refactor: one more step towards arch-agnostic design
[lunaix-os.git] / lunaix-os / hal / rtc / hwrtc.c
diff --git a/lunaix-os/hal/rtc/hwrtc.c b/lunaix-os/hal/rtc/hwrtc.c
new file mode 100644 (file)
index 0000000..8da6e22
--- /dev/null
@@ -0,0 +1,17 @@
+#include <hal/hwrtc.h>
+
+const struct hwrtc* current_rtc;
+
+void
+hwrtc_init()
+{
+    current_rtc = hwrtc_choose();
+
+    current_rtc->init(current_rtc);
+}
+
+void
+hwrtc_walltime(datetime_t* dt)
+{
+    current_rtc->get_walltime(current_rtc, dt);
+}
\ No newline at end of file