Kaynağa Gözat

Allow G26 to use the active extruder (#12387)

* Make lcd_quick_feedback argument optional
* Add click_to_cancel option to wait_for_hotend/bed
* Have G26 use the active nozzle and wait_for_hotend/bed
* Use wait_for_release in UBL G29
* Add 'T' parameter to G26 for an initial tool-change
Scott Lahteine 6 yıl önce
ebeveyn
işleme
6093df11dc
No account linked to committer's email address

+ 17
- 19
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp Dosyayı Görüntüle

630
 
630
 
631
     #if HAS_LCD_MENU
631
     #if HAS_LCD_MENU
632
       lcd_reset_alert_level();
632
       lcd_reset_alert_level();
633
-      lcd_quick_feedback(true);
633
+      lcd_quick_feedback();
634
       lcd_reset_status();
634
       lcd_reset_status();
635
       lcd_external_control = false;
635
       lcd_external_control = false;
636
     #endif
636
     #endif
689
 
689
 
690
     bool click_and_hold(const clickFunc_t func=NULL) {
690
     bool click_and_hold(const clickFunc_t func=NULL) {
691
       if (is_lcd_clicked()) {
691
       if (is_lcd_clicked()) {
692
-        lcd_quick_feedback(false); // Do NOT clear button status!  If cleared, the code
693
-                                   // code can not look for a 'click and hold'
692
+        lcd_quick_feedback(false);                // Preserve button state for click-and-hold
694
         const millis_t nxt = millis() + 1500UL;
693
         const millis_t nxt = millis() + 1500UL;
695
         while (is_lcd_clicked()) {                // Loop while the encoder is pressed. Uses hardware flag!
694
         while (is_lcd_clicked()) {                // Loop while the encoder is pressed. Uses hardware flag!
696
           idle();                                 // idle, of course
695
           idle();                                 // idle, of course
697
           if (ELAPSED(millis(), nxt)) {           // After 1.5 seconds
696
           if (ELAPSED(millis(), nxt)) {           // After 1.5 seconds
698
-            lcd_quick_feedback(true);
697
+            lcd_quick_feedback();
699
             if (func) (*func)();
698
             if (func) (*func)();
700
             wait_for_release();
699
             wait_for_release();
701
-            safe_delay(50);                       // Debounce the Encoder wheel
702
             return true;
700
             return true;
703
           }
701
           }
704
         }
702
         }
721
         lcd_external_control = true;
719
         lcd_external_control = true;
722
       #endif
720
       #endif
723
 
721
 
724
-      save_ubl_active_state_and_disable();   // we don't do bed level correction because we want the raw data when we probe
722
+      save_ubl_active_state_and_disable();   // No bed level correction so only raw data is obtained
725
       DEPLOY_PROBE();
723
       DEPLOY_PROBE();
726
 
724
 
727
       uint16_t count = GRID_MAX_POINTS;
725
       uint16_t count = GRID_MAX_POINTS;
731
 
729
 
732
         #if HAS_LCD_MENU
730
         #if HAS_LCD_MENU
733
           if (is_lcd_clicked()) {
731
           if (is_lcd_clicked()) {
732
+            lcd_quick_feedback(false); // Preserve button state for click-and-hold
734
             SERIAL_PROTOCOLLNPGM("\nMesh only partially populated.\n");
733
             SERIAL_PROTOCOLLNPGM("\nMesh only partially populated.\n");
735
-            lcd_quick_feedback(false);
736
             STOW_PROBE();
734
             STOW_PROBE();
737
-            while (is_lcd_clicked()) idle();
735
+            wait_for_release();
736
+            lcd_quick_feedback();
738
             lcd_external_control = false;
737
             lcd_external_control = false;
739
             restore_ubl_active_state_and_leave();
738
             restore_ubl_active_state_and_leave();
740
-            lcd_quick_feedback(true);
741
-            safe_delay(50);  // Debounce the Encoder wheel
742
             return;
739
             return;
743
           }
740
           }
744
         #endif
741
         #endif
843
       do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE);
840
       do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE);
844
       lcd_external_control = false;
841
       lcd_external_control = false;
845
       KEEPALIVE_STATE(IN_HANDLER);
842
       KEEPALIVE_STATE(IN_HANDLER);
846
-      lcd_quick_feedback(true);
843
+      lcd_quick_feedback();
847
       ubl.restore_ubl_active_state_and_leave();
844
       ubl.restore_ubl_active_state_and_leave();
848
     }
845
     }
849
 
846
 
910
     }
