From a77a012586fc5b1f3c021d2eb8c8bd65c1401561 Mon Sep 17 00:00:00 2001 From: Kenz Dale Date: Mon, 23 Jul 2012 16:09:47 +0200 Subject: [PATCH] Eliminated attitude sensor timeout warnings when in simulation mode. --- flight/Modules/Attitude/revolution/attitude.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/flight/Modules/Attitude/revolution/attitude.c b/flight/Modules/Attitude/revolution/attitude.c index 74800cc55..039b71c65 100644 --- a/flight/Modules/Attitude/revolution/attitude.c +++ b/flight/Modules/Attitude/revolution/attitude.c @@ -262,11 +262,13 @@ static int32_t updateAttitudeComplementary(bool first_run) // Wait until the AttitudeRaw object is updated, if a timeout then go to failsafe if ( xQueueReceive(gyroQueue, &ev, FAILSAFE_TIMEOUT_MS / portTICK_RATE_MS) != pdTRUE || - xQueueReceive(accelQueue, &ev, 1 / portTICK_RATE_MS) != pdTRUE ) + xQueueReceive(accelQueue, &ev, 1 / portTICK_RATE_MS) != pdTRUE ) // When one of these is updated so should the other { - // When one of these is updated so should the other - AlarmsSet(SYSTEMALARMS_ALARM_ATTITUDE,SYSTEMALARMS_ALARM_WARNING); - return -1; + // Do not set attitude timeout warnings in simulation mode + if (!AttitudeActualReadOnly()){ + AlarmsSet(SYSTEMALARMS_ALARM_ATTITUDE,SYSTEMALARMS_ALARM_WARNING); + return -1; + } } AccelsGet(&accelsData); @@ -527,10 +529,13 @@ static int32_t updateAttitudeINSGPS(bool first_run, bool outdoor_mode) // Wait until the gyro and accel object is updated, if a timeout then go to failsafe if ( (xQueueReceive(gyroQueue, &ev, FAILSAFE_TIMEOUT_MS / portTICK_RATE_MS) != pdTRUE) || - (xQueueReceive(accelQueue, &ev, 1 / portTICK_RATE_MS) != pdTRUE) ) + (xQueueReceive(accelQueue, &ev, 1 / portTICK_RATE_MS) != pdTRUE) ) { - AlarmsSet(SYSTEMALARMS_ALARM_ATTITUDE,SYSTEMALARMS_ALARM_WARNING); - return -1; + // Do not set attitude timeout warnings in simulation mode + if (!AttitudeActualReadOnly()){ + AlarmsSet(SYSTEMALARMS_ALARM_ATTITUDE,SYSTEMALARMS_ALARM_WARNING); + return -1; + } } if (inited) {