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