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