annotate src/shared_definitions.h @ 644:1e695355dfc4

Merge
author heinrichsweikamp
date Mon, 24 May 2021 18:41:51 +0200
parents 185ba2f91f59
children bc214815deb2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 #ifdef xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
heinrichsweikamp
parents:
diff changeset
2 ;
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
3 ; shared_definitions.h combined next generation V3.08.8
0
heinrichsweikamp
parents:
diff changeset
4 ;
heinrichsweikamp
parents:
diff changeset
5 ; Declare variables used both in C and ASM code
heinrichsweikamp
parents:
diff changeset
6 ;
heinrichsweikamp
parents:
diff changeset
7 ; This program is free software: you can redistribute it and/or modify
heinrichsweikamp
parents:
diff changeset
8 ; it under the terms of the GNU General Public License as published by
heinrichsweikamp
parents:
diff changeset
9 ; the Free Software Foundation, either version 3 of the License, or
heinrichsweikamp
parents:
diff changeset
10 ; (at your option) any later version.
heinrichsweikamp
parents:
diff changeset
11 ;
heinrichsweikamp
parents:
diff changeset
12 ; This program is distributed in the hope that it will be useful,
heinrichsweikamp
parents:
diff changeset
13 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
heinrichsweikamp
parents:
diff changeset
14 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
heinrichsweikamp
parents:
diff changeset
15 ; GNU General Public License for more details.
heinrichsweikamp
parents:
diff changeset
16 ;
heinrichsweikamp
parents:
diff changeset
17 ; You should have received a copy of the GNU General Public License
heinrichsweikamp
parents:
diff changeset
18 ; along with this program. If not, see <http://www.gnu.org/licenses/>.
heinrichsweikamp
parents:
diff changeset
19 ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
20 ; Copyright (c) 2010, JD Gascuel
0
heinrichsweikamp
parents:
diff changeset
21 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
22 ; RATIONAL
heinrichsweikamp
parents:
diff changeset
23 ;
heinrichsweikamp
parents:
diff changeset
24 ; We must enforce good data passing between the C and the ASM parts of code.
heinrichsweikamp
parents:
diff changeset
25 ; The previous design used two independant definitions of each variable,
heinrichsweikamp
parents:
diff changeset
26 ; one in C, one in ASM. If they did not match, no error was generated, and
heinrichsweikamp
parents:
diff changeset
27 ; anything can happend at runtime...
heinrichsweikamp
parents:
diff changeset
28 ;
heinrichsweikamp
parents:
diff changeset
29 ; The new design use LINKING to ensure the variables defined in C are at the
heinrichsweikamp
parents:
diff changeset
30 ; same address when used in ASM code. And it uses a unique declaration file
heinrichsweikamp
parents:
diff changeset
31 ; (with suitable macros) to make sure they have the same size in both language.
heinrichsweikamp
parents:
diff changeset
32 ;
heinrichsweikamp
parents:
diff changeset
33 ; HISTORY
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
34 ; 2011-01-20: [jDG] Creation
0
heinrichsweikamp
parents:
diff changeset
35 ;
heinrichsweikamp
parents:
diff changeset
36 ; NOTE
heinrichsweikamp
parents:
diff changeset
37 ;
heinrichsweikamp
parents:
diff changeset
38 ; This file have to obey both ASM and C syntax. The only common directives
heinrichsweikamp
parents:
diff changeset
39 ; are #if/#ifdef/#endif and the #define, so they are eavily used to do the
heinrichsweikamp
parents:
diff changeset
40 ; trick.
heinrichsweikamp
parents:
diff changeset
41 ;
heinrichsweikamp
parents:
diff changeset
42 ; BUGS
heinrichsweikamp
parents:
diff changeset
43 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
44 ; HISTORY
heinrichsweikamp
parents:
diff changeset
45 #endif
heinrichsweikamp
parents:
diff changeset
46
heinrichsweikamp
parents:
diff changeset
47 #ifdef __18CXX
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
48 //------------------------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
49 // C-Style Declarations:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
50 # ifndef TEST_MAIN
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
51 # define VAR_UCHAR(n) extern unsigned char n
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
52 # define TAB_UCHAR(n,size) extern unsigned char n[size]
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
53 # define VAR_UINT(n) extern unsigned short n
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
54 # define TAB_UINT(n,size) extern unsigned short n[size]
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
55 # else
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
56 # define VAR_UCHAR(n) unsigned char n
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
57 # define TAB_UCHAR(n,size) unsigned char n[size]
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
58 # define VAR_UINT(n) unsigned short n
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
59 # define TAB_UINT(n,size) unsigned short n[size]
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
60 # endif
0
heinrichsweikamp
parents:
diff changeset
61 #else
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
62 ;-------------------------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
63 ; ASM-Style Declarations:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
64 #define VAR_UCHAR(n) n res 1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
65 #define TAB_UCHAR(n,size) n res size
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
66 #define VAR_UINT(n) n res 2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
67 #define TAB_UINT(n,size) n res 2*size
0
heinrichsweikamp
parents:
diff changeset
68 #endif
heinrichsweikamp
parents:
diff changeset
69
210
7dbc1d780ca5 do not clear char_O_deco_gas in copy_deco_table
heinrichsweikamp
parents: 126
diff changeset
70
0
heinrichsweikamp
parents:
diff changeset
71 #ifdef xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
72 Define Model Dimensions
0
heinrichsweikamp
parents:
diff changeset
73 NUM_COMP is the number of compartiments in the Bühlmann ZH-L16 model, ie 16.
heinrichsweikamp
parents:
diff changeset
74 NUM_STOPS is the maximum number of stops computed by decoplanning.
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 521
diff changeset
75 Note that the deepest stop is roughly limited to 3m * NUM_STOPS
0
heinrichsweikamp
parents:
diff changeset
76 (this is assuming all stops up to the surface are used).
heinrichsweikamp
parents:
diff changeset
77 Note also that if the table overflow, extra stops are ignored,
heinrichsweikamp
parents:
diff changeset
78 and not reported in TTS summing.
heinrichsweikamp
parents:
diff changeset
79 NUM_GAS is the number of (potentially) active gas considered during
heinrichsweikamp
parents:
diff changeset
80 ascent simulation.
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
81 NUM_SP is the number of setpoints
0
heinrichsweikamp
parents:
diff changeset
82 #endif
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
83 #define NUM_COMP 0x10
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
84 #define NUM_STOPS 0x20
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
85 #define NUM_STOPS_LOG 0x0F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
86 #define NUM_GAS 5
0
heinrichsweikamp
parents:
diff changeset
87
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 521
diff changeset
88
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 521
diff changeset
89 #ifdef __18CXX
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
90 //---- BANK 3 DATA -------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
91 // Gather all Data C-Code --> ASM-Code
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
92 //
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
93 // Attention: keep the first block of variables on position and also do not change
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
94 // their relative position - this block goes into the deco data vault!
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
95 //
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
96 // Memory usage: 253 Byte used, 3 Byte free
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 521
diff changeset
97 # pragma udata overlay bank3=0x300
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 521
diff changeset
98 #else
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
99 ; in ASM, put the same bank, in overlay mode, at the same address
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
100 bank3 equ 0x300
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
101 bank3 udata_ovr bank3
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 521
diff changeset
102 #endif
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 521
diff changeset
103
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
104 VAR_UINT (int_O_desaturation_time); // || time until tissues desaturated to 5% remains, in minutes
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
105 VAR_UINT (int_O_nofly_time); // || altitude / no-fly waiting time time in minutes
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
106 VAR_UINT (int_O_CNS_current); // || current CNS %
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
107 VAR_UINT (int_O_lead_supersat); // || supersaturation of the leading tissue in %, 100% = on M-line of straight Buhlmann
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
108 VAR_UCHAR (char_O_lead_tissue); // || number of the leading tissue
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
109
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 521
diff changeset
110
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
111 VAR_UINT (int_O_TTS_norm); // total time to surface (TTS) in normal plan in minutes
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
112 VAR_UINT (int_O_TTS_alt); // total time to surface (TTS) in alternative plan in minutes
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
113
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
114 VAR_UINT (int_O_TST_norm); // total time of all deco stops in normal plan in minutes
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
115 VAR_UINT (int_O_TST_alt); // total time of all deco stops in alternative plan in minutes
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
116
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
117 VAR_UINT (int_O_CNS_norm); // CNS% at end of dive in normal dive plan
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
118 VAR_UINT (int_O_CNS_alt); // CNS% at end of dive in alternative plan
0
heinrichsweikamp
parents:
diff changeset
119
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
120 VAR_UINT (int_O_NDL_norm); // remaining NDL time for the normal dive plan in minutes
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
121 VAR_UINT (int_O_NDL_alt); // remaining NDL time for the alternative dive plan in minutes
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 521
diff changeset
122
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
123 VAR_UCHAR (char_O_main_status); // setup of the deco engine regarding the real tissue computations
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
124 VAR_UCHAR (char_O_deco_status); // setup of the deco engine regarding the decompression computations
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
125 VAR_UCHAR (char_O_deco_warnings); // vector of warnings generated by the deco engine
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
126 VAR_UCHAR (char_O_deco_info); // vector of infos generated by the deco engine
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 521
diff changeset
127
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
128 VAR_UINT (int_O_EAD_pres); // equivalent air depth (EAD) of breathed gas as relative pressure in[mbar]
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
129 VAR_UINT (int_O_END_pres); // equivalent narcosis depth (END) of breathed gas as relative pressure in[mbar]
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 521
diff changeset
130
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
131 TAB_UCHAR (char_O_tissue_pres_N2, NUM_COMP); // N2 tissue pressures for display purpose
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
132 TAB_UCHAR (char_O_tissue_pres_He, NUM_COMP); // He tissue pressures for display purpose
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
133 TAB_UCHAR (char_O_tissue_pressure, NUM_COMP); // total tissue pressures for display purpose
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
134 TAB_UCHAR (char_O_tissue_saturation, NUM_COMP); // tissue saturations for display purpose
0
heinrichsweikamp
parents:
diff changeset
135
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
136 TAB_UINT (int_O_gas_need_vol, NUM_GAS); // gas volumes needed for ascent in liters
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
137 TAB_UINT (int_O_gas_need_pres, NUM_GAS); // gas volumes needed for ascent in bar as per tank size
0
heinrichsweikamp
parents:
diff changeset
138
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
139 VAR_UINT (int_O_ceiling); // ascent boundary in mbar relative pressure, calculated at GF-high
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
140
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
141 VAR_UINT (int_O_breathed_ppO2); // ppO2 actually breathed (= int_O_pure_ppO2 if in OC)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 521
diff changeset
142
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
143 VAR_UINT (int_O_O2_ppO2); // ppO2 of pure O2 at current depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
144 VAR_UINT (int_O_pure_ppO2); // ppO2 of the current gas or diluent if breathed pure
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
145 VAR_UINT (int_O_pSCR_ppO2); // ppO2 calculated in pSCR loop
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
146
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
147 TAB_UINT (int_O_pressure_need, 2); // pressure reading, need by deco calculations, in 0.1 bar
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
148 VAR_UINT (int_O_SAC_measured); // measured SAC rate in 0.1 liter/minute
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
149
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
150 VAR_UCHAR (char_O_depth_sim); // depth reached in deco calculation, used in deco calculator to show progress
0
heinrichsweikamp
parents:
diff changeset
151
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
152 VAR_UINT (int_I_pres_respiration); // absolute pressure breathed
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
153 VAR_UINT (int_I_pres_surface); // absolute pressure at surface
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 521
diff changeset
154
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
155 VAR_UCHAR (char_I_current_gas_num); // number of gas currently breathed (1..5 for configured gases, 6 for the manual gas)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
156 VAR_UCHAR (char_I_current_gas_type); // type of current gas: (0=Disabled), 1=First, 2=Travel/Normal, 3=Deco/-
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
157 VAR_UCHAR (char_I_He_ratio); // helium ratio of the currently breathed gas
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
158 VAR_UCHAR (char_I_O2_ratio); // oxygen ratio of the currently breathed gas
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 521
diff changeset
159
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
160 VAR_UCHAR (char_I_saturation_multiplier); // safety factor, 100 = no conservatism, 150 = 50% faster saturation
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
161 VAR_UCHAR (char_I_desaturation_multiplier); // safety factor, 100 = no conservatism, 66 = 50% slower desaturation
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 521
diff changeset
162
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
163 VAR_UCHAR (char_I_GF_High_percentage); // GF model high value
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
164 VAR_UCHAR (char_I_GF_Low_percentage); // GF model low value
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 521
diff changeset
165
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
166 VAR_UCHAR (char_I_last_stop_depth); // depth of the last deco stop in meters
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 521
diff changeset
167
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
168 VAR_UCHAR (char_I_model); // deco model selection: 0 = ZH-L16, 1 = ZH-L16-GF (with gradient factors)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 521
diff changeset
169
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
170 VAR_UCHAR (char_I_bottom_depth); // bottom depth for deco calculator and simulator
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
171 VAR_UCHAR (char_I_bottom_time); // bottom time for deco calculator
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 521
diff changeset
172
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
173 VAR_UCHAR (char_I_dive_interval); // duration of surface break before next dive in minutes, used in simulation
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
174 VAR_UCHAR (char_I_sim_advance_time); // 'fast forward' of dive time, used in simulation (+5 min function)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
175 VAR_UCHAR (char_I_extra_time); // extra bottom time for fTTs and delayed ascent calculation in minutes
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 521
diff changeset
176
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
177 VAR_UCHAR (char_I_const_ppO2); // ppO2 reported from sensors or selected setpoint
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 521
diff changeset
178
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
179 TAB_UCHAR (char_I_deco_O2_ratio, NUM_GAS); // oxygen ratios of the configured gases, used for deco calc. | ATTENTION: do not change the
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
180 TAB_UCHAR (char_I_deco_He_ratio, NUM_GAS); // helium ratios of the configured gases, used for deco calc. | position of these
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
181 TAB_UCHAR (char_I_deco_gas_type, NUM_GAS); // type of the configured gases, used for deco calc. | arrays relative to
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
182 TAB_UCHAR (char_I_deco_gas_change,NUM_GAS); // change depths of the configured gases, used for deco calc. | each other!
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 521
diff changeset
183
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
184 TAB_UCHAR (char_I_gas_avail_size, NUM_GAS * 2); // tank sizes, used for pressure needs and SAC calculations
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
185 TAB_UCHAR (char_I_gas_avail_pres, NUM_GAS * 2); // tank pressures available (in multiples of 10 bar), used to generate warnings
0
heinrichsweikamp
parents:
diff changeset
186
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
187 VAR_UCHAR (char_I_CC_max_frac_O2); // limiter for maximum O2% in loop
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
188 VAR_UCHAR (char_I_PSCR_drop); // pSCR parameter drop [%]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
189 VAR_UCHAR (char_I_PSCR_lungratio); // pSCR parameter lung ratio [1/x]
0
heinrichsweikamp
parents:
diff changeset
190
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
191 VAR_UCHAR (char_I_altitude_wait); // selector for altitude / no-fly waiting time calculation
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 521
diff changeset
192
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
193 VAR_UCHAR (char_I_SAC_work); // gas consumption during bottom part and initial ascent in liters/minute
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
194 VAR_UCHAR (char_I_SAC_deco); // gas consumption during deco stops and following ascents in liters/minute
0
heinrichsweikamp
parents:
diff changeset
195
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
196 VAR_UCHAR (char_I_gas6_depth); // change depth (MOD) of the manually configured gas in meters
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
197
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
198 VAR_UCHAR (char_I_ppO2_max_work); // warning threshold for maximum ppO2 during working phase of the dive
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
199 VAR_UCHAR (char_I_ppO2_max_deco); // warning threshold for maximum ppO2 during deco phase of the dive
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
200 VAR_UCHAR (char_I_ppO2_min); // warning threshold for maximum ppO2 when breathing OC
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
201 VAR_UCHAR (char_I_ppO2_min_loop); // warning threshold for maximum ppO2 when breathing from CCR or pSCR
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
202
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
203 VAR_UCHAR (char_I_descent_speed); // descent speed in meters/minute
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
204 VAR_UCHAR (char_I_gas_change_time); // extra time spent during a stop for doing a gas change, in minutes
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
205
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
206 VAR_UCHAR (char_I_SAC_mode); // SAC calculation mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
207 VAR_UCHAR (char_I_max_pres_diff); // maximum pressure difference for independent double mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
208
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
209 TAB_UINT (int_IO_pressure_value,2); // pressure reading, measured pressure, in 0.1 bar | ATTENTION: do not change the position
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
210 TAB_UINT (int_I_pressure_drop, 2); // pressure reading, average pressure drop, in 1/160 bar/sec | of these arrays relative to each other!
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
211
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
212 TAB_UCHAR (char_I_pressure_gas, 2); // pressure reading, associated gas (1-5) / diluent (6-10), 0 if off
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
213 TAB_UCHAR (char_I_pressure_age, 2); // pressure reading, age of data
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
214 TAB_UCHAR (char_I_pressure_stat,2); // pressure reading, transmitter status data
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
215
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
216 TAB_UCHAR (char_O_deco_time_for_log, NUM_STOPS_LOG); // times of the shallowest NUM_STOPS_LOG deco stops
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
217
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
218 VAR_UINT (int_O_profiling_overrun); // current scheduling overrun in ms
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
219 VAR_UINT (int_O_profiling_overrun_max); // maximum scheduling overrun in ms
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
220 VAR_UCHAR (char_O_profiling_overrun_phase); // calculation phase causing the maximum overrun
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
221 VAR_UCHAR (char_O_profiling_runs_norm); // runs per cycle for normal plan
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
222 VAR_UCHAR (char_O_profiling_runs_alt); // runs per cycle for alternative plan
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
223
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
224 VAR_UINT (int_O_tank_pressure); // tank pressure for logging in [bar]
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
225 VAR_UINT (int_O_gas_density); // gas density of currently breathed mix in multiples of 0.01 grams per liter
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
226
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
227 VAR_UCHAR (char_I_backtrack_index); // pointer to next writing position in the char_I_backtrack_storage array
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
228
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
229 VAR_UCHAR (char_I_gas_density_att); // threshold for gas density attention [0.1 grams/l]
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
230 VAR_UCHAR (char_I_gas_density_warn); // threshold for gas density warning [0.1 grams/l]
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
231
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
232 VAR_UCHAR (char_I_dil_check); // =1: check ppO2 of the pure diluent against current setpoint
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
233
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
234
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
235 #ifdef __18CXX
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
236 //---- BANK 4 DATA -------------------------------------------------------
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
237 // Gather all Data ASM-Code --> C-Code
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
238 // Memory usage: 96 Byte used, 160 byte free
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
239 # pragma udata overlay bank4=0x400
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
240 #else
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
241 ; in ASM, put the same bank, in overlay mode, at the same address
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
242 bank4 equ 0x400
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
243 bank4 udata_ovr bank4
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
244 #endif
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
245
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
246 TAB_UCHAR (char_O_deco_depth, NUM_STOPS); // stops table: depth, ... | ATTENTION: do not re-arrange these
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
247 TAB_UCHAR (char_O_deco_time, NUM_STOPS); // ... duration, and | three arrays relative
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
248 TAB_UCHAR (char_O_deco_gas, NUM_STOPS); // ... gas breathed | to each other!
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
249
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
250
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
251 #ifdef __18CXX
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
252 //---- BANK 11 DATA -------------------------------------------------------
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
253 // Backtracking Data ASM-Code --> C-Code
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
254 // Memory usage: 256 Byte used, 0 byte free
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
255 # pragma udata overlay bank11=0xB00
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
256 #else
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
257 ; in ASM, put the same bank, in overlay mode, at the same address
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
258 bank11 udata_ovr 0xB00
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
259 #endif
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
260
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 628
diff changeset
261 TAB_UCHAR (char_I_backtrack_storage, 0x100); // recorded depths for backtracking in cave mode