summaryrefslogtreecommitdiff
path: root/src/arch/msp430fr5994lp/driver/counter.cc
blob: 98a2c4f208e92fd742b4c6e550d764d39cc0aabb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "driver/counter.h"

#if defined(TIMER_CYCLES)
#warn "timer_cycles and counter are mutually exclusive. Expect odd behaviour."
#endif

Counter counter;

#ifndef __acweaving
__attribute__((interrupt(TIMER2_A1_VECTOR))) void handle_timer2_overflow()
{
	if (TA2IV == 0x0e) {
		if (counter.overflow < 255) {
			counter.overflow++;
		}
	}
}
#endif