1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-31 16:52:10 +01:00

OP-1743 - Fix a very ugly error in attitude(cc/cc3d)

This commit is contained in:
Alessio Morale 2015-02-24 22:02:25 +01:00
parent 1cdc00d285
commit 84465ae0cb
2 changed files with 9 additions and 4 deletions

View File

@ -178,8 +178,9 @@ int32_t AttitudeStart(void)
// Start main task
xTaskCreate(AttitudeTask, "Attitude", STACK_SIZE_BYTES / 4, NULL, TASK_PRIORITY, &taskHandle);
PIOS_TASK_MONITOR_RegisterTask(TASKINFO_RUNNING_ATTITUDE, taskHandle);
#ifdef PIOS_INCLUDE_WDG
PIOS_WDG_RegisterFlag(PIOS_WDG_ATTITUDE);
#endif
return 0;
}
@ -253,7 +254,9 @@ static void AttitudeTask(__attribute__((unused)) void *parameters)
// Set critical error and wait until the accel is producing data
while (PIOS_ADXL345_FifoElements() == 0) {
AlarmsSet(SYSTEMALARMS_ALARM_ATTITUDE, SYSTEMALARMS_ALARM_CRITICAL);
#ifdef PIOS_INCLUDE_WDG
PIOS_WDG_UpdateFlag(PIOS_WDG_ATTITUDE);
#endif
}
accel_test = PIOS_ADXL345_Test();
#endif
@ -310,9 +313,9 @@ static void AttitudeTask(__attribute__((unused)) void *parameters)
}
init = 1;
}
#ifdef PIOS_INCLUDE_WDG
PIOS_WDG_UpdateFlag(PIOS_WDG_ATTITUDE);
#endif
AccelStateData accelState;
GyroStateData gyros;
int32_t retval = 0;
@ -487,7 +490,7 @@ static int32_t updateSensorsCC3D(AccelStateData *accelStateData, GyroStateData *
count++;
// check if further samples are already in queue
ret = xQueueReceive(queue, (void *)&mpu6000_data, 0);
ret = xQueueReceive(queue, (void *)mpu6000_data, 0);
}
PERF_TRACK_VALUE(counterAccelSamples, count);

View File

@ -241,8 +241,10 @@ void PIOS_Board_Init(void)
HwSettingsInitialize();
#ifndef ERASE_FLASH
#ifdef PIOS_INCLUDE_WDG
/* Initialize watchdog as early as possible to catch faults during init */
PIOS_WDG_Init();
#endif
#endif
/* Initialize the alarms library */