diff options
author | Joey Castillo <joeycastillo@utexas.edu> | 2022-04-21 14:12:16 -0400 |
---|---|---|
committer | Joey Castillo <joeycastillo@utexas.edu> | 2022-04-21 14:18:17 -0400 |
commit | 9c2b3b7c175f87bf5af5746a5ba0ecd8c4089293 (patch) | |
tree | 1e8d3a82021945a99ad49eb84fcce41acb5b6446 | |
parent | cedfe72ced5ab185d580d21d5766b0ba37cbc2ce (diff) | |
download | Sensor-Watch-9c2b3b7c175f87bf5af5746a5ba0ecd8c4089293.tar.gz Sensor-Watch-9c2b3b7c175f87bf5af5746a5ba0ecd8c4089293.tar.bz2 Sensor-Watch-9c2b3b7c175f87bf5af5746a5ba0ecd8c4089293.zip |
make 2022 the default year
-rwxr-xr-x | watch-library/hardware/main.c | 7 |
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(); |