If the timer is expired, then the timer is stopped. This is OK since
we are starting the timer again anyway
Change in memory:
Flash: -14 bytes
SRAM: 0 bytes
When long moves are planned and executed the USB timer can expire.
In PrusaSlicer 2.7.1 the Toolchange command (T0, T1, etc.) is sent while the USB timer is expired. This will trigger
a manual MMU unload in the firmware. Not only does this trigger a loud beep from the buzzer, but this will also significantly increase print time.
The issue only affects host prints. SD card printing does not have this issue.
Fixes#4551
The fix in this commit is the following:
If there are blocks queued while printing via host AND the USB timer is halfway expired WHILE executing a move. Then simply restart the timer to keep it alive.
Change in memory:
Flash: +62 bytes
SRAM: 0 bytes
This function is not specific to power panic. Some printer models
do not have power panic enabled.
This change fixes a build failure
No change in memory
"PRUSA uvlo" is the last g-code to be processed after the power panic
recovery. For host prints, we want to finish processing all these
g-codes and put the print in a paused state.
Currently I am using lcd_pause_print() but this may be simplified
later.
A new PrinterState is introduced PowerPanicWaitingForHost to
differentiate this paused state from the typical paused state.
In this new paused state the printer is waiting for the host to boot up
and send M79.
Once M79 is seen a new action is sent "// action:uvlo_recovery_ready"
It is up to the host software to then resume the print correctly. All
the needed information to resume the print is in EEPROM and can
be read by using the D3 g-code.
Change in memory:
Flash: +82 bytes
SRAM: 0 bytes
If recover_print was never called, then there should be
no need to call lcd_setstatuspgm(MSG_WELCOME) since
the status line was not modified by the power panic feature.
Change in memory:
Flash: -4 bytes
SRAM: 0 bytes
I would think that this should behave similarly as when stopping
the print via the LCD.
Changed UnconditionalSto()p to not close the SD card file
if we're using Octoprint. Then there shouldnt be any file open.
Some of the variables which were not reset:
isPrintPaused
pause_time
saved_start_position
saved_printing_type
Bed heater may be left on?
Change in memory:
Flash: -28 bytes
SRAM: 0 bytes
For remote hosts, when the timer is stopped, then also save the statistics.
Slightly refactored save_statistics function by removing the parameters.
The function parameters are always the same.
Change in memory:
Flash: -40 bytes
SRAM: 0 bytes
I changed the code a bit so it would compile
in Prusa Firmware.
The paused duration is no longer included in the
print time statistics.
Change in memory:
Flash: -122 bytes
SRAM: 0 bytes
To handle power panic in M600 we started saving
relevant data at the start of M600 gcode.
We are currently also saving the same data within
gcode_M600 which is saved on the stack. I propose
we just use the data already saved in SRAM to reduce
stack usage.
Change in memory:
Flash: -64 bytes
SRAM: 0 bytes
The idea is to have the host ping the printer periodically with a M79 to
enable certain features/UI. Using the usb_timer is not a good solution
for this as it depends on seeing a 'G' character
The LCD code, or whatever code is implementing the new functionality
will need to include host.h and check whether M79_timer_get_status()
returns 0 (timer not running) or 1 (timer is running).
I created a new file for the code host.cpp which we can use to expand
host related functionality and not clutter Marlin_main.cpp further.
Change in memory:
Flash: +104 bytes
SRAM: +5 bytes
While waiting for the nozzle to reach a certain temperature, a fan error
should disable the hotend heater. If printing, it will simply pause the print.
Previously the printer would wait for the nozzle to heat up before pausing the print
and turning off the hotend heater.
We rely on LcdCommands::LongPause and must return to the top level loop to process it.
Waiting in the while loop e.g. in M190 does not make sense.
Previously these preprocessor macros were always being inlined.
By making these into a function we can control the inlining
more directly.
The number of points on the mesh is also now constant. This means
'n' can now be float at compile time. This removes one uint8_t to float
conversion.
Change in memory:
Flash: -208 bytes
SRAM: 0 bytes