diff sw/mcsi-rxtx/mainloop.c @ 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 315428573a25
children
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);
 	}
 }