Mercurial > public > hwos_code
comparison src/hwos.inc @ 634:4050675965ea
3.10 stable release
author | heinrichsweikamp |
---|---|
date | Tue, 28 Apr 2020 17:34:31 +0200 |
parents | 185ba2f91f59 |
children | 8c1f1f334275 |
comparison
equal
deleted
inserted
replaced
633:690c48db7b5b | 634:4050675965ea |
---|---|
1 ;============================================================================= | 1 ;============================================================================= |
2 ; | 2 ; |
3 ; File hwos.inc combined next generation V3.08.8 | 3 ; File hwos.inc * combined next generation V3.09.5 |
4 ; | 4 ; |
5 ; OSTC Platform Definitions | 5 ; OSTC Platform Definitions |
6 ; | 6 ; |
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | 7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. |
8 ;============================================================================= | 8 ;============================================================================= |
9 ; HISTORY | 9 ; HISTORY |
10 ; 2011-05-24 : [jDG] Cleanups from initial Matthias code | 10 ; 2011-05-24 : [jDG] Cleanups from initial Matthias code |
11 ;============================================================================= | 11 ;============================================================================= |
12 | 12 |
13 | 13 |
14 ; Hardware Configuration | 14 ; ---- Hardware Configuration |
15 LIST P=18F87K22 ; compiler settings, if changed change also: Configure -> SelectDevice in MPLAB | 15 LIST P=18F87K22 ; compiler settings, if changed change also: Configure -> SelectDevice in MPLAB |
16 #include "p18f87k22.inc" ; processor definitions | 16 #include "p18f87k22.inc" ; processor definitions |
17 #include "ports.inc" ; port map definitions | 17 #include "ports.inc" ; port map definitions |
18 | 18 |
19 | 19 |
20 ; Software Configuration | 20 ; ---- Software Configuration |
21 #include "configuration.inc" ; OSTC hwOS configuration | 21 #include "configuration.inc" ; OSTC hwOS configuration |
22 | 22 |
23 | 23 |
24 ; Language Codes | 24 ;----------------------------------------------------------------------------- |
25 ; Settings, Limits, Thresholds, Encodings, etc. | |
26 ;----------------------------------------------------------------------------- | |
27 | |
28 ; ---- Language Codes | |
25 #DEFINE none 0 ; no language selected | 29 #DEFINE none 0 ; no language selected |
26 #DEFINE en 1 ; select English | 30 #DEFINE en 1 ; select English |
27 #DEFINE de 2 ; select German | 31 #DEFINE de 2 ; select German |
28 #DEFINE fr 3 ; select French | 32 #DEFINE fr 3 ; select French |
29 #DEFINE it 4 ; select Italian | 33 #DEFINE it 4 ; select Italian |
30 | 34 |
31 | 35 |
32 ; Magic Cookie Definition | 36 ; ---- Magic Cookie Definition |
33 #DEFINE comm_service_key 0xABCDEF ; simsalabim to establish comm service mode | 37 #DEFINE comm_service_key 0xABCDEF ; simsalabim to establish comm service mode |
34 | 38 |
35 | 39 |
36 ; Logo Address Vectors | 40 ; ---- Scrolling Menu Support |
41 ;#DEFINE scrolling_menu_enabled ; disabled | |
42 | |
43 | |
44 ; ---- Logo Address Vectors | |
37 #DEFINE hw_logo_block 0x01E000 ; color image data for heinrichsweikamp logo | 45 #DEFINE hw_logo_block 0x01E000 ; color image data for heinrichsweikamp logo |
38 #DEFINE usb_ble_logo_1 0x01EEDE ; color image data for USB or BLE logo | 46 #DEFINE comm_logo_1 0x01EEDE ; color image data for USB or BT logo |
39 #DEFINE usb_ble_logo_2 0x01EA04 ; color image data for USB or BLE logo, "+" bootloader | 47 #DEFINE comm_logo_2 0x01EA04 ; color image data for BT logo, "+" bootloader |
40 | 48 |
41 | 49 |
42 ;-----------------------------EEPROM DATA ------------------------------------ | 50 ;-----------------------------EEPROM DATA ------------------------------------ |
43 ; Automatic reset of all options when this is changed: | 51 ; Automatic reset of all options when this is changed: |
44 #DEFINE eeprom_opt_version .8 ; range: 16 bit | 52 #DEFINE eeprom_opt_version .8 ; range: 16 bit |
45 #DEFINE eeprom_vault_version .1 ; range: 8 bit | 53 #DEFINE eeprom_vault_version .1 ; range: 8 bit |
46 ;----------------------------------------------------------------------------- | 54 ;----------------------------------------------------------------------------- |
47 | 55 |
48 | 56 |
49 #DEFINE CCP1CON_VALUE b'00001100' ; PWM1 for LED dimming | 57 ; ---- PWM1 for LED dimming |
58 #DEFINE CCP1CON_VALUE b'00001100' | |
50 #DEFINE T2CON_ECO b'01111110' | 59 #DEFINE T2CON_ECO b'01111110' |
51 #DEFINE T2CON_NORMAL b'01111110' | 60 #DEFINE T2CON_NORMAL b'01111110' |
52 #DEFINE T2CON_FASTEST b'01111110' | 61 #DEFINE T2CON_FASTEST b'01111110' |
53 | 62 |
54 | 63 |
55 ; CPU speeds | 64 ; ---- CPU speeds |
56 #DEFINE coding_speed_eco .1 ; 1 MHz = eco speed | 65 #DEFINE coding_speed_eco .1 ; 1 MHz = eco speed |
57 #DEFINE coding_speed_normal .2 ; 16 MHz = normal speed | 66 #DEFINE coding_speed_normal .2 ; 16 MHz = normal speed |
58 #DEFINE coding_speed_fastest .4 ; 64 MHz = fastest speed (32 MHz on OSTC Sport BLE) | 67 #DEFINE coding_speed_fastest .4 ; 64 MHz = fastest speed (32 MHz on OSTC Sport BLE) |
59 | 68 |
60 #DEFINE speed_is_eco cpu_speed_state,0 ; =1: CPU is running at eco speed | 69 #DEFINE speed_is_eco cpu_speed_state,0 ; =1: CPU is running at eco speed |
61 #DEFINE speed_is_normal cpu_speed_state,1 ; =1: CPU is running at normal speed | 70 #DEFINE speed_is_normal cpu_speed_state,1 ; =1: CPU is running at normal speed |
62 #DEFINE speed_is_fastest cpu_speed_state,2 ; =1: CPU is running at fastest speed | 71 #DEFINE speed_is_fastest cpu_speed_state,2 ; =1: CPU is running at fastest speed |
63 | 72 |
64 | 73 |
65 ; Divemode Custom View Indexes - Attention: these numbers need to be in line with the jump tables in customview.asm! | 74 ; ---- Divemode Custom View Indexes - Attention: these numbers need to be in line with the jump tables in customview.asm! |
66 #DEFINE index_blank .0 ; blank view | 75 #DEFINE index_blank .0 ; blank view |
67 #DEFINE index_avr_stopwatch .1 ; average depth and stopwatch | 76 #DEFINE index_avr_stopwatch .1 ; average depth and stopwatch |
68 #DEFINE index_compass_dm .2 ; compass | 77 #DEFINE index_compass_dm .2 ; compass |
69 #DEFINE index_ppo2_sensors .3 ; ppO2 sensors | 78 #DEFINE index_ppo2_sensors .3 ; ppO2 sensors |
70 #DEFINE index_sensor_check .4 ; sensor check | 79 #DEFINE index_sensor_check .4 ; sensor check |
80 #DEFINE index_gf_factors .14 ; GF factors | 89 #DEFINE index_gf_factors .14 ; GF factors |
81 #DEFINE index_cave_waypoints .15 ; cave waypoints | 90 #DEFINE index_cave_waypoints .15 ; cave waypoints |
82 #DEFINE index_cv_dm_max .13 ; highest index used in normal custom view rotation | 91 #DEFINE index_cv_dm_max .13 ; highest index used in normal custom view rotation |
83 | 92 |
84 | 93 |
85 ; Timing for button hold-down flags | 94 ; ---- Timing for button hold-down flags |
86 #DEFINE TMR1H_VALUE_FIRST .255-.128 ; in steps of 7.8125 ms -> 1.00 s | 95 #DEFINE TMR1H_VALUE_FIRST .255-.128 ; in steps of 7.8125 ms -> 1.00 s |
87 #DEFINE TMR1H_VALUE_CONT .255-.32 ; in steps of 7.8125 ms -> 0.25 s | 96 #DEFINE TMR1H_VALUE_CONT .255-.32 ; in steps of 7.8125 ms -> 0.25 s |
88 #DEFINE TMR1H_VALUE_CONT_DIVE .255-.64 ; in steps of 7.8125 ms -> 0.50 s | 97 #DEFINE TMR1H_VALUE_CONT_DIVE .255-.64 ; in steps of 7.8125 ms -> 0.50 s |
89 | 98 |
90 | 99 |
91 ; Color Definitions: 8 bit RGB b'RRRGGGBB' | 100 ; ---- Font Sizes |
92 #DEFINE color_red b'11100000' ; (7,0,0) | |
93 #DEFINE color_dark_red b'10000101' ; (4,1,1) | |
94 #DEFINE color_violet b'11101011' ; (7,2,3) | |
95 #DEFINE color_blue b'11000111' ; (6,1,3) | |
96 #DEFINE color_green b'00011100' ; (0,7,0) | |
97 #DEFINE color_greenish b'00111110' ; (1,7,2) | |
98 #DEFINE color_dark_green b'00111001' ; (1,6,1) | |
99 #DEFINE color_yellow b'11111101' ; (7,7,1) | |
100 #DEFINE color_white b'11111111' ; (7,7,3) | |
101 #DEFINE color_black b'00000000' ; (0,0,0) | |
102 #DEFINE color_deepblue b'00000010' ; (0,0,2) | |
103 #DEFINE color_grey b'11011111' ; (6,7,3) | |
104 #DEFINE color_cyan b'11011111' ; (6,7,3) | |
105 #DEFINE color_lightblue b'11011011' ; (6,7,3) | |
106 #DEFINE color_orange b'11111000' ; (7,6,0) | |
107 #DEFINE color_pink b'11111010' ; (7,6,2) | |
108 | |
109 | |
110 ; Font Sizes | |
111 #DEFINE FT_TINY .0 ; aa_font16_block, full character set | 101 #DEFINE FT_TINY .0 ; aa_font16_block, full character set |
112 #DEFINE FT_SMALL .1 ; aa_font28_block, full character set | 102 #DEFINE FT_SMALL .1 ; aa_font28_block, full character set |
113 #DEFINE FT_STANDARD .2 ; aa_font34_block, full character set | 103 #DEFINE FT_STANDARD .2 ; aa_font34_block, full character set |
114 #DEFINE FT_MEDIUM .3 ; aa_font48_block, only digits, /, ., :, ;, <, =, > and ? | 104 #DEFINE FT_MEDIUM .3 ; aa_font48_block, only digits, /, ., :, ;, <, =, > and ? |
115 #DEFINE FT_LARGE .4 ; aa_font90_block, only digits, / and . | 105 #DEFINE FT_LARGE .4 ; aa_font90_block, only digits, / and . |
116 #DEFINE FT_HUGE .5 ; aa_font92_block, only digits, / and . | 106 #DEFINE FT_HUGE .5 ; aa_font92_block, only digits, / and . |
117 | 107 |
118 | 108 |
119 ; External O2 cell input Parameters | 109 ; ---- External O2 Sensors |
120 #DEFINE min_mv .70 ; = 7 mV | 110 #DEFINE min_mv .70 ; = 7 mV |
121 #DEFINE max_mv .2500 ; = 250 mV | 111 #DEFINE max_mv .2500 ; = 250 mV |
122 #DEFINE ignore_mv .3500 ; = 350 mV (to suppress ghost readings for long, open cables) | 112 #DEFINE ignore_mv_above .3500 ; = 350 mV (to suppress ghost readings on long open cables) |
123 | 113 #DEFINE ignore_mv_below .19 ; = 1.9 mv (to suppress noise readings on open cabled) |
124 | 114 |
125 ; Profile Recording Parameters | 115 |
126 #DEFINE logbook_profile_version 0x24 ; logbook recording format | 116 ; ---- Profile Recording Parameters |
117 #DEFINE logbook_profile_version 0x40+0x24 ; logbook recording format: internal (2 bit) + external (6 bit) | |
127 #DEFINE samplingrate_apnoe .1 ; [seconds] | 118 #DEFINE samplingrate_apnoe .1 ; [seconds] |
128 | 119 |
129 | 120 |
130 ; Profile Recording Rates - Attention: all Divisors must be < 16 ! | 121 ; ---- Profile Recording Rates - Attention: all Divisors must be < 16 ! |
131 #DEFINE div_temperature .6 ; x sampling rate [s] | 122 #DEFINE div_temperature .6 ; x sampling rate [s] |
132 #DEFINE div_deco .6 ; x sampling rate [s] | 123 #DEFINE div_deco .6 ; x sampling rate [s] |
133 #DEFINE div_gf .12 ; x sampling rate [s] | 124 #DEFINE div_gf .12 ; x sampling rate [s] |
134 #DEFINE div_ppo2_sensors .2 ; x sampling rate [s] | 125 #DEFINE div_ppo2_sensors .2 ; x sampling rate [s] |
135 #DEFINE div_decoplan .12 ; x sampling rate [s] | 126 #DEFINE div_decoplan .12 ; x sampling rate [s] |
136 #DEFINE div_cns .12 ; x sampling rate [s] | 127 #DEFINE div_cns .12 ; x sampling rate [s] |
137 #DEFINE div_tank .12 ; x sampling rate [s] | 128 #DEFINE div_tank .12 ; x sampling rate [s] |
138 | 129 |
139 | 130 |
140 ; Profile Recording Data - Attention: Information Lengths must be < 16 ! | 131 ; ---- Profile Recording Data - Attention: Information Lengths must be < 16 ! |
141 #DEFINE infolength_temperature .2 ; [byte] | 132 #DEFINE infolength_temperature .2 ; [byte] |
142 #DEFINE infolength_deco .2 ; [byte] | 133 #DEFINE infolength_deco .2 ; [byte] |
143 #DEFINE infolength_gf .1 ; [byte] | 134 #DEFINE infolength_gf .1 ; [byte] |
144 #DEFINE infolength_ppo2_sensors .9 ; [byte] | 135 #DEFINE infolength_ppo2_sensors .9 ; [byte] |
145 #DEFINE infolength_decoplan .15 ; [byte] | 136 #DEFINE infolength_decoplan .15 ; [byte] |
146 #DEFINE infolength_cns .2 ; [byte] | 137 #DEFINE infolength_cns .2 ; [byte] |
147 #DEFINE infolength_tank .2 ; [byte] | 138 #DEFINE infolength_tank .2 ; [byte] |
148 | 139 |
149 | 140 |
150 ; RX Functions | 141 ; ---- RX Functions |
151 #DEFINE rx_packet_overdue_timeout .120 ; [seconds] timeout for pressure measurements becomming declared as outdated (max. 255) | 142 #DEFINE rx_packet_overdue_timeout .120 ; [seconds] timeout for pressure measurements becomming declared as outdated (max. 255) |
152 #DEFINE max_pres_diff_min .5 ; [bar] minimum selectable pressure difference for ind.double mode | 143 #DEFINE max_pres_diff_min .5 ; [bar] minimum selectable pressure difference for ind.double mode |
153 #DEFINE max_pres_diff_max .50 ; [bar] maximum selectable pressure difference for ind.double mode | 144 #DEFINE max_pres_diff_max .50 ; [bar] maximum selectable pressure difference for ind.double mode |
154 | |
155 | 145 |
156 IFDEF _ccr_pscr | 146 IFDEF _ccr_pscr |
157 #DEFINE tr_pres_options .15 ; number of options for pressure measurement source / with diluents | 147 #DEFINE tr_pres_options .15 ; number of options for pressure measurement source / with diluents |
158 ELSE | 148 ELSE |
159 #DEFINE tr_pres_options .6 ; number of options for pressure measurement source / OC gases only | 149 #DEFINE tr_pres_options .6 ; number of options for pressure measurement source / OC gases only |
160 ENDIF | 150 ENDIF |
161 | 151 |
162 | 152 |
163 ; Cave Mode | 153 ; ---- Cave Mode |
164 IFDEF _cave_mode | 154 IFDEF _cave_mode |
165 #DEFINE backtrack_waypoint_max .30 ; highest user-available waypoint number (max allowed: 30) | 155 #DEFINE backtrack_waypoint_max .30 ; highest user-available waypoint number (max allowed: 30) |
166 #DEFINE backtrack_almost_full_threshold .240 ; backtrack index position at which the almost full flag will be set | 156 #DEFINE backtrack_almost_full_threshold .240 ; backtrack index position at which the almost full flag will be set |
167 #DEFINE backtrack_entire_full_threshold .250 ; backtrack index position at which the entirely full flag will be set | 157 #DEFINE backtrack_entire_full_threshold .250 ; backtrack index position at which the entirely full flag will be set |
168 ENDIF | 158 ENDIF |
169 | 159 |
170 | 160 |
171 ; Gas Needs Settings | 161 ; ---- Gas Needs Settings |
172 #DEFINE min_tank_size .1 ; [liter] | 162 #DEFINE min_tank_size .1 ; [liter] |
173 #DEFINE max_tank_size .40 ; [liter] | 163 #DEFINE max_tank_size .40 ; [liter] |
174 #DEFINE min_fill_press .5 ; [0 bar] value is in multiples of 10 bar | 164 #DEFINE min_fill_press .5 ; [0 bar] value is in multiples of 10 bar |
175 #DEFINE max_fill_press .29 ; [0 bar] value is in multiples of 10 bar, no 300 bar due to too far beyond ideal gas laws | 165 #DEFINE max_fill_press .29 ; [0 bar] value is in multiples of 10 bar, no 300 bar due to too far beyond ideal gas laws |
176 | 166 |
177 | 167 |
178 ; Timeouts for Menus | 168 ; ---- Timeouts for Menus / Surface Mode |
179 #DEFINE surfmode_timeout_default .240 ; [s] default timeout for surface mode and surface menus | 169 #DEFINE surfmode_timeout_default .240 ; [s] default timeout for surface mode and surface menus |
180 #DEFINE surfmode_timeout_aa_15v .90 ; [s] timeout for surface mode and surface menus when on 1.5V battery | 170 #DEFINE surfmode_timeout_aa_15v .90 ; [s] timeout for surface mode and surface menus when on 1.5V battery |
181 #DEFINE surfmode_timeout_simulator .240 ; [s] special timeout for simulator mode | 171 #DEFINE surfmode_timeout_simulator .240 ; [s] special timeout for simulator mode |
182 ;#DEFINE surfmode_timeout_sensor .240 ; [s] special timeout for surface mode when in CCR/pSCR sensor mode | 172 |
183 ;#DEFINE surfmode_timeout_calibrate .240 ; [s] special timeout when in surface CCR calibrate sensors menu | 173 |
184 ;#DEFINE surfmode_timeout_xmitter .240 ; [s] special timeout when in surface transmitter pairing menu | 174 ; ---- Timeouts for Menus / Dive Mode |
185 | |
186 #DEFINE divemode_timeout_premenu .10 ; [s] timeout for dive mode pre-menu | 175 #DEFINE divemode_timeout_premenu .10 ; [s] timeout for dive mode pre-menu |
187 #DEFINE divemode_timeout_mainmenu .30 ; [s] timeout for dive mode main menu | 176 #DEFINE divemode_timeout_mainmenu .30 ; [s] timeout for dive mode main menu |
188 | 177 |
189 | 178 |
190 ; RS232 Timeout | 179 ; ---- RS232 Timeout |
191 #DEFINE rx_timeout .400 ; [ms] timeout for RS232 RX | 180 #DEFINE rx_timeout .400 ; [ms] timeout for RS232 RX, needs to be multiple of 50 ms |
192 | 181 |
193 | 182 |
194 ; Dive-End Timeouts | 183 ; ---- End-of-Dive Timeouts |
195 #DEFINE simulator_timeout_normal .90 ; [min] timeout simulator mode | 184 #DEFINE simulator_timeout_normal .90 ; [min] timeout simulator mode |
196 #DEFINE simulator_timeout_cave .240 ; [min] timeout simulator mode (cave mode) | 185 #DEFINE simulator_timeout_cave .240 ; [min] timeout simulator mode (cave mode) |
197 #DEFINE apnoe_timeout .15 ; [min] timeout at surface in apnoe mode | 186 #DEFINE apnoe_timeout .15 ; [min] timeout at surface in apnoe mode |
198 #DEFINE simulator_timeout .15 ; [s] timeout at surface in simulator mode | 187 #DEFINE simulator_timeout .15 ; [s] timeout at surface in simulator mode |
199 | 188 |
200 | 189 |
201 ; other Timeouts | 190 ; ---- other Timeouts |
202 #DEFINE deep_sleep_10mins .144 ; [x 10mins] (24h in this example) | 191 #DEFINE deep_sleep_10mins .144 ; [x 10mins] (24h in this example) |
203 | 192 |
204 | 193 |
205 ; Surface Mode Thresholds and Limits | 194 ; ---- Surface Mode Thresholds and Limits |
206 #DEFINE high_altitude_threshold .880 ; [mbar] ambient pressure at which to switch into high altitude mode | 195 #DEFINE high_altitude_threshold .880 ; [mbar] ambient pressure at which to switch into high altitude mode |
207 #DEFINE max_surfpressure .1030 ; [mbar] maximum value for internal surface pressure | 196 #DEFINE max_surfpressure .1030 ; [mbar] maximum value for internal surface pressure |
208 | 197 #DEFINE pressure_noise_threshold .10 ; [mbar] deltaP threshold for start of fast display updating |
209 | 198 #DEFINE pressure_noise_lag_time .6 ; [1/4 secs] lag time of display updating after deltaP < threshold again |
210 ; Dive Mode Thresholds and Limits | 199 |
200 | |
201 | |
202 ; ---- Dive Mode Thresholds and Limits | |
211 #DEFINE wake_up_from_sleep .1160 ; [mbar] absolute pressure at which to switch from sleep mode to surface / dive mode | 203 #DEFINE wake_up_from_sleep .1160 ; [mbar] absolute pressure at which to switch from sleep mode to surface / dive mode |
212 #DEFINE dive_threshold_norm_alt_start .125 ; [mbar] relative pressure for normal altitude start-of-dive (equals depth in cm) | 204 #DEFINE dive_threshold_norm_alt_start .125 ; [mbar] relative pressure for normal altitude start-of-dive (equals depth in cm) |
213 #DEFINE dive_threshold_norm_alt_end .75 ; [mbar] relative pressure for normal altitude end-of-dive (equals depth in cm) | 205 #DEFINE dive_threshold_norm_alt_end .75 ; [mbar] relative pressure for normal altitude end-of-dive (equals depth in cm) |
214 #DEFINE dive_threshold_high_alt_start .325 ; [mbar] relative pressure for high altitude start-of-dive (equals depth in cm) | 206 #DEFINE dive_threshold_high_alt_start .325 ; [mbar] relative pressure for high altitude start-of-dive (equals depth in cm) |
215 #DEFINE dive_threshold_high_alt_end .75 ; [mbar] relative pressure for high altitude end-of-dive (equals depth in cm) | 207 #DEFINE dive_threshold_high_alt_end .75 ; [mbar] relative pressure for high altitude end-of-dive (equals depth in cm) |
216 #DEFINE ostc_depth_max .120 ; [m] maximum allowed operational depth for OSTC 2, 3, cR, TR, Plus & Sport | 208 #DEFINE ostc_depth_max .120 ; [m] maximum allowed operational depth for OSTC 2, 3, cR, TR, Plus & Sport |
217 #DEFINE deco_region_distance .2 ; [m] distance below first stop for the deco region to begin | 209 #DEFINE deco_region_distance .2 ; [m] distance below first stop for the deco region to begin |
218 | 210 |
219 | 211 |
220 ; Dive Mode Margins | 212 ; ---- Dive Mode Margins |
221 #DEFINE ppO2_margin_on_max .300 ; [0.1 mbar] extra margin on ppO2 max values to compensate for surface pressures > 1000 hPa | 213 #DEFINE ppO2_margin_on_max .300 ; [0.1 mbar] extra margin on ppO2 max values to compensate for surface pressures > 1000 hPa |
222 #DEFINE sensor_voting_logic_threshold .10 ; threshold in 0.01 bar | 214 #DEFINE sensor_voting_logic_threshold .10 ; threshold in 0.01 bar |
223 | 215 |
224 | 216 |
225 ; Gas and Dil types | 217 ; ---- Gas and Dil types |
226 #DEFINE num_gas_types .4 ; Disabled, First, Normal, Deco | 218 #DEFINE num_gas_types .4 ; Disabled, First, Normal, Deco |
227 #DEFINE num_dil_types .3 ; Disabled, First, Normal | 219 #DEFINE num_dil_types .3 ; Disabled, First, Normal |
228 | 220 |
229 | 221 |
230 ; ppO2 Limits | 222 ; ---- ppO2 Limits |
231 #DEFINE ppo2_warning_low_lowest .15 ; [cbar] minimum value for minimum ppO2 on OC | 223 #DEFINE ppo2_warning_low_lowest .15 ; [cbar] minimum value for minimum ppO2 on OC |
232 #DEFINE ppo2_warning_low_default .17 ; [cbar] default value for minimum ppO2 on OC | 224 #DEFINE ppo2_warning_low_default .17 ; [cbar] default value for minimum ppO2 on OC |
233 #DEFINE ppo2_warning_low_highest .21 ; [cbar] maximum value for minimum ppO2 on OC | 225 #DEFINE ppo2_warning_low_highest .21 ; [cbar] maximum value for minimum ppO2 on OC |
234 | 226 |
235 #DEFINE ppo2_warning_loop_lowest .20 ; [cbar] minimum value for minimum ppO2 on loop | 227 #DEFINE ppo2_warning_loop_lowest .20 ; [cbar] minimum value for minimum ppO2 on loop |
248 ELSE | 240 ELSE |
249 #DEFINE ppo2_warning_high_highest .160 ; [cbar] maximum value for maximum ppO2 in none-deco phase | 241 #DEFINE ppo2_warning_high_highest .160 ; [cbar] maximum value for maximum ppO2 in none-deco phase |
250 #DEFINE ppo2_warning_deco_highest .160 ; [cbar] maximum value for maximum ppO2 in deco phase | 242 #DEFINE ppo2_warning_deco_highest .160 ; [cbar] maximum value for maximum ppO2 in deco phase |
251 ENDIF | 243 ENDIF |
252 | 244 |
253 ; Salinity Limits | 245 |
246 ; ---- Salinity Limits | |
254 #DEFINE salinity_min .0 ; [%] minimum value for salinity percentage | 247 #DEFINE salinity_min .0 ; [%] minimum value for salinity percentage |
255 #DEFINE salinity_max .4 ; [%] maximum value for salinity percentage | 248 #DEFINE salinity_max .4 ; [%] maximum value for salinity percentage |
256 | 249 |
257 ; Color-Code Parameters for the Dive Mode | 250 |
251 ; ---- Color-Code Parameters for the Dive Mode | |
258 #DEFINE color_code_velocity_warn_high .11 ; [m/min] | 252 #DEFINE color_code_velocity_warn_high .11 ; [m/min] |
259 #DEFINE color_code_velocity_attn_high .10 ; [m/min] | 253 #DEFINE color_code_velocity_attn_high .10 ; [m/min] |
260 #DEFINE velocity_display_threshold .3 ; [m/min] | 254 #DEFINE velocity_display_threshold .3 ; [m/min] |
261 | 255 |
262 | 256 |
263 ; Simulator Parameters | 257 ; ---- Simulator Parameters |
264 #DEFINE simulator_startdepth .200 ; [mbar] initial depth (relative pressure) when entering simulator mode | 258 #DEFINE simulator_startdepth .200 ; [mbar] initial depth (relative pressure) when entering simulator mode |
265 #DEFINE simulator_descent_threshold .50 ; [mbar] remaining distance to target pressure when to slow down descent | 259 #DEFINE simulator_descent_threshold .50 ; [mbar] remaining distance to target pressure when to slow down descent |
266 #DEFINE simulator_ascent_threshold .50 ; [mbar] remaining distance to target pressure when to slow down ascent | 260 #DEFINE simulator_ascent_threshold .50 ; [mbar] remaining distance to target pressure when to slow down ascent |
267 #DEFINE simulator_descent_rate .5 ; [mbar/0.125 sec] normal descent speed, 5 equals 24 m/min | 261 #DEFINE simulator_descent_rate .5 ; [mbar/0.125 sec] normal descent speed, 5 equals 24 m/min |
268 #DEFINE simulator_ascent_rate .2 ; [mbar/0.125 sec] normal ascent speed, 2 equals 9 m/min | 262 #DEFINE simulator_ascent_rate .2 ; [mbar/0.125 sec] normal ascent speed, 2 equals 9 m/min |
269 | 263 |
270 | 264 |
271 ; Battery Thresholds | 265 ; ---- Battery Thresholds |
272 #DEFINE max_battery_charge_temp .3231 ; [0.1 Kelvin] max allowed battery temperature during charging (equals 50°C) | 266 #DEFINE max_battery_charge_temp .3231 ; [0.1 Kelvin] max allowed battery temperature during charging (equals 50°C) |
273 #DEFINE lithium_36v_empty .2400 ; [mV] Saft 3.6 V LS14500 AA - threshold for battery percent display | 267 #DEFINE lithium_36v_empty .2400 ; [mV] Saft 3.6 V LS14500 AA - threshold for battery percent display |
274 #DEFINE lithium_36v_low .2000 ; [mV] Saft 3.6 V LS14500 AA - lowest possible voltage, value must be higher than value of aa_15v_high! | 268 #DEFINE lithium_36v_low .2000 ; [mV] Saft 3.6 V LS14500 AA - lowest possible voltage, value must be higher than value of aa_15v_high! |
275 #DEFINE aa_15v_high .1550 ; [mV] Energizer 1.5 V E2 AA - highest possible voltage, value must be lower than value of lithium_36v_low! | 269 #DEFINE aa_15v_high .1550 ; [mV] Energizer 1.5 V E2 AA - highest possible voltage, value must be lower than value of lithium_36v_low! |
276 #DEFINE aa_15v_low .1100 ; [mV] Energizer 1.5 V E2 AA - lowest possible voltage, according to Energizer data sheet EBC-4201R, page 2 | 270 #DEFINE aa_15v_low .1100 ; [mV] Energizer 1.5 V E2 AA - lowest possible voltage, according to Energizer data sheet EBC-4201R, page 2 |
277 #DEFINE battery_show_level .30 ; [%] threshold when to show battery level | 271 #DEFINE battery_show_level .30 ; [%] threshold when to show battery level |
278 #DEFINE battery_warn_level_36 .15 ; [%] threshold for 3.6 V battery warning, also acts as threshold for setting display brightness level to ECO when in dive mode | 272 #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 |
279 #DEFINE battery_warn_level_15 .25 ; [%] threshold for 1.5 V battery warning, also acts as threshold for setting display brightness level to ECO when in dive mode | 273 #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 |
280 | 274 |
281 | 275 |
282 ; 3.6 Volt Battery Sensing Data Points at 70 mA Load | 276 ; ---- 3.6 Volt Battery Sensing Data Points at 70 mA Load |
283 #DEFINE lithium_36v_75 .3000 ; [mV] | 277 #DEFINE lithium_36v_75 .3000 ; [mV] |
284 #DEFINE lithium_36v_50 .2900 ; [mV] | 278 #DEFINE lithium_36v_50 .2900 ; [mV] |
285 #DEFINE lithium_36v_25 .2600 ; [mV] | 279 #DEFINE lithium_36v_25 .2600 ; [mV] |
286 #DEFINE lithium_36v_10 .2500 ; [mV] | 280 #DEFINE lithium_36v_10 .2500 ; [mV] |
287 | 281 |
288 | 282 |
289 ; Capacity for 2.4 Ah Saft LS14500 and 0.8 Ah Panasonic UR14500P | 283 ; ---- Capacity for 2.4 Ah Saft LS14500 and 0.8 Ah Panasonic UR14500P |
290 ; battery_gauge: 6 is nAs | 284 ; battery_gauge: 6 is nAs |
291 ; devide through 65536 | 285 ; devide through 65536 |
292 ; a) devide through 364 -> result is in percent of a 2.4 Ah battery | 286 ; a) devide through 364 -> result is in percent of a 2.4 Ah battery |
293 ; or b) devide through 121 -> result is in percent of a 0.8 Ah battery | 287 ; or b) devide through 121 -> result is in percent of a 0.8 Ah battery |
294 | 288 |
295 | 289 |
296 ; internal Battery Gauging | 290 ; ---- internal Battery Gauging |
297 #DEFINE capacity_saft_internal .364 | 291 #DEFINE capacity_saft_internal .364 |
298 #DEFINE capacity_panasonic_internal .121 | 292 #DEFINE capacity_panasonic_internal .121 |
299 | 293 |
300 | 294 |
301 ; Gauge IC | 295 ; Gauge IC |
310 | 304 |
311 #DEFINE capacity_ur16650 .271 ; 2.3Ah/0.085mAh/100 [%] | 305 #DEFINE capacity_ur16650 .271 ; 2.3Ah/0.085mAh/100 [%] |
312 #DEFINE offset_ur16650 .38477 ; 65536-(2.3Ah/0.085mAh) | 306 #DEFINE offset_ur16650 .38477 ; 65536-(2.3Ah/0.085mAh) |
313 | 307 |
314 | 308 |
315 ; Power Consumption Values | 309 ; ---- Power Consumption Values |
316 #DEFINE current_sleepmode .31 | 310 #DEFINE current_sleepmode .31 |
317 #DEFINE current_backlight_multi .115 ; * CCPR1L + current_backlight_offset (restricted to <= 255) | 311 #DEFINE current_backlight_multi .115 ; * CCPR1L + current_backlight_offset (restricted to <= 255) |
318 #DEFINE current_backlight_offset .216 | 312 #DEFINE current_backlight_offset .216 |
319 #DEFINE current_speed_eco .1914 | 313 #DEFINE current_speed_eco .1914 |
320 #DEFINE current_speed_normal .4027 | 314 #DEFINE current_speed_normal .4027 |
321 #DEFINE current_speed_fastest .5050 | 315 #DEFINE current_speed_fastest .5050 |
322 #DEFINE current_ir_receiver .139 | 316 #DEFINE current_ir_receiver .139 |
323 #DEFINE current_compass .28 | 317 #DEFINE current_compass .28 |
324 | 318 |
325 | 319 |
326 ; Brightness Thresholds (between zero (off) and 255 (max. power consumption)) | 320 ; ---- Brightness Thresholds (between zero (off) and 255 (max. power consumption)) |
327 #DEFINE ambient_light_max_high_36V .170 | 321 #DEFINE ambient_light_max_high_36V .170 |
328 #DEFINE ambient_light_max_high_cr .240 | 322 #DEFINE ambient_light_max_high_cr .240 |
329 #DEFINE ambient_light_max_high_15V .140 | 323 #DEFINE ambient_light_max_high_15V .140 |
330 #DEFINE ambient_light_min_high .35 | 324 #DEFINE ambient_light_min_high .35 |
331 #DEFINE ambient_light_max_medium .125 | 325 #DEFINE ambient_light_max_medium .125 |
332 #DEFINE ambient_light_min_medium .25 | 326 #DEFINE ambient_light_min_medium .25 |
333 #DEFINE ambient_light_max_eco .70 | 327 #DEFINE ambient_light_max_eco .70 |
334 #DEFINE ambient_light_min_eco .10 ; must be the lowest value! | 328 #DEFINE ambient_light_min_eco .10 ; must be the lowest value! |
335 | 329 |
336 | 330 |
337 ; IR Link Timeout | 331 ; ---- IR Link Timeout |
338 #DEFINE ir_timeout_value .128 ; in multiples of 62.5 ms | 332 #DEFINE ir_timeout_value .128 ; in multiples of 62.5 ms |
339 | 333 |
340 | 334 |
341 ; Setpoint Control | 335 ; ---- Setpoint Control |
342 #DEFINE surface_sp .50 ; in cbar | 336 #DEFINE surface_sp .50 ; in cbar |
343 | 337 |
344 | 338 |
345 ; Gas / Diluent Type & State | 339 ; ---- Gaslist hard-coded Limits |
340 IFDEF _helium | |
341 #DEFINE gaslist_min_o2 .7 ; minimum O2 [%] ( 7% is minimum value to keep MOD < 255 meters / 1 Byte) | |
342 #DEFINE gaslist_max_o2 .100 ; maximum O2 [%] | |
343 #DEFINE gaslist_max_He .100-gaslist_min_o2 ; maximum He [%] | |
344 #DEFINE gaslist_max_change_depth .140 ; max. change depth [m] | |
345 #DEFINE tissue_graphics_options .2 ; tissue graphics "Pres+Sat" and "N2+He" available | |
346 ELSE | |
347 #DEFINE gaslist_min_o2 .21 ; minimum O2 [%] | |
348 #DEFINE gaslist_max_o2 .100 ; maximum O2 [%] | |
349 #DEFINE gaslist_max_He .0 ; maximum He [%] | |
350 #DEFINE gaslist_max_change_depth .70 ; max. change depth [m] | |
351 #DEFINE tissue_graphics_options .1 ; tissue graphics "Pres+Sat" only available | |
352 ENDIF | |
353 | |
354 | |
355 ; ---- Setpoint list hard-coded Limits | |
356 #DEFINE gaslist_sp_max .160 ; max. setpoint [cbar] | |
357 #DEFINE gaslist_sp_min .50 ; min. setpoint [cbar] | |
358 #DEFINE gaslist_sp_max_depth .100 ; max change depth [m] | |
359 | |
360 | |
361 ; ---- Compass Display | |
362 #DEFINE compass_fast_treshold .9 ; show new heading instantly if angular difference > compass_fast_treshold, else show animated turning of compass rose | |
363 #DEFINE compass_averaging .10 ; number of averaging cycles | |
364 | |
365 | |
366 ;----------------------------------------------------------------------------- | |
367 ; Bit Flags | |
368 ;----------------------------------------------------------------------------- | |
369 | |
370 ; ---- Gas / Diluent Type & State | |
346 ; .0 ; | 0: disabled, 1: first, 2: normal/work, 3: deco | 371 ; .0 ; | 0: disabled, 1: first, 2: normal/work, 3: deco |
347 ; .1 ; | | 372 ; .1 ; | |
348 #DEFINE gas_lost .2 ; =1: gas/diluent is lost (permanently unavailable) | 373 #DEFINE gas_lost .2 ; =1: gas/diluent is lost (permanently unavailable) |
349 #DEFINE gas_staged .3 ; =1: gas/diluent is staged (temporary unavailable) | 374 #DEFINE gas_staged .3 ; =1: gas/diluent is staged (temporary unavailable) |
350 ; .4 ; --- unused | 375 ; .4 ; --- unused |
351 ; .5 ; --- unused | 376 ; .5 ; --- unused |
352 ; .6 ; --- unused | 377 ; .6 ; --- unused |
353 ; .7 ; --- unused | 378 ; .7 ; --- unused |
354 | 379 |
355 | 380 ; ---- Bit Flags for Communication with p2_deco.c - char_O_main_status |
356 ; Gaslist hard-coded Limits | |
357 IFDEF _helium | |
358 #DEFINE gaslist_min_o2 .7 ; minimum O2 [%] ( 7% is minimum value to keep MOD < 255 meters / 1 Byte) | |
359 #DEFINE gaslist_max_o2 .100 ; maximum O2 [%] | |
360 #DEFINE gaslist_max_He .100-gaslist_min_o2 ; maximum He [%] | |
361 #DEFINE gaslist_max_change_depth .220 ; max. change depth [m] (219 is maximum value that can be produced by gaslist_calc_mod with 7% O2) | |
362 #DEFINE tissue_graphics_options .2 ; tissue graphics "Pres+Sat" and "N2+He" available | |
363 ELSE | |
364 #DEFINE gaslist_min_o2 .21 ; minimum O2 [%] | |
365 #DEFINE gaslist_max_o2 .100 ; maximum O2 [%] | |
366 #DEFINE gaslist_max_He .0 ; maximum He [%] | |
367 #DEFINE gaslist_max_change_depth .70 ; max. change depth [m] (67 is maximum value that can be produced by gaslist_calc_mod with 21% O2) | |
368 #DEFINE tissue_graphics_options .1 ; tissue graphics "Pres+Sat" only available | |
369 ENDIF | |
370 | |
371 | |
372 ; Setpoint list hard-coded Limits | |
373 #DEFINE gaslist_sp_stepsize .10 ; steps for setpoint setup [cbar] | |
374 #DEFINE gaslist_sp_max .160 ; max. setpoint [cbar] | |
375 #DEFINE gaslist_sp_min .50 ; min. setpoint [cbar] | |
376 #DEFINE sp_max_change_depth .100 ; max change depth [m] | |
377 | |
378 | |
379 ; Compass Display | |
380 #DEFINE compass_fast_treshold .9 ; show new heading instantly if angular difference > compass_fast_treshold, else show animated turning of compass rose | |
381 #DEFINE compass_averaging .10 ; number of averaging cycles | |
382 | |
383 | |
384 ; Bit Flags for Communication with p2_deco.c - char_O_main_status | |
385 #DEFINE DECO_VOLUME_FLAG .0 ; =1: calculate gas needs | 381 #DEFINE DECO_VOLUME_FLAG .0 ; =1: calculate gas needs |
386 #DEFINE DECO_BOTTOM_FLAG .1 ; =1: calculate gas needs for full bottom segment, =0: ...for extra time only | 382 #DEFINE DECO_BOTTOM_FLAG .1 ; =1: calculate gas needs for full bottom segment, =0: ...for extra time only |
387 #DEFINE DECO_CAVE_MODE .2 ; =1: calculate ascent and gas needs using backtracking data | 383 #DEFINE DECO_CAVE_MODE .2 ; =1: calculate ascent and gas needs using backtracking data |
388 #DEFINE DECO_GAS_CONTINGENCY .3 ; =1: use a second best gas if best gas is all used up | 384 #DEFINE DECO_GAS_CONTINGENCY .3 ; =1: use a second best gas if best gas is all used up |
389 #DEFINE DECO_TR_FUNCTIONS .4 ; =1: calculate TR functions (pressure readings) | 385 #DEFINE DECO_TR_FUNCTIONS .4 ; =1: calculate TR functions (pressure readings) |
390 #DEFINE DECO_EXTENDED_STOPS .5 ; =1: place gas changes also below 1st stop depth | 386 #DEFINE DECO_EXTENDED_STOPS .5 ; =1: place gas changes also below 1st stop depth |
391 #DEFINE DECO_MODE_LOOP_FLAG .6 ; =1: calculate real tissues in loop mode (CCR or pSCR) | 387 #DEFINE DECO_MODE_LOOP_FLAG .6 ; =1: calculate real tissues in loop mode (CCR or pSCR) |
392 #DEFINE DECO_MODE_PSCR_FLAG .7 ; =1: calculate real tissues in pSCR mode (loop flag needs to be set, too) | 388 #DEFINE DECO_MODE_PSCR_FLAG .7 ; =1: calculate real tissues in pSCR mode (loop flag needs to be set, too) |
393 | 389 |
394 | 390 ; ---- Bit Flags for Communication with p2_deco.c - char_O_deco_status |
395 ; Bit Flags for Communication with p2_deco.c - char_O_deco_status | |
396 #DEFINE DECO_START_NORM .0 ; =1: write: start calculation of a normal deco plan | 391 #DEFINE DECO_START_NORM .0 ; =1: write: start calculation of a normal deco plan |
397 #DEFINE DECO_START_ALT .1 ; =1: write: start calculation of an alternative deco plan | 392 #DEFINE DECO_START_ALT .1 ; =1: write: start calculation of an alternative deco plan |
398 #DEFINE DECO_COMPLETED_NORM .0 ; =1: read: calculation of a normal deco plan has completed | 393 #DEFINE DECO_COMPLETED_NORM .0 ; =1: read: calculation of a normal deco plan has completed |
399 #DEFINE DECO_COMPLETED_ALT .1 ; =1: read: calculation of an alternative deco plan has completed | 394 #DEFINE DECO_COMPLETED_ALT .1 ; =1: read: calculation of an alternative deco plan has completed |
400 #DEFINE DECO_INITIALIZE .2 ; =1: write: initialize deco engine (to be done only once at the begin of every dive) | 395 #DEFINE DECO_INITIALIZE .2 ; =1: write: initialize deco engine (to be done only once at the begin of every dive) |
402 #DEFINE DECO_BAILOUT_FLAG .4 ; =1: allow gas switches before first deco stop (used in bailout plans) | 397 #DEFINE DECO_BAILOUT_FLAG .4 ; =1: allow gas switches before first deco stop (used in bailout plans) |
403 #DEFINE DECO_DELAY_FLAG .5 ; =1: figure in a delayed ascent (fTTS) | 398 #DEFINE DECO_DELAY_FLAG .5 ; =1: figure in a delayed ascent (fTTS) |
404 ; DECO_MODE_LOOP_FLAG .6 ; =1: calculate simulated tissues in loop mode (CCR or pSCR) | 399 ; DECO_MODE_LOOP_FLAG .6 ; =1: calculate simulated tissues in loop mode (CCR or pSCR) |
405 ; DECO_MODE_PSCR_FLAG .7 ; =1: calculate simulated tissues in pSCR mode (loop flag needs to be set, too) | 400 ; DECO_MODE_PSCR_FLAG .7 ; =1: calculate simulated tissues in pSCR mode (loop flag needs to be set, too) |
406 | 401 |
407 | 402 ; ---- Bit Flags for Communication with p2_deco.c - char_O_deco_warnings |
408 ; Bit Flags for Communication with p2_deco.c - char_O_deco_warnings | |
409 #DEFINE IBCD_warning .0 ; =1: IBCD currently occuring | 403 #DEFINE IBCD_warning .0 ; =1: IBCD currently occuring |
410 #DEFINE IBCD_warning_lock .1 ; =1: IBCD occured durign the dive | 404 #DEFINE IBCD_warning_lock .1 ; =1: IBCD occured durign the dive |
411 #DEFINE mbubble_warning .2 ; =1: microbubbles potentionally currently occuring | 405 #DEFINE mbubble_warning .2 ; =1: microbubbles potentionally currently occuring |
412 #DEFINE mbubble_warning_lock .3 ; =1: microbubbles potentionally occured during the dive | 406 #DEFINE mbubble_warning_lock .3 ; =1: microbubbles potentionally occured during the dive |
413 #DEFINE outside_warning .4 ; =1: currently outside the ZHL-16 model | 407 #DEFINE outside_warning .4 ; =1: currently outside the ZHL-16 model |
414 #DEFINE outside_warning_lock .5 ; =1: was outside the ZHL-16 model during the dive | 408 #DEFINE outside_warning_lock .5 ; =1: was outside the ZHL-16 model during the dive |
415 #DEFINE outside_attention .6 ; =1: currently near to the limits of the ZHL-16 model | 409 #DEFINE outside_attention .6 ; =1: currently near to the limits of the ZHL-16 model |
416 #DEFINE deco_plan_incomplete .7 ; =1: internal error: deco calculation incomplete | 410 #DEFINE deco_plan_incomplete .7 ; =1: internal error: deco calculation incomplete |
417 | 411 |
418 | 412 ; ---- Bit Flags for Communication with p2_deco.c - char_O_deco_info |
419 ; Bit Flags for Communication with p2_deco.c - char_O_deco_info | |
420 #DEFINE deco_mode .0 ; =1: in deco mode, deco ppO2 levels permitted | 413 #DEFINE deco_mode .0 ; =1: in deco mode, deco ppO2 levels permitted |
421 #DEFINE ind_double_switch .1 ; =1: switch to other tank advice active | 414 #DEFINE ind_double_switch .1 ; =1: switch to other tank advice active |
422 #DEFINE gas_needs_fTTS .2 ; =1: indicated gas needs are calculated in fTTS mode | 415 #DEFINE gas_needs_fTTS .2 ; =1: indicated gas needs are calculated in fTTS mode |
423 #DEFINE deco_zone .3 ; =1: fTTS is <= TTS (not updated when in bailout mode) | 416 #DEFINE deco_zone .3 ; =1: fTTS is <= TTS (not updated when in bailout mode) |
424 #DEFINE deco_ceiling .4 ; =1: ceiling depth > 0 | 417 #DEFINE deco_ceiling .4 ; =1: ceiling depth > 0 |
425 #DEFINE deco_stops_norm .5 ; =1: deco stops found in normal plan | 418 #DEFINE deco_stops_norm .5 ; =1: deco stops found in normal plan |
426 #DEFINE deco_stops_alt .6 ; =1: deco stops found in alternative plan | 419 #DEFINE deco_stops_alt .6 ; =1: deco stops found in alternative plan |
427 #DEFINE gas_needs_cave .7 ; =1: indicated gas needs are calculated in cave mode | 420 #DEFINE gas_needs_cave .7 ; =1: indicated gas needs are calculated in cave mode |
428 | 421 |
429 | 422 ; ---- Bit Flags for Status on Variables of Type char |
430 ; Bit Flags for Status on Variables of Type char | |
431 #DEFINE char_transmitter_lost .6 | 423 #DEFINE char_transmitter_lost .6 |
432 #DEFINE char_invalid_flag .7 | 424 #DEFINE char_invalid_flag .7 |
433 #DEFINE char_transmitter_low_bat .7 | 425 #DEFINE char_transmitter_low_bat .7 |
434 | 426 |
435 | 427 ; ---- Bit Flags for Status on Variables of Type int (Flags are placed in the UPPER byte!) |
436 ; Bit Flags for Status on Variables of Type int (Flags are placed in the UPPER byte!) | |
437 #DEFINE int_invalid_flag .2 | 428 #DEFINE int_invalid_flag .2 |
438 #DEFINE int_not_yet_computed .3 | 429 #DEFINE int_not_yet_computed .3 |
439 #DEFINE int_is_zero .3 | 430 #DEFINE int_is_zero .3 |
440 #DEFINE int_low_flag .4 | 431 #DEFINE int_low_flag .4 |
441 #DEFINE int_not_avail_flag .4 | 432 #DEFINE int_not_avail_flag .4 |
445 #DEFINE int_warning_flag .7 | 436 #DEFINE int_warning_flag .7 |
446 | 437 |
447 | 438 |
448 ;----------------------------------------------------------------------------- | 439 ;----------------------------------------------------------------------------- |
449 ; Timebase and Eventbase (stored in access RAM, set by the ISR, trigger flags to be cleared by the application) | 440 ; Timebase and Eventbase (stored in access RAM, set by the ISR, trigger flags to be cleared by the application) |
441 ;----------------------------------------------------------------------------- | |
450 | 442 |
451 #DEFINE timebase_0sec timebase,0 ; counting timebase, 1/2 sec bit | 443 #DEFINE timebase_0sec timebase,0 ; counting timebase, 1/2 sec bit |
452 #DEFINE timebase_1sec timebase,1 ; counting timebase, 1 sec bit | 444 #DEFINE timebase_1sec timebase,1 ; counting timebase, 1 sec bit |
453 #DEFINE timebase_2sec timebase,2 ; counting timebase, 2 sec bit | 445 #DEFINE timebase_2sec timebase,2 ; counting timebase, 2 sec bit |
454 #DEFINE trigger_quarter_second timebase,3 ; =1: a new 1/4 second has begun (not synced with the other time flags, not generated while block_sensor_interrupt is set) | 446 #DEFINE trigger_quarter_second timebase,3 ; =1: a new 1/4 second has begun (not synced with the other time flags, not generated while block_sensor_interrupt is set) |
459 | 451 |
460 #DEFINE trigger_isr_updates eventbase,0 ; =1: the ISR had kicked in (set by ISR, used by ISR-safe copy macros) | 452 #DEFINE trigger_isr_updates eventbase,0 ; =1: the ISR had kicked in (set by ISR, used by ISR-safe copy macros) |
461 #DEFINE trigger_timeout eventbase,1 ; =1: timeout signal by timeout service | 453 #DEFINE trigger_timeout eventbase,1 ; =1: timeout signal by timeout service |
462 #DEFINE trigger_sample_divedata eventbase,2 ; =1: time to store a new sample | 454 #DEFINE trigger_sample_divedata eventbase,2 ; =1: time to store a new sample |
463 #DEFINE trigger_S8_data_update eventbase,3 ; =1: new S8 digital data are available | 455 #DEFINE trigger_S8_data_update eventbase,3 ; =1: new S8 digital data are available |
464 #DEFINE trigger_pres_update eventbase,4 ; =1: new pressure value is available | 456 ; eventbase,4 ; --- unused |
465 #DEFINE trigger_pres_cur_changed eventbase,5 ; =1: current pressure value has changed | 457 #DEFINE trigger_pres_cur_changed eventbase,5 ; =1: current pressure value has changed |
466 #DEFINE trigger_pres_max_changed eventbase,6 ; =1: maximum pressure value has changed | 458 #DEFINE trigger_pres_max_changed eventbase,6 ; =1: maximum pressure value has changed |
467 #DEFINE trigger_temp_changed eventbase,7 ; =1: temperature value has changed | 459 #DEFINE trigger_temp_changed eventbase,7 ; =1: temperature value has changed |
468 | 460 |
469 | 461 |
470 ;----------------------------------------------------------------------------- | 462 ;----------------------------------------------------------------------------- |
471 ; Flags - stored in access RAM | 463 ; Flags - stored in access RAM |
464 ;----------------------------------------------------------------------------- | |
472 | 465 |
473 ;---- Hardware - OSTC Model Descriptor (stored in access RAM, cleared & rebuilt in restart, to preserve compatibility with 3rd party tools DO NOT alter bit positions) | 466 ;---- Hardware - OSTC Model Descriptor (stored in access RAM, cleared & rebuilt in restart, to preserve compatibility with 3rd party tools DO NOT alter bit positions) |
474 #DEFINE battery_gauge_available HW_descriptor,0 ; =1: OSTC has rechargeable battery with battery management chip | 467 #DEFINE battery_gauge_available HW_descriptor,0 ; =1: OSTC has rechargeable battery with battery management chip |
475 #DEFINE ambient_sensor HW_descriptor,1 ; =1: OSTC has an ambient light sensor | 468 #DEFINE ambient_sensor HW_descriptor,1 ; =1: OSTC has an ambient light sensor |
476 #DEFINE analog_o2_input HW_descriptor,2 ; =1: OSTC has analog inputs and S8 digital | 469 #DEFINE ext_input_s8_ana HW_descriptor,2 ; =1: OSTC has S8/analog input |
477 #DEFINE optical_input HW_descriptor,3 ; =1: OSTC has an digital optical input | 470 #DEFINE ext_input_optical HW_descriptor,3 ; =1: OSTC has optical input |
478 #DEFINE ble_available HW_descriptor,4 ; =1: OSTC has an BLE module | 471 #DEFINE ble_available HW_descriptor,4 ; =1: OSTC has an BT module |
479 #DEFINE ostc_rx_present HW_descriptor,5 ; =1: OSTC has RX module | 472 #DEFINE ostc_rx_present HW_descriptor,5 ; =1: OSTC has RX module |
480 #DEFINE lv_core HW_descriptor,6 ; =1: OSTC has low-voltage core (2.7V) | 473 #DEFINE lv_core HW_descriptor,6 ; =1: OSTC has low-voltage core (2.7V) |
481 ; HW_descriptor,7 ; --- reserved | 474 #DEFINE flash_block_write HW_descriptor,7 ; =1: OSTC has FLASH with block-write capability |
482 | 475 |
483 ;---- Hardware - OSTC Model Variants (stored in access RAM, NOT cleared in restart) | 476 ;---- Hardware - OSTC Model Variants (stored in access RAM, NOT cleared in restart) |
484 #DEFINE screen_type1 HW_variants,0 ; =1: display type 1, =0; display type 0 | 477 #DEFINE screen_type1 HW_variants,0 ; =1: display type 1, =0; display type 0 |
485 #DEFINE screen_type2 HW_variants,1 ; =1: display type 2, =0: display type 0 or 1 | 478 #DEFINE screen_type2 HW_variants,1 ; =1: display type 2, =0: display type 0 or 1 |
486 #DEFINE screen_type3 HW_variants,2 ; =1: display type 3, =0: display type 0 or 1 or 2 | 479 #DEFINE screen_type3 HW_variants,2 ; =1: display type 3, =0: display type 0 or 1 or 2 |
504 ;---- Hardware - States 2 (stored in access RAM, NOT cleared on restart) | 497 ;---- Hardware - States 2 (stored in access RAM, NOT cleared on restart) |
505 #DEFINE cc_active HW_flags_state2,0 ; =1: constant current charging active (cR hardware only) | 498 #DEFINE cc_active HW_flags_state2,0 ; =1: constant current charging active (cR hardware only) |
506 #DEFINE cv_active HW_flags_state2,1 ; =1: constant voltage charging active (cR hardware only) | 499 #DEFINE cv_active HW_flags_state2,1 ; =1: constant voltage charging active (cR hardware only) |
507 #DEFINE i2c_error_flag HW_flags_state2,2 ; =1: an I2C error occurred | 500 #DEFINE i2c_error_flag HW_flags_state2,2 ; =1: an I2C error occurred |
508 #DEFINE rs232_rx_timeout HW_flags_state2,3 ; =1: RS232 receive timeout occurred | 501 #DEFINE rs232_rx_timeout HW_flags_state2,3 ; =1: RS232 receive timeout occurred |
509 #DEFINE address_wrap_around HW_flags_state2,4 ; =1: the ext_flash_address wrapped around on increment | 502 #DEFINE battery_low_condition HW_flags_state2,4 ; =1: low battery condition detected |
510 #DEFINE battery_low_condition HW_flags_state2,5 ; =1: low battery condition detected | 503 #DEFINE flash_wrap_around HW_flags_state2,5 ; =1: address wrap-around control / signalling |
511 ; HW_flags_state2,6 ; --- unused | 504 #DEFINE flash_wait HW_flags_state2,6 ; =1: wait for flash write operation to complete |
512 ; HW_flags_state2,7 ; --- unused | 505 ; HW_flags_state2,7 ; --- unused |
513 | 506 |
514 | 507 |
515 ;---- Operating System - persistent Settings (stored in access RAM, NOT cleared in restart) | 508 ;---- Operating System - persistent Settings (stored in access RAM, NOT cleared in restart) |
516 #DEFINE sensor1_calibrated_ok OS_flags_persist,0 ; =1: sensor 1 calibration ok | 509 #DEFINE sensor1_calibrated_ok OS_flags_persist,0 ; =1: sensor 1 calibration ok |
517 #DEFINE sensor2_calibrated_ok OS_flags_persist,1 ; =1: sensor 2 calibration ok | 510 #DEFINE sensor2_calibrated_ok OS_flags_persist,1 ; =1: sensor 2 calibration ok |
518 #DEFINE sensor3_calibrated_ok OS_flags_persist,2 ; =1: sensor 3 calibration ok | 511 #DEFINE sensor3_calibrated_ok OS_flags_persist,2 ; =1: sensor 3 calibration ok |
519 #DEFINE compass_bearing_set OS_flags_persist,3 ; =1: compass bearing is set | 512 #DEFINE compass_bearing_set OS_flags_persist,3 ; =1: compass bearing is set |
520 #DEFINE use_old_batt_flag OS_flags_persist,4 ; =1: load old battery data after power-on reset | 513 #DEFINE use_old_batt_flag OS_flags_persist,4 ; =1: load old battery data after power-on reset |
521 #DEFINE options_changed OS_flags_persist,5 ; =1: option values have been changed, EEPROM needs to be updated | 514 #DEFINE option_changed OS_flags_persist,5 ; =1: option values have been changed, EEPROM needs to be updated |
522 #DEFINE restart_fast OS_flags_persist,6 ; =1: request to skip logos and waits on restart | 515 #DEFINE restart_fast OS_flags_persist,6 ; =1: request to skip logos and waits on restart |
523 #DEFINE battery_overtemp OS_flags_persist,7 ; =1: battery charging temperature limit exceeded | 516 #DEFINE battery_overtemp OS_flags_persist,7 ; =1: battery charging temperature limit exceeded |
524 | 517 |
525 | 518 |
526 ;---- Operating System - ISR Control 1 (stored in access RAM) | 519 ;---- Operating System - ISR Control 1 (stored in access RAM) |
527 #DEFINE reset_timebase OS_flags_ISR1,0 ; =1: request ISR to reset the timebase for the trigger flags | 520 #DEFINE reset_timebase OS_flags_ISR1,0 ; =1: request ISR to reset the timebase for the trigger flags |
528 #DEFINE reset_timeout OS_flags_ISR1,1 ; =1: request ISR to reset the timeout timer | 521 #DEFINE restart_timeout OS_flags_ISR1,1 ; =1: request ISR to resart the timeout timer |
529 #DEFINE reset_max_pressure OS_flags_ISR1,2 ; =1: request ISR to reset the maximum pressure to zero | 522 #DEFINE reset_max_pressure OS_flags_ISR1,2 ; =1: request ISR to reset the maximum pressure to zero |
530 #DEFINE reset_surface_interval OS_flags_ISR1,3 ; =1: request ISR to reset the surface interval to zero | 523 #DEFINE reset_surface_interval OS_flags_ISR1,3 ; =1: request ISR to reset the surface interval to zero |
531 #DEFINE reset_trip_pressure OS_flags_ISR1,4 ; =1: request ISR to reset the resettable min/max pressure | 524 #DEFINE reset_trip_pressure OS_flags_ISR1,4 ; =1: request ISR to reset the resettable min/max pressure |
532 #DEFINE block_rtc_access OS_flags_ISR1,5 ; =1: suspend the ISR from accessing the RTC | 525 #DEFINE block_rtc_access OS_flags_ISR1,5 ; =1: suspend the ISR from accessing the RTC |
533 #DEFINE block_battery_gauge OS_flags_ISR1,6 ; =1: suspend the ISR from updating the battery gauge | 526 #DEFINE block_battery_gauge OS_flags_ISR1,6 ; =1: suspend the ISR from updating the battery gauge |
534 #DEFINE block_sensor_interrupt OS_flags_ISR1,7 ; =1: suspend the ISR from executing sensor interrupts | 527 #DEFINE block_sensor_interrupt OS_flags_ISR1,7 ; =1: suspend the ISR from executing sensor interrupts |
535 | 528 |
536 ;---- Operating System - ISR Control 2 (stored in access RAM) | 529 ;---- Operating System - ISR Control 2 (stored in access RAM) |
537 #DEFINE update_surface_pressure OS_flags_ISR2,0 ; =1: request ISR to update the surface pressure | 530 #DEFINE update_surface_pressure OS_flags_ISR2,0 ; =1: request ISR to update the surface pressure |
538 #DEFINE quit_simulatormode OS_flags_ISR2,1 ; =1: request ISR to quit the simulator mode | 531 #DEFINE quit_simulatormode OS_flags_ISR2,1 ; =1: request ISR to quit the simulator mode |
539 #DEFINE count_divetime OS_flags_ISR2,2 ; =1: request ISR to count the dive time | 532 #DEFINE count_divetime OS_flags_ISR2,2 ; =1: request ISR to count the dive time |
540 #DEFINE sensor_override_request OS_flags_ISR2,3 ; =1: request ISR to override the pressure sensor with a simulated depth | 533 #DEFINE sensor_override_request OS_flags_ISR2,3 ; =1: request ISR to override the pressure sensor with a simulated depth |
541 ; OS_flags_ISR2,4 ; --- unused | 534 #DEFINE tmr5_preemtion_allowed OS_flags_ISR2,4 ; =1: allow preemption of timeout counter |
542 ; OS_flags_ISR2,5 ; --- unused | 535 ; OS_flags_ISR2,5 ; --- unused |
543 #DEFINE sensor_override_active OS_flags_ISR2,6 ; =1: ISR output: switch to override-mode confirmed | 536 #DEFINE sensor_override_active OS_flags_ISR2,6 ; =1: ISR output: switch to override-mode confirmed |
544 #DEFINE divetime_longer_1min OS_flags_ISR2,7 ; =1: ISR output: dive time is >= one minute | 537 #DEFINE divetime_longer_1min OS_flags_ISR2,7 ; =1: ISR output: dive time is >= one minute |
545 | 538 |
546 | 539 |
547 ;---- Operating Modes (stored in access RAM, persistent) | 540 ;---- Operating Modes (stored in access RAM, persistent) |
548 #DEFINE sleepmode OM_flags_mode,0 ; =1: in sleep mode | 541 #DEFINE sleepmode OM_flags_mode,0 ; =1: in sleep mode |
549 #DEFINE divemode OM_flags_mode,1 ; =1: in dive mode | 542 #DEFINE divemode OM_flags_mode,1 ; =1: in dive mode |
550 #DEFINE simulatormode OM_flags_mode,2 ; =1: in simulator mode | 543 #DEFINE simulatormode OM_flags_mode,2 ; =1: in simulator mode |
551 #DEFINE high_altitude_mode OM_flags_mode,3 ; =1: unit was manually turned on with absolute pressure < 880 mbar | 544 #DEFINE high_altitude_mode OM_flags_mode,3 ; =1: unit was manually turned on with absolute pressure < 880 mbar |
552 #DEFINE s8_digital_avail OM_flags_mode,4 ; =1: S8 digital interface is available | 545 ; OM_flags_mode,4 ; --- unused |
553 #DEFINE tr_functions_activated OM_flags_mode,5 ; =1: TR module is available and TR mode is <> off | 546 #DEFINE tr_functions_activated OM_flags_mode,5 ; =1: TR module is available and TR mode is <> off |
554 #DEFINE cold_start OM_flags_mode,6 ; =1: restart is entered from a cold start | 547 #DEFINE cold_start OM_flags_mode,6 ; =1: restart is entered from a cold start |
555 IFDEF _screendump | 548 IFDEF _screendump |
556 #DEFINE screen_dump_avail OM_flags_mode,7 ; =1: screen dump function is available | 549 #DEFINE screen_dump_avail OM_flags_mode,7 ; =1: screen dump function is available |
557 ELSE | 550 ELSE |
570 #DEFINE apnoe_new_dive DM_flags_deco,7 ; =1: a new dive has begun (apnoe mode only, set by ISR) | 563 #DEFINE apnoe_new_dive DM_flags_deco,7 ; =1: a new dive has begun (apnoe mode only, set by ISR) |
571 | 564 |
572 | 565 |
573 ;----------------------------------------------------------------------------- | 566 ;----------------------------------------------------------------------------- |
574 ; Flags - stored in bank common | 567 ; Flags - stored in bank common |
568 ;----------------------------------------------------------------------------- | |
575 | 569 |
576 ;---- Dive Mode - Dive States | 570 ;---- Dive Mode - Dive States |
577 #DEFINE use_aGF DM_flags_state,0 ; =1: use aGF, =0: use GF | 571 #DEFINE use_aGF DM_flags_state,0 ; =1: use aGF, =0: use GF |
578 #DEFINE deco_locked DM_flags_state,1 ; =1: in or has been in deco obligation during the dive | 572 #DEFINE deco_locked DM_flags_state,1 ; =1: in or has been in deco obligation during the dive |
579 #DEFINE deco_region DM_flags_state,2 ; =1: in or has been in the deco stops region during the dive | 573 #DEFINE deco_region DM_flags_state,2 ; =1: in or has been in the deco stops region during the dive |
588 #DEFINE use_O2_sensor2 DM_flags_sensor,1 ; =1: sensor 2 shall be used | 582 #DEFINE use_O2_sensor2 DM_flags_sensor,1 ; =1: sensor 2 shall be used |
589 #DEFINE use_O2_sensor3 DM_flags_sensor,2 ; =1: sensor 3 shall be used | 583 #DEFINE use_O2_sensor3 DM_flags_sensor,2 ; =1: sensor 3 shall be used |
590 #DEFINE voting_logic_sensor1 DM_flags_sensor,3 ; =1: sensor 1 is within the voting logic threshold | 584 #DEFINE voting_logic_sensor1 DM_flags_sensor,3 ; =1: sensor 1 is within the voting logic threshold |
591 #DEFINE voting_logic_sensor2 DM_flags_sensor,4 ; =1: sensor 2 is within the voting logic threshold | 585 #DEFINE voting_logic_sensor2 DM_flags_sensor,4 ; =1: sensor 2 is within the voting logic threshold |
592 #DEFINE voting_logic_sensor3 DM_flags_sensor,5 ; =1: sensor 3 is within the voting logic threshold | 586 #DEFINE voting_logic_sensor3 DM_flags_sensor,5 ; =1: sensor 3 is within the voting logic threshold |
593 #DEFINE sp_fallback DM_flags_sensor,6 ; =1: fall-back to SP1 due to external O2 sensor failure | 587 ; DM_flags_sensor,6 ; --- unused |
594 ; DM_flags_sensor,7 ; --- unused | 588 ; DM_flags_sensor,7 ; --- unused |
595 | 589 |
596 ;---- Dive Mode - User Requests / General | 590 ;---- Dive Mode - User Requests / General |
597 #DEFINE request_gas_change DM_flags_request,0 ; =1: request to change the gas | 591 #DEFINE request_gas_change DM_flags_request,0 ; =1: request to change the gas |
598 #DEFINE request_gas_update DM_flags_request,1 ; =1: request to update the gas | 592 #DEFINE request_gas_update DM_flags_request,1 ; =1: request to update the gas |
633 #DEFINE neg_flag_velocity DM_flags_layout1,6 ; =1: descending, used by velocity logic | 627 #DEFINE neg_flag_velocity DM_flags_layout1,6 ; =1: descending, used by velocity logic |
634 #DEFINE show_only_divemins DM_flags_layout1,7 ; =1: only dive minutes are shown | 628 #DEFINE show_only_divemins DM_flags_layout1,7 ; =1: only dive minutes are shown |
635 | 629 |
636 #DEFINE cur_depth_greater_100m DM_flags_layout2,0 ; =1: current depth > 100 meters | 630 #DEFINE cur_depth_greater_100m DM_flags_layout2,0 ; =1: current depth > 100 meters |
637 #DEFINE max_depth_greater_100m DM_flags_layout2,1 ; =1: max. depth > 100 meters | 631 #DEFINE max_depth_greater_100m DM_flags_layout2,1 ; =1: max. depth > 100 meters |
638 #DEFINE depth_attention DM_flags_layout2,2 ; =1: show depth in attention color | 632 #DEFINE depth_color_attention DM_flags_layout2,2 ; =1: show depth in attention color |
639 #DEFINE depth_warning DM_flags_layout2,3 ; =1: show depth in warning color | 633 #DEFINE depth_color_warning DM_flags_layout2,3 ; =1: show depth in warning color |
640 #DEFINE depth_warn_att_last DM_flags_layout2,4 ; =1: last depth was shown in warning or attention color | 634 #DEFINE depth_color_last DM_flags_layout2,4 ; =1: last depth was shown in warning or attention color |
641 #DEFINE depth_inverse_last DM_flags_layout2,5 ; =1: last depth was shown in inverse | 635 #DEFINE depth_inverse_last DM_flags_layout2,5 ; =1: last depth was shown in inverse |
642 #DEFINE gas_needs_mode_last DM_flags_layout2,6 ; =1: last gas needs were computed for cave mode, =0: direct ascent | 636 #DEFINE gas_needs_mode_last DM_flags_layout2,6 ; =1: last gas needs were computed for cave mode, =0: vertical ascent |
643 #DEFINE tts_greater_99 DM_flags_layout2,7 ; =1: TTS > 99 minutes | 637 #DEFINE tts_over_99_last DM_flags_layout2,7 ; =1: last TTS was > 99 minutes |
644 | 638 |
645 #DEFINE tissue_graphic_layout DM_flags_layout3,0 ; =1: show pres+sat, =0: show N2/He pressures | 639 #DEFINE tissue_graphic_layout DM_flags_layout3,0 ; =1: show pres+sat, =0: show N2/He pressures |
646 #DEFINE tissue_graphic_gf DM_flags_layout3,1 ; =1: show GF lines | 640 #DEFINE tissue_graphic_gf DM_flags_layout3,1 ; =1: show GF lines |
647 #DEFINE tissue_graphic_cns DM_flags_layout3,2 ; =1: shwo CNS value (surface mode graphic only) | 641 #DEFINE tissue_graphic_cns DM_flags_layout3,2 ; =1: shwo CNS value (surface mode graphic only) |
648 #DEFINE tissue_graphic_mode DM_flags_layout3,3 ; =1: logbook mode (surface mode graphic only) | 642 #DEFINE tissue_graphic_mode DM_flags_layout3,3 ; =1: logbook mode (surface mode graphic only) |
650 ; DM_flags_layout3,5 ; --- unused | 644 ; DM_flags_layout3,5 ; --- unused |
651 ; DM_flags_layout3,6 ; --- unused | 645 ; DM_flags_layout3,6 ; --- unused |
652 ; DM_flags_layout3,7 ; --- unused | 646 ; DM_flags_layout3,7 ; --- unused |
653 | 647 |
654 | 648 |
655 ;---- Dive Mode - Display Control / Messages | |
656 #DEFINE message_advice DM_flags_message,0 ; =1: an advice is active in dive mode | |
657 #DEFINE message_attention DM_flags_message,1 ; =1: an attention is active in dive mode or surface mode | |
658 #DEFINE message_warning DM_flags_message,2 ; =1: a warning is active in dive mode or surface mode | |
659 #DEFINE message_2nd_row_used DM_flags_message,3 ; =1: the second row contains a warning/attention/advice | |
660 #DEFINE sign_shown DM_flags_message,4 ; =1: the warning/attention/advice sign is shown | |
661 #DEFINE gas_needs_attention DM_flags_message,5 ; =1: the gas needs attention has been shown before | |
662 #DEFINE gas_needs_warning DM_flags_message,6 ; =1: the gas needs warning has been shown before | |
663 #DEFINE o2_sensors_warning DM_flags_message,7 ; =1: the O2 sensors warning has been shown before | |
664 | |
665 ;---- Dive Mode - Display Control / Gas, Diluent, Depth | 649 ;---- Dive Mode - Display Control / Gas, Diluent, Depth |
666 #DEFINE better_gas_hint DM_flags_gas_dil,0 ; =1: mark a gas when it is a better gas | 650 #DEFINE better_gas_hint DM_flags_gas_dil,0 ; =1: mark a gas when it is a better gas |
667 #DEFINE color_code_gases DM_flags_gas_dil,1 ; =1: color code the gases by ppO2 & current depth | 651 #DEFINE color_code_gases DM_flags_gas_dil,1 ; =1: color code the gases by ppO2 & current depth |
668 #DEFINE better_gas_available DM_flags_gas_dil,2 ; =1: a better gas is available | 652 #DEFINE better_gas_available DM_flags_gas_dil,2 ; =1: a better gas is available |
669 #DEFINE better_gas_blinking DM_flags_gas_dil,3 ; =1: gas is blinking | 653 #DEFINE better_gas_blinking DM_flags_gas_dil,3 ; =1: gas is blinking |
670 #DEFINE better_dil_available DM_flags_gas_dil,4 ; =1: a better diluent is available | 654 #DEFINE better_dil_available DM_flags_gas_dil,4 ; =1: a better diluent is available |
671 #DEFINE better_dil_blinking DM_flags_gas_dil,5 ; =1: diluent is blinking | 655 #DEFINE better_dil_blinking DM_flags_gas_dil,5 ; =1: diluent is blinking |
672 #DEFINE gas6_or_EXIT DM_flags_gas_dil,6 ; =1: exit menu, =0: provide gas6 option | 656 #DEFINE gas6_or_EXIT DM_flags_gas_dil,6 ; =1: exit menu, =0: provide gas6 option |
673 #DEFINE depth_limit_exceeded DM_flags_gas_dil,7 ; =1: depth limit exceeded | 657 ; DM_flags_gas_dil,7 ; --- unused |
658 | |
659 | |
660 ;---- Dive Mode - Display Control / Messages | |
661 #DEFINE sign_shown DM_flags_message,0 ; =1: the warning/attention/advice sign is shown | |
662 #DEFINE sign_advice DM_flags_message,1 ; =1: the sign shown is an advice sign | |
663 #DEFINE sign_attention DM_flags_message,2 ; =1: the sign shown is an attention sign | |
664 #DEFINE sign_warning DM_flags_message,3 ; =1: the sign shown is a warning sign | |
665 #DEFINE message_2nd_row_used DM_flags_message,4 ; =1: the second row contains a warning/attention/advice | |
666 ; DM_flags_message,5 ; --- unused | |
667 ; DM_flags_message,6 ; --- unused | |
668 ; DM_flags_message,7 ; --- unused | |
669 | |
670 | |
671 ;---- Dive Mode - Display Control / Advices | |
672 #DEFINE advc_det_change_gas DM_flags_advc_det,0 ; =1: change gas advice | |
673 #DEFINE advc_det_switch_tank DM_flags_advc_det,1 ; =1: change tank advice | |
674 ; DM_flags_advc_det,2 ; --- unused | |
675 ; DM_flags_advc_det,3 ; --- unused | |
676 ; DM_flags_advc_det,4 ; --- unused | |
677 ; DM_flags_advc_det,5 ; --- unused | |
678 ; DM_flags_advc_det,6 ; --- unused | |
679 ; DM_flags_advc_det,7 ; --- unused | |
680 | |
681 | |
682 ;---- Dive Mode - Display Control / Attentions | |
683 #DEFINE attn_det_gas_needs DM_flags_att1_det,0 ; =1: gas needs attention threshold reached | |
684 #DEFINE attn_det_ppo2_breathed DM_flags_att1_det,1 ; =1: breathed ppO2 attention threshold reached | |
685 #DEFINE attn_det_ppo2_diluent DM_flags_att1_det,2 ; =1: diluent ppO2 attention threshold reached | |
686 #DEFINE attn_det_cns_current DM_flags_att1_det,3 ; =1: current CNS attention threshold reached | |
687 #DEFINE attn_det_gas_density DM_flags_att1_det,4 ; =1: gas density attention threshold reached | |
688 #DEFINE attn_det_saturation DM_flags_att1_det,5 ; =1: tissue saturation attention threshold reached | |
689 #DEFINE attn_det_outside DM_flags_att1_det,6 ; =1: outside model attention issued | |
690 #DEFINE attn_det_microbubble DM_flags_att1_det,7 ; =1: µ-bubble attention issued | |
691 | |
692 #DEFINE attn_det_sac_rate DM_flags_att2_det,0 ; =1: SAC rate attention threshold reached | |
693 #DEFINE attn_det_pressure1 DM_flags_att2_det,1 ; =1: tank 1 pressure attention threshold reached | |
694 #DEFINE attn_det_pressure2 DM_flags_att2_det,2 ; =1: tank 2 pressure attention threshold reached | |
695 #DEFINE attn_det_ibcd DM_flags_att2_det,3 ; =1: IBCD attention issued | |
696 #DEFINE attn_det_cave_shut_down DM_flags_att2_det,4 ; =1: cave mode shutdown attention issued | |
697 #DEFINE attn_det_sensor1_lost DM_flags_att2_det,5 ; =1: sensor 1 lost attention issued | |
698 #DEFINE attn_det_sensor2_lost DM_flags_att2_det,6 ; =1: sensor 2 lost attention issued | |
699 #DEFINE attn_det_sensor3_lost DM_flags_att2_det,7 ; =1: sensor 3 lost attention issued | |
700 | |
701 #DEFINE attn_det_xmit1_bat DM_flags_att3_det,0 ; =1: xmitter 1 low batt attention issued | |
702 #DEFINE attn_det_xmit2_bat DM_flags_att3_det,1 ; =1: xmitter 2 low batt attention issued | |
703 #DEFINE attn_det_cns_eod DM_flags_att3_det,2 ; =1: end-of-dive CNS attention threshold reached | |
704 ; DM_flags_att3_det,3 ; --- unused | |
705 ; DM_flags_att3_det,4 ; --- unused | |
706 ; DM_flags_att3_det,5 ; --- unused | |
707 ; DM_flags_att3_det,6 ; --- unused | |
708 ; DM_flags_att3_det,7 ; --- unused | |
709 | |
710 ;---- Dive Mode - Display Control / Warnings | |
711 #DEFINE warn_det_gas_needs DM_flags_war1_det,0 ; =1: gas needs warning threshold reached | |
712 #DEFINE warn_det_ppO2_breathed DM_flags_war1_det,1 ; =1: breathed ppO2 warning threshold reached | |
713 #DEFINE warn_det_ppO2_diluent DM_flags_war1_det,2 ; =1: diluent ppO2 warning threshold reached | |
714 #DEFINE warn_det_cns_current DM_flags_war1_det,3 ; =1: current CNS warning threshold reached | |
715 #DEFINE warn_det_gas_density DM_flags_war1_det,4 ; =1: gas density warning threshold reached | |
716 #DEFINE warn_det_saturation DM_flags_war1_det,5 ; =1: tissue saturation warning threshold reached | |
717 #DEFINE warn_det_outside DM_flags_war1_det,6 ; =1: outside model warning issued | |
718 #DEFINE warn_det_microbubble DM_flags_war1_det,7 ; =1: µ-bubble warning issued | |
719 | |
720 #DEFINE warn_det_cave_shut_down DM_flags_war2_det,0 ; =1: cave mode shutdown warning issued | |
721 #DEFINE warn_det_pressure1 DM_flags_war2_det,1 ; =1: tank pressure 1 warning threshold reached | |
722 #DEFINE warn_det_pressure2 DM_flags_war2_det,2 ; =1: tank pressure 2 warning threshold reached | |
723 #DEFINE warn_det_batt_low DM_flags_war2_det,3 ; =1: battery low warning issued | |
724 #DEFINE warn_det_depth_limit DM_flags_war2_det,4 ; =1: depth limit warning issued | |
725 #DEFINE warn_det_sensors_lost DM_flags_war2_det,5 ; =1: sensors lost warning issued | |
726 #DEFINE warn_det_sensors_div DM_flags_war2_det,6 ; =1: sensors divergence warning issued | |
727 #DEFINE warn_det_no_bo_gas DM_flags_war2_det,7 ; =1: no B/O gas avail warning issued | |
728 | |
729 | |
730 ;---- Dive Mode - Display Control / Custom View automatic show-up | |
731 #DEFINE shown_gas_needs_attn DM_flags_shown1,0 ; =1: gas needs attention has been shown before | |
732 #DEFINE shown_gas_needs_warn DM_flags_shown1,1 ; =1: gas needs warning has been shown before | |
733 #DEFINE shown_sensors_diverg DM_flags_shown1,2 ; =1: sensor divergence has been shown before | |
734 #DEFINE shown_sensors_lost DM_flags_shown1,3 ; =1: sensor all lost has been shown before | |
735 #DEFINE shown_sensor1_fail DM_flags_shown1,4 ; =1: sensor 1 failure has been shown before | |
736 #DEFINE shown_sensor2_fail DM_flags_shown1,5 ; =1: sensor 2 failure has been shown before | |
737 #DEFINE shown_sensor3_fail DM_flags_shown1,6 ; =1: sensor 3 failure has been shown before | |
738 ; DM_flags_shown1,7 ; --- unused | |
739 | |
740 #DEFINE shown_xmit1_lost DM_flags_shown2,0 ; =1: xmitter 1 lost has been shown before | |
741 #DEFINE shown_xmit1_battery DM_flags_shown2,1 ; =1: xmitter 1 batt low has been shown before | |
742 #DEFINE shown_xmit1_pres_warn DM_flags_shown2,2 ; =1: xmitter 1 pres warn has been shown before | |
743 #DEFINE shown_xmit1_pres_attn DM_flags_shown2,3 ; =1: xmitter 1 pres attn has been shown before | |
744 #DEFINE shown_xmit2_lost DM_flags_shown2,4 ; =1: xmitter 2 lost has been shown before | |
745 #DEFINE shown_xmit2_battery DM_flags_shown2,5 ; =1: xmitter 2 batt low has been shown before | |
746 #DEFINE shown_xmit2_pres_warn DM_flags_shown2,6 ; =1: xmitter 2 pres warn has been shown before | |
747 #DEFINE shown_xmit2_pres_attn DM_flags_shown2,7 ; =1: xmitter 2 pres attn has been shown before | |
748 | |
749 #DEFINE shown_gas_density_attn DM_flags_shown3,0 ; =1: gas density atten. has been shown before | |
750 #DEFINE shown_gas_density_warn DM_flags_shown3,1 ; =1: gas density warning has been shown before | |
751 ; DM_flags_shown3,2 ; --- unused | |
752 ; DM_flags_shown3,3 ; --- unused | |
753 ; DM_flags_shown3,4 ; --- unused | |
754 ; DM_flags_shown3,5 ; --- unused | |
755 ; DM_flags_shown3,6 ; --- unused | |
756 ; DM_flags_shown3,7 ; --- unused | |
757 | |
674 | 758 |
675 ;---- Menu System - Control | 759 ;---- Menu System - Control |
676 #DEFINE surfmode_menu MS_flags_control,0 ; =1: surface menu is shown (i.e. returning from it) | 760 #DEFINE surfmode_menu MS_flags_control,0 ; =1: surface menu is shown (i.e. returning from it) |
677 #DEFINE dive_options_menu MS_flags_control,1 ; =1: dive options menu is shown (e.g. "Menu?") | 761 #DEFINE dive_pre_menu MS_flags_control,1 ; =1: dive pre-menu is shown (e.g. "Menu?") |
678 #DEFINE dive_main_menu MS_flags_control,2 ; =1: dive mode menu is shown (i.e. the "big" menu) | 762 #DEFINE dive_main_menu MS_flags_control,2 ; =1: dive main menu is shown (i.e. the "big" menu) |
679 #DEFINE compass_menu MS_flags_control,3 ; =1: "set bearing" is shown | 763 #DEFINE compass_menu MS_flags_control,3 ; =1: "set bearing" is shown |
680 #DEFINE is_diluent_menu MS_flags_control,4 ; =1: setting up diluents, =0: setting up OC gases | 764 #DEFINE is_diluent_menu MS_flags_control,4 ; =1: setting up diluents, =0: setting up OC gases |
681 #DEFINE is_bailout_menu MS_flags_control,5 ; =1: in bailout menu | 765 #DEFINE is_bailout_menu MS_flags_control,5 ; =1: in bailout menu |
682 #DEFINE custom_view_locked MS_flags_control,6 ; =1: the custom view is locked (defer CV auto-popup) | 766 #DEFINE custom_view_locked MS_flags_control,6 ; =1: the custom view is locked (defer CV auto-popup) |
683 ; MS_flags_control,7 ; --- unused | 767 #DEFINE option_stop_at_max MS_flags_control,7 ; =1: option increment will stop at max value (no wrap around) |
684 | 768 |
685 ;---- Menu System - Data Imprinting | 769 ;---- Menu System - Data Imprinting |
686 #DEFINE imprint_time_date MS_flags_imprint,0 ; =1: imprint current time & date | 770 #DEFINE imprint_time_date MS_flags_imprint,0 ; =1: imprint current time & date |
687 #DEFINE imprint_color_schemes MS_flags_imprint,1 ; =1: imprint color schemes | 771 #DEFINE imprint_color_schemes MS_flags_imprint,1 ; =1: imprint color schemes |
688 #DEFINE imprint_sensor_mv MS_flags_imprint,2 ; =1: imprint O2 sensor mV data | 772 #DEFINE imprint_sensor_mv MS_flags_imprint,2 ; =1: imprint O2 sensor mV data |
689 #DEFINE imprint_xmitter_pres MS_flags_imprint,3 ; =1: imprint transmitter pressure data | 773 #DEFINE imprint_xmitter_pres MS_flags_imprint,3 ; =1: imprint transmitter pressure data |
690 #DEFINE imprint_xmitter_ID MS_flags_imprint,4 ; =1: in transmitter-to-tank pairing menu | 774 #DEFINE imprint_xmitter_ID MS_flags_imprint,4 ; =1: in transmitter-to-tank pairing menu |
691 #DEFINE imprint_surfmode_data MS_flags_imprint,5 ; =1: imprint surface mode data | 775 #DEFINE imprint_surfmode_data MS_flags_imprint,5 ; =1: imprint surface mode data |
692 #DEFINE block_option_value MS_flags_imprint,6 ; =1: suspend display of option values | 776 #DEFINE block_option_value MS_flags_imprint,6 ; =1: suspend displaying of option values |
693 ; MS_flags_imprint,7 ; --- unused | 777 #DEFINE short_gas_descriptions MS_flags_imprint,7 ; =1: use short versions of gaslist_strcat_gas_cd and gaslist_strcat_setpoint |
694 | 778 |
695 | 779 |
696 ;---- Font & Image System | 780 ;---- Font & Image System |
697 #DEFINE aa_antialias AA_flags,0 ; used by aa_wordprocessor | 781 #DEFINE aa_antialias AA_flags,0 ; used by aa_wordprocessor |
698 #DEFINE aa_color_quarter AA_flags,1 ; used by aa_wordprocessor | 782 #DEFINE aa_color_quarter AA_flags,1 ; used by aa_wordprocessor |
699 #DEFINE aa_color_half AA_flags,2 ; used by aa_wordprocessor | 783 #DEFINE aa_color_half AA_flags,2 ; used by aa_wordprocessor |
700 #DEFINE aa_aux_flag AA_flags,3 ; auxiliary flag for various purposes | 784 #DEFINE aa_aux_flag AA_flags,3 ; auxiliary flag for various purposes |
701 #DEFINE use_custom_colors AA_flags,4 ; =1: override default pixel colors, used by color_image | 785 #DEFINE use_custom_colors AA_flags,4 ; =1: override default pixel colors, used by color_image |
702 ; AA_flags,5 ; --- unused | 786 #DEFINE win_invert AA_flags,5 ; =1: print in inverse video |
703 ; AA_flags,6 ; --- unused | 787 ; AA_flags,6 ; --- unused |
704 ; AA_flags,7 ; --- unused | 788 ; AA_flags,7 ; --- unused |
705 | 789 |
706 | 790 |
707 ;---- Convert and Display Functions (Control of numerical and other Output) | 791 ;---- Convert Functions (Control of numerical Output) |
708 #DEFINE leftbind CVT_flags1,0 ; =1: align numbers to the left | 792 |
709 #DEFINE win_invert CVT_flags1,1 ; =1: the text shall be printed in inverse | 793 #DEFINE hide_digit5 CVT_flags1,0 ; =1: do not print digit 5 (clip output at 9999) |
710 #DEFINE short_gas_descriptions CVT_flags1,2 ; =1: use short versions of gaslist_strcat_gas_cd and gaslist_strcat_setpoint | 794 #DEFINE hide_digit4 CVT_flags1,1 ; =1: do not print digits 5-4 (clip output at 999) |
711 #DEFINE ignore_digit3 CVT_flags1,3 ; controls suppression of digits when printing numbers | 795 #DEFINE hide_digit3 CVT_flags1,2 ; =1: do not print digits 5-3 (clip output at 99) |
712 #DEFINE ignore_digit4 CVT_flags1,4 ; controls suppression of digits when printing numbers | 796 #DEFINE hide_digit2 CVT_flags1,3 ; =1: do not print digits 5-2 (clip output at 9) |
713 #DEFINE ignore_digit5 CVT_flags1,5 ; controls suppression of digits when printing numbers | 797 #DEFINE omit_digit_1 CVT_flags1,4 ; =1: do not print digit 1 (show output as xxxx-) |
798 #DEFINE omit_digit_2 CVT_flags1,5 ; =1: do not print digits 2-1 (show output as xxx--) | |
714 ; CVT_flags1,6 ; --- unused | 799 ; CVT_flags1,6 ; --- unused |
715 ; CVT_flags1,7 ; --- unused | 800 ; CVT_flags1,7 ; --- unused |
716 | 801 |
717 #DEFINE pre_zero_flag CVT_flags2,0 | 802 #DEFINE decimal_digit1 CVT_flags2,0 ; =1: put a decimal point in front of digit 1 |
718 #DEFINE all_zeros_flag CVT_flags2,1 | 803 #DEFINE decimal_digit2 CVT_flags2,1 ; =1: put a decimal point in front of digit 2 |
719 #DEFINE DP_done CVT_flags2,2 | 804 #DEFINE decimal_digit3 CVT_flags2,2 ; =1: put a decimal point in front of digit 3 |
720 #DEFINE DP_done2 CVT_flags2,3 | 805 ; CVT_flags2,3 ; --- unused |
721 #DEFINE show_last3 CVT_flags2,4 | 806 #DEFINE leftbind CVT_flags2,4 ; =1: align output to the left (no leading spaces) |
722 #DEFINE leading_zeros CVT_flags2,5 | 807 #DEFINE leading_zeros CVT_flags2,5 ; =1: print leading zeros |
723 #DEFINE show_last4 CVT_flags2,6 | 808 #DEFINE output_overflow CVT_flags2,6 ; =1: the printed number is clipped to 9999/999/99/9 |
724 #DEFINE neg_flag CVT_flags2,7 ; =1: result is negative | 809 ; CVT_flags2,7 ; --- unused |
725 | 810 |
726 | 811 |
727 ;---- Miscellaneous Flags | 812 ;---- Miscellaneous Flags |
728 #DEFINE ignore_last_edited_gas misc_flags,0 ; =1: ignore last edited gas while cleaning up gas/dil list | 813 #DEFINE ignore_last_edited_gas misc_flags,0 ; =1: ignore last edited gas while cleaning up gas/dil list |
729 #DEFINE copying_dil misc_flags,1 ; =1: copying a diluent | 814 #DEFINE copying_dil misc_flags,1 ; =1: copying a diluent |
730 #DEFINE comm_service_mode misc_flags,2 ; =1: service mode (extended command set) is enabled | 815 #DEFINE comm_service_mode misc_flags,2 ; =1: service mode (extended command set) is enabled |
731 #DEFINE waypoint_reached_first misc_flags,3 ; =1: the first (most outside) waypoint is reached (cave mode) | 816 #DEFINE waypoint_reached_first misc_flags,3 ; =1: the first (most outside) waypoint is reached (cave mode) |
732 #DEFINE waypoint_reached_last misc_flags,4 ; =1: the last (most inside) waypoint is reached (cave mode) | 817 #DEFINE waypoint_reached_last misc_flags,4 ; =1: the last (most inside) waypoint is reached (cave mode) |
733 #DEFINE option_repaired misc_flags,5 ; =1: option value was set to default | 818 #DEFINE option_value_ok misc_flags,5 ; =1: option value was checked to be within min/max limits |
734 #DEFINE flash_wait misc_flags,6 ; =1: wait for flash write operation to complete | 819 #DEFINE aux_flag misc_flags,6 ; local flag, used in various places |
735 #DEFINE aux_flag misc_flags,7 ; local flag, used in various places | 820 #DEFINE neg_flag misc_flags,7 ; =1: result is negative |
821 | |
736 | 822 |
737 ;---- HUD Status Byte (stored in access RAM) | 823 ;---- HUD Status Byte (stored in access RAM) |
738 #DEFINE hud_connection_ok hud_status_byte,0 ; =1 HUD connection ok | 824 #DEFINE hud_connection_ok hud_status_byte,0 ; =1 HUD connection ok |
739 ; hud_status_byte,1 ; =1 HUD is calibrated | 825 ; hud_status_byte,1 ; =1 HUD is calibrated |
740 ; hud_status_byte,2 ; =1 HUD battery is low (< 3000 mV) | 826 ; hud_status_byte,2 ; =1 HUD battery is low (< 3000 mV) |
743 #DEFINE sensor3_active hud_status_byte,5 ; =1: sensor 3 is active | 829 #DEFINE sensor3_active hud_status_byte,5 ; =1: sensor 3 is active |
744 ; hud_status_byte,6 ; --- unused in stand-alone HUD | 830 ; hud_status_byte,6 ; --- unused in stand-alone HUD |
745 ; hud_status_byte,7 ; --- unused in stand-alone HUD | 831 ; hud_status_byte,7 ; --- unused in stand-alone HUD |
746 | 832 |
747 | 833 |
748 ;---------------------------- Macros ------------------------------------ | 834 ;----------------------------------------------------------------------------- |
749 | 835 ; Macros |
750 | 836 ;----------------------------------------------------------------------------- |
751 ; ---- options checking ---- | 837 |
838 ; ---- options checking | |
752 | 839 |
753 TSTOSS macro opt_reg ; TeST Option Skip next instruction if Set (not zero) | 840 TSTOSS macro opt_reg ; TeST Option Skip next instruction if Set (not zero) |
754 movff opt_reg,EEDATA ; Attention: destroys EEDATA! | 841 movff opt_reg,EEDATA ; Attention: destroys EEDATA! |
755 tstfsz EEDATA,A ; Attention: must be followed by a plain machine | 842 tstfsz EEDATA,A ; Attention: must be followed by a plain machine |
756 bra $+4 ; command, do not let follow a macro! | 843 bra $+4 ; command, do not let follow a macro! |
760 movff opt_reg,EEDATA ; Attention: destroys EEDATA! | 847 movff opt_reg,EEDATA ; Attention: destroys EEDATA! |
761 tstfsz EEDATA,A ; Attention: must be followed by a plain machine | 848 tstfsz EEDATA,A ; Attention: must be followed by a plain machine |
762 endm ; command, do not let follow a macro! | 849 endm ; command, do not let follow a macro! |
763 | 850 |
764 | 851 |
765 ; ---- literal operations ---- | 852 ; ---- literal operations |
766 | 853 |
767 CLRI macro address ; CLeaR Integer (version of clrf for 2 byte integers) | 854 CLRI macro address ; CLeaR Integer (version of clrf for 2 byte integers) |
768 clrf address+0 ; Attention: must be in bank where target variable resides! | 855 clrf address+0 ; Attention: must be in bank where target variable resides! |
769 clrf address+1 ; | 856 clrf address+1 ; |
770 endm ; | 857 endm ; |
793 movlw HIGH (literal) ; | 880 movlw HIGH (literal) ; |
794 movwf address+1 ; | 881 movwf address+1 ; |
795 endm ; | 882 endm ; |
796 | 883 |
797 | 884 |
798 ; ---- arithetics ---- | 885 ; ---- arithetics |
799 | 886 |
800 INCI macro address ; INCrement Integer (version of incf for 2 byte integers) | 887 INCI macro address ; INCrement Integer (version of incf for 2 byte integers) |
801 infsnz address+0,F ; Attention: must be in bank where target variable resides! | 888 infsnz address+0,F ; Attention: must be in bank where target variable resides! |
802 incf address+1,F ; | 889 incf address+1,F ; |
803 endm ; | 890 endm ; |
822 movlw HIGH (literal) ; | 909 movlw HIGH (literal) ; |
823 subwfb address+1,F ; | 910 subwfb address+1,F ; |
824 endm ; | 911 endm ; |
825 | 912 |
826 | 913 |
827 ; ---- moves ---- | 914 ; ---- moves |
828 | 915 |
829 MOVCC macro from,to ; MOVe 1 byte Char (actually an alias for movff) | 916 MOVCC macro from,to ; MOVe 1 byte Char (actually an alias for movff) |
830 movff from,to | 917 movff from,to |
831 endm | 918 endm |
832 | 919 |
848 extern memory_move | 935 extern memory_move |
849 call memory_move | 936 call memory_move |
850 endm | 937 endm |
851 | 938 |
852 | 939 |
853 ; ---- ISR-safe moves ---- | 940 ; ---- ISR-safe moves |
854 | 941 |
855 SMOVII macro from, to ; isr-Safe MOVe 2 byte Integer (version of MOVII for ISR-safe copying) | 942 SMOVII macro from, to ; isr-Safe MOVe 2 byte Integer (version of MOVII for ISR-safe copying) |
856 local retry ; | 943 local retry ; |
857 retry: | 944 retry: |
858 bcf trigger_isr_updates ; clear flag, it will be set by the ISR in case it had kicked in | 945 bcf trigger_isr_updates ; clear flag, it will be set by the ISR in case it had kicked in |
898 btfsc trigger_isr_updates ; did the ISR kicked in since we cleared the flag? | 985 btfsc trigger_isr_updates ; did the ISR kicked in since we cleared the flag? |
899 bra retry ; YES - retry copy | 986 bra retry ; YES - retry copy |
900 endm ; NO - done | 987 endm ; NO - done |
901 | 988 |
902 | 989 |
903 ;---------------------------- C-Code Routines ---------------------------- | 990 ;----------------------------------------------------------------------------- |
991 ; C-Code Routines | |
992 ;----------------------------------------------------------------------------- | |
904 | 993 |
905 extern deco_calc_desaturation_time | 994 extern deco_calc_desaturation_time |
906 extern deco_calc_hauptroutine | 995 extern deco_calc_hauptroutine |
907 extern deco_calc_dive_interval | 996 extern deco_calc_dive_interval |
908 extern deco_calc_dive_interval_1min | 997 extern deco_calc_dive_interval_1min |
911 extern deco_init_output_vars | 1000 extern deco_init_output_vars |
912 extern deco_pull_tissues_from_vault | 1001 extern deco_pull_tissues_from_vault |
913 extern deco_push_tissues_to_vault | 1002 extern deco_push_tissues_to_vault |
914 | 1003 |
915 | 1004 |
916 ;---------------------------- Bank0 ACCESS RAM ------------------------------ | 1005 ;----------------------------------------------------------------------------- |
1006 ; Bank0 ACCESS RAM | |
1007 ;----------------------------------------------------------------------------- | |
917 | 1008 |
918 ; Variables located in the Access Bank are declared in hwos.asm | 1009 ; Variables located in the Access Bank are declared in hwos.asm |
919 | 1010 |
920 ifndef ACCESS_RAM_VARS | 1011 ifndef INSIDE_HWOS_ASM |
921 | 1012 |
922 extern HW_descriptor | 1013 extern HW_descriptor |
923 extern HW_variants | 1014 extern HW_variants |
924 | 1015 |
925 extern HW_flags_state1 | 1016 extern HW_flags_state1 |
957 extern simulatormode_depth | 1048 extern simulatormode_depth |
958 | 1049 |
959 extern hud_status_byte | 1050 extern hud_status_byte |
960 extern hud_battery_mv | 1051 extern hud_battery_mv |
961 | 1052 |
1053 extern battery_capacity_internal | |
1054 extern battery_capacity | |
1055 extern battery_offset | |
1056 extern battery_type | |
1057 extern battery_accumulated_charge | |
1058 extern battery_temperature | |
1059 extern gauge_status_byte | |
1060 | |
962 endif ; ACCESS_RAM_VARS | 1061 endif ; ACCESS_RAM_VARS |
963 | 1062 |
964 ;---------------------------- Bank0 NORMAL RAM ------------------------------ | 1063 ;----------------------------------------------------------------------------- |
1064 ; Bank0 NORMAL RAM | |
1065 ;----------------------------------------------------------------------------- | |
1066 | |
965 isr_backup equ 0x060 ; Alias for "banksel isr_backup" | 1067 isr_backup equ 0x060 ; Alias for "banksel isr_backup" |
966 isr_backup udata_ovr isr_backup ; Bank 0 ISR data | 1068 isr_backup udata_ovr isr_backup ; Bank 0 ISR data |
967 | 1069 |
968 ;---- Backup for general Registers, used by ISR Routines | 1070 ;---- Backup for general Registers, used by ISR Routines |
969 PROD_backup res 2 | 1071 PROD_backup res 2 |
1086 pressure_rel_max_trip res 2 ; resettable maximum relative pressure | 1188 pressure_rel_max_trip res 2 ; resettable maximum relative pressure |
1087 ENDIF | 1189 ENDIF |
1088 | 1190 |
1089 ; 143 byte used, 17 byte free | 1191 ; 143 byte used, 17 byte free |
1090 | 1192 |
1091 | 1193 |
1092 ;---------------------------- Common DATA ------------------------------------ | 1194 ;----------------------------------------------------------------------------- |
1195 ; Common DATA | |
1196 ;----------------------------------------------------------------------------- | |
1197 | |
1093 common equ 0x100 ; Alias for "banksel common" | 1198 common equ 0x100 ; Alias for "banksel common" |
1094 common udata_ovr common ; Bank 1 general variables | 1199 common udata_ovr common ; Bank 1 general variables |
1095 | 1200 |
1096 ;---- Multi-Purpose Register for Data Storage and Interface with Conversion and Display Functions (6 byte) | 1201 ;---- Multi-Purpose Register for Data Storage and Interface with Conversion and Display Functions (6 byte) |
1097 mpr res 6 ; will be used as base address of 1, 2, 3, 4 and 6 byte buffers | 1202 mpr res 6 ; will be used as base address of 1, 2, 3, 4 and 6 byte buffers |
1105 | 1210 |
1106 ;---- Flags - Menu System (2 byte) | 1211 ;---- Flags - Menu System (2 byte) |
1107 MS_flags_control res 1 ; menu system - control | 1212 MS_flags_control res 1 ; menu system - control |
1108 MS_flags_imprint res 1 ; menu system - data imprinting | 1213 MS_flags_imprint res 1 ; menu system - data imprinting |
1109 | 1214 |
1110 ;---- Flags - Dive Mode (9 byte) | 1215 ;---- Flags - Dive Mode (21 byte) |
1111 DM_flags_state res 1 ; dive mode - dive states | 1216 DM_flags_state res 1 ; dive mode - dive states |
1112 DM_flags_sensor res 1 ; dive mode - O2 sensors | 1217 DM_flags_sensor res 1 ; dive mode - O2 sensors |
1113 DM_flags_request res 1 ; dive mode - user requests / general | 1218 DM_flags_request res 1 ; dive mode - user requests / general |
1114 DM_flags_event res 1 ; dive mode - data recording events | 1219 DM_flags_event res 1 ; dive mode - data recording events |
1115 DM_flags_layout1 res 1 ; dive mode - display control / layout (1) | 1220 DM_flags_layout1 res 1 ; dive mode - display control / layout (1) |
1116 DM_flags_layout2 res 1 ; dive mode - display control / layout (2) | 1221 DM_flags_layout2 res 1 ; dive mode - display control / layout (2) |
1117 DM_flags_layout3 res 1 ; dive mode - display control / layout (3) | 1222 DM_flags_layout3 res 1 ; dive mode - display control / layout (3) |
1118 DM_flags_message res 1 ; dive mode - display control / messages | 1223 DM_flags_message res 1 ; dive mode - display control / messages |
1119 DM_flags_gas_dil res 1 ; dive mode - display control / gas, diluent | 1224 DM_flags_gas_dil res 1 ; dive mode - display control / gas, diluent |
1225 DM_flags_advc_det res 1 ; dive mode - advices detected | |
1226 DM_flags_advc_ack res 1 ; dive mode - advices acknowledged | |
1227 DM_flags_att1_det res 1 ; dive mode - attentions detected (1) | |
1228 DM_flags_att2_det res 1 ; dive mode - attentions detected (2) | |
1229 DM_flags_att3_det res 1 ; dive mode - attentions detected (3) | |
1230 DM_flags_att1_ack res 1 ; dive mode - attentions acknowledged (1) | |
1231 DM_flags_att2_ack res 1 ; dive mode - attentions acknowledged (2) | |
1232 DM_flags_att3_ack res 1 ; dive mode - attentions acknowledged (3) | |
1233 DM_flags_war1_det res 1 ; dive mode - warnings detected (1) | |
1234 DM_flags_war2_det res 1 ; dive mode - warnings detected (2) | |
1235 DM_flags_war1_ack res 1 ; dive mode - warnings acknowledged (1) | |
1236 DM_flags_war2_ack res 1 ; dive mode - warnings acknowledged (2) | |
1237 DM_flags_shown1 res 1 ; dive mode - custom views shown (1) | |
1238 DM_flags_shown2 res 1 ; dive mode - custom views shown (2) | |
1239 DM_flags_shown3 res 1 ; dive mode - custom views shown (3) | |
1120 | 1240 |
1121 ;---- Miscellaneous Flags (1 byte) | 1241 ;---- Miscellaneous Flags (1 byte) |
1122 misc_flags res 1 | 1242 misc_flags res 1 |
1123 | 1243 |
1124 ;---- Interface to numerical Display Functions (1 byte) | 1244 ;---- Interface to Graphic Functions (11 byte) |
1125 ignore_digits res 1 | |
1126 | |
1127 ;---- Interface to Graphic Functions (12 byte) | |
1128 win_leftx2 res 1 | 1245 win_leftx2 res 1 |
1129 win_top res 1 | 1246 win_top res 1 |
1130 win_width res 2 | 1247 win_width res 2 |
1131 win_height res 1 | 1248 win_height res 1 |
1132 win_bargraph res 1 ; width of the bargraph bar | 1249 win_bargraph res 1 ; width of the bargraph bar |
1133 win_color1 res 1 ; 2 byte color | 1250 win_color1 res 1 ; 2 byte color |
1134 win_color2 res 1 ; 2 byte color | 1251 win_color2 res 1 ; 2 byte color |
1135 win_color3 res 1 ; 3 byte color used for display 2 | 1252 win_color3 res 1 ; 3 byte color used for display 2 |
1136 win_color4 res 1 ; 3 byte color used for display 2 | 1253 win_color4 res 1 ; 3 byte color used for display 2 |
1137 win_color5 res 1 ; 3 byte color used for display 2 | 1254 win_color5 res 1 ; 3 byte color used for display 2 |
1138 win_font res 1 ; font size selector | |
1139 | 1255 |
1140 ;---- Interface to Math Functions (16 byte) | 1256 ;---- Interface to Math Functions (16 byte) |
1141 divA res 2 | 1257 divA res 2 |
1142 xA res 2 | 1258 xA res 2 |
1143 xB res 2 | 1259 xB res 2 |
1157 batt_voltage res 2 ; battery voltage in mV (no ISR involved) | 1273 batt_voltage res 2 ; battery voltage in mV (no ISR involved) |
1158 batt_percent res 1 ; battery in percent (1-100%) | 1274 batt_percent res 1 ; battery in percent (1-100%) |
1159 message_counter res 1 ; counts amount of messages | 1275 message_counter res 1 ; counts amount of messages |
1160 message_page res 1 ; current message page number | 1276 message_page res 1 ; current message page number |
1161 pairing_slot res 1 ; slot number, used in transmitter pairing | 1277 pairing_slot res 1 ; slot number, used in transmitter pairing |
1278 | |
1162 | 1279 |
1163 ;---- Dive Mode / all modes (26 byte) | 1280 ;---- Dive Mode / all modes (26 byte) |
1164 divesecs_avg_trip res 2 ; time accumulator for the resettable average depth & stopwatch | 1281 divesecs_avg_trip res 2 ; time accumulator for the resettable average depth & stopwatch |
1165 divesecs_avg_total res 2 ; time accumulator for the total dive average depth | 1282 divesecs_avg_total res 2 ; time accumulator for the total dive average depth |
1166 pressure_rel_avg_trip res 2 ; calculated resettable average depth | 1283 pressure_rel_avg_trip res 2 ; calculated resettable average depth |
1189 ENDIF | 1306 ENDIF |
1190 | 1307 |
1191 ;---- Dive Mode / apnoe mode (2 byte) | 1308 ;---- Dive Mode / apnoe mode (2 byte) |
1192 apnoe_max_pressure res 2 ; max depth over all dives in the series | 1309 apnoe_max_pressure res 2 ; max depth over all dives in the series |
1193 | 1310 |
1194 ;---- Gas 6 Data (2 byte) | |
1195 gas6_O2_ratio res 1 ; gas 6 O2 ratio | |
1196 IFDEF _helium | |
1197 gas6_He_ratio res 1 ; gas 6 He ratio | |
1198 ENDIF | |
1199 | |
1200 ;---- Profile Recording (6 byte) | 1311 ;---- Profile Recording (6 byte) |
1201 alarm_type res 1 ; | 1312 alarm_type res 1 ; alarm states recording |
1202 event_byte1 res 1 ; | 1313 event_byte1 res 1 ; events recording |
1203 event_byte2 res 1 ; | 1314 event_byte2 res 1 ; events recording |
1204 CNS_start res 2 ; CNS value at beginning of dive | 1315 CNS_start res 2 ; CNS value at beginning of dive |
1205 | 1316 |
1206 ;---- External Flash (14 byte) | 1317 ;---- External Flash (14 byte) |
1207 ext_flash_address res 3 ; 24 bit address | 1318 ext_flash_address res 3 ; 24 bit address |
1208 ext_flash_length_counter res 3 ; 24 bit length counter | 1319 ext_flash_length_counter res 3 ; 24 bit length counter |
1209 ext_flash_log_pointer res 3 ; 24 bit address for logbook profile storing | 1320 ext_flash_log_pointer res 3 ; 24 bit address for logbook profile storing |
1210 ext_flash_end_pointer res 3 ; 24 bit address for logbook profile storing | 1321 ext_flash_end_pointer res 3 ; 24 bit address for logbook profile storing |
1211 ext_flash_rw res 1 ; transfer register for data read / write | 1322 ext_flash_rw res 1 ; transfer register for data read / write |
1212 ext_flash_rollover_threshold res 1 ; rollover threshold for address increment operations | 1323 ext_flash_address_limit res 1 ; wrap-around threshold while address incrementing |
1213 | 1324 |
1214 ;---- Battery Management (12 byte) | 1325 |
1215 battery_capacity_internal res 2 ; for internal battery gauging | 1326 ;------------------------------------------------------------------------------- |
1216 battery_capacity res 2 ; for battery gauge IC | 1327 ; private Variables - do not access from outside of the respective source files! |
1217 battery_offset res 2 ; for battery gauge IC | 1328 ;------------------------------------------------------------------------------- |
1218 battery_type res 1 ; =0:1.5V, =1:3.6V Saft, =2:LiIon 3.7V/0.8Ah, =3:LiIon 3.7V/3.1Ah, =4: LiIon 3.7V/2.3Ah | 1329 |
1219 battery_accumulated_charge res 2 ; raw values in battery gauge IC | 1330 ;---- aa_wordprocessor.asm, strings.asm & Co. |
1220 battery_temperature res 2 ; battery temperature in 0.1 Kelvin | |
1221 gauge_status_byte res 1 ; gauge IC status byte | |
1222 | |
1223 | |
1224 ;========================= private Variables =================================== | |
1225 ; do not access from outside of the respective source files! | |
1226 | |
1227 ;---- aa_wordprocessor.asm and strings.asm | |
1228 AA_flags res 1 ; various flags for aa_wordprocessor and strings | 1331 AA_flags res 1 ; various flags for aa_wordprocessor and strings |
1229 aa_bitlen res 1 ; count of pixels when decoding bitmaps | 1332 aa_bitlen res 1 ; count of pixels when decoding bitmaps |
1230 aa_start res 2 ; PROM pointer to start of encoded bitmap | 1333 aa_start res 2 ; PROM pointer to start of encoded bitmap |
1231 aa_end res 2 ; and end of it | 1334 aa_end res 2 ; and end of it |
1232 aa_temp res 2 ; current color, divided by 2 or 4 | 1335 aa_temp res 2 ; current color, divided by 2 or 4 |
1336 font_color res 1 ; selected font color | |
1337 font_size res 1 ; selected font size | |
1338 pallet_color_mask res 1 ; pallet color - mask | Attention: | |
1339 pallet_color_disabled res 1 ; pallet color - disabled | do not change | |
1340 pallet_color_memo res 1 ; pallet color - memo | the relative | |
1341 pallet_color_advice res 1 ; pallet color - advice | position of | |
1342 pallet_color_attention res 1 ; pallet color - attention | these vars! | |
1343 pallet_color_warning res 1 ; pallet color - warning | | |
1344 | |
1233 | 1345 |
1234 ;--- adc_lightsensor.asm | 1346 ;--- adc_lightsensor.asm |
1235 get_bat_volt_counter res 1 ; counter for reading the charger chip | 1347 get_bat_volt_counter res 1 ; counter for reading the charger chip |
1236 | 1348 |
1237 ;---- convert.asm | 1349 ;---- convert.asm |
1238 CVT_flags1 res 1 | 1350 CVT_flags1 res 1 |
1239 CVT_flags2 res 1 | 1351 CVT_flags2 res 1 |
1240 cvt_temp1 res 1 | 1352 bcd_lo res 1 |
1241 cvt_temp2 res 1 | 1353 bcd_hi res 1 |
1242 cvt_temp3 res 1 | 1354 bcd_up res 1 |
1243 cvt_temp4 res 1 | 1355 bin_lo res 1 |
1244 cvt_temp_lo res 1 | 1356 bin_hi res 1 |
1245 cvt_temp_hi res 1 | |
1246 | 1357 |
1247 ;---- color_processor.asm | 1358 ;---- color_processor.asm |
1248 overall_pixels res 3 ; used by color_processor.asm | 1359 overall_pixels res 3 ; used by color_processor.asm |
1249 pixel_count res 2 ; used by color_processor.asm | 1360 pixel_count res 2 ; used by color_processor.asm |
1250 encoding_format res 1 ; image encoding format | 1361 encoding_format res 1 ; image encoding format |
1255 ;---- comm.asm | 1366 ;---- comm.asm |
1256 comm_timeout_timer res 1 ; timeout for communication | 1367 comm_timeout_timer res 1 ; timeout for communication |
1257 | 1368 |
1258 ;---- eeprom_rs232.asm | 1369 ;---- eeprom_rs232.asm |
1259 eeprom_loop res 1 ; loop counter (actually used in flash and serial, too) | 1370 eeprom_loop res 1 ; loop counter (actually used in flash and serial, too) |
1260 rx_timoeut_tmr5h_load res 1 ; TMR5H load value for RS232 RX timeout | 1371 rx_timeout_tmr5h_load res 1 ; TMR5H load value for RS232 RX timeout |
1261 | 1372 |
1262 ;---- i2c.asm | 1373 ;---- i2c.asm |
1263 i2c_temp1 res 1 ; temporary data | 1374 i2c_temp1 res 1 ; temporary data |
1264 i2c_temp2 res 1 ; temporary data | 1375 i2c_temp2 res 1 ; temporary data |
1265 | 1376 |
1266 ;---- math.asm | 1377 ;---- math.asm |
1267 math_loop res 1 ; loop counter | 1378 math_loop res 1 ; loop counter |
1268 | 1379 |
1269 ;---- menu_processor.asm | 1380 ;---- menu_processor.asm |
1270 menustack_pointer res 1 ; pointer to menu stack | 1381 menustack_pointer res 1 ; pointer to menu stack |
1271 menu_flags res 1 ; flags for menu entries | 1382 menu_item_start res 1 ; index of the first menu item (scrolling) |
1272 menu_item res 1 ; index of the current item | 1383 menu_item_curr res 1 ; index of the current menu item (loop counter) |
1273 start_item res 1 ; index of the first item (scrolling) | 1384 menu_item_count res 1 ; total number of menu items |
1274 item_max res 1 ; number of items in menu | |
1275 selected_item res 1 ; index of the current item | 1385 selected_item res 1 ; index of the current item |
1276 value_type res 1 ; type for vertical menu | 1386 menu_title_addr res 2 ; address of the multi-lingual menu titel |
1277 dynamic_item res 3 ; callback address | 1387 menu_item_data_start res 3 ; base address of the menu item data blocks |
1278 menu_block res 3 ; address of the menu block (i.e. item 0) | 1388 menu_vertical_start res 1 ; vertical start position of 1st menu item |
1279 menu_title res 3 ; text or procedure for dynamic menu | 1389 item_type res 1 ; type of the menu item |
1280 menu_center res 1 ; centering for line menu | 1390 item_title_addr res 2 ; address of item title function or title text |
1281 proc_item res 3 ; address of the current procedure | 1391 item_funct_addr res 2 ; address of item call function or option definition data |
1282 text_item res 2 ; address of the current text | 1392 |
1283 | 1393 |
1284 ;---- options.asm | 1394 ;---- options.asm |
1285 #DEFINE opt_definiton_bytes .12 ; | Attention: do not change the relative position of these vars! | 1395 #DEFINE opt_definition_bytes .12 ; | Attention: do not change the relative position of these vars! |
1286 opt_type res 1 ; | option type | 1396 opt_type res 1 ; | option type |
1287 opt_serial res 1 ; | index used for option read/write via RS232 | 1397 opt_serial res 1 ; | index used for option read/write via RS232 |
1288 opt_inc res 1 ; | increment value, also used for enum low and string default+1 | 1398 opt_inc res 1 ; | increment value, also used for enum low and low (pointer to default string) |
1289 opt_min res 1 ; | minimum value, also used for enum high | 1399 opt_min res 1 ; | minimum value, also used for enum high and high(pointer to default string) |
1290 opt_max res 1 ; | maximum value | 1400 opt_max res 1 ; | maximum value, also used for length( default string) |
1291 opt_default res 1 ; | default value | 1401 opt_default res 1 ; | default value |
1292 opt_unit res 2 ; | pointer to multi-lingual unit text | 1402 opt_unit res 2 ; | pointer to multi-lingual unit text |
1293 opt_memory res 2 ; | pointer to memory position | 1403 opt_memory res 2 ; | pointer to memory position |
1294 opt_eeprom_index res 1 ; | pointer to EEPROM position (index) | 1404 opt_eeprom_index res 1 ; | pointer to EEPROM position (index) |
1295 opt_eeprom_bank res 1 ; | pointer to EEPROM position (bank) | 1405 opt_eeprom_bank res 1 ; | pointer to EEPROM position (bank) |
1315 ENDIF | 1425 ENDIF |
1316 | 1426 |
1317 ;---- wait.asm | 1427 ;---- wait.asm |
1318 wait_counter res 1 | 1428 wait_counter res 1 |
1319 | 1429 |
1320 | 1430 ;---- tft_outputs.asm |
1321 ; 201 byte used, 7 byte free (208 byte total) | 1431 pressure_update_lag_counter res 1 ; lag time counter for fast surface pressure display updating |
1322 | 1432 |
1323 | 1433 |
1324 ;============================ LOCAL DATA ====================================== | 1434 ; 200 byte used, 8 byte free (208 byte total) |
1435 | |
1436 | |
1437 ;----------------------------------------------------------------------------- | |
1438 ; LOCAL DATA | |
1439 ;----------------------------------------------------------------------------- | |
1440 | |
1325 ; Space for various overlayed local data from top-level applications, | 1441 ; Space for various overlayed local data from top-level applications, |
1326 ; i.e. applications that never run in parallel to each other | 1442 ; i.e. applications that never run in parallel to each other |
1327 ; | 1443 |
1328 ; --------------------- local Data Users -------------------------------------- | 1444 ; --------------------- local Data Users -------------------------------------- |
1329 ; | 1445 ; |
1330 ; -------------- Applications using ---------------------- | 1446 ; -------------- Applications using ---------------------- |
1331 ; Mode local1 local2 local3 | 1447 ; Mode local1 local2 local3 |
1332 ; ----------------------------------------------------------------------------- | 1448 ; -------------------------------------------------------------------------- |
1333 ; sleepmode sleepmode.asm (unused) (unused) | 1449 ; sleepmode sleepmode.asm (unused) (unused) |
1334 ; surfmode surfmode.asm* (unused) (unused) | 1450 ; surfmode surfmode.asm* (unused) (unused) |
1335 ; simulator divemode.asm divemode.asm simulator.asm | 1451 ; simulator divemode.asm divemode.asm simulator.asm |
1336 ; divemode divemode.asm divemode.asm ghostwriter.asm | 1452 ; divemode divemode.asm divemode.asm ghostwriter.asm |
1337 ; logbook logbook.asm logbook.asm logbook.asm | 1453 ; logbook logbook.asm logbook.asm logbook.asm |
1349 local3 equ 0x1F0 ; Alias for CBLOCK directive | 1465 local3 equ 0x1F0 ; Alias for CBLOCK directive |
1350 local3 udata_ovr 0x1F0 ; Bank1 shared local space | 1466 local3 udata_ovr 0x1F0 ; Bank1 shared local space |
1351 res 0x10 ; 16 Byte (0x1F0 ... 0x1FF) | 1467 res 0x10 ; 16 Byte (0x1F0 ... 0x1FF) |
1352 | 1468 |
1353 | 1469 |
1354 ;---------------------------- Common2 DATA ------------------------------------ | 1470 ;----------------------------------------------------------------------------- |
1471 ; Common2 DATA | |
1472 ;----------------------------------------------------------------------------- | |
1473 | |
1355 common2 equ 0xA00 ; Alias for "banksel common2" | 1474 common2 equ 0xA00 ; Alias for "banksel common2" |
1356 common2 udata_ovr common2 ; Bank 10 general variables | 1475 common2 udata_ovr common2 ; Bank 10 general variables |
1357 | 1476 |
1358 ;---- Data for Logging (6 byte), sampled in divemode.asm and used in ghostwriter.asm | 1477 ;---- Data for Logging (6 byte), sampled in divemode.asm and used in ghostwriter.asm |
1359 start_year res 1 ; year | ATTENTION: | 1478 start_year res 1 ; year | ATTENTION: |
1442 pres_last_2nd res 2 ; last pressure reading pressure in 1/160 bar | other! | 1561 pres_last_2nd res 2 ; last pressure reading pressure in 1/160 bar | other! |
1443 time_last_1st res 2 ; last pressure reading time in seconds | | 1562 time_last_1st res 2 ; last pressure reading time in seconds | |
1444 time_last_2nd res 2 ; last pressure reading time in seconds | | 1563 time_last_2nd res 2 ; last pressure reading time in seconds | |
1445 ENDIF | 1564 ENDIF |
1446 | 1565 |
1447 | |
1448 ; 156 byte used, 100 byte free | 1566 ; 156 byte used, 100 byte free |
1449 | 1567 |
1450 | 1568 |
1451 ;----------------------- Bank 2 General Purpose Buffer 1 ----------------------- | 1569 ;----------------------------------------------------------------------------- |
1452 ; general purpose buffer no.1 | 1570 ; Bank 2 General Purpose Buffer 1 |
1453 ; | 1571 ;----------------------------------------------------------------------------- |
1572 | |
1454 ; NOTE: needs to be aligned with a bank (low(buffer)=0) | 1573 ; NOTE: needs to be aligned with a bank (low(buffer)=0) |
1455 | 1574 |
1456 buffer udata_ovr 0x200 | 1575 buffer udata_ovr 0x200 |
1457 buffer res .256 ; buffer 1 - string buffer, etc. | 1576 buffer res .256 ; buffer 1 - string buffer, etc. |
1458 | 1577 |
1459 | 1578 |
1460 ;----------------------- Bank 11 General Purpose Buffer 2 ---------------------- | 1579 ;----------------------------------------------------------------------------- |
1461 ; general purpose buffer no. 2 | 1580 ; Bank 11 General Purpose Buffer 2 |
1581 ;----------------------------------------------------------------------------- | |
1582 | |
1583 ; NOTE: needs to be aligned with a bank (low(buffer)=0) | |
1462 ; | 1584 ; |
1463 ; NOTE: needs to be aligned with a bank (low(buffer)=0) | |
1464 | |
1465 ; Remark: this memory block is already allocated in shared_definitions.h for | 1585 ; Remark: this memory block is already allocated in shared_definitions.h for |
1466 ; use while in dive mode, so we need to make a hard reference here | 1586 ; use while in dive mode, so we need to make a hard reference here |
1467 ; | 1587 |
1468 ;buffer2 udata_ovr 0xB00 | 1588 ;buffer2 udata_ovr 0xB00 |
1469 ;buffer2 res .256 ; buffer 2 - backtracking, flash mirror, etc. | 1589 ;buffer2 res .256 ; buffer 2 - backtracking, flash mirror, etc. |
1470 | 1590 |
1471 #DEFINE buffer2 0xB00 | 1591 #DEFINE buffer2 0xB00 |
1472 | 1592 |
1473 | 1593 |
1474 ;---------------------- Bank 14 Options Table --------------------------------- | 1594 ;----------------------------------------------------------------------------- |
1595 ; Bank 14 Options Table | |
1596 ;----------------------------------------------------------------------------- | |
1597 | |
1475 opt_table equ 0xE00 ; Alias for "banksel opt_table" | 1598 opt_table equ 0xE00 ; Alias for "banksel opt_table" |
1476 opt_table udata_ovr opt_table ; Bank 14 options table | 1599 opt_table udata_ovr opt_table ; Bank 14 options table |
1477 | 1600 |
1478 ;---- Gas and Diluent Settings | 1601 ;---- Gas and Diluent Settings |
1479 opt_gas_O2_ratio res 5 ; O2 ratios of OC/bailout gases | ATTENTION: | 1602 opt_gas_O2_ratio res 5 ; O2 ratios of OC/bailout gases | ATTENTION: |
1483 opt_gas_type res 5 ; OC/bailout gas type: O=Disabled, 1=First, 2=Travel, 3=Deco | this block! | 1606 opt_gas_type res 5 ; OC/bailout gas type: O=Disabled, 1=First, 2=Travel, 3=Deco | this block! |
1484 opt_dil_type res 5 ; dil type: 0=Disabled, 1=First, 2=Normal | | 1607 opt_dil_type res 5 ; dil type: 0=Disabled, 1=First, 2=Normal | |
1485 opt_gas_change res 5 ; change depths for OC/Bailout gases | | 1608 opt_gas_change res 5 ; change depths for OC/Bailout gases | |
1486 opt_dil_change res 5 ; change depths for diluents | | 1609 opt_dil_change res 5 ; change depths for diluents | |
1487 | 1610 |
1488 ;---- Setpoints | 1611 ;---- Gas 6 Settings |
1612 opt_gas6_O2_ratio res 1 ; gas 6 O2 ratio | ATTENTION: keep relative positioning | |
1613 opt_gas6_He_ratio res 1 ; gas 6 He ratio | of these two variables! | |
1614 | |
1615 ;---- Setpoints Settings | |
1489 opt_setpoint_cbar res 5 ; setpoints in cbar | ATTENTION: keep relative positioning | 1616 opt_setpoint_cbar res 5 ; setpoints in cbar | ATTENTION: keep relative positioning |
1490 opt_setpoint_change res 5 ; change depth for the setpoints in meter | of these two arrays! | 1617 opt_setpoint_change res 5 ; change depth for the setpoints in meter | of these two arrays! |
1491 | 1618 |
1492 ;---- Dive Mode Settings | 1619 ;---- Dive Mode Settings |
1493 opt_dive_mode res 1 ; main dive/deco mode: =0: OC, =1: CC, =2: Gauge, =3: Apnea, =4: pSCR | 1620 opt_dive_mode res 1 ; main dive/deco mode: =0: OC, =1: CC, =2: Gauge, =3: Apnea, =4: pSCR |
1505 opt_brightness res 1 ; =0: Eco, =1:Medium, =2:Full | 1632 opt_brightness res 1 ; =0: Eco, =1:Medium, =2:Full |
1506 opt_salinity res 1 ; 0-5% | 1633 opt_salinity res 1 ; 0-5% |
1507 opt_language res 1 ; current language: 0=EN, 1=DE, 2=FR, 3=SP | 1634 opt_language res 1 ; current language: 0=EN, 1=DE, 2=FR, 3=SP |
1508 opt_units res 1 ; 0:m/°C, 1:ft/°F | 1635 opt_units res 1 ; 0:m/°C, 1:ft/°F |
1509 opt_dateformat res 1 ; =0:MMDDYY, =1:DDMMYY, =2:YYMMDD | 1636 opt_dateformat res 1 ; =0:MMDDYY, =1:DDMMYY, =2:YYMMDD |
1637 opt_dive_color_scheme res 1 ; dive mode color scheme selection | |
1510 opt_last_stop res 1 ; =3:3m, =4:4m, =5:5m, =6:6m | 1638 opt_last_stop res 1 ; =3:3m, =4:4m, =5:5m, =6:6m |
1511 opt_aGF_high res 1 ; alternative GF HIGH | 1639 opt_aGF_high res 1 ; alternative GF HIGH |
1512 opt_aGF_low res 1 ; alternative GF LOW | 1640 opt_aGF_low res 1 ; alternative GF LOW |
1513 opt_GF_high res 1 ; GF HIGH | 1641 opt_GF_high res 1 ; GF HIGH |
1514 opt_GF_low res 1 ; GF LOW | 1642 opt_GF_low res 1 ; GF LOW |
1515 opt_enable_aGF res 1 ; =1: aGF can be selected underwater | 1643 opt_enable_aGF res 1 ; =1: aGF can be selected underwater |
1516 opt_compass_gain res 1 ; 0-7 (230LSB/Gauss to 1370LSB/Gaus) | 1644 opt_compass_gain res 1 ; 0-7 (230LSB/Gauss to 1370LSB/Gaus) |
1517 opt_sampling_rate res 1 ; =1: 10s, =0: 2s | 1645 opt_sampling_rate res 1 ; =1: 10s, =0: 2s |
1518 opt_dive_color_scheme res 1 ; 0-3 | |
1519 opt_pressure_adjust res 1 ; SIGNED char (two's complement), -20/+20mbar max. | 1646 opt_pressure_adjust res 1 ; SIGNED char (two's complement), -20/+20mbar max. |
1520 opt_safetystop res 1 ; =1: a safety stop is shown | 1647 opt_safetystop res 1 ; =1: a safety stop is shown |
1521 opt_calibration_O2_ratio res 1 ; %O2 of calibration gas | 1648 opt_calibration_O2_ratio res 1 ; %O2 of calibration gas |
1522 opt_x_s1 res 2 ; calibration factor (Not stored in EEPROM) | 1649 opt_x_s1 res 2 ; calibration factor (not stored in EEPROM) | keep relative |
1523 opt_x_s2 res 2 ; calibration factor (Not stored in EEPROM) | 1650 opt_x_s2 res 2 ; calibration factor (not stored in EEPROM) | position! |
1524 opt_x_s3 res 2 ; calibration factor (Not stored in EEPROM) | 1651 opt_x_s3 res 2 ; calibration factor (not stored in EEPROM) | |
1525 opt_sensor_fallback res 1 ; NOT USED ANY MORE, KEPT FOR COMPATIBILITY WITH EEPROM IMAGE | 1652 opt_sensor_fallback res 1 ; NOT USED ANY MORE, KEPT FOR COMPATIBILITY WITH EEPROM IMAGE |
1526 opt_flip_screen res 1 ; =1: flip the screen | 1653 opt_flip_screen res 1 ; =1: flip the screen |
1527 opt_cR_button_left res 1 ; left button sensitivity (cR hardware) | 1654 opt_cR_button_left res 1 ; left button sensitivity (cR hardware) |
1528 opt_cR_button_right res 1 ; right button sensitivity (cR hardware) | 1655 opt_cR_button_right res 1 ; right button sensitivity (cR hardware) |
1529 opt_depth_warn res 1 ; =1:do a red blinking warning, =0:default behavior | 1656 opt_depth_warn res 1 ; =1:do a red blinking warning, =0:default behavior |
1553 opt_ext_stops res 1 ; =1: place gas switches also below 1st stop depth | 1680 opt_ext_stops res 1 ; =1: place gas switches also below 1st stop depth |
1554 opt_s8_mode res 1 ; S8 mode - analog / digital | 1681 opt_s8_mode res 1 ; S8 mode - analog / digital |
1555 opt_gas_contingency_sim res 1 ; =1: deco calculator: switch to alternative gas if best gas is used up | 1682 opt_gas_contingency_sim res 1 ; =1: deco calculator: switch to alternative gas if best gas is used up |
1556 opt_gas_contingency_dive res 1 ; =1: real dive mode: switch to alternative gas if best gas is used up | 1683 opt_gas_contingency_dive res 1 ; =1: real dive mode: switch to alternative gas if best gas is used up |
1557 opt_cave_mode res 1 ; =1: cave mode switched on | 1684 opt_cave_mode res 1 ; =1: cave mode switched on |
1685 opt_gas_density_check res 1 ; =1: gas density is checked (effective in CCR / pSCR modes only) | |
1686 opt_comm_timeout res 1 ; comm RX timeout in multiples of 10 ms | |
1687 opt_fallback res 1 ; unused dummy option for compatibility with 3rd party tools | |
1688 opt_conservatism res 1 ; unused dummy option for compatibility with 3rd party tools | |
1558 | 1689 |
1559 ;---- RX Function Settings | 1690 ;---- RX Function Settings |
1560 opt_transmitter_id_1 res 2 ; 16 bit transmitter ID for Gas 1 | 1691 opt_transmitter_id_1 res 2 ; 16 bit transmitter ID for Gas 1 |
1561 opt_transmitter_id_2 res 2 ; 16 bit transmitter ID for Gas 2 | 1692 opt_transmitter_id_2 res 2 ; 16 bit transmitter ID for Gas 2 |
1562 opt_transmitter_id_3 res 2 ; 16 bit transmitter ID for Gas 3 | 1693 opt_transmitter_id_3 res 2 ; 16 bit transmitter ID for Gas 3 |
1570 opt_TR_mode res 1 ; TR functions - mode | 1701 opt_TR_mode res 1 ; TR functions - mode |
1571 opt_TR_1st_pres res 1 ; TR functions - 1st pressure assignment | 1702 opt_TR_1st_pres res 1 ; TR functions - 1st pressure assignment |
1572 opt_TR_2nd_pres res 1 ; TR functions - 2nd pressure assignment | 1703 opt_TR_2nd_pres res 1 ; TR functions - 2nd pressure assignment |
1573 opt_TR_Bail_pres res 1 ; TR functions - bailout pressure assignment | 1704 opt_TR_Bail_pres res 1 ; TR functions - bailout pressure assignment |
1574 | 1705 |
1575 ; ==> 190 bytes used - 54 bytes free (244 usable bytes only in bank 14 as the upper 12 | 1706 ; ==> 193 bytes used - 51 bytes free (244 usable bytes only in bank 14 as the upper 12 |
1576 ; bytes are reserved for special function registers) | 1707 ; bytes are reserved for special function registers) |
1577 | 1708 |
1578 ;----------------------------------------------------------------------------- | 1709 ;----------------------------------------------------------------------------- |