浏览代码

🎨 ExtUI "user click" and other tweaks (#22122)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
InsanityAutomation 4 年前
父节点
当前提交
a3e8bb99e4
没有帐户链接到提交者的电子邮件

+ 3
- 1
Marlin/src/gcode/bedlevel/mbl/G29.cpp 查看文件

70
     return;
70
     return;
71
   }
71
   }
72
 
72
 
73
-  int8_t ix, iy;
73
+  int8_t ix, iy = 0;
74
 
74
 
75
   switch (state) {
75
   switch (state) {
76
     case MeshReport:
76
     case MeshReport:
88
       mbl_probe_index = 0;
88
       mbl_probe_index = 0;
89
       if (!ui.wait_for_move) {
89
       if (!ui.wait_for_move) {
90
         queue.inject_P(parser.seen_test('N') ? PSTR("G28" TERN(CAN_SET_LEVELING_AFTER_G28, "L0", "") "\nG29S2") : PSTR("G29S2"));
90
         queue.inject_P(parser.seen_test('N') ? PSTR("G28" TERN(CAN_SET_LEVELING_AFTER_G28, "L0", "") "\nG29S2") : PSTR("G29S2"));
91
+        TERN_(EXTENSIBLE_UI, ExtUI::onMeshLevelingStart());
91
         return;
92
         return;
92
       }
93
       }
93
       state = MeshNext;
94
       state = MeshNext;
109
       else {
110
       else {
110
         // Save Z for the previous mesh position
111
         // Save Z for the previous mesh position
111
         mbl.set_zigzag_z(mbl_probe_index - 1, current_position.z);
112
         mbl.set_zigzag_z(mbl_probe_index - 1, current_position.z);
113
+        TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ix, iy, current_position.z));
112
         SET_SOFT_ENDSTOP_LOOSE(false);
114
         SET_SOFT_ENDSTOP_LOOSE(false);
113
       }
115
       }
114
       // If there's another point to sample, move there with optional lift.
116
       // If there's another point to sample, move there with optional lift.

+ 93
- 83
Marlin/src/lcd/extui/ui_api.cpp 查看文件

47
 
47
 
48
 #include "../marlinui.h"
48
 #include "../marlinui.h"
49
 #include "../../gcode/queue.h"
49
 #include "../../gcode/queue.h"
50
+#include "../../gcode/gcode.h"
50
 #include "../../module/motion.h"
51
 #include "../../module/motion.h"
51
 #include "../../module/planner.h"
52
 #include "../../module/planner.h"
52
 #include "../../module/probe.h"
53
 #include "../../module/probe.h"
353
 
354
 
354
   extruder_t getTool(const uint8_t extruder) {
355
   extruder_t getTool(const uint8_t extruder) {
355
     switch (extruder) {
356
     switch (extruder) {
356
-      case 7:  return E7;
357
-      case 6:  return E6;
358
-      case 5:  return E5;
359
-      case 4:  return E4;
360
-      case 3:  return E3;
361
-      case 2:  return E2;
362
-      case 1:  return E1;
363
-      default: return E0;
357
+      default:
358
+      case 0: return E0; case 1: return E1; case 2: return E2; case 3: return E3;
359
+      case 4: return E4; case 5: return E5; case 6: return E6; case 7: return E7;
364
     }
360
     }
365
   }
361
   }
366
 
362
 
372
     switch (axis) {
368
     switch (axis) {
373
       #if IS_KINEMATIC || ENABLED(NO_MOTION_BEFORE_HOMING)
369
       #if IS_KINEMATIC || ENABLED(NO_MOTION_BEFORE_HOMING)
374
         case X: return axis_should_home(X_AXIS);
370
         case X: return axis_should_home(X_AXIS);
375
-        case Y: return axis_should_home(Y_AXIS);
376
-        case Z: return axis_should_home(Z_AXIS);
371
+        OPTCODE(HAS_Y_AXIS, case Y: return axis_should_home(Y_AXIS))
372
+        OPTCODE(HAS_Z_AXIS, case Z: return axis_should_home(Z_AXIS))
377
       #else
373
       #else
378
         case X: case Y: case Z: return true;
374
         case X: case Y: case Z: return true;
379
       #endif
375
       #endif
385
     return !thermalManager.tooColdToExtrude(extruder - E0);
381
     return !thermalManager.tooColdToExtrude(extruder - E0);
386
   }
382
   }
