summaryrefslogtreecommitdiff
path: root/src/arch/arduino-nano/driver/counter.cc
blob: 842bfe8a1ed4906e2e527e71fb39b088b16071b7 (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 "driver/counter.h"

#if defined(TIMER_S) || defined(CONFIG_loop)
#warn "timer/loop and counter are mutually exclusive. Expect odd behaviour."
#endif

Counter counter;

ISR(TIMER1_OVF_vect)
{
	if (counter.overflow < 255) {
		counter.overflow++;
	}
}