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

how to wait for more than one signal in one task in RTX51 TIny

Hi:

I want to excute one task that is already waiting for serval different signals. how can I do that in the RTX51 TINNY?

for example:
void task_0(){

os_send_signal (2);
}

void task_1(){

os_send_signal (2);
}

void task_2(){

os_wait(K_SIG,0,0); //I want to excute this task until both task_0 and task_1 send the signal to task_2.

++count;

}

//It is expressed in C language :
if( signal_A && signal_B){
task_2();
//how can I send signal_A and signal_B from different tasks to task_2?
}

thanks in advance

  • Hi,
    may it be an idea, to just execute 2 os_wait calls?

    void task_2()
    {
        os_wait(K_SIG,0,0); // wait for the first signal
        os_wait(K_SIG,0,0); // wait for the second signal
    
        ++count;
    }
    

  • "

    void task_2()
    { os_wait(K_SIG,0,0); // wait for the first signal os_wait(K_SIG,0,0); // wait for the second signal

    ++count;
    }

    " It does not know which task send the first signal to task_2. It means that if the task_0 has been send signal for two times before the task_1 send the signal, the task_2 also excute. But I want task_2 to wait for two signals that are from task_0 and task_1.

  • "It does not know which task send the first signal to ..."

    Hmm, this level of interrogatory makes me wonder -- somewhat clueful, yet clueless -- hmm...

    If only it had the ability to master the "Place source code between ..." directives two bullet-points above the forum's "Message:" text entry box, but no, so how to classify it ...?