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?
printf isn't reentrant. Jon
RTX51 Tiny isn't pre-emptive. How does task 1 give up the processor so that any other task might run?
How does task 1 give up the processor so that any other task might run? I kinda figured he had round-robin enabled. But, if not, you are right! Jon