File tree 3 files changed +12
-10
lines changed
3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -392,7 +392,7 @@ void MarlinUI::clear_for_drawing() {
392
392
#if HAS_DISPLAY_SLEEP
393
393
void MarlinUI::sleep_display (const bool sleep/* =true*/ ) {
394
394
static bool asleep = false ;
395
- if (asleep != sleep ){
395
+ if (asleep != sleep ) {
396
396
sleep ? u8g.sleepOn () : u8g.sleepOff ();
397
397
asleep = sleep ;
398
398
}
Original file line number Diff line number Diff line change @@ -1824,13 +1824,14 @@ void MarlinUI::host_notify(const char * const cstr) {
1824
1824
#endif
1825
1825
1826
1826
void MarlinUI::media_changed (const uint8_t old_status, const uint8_t status) {
1827
+ TERN_ (HAS_DISPLAY_SLEEP, refresh_screen_timeout ());
1827
1828
if (old_status == status) {
1828
1829
TERN_ (EXTENSIBLE_UI, ExtUI::onMediaError ()); // Failed to mount/unmount
1829
1830
return ;
1830
1831
}
1831
1832
1832
- if (status ) {
1833
- if (old_status < 2 ) {
1833
+ if (old_status < 2 ) { // Skip this section on first boot check
1834
+ if (status ) { // Media Mounted
1834
1835
#if ENABLED(EXTENSIBLE_UI)
1835
1836
ExtUI::onMediaMounted ();
1836
1837
#elif ENABLED(BROWSE_MEDIA_ON_INSERT)
@@ -1841,16 +1842,16 @@ void MarlinUI::host_notify(const char * const cstr) {
1841
1842
LCD_MESSAGE (MSG_MEDIA_INSERTED);
1842
1843
#endif
1843
1844
}
1844
- }
1845
- else {
1846
- if (old_status < 2 ) {
1845
+ else { // Media Removed
1847
1846
#if ENABLED(EXTENSIBLE_UI)
1848
1847
ExtUI::onMediaRemoved ();
1849
- #elif HAS_SD_DETECT
1848
+ #elif HAS_SD_DETECT // Q: Does "Media Removed" need to be shown for manual release too?
1850
1849
LCD_MESSAGE (MSG_MEDIA_REMOVED);
1851
1850
#if HAS_MARLINUI_MENU
1852
- if (!defer_return_to_status) return_to_status ();
1851
+ if (ENABLED (HAS_WIRED_LCD) || !defer_return_to_status) return_to_status ();
1853
1852
#endif
1853
+ #elif HAS_WIRED_LCD
1854
+ return_to_status ();
1854
1855
#endif
1855
1856
}
1856
1857
}
Original file line number Diff line number Diff line change @@ -304,6 +304,7 @@ class MarlinUI {
304
304
static void refresh_screen_timeout ();
305
305
#endif
306
306
307
+ // Sleep or wake the display (e.g., by turning the backlight off/on).
307
308
static void sleep_display (const bool =true ) IF_DISABLED(HAS_DISPLAY_SLEEP, {});
308
309
static void wake_display () { sleep_display (false ); }
309
310
@@ -743,7 +744,7 @@ class MarlinUI {
743
744
744
745
static void draw_select_screen_prompt (FSTR_P const fpre, const char * const string=nullptr , FSTR_P const fsuf=nullptr );
745
746
746
- #else
747
+ #else // !HAS_MARLINUI_MENU
747
748
748
749
static void return_to_status () {}
749
750
@@ -753,7 +754,7 @@ class MarlinUI {
753
754
FORCE_INLINE static void run_current_screen () { status_screen (); }
754
755
#endif
755
756
756
- #endif
757
+ #endif // !HAS_MARLINUI_MENU
757
758
758
759
#if ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI)
759
760
static bool lcd_clicked;
You can’t perform that action at this time.
0 commit comments