From: Joey Castillo Date: Wed, 25 Jun 2025 21:08:38 +0000 (-0400) Subject: ir upload: display free space instead of 'no data' X-Git-Url: https://git.earman.xyz/?a=commitdiff_plain;h=42997ff6140f32ffc5ff3d36a94d307f0177641b;p=sensor-watch.git ir upload: display free space instead of 'no data' --- diff --git a/watch-faces/io/irda_upload_face.c b/watch-faces/io/irda_upload_face.c index 76b8764..5684234 100644 --- a/watch-faces/io/irda_upload_face.c +++ b/watch-faces/io/irda_upload_face.c @@ -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;