Skip to content

Commit

Permalink
In the attitude loop need to check all the queues even if unused or t…
Browse files Browse the repository at this point in the history
…he event

system will have warnings
  • Loading branch information
peabody124 committed Feb 7, 2012
1 parent 3bb571a commit 02bec75
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "overo"]
path = overo
url = [email protected]:peabody124/op_overo.git
17 changes: 16 additions & 1 deletion flight/Modules/Attitude/revolution/attitude.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,12 @@ static int32_t updateAttitudeComplimentary(bool first_run)
AlarmsSet(SYSTEMALARMS_ALARM_ATTITUDE,SYSTEMALARMS_ALARM_WARNING);
return -1;
}
if ( xQueueReceive(accelQueue, &ev, 0) != pdTRUE )
{
// When one of these is updated so should the other
AlarmsSet(SYSTEMALARMS_ALARM_ATTITUDE,SYSTEMALARMS_ALARM_WARNING);
return -1;
}

// During initialization and
FlightStatusData flightStatus;
Expand Down Expand Up @@ -290,7 +296,8 @@ static int32_t updateAttitudeComplimentary(bool first_run)
accel_err[1] /= accel_mag;
accel_err[2] /= accel_mag;

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

AttitudeActualSet(&attitudeActual);

// Flush these queues for avoid errors
if ( xQueueReceive(baroQueue, &ev, 0) != pdTRUE )
{
}
if ( xQueueReceive(gpsQueue, &ev, 0) != pdTRUE )
{
}

AlarmsClear(SYSTEMALARMS_ALARM_ATTITUDE);

return 0;
Expand Down
1 change: 1 addition & 0 deletions overo
Submodule overo added at 76d03a

0 comments on commit 02bec75

Please sign in to comment.