IrDA: restore red/green status, improve display
This commit is contained in:
parent
7f9ed8ef67
commit
86ec427a68
@ -81,8 +81,9 @@ bool irda_upload_face_loop(movement_event_t event, void *context) {
|
|||||||
|
|
||||||
if (checksum != expected_checksum) {
|
if (checksum != expected_checksum) {
|
||||||
// failed
|
// 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_TOP, "BAD ", "BA");
|
||||||
watch_display_text(WATCH_POSITION_BOTTOM, "HEADER");
|
watch_display_text(WATCH_POSITION_BOTTOM, "HEAdER");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// valid header! To make it easier on ourselves, we're going to make byte 14 zero...
|
// 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;
|
char *filename = data + 2;
|
||||||
|
|
||||||
if (expected_size == 0) {
|
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);
|
filesystem_rm(filename);
|
||||||
watch_display_text_with_fallback(WATCH_POSITION_TOP, "FILE ", "FI");
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,19 +107,22 @@ bool irda_upload_face_loop(movement_event_t event, void *context) {
|
|||||||
|
|
||||||
if (checksum != expected_checksum) {
|
if (checksum != expected_checksum) {
|
||||||
// failed
|
// 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_TOP, "BAD ", "BA");
|
||||||
watch_display_text_with_fallback(WATCH_POSITION_BOTTOM, "DATA ", " Data ");
|
watch_display_text_with_fallback(WATCH_POSITION_BOTTOM, "data ", " data ");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Valid data! Write it to the file system.
|
// Valid data! Write it to the file system.
|
||||||
filesystem_write_file(filename, data + 16, expected_size);
|
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];
|
char buf[8];
|
||||||
sprintf(buf, "%4db ", expected_size);
|
sprintf(buf, "%4db ", expected_size);
|
||||||
watch_display_text(WATCH_POSITION_BOTTOM, buf);
|
watch_display_text(WATCH_POSITION_BOTTOM, buf);
|
||||||
} else {
|
} else {
|
||||||
|
movement_force_led_off();
|
||||||
watch_display_text(WATCH_POSITION_FULL, " no dat");
|
watch_display_text(WATCH_POSITION_FULL, " no dat");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user