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

about RTX51 Tiny task switching

My program as follow:
unsigned char itask;
void choice(void)_task_0
{init();
os_create_task(1);
os_create_task(2);
os_delete_task(0);
}
void task(void)_task_ 1
{
itask = os_running_task_id (); os_wait (K_SIG, 0, 0); while(1)
{ printf("Just test1");
os_wait(K_TMO,10,0);}
}
void task(void)_task_ 2
{
while(1)
{ os_wait(K_TMO,100,0);
printf("Just test2");}
}
If I remove "itask = os_running_task_id (); os_wait (K_SIG, 0, 0); "
from task 1 ,then it never run. Why? If not,it will run forever when you hit keybroad.Why? RTX51 Tiny seems difficult to me . Thanks in advance.

Parents
  • Dear Linton,
    Task1 waits for a signal (os_wait(K_SIG,0,0)) from any other task or interrupt. But in your whole source is no task defined which is sending this signal (os_send_signal(1)). Therefore Task1 is waiting endless, never reaching the loop while(1).
    with best regards
    Uwe

Reply
  • Dear Linton,
    Task1 waits for a signal (os_wait(K_SIG,0,0)) from any other task or interrupt. But in your whole source is no task defined which is sending this signal (os_send_signal(1)). Therefore Task1 is waiting endless, never reaching the loop while(1).
    with best regards
    Uwe

Children
No data