diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index 6b143163b9..fff2c36144 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -30,6 +30,13 @@ #define BUTTON_EXISTS(BN) (defined(BTN_## BN) && BTN_## BN >= 0) #define BUTTON_PRESSED(BN) !READ(BTN_## BN) + extern int preheatHotendTemp1, + preheatBedTemp1, + preheatFanSpeed1, + preheatHotendTemp2, + preheatBedTemp2, + preheatFanSpeed2; + int lcd_strlen(const char* s); int lcd_strlen_P(const char* s); void lcd_update(); @@ -65,6 +72,18 @@ #define LCD_TIMEOUT_TO_STATUS 15000 #if ENABLED(ULTIPANEL) + + #define BLEN_A 0 + #define BLEN_B 1 + // Encoder click is directly connected + #if BUTTON_EXISTS(ENC) + #define BLEN_C 2 + #define EN_C (_BV(BLEN_C)) + #endif + #define EN_A (_BV(BLEN_A)) + #define EN_B (_BV(BLEN_B)) + #define EN_C (_BV(BLEN_C)) + extern volatile uint8_t buttons; //the last checked buttons in a bit array. void lcd_buttons_update(); void lcd_quick_feedback(); // Audible feedback for a button click - could also be visual @@ -74,15 +93,10 @@ #endif // FILAMENT_CHANGE_FEATURE #else - FORCE_INLINE void lcd_buttons_update() {} - #endif - extern int preheatHotendTemp1, - preheatBedTemp1, - preheatFanSpeed1, - preheatHotendTemp2, - preheatBedTemp2, - preheatFanSpeed2; + inline void lcd_buttons_update() {} + + #endif #if ENABLED(FILAMENT_LCD_DISPLAY) extern millis_t previous_lcd_status_ms; @@ -90,19 +104,6 @@ bool lcd_blink(); - #if ENABLED(ULTIPANEL) - #define BLEN_A 0 - #define BLEN_B 1 - // Encoder click is directly connected - #if BUTTON_EXISTS(ENC) - #define BLEN_C 2 - #define EN_C (_BV(BLEN_C)) - #endif - #define EN_A (_BV(BLEN_A)) - #define EN_B (_BV(BLEN_B)) - #define EN_C (_BV(BLEN_C)) - #endif - #if ENABLED(REPRAPWORLD_KEYPAD) // is also ULTIPANEL and NEWPANEL #define REPRAPWORLD_BTN_OFFSET 0 // bit offset into buttons for shift register values @@ -153,18 +154,18 @@ #endif #else //no LCD - FORCE_INLINE void lcd_update() {} - FORCE_INLINE void lcd_init() {} - FORCE_INLINE bool lcd_hasstatus() { return false; } - FORCE_INLINE void lcd_setstatus(const char* message, const bool persist=false) {UNUSED(message); UNUSED(persist);} - FORCE_INLINE void lcd_setstatuspgm(const char* message, const uint8_t level=0) {UNUSED(message); UNUSED(level);} - FORCE_INLINE void lcd_buttons_update() {} - FORCE_INLINE void lcd_reset_alert_level() {} - FORCE_INLINE bool lcd_detected(void) { return true; } + inline void lcd_update() {} + inline void lcd_init() {} + inline bool lcd_hasstatus() { return false; } + inline void lcd_setstatus(const char* message, const bool persist=false) { UNUSED(message); UNUSED(persist); } + inline void lcd_setstatuspgm(const char* message, const uint8_t level=0) { UNUSED(message); UNUSED(level); } + inline void lcd_buttons_update() {} + inline void lcd_reset_alert_level() {} + inline bool lcd_detected(void) { return true; } #define LCD_MESSAGEPGM(x) NOOP #define LCD_ALERTMESSAGEPGM(x) NOOP -#endif //ULTRA_LCD +#endif // ULTRA_LCD -#endif //ULTRALCD_H +#endif // ULTRALCD_H