907
     }
911
   #endif // HAS_LCD_MENU
908
   #endif // HAS_LCD_MENU
912
 
909
 
910
+  inline void set_message_with_feedback(PGM_P const msg_P) {
911
+    lcd_setstatusPGM(msg_P);
912
+    lcd_quick_feedback();
913
+  }
914
+
913
   bool unified_bed_leveling::g29_parameter_parsing() {
915
   bool unified_bed_leveling::g29_parameter_parsing() {
914
     bool err_flag = false;
916
     bool err_flag = false;
915
 
917
 
916
     #if HAS_LCD_MENU
918
     #if HAS_LCD_MENU
917
-      LCD_MESSAGEPGM(MSG_UBL_DOING_G29);
918
-      lcd_quick_feedback(true);
919
+      set_message_with_feedback(PSTR(MSG_UBL_DOING_G29));
919
     #endif
920
     #endif
920
 
921
 
921
     g29_constant = 0;
922
     g29_constant = 0;
1037
       if (ubl_state_recursion_chk != 1) {
1038
       if (ubl_state_recursion_chk != 1) {
1038
         SERIAL_ECHOLNPGM("save_ubl_active_state_and_disabled() called multiple times in a row.");
1039
         SERIAL_ECHOLNPGM("save_ubl_active_state_and_disabled() called multiple times in a row.");
1039
         #if HAS_LCD_MENU
1040
         #if HAS_LCD_MENU
1040
-          LCD_MESSAGEPGM(MSG_UBL_SAVE_ERROR);
1041
-          lcd_quick_feedback(true);
1041
+          set_message_with_feedback(PSTR(MSG_UBL_SAVE_ERROR));
1042
         #endif
1042
         #endif
1043
         return;
1043
         return;
1044
       }
1044
       }
1052
       if (--ubl_state_recursion_chk) {
1052
       if (--ubl_state_recursion_chk) {
1053
         SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times.");
1053
         SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times.");
1054
         #if HAS_LCD_MENU
1054
         #if HAS_LCD_MENU
1055
-          LCD_MESSAGEPGM(MSG_UBL_RESTORE_ERROR);
1056
-          lcd_quick_feedback(true);
1055
+          set_message_with_feedback(PSTR(MSG_UBL_RESTORE_ERROR));
1057
         #endif
1056
         #endif
1058
         return;
1057
         return;
1059
       }
1058
       }
1344
     void abort_fine_tune() {
1343
     void abort_fine_tune() {
1345
       lcd_return_to_status();
1344
       lcd_return_to_status();
1346
       do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
1345
       do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
1347
-      LCD_MESSAGEPGM(MSG_EDITING_STOPPED);
1348
-      lcd_quick_feedback(true);
1346
+      set_message_with_feedback(PSTR(MSG_EDITING_STOPPED));
1349
     }
1347
     }
1350
 
1348
 
1351
     void unified_bed_leveling::fine_tune_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map) {
1349
     void unified_bed_leveling::fine_tune_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map) {

+ 42
- 50
Marlin/src/gcode/bedlevel/G26.cpp Dosyayı Görüntüle

38
 #include "../../module/planner.h"
38
 #include "../../module/planner.h"
39
 #include "../../module/stepper.h"
39
 #include "../../module/stepper.h"
40
 #include "../../module/motion.h"
40
 #include "../../module/motion.h"
41
+#include "../../module/tool_change.h"
41
 #include "../../module/temperature.h"
42
 #include "../../module/temperature.h"
42
 #include "../../lcd/ultralcd.h"
43
 #include "../../lcd/ultralcd.h"
43
 
44
 
165
     if (!is_lcd_clicked()) return false; // Return if the button isn't pressed
166
     if (!is_lcd_clicked()) return false; // Return if the button isn't pressed
166
     lcd_setstatusPGM(PSTR("Mesh Validation Stopped."), 99);
167
     lcd_setstatusPGM(PSTR("Mesh Validation Stopped."), 99);
167
     #if HAS_LCD_MENU
168
     #if HAS_LCD_MENU
168
-      lcd_quick_feedback(true);
169
+      lcd_quick_feedback();
169
     #endif
170
     #endif
170
     wait_for_release();
171
     wait_for_release();
171
     return true;
172
     return true;
172
   }
173
   }
