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.

CC1312R: SimpleLink driver Timer callback from C++

Part Number: CC1312R
Other Parts Discussed in Thread: SYSBIOS

Hello,

I have a C++ class which currently uses the TIRTOS Clock with a C callback wrapper function, along the lines of:

// Wrapper function for clock callback
extern "C" {
    void abstractClockTick(UArg arg0) {
        static RadioDevice *task = reinterpret_cast<RadioDevice*>(arg0);
        task->tick();
    }
}

...and the clock is initialized thus:

    Clock_Params clkParams;
    Clock_Params_init(&clkParams);
    clkParams.period    = 5000;
    clkParams.startFlag = TRUE;
    clkParams.arg       = (UArg)this;

I now need more accuracy and want to use a hardware timer through the Timer driver api, but it doesn't look like I can pass an argument (this) to the C function so it can reference the instance, per Timer doc: TI Drivers Runtime APIs

Is there a workaround?