mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-22 12: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:
parent
fadb00860a
commit
d2b468d661
@ -141,6 +141,8 @@ static void actuatorTask(void* parameters)
|
|||||||
lastSysTime = xTaskGetTickCount();
|
lastSysTime = xTaskGetTickCount();
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
actuator_updated = 1;
|
||||||
|
|
||||||
// Wait until the ActuatorDesired object is updated, if a timeout then go to failsafe
|
// 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 )
|
if ( xQueueReceive(queue, &ev, FAILSAFE_TIMEOUT_MS / portTICK_RATE_MS) != pdTRUE )
|
||||||
{
|
{
|
||||||
@ -148,8 +150,6 @@ static void actuatorTask(void* parameters)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
actuator_updated = 1;
|
|
||||||
|
|
||||||
// Check how long since last update
|
// Check how long since last update
|
||||||
thisSysTime = xTaskGetTickCount();
|
thisSysTime = xTaskGetTickCount();
|
||||||
if(thisSysTime > lastSysTime) // reuse dt in case of wraparound
|
if(thisSysTime > lastSysTime) // reuse dt in case of wraparound
|
||||||
|
@ -127,14 +127,16 @@ static void stabilizationTask(void* parameters)
|
|||||||
lastSysTime = xTaskGetTickCount();
|
lastSysTime = xTaskGetTickCount();
|
||||||
ZeroPids();
|
ZeroPids();
|
||||||
while(1) {
|
while(1) {
|
||||||
|
|
||||||
|
stabilization_updated = 1;
|
||||||
|
|
||||||
// Wait until the ActuatorDesired object is updated, if a timeout then go to failsafe
|
// 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 )
|
if ( xQueueReceive(queue, &ev, FAILSAFE_TIMEOUT_MS / portTICK_RATE_MS) != pdTRUE )
|
||||||
{
|
{
|
||||||
AlarmsSet(SYSTEMALARMS_ALARM_STABILIZATION,SYSTEMALARMS_ALARM_WARNING);
|
AlarmsSet(SYSTEMALARMS_ALARM_STABILIZATION,SYSTEMALARMS_ALARM_WARNING);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
stabilization_updated = 1;
|
|
||||||
|
|
||||||
// Check how long since last update
|
// Check how long since last update
|
||||||
thisSysTime = xTaskGetTickCount();
|
thisSysTime = xTaskGetTickCount();
|
||||||
if(thisSysTime > lastSysTime) // reuse dt in case of wraparound
|
if(thisSysTime > lastSysTime) // reuse dt in case of wraparound
|
||||||
|
Loading…
x
Reference in New Issue
Block a user