diff options
Diffstat (limited to 'librns510.c')
-rw-r--r-- | librns510.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/librns510.c b/librns510.c index 060c766..10b3794 100644 --- a/librns510.c +++ b/librns510.c @@ -1,16 +1,34 @@ -#include <stdint.h> -#include <byteswap.h> #include <stdio.h> -#include <string.h> + +#ifdef _MSC_VER +#include "stdint.h" +#include "inttypes.h" +#else +#include <stdint.h> +#include <inttypes.h> #include <strings.h> +#endif + +#include <string.h> #include <stdlib.h> -#include <inttypes.h> +#if 0 /*3rd party calibration */ #define POI_CA 0x80000034 /*0 */ #define POI_CB 0xF1C71CD4 /*160 */ -// + #define ZERO (POI_CA) #define SCALE (((double) (POI_CB-POI_CA))/160.) +#else /*From VW */ + +#define POI_CA 0x80b60b60 /*1*/ +#define POI_CB 0xff49f49f /*179*/ + +#define SCALE (((double) (POI_CB-POI_CA))/178.) +#define ONE (POI_CA) +#define ZERO (ONE - (uint32_t) (SCALE+.5)) + +#endif + static void fromz (int64_t a, double *lat, double *lon) |