Common: use PACKED instead of pragma pack for Location

This commit is contained in:
Randy Mackay 2014-03-17 14:14:23 +09:00
parent 954e10b26f
commit 865a4de33d
1 changed files with 2 additions and 4 deletions

View File

@ -90,14 +90,13 @@
#define LOCATION_MASK_OPTIONS_RELATIVE_ALT (1<<0) // 1 = Relative altitude
#define LOCATION_MASK_OPTIONS_LOITER_DIRECTION (1<<2) // 0 = CW, 1 = CCW
#pragma pack(push,1)
struct Location_Option_Flags {
struct PACKED Location_Option_Flags {
uint8_t relative_alt : 1; // 1 if altitude is relateive to home
uint8_t unused1 : 1; // unused flag (defined so that loiter_ccw uses the correct bit)
uint8_t loiter_ccw : 1; // 0 if clockwise, 1 if counter clockwise
};
struct Location {
struct PACKED Location {
union {
Location_Option_Flags flags; ///< options bitmask (1<<0 = relative altitude)
uint8_t options; /// allows writing all flags to eeprom as one byte
@ -106,7 +105,6 @@ struct Location {
int32_t lat; ///< param 3 - Lattitude * 10**7
int32_t lng; ///< param 4 - Longitude * 10**7
};
#pragma pack(pop)
struct PACKED RallyLocation {
int32_t lat; //Latitude * 10^7