Fixes#3715
When a long-press is triggered, the LCD inactivity timer
needs to be restarted. This is done with lcd_timeoutToStatus.start()
This also fixes situations where a long-press is triggered, and the timer
times out immediately (because it was not reset properly)
Change in memory:
Flash: +8 bytes
SRAM: 0 bytes
Consume any pending LCD click after the temperature model calibration.
Since we're already in the status menu, the usual consume action is not
done automatically here.
The current code forces any warning to return the user to the status
screen in order to show the message.
Thermal anomaly warnings can repeat at very short intervals, making menu
navigation (to pause/tune the print) impossible.
We now check if the message to be displayed is the same and only force a
kickback for new messages.
This partially reverts https://github.com/prusa3d/Prusa-Firmware/pull/3600
since we need the string to be null terminated for ease of comparison.
We pad the status line at display time instead using the new
lcd_print_pad() function which achieves the same effect.
In ultralcd_init() do not use lcd_setstatuspgm() to initialize the
welcome message.
The internal call to lcd_finishstatus() requires the serial to be
already available. Split the function into lcd_padstatus() to pre-pad
the string and save some space.
Fix regression introduced in fc10ca3146.
Accept incoming serial commands without line numbers (assumed to be
injected by the host), but do not reset the last line count when doing
so.
Now that lcd_status_message is now initialised correctly at boot-up,
this for-loop is no longer required. Now lcd_status_message is
only set in lcd_updatestatus() which always calls lcd_finishstatus()
lcd_finishstatus() makes sure the message does not exceed 20 characters
Saves 34 bytes of flash
static variables are automatically zero initialised. Now that the
status line message is initialised in ultralcd_init(), we don't
need to set the variable in global scope.
Saves 22 bytes of flash and 1 byte of SRAM
Update fw-build.sh
- Output used space of each translation (easier to troubleshoot)
- Read config.h max size per translation
- output variant .map files (easier to troubleshoot and finding missing/unused messages)
This message is never actually shown on the LCD (it's immediately
overwritten by other content). It also include g-code in a translatable
string, which is not a good idea. It's also otherwise identical to
MSG_V2_CALIBRATION, which we should have used.
Just remove it and save some space in the process.
Having the original PRINTER_ACTIVE macro copied at multiple spots doesn't make sense.
Refactoring it into a non-inline function saved ~400 bytes of code.
It should be safe in terms of performance, all occurrences are at non-time critical spots.
Add an additional parameter to control the position of second choice
prompt position (while defaulting to the old).
This allows Yes/No prompts to be equally spaced.
Modify lcd_show_multiscreen_message_two_choices_and_wait_P to also
handle single-screen or empty (no-clear) prompts, making other functions
redundant. Saves 76 bytes.
Change existing functions to simply call
lcd_show_multiscreen_message_two_choices_and_wait_P with the correct
arguments.
This changes the prompt of existing Yes/No messages: the previous prompt
would use the last two lines of the LCD, while the new prompt is using
just the last line of the LCD instead.
Translation do not require updates, since the Yes/No translation was
already the same in both implementations.
Allow running the model checking during autotuning, with the only
exception being the parameter estimation stage where we alter the same
value which is used by the checker (done to conserve memory/code).
With previous changes the model checker will disable/enable itself when
passing through an unavailable R vector entry, allowing to start the
calibration by checking only the stages where the part fan is disabled.
The C/R0 values should be stable enough to provide a fail-safe mechanism
for printers of the same variant right from the factory.
Instead of assuming the model state is always valid, allow NAN values to
pass-through the various check/estimation stages.
This allows running the model checker with incomplete parameters (for
example, missing entries in the R vector) and resume automatically.
flash: -22
RAM: 0
menu_lcd_lcdupdate_func() takes care of starting lcd_timeoutToStatus if the knob is clicked.
When the knob is clicked we only want to back out of the menu.
This changes makes the menus slightly more conistant behind the scenes.
flash: -8
RAM: 0
When the menu is entered and left the function
menu_lcd_lcdupdate_func() takes care of resetting the timer.
Currently the firmware will reset the timer twice when the lcd_babystep_z menu is entered. This commit fixes that.
Split the planner sync code out of planner_abort_hard() so that we can
independently resync the planner position from the counters.
This is needed in xyzcal as we directly modify the stepper counters
(bypassing both planner and stepper).
Call this new function instead of planner_abort_hard() when leaving, so
that motion can resume in the middle of the gcode_M45 instruction.
We already disable the heaters upon entering, and the new temperature
isr doesn't perform any direct movement until we return to the main
loop.
This allows us to remove direct control of the soft_pwm interrupt from
the header, which is dangerous.
printer_smodel_check was incorrectly substituting the final " with a
null in the command to simplify the model string comparison, but in
doing so was also corrupting the next pop from the cmdqueue.
We can modify the current strchr_pointer as long as we *don't* change
it's length. This can cause an incorrect extra read from the queue,
resulting in the last command to be completely ignored.
cmdqueue will run commands when EOF is reached without returning to the
main loop, which is already incorrect.
However, since it needs to ensure the queue is empty, an st_synchronize
call can result in a re-entrant call to get_command, which will
reprocess EOF again. Even if we removed st_synchronize, another command
could be picked by an unsuspecting manage_inactivity() somewhere else.
Short-circuit EOF processing by closing the file early and checking for
the file state early in get_command.
This should fix#3549
Call this variable menu_block_mask instead. We don't need to know the
exact reason of why we're locking the menu.
We will be able to reuse this to prevent menu entry during more
activities in a cleaner way than testing for each condition as it's
currently done for both menu entry and longpress.
This allows us to use "M310 B0 W0.01" as a way to report the current
error continuosly on the serial without 1) more code and 2) without
preventing regular usage.
Use OCTOPRINT_ASK_* for the present form of actions. In these cases the
host will perform the pausing manouvers for us.
Use OCTOPRINT_* instead for the past tense forms when we are in charge.
Also always emit the action, whether we are or not sd-printing. This is
due to the new Stopped handling behaving correctly in either case.
If the user accepted to resume, do not wait for bed temperature when
recovering. This only adds a pointless delay when recovering a short
pause and doesn't really improve the recovery quality after a long
pause.
Do not allow resuming until all thermal and fan errors are clear.
Call the appropriate resume function when resuming a printing depending
on the saved_print state (is saved_print is available, then we always
need to resume from the saved state even when printing via usb).
Clear the Stopped state when resuming, so that commands can be accepted
again.