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.

CCS/TM4C1294NCPDT: Problems while creating NDK heartbeat timer

Part Number: TM4C1294NCPDT
Other Parts Discussed in Thread: SYSBIOS

Tool/software: Code Composer Studio

I'm trying to manually configure my application using C code and Cfg*() functions (as described in spru523k, section 2.1), but I'm facing a problem  while creating the 100ms timer required. When I try to create the timer and associate it with the llTimerTick() function, I got this error from the compiler:
#169 argument of type "void(*)()" is incompatible with parameter of type "tu_sysbios_knl_Clock_FuncPtr"

The code related with this error is:

#include <ti/sysbios/knl/Clock.h>

extern void llTimerTick();

extern "C" void NDKManagerTaskFxn()
{
    Clock_Params clockParams;

    /* Create the NDK heart beat */
    Clock_Params_init(&clockParams);
    clockParams.startFlag = TRUE;
    clockParams.period = 1000;
    Clock_create(&llTimerTick, clockParams.period, &clockParams, NULL);    // Error here
}

Does anybody know what may be happening?

Thank you in advance,
Ronan

  • Hi Ronan,

    Here is the function prototype for llTimerTick

    void llTimerTick();

    Here is the function prototype for a Clock function:

    typedef Void (*FuncPtr)(UArg);

    You can simply add a cast in the Clock_create (note you do not need the address before the llTimerTick either):

    Clock_Handle ndkClockHandle;
    ...
    ndkClockHandle = Clock_create((Clock_FuncPtr)llTimerTick, clockParams.period, &clockParams, Error_IGNORE);
    if (ndkClockHandle == NULL) {
       // handle error
    }

    This is fine since the llTimerTick does not use any the arg in the Clock instance.

    Todd

  • To cast solved my problem!

    Thanks a lot, Todd!