From 4bd1ecf8a72ff23e768d4f355190c9199b73a8e4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 27 Sep 2020 16:48:03 -0500 Subject: [PATCH] E3 DWIN: "No Media" message --- Marlin/src/lcd/dwin/e3v2/dwin.cpp | 14 ++++++++++---- Marlin/src/lcd/dwin/e3v2/dwin.h | 2 ++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Marlin/src/lcd/dwin/e3v2/dwin.cpp b/Marlin/src/lcd/dwin/e3v2/dwin.cpp index 1bd49d4dd2..c0096d379d 100644 --- a/Marlin/src/lcd/dwin/e3v2/dwin.cpp +++ b/Marlin/src/lcd/dwin/e3v2/dwin.cpp @@ -1753,11 +1753,17 @@ inline void Redraw_SD_List() { Draw_Back_First(); - // As many files as will fit - LOOP_L_N(i, _MIN(nr_sd_menu_items(), MROWS)) - Draw_SDItem(i, i + 1); + if (card.isMounted()) { + // As many files as will fit + LOOP_L_N(i, _MIN(nr_sd_menu_items(), MROWS)) + Draw_SDItem(i, i + 1); - TERN_(SCROLL_LONG_FILENAMES, Init_SDItem_Shift()); + TERN_(SCROLL_LONG_FILENAMES, Init_SDItem_Shift()); + } + else { + DWIN_Draw_Rectangle(1, Color_Bg_Red, 10, MBASE(3) - 10, DWIN_WIDTH - 10, MBASE(4)); + DWIN_Draw_String(false, false, font16x32, Color_Yellow, Color_Bg_Red, ((DWIN_WIDTH) - 8 * 16) / 2, MBASE(3), F("No Media")); + } } bool DWIN_lcd_sd_status = false; diff --git a/Marlin/src/lcd/dwin/e3v2/dwin.h b/Marlin/src/lcd/dwin/e3v2/dwin.h index 8a1726691e..1b2cb273e3 100644 --- a/Marlin/src/lcd/dwin/e3v2/dwin.h +++ b/Marlin/src/lcd/dwin/e3v2/dwin.h @@ -215,9 +215,11 @@ enum processID : uint8_t { // Color #define Color_White 0xFFFF +#define Color_Yellow 0xFF0F #define Color_Bg_Window 0x31E8 // Popup background color #define Color_Bg_Blue 0x1125 // Dark blue background color #define Color_Bg_Black 0x0841 // Black background color +#define Color_Bg_Red 0xF00F // Red background color #define Popup_Text_Color 0xD6BA // Popup font background color #define Line_Color 0x3A6A // Split line color #define Rectangle_Color 0xEE2F // Blue square cursor color