1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include "arch.h" #include "driver/counter.h" Counter counter; void tim2_isr(void) { if (timer_get_flag(TIM2, TIM_SR_UIF)) { timer_clear_flag(TIM2, TIM_SR_UIF); if (counter.overflow < 4294967295) { counter.overflow++; } } }