Browse Source

Move shared code to wait_for_bed_heating

Scott Lahteine 4 years ago
parent
commit
7709261ea9

+ 2
- 10
Marlin/src/module/motion.cpp View File

@@ -1312,16 +1312,8 @@ void do_homing_move(const AxisEnum axis, const float distance, const feedRate_t
1312 1312
 
1313 1313
   #if HOMING_Z_WITH_PROBE && HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER)
1314 1314
     // Wait for bed to heat back up between probing points
1315
-    if (axis == Z_AXIS && distance < 0 && thermalManager.isHeatingBed()) {
1316
-      serialprintPGM(probe.msg_wait_for_bed_heating);
1317
-      #if HAS_DISPLAY
1318
-        LCD_MESSAGEPGM(MSG_BED_HEATING);
1319
-      #endif
1320
-      thermalManager.wait_for_bed();
1321
-      #if HAS_DISPLAY
1322
-        ui.reset_status();
1323
-      #endif
1324
-    }
1315
+    if (axis == Z_AXIS && distance < 0)
1316
+      thermalManager.wait_for_bed_heating();
1325 1317
   #endif
1326 1318
 
1327 1319
   // Only do some things when moving towards an endstop

+ 1
- 11
Marlin/src/module/probe.cpp View File

@@ -455,10 +455,6 @@ bool Probe::set_deployed(const bool deploy) {
455 455
  * @return true to indicate an error
456 456
  */
457 457
 
458
-#if HAS_BED_PROBE && HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER)
459
-  const char Probe::msg_wait_for_bed_heating[25] PROGMEM = "Wait for bed heating...\n";
460
-#endif
461
-
462 458
 /**
463 459
  * @brief Move down until the probe triggers or the low limit is reached
464 460
  *
@@ -473,13 +469,7 @@ bool Probe::probe_down_to_z(const float z, const feedRate_t fr_mm_s) {
473 469
   if (DEBUGGING(LEVELING)) DEBUG_POS(">>> Probe::probe_down_to_z", current_position);
474 470
 
475 471
   #if HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER)
476
-    // Wait for bed to heat back up between probing points
477
-    if (thermalManager.isHeatingBed()) {
478
-      serialprintPGM(msg_wait_for_bed_heating);
479
-      LCD_MESSAGEPGM(MSG_BED_HEATING);
480
-      thermalManager.wait_for_bed();
481
-      ui.reset_status();
482
-    }
472
+    thermalManager.wait_for_bed_heating();
483 473
   #endif
484 474
 
485 475
   #if ENABLED(BLTOUCH) && DISABLED(BLTOUCH_HS_MODE)

+ 0
- 3
Marlin/src/module/probe.h View File

@@ -87,9 +87,6 @@ public:
87 87
     static inline float probe_at_point(const xy_pos_t &pos, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true, const bool sanity_check=true) {
88 88
       return probe_at_point(pos.x, pos.y, raise_after, verbose_level, probe_relative, sanity_check);
89 89
     }
90
-    #if HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER)
91
-      static const char msg_wait_for_bed_heating[25];
92
-    #endif
93 90
 
94 91
   #else
95 92
 

+ 9
- 0
Marlin/src/module/temperature.cpp View File

@@ -3361,6 +3361,15 @@ void Temperature::tick() {
3361 3361
       return wait_for_heatup;
3362 3362
     }
3363 3363
 
3364
+    void Temperature::wait_for_bed_heating() {
3365
+      if (isHeatingBed()) {
3366
+        SERIAL_ECHOLNPGM("Wait for bed heating...");
3367
+        LCD_MESSAGEPGM(MSG_BED_HEATING);
3368
+        wait_for_bed();
3369
+        ui.reset_status();
3370
+      }
3371
+    }
3372
+
3364 3373
   #endif // HAS_HEATED_BED
3365 3374
 
3366 3375
   #if HAS_HEATED_CHAMBER

+ 2
- 0
Marlin/src/module/temperature.h View File

@@ -701,6 +701,8 @@ class Temperature {
701 701
         #endif
702 702
       );
703 703
 
704
+      static void wait_for_bed_heating();
705
+
704 706
     #endif // HAS_HEATED_BED
705 707
 
706 708
     #if HAS_TEMP_PROBE

Loading…
Cancel
Save