173
 
174
 
174
-  bool exit_from_g26() {
175
-    lcd_setstatusPGM(PSTR("Leaving G26"), -1);
176
-    wait_for_release();
177
-    return G26_ERR;
178
-  }
179
-
180
 #endif
175
 #endif
181
 
176
 
182
 mesh_index_pair find_closest_circle_to_print(const float &X, const float &Y) {
177
 mesh_index_pair find_closest_circle_to_print(const float &X, const float &Y) {
412
  * wait for them to get up to temperature.
407
  * wait for them to get up to temperature.
413
  */
408
  */
414
 inline bool turn_on_heaters() {
409
 inline bool turn_on_heaters() {
415
-  millis_t next = millis() + 5000UL;
410
+
411
+  SERIAL_ECHOLNPGM("Waiting for heatup.");
412
+
416
   #if HAS_HEATED_BED
413
   #if HAS_HEATED_BED
417
-    #if ENABLED(ULTRA_LCD)
418
-      if (g26_bed_temp > 25) {
414
+
415
+    if (g26_bed_temp > 25) {
416
+      #if ENABLED(ULTRA_LCD)
419
         lcd_setstatusPGM(PSTR("G26 Heating Bed."), 99);
417
         lcd_setstatusPGM(PSTR("G26 Heating Bed."), 99);
420
-        lcd_quick_feedback(true);
418
+        lcd_quick_feedback();
421
         #if HAS_LCD_MENU
419
         #if HAS_LCD_MENU
422
           lcd_external_control = true;
420
           lcd_external_control = true;
423
         #endif
421
         #endif
424
-    #endif
425
-        thermalManager.setTargetBed(g26_bed_temp);
426
-        while (ABS(thermalManager.degBed() - g26_bed_temp) > 3) {
422
+      #endif
423
+      thermalManager.setTargetBed(g26_bed_temp);
427
 
424
 
428
-          #if HAS_LCD_MENU
429
-            if (is_lcd_clicked()) return exit_from_g26();
425
+      // Wait for the temperature to stabilize
426
+      if (!thermalManager.wait_for_bed(true
427
+          #if G26_CLICK_CAN_CANCEL
428
+            , true
430
           #endif
429
           #endif
430
+        )
431
+      ) return G26_ERR;
432
+    }
431
 
433
 
432
-          if (ELAPSED(millis(), next)) {
433
-            next = millis() + 5000UL;
434
-            thermalManager.print_heaterstates();
435
-            SERIAL_EOL();
436
-          }
437
-          idle();
438
-          SERIAL_FLUSH(); // Prevent host M105 buffer overrun.
439
-        }
440
-    #if ENABLED(ULTRA_LCD)
441
-      }
442
-      lcd_setstatusPGM(PSTR("G26 Heating Nozzle."), 99);
443
-      lcd_quick_feedback(true);
444
-    #endif
445
-  #endif
446
-
447
-  // Start heating the nozzle and wait for it to reach temperature.
448
-  thermalManager.setTargetHotend(g26_hotend_temp, 0);
449
-  while (ABS(thermalManager.degHotend(0) - g26_hotend_temp) > 3) {
434
+  #endif // HAS_HEATED_BED
450
 
435
 
451
-    #if HAS_LCD_MENU
452
-      if (is_lcd_clicked()) return exit_from_g26();
453
-    #endif
436
+  // Start heating the active nozzle
437
+  #if ENABLED(ULTRA_LCD)
438
+    lcd_setstatusPGM(PSTR("G26 Heating Nozzle."), 99);
439
+    lcd_quick_feedback();
440
+  #endif
441
+  thermalManager.setTargetHotend(g26_hotend_temp, active_extruder);
454
 
442
 
455
-    if (ELAPSED(millis(), next)) {
456
-      next = millis() + 5000UL;
457
-      thermalManager.print_heaterstates();
458
-      SERIAL_EOL();
459
-    }
460
-    idle();
461
-    SERIAL_FLUSH(); // Prevent host M105 buffer overrun.
462
-  }
443
+  // Wait for the temperature to stabilize
444
+  if (!thermalManager.wait_for_hotend(active_extruder, true
445
+      #if G26_CLICK_CAN_CANCEL
446
+        , true
447
+      #endif
448
+    )
449
+  ) return G26_ERR;
463
 
450
 
464
   #if ENABLED(ULTRA_LCD)
451
   #if ENABLED(ULTRA_LCD)
465
     lcd_reset_status();
452
     lcd_reset_status();
466
-    lcd_quick_feedback(true);
453
+    lcd_quick_feedback();
467
   #endif
454
   #endif
468
 
455
 
469
   return G26_OK;
456
   return G26_OK;
507
       wait_for_release();
494
       wait_for_release();
508
 
495
 
509
       lcd_setstatusPGM(PSTR("Done Priming"), 99);
496
       lcd_setstatusPGM(PSTR("Done Priming"), 99);
510
-      lcd_quick_feedback(true);
497
+      lcd_quick_feedback();
511
       lcd_external_control = false;
498
       lcd_external_control = false;
512
     }
499
     }
513
     else
500
     else
515
   {
502
   {
516
     #if ENABLED(ULTRA_LCD)
503
     #if ENABLED(ULTRA_LCD)
517
       lcd_setstatusPGM(PSTR("Fixed Length Prime."), 99);
504
       lcd_setstatusPGM(PSTR("Fixed Length Prime."), 99);
518
-      lcd_quick_feedback(true);
505
+      lcd_quick_feedback();
519
     #endif
506
     #endif
520
     set_destination_from_current();
507
     set_destination_from_current();
521
     destination[E_AXIS] += g26_prime_length;
508
     destination[E_AXIS] += g26_prime_length;
553
  *  Q  Retraction multiplier
540
  *  Q  Retraction multiplier
554
  *  R  Repetitions (number of grid points)
541
  *  R  Repetitions (number of grid points)
555
  *  S  Nozzle Size (diameter) in mm
542
  *  S  Nozzle Size (diameter) in mm
543
+ *  T  Tool index to change to, if included
556
  *  U  Random deviation (50 if no value given)
544
  *  U  Random deviation (50 if no value given)
557
  *  X  X position
545
  *  X  X position
558
  *  Y  Y position
546
  *  Y  Y position
559
  */
547
  */
560
 void GcodeSuite::G26() {
548
 void GcodeSuite::G26() {
561
-  SERIAL_ECHOLNPGM("G26 command started. Waiting for heater(s).");
549
+  SERIAL_ECHOLNPGM("G26 starting...");
562
 
550
 
563
   // Don't allow Mesh Validation without homing first,
551
   // Don't allow Mesh Validation without homing first,
564
   // or if the parameter parsing did not go OK, abort
552
   // or if the parameter parsing did not go OK, abort
565
   if (axis_unhomed_error()) return;
553
   if (axis_unhomed_error()) return;
566
 
554
 
555
+  // Change the tool first, if specified
556
+  if (parser.seenval('T')) tool_change(parser.value_int());
557
+
567
   g26_extrusion_multiplier    = EXTRUSION_MULTIPLIER;
558
   g26_extrusion_multiplier    = EXTRUSION_MULTIPLIER;
568
   g26_retraction_multiplier   = RETRACTION_MULTIPLIER;
559
   g26_retraction_multiplier   = RETRACTION_MULTIPLIER;
569
   g26_layer_height            = MESH_TEST_LAYER_HEIGHT;
560
   g26_layer_height            = MESH_TEST_LAYER_HEIGHT;
891
 
882
 
892
   LEAVE:
883
   LEAVE:
893
   lcd_setstatusPGM(PSTR("Leaving G26"), -1);
884
   lcd_setstatusPGM(PSTR("Leaving G26"), -1);
885
+  wait_for_release();
894
 
886
 
895
   retract_filament(destination);
887
   retract_filament(destination);
896
   destination[Z_AXIS] = Z_CLEARANCE_BETWEEN_PROBES;
888
   destination[Z_AXIS] = Z_CLEARANCE_BETWEEN_PROBES;
914
     #if HAS_HEATED_BED
906
     #if HAS_HEATED_BED
915
       thermalManager.setTargetBed(0);
907
       thermalManager.setTargetBed(0);
916
     #endif
908
     #endif
917
-    thermalManager.setTargetHotend(0, 0);
909
+    thermalManager.setTargetHotend(active_extruder, 0);
918
   }
910
   }
919
 }
911
 }
920
 
912
 

+ 0
- 1
Marlin/src/lcd/menu/menu.h Dosyayı Görüntüle

30
 constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP);
30
 constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP);
