Exemplo n.º 1
0
void chrono_digital_window_appear_handler(struct Window *window) {
  app_log(APP_LOG_LEVEL_INFO, __FILE__, __LINE__, "chrono digital appears");
  chrono_digital_window_showing = true;

  // We never have the lap timer paused while the digital window is visible.
  chrono_data.lap_paused = false;

  if (chrono_data.running) {
    window_set_click_config_provider(chrono_digital_window, &started_click_config_provider);
  } else {
    window_set_click_config_provider(chrono_digital_window, &stopped_click_config_provider);
  }

  reset_chrono_digital_timer();
}
Exemplo n.º 2
0
// Sets the tick timer to fire at the appropriate rate based on current conditions.
void reset_tick_timer() {
  tick_timer_service_unsubscribe();

#if defined(FAST_TIME) || defined(BATTERY_HACK)
  tick_timer_service_subscribe(SECOND_UNIT, handle_tick);

#elif defined(MAKE_CHRONOGRAPH)
  if (config.second_hand || chrono_data.running) {
    tick_timer_service_subscribe(SECOND_UNIT, handle_tick);
  } else {
    tick_timer_service_subscribe(MINUTE_UNIT, handle_tick);
  }

  reset_chrono_digital_timer();

#else
  if (config.second_hand) {
    tick_timer_service_subscribe(SECOND_UNIT, handle_tick);
  } else {
    tick_timer_service_subscribe(MINUTE_UNIT, handle_tick);
  }
#endif
}
Exemplo n.º 3
0
void handle_chrono_digital_timer(void *data) {
  chrono_digital_timer = NULL;  // When the timer is handled, it is implicitly canceled.

  reset_chrono_digital_timer();
}
Exemplo n.º 4
0
void chrono_digital_window_disappear_handler(struct Window *window) {
  app_log(APP_LOG_LEVEL_INFO, __FILE__, __LINE__, "chrono digital disappears");
  chrono_digital_window_showing = false;
  reset_chrono_digital_timer();
}