Skip to content

Commit

Permalink
AP_Rely: allow RELAYn_DEFAULT values for DroneCAN Periphs
Browse files Browse the repository at this point in the history
  • Loading branch information
magicrub committed Nov 15, 2024
1 parent a69b777 commit 2115ad9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libraries/AP_Relay/AP_Relay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,11 @@ void AP_Relay::init()
continue;
}

if (function == AP_Relay_Params::FUNCTION::RELAY) {
bool use_default_param = (function == AP_Relay_Params::FUNCTION::RELAY);
#ifdef HAL_BUILD_AP_PERIPH
use_default_param |= (function >= AP_Relay_Params::FUNCTION::DroneCAN_HARDPOINT_0 && function <= AP_Relay_Params::FUNCTION::DroneCAN_HARDPOINT_15);
#endif
if (use_default_param) {
// relay by instance number, set the state to match our output
const AP_Relay_Params::DefaultState default_state = _params[instance].default_state;
if ((default_state == AP_Relay_Params::DefaultState::OFF) ||
Expand Down

0 comments on commit 2115ad9

Please sign in to comment.