MAX6675: change evaluation of spi result
https://cdn-shop.adafruit.com/datasheets/MAX6675.pdf When thermocouple is open (bit2), we send a "not ready", reset active and hopefully we get a result next time.
This commit is contained in:
parent
bcb6964ceb
commit
e7dce1817b
13
temp.c
13
temp.c
|
|
@ -250,11 +250,14 @@ static uint16_t temp_max6675_read(temp_sensor_t i) {
|
||||||
|
|
||||||
spi_deselect_max6675();
|
spi_deselect_max6675();
|
||||||
|
|
||||||
if ((temp & 0x8002) == 0) {
|
if ((temp & 0x4) == 0) {
|
||||||
// Got "device id".
|
temp = temp >> 3;
|
||||||
if ((temp & 4) == 0) {
|
}
|
||||||
temp = temp >> 3;
|
else {
|
||||||
}
|
// thermocouple open, send "not ready"
|
||||||
|
temp = TEMP_NOT_READY;
|
||||||
|
// and we will read it next time.
|
||||||
|
temp_sensors_runtime[i].active = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return temp;
|
return temp;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue