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

Interval does not work when receiving signals

Hi

I have the problem, that I want to execute a 'ClockTick' each 100ms, and a 'Do_Process' when a Signal is received.
If I use:

char OSEvent;

OSEvent = os_wait(K_SIG+K_IVL,100,0);
switch (OSEvent)
{
case TMO_EVENT :
{
ClockTick();
break;
}
case SIG_EVENT :
{
Do_Process();
break;
}
default :
{
LogWrite("Unknown\n");
}
}

I have the problem, that 'ClockTick' is executed in shorter intervals than 100ms when a lot of Signals are received. Seems that the interval timer is reseted whenever a signal occurs. In this way 'ClockTick' can be executed more than 10 times in a second, but it must not!

Well, I can also use a timer:
OSEvent = os_wait(K_SIG+K_TMO,100,0);

But in this way it is no guaranteed, that 'ClockTick' is executed every 100ms. If I receive a lot of Signals, then 'ClockTick' is never executed.

How can I solve this problem. According to the manual this should work with an interval.

Please help me
Tom

0