[2.0.x] Correct step pulse width on LPC1768, DUE & Teensy35_36 (#10016)

This commit is contained in:
Bob-the-Kuhn 2018-03-09 02:11:28 -06:00 committed by Scott Lahteine
parent 3707078ffc
commit 3c58ca181c
3 changed files with 3 additions and 3 deletions

View file

@ -48,7 +48,7 @@ typedef uint32_t hal_timer_t;
#define TONE_TIMER_NUM 6 // index of timer to use for beeper tones #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 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_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_TICKS_PER_US ((HAL_STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs

View file

@ -47,7 +47,7 @@ typedef uint32_t hal_timer_t;
#define TEMP_TIMER_NUM 1 // index of timer to use for temperature #define TEMP_TIMER_NUM 1 // index of timer to use for temperature
#define HAL_TIMER_RATE ((SystemCoreClock) / 4) // frequency of timers peripherals #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_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_TICKS_PER_US ((HAL_STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs
#define HAL_TEMP_TIMER_RATE 1000000 #define HAL_TEMP_TIMER_RATE 1000000

View file

@ -55,7 +55,7 @@ typedef uint32_t hal_timer_t;
#define FTM1_TIMER_RATE (F_BUS / FTM1_TIMER_PRESCALE) // 60MHz / 4 = 15MHz #define FTM1_TIMER_RATE (F_BUS / FTM1_TIMER_PRESCALE) // 60MHz / 4 = 15MHz
#define STEPPER_TIMER STEP_TIMER_NUM // Alias? #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_NUM STEP_TIMER_NUM
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE #define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE