From 118c07a3b63392fc5fb9c5b4b0dbfa052b254c9a Mon Sep 17 00:00:00 2001 From: David Volovskiy Date: Tue, 3 Sep 2024 17:13:59 -0400 Subject: [PATCH] Reduced struct memory per code review --- .../watch_faces/complication/endless_runner_face.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/movement/watch_faces/complication/endless_runner_face.h b/movement/watch_faces/complication/endless_runner_face.h index f9d6409b..8c8fa215 100644 --- a/movement/watch_faces/complication/endless_runner_face.h +++ b/movement/watch_faces/complication/endless_runner_face.h @@ -37,13 +37,12 @@ */ typedef struct { - // These are values that need saving between uses - uint32_t hi_score : 10; - uint32_t difficulty : 3; - bool soundOn; - uint32_t month_last_hi_score : 4; - uint32_t year_last_hi_score : 6; - uint32_t unused : 8; + uint16_t hi_score : 10; + uint8_t difficulty : 3; + uint8_t month_last_hi_score : 4; + uint8_t year_last_hi_score : 6; + uint8_t soundOn : 1; + /* 24 bits, likely aligned to 32 bits = 4 bytes */ } endless_runner_state_t; void endless_runner_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);