Przeglądaj źródła

Fix chopper timing struct and initialization (#12943)

teemuatlut 6 lat temu
rodzic
commit
8a3f1d6932

+ 6
- 6
Marlin/src/module/stepper_indirection.cpp Wyświetl plik

209
     chopconf.tbl = 1;
209
     chopconf.tbl = 1;
210
     chopconf.toff = chopper_timing.toff;
210
     chopconf.toff = chopper_timing.toff;
211
     chopconf.intpol = INTERPOLATE;
211
     chopconf.intpol = INTERPOLATE;
212
-    chopconf.hend = chopper_timing.hstrt + 3;
213
-    chopconf.hstrt = chopper_timing.hend - 1;
212
+    chopconf.hend = chopper_timing.hend + 3;
213
+    chopconf.hstrt = chopper_timing.hstrt - 1;
214
     st.CHOPCONF(chopconf.sr);
214
     st.CHOPCONF(chopconf.sr);
215
 
215
 
216
     st.rms_current(mA, HOLD_MULTIPLIER);
216
     st.rms_current(mA, HOLD_MULTIPLIER);
453
     chopconf.tbl = 0b01; // blank_time = 24
453
     chopconf.tbl = 0b01; // blank_time = 24
454
     chopconf.toff = chopper_timing.toff;
454
     chopconf.toff = chopper_timing.toff;
455
     chopconf.intpol = INTERPOLATE;
455
     chopconf.intpol = INTERPOLATE;
456
-    chopconf.hend = chopper_timing.hstrt + 3;
457
-    chopconf.hstrt = chopper_timing.hend - 1;
456
+    chopconf.hend = chopper_timing.hend + 3;
457
+    chopconf.hstrt = chopper_timing.hstrt - 1;
458
     st.CHOPCONF(chopconf.sr);
458
     st.CHOPCONF(chopconf.sr);
459
 
459
 
460
     st.rms_current(mA, HOLD_MULTIPLIER);
460
     st.rms_current(mA, HOLD_MULTIPLIER);
546
     TMC2660_n::CHOPCONF_t chopconf{0};
546
     TMC2660_n::CHOPCONF_t chopconf{0};
547
     chopconf.tbl = 1;
547
     chopconf.tbl = 1;
548
     chopconf.toff = chopper_timing.toff;
548
     chopconf.toff = chopper_timing.toff;
549
-    chopconf.hend = chopper_timing.hstrt + 3;
550
-    chopconf.hstrt = chopper_timing.hend - 1;
549
+    chopconf.hend = chopper_timing.hend + 3;
550
+    chopconf.hstrt = chopper_timing.hstrt - 1;
551
     st.CHOPCONF(chopconf.sr);
551
     st.CHOPCONF(chopconf.sr);
552
 
552
 
553
     st.rms_current(mA);
553
     st.rms_current(mA);

+ 2
- 2
Marlin/src/module/stepper_indirection.h Wyświetl plik

68
 
68
 
69
   typedef struct {
69
   typedef struct {
70
     uint8_t toff;
70
     uint8_t toff;
71
-    int8_t hstrt;
72
-    uint8_t hend;
71
+    int8_t hend;
72
+    uint8_t hstrt;
73
   } chopper_timing_t;
73
   } chopper_timing_t;
74
 
74
 
75
   static constexpr chopper_timing_t chopper_timing = CHOPPER_TIMING;
75
   static constexpr chopper_timing_t chopper_timing = CHOPPER_TIMING;

Ładowanie…
Anuluj
Zapisz