// If you did not resign in EVENT_TIMEOUT, you can use this event to update the display once a minute.
// Avoid displaying fast-updating values like seconds, since the display won't update again for 60 seconds.
// You should also consider starting the tick animation, to show the wearer that this is sleep mode:
- // watch_start_tick_animation(500);
+ // watch_start_sleep_animation(500);
break;
default:
// Movement's default loop handler will step in for any cases you don't handle above:
void close_enough_clock_face_activate(void *context) {
close_enough_clock_state_t *state = (close_enough_clock_state_t *)context;
- if (watch_tick_animation_is_running()) {
- watch_stop_tick_animation();
+ if (watch_sleep_animation_is_running()) {
+ watch_stop_sleep_animation();
}
if (movement_clock_mode_24h()) {
watch_set_indicator(WATCH_INDICATOR_PM);
}
if (event.event_type == EVENT_LOW_ENERGY_UPDATE) {
- if (!watch_tick_animation_is_running()) watch_start_tick_animation(500);
+ if (!watch_sleep_animation_is_running()) watch_start_sleep_animation(500);
sprintf(buf, "%s%2d %02d ", weekday, date_time.unit.day, percentage / 100);
} else {
sprintf(buf, "%s%2d %04d", weekday, date_time.unit.day, percentage);
if (event.event_type == EVENT_LOW_ENERGY_UPDATE) {
buf[8] = ' ';
buf[9] = ' ';
- if (!watch_tick_animation_is_running()) { watch_start_tick_animation(500); }
+ if (!watch_sleep_animation_is_running()) { watch_start_sleep_animation(500); }
}
// Update the display with our decimal time
break;
case EVENT_LOW_ENERGY_UPDATE:
// TODO: low energy update
- // watch_start_tick_animation(500);
+ // watch_start_sleep_animation(500);
break;
case EVENT_LIGHT_BUTTON_DOWN:
// don't light up every time light is hit
// If you did not resign in EVENT_TIMEOUT, you can use this event to update the display once a minute.
// Avoid displaying fast-updating values like seconds, since the display won't update again for 60 seconds.
// You should also consider starting the tick animation, to show the wearer that this is sleep mode:
- // watch_start_tick_animation(500);
+ // watch_start_sleep_animation(500);
_minimal_clock_face_update_display();
break;
default:
void minute_repeater_decimal_face_activate(void *context) {
minute_repeater_decimal_state_t *state = (minute_repeater_decimal_state_t *)context;
- if (watch_tick_animation_is_running()) watch_stop_tick_animation();
+ if (watch_sleep_animation_is_running()) watch_stop_sleep_animation();
if (movement_clock_mode_24h()) watch_set_indicator(WATCH_INDICATOR_24H);
}
pos = 0;
if (event.event_type == EVENT_LOW_ENERGY_UPDATE) {
- if (!watch_tick_animation_is_running()) watch_start_tick_animation(500);
+ if (!watch_sleep_animation_is_running()) watch_start_sleep_animation(500);
sprintf(buf, "%s%2d%2d%02d ", watch_utility_get_weekday(date_time), date_time.unit.day, date_time.unit.hour, date_time.unit.minute);
} else {
sprintf(buf, "%s%2d%2d%02d%02d", watch_utility_get_weekday(date_time), date_time.unit.day, date_time.unit.hour, date_time.unit.minute, date_time.unit.second);
void repetition_minute_face_activate(void *context) {
repetition_minute_state_t *state = (repetition_minute_state_t *)context;
- if (watch_tick_animation_is_running()) watch_stop_tick_animation();
+ if (watch_sleep_animation_is_running()) watch_stop_sleep_animation();
if (movement_clock_mode_24h()) watch_set_indicator(WATCH_INDICATOR_24H);
}
pos = 0;
if (event.event_type == EVENT_LOW_ENERGY_UPDATE) {
- if (!watch_tick_animation_is_running()) watch_start_tick_animation(500);
+ if (!watch_sleep_animation_is_running()) watch_start_sleep_animation(500);
sprintf(buf, "%s%2d%2d%02d ", watch_utility_get_weekday(date_time), date_time.unit.day, date_time.unit.hour, date_time.unit.minute);
} else {
sprintf(buf, "%s%2d%2d%02d%02d", watch_utility_get_weekday(date_time), date_time.unit.day, date_time.unit.hour, date_time.unit.minute, date_time.unit.second);
void simple_clock_bin_led_face_activate(void *context) {
simple_clock_bin_led_state_t *state = (simple_clock_bin_led_state_t *)context;
- if (watch_tick_animation_is_running()) watch_stop_tick_animation();
+ if (watch_sleep_animation_is_running()) watch_stop_sleep_animation();
if (movement_clock_mode_24h()) watch_set_indicator(WATCH_INDICATOR_24H);
}
pos = 0;
if (event.event_type == EVENT_LOW_ENERGY_UPDATE) {
- if (!watch_tick_animation_is_running()) watch_start_tick_animation(500);
+ if (!watch_sleep_animation_is_running()) watch_start_sleep_animation(500);
sprintf(buf, "%s%2d%2d%02d ", watch_utility_get_weekday(date_time), date_time.unit.day, date_time.unit.hour, date_time.unit.minute);
} else {
sprintf(buf, "%s%2d%2d%02d%02d", watch_utility_get_weekday(date_time), date_time.unit.day, date_time.unit.hour, date_time.unit.minute, date_time.unit.second);
void weeknumber_clock_face_activate(void *context) {
weeknumber_clock_state_t *state = (weeknumber_clock_state_t *)context;
- if (watch_tick_animation_is_running()) watch_stop_tick_animation();
+ if (watch_sleep_animation_is_running()) watch_stop_sleep_animation();
if (movement_clock_mode_24h()) watch_set_indicator(WATCH_INDICATOR_24H);
}
pos = 0;
if (event.event_type == EVENT_LOW_ENERGY_UPDATE) {
- if (!watch_tick_animation_is_running()) watch_start_tick_animation(500);
+ if (!watch_sleep_animation_is_running()) watch_start_sleep_animation(500);
sprintf(buf, "%s%2d%2d%02d ", watch_utility_get_weekday(date_time), date_time.unit.day, date_time.unit.hour, date_time.unit.minute);
} else {
sprintf(buf, "%s%2d%2d%02d%02d", watch_utility_get_weekday(date_time), date_time.unit.day, date_time.unit.hour, date_time.unit.minute, watch_utility_get_weeknumber(date_time.unit.year, date_time.unit.month, date_time.unit.day));
{
world_clock2_state_t *state = (world_clock2_state_t *) context;
- if (watch_tick_animation_is_running())
- watch_stop_tick_animation();
+ if (watch_sleep_animation_is_running())
+ watch_stop_sleep_animation();
switch (state->current_mode) {
case WORLD_CLOCK2_MODE_DISPLAY:
pos = 0;
if (event.event_type == EVENT_LOW_ENERGY_UPDATE) {
- if (!watch_tick_animation_is_running())
- watch_start_tick_animation(500);
+ if (!watch_sleep_animation_is_running())
+ watch_start_sleep_animation(500);
sprintf(buf, "%.2s%2d%2d%02d ",
zone_names[state->current_zone],
}
else {
_activity_update_logging_screen(state);
- watch_start_tick_animation(500);
+ watch_start_sleep_animation(500);
}
break;
default:
// fast-updating values like seconds, since the display won't
// update again for 60 seconds. You should also consider starting
// the tick animation, to show the wearer that this is sleep mode:
- // watch_start_tick_animation(500);
+ // watch_start_sleep_animation(500);
break;
default:
// Movement's default loop handler will step in for any cases you
state->current_page = current_page;
state->days_prev_period = 0;
watch_clear_indicator(WATCH_INDICATOR_BELL);
- if (watch_tick_animation_is_running())
- watch_stop_tick_animation();
+ if (watch_sleep_animation_is_running())
+ watch_stop_sleep_animation();
break;
case EVENT_ALARM_LONG_PRESS:
switch (current_page) {
break;
case first_period:
if (state->dates.reg) {
- if (!watch_tick_animation_is_running())
- watch_start_tick_animation(500); // Tracking activated
+ if (!watch_sleep_animation_is_running())
+ watch_start_sleep_animation(500); // Tracking activated
}
else if (event.subsecond % 5) { // blink active for 3 quarter-seconds
sprintf(buf, "%2d", state->days_prev_period);
state->offset = 0;
// finally: clear out the last two digits and replace them with the sleep mode indicator
watch_display_string(" ", 8);
- if (!watch_tick_animation_is_running()) watch_start_tick_animation(1000);
+ if (!watch_sleep_animation_is_running()) watch_start_sleep_animation(1000);
break;
case EVENT_ALARM_BUTTON_UP:
// Pressing the alarm adds an offset of one day to the displayed value,
case EVENT_LOW_ENERGY_UPDATE:
// Display static title and tick animation during LE
watch_display_string("Pd Table", 0);
- watch_start_tick_animation(500);
+ watch_start_sleep_animation(500);
break;
default:
return movement_default_loop_handler(event);
}
void planetary_hours_face_activate(void *context) {
- if (watch_tick_animation_is_running()) watch_stop_tick_animation();
+ if (watch_sleep_animation_is_running()) watch_stop_sleep_animation();
#if __EMSCRIPTEN__
int16_t browser_lat = EM_ASM_INT({ return lat; });
}
void planetary_time_face_activate(void *context) {
- if (watch_tick_animation_is_running()) watch_stop_tick_animation();
+ if (watch_sleep_animation_is_running()) watch_stop_sleep_animation();
#if __EMSCRIPTEN__
int16_t browser_lat = EM_ASM_INT({ return lat; });
state->day_ruler = !state->day_ruler;
break;
case EVENT_LOW_ENERGY_UPDATE:
- watch_start_tick_animation(500);
+ watch_start_sleep_animation(500);
break;
default:
return movement_default_loop_handler(event);
// If you did not resign in EVENT_TIMEOUT, you can use this event to update the display once a minute.
// Avoid displaying fast-updating values like seconds, since the display won't update again for 60 seconds.
// You should also consider starting the tick animation, to show the wearer that this is sleep mode:
- // watch_start_tick_animation(500);
+ // watch_start_sleep_animation(500);
break;
default:
// Movement's default loop handler will step in for any cases you don't handle above:
}
void stopwatch_face_activate(void *context) {
- if (watch_tick_animation_is_running()) watch_stop_tick_animation();
+ if (watch_sleep_animation_is_running()) watch_stop_sleep_animation();
stopwatch_state_t *stopwatch_state = (stopwatch_state_t *)context;
if (stopwatch_state->running) {
// explicitly ignore the timeout event so we stay on screen
break;
case EVENT_LOW_ENERGY_UPDATE:
- if (!watch_tick_animation_is_running()) watch_start_tick_animation(1000);
+ if (!watch_sleep_animation_is_running()) watch_start_sleep_animation(1000);
if (!stopwatch_state->running) {
// since the tick animation is running, displaying the stopped time could be misleading,
// as it could imply that the stopwatch is running. instead, show a blank display to
}
void sunrise_sunset_face_activate(void *context) {
- if (watch_tick_animation_is_running()) watch_stop_tick_animation();
+ if (watch_sleep_animation_is_running()) watch_stop_sleep_animation();
#if __EMSCRIPTEN__
int16_t browser_lat = EM_ASM_INT({
case EVENT_TICK:
if (state->page == 0) {
// if entering low energy mode, start tick animation
- if (event.event_type == EVENT_LOW_ENERGY_UPDATE && !watch_tick_animation_is_running()) watch_start_tick_animation(1000);
+ if (event.event_type == EVENT_LOW_ENERGY_UPDATE && !watch_sleep_animation_is_running()) watch_start_sleep_animation(1000);
// check if we need to update the display
watch_date_time date_time = watch_rtc_get_date_time();
if (date_time.reg >= state->rise_set_expires.reg) {
// If you did not resign in EVENT_TIMEOUT, you can use this event to update the display once a minute.
// Avoid displaying fast-updating values like seconds, since the display won't update again for 60 seconds.
// You should also consider starting the tick animation, to show the wearer that this is sleep mode:
- // watch_start_tick_animation(500);
+ // watch_start_sleep_animation(500);
break;
case EVENT_LIGHT_BUTTON_DOWN:
// don't light up every time light is hit
wareki_state_t *state = (wareki_state_t *)context;
- if (watch_tick_animation_is_running()) watch_stop_tick_animation();
+ if (watch_sleep_animation_is_running()) watch_stop_sleep_animation();
state->active = false;
// If you did not resign in EVENT_TIMEOUT, you can use this event to update the display once a minute.
// Avoid displaying fast-updating values like seconds, since the display won't update again for 60 seconds.
// You should also consider starting the tick animation, to show the wearer that this is sleep mode:
- // watch_start_tick_animation(500);
+ // watch_start_sleep_animation(500);
//break;
default:
// Movement's default loop handler will step in for any cases you don't handle above:
case EVENT_TIMEOUT:
break;
case EVENT_LOW_ENERGY_UPDATE:
- watch_start_tick_animation(500);
+ watch_start_sleep_animation(500);
break;
default:
movement_default_loop_handler(event);
break;
case EVENT_LOW_ENERGY_UPDATE:
// clear seconds area and start tick animation if necessary
- if (!watch_tick_animation_is_running()) {
+ if (!watch_sleep_animation_is_running()) {
watch_display_string(" ", 8);
- watch_start_tick_animation(1000);
+ watch_start_sleep_animation(1000);
}
// update once an hour
if (date_time.unit.minute == 0) {
}
break;
case EVENT_LOW_ENERGY_UPDATE:
- if (!watch_tick_animation_is_running()) {
+ if (!watch_sleep_animation_is_running()) {
state->mode = MODE_NORMAL;
watch_clear_indicator(WATCH_INDICATOR_BELL);
watch_clear_indicator(WATCH_INDICATOR_SIGNAL);
- watch_start_tick_animation(1000);
+ watch_start_sleep_animation(1000);
}
if (watch_rtc_get_date_time().unit.minute % 5 == 0) {
_alarm_thermometer_face_update(movement_use_imperial_units());
break;
case EVENT_LOW_ENERGY_UPDATE:
// clear seconds area and start tick animation if necessary
- if (!watch_tick_animation_is_running()) {
+ if (!watch_sleep_animation_is_running()) {
watch_display_string(" ", 8);
- watch_start_tick_animation(1000);
+ watch_start_sleep_animation(1000);
}
// update every 5 minutes
if (date_time.unit.minute % 5 == 0) {
// If you did not resign in EVENT_TIMEOUT, you can use this event to update the display once a minute.
// Avoid displaying fast-updating values like seconds, since the display won't update again for 60 seconds.
// You should also consider starting the tick animation, to show the wearer that this is sleep mode:
- // watch_start_tick_animation(500);
+ // watch_start_sleep_animation(500);
break;
case EVENT_LIGHT_BUTTON_DOWN:
// If you did not resign in EVENT_TIMEOUT, you can use this event to update the display once a minute.
// Avoid displaying fast-updating values like seconds, since the display won't update again for 60 seconds.
// You should also consider starting the tick animation, to show the wearer that this is sleep mode:
- // watch_start_tick_animation(500);
+ // watch_start_sleep_animation(500);
break;
case EVENT_BACKGROUND_TASK:
// Here we measure temperature and do main frequency correction
watch_display_text(WATCH_POSITION_BOTTOM, buf);
break;
case EVENT_LOW_ENERGY_UPDATE:
- if (!watch_tick_animation_is_running()) watch_start_tick_animation(432);
+ if (!watch_sleep_animation_is_running()) watch_start_sleep_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_get_current_timezone_offset());
sprintf(buf, "%4lu ", centibeats / 100);
}
static void clock_start_tick_tock_animation(void) {
- if (!watch_tick_animation_is_running()) {
- watch_start_tick_animation(500);
+ if (!watch_sleep_animation_is_running()) {
+ watch_start_sleep_animation(500);
}
}
static void clock_stop_tick_tock_animation(void) {
- if (watch_tick_animation_is_running()) {
- watch_stop_tick_animation();
+ if (watch_sleep_animation_is_running()) {
+ watch_stop_sleep_animation();
}
}
void simple_clock_face_activate(void *context) {
simple_clock_state_t *state = (simple_clock_state_t *)context;
- if (watch_tick_animation_is_running()) watch_stop_tick_animation();
+ if (watch_sleep_animation_is_running()) watch_stop_sleep_animation();
if (movement_clock_mode_24h()) watch_set_indicator(WATCH_INDICATOR_24H);
watch_display_text(WATCH_POSITION_MINUTES, buf + 4);
if (event.event_type == EVENT_LOW_ENERGY_UPDATE) {
watch_display_character(' ', 9);
- if (!watch_tick_animation_is_running()) watch_start_tick_animation(500);
+ if (!watch_sleep_animation_is_running()) watch_start_sleep_animation(500);
} else {
watch_display_text(WATCH_POSITION_SECONDS, buf + 6);
}
state->current_screen = 0;
_update_timezone_offset(state);
- if (watch_tick_animation_is_running()) watch_stop_tick_animation();
+ if (watch_sleep_animation_is_running()) watch_stop_sleep_animation();
}
static bool world_clock_face_do_display_mode(movement_event_t event, world_clock_state_t *state) {
watch_display_text(WATCH_POSITION_HOURS, buf + 2);
watch_display_text(WATCH_POSITION_MINUTES, buf + 4);
if (event.event_type == EVENT_LOW_ENERGY_UPDATE) {
- if (!watch_tick_animation_is_running()) watch_start_tick_animation(500);
+ if (!watch_sleep_animation_is_running()) watch_start_sleep_animation(500);
} else {
watch_display_text(WATCH_POSITION_SECONDS, buf + 6);
}
slcd_set_blink_enabled(false);
}
-void watch_start_tick_animation(uint32_t duration) {
+void watch_start_sleep_animation(uint32_t duration) {
#ifdef USE_CUSTOM_LCD
(void) duration;
watch_set_indicator(WATCH_INDICATOR_SLEEP);
#endif
}
-bool watch_tick_animation_is_running(void) {
+bool watch_sleep_animation_is_running(void) {
// TODO: wrap this in gossamer call
return SLCD->CTRLD.bit.CSREN;
}
-void watch_stop_tick_animation(void) {
+void watch_stop_sleep_animation(void) {
#ifdef USE_CUSTOM_LCD
watch_clear_indicator(WATCH_INDICATOR_SLEEP);
#else
* Sleep mode, since that mode turns off the LCD).
* @param duration The duration of each frame in ms. 500 milliseconds produces a classic tick/tock.
*/
-void watch_start_tick_animation(uint32_t duration);
+void watch_start_sleep_animation(uint32_t duration);
/** @brief Checks if the tick animation is currently running.
* @return true if the animation is running; false otherwise.
*/
-bool watch_tick_animation_is_running(void);
+bool watch_sleep_animation_is_running(void);
/** @brief Stops the tick/tock animation and clears all animating segments.
* @details This will stop the animation and clear all segments in position 8.
*/
-void watch_stop_tick_animation(void);
+void watch_stop_sleep_animation(void);
/// @}
}
}
-void watch_start_tick_animation(uint32_t duration) {
+void watch_start_sleep_animation(uint32_t duration) {
if (tick_interval_id != -1) return;
watch_display_character(' ', 8);
tick_interval_id = emscripten_set_interval(watch_invoke_tick_callback, (double)duration, NULL);
}
-bool watch_tick_animation_is_running(void) {
+bool watch_sleep_animation_is_running(void) {
return tick_interval_id != -1;
}
-void watch_stop_tick_animation(void) {
+void watch_stop_sleep_animation(void) {
emscripten_clear_timeout(tick_interval_id);
tick_interval_id = -1;
tick_state = false;