The read operation now returns the actual used value instead of the maximum allowed acceleration value.
Change in memory:
Flash: + 78 bytes
SRAM: 0 bytes
AxisDistance returns uint16_t type and is currently compared with long double axis length. The axis lengths fit easily into uint16_t:
selectorLimits.lenght = 75
idlerLimits.lenght = 225
Change in memory:
Flash: -122 bytes
SRAM: 0 bytes
This commit produces the same savings as the compiler options -fshort-enums. Except by setting the types manually we save also 2 bytes of SRAM.
By default, the enum type is 2 bytes, with we can explictly set it to one byte when applicable to reduce code size.
Almost all the savings from from 'enum Mode' in leds.h.
Change in memory:
Flash: -116 bytes
SRAM: -2 bytes
It looks like copying the RegisterRec into a local variable (as it has been here before)
seems to confuse the compiler which then refuses to optimize the calls.
With this simple tweak the code is actually 8B shorter than before (while retaining the saved ~170B of RAM)
- Improve count() for non-power-of-two sizes by handling wrap-around
- Improve full() to use always use count(), which is cheaper in both
scenarios now
Delay reporting the cut command finished until the selector has returned
back to the cutting slot. This was done by adding ProgressCode::Homing
to the Cut Filament state machine. ProgressCode::ReturningSelector is
then used to wait for the selector to return back to the cut slot after
homing becomes valid again. Only then is the cut operation reported
finished and a new command can be processed e.g. Toolchange.
Change in memory:
Flash: +16 bytes
SRAM: 0 bytes
retract.Reset takes care of setting the green LED to blink.
Might as well turn of the red LED during reset just in case.
Change in memory:
Flash: -30 bytes
SRAM: 0 bytes
Fix a minor issue where once the FILAMENT_EJECTED error screen
is shown on the MK3S+, the LEDs will stay blinking red even after
the user has removed the filament and clicked "Done".
My proposal is to turn the LED off.
Steps to reproduce:
1. Boot up printer and MMU in a clean state
2. MK3S+: on the LCD click "Load to Nozzle"
3. Once the loading is done, click "Unload filament"
4. Once unloading is done, click "Eject filament"
5. FILAMENT_EJECTED MMU error screen appears on the printer's UI
6. Remove the filament and select "Done".
* Expected behavior: Blinking red LED turns off (or goes green).
* Actual behavior: LED continous to blink red with no error screen.
Change in memory:
Flash: +16 bytes
SRAM: 0 bytes
static_assert(sizeof(ChopConfU::S) == 4) would return 5 == 4
static_assert(sizeof(ChopConfU) == 4); would return 8 == 4
using uint32_t on all types instead of uint8_t fixes the issue
No change in memory
This seems to greatly improve overall homing reliability of Idler on MMUs which couldn't home with inserted filaments at all.
The only downside is the fact, that we may actually "home" a blocked Idler correctly.
Needs to be tweaked further to make it a production code.
But my primary concern now is the fact that it doesn't seem to help too much while homing over the too-tightened Idler cover.