]> git.earman.xyz Git - sensor-watch.git/commitdiff
peek face: silence warnings
authorJoey Castillo <joeycastillo@utexas.edu>
Wed, 25 Jun 2025 21:55:34 +0000 (17:55 -0400)
committerJoey Castillo <joeycastillo@utexas.edu>
Wed, 25 Jun 2025 21:55:34 +0000 (17:55 -0400)
watch-faces/demo/peek_memory_face.c

index 22596b936d8af325ecb7149a2eb027b02a726277..37df366a0ae69f2b968618c6efba773b7c918484 100644 (file)
@@ -42,7 +42,7 @@ void peek_memory_face_setup(uint8_t watch_face_index, void ** context_ptr) {
         state->location = &dummy_value;
         state->format = PEEK_MEMORY_FORMAT_HEX;
 #else
-        state->location = &(RTC->MODE2.TIMESTAMP.reg);
+        state->location = (void *)&(RTC->MODE2.TIMESTAMP.reg);
         state->format = PEEK_MEMORY_FORMAT_DATE;
 #endif
     }
@@ -64,7 +64,7 @@ bool peek_memory_face_loop(movement_event_t event, void *context) {
             memcpy(&value, state->location, 4);
             switch (state->format) {
                 case PEEK_MEMORY_FORMAT_HEX:
-                    sprintf(buf, "%08X", value);
+                    sprintf(buf, "%08lX", value);
                     watch_display_character('M', 0);
                     watch_display_character(buf[0], 1);
                     watch_display_character(buf[1], 10);