This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

What's wrong with switch tasks in using the RTX51 Tiny ?

I write a program using the RTX51 Tiny as follow:
#include <reg52.h>
#include <rtx51tny>
#include <stdio.h>
void init(void)_task_ 0
{
init();
os_create_task(1);
os_create_task(2);
os_create_task(3);
os_delete_task(0);
}
void task1(void)_task_1
{
while(1)
{
printf(menu);//a big menu in code
}
}
void task2(void)_task_2
{
while(1)
{
printf("just test1");
os_wait(K_TMO,5,0);
}
}
void task3(void)_task_3
{
while(1)
{
printf("Just test2");
os_wait(K_TMO,5,0);
}
}
why task1 was terminated by task2 when it excuting? task2 runs forever and don't allow other tasks to start. task3 never run in this program.Why?