summaryrefslogtreecommitdiff
path: root/src/arch/stm32f446re-nucleo/driver/counter.cc
blob: dfd22e329da4274fe49bfec5f49698383eb53db7 (plain)
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++;
		}
	}
}