RT1021 SDK lpuart driver interrupt modifications question

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RT1021 SDK lpuart driver interrupt modifications question

379 Views
rshipman
Contributor V

Hi,

I've been looking at changes that have been made to the RT1021 SDK 2.11.0.

In particular to fsl_lpuart.c.

In the function: LPUART_TransferReceiveNonBlocking

I noticed this code has changed:

            /* Disable and re-enable the global interrupt to protect the interrupt enable register during

             * read-modify-wrte. */

            irqMask = DisableGlobalIRQ();

            /* Disable LPUART RX IRQ, protect ring buffer. */

            base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK);

            EnableGlobalIRQ(irqMask);

and 

            /* Disable and re-enable the global interrupt to protect the interrupt enable register during

             * read-modify-wrte. */

            irqMask = DisableGlobalIRQ();

            /* Re-enable LPUART RX IRQ. */

            base->CTRL |= (uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK);

            EnableGlobalIRQ(irqMask);

The old code used to be:

            /* Disable LPUART RX IRQ, protect ring buffer. */

            LPUART_DisableInterrupts(base, (uint32_t)kLPUART_RxDataRegFullInterruptEnable);

and

            /* Enable LPUART RX IRQ if previously enabled. */

            LPUART_EnableInterrupts(base, (uint32_t)kLPUART_RxDataRegFullInterruptEnable);

Why is the RxOverrun (LPUART_CTRL_ORIE_MASK ) interrupt being disabled? I'm not sure that is a good idea, especially when disabling the receive interrupt while copying the ring buffer to rxData. Won't that hide issues when the copy takes too long?

Perhaps I have mis-understood it.

Thanks and regards,

Ronnie

Labels (1)
0 Kudos
0 Replies