diff --git a/gazebo/Arduino.h b/gazebo/Arduino.h index b3c66e9..4ad4a7d 100644 --- a/gazebo/Arduino.h +++ b/gazebo/Arduino.h @@ -140,7 +140,7 @@ public: // to implement for Windows, see https://stackoverflow.com/a/71992965/6850197 if (!isatty(STDIN_FILENO)) return 0; struct pollfd pfd = { .fd = STDIN_FILENO, .events = POLLIN }; - return poll(&pfd, 1, 0) > 0; + return poll(&pfd, 1, 0) > 0 && (pfd.revents & POLLIN); } int read() {