Browse Source

Fix some of the duplicated PSTRs, saving 500bytes of flash with LCD on.

daid303 12 years ago
parent
commit
a95dcd74e7
2 changed files with 9 additions and 2 deletions
  1. 3
    2
      Marlin/ultralcd.cpp
  2. 6
    0
      Marlin/ultralcd_implementation_hitachi_HD44780.h

+ 3
- 2
Marlin/ultralcd.cpp View File

@@ -71,10 +71,11 @@ static void menu_action_setting_edit_long5(const char* pstr, unsigned long* ptr,
71 71
 #define MENU_ITEM(type, label, args...) do { \
72 72
     if (_menuItemNr == _lineNr) { \
73 73
         if (lcdDrawUpdate) { \
74
+            const char* _label_pstr = PSTR(label); \
74 75
             if ((encoderPosition / ENCODER_STEPS_PER_MENU_ITEM) == _menuItemNr) { \
75
-                lcd_implementation_drawmenu_ ## type ## _selected (_drawLineNr, PSTR(label) , ## args ); \
76
+                lcd_implementation_drawmenu_ ## type ## _selected (_drawLineNr, _label_pstr , ## args ); \
76 77
             }else{\
77
-                lcd_implementation_drawmenu_ ## type (_drawLineNr, PSTR(label) , ## args ); \
78
+                lcd_implementation_drawmenu_ ## type (_drawLineNr, _label_pstr , ## args ); \
78 79
             }\
79 80
         }\
80 81
         if (LCD_CLICKED && (encoderPosition / ENCODER_STEPS_PER_MENU_ITEM) == _menuItemNr) {\

+ 6
- 0
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

@@ -198,6 +198,8 @@ static void lcd_implementation_status_screen()
198 198
     lcd.print('/');
199 199
     lcd.print(itostr3left(tTarget));
200 200
     lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
201
+    if (tTarget < 10)
202
+        lcd.print(' ');
201 203
 
202 204
 # if EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
203 205
     //If we have an 2nd extruder or heated bed, show that in the top right corner
@@ -215,6 +217,8 @@ static void lcd_implementation_status_screen()
215 217
     lcd.print('/');
216 218
     lcd.print(itostr3left(tTarget));
217 219
     lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
220
+    if (tTarget < 10)
221
+        lcd.print(' ');
218 222
 # endif//EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
219 223
 #endif//LCD_WIDTH > 19
220 224
 
@@ -242,6 +246,8 @@ static void lcd_implementation_status_screen()
242 246
     lcd.print('/');
243 247
     lcd.print(itostr3left(tTarget));
244 248
     lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
249
+    if (tTarget < 10)
250
+        lcd.print(' ');
245 251
 #  else
246 252
     lcd.setCursor(0,1);
247 253
     lcd.print('X');

Loading…
Cancel
Save