boards: new ARK FPV FC (#23830)

* add new payload power switch (RC_MAP_PAY_SW)
This commit is contained in:
Alex Klimaj
2024-10-30 09:35:35 -06:00
committed by GitHub
parent 951c981d94
commit 4d1c65d722
40 changed files with 3925 additions and 1 deletions
+8
View File
@@ -57,6 +57,7 @@ static bool operator ==(const manual_control_switches_s &a, const manual_control
a.gear_switch == b.gear_switch &&
a.photo_switch == b.photo_switch &&
a.video_switch == b.video_switch &&
a.payload_power_switch == b.payload_power_switch &&
a.engage_main_motor_switch == b.engage_main_motor_switch);
}
@@ -219,6 +220,8 @@ void RCUpdate::update_rc_functions()
_rc.function[rc_channels_s::FUNCTION_AUX_5] = _param_rc_map_aux5.get() - 1;
_rc.function[rc_channels_s::FUNCTION_AUX_6] = _param_rc_map_aux6.get() - 1;
_rc.function[rc_channels_s::FUNCTION_PAYLOAD_POWER] = _param_rc_map_payload_sw.get() - 1;
for (int i = 0; i < rc_parameter_map_s::RC_PARAM_MAP_NCHAN; i++) {
_rc.function[rc_channels_s::FUNCTION_PARAM_1 + i] = _parameters.rc_map_param[i] - 1;
}
@@ -616,6 +619,11 @@ void RCUpdate::UpdateManualSwitches(const hrt_abstime &timestamp_sample)
switches.video_switch = getRCSwitchOnOffPosition(rc_channels_s::FUNCTION_AUX_4, 0.5f);
#endif
#if defined(PAYLOAD_POWER_EN)
switches.payload_power_switch = getRCSwitchOnOffPosition(rc_channels_s::FUNCTION_PAYLOAD_POWER,
_param_rc_payload_th.get());
#endif
// last 2 switch updates identical within 1 second (simple protection from bad RC data)
if ((switches == _manual_switches_previous)
&& (switches.timestamp_sample < _manual_switches_previous.timestamp_sample + VALID_DATA_MIN_INTERVAL_US)) {