387
 
383
 
384
+  GcodeSuite::MarlinBusyState getMachineBusyState() { return TERN0(HOST_KEEPALIVE_FEATURE, GcodeSuite::busy_state); }
385
+
388
   #if HAS_SOFTWARE_ENDSTOPS
386
   #if HAS_SOFTWARE_ENDSTOPS
389
     bool getSoftEndstopState() { return soft_endstop._enabled; }
387
     bool getSoftEndstopState() { return soft_endstop._enabled; }
390
     void setSoftEndstopState(const bool value) { soft_endstop._enabled = value; }
388
     void setSoftEndstopState(const bool value) { soft_endstop._enabled = value; }
396
         #if AXIS_IS_TMC(X)
394
         #if AXIS_IS_TMC(X)
397
           case X: return stepperX.getMilliamps();
395
           case X: return stepperX.getMilliamps();
398
         #endif
396
         #endif
399
-        #if AXIS_IS_TMC(X2)
400
-          case X2: return stepperX2.getMilliamps();
401
-        #endif
402
         #if AXIS_IS_TMC(Y)
397
         #if AXIS_IS_TMC(Y)
403
           case Y: return stepperY.getMilliamps();
398
           case Y: return stepperY.getMilliamps();
404
         #endif
399
         #endif
405
-        #if AXIS_IS_TMC(Y2)
406
-          case Y2: return stepperY2.getMilliamps();
407
-        #endif
408
         #if AXIS_IS_TMC(Z)
400
         #if AXIS_IS_TMC(Z)
409
           case Z: return stepperZ.getMilliamps();
401
           case Z: return stepperZ.getMilliamps();
410
         #endif
402
         #endif
403
+        #if AXIS_IS_TMC(I)
404
+          case I: return stepperI.getMilliamps();
405
+        #endif
406
+        #if AXIS_IS_TMC(J)
407
+          case J: return stepperJ.getMilliamps();
408
+        #endif
409
+        #if AXIS_IS_TMC(K)
410
+          case K: return stepperK.getMilliamps();
411
+        #endif
412
+        #if AXIS_IS_TMC(X2)
413
+          case X2: return stepperX2.getMilliamps();
414
+        #endif
415
+        #if AXIS_IS_TMC(Y2)
416
+          case Y2: return stepperY2.getMilliamps();
417
+        #endif
411
         #if AXIS_IS_TMC(Z2)
418
         #if AXIS_IS_TMC(Z2)
412
           case Z2: return stepperZ2.getMilliamps();
419
           case Z2: return stepperZ2.getMilliamps();
413
         #endif
420
         #endif
450
         #if AXIS_IS_TMC(X)
457
         #if AXIS_IS_TMC(X)
451
           case X: stepperX.rms_current(constrain(mA, 400, 1500)); break;
458
           case X: stepperX.rms_current(constrain(mA, 400, 1500)); break;
452
         #endif
459
         #endif
453
-        #if AXIS_IS_TMC(X2)
454
-          case X2: stepperX2.rms_current(constrain(mA, 400, 1500)); break;
455
-        #endif
456
         #if AXIS_IS_TMC(Y)
460
         #if AXIS_IS_TMC(Y)
457
           case Y: stepperY.rms_current(constrain(mA, 400, 1500)); break;
461
           case Y: stepperY.rms_current(constrain(mA, 400, 1500)); break;
458
         #endif
462
         #endif
459
-        #if AXIS_IS_TMC(Y2)
460
-          case Y2: stepperY2.rms_current(constrain(mA, 400, 1500)); break;
461
-        #endif
462
         #if AXIS_IS_TMC(Z)
463
         #if AXIS_IS_TMC(Z)
463
           case Z: stepperZ.rms_current(constrain(mA, 400, 1500)); break;
464
           case Z: stepperZ.rms_current(constrain(mA, 400, 1500)); break;
464
         #endif
465
         #endif
