|
|
|
|
@@ -61,7 +61,7 @@ bool beats_face_loop(movement_event_t event, movement_settings_t *settings, void
|
|
|
|
|
case EVENT_ACTIVATE:
|
|
|
|
|
case EVENT_TICK:
|
|
|
|
|
date_time = watch_rtc_get_date_time();
|
|
|
|
|
centibeats = clock2beats(date_time.unit.hour, date_time.unit.minute, date_time.unit.second, event.subsecond, movement_timezone_offsets[settings->bit.time_zone]);
|
|
|
|
|
centibeats = clock2beats(date_time.unit.hour, date_time.unit.minute, date_time.unit.second, event.subsecond, movement_get_current_timezone_offset());
|
|
|
|
|
if (centibeats == state->last_centibeat_displayed) {
|
|
|
|
|
// we missed this update, try again next subsecond
|
|
|
|
|
state->next_subsecond_update = (event.subsecond + 1) % BEAT_REFRESH_FREQUENCY;
|
|
|
|
|
@@ -71,15 +71,15 @@ bool beats_face_loop(movement_event_t event, movement_settings_t *settings, void
|
|
|
|
|
}
|
|
|
|
|
sprintf(buf, "bt %6lu", centibeats);
|
|
|
|
|
|
|
|
|
|
watch_display_string(buf, 0);
|
|
|
|
|
watch_display_text(WATCH_POSITION_FULL, buf);
|
|
|
|
|
break;
|
|
|
|
|
case EVENT_LOW_ENERGY_UPDATE:
|
|
|
|
|
if (!watch_tick_animation_is_running()) watch_start_tick_animation(432);
|
|
|
|
|
date_time = watch_rtc_get_date_time();
|
|
|
|
|
centibeats = clock2beats(date_time.unit.hour, date_time.unit.minute, date_time.unit.second, event.subsecond, movement_timezone_offsets[settings->bit.time_zone]);
|
|
|
|
|
centibeats = clock2beats(date_time.unit.hour, date_time.unit.minute, date_time.unit.second, event.subsecond, movement_get_current_timezone_offset());
|
|
|
|
|
sprintf(buf, "bt %4lu ", centibeats / 100);
|
|
|
|
|
|
|
|
|
|
watch_display_string(buf, 0);
|
|
|
|
|
watch_display_text(WATCH_POSITION_FULL, buf);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
movement_default_loop_handler(event, settings);
|
|
|
|
|
@@ -98,7 +98,7 @@ uint32_t clock2beats(uint32_t hours, uint32_t minutes, uint32_t seconds, uint32_
|
|
|
|
|
uint32_t retval = seconds * 1000 + (subseconds * 1000) / (BEAT_REFRESH_FREQUENCY);
|
|
|
|
|
retval += 60 * minutes * 1000;
|
|
|
|
|
retval += hours * 60 * 60 * 1000;
|
|
|
|
|
retval -= (utc_offset - 60) * 60 * 1000;
|
|
|
|
|
retval -= (utc_offset - 3600) * 1000;
|
|
|
|
|
|
|
|
|
|
retval /= 864; // convert to centibeats
|
|
|
|
|
retval %= 100000;
|