mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 00:35:39 +03:00
Add battery warning beeper. Update MSP_MISC/MSP_SET_MISC.
Note the old beeper was essentially 'battery critical'.
This commit is contained in:
parent
49cf725b41
commit
367eb79bd0
12 changed files with 67 additions and 24 deletions
|
@ -161,7 +161,7 @@ void annexCode(void)
|
|||
int32_t tmp, tmp2;
|
||||
int32_t axis, prop1 = 0, prop2;
|
||||
|
||||
static uint8_t batteryWarningEnabled = false;
|
||||
static batteryState_e batteryState = BATTERY_OK;
|
||||
static uint8_t vbatTimer = 0;
|
||||
static int32_t vbatCycleTime = 0;
|
||||
|
||||
|
@ -231,7 +231,7 @@ void annexCode(void)
|
|||
|
||||
if (feature(FEATURE_VBAT)) {
|
||||
updateBatteryVoltage();
|
||||
batteryWarningEnabled = shouldSoundBatteryAlarm();
|
||||
batteryState = calculateBatteryState();
|
||||
}
|
||||
|
||||
if (feature(FEATURE_CURRENT_METER)) {
|
||||
|
@ -241,7 +241,7 @@ void annexCode(void)
|
|||
}
|
||||
}
|
||||
|
||||
beepcodeUpdateState(batteryWarningEnabled);
|
||||
beepcodeUpdateState(batteryState);
|
||||
|
||||
if (ARMING_FLAG(ARMED)) {
|
||||
LED0_ON;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue