]> git.earman.xyz Git - sensor-watch.git/commitdiff
fix two-part bug with decimal seconds introduced during big refactor.
authorCarpeNoctem <cryptomax@pm.me>
Tue, 5 Sep 2023 15:21:26 +0000 (01:21 +1000)
committerCarpeNoctem <cryptomax@pm.me>
Tue, 5 Sep 2023 15:21:26 +0000 (01:21 +1000)
movement/watch_faces/clock/french_revolutionary_face.c
movement/watch_faces/clock/french_revolutionary_face.h

index 9801b9c78f06b744b6f3950a2753006d62f2e486..519cfc3612146faa484e1c1ed4b53ef83f12d746 100644 (file)
@@ -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) {
index f18bb1f5333b044cc0a22e72ee686a9ef8c545ca..294f4226971aeeba3b9e241f463859ed6cec094e 100644 (file)
@@ -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;