diff --git a/Marlin/src/HAL/HAL_DUE/HAL_timers_Due.h b/Marlin/src/HAL/HAL_DUE/HAL_timers_Due.h index b1df3a86d..a38bc6978 100644 --- a/Marlin/src/HAL/HAL_DUE/HAL_timers_Due.h +++ b/Marlin/src/HAL/HAL_DUE/HAL_timers_Due.h @@ -48,7 +48,7 @@ typedef uint32_t hal_timer_t; #define TONE_TIMER_NUM 6 // index of timer to use for beeper tones #define HAL_TIMER_RATE ((F_CPU) / 2) // frequency of timers peripherals -#define STEPPER_TIMER_PRESCALE 1.0 // prescaler for setting stepper frequency +#define STEPPER_TIMER_PRESCALE (CYCLES_PER_MICROSECOND / HAL_TICKS_PER_US) #define HAL_STEPPER_TIMER_RATE HAL_TIMER_RATE // frequency of stepper timer (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE) #define HAL_TICKS_PER_US ((HAL_STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs diff --git a/Marlin/src/HAL/HAL_LPC1768/HAL_timers.h b/Marlin/src/HAL/HAL_LPC1768/HAL_timers.h index ef875edfd..cfbf593f5 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HAL_timers.h +++ b/Marlin/src/HAL/HAL_LPC1768/HAL_timers.h @@ -47,7 +47,7 @@ typedef uint32_t hal_timer_t; #define TEMP_TIMER_NUM 1 // index of timer to use for temperature #define HAL_TIMER_RATE ((SystemCoreClock) / 4) // frequency of timers peripherals -#define STEPPER_TIMER_PRESCALE 1.0 // prescaler for setting stepper frequency +#define STEPPER_TIMER_PRESCALE (CYCLES_PER_MICROSECOND / HAL_TICKS_PER_US) #define HAL_STEPPER_TIMER_RATE HAL_TIMER_RATE // frequency of stepper timer (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE) #define HAL_TICKS_PER_US ((HAL_STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs #define HAL_TEMP_TIMER_RATE 1000000 diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/HAL_timers_Teensy.h b/Marlin/src/HAL/HAL_TEENSY35_36/HAL_timers_Teensy.h index f9c1509f2..102e840b1 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/HAL_timers_Teensy.h +++ b/Marlin/src/HAL/HAL_TEENSY35_36/HAL_timers_Teensy.h @@ -55,7 +55,7 @@ typedef uint32_t hal_timer_t; #define FTM1_TIMER_RATE (F_BUS / FTM1_TIMER_PRESCALE) // 60MHz / 4 = 15MHz #define STEPPER_TIMER STEP_TIMER_NUM // Alias? -#define STEPPER_TIMER_PRESCALE 0 // Not defined anywhere else! +#define STEPPER_TIMER_PRESCALE (CYCLES_PER_MICROSECOND / HAL_TICKS_PER_US) #define PULSE_TIMER_NUM STEP_TIMER_NUM #define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE