diff --git a/radio/src/definitions.h b/radio/src/definitions.h index df5bb4165..20d8e5352 100644 --- a/radio/src/definitions.h +++ b/radio/src/definitions.h @@ -21,8 +21,11 @@ #ifndef _DEFINITIONS_H_ #define _DEFINITIONS_H_ -#if defined(SIMU) - #define __ALIGNED +#if defined(SIMU) && __GNUC__ + #define __ALIGNED __attribute__((aligned(32))) + #define __SECTION_USED(s) __attribute__((used)) +#elif defined(SIMU) + #define __ALIGNED #define __SECTION_USED(s) #else #define __ALIGNED __attribute__((aligned(32))) diff --git a/radio/src/maths.cpp b/radio/src/maths.cpp index f1244b1af..b93aaa3e1 100644 --- a/radio/src/maths.cpp +++ b/radio/src/maths.cpp @@ -138,6 +138,11 @@ void extractLatitudeLongitude(uint32_t * latitude, uint32_t * longitude) *longitude = ((uint32_t)(qr.quot) * 1000000) + (((uint32_t)(qr.rem) * 10000 + telemetryData.hub.gpsLongitude_ap) * 5) / 3; } +#if __clang__ +// clang does not like packed member access at all. Since mavlink is a 3rd party library, ignore the errors +#pragma clang diagnostic push +#pragma clang diagnostic warning "-Waddress-of-packed-member" +#endif void getGpsPilotPosition() { extractLatitudeLongitude(&telemetryData.hub.pilotLatitude, &telemetryData.hub.pilotLongitude);