Browse Source

🚸 Prevent accidental button press

Scott Lahteine 2 years ago
parent
commit
0ff3035f3a
2 changed files with 4 additions and 2 deletions
  1. 1
    0
      Marlin/src/MarlinCore.cpp
  2. 3
    2
      Marlin/src/lcd/marlinui.h

+ 1
- 0
Marlin/src/MarlinCore.cpp View File

@@ -271,6 +271,7 @@ bool wait_for_heatup = true;
271 271
     while (wait_for_user && !(ms && ELAPSED(millis(), ms)))
272 272
       idle(TERN_(ADVANCED_PAUSE_FEATURE, no_sleep));
273 273
     wait_for_user = false;
274
+    while (ui.button_pressed()) safe_delay(50);
274 275
   }
275 276
 
276 277
 #endif

+ 3
- 2
Marlin/src/lcd/marlinui.h View File

@@ -717,8 +717,6 @@ public:
717 717
       static bool hw_button_pressed() { return BUTTON_CLICK(); }
718 718
     #endif
719 719
 
720
-    static bool button_pressed() { return hw_button_pressed() || TERN0(TOUCH_SCREEN, touch_pressed()); }
721
-
722 720
     #if EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION)
723 721
       static void wait_for_release();
724 722
     #endif
@@ -750,9 +748,12 @@ public:
750 748
   #else
751 749
 
752 750
     static void update_buttons() {}
751
+    static bool hw_button_pressed() { return false; }
753 752
 
754 753
   #endif
755 754
 
755
+  static bool button_pressed() { return hw_button_pressed() || TERN0(TOUCH_SCREEN, touch_pressed()); }
756
+
756 757
   #if ENABLED(TOUCH_SCREEN_CALIBRATION)
757 758
     static void touch_calibration_screen();
758 759
   #endif

Loading…
Cancel
Save