Browse Source

Handle MAX31855 error conditions

Scott Lahteine 8 years ago
parent
commit
149b8d9e4b
1 changed files with 15 additions and 1 deletions
  1. 15
    1
      Marlin/temperature.cpp

+ 15
- 1
Marlin/temperature.cpp View File

1333
 
1333
 
1334
     WRITE(MAX6675_SS, 1); // disable TT_MAX6675
1334
     WRITE(MAX6675_SS, 1); // disable TT_MAX6675
1335
 
1335
 
1336
-    if (max6675_temp & MAX6675_ERROR_MASK)
1336
+    if (max6675_temp & MAX6675_ERROR_MASK) {
1337
+      SERIAL_ERROR_START;
1338
+      SERIAL_ERRORPGM("Temp measurement error! ");
1339
+      #if MAX6675_ERROR_MASK == 7
1340
+        SERIAL_ERRORPGM("MAX31855 ");
1341
+        if (max6675_temp & 1)
1342
+          SERIAL_ERRORLNPGM("Open Circuit");
1343
+        else if (max6675_temp & 2)
1344
+          SERIAL_ERRORLNPGM("Short to GND");
1345
+        else if (max6675_temp & 4)
1346
+          SERIAL_ERRORLNPGM("Short to VCC");
1347
+      #else
1348
+        SERIAL_ERRORLNPGM("MAX6675");
1349
+      #endif
1337
       max6675_temp = 4000; // thermocouple open
1350
       max6675_temp = 4000; // thermocouple open
1351
+    }
1338
     else
1352
     else
1339
       max6675_temp >>= MAX6675_DISCARD_BITS;
1353
       max6675_temp >>= MAX6675_DISCARD_BITS;
1340
 
1354
 

Loading…
Cancel
Save