Skip to content

Commit

Permalink
Merge pull request #3168 from shellixyz/stop_battery_alarm_when_disar…
Browse files Browse the repository at this point in the history
…ming

Stop the battery alarm when disarming
  • Loading branch information
fiam committed Jun 23, 2018
2 parents a5b6d49 + e2b68f0 commit 668e075
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/main/sensors/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,16 +303,17 @@ void batteryUpdate(timeUs_t timeDelta)
}

// handle beeper
switch (batteryState) {
case BATTERY_WARNING:
beeper(BEEPER_BAT_LOW);
break;
case BATTERY_CRITICAL:
beeper(BEEPER_BAT_CRIT_LOW);
break;
default:
break;
}
if (ARMING_FLAG(ARMED) || !ARMING_FLAG(WAS_EVER_ARMED) || failsafeIsActive())
switch (batteryState) {
case BATTERY_WARNING:
beeper(BEEPER_BAT_LOW);
break;
case BATTERY_CRITICAL:
beeper(BEEPER_BAT_CRIT_LOW);
break;
default:
break;
}
}
}

Expand Down

0 comments on commit 668e075

Please sign in to comment.