Mercurial > public > hwos_code
comparison src/hwos.inc @ 640:8c1f1f334275
3.13 release
author | heinrichsweikamp |
---|---|
date | Thu, 29 Oct 2020 09:29:15 +0100 |
parents | 4050675965ea |
children | 7d8a4c60ec1a 5b7fe7777425 |
comparison
equal
deleted
inserted
replaced
639:0ff82370991d | 640:8c1f1f334275 |
---|---|
1 ;============================================================================= | 1 ;============================================================================= |
2 ; | 2 ; |
3 ; File hwos.inc * combined next generation V3.09.5 | 3 ; File hwos.inc * combined next generation V3.12.3 |
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 ;============================================================================= |
180 #DEFINE rx_timeout .400 ; [ms] timeout for RS232 RX, needs to be multiple of 50 ms | 180 #DEFINE rx_timeout .400 ; [ms] timeout for RS232 RX, needs to be multiple of 50 ms |
181 | 181 |
182 | 182 |
183 ; ---- End-of-Dive Timeouts | 183 ; ---- End-of-Dive Timeouts |
184 #DEFINE simulator_timeout_normal .90 ; [min] timeout simulator mode | 184 #DEFINE simulator_timeout_normal .90 ; [min] timeout simulator mode |
185 #DEFINE simulator_timeout_cave .240 ; [min] timeout simulator mode (cave mode) | 185 #DEFINE simulator_timeout_cave .240 ; [min] timeout simulator mode (cave mode) |
186 #DEFINE apnoe_timeout .15 ; [min] timeout at surface in apnoe mode | 186 #DEFINE apnoe_timeout .15 ; [min] timeout at surface in apnoe mode |
187 #DEFINE simulator_timeout .15 ; [s] timeout at surface in simulator mode | 187 #DEFINE simulator_timeout .15 ; [s] timeout at surface in simulator mode |
188 #DEFINE divetime_less_1min_timeout .5 ; [s] timeout at surface for very short dives | |
188 | 189 |
189 | 190 |
190 ; ---- other Timeouts | 191 ; ---- other Timeouts |
191 #DEFINE deep_sleep_10mins .144 ; [x 10mins] (24h in this example) | 192 #DEFINE deep_sleep_10mins .144 ; [x 10mins] (24h in this example) |
192 | 193 |
193 | 194 |
194 ; ---- Surface Mode Thresholds and Limits | 195 ; ---- Surface Mode Thresholds and Limits |
195 #DEFINE high_altitude_threshold .880 ; [mbar] ambient pressure at which to switch into high altitude mode | 196 #DEFINE high_altitude_threshold .880 ; [mbar] ambient pressure at which to switch into high altitude mode |
196 #DEFINE max_surfpressure .1030 ; [mbar] maximum value for internal surface pressure | 197 #DEFINE max_surfpressure .1060 ; [mbar] maximum value for internal surface pressure |
197 #DEFINE pressure_noise_threshold .10 ; [mbar] deltaP threshold for start of fast display updating | 198 #DEFINE pressure_noise_threshold .10 ; [mbar] deltaP threshold for start of fast display updating |
198 #DEFINE pressure_noise_lag_time .6 ; [1/4 secs] lag time of display updating after deltaP < threshold again | 199 #DEFINE pressure_noise_lag_time .6 ; [1/4 secs] lag time of display updating after deltaP < threshold again |
199 | 200 |
200 | 201 |
201 | 202 |
291 #DEFINE capacity_saft_internal .364 | 292 #DEFINE capacity_saft_internal .364 |
292 #DEFINE capacity_panasonic_internal .121 | 293 #DEFINE capacity_panasonic_internal .121 |
293 | 294 |
294 | 295 |
295 ; Gauge IC | 296 ; Gauge IC |
296 #DEFINE capacity_saft .281 ; 2.4Ah/0.085mAh/100 [%] | 297 #DEFINE capacity_saft .271 ; 2.3Ah/0.085mAh/100 [%] |
297 #DEFINE offset_saft .37300 ; 65536-(2.4Ah/0.085mAh) | 298 #DEFINE offset_saft .38477 ; 65536-(2.3Ah/0.085mAh) |
298 | 299 |
299 #DEFINE capacity_panasonic .94 ; 0.8Ah/0.085mAh/100 [%] | 300 #DEFINE capacity_panasonic .94 ; 0.8Ah/0.085mAh/100 [%] |
300 #DEFINE offset_panasonic .56124 ; 65536-(0.8Ah/0.085mAh) | 301 #DEFINE offset_panasonic .56124 ; 65536-(0.8Ah/0.085mAh) |
301 | 302 |
302 #DEFINE capacity_ncr18650 .364 ; 3.1Ah/0.085mAh/100 [%] | 303 #DEFINE capacity_ncr18650 .364 ; 3.1Ah/0.085mAh/100 [%] |
303 #DEFINE offset_ncr18650 .29065 ; 65536-(3.1Ah/0.085mAh) | 304 #DEFINE offset_ncr18650 .29065 ; 65536-(3.1Ah/0.085mAh) |
304 | 305 |
305 #DEFINE capacity_ur16650 .271 ; 2.3Ah/0.085mAh/100 [%] | 306 #DEFINE capacity_ur16650 .235 ; 2.0Ah/0.085mAh/100 [%] |
306 #DEFINE offset_ur16650 .38477 ; 65536-(2.3Ah/0.085mAh) | 307 #DEFINE offset_ur16650 .42006 ; 65536-(2.0Ah/0.085mAh) |
307 | 308 |
308 | 309 |
309 ; ---- Power Consumption Values | 310 ; ---- Power Consumption Values |
310 #DEFINE current_sleepmode .31 | 311 #DEFINE current_sleepmode .31 |
311 #DEFINE current_backlight_multi .115 ; * CCPR1L + current_backlight_offset (restricted to <= 255) | 312 #DEFINE current_backlight_multi .115 ; * CCPR1L + current_backlight_offset (restricted to <= 255) |
530 #DEFINE update_surface_pressure OS_flags_ISR2,0 ; =1: request ISR to update the surface pressure | 531 #DEFINE update_surface_pressure OS_flags_ISR2,0 ; =1: request ISR to update the surface pressure |
531 #DEFINE quit_simulatormode OS_flags_ISR2,1 ; =1: request ISR to quit the simulator mode | 532 #DEFINE quit_simulatormode OS_flags_ISR2,1 ; =1: request ISR to quit the simulator mode |
532 #DEFINE count_divetime OS_flags_ISR2,2 ; =1: request ISR to count the dive time | 533 #DEFINE count_divetime OS_flags_ISR2,2 ; =1: request ISR to count the dive time |
533 #DEFINE sensor_override_request OS_flags_ISR2,3 ; =1: request ISR to override the pressure sensor with a simulated depth | 534 #DEFINE sensor_override_request OS_flags_ISR2,3 ; =1: request ISR to override the pressure sensor with a simulated depth |
534 #DEFINE tmr5_preemtion_allowed OS_flags_ISR2,4 ; =1: allow preemption of timeout counter | 535 #DEFINE tmr5_preemtion_allowed OS_flags_ISR2,4 ; =1: allow preemption of timeout counter |
535 ; OS_flags_ISR2,5 ; --- unused | 536 #DEFINE button_hold_down_allowed OS_flags_ISR2,5 ; =1: OSTC uses mechanical push buttons |
536 #DEFINE sensor_override_active OS_flags_ISR2,6 ; =1: ISR output: switch to override-mode confirmed | 537 #DEFINE sensor_override_active OS_flags_ISR2,6 ; =1: ISR output: switch to override-mode confirmed |
537 #DEFINE divetime_longer_1min OS_flags_ISR2,7 ; =1: ISR output: dive time is >= one minute | 538 #DEFINE divetime_longer_1min OS_flags_ISR2,7 ; =1: ISR output: dive time is >= one minute |
538 | 539 |
539 | 540 |
540 ;---- Operating Modes (stored in access RAM, persistent) | 541 ;---- Operating Modes (stored in access RAM, persistent) |
575 #DEFINE dive_turned DM_flags_state,4 ; =1: dive is turned (cave mode) | 576 #DEFINE dive_turned DM_flags_state,4 ; =1: dive is turned (cave mode) |
576 #DEFINE backtrack_almost_full DM_flags_state,5 ; =1: the backtracking storage is almost full (cave mode) | 577 #DEFINE backtrack_almost_full DM_flags_state,5 ; =1: the backtracking storage is almost full (cave mode) |
577 #DEFINE backtrack_entire_full DM_flags_state,6 ; =1: the backtracking storage is entirely full (cave mode) | 578 #DEFINE backtrack_entire_full DM_flags_state,6 ; =1: the backtracking storage is entirely full (cave mode) |
578 #DEFINE backtrack_shutdown DM_flags_state,7 ; =1: the backtracking has shut down due to entirely full (cave mode) | 579 #DEFINE backtrack_shutdown DM_flags_state,7 ; =1: the backtracking has shut down due to entirely full (cave mode) |
579 | 580 |
580 ;---- Dive Mode - O2 Sensors | 581 ;---- Dive Mode - O2 Sensors & Setpoint |
581 #DEFINE use_O2_sensor1 DM_flags_sensor,0 ; =1: sensor 1 shall be used | 582 #DEFINE use_O2_sensor1 DM_flags_sensor,0 ; =1: sensor 1 shall be used |
582 #DEFINE use_O2_sensor2 DM_flags_sensor,1 ; =1: sensor 2 shall be used | 583 #DEFINE use_O2_sensor2 DM_flags_sensor,1 ; =1: sensor 2 shall be used |
583 #DEFINE use_O2_sensor3 DM_flags_sensor,2 ; =1: sensor 3 shall be used | 584 #DEFINE use_O2_sensor3 DM_flags_sensor,2 ; =1: sensor 3 shall be used |
584 #DEFINE voting_logic_sensor1 DM_flags_sensor,3 ; =1: sensor 1 is within the voting logic threshold | 585 #DEFINE voting_logic_sensor1 DM_flags_sensor,3 ; =1: sensor 1 is within the voting logic threshold |
585 #DEFINE voting_logic_sensor2 DM_flags_sensor,4 ; =1: sensor 2 is within the voting logic threshold | 586 #DEFINE voting_logic_sensor2 DM_flags_sensor,4 ; =1: sensor 2 is within the voting logic threshold |
586 #DEFINE voting_logic_sensor3 DM_flags_sensor,5 ; =1: sensor 3 is within the voting logic threshold | 587 #DEFINE voting_logic_sensor3 DM_flags_sensor,5 ; =1: sensor 3 is within the voting logic threshold |
587 ; DM_flags_sensor,6 ; --- unused | 588 ; DM_flags_sensor,6 ; --- unused |
588 ; DM_flags_sensor,7 ; --- unused | 589 #DEFINE restart_auto_sp DM_flags_sensor,7 ; =1: re-run the auto SP selection from 1st SP |
589 | 590 |
590 ;---- Dive Mode - User Requests / General | 591 ;---- Dive Mode - User Requests / General |
591 #DEFINE request_gas_change DM_flags_request,0 ; =1: request to change the gas | 592 #DEFINE request_gas_change DM_flags_request,0 ; =1: request to change the gas |
592 #DEFINE request_gas_update DM_flags_request,1 ; =1: request to update the gas | 593 #DEFINE request_gas_update DM_flags_request,1 ; =1: request to update the gas |
593 #DEFINE request_reset_avg DM_flags_request,2 ; =1: request to reset the average depth | 594 #DEFINE request_reset_avg DM_flags_request,2 ; =1: request to reset the average depth |
1185 ;--- resettable min and max Depth Option | 1186 ;--- resettable min and max Depth Option |
1186 IFDEF _min_depth_option | 1187 IFDEF _min_depth_option |
1187 pressure_rel_min_trip res 2 ; resettable minimum relative pressure | 1188 pressure_rel_min_trip res 2 ; resettable minimum relative pressure |
1188 pressure_rel_max_trip res 2 ; resettable maximum relative pressure | 1189 pressure_rel_max_trip res 2 ; resettable maximum relative pressure |
1189 ENDIF | 1190 ENDIF |
1190 | 1191 |
1191 ; 143 byte used, 17 byte free | 1192 debounce_counter res 1 ; multiples of 16ms |
1193 | |
1194 ; 144 byte used, 16 byte free | |
1192 | 1195 |
1193 | 1196 |
1194 ;----------------------------------------------------------------------------- | 1197 ;----------------------------------------------------------------------------- |
1195 ; Common DATA | 1198 ; Common DATA |
1196 ;----------------------------------------------------------------------------- | 1199 ;----------------------------------------------------------------------------- |
1290 safety_stop_countdown res 1 ; counter for safety stop | 1293 safety_stop_countdown res 1 ; counter for safety stop |
1291 dive_timeout_timer res 2 ; timeout timer for leaving dive mode after surfacing | 1294 dive_timeout_timer res 2 ; timeout timer for leaving dive mode after surfacing |
1292 gaslist_gas res 1 ; used for transfer between gaslist.asm and menu_tree.asm | 1295 gaslist_gas res 1 ; used for transfer between gaslist.asm and menu_tree.asm |
1293 best_gas_number res 1 ; number of the "best gas": 0= none found, 1-5= gases 1-5, 255= not computed | 1296 best_gas_number res 1 ; number of the "best gas": 0= none found, 1-5= gases 1-5, 255= not computed |
1294 active_gas res 1 ; the currently used OC/bailout gas (1-5) | 1297 active_gas res 1 ; the currently used OC/bailout gas (1-5) |
1298 dive_ccr_mode res 1 ; working copy of opt_ccr_mode while the dive | |
1295 | 1299 |
1296 IFDEF _ccr_pscr | 1300 IFDEF _ccr_pscr |
1297 best_dil_number res 1 ; number of the "best dil": 0= none found, 1-5= dils 1-5, 255= not computed | 1301 best_dil_number res 1 ; number of the "best dil": 0= none found, 1-5= dils 1-5, 255= not computed |
1298 active_dil res 1 ; the currently used diluent (1-5) | 1302 active_dil res 1 ; the currently used diluent (1-5) |
1299 ENDIF | 1303 ENDIF |
1429 | 1433 |
1430 ;---- tft_outputs.asm | 1434 ;---- tft_outputs.asm |
1431 pressure_update_lag_counter res 1 ; lag time counter for fast surface pressure display updating | 1435 pressure_update_lag_counter res 1 ; lag time counter for fast surface pressure display updating |
1432 | 1436 |
1433 | 1437 |
1434 ; 200 byte used, 8 byte free (208 byte total) | 1438 ; 201 byte used, 7 byte free (208 byte total) |
1435 | 1439 |
1436 | 1440 |
1437 ;----------------------------------------------------------------------------- | 1441 ;----------------------------------------------------------------------------- |
1438 ; LOCAL DATA | 1442 ; LOCAL DATA |
1439 ;----------------------------------------------------------------------------- | 1443 ;----------------------------------------------------------------------------- |