From 86ec427a68cf3624e7a6033397060a8a868fce46 Mon Sep 17 00:00:00 2001 From: Joey Castillo Date: Sat, 17 May 2025 18:18:29 -0400 Subject: [PATCH] IrDA: restore red/green status, improve display --- watch-faces/io/irda_upload_face.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/watch-faces/io/irda_upload_face.c b/watch-faces/io/irda_upload_face.c index 4f6c9ef5..f71b065e 100644 --- a/watch-faces/io/irda_upload_face.c +++ b/watch-faces/io/irda_upload_face.c @@ -81,8 +81,9 @@ bool irda_upload_face_loop(movement_event_t event, void *context) { if (checksum != expected_checksum) { // failed + movement_force_led_on(48, 0, 0); watch_display_text_with_fallback(WATCH_POSITION_TOP, "BAD ", "BA"); - watch_display_text(WATCH_POSITION_BOTTOM, "HEADER"); + watch_display_text(WATCH_POSITION_BOTTOM, "HEAdER"); break; } // valid header! To make it easier on ourselves, we're going to make byte 14 zero... @@ -91,9 +92,11 @@ bool irda_upload_face_loop(movement_event_t event, void *context) { char *filename = data + 2; if (expected_size == 0) { + // Success! All we need is a header to delete a file. + movement_force_led_on(0, 48, 0); filesystem_rm(filename); watch_display_text_with_fallback(WATCH_POSITION_TOP, "FILE ", "FI"); - watch_display_text_with_fallback(WATCH_POSITION_TOP, "dELETE", " delet"); + watch_display_text_with_fallback(WATCH_POSITION_TOP, "dELETE", " deLet"); break; } @@ -104,19 +107,22 @@ bool irda_upload_face_loop(movement_event_t event, void *context) { if (checksum != expected_checksum) { // failed + movement_force_led_on(48, 0, 0); watch_display_text_with_fallback(WATCH_POSITION_TOP, "BAD ", "BA"); - watch_display_text_with_fallback(WATCH_POSITION_BOTTOM, "DATA ", " Data "); + watch_display_text_with_fallback(WATCH_POSITION_BOTTOM, "data ", " data "); break; } // Valid data! Write it to the file system. filesystem_write_file(filename, data + 16, expected_size); - watch_display_text_with_fallback(WATCH_POSITION_TOP, "RECVD", "RC"); + watch_display_text_with_fallback(WATCH_POSITION_TOP, "RECVd", "RC"); + movement_force_led_on(0, 48, 0); char buf[8]; sprintf(buf, "%4db ", expected_size); watch_display_text(WATCH_POSITION_BOTTOM, buf); } else { + movement_force_led_off(); watch_display_text(WATCH_POSITION_FULL, " no dat"); } }