Fixed negative temp and voltage numbers

This commit is contained in:
nedko 2022-11-09 12:11:34 +02:00
parent 6cd14efd0c
commit ea4d2017a4

View File

@ -1415,7 +1415,7 @@ int8_t read_battery(int16_t *mAh, int16_t *mV, int16_t *temp)
// If bit 11 is set // If bit 11 is set
if (val & 0x00000800) if (val & 0x00000800)
{ {
val -= 2048; val -= 4096;
} }
// Transform into mV // Transform into mV
@ -1431,7 +1431,7 @@ int8_t read_battery(int16_t *mAh, int16_t *mV, int16_t *temp)
// If bit 11 is set // If bit 11 is set
if (val & 0x00000800) if (val & 0x00000800)
{ {
val -= 2048; val -= 4096;
} }
// Transform into temp // Transform into temp