Skip to content

Commit

Permalink
AP_Relay: check enabled relay mask for passing relay outputs to hardware
Browse files Browse the repository at this point in the history
  • Loading branch information
joshanne committed Sep 4, 2023
1 parent 3c59a70 commit 2b00f09
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libraries/AP_Relay/AP_Relay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ void AP_Relay::set(const uint8_t instance, const bool value)
_last_logged_pin_states = _pin_states;
}
#if AP_SIM_ENABLED && (CONFIG_HAL_BOARD != HAL_BOARD_SITL)
return;
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);
Expand Down

0 comments on commit 2b00f09

Please sign in to comment.