Re #3371: tx battery measuring code moved to board_xxx.cpp, battery check code rewritten for ARM platforms, Horus battery calibrated.

This commit is contained in:
Damjan Adamic
2016-03-20 16:05:27 +01:00
parent 49e70dbf12
commit a3af63edad
8 changed files with 95 additions and 15 deletions
+6
View File
@@ -266,3 +266,9 @@ void checkTrainerSettings()
}
}
}
uint16_t getBatteryVoltage()
{
int32_t instant_vbat = anaIn(TX_VOLTAGE); // using filtered ADC value on purpose
return (uint16_t)((instant_vbat * (1000 + g_eeGeneral.txVoltageCalibration) ) / 1637);
}