This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LS1224 Interrupts in Class

Other Parts Discussed in Thread: TMS570LS1224, HALCOGEN

Hey,

i'm at the moment working with an TMS570LS1224 and have written an class for the eCap Module, which works really great. 
Now i want to take the code which i put in ecapNotification (in notification.c) in to my class.
I thought about an callback function and in my class i'll give an function pointer to that callback function. But that didn't work because in notification.c i can't include my class (a lot of error are thrown then).

Is there an easy way to outsource the interrupts from notification.c?

Cheers
Moritz 

and thanks for help.

  • Moritz,


    Your question is C/C++ specific, and without more detail and code from your side, it will be difficult to answer it.

    Will it be possible to share your project, so I can ask our Code Generator team to have a look?

  • Dear Jean-Marc,

    at the moment it is not possible to provide specific code, but i can try to describe the problem in deep.

    What we have is an class, which manages all eCAP Pins of the TMS570. And in the notification.c there are all interrupt routines are defined (they are there by standard generated from Halcogen).
    So what we now want to do is to take the function of the interrupt defined in notification.c and move it the ecap Class.
    so that the class then looks like that

    class eCap {
    <---- Here should the function be defined --->
    }

    I know, that i can move the function to another file like i can define the function in the main without problem. But how is it working with a class, i tried to define it in the class, but it wasn't working.

    Any idea about that ?

    Cheers
    Moritz Weichert
  • Mortiz, You need to define the function as a static method inside the class. This will enable you to reference the function without an instance reference. Joe