Fixed negative temp and voltage numbers
This commit is contained in:
parent
6cd14efd0c
commit
ea4d2017a4
@ -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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user