Skip to content

Commit

Permalink
AP_ICEngine: fixed SITL ICE control
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Jul 12, 2023
1 parent e60e08f commit 0c423a0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libraries/AP_ICEngine/AP_ICEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,18 +321,24 @@ void AP_ICEngine::update(void)
/* now set output channels */
switch (state) {
case ICE_OFF:
SRV_Channels::set_output_pwm(SRV_Channel::k_ignition, pwm_ignition_off);
SRV_Channels::set_output_pwm(SRV_Channel::k_starter, pwm_starter_off);
control_ign_str(IGN_OFF_STR_OFF);
ignition_relay_set(false);
starter_start_time_ms = 0;
break;

case ICE_START_HEIGHT_DELAY:
case ICE_START_DELAY:
SRV_Channels::set_output_pwm(SRV_Channel::k_ignition, pwm_ignition_on);
SRV_Channels::set_output_pwm(SRV_Channel::k_starter, pwm_starter_off);
control_ign_str(IGN_ON_STR_OFF);
ignition_relay_set(false);
break;

case ICE_STARTING:
SRV_Channels::set_output_pwm(SRV_Channel::k_ignition, pwm_ignition_on);
SRV_Channels::set_output_pwm(SRV_Channel::k_starter, pwm_starter_on);
if (!(hal.util->get_soft_armed() || allow_throttle_disarmed())) {
control_ign_str(IGN_ON_STR_OFF);
ignition_relay_set(false);
Expand All @@ -348,6 +354,8 @@ void AP_ICEngine::update(void)
break;

case ICE_RUNNING:
SRV_Channels::set_output_pwm(SRV_Channel::k_ignition, pwm_ignition_on);
SRV_Channels::set_output_pwm(SRV_Channel::k_starter, pwm_starter_off);
control_ign_str(IGN_ON_STR_OFF);
ignition_relay_set(true);
starter_start_time_ms = 0;
Expand Down

0 comments on commit 0c423a0

Please sign in to comment.