Bläddra i källkod

Merge pull request #8736 from thinkyhead/bf2_first_step_fix

[2.0.x] Reset timer count before first block step
Scott Lahteine 7 år sedan
förälder
incheckning
11f9c253e0
Inget konto är kopplat till bidragsgivarens mejladress

+ 22
- 13
Marlin/src/HAL/HAL_AVR/HAL_AVR.h Visa fil

@@ -100,30 +100,39 @@ extern "C" {
100 100
 
101 101
 
102 102
 // timers
103
-#define STEP_TIMER_NUM OCR1A
104
-#define TEMP_TIMER_NUM 0
105
-#define TEMP_TIMER_FREQUENCY (F_CPU / 64.0 / 256.0)
106
-
107 103
 #define HAL_TIMER_RATE          ((F_CPU) / 8)    // i.e., 2MHz or 2.5MHz
108
-#define HAL_STEPPER_TIMER_RATE  HAL_TIMER_RATE
109
-#define STEPPER_TIMER_PRESCALE  INT0_PRESCALER
110 104
 #define HAL_TICKS_PER_US        ((HAL_STEPPER_TIMER_RATE) / 1000000) // Cannot be of type double
111 105
 
106
+#define TEMP_TIMER_FREQUENCY    ((F_CPU) / 64.0 / 256.0)
107
+
108
+#define HAL_STEPPER_TIMER_RATE  HAL_TIMER_RATE
109
+#define STEPPER_TIMER_PRESCALE  8
110
+
111
+#define STEP_TIMER_NUM          1
112
+#define TIMER_OCR_1             OCR1A
113
+#define TIMER_COUNTER_1         TCNT1
114
+
115
+#define TEMP_TIMER_NUM          0
116
+#define TIMER_OCR_0             OCR0A
117
+#define TIMER_COUNTER_0         TCNT0
118
+
119
+#define PULSE_TIMER_NUM         TEMP_TIMER_NUM
120
+#define PULSE_TIMER_PRESCALE    8
121
+
112 122
 #define ENABLE_STEPPER_DRIVER_INTERRUPT()  SBI(TIMSK1, OCIE1A)
113 123
 #define DISABLE_STEPPER_DRIVER_INTERRUPT() CBI(TIMSK1, OCIE1A)
114 124
 
115 125
 #define ENABLE_TEMPERATURE_INTERRUPT()  SBI(TIMSK0, OCIE0B)
116 126
 #define DISABLE_TEMPERATURE_INTERRUPT() CBI(TIMSK0, OCIE0B)
117 127
 
118
-//void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
119
-#define HAL_timer_start(timer_num,frequency)
120
-
121
-//void HAL_timer_set_count(const uint8_t timer_num, const uint16_t count);
122
-#define HAL_timer_set_count(timer, count) timer = (count)
128
+#define HAL_timer_start(timer_num, frequency)
123 129
 
124
-#define HAL_timer_get_current_count(timer) timer
130
+#define _CAT(a, ...) a ## __VA_ARGS__
131
+#define HAL_timer_set_count(timer, count) (_CAT(TIMER_OCR_, timer) = count)
132
+#define HAL_timer_get_count(timer) _CAT(TIMER_OCR_, timer)
133
+#define HAL_timer_set_current_count(timer, count) (_CAT(TIMER_COUNTER_, timer) = count)
134
+#define HAL_timer_get_current_count(timer) _CAT(TIMER_COUNTER_, timer)
125 135
 
126
-//void HAL_timer_isr_prologue(const uint8_t timer_num);
127 136
 #define HAL_timer_isr_prologue(timer_num)
128 137
 
129 138
 #define HAL_STEP_TIMER_ISR ISR(TIMER1_COMPA_vect)

+ 10
- 2
Marlin/src/HAL/HAL_DUE/HAL_timers_Due.h Visa fil

@@ -64,6 +64,9 @@ typedef uint32_t hal_timer_t;
64 64
 #define HAL_STEP_TIMER_ISR  void TC3_Handler()
65 65
 #define HAL_TEMP_TIMER_ISR  void TC4_Handler()
66 66
 
67
+#define PULSE_TIMER_NUM STEP_TIMER_NUM
68
+#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
69
+
67 70
 // --------------------------------------------------------------------------
68 71
 // Types
69 72
 // --------------------------------------------------------------------------
@@ -87,7 +90,7 @@ extern const tTimerConfig TimerConfig[];
87 90
 
88 91
 void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
89 92
 
90
-FORCE_INLINE static void HAL_timer_set_count(const uint8_t timer_num, const uint32_t count) {
93
+FORCE_INLINE static void HAL_timer_set_count(const uint8_t timer_num, const hal_timer_t count) {
91 94
   const tTimerConfig *pConfig = &TimerConfig[timer_num];
92 95
   pConfig->pTimerRegs->TC_CHANNEL[pConfig->channel].TC_RC = count;
93 96
 }
@@ -97,7 +100,12 @@ FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
97 100
   return pConfig->pTimerRegs->TC_CHANNEL[pConfig->channel].TC_RC;
98 101
 }
99 102
 
100
-FORCE_INLINE static uint32_t HAL_timer_get_current_count(const uint8_t timer_num) {
103
+FORCE_INLINE static void HAL_timer_set_current_count(const uint8_t timer_num, const hal_timer_t count) {
104
+  const tTimerConfig *pConfig = &TimerConfig[timer_num];
105
+  pConfig->pTimerRegs->TC_CHANNEL[pConfig->channel].TC_CV = count;
106
+}
107
+
108
+FORCE_INLINE static hal_timer_t HAL_timer_get_current_count(const uint8_t timer_num) {
101 109
   const tTimerConfig *pConfig = &TimerConfig[timer_num];
102 110
   return pConfig->pTimerRegs->TC_CHANNEL[pConfig->channel].TC_CV;
103 111
 }

+ 10
- 0
Marlin/src/HAL/HAL_LPC1768/HAL_timers.h Visa fil

@@ -53,6 +53,9 @@ typedef uint32_t hal_timer_t;
53 53
 #define HAL_TEMP_TIMER_RATE    1000000
54 54
 #define TEMP_TIMER_FREQUENCY   1000 // temperature interrupt frequency
55 55
 
56
+#define PULSE_TIMER_NUM STEP_TIMER_NUM
57
+#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
58
+
56 59
 #define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(STEP_TIMER_NUM)
57 60
 #define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(STEP_TIMER_NUM)
58 61
 #define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
@@ -100,6 +103,13 @@ FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
100 103
   return 0;
101 104
 }
102 105
 
106
+FORCE_INLINE static void HAL_timer_set_current_count(const uint8_t timer_num, const hal_timer_t count) {
107
+  switch (timer_num) {
108
+    case 0: LPC_TIM0->TC = count; break;
109
+    case 1: LPC_TIM1->TC = count; break;
110
+  }
111
+}
112
+
103 113
 FORCE_INLINE static hal_timer_t HAL_timer_get_current_count(const uint8_t timer_num) {
104 114
   switch (timer_num) {
105 115
     case 0: return LPC_TIM0->TC;

+ 26
- 18
Marlin/src/HAL/HAL_STM32F1/HAL_timers_Stm32f1.h Visa fil

@@ -51,20 +51,22 @@ typedef uint16_t hal_timer_t;
51 51
 #define TEMP_TIMER_NUM 2  // index of timer to use for temperature
52 52
 #define TEMP_TIMER_CHAN 1 // Channel of the timer to use for compare and interrupts
53 53
 
54
-
55 54
 #define HAL_TIMER_RATE         (F_CPU)  // frequency of timers peripherals
56 55
 #define STEPPER_TIMER_PRESCALE 36             // prescaler for setting stepper timer, 2Mhz
57 56
 #define HAL_STEPPER_TIMER_RATE (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE)   // frequency of stepper timer (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE)
58 57
 #define HAL_TICKS_PER_US       ((HAL_STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per us
59 58
 
59
+#define PULSE_TIMER_NUM STEP_TIMER_NUM
60
+#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
61
+
60 62
 #define TEMP_TIMER_PRESCALE     1000 // prescaler for setting Temp timer, 72Khz
61 63
 #define TEMP_TIMER_FREQUENCY    1000 // temperature interrupt frequency
62 64
 
63
-#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt (STEP_TIMER_NUM)
64
-#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt (STEP_TIMER_NUM)
65
+#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(STEP_TIMER_NUM)
66
+#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(STEP_TIMER_NUM)
65 67
 
66
-#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt (TEMP_TIMER_NUM)
67
-#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt (TEMP_TIMER_NUM)
68
+#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
69
+#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
68 70
 
69 71
 #define HAL_ENABLE_ISRs() do { if (thermalManager.in_temp_isr)DISABLE_TEMPERATURE_INTERRUPT(); else ENABLE_TEMPERATURE_INTERRUPT(); ENABLE_STEPPER_DRIVER_INTERRUPT(); } while(0)
70 72
 // TODO change this
@@ -92,7 +94,7 @@ static HardwareTimer TempTimer(TEMP_TIMER_NUM);
92 94
 // Public functions
93 95
 // --------------------------------------------------------------------------
94 96
 
95
-void HAL_timer_start (uint8_t timer_num, uint32_t frequency);
97
+void HAL_timer_start(uint8_t timer_num, uint32_t frequency);
96 98
 void HAL_timer_enable_interrupt(uint8_t timer_num);
97 99
 void HAL_timer_disable_interrupt(uint8_t timer_num);
98 100
 
@@ -107,26 +109,26 @@ void HAL_timer_disable_interrupt(uint8_t timer_num);
107 109
  * Todo: Look at that possibility later.
108 110
  */
109 111
 
110
-FORCE_INLINE static void HAL_timer_set_count (uint8_t timer_num, uint32_t count) {
112
+FORCE_INLINE static void HAL_timer_set_count(const uint8_t timer_num, const hal_timer_t count) {
111 113
   switch (timer_num) {
112 114
   case STEP_TIMER_NUM:
113 115
     StepperTimer.pause();
114
-    StepperTimer.setCompare (STEP_TIMER_CHAN, count);
115
-    StepperTimer.refresh ();
116
-    StepperTimer.resume ();
116
+    StepperTimer.setCompare(STEP_TIMER_CHAN, count);
117
+    StepperTimer.refresh();
118
+    StepperTimer.resume();
117 119
     break;
118 120
   case TEMP_TIMER_NUM:
119 121
     TempTimer.pause();
120
-    TempTimer.setCompare (TEMP_TIMER_CHAN, count);
121
-    TempTimer.refresh ();
122
-    TempTimer.resume ();
122
+    TempTimer.setCompare(TEMP_TIMER_CHAN, count);
123
+    TempTimer.refresh();
124
+    TempTimer.resume();
123 125
     break;
124 126
   default:
125 127
     break;
126 128
   }
127 129
 }
128 130
 
129
-FORCE_INLINE static hal_timer_t HAL_timer_get_count (uint8_t timer_num) {
131
+FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
130 132
   hal_timer_t temp;
131 133
   switch (timer_num) {
132 134
   case STEP_TIMER_NUM:
@@ -142,7 +144,14 @@ FORCE_INLINE static hal_timer_t HAL_timer_get_count (uint8_t timer_num) {
142 144
   return temp;
143 145
 }
144 146
 
145
-FORCE_INLINE static hal_timer_t HAL_timer_get_current_count(uint8_t timer_num) {
147
+FORCE_INLINE static void HAL_timer_set_current_count(const uint8_t timer_num, const hal_timer_t count) {
148
+  switch (timer_num) {
149
+    case STEP_TIMER_NUM: StepperTimer.setCount(count); break;
150
+    case TEMP_TIMER_NUM: TempTimer.setCount(count); break;
151
+  }
152
+}
153
+
154
+FORCE_INLINE static hal_timer_t HAL_timer_get_current_count(const uint8_t timer_num) {
146 155
   hal_timer_t temp;
147 156
   switch (timer_num) {
148 157
   case STEP_TIMER_NUM:
@@ -158,10 +167,9 @@ FORCE_INLINE static hal_timer_t HAL_timer_get_current_count(uint8_t timer_num) {
158 167
   return temp;
159 168
 }
160 169
 
170
+//void HAL_timer_isr_prologue (const uint8_t timer_num);
161 171
 
162
-//void HAL_timer_isr_prologue (uint8_t timer_num);
163
-
164
-FORCE_INLINE static void HAL_timer_isr_prologue(uint8_t timer_num) {
172
+FORCE_INLINE static void HAL_timer_isr_prologue(const uint8_t timer_num) {
165 173
   switch (timer_num) {
166 174
   case STEP_TIMER_NUM:
167 175
     StepperTimer.pause();

+ 15
- 5
Marlin/src/HAL/HAL_TEENSY35_36/HAL_timers_Teensy.h Visa fil

@@ -57,6 +57,9 @@ typedef uint32_t hal_timer_t;
57 57
 #define STEPPER_TIMER STEP_TIMER_NUM // Alias?
58 58
 #define STEPPER_TIMER_PRESCALE 0 // Not defined anywhere else!
59 59
 
60
+#define PULSE_TIMER_NUM STEP_TIMER_NUM
61
+#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
62
+
60 63
 #define HAL_TIMER_RATE         (FTM0_TIMER_RATE)
61 64
 #define HAL_STEPPER_TIMER_RATE HAL_TIMER_RATE
62 65
 #define HAL_TICKS_PER_US       ((HAL_STEPPER_TIMER_RATE) / 1000000)
@@ -75,23 +78,30 @@ typedef uint32_t hal_timer_t;
75 78
 
76 79
 void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
77 80
 
78
-FORCE_INLINE static void HAL_timer_set_count(const uint8_t timer_num, const uint32_t count) {
79
-  switch(timer_num) {
81
+FORCE_INLINE static void HAL_timer_set_count(const uint8_t timer_num, const hal_timer_t count) {
82
+  switch (timer_num) {
80 83
     case 0: FTM0_C0V = count; break;
81 84
     case 1: FTM1_C0V = count; break;
82 85
   }
83 86
 }
84 87
 
85 88
 FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
86
-  switch(timer_num) {
89
+  switch (timer_num) {
87 90
     case 0: return FTM0_C0V;
88 91
     case 1: return FTM1_C0V;
89 92
   }
90 93
   return 0;
91 94
 }
92 95
 
93
-FORCE_INLINE static uint32_t HAL_timer_get_current_count(const uint8_t timer_num) {
94
-  switch(timer_num) {
96
+FORCE_INLINE static void HAL_timer_set_current_count(const uint8_t timer_num, const hal_timer_t count) {
97
+  switch (timer_num) {
98
+    case 0: FTM0_CNT = count;
99
+    case 1: FTM1_CNT = count;
100
+  }
101
+}
102
+
103
+FORCE_INLINE static hal_timer_t HAL_timer_get_current_count(const uint8_t timer_num) {
104
+  switch (timer_num) {
95 105
     case 0: return FTM0_CNT;
96 106
     case 1: return FTM1_CNT;
97 107
   }

+ 1
- 2
Marlin/src/core/macros.h Visa fil

@@ -44,8 +44,7 @@
44 44
 #define _O3          __attribute__((optimize("O3")))
45 45
 
46 46
 // Clock speed factors
47
-#define CYCLES_PER_MICROSECOND (F_CPU / 1000000L) // 16 or 20
48
-#define INT0_PRESCALER 8
47
+#define CYCLES_PER_MICROSECOND (F_CPU / 1000000L) // 16 or 20 on AVR
49 48
 
50 49
 // Highly granular delays for step pulses, etc.
51 50
 #define DELAY_0_NOP NOOP

+ 24
- 15
Marlin/src/module/stepper.cpp Visa fil

@@ -408,10 +408,13 @@ void Stepper::isr() {
408 408
   }
409 409
 
410 410
   // If there is no current block, attempt to pop one from the buffer
411
+  bool first_step = false;
411 412
   if (!current_block) {
412 413
     // Anything in the buffer?
413 414
     if ((current_block = planner.get_current_block())) {
414 415
       trapezoid_generator_reset();
416
+      HAL_timer_set_current_count(STEP_TIMER_NUM, 0);
417
+      first_step = true;
415 418
 
416 419
       // Initialize Bresenham counters to 1/2 the ceiling
417 420
       counter_X = counter_Y = counter_Z = counter_E = -(current_block->step_event_count >> 1);
@@ -564,7 +567,7 @@ void Stepper::isr() {
564 567
      * 10µs = 160 or 200 cycles.
565 568
      */
566 569
     #if EXTRA_CYCLES_XYZE > 20
567
-      hal_timer_t pulse_start = HAL_timer_get_current_count(STEP_TIMER_NUM);
570
+      hal_timer_t pulse_start = HAL_timer_get_current_count(PULSE_TIMER_NUM);
568 571
     #endif
569 572
 
570 573
     #if HAS_X_STEP
@@ -596,8 +599,8 @@ void Stepper::isr() {
596 599
 
597 600
     // For minimum pulse time wait before stopping pulses
598 601
     #if EXTRA_CYCLES_XYZE > 20
599
-      while (EXTRA_CYCLES_XYZE > (uint32_t)(HAL_timer_get_current_count(STEP_TIMER_NUM) - pulse_start) * (STEPPER_TIMER_PRESCALE)) { /* nada */ }
600
-      pulse_start = HAL_timer_get_current_count(STEP_TIMER_NUM);
602
+      while (EXTRA_CYCLES_XYZE > (uint32_t)(HAL_timer_get_current_count(PULSE_TIMER_NUM) - pulse_start) * (PULSE_TIMER_PRESCALE)) { /* nada */ }
603
+      pulse_start = HAL_timer_get_current_count(PULSE_TIMER_NUM);
601 604
     #elif EXTRA_CYCLES_XYZE > 0
602 605
       DELAY_NOPS(EXTRA_CYCLES_XYZE);
603 606
     #endif
@@ -637,7 +640,7 @@ void Stepper::isr() {
637 640
 
638 641
     // For minimum pulse time wait after stopping pulses also
639 642
     #if EXTRA_CYCLES_XYZE > 20
640
-      if (i) while (EXTRA_CYCLES_XYZE > (uint32_t)(HAL_timer_get_current_count(STEP_TIMER_NUM) - pulse_start) * (STEPPER_TIMER_PRESCALE)) { /* nada */ }
643
+      if (i) while (EXTRA_CYCLES_XYZE > (uint32_t)(HAL_timer_get_current_count(PULSE_TIMER_NUM) - pulse_start) * (PULSE_TIMER_PRESCALE)) { /* nada */ }
641 644
     #elif EXTRA_CYCLES_XYZE > 0
642 645
       if (i) DELAY_NOPS(EXTRA_CYCLES_XYZE);
643 646
     #endif
@@ -666,12 +669,18 @@ void Stepper::isr() {
666 669
   // Calculate new timer value
667 670
   if (step_events_completed <= (uint32_t)current_block->accelerate_until) {
668 671
 
669
-    #ifdef CPU_32_BIT
670
-      MultiU32X24toH32(acc_step_rate, acceleration_time, current_block->acceleration_rate);
671
-    #else
672
-      MultiU24X32toH16(acc_step_rate, acceleration_time, current_block->acceleration_rate);
673
-    #endif
674
-    acc_step_rate += current_block->initial_rate;
672
+    if (first_step) {
673
+      acc_step_rate = current_block->initial_rate;
674
+      acceleration_time = 0;
675
+    }
676
+    else {
677
+      #ifdef CPU_32_BIT
678
+        MultiU32X24toH32(acc_step_rate, acceleration_time, current_block->acceleration_rate);
679
+      #else
680
+        MultiU24X32toH16(acc_step_rate, acceleration_time, current_block->acceleration_rate);
681
+      #endif
682
+      acc_step_rate += current_block->initial_rate;
683
+    }
675 684
 
676 685
     // upper limit
677 686
     NOMORE(acc_step_rate, current_block->nominal_rate);
@@ -818,7 +827,7 @@ void Stepper::isr() {
818 827
     for (uint8_t i = step_loops; i--;) {
819 828
 
820 829
       #if EXTRA_CYCLES_E > 20
821
-        hal_timer_t pulse_start = HAL_timer_get_current_count(STEP_TIMER_NUM);
830
+        hal_timer_t pulse_start = HAL_timer_get_current_count(PULSE_TIMER_NUM);
822 831
       #endif
823 832
 
824 833
       START_E_PULSE(0);
@@ -837,8 +846,8 @@ void Stepper::isr() {
837 846
 
838 847
       // For minimum pulse time wait before stopping pulses
839 848
       #if EXTRA_CYCLES_E > 20
840
-        while (EXTRA_CYCLES_E > (hal_timer_t)(HAL_timer_get_current_count(STEP_TIMER_NUM) - pulse_start) * (STEPPER_TIMER_PRESCALE)) { /* nada */ }
841
-        pulse_start = HAL_timer_get_current_count(STEP_TIMER_NUM);
849
+        while (EXTRA_CYCLES_E > (hal_timer_t)(HAL_timer_get_current_count(PULSE_TIMER_NUM) - pulse_start) * (PULSE_TIMER_PRESCALE)) { /* nada */ }
850
+        pulse_start = HAL_timer_get_current_count(PULSE_TIMER_NUM);
842 851
       #elif EXTRA_CYCLES_E > 0
843 852
         DELAY_NOPS(EXTRA_CYCLES_E);
844 853
       #endif
@@ -859,7 +868,7 @@ void Stepper::isr() {
859 868
 
860 869
       // For minimum pulse time wait before looping
861 870
       #if EXTRA_CYCLES_E > 20
862
-        if (i) while (EXTRA_CYCLES_E > (hal_timer_t)(HAL_timer_get_current_count(STEP_TIMER_NUM) - pulse_start) * (STEPPER_TIMER_PRESCALE)) { /* nada */ }
871
+        if (i) while (EXTRA_CYCLES_E > (hal_timer_t)(HAL_timer_get_current_count(PULSE_TIMER_NUM) - pulse_start) * (PULSE_TIMER_PRESCALE)) { /* nada */ }
863 872
       #elif EXTRA_CYCLES_E > 0
864 873
         if (i) DELAY_NOPS(EXTRA_CYCLES_E);
865 874
       #endif
@@ -1299,7 +1308,7 @@ void Stepper::report_positions() {
1299 1308
 
1300 1309
   #if EXTRA_CYCLES_BABYSTEP > 20
1301 1310
     #define _SAVE_START const hal_timer_t pulse_start = HAL_timer_get_current_count(STEP_TIMER_NUM)
1302
-    #define _PULSE_WAIT while (EXTRA_CYCLES_BABYSTEP > (uint32_t)(HAL_timer_get_current_count(STEP_TIMER_NUM) - pulse_start) * (STEPPER_TIMER_PRESCALE)) { /* nada */ }
1311
+    #define _PULSE_WAIT while (EXTRA_CYCLES_BABYSTEP > (uint32_t)(HAL_timer_get_current_count(STEP_TIMER_NUM) - pulse_start) * (PULSE_TIMER_PRESCALE)) { /* nada */ }
1303 1312
   #else
1304 1313
     #define _SAVE_START NOOP
1305 1314
     #if EXTRA_CYCLES_BABYSTEP > 0

+ 0
- 3
Marlin/src/module/stepper.h Visa fil

@@ -362,9 +362,6 @@ class Stepper {
362 362
       OCR1A_nominal = calc_timer_interval(current_block->nominal_rate);
363 363
       // make a note of the number of step loops required at nominal speed
364 364
       step_loops_nominal = step_loops;
365
-      acc_step_rate = current_block->initial_rate;
366
-      acceleration_time = calc_timer_interval(acc_step_rate);
367
-      _NEXT_ISR(acceleration_time);
368 365
 
369 366
       #if ENABLED(LIN_ADVANCE)
370 367
         if (current_block->use_advance_lead) {

Laddar…
Avbryt
Spara