Hi Dear Authorized,
I am just trying to pass my own pointer struct as parameter to the "EXAMPLE_LPUART_IRQHandler" method.
In default SDK example of LPUART EDMA Ring Buffer :
...
..
.
#define EXAMPLE_LPUART_IRQHandler LPUART1_IRQHandler
#define EXAMPLE_LPUART_IRQn LPUART1_IRQn
.
..
...
void EXAMPLE_LPUART_IRQHandler(void)
{
uint32_t status = LPUART_GetStatusFlags(EXAMPLE_LPUART);
uint32_t enabledInterrupts = LPUART_GetEnabledInterrupts(EXAMPLE_LPUART);
/* If new data arrived. */
if ((0U != ((uint32_t)kLPUART_IdleLineFlag & status)) &&
(0U != ((uint32_t)kLPUART_IdleLineInterruptEnable & enabledInterrupts)))
{
(void)LPUART_ClearStatusFlags(EXAMPLE_LPUART, kLPUART_IdleLineFlag);
isIdleLineDetected = true;
receivedBytes = EXAMPLE_RING_BUFFER_SIZE -
EDMA_GetRemainingMajorLoopCount(EXAMPLE_LPUART_DMA_BASEADDR, LPUART_RX_DMA_CHANNEL);
receivedBytes += (EXAMPLE_RING_BUFFER_SIZE * ringBufferFlag) - ringBufferIndex;
if (receivedBytes > 32U)
{
__NOP();
}
}
LPUART_TransferEdmaHandleIRQ(EXAMPLE_LPUART, &g_lpuartEdmaHandle);
SDK_ISR_EXIT_BARRIER;
}
What I am trying to do:
void EXAMPLE_LPUART_IRQHandler(myStruct* myStruct_param)
{
...
..
.
myStruct_param->isIdleLineDetected = true;
myStruct_param->receivedBytes = EXAMPLE_RING_BUFFER_SIZE - EDMA_GetRemainingMajorLoopCount(EXAMPLE_LPUART_DMA_BASEADDR, LPUART_RX_DMA_CHANNEL);
myStruct_param->receivedBytes += (EXAMPLE_RING_BUFFER_SIZE * ringBufferFlag) - myStruct_param->ringBufferIndex;
if (myStruct_param->receivedBytes > 32U)
{
__NOP();
}
}
LPUART_TransferEdmaHandleIRQ(EXAMPLE_LPUART, &g_lpuartEdmaHandle);
SDK_ISR_EXIT_BARRIER;
}
I just manupulate "WEAK LPUART1_IRQHandler" with parameters but it didn't work. Comments says it can be only override. How do we overload this method as stated above?
Thanks and Regards.
已解决! 转到解答。
Hi
No parameters can be explicitly passed to an interrupt handler because it is designed to be called by the hardware.
Regards
Daniel