AP_BoardConfig: add ability to change dshot firmware

This commit is contained in:
bugobliterator 2022-08-29 10:53:30 +05:30 committed by Andrew Tridgell
parent 6d4b5cfc1b
commit b8af6da623
2 changed files with 19 additions and 0 deletions

View File

@ -358,6 +358,16 @@ const AP_Param::GroupInfo AP_BoardConfig::var_info[] = {
// index 26 used by SER3_RTSCTS // index 26 used by SER3_RTSCTS
// index 27 used by SER4_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 AP_GROUPEND
}; };

View File

@ -92,6 +92,14 @@ public:
#endif #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 // get alternative config selection
uint8_t get_alt_config(void) { uint8_t get_alt_config(void) {
return uint8_t(_alt_config.get()); return uint8_t(_alt_config.get());
@ -218,6 +226,7 @@ private:
#endif #endif
AP_Int8 board_type; AP_Int8 board_type;
AP_Int8 io_enable; AP_Int8 io_enable;
AP_Int8 io_dshot;
} state; } state;
#if AP_SDCARD_STORAGE_ENABLED #if AP_SDCARD_STORAGE_ENABLED