mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-29 11:01:15 +00:00
oops fix for esp32
This commit is contained in:
parent
2b373048c6
commit
f3b93d55fb
@ -63,13 +63,11 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
|||||||
*/
|
*/
|
||||||
virtual float getBattVoltage()
|
virtual float getBattVoltage()
|
||||||
{
|
{
|
||||||
uint32_t raw = analogRead(BATTERY_PIN);
|
|
||||||
|
|
||||||
// Tested ttgo eink nrf52 board and the reported value is perfect
|
// Tested ttgo eink nrf52 board and the reported value is perfect
|
||||||
// DEBUG_MSG("raw val %u", raw);
|
// DEBUG_MSG("raw val %u", raw);
|
||||||
return
|
return
|
||||||
#ifdef BATTERY_PIN
|
#ifdef BATTERY_PIN
|
||||||
1000.0 * 2.0 * (AREF_VOLTAGE / 1024.0) * raw;
|
1000.0 * 2.0 * (AREF_VOLTAGE / 1024.0) * analogRead(BATTERY_PIN);
|
||||||
#else
|
#else
|
||||||
NAN;
|
NAN;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user