Fix, improve Power Loss Recovery (#13703)

- Save and restore workspace offsets
- Add retract and purge (hidden) options
- Always restore axis relative modes
- Use added `G92.9` to do position restores
This commit is contained in:
Msq001
2019-04-16 07:53:39 +08:00
committed by Scott Lahteine
parent df75a606ff
commit 455ee23499
5 changed files with 127 additions and 59 deletions

View File

@@ -35,6 +35,8 @@
#define SAVE_INFO_INTERVAL_MS 0
//#define SAVE_EACH_CMD_MODE
//#define DEBUG_POWER_LOSS_RECOVERY
#define POWER_LOSS_PURGE_LEN 20
#define POWER_LOSS_RETRACT_LEN 10
typedef struct {
uint8_t valid_head;
@@ -42,6 +44,13 @@ typedef struct {
// Machine state
float current_position[NUM_AXIS];
#if HAS_HOME_OFFSET
float home_offset[XYZ];
#endif
#if HAS_POSITION_SHIFT
float position_shift[XYZ];
#endif
uint16_t feedrate;
#if HOTENDS > 1