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.

LAUNCHXL-CC2640R2: Adding new Task to multiRole project.

Part Number: LAUNCHXL-CC2640R2


I am trying to add a new task in order to replace the button functionality in the multirole example with LAUNCHXL-CC2640R2. This would be a task that can call the connect, disconnect, GATT Read/Write functions similar to how the buttons execute this. The only different is I do not want to use the button callback but have a separate task instead. However, when I try to add a new task the project uploads but then multi_role_taskFxn() appears to not work properly. Below is some of the code I have been trying to use. Is there something I need to do in the ICALL in order to configure this properly or are there memory allocation restrictions? Please let me know where I am going wrong. Thanks

Within int main():



Within multirole.c

#define new_TASK_PRIORITY 1
#define MR_TASK_STACK_SIZE 610
#define new_TASK_STACK_SIZE 200

// Task configuration
Task_Struct mrTask;
Char mrTaskStack[MR_TASK_STACK_SIZE];

// Task configuration
Task_Struct new_Task;
Char new_TaskStack[new_TASK_STACK_SIZE];

void multi_role_createTask(void)
Task_Params taskParams;

// Configure task
taskParams.stack = mrTaskStack;
taskParams.stackSize = MR_TASK_STACK_SIZE;
taskParams.priority = MR_TASK_PRIORITY;

Task_construct(&mrTask, multi_role_taskFxn, &taskParams, NULL);

void new_createTask(void)
Task_Params new_taskParams;

// Configure task
new_taskParams.stack = new_TaskStack;
new_taskParams.stackSize = new_TASK_STACK_SIZE;
new_taskParams.priority = new_TASK_PRIORITY;

Task_construct(&new_Task, new_taskFxn, &new_taskParams, NULL);

static void new_taskFxn(UArg a0, UArg a1){