Move la10c_reset into finishAndDisableStepper, which is called in both
via lcd_print_stop() and indirectly via M84, saving some space.
M84 is checked-for to determine a complete file, so it's a superior
candidate to G80 (which some people avoid due to MBL issues).
enable/disable_z behave differently when PSU_Delta is defined.
During powerpanic and kill however we do *really* need to save energy
and poweroff the motors.
Rename enable/disable_z as poweron/poweroff_z and define some aliases so
that we can use the low-level function where needed.
- In both uvlo_ and uvlo_tiny, calculate Z usteps properly and adjust
the Z position to a true fullstep before disabling the motor. This
avoids shifs during recovery.
- In uvlo_tiny, instead of moving up indefinitely, adjust Z just
once using the smallest move possible (new def UVLO_TINY_Z_AXIS_SHIFT)
- Perform all the uvlo/recovery processing in physical coordinates
and MBL off: there should be no automatic Z movement!
- Disable heaters in both handlers to conserve more power.
- Add timing information to uvlo_tiny too.
- During recovery, to switch between physical and logical positioning
introduce a new "PRUSA MBL" gcode as most of the procedure is
enqueued, and no existing gcode was available.
Correctly cleanup the printer state when stopping the current print:
- Disable interrupts while aborting the planner/queue to ensure
new serial commands are not inserted while aborting
- _Always_ call planner_abort_hard() to interrupt any pending move!
- Clear the saved_target, which might be set when calling stop
from within a paused state. Create a new function to clear the
paused state for future use.
- Do not disable/reset the MBL: doing so will destroy the ability to
restart correctly using M999.
Remove the conflicting and mostly useless card.paused flag (the printing
is either paused, or not) and switch to isPrintPaused only which
accounts for both cases (SD/USB) correctly.
Fix M27/getStatus to show the current real status of the SD print.
Synchronize the queue on M601, as required to precisely pause the print
at the correct instruction.
Alias M25 to M601, which when combined with PR #1899 fixes issue #1614.
Guard against incorrect usage in M601, M602 and M603.
Since the global feedrate can be similarly modified for moves ahead of
time, save the original feedrate in the planner as we do for
gcode_target.
This avoids having to undo feedmultiply (and machine limits!) from
"nominal_speed" as previously done.
Thanks @leptun
- Introduce raise_z_above to move Z carefully when the current position
is potentially unknown, using stallguard
- Use raise_z_above for:
* filament loading/unloading clearance
* extruder spacing when preheating (to avoid buildplate marks on PEI)
* before homing to avoid damaging the build plate and to avoid
repeated Z moves as well
Since raise_z_above is conditional, it will only raise when needed.
Calling raise_z_above when the extruder position is unknown and already
at maximum travel is safe and will prevent further vertical moves.
sketch/Marlin.h:178:17: warning: extra tokens at end of #undef directive
sketch/Marlin.h:181:24: warning: extra tokens at end of #undef directive
sketch/Marlin.h:182:0: warning: "enable_z" redefined