From b8af6da62315d9cbd0b243f9c35bc3924905467f Mon Sep 17 00:00:00 2001 From: bugobliterator Date: Mon, 29 Aug 2022 10:53:30 +0530 Subject: [PATCH] AP_BoardConfig: add ability to change dshot firmware --- libraries/AP_BoardConfig/AP_BoardConfig.cpp | 10 ++++++++++ libraries/AP_BoardConfig/AP_BoardConfig.h | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/libraries/AP_BoardConfig/AP_BoardConfig.cpp b/libraries/AP_BoardConfig/AP_BoardConfig.cpp index 4d3b377e2a..6e14d33512 100644 --- a/libraries/AP_BoardConfig/AP_BoardConfig.cpp +++ b/libraries/AP_BoardConfig/AP_BoardConfig.cpp @@ -358,6 +358,16 @@ const AP_Param::GroupInfo AP_BoardConfig::var_info[] = { // index 26 used by SER3_RTSCTS // index 27 used by SER4_RTSCTS + +#if HAL_WITH_IO_MCU + // @Param: IO_DSHOT + // @DisplayName: Load DShot FW on IO + // @Description: This loads the DShot firmware on the IO co-processor + // @Values: 0:StandardFW,1:DshotFW + // @RebootRequired: True + // @User: Advanced + AP_GROUPINFO("IO_DSHOT", 25, AP_BoardConfig, state.io_dshot, 0), +#endif AP_GROUPEND }; diff --git a/libraries/AP_BoardConfig/AP_BoardConfig.h b/libraries/AP_BoardConfig/AP_BoardConfig.h index 60e97cfbf1..ffb8092f65 100644 --- a/libraries/AP_BoardConfig/AP_BoardConfig.h +++ b/libraries/AP_BoardConfig/AP_BoardConfig.h @@ -92,6 +92,14 @@ public: #endif } + static bool io_dshot(void) { +#if HAL_WITH_IO_MCU + return _singleton?_singleton->state.io_dshot.get():false; +#else + return false; +#endif + } + // get alternative config selection uint8_t get_alt_config(void) { return uint8_t(_alt_config.get()); @@ -218,6 +226,7 @@ private: #endif AP_Int8 board_type; AP_Int8 io_enable; + AP_Int8 io_dshot; } state; #if AP_SDCARD_STORAGE_ENABLED