comparison src/hwos.inc @ 582:b455b31ce022

work on 2.97 stable
author heinrichsweikamp
date Mon, 26 Feb 2018 16:40:28 +0100
parents 1ab93aca7fa9
children e81cf407261a
comparison
equal deleted inserted replaced
581:f5de1ff88814 582:b455b31ce022
1 ;============================================================================= 1 ;=============================================================================
2 ; 2 ;
3 ; File hwos.inc REFACTORED VERSION V2.95a1 3 ; File hwos.inc REFACTORED VERSION V2.98
4 ; 4 ;
5 ; OSTC Platform definitions 5 ; OSTC Platform definitions
6 ; 6 ;
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. 7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
8 ;============================================================================= 8 ;=============================================================================
9 ; HISTORY 9 ; HISTORY
10 ; 2011-05-24 : [jDG] Cleanups from initial Matthias code. 10 ; 2011-05-24 : [jDG] Cleanups from initial Matthias code.
11 11
12 ;============================================================================= 12 ;=============================================================================
13 13
14 LIST P=18F87K22 ; change also: Configure->SelectDevice from Mplab 14 LIST P=18F87K22 ; change also: Configure->SelectDevice from Mplab
15 15
16 ;#DEFINE __DEBUG 16 ;#DEFINE __DEBUG
17 17
18 ;#DEFINE french_italian ; If defined, use french and italian instead of english and german 18 ;#DEFINE french_italian ; If defined, use french and italian instead of english and german
19 19
20 #include <p18f87k22.inc> 20 #include <p18f87k22.inc>
21 #include <ports.inc> ; Portmap 21 #include <ports.inc> ; Portmap
22 22
23 ; Firmware definition 23 ; Firmware definition
24 #DEFINE softwareversion_x d'2' ; Software version XX.YY 24 #DEFINE softwareversion_x .2 ; Software version XX.YY
25 #DEFINE softwareversion_y d'97' ; Software version XX.YY 25 #DEFINE softwareversion_y .97 ; Software version XX.YY
26 #DEFINE softwareversion_beta 0 ; (and 0 for release) 26 #DEFINE softwareversion_beta .0 ; (and 0 for release)
27 27
28 ; Firmware version will appear in "Change Firmware" style 28 ; Firmware version will appear in "Change Firmware" style
29 #DEFINE firmware_expire_year .18 29 #DEFINE firmware_expire_year .19
30 #DEFINE firmware_expire_month .2 30 #DEFINE firmware_expire_month .2
31 #DEFINE firmware_expire_day .22 31 #DEFINE firmware_expire_day .24
32 32
33 #DEFINE comm_service_key 0xABCDEF 33 #DEFINE comm_service_key 0xABCDEF
34 34
35 ;-----------------------------EEPROM DATA ------------------------------------
36 ; Automatic reset of all options when this is changed:
37 #define eeprom_opt_serial 0x0006 ; Version 0.6
35 ;----------------------------------------------------------------------------- 38 ;-----------------------------------------------------------------------------
36 39
37 #DEFINE CCP1CON_VALUE b'00001100' ; PWM1 for LED dimming 40 #DEFINE CCP1CON_VALUE b'00001100' ; PWM1 for LED dimming
38 #DEFINE T2CON_ECO b'00000100' ; 1:1 Postscaler, 1:1 Prescaler, Timer 2 start -> 980Hz (Good compromise of no-flicker and efficiency) 41 #DEFINE T2CON_ECO b'00000100' ; 1:1 Postscaler, 1:1 Prescaler, Timer 2 start -> 980Hz (Good compromise of no-flicker and efficiency)
39 #DEFINE T2CON_NORMAL b'00001110' 42 #DEFINE T2CON_NORMAL b'00001110'
40 #DEFINE T2CON_FASTEST b'00001110' ; 1:2 Postscaler, 1:16 Prescaler, Timer 2 start -> 1960Hz (no-flicker) 43 #DEFINE T2CON_FASTEST b'00001110' ; 1:2 Postscaler, 1:16 Prescaler, Timer 2 start -> 1960Hz (no-flicker)
41
42 #DEFINE TMR0H_VALUE .245 ; RX Timeout (~3ms)
43 44
44 ; Timing for button hold-down flags 45 ; Timing for button hold-down flags
45 #DEFINE TMR1H_VALUE_FIRST .255-.128 ; in steps of 7,8125ms -> 1s 46 #DEFINE TMR1H_VALUE_FIRST .255-.128 ; in steps of 7,8125ms -> 1s
46 #DEFINE TMR1H_VALUE_CONT .255-.32 ; in steps of 7,8125ms -> 0.25s 47 #DEFINE TMR1H_VALUE_CONT .255-.32 ; in steps of 7,8125ms -> 0.25s
47 #DEFINE TMR1H_VALUE_CONT_DIVE .255-.64 ; in steps of 7,8125ms -> 0.5s 48 #DEFINE TMR1H_VALUE_CONT_DIVE .255-.64 ; in steps of 7,8125ms -> 0.5s
48 49
49 ; Color Definitions: 8Bit RGB b'RRRGGGBB' 50 ; Color Definitions: 8Bit RGB b'RRRGGGBB'
50 #DEFINE color_red b'11100000' ; (7,0,0) 51 #DEFINE color_red b'11100000' ; (7,0,0)
51 #DEFINE color_dark_red b'10000101' ; (4,1,1) 52 #DEFINE color_dark_red b'10000101' ; (4,1,1)
52 #DEFINE color_violet b'11101011' ; (7,2,3) 53 #DEFINE color_violet b'11101011' ; (7,2,3)
53 #DEFINE color_blue b'11000111' ; (6,1,3) 54 #DEFINE color_blue b'11000111' ; (6,1,3)
54 #DEFINE color_green b'00011100' ; (0,7,0) 55 #DEFINE color_green b'00011100' ; (0,7,0)
55 #DEFINE color_greenish b'00111110' ; (1,7,2) 56 #DEFINE color_greenish b'00111110' ; (1,7,2)
56 #DEFINE color_dark_green b'00111001' ; (1,6,1) 57 #DEFINE color_dark_green b'00111001' ; (1,6,1)
57 #DEFINE color_yellow b'11111101' ; (7,7,1) 58 #DEFINE color_yellow b'11111101' ; (7,7,1)
58 #DEFINE color_white b'11111111' ; (7,7,3) 59 #DEFINE color_white b'11111111' ; (7,7,3)
59 #DEFINE color_black b'00000000' ; (0,0,0) 60 #DEFINE color_black b'00000000' ; (0,0,0)
60 #DEFINE color_deepblue b'00000010' ; (0,0,2) 61 #DEFINE color_deepblue b'00000010' ; (0,0,2)
61 #DEFINE color_grey b'11011111' ; (6,7,3) 62 #DEFINE color_grey b'11011111' ; (6,7,3)
62 #DEFINE color_cyan b'11011111' ; (6,7,3) 63 #DEFINE color_cyan b'11011111' ; (6,7,3)
63 #DEFINE color_lightblue b'11011011' ; (6,7,3) 64 #DEFINE color_lightblue b'11011011' ; (6,7,3)
64 #DEFINE color_orange b'11111000' ; (7,6,0) 65 #DEFINE color_orange b'11111000' ; (7,6,0)
65 #DEFINE color_pink b'11111010' ; (7,6,2) 66 #DEFINE color_pink b'11111010' ; (7,6,2)
66 67
67 #DEFINE FT_TINY .0 68 #DEFINE FT_TINY .0
68 #DEFINE FT_SMALL .1 69 #DEFINE FT_SMALL .1
69 #DEFINE FT_MEDIUM .2 70 #DEFINE FT_MEDIUM .2 ; not used
70 #DEFINE FT_LARGE .3 71 #DEFINE FT_LARGE .3 ; not used
71
72 #DEFINE warn_depth .1
73 #DEFINE warn_cns .2
74 #DEFINE warn_gf .3
75 #DEFINE warn_ppo2 .4
76 #DEFINE warn_ceiling .5
77 #DEFINE warn_gas_in_gaslist .6
78 #DEFINE warn_ppo2_hud .7
79 #DEFINE warn_battery .8
80 #DEFINE warn_stop .9
81 72
82 ; External O2 cell input parameters 73 ; External O2 cell input parameters
83 #DEFINE min_mv .80 ; = 8mV 74 #DEFINE min_mv .80 ; = 8mV
84 #DEFINE max_mv .2500 ; = 250mV 75 #DEFINE max_mv .2500 ; = 250mV
85 #DEFINE ignore_mv .3500 ; = 350mV (To suppress ghost readings for long, open cables) 76 #DEFINE ignore_mv .3500 ; = 350mV (to suppress ghost readings for long, open cables)
86 77
87 ; Profile recording parameters 78 ; Profile recording parameters
88 #DEFINE logbook_profile_version 0x24 79 #DEFINE logbook_profile_version 0x24
89 #DEFINE samplingrate_apnoe .1 ; [seconds] 80 #DEFINE samplingrate_apnoe .1 ; [seconds]
90 81
91 ; Warning: Divisors must be <.16 ! 82 ; Warning: Divisors must be <.16 !
92 #DEFINE div_temperature .6 ; x samplingrate [s] 83 #DEFINE div_temperature .6 ; x samplingrate [s]
93 #DEFINE div_deco .6 ; x samplingrate [s] 84 #DEFINE div_deco .6 ; x samplingrate [s]
94 #DEFINE div_gf .12 ; x samplingrate [s] 85 #DEFINE div_gf .12 ; x samplingrate [s]
95 #DEFINE div_ppo2_sensors .2 ; x samplingrate [s] 86 #DEFINE div_ppo2_sensors .2 ; x samplingrate [s]
96 #DEFINE div_decoplan .12 ; x samplingrate [s] 87 #DEFINE div_decoplan .12 ; x samplingrate [s]
97 #DEFINE div_cns .12 ; x samplingrate [s] 88 #DEFINE div_cns .12 ; x samplingrate [s]
98 #DEFINE div_tank .0 ; x samplingrate [s] 89 #DEFINE div_tank .0 ; x samplingrate [s]
99 90
100 ; Warning: Information lengths must be <.16 ! 91 ; Warning: Information lengths must be <.16 !
101 #DEFINE infolength_temperature .2 ; [byte] 92 #DEFINE infolength_temperature .2 ; [byte]
102 #DEFINE infolength_deco .2 ; [byte] 93 #DEFINE infolength_deco .2 ; [byte]
103 #DEFINE infolength_gf .1 ; [byte] 94 #DEFINE infolength_gf .1 ; [byte]
104 #DEFINE infolength_ppo2_sensors .9 ; [byte] 95 #DEFINE infolength_ppo2_sensors .9 ; [byte]
105 #DEFINE infolength_decoplan .15 ; [byte] 96 #DEFINE infolength_decoplan .15 ; [byte]
106 #DEFINE infolength_cns .2 ; [byte] 97 #DEFINE infolength_cns .2 ; [byte]
107 #DEFINE infolength_tank .0 ; [byte] 98 #DEFINE infolength_tank .0 ; [byte]
108 99
109 ; "Better Gas" behavior 100 ; "Better Gas" behavior
110 ; better_gas_window <= minimum_change_depth ! 101 ; better_gas_window <= minimum_change_depth !
111 ; minimum_change_depth >=5 ! 102 ; minimum_change_depth >=5 !
112 #DEFINE minimum_change_depth .3 ; [m] 103 #DEFINE minimum_change_depth .3 ; [m]
113 #DEFINE better_gas_window_neg .3 ; [m] (Depth above change depth) 104 #DEFINE better_gas_window_neg .3 ; [m] (Depth above change depth)
114 #DEFINE better_gas_window_pos .1 ; [m] (Depth below change depth, if ppO2<opt_ppO2_max) 105 #DEFINE better_gas_window_pos .1 ; [m] (Depth below change depth, if ppO2<opt_ppO2_max)
115 106
116 ; Dive mode limits and thresholds 107 ; Dive mode limits and thresholds
117 #DEFINE start_dive_threshold .100 ; [cm] 108 #DEFINE start_dive_threshold .100 ; [cm]
118 #DEFINE high_altitude_dive_threshold .300 ; [cm] 109 #DEFINE high_altitude_dive_threshold .300 ; [cm]
119 #DEFINE apnoe_timeout .15 ; [min] 110 #DEFINE apnoe_timeout .15 ; [min]
120 #DEFINE divemode_menuview_timeout .10 ; [s] 111 #DEFINE divemode_menuview_timeout .10 ; [s]
121 #DEFINE divemode_timeout_default .5 ; [min] 112 #DEFINE divemode_menu_timeout .30 ; [s]
122 #DEFINE divemode_menu_timeout .30 ; [s] 113
123 114 #DEFINE ppo2_warning_low_lowest .16 ; [cbar] (Min. value) for minimum on OC
124 #DEFINE ppo2_warning_low .19 ; [cbar] (Default value) 115 #DEFINE ppo2_warning_low_default .19 ; [cbar] (Default value) for minimum on OC
125 #DEFINE ppo2_lowest_setting .16 ; [cbar] (Minimum value) 116 #DEFINE ppo2_warning_low_highest .21 ; [cbar] (Max. value) for minimum on OC
126 ;#DEFINE ppo2_display_high .120 ; [cbar] ## V2.94 moved to p2_deco.c 117
127 #DEFINE ppo2_warning_high .160 ; [cbar] (Default value) for bottom/travel gases 118 #DEFINE ppo2_warning_loop_lowest .20 ; [cbar] (Min. value) for minimum on loop
128 #DEFINE ppo2_warning_high_deco .160 ; [cbar] (Default value) for deco gases 119 #DEFINE ppo2_warning_loop_default .40 ; [cbar] (Default Value) for minimum on loop
129 #DEFINE ppo2_highest_setting .160 ; [cbar] (Max. Value) for bottom/travel gases 120 #DEFINE ppo2_warning_loop_highest .60 ; [cbar] (Max. value) for minimum on loop
130 #DEFINE ppo2_highest_setting_deco .160 ; [cbar] (Max. Value) for deco gases 121
131 122 #DEFINE ppo2_warning_high_lowest .120 ; [cbar] (Min. value) for maximum in none-deco phase
132 ; NEW ## min ppO2 CC 123 #DEFINE ppo2_warning_high_default .140 ; [cbar] (Default value) for maximum in none-deco phase
133 #DEFINE ppo2_warning_low_cc .40 ; [cbar] Default value for loop 124 #DEFINE ppo2_warning_high_highest .160 ; [cbar] (Max. value) for maximum in none-deco phase
134 #DEFINE ppo2_warning_low_cc_min .20 ; [cbar] Default value for loop 125
135 #DEFINE ppo2_warning_low_cc_max .60 ; [cbar] Default value for loop 126 #DEFINE ppo2_warning_deco_lowest .120 ; [cbar] (Min. value) for maximum in deco phase
136 127 #DEFINE ppo2_warning_deco_default .160 ; [cbar] (Default Value) for maximum in deco phase
137 ;#DEFINE cns_display_high .70 ; [%] ## V2.94 moved to p2_deco.c 128 #DEFINE ppo2_warning_deco_highest .160 ; [cbar] (Max. value) for maximum in deco phase
138 ;#DEFINE cns_warning_high .100 ; [%] ## V2.94 moved to p2_deco.c 129
139 ;#DEFINE gf_display_high .75 ; [%] ## V2.94 moved to p2_deco.c 130 #DEFINE depth_warn_mbar .13000 ; [mbar]
140 ;#DEFINE gf_warning_high .100 ; [%] ## V2.94 moved to p2_deco.c 131 #DEFINE wake_up_from_sleep .1160 ; [mbar]
141 #DEFINE depth_warn_mbar .13000 ; [mbar] 132 #DEFINE simulator_timeout .15 ; [s]
142 #DEFINE wake_up_from_sleep .1160 ; [mbar] 133
143 #DEFINE gf_display_threshold .20 ; [%] 134 #DEFINE sensor_voting_logic_threshold .10 ; Threshold in 0.01bar
144 #DEFINE simulator_timeout .15 ; [s]
145
146 #DEFINE sensor_voting_logic_threshold .10 ; Threshold in 0.01bar
147 135
148 ; Surface mode limits and thresholds 136 ; Surface mode limits and thresholds
149 #DEFINE cns_display_surface_high .70 ; [%] 137 #DEFINE high_altitude_threshold .880 ; [mbar]
150 #DEFINE high_altitude_threshold .880 ; [mbar] 138 #DEFINE max_surfpressure .1080 ; [mbar]
151 #DEFINE max_surfpressure .1080 ; [mbar] 139 #DEFINE timeout_surfacemode .90 ; [s]
152 #DEFINE timeout_surfacemode .90 ; [s] 140 #DEFINE timeout_calibrate_menu .240 ; [s]
153 #DEFINE timeout_calibrate_menu .240 ; [s] 141 #DEFINE timeout_ccr_surface .240 ; [s]
154 #DEFINE timeout_ccr_surface .240 ; [s]
155 142
156 ; Decomodel paramters 143 ; Decomodel paramters
157 #DEFINE deco_distance .10 ; [dm] 144 #DEFINE deco_distance .10 ; [dm]
158 145
159 ; Color-code parameters for the divemode 146 ; Color-code parameters for the divemode
160 ;#DEFINE color_code_cns_high .100 ; [%] ## V2.94 moved to p2_deco.c 147 #DEFINE color_code_velocity_warn_high .11 ; [m/min]
161 ;#DEFINE color_code_gf_warn_high .101 ; [%] ## V2.94 moved to p2_deco.c 148 #DEFINE color_code_velocity_attn_high .10 ; [m/min]
162 #DEFINE color_code_velocity_warn_high .11 ;[m/min] 149 #DEFINE velocity_display_threshold_1 .3 ; [m/min]
163 #DEFINE color_code_velocity_attn_high .10 ;[m/min]
164
165 ; Velocity threshold
166 #DEFINE velocity_display_threshold_1 .3 ; [m/min]
167 150
168 ; Battery thresholds 151 ; Battery thresholds
169 #DEFINE lithium_36v_empty .2400 ; [mV] Saft 3,6V LS14500 AA - threshold for battery percent display 152 #DEFINE lithium_36v_empty .2400 ; [mV] Saft 3,6V LS14500 AA - threshold for battery percent display
170 #DEFINE lithium_36v_low .2000 ; [mV] (Must be bigger then aa_15v_high!) 153 #DEFINE lithium_36v_low .2000 ; [mV] (Must be bigger then aa_15v_high!)
171 #DEFINE aa_15v_high .1550 ; [mV] Energizer 1,5V E2 AA 154 #DEFINE aa_15v_high .1550 ; [mV] Energizer 1,5V E2 AA
172 #DEFINE aa_15v_low .1100 ; [mV] According to Energizer Datasheet EBC-4201R, Page 2 155 #DEFINE aa_15v_low .1100 ; [mV] According to Energizer Datasheet EBC-4201R, Page 2
173 #DEFINE color_code_battery_low .10 ; [%] 156 #DEFINE color_code_battery_low .10 ; [%]
174 #DEFINE battery_show_level .24 ; [%] 157 #DEFINE battery_show_level .24 ; [%]
175 158
176 ; 3,6V battery sensing data points at 70mA load 159 ; 3,6V battery sensing data points at 70mA load
177 #DEFINE lithium_36v_75 .3000 ; [mV] 160 #DEFINE lithium_36v_75 .3000 ; [mV]
178 #DEFINE lithium_36v_50 .2900 ; [mV] 161 #DEFINE lithium_36v_50 .2900 ; [mV]
179 #DEFINE lithium_36v_25 .2600 ; [mV] 162 #DEFINE lithium_36v_25 .2600 ; [mV]
180 #DEFINE lithium_36v_10 .2500 ; [mV] 163 #DEFINE lithium_36v_10 .2500 ; [mV]
181 164
182 ; Capacity for 2.4Ah Saft LS14500 and 0.8Ah Panasonic UR14500P 165 ; Capacity for 2.4Ah Saft LS14500 and 0.8Ah Panasonic UR14500P
183 ; battery_gauge:6 is nAs 166 ; battery_gauge:6 is nAs
184 ; devide through 65536 167 ; devide through 65536
185 ; a) devide through 364 -> Result is in percent of a 2.4Ah Battery 168 ; a) devide through 364 -> Result is in percent of a 2.4Ah Battery
186 ; or b) devide through 121 -> Result is in percent of a 0.8Ah Battery 169 ; or b) devide through 121 -> Result is in percent of a 0.8Ah Battery
187 170
188 ; For internal battery gauging 171 ; For internal battery gauging
189 #DEFINE internal_saft_capacity .364 172 #DEFINE internal_saft_capacity .364
190 #DEFINE internal_panasonic_capacity .121 173 #DEFINE internal_panasonic_capacity .121
191 174
192 ; For gauge IC 175 ; For gauge IC
193 #DEFINE saft_capacity .281 ; 2.4Ah/0.085mAh/100 [%] 176 #DEFINE saft_capacity .281 ; 2.4Ah/0.085mAh/100 [%]
194 #DEFINE saft_offset .37300 ; 65536-(2.4Ah/0.085mAh) 177 #DEFINE saft_offset .37300 ; 65536-(2.4Ah/0.085mAh)
195 178
196 #DEFINE panasonic_capacity .94 ; 0.8Ah/0.085mAh/100 [%] 179 #DEFINE panasonic_capacity .94 ; 0.8Ah/0.085mAh/100 [%]
197 #DEFINE panasonic_offset .56124 ; 65536-(0.8Ah/0.085mAh) 180 #DEFINE panasonic_offset .56124 ; 65536-(0.8Ah/0.085mAh)
198 181
199 #DEFINE ncr18650_capacity .364 ; 3.1Ah/0.085mAh/100 [%] 182 #DEFINE ncr18650_capacity .364 ; 3.1Ah/0.085mAh/100 [%]
200 #DEFINE ncr18650_offset .29065 ; 65536-(3.1Ah/0.085mAh) 183 #DEFINE ncr18650_offset .29065 ; 65536-(3.1Ah/0.085mAh)
201 184
202 #DEFINE ur16650_capacity .271 ; 2.3Ah/0.085mAh/100 [%] 185 #DEFINE ur16650_capacity .271 ; 2.3Ah/0.085mAh/100 [%]
203 #DEFINE ur16650_offset .38477 ; 65536-(2.3Ah/0.085mAh) 186 #DEFINE ur16650_offset .38477 ; 65536-(2.3Ah/0.085mAh)
204 187
205 #DEFINE current_sleepmode .31 188 #DEFINE current_sleepmode .31
206 #DEFINE current_backlight_multi .115 ; *CCPR1L+current_backlight_offset 189 #DEFINE current_backlight_multi .115 ; * CCPR1L + current_backlight_offset
207 #DEFINE current_backlight_offset .216 190 #DEFINE current_backlight_offset .216
208 #DEFINE current_speed_eco .1914 191 #DEFINE current_speed_eco .1914
209 #DEFINE current_speed_normal .4027 192 #DEFINE current_speed_normal .4027
210 #DEFINE current_speed_fastest .5050 193 #DEFINE current_speed_fastest .5050
211 #DEFINE current_ir_reciever .139 194 #DEFINE current_ir_receiver .139
212 #DEFINE current_compass .28 195 #DEFINE current_compass .28
213 196
214 ; Brightness thresholds (between zero (off) and 255 (max. power)) 197 ; Brightness thresholds (between zero (off) and 255 (max. power))
215 #DEFINE ambient_light_max_high_36V .170 198 #DEFINE ambient_light_max_high_36V .170
216 #DEFINE ambient_light_max_high_cr .240 199 #DEFINE ambient_light_max_high_cr .240
217 #DEFINE ambient_light_max_high_15V .140 200 #DEFINE ambient_light_max_high_15V .140
218 #DEFINE ambient_light_min_high .35 201 #DEFINE ambient_light_min_high .35
219 #DEFINE ambient_light_max_medium .125 202 #DEFINE ambient_light_max_medium .125
220 #DEFINE ambient_light_min_medium .25 203 #DEFINE ambient_light_min_medium .25
221 #DEFINE ambient_light_max_eco .70 204 #DEFINE ambient_light_max_eco .70
222 #DEFINE ambient_light_min_eco .10 ; Must be the lowest value! 205 #DEFINE ambient_light_min_eco .10 ; must be the lowest value!
223 206
224 ; IR Link timeout 207 ; IR Link timeout
225 #DEFINE ir_timeout_value .64 ; multiples of 62,5ms 208 #DEFINE ir_timeout_value .64 ; multiples of 62,5ms
226 209
227 ; Sp control constants 210 ; Sp control constants
228 #DEFINE surface_sp .50 ; in cbar 211 #DEFINE surface_sp .50 ; in cbar
229 212
230 ; Gaslist hard-coded limits 213 ; Gaslist hard-coded limits
231 #DEFINE gaslist_min_o2 .7 ; Minimum O2 [%] 214 #DEFINE gaslist_min_o2 .5 ; Minimum O2 [%]
232 #DEFINE gaslist_max_change_depth .99 ; Max. change depth [m] 215 #DEFINE gaslist_max_He .100-gaslist_min_o2 ; Maximum He [%]
233 #DEFINE gaslist_sp_stepsize .10 ; Steps for Setpoint Setup [cbar] 216
234 #DEFINE gaslist_sp_max .160 ; Max. Setpoint [cbar] 217 #DEFINE gaslist_max_change_depth .99 ; Max. change depth [m]
235 #DEFINE gaslist_sp_min .50 ; Min. Setpoint [cbar] 218 #DEFINE gaslist_sp_stepsize .10 ; Steps for Setpoint Setup [cbar]
219 #DEFINE gaslist_sp_max .160 ; Max. Setpoint [cbar]
220 #DEFINE gaslist_sp_min .50 ; Min. Setpoint [cbar]
236 221
237 ; Compass display 222 ; Compass display
238 #DEFINE compass_fast_treshold .9 ; show new heading instantly if new and old > compass_fast_treshold 223 #DEFINE compass_fast_treshold .9 ; show new heading instantly if new and old > compass_fast_treshold
239 #DEFINE compass_averaging .10 ; numbers of extra averaging 224 #DEFINE compass_averaging .10 ; numbers of extra averaging
225
226 ; Bit Masks for communication with p2_deco.c - char_O_deco_status
227 #define DECO_STATUS_MASK .3
228
229 ; Bit Flags for communication with p2_deco.c - char_O_deco_status
230 #define DECO_STATUS_0_FLAG .0
231 #define DECO_STATUS_1_FLAG .1
232 #define DECO_MODE_LOOP_FLAG .2
233 #define DECO_MODE_PSCR_FLAG .3
234 #define DECO_PLAN_FLAG .4
235 #define DECO_CNS_FLAG .5
236 #define DECO_VOLUME_FLAG .6
237 #define DECO_ASCENT_FLAG .7
238
239 ; Bit Flags for communication with p2_deco.c - char_O_main_status
240 ; .0 ; unused
241 ; .1 ; unused
242 ; DECO_MODE_LOOP_FLAG .2 ; defined below, also used for char_O_main_status
243 ; DECO_MODE_PSCR_FLAG .3 ; defined below, also used for char_O_main_status
244 #define DECO_GASCHANGE_OVRD .4
245 ; .5 ; unused
246 #define DECO_BOTTOM_FLAG .6
247 ; .7 ; unused
248
249 ; Bit Values for communication with p2_deco.c
250 #define DECO_STATUS_INIT .3
251 #define DECO_MODE_LOOP .4
252 #define DECO_MODE_PSCR .8
253 #define DECO_PLAN_ALTERNATE .16
254 #define DECO_CNS_CALCULATE .32
255 #define DECO_VOLUME_CALCULATE .64
256 #define DECO_ASCENT_DELAYED .128
257
258 ; Bit Flags for char_O_deco_warnings
259 #define IBCD_warning .0
260 #define IBCD_warning_lock .1
261 #define mbubble_warning .2
262 #define mbubble_warning_lock .3
263 #define outside_warning .4
264 #define outside_warning_lock .5
265 #define stoptable_overflow .6
266 #define deco_flag .7
267
268 ; Bit Flags for status on CHARs
269 #define char_invalid_flag .7
270
271 ; Bit Flags for status on INTs
272 #define int_invalid_flag .2
273 #define int_not_yet_computed .3
274 #define int_is_zero .3
275 #define int_low_flag .4
276 #define int_high_flag .5
277 #define int_attention_flag .6
278 #define int_warning_flag .7
279
280 ;-----------------------------------------------------------------------------
281 ; Flags
240 282
241 ; Hardware defines 283 ; Hardware defines
242 #DEFINE battery_gauge_available hardware_flag,0 ; OSTC has rechargeable battery with battery management chip 284 #DEFINE battery_gauge_available hardware_flag,0 ; =1: OSTC has rechargeable battery with battery management chip
243 #DEFINE ambient_sensor hardware_flag,1 ; OSTC has an ambient light sensor 285 #DEFINE ambient_sensor hardware_flag,1 ; =1: OSTC has an ambient light sensor
244 #DEFINE analog_o2_input hardware_flag,2 ; OSTC has analog inputs and S8 digital 286 #DEFINE analog_o2_input hardware_flag,2 ; =1: OSTC has analog inputs and S8 digital
245 #DEFINE optical_input hardware_flag,3 ; OSTC has an digital optical input 287 #DEFINE optical_input hardware_flag,3 ; =1: OSTC has an digital optical input
246 #DEFINE ble_available hardware_flag,4 ; OSTC has an BLE module 288 #DEFINE ble_available hardware_flag,4 ; =1: OSTC has an BLE module
247 #DEFINE ostc_rx_present hardware_flag,5 ; OSTC_RX circuity present 289 #DEFINE ostc_rx_present hardware_flag,5 ; =1: OSTC RX circuity present
248 ;unused 290 ; hardware_flag,6 ; unused
249 ;unused 291 ; hardware_flag,7 ; unused
250 292
251 ; Hardware flag byte: 293 #DEFINE leftbind cvt_flags+0,0
252 ; BIT0 = OSTC has rechargeable battery with battery management chip 294 #DEFINE ignore_digit3 cvt_flags+0,1
253 ; BIT1 = OSTC has an ambient light sensor 295 #DEFINE ignore_digit4 cvt_flags+0,2
254 ; BIT2 = OSTC has analog inputs and S8 digital 296 #DEFINE ignore_digit5 cvt_flags+0,3
255 ; BIT3 = OSTC has an digital optical input 297 #DEFINE enable_screen_dumps cvt_flags+0,4 ; =1: Ignore vin_usb, wait for "l" command (Screen dump
256 ; BIT4 = OSTC has an BLE module 298 #DEFINE screen_type cvt_flags+0,5 ; =1: display1, =0; display0
257 ; BIT5 = OSTC_RX circuity present 299 #DEFINE compass_type cvt_flags+0,6 ; =1: compass1, =0: compass0
258 ; BIT6 = unused 300 #DEFINE analog_switches cvt_flags+0,7 ; =1: Analog switches available
259 ; BIT7 = unused 301
260 302 #define pre_zero_flag cvt_flags+1,0
261 303 #define all_zeros_flag cvt_flags+1,1
304 #define DP_done cvt_flags+1,2
305 #define DP_done2 cvt_flags+1,3
306 #define show_last3 cvt_flags+1,4
307 #define leading_zeros cvt_flags+1,5
308 #define show_last4 cvt_flags+1,6
309 #DEFINE compass_type2 cvt_flags+1,7 ; =1: Compass2, =0: Compass1 or compass0
310
311
312 ; HUD Status Byte
313 #DEFINE hud_connection_ok hud_status_byte,0 ; =1 -> HUD connection ok
314 ; hud_status_byte,1 ; =1 -> HUD is calibrated
315 ; hud_status_byte,2 ; =1 -> HUD Battery is low (<3000mV)
316 #DEFINE sensor1_active hud_status_byte,3 ; =1: Sensor1 is active
317 #DEFINE sensor2_active hud_status_byte,4 ; =1: Sensor2 is active
318 #DEFINE sensor3_active hud_status_byte,5 ; =1: Sensor3 is active
319 ; hud_status_byte,6 ; unused in stand-alone HUD
320 ; hud_status_byte,7 ; unused in stand-alone HUD
321
322 #DEFINE switch_left flag1,0 ; =1: left button was pressed
323 #DEFINE switch_right flag1,1 ; =1: right button was pressed
324 #DEFINE neg_flag flag1,2 ; e.g. sub16 (sub_c = sub_a - sub_b)
325 #DEFINE pressure_refresh flag1,3 ; =1: A new pressure/temperature is available
326 #DEFINE sleepmode flag1,4 ; =1: in Sleepmode
327 #DEFINE tft_is_dimming flag1,5 ; =1: the TFT is dimming, ignore light sensor
328 #DEFINE display_velocity flag1,6 ; =1: show velocity
329 #DEFINE no_sensor_int flag1,7 ; =1: block any further access to pressure sensor
330
331 #DEFINE rs232_receive_overflow flag2,0 ; =1: a RS232 timeout overflow occoured
332 #DEFINE stored_gas_changed flag2,1 ; =1: Stored Gas changed
333 #DEFINE high_altitude_mode flag2,2 ; =1: unit was manually turned on with ambient pressure <880mbar
334 #DEFINE FLAG_apnoe_mode flag2,3 ; =1: Apnoe mode selected
335 #DEFINE restore_deco_data flag2,4 ; =1: restore deco data (After simulation)
336 #DEFINE premenu flag2,5 ; =1: Premenu/Divemenu selected
337 #DEFINE menubit flag2,6 ; menu
338 #DEFINE simulatormode_active flag2,7 ; =1: simulator mode active, override pressure sensor readings
339
340 #DEFINE divemode_menu flag3,0 ; =1: divemode menu is shown
341 #DEFINE onesecupdate flag3,1 ; =1: after any second
342 #DEFINE twosecupdate flag3,2 ; =1: new two-second update
343 #DEFINE toggle_customview flag3,3 ; =1: next customview
344 #DEFINE oneminupdate flag3,4 ; =1: after any minute
345 #DEFINE divemode flag3,5 ; =1: in Divemode
346 #DEFINE battery_is_36v flag3,6 ; =1: 3,6V Battery is in use
347 #DEFINE warning_active flag3,7 ; =1: a warning is active in divemode or surfacemode
348
349 #DEFINE better_gas_available flag4,0 ; =1: a better gas is available
350 #DEFINE blinking_better_gas flag4,1 ; =1: gas is blinking
351 #DEFINE menuview flag4,2 ; =1: a menuview is shown in divemode (e.g. "Menu?")
352 #DEFINE quarter_second_update flag4,3 ; =1: a new 1/4 second has begun
353 #DEFINE divemode_gaschange flag4,4 ; =1: the gas will change very soon
354 #DEFINE decostop_active flag4,5 ; =1: decompression stop shown
355 #DEFINE depth_greater_100m flag4,6 ; =1: current depth > 100m
356 #DEFINE realdive flag4,7 ; =1: a real dive during divemode
357
358 #DEFINE dive_warning_displayed flag5,0 ; =1: the warning sign is shown
359 #DEFINE reset_average_depth flag5,1 ; =1: reset the average depth
360 #DEFINE store_sample flag5,2 ; =1: store a new sample
361 #DEFINE divemode2 flag5,3 ; =1: dive longer than one minute
362 #DEFINE FLAG_active_descent flag5,4 ; used in Apnoe mode
363 #DEFINE event_occured flag5,5 ; =1: an event occured, store it!
364 #DEFINE divemode_menu_active flag5,6 ; =1: the divemode menu is shown
365 #DEFINE temp_changed flag5,7 ; =1: the temperature changed
366
367 #DEFINE gas6_changed flag6,0 ; =1: gas 6 has been selected/changed underwater
368 #DEFINE onehourupdate flag6,1 ; =1: a new hour has just begun
369 #DEFINE settime_setdate flag6,2 ; =1: in the Set Time or Set Date Menu
370 #DEFINE setpoint_changed flag6,3 ; =1: setpoint has been changed
371 #DEFINE second_row_warning flag6,4 ; =1: the second row contains a warning
372 #DEFINE FLAG_ccr_mode flag6,5 ; =1: CCR mode (fixed ppO2 or sensor) active
373 #DEFINE FLAG_back_to_loop flag6,6 ; =1: a switchback from bailout to loop occured
374 #DEFINE FLAG_set_marker flag6,7 ; =1: set a marker in the logbook
375
376 ; flag7,0 ; unused
377 #DEFINE no_more_divesecs flag7,1 ; =1: Do no longer show seconds in divemode
378 #DEFINE FLAG_gauge_mode flag7,2 ; =1: In Gauge mode
379 #DEFINE ignore_last_edited_gas flag7,3 ; Used in gaslist_cleanup_list
380 #DEFINE ccr_diluent_setup flag7,4 ; =1: Setting up Diluents ("Gas6-10")
381 #DEFINE space_gas_decriptions flag7,5 ; =1: add a space in front of gas numbers < 9 for alignment
382 #DEFINE short_gas_decriptions flag7,6 ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint
383 #DEFINE max_depth_greater_100m flag7,7 ; =1: Max. Depth > 100m
384
385 #DEFINE is_bailout flag8,0 ; =1: Bailout
386 #DEFINE is_bailout_menu flag8,1 ; =1: Bailout
387 #DEFINE toggle_gf flag8,2 ; =1: Toggle GF/aGF
388 #DEFINE use_agf flag8,3 ; =1: Use aGF (instead of GF)
389 #DEFINE battery_removed_in_usb flag8,4 ; =1: The battery has been removed in USB (probably not used for anything useful)
390 #DEFINE adc_running flag8,5 ; =1: The ADC is in use
391 #DEFINE comm_service_enabled flag8,6 ; =1: COMM Service mode unlocked
392 #DEFINE compass_enabled flag8,7 ; =1: The compass and accelerometer chip is active
393
394 #DEFINE compass_fast_mode flag9,0 ; =1: The compass is in fast mode
395 #DEFINE in_color_menu flag9,1 ; =1: In the color scheme menu
396 #DEFINE bailoutgas_event flag9,2 ; =1: bailout was selected or a gaschange during bailout
397 #DEFINE win_invert flag9,3 ; =1: Invert font output
398 #DEFINE show_safety_stop flag9,4 ; =1: Show the safety stop
399 #DEFINE safety_stop_active flag9,5 ; =1: The safety stop is currently displayed
400 #DEFINE new_s8_data_available flag9,6 ; =1: New data frame received
401 #DEFINE print_compass_label flag9,7 ; =1: print the graphical comapss label
402
403 #DEFINE s8_digital flag10,0 ; =1: Digital I/O
404 #DEFINE menu_show_sensors2 flag10,1 ; =1: Update mV data in calibration menu
405 #DEFINE use_O2_sensor1 flag10,2 ; =1: Use this sensor
406 #DEFINE use_O2_sensor2 flag10,3 ; =1: Use this sensor
407 #DEFINE use_O2_sensor3 flag10,4 ; =1: Use this sensor
408 #DEFINE setpoint_fallback flag10,5 ; =1: Fallback to SP1 due to external O2 sensor failure
409 #DEFINE blinking_setpoint flag10,6 ; =1: SP is blinking
410 #DEFINE flip_screen flag10,7 ; =1: Screen is flipped by 180°
411
412 #DEFINE sensor1_calibrated_ok flag11,0 ; =1: This sensor has been calibrated ok
413 #DEFINE sensor2_calibrated_ok flag11,1 ; =1: This sensor has been calibrated ok
414 #DEFINE sensor3_calibrated_ok flag11,2 ; =1: This sensor has been calibrated ok
415 #DEFINE voting_logic_sensor1 flag11,3 ; =1: This sensor is within the voting logic threshold
416 #DEFINE voting_logic_sensor2 flag11,4 ; =1: This sensor is within the voting logic threshold
417 #DEFINE voting_logic_sensor3 flag11,5 ; =1: This sensor is within the voting logic threshold
418 #DEFINE cc_active flag11,6 ; =1: Constant Current active (cR Hardware)
419 #DEFINE cv_active flag11,7 ; =1: Constant Voltage active (cR Hardware)
420
421 #DEFINE compass_bearing_set flag12,0 ; bearing set
422 #DEFINE compass_bearing_eq flag12,1 ; bearing is in direction? do not show << or >>
423 #DEFINE compass_bearing_lft flag12,2 ; bearing is to the left/<< if set, otherwise to the right/>>
424 #DEFINE compass_bearing_vis flag12,3 ; bearing is visible? (either ahead or behind/-180°)
425 #DEFINE compass_bearing_ahd flag12,4 ; bearing is ahead or behind?
426 #DEFINE blinking_depth_warning flag12,5 ; set by the color_depth. =1: warning color
427 #DEFINE blinking_depth_prev flag12,6 ; set by the TFT_depth. =1: prev display had warning color
428 #DEFINE blinking_depth_toggle flag12,7 ; toggle to blink
429
430 #DEFINE neg_flag_velocity flag13,0 ; neg_flag backup for velocity logic
431 #DEFINE analog_sw1_pressed flag13,1 ; =1: Analog switch 1 pressed
432 #DEFINE analog_sw2_pressed flag13,2 ; =1: Analog switch 2 pressed
433 #DEFINE sp2_switched flag13,3 ; =1: This setpoint has been autoselected already
434 #DEFINE sp3_switched flag13,4 ; =1: This setpoint has been autoselected already
435 #DEFINE sp4_switched flag13,5 ; =1: This setpoint has been autoselected already
436 #DEFINE sp5_switched flag13,6 ; =1: This setpoint has been autoselected already
437 #DEFINE use_old_batt_flag flag13,7 ; =1: load old battery information after power-on reset
438
439 #DEFINE FLAG_pscr_mode flag14,0 ; =1: OSTC is in PSCR mode
440 #DEFINE deep_sleep flag14,1 ; =1: OSTC is in deep sleep (ignore buttons, etc)
441 #DEFINE sensors_agree flag14,2 ; =1: the ppO2 of all sensors are within the threshold range
442 #DEFINE gas_needs_attention flag14,3 ; =1: the gas needs attention has been raised before
443 #DEFINE gas_needs_warning flag14,4 ; =1: the gas needs warning has been raised before
444 #DEFINE sensor_warning flag14,5 ; =1: the sensors disagree warning has been raised before
445 #DEFINE alternative_divelayout flag14,6 ; =1: the alternative divelayout is used (aka Blind Mode)
446 #DEFINE i2c_error_flag flag14,7 ; =1: an I2C error occured
447
448 #define aa_antialias aa_flags,0 ; used by aa_wordprocessor
449 #define aa_color_quart aa_flags,1 ; used by aa_wordprocessor
450 #define aa_color_half aa_flags,2 ; used by aa_wordprocessor
451 ; aa_flags,3 ; unused
452 ; aa_flags,4 ; unused
453 ; aa_flags,5 ; unused
454 ; aa_flags,6 ; unused
455 ; aa_flags,7 ; unused
456
457
458 ; Update flags in divemode, =1: Update the screen
459 #DEFINE FLAG_TFT_divemode_mask tft_update_flags+0,0
460 #DEFINE FLAG_TFT_display_ndl_mask tft_update_flags+0,1
461 #DEFINE FLAG_TFT_depth tft_update_flags+0,2
462 #DEFINE FLAG_TFT_divemins tft_update_flags+0,3
463 #DEFINE FLAG_TFT_show_safety_stop tft_update_flags+0,4
464 #DEFINE FLAG_TFT_display_ndl tft_update_flags+0,5
465 #DEFINE FLAG_TFT_display_deko_mask tft_update_flags+0,6
466 #DEFINE FLAG_TFT_display_deko tft_update_flags+0,7
467 #DEFINE FLAG_TFT_display_tts tft_update_flags+1,0
468 #DEFINE FLAG_TFT_temp_divemode tft_update_flags+1,1
469 #DEFINE FLAG_TFT_divemode_warning tft_update_flags+1,2
470 #DEFINE FLAG_TFT_divemode_warning_clear tft_update_flags+1,3
471 #DEFINE FLAG_TFT_active_gas_divemode tft_update_flags+1,4
472 #DEFINE FLAG_TFT_clear_safety_stop tft_update_flags+1,5
473 #DEFINE FLAG_TFT_max_depth tft_update_flags+1,6
474 #DEFINE FLAG_TFT_divemode_mask_alt tft_update_flags+1,7
475 #DEFINE FLAG_TFT_dive_warning_text_clear tft_update_flags+2,0
476 #DEFINE FLAG_TFT_dive_warning_text_clr2 tft_update_flags+2,1
477 #DEFINE FLAG_TFT_max_depth_alt tft_update_flags+2,2
478 #DEFINE FLAG_TFT_big_deco_alt tft_update_flags+2,3
479 ; tft_update_flags+2,4 ; unused
480 ; tft_update_flags+2,5 ; unused
481 ; tft_update_flags+2,6 ; unused
482 ; tft_update_flags+2,7 ; unused
483
484
262 ;---------------------------- Macros ------------------------------------ 485 ;---------------------------- Macros ------------------------------------
263 486
264 TSTOSS macro opt_reg ; TeST Option Skip if not Zero 487 TSTOSS macro opt_reg ; TeST Option Skip if not Zero
265 movff opt_reg,WREG 488 movff opt_reg,WREG
266 tstfsz WREG,A 489 tstfsz WREG,A
267 bra $+4 490 bra $+4
268 endm 491 endm
492
493 ;---------------------------- C-code Routines ----------------------------
494
495 extern deco_calc_desaturation_time
496 extern deco_calc_hauptroutine
497 extern deco_calc_dive_interval_1min
498 extern deco_calc_dive_interval_10min
499 extern deco_calc_dive_interval
500 extern deco_clear_tissue
501 extern deco_pull_tissues_from_vault
502 extern deco_push_tissues_to_vault
503
269 504
270 ;---------------------------- Bank0 DATA ------------------------------------ 505 ;---------------------------- Bank0 DATA ------------------------------------
271 isr_backup equ 0x60 506 isr_backup equ 0x60
272 isr_backup udata_ovr isr_backup ; Reserved space for interupt data 507 isr_backup udata_ovr isr_backup ; Reserved space for interupt data
273 508
274 ;---- Backup for general registers 509 ;---- Backup for general registers
275 isr_prod res 2 510 isr_prod res 2
276 511
277 ;---- MS5541 subroutines 512 ;---- MS5541 subroutines
278 amb_pressure res 2 513 amb_pressure res 2
279 temperature res 2 514 temperature res 2
280 515
281 C1 res 2 ; Decoded calibration data 516 C1 res 2 ; Decoded calibration data
282 C2 res 2 517 C2 res 2
283 C3 res 2 518 C3 res 2
284 C4 res 2 ; Here: C4-250 519 C4 res 2 ; Here: C4-250
285 C5 res 2 ; Here: Reference Temperature UT1 = 8*C5 + 10000 (u16 range 10.000 .. +42.760) 520 C5 res 2 ; Here: Reference Temperature UT1 = 8*C5 + 10000 (u16 range 10.000 .. +42.760)
286 C6 res 2 521 C6 res 2
287 D1 res 2 ; raw pressure 522 D1 res 2 ; raw pressure
288 D2 res 2 ; raw temperature 523 D2 res 2 ; raw temperature
289 xdT res 2 524 xdT res 2
290 xdT2 res 2 525 xdT2 res 2
291 OFF res 2 526 OFF res 2
292 SENS res 2 527 SENS res 2
293 dLSB res 1 ; Pressure sensor interface 528 dLSB res 1 ; Pressure sensor interface
294 dMSB res 1 529 dMSB res 1
295 clock_count res 1 530 clock_count res 1
296 sensor_state_counter res 1 ; counts to eight for state maschine 531 sensor_state_counter res 1 ; counts to eight for state maschine
297 amb_pressure_avg res 2 532 amb_pressure_avg res 2
298 temperature_avg res 2 533 temperature_avg res 2
299 minimum_temperature res 2 ; minimum temperature 534 minimum_temperature res 2 ; minimum temperature
300 last_temperature res 2 535 last_temperature res 2
301 last_pressure res 2 536 last_pressure res 2
302 last_pressure_velocity res 2 ; For velocity 537 last_pressure_velocity res 2 ; For velocity
303 last_surfpressure res 2 538 last_surfpressure res 2
304 last_surfpressure_15min res 2 539 last_surfpressure_15min res 2
305 last_surfpressure_30min res 2 540 last_surfpressure_30min res 2
306 rel_pressure res 2 541 rel_pressure res 2
307 sim_pressure res 2 ; hold simulated pressure in mbar if in Simulator mode 542 sim_pressure res 2 ; hold simulated pressure in mbar if in Simulator mode
308 max_pressure res 2 543 max_pressure res 2
309 avg_rel_pressure res 2 544 avg_rel_pressure res 2
310 avg_rel_pressure_total res 2 545 avg_rel_pressure_total res 2
546
311 ;---- Data for ISR math subroutines 547 ;---- Data for ISR math subroutines
312 isr_xC res 4 548 isr_xC res 4
313 isr_xA res 2 549 isr_xA res 2
314 isr_xB res 2 550 isr_xB res 2
315 551
316 ;---- Data for ISR routines 552 ;---- Data for ISR routines
317 isr1_temp res 1 ; ISR temp variable, used in ms5541.asm, isr_rtcc, isr_battery_gauge 553 isr1_temp res 1 ; ISR temp variable, used in ms5541.asm, isr_rtcc, isr_battery_gauge
318 isr2_temp res 1 ; ISR temp variable, used isr_battery_gauge 554 isr2_temp res 1 ; ISR temp variable, used isr_battery_gauge
319 555
320 ;---- Display brightness 556 ;---- Display brightness
321 max_CCPR1L res 1 ; Max. brightness value for CCPR1L 557 max_CCPR1L res 1 ; Max. brightness value for CCPR1L
322 558
323 ; Battery gauge (nAs, nC) 559 ; Battery gauge (nAs, nC)
324 battery_gauge res 6 ; 48Bit -> 78Ah max... 560 battery_gauge res 6 ; 48Bit -> 78Ah max...
325 561
326 ; IR/S8-Link 562 ; IR/S8-Link
327 ir_s8_buffer res .18 ; temporally used in get_calibration_data for the raw (packed) calibration data 563 ir_s8_buffer res .18 ; temporally used in get_calibration_data for the raw (packed) calibration data
328 ir_s8_counter res 1 564 ir_s8_counter res 1
329 ir_S8_timeout res 1 ; Timeout for valid data 565 ir_s8_timeout res 1 ; Timeout for valid data
330 566
331 ; Compass raw data 567 ; Compass raw data
332 compass_DX res 2 568 compass_DX res 2
333 compass_DY res 2 569 compass_DY res 2
334 compass_DZ res 2 570 compass_DZ res 2
335 571
336 accel_DX res 2 572 accel_DX res 2
337 accel_DY res 2 573 accel_DY res 2
338 accel_DZ res 2 574 accel_DZ res 2
339 575
340 ; Compass FILTERED data 576 ; Compass FILTERED data
341 compass_DX_f res 2 577 compass_DX_f res 2
342 compass_DY_f res 2 578 compass_DY_f res 2
343 compass_DZ_f res 2 579 compass_DZ_f res 2
344 580
345 accel_DX_f res 2 581 accel_DX_f res 2
346 accel_DY_f res 2 582 accel_DY_f res 2
347 accel_DZ_f res 2 583 accel_DZ_f res 2
348 584
349 ; Compass calibration data 585 ; Compass calibration data
350 compass_CX_f res 2 586 compass_CX_f res 2
351 compass_CY_f res 2 587 compass_CY_f res 2
352 compass_CZ_f res 2 588 compass_CZ_f res 2
353 589
354 ; Compass more data 590 ; Compass more data
355 compass_heading res 2 ; Corrected heading (in 1°) : -180 .. 180 591 compass_heading res 2 ; Corrected heading (in 1°) : -180 .. 180
356 compass_heading_old res 2 ; Old heading (For smoother display) 592 compass_heading_old res 2 ; Old heading (For smoother display)
357 compass_heading_shown res 2 ; Displayed heading 593 compass_heading_shown res 2 ; Displayed heading
358 ;compass_roll res 2 ; Rotation around the X axis 594 ;compass_roll res 2 ; Rotation around the X axis
359 ;compass_pitch res 2 ; Rotation around the Y axis 595 ;compass_pitch res 2 ; Rotation around the Y axis
360 596
361 compass_a res 2 ; Tmp data for Q15 arithmetics 597 compass_a res 2 ; Tmp data for Q15 arithmetics
362 compass_b res 2 598 compass_b res 2
363 compass_r res 3 599 compass_r res 3
364 600
365 CNS_start res 2 ; CNS value at beginning of dive 601 CNS_start res 2 ; CNS value at beginning of dive
366 GF_start res 1 ; GF value at beginning of dive 602 GF_start res 1 ; GF value at beginning of dive
367 603
368 speed_setting res 1 ; =1: Eco, =2: Normal, =3: Fastest 604 speed_setting res 1 ; =1: Eco, =2: Normal, =3: Fastest
369 605
370 ;---- Data for graphical compass 606 ;---- Data for graphical compass
371 xRD res 2 ; virtual compass ruler offset 607 xRD res 2 ; virtual compass ruler offset
372 xRDr res 2 ; virtual compass ruler offset - right end 608 xRDr res 2 ; virtual compass ruler offset - right end
373 xRD180 res 2 ; virtual compass ruler offset for the -180 marker 609 xRD180 res 2 ; virtual compass ruler offset for the -180 marker
374 xLO res 1 ; lo backup to prevent trashing 610 xLO res 1 ; lo backup to prevent trashing
375 xHI res 1 ; hi backup to prevent trashing 611 xHI res 1 ; hi backup to prevent trashing
376 xCM res 1 ; compass bearing relative position 612 xCM res 1 ; compass bearing relative position
377 compass_bearing res 2 ; this is where the bearing menu stores the actual heading for bearing 613 compass_bearing res 2 ; this is where the bearing menu stores the actual heading for bearing
378 614
379 ;---------------------------- Common DATA ------------------------------------ 615 ;---------------------------- Common DATA ------------------------------------
380 616 common equ 0x100 ; Alias for "banksel common"
381 common equ 0x100 ; Alias for "banksel common" 617 common udata_ovr common ; Bank 1 general variables
382 common udata_ovr common ; Bank1 general variables
383 618
384 ;---- Time and Date 619 ;---- Time and Date
385 secs res 1 620 secs res 1
386 mins res 1 621 mins res 1
387 hours res 1 622 hours res 1
388 day res 1 623 day res 1
389 month res 1 624 month res 1
390 year res 1 625 year res 1
391 surface_interval res 2 626 surface_interval res 2
392 627
393 flag1 res 1 628 ;---- State Information
394 flag2 res 1 629 flag1 res 1
395 flag3 res 1 630 flag2 res 1
396 flag4 res 1 631 flag3 res 1
397 flag5 res 1 632 flag4 res 1
398 flag6 res 1 633 flag5 res 1
399 flag7 res 1 634 flag6 res 1
400 flag8 res 1 635 flag7 res 1
401 flag9 res 1 636 flag8 res 1
402 flag10 res 1 637 flag9 res 1
403 flag11 res 1 638 flag10 res 1
404 flag12 res 1 639 flag11 res 1
405 flag13 res 1 640 flag12 res 1
406 flag14 res 1 641 flag13 res 1
407 642 flag14 res 1
408 hardware_flag res 1 ; hardware descriptor flag 643 hardware_flag res 1 ; hardware descriptor flag
409 644 tft_update_flags res 3
410 temp1 res 1 645
411 temp2 res 1 646 ;---- Interface to Data Conversion &
412 647 ;---- Output Functions, as well as
413 ;---- Interface to wait macros 648 ;---- General-Purpose Temp Storage
414 wait_temp res 1 649 lo res 1
415 waitms_temp res 1 650 hi res 1
416 651 up res 1
417 ;---- Interface to graphic subroutines (aa_wordprocessor, color_processor, ...) 652 ignore_digits res 1
418 win_leftx2 res 1 653
419 win_top res 1 654 ;---- Interface to Graphic Functions
420 win_width res 2 655 win_leftx2 res 1
421 win_height res 1 656 win_top res 1
422 win_bargraph res 1 657 win_width res 2
423 win_color1 res 1 658 win_height res 1
424 win_color2 res 1 659 win_bargraph res 1
425 win_font res 1 660 win_color1 res 1
426 661 win_color2 res 1
427 ;---- Draw subroutines 662 win_font res 1
428 tft_temp4 res 1 663
429 tft_temp3 res 1 664 ;---- Interface to Math Functions
430 tft_temp2 res 1 665 divA res 2
431 tft_temp1 res 1 666 divB res 1
432 667 xC res 4
433 ;---- data conversion subroutines 668 xA res 2
434 lo res 1 669 xB res 2
435 hi res 1 670 sub_c res 2
436 up res 1 671 sub_a res 2
437 672 sub_b res 2
438 ;---- RS232 temp variables
439 uart1_temp res 1
440 uart2_temp res 1
441 uart3_temp res 1
442
443 ;---- Data for math subroutines
444 divA res 2
445 divB res 1
446 xC res 4
447 xA res 2
448 xB res 2
449 sub_c res 2
450 sub_a res 2
451 sub_b res 2
452
453 ;---- Data for conversion subroutines
454 cvt_flags res 2
455 ignore_digits res 1
456
457 #define leftbind cvt_flags,0
458 #define ignore_digit3 cvt_flags,1
459 #define ignore_digit4 cvt_flags,2
460 #define ignore_digit5 cvt_flags,3
461 #DEFINE enable_screen_dumps cvt_flags,4 ; =1: Ignore vin_usb, wait for "l" command (Screen dump
462 #DEFINE screen_type cvt_flags,5 ; =1: display1, =0; display0
463 #DEFINE compass_type cvt_flags,6 ; =1: compass1, =0: compass0
464 #DEFINE analog_switches cvt_flags,7 ; =1: Analog switches available
465
466 #DEFINE compass_type2 cvt_flags+1,0 ; =1: Compass2, =0: Compass1 or compass0
467
468 673
469 ;---- Misc. 674 ;---- Misc.
470 timeout_counter res 1 675 timeout_counter1 res 2 ; timeout for dive operations
471 timeout_counter2 res 1 676 timeout_counter2 res 1 ; timeout for menu operations
472 timeout_counter3 res 1 677 batt_voltage res 2 ; battery voltage in mV
473 batt_voltage res 2 ; Battery voltage in mV 678 batt_percent res 1 ; battery in percent (1-100)
474 batt_percent res 1 ; Battery in percent (1-100) 679 warning_counter res 1 ; counts amount of warning in divemode
475 ambient_light res 2 ; ambient_light level 680 warning_page res 1 ; current # of warning page
476 lo_temp res 1 681
477 hi_temp res 1 682 ;---- Dive Mode / General
478 convert_value_temp res 3 ; used in menu_battery_state_convert_date 683 divemins res 2
479 active_gas res 1 ; the currently breathed gas (1-5) 684 divesecs res 1
480 active_diluent res 1 ; backup when switching back from bailout to CCR/pSCR loop 685 total_divetime_seconds res 2
481 warning_counter res 1 ; Counts amount of warning in divemode 686 average_divesecs res 2 ; for the resettable stopwatch
482 warning_page res 1 ; current # of warning page 687 safety_stop_countdown res 1 ; counts seconds of safety stop
483 688 gaslist_gas res 1 ; used for transfer between gaslist.asm and menu_tree.asm
484 ; Remind history for menu processor (and such): 689 active_gas res 1 ; the currently breathed gas (1-5)
485 menustack res 5 ; menu stack 690 ;active_gas_type res 1 ; 0=Disabled, 1=First, 2=Travel, 3=Deco for OC gases and 0=Disabled, 1=First, 2=Normal for diluents
486 menupos res 1 ; Logbook and divemode menu 691
487 menupos2 res 1 ; For dive mode simulator and pre-menu 692 ;---- Dive Mode / Apnoe
488 menupos3 res 1 ; For Customviews 693 apnoe_surface_mins res 1
489 menupos4 res 1 ; For divemode menu 694 apnoe_surface_secs res 1
490 695 apnoe_mins res 1
491 ; Apnoe stuff that must be in bank common 696 apnoe_secs res 1
492 apnoe_mins res 1 697 apnoe_max_pressure res 2
493 apnoe_secs res 1 698
494 apnoe_max_pressure res 2 699 ;---- Profile Recording
495 700 samplingrate res 1
496 ; Divemode 701 samplesecs res 1
497 divemins res 2 702 samplesecs_value res 1
498 divesecs res 1 703 AlarmType res 1
499 samplingrate res 1 704 EventByte1 res 1
500 samplesecs_value res 1 705 EventByte2 res 1
501 divisor_temperature res 1 706
502 divisor_deco res 1 707 ;---- External Flash
503 divisor_gf res 1 708 ext_flash_rw res 1 ; transfer register for data read / write
504 divisor_ppo2_sensors res 1 709 ext_flash_address res 3 ; 24 bit address
505 divisor_decoplan res 1 710 ext_flash_log_pointer res 3 ; 24 bit address for logbook profile storing
506 divisor_cns res 1 711 ext_flash_end_pointer res 3 ; 24 bit address for logbook profile storing
507 divisor_tank res 1 712 ext_flash_dive_counter res 3 ; 24 bit counter for dive length (increased in write_byte_ext_flash_plus)
508 average_depth_hold res 4 713
509 average_depth_hold_total res 4 714 ;---- O2 Sensor Data
510 total_divetime_seconds res 2 715 o2_mv_sensor1 res 2 ; in 0.1mV steps
511 average_divesecs res 2 ; For the resettable stopwatch 716 o2_mv_sensor2 res 2 ; in 0.1mV steps
512 decodata res 2 717 o2_mv_sensor3 res 2 ; in 0.1mV steps
513 apnoe_timeout_counter res 1 718 o2_ppo2_sensor1 res 1 ; Sensor1 ppO2 (in 0.01bar steps)
514 apnoe_surface_mins res 1 719 o2_ppo2_sensor2 res 1 ; Sensor2 ppO2 (in 0.01bar steps)
515 apnoe_surface_secs res 1 720 o2_ppo2_sensor3 res 1 ; Sensor3 ppO2 (in 0.01bar steps)
516 721 hud_status_byte res 1
517 ; Profile storing 722
518 AlarmType res 1 723
519 samplesecs res 1 724 ;========================= privte Variables ===================================
520 EventByte res 1 725 ; do not access from outside of the respective source files!
521 EventByte2 res 1 726
522 ProfileFlagByte res 1 727 ;---- aa_wordprocessor.asm
523 728 aa_flags res 1 ; various flags for aa_wordprocessor
524 ; External flash 729 aa_bitlen res 1 ; count of pixels when decoding bitmaps
525 ext_flash_address res 3 ; 24bit Address 730 aa_start res 2 ; PROM ptr to start of encoded bitmap
526 ext_flash_log_pointer res 3 ; 24bit Address for logbook profile storing 731 aa_end res 2 ; and end of it
527 ext_flash_dive_counter res 3 ; 24bit Counter for dive length (increased in write_byte_ext_flash_plus) 732 aa_temp res 2 ; current color, divided by 2 or 4
528 733
529 ; I2C 734 ;--- adc_lightsensor.asm
530 i2c_temp res 2 ; Temp 735 get_bat_volt_counter res 1 ; counter for 10x reading the charger chip
531 736
532 ; O2 Sensor data 737 ;---- convert.asm
533 o2_mv_sensor1 res 2 ; in 0.1mV steps 738 cvt_flags res 2
534 o2_mv_sensor2 res 2 ; in 0.1mV steps 739 cvt_temp1 res 1
535 o2_mv_sensor3 res 2 ; in 0.1mV steps 740 cvt_temp2 res 1
536 o2_ppo2_sensor1 res 1 ; Sensor1 ppO2 (in 0.01bar steps) 741 cvt_temp3 res 1
537 o2_ppo2_sensor2 res 1 ; Sensor2 ppO2 (in 0.01bar steps) 742 cvt_temp4 res 1
538 o2_ppo2_sensor3 res 1 ; Sensor3 ppO2 (in 0.01bar steps) 743 lo_temp res 1
539 hud_status_byte res 1 744 hi_temp res 1
540 ;Status Byte/ 745
541 #DEFINE hud_connection_ok hud_status_byte,0 ;Bit0 = 1 -> HUD connection ok 746 ;---- color_processor.asm
542 ;Bit1 = 1 -> HUD is calibrated 747 img_pixels res 3 ; used by color_processor.asm
543 ;Bit2 = 1 -> HUD Battery is low (<3000mV) 748 img_count res 2 ; used by color_processor.asm
544 #DEFINE sensor1_active hud_status_byte,3 ;=1: Sensor1 is active 749
545 #DEFINE sensor2_active hud_status_byte,4 ;=1: Sensor2 is active 750 ;---- comm.asm
546 #DEFINE sensor3_active hud_status_byte,5 ;=1: Sensor3 is active 751 comm_timeout res 1 ; timeout for communication
547 ;Bit6 unused in stand-alone HUD 752
548 ;Bit7 unused in stand-alone HUD 753 ;---- eeprom_rs232.asm
549 754 uart1_temp res 1
550 sensor_setpoint res 1 ; sensor ppo2 in 0.01bar for deco routine 755 uart2_temp res 1
551 756 uart3_temp res 1
552 better_gas_number res 1 ; number (1-5) of the "better gas" in divemode, =0: no better gas available 757
553 customview_divemode res 1 ; keeps last custom view 758 ;---- i2c.asm
554 customview_surfmode res 1 759 i2c_temp1 res 1 ; temporary data
555 safety_stop_countdown res 1 ; counts seconds of safety stop 760 i2c_temp2 res 1 ; temporary data
556 tft_update_flags res 3 ; probably more then needed... 761
557 762 ;---- menu_processor.asm
558 ; bank common 1 Byte left here... 763 menupos1 res 1 ; logbook and divemode menu
559 764 menupos2 res 1 ; used for dive mode simulator and pre-menu
560 765 menupos3 res 1 ; used for Customviews
561 ;---------------------------- TMP DATA --------------------------------------- 766 menupos4 res 1 ; used for divemode menu
562 ; Space for various overlayed data from color, word, menu processors, etc. 767 menu_flags res 1 ; flags for menu entries
563 ; 768 menu_item res 1 ; index of the current item
564 769 start_item res 1 ; index of the first item (scrolling)
565 tmp udata_ovr 0x1A0 ; Bank1 shared TMP space 770 item_max res 1 ; number of items in menu
566 tmp equ 0x1A0 ; Alias for CBLOCK directive. 771 selected_item res 1 ; index of the current item
567 res 0x05F ; RESERVED area. 772 value_type res 1 ; type for vertical menu
773 dynamic_item res 3 ; callback addr
774 menu_block res 3 ; address of the menu block (i.e. item 0)
775 menu_title res 3 ; text or proc for dynamic menu
776 menu_center res 1 ; centering for line menu
777 proc_item res 3 ; address of the current proc
778 text_item res 2 ; address of the current text
779
780 ;---- options.asm
781 opt_type res 1 ;
782 opt_default res 1 ;
783 opt_inc res 1 ; also used for default+1 (string) and enum low
784 opt_min res 1 ; also used for enum high
785 opt_max res 1 ;
786 opt_unit res 2 ; multi-lingual unit text
787 opt_eeprom res 1 ;
788 opt_backup_tbl res 3 ; buffer for table pointer
789
790 ;---- tft.asm
791 save_top res 1
792 save_height res 1
793 save_left res 1
794 save_width res 1
795 ds_line res 1 ; current line (0..239)
796 ds_column res 1 ; current columnx2 (0..159)
797 ds_pixel res 2 ; current pixel color
798 ds_count res 1 ; repetition count
799 tft_temp1 res 1
800 tft_temp2 res 1
801 tft_temp3 res 1
802 tft_temp4 res 1
803
804 ;---- wait.asm
805 wait_counter res 1
806
807 ; ==> 187 bytes used - 21 bytes free
808
809
810 ;============================ LOCAL DATA ======================================
811 ; Space for various overlayed local data from top-level applications,
812 ; i.e. applications that never run in parallel to each other
813 ;
814 ; --------------------- local Data Users --------------------------------------
815 ; -------------- Applications using -------------
816 ; Mode local1 local2 local3
817 ; -----------------------------------------------------------------------------
818 ; sleepmode sleepmode.asm (unused) (unused)
819 ; surfmode surfmode.asm* (unused) (unused)
820 ; simulator simulator.asm (unused) (unused)
821 ; divemode divemode.asm ghostwriter.asm (unused)
822 ; logbook logboock.asm logbook.asm logbook.asm
823 ;
824 ; * assigned to this slot, but currently no local memory used
825
826 local1 equ 0x1D0 ; Alias for CBLOCK directive
827 local1 udata_ovr 0x1D0 ; Bank1 shared local space
828 res 0x10 ; 16 Byte (0x1D0 ... 0x1DF)
829
830 local2 equ 0x1E0 ; Alias for CBLOCK directive
831 local2 udata_ovr 0x1E0 ; Bank1 shared local space
832 res 0x10 ; 16 Byte (0x1E0 ... 0x1EF)
833
834 local3 equ 0x1F0 ; Alias for CBLOCK directive
835 local3 udata_ovr 0x1F0 ; Bank1 shared local space
836 res 0x10 ; 16 Byte (0x1F0 ... 0x1FF)
837
568 838
569 ;---------------------------- Common2 DATA ------------------------------------ 839 ;---------------------------- Common2 DATA ------------------------------------
570 840 common2 equ 0xA00 ; Alias for "banksel common2"
571 common2 equ 0xA00 ; Alias for "banksel common" 841 common2 udata_ovr common2 ; Bank 10 general variables
572 common2 udata_ovr common2 ; Bank1 general variables 842
573 843 s8_rawdata_sensor1 res 3 ; 24bit A/D raw data from S8 HUD sensor 1
574 s8_rawdata_sensor1 res 3 ; 24bit A/D raw data from S8 HUD sensor 1 844 s8_rawdata_sensor2 res 3 ; 24bit A/D raw data from S8 HUD sensor 2
575 s8_rawdata_sensor2 res 3 ; 24bit A/D raw data from S8 HUD sensor 2 845 s8_rawdata_sensor3 res 3 ; 24bit A/D raw data from S8 HUD sensor 3
576 s8_rawdata_sensor3 res 3 ; 24bit A/D raw data from S8 HUD sensor 3 846 hud_battery_mv res 2 ; hud/ppo2 monitor battery voltage in mV
577 847
578 hud_battery_mv res 2 ; hud/ppo2 monitor battery voltage in mV 848 start_day res 1 ; At start of dive (For logbook)
579 start_day res 1 ; At start of dive (For logbook) 849 start_month res 1 ; At start of dive (For logbook)
580 start_month res 1 ; At start of dive (For logbook) 850 start_year res 1 ; At start of dive (For logbook)
581 start_year res 1 ; At start of dive (For logbook) 851 start_hours res 1 ; At start of dive (For logbook)
582 start_hours res 1 ; At start of dive (For logbook) 852 start_mins res 1 ; At start of dive (For logbook)
583 start_mins res 1 ; At start of dive (For logbook) 853
584 854 opt_gas_type_backup res 5 ; 0=Disabled, 1=First, 2=Travel, 3=Deco * need to be in same bank
585 old_velocity res 4 ; Stores the last 4 speeds (8 seconds) in m/min 855 opt_dil_type_backup res 5 ; 0=Disabled, 1=First, 2=Normal + need to be in same bank
586 opt_gas_type_backup res 5 ; 0=Disabled, 1=First, 2=Travel, 3=Deco 856 opt_OC_bail_gas_change_backup res 5 ; Gas change depths OC/Bailout *
587 opt_dil_type_backup res 5 ; 0=Disabled, 1=First, 2=Normal 857 opt_dil_change_backup res 5 ; Gas change depths Diluents +
588 858
589 opt_OC_bail_gas_change_backup res 5 ; Gas change depths OC/Bailout 859 internal_battery_capacity res 2 ; For internal battery gauging
590 opt_dil_change_backup res 5 ; Gas change depths Diluents 860 battery_capacity res 2 ; For battery gauge IC
591 861 battery_offset res 2 ; For battery gauge IC
592 internal_battery_capacity res 2 ; For internal battery gauging 862 battery_type res 1 ; =0:1.5V, =1:3,6V Saft, =2:LiIon 3,7V/0.8Ah, =3:LiIon 3,7V/3.1Ah, =4: LiIon 3,7V/2.3Ah
593 battery_capacity res 2 ; For battery gauge IC 863 battery_acumulated_charge res 2 ; Raw values in battery gauge IC
594 battery_offset res 2 ; For battery gauge IC 864 gauge_status_byte res 1 ; Gauge IC status byte
595 865
596 analog_sw1_raw res 2 ; idle values (average) 866 analog_sw1_raw res 2 ; idle values (average)
597 analog_sw2_raw res 2 ; idle values (average) 867 analog_sw2_raw res 2 ; idle values (average)
598 analog_counter res 1 ; for averaging 868 analog_counter res 1 ; for averaging
599 analog_sw1 res 1 ; analog value for switch 1 869 analog_sw1 res 1 ; analog value for switch 1
600 analog_sw2 res 1 ; analog value for switch 2 870 analog_sw2 res 1 ; analog value for switch 2
601 battery_type res 1 ; =0:1.5V, =1:3,6V Saft, =2:LiIon 3,7V/0.8Ah, =3:LiIon 3,7V/3.1Ah, =4: LiIon 3,7V/2.3Ah 871 button_polarity res 1 ; 0xFF (Both normal), 0x00 (Both inverted), 0x01 (Left inverted only), 0x02 (Right inverted only)
602 uptime res 4 ; Uptime [s] 872
603 lastdive_time res 4 ; Time since last dive [s] 873 uptime res 4 ; Uptime [s]
604 lastdive_duration res 3 ; mins:2 and secs 874 lastdive_time res 4 ; Time since last dive [s]
605 lastdive_maxdepth res 2 ; in mbar 875 lastdive_duration res 3 ; mins:2 and secs
606 battery_acumulated_charge res 2 ; Raw values in battery gauge IC 876 lastdive_maxdepth res 2 ; in mbar
607 gauge_status_byte res 1 ; Gauge IC status byte 877
608 button_polarity res 1 ; 0xFF (Both normal), 0x00 (Both inverted), 0x01 (Left inverted only), 0x02 (Right inverted only) 878 rx_buffer res .48 ; Buffer for RX data (Slots 0-7)
609 gaslist_gas_global res 1 ; for color coding the gas lists 879 rx_firmware res 2 ; The RX firmware version xx.yy
610 ;active_gas_type res 1 ; 0=Disabled, 1=First, 2=Travel, 3=Deco for OC gases and 0=Disabled, 1=First, 2=Normal for diluents 880
611 rx_buffer res .48 ; Buffer for RX data (Slots 0-7) 881 customview_surfmode res 1 ; storage to remember last selected custom view in surface mode
612 rx_firmware res 2 ; The RX firmware version xx.yy 882 customview_divemode res 1 ; storage to remember last selected custom view in dive mode
613 883
614 gas6_O2_ratio res 1 ; gas6 O2 ratio 884 ambient_light res 2 ; ambient_light level
615 gas6_He_ratio res 1 ; gas6 He ratio 885 better_gas_number res 1 ; number (1-5) of the "better gas" in divemode, =0: no better gas available
616 gas6_temp res 1 ; temp used in divemenu_tree.asm 886 old_velocity res 4 ; Stores the last 4 speeds (8 seconds) in m/min
617 887
888 menustack res 5 ; menu stack from menu_processor.asm
889
890 gas6_O2_ratio res 1 ; gas6 O2 ratio
891 gas6_He_ratio res 1 ; gas6 He ratio
892 gas6_temp res 1 ; temp used in divemenu_tree.asm
893
894 ; ==> 134 bytes used - 122 bytes free
895
896
897 ;---------------------------- Bank 2 general purpose buffer -------------------
898 ; Reserved for general purpose buffer (strings, images, etc).
899 ; NOTE: Needs to be aligned with a bank (LOW(buffer)==0).
900
901 buffer udata_ovr 0x200
902
903 buffer res .256
904
905
906 ;---------------------------- Bank 14 for options table -----------------------
907 opt_table equ 0xE00
908 opt_table udata_ovr opt_table
909
910 ;---- Dive Options
911 opt_gas_O2_ratio res 5 ; Needed because deco gaslist use N2
912 opt_dil_O2_ratio res 5 ; Must be in line with opt_gas_O2_ratio
913 opt_gas_He_ratio res 5 ; He ratio Gas1-5
914 opt_dil_He_ratio res 5 ; Must be in line with opt_gas_He_ratio
915 opt_gas_type res 5 ; 0=Disabled, 1=First, 2=Travel, 3=Deco
916 opt_dil_type res 5 ; 0=Disabled, 1=First, 2=Normal ; Must be in line with opt_gas_type
917 opt_dive_mode res 1 ; 0=OC, 1=CC, 2=Gauge, 3=Apnea, 4=PSCR
918 opt_ccr_mode res 1 ; =0: Fixed SP, =1: Sensor
919 opt_OC_bail_gas_change res 5 ; Gas change depths OC/Bailout
920
921 ;---- Managing Settings
922 opt_brightness res 1 ; =0: Eco, =1:Medium, =2:Full
923 opt_salinity res 1 ; 0-5%
924 #DEFINE opt_name_length .60 ; Custom text string 5 rows with 12 chars
925 opt_name res opt_name_length
926 opt_language res 1 ; Current language. 0=EN, 1=DE, 2=FR, 3=SP
927 opt_units res 1 ; 0:m/°C, 1:ft/°F
928 opt_dateformat res 1 ; =0:MMDDYY, =1:DDMMYY, =2:YYMMDD
929 opt_last_stop res 1 ; =3:3m, =4:4m, =5:5m, =6:6m
930 opt_aGF_high res 1 ; Alternative GF HIGH
931 opt_aGF_low res 1 ; Alternative GF LOW
932 opt_GF_high res 1 ; GF HIGH
933 opt_GF_low res 1 ; GF LOW
934 opt_enable_aGF res 1 ; =1: aGF can be selected underwater
935 opt_compass_gain res 1 ; 0-7 (230LSB/Gauss to 1370LSB/Gaus)
936 opt_sampling_rate res 1 ; =1: 10s, =0: 2s
937 opt_dive_color_scheme res 1 ; 0-3
938 opt_pressure_adjust res 1 ; SIGNED char (two's complement), -20/+20mbar max.
939 opt_enable_safetystop res 1 ; =1: A safety stop is shown
940 opt_calibration_O2_ratio res 1 ; %O2 of calibration gas
941 opt_x_s1 res 2 ; calibration factor (Not stored in EEPROM)
942 opt_x_s2 res 2 ; calibration factor (Not stored in EEPROM)
943 opt_x_s3 res 2 ; calibration factor (Not stored in EEPROM)
944 opt_sensor_fallback res 1 ; NOT USED ANY MORE, KEPT FOR COMPATIBILITY WITH EEPROM IMAGE
945 opt_flip_screen res 1 ; =1: Flip the screen
946 opt_cR_button_left res 1 ; Left button sensitivity (cR hardware)
947 opt_cR_button_right res 1 ; Right button sensitivity (cR hardware)
948 opt_modwarning res 1 ; =1:do a red blinking warning, =0:default behaviour
949 opt_vsitextv2 res 1 ; =1:use the depth dependent ascend rate limits
950 opt_vsigraph res 1 ; =1:draw the graphical VSI bar
951 opt_showppo2 res 1 ; =1:always show the ppO2 value in the warning position
952 opt_temperature_adjust res 1 ; SIGNED char (two's complement), -2.0/+2.0 °C max.
953 opt_safety_stop_length res 1 ; [s]
954 opt_safety_stop_start res 1 ; [cbar]
955 opt_safety_stop_end res 1 ; [cbar]
956 opt_safety_stop_reset res 1 ; [cbar]
957 opt_diveTimeout res 1 ; Timeout for Divemode [min]
958 opt_sim_setpoint_number res 1 ; setpoint to use for deco calculation
959 opt_calc_asc_gasvolume res 1 ; calculate OC gas volume needs for ascent
960 opt_sim_use_aGF res 1 ; =0: use GF, =1: use aGF for deco calculation
961 opt_enable_IBCD res 1 ; enable IBCD warning
962 opt_sat_multiplier_gf res 1 ; Buhlmann safety factor for GF deco
963 opt_desat_multiplier_gf res 1 ; Buhlmann safety factor for GF deco
964 opt_sat_multiplier_non_gf res 1 ; Buhlmann safety factor for NON-GF deco
965 opt_desat_multiplier_non_gf res 1 ; Buhlmann safety factor for NON-GF deco
618 966
619 ;----------------------------------------------------------------------------- 967 ;-----------------------------------------------------------------------------
620 ; Reserve BANK2 for general purpose buffer (strings, images, etc).
621 ; NOTE: Needs to be aligned with a bank (LOW(buffer)==0).
622 buffer udata_ovr 0x200
623 buffer res .256
624
625 opt_table equ 0xE00
626 opt_table udata_ovr opt_table
627
628 ;---- Dive Options
629 opt_gas_O2_ratio res 5 ; Needed because deco gaslist use N2
630 opt_dil_O2_ratio res 5 ; Must be in line with opt_gas_O2_ratio
631 opt_gas_He_ratio res 5 ; He ratio Gas1-5
632 opt_dil_He_ratio res 5 ; Must be in line with opt_gas_He_ratio
633 opt_gas_type res 5 ; 0=Disabled, 1=First, 2=Travel, 3=Deco
634 opt_dil_type res 5 ; 0=Disabled, 1=First, 2=Normal -> ; Must be in line with opt_gas_type
635 opt_dive_mode res 1 ; 0=OC, 1=CC, 2=Gauge, 3=Apnea, 4=PSCR
636 opt_ccr_mode res 1 ; =0: Fixed SP, =1: Sensor
637 opt_OC_bail_gas_change res 5 ; Gas change depths OC/Bailout
638 char_I_dil_change res 5 ; Work-Around for 2.97 stable
639
640 ;---- Managing Settings
641 opt_brightness res 1 ; =0: Eco, =1:Medium, =2:Full
642 opt_salinity res 1 ; 0-5%
643 #DEFINE opt_name_length .60 ; Custom text string 5 rows with 12 chars
644 opt_name res opt_name_length
645 opt_language res 1 ; Current language. 0=EN, 1=DE, 2=FR, 3=SP
646 opt_units res 1 ; 0:m/°C, 1:ft/°F
647 opt_dateformat res 1 ; =0:MMDDYY, =1:DDMMYY, =2:YYMMDD
648 opt_last_stop res 1 ; =3:3m, =4:4m, =5:5m, =6:6m
649 opt_aGF_high res 1 ; Alternative GF HIGH
650 opt_aGF_low res 1 ; Alternative GF LOW
651 opt_GF_high res 1 ; GF HIGH
652 opt_GF_low res 1 ; GF LOW
653 opt_enable_aGF res 1 ; =1: aGF can be selected underwater
654 opt_compass_gain res 1 ; 0-7 (230LSB/Gauss to 1370LSB/Gaus)
655 opt_sampling_rate res 1 ; =1: 10s, =0: 2s
656 opt_dive_color_scheme res 1 ; 0-3
657 opt_pressure_adjust res 1 ; SIGNED int (two's complement), -20/+20mbar max.
658 opt_enable_safetystop res 1 ; =1: A safety stop is shown
659 opt_calibration_O2_ratio res 1 ; %O2 of calibration gas
660 opt_x_s1 res 2 ; calibration factor (Not stored in EEPROM)
661 opt_x_s2 res 2 ; calibration factor (Not stored in EEPROM)
662 opt_x_s3 res 2 ; calibration factor (Not stored in EEPROM)
663 opt_sensor_fallback res 1 ; NOT USED ANY MORE, KEPT FOR COMPATIBILITY WITH EEPROM IMAGE
664 opt_flip_screen res 1 ; =1: Flip the screen
665 opt_cR_button_left res 1 ; Left button sensitivity (cR hardware)
666 opt_cR_button_right res 1 ; Right button sensitivity (cR hardware)
667 opt_modwarning res 1 ; =1:do a red blinking warning, =0:default behaviour
668 opt_vsitextv2 res 1 ; =1:use the depth dependent ascend rate limits
669 opt_vsigraph res 1 ; =1:draw the graphical VSI bar
670 opt_showppo2 res 1 ; =1:always show the ppO2 value in the warning position
671 opt_temperature_adjust res 1 ; SIGNED int (two's complement), -2.0/+2.0 °C max.
672 opt_safety_stop_length res 1 ; [s]
673 opt_safety_stop_start res 1 ; [cbar]
674 opt_safety_stop_end res 1 ; [cbar]
675 opt_safety_stop_reset res 1 ; [cbar]
676 opt_diveTimeout res 1 ; Timeout for Divemode [min]
677 opt_sim_setpoint_number res 1 ; NEW setpoint to use for deco calculation
678 opt_calc_asc_gasvolume res 1 ; NEW calculate OC gas volume needs for ascent
679 opt_sim_use_aGF res 1 ; NEW use GF (no) or aGF (yes) for deco calculation
680 opt_enable_IBCD res 1 ; NEW enable IBCD warning
681 opt_sat_multiplier_gf res 1 ; Bühlmann safety factor for GF deco
682 opt_desat_multiplier_gf res 1 ; Bühlmann safety factor for GF deco
683 opt_sat_multiplier_non_gf res 1 ; Bühlmann safety factor for NON-GF deco
684 opt_desat_multiplier_non_gf res 1 ; Bühlmann safety factor for NON-GF deco
685
686 ;-----------------------------EEPROM DATA ------------------------------------
687 ; Automatic reset of all options when this is changed:
688 #define eeprom_opt_serial 0x0006 ; Version 0.6
689
690 ;-----------------------------------------------------------------------------
691 ; Flags
692 #DEFINE switch_left flag1,0
693 #DEFINE switch_right flag1,1
694 #DEFINE neg_flag flag1,2 ; e.g. sub16 (sub_c = sub_a - sub_b)
695 #DEFINE pressure_refresh flag1,3 ; =1: A new pressure/temperature is available
696 #DEFINE sleepmode flag1,4 ; =1: In Sleepmode
697 #DEFINE tft_is_dimming flag1,5 ; =1: The TFT is dimming, ignore light sensor
698 #DEFINE display_velocity flag1,6 ; =1: show velocity
699 #DEFINE no_sensor_int flag1,7 ; =1: block any further access to pressure sensor
700
701 #DEFINE rs232_recieve_overflow flag2,0 ; =1: An RS232 timeout overflow occoured
702 #DEFINE stored_gas_changed flag2,1 ; =1: Stored Gas changed
703 #DEFINE high_altitude_mode flag2,2 ; =1: Unit was manually turned on with ambient pressure <880mbar
704 #DEFINE FLAG_apnoe_mode flag2,3 ; =1: Apnoe mode selected
705 #DEFINE restore_deco_data flag2,4 ; =1: Restore deco data (After simulation)
706 #DEFINE premenu flag2,5 ; =1: Premenu/Divemenu selected
707 #DEFINE menubit flag2,6 ; menu
708 #DEFINE simulatormode_active flag2,7 ; =1: Simulator mode active, override pressure sensor readings
709
710 #DEFINE divemode_menu flag3,0 ; =1: Divemode menu is shown
711 #DEFINE onesecupdate flag3,1 ; =1: after any second
712 #DEFINE twosecupdate flag3,2 ; =1: New two-second update
713 #DEFINE toggle_customview flag3,3 ; =1: Next customview
714 #DEFINE oneminupdate flag3,4 ; =1: after any minute
715 #DEFINE divemode flag3,5 ; =1: in Divemode
716 #DEFINE battery_is_36v flag3,6 ; =1: 3,6V Battery is in use
717 #DEFINE warning_active flag3,7 ; =1: A warning is active in divemode or surfacemode
718
719 #DEFINE better_gas_available flag4,0 ; =1: A better gas is available
720 #DEFINE blinking_better_gas flag4,1 ; =1: Gas is blinking
721 #DEFINE menuview flag4,2 ; =1: A menuview is shown in divemode (e.g. "Menu?")
722 #DEFINE quarter_second_update flag4,3 ; =1: A new 1/4 second has begun
723 #DEFINE divemode_gaschange flag4,4 ; =1: The gas will change very soon
724 #DEFINE decostop_active flag4,5 ; =1: Decompression stop shown
725 #DEFINE depth_greater_100m flag4,6 ; =1: Current Depth > 100m
726 #DEFINE realdive flag4,7 ; =1: A real dive during divemode
727
728 #DEFINE dive_warning_displayed flag5,0 ; =1: The warning sign is shown
729 #DEFINE reset_average_depth flag5,1 ; =1: Reset the average depth
730 #DEFINE store_sample flag5,2 ; =1: Store a new sample
731 #DEFINE divemode2 flag5,3 ; =1: Dive longer then one minute
732 #DEFINE FLAG_active_descent flag5,4 ; Used in Apnoe mode
733 #DEFINE event_occured flag5,5 ; =1: An event occured, store it!
734 #DEFINE divemode_menu_active flag5,6 ; =1: The divemode menu is shown
735 #DEFINE temp_changed flag5,7 ; =1: The temperature changed
736
737 #DEFINE gas6_changed flag6,0 ; =1: Gas 6 has been selected/changed underwater
738 #DEFINE onehourupdate flag6,1 ; =1: A new hour has just begun
739 #DEFINE settime_setdate flag6,2 ; =1: In the Set Time or Set Date Menu
740 #DEFINE setpoint_changed flag6,3 ; =1: Setpoint has been changed
741 #DEFINE second_row_warning flag6,4 ; =1: The second row contains a warning
742 #DEFINE FLAG_ccr_mode flag6,5 ; =1: CCR mode (Fixed ppO2 or Sensor) active
743 #DEFINE dive_hud1_displayed flag6,6 ; =1: The Sensor1 HUD reading is displayed
744 #DEFINE dive_hud2_displayed flag6,7 ; =1: The Sensor2 HUD reading is displayed
745
746 #DEFINE dive_hud3_displayed flag7,0 ; =1: The Sensor3 HUD reading is displayed
747 #DEFINE no_more_divesecs flag7,1 ; =1: Do no longer show seconds in divemode
748 #DEFINE FLAG_gauge_mode flag7,2 ; =1: In Gauge mode
749 #DEFINE ignore_last_edited_gas flag7,3 ; Used in gaslist_cleanup_list
750 #DEFINE ccr_diluent_setup flag7,4 ; =1: Setting up Diluents ("Gas6-10")
751 #DEFINE menu_show_sensors flag7,5 ; =1: Update HUD data in menu ## NOT USED ANYMORE ##
752 #DEFINE short_gas_decriptions flag7,6 ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint
753 #DEFINE max_depth_greater_100m flag7,7 ; =1: Max. Depth > 100m
754
755 #DEFINE is_bailout flag8,0 ; =1: Bailout
756 #DEFINE is_bailout_menu flag8,1 ; =1: Bailout
757 #DEFINE toggle_gf flag8,2 ; =1: Toggle GF/aGF
758 #DEFINE use_agf flag8,3 ; =1: Use aGF (instead of GF)
759 #DEFINE battery_removed_in_usb flag8,4 ; =1: The battery has been removed in USB
760 #DEFINE adc_running flag8,5 ; =1: The ADC is in use
761 #DEFINE comm_service_enabled flag8,6 ; =1: COMM Service mode unlocked
762 #DEFINE compass_enabled flag8,7 ; =1: The compass and accelerometer chip is active
763
764 #DEFINE compass_fast_mode flag9,0 ; =1: The compass is in fast mode
765 #DEFINE in_color_menu flag9,1 ; =1: In the color scheme menu
766 #DEFINE bailoutgas_event flag9,2 ; =1: bailout was selected or a gaschange during bailout
767 #DEFINE win_invert flag9,3 ; =1: Invert font output
768 #DEFINE show_safety_stop flag9,4 ; =1: Show the safety stop
769 #DEFINE safety_stop_active flag9,5 ; =1: The safety stop is currently displayed
770 #DEFINE new_s8_data_available flag9,6 ; =1: New data frame recieved
771 #DEFINE print_compass_label flag9,7 ; =1: print the graphical comapss label
772
773 #DEFINE s8_digital flag10,0; =1: Digital I/O
774 #DEFINE menu_show_sensors2 flag10,1; =1: Update mV data in calibration menu
775 #DEFINE use_O2_sensor1 flag10,2; =1: Use this sensor for deco
776 #DEFINE use_O2_sensor2 flag10,3; =1: Use this sensor for deco
777 #DEFINE use_O2_sensor3 flag10,4; =1: Use this sensor for deco
778 #DEFINE setpoint_fallback flag10,5; =1: Fallback to SP1 due to external O2 sensor failure
779 #DEFINE blinking_setpoint flag10,6; =1: SP is blinking
780 #DEFINE flip_screen flag10,7; =1: Screen is flipped by 180°
781
782 #DEFINE sensor1_calibrated_ok flag11,0; =1: This sensor has been calibrated ok
783 #DEFINE sensor2_calibrated_ok flag11,1; =1: This sensor has been calibrated ok
784 #DEFINE sensor3_calibrated_ok flag11,2; =1: This sensor has been calibrated ok
785 #DEFINE voting_logic_sensor1 flag11,3; =1: This sensor is within the voting logic threshold
786 #DEFINE voting_logic_sensor2 flag11,4; =1: This sensor is within the voting logic threshold
787 #DEFINE voting_logic_sensor3 flag11,5; =1: This sensor is within the voting logic threshold
788 #DEFINE cc_active flag11,6; =1: Constant Current active (cR Hardware)
789 #DEFINE cv_active flag11,7; =1: Constant Voltage active (cR Hardware)
790
791 #DEFINE compass_bearing_set flag12,0 ; bearing set
792 #DEFINE compass_bearing_eq flag12,1 ; bearing is in direction? do not show << or >>
793 #DEFINE compass_bearing_lft flag12,2 ; bearing is to the left/<< if set, otherwise to the right/>>
794 #DEFINE compass_bearing_vis flag12,3 ; bearing is visible? (either ahead or behind/-180°)
795 #DEFINE compass_bearing_ahd flag12,4 ; bearing is ahead or behind?
796 #DEFINE blinking_depth_warning flag12,5 ; set by the color_depth. =1: warning color
797 #DEFINE blinking_depth_prev flag12,6 ; set by the TFT_depth. =1: prev display had warning color
798 #DEFINE blinking_depth_toggle flag12,7 ; toggle to blink
799
800 #DEFINE neg_flag_velocity flag13,0 ; neg_flag backup for velocity logic
801 #DEFINE analog_sw1_pressed flag13,1 ; =1: Analog switch 1 pressed
802 #DEFINE analog_sw2_pressed flag13,2 ; =1: Analog switch 2 pressed
803 #DEFINE sp2_switched flag13,3 ; =1: This setpoint has been autoselected already
804 #DEFINE sp3_switched flag13,4 ; =1: This setpoint has been autoselected already
805 #DEFINE sp4_switched flag13,5 ; =1: This setpoint has been autoselected already
806 #DEFINE sp5_switched flag13,6 ; =1: This setpoint has been autoselected already
807 #DEFINE use_old_batt_flag flag13,7 ; =1: load old battery information after power-on reset
808
809 #DEFINE FLAG_pscr_mode flag14,0 ; =1: OSTC is in PSCR mode
810 #DEFINE deep_sleep flag14,1 ; OSTC is in deep sleep (ignore buttons, etc)
811 #DEFINE sensors_agree flag14,2 ; =1: the ppO2 of all sensors are within the threshold range
812 #DEFINE gas_needs_attention flag14,3 ; =1: the gas needs attention has been raised before
813 #DEFINE gas_needs_warning flag14,4 ; =1: the gas needs warning has been raised before
814 #DEFINE sensor_warning flag14,5 ; =1: the sensors disagree warning has been raised before
815 #DEFINE alternative_divelayout flag14,6 ; =1: the alternative divelayout is used (aka Blind Mode)
816 #DEFINE i2c_error_flag flag14,7 ; =1: An I2C error occured
817
818
819 ; Update flags in divemode, =1: Update the screen
820 #DEFINE FLAG_TFT_divemode_mask tft_update_flags+0,0
821 #DEFINE FLAG_TFT_display_ndl_mask tft_update_flags+0,1
822 #DEFINE FLAG_TFT_depth tft_update_flags+0,2
823 #DEFINE FLAG_TFT_divemins tft_update_flags+0,3
824 #DEFINE FLAG_TFT_show_safety_stop tft_update_flags+0,4
825 #DEFINE FLAG_TFT_display_ndl tft_update_flags+0,5
826 #DEFINE FLAG_TFT_display_deko_mask tft_update_flags+0,6
827 #DEFINE FLAG_TFT_display_deko tft_update_flags+0,7
828 #DEFINE FLAG_TFT_display_tts tft_update_flags+1,0
829 #DEFINE FLAG_TFT_temp_divemode tft_update_flags+1,1
830 #DEFINE FLAG_TFT_divemode_warning tft_update_flags+1,2
831 #DEFINE FLAG_TFT_divemode_warning_clear tft_update_flags+1,3
832 #DEFINE FLAG_TFT_active_gas_divemode tft_update_flags+1,4
833 #DEFINE FLAG_TFT_clear_safety_stop tft_update_flags+1,5
834 #DEFINE FLAG_TFT_max_depth tft_update_flags+1,6
835 #DEFINE FLAG_TFT_divemode_mask_alt tft_update_flags+1,7
836 #DEFINE FLAG_TFT_dive_warning_text_clear tft_update_flags+2,0
837 #DEFINE FLAG_TFT_dive_warning_text_clr2 tft_update_flags+2,1
838 #DEFINE FLAG_TFT_max_depth_alt tft_update_flags+2,2
839 #DEFINE FLAG_TFT_big_deco_alt tft_update_flags+2,3
840 #define FLAG_TFT_not_defined_yet tft_update_flags+2,7 ; last usable flag within tft_update_flags memory space
841
842
843 ; Bit Masks for communication with p2_deco.c
844 #define DECO_STATUS_MASK .3
845
846 ; Bit Flags for communication with p2_deco.c - char_O_deco_status
847 #define DECO_STATUS_0_FLAG .0
848 #define DECO_STATUS_1_FLAG .1
849 #define DECO_MODE_LOOP_FLAG .2
850 #define DECO_MODE_PSCR_FLAG .3
851 #define DECO_PLAN_FLAG .4
852 #define DECO_CNS_FLAG .5
853 #define DECO_VOLUME_FLAG .6
854 #define DECO_ASCENT_FLAG .7
855
856 ; Bit Flags for communication with p2_deco.c - char_O_main_status
857 ;#define DECO_MODE_LOOP_FLAG .2
858 ;#define DECO_MODE_PSCR_FLAG .3
859 #define DECO_GASCHANGE_OVRD .4
860 #define DECO_BOTTOM_FLAG .6
861
862 ; Bit Values for communication with p2_deco.c
863 #define DECO_STATUS_INIT .3
864 #define DECO_MODE_LOOP .4
865 #define DECO_MODE_PSCR .8
866 #define DECO_PLAN_ALTERNATE .16
867 #define DECO_CNS_CALCULATE .32
868 #define DECO_VOLUME_CALCULATE .64
869 #define DECO_ASCENT_DELAYED .128
870
871 ; Bit Flags for char_O_deco_warnings
872 #define IBCD_warning .0
873 #define IBCD_warning_lock .1
874 #define mbubble_warning .2
875 #define mbubble_warning_lock .3
876 #define outside_warning .4
877 #define outside_warning_lock .5
878 #define stoptable_overflow .6
879 #define deco_flag .7
880
881 #define char_invalid_flag .7
882
883 #define int_invalid_flag .2
884 #define int_not_yet_computed .3
885 #define int_is_zero .3
886 #define int_low_flag .4
887 #define int_high_flag .5
888 #define int_prewarning_flag .6
889 #define int_warning_flag .7
890
891
892
893 ;=============================================================================
894 ; C-code Routines
895 ; PART 2
896 extern deco_calc_CNS_decrease_15min
897 extern deco_calc_desaturation_time
898 extern deco_calc_hauptroutine
899 extern deco_calc_wo_deco_step_1_min
900 extern deco_calc_dive_interval
901 extern deco_clear_tissue
902 extern deco_pull_tissues_from_vault
903 extern deco_push_tissues_to_vault
904