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

LP-73 finish the merge with next

This commit is contained in:
Cliff Geerdes 2015-10-24 13:14:52 -04:00
parent 04e3bbd4ce
commit d5bdc41fb9
2 changed files with 13 additions and 15 deletions

View File

@ -940,9 +940,22 @@ void PIOS_Board_Init(void)
PIOS_ADC_Init(&pios_adc_cfg);
#endif
#ifdef PIOS_INCLUDE_WDG
// give HMC5x83 on I2C some extra time to allow for reset, etc. if needed
// this is not in a loop, so it is safe
// leave this here even if PIOS_INCLUDE_HMC5X83 is undefined
// to avoid making something else fail when HMC5X83 is removed
PIOS_WDG_Clear();
#endif /* PIOS_INCLUDE_WDG */
#if defined(PIOS_INCLUDE_HMC5X83)
// attach the 5x83 mag to the previously inited I2C1
onboard_mag = PIOS_HMC5x83_Init(&pios_hmc5x83_internal_cfg, pios_i2c_mag_adapter_id, 0);
#ifdef PIOS_INCLUDE_WDG
// give HMC5x83 on I2C some extra time to allow for reset, etc. if needed
// this is not in a loop, so it is safe
PIOS_WDG_Clear();
#endif /* PIOS_INCLUDE_WDG */
// add this sensor to the sensor task's list
PIOS_HMC5x83_Register(onboard_mag, PIOS_SENSORS_TYPE_3AXIS_MAG);
#endif

View File

@ -245,13 +245,6 @@ void ConfigRevoWidget::storeAndClearBoardRotation()
// Store current aux mag board rotation
AuxMagSettings *auxMagSettings = AuxMagSettings::GetInstance(getObjectManager());
Q_ASSERT(auxMagSettings);
<<<<<<< HEAD
AuxMagSettings::DataFields auxMagData = auxMagSettings->getData();
auxMagStoredBoardRotation = auxMagData.Orientation;
// Set aux mag board rotation to no rotation
auxMagData.Orientation = 0.0f;
=======
AuxMagSettings::DataFields auxMagData = auxMagSettings->getData();
auxMagStoredBoardRotation[AuxMagSettings::BOARDROTATION_YAW] = auxMagData.BoardRotation[AuxMagSettings::BOARDROTATION_YAW];
auxMagStoredBoardRotation[AuxMagSettings::BOARDROTATION_ROLL] = auxMagData.BoardRotation[AuxMagSettings::BOARDROTATION_ROLL];
@ -261,7 +254,6 @@ void ConfigRevoWidget::storeAndClearBoardRotation()
auxMagData.BoardRotation[AuxMagSettings::BOARDROTATION_YAW] = 0;
auxMagData.BoardRotation[AuxMagSettings::BOARDROTATION_ROLL] = 0;
auxMagData.BoardRotation[AuxMagSettings::BOARDROTATION_PITCH] = 0;
>>>>>>> 2c030f1... LP-73 fix V9 calibration bug and convert BoardRotation to int
auxMagSettings->setData(auxMagData);
}
}
@ -281,20 +273,13 @@ void ConfigRevoWidget::recallBoardRotation()
data.BoardRotation[AttitudeSettings::BOARDROTATION_PITCH] = storedBoardRotation[AttitudeSettings::BOARDROTATION_PITCH];
attitudeSettings->setData(data);
<<<<<<< HEAD
// Restore the aux mag board rotation
AuxMagSettings *auxMagSettings = AuxMagSettings::GetInstance(getObjectManager());
Q_ASSERT(auxMagSettings);
AuxMagSettings::DataFields auxMagData = auxMagSettings->getData();
auxMagData.Orientation = auxMagStoredBoardRotation;
=======
AuxMagSettings *auxMagSettings = AuxMagSettings::GetInstance(getObjectManager());
Q_ASSERT(auxMagSettings);
AuxMagSettings::DataFields auxMagData = auxMagSettings->getData();
auxMagData.BoardRotation[AuxMagSettings::BOARDROTATION_YAW] = auxMagStoredBoardRotation[AuxMagSettings::BOARDROTATION_YAW];
auxMagData.BoardRotation[AuxMagSettings::BOARDROTATION_ROLL] = auxMagStoredBoardRotation[AuxMagSettings::BOARDROTATION_ROLL];
auxMagData.BoardRotation[AuxMagSettings::BOARDROTATION_PITCH] = auxMagStoredBoardRotation[AuxMagSettings::BOARDROTATION_PITCH];
>>>>>>> 2c030f1... LP-73 fix V9 calibration bug and convert BoardRotation to int
auxMagSettings->setData(auxMagData);
}
}