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

AHRS Comms: Send FirmwareIAP object to AHRS so that it can be remotely

rebooted.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2214 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
peabody124 2010-12-10 21:03:29 +00:00 committed by peabody124
parent 7d70d1f9f2
commit f30aa1d719
3 changed files with 19 additions and 3 deletions

View File

@ -76,6 +76,7 @@ void altitude_callback(AhrsObjHandle obj);
void calibration_callback(AhrsObjHandle obj); void calibration_callback(AhrsObjHandle obj);
void gps_callback(AhrsObjHandle obj); void gps_callback(AhrsObjHandle obj);
void settings_callback(AhrsObjHandle obj); void settings_callback(AhrsObjHandle obj);
void firmwareiapobj_callback(AhrsObjHandle obj);
/** /**
* @addtogroup AHRS_Global_Data AHRS Global Data * @addtogroup AHRS_Global_Data AHRS Global Data
@ -492,6 +493,7 @@ for all data to be up to date before doing anything*/
BaroAltitudeConnectCallback(altitude_callback); BaroAltitudeConnectCallback(altitude_callback);
AHRSSettingsConnectCallback(settings_callback); AHRSSettingsConnectCallback(settings_callback);
HomeLocationConnectCallback(homelocation_callback); HomeLocationConnectCallback(homelocation_callback);
FirmwareIAPObjConnectCallback(firmwareiapobj_callback);
calibration_callback(AHRSCalibrationHandle()); //force an update calibration_callback(AHRSCalibrationHandle()); //force an update
@ -995,6 +997,15 @@ void homelocation_callback(AhrsObjHandle obj)
INSSetMagNorth(Be); INSSetMagNorth(Be);
} }
void firmwareiapobj_callback(AhrsObjHandle obj)
{
FirmwareIAPObjData firmwareIAPObj;
FirmwareIAPObjGet(&firmwareIAPObj);
// float time = timer_counter() / timer_rate();
}
/** /**
* @} * @}

View File

@ -37,6 +37,7 @@ static PositionActualData PositionActual;
static VelocityActualData VelocityActual; static VelocityActualData VelocityActual;
static HomeLocationData HomeLocation; static HomeLocationData HomeLocation;
static AHRSSettingsData AHRSSettings; static AHRSSettingsData AHRSSettings;
static FirmwareIAPObjData FirmwareIAPObj;
AhrsSharedObject objectHandles[MAX_AHRS_OBJECTS]; AhrsSharedObject objectHandles[MAX_AHRS_OBJECTS];
@ -60,8 +61,9 @@ CREATEHANDLE(6, PositionActual);
CREATEHANDLE(7, VelocityActual); CREATEHANDLE(7, VelocityActual);
CREATEHANDLE(8, HomeLocation); CREATEHANDLE(8, HomeLocation);
CREATEHANDLE(9, AHRSSettings); CREATEHANDLE(9, AHRSSettings);
CREATEHANDLE(10, FirmwareIAPObj);
#if 10 != MAX_AHRS_OBJECTS //sanity check #if 11 != MAX_AHRS_OBJECTS //sanity check
#error We did not create the correct number of xxxHandle() functions #error We did not create the correct number of xxxHandle() functions
#endif #endif
@ -101,6 +103,7 @@ void AhrsInitHandles(void)
ADDHANDLE(idx++, VelocityActual); ADDHANDLE(idx++, VelocityActual);
ADDHANDLE(idx++, HomeLocation); ADDHANDLE(idx++, HomeLocation);
ADDHANDLE(idx++, AHRSSettings); ADDHANDLE(idx++, AHRSSettings);
ADDHANDLE(idx++, FirmwareIAPObj);
if (idx != MAX_AHRS_OBJECTS) { if (idx != MAX_AHRS_OBJECTS) {
PIOS_DEBUG_Assert(0); PIOS_DEBUG_Assert(0);
} }
@ -113,7 +116,7 @@ void AhrsInitHandles(void)
GPSPositionConnectCallback(ObjectUpdatedCb); GPSPositionConnectCallback(ObjectUpdatedCb);
HomeLocationConnectCallback(ObjectUpdatedCb); HomeLocationConnectCallback(ObjectUpdatedCb);
AHRSCalibrationConnectCallback(ObjectUpdatedCb); AHRSCalibrationConnectCallback(ObjectUpdatedCb);
FirmwareIAPObjConnectCallback(ObjectUpdatedCb);
#endif #endif
} }

View File

@ -37,6 +37,7 @@
#include "homelocation.h" #include "homelocation.h"
#include "ahrscalibration.h" #include "ahrscalibration.h"
#include "ahrssettings.h" #include "ahrssettings.h"
#include "firmwareiapobj.h"
/** union that will fit any UAVObject. /** union that will fit any UAVObject.
*/ */
@ -52,11 +53,12 @@ typedef union {
VelocityActualData VelocityActual; VelocityActualData VelocityActual;
HomeLocationData HomeLocation; HomeLocationData HomeLocation;
AHRSSettingsData AHRSSettings; AHRSSettingsData AHRSSettings;
FirmwareIAPObjData FirmwareIAPObj;
} __attribute__ ((packed)) AhrsSharedData; } __attribute__ ((packed)) AhrsSharedData;
/** The number of UAVObjects we will be dealing with. /** The number of UAVObjects we will be dealing with.
*/ */
#define MAX_AHRS_OBJECTS 10 #define MAX_AHRS_OBJECTS 11
/** Our own version of a UAVObject. /** Our own version of a UAVObject.
*/ */