31
 
31
 
32
 void scroll_screen(const uint8_t limit, const bool is_menu);
32
 void scroll_screen(const uint8_t limit, const bool is_menu);
33
-bool use_click();
34
 bool printer_busy();
33
 bool printer_busy();
35
 void lcd_completion_feedback(const bool good=true);
34
 void lcd_completion_feedback(const bool good=true);
36
 void lcd_save_previous_screen();
35
 void lcd_save_previous_screen();

+ 5
- 5
Marlin/src/lcd/ultralcd.cpp Dosyayı Görüntüle

244
           #if HAS_LCD_MENU
244
           #if HAS_LCD_MENU
245
             if      (RRK(EN_REPRAPWORLD_KEYPAD_DOWN))   encoderPosition -= ENCODER_STEPS_PER_MENU_ITEM;
245
             if      (RRK(EN_REPRAPWORLD_KEYPAD_DOWN))   encoderPosition -= ENCODER_STEPS_PER_MENU_ITEM;
246
             else if (RRK(EN_REPRAPWORLD_KEYPAD_UP))     encoderPosition += ENCODER_STEPS_PER_MENU_ITEM;
246
             else if (RRK(EN_REPRAPWORLD_KEYPAD_UP))     encoderPosition += ENCODER_STEPS_PER_MENU_ITEM;
