Change to saved_printing_type fixes few issues during power panic recovery

This commit is contained in:
3d-gussner 2024-03-13 11:18:20 +01:00
parent fc157d1f6c
commit 4e032f6f11
1 changed files with 3 additions and 3 deletions

View File

@ -427,7 +427,7 @@ void restore_print_from_eeprom(bool mbl_was_active) {
SERIAL_ECHOPGM(", feedmultiply:"); SERIAL_ECHOPGM(", feedmultiply:");
MYSERIAL.println(feedmultiply_rec); MYSERIAL.println(feedmultiply_rec);
if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_SD) if (saved_printing_type == PowerPanic::PRINT_TYPE_SD)
{ // M23 { // M23
restore_file_from_sd(); restore_file_from_sd();
} }
@ -469,12 +469,12 @@ void restore_print_from_eeprom(bool mbl_was_active) {
// SD: Position in file, USB: g-code line number // SD: Position in file, USB: g-code line number
uint32_t position = eeprom_read_dword((uint32_t*)(EEPROM_FILE_POSITION)); uint32_t position = eeprom_read_dword((uint32_t*)(EEPROM_FILE_POSITION));
if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_SD) if (saved_printing_type == PowerPanic::PRINT_TYPE_SD)
{ {
// Set a position in the file. // Set a position in the file.
enquecommandf_P(PSTR("M26 S%lu"), position); enquecommandf_P(PSTR("M26 S%lu"), position);
} }
else if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_HOST) else if (saved_printing_type == PowerPanic::PRINT_TYPE_HOST)
{ {
// Set line number // Set line number
enquecommandf_P(PSTR("M110 N%lu"), position); enquecommandf_P(PSTR("M110 N%lu"), position);