Browse Source

Merge pull request #6638 from bgort/silentprobing2

Cleanup previous implementation of new quiet probing
bgort 7 years ago
parent
commit
83b6bc8e05
2 changed files with 8 additions and 22 deletions
  1. 5
    13
      Marlin/Marlin_main.cpp
  2. 3
    9
      Marlin/temperature.cpp

+ 5
- 13
Marlin/Marlin_main.cpp View File

2058
 
2058
 
2059
 #if ENABLED(PROBING_FANS_OFF)
2059
 #if ENABLED(PROBING_FANS_OFF)
2060
   void fans_pause(bool p) {
2060
   void fans_pause(bool p) {
2061
-    if (p && fans_paused) { // If called out of order something is wrong
2061
+    if (p == fans_paused) { // If called out of order something is wrong
2062
       SERIAL_ERROR_START;
2062
       SERIAL_ERROR_START;
2063
-      SERIAL_ERRORLNPGM("Fans already paused!");
2063
+      serialprintPGM(fans_paused ? PSTR("Fans already paused!") : PSTR("Fans already unpaused!"));
2064
       return;
2064
       return;
2065
     }
2065
     }
2066
 
2066
 
2067
-    if (!p && !fans_paused) {
2068
-      SERIAL_ERROR_START;
2069
-      SERIAL_ERRORLNPGM("Fans already unpaused!");
2070
-      return;
2071
-    }
2072
-
2073
-    if (p) {
2067
+    if (p)
2074
       for (uint8_t x = 0;x < FAN_COUNT;x++) {
2068
       for (uint8_t x = 0;x < FAN_COUNT;x++) {
2075
         paused_fanSpeeds[x] = fanSpeeds[x];
2069
         paused_fanSpeeds[x] = fanSpeeds[x];
2076
         fanSpeeds[x] = 0;
2070
         fanSpeeds[x] = 0;
2077
       }
2071
       }
2078
-    }
2079
-    else {
2072
+    else
2080
       for (uint8_t x = 0;x < FAN_COUNT;x++)
2073
       for (uint8_t x = 0;x < FAN_COUNT;x++)
2081
         fanSpeeds[x] = paused_fanSpeeds[x];
2074
         fanSpeeds[x] = paused_fanSpeeds[x];
2082
-    }
2083
 
2075
 
2084
     fans_paused = p;
2076
     fans_paused = p;
2085
   }
2077
   }
2086
-#endif
2078
+#endif // PROBING_FANS_OFF
2087
 
2079
 
2088
 #if HAS_BED_PROBE
2080
 #if HAS_BED_PROBE
2089
 
2081
 

+ 3
- 9
Marlin/temperature.cpp View File

1358
 
1358
 
1359
 #if ENABLED(PROBING_HEATERS_OFF)
1359
 #if ENABLED(PROBING_HEATERS_OFF)
1360
   void Temperature::pause(bool p) {
1360
   void Temperature::pause(bool p) {
1361
-    if (p && paused) { // If called out of order something is wrong
1361
+    if (p == paused) { // If called out of order something is wrong
1362
       SERIAL_ERROR_START;
1362
       SERIAL_ERROR_START;
1363
-      SERIAL_ERRORLNPGM("Heaters already paused!");
1364
-      return;
1365
-    }
1366
-
1367
-    if (!p && !paused) {
1368
-      SERIAL_ERROR_START;
1369
-      SERIAL_ERRORLNPGM("Heaters already unpaused!");
1363
+      serialprintPGM(paused ? PSTR("Heaters already paused!") : PSTR("Heaters already unpaused!"));
1370
       return;
1364
       return;
1371
     }
1365
     }
1372
 
1366
 
1393
   bool Temperature::ispaused() {
1387
   bool Temperature::ispaused() {
1394
     return paused;
1388
     return paused;
1395
   }
1389
   }
1396
-#endif
1390
+#endif // PROBING_HEATERS_OFF
1397
 
1391
 
1398
 #if ENABLED(HEATER_0_USES_MAX6675)
1392
 #if ENABLED(HEATER_0_USES_MAX6675)
1399
 
1393
 

Loading…
Cancel
Save