247
-            else if (RRK(EN_REPRAPWORLD_KEYPAD_LEFT))   { menu_item_back::action(); lcd_quick_feedback(true); }
248
-            else if (RRK(EN_REPRAPWORLD_KEYPAD_RIGHT))  { lcd_return_to_status(); lcd_quick_feedback(true); }
247
+            else if (RRK(EN_REPRAPWORLD_KEYPAD_LEFT))   { menu_item_back::action(); lcd_quick_feedback(); }
248
+            else if (RRK(EN_REPRAPWORLD_KEYPAD_RIGHT))  { lcd_return_to_status(); lcd_quick_feedback(); }
249
           #endif
249
           #endif
250
         }
250
         }
251
         else if (RRK(EN_REPRAPWORLD_KEYPAD_DOWN))     encoderPosition += ENCODER_PULSES_PER_STEP;
251
         else if (RRK(EN_REPRAPWORLD_KEYPAD_DOWN))     encoderPosition += ENCODER_PULSES_PER_STEP;
484
   }
484
   }
485
 #endif
485
 #endif
486
 
486
 
487
-void lcd_quick_feedback(const bool clear_buttons) {
487
+void lcd_quick_feedback(const bool clear_buttons/*=true*/) {
488
 
488
 
489
   #if HAS_LCD_MENU
489
   #if HAS_LCD_MENU
490
     lcd_refresh();
490
     lcd_refresh();
661
         wait_for_unclick = true;         //  Set debounce flag to ignore continous clicks
661
         wait_for_unclick = true;         //  Set debounce flag to ignore continous clicks
662
         lcd_clicked = !wait_for_user && !no_reentry; //  Keep the click if not waiting for a user-click
662
         lcd_clicked = !wait_for_user && !no_reentry; //  Keep the click if not waiting for a user-click
663
         wait_for_user = false;           //  Any click clears wait for user
663
         wait_for_user = false;           //  Any click clears wait for user
664
-        lcd_quick_feedback(true);        //  Always make a click sound
664
+        lcd_quick_feedback();        //  Always make a click sound
665
       }
665
       }
