} tide_state_t;
void tide_face_setup(uint8_t watch_face_index, void** state_ptr) {
+ (void) watch_face_index;
if (*state_ptr == NULL) {
// Boot time initialization.
*state_ptr = malloc(sizeof(tide_state_t));
}
}
-uint32_t _get_current_unix_time() {
+static uint32_t _get_current_unix_time() {
return watch_utility_date_time_to_unix_time(movement_get_utc_date_time(), 0);
}
-void _move_next_high_tide(tide_state_t* state, uint32_t now) {
+static void _move_next_high_tide(tide_state_t* state, uint32_t now) {
while (state->next_high_tide > now + SEMI_DIURNAL_TIDAL_PERIOD) {
state->next_high_tide -= SEMI_DIURNAL_TIDAL_PERIOD;
}
switch (_get_tide_amplitude(time)) {
case spring_tide:
_set_pixel(digit_mapping[9].segment[0]); // top horizontal bar on the bottom-right character.
+ // fall-through
case medium_tide:
_set_pixel(digit_mapping[9].segment[6]); // mid horizontal bar on the bottom-right character.
+ // fall-through
case neap_tide:
_set_pixel(digit_mapping[9].segment[3]); // bottom horizontal bar on the bottom-right character.
break;
switch(state->mode) {
case empty:
state->next_high_tide = _get_current_unix_time();
- // fallthrough intended.
+ // fall-through
case current:
case future:
state->mode = setting_hour;
state->mode = current;
_draw(state, now, event.subsecond);
}
- // Passthrough intended:
+ // fall-through
// Delegate the resign behavior to the default loop handler.
default:
return movement_default_loop_handler(event);
sprintf(buf, "%2d", valid_for);
watch_display_text(WATCH_POSITION_TOP_RIGHT, buf);
- sprintf(buf, "%06u", totp_state->current_code);
+ sprintf(buf, "%06u", (unsigned int)totp_state->current_code);
watch_display_text(WATCH_POSITION_BOTTOM, buf);
}
bool voltage_face_loop(movement_event_t event, void *context) {
(void) context;
- watch_date_time_t date_time;
+ watch_date_time_t date_time = {0};
switch (event.event_type) {
case EVENT_ACTIVATE:
if (watch_sleep_animation_is_running()) watch_stop_sleep_animation();