28 #define PACKED __attribute__((__packed__)) 31 #define UNUSED_FUNCTION __attribute__((unused)) 34 #define OPTIMIZE(level) __attribute__((optimize(level))) 37 #define NOINLINE __attribute__((noinline)) 39 #define FMT_PRINTF(a,b) __attribute__((format(printf, a, b))) 40 #define FMT_SCANF(a,b) __attribute__((format(scanf, a, b))) 42 #ifdef __has_cpp_attribute 43 # if __has_cpp_attribute(fallthrough) 44 # define FALLTHROUGH [[fallthrough]] 45 # elif __has_cpp_attribute(gnu::fallthrough) 46 # define FALLTHROUGH [[gnu::fallthrough]] 53 #define ToRad(x) radians(x) // *pi/180 54 #define ToDeg(x) degrees(x) // *180/pi 58 #define DEFINE_BYTE_ARRAY_METHODS \ 59 inline uint8_t &operator[](size_t i) { return reinterpret_cast<uint8_t *>(this)[i]; } \ 60 inline uint8_t operator[](size_t i) const { return reinterpret_cast<const uint8_t *>(this)[i]; } 62 #define LOCATION_ALT_MAX_M 83000 // maximum altitude (in meters) that can be fit into Location structure's alt field 68 #define BIT_IS_SET(value, bitnumber) (((value) & (1U<<(bitnumber))) != 0) 71 #define LOWBYTE(i) ((uint8_t)(i)) 72 #define HIGHBYTE(i) ((uint8_t)(((uint16_t)(i))>>8)) 74 template <
typename T,
size_t N>
80 #define ARRAY_SIZE(_arr) sizeof(_ARRAY_SIZE_HELPER(_arr)) 83 #define ARRAY_SIZE_SIMPLE(_arr) (sizeof(_arr)/sizeof(_arr[0])) 92 #define _UNUSED_RESULT(uniq_, expr_) \ 94 decltype(expr_) uniq_ __attribute__((unused)); \ 104 #define UNUSED_RESULT(expr_) _UNUSED_RESULT(__unique_name_##__COUNTER__, expr_) 165 #if CONFIG_HAL_BOARD == HAL_BOARD_SITL 167 #define SITL_printf(fmt, args ...) do { ::printf("%s(%u): " fmt, __FILE__, __LINE__, ##args); } while(0) 169 #define SITL_printf(fmt, args ...)
char(& _ARRAY_SIZE_HELPER(T(&_arr)[N]))[N]
int32_t lat
param 3 - Latitude * 10**7
int32_t alt
param 2 - Altitude in centimeters (meters * 100) see LOCATION_ALT_MAX_M
bool is_bounded_int32(int32_t value, int32_t lower_bound, int32_t upper_bound)
Location_Option_Flags flags
options bitmask (1<<0 = relative altitude)
int32_t lng
param 4 - Longitude * 10**7