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 Aug 30, 2024
1 parent 45dd2af commit 72cf9b0
Show file tree
Hide file tree
Showing 2 changed files with 9 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
9 changes: 8 additions & 1 deletion libraries/AP_BoardConfig/AP_BoardConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,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 +230,12 @@ class AP_BoardConfig {
}
#endif

#if HAL_WITH_IO_MCU
bool use_safety_as_led() {
return state.safety_option.get() | IO_SAFETY_PINS_AS_PROFILED;
}
#endif

private:
static AP_BoardConfig *_singleton;

Expand Down

0 comments on commit 72cf9b0

Please sign in to comment.