mirror of https://github.com/ArduPilot/ardupilot
AP_BoardConfig: fix handling of AP_FEATURE_SAFETY_BUTTON
Not all PX4-based board have a safety button. Rely on HAL_HAVE_SAFETY_SWITCH instead of ifdef'ing each of them. This allows to build for aerofc-v1 without safety button.
This commit is contained in:
parent
000ae3cb85
commit
259195a7c7
|
@ -15,7 +15,7 @@
|
|||
#define AP_FEATURE_BOARD_DETECT 0
|
||||
#endif
|
||||
|
||||
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN || defined(HAL_CHIBIOS_ARCH_FMUV3) || defined(HAL_CHIBIOS_ARCH_FMUV4) || defined(HAL_CHIBIOS_ARCH_FMUV5) || defined(HAL_CHIBIOS_ARCH_MINDPXV2) || defined(HAL_GPIO_PIN_SAFETY_IN)
|
||||
#if HAL_HAVE_SAFETY_SWITCH
|
||||
#define AP_FEATURE_SAFETY_BUTTON 1
|
||||
#else
|
||||
#define AP_FEATURE_SAFETY_BUTTON 0
|
||||
|
|
|
@ -97,7 +97,7 @@ void AP_BoardConfig::px4_setup_pwm()
|
|||
*/
|
||||
void AP_BoardConfig::px4_setup_safety_mask()
|
||||
{
|
||||
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4
|
||||
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 && HAL_HAVE_SAFETY_SWITCH
|
||||
// setup channels to ignore the armed state
|
||||
int px4io_fd = open("/dev/px4io", 0);
|
||||
if (px4io_fd != -1) {
|
||||
|
|
Loading…
Reference in New Issue