Browse Source

Revert "force push"

This reverts commit 19e7838c20e499a093356ec34c2de0a81787856b.
NotaRobotexe 5 years ago
parent
commit
b5129ff2ec
4 changed files with 8 additions and 9 deletions
  1. 0 4
      Firmware/Marlin.h
  2. 3 3
      Firmware/eeprom.cpp
  3. 1 1
      Firmware/menu.cpp
  4. 4 1
      Firmware/ultralcd.cpp

+ 0 - 4
Firmware/Marlin.h

@@ -331,10 +331,6 @@ extern float retract_length_swap;
 extern float retract_recover_length_swap;
 #endif
 
-const char smooth1[] PROGMEM = "Smooth1";
-const char smooth2[] PROGMEM = "Smooth2";
-const char textured[] PROGMEM = "Textur1";
-const char *const defaultSheetNames[] PROGMEM = {smooth1,smooth2,textured};
 
 extern uint8_t host_keepalive_interval;
 

+ 3 - 3
Firmware/eeprom.cpp

@@ -8,6 +8,7 @@
 #include <avr/eeprom.h>
 #include <stdint.h>
 
+
 #include "language.h"
 
 #if 0
@@ -62,6 +63,7 @@ void eeprom_init()
     if (eeprom_read_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL) == 0xff) eeprom_update_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL, 0);
     if (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == 0xff) eeprom_update_byte(&(EEPROM_Sheets_base->active_sheet), 0);
     
+    char defaultSheetNames[3][8] = {"Smooth1","Smooth2","Textur1"};
     for (uint_least8_t i = 0; i < (sizeof(Sheets::s)/sizeof(Sheets::s[0])); ++i)
     {
         bool is_uninitialized = true;
@@ -71,10 +73,8 @@ void eeprom_init()
         }
         if(is_uninitialized)
         {
-            char sheet_PROGMEM_buffer[8];
-            strcpy_P(sheet_PROGMEM_buffer, (char *)pgm_read_word(&(defaultSheetNames[i])));
             for (uint_least8_t a = 0; a < sizeof(Sheet::name); ++a){
-                eeprom_write(&(EEPROM_Sheets_base->s[i].name[a]), sheet_PROGMEM_buffer[a]);
+                eeprom_write(&(EEPROM_Sheets_base->s[i].name[a]), defaultSheetNames[i][a]);
             }
         }
     }

+ 1 - 1
Firmware/menu.cpp

@@ -202,7 +202,7 @@ void menu_format_sheet_E(const Sheet &sheet_E, SheetFormatBuffer &buffer)
 //! @param[out] buffer for formatted output
 void menu_format_sheet_select_E(const Sheet &sheet_E, SheetFormatBuffer &buffer)
 {
-    uint_least8_t index = sprintf_P(buffer.c,PSTR("%-9.10S["), _T(MSG_SHEET));
+    uint_least8_t index = sprintf_P(buffer.c,PSTR("%.10S    ["), _T(MSG_SHEET));
     eeprom_read_block(&(buffer.c[index]), sheet_E.name, 7);
 	buffer.c[index + 7] = ']';
     buffer.c[index + 8] = '\0';

+ 4 - 1
Firmware/ultralcd.cpp

@@ -304,6 +304,7 @@ bool lcd_oldcardstatus;
 #endif
 
 uint8_t selected_sheet = 0;
+char defaultSheetNames[3][8] = {"Smooth1","Smooth2","Textur1"};
 
 bool ignore_click = false;
 bool wait_for_unclick;
@@ -6595,7 +6596,9 @@ static void lcd_reset_sheet()
     eeprom_read_block(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name));
     
 	menuData->initialized = false;
-    strcpy_P(menuData->name, (char *)pgm_read_word(&(defaultSheetNames[selected_sheet])));
+	for (uint_least8_t i = 0; i < sizeof(Sheet::name); ++i){
+		menuData->name[i] = defaultSheetNames[selected_sheet][i];
+    }
 
 	eeprom_update_word(reinterpret_cast<uint16_t *>(&(EEPROM_Sheets_base->s[selected_sheet].z_offset)),0xffff);
 	eeprom_update_block(menuData->name,EEPROM_Sheets_base->s[selected_sheet].name,sizeof(Sheet::name));