Browse Source

Some cleanup in ultralcd.h

pull/1/head
Scott Lahteine 8 years ago
parent
commit
1226ae1912
  1. 59
      Marlin/ultralcd.h

59
Marlin/ultralcd.h

@ -30,6 +30,13 @@
#define BUTTON_EXISTS(BN) (defined(BTN_## BN) && BTN_## BN >= 0) #define BUTTON_EXISTS(BN) (defined(BTN_## BN) && BTN_## BN >= 0)
#define BUTTON_PRESSED(BN) !READ(BTN_## BN) #define BUTTON_PRESSED(BN) !READ(BTN_## BN)
extern int preheatHotendTemp1,
preheatBedTemp1,
preheatFanSpeed1,
preheatHotendTemp2,
preheatBedTemp2,
preheatFanSpeed2;
int lcd_strlen(const char* s); int lcd_strlen(const char* s);
int lcd_strlen_P(const char* s); int lcd_strlen_P(const char* s);
void lcd_update(); void lcd_update();
@ -65,6 +72,18 @@
#define LCD_TIMEOUT_TO_STATUS 15000 #define LCD_TIMEOUT_TO_STATUS 15000
#if ENABLED(ULTIPANEL) #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. extern volatile uint8_t buttons; //the last checked buttons in a bit array.
void lcd_buttons_update(); void lcd_buttons_update();
void lcd_quick_feedback(); // Audible feedback for a button click - could also be visual void lcd_quick_feedback(); // Audible feedback for a button click - could also be visual
@ -74,15 +93,10 @@
#endif // FILAMENT_CHANGE_FEATURE #endif // FILAMENT_CHANGE_FEATURE
#else #else
FORCE_INLINE void lcd_buttons_update() {}
#endif
extern int preheatHotendTemp1, inline void lcd_buttons_update() {}
preheatBedTemp1,
preheatFanSpeed1, #endif
preheatHotendTemp2,
preheatBedTemp2,
preheatFanSpeed2;
#if ENABLED(FILAMENT_LCD_DISPLAY) #if ENABLED(FILAMENT_LCD_DISPLAY)
extern millis_t previous_lcd_status_ms; extern millis_t previous_lcd_status_ms;
@ -90,19 +104,6 @@
bool lcd_blink(); 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 #if ENABLED(REPRAPWORLD_KEYPAD) // is also ULTIPANEL and NEWPANEL
#define REPRAPWORLD_BTN_OFFSET 0 // bit offset into buttons for shift register values #define REPRAPWORLD_BTN_OFFSET 0 // bit offset into buttons for shift register values
@ -153,14 +154,14 @@
#endif #endif
#else //no LCD #else //no LCD
FORCE_INLINE void lcd_update() {} inline void lcd_update() {}
FORCE_INLINE void lcd_init() {} inline void lcd_init() {}
FORCE_INLINE bool lcd_hasstatus() { return false; } inline bool lcd_hasstatus() { return false; }
FORCE_INLINE void lcd_setstatus(const char* message, const bool persist=false) {UNUSED(message); UNUSED(persist);} 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);} inline void lcd_setstatuspgm(const char* message, const uint8_t level=0) { UNUSED(message); UNUSED(level); }
FORCE_INLINE void lcd_buttons_update() {} inline void lcd_buttons_update() {}
FORCE_INLINE void lcd_reset_alert_level() {} inline void lcd_reset_alert_level() {}
FORCE_INLINE bool lcd_detected(void) { return true; } inline bool lcd_detected(void) { return true; }
#define LCD_MESSAGEPGM(x) NOOP #define LCD_MESSAGEPGM(x) NOOP
#define LCD_ALERTMESSAGEPGM(x) NOOP #define LCD_ALERTMESSAGEPGM(x) NOOP

Loading…
Cancel
Save