Skip to content

Commit

Permalink
adding uartRxActive to expose the RX state machine status as a boolea…
Browse files Browse the repository at this point in the history
…n value (#2457)
  • Loading branch information
atanisoft authored and me-no-dev committed Mar 3, 2019
1 parent 5af0336 commit f3c1a91
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cores/esp32/esp32-hal-uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,3 +558,10 @@ uartDetectBaudrate(uart_t *uart)

return default_rates[i];
}

/*
* Returns the status of the RX state machine, if the value is non-zero the state machine is active.
*/
bool uartRxActive(uart_t* uart) {
return uart->dev->status.st_urx_out != 0;
}
2 changes: 2 additions & 0 deletions cores/esp32/esp32-hal-uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ int uartGetDebug();

unsigned long uartDetectBaudrate(uart_t *uart);

bool uartRxActive(uart_t* uart);

#ifdef __cplusplus
}
#endif
Expand Down

0 comments on commit f3c1a91

Please sign in to comment.