add static cast so compiler shuts up about type conversion. add CMakeLists.txt so we can use library on esp-idf

This commit is contained in:
franchioping 2026-03-26 23:19:48 +00:00
parent 6e80e6ad3c
commit 262feec75c
2 changed files with 7 additions and 2 deletions

5
CMakeLists.txt Normal file
View File

@ -0,0 +1,5 @@
idf_component_register(
SRC_DIRS "src"
INCLUDE_DIRS "." "src"
REQUIRES arduino-esp32
)

View File

@ -18,7 +18,7 @@ dshot_result_t init_rmt_tx_channel(gpio_num_t gpio, rmt_channel_handle_t *out_ch
.mem_block_symbols = RMT_TX_BUFFER_SYMBOLS, .mem_block_symbols = RMT_TX_BUFFER_SYMBOLS,
.trans_queue_depth = RMT_QUEUE_DEPTH, .trans_queue_depth = RMT_QUEUE_DEPTH,
.flags = { .flags = {
.invert_out = is_bidirectional ? 1 : 0, .invert_out = static_cast<uint32_t>(is_bidirectional ? 1 : 0),
.init_level = 0}}; .init_level = 0}};
rmt_transmit_config_t rmt_tx_config = {}; // Initialize all members to zero rmt_transmit_config_t rmt_tx_config = {}; // Initialize all members to zero
@ -92,4 +92,4 @@ dshot_result_t init_dshot_encoder(rmt_encoder_handle_t *out_encoder, const rmt_t
} }
return {true, DSHOT_ENCODER_INIT_SUCCESS}; return {true, DSHOT_ENCODER_INIT_SUCCESS};
} }