Skip to content

Commit 02bec75

Browse files
committed
In the attitude loop need to check all the queues even if unused or the event
system will have warnings
1 parent 3bb571a commit 02bec75

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "overo"]
2+
path = overo
3+
url = [email protected]:peabody124/op_overo.git

flight/Modules/Attitude/revolution/attitude.c

+16-1
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,12 @@ static int32_t updateAttitudeComplimentary(bool first_run)
234234
AlarmsSet(SYSTEMALARMS_ALARM_ATTITUDE,SYSTEMALARMS_ALARM_WARNING);
235235
return -1;
236236
}
237+
if ( xQueueReceive(accelQueue, &ev, 0) != pdTRUE )
238+
{
239+
// When one of these is updated so should the other
240+
AlarmsSet(SYSTEMALARMS_ALARM_ATTITUDE,SYSTEMALARMS_ALARM_WARNING);
241+
return -1;
242+
}
237243

238244
// During initialization and
239245
FlightStatusData flightStatus;
@@ -290,7 +296,8 @@ static int32_t updateAttitudeComplimentary(bool first_run)
290296
accel_err[1] /= accel_mag;
291297
accel_err[2] /= accel_mag;
292298

293-
if (1) {
299+
if ( xQueueReceive(magQueue, &ev, 0) != pdTRUE )
300+
{
294301
// Rotate gravity to body frame and cross with accels
295302
float brot[3];
296303
float Rbe[3][3];
@@ -378,6 +385,14 @@ static int32_t updateAttitudeComplimentary(bool first_run)
378385

379386
AttitudeActualSet(&attitudeActual);
380387

388+
// Flush these queues for avoid errors
389+
if ( xQueueReceive(baroQueue, &ev, 0) != pdTRUE )
390+
{
391+
}
392+
if ( xQueueReceive(gpsQueue, &ev, 0) != pdTRUE )
393+
{
394+
}
395+
381396
AlarmsClear(SYSTEMALARMS_ALARM_ATTITUDE);
382397

383398
return 0;

overo

Submodule overo added at 76d03ac

0 commit comments

Comments
 (0)