nxp-mcuxpresso / mcux-sdk

MCUXpresso SDK
BSD 3-Clause "New" or "Revised" License
323 stars 142 forks source link

Fix handling of TX complete interrupt in LPUART EDMA #47

Closed andresovela closed 2 years ago

andresovela commented 2 years ago

This PR fixes a potential issue that could happen if the user of the driver enables other UART interrupts.

Signed-off-by: Andres O. Vela andresovela@gmail.com

Prerequisites

Describe the pull request

A clear and concise description for the change in this Pull Request and which issue is fixed.

Fixes # (issue)

Type of change (please delete options that are not relevant):

Tests

mcuxsusan commented 2 years ago

Hi @andresovela , thanks for your prompt action on the sign-off issue. Our developer is checking the contribution and feedback may be delayed, appreciate for your understanding.

mcuxsusan commented 2 years ago

Feedback from developer: _"When using the lpuart edma transactional layer, the interrupt is handled by the API LPUART_TransferEdmaHandleIRQ(the modified API in the PR) which is implemented inside the driver through double weak, the API is only dedicated to handle the transfer completion interrupt, so in LPUART_TransferCreateHandleEDMA the driver already disables all the interrupts. However if user enables any other interrupts after calling LPUARTTransferCreateHandleEDMA, the transfer flow may be aborted by mistake. The modification in the PR can prevent this from happening, we will also need to update document to remind user that it is forbidden to enable/disable any interrupts if using the transactional layer, regardless of the driver(uart/i2c.. etc) or the handling method(interrupt/edma)."

mcuxsusan commented 2 years ago

The change looks good, thanks again for your prompt action.