Update psm charger type

This commit is contained in:
fincs 2021-07-15 21:59:49 +02:00
parent c1640f4b54
commit 47fd18cabb
No known key found for this signature in database
GPG Key ID: 62C7609ADA219C60

View File

@ -8,7 +8,7 @@ static bool powerCacheIsCharging;
static PsmSession powerSession;
bool powerGetDetails(uint32_t *batteryCharge, bool *isCharging) {
ChargerType charger = ChargerType_None;
PsmChargerType charger = PsmChargerType_Unconnected;
bool hwReadsSucceeded = false;
bool use_cache = false;
Result rc = 0;
@ -31,7 +31,7 @@ bool powerGetDetails(uint32_t *batteryCharge, bool *isCharging) {
else {
rc = psmGetChargerType(&charger);
hwReadsSucceeded &= R_SUCCEEDED(rc);
*isCharging = (charger > ChargerType_None);
*isCharging = (charger != PsmChargerType_Unconnected);
}
powerCacheCharge = *batteryCharge;