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