hi..
now i am working on frdmk64 controller. actually i edited hello example project. in this project i created 3 task but i want to destroy one task after some time but its destroyed all task. i attached my code also.
sample code:
const TASK_TEMPLATE_STRUCT MQX_template_list[] =
{
/* Task Index, Function, Stack, Priority, Name, Attributes, Param, Time Slice */
{ WORLD_TASK, world_task, 700, 8, "world", MQX_AUTO_START_TASK, 0, 0 },
{ HELLO_TASK, hello_task, 700, 9, "hello", MQX_AUTO_START_TASK, 0, 0 },
{ TEST_TASK, test_task, 700, 10, "test", 0, 0, 0 },
{ 0 }
};
test_tid = _task_create(0, TEST_TASK, (uint32_t) &task_p);
if (test_tid == MQX_NULL_TASK_ID)
{
fprintf(stderr, "Fatal Error 0x%X: Unable to create test task.", _task_get_error());
_task_block();
}
i=10;
while(1)
{
printf("Enter\n",i);
printf("world=%d\n",i);
if(i==15)
{
_task_destroy(test_tid);
printf("test destroyed",i);
}
i++;
_time_delay(3000);
}
my problem was its blocking WORLD_TASK and also HELLO_TASK. so how to solve this problem.
Original Attachment has been moved to: hello_pro.zip
Hello,
Please check the below threads and let me know if this helps!!!
Task managment - Kill various tasks
Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
dear soledad,
if i use _task_abort or _task_destroy API function all the task are blocked. why this thing happening..? actually i used " _task_abort(test_tid);" so "test_tid " task should stop, remaining task should be run. but its blocked all task. how to avoid this problem..? give some explanation
Hello,
Please check the below thread and let me know if this helps
Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------