Merge remote-tracking branch 'origin/master' into mmosca-mavlinkrc
[inav.git] / src / main / common / olc.h
blobce243eb87689c27966c603b372dd7c9063293f0e
1 #pragma once
3 #include <stddef.h>
4 #include <stdint.h>
6 #define OLC_DEG_MULTIPLIER ((olc_coord_t)10000000LL) // 1e7
8 typedef int32_t olc_coord_t;
9 typedef uint32_t uolc_coord_t;
11 // olc_encodes the given coordinates in lat and lon (deg * OLC_DEG_MULTIPLIER)
12 // as an OLC code of the given length. It returns the number of characters
13 // written to buf.
14 int olc_encode(olc_coord_t lat, olc_coord_t lon, size_t length, char *buf, size_t bufsize);