]> git.earman.xyz Git - sensor-watch.git/commitdiff
ir upload: display free space instead of 'no data'
authorJoey Castillo <joeycastillo@utexas.edu>
Wed, 25 Jun 2025 21:08:38 +0000 (17:08 -0400)
committerJoey Castillo <joeycastillo@utexas.edu>
Wed, 25 Jun 2025 21:08:38 +0000 (17:08 -0400)
watch-faces/io/irda_upload_face.c

index 76b8764d4e8c70f158db55f73d4ab3d57bf31dee..56842342324c3f9145b22ec8a9467f10a6c34132 100644 (file)
@@ -67,7 +67,9 @@ bool irda_upload_face_loop(movement_event_t event, void *context) {
             char data[256];
             size_t bytes_read = uart_read_instance(0, data, 256);
             watch_clear_display();
-            watch_display_text_with_fallback(WATCH_POSITION_TOP, "IrDA", "IR");
+            watch_set_indicator(WATCH_INDICATOR_ARROWS);
+            if (watch_rtc_get_date_time().unit.second % 4 < 2) watch_display_text_with_fallback(WATCH_POSITION_TOP, "IrDA", "IR");
+            else watch_display_text_with_fallback(WATCH_POSITION_TOP, "FREE ", "DF");
 
             if (bytes_read) {
                 // data is in the following format, where S is Size, F is Filename and C is checksum:
@@ -124,7 +126,9 @@ bool irda_upload_face_loop(movement_event_t event, void *context) {
                 watch_display_text(WATCH_POSITION_BOTTOM, buf);
             } else {
                 movement_force_led_off();
-                watch_display_text(WATCH_POSITION_FULL, "    no dat");
+                char buf[7];
+                snprintf(buf, 7, "%4ld b", filesystem_get_free_space());
+                watch_display_text(WATCH_POSITION_BOTTOM, buf);
             }
         }
             break;