summaryrefslogtreecommitdiff
path: root/src/arch/atmega2560/driver/counter.cc
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-02-07 21:12:04 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-02-07 21:12:04 +0100
commit998419816c815175cd4c4f226e619c578d42e0aa (patch)
tree3efa872828bb973406a15469ac9ddfd245f29cfa /src/arch/atmega2560/driver/counter.cc
parent30431427adbf05a3e5cc17f6fb4b1b1cbc105b39 (diff)
add arch atmega2560 (preliminary support)
Diffstat (limited to 'src/arch/atmega2560/driver/counter.cc')
-rw-r--r--src/arch/atmega2560/driver/counter.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/arch/atmega2560/driver/counter.cc b/src/arch/atmega2560/driver/counter.cc
new file mode 100644
index 0000000..d6cde46
--- /dev/null
+++ b/src/arch/atmega2560/driver/counter.cc
@@ -0,0 +1,15 @@
+/*
+ * Copyright 2021 Daniel Friesel
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+#include "driver/counter.h"
+
+Counter counter;
+
+ISR(TIMER3_OVF_vect)
+{
+ if (counter.overflow < 255) {
+ counter.overflow++;
+ }
+}