From d5bdc41fb96b85f262a236494e96501425eb5246 Mon Sep 17 00:00:00 2001 From: Cliff Geerdes Date: Sat, 24 Oct 2015 13:14:52 -0400 Subject: [PATCH] LP-73 finish the merge with next --- .../boards/revoproto/firmware/pios_board.c | 13 +++++++++++++ .../gcs/src/plugins/config/configrevowidget.cpp | 15 --------------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/flight/targets/boards/revoproto/firmware/pios_board.c b/flight/targets/boards/revoproto/firmware/pios_board.c index 69b60f0c2..1135faf12 100644 --- a/flight/targets/boards/revoproto/firmware/pios_board.c +++ b/flight/targets/boards/revoproto/firmware/pios_board.c @@ -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 diff --git a/ground/gcs/src/plugins/config/configrevowidget.cpp b/ground/gcs/src/plugins/config/configrevowidget.cpp index efa13e620..b247ff202 100644 --- a/ground/gcs/src/plugins/config/configrevowidget.cpp +++ b/ground/gcs/src/plugins/config/configrevowidget.cpp @@ -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); } }