Fixed segmapping

This commit is contained in:
David Volovskiy 2025-08-12 18:57:15 -04:00
parent 1b503336c5
commit fc9e6c388e
3 changed files with 11 additions and 4 deletions

View 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.

View 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.

View File

@ -30,7 +30,7 @@
#include <stdlib.h>
#include <string.h>
#include "higher_lower_game_face.h"
#include "watch_private_display.h"
#include "watch_common_display.h"
#define TITLE_TEXT "Hi-Lo"
#define GAME_BOARD_SIZE 6
@ -151,9 +151,14 @@ static void init_game(void) {
}
static void set_segment_at_position(segment_t segment, uint8_t position) {
const uint64_t position_segment_data = (Segment_Map[position] >> (8 * (uint8_t) segment)) & 0xFF;
const uint8_t com_pin = position_segment_data >> 6;
const uint8_t seg = position_segment_data & 0x3F;
digit_mapping_t segmap;
if (watch_get_lcd_type() == WATCH_LCD_TYPE_CUSTOM) {
segmap = Custom_LCD_Display_Mapping[position];
} else {
segmap = Classic_LCD_Display_Mapping[position];
}
const uint8_t com_pin = segmap.segment[segment].address.com;
const uint8_t seg = segmap.segment[segment].address.seg;
watch_set_pixel(com_pin, seg);
}