Skip to content

Commit 81969a3

Browse files
fix(PeriphDrivers): Fix UART RevB Driver not cleaning up Async Transactions (#1334)
Signed-off-by: Brandon Hurst <[email protected]>
1 parent 0f8fed1 commit 81969a3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Libraries/PeriphDrivers/Source/UART/uart_revb.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -749,10 +749,12 @@ int MXC_UART_RevB_AsyncTxCallback(mxc_uart_revb_regs_t *uart, int retVal)
749749

750750
mxc_uart_req_t *req = (mxc_uart_req_t *)AsyncTxRequests[uart_num];
751751
if ((req != NULL) && (req->callback != NULL)) {
752-
AsyncTxRequests[uart_num] = NULL;
753752
req->callback(req, retVal);
754753
}
755754

755+
// Cleanup Async Transaction
756+
AsyncTxRequests[uart_num] = NULL;
757+
756758
return E_NO_ERROR;
757759
}
758760

@@ -762,10 +764,12 @@ int MXC_UART_RevB_AsyncRxCallback(mxc_uart_revb_regs_t *uart, int retVal)
762764

763765
mxc_uart_req_t *req = (mxc_uart_req_t *)AsyncRxRequests[uart_num];
764766
if ((req != NULL) && (req->callback != NULL)) {
765-
AsyncRxRequests[uart_num] = NULL;
766767
req->callback(req, retVal);
767768
}
768769

770+
// Cleanup Async Transaction
771+
AsyncRxRequests[uart_num] = NULL;
772+
769773
return E_NO_ERROR;
770774
}
771775

0 commit comments

Comments
 (0)