]> git.earman.xyz Git - sensor-watch.git/commitdiff
Fixed segmapping
authorDavid Volovskiy <devolov@gmail.com>
Tue, 12 Aug 2025 22:57:15 +0000 (18:57 -0400)
committerDavid Volovskiy <devolov@gmail.com>
Tue, 12 Aug 2025 22:57:15 +0000 (18:57 -0400)
movement_faces.h
watch-faces.mk
watch-faces/complication/higher_lower_game_face.c

index fc43716d9f27621630ddcb169e373afe1214ddd2..24509a66eb16ae765a84ae2dbc949e8850bb1a77 100644 (file)
@@ -73,4 +73,5 @@
 #include "wareki_face.h"
 #include "deadline_face.h"
 #include "wordle_face.h"
+#include "higher_lower_game_face.h"
 // New includes go above this line.
index 22e262cffe6dd963ff106d23b97dafbb905c3e64..11dab1d84c21ae0d7fb4b3cedeff03185901431f 100644 (file)
@@ -48,4 +48,5 @@ SRCS += \
   ./watch-faces/sensor/lis2dw_monitor_face.c \
   ./watch-faces/complication/wareki_face.c \
   ./watch-faces/complication/deadline_face.c \
+  ./watch-faces/complication/higher_lower_game_face.c \
 # New watch faces go above this line.
index 3491b5bd0a1cacf8a328f2a41ff44351b22adaf9..260412d9d88776f24b4a58b9c20d857bc3a93008 100755 (executable)
@@ -30,7 +30,7 @@
 #include <stdlib.h>\r
 #include <string.h>\r
 #include "higher_lower_game_face.h"\r
-#include "watch_private_display.h"\r
+#include "watch_common_display.h"\r
 \r
 #define TITLE_TEXT "Hi-Lo"\r
 #define GAME_BOARD_SIZE 6\r
@@ -151,9 +151,14 @@ static void init_game(void) {
 }\r
 \r
 static void set_segment_at_position(segment_t segment, uint8_t position) {\r
-    const uint64_t position_segment_data = (Segment_Map[position] >> (8 * (uint8_t) segment)) & 0xFF;\r
-    const uint8_t com_pin = position_segment_data >> 6;\r
-    const uint8_t seg = position_segment_data & 0x3F;\r
+    digit_mapping_t segmap;\r
+    if (watch_get_lcd_type() == WATCH_LCD_TYPE_CUSTOM) {\r
+        segmap = Custom_LCD_Display_Mapping[position];\r
+    } else {\r
+        segmap = Classic_LCD_Display_Mapping[position];\r
+    }\r
+    const uint8_t com_pin = segmap.segment[segment].address.com;\r
+    const uint8_t seg = segmap.segment[segment].address.seg;\r
     watch_set_pixel(com_pin, seg);\r
 }\r
 \r