mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-28 17:54:15 +01:00
OP-1743 - Fix a very ugly error in attitude(cc/cc3d)
This commit is contained in:
parent
1cdc00d285
commit
84465ae0cb
@ -178,8 +178,9 @@ int32_t AttitudeStart(void)
|
|||||||
// Start main task
|
// Start main task
|
||||||
xTaskCreate(AttitudeTask, "Attitude", STACK_SIZE_BYTES / 4, NULL, TASK_PRIORITY, &taskHandle);
|
xTaskCreate(AttitudeTask, "Attitude", STACK_SIZE_BYTES / 4, NULL, TASK_PRIORITY, &taskHandle);
|
||||||
PIOS_TASK_MONITOR_RegisterTask(TASKINFO_RUNNING_ATTITUDE, taskHandle);
|
PIOS_TASK_MONITOR_RegisterTask(TASKINFO_RUNNING_ATTITUDE, taskHandle);
|
||||||
|
#ifdef PIOS_INCLUDE_WDG
|
||||||
PIOS_WDG_RegisterFlag(PIOS_WDG_ATTITUDE);
|
PIOS_WDG_RegisterFlag(PIOS_WDG_ATTITUDE);
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -253,7 +254,9 @@ static void AttitudeTask(__attribute__((unused)) void *parameters)
|
|||||||
// Set critical error and wait until the accel is producing data
|
// Set critical error and wait until the accel is producing data
|
||||||
while (PIOS_ADXL345_FifoElements() == 0) {
|
while (PIOS_ADXL345_FifoElements() == 0) {
|
||||||
AlarmsSet(SYSTEMALARMS_ALARM_ATTITUDE, SYSTEMALARMS_ALARM_CRITICAL);
|
AlarmsSet(SYSTEMALARMS_ALARM_ATTITUDE, SYSTEMALARMS_ALARM_CRITICAL);
|
||||||
|
#ifdef PIOS_INCLUDE_WDG
|
||||||
PIOS_WDG_UpdateFlag(PIOS_WDG_ATTITUDE);
|
PIOS_WDG_UpdateFlag(PIOS_WDG_ATTITUDE);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
accel_test = PIOS_ADXL345_Test();
|
accel_test = PIOS_ADXL345_Test();
|
||||||
#endif
|
#endif
|
||||||
@ -310,9 +313,9 @@ static void AttitudeTask(__attribute__((unused)) void *parameters)
|
|||||||
}
|
}
|
||||||
init = 1;
|
init = 1;
|
||||||
}
|
}
|
||||||
|
#ifdef PIOS_INCLUDE_WDG
|
||||||
PIOS_WDG_UpdateFlag(PIOS_WDG_ATTITUDE);
|
PIOS_WDG_UpdateFlag(PIOS_WDG_ATTITUDE);
|
||||||
|
#endif
|
||||||
AccelStateData accelState;
|
AccelStateData accelState;
|
||||||
GyroStateData gyros;
|
GyroStateData gyros;
|
||||||
int32_t retval = 0;
|
int32_t retval = 0;
|
||||||
@ -487,7 +490,7 @@ static int32_t updateSensorsCC3D(AccelStateData *accelStateData, GyroStateData *
|
|||||||
|
|
||||||
count++;
|
count++;
|
||||||
// check if further samples are already in queue
|
// 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);
|
PERF_TRACK_VALUE(counterAccelSamples, count);
|
||||||
|
|
||||||
|
@ -241,8 +241,10 @@ void PIOS_Board_Init(void)
|
|||||||
HwSettingsInitialize();
|
HwSettingsInitialize();
|
||||||
|
|
||||||
#ifndef ERASE_FLASH
|
#ifndef ERASE_FLASH
|
||||||
|
#ifdef PIOS_INCLUDE_WDG
|
||||||
/* Initialize watchdog as early as possible to catch faults during init */
|
/* Initialize watchdog as early as possible to catch faults during init */
|
||||||
PIOS_WDG_Init();
|
PIOS_WDG_Init();
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Initialize the alarms library */
|
/* Initialize the alarms library */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user