My example is based on "Can_example_S32G399A_M7".
Autosar Can Driver is used as in the example.
FlexCan0 and FlexCan1 are used with external loop. Can rx and tx interrupt are used instead of polling.
I would like the Can ISR will ultimately call CanIf_RxIndication. which its call hierarchy is show as below. the callback in Flexcan_aCtrlConfigPB_VS_0[2] is with the declaration as:
void Can_CommonIrqCallback(uint8 u8Instance,
Flexcan_Ip_EventType event,
uint32 u32buffIdx,
const Flexcan_Ip_StateType *driverState
)
Call Hierarchy is as below:
In main.c, I map the ISR CAN0_ORED_0_7_MB_IRQn to CAN0_ORED_0_7_MB_IRQHandler
My question is:
How does the "CAN0_ORED_0_7_MB_IRQHandler" call "Can_CommonIrqCallback" in turn to call "CanIf_RxIndication"?
is there an easy way to configure the peripherals in MCAL? Or I have to modify the code to bridge the CAN0_ORED_0_7_MB_IRQHandler to Can_CommonIrqCallback? and where is the best place? Do you have any sample code?
I attached please find my zip code.
Thanks,
Vivian
Solved! Go to Solution.
Please ignore my previous question.
This morning I test the code, and the Rx_Indication and Tx_confirmation are called after I installed the CAN0_ORED_0_7_MB_IRQHandler to CAN0_ORED_0_7_MB_IRQn
Further reading the code find that in FlexCAN_lp.c, it call state->callback which will ultimately call the Rx_indication and Tx_confirmation.
Sorry to post here and waste your time.
Please ignore my previous question.
This morning I test the code, and the Rx_Indication and Tx_confirmation are called after I installed the CAN0_ORED_0_7_MB_IRQHandler to CAN0_ORED_0_7_MB_IRQn
Further reading the code find that in FlexCAN_lp.c, it call state->callback which will ultimately call the Rx_indication and Tx_confirmation.
Sorry to post here and waste your time.