diff --git a/Marlin/src/lcd/extensible_ui/ui_api.cpp b/Marlin/src/lcd/extensible_ui/ui_api.cpp index 401ae38d94..a9dabaa0ac 100644 --- a/Marlin/src/lcd/extensible_ui/ui_api.cpp +++ b/Marlin/src/lcd/extensible_ui/ui_api.cpp @@ -134,7 +134,6 @@ namespace ExtUI { // The ms count is return (uint32_t)(currTime / (F_CPU / 8000)); } - #endif // __SAM3X8E__ void delay_us(unsigned long us) { diff --git a/Marlin/src/lcd/extensible_ui/ui_api.h b/Marlin/src/lcd/extensible_ui/ui_api.h index ece25aa231..1a86680a1f 100644 --- a/Marlin/src/lcd/extensible_ui/ui_api.h +++ b/Marlin/src/lcd/extensible_ui/ui_api.h @@ -179,7 +179,7 @@ namespace ExtUI { #ifdef __SAM3X8E__ uint32_t safe_millis(); #else - #define safe_millis() millis() // TODO: Implement for AVR + FORCE_INLINE uint32_t safe_millis() { return millis(); } // TODO: Implement for AVR #endif void delay_us(unsigned long us); diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp index 8fbc75774b..8cecbd9182 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/ultralcd.cpp @@ -29,12 +29,31 @@ #if ENABLED(SDSUPPORT) #include "../sd/cardreader.h" #endif - #if ENABLED(EXTENSIBLE_UI) #define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80u) #endif #endif +#if HAS_SPI_LCD + #if ENABLED(STATUS_MESSAGE_SCROLLING) + uint8_t MarlinUI::status_scroll_offset; // = 0 + #if LONG_FILENAME_LENGTH > CHARSIZE * 2 * (LCD_WIDTH) + #define MAX_MESSAGE_LENGTH LONG_FILENAME_LENGTH + #else + #define MAX_MESSAGE_LENGTH CHARSIZE * 2 * (LCD_WIDTH) + #endif + #else + #define MAX_MESSAGE_LENGTH CHARSIZE * (LCD_WIDTH) + #endif +#elif ENABLED(EXTENSIBLE_UI) + #define MAX_MESSAGE_LENGTH 63 +#endif + +#ifdef MAX_MESSAGE_LENGTH + uint8_t MarlinUI::status_message_level; // = 0 + char MarlinUI::status_message[MAX_MESSAGE_LENGTH + 1]; +#endif + #if HAS_SPI_LCD #if HAS_GRAPHICAL_LCD @@ -75,24 +94,6 @@ uint8_t lcd_sd_status; #endif -#if ENABLED(STATUS_MESSAGE_SCROLLING) - uint8_t MarlinUI::status_scroll_offset; // = 0 - #if LONG_FILENAME_LENGTH > CHARSIZE * 2 * (LCD_WIDTH) - #define MAX_MESSAGE_LENGTH LONG_FILENAME_LENGTH - #else - #define MAX_MESSAGE_LENGTH CHARSIZE * 2 * (LCD_WIDTH) - #endif -#elif ENABLED(EXTENSIBLE_UI) - #define MAX_MESSAGE_LENGTH 63 -#else - #define MAX_MESSAGE_LENGTH CHARSIZE * (LCD_WIDTH) -#endif - -#if HAS_SPI_LCD || ENABLED(EXTENSIBLE_UI) - uint8_t MarlinUI::status_message_level; // = 0 - char MarlinUI::status_message[MAX_MESSAGE_LENGTH + 1]; -#endif - #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS bool MarlinUI::defer_return_to_status; #endif