Mercurial > public > hwos_code
annotate src/hwos.inc @ 503:4542d03f748a
NEW: Last Dive customviews in surface mode with divetime, depth and interval
author | heinrichsweikamp |
---|---|
date | Sun, 11 Jun 2017 17:11:40 +0200 |
parents | e8351dd7bb90 |
children | b9f06f1a1f74 |
rev | line source |
---|---|
0 | 1 ;============================================================================= |
2 ; | |
275 | 3 ; File hwos.inc |
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 | |
14 LIST P=18F87K22 ; change also: Configure->SelectDevice from Mplab | |
15 | |
99
87cc1adfe4da
show event "bailout" in the internal logbook
heinrichsweikamp
parents:
98
diff
changeset
|
16 ;#DEFINE __DEBUG |
0 | 17 |
448 | 18 ;#DEFINE french_italian ; If defined, use french and italian instead of english and german |
19 | |
0 | 20 #include <p18f87k22.inc> |
21 #include <ports.inc> ; Portmap | |
22 | |
180 | 23 ; Firmware definition |
402
a3a0f1fd7fc4
NEW: Logbook shows markers with small orange boxes in the profile
heinrichsweikamp
parents:
399
diff
changeset
|
24 #DEFINE softwareversion_x d'2' ; Software version XX.YY |
503
4542d03f748a
NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents:
498
diff
changeset
|
25 #DEFINE softwareversion_y d'17' ; Software version XX.YY |
492 | 26 #DEFINE softwareversion_beta 0 ; (and 0 for release) |
180 | 27 ; Firmware version will appear in "Change Firmware" style |
486 | 28 #DEFINE firmware_expire_year .18 |
497 | 29 #DEFINE firmware_expire_month .4 |
30 #DEFINE firmware_expire_day .3 | |
0 | 31 |
32 #DEFINE comm_service_key 0xABCDEF | |
33 | |
34 ;----------------------------------------------------------------------------- | |
35 | |
36 #DEFINE CCP1CON_VALUE b'00001100' ; PWM1 for LED dimming | |
37 #DEFINE T2CON_ECO b'00000100' ; 1:1 Postscaler, 1:1 Prescaler, Timer 2 start -> 980Hz (Good compromise of no-flicker and efficiency) | |
38 #DEFINE T2CON_NORMAL b'00001110' | |
39 #DEFINE T2CON_FASTEST b'00001110' ; 1:2 Postscaler, 1:16 Prescaler, Timer 2 start -> 1960Hz (no-flicker) | |
40 | |
28 | 41 #DEFINE TMR0H_VALUE .245 ; RX Timeout (~3ms) |
42 | |
0 | 43 ; Timing for button hold-down flags |
44 #DEFINE TMR1H_VALUE_FIRST .255-.128 ; in steps of 7,8125ms -> 1s | |
45 #DEFINE TMR1H_VALUE_CONT .255-.32 ; in steps of 7,8125ms -> 0.25s | |
46 #DEFINE TMR1H_VALUE_CONT_DIVE .255-.64 ; in steps of 7,8125ms -> 0.5s | |
47 | |
48 ; Color Definitions: 8Bit RGB b'RRRGGGBB' | |
49 #DEFINE color_red b'11100000' ; (7,0,0) | |
50 #DEFINE color_dark_red b'10000101' ; (4,1,1) | |
51 #DEFINE color_violet b'11101011' ; (7,2,3) | |
52 #DEFINE color_blue b'11000111' ; (6,1,3) | |
53 #DEFINE color_green b'00011100' ; (0,7,0) | |
54 #DEFINE color_greenish b'00111110' ; (1,7,2) | |
55 #DEFINE color_dark_green b'00111001' ; (1,6,1) | |
56 #DEFINE color_yellow b'11111101' ; (7,7,1) | |
57 #DEFINE color_white b'11111111' ; (7,7,3) | |
58 #DEFINE color_black b'00000000' ; (0,0,0) | |
59 #DEFINE color_deepblue b'00000010' ; (0,0,2) | |
60 #DEFINE color_grey b'11011111' ; (6,7,3) | |
61 #DEFINE color_cyan b'11011111' ; (6,7,3) | |
62 #DEFINE color_lightblue b'11011011' ; (6,7,3) | |
63 #DEFINE color_orange b'11111000' ; (7,6,0) | |
64 #DEFINE color_pink b'11111010' ; (7,6,2) | |
65 | |
66 #DEFINE FT_TINY .0 | |
67 #DEFINE FT_SMALL .1 | |
68 #DEFINE FT_MEDIUM .2 | |
69 #DEFINE FT_LARGE .3 | |
70 | |
307
14719662fb95
Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents:
303
diff
changeset
|
71 #DEFINE warn_depth .1 |
14719662fb95
Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents:
303
diff
changeset
|
72 #DEFINE warn_cns .2 |
14719662fb95
Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents:
303
diff
changeset
|
73 #DEFINE warn_gf .3 |
14719662fb95
Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents:
303
diff
changeset
|
74 #DEFINE warn_ppo2 .4 |
14719662fb95
Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents:
303
diff
changeset
|
75 #DEFINE warn_ceiling .5 |
14719662fb95
Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents:
303
diff
changeset
|
76 #DEFINE warn_gas_in_gaslist .6 |
14719662fb95
Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents:
303
diff
changeset
|
77 #DEFINE warn_ppo2_hud .7 |
14719662fb95
Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents:
303
diff
changeset
|
78 #DEFINE warn_battery .8 |
0 | 79 |
113 | 80 ; External O2 cell input parameters |
81 #DEFINE min_mv .80 ; = 8mV | |
145
e3ac5b2021bc
NEW: Setpoint-Fallback option for external O2 sensor failure
heinrichsweikamp
parents:
143
diff
changeset
|
82 #DEFINE max_mv .2500 ; = 250mV |
196
a0e0ddfc1b49
suppress ghost readings for long, open cables
heinrichsweikamp
parents:
194
diff
changeset
|
83 #DEFINE ignore_mv .3500 ; = 350mV (To suppress ghost readings for long, open cables) |
0 | 84 |
85 ; Profile recording parameters | |
389
9175429bdeba
CHANGE: Logbook now shows end-of-dive date and time for dives made with firmware <1.92 indicated by an icon in the logbook
heinrichsweikamp
parents:
388
diff
changeset
|
86 #DEFINE logbook_profile_version 0x24 |
0 | 87 #DEFINE samplingrate_apnoe .1 ; [seconds] |
88 ; Warning: Divisors must be <.16 ! | |
89 #DEFINE div_temperature .6 ; x samplingrate [s] | |
90 #DEFINE div_deco .6 ; x samplingrate [s] | |
91 #DEFINE div_gf .12 ; x samplingrate [s] | |
92 #DEFINE div_ppo2_sensors .2 ; x samplingrate [s] | |
93 #DEFINE div_decoplan .12 ; x samplingrate [s] | |
94 #DEFINE div_cns .12 ; x samplingrate [s] | |
95 #DEFINE div_tank .0 ; x samplingrate [s] | |
96 ; Warning: Information lengths must be <.16 ! | |
97 #DEFINE infolength_temperature .2 ; [byte] | |
98 #DEFINE infolength_deco .2 ; [byte] | |
99 #DEFINE infolength_gf .1 ; [byte] | |
100 #DEFINE infolength_ppo2_sensors .9 ; [byte] | |
101 #DEFINE infolength_decoplan .15 ; [byte] | |
102 #DEFINE infolength_cns .2 ; [byte] | |
103 #DEFINE infolength_tank .0 ; [byte] | |
104 | |
105 ; "Better Gas" behavior | |
106 ; better_gas_window <= minimum_change_depth ! | |
107 ; minimum_change_depth >=5 ! | |
108 #DEFINE minimum_change_depth .3 ; [m] | |
69 | 109 #DEFINE better_gas_window_neg .3 ; [m] (Depth above change depth) |
110 #DEFINE better_gas_window_pos .1 ; [m] (Depth below change depth, if ppO2<opt_ppO2_max) | |
0 | 111 |
112 ; Dive mode limits and thresholds | |
113 #DEFINE start_dive_threshold .100 ; [cm] | |
114 #DEFINE high_altitude_dive_threshold .300;[cm] | |
35
eca4a201d8cf
change apnea timeout, do no longer store apnea dives in logbook
heinrichsweikamp
parents:
31
diff
changeset
|
115 #DEFINE apnoe_timeout .15 ; [min] |
0 | 116 #DEFINE divemode_menuview_timeout .10 ; [s] |
445 | 117 #DEFINE divemode_timeout_default .5 ; [min] |
0 | 118 #DEFINE divemode_menu_timeout .30 ; [s] |
119 #DEFINE ppo2_warning_low .19 ; [cbar] (Default value) | |
120 #DEFINE ppo2_lowest_setting .16 ; [cbar] (Minimum value) | |
121 #DEFINE ppo2_display_high .120 ; [cbar] | |
122 #DEFINE ppo2_warning_high .160 ; [cbar] (Default value) | |
123 #DEFINE ppo2_highest_setting .160 ; [cbar] (Max. Value) | |
124 #DEFINE cns_display_high .70 ; [%] | |
125 #DEFINE cns_warning_high .100 ; [%] | |
126 #DEFINE gf_display_high .75 ; [%] | |
127 #DEFINE gf_warning_high .100 ; [%] | |
128 #DEFINE depth_warn_mbar .13000 ; [mbar] | |
129 #DEFINE wake_up_from_sleep .1160 ; [mbar] | |
130 #DEFINE gf_display_threshold .20 ; [%] | |
131 #DEFINE simulator_timeout .15 ; [s] | |
192 | 132 #DEFINE sensor_voting_logic_threshold .20 ; Threshold in 0.01bar |
133 | |
0 | 134 |
135 ; Surface mode limits and thresholds | |
136 #DEFINE cns_display_surface_high .70 ; [%] | |
137 #DEFINE high_altitude_threshold .880 ; [mbar] | |
138 #DEFINE max_surfpressure .1080 ; [mbar] | |
139 #DEFINE timeout_surfacemode .90 ; [s] | |
187
669b5d00706d
CHANGE: Longer timeout (4 min) for calibration menu
heinrichsweikamp
parents:
185
diff
changeset
|
140 #DEFINE timeout_calibrate_menu .240 ; [s] |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
187
diff
changeset
|
141 #DEFINE timeout_ccr_surface .240 ; [s] |
0 | 142 |
143 ; Decomodel paramters | |
144 #DEFINE no_fly_time_ratio .60 ; [%] | |
145 #DEFINE deco_distance .10 ; [dm] | |
146 | |
147 ; Color-code parameters for the divemode | |
148 #DEFINE color_code_cns_high .100 ; [%] | |
149 #DEFINE color_code_gf_warn_high .101 ; [%] | |
399
db25f2028074
CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents:
398
diff
changeset
|
150 #DEFINE color_code_velocity_warn_high .11 ;[m/min] |
db25f2028074
CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents:
398
diff
changeset
|
151 #DEFINE color_code_velocity_attn_high .10 ;[m/min] |
0 | 152 |
153 ; Velocity threshold | |
399
db25f2028074
CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents:
398
diff
changeset
|
154 #DEFINE velocity_display_threshold_1 .3 ; [m/min] |
0 | 155 |
156 ; Battery thresholds | |
37
0e1723f2761e
use four additional data points for the battery monitor
mh@mh-THINK.fritz.box
parents:
35
diff
changeset
|
157 #DEFINE lithium_36v_empty .2400 ; [mV] Saft 3,6V LS14500 AA - threshold for battery percent display |
0 | 158 #DEFINE lithium_36v_low .2000 ; [mV] (Must be bigger then aa_15v_high!) |
159 #DEFINE aa_15v_high .1550 ; [mV] Energizer 1,5V E2 AA | |
160 #DEFINE aa_15v_low .1100 ; [mV] According to Energizer Datasheet EBC-4201R, Page 2 | |
43 | 161 #DEFINE color_code_battery_low .10 ; [%] |
162 #DEFINE battery_show_level .24 ; [%] | |
0 | 163 |
92
7ca1105751c7
add sensor calibration option (PC only), some cleanup
heinrichsweikamp
parents:
89
diff
changeset
|
164 ; 3,6V battery sensing data points at 70mA load |
7ca1105751c7
add sensor calibration option (PC only), some cleanup
heinrichsweikamp
parents:
89
diff
changeset
|
165 #DEFINE lithium_36v_75 .3000 ; [mV] |
7ca1105751c7
add sensor calibration option (PC only), some cleanup
heinrichsweikamp
parents:
89
diff
changeset
|
166 #DEFINE lithium_36v_50 .2900 ; [mV] |
7ca1105751c7
add sensor calibration option (PC only), some cleanup
heinrichsweikamp
parents:
89
diff
changeset
|
167 #DEFINE lithium_36v_25 .2600 ; [mV] |
7ca1105751c7
add sensor calibration option (PC only), some cleanup
heinrichsweikamp
parents:
89
diff
changeset
|
168 #DEFINE lithium_36v_10 .2500 ; [mV] |
448 | 169 |
170 ; Capacity for 2.4Ah Saft LS14500 and 0.8Ah Panasonic UR14500P | |
171 ; battery_gauge:6 is nAs | |
172 ; devide through 65536 | |
173 ; a) devide through 364 -> Result is in percent of a 2.4Ah Battery | |
174 ; 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
|
175 |
448 | 176 ; For internal battery gauging |
177 #DEFINE internal_saft_capacity .364 | |
178 #DEFINE internal_panasonic_capacity .121 | |
179 | |
180 ; For gauge IC | |
181 #DEFINE saft_capacity .281 ; 2.4Ah/0.085mAh/100 [%] | |
182 #DEFINE saft_offset .37300 ; 65536-(2.4Ah/0.085mAh) | |
183 | |
184 #DEFINE panasonic_capacity .94 ; 0.8Ah/0.085mAh/100 [%] | |
185 #DEFINE panasonic_offset .56124 ; 65536-(0.8Ah/0.085mAh) | |
186 | |
187 #DEFINE ncr18650_capacity .364 ; 3.1Ah/0.085mAh/100 [%] | |
188 #DEFINE ncr18650_offset .29065 ; 65536-(3.1Ah/0.085mAh) | |
189 | |
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
466
diff
changeset
|
190 #DEFINE ur16650_capacity .271 ; 2.3Ah/0.085mAh/100 [%] |
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
466
diff
changeset
|
191 #DEFINE ur16650_offset .38477 ; 65536-(2.3Ah/0.085mAh) |
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
466
diff
changeset
|
192 |
381
e32f424223fb
BUGFIX: Battery consumption calculation in sleep mode (3,6V battery only)
heinrichsweikamp
parents:
378
diff
changeset
|
193 #DEFINE current_sleepmode .31 |
0 | 194 #DEFINE current_backlight_multi .115 ; *CCPR1L+current_backlight_offset |
195 #DEFINE current_backlight_offset .216 | |
196 #DEFINE current_speed_eco .1914 | |
197 #DEFINE current_speed_normal .4027 | |
198 #DEFINE current_speed_fastest .5050 | |
199 #DEFINE current_ir_reciever .139 | |
200 #DEFINE current_compass .28 | |
201 | |
202 ; Brightness thresholds (between zero (off) and 255 (max. power)) | |
402
a3a0f1fd7fc4
NEW: Logbook shows markers with small orange boxes in the profile
heinrichsweikamp
parents:
399
diff
changeset
|
203 #DEFINE ambient_light_max_high_36V .170 |
200 | 204 #DEFINE ambient_light_max_high_cr .240 |
402
a3a0f1fd7fc4
NEW: Logbook shows markers with small orange boxes in the profile
heinrichsweikamp
parents:
399
diff
changeset
|
205 #DEFINE ambient_light_max_high_15V .140 |
198
c511dc403d7e
(Slightly) reduce current consumption in Eco and sleep mode
heinrichsweikamp
parents:
196
diff
changeset
|
206 #DEFINE ambient_light_min_high .35 |
402
a3a0f1fd7fc4
NEW: Logbook shows markers with small orange boxes in the profile
heinrichsweikamp
parents:
399
diff
changeset
|
207 #DEFINE ambient_light_max_medium .125 |
198
c511dc403d7e
(Slightly) reduce current consumption in Eco and sleep mode
heinrichsweikamp
parents:
196
diff
changeset
|
208 #DEFINE ambient_light_min_medium .25 |
402
a3a0f1fd7fc4
NEW: Logbook shows markers with small orange boxes in the profile
heinrichsweikamp
parents:
399
diff
changeset
|
209 #DEFINE ambient_light_max_eco .70 |
201 | 210 #DEFINE ambient_light_min_eco .10 ; Must be the lowest value! |
0 | 211 |
212 ; IR Link timeout | |
101 | 213 #DEFINE ir_timeout_value .64 ; multiples of 62,5ms |
0 | 214 |
352
5c6da9fa5cb0
add setpoint change to first sample in CCR mode
heinrichsweikamp
parents:
344
diff
changeset
|
215 ; Sp control constants |
5c6da9fa5cb0
add setpoint change to first sample in CCR mode
heinrichsweikamp
parents:
344
diff
changeset
|
216 #DEFINE surface_sp .50 ; in cbar |
5c6da9fa5cb0
add setpoint change to first sample in CCR mode
heinrichsweikamp
parents:
344
diff
changeset
|
217 |
0 | 218 ; Gaslist hard-coded limits |
219 #DEFINE gaslist_min_o2 .7 ; Minimum O2 [%] | |
185
f515712d8cd6
BUGFIX: Check min and max values after PC configuration properly
heinrichsweikamp
parents:
183
diff
changeset
|
220 #DEFINE gaslist_max_change_depth .99 ; Max. change depth [m] |
0 | 221 #DEFINE gaslist_sp_stepsize .10 ; Steps for Setpoint Setup [cbar] |
222 #DEFINE gaslist_sp_max .160 ; Max. Setpoint [cbar] | |
223 #DEFINE gaslist_sp_min .50 ; Min. Setpoint [cbar] | |
224 | |
16
7b06f20881be
calm compass reading for minor heading changes
heinrichsweikamp
parents:
15
diff
changeset
|
225 ; Compass display |
214 | 226 #DEFINE compass_fast_treshold .9 ; show new heading instantly if new and old > compass_fast_treshold |
227 #DEFINE compass_averaging .10 ; numbers of extra averaging | |
16
7b06f20881be
calm compass reading for minor heading changes
heinrichsweikamp
parents:
15
diff
changeset
|
228 |
235
23311219dacc
under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents:
234
diff
changeset
|
229 ; Hardware defines |
448 | 230 #DEFINE battery_gauge_available hardware_flag,0 ; OSTC has rechargeable battery with battery management chip |
235
23311219dacc
under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents:
234
diff
changeset
|
231 #DEFINE ambient_sensor hardware_flag,1 ; OSTC has an ambient sensor |
23311219dacc
under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents:
234
diff
changeset
|
232 #DEFINE analog_o2_input hardware_flag,2 ; OSTC has analog inputs and S8 digital |
23311219dacc
under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents:
234
diff
changeset
|
233 #DEFINE optical_input hardware_flag,3 ; OSTC has an digital optical input |
23311219dacc
under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents:
234
diff
changeset
|
234 #DEFINE ble_available hardware_flag,4 ; OSTC has an BLE module |
23311219dacc
under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents:
234
diff
changeset
|
235 ;unused |
23311219dacc
under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents:
234
diff
changeset
|
236 ;unused |
23311219dacc
under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents:
234
diff
changeset
|
237 ;unused |
23311219dacc
under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents:
234
diff
changeset
|
238 |
0 | 239 ;---------------------------- Macros ------------------------------------ |
240 | |
241 TSTOSS macro opt_reg ; TeST Option Skip if not Zero | |
242 movff opt_reg,WREG | |
243 tstfsz WREG,A | |
244 bra $+4 | |
245 endm | |
246 | |
247 ;---------------------------- Bank0 DATA ------------------------------------ | |
248 isr_backup equ 0x60 | |
249 isr_backup udata_ovr isr_backup ; Reserved space for interupt data | |
250 | |
251 ;---- Backup for general registers | |
252 isr_prod res 2 | |
253 | |
254 ;---- MS5541 subroutines | |
255 amb_pressure res 2 | |
256 temperature res 2 | |
257 | |
258 C1 res 2 ; Decoded calibration data | |
259 C2 res 2 | |
260 C3 res 2 | |
261 C4 res 2 ; Here: C4-250 | |
262 C5 res 2 ; Here: Reference Temperature UT1 = 8*C5 + 10000 (u16 range 10.000 .. +42.760) | |
263 C6 res 2 | |
264 D1 res 2 ; raw pressure | |
265 D2 res 2 ; raw temperature | |
266 xdT res 2 | |
267 xdT2 res 2 | |
268 OFF res 2 | |
269 SENS res 2 | |
270 dLSB res 1 ;Pressure sensor interface | |
271 dMSB res 1 | |
272 clock_count res 1 | |
273 sensor_state_counter res 1 ; counts to eight for state maschine | |
274 amb_pressure_avg res 2 | |
275 temperature_avg res 2 | |
276 minimum_temperature res 2 ; minimum temperature | |
277 last_temperature res 2 | |
278 last_pressure res 2 | |
279 last_pressure_velocity res 2 ; For velocity | |
280 last_surfpressure res 2 | |
281 last_surfpressure_15min res 2 | |
282 last_surfpressure_30min res 2 | |
283 rel_pressure res 2 | |
284 sim_pressure res 2 ; hold simulated pressure in mbar if in Simulator mode | |
285 max_pressure res 2 | |
437 | 286 avg_rel_pressure res 2 |
287 avg_rel_pressure_total res 2 | |
0 | 288 ;---- Data for ISR math subroutines |
289 isr_xC res 4 | |
290 isr_xA res 2 | |
291 isr_xB res 2 | |
292 | |
293 ;---- Data for ISR routines | |
294 isr1_temp res 1 ; ISR temp variable, used in ms5541.asm, isr_rtcc, isr_battery_gauge | |
295 isr2_temp res 1 ; ISR temp variable, used isr_battery_gauge | |
296 | |
297 ;---- Display brightness | |
298 max_CCPR1L res 1 ; Max. brightness value for CCPR1L | |
299 | |
300 ; Battery gauge (nAs, nC) | |
301 battery_gauge res 6 ; 48Bit -> 78Ah max... | |
302 | |
187
669b5d00706d
CHANGE: Longer timeout (4 min) for calibration menu
heinrichsweikamp
parents:
185
diff
changeset
|
303 ; IR/S8-Link |
255 | 304 ir_s8_buffer res .18 ; temporally used in get_calibration_data for the raw (packed) calibration data |
187
669b5d00706d
CHANGE: Longer timeout (4 min) for calibration menu
heinrichsweikamp
parents:
185
diff
changeset
|
305 ir_s8_counter res 1 |
669b5d00706d
CHANGE: Longer timeout (4 min) for calibration menu
heinrichsweikamp
parents:
185
diff
changeset
|
306 ir_S8_timeout res 1 ; Timeout for valid data |
0 | 307 |
308 ; Compass raw data | |
309 compass_DX res 2 | |
310 compass_DY res 2 | |
311 compass_DZ res 2 | |
312 | |
313 accel_DX res 2 | |
314 accel_DY res 2 | |
315 accel_DZ res 2 | |
316 | |
317 ; Compass FILTERED data | |
318 compass_DX_f res 2 | |
319 compass_DY_f res 2 | |
320 compass_DZ_f res 2 | |
321 | |
322 accel_DX_f res 2 | |
323 accel_DY_f res 2 | |
324 accel_DZ_f res 2 | |
325 | |
326 ; Compass calibration data | |
327 compass_CX_f res 2 | |
328 compass_CY_f res 2 | |
329 compass_CZ_f res 2 | |
330 | |
331 ; Compass more data | |
332 compass_heading res 2 ; Corrected heading (in 1°) : -180 .. 180 | |
16
7b06f20881be
calm compass reading for minor heading changes
heinrichsweikamp
parents:
15
diff
changeset
|
333 compass_heading_old res 2 ; Old heading (For smoother display) |
170 | 334 compass_heading_shown res 2 ; Displayed heading |
214 | 335 ;compass_roll res 2 ; Rotation around the X axis |
438 | 336 ;compass_pitch res 2 ; Rotation around the Y axis |
0 | 337 |
338 compass_a res 2 ; Tmp data for Q15 arithmetics | |
339 compass_b res 2 | |
340 compass_r res 3 | |
341 | |
342 CNS_start res 2 ; CNS value at beginning of dive | |
343 GF_start res 1 ; GF value at beginning of dive | |
344 | |
319 | 345 speed_setting res 1 ; =1: Eco, =2: Normal, =3: Fastest |
346 | |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
250
diff
changeset
|
347 ;---- Data for graphical compass |
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
250
diff
changeset
|
348 xRD res 2 ; virtual compass ruler offset |
255 | 349 xRDr res 2 ; virtual compass ruler offset - right end |
350 xRD180 res 2 ; virtual compass ruler offset for the -180 marker | |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
250
diff
changeset
|
351 xLO res 1 ; lo backup to prevent trashing |
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
250
diff
changeset
|
352 xHI res 1 ; hi backup to prevent trashing |
255 | 353 xCM res 1 ; compass bearing relative position |
354 compass_bearing res 2 ; this is where the bearing menu stores the actual heading for bearing | |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
250
diff
changeset
|
355 |
0 | 356 ;---------------------------- Common DATA ------------------------------------ |
357 | |
358 common equ 0x100 ; Alias for "banksel common" | |
359 common udata_ovr common ; Bank1 general variables | |
360 | |
361 ;---- Time and Date | |
362 secs res 1 | |
363 mins res 1 | |
364 hours res 1 | |
365 day res 1 | |
366 month res 1 | |
367 year res 1 | |
368 surface_interval res 2 | |
369 | |
370 flag1 res 1 | |
371 flag2 res 1 | |
372 flag3 res 1 | |
373 flag4 res 1 | |
374 flag5 res 1 | |
375 flag6 res 1 | |
376 flag7 res 1 | |
377 flag8 res 1 | |
16
7b06f20881be
calm compass reading for minor heading changes
heinrichsweikamp
parents:
15
diff
changeset
|
378 flag9 res 1 |
113 | 379 flag10 res 1 |
189
e79bc535ef9e
ignore un-calibrated sensors even if they become valid
heinrichsweikamp
parents:
188
diff
changeset
|
380 flag11 res 1 |
255 | 381 flag12 res 1 |
319 | 382 flag13 res 1 |
480
ad8acade5567
NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents:
479
diff
changeset
|
383 flag14 res 1 |
0 | 384 |
235
23311219dacc
under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents:
234
diff
changeset
|
385 hardware_flag res 1 ; hardware descriptor flag |
23311219dacc
under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents:
234
diff
changeset
|
386 |
0 | 387 temp1 res 1 |
388 temp2 res 1 | |
389 | |
390 ;---- Interface to wait macros | |
391 wait_temp res 1 | |
392 waitms_temp res 1 | |
393 | |
394 ;---- Interface to graphic subroutines (aa_wordprocessor, color_processor, ...) | |
395 win_leftx2 res 1 | |
396 win_top res 1 | |
397 win_width res 2 | |
398 win_height res 1 | |
399 win_bargraph res 1 | |
400 win_color1 res 1 | |
401 win_color2 res 1 | |
402 win_font res 1 | |
403 | |
404 ;---- Draw subroutines | |
405 tft_temp4 res 1 | |
406 tft_temp3 res 1 | |
407 tft_temp2 res 1 | |
408 tft_temp1 res 1 | |
409 | |
410 ;---- data conversion subroutines | |
411 lo res 1 | |
412 hi res 1 | |
413 up res 1 | |
414 | |
415 ;---- RS232 temp variables | |
416 uart1_temp res 1 | |
417 uart2_temp res 1 | |
378 | 418 uart3_temp res 1 |
0 | 419 |
420 ;---- Data for math subroutines | |
421 divA res 2 | |
422 divB res 1 | |
423 xC res 4 | |
424 xA res 2 | |
425 xB res 2 | |
426 sub_c res 2 | |
427 sub_a res 2 | |
428 sub_b res 2 | |
429 | |
430 ;---- Data for conversion subroutines | |
431 cvt_flags res 1 | |
432 ignore_digits res 1 | |
433 | |
434 #define leftbind cvt_flags,0 | |
435 #define ignore_digit3 cvt_flags,1 | |
436 #define ignore_digit4 cvt_flags,2 | |
437 #define ignore_digit5 cvt_flags,3 | |
360 | 438 #DEFINE enable_screen_dumps cvt_flags,4 ; =1: Ignore vin_usb, wait for "l" command (Screen dump |
439 #DEFINE screen_type cvt_flags,5 ; =1: display1, =0; display0 | |
427 | 440 #DEFINE compass_type cvt_flags,6 ; =1: compass1, =0: compass0 |
464
0491a84fd0b8
CHANGE: Easier to understand "New Battery" menu (OSTC model dependent)
heinrichsweikamp
parents:
461
diff
changeset
|
441 #DEFINE analog_switches cvt_flags,7 ; =1: Analog switches available |
0 | 442 ;---- Misc. |
443 nofly_time res 2 ; No Fly time in Minutes (Calculated after Dive) | |
444 timeout_counter res 1 | |
445 timeout_counter2 res 1 | |
446 timeout_counter3 res 1 | |
447 batt_voltage res 2 ; Battery voltage in mV | |
448 batt_percent res 1 ; Battery in percent (1-100) | |
449 ambient_light res 2 ; ambient_light level | |
450 lo_temp res 1 | |
451 hi_temp res 1 | |
452 desaturation_time res 2 | |
97
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
96
diff
changeset
|
453 convert_value_temp res 3 ; used in menu_battery_state_convert_date |
0 | 454 active_gas res 1 |
97
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
96
diff
changeset
|
455 active_diluent res 1 ; As a backup when switching back from Bailout to CCR |
0 | 456 warning_counter res 1 ; Counts amount of warning in divemode |
457 warning_counter_backup res 1 ; Backup of warning_counter | |
458 warning_page res 1 ; current # of warning page | |
459 | |
460 ; Remind history for menu processor (and such): | |
461 menustack res 5 ; menu stack | |
462 menupos res 1 ; Logbook and divemode menu | |
463 menupos2 res 1 ; For dive mode simulator and pre-menu | |
464 menupos3 res 1 ; For Customviews | |
465 menupos4 res 1 ; For divemode menu | |
466 | |
467 ; Apnoe stuff that must be in bank common | |
468 apnoe_mins res 1 | |
469 apnoe_secs res 1 | |
470 apnoe_max_pressure res 2 | |
471 | |
472 ; Divemode | |
473 divemins res 2 | |
474 divesecs res 1 | |
23
e402813343b6
new option to switch samplingrate between 10s and 2s
heinrichsweikamp
parents:
18
diff
changeset
|
475 samplingrate res 1 |
0 | 476 samplesecs_value res 1 |
477 divisor_temperature res 1 | |
478 divisor_deco res 1 | |
479 divisor_gf res 1 | |
480 divisor_ppo2_sensors res 1 | |
481 divisor_decoplan res 1 | |
482 divisor_cns res 1 | |
483 divisor_tank res 1 | |
484 average_depth_hold res 4 | |
485 average_depth_hold_total res 4 | |
486 total_divetime_seconds res 2 | |
487 average_divesecs res 2 ; For the resettable stopwatch | |
488 decodata res 2 | |
489 apnoe_timeout_counter res 1 | |
490 apnoe_surface_mins res 1 | |
491 apnoe_surface_secs res 1 | |
492 | |
493 ; Profile storing | |
494 AlarmType res 1 | |
495 samplesecs res 1 | |
496 EventByte res 1 | |
98 | 497 EventByte2 res 1 |
0 | 498 ProfileFlagByte res 1 |
499 | |
500 ; External flash | |
501 ext_flash_address res 3 ; 24bit Address | |
502 ext_flash_log_pointer res 3 ; 24bit Address for logbook profile storing | |
503 ext_flash_dive_counter res 3 ; 24bit Counter for dive length (increased in write_byte_ext_flash_plus) | |
504 | |
505 ; I2C | |
113 | 506 i2c_temp res 2 ; Temp |
0 | 507 |
508 ; O2 Sensor data | |
509 o2_mv_sensor1 res 2 ; in 0.1mV steps | |
510 o2_mv_sensor2 res 2 ; in 0.1mV steps | |
511 o2_mv_sensor3 res 2 ; in 0.1mV steps | |
512 o2_ppo2_sensor1 res 1 ; Sensor1 ppO2 (in 0.01bar steps) | |
513 o2_ppo2_sensor2 res 1 ; Sensor2 ppO2 (in 0.01bar steps) | |
514 o2_ppo2_sensor3 res 1 ; Sensor3 ppO2 (in 0.01bar steps) | |
515 hud_status_byte res 1 | |
516 ;Status Byte/ | |
145
e3ac5b2021bc
NEW: Setpoint-Fallback option for external O2 sensor failure
heinrichsweikamp
parents:
143
diff
changeset
|
517 #DEFINE hud_connection_ok hud_status_byte,0 ;Bit0 = 1 -> HUD connection ok |
0 | 518 ;Bit1 = 1 -> HUD is calibrated |
519 ;Bit2 = 1 -> HUD Battery is low (<3000mV) | |
145
e3ac5b2021bc
NEW: Setpoint-Fallback option for external O2 sensor failure
heinrichsweikamp
parents:
143
diff
changeset
|
520 #DEFINE sensor1_active hud_status_byte,3 ;=1: Sensor1 is active |
e3ac5b2021bc
NEW: Setpoint-Fallback option for external O2 sensor failure
heinrichsweikamp
parents:
143
diff
changeset
|
521 #DEFINE sensor2_active hud_status_byte,4 ;=1: Sensor2 is active |
113 | 522 #DEFINE sensor3_active hud_status_byte,5 ;=1: Sensor3 is active |
0 | 523 ;Bit6 unused in stand-alone HUD |
524 ;Bit7 unused in stand-alone HUD | |
525 | |
526 sensor_setpoint res 1 ; sensor ppo2 in 0.01bar for deco routine | |
527 | |
528 better_gas_number res 1 ; number (1-5) of the "better gas" in divemode, =0: no better gas available | |
39
e4e91fe8b09d
remember last customview in dive and surface mode
mh@mh-THINK.fritz.box
parents:
37
diff
changeset
|
529 customview_divemode res 1 ; keeps last custom view |
e4e91fe8b09d
remember last customview in dive and surface mode
mh@mh-THINK.fritz.box
parents:
37
diff
changeset
|
530 customview_surfmode res 1 |
104
223579e905c3
Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents:
101
diff
changeset
|
531 safety_stop_countdown res 1 ; counts seconds of safety stop |
223579e905c3
Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents:
101
diff
changeset
|
532 |
0 | 533 ;---------------------------- TMP DATA --------------------------------------- |
534 ; Space for various overlayed data from color, word, menu processors, etc. | |
535 ; | |
536 | |
537 tmp udata_ovr 0x1A0 ; Bank1 shared TMP space | |
538 tmp equ 0x1A0 ; Alias for CBLOCK directive. | |
418 | 539 res 0x05F ; RESERVED area. |
0 | 540 |
268
29acdb601548
BUGFIX: Increase timing tolerance for S8 HUD (cR only)
heinrichsweikamp
parents:
266
diff
changeset
|
541 ;---------------------------- Common2 DATA ------------------------------------ |
29acdb601548
BUGFIX: Increase timing tolerance for S8 HUD (cR only)
heinrichsweikamp
parents:
266
diff
changeset
|
542 |
29acdb601548
BUGFIX: Increase timing tolerance for S8 HUD (cR only)
heinrichsweikamp
parents:
266
diff
changeset
|
543 common2 equ 0xA00 ; Alias for "banksel common" |
29acdb601548
BUGFIX: Increase timing tolerance for S8 HUD (cR only)
heinrichsweikamp
parents:
266
diff
changeset
|
544 common2 udata_ovr common2 ; Bank1 general variables |
29acdb601548
BUGFIX: Increase timing tolerance for S8 HUD (cR only)
heinrichsweikamp
parents:
266
diff
changeset
|
545 |
29acdb601548
BUGFIX: Increase timing tolerance for S8 HUD (cR only)
heinrichsweikamp
parents:
266
diff
changeset
|
546 s8_rawdata_sensor1 res 3 ; 24bit A/D raw data from S8 HUD sensor 1 |
29acdb601548
BUGFIX: Increase timing tolerance for S8 HUD (cR only)
heinrichsweikamp
parents:
266
diff
changeset
|
547 s8_rawdata_sensor2 res 3 ; 24bit A/D raw data from S8 HUD sensor 2 |
29acdb601548
BUGFIX: Increase timing tolerance for S8 HUD (cR only)
heinrichsweikamp
parents:
266
diff
changeset
|
548 s8_rawdata_sensor3 res 3 ; 24bit A/D raw data from S8 HUD sensor 3 |
29acdb601548
BUGFIX: Increase timing tolerance for S8 HUD (cR only)
heinrichsweikamp
parents:
266
diff
changeset
|
549 |
378 | 550 hud_battery_mv res 2 ; hud/ppo2 monitor battery voltage in mV |
389
9175429bdeba
CHANGE: Logbook now shows end-of-dive date and time for dives made with firmware <1.92 indicated by an icon in the logbook
heinrichsweikamp
parents:
388
diff
changeset
|
551 start_day res 1 ; At start of dive (For logbook) |
9175429bdeba
CHANGE: Logbook now shows end-of-dive date and time for dives made with firmware <1.92 indicated by an icon in the logbook
heinrichsweikamp
parents:
388
diff
changeset
|
552 start_month res 1 ; At start of dive (For logbook) |
9175429bdeba
CHANGE: Logbook now shows end-of-dive date and time for dives made with firmware <1.92 indicated by an icon in the logbook
heinrichsweikamp
parents:
388
diff
changeset
|
553 start_year res 1 ; At start of dive (For logbook) |
9175429bdeba
CHANGE: Logbook now shows end-of-dive date and time for dives made with firmware <1.92 indicated by an icon in the logbook
heinrichsweikamp
parents:
388
diff
changeset
|
554 start_hours res 1 ; At start of dive (For logbook) |
9175429bdeba
CHANGE: Logbook now shows end-of-dive date and time for dives made with firmware <1.92 indicated by an icon in the logbook
heinrichsweikamp
parents:
388
diff
changeset
|
555 start_mins res 1 ; At start of dive (For logbook) |
378 | 556 |
448 | 557 old_velocity res 4 ; Stores the last 4 speeds (8 seconds) in m/min |
403
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
402
diff
changeset
|
558 opt_gas_type_backup res 5 ; 0=Disabled, 1=First, 2=Travel, 3=Deco |
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
402
diff
changeset
|
559 opt_dil_type_backup res 5 ; 0=Disabled, 1=First, 2=Normal |
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
402
diff
changeset
|
560 opt_OC_bail_gas_change_backup res 5 ; Gas change depths OC/Bailout |
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
402
diff
changeset
|
561 |
448 | 562 internal_battery_capacity res 2 ; For internal battery gauging |
563 battery_capacity res 2 ; For battery gauge IC | |
564 battery_offset res 2 ; For battery gauge IC | |
565 | |
474 | 566 analog_sw1_raw res 2 ; idle values (average) |
567 analog_sw2_raw res 2 ; idle values (average) | |
568 analog_counter res 1 ; for averaging | |
448 | 569 analog_sw1 res 1 ; analog value for switch 1 |
570 analog_sw2 res 1 ; analog value for switch 2 | |
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
466
diff
changeset
|
571 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 |
453
b4f28ab23b87
NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents:
448
diff
changeset
|
572 uptime res 4 ; Uptime [s] |
b4f28ab23b87
NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents:
448
diff
changeset
|
573 lastdive_time res 4 ; Time since last dive [s] |
503
4542d03f748a
NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents:
498
diff
changeset
|
574 lastdive_duration res 3 ; mins:2 and secs |
4542d03f748a
NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents:
498
diff
changeset
|
575 lastdive_maxdepth res 2 ; in mbar |
466 | 576 battery_acumulated_charge res 2 ; Raw values in battery gauge IC |
577 gauge_status_byte res 1 ; Gauge IC status byte | |
475 | 578 button_polarity res 1 ; 0xFF (Both normal), 0x00 (Both inverted), 0x01 (Left inverted only), 0x02 (Right inverted only) |
399
db25f2028074
CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents:
398
diff
changeset
|
579 |
0 | 580 ;----------------------------------------------------------------------------- |
581 ; Reserve BANK2 for general purpose buffer (strings, images, etc). | |
582 ; NOTE: Needs to be aligned with a bank (LOW(buffer)==0). | |
583 buffer udata_ovr 0x200 | |
584 buffer res .256 | |
585 | |
586 opt_table equ 0xE00 | |
587 opt_table udata_ovr opt_table | |
588 | |
589 ;---- Dive Options | |
590 opt_gas_O2_ratio res 5 ; Needed because deco gaslist use N2 | |
591 opt_dil_O2_ratio res 5 ; Must be in line with opt_gas_O2_ratio | |
592 opt_gas_He_ratio res 5 ; He ratio Gas1-5 | |
593 opt_dil_He_ratio res 5 ; Must be in line with opt_gas_He_ratio | |
594 opt_gas_type res 5 ; 0=Disabled, 1=First, 2=Travel, 3=Deco | |
595 opt_dil_type res 5 ; 0=Disabled, 1=First, 2=Normal | |
480
ad8acade5567
NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents:
479
diff
changeset
|
596 opt_dive_mode res 1 ; 0=OC, 1=CC, 2=Gauge, 3=Apnea, 4=PSCR |
0 | 597 opt_ppO2_max res 1 ; PPO2 Max for MOD calculation and color coding in divemode |
598 opt_ccr_mode res 1 ; =0: Fixed SP, =1: Sensor | |
599 opt_ppO2_min res 1 ; PPO2 min for Sensors and color coding in divemode | |
97
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
96
diff
changeset
|
600 opt_OC_bail_gas_change res 5 ; Gas change depths OC/Bailout |
0 | 601 ;---- Managing Settings |
602 | |
603 opt_brightness res 1 ; =0: Eco, =1:Medium, =2:Full | |
604 opt_salinity res 1 ; 0-5% | |
605 #DEFINE opt_name_length .60 ; Custom text string 5 rows with 12 chars | |
606 opt_name res opt_name_length | |
607 opt_language res 1 ; Current language. 0=EN, 1=DE, 2=FR, 3=SP | |
608 opt_units res 1 ; 0:m/°C, 1:ft/°F | |
609 opt_dateformat res 1 ; =0:MMDDYY, =1:DDMMYY, =2:YYMMDD | |
610 opt_last_stop res 1 ; =3:3m, =4:4m, =5:5m, =6:6m | |
611 opt_aGF_high res 1 ; Alternative GF HIGH | |
612 opt_aGF_low res 1 ; Alternative GF LOW | |
613 opt_GF_high res 1 ; GF HIGH | |
614 opt_GF_low res 1 ; GF LOW | |
615 opt_enable_aGF res 1 ; =1: aGF can be selected underwater | |
18
4e3f133dfbf4
add new opt_compass_gain option to work with more magnetic battery types
heinrichsweikamp
parents:
17
diff
changeset
|
616 opt_compass_gain res 1 ; 0-7 (230LSB/Gauss to 1370LSB/Gaus) |
24 | 617 opt_sampling_rate res 1 ; =1: 10s, =0: 2s |
50 | 618 opt_dive_color_scheme res 1 ; 0-3 |
92
7ca1105751c7
add sensor calibration option (PC only), some cleanup
heinrichsweikamp
parents:
89
diff
changeset
|
619 opt_pressure_adjust res 1 ; SIGNED int (two's complement), -20/+20mbar max. |
104
223579e905c3
Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents:
101
diff
changeset
|
620 opt_enable_safetystop res 1 ; =1: A safety stop is shown |
113 | 621 opt_calibration_O2_ratio res 1 ; %O2 of calibration gas |
622 opt_x_s1 res 2 ; calibration factor (Not stored in EEPROM) | |
623 opt_x_s2 res 2 ; calibration factor (Not stored in EEPROM) | |
624 opt_x_s3 res 2 ; calibration factor (Not stored in EEPROM) | |
145
e3ac5b2021bc
NEW: Setpoint-Fallback option for external O2 sensor failure
heinrichsweikamp
parents:
143
diff
changeset
|
625 opt_sensor_fallback res 1 ; =1: Fallback to SP1 when sensor is lost |
155
5f71e31bd5b3
CHANGE: Re-arranged Settings Menu, add 180? rotate to menu
heinrichsweikamp
parents:
151
diff
changeset
|
626 opt_flip_screen res 1 ; =1: Flip the screen |
220
effd7259f5a5
make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents:
218
diff
changeset
|
627 opt_cR_button_left res 1 ; Left button sensitivity (cR hardware) |
effd7259f5a5
make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents:
218
diff
changeset
|
628 opt_cR_button_right res 1 ; Right button sensitivity (cR hardware) |
307
14719662fb95
Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents:
303
diff
changeset
|
629 opt_modwarning res 1 ; =1:do a red blinking warning, =0:default behaviour |
14719662fb95
Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents:
303
diff
changeset
|
630 opt_vsitextv2 res 1 ; =1:use the depth dependent ascend rate limits |
326
d21b172d5a7a
VSIbar #4: VSI settings submenu, graph option, logbook offset and compass calib. menu exit fix
Janos Kovacs <kovjanos@gmail.com>
parents:
319
diff
changeset
|
631 opt_vsigraph res 1 ; =1:draw the graphical VSI bar |
335
3d43da7acfe1
Always show ppO2 (warning position, standard color) option
janos_kovacs <kovjanos@gmail.com>
parents:
333
diff
changeset
|
632 opt_showppo2 res 1 ; =1:always show the ppO2 value in the warning position |
368
57e349960ef4
Additional temperature calibration via PC interface
heinrichsweikamp
parents:
367
diff
changeset
|
633 opt_temperature_adjust res 1 ; SIGNED int (two's complement), -2.0/+2.0 °C max. |
399
db25f2028074
CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents:
398
diff
changeset
|
634 opt_safety_stop_length res 1 ; [s] |
db25f2028074
CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents:
398
diff
changeset
|
635 opt_safety_stop_start res 1 ; [cbar] |
db25f2028074
CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents:
398
diff
changeset
|
636 opt_safety_stop_end res 1 ; [cbar] |
db25f2028074
CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents:
398
diff
changeset
|
637 opt_safety_stop_reset res 1 ; [cbar] |
444
d93d75ae01bf
Adjustable timeout for Divemode (Config 0x48)
heinrichsweikamp
parents:
441
diff
changeset
|
638 opt_diveTimeout res 1 ; Timeout for Divemode [min] |
480
ad8acade5567
NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents:
479
diff
changeset
|
639 opt_PSCR_drop res 1 ; PSCR Drop [%] |
ad8acade5567
NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents:
479
diff
changeset
|
640 opt_PSCR_lungratio res 1 ; PSCR Lung Ratio [1/x] |
0 | 641 |
642 ;-----------------------------EEPROM DATA ------------------------------------ | |
643 ; Automatic reset of all options when this is changed: | |
644 #define eeprom_opt_serial 0x0005 ; Version 0.5 | |
645 | |
646 ;----------------------------------------------------------------------------- | |
647 ; Flags | |
648 #DEFINE switch_left flag1,0 | |
649 #DEFINE switch_right flag1,1 | |
650 #DEFINE neg_flag flag1,2 ; e.g. sub16 (sub_c = sub_a - sub_b) | |
651 #DEFINE pressure_refresh flag1,3 ; =1: A new pressure/temperature is available | |
652 #DEFINE sleepmode flag1,4 ; =1: In Sleepmode | |
653 #DEFINE tft_is_dimming flag1,5 ; =1: The TFT is dimming, ignore light sensor | |
654 #DEFINE display_velocity flag1,6 ; =1: show velocity | |
655 #DEFINE no_sensor_int flag1,7 ; =1: block any further access to pressure sensor | |
656 | |
657 #DEFINE rs232_recieve_overflow flag2,0 ; =1: An RS232 timeout overflow occoured | |
658 #DEFINE stored_gas_changed flag2,1 ; =1: Stored Gas changed | |
659 #DEFINE high_altitude_mode flag2,2 ; =1: Unit was manually turned on with ambient pressure <880mbar | |
660 #DEFINE FLAG_apnoe_mode flag2,3 ; =1: Apnoe mode selected | |
661 #DEFINE restore_deco_data flag2,4 ; =1: Restore deco data (After simulation) | |
662 #DEFINE premenu flag2,5 ; =1: Premenu/Divemenu selected | |
663 #DEFINE menubit flag2,6 ; menu | |
664 #DEFINE simulatormode_active flag2,7 ; =1: Simulator mode active, override pressure sensor readings | |
665 | |
666 #DEFINE divemode_menu flag3,0 ; =1: Divemode menu is shown | |
667 #DEFINE onesecupdate flag3,1 ; =1 after any second | |
668 #DEFINE twosecupdate flag3,2 ; =1: New two-second update | |
669 #DEFINE toggle_customview flag3,3 ; =1: Next customview | |
670 #DEFINE oneminupdate flag3,4 ; =1 after any minute | |
671 #DEFINE divemode flag3,5 ; =1: in Divemode | |
672 #DEFINE battery_is_36v flag3,6 ; =1: 3,6V Battery is in use | |
673 #DEFINE warning_active flag3,7 ; =1: A warning is active in divemode or surfacemode | |
674 | |
675 #DEFINE better_gas_available flag4,0 ; =1: A better gas is available | |
676 #DEFINE blinking_better_gas flag4,1 ; =1: Gas is blinking | |
677 #DEFINE menuview flag4,2 ; =1: A menuview is shown in divemode (e.g. "Menu?") | |
678 #DEFINE quarter_second_update flag4,3 ; =1: A new 1/4 second has begun | |
679 #DEFINE divemode_gaschange flag4,4 ; =1: The gas will change very soon | |
680 #DEFINE decostop_active flag4,5 ; =1: Decompression stop shown | |
681 #DEFINE depth_greater_100m flag4,6 ; =1: Current Depth > 100m | |
682 #DEFINE realdive flag4,7 ; =1: A real dive during divemode | |
683 | |
684 #DEFINE dive_warning_displayed flag5,0 ; =1: The warning sign is shown | |
685 #DEFINE reset_average_depth flag5,1 ; =1: Reset the average depth | |
686 #DEFINE store_sample flag5,2 ; =1: Store a new sample | |
687 #DEFINE divemode2 flag5,3 ; =1: Dive longer then one minute | |
688 #DEFINE FLAG_active_descent flag5,4 ; Used in Apnoe mode | |
689 #DEFINE event_occured flag5,5 ; =1: An event occured, store it! | |
690 #DEFINE divemode_menu_active flag5,6 ; =1: The divemode menu is shown | |
691 #DEFINE temp_changed flag5,7 ; =1: The temperature changed | |
692 | |
693 #DEFINE gas6_changed flag6,0 ; =1: Gas 6 has been selected/changed underwater | |
694 #DEFINE onehourupdate flag6,1 ; =1: A new hour has just begun | |
695 #DEFINE settime_setdate flag6,2 ; =1: In the Set Time or Set Date Menu | |
696 #DEFINE setpoint_changed flag6,3 ; =1: Setpoint has been changed | |
697 #DEFINE second_row_warning flag6,4 ; =1: The second row contains a warning | |
698 #DEFINE FLAG_ccr_mode flag6,5 ; =1: CCR mode (Fixed ppO2 or Sensor) active | |
699 #DEFINE dive_hud1_displayed flag6,6 ; =1: The Sensor1 HUD reading is displayed | |
700 #DEFINE dive_hud2_displayed flag6,7 ; =1: The Sensor2 HUD reading is displayed | |
701 | |
702 #DEFINE dive_hud3_displayed flag7,0 ; =1: The Sensor3 HUD reading is displayed | |
703 #DEFINE no_more_divesecs flag7,1 ; =1: Do no longer show seconds in divemode | |
704 #DEFINE FLAG_gauge_mode flag7,2 ; =1: In Gauge mode | |
705 #DEFINE ignore_last_edited_gas flag7,3 ; Used in gaslist_cleanup_list | |
706 #DEFINE ccr_diluent_setup flag7,4 ; =1: Setting up Diluents ("Gas6-10") | |
707 #DEFINE menu_show_sensors flag7,5 ; =1: Update HUD data in menu | |
708 #DEFINE short_gas_decriptions flag7,6 ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint | |
11 | 709 #DEFINE max_depth_greater_100m flag7,7 ; =1: Max. Depth > 100m |
0 | 710 |
711 #DEFINE is_bailout flag8,0 ; =1: Bailout | |
712 #DEFINE is_bailout_menu flag8,1 ; =1: Bailout | |
713 #DEFINE toggle_gf flag8,2 ; =1: Toggle GF/aGF | |
714 #DEFINE use_agf flag8,3 ; =1: Use aGF (instead of GF) | |
715 #DEFINE battery_removed_in_usb flag8,4 ; =1: The battery has been removed in USB | |
716 #DEFINE adc_running flag8,5 ; =1: The ADC is in use | |
717 #DEFINE comm_service_enabled flag8,6 ; =1: COMM Service mode unlocked | |
718 #DEFINE compass_enabled flag8,7 ; =1: The compass and accelerometer chip is active | |
719 | |
16
7b06f20881be
calm compass reading for minor heading changes
heinrichsweikamp
parents:
15
diff
changeset
|
720 #DEFINE compass_fast_mode flag9,0 ; =1: The compass is in fast mode |
50 | 721 #DEFINE in_color_menu flag9,1 ; =1: In the color scheme menu |
98 | 722 #DEFINE bailoutgas_event flag9,2 ; =1: bailout was selected or a gaschange during bailout |
189
e79bc535ef9e
ignore un-calibrated sensors even if they become valid
heinrichsweikamp
parents:
188
diff
changeset
|
723 #DEFINE win_invert flag9,3 ; =1: Invert font output |
425 | 724 #DEFINE show_safety_stop flag9,4 ; =1: Show the safety stop |
145
e3ac5b2021bc
NEW: Setpoint-Fallback option for external O2 sensor failure
heinrichsweikamp
parents:
143
diff
changeset
|
725 #DEFINE safety_stop_active flag9,5 ; =1: The safety stop is currently displayed |
113 | 726 #DEFINE new_s8_data_available flag9,6 ; =1: New data frame recieved |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
250
diff
changeset
|
727 #DEFINE print_compass_label flag9,7 ; =1: print the graphical comapss label |
113 | 728 |
729 #DEFINE s8_digital flag10,0; =1: Digital I/O | |
145
e3ac5b2021bc
NEW: Setpoint-Fallback option for external O2 sensor failure
heinrichsweikamp
parents:
143
diff
changeset
|
730 #DEFINE menu_show_sensors2 flag10,1; =1: Update mV data in calibration menu |
192 | 731 #DEFINE use_O2_sensor1 flag10,2; =1: Use this sensor for deco |
732 #DEFINE use_O2_sensor2 flag10,3; =1: Use this sensor for deco | |
733 #DEFINE use_O2_sensor3 flag10,4; =1: Use this sensor for deco | |
145
e3ac5b2021bc
NEW: Setpoint-Fallback option for external O2 sensor failure
heinrichsweikamp
parents:
143
diff
changeset
|
734 #DEFINE setpoint_fallback flag10,5; =1: Fallback to SP1 due to external O2 sensor failure |
e3ac5b2021bc
NEW: Setpoint-Fallback option for external O2 sensor failure
heinrichsweikamp
parents:
143
diff
changeset
|
735 #DEFINE blinking_setpoint flag10,6; =1: SP is blinking |
151 | 736 #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
|
737 |
e79bc535ef9e
ignore un-calibrated sensors even if they become valid
heinrichsweikamp
parents:
188
diff
changeset
|
738 #DEFINE sensor1_calibrated_ok flag11,0; =1: This sensor has been calibrated ok |
e79bc535ef9e
ignore un-calibrated sensors even if they become valid
heinrichsweikamp
parents:
188
diff
changeset
|
739 #DEFINE sensor2_calibrated_ok flag11,1; =1: This sensor has been calibrated ok |
e79bc535ef9e
ignore un-calibrated sensors even if they become valid
heinrichsweikamp
parents:
188
diff
changeset
|
740 #DEFINE sensor3_calibrated_ok flag11,2; =1: This sensor has been calibrated ok |
192 | 741 #DEFINE voting_logic_sensor1 flag11,3; =1: This sensor is within the voting logic threshold |
742 #DEFINE voting_logic_sensor2 flag11,4; =1: This sensor is within the voting logic threshold | |
743 #DEFINE voting_logic_sensor3 flag11,5; =1: This sensor is within the voting logic threshold | |
207 | 744 #DEFINE cc_active flag11,6; =1: Constant Current active (cR Hardware) |
745 #DEFINE cv_active flag11,7; =1: Constant Voltage active (cR Hardware) | |
250 | 746 |
255 | 747 #DEFINE compass_bearing_set flag12,0 ; bearing set |
748 #DEFINE compass_bearing_eq flag12,1 ; bearing is in direction? do not show << or >> | |
749 #DEFINE compass_bearing_lft flag12,2 ; bearing is to the left/<< if set, otherwise to the right/>> | |
750 #DEFINE compass_bearing_vis flag12,3 ; bearing is visible? (either ahead or behind/-180°) | |
751 #DEFINE compass_bearing_ahd flag12,4 ; bearing is ahead or behind? | |
300
5ad479f2a868
Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents:
283
diff
changeset
|
752 #DEFINE blinking_depth_warning flag12,5 ; set by the color_depth. =1: warning color |
5ad479f2a868
Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents:
283
diff
changeset
|
753 #DEFINE blinking_depth_prev flag12,6 ; set by the TFT_depth. =1: prev display had warning color |
5ad479f2a868
Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents:
283
diff
changeset
|
754 #DEFINE blinking_depth_toggle flag12,7 ; toggle to blink |
255 | 755 |
315
4f83470dcece
VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents:
310
diff
changeset
|
756 #DEFINE neg_flag_velocity flag13,0 ; neg_flag backup for velocity logic |
448 | 757 #DEFINE analog_sw1_pressed flag13,1 ; =1: Analog switch 1 pressed |
758 #DEFINE analog_sw2_pressed flag13,2 ; =1: Analog switch 2 pressed | |
338
2811932b4e99
NEW: Mode Auto SP: Automatically switches the SP during descent (CC Mode)
heinrichsweikamp
parents:
337
diff
changeset
|
759 #DEFINE sp2_switched flag13,3 ; =1: This setpoint has been autoselected already |
2811932b4e99
NEW: Mode Auto SP: Automatically switches the SP during descent (CC Mode)
heinrichsweikamp
parents:
337
diff
changeset
|
760 #DEFINE sp3_switched flag13,4 ; =1: This setpoint has been autoselected already |
2811932b4e99
NEW: Mode Auto SP: Automatically switches the SP during descent (CC Mode)
heinrichsweikamp
parents:
337
diff
changeset
|
761 #DEFINE sp4_switched flag13,5 ; =1: This setpoint has been autoselected already |
2811932b4e99
NEW: Mode Auto SP: Automatically switches the SP during descent (CC Mode)
heinrichsweikamp
parents:
337
diff
changeset
|
762 #DEFINE sp5_switched flag13,6 ; =1: This setpoint has been autoselected already |
464
0491a84fd0b8
CHANGE: Easier to understand "New Battery" menu (OSTC model dependent)
heinrichsweikamp
parents:
461
diff
changeset
|
763 #DEFINE use_old_batt_flag flag13,7 ; =1: load old battery information after power-on reset |
480
ad8acade5567
NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents:
479
diff
changeset
|
764 |
ad8acade5567
NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents:
479
diff
changeset
|
765 #DEFINE FLAG_pscr_mode flag14,0 ; =1: OSTC is in PSCR mode |
490
8dfb93e80338
NEW: Deep Sleep mode for OSTC Plus and OSTC 2 (2017) (Entered automatically)
heinrichsweikamp
parents:
486
diff
changeset
|
766 #DEFINE deep_sleep flag14,1 ; OSTC is in deep sleep (ignore buttons, etc) |
0 | 767 ;============================================================================= |
768 ; C-code Routines | |
769 ; PART 2 | |
770 extern deco_calc_CNS_decrease_15min | |
771 extern deco_calc_CNS_fraction | |
772 extern deco_calc_desaturation_time | |
773 extern deco_calc_hauptroutine | |
774 extern deco_calc_tissue | |
775 extern deco_calc_percentage | |
776 extern deco_calc_wo_deco_step_1_min | |
777 extern deco_calc_dive_interval | |
778 extern deco_clear_CNS_fraction | |
779 extern deco_clear_tissue | |
780 extern deco_pull_tissues_from_vault | |
781 extern deco_push_tissues_to_vault | |
782 |