Commit Graph

837 Commits (fff1c471b4408d1fa64fbf0fea28a6a698a59857)

Author SHA1 Message Date
Guðni Már Gilbert fff1c471b4 Optimisation: make constructors constexpr
Cppcheck was complaining some member variables
are not initialised in the constructor.

Change in memory:
Flash: -186 bytes
SRAM: -15 bytes
2023-08-20 14:44:04 +00:00
Guðni Már Gilbert 0d76a0ea23 optimisation: sg_filter_threshold not initialised in constructor
Caught with Cppcheck

Change in memory:
Flash: -26 bytes
SRAM: 0 bytes
2023-08-20 13:45:48 +00:00
Yuri D'Elia 6a0f49859e cmake: Set source epoch from the HEAD commit
Allow to set the source epoch of the build with
PROJECT_VERSION_TIMESTAMP.

When unset fetch the commit timestamp of the current HEAD automatically
instead of leaving the source as 0.

We have no use for this on the MMU, but it doesn't hurt to follow what
we do on the MK3.
2023-08-17 14:19:59 +02:00
Alex Voinea 034d007b33
Merge pull request #290 from DRracer/usb-product-string-3
Change USB strings
2023-08-11 11:25:05 +03:00
D.R.racer ad2e944531 Change USB strings
as per request from the PrusaSlicer team + Content team
- product string
- manufacturer string
2023-08-11 10:14:59 +02:00
D.R.racer fbda9faa2a Set maximum bowden length to 1m 2023-08-10 16:08:07 +02:00
D.R.racer 11d205484b Update bowden length register documentation 2023-08-10 16:08:07 +02:00
D.R.racer 0419bdefd7 Perform up to maximumBowdenLength while unloading to FINDA
+ update unit tests to match the changed implementation
2023-08-10 16:08:07 +02:00
D.R.racer 19aa7ce2c7 Fixup sizeof register array after rebase 2023-08-10 16:08:07 +02:00
D.R.racer 41f5d29083 Set correct default bowden length 2023-08-10 16:08:07 +02:00
D.R.racer 570153b5d4 Increase version to 3.0.1 2023-08-10 16:08:07 +02:00
D.R.racer 3a105cab4a Introduce bowden length RW register (no runtime autotune)
contains updated unit tests
2023-08-10 16:08:07 +02:00
D.R.racer 77a8788821 Refactor registers a bit to make unit tests work again 2023-08-10 08:11:52 +02:00
D.R.racer 93a344bde8 Push the compiler into the optimization
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)
2023-08-10 08:11:52 +02:00
Guðni Már Gilbert 96985c1502 Fix unit test build
GCC 12 doesn't know AVR pgm_read_ptr()
2023-08-10 08:11:52 +02:00
Guðni Már Gilbert 1661132819 Move MMU registers into PROGMEM
Change in memory:
Flash: +34 bytes
SRAM: -170 bytes
2023-08-10 08:11:52 +02:00
D.R.racer f164a8afa0 Enforce specific ErrorCodes bitmask values 2023-07-28 17:11:43 +02:00
Guðni Már Gilbert 169925fc9f fixup
No change in memory
2023-07-28 17:11:43 +02:00
Guðni Már Gilbert 5293547094 optimisation: Add << operator to ErrorCode
Change in memory:
Flash: -54 bytes
SRAM: 0 bytes
2023-07-28 17:11:43 +02:00
Yuri D'Elia 35a89d2452 CircularIndex: add tests for non-power-of-two sizes 2023-07-28 15:48:14 +02:00
Yuri D'Elia aaee8cab30 CircularIndex: optimize further for non-power-of-two sizes
- 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
2023-07-28 15:48:14 +02:00
Yuri D'Elia 1979d02027 CircularIndex: Fix non-power-of-two sizes
Add back the option to use CircularIndex even for non-power-of-two sizes
for the future.
2023-07-28 15:48:14 +02:00
Yuri D'Elia 040cb8a2a6 catch2: Fix build with gcc13
Cherrypick of catch2 commit 52066dbc2a53f4c3ab2a418d03f93200a8245451 to
fix the build with gcc 13 without a full update.
2023-07-24 12:38:44 +02:00
D.R.racer 4fa352b4fa Change minimum unit tests to reflect new version nr 2023-07-20 10:28:58 +02:00
D.R.racer 77691e93fb Tag 2.1.9 as 3.0.0
Getting ready for the release
2023-07-20 10:28:58 +02:00
D.R.racer 554caa24fa Update build server config 2023-07-13 16:24:06 +02:00
Guðni Már Gilbert 1633d9af9b Optimise CircularIndex count
No change in memory
2023-06-12 07:42:25 +02:00
Guðni Már Gilbert edec4708b5 MMU-239 Add unit test for FINDA flickering when ejecting filament
The test case test the error recovery on all MMU slots.
2023-06-12 07:39:25 +02:00
Guðni Már Gilbert 4d3067213f MMU-239 Add unit test for ejecting slots 0-4
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.
2023-06-12 07:39:25 +02:00
Guðni Már Gilbert 48ea52bd47 Minor header cleanup 2023-06-12 07:39:25 +02:00
Guðni Már Gilbert ddc962067c Fix missing ErrorCode::RUNNING
This is needed in case we are recovering
from FINDA_FLICKERS
2023-06-12 07:39:25 +02:00
Guðni Már Gilbert 9842375450 Improve homing behavior more
Split the wait for HomingValid and the event where we wait
for the Selector/Idler status to go 'Ready' into separate functions
2023-06-12 07:04:51 +02:00
Guðni Már Gilbert bfc953f52d Add more strings to error output in unit tests 2023-06-12 07:04:51 +02:00
Guðni Már Gilbert eb52475819 Improve selector homing behavior in unit tests
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.
2023-06-12 07:04:51 +02:00
Guðni Már Gilbert 372045c38c Update cut filament unit test 2023-06-12 07:04:51 +02:00
Guðni Már Gilbert 20a2ee7d56 Fix false FINDA_FLICKERS on Toolchange retry
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
2023-06-12 07:04:51 +02:00
Guðni Már Gilbert 8c873c8a53 cleanup: unit tests: Remove unused Catch namespace 2023-06-04 14:06:03 +00:00
3d-gussner 6532a435d2 Update doxygen pulley values 2023-05-05 10:40:51 +02:00
3d-gussner 342b95bb18 Set pulley to 95mm/s for load and unload
Set pulley to 230mA current to prevent grinding
2023-05-04 11:01:11 +02:00
Guðni Már Gilbert 4a315c920a Remove redundant call to SetPairButOffOthers
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
2023-05-04 07:51:45 +02:00
Guðni Már Gilbert c096725674 modules: leds: Implement SetAllOff()
A helper function which turns of all LEDs
reduces code size :)

