Save/restore K during a power panic

This commit is contained in:
Yuri D'Elia 2019-06-03 16:53:55 +02:00
parent 84009e1e8e
commit bca5618145
2 changed files with 8 additions and 0 deletions

View File

@ -8801,6 +8801,9 @@ void uvlo_()
#endif
#endif
eeprom_update_word((uint16_t*)(EEPROM_EXTRUDEMULTIPLY), (uint16_t)extrudemultiply);
#ifdef LIN_ADVANCE
eeprom_update_float((float*)(EEPROM_UVLO_LA_K), extruder_advance_K);
#endif
// Finaly store the "power outage" flag.
if(sd_print) eeprom_update_byte((uint8_t*)EEPROM_UVLO, 1);
@ -9046,6 +9049,9 @@ void recover_machine_state_after_power_panic(bool bTiny)
#endif
#endif
extrudemultiply = (int)eeprom_read_word((uint16_t*)(EEPROM_EXTRUDEMULTIPLY));
#ifdef LIN_ADVANCE
extruder_advance_K = eeprom_read_float((float*)EEPROM_UVLO_LA_K);
#endif
}
void restore_print_from_eeprom() {

View File

@ -160,6 +160,8 @@
#define EEPROM_MBL_POINTS_NR (EEPROM_MBL_MAGNET_ELIMINATION -1) //uint8_t number of points in one exis for mesh bed leveling
#define EEPROM_MBL_PROBE_NR (EEPROM_MBL_POINTS_NR-1) //number of measurements for each point
#define EEPROM_MMU_STEALTH (EEPROM_MBL_PROBE_NR-1)
#define EEPROM_UVLO_LA_K (EEPROM_MMU_STEALTH-4) // float
// !!!!!
// !!!!! this is end of EEPROM section ... all updates MUST BE inserted before this mark !!!!!
// !!!!!