Переглянути джерело

Add two defines and use LCD_STR_DEGREE with consistency

This saves 12 bytes of flash and 2 bytes of SRAM
Guðni Már Gilbert 2 роки тому
батько
коміт
da2c802440
3 змінених файлів з 21 додано та 19 видалено
  1. 2 2
      Firmware/lcd.cpp
  2. 11 9
      Firmware/lcd.h
  3. 8 8
      Firmware/ultralcd.cpp

+ 2 - 2
Firmware/lcd.cpp

@@ -953,7 +953,7 @@ const uint8_t lcd_chardata_confirm[8] PROGMEM = {
 
 void lcd_set_custom_characters_nextpage(void)
 {
-	lcd_createChar_P(1, lcd_chardata_arr2down);
-	lcd_createChar_P(2, lcd_chardata_confirm);
+	lcd_createChar_P(LCD_STR_ARROW_2_DOWN[0], lcd_chardata_arr2down);
+	lcd_createChar_P(LCD_STR_CONFIRM[0], lcd_chardata_confirm);
 }
 

+ 11 - 9
Firmware/lcd.h

@@ -189,15 +189,17 @@ private:
 
 
 //Custom characters defined in the first 8 characters of the LCD
-#define LCD_STR_BEDTEMP     "\x00"
-#define LCD_STR_DEGREE      "\x01"
-#define LCD_STR_THERMOMETER "\x02"
-#define LCD_STR_UPLEVEL     "\x03"
-#define LCD_STR_REFRESH     "\x04"
-#define LCD_STR_FOLDER      "\x05"
-#define LCD_STR_FEEDRATE    "\x06"
-#define LCD_STR_CLOCK       "\x07"
-#define LCD_STR_ARROW_RIGHT "\x7E" //from the default character set
+#define LCD_STR_BEDTEMP      "\x00"
+#define LCD_STR_DEGREE       "\x01"
+#define LCD_STR_ARROW_2_DOWN "\x01"
+#define LCD_STR_THERMOMETER  "\x02"
+#define LCD_STR_CONFIRM      "\x02"
+#define LCD_STR_UPLEVEL      "\x03"
+#define LCD_STR_REFRESH      "\x04"
+#define LCD_STR_FOLDER       "\x05"
+#define LCD_STR_FEEDRATE     "\x06"
+#define LCD_STR_CLOCK        "\x07"
+#define LCD_STR_ARROW_RIGHT  "\x7E" //from the default character set
 
 extern void lcd_set_custom_characters(void);
 extern void lcd_set_custom_characters_nextpage(void);

+ 8 - 8
Firmware/ultralcd.cpp

@@ -3246,7 +3246,7 @@ bool lcd_wait_for_pinda(float temp) {
 		lcd_print(ftostr3(current_temperature_pinda));
 		lcd_print('/');
 		lcd_print(ftostr3(temp));
-		lcd_print(LCD_STR_DEGREE);
+		lcd_print(LCD_STR_DEGREE[0]);
 		delay_keep_alive(1000);
 		serialecho_temperatures();
 		if (pinda_timeout.expired(8 * 60 * 1000ul)) { //PINDA cooling from 60 C to 35 C takes about 7 minutes
@@ -3266,7 +3266,7 @@ void lcd_wait_for_heater() {
 		lcd_print(ftostr3(degHotend(active_extruder)));
 		lcd_print('/');
 		lcd_print(ftostr3(degTargetHotend(active_extruder)));
-		lcd_print(LCD_STR_DEGREE);
+		lcd_print(LCD_STR_DEGREE[0]);
 }
 
 void lcd_wait_for_cool_down() {
@@ -3281,13 +3281,13 @@ void lcd_wait_for_cool_down() {
 		lcd_print(LCD_STR_THERMOMETER[0]);
 		lcd_print(ftostr3(degHotend(0)));
 		lcd_print("/0");		
-		lcd_print(LCD_STR_DEGREE);
+		lcd_print(LCD_STR_DEGREE[0]);
 
 		lcd_set_cursor(9, 4);
 		lcd_print(LCD_STR_BEDTEMP[0]);
 		lcd_print(ftostr3(degBed()));
 		lcd_print("/0");		
-		lcd_print(LCD_STR_DEGREE);
+		lcd_print(LCD_STR_DEGREE[0]);
 		delay_keep_alive(1000);
 		serialecho_temperatures();
 	}
@@ -3436,8 +3436,8 @@ static const char* lcd_display_message_fullscreen_nonBlocking_P(const char *msg,
         // Display the "next screen" indicator character.
         lcd_set_custom_characters_nextpage();
         lcd_set_cursor(19, 3);
-        // Display the down arrow.
-        lcd_print(char(1));
+        // Display the double down arrow.
+        lcd_print(LCD_STR_ARROW_2_DOWN[0]);
     }
 
     nlines = row;
@@ -3478,7 +3478,7 @@ void lcd_show_fullscreen_message_and_wait_P(const char *msg)
 		if (!multi_screen) {
 			lcd_set_cursor(19, 3);
 			// Display the confirm char.
-			lcd_print(char(2));
+			lcd_print(LCD_STR_CONFIRM[0]);
 		}
         // Wait for 5 seconds before displaying the next text.
         for (uint8_t i = 0; i < 100; ++ i) {
@@ -3504,7 +3504,7 @@ void lcd_show_fullscreen_message_and_wait_P(const char *msg)
 
 				lcd_set_cursor(19, 3);
 				// Display the confirm char.
-				lcd_print(char(2));
+				lcd_print(LCD_STR_CONFIRM[0]);
 			}
         }
     }