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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -242,12 +242,7 @@ extern uint16_t adcValues[NUMBER_ANALOG];
|
||||
void adcInit(void);
|
||||
void adcRead(void);
|
||||
uint16_t getAnalogValue(uint8_t index);
|
||||
|
||||
#if defined(REV3)
|
||||
#define BATT_SCALE 120
|
||||
#else
|
||||
#define BATT_SCALE 150
|
||||
#endif
|
||||
uint16_t getBatteryVoltage(); // returns current battery voltage in 10mV steps
|
||||
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
extern "C" {
|
||||
|
||||
Reference in New Issue
Block a user