summaryrefslogtreecommitdiff
path: root/include/arch/rm46l8lp/driver/uptime.h
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2022-07-18 11:25:27 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2022-07-18 11:25:27 +0200
commite6cef3c547e8f73cbf2d3c7ba639cb7d9934c475 (patch)
treeb38bf797c9cd5c226de250e8f569031ebc6131d0 /include/arch/rm46l8lp/driver/uptime.h
parent4da20a683273f252940ff2752d2f497040800b3d (diff)
Add Hercules RM46L8 Launchpad support (Cortex R4F)
Diffstat (limited to 'include/arch/rm46l8lp/driver/uptime.h')
-rw-r--r--include/arch/rm46l8lp/driver/uptime.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/arch/rm46l8lp/driver/uptime.h b/include/arch/rm46l8lp/driver/uptime.h
new file mode 100644
index 0000000..b4e7523
--- /dev/null
+++ b/include/arch/rm46l8lp/driver/uptime.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2020 Daniel Friesel
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+#ifndef UPTIME_H
+#define UPTIME_H
+
+class Uptime {
+ private:
+ Uptime(const Uptime &copy);
+#ifdef TIMER_S
+ unsigned int seconds;
+#endif
+
+ public:
+#ifdef TIMER_S
+ Uptime () : seconds(0) {}
+#else
+ Uptime () {}
+#endif
+#ifdef TIMER_S
+ inline unsigned int get_s() { return seconds; }
+ inline void tick_s() { seconds++; }
+#endif
+};
+
+extern Uptime uptime;
+
+#endif