Change in memory:
Flash: -64 bytes
SRAM: 0 bytes
2023-05-02 07:32:27 +02:00
Guðni Már Gilbert c6c23e2c06 logic: eject_filament: reset LED state on OK event
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
2023-05-02 07:32:27 +02:00
Guðni Már Gilbert 605fa412ef Fix compiler error on GCC 12
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
2023-05-02 07:16:50 +02:00
D.R.racer 113f71330e Disable register 0x21 2023-03-14 18:14:26 +01:00
D.R.racer f07e206398 Hold/Resume Idler+Selector even after their homing errors
MMU-222
2023-03-14 18:14:02 +01:00
D.R.racer bafad408b7 Hold Idler and Selector even in logic::StartUp error handling
StartUp doesn't share the common ErrDisengageIdler code so the hold/resume must be used explicitly.
2023-03-14 18:08:10 +01:00
D.R.racer c4e23b687d Clean-up TMC SG trs setting in COOLCONF register 2023-03-14 17:58:11 +01:00
D.R.racer f0a633b4b6 Ignore Idler's SG signal from TMC when rolling over filaments 2023-03-14 17:58:11 +01:00
D.R.racer d9c4d61fec Optimize LED writes 2023-03-14 17:58:11 +01:00
D.R.racer b97b7561c6 Ignoring the diag pin (stallguard) completely in specified range
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.
2023-03-14 17:58:11 +01:00