666
     }
666
     }
667
     else wait_for_unclick = false;
667
     else wait_for_unclick = false;
668
 
668
 
669
     #if BUTTON_EXISTS(BACK)
669
     #if BUTTON_EXISTS(BACK)
670
       if (LCD_BACK_CLICKED) {
670
       if (LCD_BACK_CLICKED) {
671
-        lcd_quick_feedback(true);
671
+        lcd_quick_feedback();
672
         lcd_goto_previous_menu();
672
         lcd_goto_previous_menu();
673
       }
673
       }
674
     #endif
674
     #endif

+ 3
- 1
Marlin/src/lcd/ultralcd.h Dosyayı Görüntüle

242
     inline void lcd_buzz(const long duration, const uint16_t freq) { UNUSED(duration); UNUSED(freq); }
242
     inline void lcd_buzz(const long duration, const uint16_t freq) { UNUSED(duration); UNUSED(freq); }
243
   #endif
243
   #endif
244
 
244
 
245
-  void lcd_quick_feedback(const bool clear_buttons); // Audible feedback for a button click - could also be visual
245
+  void lcd_quick_feedback(const bool clear_buttons=true); // Audible feedback for a button click - could also be visual
246
 
246
 
247
   #if ENABLED(LCD_PROGRESS_BAR)
247
   #if ENABLED(LCD_PROGRESS_BAR)
248
     extern millis_t progress_bar_ms;  // Start time for the current progress bar cycle
248
     extern millis_t progress_bar_ms;  // Start time for the current progress bar cycle
351
 
351
 
352
   bool lcd_blink();
352
   bool lcd_blink();
353
 
353
 
354
+  bool use_click();
355
+
354
   #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION)
356
   #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION)
355
     bool is_lcd_clicked();
357
     bool is_lcd_clicked();
356
     void wait_for_release();
358
     void wait_for_release();

+ 26
- 2
Marlin/src/module/temperature.cpp Dosyayı Görüntüle

2441
       #define MIN_COOLING_SLOPE_TIME 60
2441
       #define MIN_COOLING_SLOPE_TIME 60
2442
     #endif
2442
     #endif
2443
 
2443
 
2444
-    bool Temperature::wait_for_hotend(const uint8_t target_extruder, const bool no_wait_for_cooling/*=true*/) {
2444
+    bool Temperature::wait_for_hotend(const uint8_t target_extruder, const bool no_wait_for_cooling/*=true*/
2445
+      #if G26_CLICK_CAN_CANCEL
2446
+        , const bool click_to_cancel/*=false*/
2447
+      #endif
2448
+    ) {
2445
       #if TEMP_RESIDENCY_TIME > 0
2449
       #if TEMP_RESIDENCY_TIME > 0
2446
         millis_t residency_start_ms = 0;
2450
         millis_t residency_start_ms = 0;
2447
         // Loop until the temperature has stabilized
2451
         // Loop until the temperature has stabilized
2525
           }
2529
           }
2526
         }
2530
         }
2527
 
2531
 
2532
+        #if G26_CLICK_CAN_CANCEL
2533
+          if (click_to_cancel && use_click()) {
2534
+            wait_for_heatup = false;
2535
+            lcd_quick_feedback();
2536
+          }
2537
+        #endif
2538
+
2528
       } while (wait_for_heatup && TEMP_CONDITIONS);