466
+        #if AXIS_IS_TMC(I)
467
+          case I: stepperI.rms_current(constrain(mA, 400, 1500)); break;
468
+        #endif
469
+        #if AXIS_IS_TMC(J)
470
+          case J: stepperJ.rms_current(constrain(mA, 400, 1500)); break;
471
+        #endif
472
+        #if AXIS_IS_TMC(K)
473
+          case K: stepperK.rms_current(constrain(mA, 400, 1500)); break;
474
+        #endif
475
+        #if AXIS_IS_TMC(X2)
476
+          case X2: stepperX2.rms_current(constrain(mA, 400, 1500)); break;
477
+        #endif
478
+        #if AXIS_IS_TMC(Y2)
479
+          case Y2: stepperY2.rms_current(constrain(mA, 400, 1500)); break;
480
+        #endif
465
         #if AXIS_IS_TMC(Z2)
481
         #if AXIS_IS_TMC(Z2)
466
           case Z2: stepperZ2.rms_current(constrain(mA, 400, 1500)); break;
482
           case Z2: stepperZ2.rms_current(constrain(mA, 400, 1500)); break;
467
         #endif
483
         #endif
501
 
517
 
502
     int getTMCBumpSensitivity(const axis_t axis) {
518
     int getTMCBumpSensitivity(const axis_t axis) {
503
       switch (axis) {
519
       switch (axis) {
504
-        #if ENABLED(X_SENSORLESS)
505
-          case X:  return stepperX.homing_threshold();
520
+        OPTCODE(X_SENSORLESS,  case X:  return stepperX.homing_threshold())
521
+        OPTCODE(Y_SENSORLESS,  case Y:  return stepperY.homing_threshold())
522
+        OPTCODE(Z_SENSORLESS,  case Z:  return stepperZ.homing_threshold())
523
+        OPTCODE(I_SENSORLESS,  case I:  return stepperI.homing_threshold())
524
+        OPTCODE(J_SENSORLESS,  case J:  return stepperJ.homing_threshold())
525
+        OPTCODE(K_SENSORLESS,  case K:  return stepperK.homing_threshold())
526
+        OPTCODE(X2_SENSORLESS, case X2: return stepperX2.homing_threshold())
527
+        OPTCODE(Y2_SENSORLESS, case Y2: return stepperY2.homing_threshold())
528
+        OPTCODE(Z2_SENSORLESS, case Z2: return stepperZ2.homing_threshold())
529
+        OPTCODE(Z3_SENSORLESS, case Z3: return stepperZ3.homing_threshold())
530
+        OPTCODE(Z4_SENSORLESS, case Z4: return stepperZ4.homing_threshold())
531
+        default: return 0;
532
+      }
533
+    }
534
+
535
+    void setTMCBumpSensitivity(const_float_t value, const axis_t axis) {
536
+      switch (axis) {
537
+        #if X_SENSORLESS
538
+          case X: stepperX.homing_threshold(value); break;
506
         #endif
539
         #endif
507
-        #if ENABLED(X2_SENSORLESS)
508
-          case X2: return stepperX2.homing_threshold();
540
+        #if Y_SENSORLESS
541
+          case Y: stepperY.homing_threshold(value); break;
509
         #endif
542
         #endif
510
-        #if ENABLED(Y_SENSORLESS)
511
-          case Y:  return stepperY.homing_threshold();
543
+        #if Z_SENSORLESS
544
+          case Z: stepperZ.homing_threshold(value); break;
512
         #endif
545
         #endif
513
-        #if ENABLED(Y2_SENSORLESS)
514
-          case Y2: return stepperY2.homing_threshold();
546
+        #if I_SENSORLESS
547
+          case I: stepperI.homing_threshold(value); break;
515
         #endif
548
         #endif
516
-        #if ENABLED(Z_SENSORLESS)
517
-          case Z:  return stepperZ.homing_threshold();
549
+        #if J_SENSORLESS
550
+          case J: stepperJ.homing_threshold(value); break;
518
         #endif
551
         #endif
519
-        #if ENABLED(Z2_SENSORLESS)
520
-          case Z2: return stepperZ2.homing_threshold();
552
+        #if K_SENSORLESS
553
+          case K: stepperK.homing_threshold(value); break;
521
         #endif
554
         #endif
522
-        #if ENABLED(Z3_SENSORLESS)
523
-          case Z3: return stepperZ3.homing_threshold();
555
+        #if X2_SENSORLESS
556
+          case X2: stepperX2.homing_threshold(value); break;
524
         #endif
557
         #endif
525
-        #if ENABLED(Z4_SENSORLESS)
526
-          case Z4: return stepperZ4.homing_threshold();
558
+        #if Y2_SENSORLESS
559
+          case Y2: stepperY2.homing_threshold(value); break;
527
         #endif
560
         #endif
528
-        default: return 0;
529
-      }
530
-    }
531
-
532
-    void setTMCBumpSensitivity(const_float_t value, const axis_t axis) {
533
-      switch (axis) {
534
-        #if X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS
535
-          #if X_SENSORLESS
536
-            case X:  stepperX.homing_threshold(value);  break;
537
-          #endif
538
-          #if X2_SENSORLESS
539
-            case X2: stepperX2.homing_threshold(value); break;
540
-          #endif
541
-          #if Y_SENSORLESS
542
-            case Y: stepperY.homing_threshold(value); break;
543
-          #endif
544
-          #if Y2_SENSORLESS
545
-            case Y2: stepperY2.homing_threshold(value); break;
546
-          #endif
547
-          #if Z_SENSORLESS
548
-            case Z: stepperZ.homing_threshold(value); break;
549
-          #endif
550
-          #if Z2_SENSORLESS
551
-            case Z2: stepperZ2.homing_threshold(value); break;
552
-          #endif
553
-          #if Z3_SENSORLESS
554
-            case Z3: stepperZ3.homing_threshold(value); break;
555
-          #endif
556
-          #if Z4_SENSORLESS
557
-            case Z4: stepperZ4.homing_threshold(value); break;
558
-          #endif
559
-        #else
560
-          UNUSED(value);
561
+        #if Z2_SENSORLESS
562
+          case Z2: stepperZ2.homing_threshold(value); break;
563
+        #endif
564
+        #if Z3_SENSORLESS
565
+          case Z3: stepperZ3.homing_threshold(value); break;
566
+        #endif
567
+        #if Z4_SENSORLESS
568
+          case Z4: stepperZ4.homing_threshold(value); break;
561
         #endif
569
         #endif
562
         default: break;
570
         default: break;
563
       }
571
       }
572
+      UNUSED(value);
564
     }
573
     }
