|
@@ -40,6 +40,11 @@ GcodeSuite gcode;
|
40
|
40
|
#include "../feature/host_actions.h"
|
41
|
41
|
#endif
|
42
|
42
|
|
|
43
|
+#if ENABLED(POWER_LOSS_RECOVERY)
|
|
44
|
+ #include "../sd/cardreader.h"
|
|
45
|
+ #include "../feature/power_loss_recovery.h"
|
|
46
|
+#endif
|
|
47
|
+
|
43
|
48
|
#include "../Marlin.h" // for idle() and suspend_auto_report
|
44
|
49
|
|
45
|
50
|
millis_t GcodeSuite::previous_move_ms;
|
|
@@ -86,8 +91,9 @@ int8_t GcodeSuite::get_target_extruder_from_command() {
|
86
|
91
|
* - Set the feedrate, if included
|
87
|
92
|
*/
|
88
|
93
|
void GcodeSuite::get_destination_from_command() {
|
|
94
|
+ bool seen[XYZE] = { false, false, false, false };
|
89
|
95
|
LOOP_XYZE(i) {
|
90
|
|
- if (parser.seen(axis_codes[i])) {
|
|
96
|
+ if ( (seen[i] = parser.seenval(axis_codes[i])) ) {
|
91
|
97
|
const float v = parser.value_axis_units((AxisEnum)i);
|
92
|
98
|
destination[i] = (axis_relative_modes[i] || relative_mode)
|
93
|
99
|
? current_position[i] + v
|
|
@@ -97,6 +103,11 @@ void GcodeSuite::get_destination_from_command() {
|
97
|
103
|
destination[i] = current_position[i];
|
98
|
104
|
}
|
99
|
105
|
|
|
106
|
+ #if ENABLED(POWER_LOSS_RECOVERY)
|
|
107
|
+ // Only update power loss recovery on moves with E
|
|
108
|
+ if ((seen[E_AXIS] || seen[Z_AXIS]) && IS_SD_PRINTING()) recovery.save();
|
|
109
|
+ #endif
|
|
110
|
+
|
100
|
111
|
if (parser.linearval('F') > 0)
|
101
|
112
|
feedrate_mm_s = MMM_TO_MMS(parser.value_feedrate());
|
102
|
113
|
|