From 82ed355aba8a367765c1d4ae4dd2b052777910b7 Mon Sep 17 00:00:00 2001 From: CarpeNoctem Date: Wed, 6 Sep 2023 01:21:26 +1000 Subject: [PATCH] fix two-part bug with decimal seconds introduced during big refactor. --- movement/watch_faces/clock/french_revolutionary_face.c | 4 ++-- movement/watch_faces/clock/french_revolutionary_face.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/movement/watch_faces/clock/french_revolutionary_face.c b/movement/watch_faces/clock/french_revolutionary_face.c index 9801b9c..519cfc3 100644 --- a/movement/watch_faces/clock/french_revolutionary_face.c +++ b/movement/watch_faces/clock/french_revolutionary_face.c @@ -158,7 +158,7 @@ fr_decimal_time get_decimal_time(watch_date_time *date_time) { decimal_time.minute = current_decimal_seconds / 100; // Remove the minutes from total seconds and keep the remaining seconds // Note: I think I used an extra seconds variable here because sprintf or movement weren't liking a uint32... - decimal_time.second = current_decimal_seconds - decimal_time.hour * 100; + decimal_time.second = current_decimal_seconds - decimal_time.minute * 100; return decimal_time; } @@ -166,7 +166,7 @@ fr_decimal_time get_decimal_time(watch_date_time *date_time) { // - Decimal-time only // - Decimal-time with date in top-right // - Decimal-time with normal time in the top (minutes first, then hours, due to display limitations) -// Note: There is some power-saving stuff that simple clock does here around not redrawing characters that haven't changed, but we're not doing that here. +// TODO: There is some power-saving stuff that simple clock does here around not redrawing characters that haven't changed, but we're not doing that here. // I'll try to add that optimization could be added in a future commit. void set_display_buffer(char *buf, french_revolutionary_state_t *state, fr_decimal_time *decimal_time, watch_date_time *date_time) { switch (state->display_type) { diff --git a/movement/watch_faces/clock/french_revolutionary_face.h b/movement/watch_faces/clock/french_revolutionary_face.h index f18bb1f..294f422 100644 --- a/movement/watch_faces/clock/french_revolutionary_face.h +++ b/movement/watch_faces/clock/french_revolutionary_face.h @@ -58,8 +58,8 @@ typedef struct { } french_revolutionary_state_t; typedef struct { - uint8_t second : 6; // 0-99 - uint8_t minute : 6; // 0-99 + uint8_t second : 8; // 0-99 + uint8_t minute : 8; // 0-99 uint8_t hour : 5; // 0-10 } fr_decimal_time;