Fix chopper timing struct and initialization (#12943)

This commit is contained in:
teemuatlut 2019-01-20 02:57:02 +02:00 committed by Scott Lahteine
parent c6991109b7
commit 8a3f1d6932
2 changed files with 8 additions and 8 deletions

View file

@ -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);

View file

@ -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;