mirror of https://github.com/ArduPilot/ardupilot
Common: use PACKED instead of pragma pack for Location
This commit is contained in:
parent
954e10b26f
commit
865a4de33d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue