]> git.earman.xyz Git - sensor-watch.git/commitdiff
activity watch face improvements
authorjoeycastillo <joeycastillo@utexas.edu>
Sun, 27 Oct 2024 19:13:24 +0000 (15:13 -0400)
committerjoeycastillo <joeycastillo@utexas.edu>
Sun, 27 Oct 2024 19:13:24 +0000 (15:13 -0400)
watch-faces/sensor/activity_logging_face.c

index cdd8c98a95a4f63fd36fb1f23fbe466c6a060d1b..04f4d4ed63502d606ea91d881d9c20fd0ad5e46a 100644 (file)
@@ -49,7 +49,7 @@ static void _activity_logging_face_log_data(activity_logging_state_t *state) {
     // print size of thing
     printf("Size of data point: %d\n", sizeof(activity_logging_data_point_t));
     if (filesystem_append_file("activity.dat", (char *)&data_point, sizeof(activity_logging_data_point_t))) {
-        printf("Data point written\n", state->data_points);
+        printf("Data point written\n");
     } else {
         printf("Failed to write data point\n");
     }
@@ -95,7 +95,7 @@ static void _activity_logging_face_update_display(activity_logging_state_t *stat
         watch_display_text(WATCH_POSITION_TOP, "AC");
         sprintf(buf, "%2d", state->display_index);
         watch_display_text(WATCH_POSITION_TOP_RIGHT, buf);
-        sprintf(buf, "%-3lu/%2d", state->data[pos].bit.orientation_changes > 999 ? 999 : state->data[pos].bit.orientation_changes, state->data[pos].bit.active_minutes);
+        sprintf(buf, "%-3u/%2d", state->data[pos].bit.orientation_changes > 999 ? 999 : state->data[pos].bit.orientation_changes, state->data[pos].bit.active_minutes);
         watch_display_text(WATCH_POSITION_BOTTOM, buf);
     }
 }
@@ -106,7 +106,9 @@ void activity_logging_face_setup(uint8_t watch_face_index, void ** context_ptr)
         *context_ptr = malloc(sizeof(activity_logging_state_t));
         memset(*context_ptr, 0, sizeof(activity_logging_state_t));
         // create file if it doesn't exist
-        if (!filesystem_file_exists("activity.dat")) filesystem_write_file("activity.dat", "", 0);
+        if (!filesystem_file_exists("activity.dat")) {
+            filesystem_write_file("activity.dat", "", 0);
+        }
     }
 }