565
   #endif
574
   #endif
566
 
575
 
661
 
670
 
662
   #if HAS_JUNCTION_DEVIATION
671
   #if HAS_JUNCTION_DEVIATION
663
 
672
 
664
-    float getJunctionDeviation_mm() {
665
-      return planner.junction_deviation_mm;
666
-    }
673
+    float getJunctionDeviation_mm() { return planner.junction_deviation_mm; }
667
 
674
 
668
     void setJunctionDeviation_mm(const_float_t value) {
675
     void setJunctionDeviation_mm(const_float_t value) {
669
       planner.junction_deviation_mm = constrain(value, 0.001, 0.3);
676
       planner.junction_deviation_mm = constrain(value, 0.001, 0.3);
682
   #endif
689
   #endif
683
 
690
 
684
   #if PREHEAT_COUNT
691
   #if PREHEAT_COUNT
685
-      uint16_t getMaterial_preset_E(const uint16_t index) { return ui.material_preset[index].hotend_temp; }
692
+    uint16_t getMaterial_preset_E(const uint16_t index) { return ui.material_preset[index].hotend_temp; }
686
     #if HAS_HEATED_BED
693
     #if HAS_HEATED_BED
687
       uint16_t getMaterial_preset_B(const uint16_t index) { return ui.material_preset[index].bed_temp; }
694
       uint16_t getMaterial_preset_B(const uint16_t index) { return ui.material_preset[index].bed_temp; }
688
     #endif
695
     #endif
709
       switch (axis) {
716
       switch (axis) {
710
         #if ENABLED(BABYSTEP_XY)
717
         #if ENABLED(BABYSTEP_XY)
711
           case X: babystep.add_steps(X_AXIS, steps); break;
718
           case X: babystep.add_steps(X_AXIS, steps); break;
712
-          case Y: babystep.add_steps(Y_AXIS, steps); break;
719
+          #if HAS_Y_AXIS
720
+            case Y: babystep.add_steps(Y_AXIS, steps); break;
721
+          #endif
722
+        #endif
723
+        #if HAS_Z_AXIS
724
+          case Z: babystep.add_steps(Z_AXIS, steps); break;
713
         #endif
725
         #endif
714
-        case Z: babystep.add_steps(Z_AXIS, steps); break;
715
         default: return false;
726
         default: return false;
716
       };
727
       };
717
       return true;
728
       return true;
750
               hotend_offset[e][axis] += mm;
761
               hotend_offset[e][axis] += mm;
751
 
762
 
752
           normalizeNozzleOffset(X);
763
           normalizeNozzleOffset(X);
753
-          normalizeNozzleOffset(Y);
754
-          normalizeNozzleOffset(Z);
764
+          TERN_(HAS_Y_AXIS, normalizeNozzleOffset(Y));
765
+          TERN_(HAS_Z_AXIS, normalizeNozzleOffset(Z));
755
         }
766
         }
