Quantcast
Channel: Forum - Recent Threads
Viewing all articles
Browse latest Browse all 5781

How to use p_context of can_cfg_t?

$
0
0

Hallo,

the user manual describes the "void const *p_context" of the "can_cfg_t" as an "User defined callback context."

So I've assumed,  that I can use this pointer for a reference to my own data assigned to a specific CAN channel (e.g. diagnostic and statistic data) used in the callback function.

SSP inits this ptr to the instance "g_can0" itself, in the following way: "p_context=&g_can0".

Trying to assign the "p_context" to my own data, forces the compiler error "assignment of read only object", because of "static const" declaration,  I guess.

So the question is: can I use the ptr. for a reference to my own data or not? And if yes, how can I manage this?

Thanks for your support.

Regards

Ralph


Viewing all articles
Browse latest Browse all 5781

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>