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

Ignore Telemetry alarm when arming (telemetry alarm no longer prevents arming).

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2821 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
pip 2011-02-20 17:53:03 +00:00 committed by pip
parent df26016c64
commit 88cf1e276a

View File

@ -544,7 +544,7 @@ static uint32_t timeDifferenceMs(portTickType start_time, portTickType end_time)
} }
static bool okToArm(void) static bool okToArm(void)
{ // return TRUE is it's OK to arm { // return TRUE if it's OK to arm
bool ok = true; bool ok = true;
@ -556,8 +556,8 @@ static bool okToArm(void)
SystemAlarmsData alarms; SystemAlarmsData alarms;
SystemAlarmsGet(&alarms); SystemAlarmsGet(&alarms);
// // fetch the GPS alarm state
// SystemAlarmsAlarmOptions gps_alarm = AlarmsGet(SYSTEMALARMS_ALARM_GPS); // SystemAlarmsAlarmOptions gps_alarm = AlarmsGet(SYSTEMALARMS_ALARM_GPS);
// SystemAlarmsAlarmOptions telemetry_alarm = AlarmsGet(SYSTEMALARMS_ALARM_TELEMETRY);
switch (AHRSSettings.Algorithm) switch (AHRSSettings.Algorithm)
{ {
@ -565,13 +565,13 @@ static bool okToArm(void)
case AHRSSETTINGS_ALGORITHM_INSGPS_INDOOR: case AHRSSETTINGS_ALGORITHM_INSGPS_INDOOR:
case AHRSSETTINGS_ALGORITHM_INSGPS_INDOOR_NOMAG: case AHRSSETTINGS_ALGORITHM_INSGPS_INDOOR_NOMAG:
// Go through alarms // Check each alarm
for (int i = 0; i < SYSTEMALARMS_ALARM_NUMELEM; i++) for (int i = 0; i < SYSTEMALARMS_ALARM_NUMELEM; i++)
{ {
if (alarms.Alarm[i] >= SYSTEMALARMS_ALARM_WARNING) if (alarms.Alarm[i] >= SYSTEMALARMS_ALARM_WARNING)
{ // found an alarm thats set { // found an alarm thats set
if (i != SYSTEMALARMS_ALARM_GPS) if (i != SYSTEMALARMS_ALARM_GPS && i != SYSTEMALARMS_ALARM_TELEMETRY)
{ // it's not the gps alarm { // it's not the gps or telemetry alarm
ok = false; ok = false;
break; break;
} }
@ -581,13 +581,21 @@ static bool okToArm(void)
break; break;
case AHRSSETTINGS_ALGORITHM_INSGPS_OUTDOOR: case AHRSSETTINGS_ALGORITHM_INSGPS_OUTDOOR:
if (AlarmsHasWarnings())
ok = false;
break;
default: // unknown AHRS algorithum default: // unknown AHRS algorithum
if (AlarmsHasWarnings())
ok = false; // Check each alarm
for (int i = 0; i < SYSTEMALARMS_ALARM_NUMELEM; i++)
{
if (alarms.Alarm[i] >= SYSTEMALARMS_ALARM_WARNING)
{ // found an alarm thats set
if (i != SYSTEMALARMS_ALARM_TELEMETRY)
{ // it's not the telemetry alarm
ok = false;
break;
}
}
}
break; break;
} }