bugfix for some negative temperature conversions
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
This commit is contained in:
@ -25,4 +25,7 @@ void max1227::prepareExternallyClockedTemperatureRead(uint8_t *spiBuf, size_t &s
|
||||
sz += 25;
|
||||
}
|
||||
|
||||
float max1227::getTemperature(int16_t temp) { return static_cast<float>(temp) * 0.125; }
|
||||
float max1227::getTemperature(uint16_t raw) {
|
||||
float temp = static_cast<float>((-2048 * (raw >> 11)) + (raw & 0x7FF)) * 0.125;
|
||||
return temp;
|
||||
}
|
||||
|
Reference in New Issue
Block a user