Fix chopper timing struct and initialization (#12943)

2.0.x
teemuatlut 6 years ago committed by Scott Lahteine
parent c6991109b7
commit 8a3f1d6932

@ -209,8 +209,8 @@
chopconf.tbl = 1; chopconf.tbl = 1;
chopconf.toff = chopper_timing.toff; chopconf.toff = chopper_timing.toff;
chopconf.intpol = INTERPOLATE; chopconf.intpol = INTERPOLATE;
chopconf.hend = chopper_timing.hstrt + 3; chopconf.hend = chopper_timing.hend + 3;
chopconf.hstrt = chopper_timing.hend - 1; chopconf.hstrt = chopper_timing.hstrt - 1;
st.CHOPCONF(chopconf.sr); st.CHOPCONF(chopconf.sr);
st.rms_current(mA, HOLD_MULTIPLIER); st.rms_current(mA, HOLD_MULTIPLIER);
@ -453,8 +453,8 @@
chopconf.tbl = 0b01; // blank_time = 24 chopconf.tbl = 0b01; // blank_time = 24
chopconf.toff = chopper_timing.toff; chopconf.toff = chopper_timing.toff;
chopconf.intpol = INTERPOLATE; chopconf.intpol = INTERPOLATE;
chopconf.hend = chopper_timing.hstrt + 3; chopconf.hend = chopper_timing.hend + 3;
chopconf.hstrt = chopper_timing.hend - 1; chopconf.hstrt = chopper_timing.hstrt - 1;
st.CHOPCONF(chopconf.sr); st.CHOPCONF(chopconf.sr);
st.rms_current(mA, HOLD_MULTIPLIER); st.rms_current(mA, HOLD_MULTIPLIER);
@ -546,8 +546,8 @@
TMC2660_n::CHOPCONF_t chopconf{0}; TMC2660_n::CHOPCONF_t chopconf{0};
chopconf.tbl = 1; chopconf.tbl = 1;
chopconf.toff = chopper_timing.toff; chopconf.toff = chopper_timing.toff;
chopconf.hend = chopper_timing.hstrt + 3; chopconf.hend = chopper_timing.hend + 3;
chopconf.hstrt = chopper_timing.hend - 1; chopconf.hstrt = chopper_timing.hstrt - 1;
st.CHOPCONF(chopconf.sr); st.CHOPCONF(chopconf.sr);
st.rms_current(mA); st.rms_current(mA);

@ -68,8 +68,8 @@
typedef struct { typedef struct {
uint8_t toff; uint8_t toff;
int8_t hstrt; int8_t hend;
uint8_t hend; uint8_t hstrt;
} chopper_timing_t; } chopper_timing_t;
static constexpr chopper_timing_t chopper_timing = CHOPPER_TIMING; static constexpr chopper_timing_t chopper_timing = CHOPPER_TIMING;

Loading…
Cancel
Save