summaryrefslogtreecommitdiffstats
path: root/watch-library/hardware/main.c
diff options
context:
space:
mode:
authorJoey Castillo <joeycastillo@utexas.edu>2022-05-02 18:39:45 -0500
committerJoey Castillo <joeycastillo@utexas.edu>2022-05-02 18:39:45 -0500
commitcd405735351035df657b64547b3dfc6a3d59db56 (patch)
tree1cdd5e6b0d0434d20f71045178a1e5e7377eb56f /watch-library/hardware/main.c
parent0004c30f422e702fd184a54e9f1d55da878bcd0f (diff)
parent35d1f5e647ac1b5fcccdb43ec58058587dd5301b (diff)
downloadSensor-Watch-cd405735351035df657b64547b3dfc6a3d59db56.tar.gz
Sensor-Watch-cd405735351035df657b64547b3dfc6a3d59db56.tar.bz2
Sensor-Watch-cd405735351035df657b64547b3dfc6a3d59db56.zip
Merge branch 'main' of github.com:joeycastillo/Sensor-Watch into motion-express
Diffstat (limited to 'watch-library/hardware/main.c')
-rwxr-xr-xwatch-library/hardware/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/watch-library/hardware/main.c b/watch-library/hardware/main.c
index eb372cc4..d1eee168 100755
--- a/watch-library/hardware/main.c
+++ b/watch-library/hardware/main.c
@@ -66,6 +66,13 @@ int main(void) {
// Watch library code. Set initial parameters for the device and enable the RTC.
_watch_init();
+ // if date/time register is 0 (power on reset state), default year to 2022.
+ watch_date_time date_time = watch_rtc_get_date_time();
+ if (date_time.reg == 0) {
+ date_time.unit.year = 2;
+ watch_rtc_set_date_time(date_time);
+ }
+
// User code. Give the app a chance to enable and set up peripherals.
app_setup();