If either Y_DUAL_STEPPER_DRIVERS or Z_DUAL_STEPPER_DRIVERS is defined
the compilation will fail with an error message. This configuration will likely
never be fully implemented unless someone from the community steps up.
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
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
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
Remove loading_flag and check for eFilamentAction instead which already
flags both load/unload (in addition to mmu actions).
Correctly transition from AutoLoad to Load as soon as the operation
cannot be cancelled anymore as opposed to resetting it.
A partial backup is needed in scenarios where the extruder may be
parked after a print is saved. For example during a blocking wait for the user in M600
Or during a MMU error screen.
A sudden power panic at this point would previously save the parked position
into EEPROM. When the print is recovered it would print in mid air.
This allows us to restore the position of all axis saved in RAM
If the extruder had been parked to the side for example
due to filament runout. Then the original position (before parking)
should now be restored
Change in memory:
Flash: +40 bytes
SRAM: 0 bytes
If a print has been saved to RAM such as during a filament runout,
do not overwrite these saved values if a sudden
power panic appears.
Additionally, change the saved types to be the same as power panic when saving to RAM:
- Bed target temperature is uint8_t (0 to 255) instead of float
- Extruder target temperature is uint16_t instead of float
Doing this change allows us to re-use the same global variables and
avoid creating local variables during power panic.
Change in memory:
Flash: -246 bytes
SRAM: -5 bytes
Code size increases a bit but keep in mind the PR
that broke the behavior "saved" 182 bytes:
https://github.com/prusa3d/Prusa-Firmware/pull/4063
So I think this code size increase is OK
Change in memory:
Flash: +84 bytes
SRAM: 0 bytes
These variables only range from 0 to 255
For the menus we currently need to convert fanSpeed to int16_t.
Change in memory:
Flash: -160 bytes
SRAM: -2 bytes
For non-time critical code it is more effcient to call a function
rather inlining each division operation.
Change in memory:
Flash: -122 bytes
SRAM: 0 bytes
When the extruder lifts up after completing the Purge line,
the baby stepping is not allowed for a short time. This dismisses
the menu. We don't want this behavior, so only apply the Z-axis requirement
when printing.
Change in memory:
Flash: +8 bytes
SRAM: 0 bytes