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
9
temp.c
9
temp.c
|
|
@ -250,11 +250,14 @@ static uint16_t temp_max6675_read(temp_sensor_t i) {
|
|||
|
||||
spi_deselect_max6675();
|
||||
|
||||
if ((temp & 0x8002) == 0) {
|
||||
// Got "device id".
|
||||
if ((temp & 4) == 0) {
|
||||
if ((temp & 0x4) == 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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue