Commit Graph

937 Commits (47cd8f1076267a7a3bf7a562fbeaa0e44a24cff5)

Author SHA1 Message Date
Alex Voinea 0e896cae85 Fix bootloader file generation 2022-11-15 10:43:34 +01:00
D.R.racer 299a31b765 Generate exactly 1 userInput event when button pressed (and held)
This PR is a different solution to what @gudnimg found in PR#233 / PFW-1404.

The benefit of this approach is the fact, that the button press event is generated when the button is pressed and not after it has been released.

The downside is obvious:
CPUFLASH: +28B
RAM: +1B
2022-11-15 07:19:20 +01:00
VintagePC 8ae82dd6b3 Build bootloader hex too 2022-11-11 16:28:39 +01:00
Alex Voinea a4463b9734 Selector: use freewheeling 2022-11-11 10:46:21 +01:00
Guðni Már Gilbert 21a3ceb2b2 PFW-1428 Enable UART1 receiver when the MMU is ready to process incoming messages 2022-11-01 06:39:10 +01:00
Guðni Már Gilbert 144725ab11
Merge pull request #232 from gudnimg/fix-firmware-panic-error-report
Fix issue where firmware panic error code is overwritten
2022-10-28 10:25:21 +00:00
Guðni Már Gilbert 394f290bfb Check for ERRInternal in command_base Step()
Reduces code size significantly
2022-10-27 15:40:15 +00:00
Guðni Már Gilbert ef4246dd9a Fix issue where firmware panic error code is overwritten
If QUEUE_FULL error happened, it would be overwritten as INTERNAL
and incorrectly display FW_RUNTIME_ERROR on MK3S.

The fix is to add handling for ERRInternal in every StepInner() and forward the error
to higher application layer
2022-10-26 20:39:28 +00:00
Guðni Már Gilbert 0e625dc551 circular_buffer: implement reset()
reset() discards any data in the buffer (head == tail)

Change in memory:
Flash: -116 bytes
SRAM: 0 bytes
2022-10-25 07:21:33 +02:00
Yuri D'Elia 8a0ede668c
Merge pull request #230 from wavexx/abort_tests
motion: Add tests for unscheduled moves in AbortPlannedMoves
2022-10-22 18:13:54 +02:00
Alex Voinea 09d3527f90
Merge pull request #225 from leptun/hwSanity_disable_steppers_after_test
hwSanity: Disable the steppers after test
2022-10-22 18:04:38 +02:00
Yuri D'Elia 3567a3dcd5 motion: Also test for the simplest case of a single+unplanned move 2022-10-22 17:40:28 +02:00
Yuri D'Elia 7053755b0e motion: Add tests for unscheduled moves in AbortPlannedMoves
This catches the previously untested #228
2022-10-22 17:21:08 +02:00
Guðni Már Gilbert 0506af08ac
Merge pull request #226 from gudnimg/parallel-unit-tests
Run unit tests in parallel when possible
2022-10-22 14:50:17 +00:00
Alex Voinea 3b85df297e hwSanity: Disable the steppers after test
flash: -44
RAM: 0
2022-10-22 16:48:48 +02:00
Guðni Már Gilbert 709b616948
Merge pull request #228 from gudnimg/abortplannedmoves-gudni
Empty the entire block_index queue when planned moves are aborted
2022-10-22 14:44:24 +00:00
Guðni Már Gilbert 7bbee87a08 Empty the entire block_index queue when planned moves are aborted 2022-10-22 14:10:31 +00:00
Yuri D'Elia e045225167
Merge pull request #229 from wavexx/catch2_v3_subrepo
Update Catch2 to v3.1.1
2022-10-22 16:05:31 +02:00
Guðni Már Gilbert 353affb9f3 Optimise Catch2 V3 includes + fix a few cases of missing includes 2022-10-22 15:41:44 +02:00
Guðni Már Gilbert 45f70e004c Update CMake integration for Catch v3.1.0 2022-10-22 15:41:44 +02:00
Yuri D'Elia 7ba6850411 Update Catch2 v3.1.1
Re-initialize subrepo
2022-10-22 15:41:14 +02:00
Guðni Már Gilbert 8c5c84cc17 Formatting 2022-10-21 22:03:08 +00:00
Guðni Már Gilbert d6029f7fd2 Move the other Ctest arguments into a single variable 2022-10-21 22:02:19 +00:00
Guðni Már Gilbert 745be900ef Run unit tests in parallel if possible
ReadResponse unit tests usually takes at least 30 seconds to run on my
computer, so having the unit tests run on more than one thread makes a
big difference.
2022-10-21 21:30:15 +00:00
Alex Voinea c2601d9a34 Revert accidental change
Fix windows build
2022-10-20 12:31:12 +02:00
D.R.racer 44454fd8d9 Fix formatting 2022-10-20 12:09:42 +02:00
D.R.racer 0e427ae37c Disable -mrelax due to avr-gcc/linker bugs 2022-10-20 12:09:42 +02:00
D.R.racer 2c6f2d7533 Only set new SGTHRS when planning a Homing move (not regular moves) 2022-10-20 12:09:42 +02:00
D.R.racer dc487c36b6 Remove Enable/Disable TMC when reiniting Movable axes
The previous commits by @leptun were correct but there has been one call to Disable axis (and TMC) hidden in `InitMovement`.
Therefore `InitMovement` has been split into 2 separate functions - one is there to allow the original full axis reinit, but the other `InitMovementNoReinitAxis` now only prepares a move without reiniting the TMC driver.

