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.

CC2538: Please introduce create new task on SampleLight example

Part Number: CC2538
Other Parts Discussed in Thread: Z-STACK

I use Z-Stack 3.0.1,

Please introduce create new task on SampleLight example.

---------

Previously, I tried the following steps:

- add task in tasksArr[]

const pTaskEventHandlerFn tasksArr[] = {
    macEventLoop,
    nwk_event_loop,
    .
    .
    my_task_event_loop
}

- init task in osalInitTasks()

void osalInitTasks( void )
{
    uint8 taskID = 0;
    
    tasksEvents = (uint16 *)osal_mem_alloc( sizeof( uint16 ) * tasksCnt);
    osal_memset( tasksEvents, 0, (sizeof( uint16 ) * tasksCnt));

    macTaskInit( taskID++ );
    nwk_init( taskID++ );
    .
    .
    .
    bdb_Init( taskID++ );
    zclSampleLight_Init( taskID++ );
    
    my_task_Init( taskID );
}

void  my_task_Init(uint8 task_id)
{
    // nothing
}

uint16 my_task_event_loop( uint8 task_id, uint16 events )

{

    // my code process 

    return events;

}

and then program does not go into my task. Please introduce me thanks.