diff --git a/flight/Modules/Attitude/revolution/attitude.c b/flight/Modules/Attitude/revolution/attitude.c index 425abdb60..18bc20630 100644 --- a/flight/Modules/Attitude/revolution/attitude.c +++ b/flight/Modules/Attitude/revolution/attitude.c @@ -269,14 +269,20 @@ static int32_t updateAttitudeComplimentary(bool first_run) FlightStatusData flightStatus; FlightStatusGet(&flightStatus); if(first_run) { +#if defined(PIOS_INCLUDE_HMC5883) // To initialize we need a valid mag reading if ( xQueueReceive(magQueue, &ev, 0 / portTICK_RATE_MS) != pdTRUE ) return -1; - - AttitudeActualData attitudeActual; - AttitudeActualGet(&attitudeActual); MagnetometerData magData; MagnetometerGet(&magData); +#else + MagnetometerData magData; + magData.x = 100; + magData.y = 0; + magData.z = 0; +#endif + AttitudeActualData attitudeActual; + AttitudeActualGet(&attitudeActual); init = 0; attitudeActual.Roll = atan2f(-accelsData.y, -accelsData.z) * 180.0f / F_PI; attitudeActual.Pitch = atan2f(accelsData.x, -accelsData.z) * 180.0f / F_PI; diff --git a/flight/Modules/Sensors/sensors.c b/flight/Modules/Sensors/sensors.c index c635d53bd..c854aa37a 100644 --- a/flight/Modules/Sensors/sensors.c +++ b/flight/Modules/Sensors/sensors.c @@ -194,6 +194,8 @@ static void SensorsTask(void *parameters) #if defined(PIOS_INCLUDE_HMC5883) mag_test = PIOS_HMC5883_Test(); +#else + mag_test = 0; #endif if(accel_test < 0 || gyro_test < 0 || mag_test < 0) { @@ -412,16 +414,7 @@ static void SensorsTask(void *parameters) PIOS_WDG_UpdateFlag(PIOS_WDG_SENSORS); - switch(bdinfo->board_rev) { - case 0x01: // L3GD20 + BMA180 board - lastSysTime = xTaskGetTickCount(); - break; - case 0x02: - vTaskDelayUntil(&lastSysTime, SENSOR_PERIOD / portTICK_RATE_MS); - break; - default: - PIOS_DEBUG_Assert(0); - } + lastSysTime = xTaskGetTickCount(); } } diff --git a/flight/Revolution/Makefile b/flight/Revolution/Makefile index f0470a590..2553004c4 100644 --- a/flight/Revolution/Makefile +++ b/flight/Revolution/Makefile @@ -49,7 +49,8 @@ endif FLASH_TOOL = OPENOCD # List of modules to include -MODULES = Sensors Attitude/revolution ManualControl Stabilization Altitude/revolution Actuator GPS FirmwareIAP +MODULES = Sensors Attitude/revolution ManualControl Stabilization Actuator +MODULES += Altitude/revolution GPS FirmwareIAP MODULES += AltitudeHold VtolPathFollower PathPlanner MODULES += CameraStab MODULES += OveroSync diff --git a/flight/Revolution/System/inc/pios_config.h b/flight/Revolution/System/inc/pios_config.h index 484b0ed60..7a82695fb 100644 --- a/flight/Revolution/System/inc/pios_config.h +++ b/flight/Revolution/System/inc/pios_config.h @@ -94,7 +94,7 @@ /* Flags that alter behaviors - mostly to lower resources for CC */ #define PIOS_INCLUDE_INITCALL /* Include init call structures */ #define PIOS_TELEM_PRIORITY_QUEUE /* Enable a priority queue in telemetry */ -#define PIOS_QUATERNION_STABILIZATION /* Stabilization options */ +//#define PIOS_QUATERNION_STABILIZATION /* Stabilization options */ #define PIOS_GPS_SETS_HOMELOCATION /* GPS options */ /* Alarm Thresholds */ diff --git a/flight/Revolution/System/pios_board.c b/flight/Revolution/System/pios_board.c index 2eaf5bbb8..67dfe5dad 100644 --- a/flight/Revolution/System/pios_board.c +++ b/flight/Revolution/System/pios_board.c @@ -174,7 +174,7 @@ static const struct pios_mpu6000_cfg pios_mpu6000_cfg = { .exti_cfg = &pios_exti_mpu6000_cfg, .Fifo_store = PIOS_MPU6000_FIFO_TEMP_OUT | PIOS_MPU6000_FIFO_GYRO_X_OUT | PIOS_MPU6000_FIFO_GYRO_Y_OUT | PIOS_MPU6000_FIFO_GYRO_Z_OUT, // Clock at 8 khz, downsampled by 8 for 1khz - .Smpl_rate_div = 7, + .Smpl_rate_div = 15, .interrupt_cfg = PIOS_MPU6000_INT_CLR_ANYRD, .interrupt_en = PIOS_MPU6000_INTEN_DATA_RDY, .User_ctl = PIOS_MPU6000_USERCTL_FIFO_EN | PIOS_MPU6000_USERCTL_DIS_I2C,