2539
       } while (wait_for_heatup && TEMP_CONDITIONS);
2529
 
2540
 
2530
       if (wait_for_heatup) {
2541
       if (wait_for_heatup) {
2552
       #define MIN_COOLING_SLOPE_TIME_BED 60
2563
       #define MIN_COOLING_SLOPE_TIME_BED 60
2553
     #endif
2564
     #endif
2554
 
2565
 
2555
-    void Temperature::wait_for_bed(const bool no_wait_for_cooling) {
2566
+    bool Temperature::wait_for_bed(const bool no_wait_for_cooling
2567
+      #if G26_CLICK_CAN_CANCEL
2568
+        , const bool click_to_cancel/*=false*/
2569
+      #endif
2570
+    ) {
2556
       #if TEMP_BED_RESIDENCY_TIME > 0
2571
       #if TEMP_BED_RESIDENCY_TIME > 0
2557
         millis_t residency_start_ms = 0;
2572
         millis_t residency_start_ms = 0;
2558
         // Loop until the temperature has stabilized
2573
         // Loop until the temperature has stabilized
2639
           }
2654
           }
2640
         }
2655
         }
2641
 
2656
 
2657
+        #if G26_CLICK_CAN_CANCEL
2658
+          if (click_to_cancel && use_click()) {
2659
+            wait_for_heatup = false;
2660
+            lcd_quick_feedback();
2661
+          }
2662
+        #endif
2663
+
2642
       } while (wait_for_heatup && TEMP_BED_CONDITIONS);
2664
       } while (wait_for_heatup && TEMP_BED_CONDITIONS);
2643
 
2665
 
2644
       if (wait_for_heatup) lcd_reset_status();
2666
       if (wait_for_heatup) lcd_reset_status();
2646
       #if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE)
2668
       #if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE)
2647
         gcode.busy_state = old_busy_state;
2669
         gcode.busy_state = old_busy_state;
2648
       #endif
2670
       #endif
2671
+
2672
+      return wait_for_heatup;
2649
     }
2673
     }
2650
 
2674
 
2651
   #endif // HAS_HEATED_BED
2675
   #endif // HAS_HEATED_BED

+ 12
- 2
Marlin/src/module/temperature.h Dosyayı Görüntüle

138
   #define unscalePID_d(d) ( float(d) * PID_dT )
138
   #define unscalePID_d(d) ( float(d) * PID_dT )
139
 #endif
139
 #endif
140
 
140
 
141
+#define G26_CLICK_CAN_CANCEL (HAS_LCD_MENU && ENABLED(G26_MESH_VALIDATION))
142
+
141
 class Temperature {
143
 class Temperature {
142
 
144
 
143
   public:
145
   public:
426
     }
428
     }
427
 
429
 
428
     #if HAS_TEMP_HOTEND
430
     #if HAS_TEMP_HOTEND
429
-      static bool wait_for_hotend(const uint8_t target_extruder, const bool no_wait_for_cooling=true);
431
+      static bool wait_for_hotend(const uint8_t target_extruder, const bool no_wait_for_cooling=true
432
+        #if G26_CLICK_CAN_CANCEL
433
+          , const bool click_to_cancel=false
434
+        #endif
435
+      );
430
     #endif
436
     #endif
431
 
437
 
432
     #if HAS_HEATED_BED
438
     #if HAS_HEATED_BED
459
         static void start_watching_bed();
465
         static void start_watching_bed();
460
       #endif
466
       #endif
461
 
467
 
462
-      static void wait_for_bed(const bool no_wait_for_cooling);
468
+      static bool wait_for_bed(const bool no_wait_for_cooling
469
+        #if G26_CLICK_CAN_CANCEL
470
+          , const bool click_to_cancel=false
471
+        #endif
472
+      );
463
 
473
 
464
     #endif // HAS_HEATED_BED
474
     #endif // HAS_HEATED_BED
465
 
475
 

Loading…
İptal
Kaydet