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

@@ -664,20 +664,17 @@ void app_init(void) {
movement_store_settings();
}
// populate the DST offset cache
_movement_update_dst_offset_cache();
watch_date_time_t date_time = watch_rtc_get_date_time();
if (date_time.reg == 0) {
// at first boot, set year to 2025
date_time.unit.year = 2025 - WATCH_RTC_REFERENCE_YEAR;
date_time.unit.month = 1;
date_time.unit.day = 1;
date_time = watch_get_init_date_time();
// but convert from local time to UTC
date_time = watch_utility_date_time_convert_zone(date_time, movement_get_current_timezone_offset(), 0);
watch_rtc_set_date_time(date_time);
}
// populate the DST offset cache
_movement_update_dst_offset_cache();
if (movement_state.accelerometer_motion_threshold == 0) movement_state.accelerometer_motion_threshold = 32;
movement_state.light_ticks = -1;