From 5c9fa88ed2d23dc6a5cfdf3b2cef56bf42b03047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Sun, 24 Jan 2021 21:19:16 +0100 Subject: [PATCH] Consume buffer before starting At least ESP8266 does output on UART boot messages. This makes us skip them, and ensure that everything is consumed ahead. --- SourceCode/MacOSX/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SourceCode/MacOSX/main.c b/SourceCode/MacOSX/main.c index fb73521..e28522e 100644 --- a/SourceCode/MacOSX/main.c +++ b/SourceCode/MacOSX/main.c @@ -114,6 +114,9 @@ int main(int arg, char *argv[]) unsigned char j = 0; for(j=5; j>0; j--) { + // Consume buffer + char buf[512]; + read(Cport[0], buf, sizeof(buf)); printf("Remain: %d\n", j); sleep(1); }