This test ejects slots 0 to 4 and goes through the state machine
without creating any errors like FINDA_FLICKERS.
It also verifies the selector parking position is correct for each
ejected filament slot.
Waiting for the selector to return to the parked position after homing
is not enforced by the firmware and should therefore not be enforced by
the unit tests. There are some few exceptions to this, and for those
situations I added a parameter to SimulateSelectorHoming() called
waitForParkedPosition to explicitly wait for the selector to return to
the parked position if set to true. This is very useful when setting up
test cases in general and also allows us to control the behavior in each
test.
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.
Now the whole functionality takes +196B
As noted by @leptun, we cannot reliably check for >1 buttons pressed at once.
Since the left button is the least used, let's use it for invoking the HW EEPROM clear upon MMU start.
Based on long-term test experience - saves some code + prevents the user from entering hard-to-understand states.
Only Retry remains as the one and only way of recovering from errors.
This commit introduces a new set of registers 0x1e, 0x1f and 0x20 which allow reading and writing iRun current values for each axis/motor.
Please note the register contains raw TMC2130 iRun value which needs to be translated into mA to be understandable by people.
Translation table of iRun -> mA is present in tmc2130.cpp for now.