756
       #else
767
       #else
757
         UNUSED(linked_nozzles);
768
         UNUSED(linked_nozzles);
1014
     TERN_(HAS_FAN, thermalManager.zero_fan_speeds());
1025
     TERN_(HAS_FAN, thermalManager.zero_fan_speeds());
1015
   }
1026
   }
1016
 
1027
 
1017
-  bool awaitingUserConfirm() { return wait_for_user; }
1018
-
1028
+  bool awaitingUserConfirm() { return TERN0(HAS_RESUME_CONTINUE, wait_for_user); }
1019
   void setUserConfirmed() { TERN_(HAS_RESUME_CONTINUE, wait_for_user = false); }
1029
   void setUserConfirmed() { TERN_(HAS_RESUME_CONTINUE, wait_for_user = false); }
1020
 
1030
 
1021
   void printFile(const char *filename) {
1031
   void printFile(const char *filename) {
1038
 
1048
 
1039
   bool isMediaInserted() { return TERN0(SDSUPPORT, IS_SD_INSERTED() && card.isMounted()); }
1049
   bool isMediaInserted() { return TERN0(SDSUPPORT, IS_SD_INSERTED() && card.isMounted()); }
1040
 
1050
 
1041
-  void pausePrint() { ui.pause_print(); }
1051
+  void pausePrint()  { ui.pause_print(); }
1042
   void resumePrint() { ui.resume_print(); }
1052
   void resumePrint() { ui.resume_print(); }
1043
-  void stopPrint() { ui.abort_print(); }
1053
+  void stopPrint()   { ui.abort_print(); }
1044
 
1054
 
1045
   void onUserConfirmRequired_P(PGM_P const pstr) {
1055
   void onUserConfirmRequired_P(PGM_P const pstr) {
1046
     char msg[strlen_P(pstr) + 1];
1056
     char msg[strlen_P(pstr) + 1];

+ 7
- 1
Marlin/src/lcd/extui/ui_api.h 查看文件

44
 
44
 
45
 #include "../../inc/MarlinConfig.h"
45
 #include "../../inc/MarlinConfig.h"
46
 #include "../marlinui.h"
46
 #include "../marlinui.h"
47
+#include "../../gcode/gcode.h"
47
 
48
 
48
 namespace ExtUI {
49
 namespace ExtUI {
49
 
50
 
53
 
54
 
54
   static constexpr size_t eeprom_data_size = 48;
55
   static constexpr size_t eeprom_data_size = 48;
55
 
56
 
56
-  enum axis_t     : uint8_t { X, Y, Z, X2, Y2, Z2, Z3, Z4 };
57
+  enum axis_t     : uint8_t { X, Y, Z, I, J, K, X2, Y2, Z2, Z3, Z4 };
57
   enum extruder_t : uint8_t { E0, E1, E2, E3, E4, E5, E6, E7 };
58
   enum extruder_t : uint8_t { E0, E1, E2, E3, E4, E5, E6, E7 };
58
   enum heater_t   : uint8_t { H0, H1, H2, H3, H4, H5, BED, CHAMBER, COOLER };
59
   enum heater_t   : uint8_t { H0, H1, H2, H3, H4, H5, BED, CHAMBER, COOLER };
59
   enum fan_t      : uint8_t { FAN0, FAN1, FAN2, FAN3, FAN4, FAN5, FAN6, FAN7 };
60
   enum fan_t      : uint8_t { FAN0, FAN1, FAN2, FAN3, FAN4, FAN5, FAN6, FAN7 };
78
   void injectCommands(char * const);
79
   void injectCommands(char * const);
79
   bool commandsInQueue();
80
   bool commandsInQueue();
80
 
81
 
82
+  GcodeSuite::MarlinBusyState getMachineBusyState();
83
+
81
   bool isHeaterIdle(const heater_t);
84
   bool isHeaterIdle(const heater_t);
82
   bool isHeaterIdle(const extruder_t);
85
   bool isHeaterIdle(const extruder_t);
83
   void enableHeater(const heater_t);
86
   void enableHeater(const heater_t);
125
   float getAxisMaxAcceleration_mm_s2(const extruder_t);
128
   float getAxisMaxAcceleration_mm_s2(const extruder_t);
126
   feedRate_t getMinFeedrate_mm_s();
129
   feedRate_t getMinFeedrate_mm_s();
127
   feedRate_t getMinTravelFeedrate_mm_s();
130
   feedRate_t getMinTravelFeedrate_mm_s();
131
+  feedRate_t getFeedrate_mm_s();
128
   float getPrintingAcceleration_mm_s2();
132
   float getPrintingAcceleration_mm_s2();
129
   float getRetractAcceleration_mm_s2();
133
   float getRetractAcceleration_mm_s2();
130
   float getTravelAcceleration_mm_s2();
134
   float getTravelAcceleration_mm_s2();
186
     void setHostResponse(const uint8_t);
190
     void setHostResponse(const uint8_t);
187
   #endif
191
   #endif
188
 
192
 
193
+  inline void simulateUserClick() { ui.lcd_clicked = true; }
194
+
189
   #if ENABLED(PRINTCOUNTER)
195
   #if ENABLED(PRINTCOUNTER)
190
     char* getFailedPrints_str(char buffer[21]);
196
     char* getFailedPrints_str(char buffer[21]);
191
     char* getTotalPrints_str(char buffer[21]);
197
     char* getTotalPrints_str(char buffer[21]);

+ 4
- 8
Marlin/src/lcd/marlinui.cpp 查看文件

223
 
223
 
224
 #endif
224
 #endif
225
 
225
 
226
+#if EITHER(HAS_LCD_MENU, EXTENSIBLE_UI)
227
+  bool MarlinUI::lcd_clicked;
228
+#endif
229
+
226
 #if HAS_LCD_MENU
230
 #if HAS_LCD_MENU
227
   #include "menu/menu.h"
231
   #include "menu/menu.h"
228
 
232
 
247
     uint8_t MarlinUI::repeat_delay;
251
     uint8_t MarlinUI::repeat_delay;
248
   #endif
252
   #endif
249
 
253
 
250
-  bool MarlinUI::lcd_clicked;
251
-
252
-  bool MarlinUI::use_click() {
253
-    const bool click = lcd_clicked;
254
-    lcd_clicked = false;
255
-    return click;
256
-  }
257
-
258
   #if EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION)
254
   #if EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION)
259
 
255
 
260
     bool MarlinUI::external_control; // = false
256
     bool MarlinUI::external_control; // = false

+ 12
- 4
Marlin/src/lcd/marlinui.h 查看文件

474
     static void set_selection(const bool sel) { selection = sel; }
474
     static void set_selection(const bool sel) { selection = sel; }
475
     static bool update_selection();
475
     static bool update_selection();
476
 
476
 
477
-    static bool lcd_clicked;
478
-    static bool use_click();
479
-
480
     static void synchronize(PGM_P const msg=nullptr);
477
     static void synchronize(PGM_P const msg=nullptr);
481
 
478
 
482
     static screenFunc_t currentScreen;
479
     static screenFunc_t currentScreen;
527
 
524
 
528
   #elif HAS_WIRED_LCD
525
   #elif HAS_WIRED_LCD
529
 
526
 
530
-    static constexpr bool lcd_clicked = false;
531
     static constexpr bool on_status_screen() { return true; }
527
     static constexpr bool on_status_screen() { return true; }
532
     FORCE_INLINE static void run_current_screen() { status_screen(); }
528
     FORCE_INLINE static void run_current_screen() { status_screen(); }
533
 
529
 
534
   #endif
530
   #endif
535
 
531
 
532
+  #if EITHER(HAS_LCD_MENU, EXTENSIBLE_UI)
533
+    static bool lcd_clicked;
534
+    static inline bool use_click() {
535
+      const bool click = lcd_clicked;
536
+      lcd_clicked = false;
537
+      return click;
538
+    }
539
+  #else
540
+    static constexpr bool lcd_clicked = false;
541
+    static inline bool use_click() { return false; }
542
+  #endif
543
+
536
   #if BOTH(HAS_LCD_MENU, ADVANCED_PAUSE_FEATURE)
544
   #if BOTH(HAS_LCD_MENU, ADVANCED_PAUSE_FEATURE)
537
     static void pause_show_message(const PauseMessage message, const PauseMode mode=PAUSE_MODE_SAME, const uint8_t extruder=active_extruder);
545
     static void pause_show_message(const PauseMessage message, const PauseMode mode=PAUSE_MODE_SAME, const uint8_t extruder=active_extruder);
538
   #else
546
   #else

+ 1
- 1
Marlin/src/module/probe.cpp 查看文件

384
     DEBUG_EOL();
384
     DEBUG_EOL();
385
 
385
 
386
     TERN_(WAIT_FOR_NOZZLE_HEAT, if (hotend_temp > thermalManager.wholeDegHotend(0) + (TEMP_WINDOW)) thermalManager.wait_for_hotend(0));
386
     TERN_(WAIT_FOR_NOZZLE_HEAT, if (hotend_temp > thermalManager.wholeDegHotend(0) + (TEMP_WINDOW)) thermalManager.wait_for_hotend(0));
387
-    TERN_(WAIT_FOR_BED_HEAT,    if (bed_temp > thermalManager.wholeDegBed() + (TEMP_BED_WINDOW))    thermalManager.wait_for_bed_heating());
387
+    TERN_(WAIT_FOR_BED_HEAT,    if (bed_temp    > thermalManager.wholeDegBed() + (TEMP_BED_WINDOW)) thermalManager.wait_for_bed_heating());
388
   }
388
   }
389
 
389
 
390
 #endif
390
 #endif

+ 2
- 2
Marlin/src/module/temperature.cpp 查看文件

3621
         #if G26_CLICK_CAN_CANCEL
3621
         #if G26_CLICK_CAN_CANCEL
3622
           if (click_to_cancel && ui.use_click()) {
3622
           if (click_to_cancel && ui.use_click()) {
3623
             wait_for_heatup = false;
3623
             wait_for_heatup = false;
3624
-            ui.quick_feedback();
3624
+            TERN_(HAS_LCD_MENU, ui.quick_feedback());
3625
           }
3625
           }
3626
         #endif
3626
         #endif
3627
 
3627
 
3755
         #if G26_CLICK_CAN_CANCEL
3755
         #if G26_CLICK_CAN_CANCEL
3756
           if (click_to_cancel && ui.use_click()) {
3756
           if (click_to_cancel && ui.use_click()) {
3757
             wait_for_heatup = false;
3757
             wait_for_heatup = false;
3758
-            ui.quick_feedback();
3758
+            TERN_(HAS_LCD_MENU, ui.quick_feedback());
3759
           }
3759
           }
3760
         #endif
3760
         #endif
3761
 
3761
 

+ 1
- 1
Marlin/src/module/temperature.h 查看文件

174
   #define unscalePID_d(d) ( float(d) * PID_dT )
174
   #define unscalePID_d(d) ( float(d) * PID_dT )
175
 #endif
175
 #endif
176
 
176
 
177
-#if BOTH(HAS_LCD_MENU, G26_MESH_VALIDATION)
177
+#if ENABLED(G26_MESH_VALIDATION) && EITHER(HAS_LCD_MENU, EXTENSIBLE_UI)
178
   #define G26_CLICK_CAN_CANCEL 1
178
   #define G26_CLICK_CAN_CANCEL 1
179
 #endif
179
 #endif
180
 
180
 

正在加载...
取消
保存