From 287f755edb4c5cb62dcfb35e95f11325a912b41a Mon Sep 17 00:00:00 2001 From: Joey Castillo Date: Tue, 20 May 2025 23:50:09 -0400 Subject: [PATCH] slcd: we can fit these segment mappings into one byte --- watch-library/shared/watch/watch_common_display.c | 2 +- watch-library/shared/watch/watch_slcd.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/watch-library/shared/watch/watch_common_display.c b/watch-library/shared/watch/watch_common_display.c index a06c9dbf..ed558a1b 100644 --- a/watch-library/shared/watch/watch_common_display.c +++ b/watch-library/shared/watch/watch_common_display.c @@ -29,7 +29,7 @@ #include #include -uint32_t IndicatorSegments[8] = { +uint8_t IndicatorSegments[8] = { SLCD_SEGID(0, 17), // WATCH_INDICATOR_SIGNAL SLCD_SEGID(0, 16), // WATCH_INDICATOR_BELL SLCD_SEGID(2, 17), // WATCH_INDICATOR_PM diff --git a/watch-library/shared/watch/watch_slcd.h b/watch-library/shared/watch/watch_slcd.h index dde7366c..b94b3f80 100644 --- a/watch-library/shared/watch/watch_slcd.h +++ b/watch-library/shared/watch/watch_slcd.h @@ -42,9 +42,9 @@ */ /// @{ -#define SLCD_SEGID(com, seg) (((com) << 16) | (seg)) -#define SLCD_COMNUM(segid) (((segid) >> 16) & 0xFF) -#define SLCD_SEGNUM(segid) ((segid)&0xFF) +#define SLCD_SEGID(com, seg) (((com) << 5) | (seg)) +#define SLCD_COMNUM(segid) (((segid) >> 5) & 0x07) +#define SLCD_SEGNUM(segid) ((segid) & 0x1F) /// An enum listing the icons and indicators available on the watch. typedef enum {