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

Arm checks: Simply don't check GPS because the dependence on AHRS Settings

breaks CC.  This should be done by the GPS alarm being set only when
appropriate (i.e. by AHRS on OP when needed) and not by the GPS module.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2824 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
peabody124 2011-02-21 05:58:24 +00:00 committed by peabody124
parent 4972c99519
commit 5f2c502172
2 changed files with 20 additions and 56 deletions

View File

@ -42,8 +42,6 @@
#include "attitudedesired.h"
#include "flighttelemetrystats.h"
#include "ahrs_comm_objects.h"
// Private constants
#if defined(PIOS_MANUAL_STACK_SIZE)
#define STACK_SIZE_BYTES PIOS_MANUAL_STACK_SIZE
@ -543,63 +541,30 @@ static uint32_t timeDifferenceMs(portTickType start_time, portTickType end_time)
return ((((portTICK_RATE_MS) -1) - start_time) + end_time) * portTICK_RATE_MS;
}
/**
* @brief Determine if the aircraft is safe to arm
* @returns True if safe to arm, false otherwise
*/
static bool okToArm(void)
{ // return TRUE if it's OK to arm, otherwise return FALSE
bool ok = true;
// read AHRS settings
AHRSSettingsData AHRSSettings;
AHRSSettingsGet(&AHRSSettings);
{
// read alarms
SystemAlarmsData alarms;
SystemAlarmsGet(&alarms);
SystemAlarmsGet(&alarms);
// SystemAlarmsAlarmOptions gps_alarm = AlarmsGet(SYSTEMALARMS_ALARM_GPS);
// SystemAlarmsAlarmOptions telemetry_alarm = AlarmsGet(SYSTEMALARMS_ALARM_TELEMETRY);
switch (AHRSSettings.Algorithm)
// Check each alarm
for (int i = 0; i < SYSTEMALARMS_ALARM_NUMELEM; i++)
{
case AHRSSETTINGS_ALGORITHM_SIMPLE:
case AHRSSETTINGS_ALGORITHM_INSGPS_INDOOR:
case AHRSSETTINGS_ALGORITHM_INSGPS_INDOOR_NOMAG:
if (alarms.Alarm[i] >= SYSTEMALARMS_ALARM_ERROR)
{ // found an alarm thats set
if (i == SYSTEMALARMS_ALARM_GPS || i == SYSTEMALARMS_ALARM_TELEMETRY)
continue;
// Check each alarm
for (int i = 0; i < SYSTEMALARMS_ALARM_NUMELEM; i++)
{
if (alarms.Alarm[i] >= SYSTEMALARMS_ALARM_ERROR)
{ // found an alarm thats set
if (i != SYSTEMALARMS_ALARM_GPS && i != SYSTEMALARMS_ALARM_TELEMETRY)
{ // it's not the gps or telemetry alarm
ok = false; // prevent arming
break;
}
}
}
break;
case AHRSSETTINGS_ALGORITHM_INSGPS_OUTDOOR:
default: // unknown AHRS algorithum
// Check each alarm
for (int i = 0; i < SYSTEMALARMS_ALARM_NUMELEM; i++)
{
if (alarms.Alarm[i] >= SYSTEMALARMS_ALARM_ERROR)
{ // found an alarm thats set
if (i != SYSTEMALARMS_ALARM_TELEMETRY)
{ // it's not the telemetry alarm
ok = false; // prevent arming
break;
}
}
}
break;
return false;
}
}
return ok;
return true;
}
//

View File

@ -8256,7 +8256,6 @@
};
buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "OpenPilotOSX" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,