gestion message erroné dans askBattery et StartWithWatchdog fonctionnel
This commit is contained in:
parent
be868ed6f4
commit
6ca9bf556a
1 changed files with 7 additions and 3 deletions
|
@ -404,7 +404,7 @@ void Tasks::ReceiveFromMonTask(void *arg) {
|
|||
|
||||
} else if (msgRcv->CompareID(MESSAGE_ROBOT_START_WITH_WD)) {
|
||||
cout << "Command Start Robot with Watchdog Received" << endl << flush;
|
||||
rt_sem_v(&sem_startRobotWithoutWatchdog);
|
||||
rt_sem_v(&sem_startRobotWithWatchdog);
|
||||
|
||||
} else if (msgRcv->CompareID(MESSAGE_CAM_ASK_ARENA)) {
|
||||
cout << "Command Search Arena Received" << endl << flush;
|
||||
|
@ -591,7 +591,9 @@ void Tasks::StartRobotTaskWithWatchdog(void *arg) {
|
|||
while (killBatteryOk==0) {
|
||||
cpt++;
|
||||
if(cpt==2){
|
||||
rt_mutex_acquire(&mutex_robot, TM_INFINITE);
|
||||
robot.Write(robot.ReloadWD());
|
||||
rt_mutex_release(&mutex_robot);
|
||||
cpt=0;
|
||||
}
|
||||
rt_task_wait_period(NULL);
|
||||
|
@ -656,9 +658,11 @@ void Tasks::AskBattery(void *arg){
|
|||
rt_mutex_acquire(&mutex_robot, TM_INFINITE);
|
||||
p_mess_answer_battery = robot.Write(robot.GetBattery());
|
||||
rt_mutex_release(&mutex_robot);
|
||||
if(p_mess_answer_battery->GetID()==MESSAGE_ROBOT_BATTERY_LEVEL){
|
||||
WriteInQueue(&q_messageToMon, p_mess_answer_battery);
|
||||
cout << endl << flush;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue