From 90001307c4f762f1bdcb955f746fae744a5323c9 Mon Sep 17 00:00:00 2001 From: Jamie Smith Date: Fri, 5 Apr 2024 05:05:01 -0700 Subject: [PATCH 1/2] Remove setting the stdio file handle to nonblocking --- GNSSDemo.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/GNSSDemo.cpp b/GNSSDemo.cpp index 87d1df5..c8e9a2f 100644 --- a/GNSSDemo.cpp +++ b/GNSSDemo.cpp @@ -99,10 +99,7 @@ void GNSSDemo::test_HUD() bargraph.setHeights(heights); bargraph.setLabels(&labels[0][0]); - - FileHandle *stdin_fh = mbed_file_handle(STDIN_FILENO); - stdin_fh->set_blocking(false); - + while(!stdin_fh->readable()) // exit when the user types a char { while(updateTimer.elapsed_time() < UPDATE_RATE) @@ -170,8 +167,6 @@ void GNSSDemo::test_HUD() bargraph.setNumCols(currentIndex); bargraph.print(); } - - stdin_fh->set_blocking(true); } void GNSSDemo::hotStartTest() From 22d91c0629c5616db2c25dc93a7b7bee85e9e5ae Mon Sep 17 00:00:00 2001 From: Jamie Smith Date: Fri, 5 Apr 2024 05:08:50 -0700 Subject: [PATCH 2/2] Update GNSSDemo.cpp --- GNSSDemo.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GNSSDemo.cpp b/GNSSDemo.cpp index c8e9a2f..2bc60a3 100644 --- a/GNSSDemo.cpp +++ b/GNSSDemo.cpp @@ -99,6 +99,8 @@ void GNSSDemo::test_HUD() bargraph.setHeights(heights); bargraph.setLabels(&labels[0][0]); + + FileHandle *stdin_fh = mbed_file_handle(STDIN_FILENO); while(!stdin_fh->readable()) // exit when the user types a char {