Mercurial > public > hwos_code
comparison src/hwos.inc @ 628:cd58f7fc86db
3.05 stable work
author | heinrichsweikamp |
---|---|
date | Thu, 19 Sep 2019 12:01:29 +0200 |
parents | 7bdcc591196c |
children | 237931377539 |
comparison
equal
deleted
inserted
replaced
627:bf5fee575701 | 628:cd58f7fc86db |
---|---|
1 ;============================================================================= | 1 ;============================================================================= |
2 ; | 2 ; |
3 ; File hwos.inc combined next generation V3.03.4 | 3 ; File hwos.inc combined next generation V3.04.3 |
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 ;============================================================================= |
33 #DEFINE comm_service_key 0xABCDEF ; simsalabim to establish data connection | 33 #DEFINE comm_service_key 0xABCDEF ; simsalabim to establish data connection |
34 | 34 |
35 | 35 |
36 ; Logo Address Vectors | 36 ; Logo Address Vectors |
37 #DEFINE hw_logo_block 0x01E000 ; color image data for heinrichsweikamp logo | 37 #DEFINE hw_logo_block 0x01E000 ; color image data for heinrichsweikamp logo |
38 #DEFINE usb_ble_logo_block 0x01EEDE ; color image data for USB or BLE logo | 38 #DEFINE usb_ble_logo_1 0x01EEDE ; color image data for USB or BLE logo |
39 #DEFINE usb_ble_logo_2 0x01EA04 ; color image data for USB or BLE logo, "+" bootloader | |
39 | 40 |
40 | 41 |
41 ;-----------------------------EEPROM DATA ------------------------------------ | 42 ;-----------------------------EEPROM DATA ------------------------------------ |
42 ; Automatic reset of all options when this is changed: | 43 ; Automatic reset of all options when this is changed: |
43 #DEFINE eeprom_opt_serial 0x0008 ; Version 0.8 | 44 #DEFINE eeprom_opt_serial 0x0008 ; Version 0.8 |
69 #DEFINE index_pressures_SAC .6 ; tank pressure and SAC rate | 70 #DEFINE index_pressures_SAC .6 ; tank pressure and SAC rate |
70 #DEFINE index_gas_needs_ascent .7 ; gas needs for ascent / cave return | 71 #DEFINE index_gas_needs_ascent .7 ; gas needs for ascent / cave return |
71 #DEFINE index_decoplan .8 ; deco plan | 72 #DEFINE index_decoplan .8 ; deco plan |
72 #DEFINE index_ceiling_GF_tissue .9 ; ceiling, current GF and tissues | 73 #DEFINE index_ceiling_GF_tissue .9 ; ceiling, current GF and tissues |
73 #DEFINE index_CNS .10 ; CNS values | 74 #DEFINE index_CNS .10 ; CNS values |
74 #DEFINE index_ppo2_ead_end_cns .11 ; ppO2, END/EAD and CNS | 75 #DEFINE index_ppo2_ead_end_cns .11 ; ppO2, END/EAD and CNS or gas density |
75 #DEFINE index_gf_factors .12 ; GF factors | 76 #DEFINE index_gf_factors .12 ; GF factors |
76 #DEFINE index_clock_batt_surfpress .13 ; clock, battery and surface pressure | 77 #DEFINE index_clock_batt_surfpress .13 ; clock, battery and surface pressure |
77 #DEFINE index_cv_dm_max .13 ; highest index in use in dive mode custom view | 78 #DEFINE index_cv_dm_max .13 ; highest index in use in dive mode custom view |
78 | 79 |
79 | 80 |
110 #DEFINE FT_LARGE .4 ; aa_font90_block, only digits, / and . | 111 #DEFINE FT_LARGE .4 ; aa_font90_block, only digits, / and . |
111 #DEFINE FT_HUGE .5 ; aa_font92_block, only digits, / and . | 112 #DEFINE FT_HUGE .5 ; aa_font92_block, only digits, / and . |
112 | 113 |
113 | 114 |
114 ; External O2 cell input Parameters | 115 ; External O2 cell input Parameters |
115 #DEFINE min_mv .80 ; = 8 mV | 116 #DEFINE min_mv .70 ; = 7 mV |
116 #DEFINE max_mv .2500 ; = 250 mV | 117 #DEFINE max_mv .2500 ; = 250 mV |
117 #DEFINE ignore_mv .3500 ; = 350 mV (to suppress ghost readings for long, open cables) | 118 #DEFINE ignore_mv .3500 ; = 350 mV (to suppress ghost readings for long, open cables) |
118 | 119 |
119 | 120 |
120 ; Profile Recording Parameters | 121 ; Profile Recording Parameters |
127 #DEFINE div_deco .6 ; x sampling rate [s] | 128 #DEFINE div_deco .6 ; x sampling rate [s] |
128 #DEFINE div_gf .12 ; x sampling rate [s] | 129 #DEFINE div_gf .12 ; x sampling rate [s] |
129 #DEFINE div_ppo2_sensors .2 ; x sampling rate [s] | 130 #DEFINE div_ppo2_sensors .2 ; x sampling rate [s] |
130 #DEFINE div_decoplan .12 ; x sampling rate [s] | 131 #DEFINE div_decoplan .12 ; x sampling rate [s] |
131 #DEFINE div_cns .12 ; x sampling rate [s] | 132 #DEFINE div_cns .12 ; x sampling rate [s] |
132 #DEFINE div_tank .0 ; x sampling rate [s] | 133 #DEFINE div_tank .12 ; x sampling rate [s] |
133 | 134 |
134 | 135 |
135 ; Profile Recording Data - Attention: Information Lengths must be < 16 ! | 136 ; Profile Recording Data - Attention: Information Lengths must be < 16 ! |
136 #DEFINE infolength_temperature .2 ; [byte] | 137 #DEFINE infolength_temperature .2 ; [byte] |
137 #DEFINE infolength_deco .2 ; [byte] | 138 #DEFINE infolength_deco .2 ; [byte] |
138 #DEFINE infolength_gf .1 ; [byte] | 139 #DEFINE infolength_gf .1 ; [byte] |
139 #DEFINE infolength_ppo2_sensors .9 ; [byte] | 140 #DEFINE infolength_ppo2_sensors .9 ; [byte] |
140 #DEFINE infolength_decoplan .15 ; [byte] | 141 #DEFINE infolength_decoplan .15 ; [byte] |
141 #DEFINE infolength_cns .2 ; [byte] | 142 #DEFINE infolength_cns .2 ; [byte] |
142 #DEFINE infolength_tank .0 ; [byte] | 143 #DEFINE infolength_tank .2 ; [byte] |
143 | 144 |
144 | 145 |
145 ; RX Functions | 146 ; RX Functions |
146 #DEFINE rx_packet_overdue_timeout .60 ; [seconds] | 147 #DEFINE rx_packet_overdue_timeout .120 ; [seconds] timeout for pressure measurements becomming declared as outdated (max. 255) |
147 #DEFINE max_pres_diff_min .5 ; [bar] minimum selectable pressure difference for ind.double mode | 148 #DEFINE max_pres_diff_min .5 ; [bar] minimum selectable pressure difference for ind.double mode |
148 #DEFINE max_pres_diff_max .50 ; [bar] maximum selectable pressure difference for ind.double mode | 149 #DEFINE max_pres_diff_max .50 ; [bar] maximum selectable pressure difference for ind.double mode |
150 | |
149 | 151 |
150 IFDEF _ccr_pscr | 152 IFDEF _ccr_pscr |
151 #DEFINE tr_pres_options .15 ; number of options for pressure measurement source / with diluents | 153 #DEFINE tr_pres_options .15 ; number of options for pressure measurement source / with diluents |
152 ELSE | 154 ELSE |
153 #DEFINE tr_pres_options .6 ; number of options for pressure measurement source / OC gases only | 155 #DEFINE tr_pres_options .6 ; number of options for pressure measurement source / OC gases only |
180 | 182 |
181 | 183 |
182 ; other Timeouts | 184 ; other Timeouts |
183 #DEFINE simulator_timeout .15 ; [s] | 185 #DEFINE simulator_timeout .15 ; [s] |
184 #DEFINE apnoe_timeout .15 ; [min] | 186 #DEFINE apnoe_timeout .15 ; [min] |
185 | 187 #DEFINE deep_sleep_10mins .144 ; [x 10mins] (24h in this example) |
186 | 188 |
187 ; Surface Mode Thresholds and Limits | 189 ; Surface Mode Thresholds and Limits |
188 #DEFINE high_altitude_threshold .880 ; [mbar] ambient pressure at which to switch into high altitude mode | 190 #DEFINE high_altitude_threshold .880 ; [mbar] ambient pressure at which to switch into high altitude mode |
189 #DEFINE max_surfpressure .1030 ; [mbar] maximum value for internal surface pressure | 191 #DEFINE max_surfpressure .1030 ; [mbar] maximum value for internal surface pressure |
190 | 192 |
194 #DEFINE dive_threshold_norm_alt_start .125 ; [mbar] relative pressure for normal altitude start-of-dive (equals depth in cm) | 196 #DEFINE dive_threshold_norm_alt_start .125 ; [mbar] relative pressure for normal altitude start-of-dive (equals depth in cm) |
195 #DEFINE dive_threshold_norm_alt_end .75 ; [mbar] relative pressure for normal altitude end-of-dive (equals depth in cm) | 197 #DEFINE dive_threshold_norm_alt_end .75 ; [mbar] relative pressure for normal altitude end-of-dive (equals depth in cm) |
196 #DEFINE dive_threshold_high_alt_start .325 ; [mbar] relative pressure for high altitude start-of-dive (equals depth in cm) | 198 #DEFINE dive_threshold_high_alt_start .325 ; [mbar] relative pressure for high altitude start-of-dive (equals depth in cm) |
197 #DEFINE dive_threshold_high_alt_end .75 ; [mbar] relative pressure for high altitude end-of-dive (equals depth in cm) | 199 #DEFINE dive_threshold_high_alt_end .75 ; [mbar] relative pressure for high altitude end-of-dive (equals depth in cm) |
198 #DEFINE ostc_depth_max .120 ; [m] maximum allowed operational depth for OSTC 2, 3, cR, TR, Plus & Sport | 200 #DEFINE ostc_depth_max .120 ; [m] maximum allowed operational depth for OSTC 2, 3, cR, TR, Plus & Sport |
201 #DEFINE deco_region_distance .2 ; [m] distance below first stop for the deco region to begin | |
199 | 202 |
200 | 203 |
201 ; Dive Mode Margins | 204 ; Dive Mode Margins |
202 #DEFINE ppO2_margin_on_max .300 ; [0.1 mbar] extra margin on ppO2 max values to compensate for surface pressures > 1000 hPa | 205 #DEFINE ppO2_margin_on_max .300 ; [0.1 mbar] extra margin on ppO2 max values to compensate for surface pressures > 1000 hPa |
203 #DEFINE sensor_voting_logic_threshold .10 ; threshold in 0.01 bar | 206 #DEFINE sensor_voting_logic_threshold .10 ; threshold in 0.01 bar |
211 #DEFINE ppo2_warning_loop_lowest .20 ; [cbar] minimum value for minimum ppO2 on loop | 214 #DEFINE ppo2_warning_loop_lowest .20 ; [cbar] minimum value for minimum ppO2 on loop |
212 #DEFINE ppo2_warning_loop_default .40 ; [cbar] default value for minimum ppO2 on loop | 215 #DEFINE ppo2_warning_loop_default .40 ; [cbar] default value for minimum ppO2 on loop |
213 #DEFINE ppo2_warning_loop_highest .60 ; [cbar] maximum value for minimum ppO2 on loop | 216 #DEFINE ppo2_warning_loop_highest .60 ; [cbar] maximum value for minimum ppO2 on loop |
214 | 217 |
215 #DEFINE ppo2_warning_high_lowest .120 ; [cbar] minimum value for maximum ppO2 in none-deco phase | 218 #DEFINE ppo2_warning_high_lowest .120 ; [cbar] minimum value for maximum ppO2 in none-deco phase |
219 #DEFINE ppo2_warning_deco_lowest .120 ; [cbar] minimum value for maximum ppO2 in deco phase | |
220 | |
216 #DEFINE ppo2_warning_high_default .140 ; [cbar] default value for maximum ppO2 in none-deco phase | 221 #DEFINE ppo2_warning_high_default .140 ; [cbar] default value for maximum ppO2 in none-deco phase |
222 #DEFINE ppo2_warning_deco_default .160 ; [cbar] default value for maximum ppO2 in deco phase | |
223 | |
224 IFDEF _high_ppO2_max | |
225 #DEFINE ppo2_warning_high_highest .200 ; [cbar] maximum value for maximum ppO2 in none-deco phase | |
226 #DEFINE ppo2_warning_deco_highest .200 ; [cbar] maximum value for maximum ppO2 in deco phase | |
227 ELSE | |
217 #DEFINE ppo2_warning_high_highest .160 ; [cbar] maximum value for maximum ppO2 in none-deco phase | 228 #DEFINE ppo2_warning_high_highest .160 ; [cbar] maximum value for maximum ppO2 in none-deco phase |
218 | |
219 #DEFINE ppo2_warning_deco_lowest .120 ; [cbar] minimum value for maximum ppO2 in deco phase | |
220 #DEFINE ppo2_warning_deco_default .160 ; [cbar] default value for maximum ppO2 in deco phase | |
221 #DEFINE ppo2_warning_deco_highest .160 ; [cbar] maximum value for maximum ppO2 in deco phase | 229 #DEFINE ppo2_warning_deco_highest .160 ; [cbar] maximum value for maximum ppO2 in deco phase |
222 | 230 ENDIF |
223 | |
224 ; Deco-Model Parameters | |
225 #DEFINE deco_distance .0 ; [dm] ex .10 | |
226 | 231 |
227 | 232 |
228 ; Color-Code Parameters for the Dive Mode | 233 ; Color-Code Parameters for the Dive Mode |
229 #DEFINE color_code_velocity_warn_high .11 ; [m/min] | 234 #DEFINE color_code_velocity_warn_high .11 ; [m/min] |
230 #DEFINE color_code_velocity_attn_high .10 ; [m/min] | 235 #DEFINE color_code_velocity_attn_high .10 ; [m/min] |
233 | 238 |
234 ; Simulator Parameters | 239 ; Simulator Parameters |
235 #DEFINE simulator_startdepth .200 ; [mbar] initial depth (relative pressure) when entering simulator mode | 240 #DEFINE simulator_startdepth .200 ; [mbar] initial depth (relative pressure) when entering simulator mode |
236 #DEFINE simulator_descent_threshold .50 ; [mbar] remaining distance to target pressure when to slow down descent | 241 #DEFINE simulator_descent_threshold .50 ; [mbar] remaining distance to target pressure when to slow down descent |
237 #DEFINE simulator_ascent_threshold .50 ; [mbar] remaining distance to target pressure when to slow down ascent | 242 #DEFINE simulator_ascent_threshold .50 ; [mbar] remaining distance to target pressure when to slow down ascent |
238 #DEFINE simulator_descent_rate .4 ; [mbar/0.125 sec] normal sescent speed, 4 equals 19 m/min | 243 #DEFINE simulator_descent_rate .5 ; [mbar/0.125 sec] normal descent speed, 5 equals 24 m/min |
239 #DEFINE simulator_ascent_rate .2 ; [mbar/0.125 sec] normal ascent speed, 2 equals 9 m/min | 244 #DEFINE simulator_ascent_rate .2 ; [mbar/0.125 sec] normal ascent speed, 2 equals 9 m/min |
240 | 245 |
241 | 246 |
242 ; Battery Thresholds | 247 ; Battery Thresholds |
243 #DEFINE max_battery_charge_temp .3231 ; [0.1 Kelvin] max allowed battery temperature during charging (equals 50°C) | 248 #DEFINE max_battery_charge_temp .3231 ; [0.1 Kelvin] max allowed battery temperature during charging (equals 50°C) |
244 #DEFINE lithium_36v_empty .2400 ; [mV] Saft 3.6 V LS14500 AA - threshold for battery percent display | 249 #DEFINE lithium_36v_empty .2400 ; [mV] Saft 3.6 V LS14500 AA - threshold for battery percent display |
245 #DEFINE lithium_36v_low .2000 ; [mV] Saft 3.6 V LS14500 AA - lowest possible voltage, value must be higher than value of aa_15v_high! | 250 #DEFINE lithium_36v_low .2000 ; [mV] Saft 3.6 V LS14500 AA - lowest possible voltage, value must be higher than value of aa_15v_high! |
246 #DEFINE aa_15v_high .1550 ; [mV] Energizer 1.5 V E2 AA - highest possible voltage, value must be lower than value of lithium_36v_low! | 251 #DEFINE aa_15v_high .1550 ; [mV] Energizer 1.5 V E2 AA - highest possible voltage, value must be lower than value of lithium_36v_low! |
247 #DEFINE aa_15v_low .1100 ; [mV] Energizer 1.5 V E2 AA - lowest possible voltage, according to Energizer data sheet EBC-4201R, page 2 | 252 #DEFINE aa_15v_low .1100 ; [mV] Energizer 1.5 V E2 AA - lowest possible voltage, according to Energizer data sheet EBC-4201R, page 2 |
248 #DEFINE battery_show_level .30 ; [%] threshold when to show battery level | 253 #DEFINE battery_show_level .30 ; [%] threshold when to show battery level |
249 #DEFINE color_code_battery_low .30 ; [%] threshold for battery level color coding, also acts as threshold for setting display brightness level to ECO when in dive mode | 254 #DEFINE battery_warn_level_36 .15 ; [%] threshold for 3.6 V battery warning, also acts as threshold for setting display brightness level to ECO when in dive mode |
255 #DEFINE battery_warn_level_15 .25 ; [%] threshold for 1.5 V battery warning, also acts as threshold for setting display brightness level to ECO when in dive modebattery warning level, also acts as threshold for setting display brightness level to ECO when in dive mode | |
250 | 256 |
251 | 257 |
252 ; 3.6 Volt Battery Sensing Data Points at 70 mA Load | 258 ; 3.6 Volt Battery Sensing Data Points at 70 mA Load |
253 #DEFINE lithium_36v_75 .3000 ; [mV] | 259 #DEFINE lithium_36v_75 .3000 ; [mV] |
254 #DEFINE lithium_36v_50 .2900 ; [mV] | 260 #DEFINE lithium_36v_50 .2900 ; [mV] |
255 #DEFINE lithium_36v_25 .2600 ; [mV] | 261 #DEFINE lithium_36v_25 .2600 ; [mV] |
256 #DEFINE lithium_36v_10 .2500 ; [mV] | 262 #DEFINE lithium_36v_10 .2500 ; [mV] |
257 | 263 |
264 | |
258 ; Capacity for 2.4 Ah Saft LS14500 and 0.8 Ah Panasonic UR14500P | 265 ; Capacity for 2.4 Ah Saft LS14500 and 0.8 Ah Panasonic UR14500P |
259 ; battery_gauge: 6 is nAs | 266 ; battery_gauge: 6 is nAs |
260 ; devide through 65536 | 267 ; devide through 65536 |
261 ; a) devide through 364 -> result is in percent of a 2.4 Ah battery | 268 ; a) devide through 364 -> result is in percent of a 2.4 Ah battery |
262 ; or b) devide through 121 -> result is in percent of a 0.8 Ah battery | 269 ; or b) devide through 121 -> result is in percent of a 0.8 Ah battery |
270 | |
263 | 271 |
264 ; internal Battery Gauging | 272 ; internal Battery Gauging |
265 #DEFINE capacity_saft_internal .364 | 273 #DEFINE capacity_saft_internal .364 |
266 #DEFINE capacity_panasonic_internal .121 | 274 #DEFINE capacity_panasonic_internal .121 |
267 | 275 |
301 #DEFINE ambient_light_max_eco .70 | 309 #DEFINE ambient_light_max_eco .70 |
302 #DEFINE ambient_light_min_eco .10 ; must be the lowest value! | 310 #DEFINE ambient_light_min_eco .10 ; must be the lowest value! |
303 | 311 |
304 | 312 |
305 ; IR Link Timeout | 313 ; IR Link Timeout |
306 #DEFINE ir_timeout_value .64 ; in multiples of 62.5 ms | 314 #DEFINE ir_timeout_value .128 ; in multiples of 62.5 ms |
307 | 315 |
308 | 316 |
309 ; Setpoint Control | 317 ; Setpoint Control |
310 #DEFINE surface_sp .50 ; in cbar | 318 #DEFINE surface_sp .50 ; in cbar |
311 | 319 |
350 #DEFINE DECO_START_NORM .0 ; =1: write: start calculation of a normal deco plan | 358 #DEFINE DECO_START_NORM .0 ; =1: write: start calculation of a normal deco plan |
351 #DEFINE DECO_START_ALT .1 ; =1: write: start calculation of an alternative deco plan | 359 #DEFINE DECO_START_ALT .1 ; =1: write: start calculation of an alternative deco plan |
352 #DEFINE DECO_COMPLETED_NORM .0 ; =1: read: calculation of a normal deco plan has completed | 360 #DEFINE DECO_COMPLETED_NORM .0 ; =1: read: calculation of a normal deco plan has completed |
353 #DEFINE DECO_COMPLETED_ALT .1 ; =1: read: calculation of an alternative deco plan has completed | 361 #DEFINE DECO_COMPLETED_ALT .1 ; =1: read: calculation of an alternative deco plan has completed |
354 #DEFINE DECO_INITIALIZE .2 ; =1: write: initialize deco engine (to be done only once at the begin of every dive) | 362 #DEFINE DECO_INITIALIZE .2 ; =1: write: initialize deco engine (to be done only once at the begin of every dive) |
355 ; .3 ; unused | 363 #DEFINE DECO_CALCULATOR_MODE .3 ; =1: deco engone is run from the deco calculator |
356 #DEFINE DECO_BAILOUT_FLAG .4 ; =1: allow gas switches before first deco stop (used in bailout plans) | 364 #DEFINE DECO_BAILOUT_FLAG .4 ; =1: allow gas switches before first deco stop (used in bailout plans) |
357 #DEFINE DECO_ASCENT_FLAG .5 ; =1: figure in a delayed ascent (fTTS) | 365 #DEFINE DECO_ASCENT_FLAG .5 ; =1: figure in a delayed ascent (fTTS) |
358 ; DECO_MODE_LOOP_FLAG .6 ; =1: calculate simulated tissues in loop mode (CCR or pSCR) | 366 ; DECO_MODE_LOOP_FLAG .6 ; =1: calculate simulated tissues in loop mode (CCR or pSCR) |
359 ; DECO_MODE_PSCR_FLAG .7 ; =1: calculate simulated tissues in pSCR mode (loop flag needs to be set, too) | 367 ; DECO_MODE_PSCR_FLAG .7 ; =1: calculate simulated tissues in pSCR mode (loop flag needs to be set, too) |
360 | 368 |
365 #DEFINE mbubble_warning .2 ; =1: microbubbles potentionally currently occuring | 373 #DEFINE mbubble_warning .2 ; =1: microbubbles potentionally currently occuring |
366 #DEFINE mbubble_warning_lock .3 ; =1: microbubbles potentionally occured during the dive | 374 #DEFINE mbubble_warning_lock .3 ; =1: microbubbles potentionally occured during the dive |
367 #DEFINE outside_warning .4 ; =1: currently outside the ZHL-16 model | 375 #DEFINE outside_warning .4 ; =1: currently outside the ZHL-16 model |
368 #DEFINE outside_warning_lock .5 ; =1: was outside the ZHL-16 model during the dive | 376 #DEFINE outside_warning_lock .5 ; =1: was outside the ZHL-16 model during the dive |
369 #DEFINE outside_attention .6 ; =1: currently near to the limits of the ZHL-16 model | 377 #DEFINE outside_attention .6 ; =1: currently near to the limits of the ZHL-16 model |
370 #DEFINE stoptable_overflow .7 ; =1: more stops needed than can be stored | 378 #DEFINE deco_plan_incomplete .7 ; =1: internal error: deco calculation incomplete |
371 | 379 |
372 | 380 |
373 ; Bit Flags for Communication with p2_deco.c - char_O_deco_info | 381 ; Bit Flags for Communication with p2_deco.c - char_O_deco_info |
374 #DEFINE deco_flag .0 ; =1: in deco mode, deco ppO2 levels permitted | 382 #DEFINE deco_mode .0 ; =1: in deco mode, deco ppO2 levels permitted |
375 #DEFINE ind_double_switch .1 ; =1: switch to other tank advice active | 383 #DEFINE ind_double_switch .1 ; =1: switch to other tank advice active |
376 ; .2 ; --- unused | 384 ; .2 ; --- unused |
377 #DEFINE deco_zone .3 ; =1: fTTS is <= TTS (not updated when in bailout mode) | 385 #DEFINE deco_zone .3 ; =1: fTTS is <= TTS (not updated when in bailout mode) |
378 #DEFINE deco_ceiling .4 ; =1: ceiling depth > 0 | 386 #DEFINE deco_ceiling .4 ; =1: ceiling depth > 0 |
379 #DEFINE deco_stops .5 ; =1: deco stops found | 387 #DEFINE deco_stops .5 ; =1: deco stops found |
433 #DEFINE ostc_rx_present HW_descriptor,5 ; =1: OSTC has RX module | 441 #DEFINE ostc_rx_present HW_descriptor,5 ; =1: OSTC has RX module |
434 #DEFINE lv_core HW_descriptor,6 ; =1: OSTC has low-voltage core (2.7V) | 442 #DEFINE lv_core HW_descriptor,6 ; =1: OSTC has low-voltage core (2.7V) |
435 ; HW_descriptor,7 ; --- reserved | 443 ; HW_descriptor,7 ; --- reserved |
436 | 444 |
437 ;---- Hardware - OSTC Model Variants (stored in access RAM, NOT cleared in restart) | 445 ;---- Hardware - OSTC Model Variants (stored in access RAM, NOT cleared in restart) |
438 #DEFINE screen_type HW_variants,0 ; =1: display 1, =0; display 0 | 446 #DEFINE screen_type1 HW_variants,0 ; =1: display type 1, =0; display type 0 |
439 #DEFINE screen_type2 HW_variants,1 ; =1: display 2, =0: display 0 or 1 | 447 #DEFINE screen_type2 HW_variants,1 ; =1: display type 2, =0: display type 0 or 1 |
440 #DEFINE compass_type HW_variants,2 ; =1: compass 1, =0: compass 0 | 448 #DEFINE screen_type3 HW_variants,2 ; =1: display type 3, =0: display type 0 or 1 or 2 |
441 #DEFINE compass_type2 HW_variants,3 ; =1: compass 2, =0: compass 0 or 1 | 449 #DEFINE compass_type1 HW_variants,3 ; =1: compass type 1, =0: compass type 0 |
442 #DEFINE analog_switches HW_variants,4 ; =1: analog switches available | 450 #DEFINE compass_type2 HW_variants,4 ; =1: compass type 2, =0: compass type 0 or 1 |
443 #DEFINE battery_is_36v HW_variants,5 ; =1: a 3.6 Volt battery is detected | 451 #DEFINE compass_type3 HW_variants,5 ; =1: compass type 3, =0: compass type 0 or 1 or 2 |
444 #DEFINE cc_active HW_variants,6 ; =1: constant current charging active (cR hardware only) | 452 #DEFINE analog_switches HW_variants,6 ; =1: analog switches available |
445 #DEFINE cv_active HW_variants,7 ; =1: constant voltage charging active (cR hardware only) | 453 #DEFINE battery_is_36v HW_variants,7 ; =1: a 3.6 Volt battery is detected |
446 | 454 |
447 #DEFINE compass_type3 HW_variants2,0 ; =1: compass 3, =0: compass 0, 1 or 2 | 455 |
448 | 456 ;---- Hardware - States 1 (stored in access RAM, cleared on restart) |
449 | 457 #DEFINE analog_sw1_pressed HW_flags_state1,0 ; =1: analog switch 1 pressed |
450 ;---- Hardware - States (stored in access RAM) | 458 #DEFINE analog_sw2_pressed HW_flags_state1,1 ; =1: analog switch 2 pressed |
451 #DEFINE analog_sw1_pressed HW_flags_state,0 ; =1: analog switch 1 pressed | 459 #DEFINE switch_left HW_flags_state1,2 ; =1: left button was pressed |
452 #DEFINE analog_sw2_pressed HW_flags_state,1 ; =1: analog switch 2 pressed | 460 #DEFINE switch_right HW_flags_state1,3 ; =1: right button was pressed |
453 #DEFINE switch_left HW_flags_state,2 ; =1: left button was pressed | 461 #DEFINE flip_screen HW_flags_state1,4 ; =1: screen is shown 180° turned |
454 #DEFINE switch_right HW_flags_state,3 ; =1: right button was pressed | 462 #DEFINE adc_is_running HW_flags_state1,5 ; =1: the ADC is in use |
455 #DEFINE flip_screen HW_flags_state,4 ; =1: screen is shown 180° turned | 463 #DEFINE tft_is_dimming HW_flags_state1,6 ; =1: the TFT is dimming, ignore light sensor |
456 #DEFINE adc_is_running HW_flags_state,5 ; =1: the ADC is in use | 464 #DEFINE compass_enabled HW_flags_state1,7 ; =1: the compass and accelerometer chip is active |
457 #DEFINE tft_is_dimming HW_flags_state,6 ; =1: the TFT is dimming, ignore light sensor | 465 |
458 #DEFINE compass_enabled HW_flags_state,7 ; =1: the compass and accelerometer chip is active | 466 ;---- Hardware - States 2 (stored in access RAM, NOT cleared on restart) |
467 #DEFINE cc_active HW_flags_state2,0 ; =1: constant current charging active (cR hardware only) | |
468 #DEFINE cv_active HW_flags_state2,1 ; =1: constant voltage charging active (cR hardware only) | |
469 ; HW_flags_state2,2 ; --- unused | |
470 ; HW_flags_state2,3 ; --- unused | |
471 ; HW_flags_state2,4 ; --- unused | |
472 ; HW_flags_state2,5 ; --- unused | |
473 ; HW_flags_state2,6 ; --- unused | |
474 ; HW_flags_state2,7 ; --- unused | |
459 | 475 |
460 | 476 |
461 ;---- Operating System - persistent Settings (stored in access RAM, NOT cleared in restart) | 477 ;---- Operating System - persistent Settings (stored in access RAM, NOT cleared in restart) |
462 #DEFINE sensor1_calibrated_ok OS_flags_persist,0 ; =1: sensor 1 calibration ok | 478 #DEFINE sensor1_calibrated_ok OS_flags_persist,0 ; =1: sensor 1 calibration ok |
463 #DEFINE sensor2_calibrated_ok OS_flags_persist,1 ; =1: sensor 2 calibration ok | 479 #DEFINE sensor2_calibrated_ok OS_flags_persist,1 ; =1: sensor 2 calibration ok |
523 #DEFINE use_aGF DM_flags_state,0 ; =1: use aGF, =0: use GF | 539 #DEFINE use_aGF DM_flags_state,0 ; =1: use aGF, =0: use GF |
524 #DEFINE sp_fallback DM_flags_state,1 ; =1: fall-back to SP1 due to external O2 sensor failure | 540 #DEFINE sp_fallback DM_flags_state,1 ; =1: fall-back to SP1 due to external O2 sensor failure |
525 #DEFINE dive_turned DM_flags_state,2 ; =1: dive is turned | 541 #DEFINE dive_turned DM_flags_state,2 ; =1: dive is turned |
526 #DEFINE cave_mode DM_flags_state,3 ; =1: in cave mode (gas needs by backtracking) | 542 #DEFINE cave_mode DM_flags_state,3 ; =1: in cave mode (gas needs by backtracking) |
527 #DEFINE depth_limit_exceeded DM_flags_state,4 ; =1: depth limit exceeded | 543 #DEFINE depth_limit_exceeded DM_flags_state,4 ; =1: depth limit exceeded |
528 ; DM_flags_state,5 ; --- unused | 544 #DEFINE deco_locked DM_flags_state,5 ; =1: in or has been in deco obligation during the dive |
529 ; DM_flags_state,6 ; --- unused | 545 #DEFINE deco_region DM_flags_state,6 ; =1: in or has been in the deco stops region during the dive |
530 ; DM_flags_state,7 ; --- unused | 546 ; DM_flags_state,7 ; --- unused |
531 | 547 |
532 ;---- Dive Mode - O2 Sensors | 548 ;---- Dive Mode - O2 Sensors |
533 #DEFINE use_O2_sensor1 DM_flags_sensor,0 ; =1: sensor 1 shall be used | 549 #DEFINE use_O2_sensor1 DM_flags_sensor,0 ; =1: sensor 1 shall be used |
534 #DEFINE use_O2_sensor2 DM_flags_sensor,1 ; =1: sensor 2 shall be used | 550 #DEFINE use_O2_sensor2 DM_flags_sensor,1 ; =1: sensor 2 shall be used |
813 | 829 |
814 ifndef ACCESS_RAM_VARS | 830 ifndef ACCESS_RAM_VARS |
815 | 831 |
816 extern HW_descriptor | 832 extern HW_descriptor |
817 extern HW_variants | 833 extern HW_variants |
818 extern HW_variants2 | 834 |
819 | 835 extern HW_flags_state1 |
820 extern HW_flags_state | 836 extern HW_flags_state2 |
821 | 837 |
822 extern OS_flags_persist | 838 extern OS_flags_persist |
823 extern OS_flags_ISR1 | 839 extern OS_flags_ISR1 |
824 extern OS_flags_ISR2 | 840 extern OS_flags_ISR2 |
825 | 841 |
1201 ; -------------- Applications using ---------------------- | 1217 ; -------------- Applications using ---------------------- |
1202 ; Mode local1 local2 local3 | 1218 ; Mode local1 local2 local3 |
1203 ; ----------------------------------------------------------------------------- | 1219 ; ----------------------------------------------------------------------------- |
1204 ; sleepmode sleepmode.asm (unused) (unused) | 1220 ; sleepmode sleepmode.asm (unused) (unused) |
1205 ; surfmode surfmode.asm* (unused) (unused) | 1221 ; surfmode surfmode.asm* (unused) (unused) |
1206 ; simulator simulator.asm (unused) (unused) | 1222 ; simulator divemode.asm divemode.asm simulator.asm |
1207 ; divemode divemode.asm divemode.asm ghostwriter.asm | 1223 ; divemode divemode.asm divemode.asm ghostwriter.asm |
1208 ; logbook logbook.asm logbook.asm logbook.asm | 1224 ; logbook logbook.asm logbook.asm logbook.asm |
1209 ; | 1225 ; |
1210 ; * assigned to this slot, but currently no local memory used | 1226 ; * assigned to this slot, but currently no local memory used |
1211 | 1227 |
1263 ;old_velocity res 4 ; stores the last 4 speeds (8 seconds) in m/min | 1279 ;old_velocity res 4 ; stores the last 4 speeds (8 seconds) in m/min |
1264 | 1280 |
1265 ;---- Menu Processor (8 byte) | 1281 ;---- Menu Processor (8 byte) |
1266 menustack res 8 ; menu stack | 1282 menustack res 8 ; menu stack |
1267 | 1283 |
1268 ;---- Graphical Compass (17 byte) | 1284 ;---- Graphical Compass (15 byte) |
1269 xRD res 2 ; virtual compass ruler offset | 1285 xRD res 2 ; virtual compass ruler offset |
1270 xRDr res 2 ; virtual compass ruler offset - right end | 1286 xRDr res 2 ; virtual compass ruler offset - right end |
1271 xRD180 res 2 ; virtual compass ruler offset for the -180 marker | 1287 xRD180 res 2 ; virtual compass ruler offset for the -180 marker |
1272 xLO res 1 ; lo backup to prevent trashing | 1288 xLO res 1 ; lo backup to prevent trashing |
1273 xHI res 1 ; hi backup to prevent trashing | 1289 xHI res 1 ; hi backup to prevent trashing |
1274 xCM res 1 ; compass bearing relative position | 1290 xCM res 1 ; compass bearing relative position |
1275 compass_heading_new res 2 ; corrected heading (in 1°) : -180 .. 180 | 1291 compass_heading_new res 2 ; corrected heading (in 1°) : -180 .. 180 |
1276 compass_heading_old res 2 ; old heading (for smoother display) | |
1277 compass_heading_shown res 2 ; displayed heading | 1292 compass_heading_shown res 2 ; displayed heading |
1278 compass_bearing res 2 ; displayed bearing | 1293 compass_bearing res 2 ; displayed bearing |
1279 | 1294 |
1280 ;---- Compass Arithmetics (30 byte) | 1295 ;---- Compass Arithmetics (30 byte) |
1281 compass_DX res 2 ; raw data | 1296 compass_DX res 2 ; raw data |
1304 rx_buffer res .48 ; Buffer for RX data (slots 0-7) | 1319 rx_buffer res .48 ; Buffer for RX data (slots 0-7) |
1305 rx_firmware_cur_major res 1 ; TR module current firmware, major | 1320 rx_firmware_cur_major res 1 ; TR module current firmware, major |
1306 rx_firmware_cur_minor res 1 ; TR module current firmware, minor | 1321 rx_firmware_cur_minor res 1 ; TR module current firmware, minor |
1307 ENDIF | 1322 ENDIF |
1308 | 1323 |
1309 ;---- SAC Calculation on Pressure Readings 1 & 2 (20 byte) | 1324 ;---- SAC Calculation on Pressure Readings 1 & 2 (22 byte) |
1310 IFDEF _rx_functions | 1325 IFDEF _rx_functions |
1311 pres_accu_1st res 4 ; accumulator for pressure drop in 1/160 bar | ATTENTION: do not | 1326 pres_accu_1st res 4 ; accumulator for pressure drop in 1/160 bar | ATTENTION: do not |
1312 pres_accu_2nd res 4 ; accumulator for pressure drop in 1/160 bar | change the | 1327 pres_accu_2nd res 4 ; accumulator for pressure drop in 1/160 bar | change the |
1313 time_accu_1st res 1 ; accumulator for reading ages in seconds | position | 1328 time_accu_1st res 2 ; accumulator for reading ages in seconds | position |
1314 gas__last_1st res 1 ; last gas assignment | of these | 1329 gas__last_1st res 1 ; last gas assignment | of these |
1315 time_accu_2nd res 1 ; accumulator for reading ages in seconds | variables | 1330 time_accu_2nd res 2 ; accumulator for reading ages in seconds | variables |
1316 gas__last_2nd res 1 ; last gas assignment | relative | 1331 gas__last_2nd res 1 ; last gas assignment | relative |
1317 pres_last_1st res 2 ; last pressure reading pressure in 1/160 bar | to each | 1332 pres_last_1st res 2 ; last pressure reading pressure in 1/160 bar | to each |
1318 pres_last_2nd res 2 ; last pressure reading pressure in 1/160 bar | other! | 1333 pres_last_2nd res 2 ; last pressure reading pressure in 1/160 bar | other! |
1319 time_last_1st res 2 ; last pressure reading time in seconds | | 1334 time_last_1st res 2 ; last pressure reading time in seconds | |
1320 time_last_2nd res 2 ; last pressure reading time in seconds | | 1335 time_last_2nd res 2 ; last pressure reading time in seconds | |