mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_BoardConfig: add option to use IO safety led switch for ProfiLED
This commit is contained in:
parent
646e09ebaa
commit
ca9713b275
@ -281,7 +281,7 @@ const AP_Param::GroupInfo AP_BoardConfig::var_info[] = {
|
|||||||
// @Param: OPTIONS
|
// @Param: OPTIONS
|
||||||
// @DisplayName: Board options
|
// @DisplayName: Board options
|
||||||
// @Description: Board specific option flags
|
// @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
|
// @User: Advanced
|
||||||
AP_GROUPINFO("OPTIONS", 19, AP_BoardConfig, _options, HAL_BRD_OPTIONS_DEFAULT),
|
AP_GROUPINFO("OPTIONS", 19, AP_BoardConfig, _options, HAL_BRD_OPTIONS_DEFAULT),
|
||||||
|
|
||||||
|
@ -158,7 +158,8 @@ public:
|
|||||||
WRITE_PROTECT_FLASH = (1<<5),
|
WRITE_PROTECT_FLASH = (1<<5),
|
||||||
WRITE_PROTECT_BOOTLOADER = (1<<6),
|
WRITE_PROTECT_BOOTLOADER = (1<<6),
|
||||||
SKIP_BOARD_VALIDATION = (1<<7),
|
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
|
//return true if arming gpio output is disabled
|
||||||
@ -200,6 +201,12 @@ public:
|
|||||||
return _singleton?(_singleton->_options & ALLOW_SET_INTERNAL_PARM)!=0:false;
|
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
|
// handle press of safety button. Return true if safety state
|
||||||
// should be toggled
|
// should be toggled
|
||||||
bool safety_button_handle_pressed(uint8_t press_count);
|
bool safety_button_handle_pressed(uint8_t press_count);
|
||||||
|
Loading…
Reference in New Issue
Block a user