From 3dae53c57661168f3638489ca66b68d8076d65b4 Mon Sep 17 00:00:00 2001
From: ConfuSomu
Date: Sat, 27 Feb 2021 17:59:45 -0500
Subject: Implement getDatetime function in API

---
 apps/home_menu.cpp  | 6 +-----
 apps/main_clock.cpp | 6 +-----
 2 files changed, 2 insertions(+), 10 deletions(-)

(limited to 'apps')

diff --git a/apps/home_menu.cpp b/apps/home_menu.cpp
index 8f0ee8b..97d4423 100644
--- a/apps/home_menu.cpp
+++ b/apps/home_menu.cpp
@@ -1,9 +1,5 @@
 #include <stdio.h>
 #include "pico/stdlib.h"
-extern "C" {
-#include "hardware/rtc.h"
-}
-#include "pico/util/datetime.h"
 
 #include "home_menu.hpp"
 #include "../api.hpp"
@@ -32,7 +28,7 @@ namespace app_home_menu {
         char datetime_buf[256];
         char *datetime_str = &datetime_buf[0];
         datetime_t t;
-        rtc_get_datetime(&t);
+        app_api->getDatetime(&t);
 
         // title with time
         title_str(datetime_str, sizeof(datetime_buf), &t);
diff --git a/apps/main_clock.cpp b/apps/main_clock.cpp
index 9939e4e..298fed0 100644
--- a/apps/main_clock.cpp
+++ b/apps/main_clock.cpp
@@ -1,9 +1,5 @@
 #include <stdio.h>
 #include "pico/stdlib.h"
-extern "C" {
-#include "hardware/rtc.h"
-}
-#include "pico/util/datetime.h"
 
 #include "main_clock.hpp"
 #include "../api.hpp"
@@ -43,7 +39,7 @@ namespace app_main_clock {
         char datetime_buf[256];
         char *datetime_str = &datetime_buf[0];
         datetime_t t;
-        rtc_get_datetime(&t);
+        app_api->getDatetime(&t);
 
         // time
         time_as_str(datetime_str, sizeof(datetime_buf), &t);
-- 
cgit v1.2.3-54-g00ecf