1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

LP-273 Reinit Mag alarm while switching to Complementary

This commit is contained in:
Laurent Lalanne 2016-04-02 00:11:01 +02:00
parent bbb93658be
commit b1747c58c2

View File

@ -383,6 +383,8 @@ static void StateEstimationCb(void)
switch ((RevoSettingsFusionAlgorithmOptions)revoSettings.FusionAlgorithm) {
case REVOSETTINGS_FUSIONALGORITHM_BASICCOMPLEMENTARY:
newFilterChain = cfQueue;
// reinit Mag alarm
AlarmsSet(SYSTEMALARMS_ALARM_MAGNETOMETER, SYSTEMALARMS_ALARM_UNINITIALISED);
break;
case REVOSETTINGS_FUSIONALGORITHM_COMPLEMENTARYMAG:
newFilterChain = cfmiQueue;
@ -414,7 +416,7 @@ static void StateEstimationCb(void)
AlarmsSet(SYSTEMALARMS_ALARM_ATTITUDE, SYSTEMALARMS_ALARM_ERROR);
return;
} else {
// set new fusion algortithm
// set new fusion algorithm
filterChain = newFilterChain;
fusionAlgorithm = revoSettings.FusionAlgorithm;
}