summaryrefslogtreecommitdiff
path: root/src/arch/atmega2560/driver/counter.cc
diff options
context:
space:
mode:
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++;
+ }
+}