This approach seems to have the benefit of fixing the Idler creep over time.

The disadvantage is the fact, that setting StallGuard threshold is no longer called. We may need to add a special piece of code to handle/apply SGTHRS change at runtime like before.
2022-10-20 12:09:42 +02:00
Alex Voinea e2924c3506 Fix tests 2022-10-20 12:09:42 +02:00
Alex Voinea d7301b8d58 Adjust PWM_FREQ to allow lower current regulation
With PWM_FREQ=2 (fPWM = 2/512 fclk), the idler parked current was quite high since the setting was not actually respected (scientifically tested using hand). In order to allow lower current regulation in stealthchop, TBL and PWM_FREQ need to be adjusted. The lower both of these values, the better. Since TBL affects both stealthchop and spreadcycle, I chose to only modify PWM_FREQ.
This new PWM_FREQ results in half the previous stealthchop PWM frequency and also halves the low current limit (so if previously the minimum achievable current was 300mA, now it would be 150mA). I confirmed that this setting works correctly on a 24V supply. There is no audible noise from stealthChop PWM and the hold current is indeed reduced now (again, scientifically tested using my hand).
2022-10-20 12:09:42 +02:00
Alex Voinea 2d4aba2cde Reduce idler parked current (IHOLD) 2022-10-20 12:09:42 +02:00
Alex Voinea d77d31b883 Idler dynamic IHOLD adjustments 2022-10-20 12:09:42 +02:00
Guðni Már Gilbert bf89030423 user input test: Register enum with Catch
Now when REQUIRE ( a == b ) fails we see the values of a and b.
2022-10-17 17:27:47 +02:00
Yuri D'Elia a0c622ca99 cmake: Uniform Avr toolchain build with MK3
- Also set AR/RANLIB in the toolchain
- Fetch GCC version from bootstrap
2022-10-17 17:26:08 +02:00
Yuri D'Elia 9f39b373a9 build: Set -mrelax to remove trampolines while linking
Avr GCC automatically marks all indirect calls for trampoline generation
irregardless of the target.

This can be avoided by forcing -mshort-calls or using -mrelax that
removes the trampoline at link time (after the call location has been
proven to be reachable).

This saves 510 bytes on the current build (the trampolines section is
now empty as expected).
2022-10-17 17:22:21 +02:00
D.R.racer 08230b9d7a Increase version to 2.1.4 2022-10-12 07:45:21 +02:00
Guðni Már Gilbert 63404f7970 Format 2022-10-12 06:41:59 +02:00
Guðni Már Gilbert 01ef1191b0 Fix test_motion_ramp on Windows
* 'python3' is not valid on Windows

* call the .py file with 'python' command to prevent BAD_COMMAND error
2022-10-12 06:41:59 +02:00
D.R.racer 37f820e9a6 Prevent filament creep in activeSlot+1
This PR is just about tuning the intermediate Idler positions so that the filament gets relieved from the Pulley safely while the Extruder gears take over and the activeSlot+1 filament is not affected by its Idler bearing.
On a test bench filament was creeping about 0.5mm per Toolchange.
Changing the intermediate position from exact middle into 3/4 practically elliminated the creep. We can play with these constants more if necessary in the future.
2022-10-11 07:15:57 +02:00
DRracer 794b0d0a81
Fix unit tests on windows (#213)
* Fix unit tests on windows

Based on PR#210 from @gudnimg

Cherry picked just the necessary changes + reformatted the corresponding CMakeLists.txt

* Change cd -> WORKING_DIRECTORY even for test coverage report

* Update CMakeLists.txt

* Add `BYPRODUCTS` arguments

Co-authored-by: D.R.racer <drracer@drracer.eu>
Co-authored-by: vintagepc <53943260+vintagepc@users.noreply.github.com>
2022-10-11 07:15:01 +02:00
Alex Voinea 2ab3b96542 tests... 2022-10-11 07:13:42 +02:00
Alex Voinea e91e382c5c Fix tests
Pretty please 🥺
2022-10-11 07:13:42 +02:00
Alex Voinea 62a9abc235 Reformat modified files
rip history
maybe now?
2022-10-11 07:13:42 +02:00
Alex Voinea 55e8caa054 Always check for tmc errors 2022-10-11 07:13:42 +02:00
Alex Voinea ecb1696a12 Abort moves when tmc errors happen 2022-10-11 07:13:42 +02:00
Alex Voinea a71e8045b1 Clear tmc error flags on init 2022-10-11 07:13:42 +02:00
Alex Voinea abf25c2b3e Only check for errors if the driver is initialized 2022-10-11 07:13:42 +02:00
Alex Voinea 739f4cd2a3 Check for tmc2130 error flags 2022-10-11 07:13:42 +02:00
Alex Voinea 8b2de34e34 Make sure the error flags are turned into bools 2022-10-11 07:13:42 +02:00