123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- #ifndef _POWER_LOSS_RECOVERY_H_
- #define _POWER_LOSS_RECOVERY_H_
- #include "cardreader.h"
- #include "types.h"
- #include "MarlinConfig.h"
- #define SAVE_INFO_INTERVAL_MS 0
- typedef struct {
- uint8_t valid_head;
-
- float current_position[NUM_AXIS], feedrate;
- #if HOTENDS > 1
- uint8_t active_hotend;
- #endif
- int16_t target_temperature[HOTENDS];
- #if HAS_HEATED_BED
- int16_t target_temperature_bed;
- #endif
- #if FAN_COUNT
- int16_t fanSpeeds[FAN_COUNT];
- #endif
- #if HAS_LEVELING
- bool leveling;
- float fade;
- #endif
-
- uint8_t cmd_queue_index_r, commands_in_queue;
- char command_queue[BUFSIZE][MAX_CMD_SIZE];
-
- char sd_filename[MAXPATHNAMELENGTH];
- uint32_t sdpos;
-
- millis_t print_job_elapsed;
- uint8_t valid_foot;
- } job_recovery_info_t;
- extern job_recovery_info_t job_recovery_info;
- enum JobRecoveryPhase : unsigned char {
- JOB_RECOVERY_IDLE,
- JOB_RECOVERY_MAYBE,
- JOB_RECOVERY_YES,
- JOB_RECOVERY_DONE
- };
- extern JobRecoveryPhase job_recovery_phase;
- #if HAS_LEVELING
- #define APPEND_CMD_COUNT 9
- #else
- #define APPEND_CMD_COUNT 7
- #endif
- extern char job_recovery_commands[BUFSIZE + APPEND_CMD_COUNT][MAX_CMD_SIZE];
- extern uint8_t job_recovery_commands_count;
- void check_print_job_recovery();
- void save_job_recovery_info();
- #endif
|