Add an emergency-command parser to MarlinSerial's RX interrupt.
The parser tries to find and execute M108,M112,M410 before the commands disappear in the RX-buffer.
To avoid false positives for M117, comments and commands followed by filenames (M23, M28, M30, M32, M33) are filtered.
This enables Marlin to receive and react on the Emergency command at all times - regardless of whether the buffers are full or not. It remains to convince hosts to send the commands. To inform the hosts about the new feature a new entry in the M115-report was made. "`EMERGENCY_CODES:M112,M108,M410;`".
The parser is fast. It only ever needs two switch decisions and one assignment of the new state for every character.
One problem remains. If the host has sent an incomplete line before sending an emergency command the emergency command could be omitted when the parser is in `state_IGNORE`.
In that case the host should send "\ncommand\n"
Also introduces M108 to break the waiting for the heaters in M109, M190 and M303.
Rename `cancel_heatup` to `wait_for_heatup` to better see the purpose.
Move and extend axis_unhomed test to deploy/stow_z_probe().
Move and extend position store/restore to deploy/stow_z_probe().
Now all kinds of probes can use the 'E' parameter in G29/M48.
Allen key probes can be used now for grid and 3-point levelling.
Deploying the Allen Key probe uses big moves in z direction.
Too dangerous for an unhomed z-axis.
Throw a compile time error when we try to configure an
Allen Key probe homing to z-min and having no other z-min-endstop.
Aim: Test probes in update_endstops only when activated
Changes:
Configurations
Add define for FIX_MOUNTED_PROBE to handle the situation where formerly ENDSTOPS_ONLY_FOR_HOMING had to be set, or lowering the nozzle below Z_PROBE_OFFSET_FROM_EXTRUDER could give an "endstop hit" message.
Add define for Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to indicate a common situation, that we have a probe but it is connected to an endstop pin
Add some comments
Shift some entries to have related things together.
Conditionals.h
We have a probe (HAS_Z_MIN_PROBE) if one of the pins is defined AND one of the probes is defined.
SanityCheck.h
Add some tests if the probe is connected and if we have defined a probe.
stepper.cpp
Changes to test the probe only when it is deployed (z_probe_is_active).
Test update_endstops() when the probe is deployed.
MarlinMain.cpp
a. set and reset z_probe_is_active in deploy_z_probe(), stow_z_probe() and dock_sled()
b. set and reset z_probe_is_active in the case a z-servo is moved to a defined position. The only remaining unhandled servo move is in M280 where we do not end in a defined position. If you want to handle a probe use M401/402
c. skip deploying/stowing when already deployed/stowed in the dedicated deploy/stow functions.
d. Handle the new FIX_MOUNTED_PROBE in parallel to a servo driven probe/endstop.
To do: In another PR. handle all probes in deploy/stow_z_probe.
Sort out SERVO_LEVELING vs. HAS_SERVO_ENDSTOPS.
rebased
corrected spelling
changed to #elif for error
Still with MIN_Z_HEIGHT_FOR_HOMING but con be done with (folder wide) search-replace when we have a better name.
Currently we use the probe exclusively as a device to find the build platform(bed).
For the currently supported setups this means, we use it as a additional min-endstop.
A triggered when not deployed probe disturbs the homing process for max-endstops.
Rename ENDSTOPPULLUP_ZPROBE to ENDSTOPPULLUP_ZMIN_PROBE
Rename Z_PROBE_ENDSTOP_INVERTING to Z_MIN_PROBE_ENDSTOP_INVERTING
Rename Z_PROBE_ENDSTOP to Z_MIN_PROBE_ENDSTOP
Rename DISABLE_Z_PROBE_ENDSTOP to DISABLE_Z_MIN_PROBE_ENDSTOP
Rename Z_PROBE_REPEATABILITY_TEST to Z_MIN_PROBE_REPEATABILITY_TEST
Rename Z_PROBE_ENDSTOP to Z_MIN_PROBE_ENDSTOP
Adjust comments accordingly
Remove Z_MAX check for the probe in update_endstops().
Using an delta related idea of @clefranc from #61,
extended to the general change for all setups.
Tested with Prusa i3, max-z-endstop and permanently triggered z-probe.
Worked for @clefranc's delta.
Just set up the pin. Don't move to a random position.
Simplify servo::move()
* servo::move() does not need the pin parameter - The pin is set during servo_init() with attach().
* servo::move() does not need a return value.
SERVO_LEVELING is the wrong condition to deactivate the servos.
Remove some temporary (Servo *) variables.
SanityCheck for the servo indexes.
- Make thermal protection for all hotends and/or bed into simple
switches
- Now enable `WATCH_TEMP_PERIOD` when `THERMAL_PROTECTION_HOTENDS` is
enabled
- Move detailed thermal parameters to `Configuration_adv.h`
- Add sanity checks to warn about old configurations
- Change `WATCH_TEMP_PERIOD` to seconds instead of milliseconds
Updated documentation in Configuration.h.
Cleaned up and commented some code relating to Z_PROBE_ENDSTOP.
Separated Z_MIN_ENDSTOP and Z_PROBE_ENDSTOP completely.
Documented some additional areas that should be addressed if Z_PROBE is
fully separated from Z_MIN or Z_MAX.
Fixed a documentation error in sanity checks. Servos start at 0 not 1.
- Some messages should not expire with `PROGRESS_MSG_EXPIRE`.
- Simplify conditional for progress bar with sanity checks.
- Rename `messageTick` to `expireStatusMillis` and make it the expire
time.
- Add `Conditionals.h` with calculated configuration values
- Add `SanityCheck.h` with checks for configuration errors
- Remove equivalent code from all configurations
- Move error checks from some sources to `SanityCheck.h` also
- Fix initialization of count_direction in stepper.cpp