tests/gadget0: avoid floating point division

Reviewed-by: Karl Palsson <karlp@tweak.net.au> (Changed from cast to
literal int, more inline with efm32 and clearer intent)
This commit is contained in:
Brian Cooke 2019-11-17 02:30:13 +01:00 committed by Karl Palsson
parent 18f4d7c1b7
commit d44ffe8c0b

View File

@ -33,7 +33,7 @@ void delay_setup(void)
/* set up a microsecond free running timer for ... things... */
rcc_periph_clock_enable(RCC_TIM6);
/* microsecond counter */
timer_set_prescaler(TIM6, rcc_apb1_frequency / 1e6 - 1);
timer_set_prescaler(TIM6, rcc_apb1_frequency / 1000000 - 1);
timer_set_period(TIM6, 0xffff);
timer_one_shot_mode(TIM6);
}