access interrupt of component from another component

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hello,

   

I would like to access the "CAN1_ReceiveMsg" of the CAN component from an custom component. I know that I can use the "CAN1_RECEIVE_MSG_CALLBACK" define, but only by adding it manually in my project. Is it possible to do this within my custom component so that it is not necessary to do the define by the component user? 

   

How can I read the received data from within the callbackfunktion? (How do I figure out witch mailbox was the one that caused the interrupt?)

   

regards Konrad

0 Likes
1 Solution
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

When you embed, your component can control how the CAN component is named, so you can call methods on it (actually I think you need to use a special syntax for the instance name, the docs should help you with that).

View solution in original post

0 Likes
3 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

You would need to include the CAN component into your own. Otherwise your component doesn't know the correct instance ID, so it cannot call the correct callback.

0 Likes
Anonymous
Not applicable

Hi, thank you for your answer, but I didn't got it. When I include the CAN component in my custom component how do I signal the CAN API to call a callback routine?

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

When you embed, your component can control how the CAN component is named, so you can call methods on it (actually I think you need to use a special syntax for the instance name, the docs should help you with that).

0 Likes