Browse Source

🚸 Prevent accidental button press

Scott Lahteine 3 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
     while (wait_for_user && !(ms && ELAPSED(millis(), ms)))
271
     while (wait_for_user && !(ms && ELAPSED(millis(), ms)))
272
       idle(TERN_(ADVANCED_PAUSE_FEATURE, no_sleep));
272
       idle(TERN_(ADVANCED_PAUSE_FEATURE, no_sleep));
273
     wait_for_user = false;
273
     wait_for_user = false;
274
+    while (ui.button_pressed()) safe_delay(50);
274
   }
275
   }
275
 
276
 
276
 #endif
277
 #endif

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

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

Loading…
Cancel
Save