From 2dc4c642e78bb4fa99ca41f3ae3c92335248ffd4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 3 Apr 2022 16:50:39 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20=20Misc.=20adjustments,=20spacin?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 64 +++++++++---------- Marlin/src/gcode/host/M876.cpp | 4 +- Marlin/src/inc/Conditionals_adv.h | 4 ++ Marlin/src/lcd/marlinui.cpp | 2 + Marlin/src/lcd/menu/menu_configuration.cpp | 4 ++ Marlin/src/module/settings.cpp | 10 +-- .../PlatformIO/scripts/common-dependencies.h | 4 -- platformio.ini | 2 +- 8 files changed, 50 insertions(+), 44 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index c2d5dced28..051560981e 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2584,38 +2584,38 @@ //========================== Extensible UI Displays =========================== //============================================================================= -// -// DGUS Touch Display with DWIN OS. (Choose one.) -// ORIGIN : https://www.aliexpress.com/item/32993409517.html -// FYSETC : https://www.aliexpress.com/item/32961471929.html -// MKS : https://www.aliexpress.com/item/1005002008179262.html -// -// Flash display with DGUS Displays for Marlin: -// - Format the SD card to FAT32 with an allocation size of 4kb. -// - Download files as specified for your type of display. -// - Plug the microSD card into the back of the display. -// - Boot the display and wait for the update to complete. -// -// ORIGIN (Marlin DWIN_SET) -// - Download https://github.com/coldtobi/Marlin_DGUS_Resources -// - Copy the downloaded DWIN_SET folder to the SD card. -// -// FYSETC (Supplier default) -// - Download https://github.com/FYSETC/FYSTLCD-2.0 -// - Copy the downloaded SCREEN folder to the SD card. -// -// HIPRECY (Supplier default) -// - Download https://github.com/HiPrecy/Touch-Lcd-LEO -// - Copy the downloaded DWIN_SET folder to the SD card. -// -// MKS (MKS-H43) (Supplier default) -// - Download https://github.com/makerbase-mks/MKS-H43 -// - Copy the downloaded DWIN_SET folder to the SD card. -// -// RELOADED (T5UID1) -// - Download https://github.com/Desuuuu/DGUS-reloaded/releases -// - Copy the downloaded DWIN_SET folder to the SD card. -// +/** + * DGUS Touch Display with DWIN OS. (Choose one.) + * ORIGIN : https://www.aliexpress.com/item/32993409517.html + * FYSETC : https://www.aliexpress.com/item/32961471929.html + * MKS : https://www.aliexpress.com/item/1005002008179262.html + * + * Flash display with DGUS Displays for Marlin: + * - Format the SD card to FAT32 with an allocation size of 4kb. + * - Download files as specified for your type of display. + * - Plug the microSD card into the back of the display. + * - Boot the display and wait for the update to complete. + * + * ORIGIN (Marlin DWIN_SET) + * - Download https://github.com/coldtobi/Marlin_DGUS_Resources + * - Copy the downloaded DWIN_SET folder to the SD card. + * + * FYSETC (Supplier default) + * - Download https://github.com/FYSETC/FYSTLCD-2.0 + * - Copy the downloaded SCREEN folder to the SD card. + * + * HIPRECY (Supplier default) + * - Download https://github.com/HiPrecy/Touch-Lcd-LEO + * - Copy the downloaded DWIN_SET folder to the SD card. + * + * MKS (MKS-H43) (Supplier default) + * - Download https://github.com/makerbase-mks/MKS-H43 + * - Copy the downloaded DWIN_SET folder to the SD card. + * + * RELOADED (T5UID1) + * - Download https://github.com/Desuuuu/DGUS-reloaded/releases + * - Copy the downloaded DWIN_SET folder to the SD card. + */ //#define DGUS_LCD_UI_ORIGIN //#define DGUS_LCD_UI_FYSETC //#define DGUS_LCD_UI_HIPRECY diff --git a/Marlin/src/gcode/host/M876.cpp b/Marlin/src/gcode/host/M876.cpp index 49994f44e6..c2a519d0ac 100644 --- a/Marlin/src/gcode/host/M876.cpp +++ b/Marlin/src/gcode/host/M876.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(HOST_PROMPT_SUPPORT) && DISABLED(EMERGENCY_PARSER) +#if HAS_GCODE_M876 #include "../../feature/host_actions.h" #include "../gcode.h" @@ -37,4 +37,4 @@ void GcodeSuite::M876() { } -#endif // HOST_PROMPT_SUPPORT && !EMERGENCY_PARSER +#endif // HAS_GCODE_M876 diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 8a85536aea..d86fcddb3a 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -701,6 +701,10 @@ #undef SERIAL_XON_XOFF #endif +#if ENABLED(HOST_PROMPT_SUPPORT) && DISABLED(EMERGENCY_PARSER) + #define HAS_GCODE_M876 1 +#endif + #if ENABLED(HOST_ACTION_COMMANDS) #ifndef ACTION_ON_PAUSE #define ACTION_ON_PAUSE "pause" diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 7c97ef791d..cf225eb2bd 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -184,12 +184,14 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; #endif #if LCD_BACKLIGHT_TIMEOUT + uint16_t MarlinUI::lcd_backlight_timeout; // Initialized by settings.load() millis_t MarlinUI::backlight_off_ms = 0; void MarlinUI::refresh_backlight_timeout() { backlight_off_ms = lcd_backlight_timeout ? millis() + lcd_backlight_timeout * 1000UL : 0; WRITE(LCD_BACKLIGHT_PIN, HIGH); } + #endif void MarlinUI::init() { diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index b0d739f061..c66df85024 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -541,6 +541,10 @@ void menu_configuration() { #if HAS_LCD_CONTRAST && LCD_CONTRAST_MIN < LCD_CONTRAST_MAX EDIT_ITEM_FAST(uint8, MSG_CONTRAST, &ui.contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, ui.refresh_contrast, true); #endif + + // + // Set display backlight / sleep timeout + // #if LCD_BACKLIGHT_TIMEOUT && LCD_BKL_TIMEOUT_MIN < LCD_BKL_TIMEOUT_MAX EDIT_ITEM(uint16_4, MSG_LCD_TIMEOUT_SEC, &ui.lcd_backlight_timeout, LCD_BKL_TIMEOUT_MIN, LCD_BKL_TIMEOUT_MAX, ui.refresh_backlight_timeout); #endif diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 1f482afeb4..6e373f6132 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -398,7 +398,7 @@ typedef struct SettingsDataStruct { uint8_t lcd_brightness; // M256 B // - // LCD_BACKLIGHT_TIMEOUT + // Display Sleep // #if LCD_BACKLIGHT_TIMEOUT uint16_t lcd_backlight_timeout; // (G-code needed) @@ -1130,7 +1130,7 @@ void MarlinSettings::postprocess() { } // - // LCD Backlight Timeout + // LCD Backlight / Sleep Timeout // #if LCD_BACKLIGHT_TIMEOUT EEPROM_WRITE(ui.lcd_backlight_timeout); @@ -1144,7 +1144,7 @@ void MarlinSettings::postprocess() { #if ENABLED(USE_CONTROLLER_FAN) const controllerFan_settings_t &cfs = controllerFan.settings; #else - controllerFan_settings_t cfs = controllerFan_defaults; + constexpr controllerFan_settings_t cfs = controllerFan_defaults; #endif EEPROM_WRITE(cfs); } @@ -2054,7 +2054,7 @@ void MarlinSettings::postprocess() { } // - // LCD Backlight Timeout + // LCD Backlight / Sleep Timeout // #if LCD_BACKLIGHT_TIMEOUT EEPROM_READ(ui.lcd_backlight_timeout); @@ -3094,7 +3094,7 @@ void MarlinSettings::reset() { TERN_(HAS_LCD_BRIGHTNESS, ui.brightness = LCD_BRIGHTNESS_DEFAULT); // - // LCD Backlight Timeout + // LCD Backlight / Sleep Timeout // #if LCD_BACKLIGHT_TIMEOUT ui.lcd_backlight_timeout = LCD_BACKLIGHT_TIMEOUT; diff --git a/buildroot/share/PlatformIO/scripts/common-dependencies.h b/buildroot/share/PlatformIO/scripts/common-dependencies.h index f004c54adb..4aa97c41ad 100644 --- a/buildroot/share/PlatformIO/scripts/common-dependencies.h +++ b/buildroot/share/PlatformIO/scripts/common-dependencies.h @@ -45,10 +45,6 @@ #define HAS_SAVED_POSITIONS #endif -#if ENABLED(HOST_PROMPT_SUPPORT) && DISABLED(EMERGENCY_PARSER) - #define HAS_GCODE_M876 -#endif - #if ENABLED(DUET_SMART_EFFECTOR) && PIN_EXISTS(SMART_EFFECTOR_MOD) #define HAS_SMART_EFF_MOD #endif diff --git a/platformio.ini b/platformio.ini index 952912b21d..29e81782dd 100644 --- a/platformio.ini +++ b/platformio.ini @@ -217,7 +217,7 @@ default_src_filter = + - - + - - - - - - + - - - - - -