Mercurial > public > hwos_code
annotate src/hwos.inc @ 631:185ba2f91f59
3.09 beta 1 release
author | heinrichsweikamp |
---|---|
date | Fri, 28 Feb 2020 15:45:07 +0100 |
parents | 237931377539 |
children | 4050675965ea |
rev | line source |
---|---|
0 | 1 ;============================================================================= |
2 ; | |
631 | 3 ; File hwos.inc combined next generation V3.08.8 |
0 | 4 ; |
623 | 5 ; OSTC Platform Definitions |
0 | 6 ; |
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | |
8 ;============================================================================= | |
9 ; HISTORY | |
604 | 10 ; 2011-05-24 : [jDG] Cleanups from initial Matthias code |
0 | 11 ;============================================================================= |
12 | |
623 | 13 |
14 ; Hardware Configuration | |
15 LIST P=18F87K22 ; compiler settings, if changed change also: Configure -> SelectDevice in MPLAB | |
16 #include "p18f87k22.inc" ; processor definitions | |
17 #include "ports.inc" ; port map definitions | |
0 | 18 |
604 | 19 |
623 | 20 ; Software Configuration |
21 #include "configuration.inc" ; OSTC hwOS configuration | |
582 | 22 |
0 | 23 |
623 | 24 ; Language Codes |
604 | 25 #DEFINE none 0 ; no language selected |
623 | 26 #DEFINE en 1 ; select English |
27 #DEFINE de 2 ; select German | |
28 #DEFINE fr 3 ; select French | |
29 #DEFINE it 4 ; select Italian | |
604 | 30 |
560 | 31 |
623 | 32 ; Magic Cookie Definition |
631 | 33 #DEFINE comm_service_key 0xABCDEF ; simsalabim to establish comm service mode |
0 | 34 |
35 | |
604 | 36 ; Logo Address Vectors |
37 #DEFINE hw_logo_block 0x01E000 ; color image data for heinrichsweikamp logo | |
628 | 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 | |
604 | 40 |
41 | |
582 | 42 ;-----------------------------EEPROM DATA ------------------------------------ |
43 ; Automatic reset of all options when this is changed: | |
631 | 44 #DEFINE eeprom_opt_version .8 ; range: 16 bit |
45 #DEFINE eeprom_vault_version .1 ; range: 8 bit | |
0 | 46 ;----------------------------------------------------------------------------- |
47 | |
623 | 48 |
582 | 49 #DEFINE CCP1CON_VALUE b'00001100' ; PWM1 for LED dimming |
623 | 50 #DEFINE T2CON_ECO b'01111110' |
51 #DEFINE T2CON_NORMAL b'01111110' | |
52 #DEFINE T2CON_FASTEST b'01111110' | |
53 | |
54 | |
55 ; CPU speeds | |
56 #DEFINE coding_speed_eco .1 ; 1 MHz = eco speed | |
57 #DEFINE coding_speed_normal .2 ; 16 MHz = normal speed | |
58 #DEFINE coding_speed_fastest .4 ; 64 MHz = fastest speed (32 MHz on OSTC Sport BLE) | |
59 | |
60 #DEFINE speed_is_eco cpu_speed_state,0 ; =1: CPU is running at eco speed | |
61 #DEFINE speed_is_normal cpu_speed_state,1 ; =1: CPU is running at normal speed | |
62 #DEFINE speed_is_fastest cpu_speed_state,2 ; =1: CPU is running at fastest speed | |
63 | |
604 | 64 |
65 ; Divemode Custom View Indexes - Attention: these numbers need to be in line with the jump tables in customview.asm! | |
631 | 66 #DEFINE index_blank .0 ; blank view |
604 | 67 #DEFINE index_avr_stopwatch .1 ; average depth and stopwatch |
68 #DEFINE index_compass_dm .2 ; compass | |
69 #DEFINE index_ppo2_sensors .3 ; ppO2 sensors | |
70 #DEFINE index_sensor_check .4 ; sensor check | |
71 #DEFINE index_pscr_info .5 ; pSCR data | |
72 #DEFINE index_pressures_SAC .6 ; tank pressure and SAC rate | |
73 #DEFINE index_gas_needs_ascent .7 ; gas needs for ascent / cave return | |
631 | 74 #DEFINE index_cave_tts .8 ; cave mode TTS |
75 #DEFINE index_decoplan .9 ; deco plan | |
76 #DEFINE index_ceiling_GF_tissue .10 ; ceiling, current GF and tissues | |
77 #DEFINE index_CNS .11 ; CNS values | |
78 #DEFINE index_ppo2_ead_end_cns .12 ; ppO2, END/EAD and CNS or gas density | |
604 | 79 #DEFINE index_clock_batt_surfpress .13 ; clock, battery and surface pressure |
631 | 80 #DEFINE index_gf_factors .14 ; GF factors |
81 #DEFINE index_cave_waypoints .15 ; cave waypoints | |
82 #DEFINE index_cv_dm_max .13 ; highest index used in normal custom view rotation | |
28 | 83 |
623 | 84 |
0 | 85 ; Timing for button hold-down flags |
631 | 86 #DEFINE TMR1H_VALUE_FIRST .255-.128 ; in steps of 7.8125 ms -> 1.00 s |
604 | 87 #DEFINE TMR1H_VALUE_CONT .255-.32 ; in steps of 7.8125 ms -> 0.25 s |
631 | 88 #DEFINE TMR1H_VALUE_CONT_DIVE .255-.64 ; in steps of 7.8125 ms -> 0.50 s |
0 | 89 |
623 | 90 |
604 | 91 ; Color Definitions: 8 bit RGB b'RRRGGGBB' |
582 | 92 #DEFINE color_red b'11100000' ; (7,0,0) |
93 #DEFINE color_dark_red b'10000101' ; (4,1,1) | |
94 #DEFINE color_violet b'11101011' ; (7,2,3) | |
95 #DEFINE color_blue b'11000111' ; (6,1,3) | |
96 #DEFINE color_green b'00011100' ; (0,7,0) | |
97 #DEFINE color_greenish b'00111110' ; (1,7,2) | |
98 #DEFINE color_dark_green b'00111001' ; (1,6,1) | |
99 #DEFINE color_yellow b'11111101' ; (7,7,1) | |
100 #DEFINE color_white b'11111111' ; (7,7,3) | |
101 #DEFINE color_black b'00000000' ; (0,0,0) | |
102 #DEFINE color_deepblue b'00000010' ; (0,0,2) | |
103 #DEFINE color_grey b'11011111' ; (6,7,3) | |
104 #DEFINE color_cyan b'11011111' ; (6,7,3) | |
105 #DEFINE color_lightblue b'11011011' ; (6,7,3) | |
106 #DEFINE color_orange b'11111000' ; (7,6,0) | |
107 #DEFINE color_pink b'11111010' ; (7,6,2) | |
0 | 108 |
623 | 109 |
110 ; Font Sizes | |
111 #DEFINE FT_TINY .0 ; aa_font16_block, full character set | |
112 #DEFINE FT_SMALL .1 ; aa_font28_block, full character set | |
113 #DEFINE FT_STANDARD .2 ; aa_font34_block, full character set | |
114 #DEFINE FT_MEDIUM .3 ; aa_font48_block, only digits, /, ., :, ;, <, =, > and ? | |
115 #DEFINE FT_LARGE .4 ; aa_font90_block, only digits, / and . | |
116 #DEFINE FT_HUGE .5 ; aa_font92_block, only digits, / and . | |
117 | |
0 | 118 |
604 | 119 ; External O2 cell input Parameters |
628 | 120 #DEFINE min_mv .70 ; = 7 mV |
604 | 121 #DEFINE max_mv .2500 ; = 250 mV |
122 #DEFINE ignore_mv .3500 ; = 350 mV (to suppress ghost readings for long, open cables) | |
0 | 123 |
623 | 124 |
604 | 125 ; Profile Recording Parameters |
631 | 126 #DEFINE logbook_profile_version 0x24 ; logbook recording format |
582 | 127 #DEFINE samplingrate_apnoe .1 ; [seconds] |
560 | 128 |
623 | 129 |
130 ; Profile Recording Rates - Attention: all Divisors must be < 16 ! | |
604 | 131 #DEFINE div_temperature .6 ; x sampling rate [s] |
132 #DEFINE div_deco .6 ; x sampling rate [s] | |
133 #DEFINE div_gf .12 ; x sampling rate [s] | |
134 #DEFINE div_ppo2_sensors .2 ; x sampling rate [s] | |
135 #DEFINE div_decoplan .12 ; x sampling rate [s] | |
136 #DEFINE div_cns .12 ; x sampling rate [s] | |
628 | 137 #DEFINE div_tank .12 ; x sampling rate [s] |
560 | 138 |
623 | 139 |
140 ; Profile Recording Data - Attention: Information Lengths must be < 16 ! | |
582 | 141 #DEFINE infolength_temperature .2 ; [byte] |
142 #DEFINE infolength_deco .2 ; [byte] | |
143 #DEFINE infolength_gf .1 ; [byte] | |
144 #DEFINE infolength_ppo2_sensors .9 ; [byte] | |
145 #DEFINE infolength_decoplan .15 ; [byte] | |
146 #DEFINE infolength_cns .2 ; [byte] | |
628 | 147 #DEFINE infolength_tank .2 ; [byte] |
0 | 148 |
623 | 149 |
150 ; RX Functions | |
628 | 151 #DEFINE rx_packet_overdue_timeout .120 ; [seconds] timeout for pressure measurements becomming declared as outdated (max. 255) |
604 | 152 #DEFINE max_pres_diff_min .5 ; [bar] minimum selectable pressure difference for ind.double mode |
153 #DEFINE max_pres_diff_max .50 ; [bar] maximum selectable pressure difference for ind.double mode | |
0 | 154 |
628 | 155 |
623 | 156 IFDEF _ccr_pscr |
157 #DEFINE tr_pres_options .15 ; number of options for pressure measurement source / with diluents | |
158 ELSE | |
159 #DEFINE tr_pres_options .6 ; number of options for pressure measurement source / OC gases only | |
160 ENDIF | |
161 | |
631 | 162 |
623 | 163 ; Cave Mode |
164 IFDEF _cave_mode | |
631 | 165 #DEFINE backtrack_waypoint_max .30 ; highest user-available waypoint number (max allowed: 30) |
166 #DEFINE backtrack_almost_full_threshold .240 ; backtrack index position at which the almost full flag will be set | |
167 #DEFINE backtrack_entire_full_threshold .250 ; backtrack index position at which the entirely full flag will be set | |
623 | 168 ENDIF |
169 | |
170 | |
604 | 171 ; Gas Needs Settings |
172 #DEFINE min_tank_size .1 ; [liter] | |
173 #DEFINE max_tank_size .40 ; [liter] | |
174 #DEFINE min_fill_press .5 ; [0 bar] value is in multiples of 10 bar | |
175 #DEFINE max_fill_press .29 ; [0 bar] value is in multiples of 10 bar, no 300 bar due to too far beyond ideal gas laws | |
176 | |
177 | |
623 | 178 ; Timeouts for Menus |
631 | 179 #DEFINE surfmode_timeout_default .240 ; [s] default timeout for surface mode and surface menus |
180 #DEFINE surfmode_timeout_aa_15v .90 ; [s] timeout for surface mode and surface menus when on 1.5V battery | |
181 #DEFINE surfmode_timeout_simulator .240 ; [s] special timeout for simulator mode | |
182 ;#DEFINE surfmode_timeout_sensor .240 ; [s] special timeout for surface mode when in CCR/pSCR sensor mode | |
183 ;#DEFINE surfmode_timeout_calibrate .240 ; [s] special timeout when in surface CCR calibrate sensors menu | |
184 ;#DEFINE surfmode_timeout_xmitter .240 ; [s] special timeout when in surface transmitter pairing menu | |
604 | 185 |
623 | 186 #DEFINE divemode_timeout_premenu .10 ; [s] timeout for dive mode pre-menu |
187 #DEFINE divemode_timeout_mainmenu .30 ; [s] timeout for dive mode main menu | |
188 | |
189 | |
631 | 190 ; RS232 Timeout |
191 #DEFINE rx_timeout .400 ; [ms] timeout for RS232 RX | |
192 | |
193 | |
194 ; Dive-End Timeouts | |
195 #DEFINE simulator_timeout_normal .90 ; [min] timeout simulator mode | |
196 #DEFINE simulator_timeout_cave .240 ; [min] timeout simulator mode (cave mode) | |
197 #DEFINE apnoe_timeout .15 ; [min] timeout at surface in apnoe mode | |
198 #DEFINE simulator_timeout .15 ; [s] timeout at surface in simulator mode | |
199 | |
200 | |
623 | 201 ; other Timeouts |
631 | 202 #DEFINE deep_sleep_10mins .144 ; [x 10mins] (24h in this example) |
203 | |
582 | 204 |
623 | 205 ; Surface Mode Thresholds and Limits |
206 #DEFINE high_altitude_threshold .880 ; [mbar] ambient pressure at which to switch into high altitude mode | |
207 #DEFINE max_surfpressure .1030 ; [mbar] maximum value for internal surface pressure | |
560 | 208 |
209 | |
623 | 210 ; Dive Mode Thresholds and Limits |
211 #DEFINE wake_up_from_sleep .1160 ; [mbar] absolute pressure at which to switch from sleep mode to surface / dive mode | |
212 #DEFINE dive_threshold_norm_alt_start .125 ; [mbar] relative pressure for normal altitude start-of-dive (equals depth in cm) | |
213 #DEFINE dive_threshold_norm_alt_end .75 ; [mbar] relative pressure for normal altitude end-of-dive (equals depth in cm) | |
214 #DEFINE dive_threshold_high_alt_start .325 ; [mbar] relative pressure for high altitude start-of-dive (equals depth in cm) | |
215 #DEFINE dive_threshold_high_alt_end .75 ; [mbar] relative pressure for high altitude end-of-dive (equals depth in cm) | |
216 #DEFINE ostc_depth_max .120 ; [m] maximum allowed operational depth for OSTC 2, 3, cR, TR, Plus & Sport | |
628 | 217 #DEFINE deco_region_distance .2 ; [m] distance below first stop for the deco region to begin |
192 | 218 |
582 | 219 |
623 | 220 ; Dive Mode Margins |
221 #DEFINE ppO2_margin_on_max .300 ; [0.1 mbar] extra margin on ppO2 max values to compensate for surface pressures > 1000 hPa | |
604 | 222 #DEFINE sensor_voting_logic_threshold .10 ; threshold in 0.01 bar |
0 | 223 |
623 | 224 |
631 | 225 ; Gas and Dil types |
226 #DEFINE num_gas_types .4 ; Disabled, First, Normal, Deco | |
227 #DEFINE num_dil_types .3 ; Disabled, First, Normal | |
228 | |
229 | |
623 | 230 ; ppO2 Limits |
231 #DEFINE ppo2_warning_low_lowest .15 ; [cbar] minimum value for minimum ppO2 on OC | |
232 #DEFINE ppo2_warning_low_default .17 ; [cbar] default value for minimum ppO2 on OC | |
233 #DEFINE ppo2_warning_low_highest .21 ; [cbar] maximum value for minimum ppO2 on OC | |
234 | |
235 #DEFINE ppo2_warning_loop_lowest .20 ; [cbar] minimum value for minimum ppO2 on loop | |
236 #DEFINE ppo2_warning_loop_default .40 ; [cbar] default value for minimum ppO2 on loop | |
237 #DEFINE ppo2_warning_loop_highest .60 ; [cbar] maximum value for minimum ppO2 on loop | |
238 | |
239 #DEFINE ppo2_warning_high_lowest .120 ; [cbar] minimum value for maximum ppO2 in none-deco phase | |
628 | 240 #DEFINE ppo2_warning_deco_lowest .120 ; [cbar] minimum value for maximum ppO2 in deco phase |
241 | |
623 | 242 #DEFINE ppo2_warning_high_default .140 ; [cbar] default value for maximum ppO2 in none-deco phase |
243 #DEFINE ppo2_warning_deco_default .160 ; [cbar] default value for maximum ppO2 in deco phase | |
628 | 244 |
245 IFDEF _high_ppO2_max | |
246 #DEFINE ppo2_warning_high_highest .200 ; [cbar] maximum value for maximum ppO2 in none-deco phase | |
247 #DEFINE ppo2_warning_deco_highest .200 ; [cbar] maximum value for maximum ppO2 in deco phase | |
248 ELSE | |
249 #DEFINE ppo2_warning_high_highest .160 ; [cbar] maximum value for maximum ppO2 in none-deco phase | |
623 | 250 #DEFINE ppo2_warning_deco_highest .160 ; [cbar] maximum value for maximum ppO2 in deco phase |
628 | 251 ENDIF |
623 | 252 |
631 | 253 ; Salinity Limits |
254 #DEFINE salinity_min .0 ; [%] minimum value for salinity percentage | |
255 #DEFINE salinity_max .4 ; [%] maximum value for salinity percentage | |
0 | 256 |
604 | 257 ; Color-Code Parameters for the Dive Mode |
582 | 258 #DEFINE color_code_velocity_warn_high .11 ; [m/min] |
259 #DEFINE color_code_velocity_attn_high .10 ; [m/min] | |
623 | 260 #DEFINE velocity_display_threshold .3 ; [m/min] |
261 | |
262 | |
263 ; Simulator Parameters | |
264 #DEFINE simulator_startdepth .200 ; [mbar] initial depth (relative pressure) when entering simulator mode | |
265 #DEFINE simulator_descent_threshold .50 ; [mbar] remaining distance to target pressure when to slow down descent | |
266 #DEFINE simulator_ascent_threshold .50 ; [mbar] remaining distance to target pressure when to slow down ascent | |
628 | 267 #DEFINE simulator_descent_rate .5 ; [mbar/0.125 sec] normal descent speed, 5 equals 24 m/min |
623 | 268 #DEFINE simulator_ascent_rate .2 ; [mbar/0.125 sec] normal ascent speed, 2 equals 9 m/min |
269 | |
0 | 270 |
604 | 271 ; Battery Thresholds |
623 | 272 #DEFINE max_battery_charge_temp .3231 ; [0.1 Kelvin] max allowed battery temperature during charging (equals 50°C) |
604 | 273 #DEFINE lithium_36v_empty .2400 ; [mV] Saft 3.6 V LS14500 AA - threshold for battery percent display |
623 | 274 #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! |
275 #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! | |
276 #DEFINE aa_15v_low .1100 ; [mV] Energizer 1.5 V E2 AA - lowest possible voltage, according to Energizer data sheet EBC-4201R, page 2 | |
277 #DEFINE battery_show_level .30 ; [%] threshold when to show battery level | |
628 | 278 #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 |
631 | 279 #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 mode |
0 | 280 |
623 | 281 |
282 ; 3.6 Volt Battery Sensing Data Points at 70 mA Load | |
582 | 283 #DEFINE lithium_36v_75 .3000 ; [mV] |
284 #DEFINE lithium_36v_50 .2900 ; [mV] | |
285 #DEFINE lithium_36v_25 .2600 ; [mV] | |
286 #DEFINE lithium_36v_10 .2500 ; [mV] | |
604 | 287 |
628 | 288 |
604 | 289 ; Capacity for 2.4 Ah Saft LS14500 and 0.8 Ah Panasonic UR14500P |
623 | 290 ; battery_gauge: 6 is nAs |
448 | 291 ; devide through 65536 |
604 | 292 ; a) devide through 364 -> result is in percent of a 2.4 Ah battery |
293 ; or b) devide through 121 -> result is in percent of a 0.8 Ah battery | |
37
0e1723f2761e
use four additional data points for the battery monitor
mh@mh-THINK.fritz.box
parents:
35
diff
changeset
|
294 |
628 | 295 |
604 | 296 ; internal Battery Gauging |
623 | 297 #DEFINE capacity_saft_internal .364 |
298 #DEFINE capacity_panasonic_internal .121 | |
299 | |
448 | 300 |
604 | 301 ; Gauge IC |
623 | 302 #DEFINE capacity_saft .281 ; 2.4Ah/0.085mAh/100 [%] |
303 #DEFINE offset_saft .37300 ; 65536-(2.4Ah/0.085mAh) | |
448 | 304 |
623 | 305 #DEFINE capacity_panasonic .94 ; 0.8Ah/0.085mAh/100 [%] |
306 #DEFINE offset_panasonic .56124 ; 65536-(0.8Ah/0.085mAh) | |
582 | 307 |
623 | 308 #DEFINE capacity_ncr18650 .364 ; 3.1Ah/0.085mAh/100 [%] |
309 #DEFINE offset_ncr18650 .29065 ; 65536-(3.1Ah/0.085mAh) | |
448 | 310 |
623 | 311 #DEFINE capacity_ur16650 .271 ; 2.3Ah/0.085mAh/100 [%] |
312 #DEFINE offset_ur16650 .38477 ; 65536-(2.3Ah/0.085mAh) | |
313 | |
582 | 314 |
623 | 315 ; Power Consumption Values |
582 | 316 #DEFINE current_sleepmode .31 |
623 | 317 #DEFINE current_backlight_multi .115 ; * CCPR1L + current_backlight_offset (restricted to <= 255) |
582 | 318 #DEFINE current_backlight_offset .216 |
319 #DEFINE current_speed_eco .1914 | |
320 #DEFINE current_speed_normal .4027 | |
321 #DEFINE current_speed_fastest .5050 | |
322 #DEFINE current_ir_receiver .139 | |
323 #DEFINE current_compass .28 | |
0 | 324 |
623 | 325 |
326 ; Brightness Thresholds (between zero (off) and 255 (max. power consumption)) | |
582 | 327 #DEFINE ambient_light_max_high_36V .170 |
328 #DEFINE ambient_light_max_high_cr .240 | |
329 #DEFINE ambient_light_max_high_15V .140 | |
330 #DEFINE ambient_light_min_high .35 | |
331 #DEFINE ambient_light_max_medium .125 | |
332 #DEFINE ambient_light_min_medium .25 | |
333 #DEFINE ambient_light_max_eco .70 | |
334 #DEFINE ambient_light_min_eco .10 ; must be the lowest value! | |
0 | 335 |
623 | 336 |
604 | 337 ; IR Link Timeout |
631 | 338 #DEFINE ir_timeout_value .128 ; in multiples of 62.5 ms |
623 | 339 |
0 | 340 |
604 | 341 ; Setpoint Control |
582 | 342 #DEFINE surface_sp .50 ; in cbar |
352
5c6da9fa5cb0
add setpoint change to first sample in CCR mode
heinrichsweikamp
parents:
344
diff
changeset
|
343 |
623 | 344 |
631 | 345 ; Gas / Diluent Type & State |
346 ; .0 ; | 0: disabled, 1: first, 2: normal/work, 3: deco | |
347 ; .1 ; | | |
348 #DEFINE gas_lost .2 ; =1: gas/diluent is lost (permanently unavailable) | |
349 #DEFINE gas_staged .3 ; =1: gas/diluent is staged (temporary unavailable) | |
350 ; .4 ; --- unused | |
351 ; .5 ; --- unused | |
352 ; .6 ; --- unused | |
353 ; .7 ; --- unused | |
354 | |
355 | |
604 | 356 ; Gaslist hard-coded Limits |
623 | 357 IFDEF _helium |
358 #DEFINE gaslist_min_o2 .7 ; minimum O2 [%] ( 7% is minimum value to keep MOD < 255 meters / 1 Byte) | |
631 | 359 #DEFINE gaslist_max_o2 .100 ; maximum O2 [%] |
623 | 360 #DEFINE gaslist_max_He .100-gaslist_min_o2 ; maximum He [%] |
361 #DEFINE gaslist_max_change_depth .220 ; max. change depth [m] (219 is maximum value that can be produced by gaslist_calc_mod with 7% O2) | |
362 #DEFINE tissue_graphics_options .2 ; tissue graphics "Pres+Sat" and "N2+He" available | |
363 ELSE | |
364 #DEFINE gaslist_min_o2 .21 ; minimum O2 [%] | |
631 | 365 #DEFINE gaslist_max_o2 .100 ; maximum O2 [%] |
623 | 366 #DEFINE gaslist_max_He .0 ; maximum He [%] |
367 #DEFINE gaslist_max_change_depth .70 ; max. change depth [m] (67 is maximum value that can be produced by gaslist_calc_mod with 21% O2) | |
368 #DEFINE tissue_graphics_options .1 ; tissue graphics "Pres+Sat" only available | |
369 ENDIF | |
370 | |
371 | |
372 ; Setpoint list hard-coded Limits | |
604 | 373 #DEFINE gaslist_sp_stepsize .10 ; steps for setpoint setup [cbar] |
374 #DEFINE gaslist_sp_max .160 ; max. setpoint [cbar] | |
375 #DEFINE gaslist_sp_min .50 ; min. setpoint [cbar] | |
631 | 376 #DEFINE sp_max_change_depth .100 ; max change depth [m] |
582 | 377 |
623 | 378 |
604 | 379 ; Compass Display |
623 | 380 #DEFINE compass_fast_treshold .9 ; show new heading instantly if angular difference > compass_fast_treshold, else show animated turning of compass rose |
381 #DEFINE compass_averaging .10 ; number of averaging cycles | |
0 | 382 |
383 | |
604 | 384 ; Bit Flags for Communication with p2_deco.c - char_O_main_status |
623 | 385 #DEFINE DECO_VOLUME_FLAG .0 ; =1: calculate gas needs |
386 #DEFINE DECO_BOTTOM_FLAG .1 ; =1: calculate gas needs for full bottom segment, =0: ...for extra time only | |
387 #DEFINE DECO_CAVE_MODE .2 ; =1: calculate ascent and gas needs using backtracking data | |
631 | 388 #DEFINE DECO_GAS_CONTINGENCY .3 ; =1: use a second best gas if best gas is all used up |
623 | 389 #DEFINE DECO_TR_FUNCTIONS .4 ; =1: calculate TR functions (pressure readings) |
390 #DEFINE DECO_EXTENDED_STOPS .5 ; =1: place gas changes also below 1st stop depth | |
391 #DEFINE DECO_MODE_LOOP_FLAG .6 ; =1: calculate real tissues in loop mode (CCR or pSCR) | |
392 #DEFINE DECO_MODE_PSCR_FLAG .7 ; =1: calculate real tissues in pSCR mode (loop flag needs to be set, too) | |
393 | |
0 | 394 |
604 | 395 ; Bit Flags for Communication with p2_deco.c - char_O_deco_status |
623 | 396 #DEFINE DECO_START_NORM .0 ; =1: write: start calculation of a normal deco plan |
397 #DEFINE DECO_START_ALT .1 ; =1: write: start calculation of an alternative deco plan | |
398 #DEFINE DECO_COMPLETED_NORM .0 ; =1: read: calculation of a normal deco plan has completed | |
399 #DEFINE DECO_COMPLETED_ALT .1 ; =1: read: calculation of an alternative deco plan has completed | |
400 #DEFINE DECO_INITIALIZE .2 ; =1: write: initialize deco engine (to be done only once at the begin of every dive) | |
628 | 401 #DEFINE DECO_CALCULATOR_MODE .3 ; =1: deco engone is run from the deco calculator |
623 | 402 #DEFINE DECO_BAILOUT_FLAG .4 ; =1: allow gas switches before first deco stop (used in bailout plans) |
631 | 403 #DEFINE DECO_DELAY_FLAG .5 ; =1: figure in a delayed ascent (fTTS) |
623 | 404 ; DECO_MODE_LOOP_FLAG .6 ; =1: calculate simulated tissues in loop mode (CCR or pSCR) |
405 ; DECO_MODE_PSCR_FLAG .7 ; =1: calculate simulated tissues in pSCR mode (loop flag needs to be set, too) | |
406 | |
268
29acdb601548
BUGFIX: Increase timing tolerance for S8 HUD (cR only)
heinrichsweikamp
parents:
266
diff
changeset
|
407 |
604 | 408 ; Bit Flags for Communication with p2_deco.c - char_O_deco_warnings |
623 | 409 #DEFINE IBCD_warning .0 ; =1: IBCD currently occuring |
410 #DEFINE IBCD_warning_lock .1 ; =1: IBCD occured durign the dive | |
411 #DEFINE mbubble_warning .2 ; =1: microbubbles potentionally currently occuring | |
412 #DEFINE mbubble_warning_lock .3 ; =1: microbubbles potentionally occured during the dive | |
413 #DEFINE outside_warning .4 ; =1: currently outside the ZHL-16 model | |
414 #DEFINE outside_warning_lock .5 ; =1: was outside the ZHL-16 model during the dive | |
415 #DEFINE outside_attention .6 ; =1: currently near to the limits of the ZHL-16 model | |
628 | 416 #DEFINE deco_plan_incomplete .7 ; =1: internal error: deco calculation incomplete |
623 | 417 |
0 | 418 |
604 | 419 ; Bit Flags for Communication with p2_deco.c - char_O_deco_info |
628 | 420 #DEFINE deco_mode .0 ; =1: in deco mode, deco ppO2 levels permitted |
604 | 421 #DEFINE ind_double_switch .1 ; =1: switch to other tank advice active |
631 | 422 #DEFINE gas_needs_fTTS .2 ; =1: indicated gas needs are calculated in fTTS mode |
623 | 423 #DEFINE deco_zone .3 ; =1: fTTS is <= TTS (not updated when in bailout mode) |
604 | 424 #DEFINE deco_ceiling .4 ; =1: ceiling depth > 0 |
631 | 425 #DEFINE deco_stops_norm .5 ; =1: deco stops found in normal plan |
426 #DEFINE deco_stops_alt .6 ; =1: deco stops found in alternative plan | |
427 #DEFINE gas_needs_cave .7 ; =1: indicated gas needs are calculated in cave mode | |
623 | 428 |
0 | 429 |
604 | 430 ; Bit Flags for Status on Variables of Type char |
431 #DEFINE char_transmitter_lost .6 | |
432 #DEFINE char_invalid_flag .7 | |
433 #DEFINE char_transmitter_low_bat .7 | |
434 | |
623 | 435 |
631 | 436 ; Bit Flags for Status on Variables of Type int (Flags are placed in the UPPER byte!) |
604 | 437 #DEFINE int_invalid_flag .2 |
438 #DEFINE int_not_yet_computed .3 | |
439 #DEFINE int_is_zero .3 | |
440 #DEFINE int_low_flag .4 | |
441 #DEFINE int_not_avail_flag .4 | |
442 #DEFINE int_high_flag .5 | |
443 #DEFINE int_outdated_flag .5 | |
444 #DEFINE int_attention_flag .6 | |
445 #DEFINE int_warning_flag .7 | |
0 | 446 |
623 | 447 |
0 | 448 ;----------------------------------------------------------------------------- |
623 | 449 ; Timebase and Eventbase (stored in access RAM, set by the ISR, trigger flags to be cleared by the application) |
450 | |
451 #DEFINE timebase_0sec timebase,0 ; counting timebase, 1/2 sec bit | |
452 #DEFINE timebase_1sec timebase,1 ; counting timebase, 1 sec bit | |
453 #DEFINE timebase_2sec timebase,2 ; counting timebase, 2 sec bit | |
454 #DEFINE trigger_quarter_second timebase,3 ; =1: a new 1/4 second has begun (not synced with the other time flags, not generated while block_sensor_interrupt is set) | |
455 #DEFINE trigger_half_second timebase,4 ; =1: a new 1/2 second has begun | |
456 #DEFINE trigger_full_second timebase,5 ; =1: a new 1/1 second has begun | |
457 #DEFINE trigger_full_minute timebase,6 ; =1: a new minute has begun | |
458 #DEFINE trigger_full_hour timebase,7 ; =1: a new hour has begun | |
459 | |
460 #DEFINE trigger_isr_updates eventbase,0 ; =1: the ISR had kicked in (set by ISR, used by ISR-safe copy macros) | |
461 #DEFINE trigger_timeout eventbase,1 ; =1: timeout signal by timeout service | |
462 #DEFINE trigger_sample_divedata eventbase,2 ; =1: time to store a new sample | |
463 #DEFINE trigger_S8_data_update eventbase,3 ; =1: new S8 digital data are available | |
464 #DEFINE trigger_pres_update eventbase,4 ; =1: new pressure value is available | |
465 #DEFINE trigger_pres_cur_changed eventbase,5 ; =1: current pressure value has changed | |
466 #DEFINE trigger_pres_max_changed eventbase,6 ; =1: maximum pressure value has changed | |
467 #DEFINE trigger_temp_changed eventbase,7 ; =1: temperature value has changed | |
468 | |
469 | |
470 ;----------------------------------------------------------------------------- | |
471 ; Flags - stored in access RAM | |
472 | |
473 ;---- Hardware - OSTC Model Descriptor (stored in access RAM, cleared & rebuilt in restart, to preserve compatibility with 3rd party tools DO NOT alter bit positions) | |
474 #DEFINE battery_gauge_available HW_descriptor,0 ; =1: OSTC has rechargeable battery with battery management chip | |
475 #DEFINE ambient_sensor HW_descriptor,1 ; =1: OSTC has an ambient light sensor | |
476 #DEFINE analog_o2_input HW_descriptor,2 ; =1: OSTC has analog inputs and S8 digital | |
477 #DEFINE optical_input HW_descriptor,3 ; =1: OSTC has an digital optical input | |
478 #DEFINE ble_available HW_descriptor,4 ; =1: OSTC has an BLE module | |
479 #DEFINE ostc_rx_present HW_descriptor,5 ; =1: OSTC has RX module | |
480 #DEFINE lv_core HW_descriptor,6 ; =1: OSTC has low-voltage core (2.7V) | |
481 ; HW_descriptor,7 ; --- reserved | |
482 | |
483 ;---- Hardware - OSTC Model Variants (stored in access RAM, NOT cleared in restart) | |
628 | 484 #DEFINE screen_type1 HW_variants,0 ; =1: display type 1, =0; display type 0 |
485 #DEFINE screen_type2 HW_variants,1 ; =1: display type 2, =0: display type 0 or 1 | |
486 #DEFINE screen_type3 HW_variants,2 ; =1: display type 3, =0: display type 0 or 1 or 2 | |
487 #DEFINE compass_type1 HW_variants,3 ; =1: compass type 1, =0: compass type 0 | |
488 #DEFINE compass_type2 HW_variants,4 ; =1: compass type 2, =0: compass type 0 or 1 | |
489 #DEFINE compass_type3 HW_variants,5 ; =1: compass type 3, =0: compass type 0 or 1 or 2 | |
490 #DEFINE analog_switches HW_variants,6 ; =1: analog switches available | |
491 #DEFINE battery_is_36v HW_variants,7 ; =1: a 3.6 Volt battery is detected | |
624 | 492 |
623 | 493 |
628 | 494 ;---- Hardware - States 1 (stored in access RAM, cleared on restart) |
495 #DEFINE analog_sw1_pressed HW_flags_state1,0 ; =1: analog switch 1 pressed | |
496 #DEFINE analog_sw2_pressed HW_flags_state1,1 ; =1: analog switch 2 pressed | |
497 #DEFINE switch_left HW_flags_state1,2 ; =1: left button was pressed | |
498 #DEFINE switch_right HW_flags_state1,3 ; =1: right button was pressed | |
499 #DEFINE flip_screen HW_flags_state1,4 ; =1: screen is shown 180° turned | |
500 #DEFINE adc_is_running HW_flags_state1,5 ; =1: the ADC is in use | |
501 #DEFINE tft_is_dimming HW_flags_state1,6 ; =1: the TFT is dimming, ignore light sensor | |
502 #DEFINE compass_enabled HW_flags_state1,7 ; =1: the compass and accelerometer chip is active | |
503 | |
504 ;---- Hardware - States 2 (stored in access RAM, NOT cleared on restart) | |
505 #DEFINE cc_active HW_flags_state2,0 ; =1: constant current charging active (cR hardware only) | |
506 #DEFINE cv_active HW_flags_state2,1 ; =1: constant voltage charging active (cR hardware only) | |
631 | 507 #DEFINE i2c_error_flag HW_flags_state2,2 ; =1: an I2C error occurred |
508 #DEFINE rs232_rx_timeout HW_flags_state2,3 ; =1: RS232 receive timeout occurred | |
509 #DEFINE address_wrap_around HW_flags_state2,4 ; =1: the ext_flash_address wrapped around on increment | |
510 #DEFINE battery_low_condition HW_flags_state2,5 ; =1: low battery condition detected | |
628 | 511 ; HW_flags_state2,6 ; --- unused |
512 ; HW_flags_state2,7 ; --- unused | |
623 | 513 |
582 | 514 |
623 | 515 ;---- Operating System - persistent Settings (stored in access RAM, NOT cleared in restart) |
516 #DEFINE sensor1_calibrated_ok OS_flags_persist,0 ; =1: sensor 1 calibration ok | |
517 #DEFINE sensor2_calibrated_ok OS_flags_persist,1 ; =1: sensor 2 calibration ok | |
518 #DEFINE sensor3_calibrated_ok OS_flags_persist,2 ; =1: sensor 3 calibration ok | |
519 #DEFINE compass_bearing_set OS_flags_persist,3 ; =1: compass bearing is set | |
520 #DEFINE use_old_batt_flag OS_flags_persist,4 ; =1: load old battery data after power-on reset | |
631 | 521 #DEFINE options_changed OS_flags_persist,5 ; =1: option values have been changed, EEPROM needs to be updated |
522 #DEFINE restart_fast OS_flags_persist,6 ; =1: request to skip logos and waits on restart | |
623 | 523 #DEFINE battery_overtemp OS_flags_persist,7 ; =1: battery charging temperature limit exceeded |
524 | |
525 | |
526 ;---- Operating System - ISR Control 1 (stored in access RAM) | |
527 #DEFINE reset_timebase OS_flags_ISR1,0 ; =1: request ISR to reset the timebase for the trigger flags | |
528 #DEFINE reset_timeout OS_flags_ISR1,1 ; =1: request ISR to reset the timeout timer | |
529 #DEFINE reset_max_pressure OS_flags_ISR1,2 ; =1: request ISR to reset the maximum pressure to zero | |
530 #DEFINE reset_surface_interval OS_flags_ISR1,3 ; =1: request ISR to reset the surface interval to zero | |
531 #DEFINE reset_trip_pressure OS_flags_ISR1,4 ; =1: request ISR to reset the resettable min/max pressure | |
532 #DEFINE block_rtc_access OS_flags_ISR1,5 ; =1: suspend the ISR from accessing the RTC | |
533 #DEFINE block_battery_gauge OS_flags_ISR1,6 ; =1: suspend the ISR from updating the battery gauge | |
534 #DEFINE block_sensor_interrupt OS_flags_ISR1,7 ; =1: suspend the ISR from executing sensor interrupts | |
535 | |
536 ;---- Operating System - ISR Control 2 (stored in access RAM) | |
537 #DEFINE update_surface_pressure OS_flags_ISR2,0 ; =1: request ISR to update the surface pressure | |
538 #DEFINE quit_simulatormode OS_flags_ISR2,1 ; =1: request ISR to quit the simulator mode | |
539 #DEFINE count_divetime OS_flags_ISR2,2 ; =1: request ISR to count the dive time | |
540 #DEFINE sensor_override_request OS_flags_ISR2,3 ; =1: request ISR to override the pressure sensor with a simulated depth | |
541 ; OS_flags_ISR2,4 ; --- unused | |
542 ; OS_flags_ISR2,5 ; --- unused | |
543 #DEFINE sensor_override_active OS_flags_ISR2,6 ; =1: ISR output: switch to override-mode confirmed | |
544 #DEFINE divetime_longer_1min OS_flags_ISR2,7 ; =1: ISR output: dive time is >= one minute | |
545 | |
546 | |
547 ;---- Operating Modes (stored in access RAM, persistent) | |
548 #DEFINE sleepmode OM_flags_mode,0 ; =1: in sleep mode | |
549 #DEFINE divemode OM_flags_mode,1 ; =1: in dive mode | |
550 #DEFINE simulatormode OM_flags_mode,2 ; =1: in simulator mode | |
551 #DEFINE high_altitude_mode OM_flags_mode,3 ; =1: unit was manually turned on with absolute pressure < 880 mbar | |
552 #DEFINE s8_digital_avail OM_flags_mode,4 ; =1: S8 digital interface is available | |
553 #DEFINE tr_functions_activated OM_flags_mode,5 ; =1: TR module is available and TR mode is <> off | |
554 #DEFINE cold_start OM_flags_mode,6 ; =1: restart is entered from a cold start | |
555 IFDEF _screendump | |
556 #DEFINE screen_dump_avail OM_flags_mode,7 ; =1: screen dump function is available | |
557 ELSE | |
558 #DEFINE comm_mode_disabled OM_flags_mode,7 ; =1: COMM mode is disabled | |
559 ENDIF | |
560 | |
561 | |
562 ;---- Dive Modes - Deco Modes (stored in access RAM) | |
563 #DEFINE FLAG_oc_mode DM_flags_deco,0 ; =1: in OC mode active | |
564 #DEFINE FLAG_ccr_mode DM_flags_deco,1 ; =1: in CCR mode (fixed ppO2 or sensor) active | |
565 #DEFINE FLAG_gauge_mode DM_flags_deco,2 ; =1: in gauge mode | |
566 #DEFINE FLAG_apnoe_mode DM_flags_deco,3 ; =1: in apnoe mode | |
567 #DEFINE FLAG_pscr_mode DM_flags_deco,4 ; =1: in pSCR mode | |
568 #DEFINE bailout_mode DM_flags_deco,5 ; =1: in bailout mode | |
569 #DEFINE apnoe_at_surface DM_flags_deco,6 ; =1: at the surface, 0= submerged (apnoe mode only, set/reset by ISR) | |
570 #DEFINE apnoe_new_dive DM_flags_deco,7 ; =1: a new dive has begun (apnoe mode only, set by ISR) | |
571 | |
572 | |
573 ;----------------------------------------------------------------------------- | |
574 ; Flags - stored in bank common | |
575 | |
576 ;---- Dive Mode - Dive States | |
577 #DEFINE use_aGF DM_flags_state,0 ; =1: use aGF, =0: use GF | |
631 | 578 #DEFINE deco_locked DM_flags_state,1 ; =1: in or has been in deco obligation during the dive |
579 #DEFINE deco_region DM_flags_state,2 ; =1: in or has been in the deco stops region during the dive | |
580 #DEFINE cave_mode DM_flags_state,3 ; =1: cave mode is active (cave mode) | |
581 #DEFINE dive_turned DM_flags_state,4 ; =1: dive is turned (cave mode) | |
582 #DEFINE backtrack_almost_full DM_flags_state,5 ; =1: the backtracking storage is almost full (cave mode) | |
583 #DEFINE backtrack_entire_full DM_flags_state,6 ; =1: the backtracking storage is entirely full (cave mode) | |
584 #DEFINE backtrack_shutdown DM_flags_state,7 ; =1: the backtracking has shut down due to entirely full (cave mode) | |
582 | 585 |
623 | 586 ;---- Dive Mode - O2 Sensors |
587 #DEFINE use_O2_sensor1 DM_flags_sensor,0 ; =1: sensor 1 shall be used | |
588 #DEFINE use_O2_sensor2 DM_flags_sensor,1 ; =1: sensor 2 shall be used | |
589 #DEFINE use_O2_sensor3 DM_flags_sensor,2 ; =1: sensor 3 shall be used | |
590 #DEFINE voting_logic_sensor1 DM_flags_sensor,3 ; =1: sensor 1 is within the voting logic threshold | |
591 #DEFINE voting_logic_sensor2 DM_flags_sensor,4 ; =1: sensor 2 is within the voting logic threshold | |
592 #DEFINE voting_logic_sensor3 DM_flags_sensor,5 ; =1: sensor 3 is within the voting logic threshold | |
631 | 593 #DEFINE sp_fallback DM_flags_sensor,6 ; =1: fall-back to SP1 due to external O2 sensor failure |
623 | 594 ; DM_flags_sensor,7 ; --- unused |
595 | |
631 | 596 ;---- Dive Mode - User Requests / General |
597 #DEFINE request_gas_change DM_flags_request,0 ; =1: request to change the gas | |
598 #DEFINE request_gas_update DM_flags_request,1 ; =1: request to update the gas | |
599 #DEFINE request_reset_avg DM_flags_request,2 ; =1: request to reset the average depth | |
600 #DEFINE request_next_custview DM_flags_request,3 ; =1: request to show the next custom view | |
601 #DEFINE request_back_to_loop DM_flags_request,4 ; =1: request to switch back from bailout to loop | |
602 #DEFINE request_toggle_GF DM_flags_request,5 ; =1: request to toggle between GF and aGF | |
603 #DEFINE request_set_marker DM_flags_request,6 ; =1: request to set a marker in the logbook | |
604 #DEFINE request_restart_engine DM_flags_request,7 ; =1: request to restart the deco engine | |
605 | |
606 ;---- Dive Mode - User Requests / Cave Mode | |
607 #DEFINE request_cave_toggle DM_flags_cavereq,0 ; =1: request to toggle cave mode off/on (cave mode) | |
608 #DEFINE request_cave_off_turned DM_flags_cavereq,1 ; =1: request to switch cave mode off (cave mode) | |
609 #DEFINE request_turn_toggle DM_flags_cavereq,2 ; =1: request to toggle dive turned state (cave mode) | |
610 #DEFINE request_turn_turn DM_flags_cavereq,3 ; =1: request to switch dive turned state to turned (cave mode) | |
611 #DEFINE request_waypoint_set DM_flags_cavereq,4 ; =1: request to set a waypoint (cave mode) | |
612 #DEFINE request_waypoint_out DM_flags_cavereq,5 ; =1: request to go one waypoint out of the cave (cave mode) | |
613 #DEFINE request_waypoint_in DM_flags_cavereq,6 ; =1: request to go one waypoint into the cave (cave mode) | |
614 ; DM_flags_cavereq,7 ; --- unused | |
623 | 615 |
616 ;---- Dive Mode - Data Recording Events | |
617 #DEFINE event_occured DM_flags_event,0 ; =1: an event occurred (global indicator flag) | |
618 #DEFINE event_gas_change DM_flags_event,1 ; =1: a change to another gas or diluent occurred | |
619 #DEFINE event_gas_change_gas6 DM_flags_event,2 ; =1: a change to or of the gas 6 has occurred | |
620 #DEFINE event_bailout DM_flags_event,3 ; =1: a change to or of the OC gas occurred due to bailout | |
621 #DEFINE event_SP_change DM_flags_event,4 ; =1: a change of the setpoint has occurred | |
622 ; DM_flags_event,5 ; --- unused | |
631 | 623 ; DM_flags_event,6 ; --- unused |
624 ; DM_flags_event,7 ; --- unused | |
623 | 625 |
626 ;---- Dive Mode - Display Control / Layout | |
627 #DEFINE safety_stop_enabled DM_flags_layout1,0 ; =1: safety stop is enabled | |
628 #DEFINE safety_stop_active DM_flags_layout1,1 ; =1: safety stop is shown | |
629 #DEFINE decostop_active DM_flags_layout1,2 ; =1: decompression stop is shown | |
630 #DEFINE velocity_active_num DM_flags_layout1,3 ; =1: numerical velocity indicator is shown | |
631 #DEFINE velocity_active_vsi DM_flags_layout1,4 ; =1: graphical velocity indicator is shown | |
632 #DEFINE alt_layout_active DM_flags_layout1,5 ; =1: the alternative dive layout is used (aka "blind mode") | |
633 #DEFINE neg_flag_velocity DM_flags_layout1,6 ; =1: descending, used by velocity logic | |
634 #DEFINE show_only_divemins DM_flags_layout1,7 ; =1: only dive minutes are shown | |
635 | |
636 #DEFINE cur_depth_greater_100m DM_flags_layout2,0 ; =1: current depth > 100 meters | |
637 #DEFINE max_depth_greater_100m DM_flags_layout2,1 ; =1: max. depth > 100 meters | |
638 #DEFINE depth_attention DM_flags_layout2,2 ; =1: show depth in attention color | |
639 #DEFINE depth_warning DM_flags_layout2,3 ; =1: show depth in warning color | |
640 #DEFINE depth_warn_att_last DM_flags_layout2,4 ; =1: last depth was shown in warning or attention color | |
641 #DEFINE depth_inverse_last DM_flags_layout2,5 ; =1: last depth was shown in inverse | |
642 #DEFINE gas_needs_mode_last DM_flags_layout2,6 ; =1: last gas needs were computed for cave mode, =0: direct ascent | |
643 #DEFINE tts_greater_99 DM_flags_layout2,7 ; =1: TTS > 99 minutes | |
644 | |
631 | 645 #DEFINE tissue_graphic_layout DM_flags_layout3,0 ; =1: show pres+sat, =0: show N2/He pressures |
646 #DEFINE tissue_graphic_gf DM_flags_layout3,1 ; =1: show GF lines | |
647 #DEFINE tissue_graphic_cns DM_flags_layout3,2 ; =1: shwo CNS value (surface mode graphic only) | |
648 #DEFINE tissue_graphic_mode DM_flags_layout3,3 ; =1: logbook mode (surface mode graphic only) | |
649 ; DM_flags_layout3,4 ; --- unused | |
650 ; DM_flags_layout3,5 ; --- unused | |
651 ; DM_flags_layout3,6 ; --- unused | |
652 ; DM_flags_layout3,7 ; --- unused | |
653 | |
654 | |
623 | 655 ;---- Dive Mode - Display Control / Messages |
656 #DEFINE message_advice DM_flags_message,0 ; =1: an advice is active in dive mode | |
657 #DEFINE message_attention DM_flags_message,1 ; =1: an attention is active in dive mode or surface mode | |
658 #DEFINE message_warning DM_flags_message,2 ; =1: a warning is active in dive mode or surface mode | |
659 #DEFINE message_2nd_row_used DM_flags_message,3 ; =1: the second row contains a warning/attention/advice | |
660 #DEFINE sign_shown DM_flags_message,4 ; =1: the warning/attention/advice sign is shown | |
661 #DEFINE gas_needs_attention DM_flags_message,5 ; =1: the gas needs attention has been shown before | |
662 #DEFINE gas_needs_warning DM_flags_message,6 ; =1: the gas needs warning has been shown before | |
663 #DEFINE o2_sensors_warning DM_flags_message,7 ; =1: the O2 sensors warning has been shown before | |
604 | 664 |
631 | 665 ;---- Dive Mode - Display Control / Gas, Diluent, Depth |
623 | 666 #DEFINE better_gas_hint DM_flags_gas_dil,0 ; =1: mark a gas when it is a better gas |
631 | 667 #DEFINE color_code_gases DM_flags_gas_dil,1 ; =1: color code the gases by ppO2 & current depth |
668 #DEFINE better_gas_available DM_flags_gas_dil,2 ; =1: a better gas is available | |
669 #DEFINE better_gas_blinking DM_flags_gas_dil,3 ; =1: gas is blinking | |
670 #DEFINE better_dil_available DM_flags_gas_dil,4 ; =1: a better diluent is available | |
671 #DEFINE better_dil_blinking DM_flags_gas_dil,5 ; =1: diluent is blinking | |
672 #DEFINE gas6_or_EXIT DM_flags_gas_dil,6 ; =1: exit menu, =0: provide gas6 option | |
673 #DEFINE depth_limit_exceeded DM_flags_gas_dil,7 ; =1: depth limit exceeded | |
623 | 674 |
675 ;---- Menu System - Control | |
676 #DEFINE surfmode_menu MS_flags_control,0 ; =1: surface menu is shown (i.e. returning from it) | |
677 #DEFINE dive_options_menu MS_flags_control,1 ; =1: dive options menu is shown (e.g. "Menu?") | |
678 #DEFINE dive_main_menu MS_flags_control,2 ; =1: dive mode menu is shown (i.e. the "big" menu) | |
679 #DEFINE compass_menu MS_flags_control,3 ; =1: "set bearing" is shown | |
680 #DEFINE is_diluent_menu MS_flags_control,4 ; =1: setting up diluents, =0: setting up OC gases | |
681 #DEFINE is_bailout_menu MS_flags_control,5 ; =1: in bailout menu | |
631 | 682 #DEFINE custom_view_locked MS_flags_control,6 ; =1: the custom view is locked (defer CV auto-popup) |
623 | 683 ; MS_flags_control,7 ; --- unused |
684 | |
685 ;---- Menu System - Data Imprinting | |
686 #DEFINE imprint_time_date MS_flags_imprint,0 ; =1: imprint current time & date | |
687 #DEFINE imprint_color_schemes MS_flags_imprint,1 ; =1: imprint color schemes | |
688 #DEFINE imprint_sensor_mv MS_flags_imprint,2 ; =1: imprint O2 sensor mV data | |
689 #DEFINE imprint_xmitter_pres MS_flags_imprint,3 ; =1: imprint transmitter pressure data | |
690 #DEFINE imprint_xmitter_ID MS_flags_imprint,4 ; =1: in transmitter-to-tank pairing menu | |
691 #DEFINE imprint_surfmode_data MS_flags_imprint,5 ; =1: imprint surface mode data | |
692 #DEFINE block_option_value MS_flags_imprint,6 ; =1: suspend display of option values | |
693 ; MS_flags_imprint,7 ; --- unused | |
694 | |
0 | 695 |
623 | 696 ;---- Font & Image System |
697 #DEFINE aa_antialias AA_flags,0 ; used by aa_wordprocessor | |
698 #DEFINE aa_color_quarter AA_flags,1 ; used by aa_wordprocessor | |
699 #DEFINE aa_color_half AA_flags,2 ; used by aa_wordprocessor | |
700 #DEFINE aa_aux_flag AA_flags,3 ; auxiliary flag for various purposes | |
701 #DEFINE use_custom_colors AA_flags,4 ; =1: override default pixel colors, used by color_image | |
702 ; AA_flags,5 ; --- unused | |
703 ; AA_flags,6 ; --- unused | |
704 ; AA_flags,7 ; --- unused | |
705 | |
706 | |
707 ;---- Convert and Display Functions (Control of numerical and other Output) | |
708 #DEFINE leftbind CVT_flags1,0 ; =1: align numbers to the left | |
709 #DEFINE win_invert CVT_flags1,1 ; =1: the text shall be printed in inverse | |
710 #DEFINE short_gas_descriptions CVT_flags1,2 ; =1: use short versions of gaslist_strcat_gas_cd and gaslist_strcat_setpoint | |
631 | 711 #DEFINE ignore_digit3 CVT_flags1,3 ; controls suppression of digits when printing numbers |
712 #DEFINE ignore_digit4 CVT_flags1,4 ; controls suppression of digits when printing numbers | |
713 #DEFINE ignore_digit5 CVT_flags1,5 ; controls suppression of digits when printing numbers | |
714 ; CVT_flags1,6 ; --- unused | |
623 | 715 ; CVT_flags1,7 ; --- unused |
0 | 716 |
623 | 717 #DEFINE pre_zero_flag CVT_flags2,0 |
718 #DEFINE all_zeros_flag CVT_flags2,1 | |
719 #DEFINE DP_done CVT_flags2,2 | |
720 #DEFINE DP_done2 CVT_flags2,3 | |
721 #DEFINE show_last3 CVT_flags2,4 | |
722 #DEFINE leading_zeros CVT_flags2,5 | |
723 #DEFINE show_last4 CVT_flags2,6 | |
724 #DEFINE neg_flag CVT_flags2,7 ; =1: result is negative | |
725 | |
726 | |
631 | 727 ;---- Miscellaneous Flags |
623 | 728 #DEFINE ignore_last_edited_gas misc_flags,0 ; =1: ignore last edited gas while cleaning up gas/dil list |
729 #DEFINE copying_dil misc_flags,1 ; =1: copying a diluent | |
631 | 730 #DEFINE comm_service_mode misc_flags,2 ; =1: service mode (extended command set) is enabled |
731 #DEFINE waypoint_reached_first misc_flags,3 ; =1: the first (most outside) waypoint is reached (cave mode) | |
732 #DEFINE waypoint_reached_last misc_flags,4 ; =1: the last (most inside) waypoint is reached (cave mode) | |
733 #DEFINE option_repaired misc_flags,5 ; =1: option value was set to default | |
734 #DEFINE flash_wait misc_flags,6 ; =1: wait for flash write operation to complete | |
735 #DEFINE aux_flag misc_flags,7 ; local flag, used in various places | |
623 | 736 |
737 ;---- HUD Status Byte (stored in access RAM) | |
604 | 738 #DEFINE hud_connection_ok hud_status_byte,0 ; =1 HUD connection ok |
739 ; hud_status_byte,1 ; =1 HUD is calibrated | |
623 | 740 ; hud_status_byte,2 ; =1 HUD battery is low (< 3000 mV) |
604 | 741 #DEFINE sensor1_active hud_status_byte,3 ; =1: sensor 1 is active |
742 #DEFINE sensor2_active hud_status_byte,4 ; =1: sensor 2 is active | |
743 #DEFINE sensor3_active hud_status_byte,5 ; =1: sensor 3 is active | |
744 ; hud_status_byte,6 ; --- unused in stand-alone HUD | |
745 ; hud_status_byte,7 ; --- unused in stand-alone HUD | |
0 | 746 |
582 | 747 |
748 ;---------------------------- Macros ------------------------------------ | |
749 | |
631 | 750 |
751 ; ---- options checking ---- | |
752 | |
623 | 753 TSTOSS macro opt_reg ; TeST Option Skip next instruction if Set (not zero) |
631 | 754 movff opt_reg,EEDATA ; Attention: destroys EEDATA! |
755 tstfsz EEDATA,A ; Attention: must be followed by a plain machine | |
623 | 756 bra $+4 ; command, do not let follow a macro! |
757 endm ; | |
758 | |
759 TSTOSC macro opt_reg ; TeST Option Skip next instruction if Clear (zero) | |
631 | 760 movff opt_reg,EEDATA ; Attention: destroys EEDATA! |
761 tstfsz EEDATA,A ; Attention: must be followed by a plain machine | |
623 | 762 endm ; command, do not let follow a macro! |
763 | |
764 | |
631 | 765 ; ---- literal operations ---- |
766 | |
767 CLRI macro address ; CLeaR Integer (version of clrf for 2 byte integers) | |
768 clrf address+0 ; Attention: must be in bank where target variable resides! | |
769 clrf address+1 ; | |
770 endm ; | |
771 | |
772 CLRT macro address ; CLeaR Three byte integer (version of clrf for 3 byte integers) | |
773 clrf address+0 ; Attention: must be in bank where target variable resides! | |
774 clrf address+1 ; | |
775 clrf address+2 ; | |
623 | 776 endm ; |
777 | |
631 | 778 CLRR macro address,range ; CLeaR a Range of bytes (version of clrf for 1-256 bytes) |
779 movlw low(range) ; initialize loop counter | |
780 lfsr FSR1,address ; set start address | |
781 extern memory_clear | |
782 call memory_clear | |
783 endm | |
623 | 784 |
631 | 785 SETI macro address ; SET Integer (version of setf for 2 byte integers) |
786 setf address+0 ; Attention: must be in bank where target variable resides! | |
787 setf address+1 ; | |
623 | 788 endm ; |
789 | |
631 | 790 MOVLI macro literal,address ; MOVe Literal to Integer |
791 movlw LOW (literal) ; Attention: destroys WREG! | |
792 movwf address+0 ; Attention: must be in bank where target variable resides! | |
793 movlw HIGH (literal) ; | |
794 movwf address+1 ; | |
623 | 795 endm ; |
796 | |
797 | |
631 | 798 ; ---- arithetics ---- |
799 | |
800 INCI macro address ; INCrement Integer (version of incf for 2 byte integers) | |
801 infsnz address+0,F ; Attention: must be in bank where target variable resides! | |
802 incf address+1,F ; | |
623 | 803 endm ; |
804 | |
631 | 805 DECI macro address ; DECrement Integer (version of decf for 2 byte integers) |
623 | 806 movlw .1 ; Attention: destroys WREG! |
631 | 807 subwf address+0,F ; Attention: must be in bank where target variable resides! |
623 | 808 movlw .0 ; |
631 | 809 subwfb address+1,F ; |
810 endm ; | |
811 | |
812 ADDLI macro literal, address ; ADD Literal to Integer | |
813 movlw LOW (literal) ; Attention: destroys WREG! | |
814 addwf address+0,F ; Attention: must be in bank where target variable resides! | |
815 movlw HIGH (literal) ; | |
816 addwfc address+1,F ; | |
817 endm ; | |
818 | |
819 SUBLI macro literal, address ; SUBtract Literal from Integer | |
820 movlw LOW (literal) ; Attention: destroys WREG! | |
821 subwf address+0,F ; Attention: must be in bank where target variable resides! | |
822 movlw HIGH (literal) ; | |
823 subwfb address+1,F ; | |
623 | 824 endm ; |
825 | |
826 | |
631 | 827 ; ---- moves ---- |
828 | |
829 MOVCC macro from,to ; MOVe 1 byte Char (actually an alias for movff) | |
830 movff from,to | |
831 endm | |
832 | |
833 MOVII macro from,to ; MOVe 2 byte Integer (version of movff for 2 bytes) | |
834 movff from+0,to+0 ; copy 1st byte | |
835 movff from+1,to+1 ; copy 2nd byte | |
623 | 836 endm ; |
837 | |
631 | 838 MOVTT macro from,to ; MOVe Three byte Integer (version of movff for 3 bytes) |
839 movff from+0,to+0 ; copy 1st byte | |
840 movff from+1,to+1 ; copy 2nd byte | |
841 movff from+2,to+2 ; copy 3rd byte | |
842 endm ; | |
843 | |
844 MOVRR macro from,to,range ; MOVe a Range of bytes (version of movff for 1-256 bytes) | |
845 movlw low(range) ; initialize loop counter | |
846 lfsr FSR1,from ; from | |
847 lfsr FSR2,to ; to | |
848 extern memory_move | |
849 call memory_move | |
850 endm | |
851 | |
623 | 852 |
631 | 853 ; ---- ISR-safe moves ---- |
623 | 854 |
631 | 855 SMOVII macro from, to ; isr-Safe MOVe 2 byte Integer (version of MOVII for ISR-safe copying) |
623 | 856 local retry ; |
857 retry: | |
858 bcf trigger_isr_updates ; clear flag, it will be set by the ISR in case it had kicked in | |
859 movff from+0,to+0 ; copy low byte | |
860 movff from+1,to+1 ; copy high byte | |
861 btfsc trigger_isr_updates ; did the ISR kicked in since we cleared the flag? | |
862 bra retry ; YES - retry copy | |
863 endm ; NO - done | |
864 | |
631 | 865 SMOVTT macro from, to ; isr-Safe MOVe Three byte integer (version of MOVTT for ISR-safe copying) |
623 | 866 local retry ; |
867 retry: | |
868 bcf trigger_isr_updates ; clear flag, it will be set by the ISR in case it had kicked in | |
869 movff from+0,to+0 ; copy low byte | |
870 movff from+1,to+1 ; copy high byte | |
871 movff from+2,to+2 ; copy upper byte | |
872 btfsc trigger_isr_updates ; did the ISR kicked in since we cleared the flag? | |
873 bra retry ; YES - retry copy | |
874 endm ; NO - done | |
875 | |
631 | 876 SMOVQQ macro from, to ; isr-Safe MOVe Quad byte integer (version of MOVII for ISR-safe copying) |
623 | 877 local retry ; |
878 retry: | |
879 bcf trigger_isr_updates ; clear flag, it will be set by the ISR in case it had kicked in | |
880 movff from+0,to+0 ; copy byte 0 (LSB) | |
881 movff from+1,to+1 ; copy byte 1 | |
882 movff from+2,to+2 ; copy byte 2 | |
883 movff from+3,to+3 ; copy byte 3 (MSB) | |
884 btfsc trigger_isr_updates ; did the ISR kicked in since we cleared the flag? | |
885 bra retry ; YES - retry copy | |
886 endm ; NO - done | |
887 | |
888 SMOVSS macro from, to ; isr-Safe MOVe Six byte integer to integer (version of MOVII for integers updated in ISR) | |
889 local retry ; | |
890 retry: | |
891 bcf trigger_isr_updates ; clear flag, it will be set by the ISR in case it had kicked in | |
892 movff from+0,to+0 ; copy byte 0 (LSB) | |
893 movff from+1,to+1 ; copy byte 1 | |
894 movff from+2,to+2 ; copy byte 2 | |
895 movff from+3,to+3 ; copy byte 3 | |
896 movff from+4,to+4 ; copy byte 4 | |
897 movff from+5,to+5 ; copy byte 5 (MSB) | |
898 btfsc trigger_isr_updates ; did the ISR kicked in since we cleared the flag? | |
899 bra retry ; YES - retry copy | |
900 endm ; NO - done | |
901 | |
582 | 902 |
604 | 903 ;---------------------------- C-Code Routines ---------------------------- |
582 | 904 |
905 extern deco_calc_desaturation_time | |
906 extern deco_calc_hauptroutine | |
604 | 907 extern deco_calc_dive_interval |
582 | 908 extern deco_calc_dive_interval_1min |
909 extern deco_calc_dive_interval_10min | |
910 extern deco_clear_tissue | |
623 | 911 extern deco_init_output_vars |
582 | 912 extern deco_pull_tissues_from_vault |
913 extern deco_push_tissues_to_vault | |
560 | 914 |
915 | |
623 | 916 ;---------------------------- Bank0 ACCESS RAM ------------------------------ |
917 | |
918 ; Variables located in the Access Bank are declared in hwos.asm | |
919 | |
920 ifndef ACCESS_RAM_VARS | |
921 | |
922 extern HW_descriptor | |
923 extern HW_variants | |
924 | |
628 | 925 extern HW_flags_state1 |
926 extern HW_flags_state2 | |
623 | 927 |
928 extern OS_flags_persist | |
929 extern OS_flags_ISR1 | |
930 extern OS_flags_ISR2 | |
931 | |
932 extern OM_flags_mode | |
933 | |
934 extern DM_flags_deco | |
935 | |
936 extern cpu_speed_request | |
937 extern cpu_speed_state | |
938 | |
939 extern timebase | |
940 extern eventbase | |
604 | 941 |
623 | 942 extern isr_timeout_timer |
943 extern isr_timeout_reload | |
944 | |
945 extern total_divetime_secs | |
946 extern counted_divetime_mins | |
947 extern counted_divetime_secs | |
948 | |
949 extern apnoe_surface_secs | |
950 extern apnoe_surface_mins | |
951 extern apnoe_dive_secs | |
952 extern apnoe_dive_mins | |
953 | |
954 extern sampling_rate | |
955 extern sampling_timer | |
956 | |
957 extern simulatormode_depth | |
958 | |
959 extern hud_status_byte | |
960 extern hud_battery_mv | |
961 | |
631 | 962 endif ; ACCESS_RAM_VARS |
623 | 963 |
964 ;---------------------------- Bank0 NORMAL RAM ------------------------------ | |
965 isr_backup equ 0x060 ; Alias for "banksel isr_backup" | |
966 isr_backup udata_ovr isr_backup ; Bank 0 ISR data | |
604 | 967 |
631 | 968 ;---- Backup for general Registers, used by ISR Routines |
623 | 969 PROD_backup res 2 |
970 FSR0_backup res 2 | |
971 BSR_backup res 1 | |
972 | |
631 | 973 ;---- Multi-Purpose Registers, used by ISR Routines |
623 | 974 isr_mpr res 2 ; used in ms5541.asm and isr.asm |
631 | 975 #DEFINE isr_lo isr_mpr+0 ; ... |
976 #DEFINE isr_hi isr_mpr+1 ; ... | |
977 | |
978 ;---- Multi-Purpose Registers, NOT USED by ISR Routines | |
979 backup_mpr res 2 ; used in rtc.asm | |
980 #DEFINE backup_lo backup_mpr+0 | |
981 #DEFINE backup_hi backup_mpr+1 | |
982 | |
623 | 983 |
984 ;---- Time and Date - Real Time Clock | |
985 rtc_year res 1 ; running year | Attention: | |
986 rtc_month res 1 ; running month | do not change | |
987 rtc_day res 1 ; running day | the Position of | |
988 rtc_hour res 1 ; running hour | these Variables | |
989 rtc_mins res 1 ; running minute | relative to | |
990 rtc_secs res 1 ; running second | each other! | |
582 | 991 |
623 | 992 rtc_latched_year res 1 ; latched year | Attention: |
993 rtc_latched_month res 1 ; latched month | do not change | |
994 rtc_latched_day res 1 ; latched day | the Position of | |
995 rtc_latched_hour res 1 ; latched hour | these Variables | |
996 rtc_latched_mins res 1 ; latched minute | relative to | |
997 rtc_latched_secs res 1 ; latched second | each other! | |
998 | |
999 ;--- RTC-independent Timebase | |
1000 timebase_mins res 1 ; RTC-independent timer for generating the every hour trigger | |
1001 timebase_secs res 1 ; RTC-independent timer for generating the every minute trigger | |
1002 | |
1003 ;---- other Timers | |
1004 uptime res 4 ; [sec] uptime of the OSTC since last cold start | |
629 | 1005 surface_interval_secs res 4 ; [sec] surface interval counted in seconds |
1006 surface_interval_mins res 2 ; [min] surface interval counted in minutes | |
623 | 1007 simulator_time res 1 ; [min] real runtime of the simulator |
1008 | |
1009 ;---- Data for Pressure and Temperature Calculation (MS5541) | |
1010 clock_count res 1 ; I2C clock pulse counter | |
1011 sensor_state_counter res 1 ; counter for pressure sensor state machine | |
1012 dLSB res 1 ; pressure sensor interface, LSB | |
1013 dMSB res 1 ; pressure sensor interface, MSB | |
1014 dbuffer res 1 ; pressure sensor interface, RX/TX buffer | |
582 | 1015 |
604 | 1016 C1 res 2 ; decoded calibration data |
623 | 1017 C2 res 2 ; decoded calibration data |
1018 C3 res 2 ; decoded calibration data | |
1019 C4 res 2 ; decoded calibration data, here C4-250 | |
1020 C5 res 2 ; decoded calibration data, here reference temperature UT1 = 8*C5 + 10000 (u16 range 10.000 .. +42.760) | |
1021 C6 res 2 ; decoded calibration data | |
582 | 1022 D1 res 2 ; raw pressure |
1023 D2 res 2 ; raw temperature | |
1024 xdT res 2 | |
1025 xdT2 res 2 | |
1026 OFF res 2 | |
1027 SENS res 2 | |
623 | 1028 |
1029 temperature_cur res 2 ; current temperature | |
1030 temperature_min res 2 ; minimum temperature (operated by divemode.asm) | |
1031 temperature_avg res 2 ; internal register used for averaging | |
1032 temperature_last res 2 ; internal register used for detecting changes | |
1033 | |
1034 pressure_abs res 2 ; current absolute pressure | |
1035 pressure_abs_avg res 2 ; internal register used for averaging | |
1036 pressure_abs_last res 2 ; internal register used for detecting pressure changes | |
1037 | |
1038 pressure_abs_sampled res 2 ; sampled surface pressure, sampled in sleep mode every 15 minutes | |
1039 pressure_abs_ref res 2 ; reference surface pressure, surface pressure sampled 15 minutes ago | |
1040 pressure_surf res 2 ; surface pressure used by ISR to calculate relative pressures | |
1041 | |
1042 pressure_rel_cur res 2 ; current relative pressure | |
1043 pressure_rel_max res 2 ; maximum relative pressure | |
1044 pressure_rel_sim res 2 ; simulated relative pressure (simulator mode) | |
582 | 1045 |
604 | 1046 ;---- Data for ISR Math Subroutines |
623 | 1047 isr_xA res 2 ; multiplicand 1 |
1048 isr_xB res 2 ; multiplicand 2 | |
1049 isr_xC res 4 ; resulting product | |
582 | 1050 |
604 | 1051 ;---- Display Brightness |
623 | 1052 ambient_light res 2 ; ambient light level |
604 | 1053 max_CCPR1L res 1 ; max. brightness value for CCPR1L |
582 | 1054 |
604 | 1055 ;---- Battery Gauge (nAs, nC) |
1056 battery_gauge res 6 ; 48 bit -> 78 Ah max | |
582 | 1057 |
604 | 1058 ;---- IR/S8-Link |
623 | 1059 ir_s8_buffer res .18 ; buffer for data received on IR/S8 interface, |
1060 ; also used to buffer MS5541 raw calibration data | |
1061 | |
1062 IFDEF _external_sensor | |
582 | 1063 ir_s8_counter res 1 |
604 | 1064 ir_s8_timeout res 1 ; timeout for valid data |
623 | 1065 ENDIF |
582 | 1066 |
623 | 1067 ;---- raw O2 Sensor Data received on S8 Link |
1068 IFDEF _external_sensor | |
1069 s8_rawdata_sensor1 res 3 ; 24 bit A/D raw data from S8 HUD sensor 1 | |
1070 s8_rawdata_sensor2 res 3 ; 24 bit A/D raw data from S8 HUD sensor 2 | |
1071 s8_rawdata_sensor3 res 3 ; 24 bit A/D raw data from S8 HUD sensor 3 | |
1072 ENDIF | |
582 | 1073 |
623 | 1074 ;---- Switch Processing (8 byte, called by ISR and sleep mode) |
1075 analog_sw1_raw res 2 ; idle values (average) | |
1076 analog_sw2_raw res 2 ; idle values (average) | |
1077 analog_counter res 1 ; for averaging | |
1078 analog_sw1 res 1 ; analog value for switch 1 | |
1079 analog_sw2 res 1 ; analog value for switch 2 | |
1080 button_polarity res 1 ; 0xFF (both normal), 0x00 (both inverted), 0x01 (left inverted only), 0x02 (right inverted only) | |
582 | 1081 |
631 | 1082 |
623 | 1083 ;--- resettable min and max Depth Option |
1084 IFDEF _min_depth_option | |
1085 pressure_rel_min_trip res 2 ; resettable minimum relative pressure | |
1086 pressure_rel_max_trip res 2 ; resettable maximum relative pressure | |
1087 ENDIF | |
582 | 1088 |
631 | 1089 ; 143 byte used, 17 byte free |
560 | 1090 |
623 | 1091 |
582 | 1092 ;---------------------------- Common DATA ------------------------------------ |
623 | 1093 common equ 0x100 ; Alias for "banksel common" |
1094 common udata_ovr common ; Bank 1 general variables | |
582 | 1095 |
623 | 1096 ;---- Multi-Purpose Register for Data Storage and Interface with Conversion and Display Functions (6 byte) |
1097 mpr res 6 ; will be used as base address of 1, 2, 3, 4 and 6 byte buffers | |
1098 #DEFINE lo mpr+0 ; nickname for "low" | |
1099 #DEFINE hi mpr+1 ; nickname for "high" | |
1100 #DEFINE up mpr+2 ; nickname for "upper" | |
1101 #DEFINE ex mpr+3 ; nickname for "extra" | |
1102 #DEFINE ul mpr+4 ; nickname for "ultra" | |
1103 #DEFINE hy mpr+5 ; nickname for "hyper" | |
1104 | |
582 | 1105 |
623 | 1106 ;---- Flags - Menu System (2 byte) |
1107 MS_flags_control res 1 ; menu system - control | |
1108 MS_flags_imprint res 1 ; menu system - data imprinting | |
582 | 1109 |
631 | 1110 ;---- Flags - Dive Mode (9 byte) |
623 | 1111 DM_flags_state res 1 ; dive mode - dive states |
1112 DM_flags_sensor res 1 ; dive mode - O2 sensors | |
631 | 1113 DM_flags_request res 1 ; dive mode - user requests / general |
623 | 1114 DM_flags_event res 1 ; dive mode - data recording events |
1115 DM_flags_layout1 res 1 ; dive mode - display control / layout (1) | |
1116 DM_flags_layout2 res 1 ; dive mode - display control / layout (2) | |
631 | 1117 DM_flags_layout3 res 1 ; dive mode - display control / layout (3) |
623 | 1118 DM_flags_message res 1 ; dive mode - display control / messages |
1119 DM_flags_gas_dil res 1 ; dive mode - display control / gas, diluent | |
1120 | |
1121 ;---- Miscellaneous Flags (1 byte) | |
1122 misc_flags res 1 | |
1123 | |
1124 ;---- Interface to numerical Display Functions (1 byte) | |
582 | 1125 ignore_digits res 1 |
1126 | |
623 | 1127 ;---- Interface to Graphic Functions (12 byte) |
582 | 1128 win_leftx2 res 1 |
1129 win_top res 1 | |
1130 win_width res 2 | |
1131 win_height res 1 | |
623 | 1132 win_bargraph res 1 ; width of the bargraph bar |
1133 win_color1 res 1 ; 2 byte color | |
1134 win_color2 res 1 ; 2 byte color | |
1135 win_color3 res 1 ; 3 byte color used for display 2 | |
1136 win_color4 res 1 ; 3 byte color used for display 2 | |
1137 win_color5 res 1 ; 3 byte color used for display 2 | |
1138 win_font res 1 ; font size selector | |
560 | 1139 |
623 | 1140 ;---- Interface to Math Functions (16 byte) |
582 | 1141 divA res 2 |
1142 xA res 2 | |
1143 xB res 2 | |
623 | 1144 xC res 4 |
582 | 1145 sub_a res 2 |
1146 sub_b res 2 | |
623 | 1147 sub_c res 2 |
582 | 1148 |
631 | 1149 ;---- Menu System and Views (5 byte) |
623 | 1150 menu_pos_cur res 1 ; current position in main menu |
1151 menu_pos_max res 1 ; highest position in main menu | |
1152 active_premenu res 1 ; currently shown pre-menu (0: none) | |
631 | 1153 active_customview res 1 ; currently shown custom view |
1154 backup_customview res 1 ; previously shown custom view | |
623 | 1155 |
1156 ;---- Miscellaneous (6 byte) | |
1157 batt_voltage res 2 ; battery voltage in mV (no ISR involved) | |
1158 batt_percent res 1 ; battery in percent (1-100%) | |
604 | 1159 message_counter res 1 ; counts amount of messages |
623 | 1160 message_page res 1 ; current message page number |
604 | 1161 pairing_slot res 1 ; slot number, used in transmitter pairing |
1162 | |
631 | 1163 ;---- Dive Mode / all modes (26 byte) |
623 | 1164 divesecs_avg_trip res 2 ; time accumulator for the resettable average depth & stopwatch |
1165 divesecs_avg_total res 2 ; time accumulator for the total dive average depth | |
1166 pressure_rel_avg_trip res 2 ; calculated resettable average depth | |
1167 pressure_rel_avg_total res 2 ; calculated total dive average depth | |
1168 pressure_rel_cur_cached res 2 ; cached current relative pressure | |
1169 pressure_rel_max_cached res 2 ; cached maximum relative pressure | |
1170 pressure_abs_cached res 2 ; cached current absolute pressure | |
1171 pressure_abs_10 res 2 ; cached current absolute pressure divided by 10 | |
1172 depth_meter res 1 ; current depth in meters | |
1173 safety_stop_countdown res 1 ; counter for safety stop | |
1174 dive_timeout_timer res 2 ; timeout timer for leaving dive mode after surfacing | |
582 | 1175 gaslist_gas res 1 ; used for transfer between gaslist.asm and menu_tree.asm |
604 | 1176 best_gas_number res 1 ; number of the "best gas": 0= none found, 1-5= gases 1-5, 255= not computed |
623 | 1177 active_gas res 1 ; the currently used OC/bailout gas (1-5) |
1178 | |
1179 IFDEF _ccr_pscr | |
604 | 1180 best_dil_number res 1 ; number of the "best dil": 0= none found, 1-5= dils 1-5, 255= not computed |
1181 active_dil res 1 ; the currently used diluent (1-5) | |
623 | 1182 ENDIF |
1183 | |
631 | 1184 IFDEF _cave_mode |
1185 DM_flags_cavereq res 1 ; dive mode - user requests / cave mode | |
1186 backtrack_deltatime res 1 ; time elapsed since last depth recording in seconds | |
1187 backtrack_waypoint_num res 1 ; current waypoint number | |
1188 backtrack_waypoint_turn res 1 ; waypoint number of the turn point | |
1189 ENDIF | |
1190 | |
623 | 1191 ;---- Dive Mode / apnoe mode (2 byte) |
1192 apnoe_max_pressure res 2 ; max depth over all dives in the series | |
560 | 1193 |
623 | 1194 ;---- Gas 6 Data (2 byte) |
1195 gas6_O2_ratio res 1 ; gas 6 O2 ratio | |
1196 IFDEF _helium | |
1197 gas6_He_ratio res 1 ; gas 6 He ratio | |
1198 ENDIF | |
582 | 1199 |
623 | 1200 ;---- Profile Recording (6 byte) |
1201 alarm_type res 1 ; | |
1202 event_byte1 res 1 ; | |
1203 event_byte2 res 1 ; | |
1204 CNS_start res 2 ; CNS value at beginning of dive | |
560 | 1205 |
631 | 1206 ;---- External Flash (14 byte) |
582 | 1207 ext_flash_address res 3 ; 24 bit address |
631 | 1208 ext_flash_length_counter res 3 ; 24 bit length counter |
582 | 1209 ext_flash_log_pointer res 3 ; 24 bit address for logbook profile storing |
1210 ext_flash_end_pointer res 3 ; 24 bit address for logbook profile storing | |
631 | 1211 ext_flash_rw res 1 ; transfer register for data read / write |
1212 ext_flash_rollover_threshold res 1 ; rollover threshold for address increment operations | |
582 | 1213 |
623 | 1214 ;---- Battery Management (12 byte) |
1215 battery_capacity_internal res 2 ; for internal battery gauging | |
1216 battery_capacity res 2 ; for battery gauge IC | |
1217 battery_offset res 2 ; for battery gauge IC | |
1218 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 | |
1219 battery_accumulated_charge res 2 ; raw values in battery gauge IC | |
1220 battery_temperature res 2 ; battery temperature in 0.1 Kelvin | |
1221 gauge_status_byte res 1 ; gauge IC status byte | |
560 | 1222 |
1223 | |
604 | 1224 ;========================= private Variables =================================== |
582 | 1225 ; do not access from outside of the respective source files! |
560 | 1226 |
623 | 1227 ;---- aa_wordprocessor.asm and strings.asm |
1228 AA_flags res 1 ; various flags for aa_wordprocessor and strings | |
582 | 1229 aa_bitlen res 1 ; count of pixels when decoding bitmaps |
623 | 1230 aa_start res 2 ; PROM pointer to start of encoded bitmap |
582 | 1231 aa_end res 2 ; and end of it |
1232 aa_temp res 2 ; current color, divided by 2 or 4 | |
1233 | |
1234 ;--- adc_lightsensor.asm | |
623 | 1235 get_bat_volt_counter res 1 ; counter for reading the charger chip |
582 | 1236 |
1237 ;---- convert.asm | |
623 | 1238 CVT_flags1 res 1 |
1239 CVT_flags2 res 1 | |
582 | 1240 cvt_temp1 res 1 |
1241 cvt_temp2 res 1 | |
1242 cvt_temp3 res 1 | |
1243 cvt_temp4 res 1 | |
623 | 1244 cvt_temp_lo res 1 |
1245 cvt_temp_hi res 1 | |
582 | 1246 |
1247 ;---- color_processor.asm | |
623 | 1248 overall_pixels res 3 ; used by color_processor.asm |
1249 pixel_count res 2 ; used by color_processor.asm | |
1250 encoding_format res 1 ; image encoding format | |
1251 | |
1252 ;---- compass_ops.asm | |
1253 compass_flags res 1 ; flags are defined in compass_ops.asm | |
582 | 1254 |
1255 ;---- comm.asm | |
623 | 1256 comm_timeout_timer res 1 ; timeout for communication |
582 | 1257 |
1258 ;---- eeprom_rs232.asm | |
631 | 1259 eeprom_loop res 1 ; loop counter (actually used in flash and serial, too) |
1260 rx_timoeut_tmr5h_load res 1 ; TMR5H load value for RS232 RX timeout | |
582 | 1261 |
1262 ;---- i2c.asm | |
1263 i2c_temp1 res 1 ; temporary data | |
1264 i2c_temp2 res 1 ; temporary data | |
1265 | |
623 | 1266 ;---- math.asm |
1267 math_loop res 1 ; loop counter | |
1268 | |
582 | 1269 ;---- menu_processor.asm |
623 | 1270 menustack_pointer res 1 ; pointer to menu stack |
582 | 1271 menu_flags res 1 ; flags for menu entries |
1272 menu_item res 1 ; index of the current item | |
1273 start_item res 1 ; index of the first item (scrolling) | |
1274 item_max res 1 ; number of items in menu | |
1275 selected_item res 1 ; index of the current item | |
1276 value_type res 1 ; type for vertical menu | |
623 | 1277 dynamic_item res 3 ; callback address |
582 | 1278 menu_block res 3 ; address of the menu block (i.e. item 0) |
623 | 1279 menu_title res 3 ; text or procedure for dynamic menu |
582 | 1280 menu_center res 1 ; centering for line menu |
623 | 1281 proc_item res 3 ; address of the current procedure |
582 | 1282 text_item res 2 ; address of the current text |
1283 | |
1284 ;---- options.asm | |
631 | 1285 #DEFINE opt_definiton_bytes .12 ; | Attention: do not change the relative position of these vars! |
1286 opt_type res 1 ; | option type | |
1287 opt_serial res 1 ; | index used for option read/write via RS232 | |
1288 opt_inc res 1 ; | increment value, also used for enum low and string default+1 | |
1289 opt_min res 1 ; | minimum value, also used for enum high | |
1290 opt_max res 1 ; | maximum value | |
1291 opt_default res 1 ; | default value | |
1292 opt_unit res 2 ; | pointer to multi-lingual unit text | |
1293 opt_memory res 2 ; | pointer to memory position | |
1294 opt_eeprom_index res 1 ; | pointer to EEPROM position (index) | |
1295 opt_eeprom_bank res 1 ; | pointer to EEPROM position (bank) | |
1296 opt_end_token res 1 ; | =0xFF: end of table reached (does not count into opt_definiton_bytes) | |
1297 | |
582 | 1298 |
1299 ;---- tft.asm | |
623 | 1300 tft_save_top res 1 |
1301 tft_save_height res 1 | |
1302 tft_save_left res 1 | |
1303 tft_save_width res 1 | |
582 | 1304 tft_temp1 res 1 |
1305 tft_temp2 res 1 | |
1306 tft_temp3 res 1 | |
1307 tft_temp4 res 1 | |
1308 | |
623 | 1309 ;---- dump screen Function |
604 | 1310 IFDEF _screendump |
623 | 1311 ds_line res 1 ; current line (0..239) |
1312 ds_column res 1 ; current columnx2 (0..159) | |
1313 ds_pixel res 2 ; current pixel color | |
1314 ds_count res 1 ; repetition count | |
604 | 1315 ENDIF |
1316 | |
582 | 1317 ;---- wait.asm |
1318 wait_counter res 1 | |
1319 | |
623 | 1320 |
631 | 1321 ; 201 byte used, 7 byte free (208 byte total) |
582 | 1322 |
1323 | |
1324 ;============================ LOCAL DATA ====================================== | |
1325 ; Space for various overlayed local data from top-level applications, | |
1326 ; i.e. applications that never run in parallel to each other | |
1327 ; | |
1328 ; --------------------- local Data Users -------------------------------------- | |
623 | 1329 ; |
1330 ; -------------- Applications using ---------------------- | |
582 | 1331 ; Mode local1 local2 local3 |
1332 ; ----------------------------------------------------------------------------- | |
1333 ; sleepmode sleepmode.asm (unused) (unused) | |
1334 ; surfmode surfmode.asm* (unused) (unused) | |
628 | 1335 ; simulator divemode.asm divemode.asm simulator.asm |
604 | 1336 ; divemode divemode.asm divemode.asm ghostwriter.asm |
623 | 1337 ; logbook logbook.asm logbook.asm logbook.asm |
582 | 1338 ; |
1339 ; * assigned to this slot, but currently no local memory used | |
1340 | |
1341 local1 equ 0x1D0 ; Alias for CBLOCK directive | |
1342 local1 udata_ovr 0x1D0 ; Bank1 shared local space | |
1343 res 0x10 ; 16 Byte (0x1D0 ... 0x1DF) | |
1344 | |
1345 local2 equ 0x1E0 ; Alias for CBLOCK directive | |
1346 local2 udata_ovr 0x1E0 ; Bank1 shared local space | |
1347 res 0x10 ; 16 Byte (0x1E0 ... 0x1EF) | |
1348 | |
1349 local3 equ 0x1F0 ; Alias for CBLOCK directive | |
1350 local3 udata_ovr 0x1F0 ; Bank1 shared local space | |
1351 res 0x10 ; 16 Byte (0x1F0 ... 0x1FF) | |
1352 | |
1353 | |
1354 ;---------------------------- Common2 DATA ------------------------------------ | |
623 | 1355 common2 equ 0xA00 ; Alias for "banksel common2" |
1356 common2 udata_ovr common2 ; Bank 10 general variables | |
582 | 1357 |
623 | 1358 ;---- Data for Logging (6 byte), sampled in divemode.asm and used in ghostwriter.asm |
1359 start_year res 1 ; year | ATTENTION: | |
1360 start_month res 1 ; month | do not change the | |
1361 start_day res 1 ; day | position of these | |
1362 start_hour res 1 ; hour | variables relative | |
1363 start_mins res 1 ; minute | to each other! | |
1364 start_secs res 1 ; second, not used, for code commonality | | |
582 | 1365 |
623 | 1366 supersat_start res 1 ; leading tissue supersaturation at beginning of the dive |
1367 | |
1368 ;---- O2 Sensors (9 byte, updated by ISR when sensors are connected via datalink) | |
1369 IFDEF _external_sensor | |
1370 sensor1_mv res 2 ; sensor 1 voltage in 0.1 mV steps | |
1371 sensor2_mv res 2 ; sensor 2 voltage in 0.1 mV steps | |
1372 sensor3_mv res 2 ; sensor 3 voltage in 0.1 mV steps | |
1373 sensor1_ppO2 res 1 ; sensor 1 ppO2 in 0.01 bar steps | |
1374 sensor2_ppO2 res 1 ; sensor 2 ppO2 in 0.01 bar steps | |
1375 sensor3_ppO2 res 1 ; sensor 3 ppO2 in 0.01 bar steps | |
1376 ENDIF | |
582 | 1377 |
623 | 1378 ;---- last Dive Statistics (7 byte) |
1379 lastdive_duration res 3 ; byte 0= minutes, low byte, 1= minutes, high byte, 2= seconds | |
1380 lastdive_maxdepth res 2 ; in mbar | |
1381 lastdive_avgdepth res 2 ; in mbar | |
582 | 1382 |
623 | 1383 ;---- Backup of last shown Custom View (2 byte) |
582 | 1384 customview_surfmode res 1 ; storage to remember last selected custom view in surface mode |
1385 customview_divemode res 1 ; storage to remember last selected custom view in dive mode | |
1386 | |
623 | 1387 ;---- Miscellaneous (0 byte) |
1388 ;old_velocity res 4 ; stores the last 4 speeds (8 seconds) in m/min | |
1389 | |
1390 ;---- Menu Processor (8 byte) | |
1391 menustack res 8 ; menu stack | |
582 | 1392 |
628 | 1393 ;---- Graphical Compass (15 byte) |
623 | 1394 xRD res 2 ; virtual compass ruler offset |
1395 xRDr res 2 ; virtual compass ruler offset - right end | |
1396 xRD180 res 2 ; virtual compass ruler offset for the -180 marker | |
1397 xLO res 1 ; lo backup to prevent trashing | |
1398 xHI res 1 ; hi backup to prevent trashing | |
1399 xCM res 1 ; compass bearing relative position | |
1400 compass_heading_new res 2 ; corrected heading (in 1°) : -180 .. 180 | |
1401 compass_heading_shown res 2 ; displayed heading | |
1402 compass_bearing res 2 ; displayed bearing | |
582 | 1403 |
623 | 1404 ;---- Compass Arithmetics (30 byte) |
1405 compass_DX res 2 ; raw data | |
1406 compass_DY res 2 ; raw data | |
1407 compass_DZ res 2 ; raw data | |
1408 accel_DX res 2 ; raw data | |
1409 accel_DY res 2 ; raw data | |
1410 accel_DZ res 2 ; raw data | |
1411 compass_DX_f res 2 ; filtered Data | |
1412 compass_DY_f res 2 ; filtered Data | |
1413 compass_DZ_f res 2 ; filtered Data | |
1414 accel_DX_f res 2 ; filtered Data | |
1415 accel_DY_f res 2 ; filtered Data | |
1416 accel_DZ_f res 2 ; filtered Data | |
631 | 1417 compass_CX_f res 2 ; calibration data (stored via options system) |
1418 compass_CY_f res 2 ; calibration data (stored via options system) | |
1419 compass_CZ_f res 2 ; calibration data (stored via options system) | |
582 | 1420 |
623 | 1421 ;---- temporary Data for Q15 Arithmetics (7 byte, compass_ops.asm, called from C) |
1422 compass_a res 2 ; | |
1423 compass_b res 2 ; | |
1424 compass_r res 3 ; | |
1425 | |
1426 ;---- Data Exchange with TR Co-Processor (50 byte) | |
604 | 1427 IFDEF _rx_functions |
1428 rx_buffer res .48 ; Buffer for RX data (slots 0-7) | |
623 | 1429 rx_firmware_cur_major res 1 ; TR module current firmware, major |
1430 rx_firmware_cur_minor res 1 ; TR module current firmware, minor | |
1431 ENDIF | |
604 | 1432 |
628 | 1433 ;---- SAC Calculation on Pressure Readings 1 & 2 (22 byte) |
623 | 1434 IFDEF _rx_functions |
604 | 1435 pres_accu_1st res 4 ; accumulator for pressure drop in 1/160 bar | ATTENTION: do not |
1436 pres_accu_2nd res 4 ; accumulator for pressure drop in 1/160 bar | change the | |
628 | 1437 time_accu_1st res 2 ; accumulator for reading ages in seconds | position |
604 | 1438 gas__last_1st res 1 ; last gas assignment | of these |
628 | 1439 time_accu_2nd res 2 ; accumulator for reading ages in seconds | variables |
604 | 1440 gas__last_2nd res 1 ; last gas assignment | relative |
1441 pres_last_1st res 2 ; last pressure reading pressure in 1/160 bar | to each | |
1442 pres_last_2nd res 2 ; last pressure reading pressure in 1/160 bar | other! | |
1443 time_last_1st res 2 ; last pressure reading time in seconds | | |
1444 time_last_2nd res 2 ; last pressure reading time in seconds | | |
1445 ENDIF | |
1446 | |
623 | 1447 |
631 | 1448 ; 156 byte used, 100 byte free |
1449 | |
1450 | |
1451 ;----------------------- Bank 2 General Purpose Buffer 1 ----------------------- | |
1452 ; general purpose buffer no.1 | |
1453 ; | |
1454 ; NOTE: needs to be aligned with a bank (low(buffer)=0) | |
1455 | |
1456 buffer udata_ovr 0x200 | |
1457 buffer res .256 ; buffer 1 - string buffer, etc. | |
582 | 1458 |
1459 | |
631 | 1460 ;----------------------- Bank 11 General Purpose Buffer 2 ---------------------- |
1461 ; general purpose buffer no. 2 | |
1462 ; | |
1463 ; NOTE: needs to be aligned with a bank (low(buffer)=0) | |
582 | 1464 |
631 | 1465 ; Remark: this memory block is already allocated in shared_definitions.h for |
1466 ; use while in dive mode, so we need to make a hard reference here | |
1467 ; | |
1468 ;buffer2 udata_ovr 0xB00 | |
1469 ;buffer2 res .256 ; buffer 2 - backtracking, flash mirror, etc. | |
582 | 1470 |
631 | 1471 #DEFINE buffer2 0xB00 |
582 | 1472 |
1473 | |
604 | 1474 ;---------------------- Bank 14 Options Table --------------------------------- |
623 | 1475 opt_table equ 0xE00 ; Alias for "banksel opt_table" |
1476 opt_table udata_ovr opt_table ; Bank 14 options table | |
582 | 1477 |
623 | 1478 ;---- Gas and Diluent Settings |
604 | 1479 opt_gas_O2_ratio res 5 ; O2 ratios of OC/bailout gases | ATTENTION: |
1480 opt_dil_O2_ratio res 5 ; O2 ratios of diluents | keep relative | |
1481 opt_gas_He_ratio res 5 ; He ratios of OC/bailout gases | positioning of | |
1482 opt_dil_He_ratio res 5 ; He ratios of diluents | all arrays in | |
1483 opt_gas_type res 5 ; OC/bailout gas type: O=Disabled, 1=First, 2=Travel, 3=Deco | this block! | |
1484 opt_dil_type res 5 ; dil type: 0=Disabled, 1=First, 2=Normal | | |
1485 opt_gas_change res 5 ; change depths for OC/Bailout gases | | |
1486 opt_dil_change res 5 ; change depths for diluents | | |
1487 | |
623 | 1488 ;---- Setpoints |
1489 opt_setpoint_cbar res 5 ; setpoints in cbar | ATTENTION: keep relative positioning | |
1490 opt_setpoint_change res 5 ; change depth for the setpoints in meter | of these two arrays! | |
582 | 1491 |
623 | 1492 ;---- Dive Mode Settings |
1493 opt_dive_mode res 1 ; main dive/deco mode: =0: OC, =1: CC, =2: Gauge, =3: Apnea, =4: pSCR | |
1494 opt_ccr_mode res 1 ; CCR/pSCR sub mode: =0: fixed/calculated SP, =1: Sensor, =2: Auto SP | |
1495 | |
1496 ;---- custom Text | |
1497 #DEFINE opt_name_length .60 ; custom text string 5 rows with 12 chars | |
1498 opt_name res opt_name_length | |
1499 | |
1500 ;---- various other Settings | |
631 | 1501 opt_fw_version_major res 1 ; firmware version, major | use read-only! |
1502 opt_fw_version_minor res 1 ; firmware version, minor | | |
1503 opt_fw_version_beta res 1 ; firmware version, beta | | |
623 | 1504 opt_surface_interval res 1 ; surface interval, used by deco calculator |
582 | 1505 opt_brightness res 1 ; =0: Eco, =1:Medium, =2:Full |
1506 opt_salinity res 1 ; 0-5% | |
604 | 1507 opt_language res 1 ; current language: 0=EN, 1=DE, 2=FR, 3=SP |
582 | 1508 opt_units res 1 ; 0:m/°C, 1:ft/°F |
1509 opt_dateformat res 1 ; =0:MMDDYY, =1:DDMMYY, =2:YYMMDD | |
1510 opt_last_stop res 1 ; =3:3m, =4:4m, =5:5m, =6:6m | |
604 | 1511 opt_aGF_high res 1 ; alternative GF HIGH |
1512 opt_aGF_low res 1 ; alternative GF LOW | |
582 | 1513 opt_GF_high res 1 ; GF HIGH |
1514 opt_GF_low res 1 ; GF LOW | |
1515 opt_enable_aGF res 1 ; =1: aGF can be selected underwater | |
1516 opt_compass_gain res 1 ; 0-7 (230LSB/Gauss to 1370LSB/Gaus) | |
1517 opt_sampling_rate res 1 ; =1: 10s, =0: 2s | |
1518 opt_dive_color_scheme res 1 ; 0-3 | |
1519 opt_pressure_adjust res 1 ; SIGNED char (two's complement), -20/+20mbar max. | |
631 | 1520 opt_safetystop res 1 ; =1: a safety stop is shown |
582 | 1521 opt_calibration_O2_ratio res 1 ; %O2 of calibration gas |
604 | 1522 opt_x_s1 res 2 ; calibration factor (Not stored in EEPROM) |
1523 opt_x_s2 res 2 ; calibration factor (Not stored in EEPROM) | |
1524 opt_x_s3 res 2 ; calibration factor (Not stored in EEPROM) | |
582 | 1525 opt_sensor_fallback res 1 ; NOT USED ANY MORE, KEPT FOR COMPATIBILITY WITH EEPROM IMAGE |
604 | 1526 opt_flip_screen res 1 ; =1: flip the screen |
623 | 1527 opt_cR_button_left res 1 ; left button sensitivity (cR hardware) |
604 | 1528 opt_cR_button_right res 1 ; right button sensitivity (cR hardware) |
631 | 1529 opt_depth_warn res 1 ; =1:do a red blinking warning, =0:default behavior |
1530 opt_vsitext res 1 ; =1:use the depth dependent ascend rate limits | |
582 | 1531 opt_vsigraph res 1 ; =1:draw the graphical VSI bar |
1532 opt_showppo2 res 1 ; =1:always show the ppO2 value in the warning position | |
1533 opt_temperature_adjust res 1 ; SIGNED char (two's complement), -2.0/+2.0 °C max. | |
1534 opt_safety_stop_length res 1 ; [s] | |
1535 opt_safety_stop_start res 1 ; [cbar] | |
1536 opt_safety_stop_end res 1 ; [cbar] | |
1537 opt_safety_stop_reset res 1 ; [cbar] | |
604 | 1538 opt_diveTimeout res 1 ; timeout for dive mode [min] |
582 | 1539 opt_sim_setpoint_number res 1 ; setpoint to use for deco calculation |
631 | 1540 opt_calc_gasvolume res 1 ; calculate OC gas volume needs for ascent |
582 | 1541 opt_sim_use_aGF res 1 ; =0: use GF, =1: use aGF for deco calculation |
1542 opt_enable_IBCD res 1 ; enable IBCD warning | |
1543 opt_sat_multiplier_gf res 1 ; Buhlmann safety factor for GF deco | |
1544 opt_desat_multiplier_gf res 1 ; Buhlmann safety factor for GF deco | |
1545 opt_sat_multiplier_non_gf res 1 ; Buhlmann safety factor for NON-GF deco | |
1546 opt_desat_multiplier_non_gf res 1 ; Buhlmann safety factor for NON-GF deco | |
604 | 1547 opt_2ndDepthDisp res 1 ; =1: show average depth instead of max depth |
623 | 1548 opt_max_depth res 1 ; depth at which a warning will be given |
631 | 1549 opt_store_apnoe res 1 ; =1: store dives in apnoe mode into logbook |
623 | 1550 opt_tissue_graphics res 1 ; =0: show N2 and He pressures, =1: show pressures and saturations |
1551 opt_logoffset_step res 1 ; step size when adjusting log offset | |
1552 opt_layout res 1 ; initial layout of dive mode screen | |
631 | 1553 opt_ext_stops res 1 ; =1: place gas switches also below 1st stop depth |
1554 opt_s8_mode res 1 ; S8 mode - analog / digital | |
1555 opt_gas_contingency_sim res 1 ; =1: deco calculator: switch to alternative gas if best gas is used up | |
1556 opt_gas_contingency_dive res 1 ; =1: real dive mode: switch to alternative gas if best gas is used up | |
1557 opt_cave_mode res 1 ; =1: cave mode switched on | |
604 | 1558 |
623 | 1559 ;---- RX Function Settings |
604 | 1560 opt_transmitter_id_1 res 2 ; 16 bit transmitter ID for Gas 1 |
1561 opt_transmitter_id_2 res 2 ; 16 bit transmitter ID for Gas 2 | |
1562 opt_transmitter_id_3 res 2 ; 16 bit transmitter ID for Gas 3 | |
1563 opt_transmitter_id_4 res 2 ; 16 bit transmitter ID for Gas 4 | |
1564 opt_transmitter_id_5 res 2 ; 16 bit transmitter ID for Gas 5 | |
1565 opt_transmitter_id_6 res 2 ; 16 bit transmitter ID for Dil 1 | |
1566 opt_transmitter_id_7 res 2 ; 16 bit transmitter ID for Dil 2 | |
1567 opt_transmitter_id_8 res 2 ; 16 bit transmitter ID for Dil 3 | |
1568 opt_transmitter_id_9 res 2 ; 16 bit transmitter ID for Dil 4 | |
1569 opt_transmitter_id_10 res 2 ; 16 bit transmitter ID for Dil 5 | |
1570 opt_TR_mode res 1 ; TR functions - mode | |
1571 opt_TR_1st_pres res 1 ; TR functions - 1st pressure assignment | |
1572 opt_TR_2nd_pres res 1 ; TR functions - 2nd pressure assignment | |
1573 opt_TR_Bail_pres res 1 ; TR functions - bailout pressure assignment | |
1574 | |
631 | 1575 ; ==> 190 bytes used - 54 bytes free (244 usable bytes only in bank 14 as the upper 12 |
1576 ; bytes are reserved for special function registers) | |
582 | 1577 |
1578 ;----------------------------------------------------------------------------- |