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

Some questions with the following codes (in large mode) RTX51 full

Thank you in advance.
here is the problems:
1. With the same priority, which task (task 1 or task 2) should run first?
2. If interrupt 0 should be reset after task 1 has been triggered?
3. Why task 2 keeps in ready and task 1 keeps in running (Round-Robin problem?)?
4. In RTX 51 full, how can I disable and enable all interrupts at one time? May I do it like what I have done in function_1?
5. I have to mark function_1 as reentrant function?
6. In task1, what is the difference between clear signal (task1) and unclear signal (task1)?

void init() _task_ INIT
{
os_create_task(TASK1);
os_create_task(TASK2);
os_enable_isr(0);
}

void int0() interrupt 0
{
isr_send_signal(TASK1);
}

void task1() _task_ TASK1 _pirority_ 1
{
while(1) {
os_wait(K_SIG+K_TMO,10,0);
os_clear_signal(TASK1); /* I have to do this?*/
/* task code*/
function_1();
os_send_signal(TASK2);
}
}

void task2() _task_ TASK2 _pirority_ 1
{
while(1) {
os_wait(K_SIG+K_TMO, 10, 0);
/* task code */
function_1();
}
}

function_1() large reentrant /* I have to mark it?*/
{

EA=0;
/* code */
EA=1;

}