Page 1 of 1

Tasks periodic check by events

Posted: Fri Jan 09, 2015 1:26 am
by DeusExMachina
Hello,
I want to implement periodic task check in separate supervisor task, which resets WDT counter after receiving tasks from all other tasks.

Code: Select all

msg_t Task1()
{
while(1)
  {
    chEvtSignal(hSupervisor, Event1);
...
  }
}

msg_t Task2()
{
while(1)
  {
    chEvtSignal(hSupervisor, Event2);
...
  }
}

msg_t Supervisor()
{
  while(1)
  {   
    chEvtWaitAll(Event1 | Event2);
    resetWDT();
   ..
  }
}


But I receive both events very rarely, and MCU resets periodically. I send both events every 250ms, and WDT period is 2 sec. May be I do something wrong with events? :oops: When I wait only one event (from one task) everything works as expected.

Re: Tasks periodic check by events

Posted: Fri Jan 09, 2015 9:16 am
by Giovanni
Hi,

This is a classic way to do that, without seeing the actual code it is hard to imagine what could be the problem.

Giovanni

Re: Tasks periodic check by events

Posted: Tue Feb 03, 2015 7:07 am
by DeusExMachina
It was mine logic error, everything works well.