Attempt to workaround the M73 C0|D0 visual issue
This is an attempt to enable alternation of time to print finish and time
to color change even in the last minute of time to color change, i.e. be
able to print "0:00C".
The proposed solution leverages the capability of the current FW to read
float values from the C|D parameter. This could have the raw benefit of
being able still to alternate this time on the LCD as "0:00C" (or
"<1min") if the slicer sends a non-zero but <1 time right before the
color change.
Co-authored-by: D.R.racer <drracer@drracer.eu>
Co-authored-by: 3d-gussner <3d.gussner@gmail.com>
A fairly mysterious situation happened recently in the MK3 branch.
After merging #3033 (change watchdogReset() into a single inline wdr instruction)
we were unable to flash languages.
Since it looked similarly suspicious like issue #2954 we started investigating deeply.
The problem was in the code as described in the comment in this PR.
Instead of resetting the encoder status when homing or leveling, simply
exit the move/liveZ menu.
When transitioning from idle->printing, axis move shouldn't be allowed
as it would insert moves during a print. This is always wrong.
The menu must be always dismissed. Instead of checking all places where
the menu could be active, automatically dimiss the menu from within
_lcd_move when homing/MBL is happening. The long-push function and the
settings menu checks if "axis move" is possible, and thus
prevent the user to re-enter the menu already.
When doing the first layer calibration, the _lcd_babystep_z is
automatically brought back after MBL has completed.
Technically we should do the same when entering/exiting the paused state
in _lcd_move. However, it's better to dismiss _any_ menu in
stop_and_save_print_to_ram/restore_print_from_ram_and_continue instead.
To be done later...
Move axis queues movements, which disrupts a normal print, homing (when
XY is combined) or MBL.
Likewise, "Disable steppers" only makes sense when the printer is fully
idle.
Only allow such actions when the printer is not active and/or in the
paused state.
Further restrict babystep insertion when the lcd_update is enabled by
toggling homing_flag when probing Z (where Z shouldn't be touched
anyway as it would disrupt the measurement)
Also reset the encoder value during mesh leveling.
The code around these calls _requires_ that the steps are immediately
processed and/or added to the subsequent planner moves.
The only part that doesn't care about immediate insertion is the
direct user-insertion though the lcd encoder.
User can en/disable the fan check during print. This is very useful in case of false positive
fan errors to let the user to decide to finish print with "faulty" fan.
It makes no sense keeping watchdogReset as a separate function which
must be called, since it only contains one instruction: "wdr".
Not only was the code larger by 32 bytes in total, but also much slower
(call+ret take 4 cycles together for no reason in this case).
Surprisingly, doing just this on FW 3.9.3 solves issue #2954 on the one
affected EINSY board, even though it makes not much sense (there must be
some other timing issue).
Another request from our Service dept. - the user shall be prevented
from skipping the intro wizard, because otherwise some preset/calibrated
features will look like not done - especially live-z calibration.
And since there are users, who send a machine to service to perform 1st
layer calibration only, they must not omit the Z-calibration at the
start after shipping.
As the `M0/M1` moved to the beginning of the parser
- parser would not be able to "find" `M1nn` command if the query was `M1` instead of `M1 `
- to be able to "stop/halt" without sending a string and display default message use gcode `M0`
- as there are no `M0nn` gcodes the parser can query `M0` without additional space needed as in `M1 `
- If `M73` `R,S,C,D` values set the LCD Info screen clock switchs between Remaining and Change time
- If Remaining time is 0 while Change time is >0 the clock switchs between Change time and actual printing time
- If Change is 0 while Remaining time is >0 the clock shows the Remaining time
- If both are 0 the clock shows the actual printing time
- `M73 C` values are shown in "Normal" mode
- `M73 D` values are shown in "Stealth" mode
- Changing the speed will try to calculate the espected times and show `?` behind `R` or `C`
- Add parameter `C` to gcode `M73`
- LCD Info screen switches to change time if last `M73` gcode contains `C` parameter
- Examples:
- `M73 P5 R120` will display on LCD ` SD 5% 02:00R ` if it is printing at 100% speed
- `M73 P5 R120 C60` will display on LCD ` SD 5% 01:00C ` if it is printing at 100% speed
Slicers can generate "Time to change/pause/user interaction" using `C<mins:0-65535>` parameter to "overwrite" the remaining print time.
To switch between time to change and remaining time just send in intervals `M73` with or without `C` parameter.
The functions find_bed_induction_sensor_point_* have conflicting
extern and inline declarations.
These are used outside of the compilation unit only, and thus there's no
point in defining them inline.
This causes a compilation failure at O1 and above, which is strangely
avoided at Os.
... looks like I've been able to reduce the code by 80B by using the
clamp999() function. There are other spots this function can be used as
well, I didn't touch those yet.
upon request from our Service dept. - it is to do the same stuff like
Shipping prep., but keep the printer's stats intact. Still, this has to
be verified and may undergo some further changes.