Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/04/02 12:20
Read: times


 
#23876 - RTX51-full - os_wait forever
Can anyone help me with this one?

I will try to explaine my problem with a code sample:
The init task creates TASK1 and enables interrupt 0. Interrupt 0 send a signal to TASK1. TASK1 waits for signal from interrupt function and when received it he clear the signal and creates other task - TASK2. TASK2 suppose to blink a LED. The problem is that when the program gets to the first wait statement he waits there forever!

The question is WAY???

For better understanding my current code looks something like that:

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

void int0() interrupt 0 using 3
{
os_send_signal(TASK1);
}

void task1() _task_ TASK1
{
while(1) {
os_wait(K_SIG,255,0);
os_clear_signal(TASK1);
os_create_task(TASK2);
}
}

void task2() _task_ TASK2
{
leds = on;
os_wait(K_TMO, _2_SEC, 0);
leds = off;
os_wait(K_TMO, _2_SEC, 0);
}

P.S. I tried also:
void task1() _task_ TASK1
{
If (os_attach_interrupt(0))
os_delete_task(os_running_task_id());
while (1) {
os_wait(K_INT,0xFF,NULL);
:
}
}
but it also NOT helping me. The program, for some reason, doesn’t attach the task to the interrupt and the task delete.

PLEASE HELP :-((

No replies in thread

Back to Subject List