Skip to content

Commit f3c1a91

Browse files
atanisoftme-no-dev
authored andcommitted
adding uartRxActive to expose the RX state machine status as a boolean value (espressif#2457)
1 parent 5af0336 commit f3c1a91

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

cores/esp32/esp32-hal-uart.c

+7
Original file line numberDiff line numberDiff line change
@@ -558,3 +558,10 @@ uartDetectBaudrate(uart_t *uart)
558558

559559
return default_rates[i];
560560
}
561+
562+
/*
563+
* Returns the status of the RX state machine, if the value is non-zero the state machine is active.
564+
*/
565+
bool uartRxActive(uart_t* uart) {
566+
return uart->dev->status.st_urx_out != 0;
567+
}

cores/esp32/esp32-hal-uart.h

+2
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ int uartGetDebug();
7474

7575
unsigned long uartDetectBaudrate(uart_t *uart);
7676

77+
bool uartRxActive(uart_t* uart);
78+
7779
#ifdef __cplusplus
7880
}
7981
#endif

0 commit comments

Comments
 (0)