STM32 timer simplification (#11995)

Prescalers aren't calculated for the given target frequency.
Stepper timer should run at 2 Mhz and temperature timer at 72 Khz.
This commit is contained in:
Nils Hasenbanck
2018-10-04 05:33:24 +02:00
committed by Scott Lahteine
parent 8daadd2c8c
commit fcf6d127fd
2 changed files with 14 additions and 19 deletions

View File

@@ -71,7 +71,7 @@ bool timers_initialised[NUM_HARDWARE_TIMERS] = {false};
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
if (!timers_initialised[timer_num]) {
constexpr uint32_t step_prescaler = STEPPER_TIMER_PRESCALE - 1,
uint32_t step_prescaler = STEPPER_TIMER_PRESCALE - 1,
temp_prescaler = TEMP_TIMER_PRESCALE - 1;
switch (timer_num) {
case STEP_TIMER_NUM: