Set time on make (#35)

* Time can get set from makefile

* Added setting make time into simulator

* Added  Hash in settings

* Added default location

* Cuts the Githash to 6 characters in the settings in case the makefile didn't do that already

* bump gossamer commit

* remove automatic timezone setting

* automatic time set: rename MAKEFILE_ to BUILD_ to match gossamer

* Revert "Added default location"

This reverts commit c24f69450fd40472c4f6cebb790a56c3f0d69cb6.

* silence warning

* watch_get_init_date_time: explicitly initialize all fields to 0

---------

Co-authored-by: Joey Castillo <joeycastillo@utexas.edu>
This commit is contained in:
voloved
2025-07-06 10:56:27 -04:00
committed by GitHub
parent 7a6f7147ae
commit 154bd54510
6 changed files with 91 additions and 8 deletions

View File

@@ -56,6 +56,32 @@ rtc_date_time_t watch_rtc_get_date_time(void) {
return rtc_get_date_time();
}
rtc_date_time_t watch_get_init_date_time(void) {
rtc_date_time_t date_time;
#ifdef BUILD_YEAR
date_time.unit.year = BUILD_YEAR;
#else
date_time.unit.year = 5;
#endif
#ifdef BUILD_MONTH
date_time.unit.month = BUILD_MONTH;
#else
date_time.unit.month = 1;
#endif
#ifdef BUILD_DAY
date_time.unit.day = BUILD_DAY;
#else
date_time.unit.day = 1;
#endif
#ifdef BUILD_HOUR
date_time.unit.hour = BUILD_HOUR;
#endif
#ifdef BUILD_MINUTE
date_time.unit.minute = BUILD_MINUTE;
#endif
return date_time;
}
void watch_rtc_register_tick_callback(watch_cb_t callback) {
watch_rtc_register_periodic_callback(callback, 1);
}