Page 2 of 2

Re: OSCreateMsg

PostPosted: Mon Mar 31, 2008 3:16 am
by Gerald
what are eFlags? and what is OSWaitEFlag doing?

whats the difference between eFlags and WaitForMultipleObjects?

how could i share a var between two tasks? should the var be atomic?

bye


Re: OSCreateMsg

PostPosted: Mon Mar 31, 2008 8:51 am
by aek

Re: OSCreateMsg

PostPosted: Tue Apr 01, 2008 11:20 am
by Gerald
void Task1()
{
for(;
{
if(start_process == true)
{
// do some work
start_process = false;
OSSignalMsg
}
else
{
// do some other work like receive on a LIN Bus
}

OS_Delay(50);
}
}

void Task2()
{
for(;
{
OS_WaitMsg

// start a process...
// process done...

start_process = true;

OS_Delay(50);
}
}

which synchronisation object do you prefer here for the global var start_process? it must not block task1!