Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix UART RevB Driver not cleaning up Async Transactions
Currently, the private AsyncTxRequests and AsyncRxRequests arrays are used to track transactions in progress for uart_revb.c. The Tx/Rx Async Callbacks check for a callback function before clearing the Requests: ```C mxc_uart_req_t *req = (mxc_uart_req_t *)AsyncTxRequests[uart_num]; if ((req != NULL) && (req->callback != NULL)) { AsyncTxRequests[uart_num] = NULL; req->callback(req, retVal); } ``` This means that if the user does not supply an explicit callback function, a transaction never gets cleared, causing problems after just one transaction. This commit resolves this by moving the cleanup of this important struct outside of the conditional check for a callback function. ```C mxc_uart_req_t *req = (mxc_uart_req_t *)AsyncTxRequests[uart_num]; if ((req != NULL) && (req->callback != NULL)) { req->callback(req, retVal); } // Cleanup Async Transaction AsyncTxRequests[uart_num] = NULL; ``` Signed-off-by: Brandon Hurst <brandon.hurst@analog.com>
- Loading branch information