diff --git a/software/raspberry/superviseur-robot/tasks.cpp b/software/raspberry/superviseur-robot/tasks.cpp index f698b47..66063b7 100644 --- a/software/raspberry/superviseur-robot/tasks.cpp +++ b/software/raspberry/superviseur-robot/tasks.cpp @@ -656,9 +656,8 @@ void Tasks::StartRobotTaskWithoutWatchdog(void *arg) { void Tasks::StartRobotTaskWithWatchdog(void *arg) { int killBatteryOk=0; - int cpt=1; + int cpt=0; Message * msgSend; - int err; while(1){ @@ -697,11 +696,13 @@ void Tasks::StartRobotTaskWithWatchdog(void *arg) { while (killBatteryOk==0) { cpt++; if(cpt==2){ + rt_mutex_acquire(&mutex_robot, TM_INFINITE); + robot.Write(MESSAGE_ROBOT_RELOAD_WD); + rt_mutex_release(&mutex_robot); cpt=0; } rt_task_wait_period(NULL); rt_sem_v(&sem_askBattery); - rt_mutex_acquire(&mutex_killBattery, TM_INFINITE); killBatteryOk=killBattery; rt_mutex_release(&mutex_killBattery);