changeset 15:8b49ea8aeb99

fc-mcsi-rxtx: more reliable fflush(stdout) in main loop
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 28 Oct 2024 23:43:10 +0000
parents f908a782cff9
children f422d19c0118
files sw/mcsi-rxtx/mainloop.c
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/sw/mcsi-rxtx/mainloop.c	Mon Oct 28 07:25:31 2024 +0000
+++ b/sw/mcsi-rxtx/mainloop.c	Mon Oct 28 23:43:10 2024 +0000
@@ -22,9 +22,7 @@
 	unsigned off;
 	int cc;
 
-	is_active = 0;
-	off = 0;
-	for (;;) {
+	for (off = 0; ; fflush(stdout)) {
 		FD_ZERO(&fds);
 		FD_SET(0, &fds);
 		FD_SET(target_fd, &fds);
@@ -75,6 +73,5 @@
 				transmit_20ms_block();
 			}
 		}
-		fflush(stdout);
 	}
 }