mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
AP_Relay: check enabled relay mask for passing relay outputs to hardware
This commit is contained in:
parent
8125ba1a41
commit
768e2409df
@ -156,8 +156,10 @@ void AP_Relay::set(const uint8_t instance, const bool value)
|
||||
_last_log_ms = now;
|
||||
_last_logged_pin_states = _pin_states;
|
||||
}
|
||||
#if AP_SIM_ENABLED && (CONFIG_HAL_BOARD != HAL_BOARD_SITL)
|
||||
#if AP_SIM_ENABLED
|
||||
if (!(AP::sitl()->on_hardware_relay_enable_mask & (1U << instance))) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
hal.gpio->pinMode(_pin[instance], HAL_GPIO_OUTPUT);
|
||||
hal.gpio->write(_pin[instance], value);
|
||||
|
Loading…
Reference in New Issue
Block a user