mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Update uart_select_example_main.c
This commit is contained in:
parent
d7ca8b94c8
commit
d836ea0107
@ -7,6 +7,7 @@
|
|||||||
CONDITIONS OF ANY KIND, either express or implied.
|
CONDITIONS OF ANY KIND, either express or implied.
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
#include <sys/fcntl.h>
|
#include <sys/fcntl.h>
|
||||||
#include <sys/errno.h>
|
#include <sys/errno.h>
|
||||||
#include <sys/unistd.h>
|
#include <sys/unistd.h>
|
||||||
@ -63,7 +64,7 @@ static void uart_select_task(void *arg)
|
|||||||
s = select(fd + 1, &rfds, NULL, NULL, &tv);
|
s = select(fd + 1, &rfds, NULL, NULL, &tv);
|
||||||
|
|
||||||
if (s < 0) {
|
if (s < 0) {
|
||||||
ESP_LOGE(TAG, "Select failed: errno %d", errno);
|
ESP_LOGE(TAG, "Select failed: errno %d (%s)", errno, strerror(errno));
|
||||||
break;
|
break;
|
||||||
} else if (s == 0) {
|
} else if (s == 0) {
|
||||||
ESP_LOGI(TAG, "Timeout has been reached and nothing has been received");
|
ESP_LOGI(TAG, "Timeout has been reached and nothing has been received");
|
||||||
|
Loading…
Reference in New Issue
Block a user