Mercurial > public > hwos_code
comparison src/compass.h @ 604:ca4556fb60b9
bump to 2.99beta, work on 3.00 stable
author | heinrichsweikamp |
---|---|
date | Thu, 22 Nov 2018 19:47:26 +0100 |
parents | 7d9edd3b8c86 |
children | c40025d8e750 |
comparison
equal
deleted
inserted
replaced
603:00b24fb4324d | 604:ca4556fb60b9 |
---|---|
3 // 2013-03-29 [jDG] Creation for tests. | 3 // 2013-03-29 [jDG] Creation for tests. |
4 | 4 |
5 //---- Storage classes ------------------------------------------------------- | 5 //---- Storage classes ------------------------------------------------------- |
6 // Declaring PIC18 and VC++/G++ functions. | 6 // Declaring PIC18 and VC++/G++ functions. |
7 #ifdef UNIX | 7 #ifdef UNIX |
8 # define PARAMETER | 8 # define PARAMETER |
9 # define OVERLAY | 9 # define OVERLAY |
10 #else | 10 #else |
11 //---- Bank 9 parameters ----------------------------------------------------- | 11 //---- Bank 9 parameters ----------------------------------------------------- |
12 # pragma udata overlay bank9_compass = 0x900 | 12 # pragma udata overlay bank9_compass = 0x900 |
13 # define PARAMETER static | 13 # define PARAMETER static |
14 # define OVERLAY overlay | 14 # define OVERLAY overlay |
15 #endif | 15 #endif |
16 | 16 |
17 ////////////////////////////////////////////////////////////////////////////// | 17 ////////////////////////////////////////////////////////////////////////////// |
18 | 18 |
19 #define Q_PI (18000) | 19 #define Q_PI (18000) |
20 #define Q_PIO2 (9000) | 20 #define Q_PIO2 (9000) |
21 | 21 |
22 typedef short int Int16; | 22 typedef short int Int16; |
23 typedef signed char Int8; | 23 typedef signed char Int8; |
24 typedef Int16 Angle; | 24 typedef Int16 Angle; |
25 | 25 |
26 // The (filtered) components of the magnetometer sensor: | 26 // The (filtered) components of the magnetometer sensor: |
27 extern Int16 compass_DX_f; | 27 extern Int16 compass_DX_f; |
28 extern Int16 compass_DY_f; | 28 extern Int16 compass_DY_f; |
29 extern Int16 compass_DZ_f; | 29 extern Int16 compass_DZ_f; |
47 extern Int16 imul(PARAMETER Int16 a, PARAMETER Int16 b); | 47 extern Int16 imul(PARAMETER Int16 a, PARAMETER Int16 b); |
48 extern Int16 udiv(PARAMETER Int16 a, PARAMETER Int16 b); | 48 extern Int16 udiv(PARAMETER Int16 a, PARAMETER Int16 b); |
49 extern Angle utan(PARAMETER Int16 a, PARAMETER Int16 b); | 49 extern Angle utan(PARAMETER Int16 a, PARAMETER Int16 b); |
50 extern Angle itan(PARAMETER Int16 a, PARAMETER Int16 b); | 50 extern Angle itan(PARAMETER Int16 a, PARAMETER Int16 b); |
51 extern Angle cosxh(PARAMETER Int16 a, PARAMETER Int16 b); | 51 extern Angle cosxh(PARAMETER Int16 a, PARAMETER Int16 b); |
52 extern void sincos(PARAMETER Int16 a, PARAMETER Int16 b, Int16* sin, Int16* cos); | 52 |
53 extern void sincos(PARAMETER Int16 a, PARAMETER Int16 b, Int16* sin, Int16* cos); | |
53 | 54 |
54 ////////////////////////////////////////////////////////////////////////////// | 55 ////////////////////////////////////////////////////////////////////////////// |
55 // The user functions | 56 // The user functions |
56 extern void compass(void); | 57 extern void compass(void); |
57 extern void compass_reset_calibration(void); | 58 extern void compass_reset_calibration(void); |
58 extern void compass_add_calibration(void); | 59 extern void compass_add_calibration(void); |
59 | |
60 extern void compass_solve_calibration(void); | 60 extern void compass_solve_calibration(void); |