Browse Source

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

pull/1/head
daid303 12 years ago
parent
commit
a95dcd74e7
  1. 5
      Marlin/ultralcd.cpp
  2. 6
      Marlin/ultralcd_implementation_hitachi_HD44780.h

5
Marlin/ultralcd.cpp

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

6
Marlin/ultralcd_implementation_hitachi_HD44780.h

@ -198,6 +198,8 @@ static void lcd_implementation_status_screen()
lcd.print('/'); lcd.print('/');
lcd.print(itostr3left(tTarget)); lcd.print(itostr3left(tTarget));
lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
if (tTarget < 10)
lcd.print(' ');
# if EXTRUDERS > 1 || TEMP_SENSOR_BED != 0 # if EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
//If we have an 2nd extruder or heated bed, show that in the top right corner //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()
lcd.print('/'); lcd.print('/');
lcd.print(itostr3left(tTarget)); lcd.print(itostr3left(tTarget));
lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
if (tTarget < 10)
lcd.print(' ');
# endif//EXTRUDERS > 1 || TEMP_SENSOR_BED != 0 # endif//EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
#endif//LCD_WIDTH > 19 #endif//LCD_WIDTH > 19
@ -242,6 +246,8 @@ static void lcd_implementation_status_screen()
lcd.print('/'); lcd.print('/');
lcd.print(itostr3left(tTarget)); lcd.print(itostr3left(tTarget));
lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
if (tTarget < 10)
lcd.print(' ');
# else # else
lcd.setCursor(0,1); lcd.setCursor(0,1);
lcd.print('X'); lcd.print('X');

Loading…
Cancel
Save