summaryrefslogtreecommitdiff
path: root/src/arch/stm32f446re-nucleo/driver/counter.cc
blob: 1512019dce81b146b6629338e4207cbde227907c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
 * Copyright 2020 Daniel Friesel
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */
#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++;
		}
	}
}