Skip to content

Commit

Permalink
AP_BoardConfig: add option to use IO safety led switch for ProfiLED
Browse files Browse the repository at this point in the history
  • Loading branch information
bugobliterator committed Oct 15, 2024
1 parent 93646a2 commit 19b66f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libraries/AP_BoardConfig/AP_BoardConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ const AP_Param::GroupInfo AP_BoardConfig::var_info[] = {
// @Param: OPTIONS
// @DisplayName: Board options
// @Description: Board specific option flags
// @Bitmask: 0:Enable hardware watchdog, 1:Disable MAVftp, 2:Enable set of internal parameters, 3:Enable Debug Pins, 4:Unlock flash on reboot, 5:Write protect firmware flash on reboot, 6:Write protect bootloader flash on reboot, 7:Skip board validation, 8:Disable board arming gpio output change on arm/disarm
// @Bitmask: 0:Enable hardware watchdog, 1:Disable MAVftp, 2:Enable set of internal parameters, 3:Enable Debug Pins, 4:Unlock flash on reboot, 5:Write protect firmware flash on reboot, 6:Write protect bootloader flash on reboot, 7:Skip board validation, 8:Disable board arming gpio output change on arm/disarm, 9:Use safety pins as profiled
// @User: Advanced
AP_GROUPINFO("OPTIONS", 19, AP_BoardConfig, _options, HAL_BRD_OPTIONS_DEFAULT),

Expand Down
11 changes: 10 additions & 1 deletion libraries/AP_BoardConfig/AP_BoardConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include <AP_Radio/AP_Radio.h>
#endif

#include <AP_IOMCU/AP_IOMCU.h>

extern "C" typedef int (*main_fn_t)(int argc, char **);

class AP_BoardConfig {
Expand Down Expand Up @@ -158,7 +160,8 @@ class AP_BoardConfig {
WRITE_PROTECT_FLASH = (1<<5),
WRITE_PROTECT_BOOTLOADER = (1<<6),
SKIP_BOARD_VALIDATION = (1<<7),
DISABLE_ARMING_GPIO = (1<<8)
DISABLE_ARMING_GPIO = (1<<8),
IO_SAFETY_PINS_AS_PROFILED = (1<<9),
};

//return true if arming gpio output is disabled
Expand Down Expand Up @@ -229,6 +232,12 @@ class AP_BoardConfig {
}
#endif

#if HAL_WITH_IO_MCU && AP_IOMCU_PROFILED_SUPPORT_ENABLED
bool use_safety_as_led() {
return _singleton? (_singleton->_options & IO_SAFETY_PINS_AS_PROFILED) : false;
}
#endif

private:
static AP_BoardConfig *_singleton;

Expand Down

0 comments on commit 19b66f1

Please sign in to comment.