bring over character set demo

This commit is contained in:
joeycastillo 2024-10-02 07:41:56 -04:00
parent 996571967f
commit 3f846ff6b4
4 changed files with 7 additions and 2 deletions

View File

@ -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"

View File

@ -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 \

View File

@ -26,6 +26,7 @@
#include <string.h>
#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);