瀏覽代碼

information that temp calibration active is active is stored to eeprom

PavelSindler 8 年之前
父節點
當前提交
fab71ff7cf
共有 3 個文件被更改,包括 4 次插入1 次删除
  1. 1 0
      Firmware/Configuration.h
  2. 2 1
      Firmware/Marlin_main.cpp
  3. 1 0
      Firmware/ultralcd.cpp

+ 1 - 0
Firmware/Configuration.h

@@ -45,6 +45,7 @@
 #define EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY (EEPROM_BED_CORRECTION_REAR-1)
 #define EEPROM_PRINT_FLAG (EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY-1)
 #define EEPROM_PROBE_TEMP_SHIFT (EEPROM_PRINT_FLAG - 2*5) //5 x int for storing pinda probe temp shift relative to 50 C; unit: motor steps 
+#define EEPROM_TEMP_CAL_ACTIVE (EEPROM_PROBE_TEMP_SHIFT - 1)
 
 // Currently running firmware, each digit stored as uint16_t.
 // The flavor differentiates a dev, alpha, beta, release candidate or a release version.

+ 2 - 1
Firmware/Marlin_main.cpp

@@ -1141,6 +1141,7 @@ void setup()
       // EEPROM_LANG to number lower than 0x0ff.
       // 1) Set a high power mode.
       eeprom_write_byte((uint8_t*)EEPROM_SILENT, 0);
+	  eeprom_write_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0);
   }
 
   // In the future, somewhere here would one compare the current firmware version against the firmware version stored in the EEPROM.
@@ -1150,7 +1151,7 @@ void setup()
     if (lang_selected >= LANG_NUM){
       lcd_mylang();
     }
-
+	temp_cal_active = eeprom_read_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE);
 	check_babystep(); //checking if Z babystep is in allowed range
 	
   if (calibration_status() == CALIBRATION_STATUS_ASSEMBLED ||

+ 1 - 0
Firmware/ultralcd.cpp

@@ -2245,6 +2245,7 @@ void lcd_pinda_calibration_menu()
 
 void lcd_temp_calibration_set() {
 	temp_cal_active = !temp_cal_active;
+	eeprom_update_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE, temp_cal_active);
 	digipot_init();
 	lcd_goto_menu(lcd_pinda_calibration_menu, 2);
 }