Browse Source

🚸 Prevent accidental button press

FB4S_WIFI
Scott Lahteine 3 years ago
committed by Scott Lahteine
parent
commit
7ff4b70694
  1. 1
      Marlin/src/MarlinCore.cpp
  2. 5
      Marlin/src/lcd/marlinui.h

1
Marlin/src/MarlinCore.cpp

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

5
Marlin/src/lcd/marlinui.h

@ -709,8 +709,6 @@ public:
static bool hw_button_pressed() { return BUTTON_CLICK(); } static bool hw_button_pressed() { return BUTTON_CLICK(); }
#endif #endif
static bool button_pressed() { return hw_button_pressed() || TERN0(TOUCH_SCREEN, touch_pressed()); }
#if EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION) #if EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION)
static void wait_for_release(); static void wait_for_release();
#endif #endif
@ -742,9 +740,12 @@ public:
#else #else
static void update_buttons() {} static void update_buttons() {}
static bool hw_button_pressed() { return false; }
#endif #endif
static bool button_pressed() { return hw_button_pressed() || TERN0(TOUCH_SCREEN, touch_pressed()); }
#if ENABLED(TOUCH_SCREEN_CALIBRATION) #if ENABLED(TOUCH_SCREEN_CALIBRATION)
static void touch_calibration_screen(); static void touch_calibration_screen();
#endif #endif

Loading…
Cancel
Save