Tasks periodic check by events

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
User avatar
DeusExMachina
Posts: 223
Joined: Tue Apr 03, 2012 5:08 am
Has thanked: 3 times
Been thanked: 3 times

Tasks periodic check by events

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Tasks periodic check by events

Post 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
User avatar
DeusExMachina
Posts: 223
Joined: Tue Apr 03, 2012 5:08 am
Has thanked: 3 times
Been thanked: 3 times

Re: Tasks periodic check by events

Post by DeusExMachina »

It was mine logic error, everything works well.
Post Reply