mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 01:35:41 +03:00
Battery auto-detect and LPF for battery monitoring
This commit is contained in:
parent
26ac6115e7
commit
942c89237e
10 changed files with 268 additions and 69 deletions
|
@ -217,9 +217,12 @@ static bool shouldTriggerBatteryAlarmNow(void)
|
|||
|
||||
static inline void updateAlarmBatteryStatus(HOTT_EAM_MSG_t *hottEAMMessage)
|
||||
{
|
||||
batteryState_e batteryState;
|
||||
|
||||
if (shouldTriggerBatteryAlarmNow()){
|
||||
lastHottAlarmSoundTime = millis();
|
||||
if (vbat <= batteryWarningVoltage){
|
||||
batteryState = getBatteryState();
|
||||
if (batteryState == BATTERY_WARNING || batteryState == BATTERY_CRITICAL){
|
||||
hottEAMMessage->warning_beeps = 0x10;
|
||||
hottEAMMessage->alarm_invers1 = HOTT_EAM_ALARM1_FLAG_BATTERY_1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue