summaryrefslogtreecommitdiffstats
path: root/librns510.c
diff options
context:
space:
mode:
authorroot <root@no.no.james.local>2015-04-23 20:11:27 +0100
committerroot <root@no.no.james.local>2015-04-23 20:11:27 +0100
commitf57d1e76da88ebd729e4ef882fe621c35c72218c (patch)
treef2db4a709c535c7d0d6eb5c750a7a9c21cec1d82 /librns510.c
parentf70af808abd0dc6136c2faf11720f2dfac1082e9 (diff)
downloadpython-f57d1e76da88ebd729e4ef882fe621c35c72218c.tar.gz
python-f57d1e76da88ebd729e4ef882fe621c35c72218c.tar.bz2
python-f57d1e76da88ebd729e4ef882fe621c35c72218c.zip
fish
Diffstat (limited to 'librns510.c')
-rw-r--r--librns510.c28
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)