1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

Flight/Stabilization: Need to either set or clear the alarm, but the way it was

before cleared at the end of each loop - including one after an alarm

Flight/Actuator: Similar change to make sure not having updates from
stabilization (i.e. no AHRS) doesn't trigger a watchdog reset

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2140 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
peabody124 2010-11-23 17:13:42 +00:00 committed by peabody124
parent fadb00860a
commit d2b468d661
2 changed files with 10 additions and 8 deletions

View File

@ -140,15 +140,15 @@ static void actuatorTask(void* parameters)
// Main task loop
lastSysTime = xTaskGetTickCount();
while (1)
{
{
actuator_updated = 1;
// Wait until the ActuatorDesired object is updated, if a timeout then go to failsafe
if ( xQueueReceive(queue, &ev, FAILSAFE_TIMEOUT_MS / portTICK_RATE_MS) != pdTRUE )
{
setFailsafe();
continue;
}
actuator_updated = 1;
// Check how long since last update
thisSysTime = xTaskGetTickCount();

View File

@ -127,14 +127,16 @@ static void stabilizationTask(void* parameters)
lastSysTime = xTaskGetTickCount();
ZeroPids();
while(1) {
stabilization_updated = 1;
// Wait until the ActuatorDesired object is updated, if a timeout then go to failsafe
if ( xQueueReceive(queue, &ev, FAILSAFE_TIMEOUT_MS / portTICK_RATE_MS) != pdTRUE )
{
AlarmsSet(SYSTEMALARMS_ALARM_STABILIZATION,SYSTEMALARMS_ALARM_WARNING);
}
continue;
}
stabilization_updated = 1;
// Check how long since last update
thisSysTime = xTaskGetTickCount();
if(thisSysTime > lastSysTime) // reuse dt in case of wraparound
@ -222,9 +224,9 @@ static void stabilizationTask(void* parameters)
{
ZeroPids();
}
// Clear alarms
AlarmsClear(SYSTEMALARMS_ALARM_STABILIZATION);
AlarmsClear(SYSTEMALARMS_ALARM_STABILIZATION);
}
}