Delay function using timers - LED blinks too fast
void delay_setup(void) { rcc_periph_clock_enable(RCC_TIM6); timer_set_prescaler(TIM6, rcc_apb1_frequency / 1000000 - 1); timer_set_period(TIM6, 0xffff); timer_one_shot_mode(TIM6); } void delay_us(uint32_t us) { TIM_ARR(TIM6) = us; TIM_EGR(TIM...