Conversation
Add unit tests covering the save/restore invariant of TMCVirtualPinHelper (pwmthrs, tcoolthrs, thigh, en_pwm_mode, diag_pin_field) and the Kalico home_current switching logic in BaseTMCCurrentHelper. Establishes a baseline so the upstream TMC cleanup/refactor PRs (#7154, #7193) cannot silently regress the behavior. Signed-off-by: Rogerio Goncalves <rogerlz@gmail.com>
Currently TMC spi just drop the data that could be useful. Export that data. Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Reported by @poernahi. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This register is readable and contains the overvoltage and overtemp threshold settings. Signed-off-by: Hendrik Poernama <poernahi@gmail.com>
Code movement only; no code changes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Move shutdown checking from _do_enable() and _dos_disable() to new enable_disable_cb(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It's possible for a motor disable request to occur while processing a previous motor enable. Use a reactor mutex to ensure the two events are processed serially. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The event handler is registered with an incorrect event name, causing the handler to never be called. Signed-off-by: Maksim Bolgov maksim8024@gmail.com
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Upstream Klipper does not use Ruff; cherry-picks into Kalico need a format pass to match the project style (double quotes, line wrapping, blank lines between class members). This commit applies ruff-format over the files touched by the #6592/#6987/#7154/#7159/#7193 sync. Signed-off-by: Rogerio Goncalves <rogerlz@gmail.com>
If the first homing_move() raises (e.g. endstop never triggers during sensorless homing), the first try/finally only resets acceleration and leaves the stepper at home_current. The subsequent restore on success/second-home never executes, so the printer runs with home_current instead of run_current until the next successful home. Mirror the existing pattern from the second-home finally (restore both accel and current) so the failure path is symmetric. Signed-off-by: Rogerio Goncalves <rogerlz@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-picks the TMC catchup chain that brings Kalico's TMC drivers up to date with upstream Klipper, culminating in TMC2240 StealthChop (SG4) sensorless homing support.
Upstream commits included (in cherry-pick / merge order):
2cbb89597tmc2240: AddOTW_OV_VTHto ReadRegistersOTW_OV_VTHFieldFormattersTMCCommandHelpercleanupstepper:set_dir_invertedevent handler typoKalico-side commits on top:
test/test_tmc_homing.py: baseline unit tests (15) covering theTMCVirtualPinHelpersave/restore round trip and Kalico'shome_currentswitching logic, so the homing refactor cannot silently regress.homing.pyfirst-homefinallynow restores run current on failure (was only resetting accel; failed sensorless homing left the stepper athome_currentuntil the next successful home).