1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-17 02:52:12 +01:00

firmware: disable Attitude module in simulation

this part should be rewritten to completely disable the polling of sensors.
i just do not know how to do it correctly.
This commit is contained in:
Dmitry Zaitsev 2012-03-10 06:02:23 +04:00
parent 933dfa8609
commit d45e88515b

View File

@ -246,7 +246,11 @@ static int8_t updateSensors(AttitudeRawData * attitudeRaw)
AlarmsSet(SYSTEMALARMS_ALARM_ATTITUDE, SYSTEMALARMS_ALARM_ERROR);
return -1;
}
// for simulation
if (AttitudeRawReadOnly() == ACCESS_READONLY)
return 0;
// No accel data available
if(PIOS_ADXL345_FifoElements() == 0)
return -1;
@ -329,6 +333,10 @@ static int8_t updateSensors(AttitudeRawData * attitudeRaw)
static void updateAttitude(AttitudeRawData * attitudeRaw)
{
// for simulation
if (AttitudeActualReadOnly() == ACCESS_READONLY)
return;
float dT;
portTickType thisSysTime = xTaskGetTickCount();
static portTickType lastSysTime = 0;