Browse Source

Eliminate stepper.* signed/unsigned warnings

Scott Lahteine 6 years ago
parent
commit
aa4cd2e861
2 changed files with 6 additions and 6 deletions
  1. 2
    2
      Marlin/src/module/stepper.cpp
  2. 4
    4
      Marlin/src/module/stepper.h

+ 2
- 2
Marlin/src/module/stepper.cpp View File

@@ -1324,7 +1324,7 @@ void Stepper::stepper_pulse_phase_isr() {
1324 1324
   // Get the timer count and estimate the end of the pulse
1325 1325
   hal_timer_t pulse_end = HAL_timer_get_count(PULSE_TIMER_NUM) + hal_timer_t(MIN_PULSE_TICKS);
1326 1326
 
1327
-  const hal_timer_t added_step_ticks = ADDED_STEP_TICKS;
1327
+  const hal_timer_t added_step_ticks = hal_timer_t(ADDED_STEP_TICKS);
1328 1328
 
1329 1329
   // Take multiple steps per interrupt (For high speed moves)
1330 1330
   do {
@@ -1820,7 +1820,7 @@ uint32_t Stepper::stepper_block_phase_isr() {
1820 1820
     // Get the timer count and estimate the end of the pulse
1821 1821
     hal_timer_t pulse_end = HAL_timer_get_count(PULSE_TIMER_NUM) + hal_timer_t(MIN_PULSE_TICKS);
1822 1822
 
1823
-    const hal_timer_t added_step_ticks = ADDED_STEP_TICKS;
1823
+    const hal_timer_t added_step_ticks = hal_timer_t(ADDED_STEP_TICKS);
1824 1824
 
1825 1825
     // Step E stepper if we have steps
1826 1826
     while (LA_steps) {

+ 4
- 4
Marlin/src/module/stepper.h View File

@@ -58,7 +58,7 @@
58 58
 
59 59
 #ifndef MAXIMUM_STEPPER_RATE
60 60
   #if MINIMUM_STEPPER_PULSE
61
-    #define MAXIMUM_STEPPER_RATE (1000000UL / (2UL * (MINIMUM_STEPPER_PULSE)))
61
+    #define MAXIMUM_STEPPER_RATE (1000000UL / (2UL * (unsigned long)(MINIMUM_STEPPER_PULSE)))
62 62
   #else
63 63
     #define MAXIMUM_STEPPER_RATE 500000UL
64 64
   #endif
@@ -165,9 +165,9 @@
165 165
 #define MIN_ISR_LOOP_CYCLES (ISR_X_STEPPER_CYCLES + ISR_Y_STEPPER_CYCLES + ISR_Z_STEPPER_CYCLES + ISR_E_STEPPER_CYCLES + ISR_MIXING_STEPPER_CYCLES)
166 166
 
167 167
 // Calculate the minimum MPU cycles needed per pulse to enforce, limited to the max stepper rate
168
-#define _MIN_STEPPER_PULSE_CYCLES(N) MAX((F_CPU) / (MAXIMUM_STEPPER_RATE), ((F_CPU) / 500000UL) * (N))
168
+#define _MIN_STEPPER_PULSE_CYCLES(N) MAX((unsigned long)((F_CPU) / (MAXIMUM_STEPPER_RATE)), ((F_CPU) / 500000UL) * (N))
169 169
 #if MINIMUM_STEPPER_PULSE
170
-  #define MIN_STEPPER_PULSE_CYCLES _MIN_STEPPER_PULSE_CYCLES((MINIMUM_STEPPER_PULSE))
170
+  #define MIN_STEPPER_PULSE_CYCLES _MIN_STEPPER_PULSE_CYCLES((unsigned long)(MINIMUM_STEPPER_PULSE))
171 171
 #else
172 172
   #define MIN_STEPPER_PULSE_CYCLES _MIN_STEPPER_PULSE_CYCLES(1UL)
173 173
 #endif
@@ -176,7 +176,7 @@
176 176
 // adding the "start stepper pulse" code section execution cycles to account for that not all
177 177
 // pulses start at the beginning of the loop, so an extra time must be added to compensate so
178 178
 // the last generated pulse (usually the extruder stepper) has the right length
179
-#define MIN_PULSE_TICKS (((PULSE_TIMER_TICKS_PER_US) * (MINIMUM_STEPPER_PULSE)) + ((MIN_ISR_START_LOOP_CYCLES) / (PULSE_TIMER_PRESCALE)))
179
+#define MIN_PULSE_TICKS (((PULSE_TIMER_TICKS_PER_US) * (unsigned long)(MINIMUM_STEPPER_PULSE)) + ((MIN_ISR_START_LOOP_CYCLES) / (unsigned long)(PULSE_TIMER_PRESCALE)))
180 180
 
181 181
 // Calculate the extra ticks of the PULSE timer between step pulses
182 182
 #define ADDED_STEP_TICKS (((MIN_STEPPER_PULSE_CYCLES) / (PULSE_TIMER_PRESCALE)) - (MIN_PULSE_TICKS))

Loading…
Cancel
Save