mirror of
https://github.com/firewalkwithm3/Sensor-Watch.git
synced 2024-11-22 19:20:30 +08:00
add default loop handler to all current watch faces
This commit is contained in:
parent
12f2d31f98
commit
2b22ecc8e4
|
@ -57,16 +57,8 @@ bool beats_face_loop(movement_event_t event, movement_settings_t *settings, void
|
|||
|
||||
watch_display_string(buf, 0);
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_DOWN:
|
||||
movement_illuminate_led();
|
||||
break;
|
||||
case EVENT_ALARM_BUTTON_DOWN:
|
||||
case EVENT_ALARM_BUTTON_UP:
|
||||
case EVENT_ALARM_LONG_PRESS:
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -88,4 +80,4 @@ uint32_t clock2beats(uint32_t hours, uint32_t minutes, uint32_t seconds, uint32_
|
|||
retval %= 100000;
|
||||
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -129,9 +129,6 @@ bool mars_time_face_loop(movement_event_t event, movement_settings_t *settings,
|
|||
case EVENT_TICK:
|
||||
_update(settings, state);
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_UP:
|
||||
state->displaying_sol = !state->displaying_sol;
|
||||
_update(settings, state);
|
||||
|
@ -152,6 +149,7 @@ bool mars_time_face_loop(movement_event_t event, movement_settings_t *settings,
|
|||
// watch_start_tick_animation(500);
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -122,12 +122,6 @@ bool weeknumber_clock_face_loop(movement_event_t event, movement_settings_t *set
|
|||
// handle alarm indicator
|
||||
if (state->alarm_enabled != settings->bit.alarm_enabled) _update_alarm_indicator(settings->bit.alarm_enabled, state);
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
return false;
|
||||
case EVENT_LIGHT_BUTTON_DOWN:
|
||||
movement_illuminate_led();
|
||||
break;
|
||||
case EVENT_ALARM_LONG_PRESS:
|
||||
state->signal_enabled = !state->signal_enabled;
|
||||
if (state->signal_enabled) watch_set_indicator(WATCH_INDICATOR_BELL);
|
||||
|
@ -149,6 +143,7 @@ bool weeknumber_clock_face_loop(movement_event_t event, movement_settings_t *set
|
|||
}
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -441,13 +441,11 @@ bool alarm_face_loop(movement_event_t event, movement_settings_t *settings, void
|
|||
_alarm_update_alarm_enabled(settings, state);
|
||||
}
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_TIMEOUT:
|
||||
movement_move_to_face(0);
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -219,14 +219,6 @@ bool astronomy_face_loop(movement_event_t event, movement_settings_t *settings,
|
|||
case EVENT_TICK:
|
||||
_astronomy_face_update(event, settings, state);
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
// You shouldn't need to change this case; Mode almost always moves to the next watch face.
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_UP:
|
||||
// If you have other uses for the Light button, you can opt not to illuminate the LED for this event.
|
||||
movement_illuminate_led();
|
||||
break;
|
||||
case EVENT_ALARM_BUTTON_UP:
|
||||
switch (state->mode) {
|
||||
case ASTRONOMY_MODE_SELECTING_BODY:
|
||||
|
@ -267,6 +259,7 @@ bool astronomy_face_loop(movement_event_t event, movement_settings_t *settings,
|
|||
// TODO?
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -57,9 +57,6 @@ bool blinky_face_loop(movement_event_t event, movement_settings_t *settings, voi
|
|||
case EVENT_ACTIVATE:
|
||||
_blinky_face_update_lcd(state);
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_UP:
|
||||
if (!state->active) {
|
||||
state->color = (state->color + 1) % 3;
|
||||
|
@ -93,7 +90,9 @@ bool blinky_face_loop(movement_event_t event, movement_settings_t *settings, voi
|
|||
break;
|
||||
case EVENT_TIMEOUT:
|
||||
if (!state->active) movement_move_to_face(0);
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -160,9 +160,6 @@ bool countdown_face_loop(movement_event_t event, movement_settings_t *settings,
|
|||
}
|
||||
draw(state, event.subsecond);
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_UP:
|
||||
switch(state->mode) {
|
||||
case cd_running:
|
||||
|
@ -216,8 +213,10 @@ bool countdown_face_loop(movement_event_t event, movement_settings_t *settings,
|
|||
movement_move_to_face(0);
|
||||
break;
|
||||
case EVENT_LOW_ENERGY_UPDATE:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -47,12 +47,6 @@ bool counter_face_loop(movement_event_t event, movement_settings_t *settings, vo
|
|||
counter_state_t *state = (counter_state_t *)context;
|
||||
|
||||
switch (event.event_type) {
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_DOWN:
|
||||
movement_illuminate_led();
|
||||
break;
|
||||
case EVENT_ALARM_BUTTON_UP:
|
||||
state->counter_idx++; // increment counter index
|
||||
if (state->counter_idx>99) { //0-99
|
||||
|
@ -72,6 +66,7 @@ bool counter_face_loop(movement_event_t event, movement_settings_t *settings, vo
|
|||
// ignore timeout
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -110,12 +110,6 @@ bool databank_face_loop(movement_event_t event, movement_settings_t *settings, v
|
|||
databank_state.current_word = 0;
|
||||
display();
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
// when the user presses 'mode', we tell movement to move to the next watch face.
|
||||
// movement will call our resign function, clear the screen, and transfer control
|
||||
// to the next watch face in the list.
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_ALARM_LONG_PRESS:
|
||||
databank_state.databank_page = (databank_state.databank_page + 1) % databank_num_pages;
|
||||
databank_state.current_word = 0;
|
||||
|
@ -141,7 +135,9 @@ bool databank_face_loop(movement_event_t event, movement_settings_t *settings, v
|
|||
// and it will do it long before the watch enters low energy mode. This ensures we
|
||||
// won't be on screen, and thus opts us out of getting the EVENT_LOW_ENERGY_UPDATE above.
|
||||
movement_move_to_face(0);
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -123,9 +123,6 @@ bool day_one_face_loop(movement_event_t event, movement_settings_t *settings, vo
|
|||
}
|
||||
}
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_DOWN:
|
||||
// only illuminate if we're in display mode
|
||||
if (state->current_page == 0) movement_illuminate_led();
|
||||
|
@ -176,7 +173,9 @@ bool day_one_face_loop(movement_event_t event, movement_settings_t *settings, vo
|
|||
if (state->current_page != 0) {
|
||||
movement_move_to_face(0);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -664,14 +664,12 @@ bool interval_face_loop(movement_event_t event, movement_settings_t *settings, v
|
|||
watch_buzzer_play_sequence((int8_t *)_sound_seq_finish, NULL);
|
||||
}
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_TIMEOUT:
|
||||
if (state->face_state != interval_state_running) movement_move_to_face(0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -174,14 +174,6 @@ bool orrery_face_loop(movement_event_t event, movement_settings_t *settings, voi
|
|||
case EVENT_TICK:
|
||||
_orrery_face_update(event, settings, state);
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_DOWN:
|
||||
movement_illuminate_led();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_UP:
|
||||
break;
|
||||
case EVENT_ALARM_BUTTON_UP:
|
||||
switch (state->mode) {
|
||||
case ORRERY_MODE_SELECTING_BODY:
|
||||
|
@ -219,6 +211,7 @@ bool orrery_face_loop(movement_event_t event, movement_settings_t *settings, voi
|
|||
movement_move_to_face(0);
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -141,9 +141,6 @@ bool probability_face_loop(movement_event_t event, movement_settings_t *settings
|
|||
case EVENT_TICK:
|
||||
display_dice_roll_animation(state);
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_UP:
|
||||
// Change how many sides the die has
|
||||
for (int i = 0; i < NUM_DICE_TYPES; i++) {
|
||||
|
@ -170,6 +167,7 @@ bool probability_face_loop(movement_event_t event, movement_settings_t *settings
|
|||
watch_display_string("SLEEP ", 4);
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,12 +46,6 @@ bool pulsometer_face_loop(movement_event_t event, movement_settings_t *settings,
|
|||
pulsometer_state_t *pulsometer_state = (pulsometer_state_t *)context;
|
||||
char buf[14];
|
||||
switch (event.event_type) {
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_DOWN:
|
||||
movement_illuminate_led();
|
||||
break;
|
||||
case EVENT_ALARM_BUTTON_DOWN:
|
||||
pulsometer_state->measuring = true;
|
||||
pulsometer_state->pulse = 0xFFFF;
|
||||
|
@ -102,6 +96,7 @@ bool pulsometer_face_loop(movement_event_t event, movement_settings_t *settings,
|
|||
movement_move_to_face(0);
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,12 +49,6 @@ bool ratemeter_face_loop(movement_event_t event, movement_settings_t *settings,
|
|||
case EVENT_ACTIVATE:
|
||||
watch_display_string("ra ", 0);
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_DOWN:
|
||||
movement_illuminate_led();
|
||||
break;
|
||||
case EVENT_ALARM_BUTTON_DOWN:
|
||||
if (ratemeter_state->ticks != 0) {
|
||||
ratemeter_state->rate = (int16_t)(60.0 / ((float)ratemeter_state->ticks / (float)RATEMETER_FACE_FREQUENCY));
|
||||
|
@ -85,6 +79,7 @@ bool ratemeter_face_loop(movement_event_t event, movement_settings_t *settings,
|
|||
movement_move_to_face(0);
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -441,7 +441,9 @@ bool rpn_calculator_alt_face_loop(movement_event_t event, movement_settings_t *s
|
|||
movement_move_to_face(0);
|
||||
break;
|
||||
case EVENT_LOW_ENERGY_UPDATE:
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -333,6 +333,7 @@ bool rpn_calculator_face_loop(movement_event_t event, movement_settings_t *setti
|
|||
case EVENT_LOW_ENERGY_UPDATE:
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -197,9 +197,6 @@ bool sailing_face_loop(movement_event_t event, movement_settings_t *settings, vo
|
|||
}
|
||||
draw(state, event.subsecond, settings);
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_LONG_PRESS:
|
||||
if (state->mode == sl_running) {
|
||||
reset(state);
|
||||
|
@ -258,8 +255,10 @@ bool sailing_face_loop(movement_event_t event, movement_settings_t *settings, vo
|
|||
}
|
||||
break;
|
||||
case EVENT_LOW_ENERGY_UPDATE:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -251,9 +251,6 @@ bool stock_stopwatch_face_loop(movement_event_t event, movement_settings_t *sett
|
|||
case EVENT_TICK:
|
||||
_draw();
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_LONG_PRESS:
|
||||
// kind od hidden feature: long press toggles light on or off
|
||||
state->light_on_button = !state->light_on_button;
|
||||
|
@ -313,6 +310,7 @@ bool stock_stopwatch_face_loop(movement_event_t event, movement_settings_t *sett
|
|||
_draw();
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
|
@ -323,4 +321,4 @@ void stock_stopwatch_face_resign(movement_settings_t *settings, void *context) {
|
|||
(void) context;
|
||||
// cancel the keepalive task
|
||||
movement_cancel_background_task();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -138,9 +138,6 @@ bool tachymeter_face_loop(movement_event_t event, movement_settings_t *settings,
|
|||
state->animation_state = (state->animation_state + 1) % 6;
|
||||
}
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_UP:
|
||||
if (state->editing){
|
||||
// Go to next digit
|
||||
|
@ -254,6 +251,7 @@ bool tachymeter_face_loop(movement_event_t event, movement_settings_t *settings,
|
|||
// watch_start_tick_animation(500);
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
// return true if the watch can enter standby mode. If you are PWM'ing an LED or buzzing the buzzer here,
|
||||
|
|
|
@ -46,12 +46,6 @@ bool tally_face_loop(movement_event_t event, movement_settings_t *settings, void
|
|||
tally_state_t *state = (tally_state_t *)context;
|
||||
|
||||
switch (event.event_type) {
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_DOWN:
|
||||
movement_illuminate_led();
|
||||
break;
|
||||
case EVENT_ALARM_BUTTON_UP:
|
||||
// increment tally index
|
||||
state->tally_idx++;
|
||||
|
@ -79,6 +73,7 @@ bool tally_face_loop(movement_event_t event, movement_settings_t *settings, void
|
|||
// ignore timeout
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -248,9 +248,6 @@ bool tarot_face_loop(movement_event_t event, movement_settings_t *settings, void
|
|||
case EVENT_TICK:
|
||||
display_animation(state);
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_UP:
|
||||
if (state->drawn_cards[0] == 0xff) {
|
||||
// deck is inited; cycle through # cards to draw
|
||||
|
@ -287,11 +284,8 @@ bool tarot_face_loop(movement_event_t event, movement_settings_t *settings, void
|
|||
case EVENT_LOW_ENERGY_UPDATE:
|
||||
watch_display_string("SLEEP ", 4);
|
||||
break;
|
||||
case EVENT_MODE_LONG_PRESS:
|
||||
// since we ignore timeouts, provide a convenient way to jump back to the start
|
||||
movement_move_to_face(0);
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -89,12 +89,6 @@ bool tempchart_face_loop(movement_event_t event, movement_settings_t *settings,
|
|||
case EVENT_TICK:
|
||||
// on activate and tick, if we are animating,
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
// when the user presses 'mode', we tell movement to move to the next watch face.
|
||||
// movement will call our resign function, clear the screen, and transfer control
|
||||
// to the next watch face in the list.
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LOW_ENERGY_UPDATE:
|
||||
// This low energy mode update occurs once a minute, if the watch face is in the
|
||||
// foreground when Movement enters low energy mode. We have the option of supporting
|
||||
|
@ -133,6 +127,7 @@ bool tempchart_face_loop(movement_event_t event, movement_settings_t *settings,
|
|||
break;
|
||||
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -142,9 +142,6 @@ bool tomato_face_loop(movement_event_t event, movement_settings_t *settings, voi
|
|||
}
|
||||
tomato_draw(state);
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_UP:
|
||||
movement_illuminate_led();
|
||||
if (state->mode == tomato_ready) {
|
||||
|
@ -179,6 +176,7 @@ bool tomato_face_loop(movement_event_t event, movement_settings_t *settings, voi
|
|||
movement_move_to_face(0);
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -79,12 +79,6 @@ bool totp_face_loop(movement_event_t event, movement_settings_t *settings, void
|
|||
|
||||
watch_display_string(buf, 0);
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_DOWN:
|
||||
movement_illuminate_led();
|
||||
break;
|
||||
case EVENT_TIMEOUT:
|
||||
movement_move_to_face(0);
|
||||
break;
|
||||
|
@ -101,7 +95,9 @@ bool totp_face_loop(movement_event_t event, movement_settings_t *settings, void
|
|||
break;
|
||||
case EVENT_ALARM_BUTTON_DOWN:
|
||||
case EVENT_ALARM_LONG_PRESS:
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -242,12 +242,6 @@ bool totp_face_lfs_loop(movement_event_t event, movement_settings_t *settings, v
|
|||
case EVENT_ACTIVATE:
|
||||
totp_face_display(totp_state);
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_DOWN:
|
||||
movement_illuminate_led();
|
||||
break;
|
||||
case EVENT_TIMEOUT:
|
||||
movement_move_to_face(0);
|
||||
break;
|
||||
|
@ -257,7 +251,9 @@ bool totp_face_lfs_loop(movement_event_t event, movement_settings_t *settings, v
|
|||
break;
|
||||
case EVENT_ALARM_BUTTON_DOWN:
|
||||
case EVENT_ALARM_LONG_PRESS:
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -144,16 +144,15 @@ bool wake_face_loop(movement_event_t event, movement_settings_t *settings, void
|
|||
movement_play_alarm();
|
||||
// 2022-07-23: Thx @joeycastillo for the dedicated “alarm” signal
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_TIMEOUT:
|
||||
movement_move_to_face(0);
|
||||
break;
|
||||
case EVENT_LOW_ENERGY_UPDATE:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,12 +45,6 @@ bool character_set_face_loop(movement_event_t event, movement_settings_t *settin
|
|||
char *c = (char *)context;
|
||||
char buf[11];
|
||||
switch (event.event_type) {
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_DOWN:
|
||||
movement_illuminate_led();
|
||||
break;
|
||||
case EVENT_ALARM_BUTTON_UP:
|
||||
*c = (*c) + 1;
|
||||
if (*c & 0x80) *c = ' ';
|
||||
|
@ -63,6 +57,7 @@ bool character_set_face_loop(movement_event_t event, movement_settings_t *settin
|
|||
movement_move_to_face(0);
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -65,12 +65,6 @@ bool demo_face_loop(movement_event_t event, movement_settings_t *settings, void
|
|||
(void) settings;
|
||||
demo_face_index_t *screen = (demo_face_index_t *)context;
|
||||
switch (event.event_type) {
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_DOWN:
|
||||
movement_illuminate_led();
|
||||
break;
|
||||
case EVENT_ALARM_BUTTON_UP:
|
||||
*screen = ((*screen) + 1) % DEMO_FACE_NUM_FACES;
|
||||
// fall through
|
||||
|
@ -129,6 +123,7 @@ bool demo_face_loop(movement_event_t event, movement_settings_t *settings, void
|
|||
// ignore timeout
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -96,9 +96,6 @@ bool frequency_correction_face_loop(movement_event_t event, movement_settings_t
|
|||
break;
|
||||
case EVENT_TICK:
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_UP:
|
||||
freqcorr = RTC->MODE2.FREQCORR.reg;
|
||||
if (freqcorr < 127) {
|
||||
|
@ -126,6 +123,7 @@ bool frequency_correction_face_loop(movement_event_t event, movement_settings_t
|
|||
watch_start_tick_animation(500);
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -66,18 +66,6 @@ bool hello_there_face_loop(movement_event_t event, movement_settings_t *settings
|
|||
state->current_word = (state->current_word + 1) % 2;
|
||||
}
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_UP:
|
||||
// when the user presses 'light', we illuminate the LED. We could override this if
|
||||
// our UI needed an additional button for input, consuming the light button press
|
||||
// but not illuminating the LED.
|
||||
movement_illuminate_led();
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
// when the user presses 'mode', we tell movement to move to the next watch face.
|
||||
// movement will call our resign function, clear the screen, and transfer control
|
||||
// to the next watch face in the list.
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_ALARM_BUTTON_UP:
|
||||
// when the user presses 'alarm', we toggle the state of the animation. If animating,
|
||||
// we stop; if stopped, we resume.
|
||||
|
@ -97,7 +85,9 @@ bool hello_there_face_loop(movement_event_t event, movement_settings_t *settings
|
|||
// and it will do it long before the watch enters low energy mode. This ensures we
|
||||
// won't be on screen, and thus opts us out of getting the EVENT_LOW_ENERGY_UPDATE above.
|
||||
movement_move_to_face(0);
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -146,12 +146,6 @@ bool lis2dw_logging_face_loop(movement_event_t event, movement_settings_t *setti
|
|||
lis2dw_interrupt_source interrupt_source = 0;
|
||||
|
||||
switch (event.event_type) {
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_LONG_PRESS:
|
||||
movement_illuminate_led();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_DOWN:
|
||||
logger_state->axis_index = (logger_state->axis_index + 1) % 4;
|
||||
logger_state->log_ticks = 255;
|
||||
|
@ -187,6 +181,7 @@ bool lis2dw_logging_face_loop(movement_event_t event, movement_settings_t *setti
|
|||
_lis2dw_logging_face_log_data(logger_state);
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,12 +55,6 @@ bool voltage_face_loop(movement_event_t event, movement_settings_t *settings, vo
|
|||
(void) context;
|
||||
watch_date_time date_time;
|
||||
switch (event.event_type) {
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_DOWN:
|
||||
movement_illuminate_led();
|
||||
break;
|
||||
case EVENT_ACTIVATE:
|
||||
_voltage_face_update_display();
|
||||
break;
|
||||
|
@ -78,6 +72,7 @@ bool voltage_face_loop(movement_event_t event, movement_settings_t *settings, vo
|
|||
watch_display_string("BA SLEEP ", 0);
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -159,9 +159,6 @@ bool accelerometer_data_acquisition_face_loop(movement_event_t event, movement_s
|
|||
break;
|
||||
}
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_UP:
|
||||
switch (state->mode) {
|
||||
case ACCELEROMETER_DATA_ACQUISITION_MODE_IDLE:
|
||||
|
@ -218,6 +215,7 @@ bool accelerometer_data_acquisition_face_loop(movement_event_t event, movement_s
|
|||
}
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -94,9 +94,6 @@ bool thermistor_logging_face_loop(movement_event_t event, movement_settings_t *s
|
|||
case EVENT_TIMEOUT:
|
||||
movement_move_to_face(0);
|
||||
break;
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_LONG_PRESS:
|
||||
// light button shows the timestamp, but if you need the light, long press it.
|
||||
movement_illuminate_led();
|
||||
|
@ -121,6 +118,7 @@ bool thermistor_logging_face_loop(movement_event_t event, movement_settings_t *s
|
|||
_thermistor_logging_face_log_data(logger_state);
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -57,12 +57,6 @@ bool thermistor_readout_face_loop(movement_event_t event, movement_settings_t *s
|
|||
(void) context;
|
||||
watch_date_time date_time = watch_rtc_get_date_time();
|
||||
switch (event.event_type) {
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_DOWN:
|
||||
movement_illuminate_led();
|
||||
break;
|
||||
case EVENT_ALARM_BUTTON_DOWN:
|
||||
settings->bit.use_imperial_units = !settings->bit.use_imperial_units;
|
||||
_thermistor_readout_face_update_display(settings->bit.use_imperial_units);
|
||||
|
@ -86,6 +80,7 @@ bool thermistor_readout_face_loop(movement_event_t event, movement_settings_t *s
|
|||
watch_display_string("TE SLEEP ", 0);
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -64,9 +64,6 @@ void thermistor_testing_face_activate(movement_settings_t *settings, void *conte
|
|||
bool thermistor_testing_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
|
||||
(void) context;
|
||||
switch (event.event_type) {
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
movement_move_to_next_face();
|
||||
break;
|
||||
case EVENT_ALARM_BUTTON_DOWN:
|
||||
settings->bit.use_imperial_units = !settings->bit.use_imperial_units;
|
||||
_thermistor_testing_face_update_display(settings->bit.use_imperial_units);
|
||||
|
@ -76,6 +73,7 @@ bool thermistor_testing_face_loop(movement_event_t event, movement_settings_t *s
|
|||
_thermistor_testing_face_update_display(settings->bit.use_imperial_units);
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -239,6 +239,7 @@ bool finetune_face_loop(movement_event_t event, movement_settings_t *settings, v
|
|||
break;
|
||||
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -365,6 +365,7 @@ bool nanosec_face_loop(movement_event_t event, movement_settings_t *settings, vo
|
|||
apply_RTC_correction(correction);
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -201,6 +201,7 @@ bool set_time_hackwatch_face_loop(movement_event_t event, movement_settings_t *s
|
|||
movement_move_to_face(0);
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue