From 262feec75cbc8b6de3b776b025b85fa534685e71 Mon Sep 17 00:00:00 2001 From: franchioping Date: Thu, 26 Mar 2026 23:19:48 +0000 Subject: [PATCH] add static cast so compiler shuts up about type conversion. add CMakeLists.txt so we can use library on esp-idf --- CMakeLists.txt | 5 +++++ src/dshot_init.cpp | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..189c7d1 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,5 @@ +idf_component_register( + SRC_DIRS "src" + INCLUDE_DIRS "." "src" + REQUIRES arduino-esp32 +) diff --git a/src/dshot_init.cpp b/src/dshot_init.cpp index 089e157..5395cb4 100644 --- a/src/dshot_init.cpp +++ b/src/dshot_init.cpp @@ -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, .trans_queue_depth = RMT_QUEUE_DEPTH, .flags = { - .invert_out = is_bidirectional ? 1 : 0, + .invert_out = static_cast(is_bidirectional ? 1 : 0), .init_level = 0}}; 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}; -} \ No newline at end of file +}