AP_BoardConfig: add option to use IO safety led switch for ProfiLED

This commit is contained in:
bugobliterator 2024-09-17 15:26:09 +10:00 committed by Andrew Tridgell
parent 646e09ebaa
commit ca9713b275
2 changed files with 9 additions and 2 deletions

View File

@ -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),

View File

@ -158,7 +158,8 @@ public:
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
@ -200,6 +201,12 @@ public:
return _singleton?(_singleton->_options & ALLOW_SET_INTERNAL_PARM)!=0:false;
}
#if HAL_WITH_IO_MCU
static bool use_safety_as_led(void) {
return _singleton?(_singleton->_options & IO_SAFETY_PINS_AS_PROFILED)!=0:false;
}
#endif
// handle press of safety button. Return true if safety state
// should be toggled
bool safety_button_handle_pressed(uint8_t press_count);