RT1021 SDK lpuart driver interrupt modifications question

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

RT1021 SDK lpuart driver interrupt modifications question

804件の閲覧回数
rshipman
Senior Contributor I

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

ラベル(1)
0 件の賞賛
返信
0 返答(返信)