From 3f846ff6b40037a2c49d287eb256307ef47fa045 Mon Sep 17 00:00:00 2001 From: joeycastillo Date: Wed, 2 Oct 2024 07:41:56 -0400 Subject: [PATCH] bring over character set demo --- movement_faces.h | 1 + watch-faces.mk | 1 + .../watch_faces => watch-faces}/demo/character_set_face.c | 7 +++++-- .../watch_faces => watch-faces}/demo/character_set_face.h | 0 4 files changed, 7 insertions(+), 2 deletions(-) rename {movement/watch_faces => watch-faces}/demo/character_set_face.c (86%) rename {movement/watch_faces => watch-faces}/demo/character_set_face.h (100%) diff --git a/movement_faces.h b/movement_faces.h index 1d3215d1..d774dcfe 100644 --- a/movement_faces.h +++ b/movement_faces.h @@ -31,6 +31,7 @@ #include "countdown_face.h" #include "fast_stopwatch_face.h" #include "sunrise_sunset_face.h" +#include "character_set_face.h" #include "float_demo_face.h" #include "voltage_face.h" #include "set_time_face.h" diff --git a/watch-faces.mk b/watch-faces.mk index 0e38e1cd..c36886c2 100644 --- a/watch-faces.mk +++ b/watch-faces.mk @@ -6,6 +6,7 @@ SRCS += \ ./watch-faces/complication/countdown_face.c \ ./watch-faces/complication/fast_stopwatch_face.c \ ./watch-faces/complication/sunrise_sunset_face.c \ + ./watch-faces/demo/character_set_face.c \ ./watch-faces/demo/float_demo_face.c \ ./watch-faces/sensor/voltage_face.c \ ./watch-faces/settings/set_time_face.c \ diff --git a/movement/watch_faces/demo/character_set_face.c b/watch-faces/demo/character_set_face.c similarity index 86% rename from movement/watch_faces/demo/character_set_face.c rename to watch-faces/demo/character_set_face.c index 833362ed..9b1d8c81 100644 --- a/movement/watch_faces/demo/character_set_face.c +++ b/watch-faces/demo/character_set_face.c @@ -26,6 +26,7 @@ #include #include "character_set_face.h" #include "watch.h" +#include "watch_common_display.h" void character_set_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; @@ -47,8 +48,10 @@ bool character_set_face_loop(movement_event_t event, void *context) { if (*c & 0x80) *c = ' '; // fall through case EVENT_ACTIVATE: - sprintf(buf, "%c%c%c%c%c%c%c%c%c%c", *c, *c, *c, *c, *c, *c, *c, *c, *c, *c); - watch_display_string(buf, 0); + sprintf(buf, "%c%c%c%c%c%c", *c, *c, *c, *c, *c, *c); + watch_display_text_with_fallback(WATCH_POSITION_TOP_LEFT, buf, buf); + watch_display_text_with_fallback(WATCH_POSITION_TOP_RIGHT, buf, buf); + watch_display_text_with_fallback(WATCH_POSITION_BOTTOM, buf, buf); break; case EVENT_TIMEOUT: movement_move_to_face(0); diff --git a/movement/watch_faces/demo/character_set_face.h b/watch-faces/demo/character_set_face.h similarity index 100% rename from movement/watch_faces/demo/character_set_face.h rename to watch-faces/demo/character_set_face.h