- No wait for heatup during host print recovery
- No extra Z lift when power panic happens during paused print
- added an extra EEPROM value
- fixed `EEPROM_LAST_ITEM`
- changed EEPROM version to 3.14.0
- Added `reset_uvlo` function
- Hide menus during recovering
- Un-/Load filament with FSensor active only show Load OR Unload depending on FS sate
- Host
- Reprint only shown when M79 timer is active
- Resume only shown when M79 timer active
- Stop print always shown when printing, paused and recovering
When the cs variable is loaded into RAM, cs.axis_ustep_resolution will always have some value and none of the 0xff values.
Change in memory:
Flash: -40 bytes
SRAM: 0 bytes
cancel_heatup is set to false inside wait_for_heater()
there is no need to do it before the function call
Change in memory:
Flash: -4 bytes
SRAM: 0 bytes
When a print is paused, card.sdprinting is set to false. Instead we can check
if the SD card has been mounted and try to close the file.
The closefile() method will check internally whether or not the file is open.
In the case of a Fan Error, the print is paused. If the nozzle is allowed to cool for a while before the print is stopped via the LCD, then the MMU will try to unload with a cold nozzle.
This can happen with ANY recoverable thermal errors.
In this commit I attempt to fix all scenarios. Including PFW-1544 where the nozzle is cooling down when the print has finished normally.
PFW-1544
PFW-1552
Change in memory:
Flash: +74 bytes
SRAM: 0 bytes
If the if statement is not true, then the st_synchronize call is not useful
The raise_z call above the if statement does not need it since it always calls st_synchronize (blocking move)
No change in memory
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
restore_file_from_sd function now supports any
filename extension. If a print was finished (to allow reprinting) then the
EEPROM filename and extension should always be valid.
Change in memory:
Flash: -312 bytes
SRAM: 0 bytes
If a planned request is activated when the current status is finished
then the firmware must wait for the response when the request
is expecting it
An example is a register read or a register write.
manage_response not return unless the register has been read or
written. And we must see the response to know if an error should be
reported.
Step to reproduce issue:
1. Fail selector homing
2. Select 'Tune' item
3. Observe issue. In this situation you can see the value
for the previous register read is shown. Which is 0. This very timing dependent and does not always happen.
4. Repeat step 2 until the issue appears. It may take a few times.
"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
- Only queue M26 for SD prints
- Add M110 to set gcode_LastN for host prints
- Remove one debug log to save resource (52 bytes)
Change in memory:
Flash: -14 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
Based on experience of mibehaving MMU2S units, a broader range seems to help more people in getting their unit to home properly.
Related to issue #4285
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
- Yes/no question --> Need to fix the bug related with the filename print --> if (lcd_show_fullscreen_message_yes_no_and_wait_P(altfilename, false, LCD_LEFT_BUTTON_CHOICE)==LCD_LEFT_BUTTON_CHOICE)
Host has to send back state with `M72 S1|0` to keep printer and host in sync
Changed LCD menu messages to `Set ready` and `Set not ready`
Updated translations
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
When a SD file is selected to print
save the DOS 8.3 extension into EEPROM.
After a power outage, the correct file extension is then
selected instead of always assuming it's ".gco"
This allows users to recover ".g" files.
Change in memory:
Flash: +104 bytes
SRAM: 0 bytes
There is no need to read one byte at a time. We can simply
read the whole block in one go. This saves some flash memory.
Change in memory:
Flash: -18 bytes
SRAM: 0 bytes
We can just read the whole EEPROM block since short filenames
are always null terminated. strcat_P will then apply the file extension
at the correct position.
Change in memory:
Flash: -24 bytes
SRAM: 0 bytes
If the saved printing type was USB, then EEPROM_FILENAME
does not contain anything. The firmware should also
not be trying to open a file on a SD card which is maybe
not even mounted.
Change in memory:
Flash: +12 bytes
SRAM: 0 bytes
There is no need to restrict how often the message is rendered.
It was being restricted to render every 1 second. We don't do
this for most of the static menus. So I propose this 1 second period
be removed.
Tested on MK3S+
Change in memory:
Flash: -168 bytes
SRAM: -8 bytes
My plan is to re-use this function in M79
in a later commit. The firmware doesn't
have a dedicated parser like Marlin 2.1
so this is my attempt to not duplicate the parsing of a quoted string in G-codes
Change in memory (MK3S+ Multilang):
Flash: -50 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
Setting this state notifies PrusaLink/PrusaConnect
that the printer is waiting for user input (attention).
Change in memory:
Flash: +12 bytes
SRAM: 0 bytes
power_on should not be modifying
EEPROM_MMU_ENABLED. The code is never
executed unless it's already been set.
Only disable EEPROM_MMU_ENABLED through Buttons::DisableMMU
Change in memory:
Flash: -18 bytes
SRAM: 0 bytes
Using uint16_t instead of uint32_t reduces code size
and probably is quicker to execute
OCR4C register is 2 bytes on ATmega2560
It's 1 byte on ATmega32u4 and ATmega16u4
Change in memory:
Flash: -80 bytes
SRAM: 0 bytes