mirror of
https://github.com/joeycastillo/second-movement.git
synced 2025-10-29 11:38:27 +00:00
ir upload: display free space instead of 'no data'
This commit is contained in:
parent
7f9a00ef35
commit
42997ff614
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user