From 8a3f1d693281b11c957ff4d213bc28d666eaeebd Mon Sep 17 00:00:00 2001 From: teemuatlut Date: Sun, 20 Jan 2019 02:57:02 +0200 Subject: [PATCH] Fix chopper timing struct and initialization (#12943) --- Marlin/src/module/stepper_indirection.cpp | 12 ++++++------ Marlin/src/module/stepper_indirection.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Marlin/src/module/stepper_indirection.cpp b/Marlin/src/module/stepper_indirection.cpp index fe07d554b..74d5aa0c1 100644 --- a/Marlin/src/module/stepper_indirection.cpp +++ b/Marlin/src/module/stepper_indirection.cpp @@ -209,8 +209,8 @@ chopconf.tbl = 1; chopconf.toff = chopper_timing.toff; chopconf.intpol = INTERPOLATE; - chopconf.hend = chopper_timing.hstrt + 3; - chopconf.hstrt = chopper_timing.hend - 1; + chopconf.hend = chopper_timing.hend + 3; + chopconf.hstrt = chopper_timing.hstrt - 1; st.CHOPCONF(chopconf.sr); st.rms_current(mA, HOLD_MULTIPLIER); @@ -453,8 +453,8 @@ chopconf.tbl = 0b01; // blank_time = 24 chopconf.toff = chopper_timing.toff; chopconf.intpol = INTERPOLATE; - chopconf.hend = chopper_timing.hstrt + 3; - chopconf.hstrt = chopper_timing.hend - 1; + chopconf.hend = chopper_timing.hend + 3; + chopconf.hstrt = chopper_timing.hstrt - 1; st.CHOPCONF(chopconf.sr); st.rms_current(mA, HOLD_MULTIPLIER); @@ -546,8 +546,8 @@ TMC2660_n::CHOPCONF_t chopconf{0}; chopconf.tbl = 1; chopconf.toff = chopper_timing.toff; - chopconf.hend = chopper_timing.hstrt + 3; - chopconf.hstrt = chopper_timing.hend - 1; + chopconf.hend = chopper_timing.hend + 3; + chopconf.hstrt = chopper_timing.hstrt - 1; st.CHOPCONF(chopconf.sr); st.rms_current(mA); diff --git a/Marlin/src/module/stepper_indirection.h b/Marlin/src/module/stepper_indirection.h index b1c6ae76e..08559eccc 100644 --- a/Marlin/src/module/stepper_indirection.h +++ b/Marlin/src/module/stepper_indirection.h @@ -68,8 +68,8 @@ typedef struct { uint8_t toff; - int8_t hstrt; - uint8_t hend; + int8_t hend; + uint8_t hstrt; } chopper_timing_t; static constexpr chopper_timing_t chopper_timing = CHOPPER_TIMING;