adding uartRxActive to expose the RX state machine status as a boolean value (#2457)

This commit is contained in:
Mike Dunston 2019-03-03 06:47:24 -08:00 committed by Me No Dev
parent 5af0336177
commit f3c1a91f8e
2 changed files with 9 additions and 0 deletions

View File

@ -558,3 +558,10 @@ uartDetectBaudrate(uart_t *uart)
return default_rates[i]; 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;
}

View File

@ -74,6 +74,8 @@ int uartGetDebug();
unsigned long uartDetectBaudrate(uart_t *uart); unsigned long uartDetectBaudrate(uart_t *uart);
bool uartRxActive(uart_t* uart);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif