diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2021-11-29 16:41:48 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2021-11-29 16:56:29 -0500 |
commit | 520273e5abfd9a3dd899f94b5df602669b655ec0 (patch) | |
tree | 7b23ace366f9931704199e2584ecbc4809167b7e /klippy | |
parent | 54acca37ba642e8af4aeb9bdc6b538a639eb0320 (diff) | |
download | kutter-520273e5abfd9a3dd899f94b5df602669b655ec0.tar.gz kutter-520273e5abfd9a3dd899f94b5df602669b655ec0.tar.xz kutter-520273e5abfd9a3dd899f94b5df602669b655ec0.zip |
stepper: Support step_pulse_duration even on TMC drivers in UART/SPI mode
Commit 689231df changed the default step_pulse_duration to 100ns for
TMC drivers that are configured in UART/SPI mode, but it failed to
document that change in Config_Changes.md and Config_Reference.md.
Update those documents to reflect that change.
Update the code so that a user may specify a custom
step_pulse_duration even on TMC drivers that are configured in
UART/SPI mode. This may be useful for drivers that use a level
shifter on the step pin that requires more than a ~300ns to detect a
level change.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy')
-rw-r--r-- | klippy/stepper.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/klippy/stepper.py b/klippy/stepper.py index 2e6655ef..4a4f9ea4 100644 --- a/klippy/stepper.py +++ b/klippy/stepper.py @@ -14,6 +14,8 @@ class error(Exception): # Steppers ###################################################################### +MIN_BOTH_EDGE_DURATION = 0.000000200 + # Interface to low-level mcu and chelper code class MCU_stepper: def __init__(self, name, step_pin_params, dir_pin_params, step_dist, @@ -70,7 +72,8 @@ class MCU_stepper: self._step_pulse_duration = .000002 invert_step = self._invert_step sbe = int(self._mcu.get_constants().get('STEPPER_BOTH_EDGE', '0')) - if self._req_step_both_edge and sbe: + if (self._req_step_both_edge and sbe + and self._step_pulse_duration <= MIN_BOTH_EDGE_DURATION): # Enable stepper optimized step on both edges self._step_both_edge = True self._step_pulse_duration = 0. |