mirror of
https://github.com/firewalkwithm3/Sensor-Watch.git
synced 2024-11-23 03:30:30 +08:00
Long press of mode on home screen goes to settings
This also changes the default rotation so you don't see the settings screens.
This commit is contained in:
parent
5bd0aafc24
commit
b51f7b6f36
|
@ -50,6 +50,11 @@
|
||||||
#include "alt_fw/deep_space_now.h"
|
#include "alt_fw/deep_space_now.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Default to no secondary face behaviour.
|
||||||
|
#ifndef MOVEMENT_SECONDARY_FACE_INDEX
|
||||||
|
#define MOVEMENT_SECONDARY_FACE_INDEX MOVEMENT_NUM_FACES
|
||||||
|
#endif
|
||||||
|
|
||||||
#if __EMSCRIPTEN__
|
#if __EMSCRIPTEN__
|
||||||
#include <emscripten.h>
|
#include <emscripten.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -203,7 +208,8 @@ void movement_move_to_face(uint8_t watch_face_index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void movement_move_to_next_face(void) {
|
void movement_move_to_next_face(void) {
|
||||||
movement_move_to_face((movement_state.current_watch_face + 1) % MOVEMENT_NUM_FACES);
|
uint16_t face_max = movement_state.current_watch_face < ((int16_t)MOVEMENT_SECONDARY_FACE_INDEX) ? MOVEMENT_SECONDARY_FACE_INDEX : MOVEMENT_NUM_FACES;
|
||||||
|
movement_move_to_face((movement_state.current_watch_face + 1) % face_max);
|
||||||
}
|
}
|
||||||
|
|
||||||
void movement_schedule_background_task(watch_date_time date_time) {
|
void movement_schedule_background_task(watch_date_time date_time) {
|
||||||
|
@ -409,14 +415,18 @@ bool app_loop(void) {
|
||||||
can_sleep = watch_faces[movement_state.current_watch_face].loop(event, &movement_state.settings, watch_face_contexts[movement_state.current_watch_face]);
|
can_sleep = watch_faces[movement_state.current_watch_face].loop(event, &movement_state.settings, watch_face_contexts[movement_state.current_watch_face]);
|
||||||
|
|
||||||
// Long-pressing MODE brings one back to the first face, provided that the watch face hasn't decided to send them elsewhere
|
// Long-pressing MODE brings one back to the first face, provided that the watch face hasn't decided to send them elsewhere
|
||||||
// (and we're not currently on the first face).
|
// (and we're not currently on the first face). If we're currently on the first face, a long press
|
||||||
|
// of MODE sends us to the secondary faces (if defined).
|
||||||
// Note that it's the face's responsibility to provide some way to get to the next face, so if EVENT_MODE_BUTTON_* is
|
// Note that it's the face's responsibility to provide some way to get to the next face, so if EVENT_MODE_BUTTON_* is
|
||||||
// used for face functionality EVENT_MODE_LONG_PRESS should probably be handled and next_face() triggered in the face
|
// used for face functionality EVENT_MODE_LONG_PRESS should probably be handled and next_face() triggered in the face
|
||||||
// (which would effectively disable the normal 'long press to face 0' behaviour).
|
// (which would effectively disable the normal 'long press to face 0' behaviour).
|
||||||
if (event.event_type == EVENT_MODE_LONG_PRESS
|
if (event.event_type == EVENT_MODE_LONG_PRESS
|
||||||
&& movement_state.current_watch_face > 0
|
|
||||||
&& !movement_state.watch_face_changed) {
|
&& !movement_state.watch_face_changed) {
|
||||||
movement_move_to_face(0);
|
if (movement_state.current_watch_face != 0) {
|
||||||
|
movement_move_to_face(0);
|
||||||
|
} else if (MOVEMENT_SECONDARY_FACE_INDEX != MOVEMENT_NUM_FACES) {
|
||||||
|
movement_move_to_face(MOVEMENT_SECONDARY_FACE_INDEX);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
event.event_type = EVENT_NONE;
|
event.event_type = EVENT_NONE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,4 +39,11 @@ const watch_face_t watch_faces[] = {
|
||||||
|
|
||||||
#define MOVEMENT_NUM_FACES (sizeof(watch_faces) / sizeof(watch_face_t))
|
#define MOVEMENT_NUM_FACES (sizeof(watch_faces) / sizeof(watch_face_t))
|
||||||
|
|
||||||
|
/* Determines what face to go to from the first face if you've already set
|
||||||
|
* a mode long press to go to the first face in preferences, and
|
||||||
|
* excludes these faces from the normal rotation.
|
||||||
|
* Usually it makes sense to set this to the preferences face.
|
||||||
|
*/
|
||||||
|
#define MOVEMENT_SECONDARY_FACE_INDEX (MOVEMENT_NUM_FACES - 2)
|
||||||
|
|
||||||
#endif // MOVEMENT_CONFIG_H_
|
#endif // MOVEMENT_CONFIG_H_
|
||||||
|
|
Loading…
Reference in a new issue