Tool/software: TI-RTOS
I am trying to delete a task with Task_delete. This raises an exception and the program seems to be stuck in xdc_runtime_Error_policySpin__E.
I have added Task_setPri(-1) before the delete, but that doesn't fix the issue. I have attached the call stack as well as disassembly.
#define SERVO_TASK_STACK_SIZE 480
Char servoTaskStack[SERVO_TASK_STACK_SIZE];
Task_Handle servoTaskHandle;
void createServoTask() {
Task_Params taskParams;
Task_Params_init(&taskParams);
taskParams.stack = servoTaskStack;
taskParams.stackSize = SERVO_TASK_STACK_SIZE;
taskParams.priority = 5;
servoTaskHandle = Task_create(taskFuncServo, &taskParams, NULL);
}
void deleteServoTask() {
if (servoTaskHandle) {
Task_setPri(servoTaskHandle, -1);
Task_delete(&servoTaskHandle);
}
}

