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
 #define MENU_ITEM(type, label, args...) do { \
71
 #define MENU_ITEM(type, label, args...) do { \
72
     if (_menuItemNr == _lineNr) { \
72
     if (_menuItemNr == _lineNr) { \
73
         if (lcdDrawUpdate) { \
73
         if (lcdDrawUpdate) { \
74
+            const char* _label_pstr = PSTR(label); \
74
             if ((encoderPosition / ENCODER_STEPS_PER_MENU_ITEM) == _menuItemNr) { \
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
             }else{\
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
         if (LCD_CLICKED && (encoderPosition / ENCODER_STEPS_PER_MENU_ITEM) == _menuItemNr) {\
81
         if (LCD_CLICKED && (encoderPosition / ENCODER_STEPS_PER_MENU_ITEM) == _menuItemNr) {\

+ 6
- 0
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

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

Loading…
Cancel
Save