ok
This commit is contained in:
parent
19cefe3563
commit
c5892bacc9
1 changed files with 4 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue