mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +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:
parent
7d70d1f9f2
commit
f30aa1d719
@ -76,6 +76,7 @@ void altitude_callback(AhrsObjHandle obj);
|
||||
void calibration_callback(AhrsObjHandle obj);
|
||||
void gps_callback(AhrsObjHandle obj);
|
||||
void settings_callback(AhrsObjHandle obj);
|
||||
void firmwareiapobj_callback(AhrsObjHandle obj);
|
||||
|
||||
/**
|
||||
* @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);
|
||||
AHRSSettingsConnectCallback(settings_callback);
|
||||
HomeLocationConnectCallback(homelocation_callback);
|
||||
FirmwareIAPObjConnectCallback(firmwareiapobj_callback);
|
||||
|
||||
calibration_callback(AHRSCalibrationHandle()); //force an update
|
||||
|
||||
@ -995,6 +997,15 @@ void homelocation_callback(AhrsObjHandle obj)
|
||||
INSSetMagNorth(Be);
|
||||
}
|
||||
|
||||
void firmwareiapobj_callback(AhrsObjHandle obj)
|
||||
{
|
||||
FirmwareIAPObjData firmwareIAPObj;
|
||||
FirmwareIAPObjGet(&firmwareIAPObj);
|
||||
|
||||
// float time = timer_counter() / timer_rate();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
@ -37,6 +37,7 @@ static PositionActualData PositionActual;
|
||||
static VelocityActualData VelocityActual;
|
||||
static HomeLocationData HomeLocation;
|
||||
static AHRSSettingsData AHRSSettings;
|
||||
static FirmwareIAPObjData FirmwareIAPObj;
|
||||
|
||||
AhrsSharedObject objectHandles[MAX_AHRS_OBJECTS];
|
||||
|
||||
@ -60,8 +61,9 @@ CREATEHANDLE(6, PositionActual);
|
||||
CREATEHANDLE(7, VelocityActual);
|
||||
CREATEHANDLE(8, HomeLocation);
|
||||
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
|
||||
#endif
|
||||
|
||||
@ -101,6 +103,7 @@ void AhrsInitHandles(void)
|
||||
ADDHANDLE(idx++, VelocityActual);
|
||||
ADDHANDLE(idx++, HomeLocation);
|
||||
ADDHANDLE(idx++, AHRSSettings);
|
||||
ADDHANDLE(idx++, FirmwareIAPObj);
|
||||
if (idx != MAX_AHRS_OBJECTS) {
|
||||
PIOS_DEBUG_Assert(0);
|
||||
}
|
||||
@ -113,7 +116,7 @@ void AhrsInitHandles(void)
|
||||
GPSPositionConnectCallback(ObjectUpdatedCb);
|
||||
HomeLocationConnectCallback(ObjectUpdatedCb);
|
||||
AHRSCalibrationConnectCallback(ObjectUpdatedCb);
|
||||
|
||||
FirmwareIAPObjConnectCallback(ObjectUpdatedCb);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "homelocation.h"
|
||||
#include "ahrscalibration.h"
|
||||
#include "ahrssettings.h"
|
||||
#include "firmwareiapobj.h"
|
||||
|
||||
/** union that will fit any UAVObject.
|
||||
*/
|
||||
@ -52,11 +53,12 @@ typedef union {
|
||||
VelocityActualData VelocityActual;
|
||||
HomeLocationData HomeLocation;
|
||||
AHRSSettingsData AHRSSettings;
|
||||
FirmwareIAPObjData FirmwareIAPObj;
|
||||
} __attribute__ ((packed)) AhrsSharedData;
|
||||
|
||||
/** 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.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user