mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-22 04:54:47 +00:00
trunk fmt
This commit is contained in:
parent
fbc3b2beee
commit
1398611276
@ -165,11 +165,11 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
|||||||
virtual bool isVbusIn() override
|
virtual bool isVbusIn() override
|
||||||
{
|
{
|
||||||
#ifdef EXT_PWR_DETECT
|
#ifdef EXT_PWR_DETECT
|
||||||
// if external powered that pin will be pulled up
|
// if external powered that pin will be pulled up
|
||||||
if (digitalRead(EXT_PWR_DETECT) == HIGH) {
|
if (digitalRead(EXT_PWR_DETECT) == HIGH) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// if it's not HIGH - check the battery
|
// if it's not HIGH - check the battery
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return getBattVoltage() > chargingVolt;
|
return getBattVoltage() > chargingVolt;
|
||||||
|
@ -27,8 +27,8 @@ static bool isPowered()
|
|||||||
|
|
||||||
2) If we detect USB power from the power management chip, we must be getting power externally.
|
2) If we detect USB power from the power management chip, we must be getting power externally.
|
||||||
|
|
||||||
3) On some boards we don't have the power management chip (like AXPxxxx) so we use EXT_PWR_DETECT GPIO pin to detect external power source
|
3) On some boards we don't have the power management chip (like AXPxxxx) so we use EXT_PWR_DETECT GPIO pin to detect
|
||||||
(see `isVbusIn()` in `Power.cpp`)
|
external power source (see `isVbusIn()` in `Power.cpp`)
|
||||||
*/
|
*/
|
||||||
return !isPowerSavingMode && powerStatus && (!powerStatus->getHasBattery() || powerStatus->getHasUSB());
|
return !isPowerSavingMode && powerStatus && (!powerStatus->getHasBattery() || powerStatus->getHasUSB());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user