Minor patches to POWER_LOSS_RECOVERY
This commit is contained in:
parent
1ea222e6fc
commit
4b2af6ab48
3 changed files with 23 additions and 11 deletions
|
@ -66,15 +66,20 @@ static char sd_filename[MAXPATHNAMELENGTH];
|
||||||
if (e < HOTENDS - 1) SERIAL_CHAR(',');
|
if (e < HOTENDS - 1) SERIAL_CHAR(',');
|
||||||
}
|
}
|
||||||
SERIAL_EOL();
|
SERIAL_EOL();
|
||||||
SERIAL_PROTOCOLPGM("fanSpeeds: ");
|
|
||||||
for (uint8_t i = 0; i < FAN_COUNT; i++) {
|
|
||||||
SERIAL_PROTOCOL(job_recovery_info.fanSpeeds[i]);
|
|
||||||
if (i < FAN_COUNT - 1) SERIAL_CHAR(',');
|
|
||||||
}
|
|
||||||
SERIAL_EOL();
|
|
||||||
#if HAS_HEATED_BED
|
#if HAS_HEATED_BED
|
||||||
SERIAL_PROTOCOLLNPAIR("target_temperature_bed: ", job_recovery_info.target_temperature_bed);
|
SERIAL_PROTOCOLLNPAIR("target_temperature_bed: ", job_recovery_info.target_temperature_bed);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if FAN_COUNT
|
||||||
|
SERIAL_PROTOCOLPGM("fanSpeeds: ");
|
||||||
|
for (int8_t i = 0; i < FAN_COUNT; i++) {
|
||||||
|
SERIAL_PROTOCOL(job_recovery_info.fanSpeeds[i]);
|
||||||
|
if (i < FAN_COUNT - 1) SERIAL_CHAR(',');
|
||||||
|
}
|
||||||
|
SERIAL_EOL();
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAS_LEVELING
|
#if HAS_LEVELING
|
||||||
SERIAL_PROTOCOLPAIR("leveling: ", int(job_recovery_info.leveling));
|
SERIAL_PROTOCOLPAIR("leveling: ", int(job_recovery_info.leveling));
|
||||||
SERIAL_PROTOCOLLNPAIR(" fade: ", int(job_recovery_info.fade));
|
SERIAL_PROTOCOLLNPAIR(" fade: ", int(job_recovery_info.fade));
|
||||||
|
@ -180,7 +185,7 @@ void do_print_job_recovery() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save the current machine state to the "bin" file
|
* Save the current machine state to the power-loss recovery file
|
||||||
*/
|
*/
|
||||||
void save_job_recovery_info() {
|
void save_job_recovery_info() {
|
||||||
#if SAVE_INFO_INTERVAL_MS > 0
|
#if SAVE_INFO_INTERVAL_MS > 0
|
||||||
|
@ -209,10 +214,14 @@ void save_job_recovery_info() {
|
||||||
COPY(job_recovery_info.current_position, current_position);
|
COPY(job_recovery_info.current_position, current_position);
|
||||||
job_recovery_info.feedrate = feedrate_mm_s;
|
job_recovery_info.feedrate = feedrate_mm_s;
|
||||||
COPY(job_recovery_info.target_temperature, thermalManager.target_temperature);
|
COPY(job_recovery_info.target_temperature, thermalManager.target_temperature);
|
||||||
|
|
||||||
#if HAS_HEATED_BED
|
#if HAS_HEATED_BED
|
||||||
job_recovery_info.target_temperature_bed = thermalManager.target_temperature_bed;
|
job_recovery_info.target_temperature_bed = thermalManager.target_temperature_bed;
|
||||||
#endif
|
#endif
|
||||||
COPY(job_recovery_info.fanSpeeds, fanSpeeds);
|
|
||||||
|
#if FAN_COUNT
|
||||||
|
COPY(job_recovery_info.fanSpeeds, fanSpeeds);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAS_LEVELING
|
#if HAS_LEVELING
|
||||||
job_recovery_info.leveling = planner.leveling_active;
|
job_recovery_info.leveling = planner.leveling_active;
|
||||||
|
|
|
@ -40,13 +40,16 @@ typedef struct {
|
||||||
|
|
||||||
// Machine state
|
// Machine state
|
||||||
float current_position[NUM_AXIS], feedrate;
|
float current_position[NUM_AXIS], feedrate;
|
||||||
int16_t target_temperature[HOTENDS],
|
int16_t target_temperature[HOTENDS];
|
||||||
fanSpeeds[FAN_COUNT];
|
|
||||||
|
|
||||||
#if HAS_HEATED_BED
|
#if HAS_HEATED_BED
|
||||||
int16_t target_temperature_bed;
|
int16_t target_temperature_bed;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if FAN_COUNT
|
||||||
|
int16_t fanSpeeds[FAN_COUNT];
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAS_LEVELING
|
#if HAS_LEVELING
|
||||||
bool leveling;
|
bool leveling;
|
||||||
float fade;
|
float fade;
|
||||||
|
|
|
@ -1016,7 +1016,7 @@ void CardReader::printingHasFinished() {
|
||||||
const bool success = jobRecoveryFile.remove(&root, job_recovery_file_name);
|
const bool success = jobRecoveryFile.remove(&root, job_recovery_file_name);
|
||||||
#if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
|
#if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
|
||||||
SERIAL_PROTOCOLPGM("Power-loss file delete");
|
SERIAL_PROTOCOLPGM("Power-loss file delete");
|
||||||
serialprintPGM(success ? PSTR("d.") : PSTR(" failed."))
|
serialprintPGM(success ? PSTR("d.\n") : PSTR(" failed.\n"));
|
||||||
#else
|
#else
|
||||||
UNUSED(success);
|
UNUSED(success);
|
||||||
#endif
|
#endif
|
||||||
|
|
Reference in a new issue