Browse Source

Some cleanup in ultralcd.h

Scott Lahteine 7 years ago
parent
commit
1226ae1912
1 changed files with 32 additions and 31 deletions
  1. 32
    31
      Marlin/ultralcd.h

+ 32
- 31
Marlin/ultralcd.h View File

30
   #define BUTTON_EXISTS(BN) (defined(BTN_## BN) && BTN_## BN >= 0)
30
   #define BUTTON_EXISTS(BN) (defined(BTN_## BN) && BTN_## BN >= 0)
31
   #define BUTTON_PRESSED(BN) !READ(BTN_## BN)
31
   #define BUTTON_PRESSED(BN) !READ(BTN_## BN)
32
 
32
 
33
+  extern int preheatHotendTemp1,
34
+             preheatBedTemp1,
35
+             preheatFanSpeed1,
36
+             preheatHotendTemp2,
37
+             preheatBedTemp2,
38
+             preheatFanSpeed2;
39
+
33
   int lcd_strlen(const char* s);
40
   int lcd_strlen(const char* s);
34
   int lcd_strlen_P(const char* s);
41
   int lcd_strlen_P(const char* s);
35
   void lcd_update();
42
   void lcd_update();
65
   #define LCD_TIMEOUT_TO_STATUS 15000
72
   #define LCD_TIMEOUT_TO_STATUS 15000
66
 
73
 
67
   #if ENABLED(ULTIPANEL)
74
   #if ENABLED(ULTIPANEL)
75
+
76
+    #define BLEN_A 0
77
+    #define BLEN_B 1
78
+    // Encoder click is directly connected
79
+    #if BUTTON_EXISTS(ENC)
80
+      #define BLEN_C 2
81
+      #define EN_C (_BV(BLEN_C))
82
+    #endif
83
+    #define EN_A (_BV(BLEN_A))
84
+    #define EN_B (_BV(BLEN_B))
85
+    #define EN_C (_BV(BLEN_C))
86
+
68
     extern volatile uint8_t buttons;  //the last checked buttons in a bit array.
87
     extern volatile uint8_t buttons;  //the last checked buttons in a bit array.
69
     void lcd_buttons_update();
88
     void lcd_buttons_update();
70
     void lcd_quick_feedback(); // Audible feedback for a button click - could also be visual
89
     void lcd_quick_feedback(); // Audible feedback for a button click - could also be visual
74
     #endif // FILAMENT_CHANGE_FEATURE
93
     #endif // FILAMENT_CHANGE_FEATURE
75
 
94
 
76
   #else
95
   #else
77
-    FORCE_INLINE void lcd_buttons_update() {}
78
-  #endif
79
 
96
 
80
-  extern int preheatHotendTemp1,
81
-             preheatBedTemp1,
82
-             preheatFanSpeed1,
83
-             preheatHotendTemp2,
84
-             preheatBedTemp2,
85
-             preheatFanSpeed2;
97
+    inline void lcd_buttons_update() {}
98
+
99
+  #endif
86
 
100
 
87
   #if ENABLED(FILAMENT_LCD_DISPLAY)
101
   #if ENABLED(FILAMENT_LCD_DISPLAY)
88
     extern millis_t previous_lcd_status_ms;
102
     extern millis_t previous_lcd_status_ms;
90
 
104
 
91
   bool lcd_blink();
105
   bool lcd_blink();
92
 
106
 
93
-  #if ENABLED(ULTIPANEL)
94
-    #define BLEN_A 0
95
-    #define BLEN_B 1
96
-    // Encoder click is directly connected
97
-    #if BUTTON_EXISTS(ENC)
98
-      #define BLEN_C 2
99
-      #define EN_C (_BV(BLEN_C))
100
-    #endif
101
-    #define EN_A (_BV(BLEN_A))
102
-    #define EN_B (_BV(BLEN_B))
103
-    #define EN_C (_BV(BLEN_C))
104
-  #endif
105
-
106
   #if ENABLED(REPRAPWORLD_KEYPAD) // is also ULTIPANEL and NEWPANEL
107
   #if ENABLED(REPRAPWORLD_KEYPAD) // is also ULTIPANEL and NEWPANEL
107
 
108
 
108
     #define REPRAPWORLD_BTN_OFFSET 0 // bit offset into buttons for shift register values
109
     #define REPRAPWORLD_BTN_OFFSET 0 // bit offset into buttons for shift register values
153
   #endif
154
   #endif
154
 
155
 
155
 #else //no LCD
156
 #else //no LCD
156
-  FORCE_INLINE void lcd_update() {}
157
-  FORCE_INLINE void lcd_init() {}
158
-  FORCE_INLINE bool lcd_hasstatus() { return false; }
159
-  FORCE_INLINE void lcd_setstatus(const char* message, const bool persist=false) {UNUSED(message); UNUSED(persist);}
160
-  FORCE_INLINE void lcd_setstatuspgm(const char* message, const uint8_t level=0) {UNUSED(message); UNUSED(level);}
161
-  FORCE_INLINE void lcd_buttons_update() {}
162
-  FORCE_INLINE void lcd_reset_alert_level() {}
163
-  FORCE_INLINE bool lcd_detected(void) { return true; }
157
+  inline void lcd_update() {}
158
+  inline void lcd_init() {}
159
+  inline bool lcd_hasstatus() { return false; }
160
+  inline void lcd_setstatus(const char* message, const bool persist=false) { UNUSED(message); UNUSED(persist); }
161
+  inline void lcd_setstatuspgm(const char* message, const uint8_t level=0) { UNUSED(message); UNUSED(level); }
162
+  inline void lcd_buttons_update() {}
163
+  inline void lcd_reset_alert_level() {}
164
+  inline bool lcd_detected(void) { return true; }
164
 
165
 
165
   #define LCD_MESSAGEPGM(x) NOOP
166
   #define LCD_MESSAGEPGM(x) NOOP
166
   #define LCD_ALERTMESSAGEPGM(x) NOOP
167
   #define LCD_ALERTMESSAGEPGM(x) NOOP
167
 
168
 
168
-#endif //ULTRA_LCD
169
+#endif // ULTRA_LCD
169
 
170
 
170
-#endif //ULTRALCD_H
171
+#endif // ULTRALCD_H

Loading…
Cancel
Save