summaryrefslogtreecommitdiff
path: root/include/arch/lora32u4ii/driver/uptime.h
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-09-18 21:07:30 +0200
committerDaniel Friesel <derf@finalrewind.org>2021-09-18 21:07:30 +0200
commit4f6973b8500418abf83c2377d09396b8588f7746 (patch)
tree83862be273470ad25e492e62cf830cbc4ea4a9b5 /include/arch/lora32u4ii/driver/uptime.h
parent65d563aa36e1367d4d3191ac838c6fb60ac4f481 (diff)
New architecture: lora32u4ii
Very limited support at the moment. No I2C/SPI, no USB bootloader or USB UART.
Diffstat (limited to 'include/arch/lora32u4ii/driver/uptime.h')
-rw-r--r--include/arch/lora32u4ii/driver/uptime.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/arch/lora32u4ii/driver/uptime.h b/include/arch/lora32u4ii/driver/uptime.h
new file mode 100644
index 0000000..db2c039
--- /dev/null
+++ b/include/arch/lora32u4ii/driver/uptime.h
@@ -0,0 +1,27 @@
+#ifndef UPTIME_H
+#define UPTIME_H
+
+#include <avr/io.h>
+
+class Uptime {
+ private:
+ Uptime(const Uptime &copy);
+#ifdef TIMER_S
+ uint8_t seconds;
+#endif
+
+ public:
+#ifdef TIMER_S
+ Uptime () : seconds(0) {}
+#else
+ Uptime () {}
+#endif
+#ifdef TIMER_S
+ inline uint8_t get_s() { return seconds; }
+ inline void tick_s() { seconds++; }
+#endif
+};
+
+extern Uptime uptime;
+
+#endif