AP_GPS: pragma pack is needed on ARM

we rely on GPS data structures having byte alignment. Luckily GCC can
cope with this.
This commit is contained in:
Andrew Tridgell 2013-01-04 19:39:15 +11:00
parent 741174f5d5
commit 3bfff4bd6d
5 changed files with 11 additions and 10 deletions

View File

@ -25,7 +25,7 @@ public:
static bool _detect(uint8_t );
private:
// XXX this is being ignored by the compiler #pragma pack(1)
#pragma pack(push,1)
struct diyd_mtk_msg {
int32_t latitude;
int32_t longitude;
@ -36,7 +36,7 @@ private:
uint8_t fix_type;
uint32_t utc_time;
};
// #pragma pack(pop)
#pragma pack(pop)
enum diyd_mtk_fix_type {
FIX_NONE = 1,
FIX_2D = 2,

View File

@ -24,7 +24,7 @@ public:
static bool _detect(uint8_t );
private:
// XXX this is being ignored by the compiler #pragma pack(1)
#pragma pack(push,1)
struct diyd_mtk_msg {
int32_t latitude;
int32_t longitude;
@ -37,7 +37,7 @@ private:
uint32_t utc_time;
uint16_t hdop;
};
// #pragma pack(pop)
#pragma pack(pop)
enum diyd_mtk_fix_type {
FIX_NONE = 1,
FIX_2D = 2,

View File

@ -28,7 +28,7 @@ public:
static bool _detect(uint8_t );
private:
// XXX this is being ignored by the compiler #pragma pack(1)
#pragma pack(push,1)
struct diyd_mtk_msg {
int32_t latitude;
int32_t longitude;
@ -41,7 +41,7 @@ private:
uint32_t utc_time;
uint16_t hdop;
};
// #pragma pack(pop)
#pragma pack(pop)
enum diyd_mtk_fix_type {
FIX_NONE = 1,
FIX_2D = 2,

View File

@ -23,7 +23,7 @@ public:
static bool _detect(uint8_t data);
private:
// XXX this is being ignored by the compiler #pragma pack(1)
#pragma pack(push,1)
struct sirf_geonav {
uint16_t fix_invalid;
uint16_t fix_type;
@ -61,7 +61,7 @@ private:
uint8_t hdop;
uint8_t mode_info;
};
// #pragma pack(pop)
#pragma pack(pop)
enum sirf_protocol_bytes {
PREAMBLE1 = 0xa0,
PREAMBLE2 = 0xa2,

View File

@ -39,7 +39,7 @@ public:
private:
// u-blox UBX protocol essentials
// XXX this is being ignored by the compiler #pragma pack(1)
#pragma pack(push,1)
struct ubx_header {
uint8_t preamble1;
uint8_t preamble2;
@ -124,7 +124,8 @@ private:
uint32_t speed_accuracy;
uint32_t heading_accuracy;
};
// // #pragma pack(pop)
#pragma pack(pop)
enum ubs_protocol_bytes {
PREAMBLE1 = 0xb5,
PREAMBLE2 = 0x62,