VFS: select() on UART should return immediately when data is buffered

This commit is contained in:
Roland Dobai
2018-11-27 12:53:19 +01:00
parent 81231fcc4b
commit 957cf0ab84
2 changed files with 15 additions and 1 deletions

View File

@@ -66,7 +66,10 @@ static void uart_select_task()
if (FD_ISSET(fd, &rfds)) {
char buf;
if (read(fd, &buf, 1) > 0) {
ESP_LOGI(TAG, "Received: %c", buf);
ESP_LOGI(TAG, "Received: %c", buf);
// Note: Only one character was read even the buffer contains more. The other characters will
// be read one-by-one by subsequent calls to select() which will then return immediately
// without timeout.
} else {
ESP_LOGE(TAG, "UART read error");
break;