annotate code_part1/OSTC_code_c_part2/p2_definitions.h @ 294:4e43476b5a63

Menu3 marker bugbix
author Heinrichsweikamp
date Tue, 26 Apr 2011 18:57:50 +0200
parents ade0848c8b8b
children a99073445c18
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
116
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
1 // *********************************************************
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
2 // ** Common definitions for the OSTC decompression code **
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
3 // *********************************************************
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
4
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
5 //////////////////////////////////////////////////////////////////////////////
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
6 // OSTC - diving computer code
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
7 // Copyright (C) 2008 HeinrichsWeikamp GbR
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
8 //
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
9 // This program is free software: you can redistribute it and/or modify
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
10 // it under the terms of the GNU General Public License as published by
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
11 // the Free Software Foundation, either version 3 of the License, or
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
12 // (at your option) any later version.
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
13 //
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
14 // This program is distributed in the hope that it will be useful,
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
17 // GNU General Public License for more details.
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
18 //
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
19 // You should have received a copy of the GNU General Public License
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
20 // along with this program. If not, see <http://www.gnu.org/licenses/>.
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
21 //
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
22 //////////////////////////////////////////////////////////////////////////////
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
23 // history:
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
24 // 12/25/10 v110: [jDG] split in three files (deco.c, main.c, definitions.h)
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
25
184
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
26 #define DBG_c_gas 0x0001
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
27 #define DBG_c_ppO2 0x0002
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
28 #define DBG_RUN 0x0004
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
29 #define DBG_RESTART 0x0008
116
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
30
184
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
31 #define DBG_CdeSAT 0x0010
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
32 #define DBG_C_MODE 0x0020
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
33 #define DBG_C_SURF 0x0040
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
34 #define DBG_HEwoHE 0x0080
116
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
35
184
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
36 #define DBG_C_DPPO2 0x0100
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
37 #define DBG_C_DGAS 0x0200
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
38 #define DBG_C_DIST 0x0400
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
39 #define DBG_C_LAST 0x0800
116
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
40
184
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
41 #define DBG_C_GF 0x1000
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
42 #define DBG_ZH16ERR 0x2000
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
43 #define DBG_PHIGH 0x4000
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
44 #define DBG_PLOW 0x8000
116
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
45
184
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
46 #define DBS_mode 0x0001
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
47 #define DBS_ppO2 0x0002
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
48 #define DBS_HE_sat 0x0004
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
49 #define DBS_ppO2chg 0x0008
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
50
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
51 #define DBS_SAT2l 0x0010
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
52 #define DBS_SAT2h 0x0020
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
53 #define DBS_GFLOW2l 0x0040
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
54 #define DBS_GFLOW2h 0x0080
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
55
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
56 #define DBS_GFHGH2l 0x0100
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
57 #define DBS_GFHGH2h 0x0200
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
58 #define DBS_GASO22l 0x0400
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
59 #define DBS_GASO22h 0x0800
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
60
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
61 #define DBS_DIST2h 0x1000
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
62 #define DBS_LAST2h 0x2000
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
63 #define DBS_DECOO2l 0x4000
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
64 #define DBS_DECOO2h 0x8000
116
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
65
184
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
66 #define DBS2_PRES2h 0x0001
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
67 #define DBS2_PRES2l 0x0002
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
68 #define DBS2_SURF2l 0x0004
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
69 #define DBS2_SURF2h 0x0008
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
70
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
71 #define DBS2_DESAT2l 0x0010
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
72 #define DBS2_DESAT2h 0x0020
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
73 #define DBS2_GFDneg 0x0040
116
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
74
184
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
75 #define MBAR_REACH_GASCHANGE_AUTO_CHANGE_OFF 150
116
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
76
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
77 // *************************
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
78 // ** P R O T O T Y P E S **
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
79 // *************************
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
80
167
cb055a7d75f3 + Use overlay local vars.
JeanDo
parents: 163
diff changeset
81 extern void calc_percentage(void);
cb055a7d75f3 + Use overlay local vars.
JeanDo
parents: 163
diff changeset
82 extern void deco_calc_hauptroutine(void);
cb055a7d75f3 + Use overlay local vars.
JeanDo
parents: 163
diff changeset
83 extern void deco_clear_tissue(void);
cb055a7d75f3 + Use overlay local vars.
JeanDo
parents: 163
diff changeset
84 extern void deco_calc_percentage(void);
cb055a7d75f3 + Use overlay local vars.
JeanDo
parents: 163
diff changeset
85 extern void deco_calc_wo_deco_step_1_min(void);
cb055a7d75f3 + Use overlay local vars.
JeanDo
parents: 163
diff changeset
86 extern void deco_debug(void);
cb055a7d75f3 + Use overlay local vars.
JeanDo
parents: 163
diff changeset
87 extern void deco_gradient_array(void);
cb055a7d75f3 + Use overlay local vars.
JeanDo
parents: 163
diff changeset
88 extern void deco_hash(void);
cb055a7d75f3 + Use overlay local vars.
JeanDo
parents: 163
diff changeset
89 extern void deco_calc_desaturation_time(void);
cb055a7d75f3 + Use overlay local vars.
JeanDo
parents: 163
diff changeset
90 extern void deco_calc_CNS_fraction(void);
cb055a7d75f3 + Use overlay local vars.
JeanDo
parents: 163
diff changeset
91 extern void deco_clear_CNS_fraction(void);
cb055a7d75f3 + Use overlay local vars.
JeanDo
parents: 163
diff changeset
92 extern void deco_push_tissues_to_vault(void);
cb055a7d75f3 + Use overlay local vars.
JeanDo
parents: 163
diff changeset
93 extern void deco_pull_tissues_from_vault(void);
222
638f8e17bd51 Prototyping deco_gas_volumes() to compute gas consumption per tank with decoplanning.
JeanDo
parents: 200
diff changeset
94 extern void deco_gas_volumes(void);
116
14a074e1a375 Split C code, and use direct linking.
JeanDo
parents:
diff changeset
95
184
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
96 // ***********************************************
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
97 // ** Allow compile on VisualC **
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
98 // ***********************************************
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
99
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
100 #ifdef WIN32
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
101 // Some keywords just dont exists on Visual C++:
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
102 # define CROSS_COMPILE
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
103 # define __18CXX
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
104 # define ram
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
105 # define rom
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
106 # define overlay
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
107 # define PARAMETER
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
108
192
c8816e4bc724 GF Model
JeanDo
parents: 184
diff changeset
109 #include <assert.h>
c8816e4bc724 GF Model
JeanDo
parents: 184
diff changeset
110
184
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
111 // Avoid warnings about float/double mismatches:
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
112 # pragma warning(disable: 4244 4068 4305)
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
113 #else
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
114 # define PARAMETER static
235
ade0848c8b8b New runtime asserts when compiled in DEBUG more.
JeanDo
parents: 222
diff changeset
115 # ifdef __DEBUG
ade0848c8b8b New runtime asserts when compiled in DEBUG more.
JeanDo
parents: 222
diff changeset
116 # define assert(predicate) if( !(predicate) ) assert_failed(__LINE__)
ade0848c8b8b New runtime asserts when compiled in DEBUG more.
JeanDo
parents: 222
diff changeset
117 # else
ade0848c8b8b New runtime asserts when compiled in DEBUG more.
JeanDo
parents: 222
diff changeset
118 # define assert(predicate)
ade0848c8b8b New runtime asserts when compiled in DEBUG more.
JeanDo
parents: 222
diff changeset
119 # endif
184
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
120 #endif
016c45a0caaf Enable to compile p2_deco.c on other platforms.
JeanDo
parents: 167
diff changeset
121
167
cb055a7d75f3 + Use overlay local vars.
JeanDo
parents: 163
diff changeset
122 //////////////////////////////////////////////////////////////////////////////