Optimize finetune and nanosec faces to work with rtc-counter32

This commit is contained in:
Alessandro Genova
2025-08-02 23:06:45 -04:00
parent 6e23421df4
commit e2d13e076e
5 changed files with 28 additions and 33 deletions
+15 -6
View File
@@ -535,8 +535,22 @@ watch_date_time_t movement_get_local_date_time(void) {
return watch_utility_date_time_from_unix_time(timestamp, movement_get_current_timezone_offset());
}
uint32_t movement_get_utc_timestamp(void) {
return watch_rtc_get_unix_time();
}
void movement_set_utc_date_time(watch_date_time_t date_time) {
watch_rtc_set_date_time(date_time);
movement_set_utc_timestamp(watch_utility_date_time_to_unix_time(date_time, 0));
}
void movement_set_local_date_time(watch_date_time_t date_time) {
int32_t current_offset = movement_get_current_timezone_offset();
watch_date_time_t utc_date_time = watch_utility_date_time_convert_zone(date_time, current_offset, 0);
movement_set_utc_date_time(utc_date_time);
}
void movement_set_utc_timestamp(uint32_t timestamp) {
watch_rtc_set_unix_time(timestamp);
// If the time was changed, the top of the minute alarm needs to be reset accordingly
_movement_set_top_of_minute_alarm();
@@ -547,11 +561,6 @@ void movement_set_utc_date_time(watch_date_time_t date_time) {
_movement_update_dst_offset_cache();
}
void movement_set_local_date_time(watch_date_time_t date_time) {
int32_t current_offset = movement_get_current_timezone_offset();
watch_date_time_t utc_date_time = watch_utility_date_time_convert_zone(date_time, current_offset, 0);
movement_set_utc_date_time(utc_date_time);
}
bool movement_button_should_sound(void) {
return movement_state.settings.bit.button_should_sound;