pull/2400/head
Thomas Göttgens 2023-04-02 10:34:31 +02:00
rodzic fbc3b2beee
commit 1398611276
2 zmienionych plików z 7 dodań i 7 usunięć

Wyświetl plik

@ -165,11 +165,11 @@ class AnalogBatteryLevel : public HasBatteryLevel
virtual bool isVbusIn() override
{
#ifdef EXT_PWR_DETECT
// if external powered that pin will be pulled up
if (digitalRead(EXT_PWR_DETECT) == HIGH) {
return true;
}
// if it's not HIGH - check the battery
// if external powered that pin will be pulled up
if (digitalRead(EXT_PWR_DETECT) == HIGH) {
return true;
}
// if it's not HIGH - check the battery
#endif
return getBattVoltage() > chargingVolt;

Wyświetl plik

@ -27,8 +27,8 @@ static bool isPowered()
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
(see `isVbusIn()` in `Power.cpp`)
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 (see `isVbusIn()` in `Power.cpp`)
*/
return !isPowerSavingMode && powerStatus && (!powerStatus->getHasBattery() || powerStatus->getHasUSB());
}