From c090b8df38792f24eb8a2e1aed6b99c320825fca Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Tue, 28 Jun 2016 23:07:54 +0200 Subject: [PATCH] LP-327 - Raise an alarm to prevent arming if gyro is not yet calibrated (implement the same Revo behaviour) --- flight/modules/Attitude/attitude.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flight/modules/Attitude/attitude.c b/flight/modules/Attitude/attitude.c index 0cac95903..805e651d3 100644 --- a/flight/modules/Attitude/attitude.c +++ b/flight/modules/Attitude/attitude.c @@ -356,7 +356,8 @@ static void AttitudeTask(__attribute__((unused)) void *parameters) } // Only update attitude when sensor data is good - if (retval != 0) { + // raise alarm if gyro has not been yet calibrated to prevent arming + if (retval != 0 || init == 0) { AlarmsSet(SYSTEMALARMS_ALARM_ATTITUDE, SYSTEMALARMS_ALARM_ERROR); } else { // Do not update attitude data in simulation mode