comparison src/ostc3.inc @ 113:f3062a611eef

Merge
author heinrichsweikamp
date Mon, 23 Jun 2014 16:14:33 +0200
parents c61b7a4e317c
children c935f7fbd39c
comparison
equal deleted inserted replaced
112:a24581f0b372 113:f3062a611eef
17 17
18 #include <p18f87k22.inc> 18 #include <p18f87k22.inc>
19 #include <ports.inc> ; Portmap 19 #include <ports.inc> ; Portmap
20 20
21 #DEFINE softwareversion_x d'1' ; Software version XX.YY 21 #DEFINE softwareversion_x d'1' ; Software version XX.YY
22 #DEFINE softwareversion_y d'40' ; Software version XX.YY 22 #DEFINE softwareversion_y d'41' ; Software version XX.YY
23 #DEFINE softwareversion_beta 0 ; (and 0 for release) 23 #DEFINE softwareversion_beta 1 ; (and 0 for release)
24 24
25 #DEFINE comm_service_key 0xABCDEF 25 #DEFINE comm_service_key 0xABCDEF
26 26
27 ;----------------------------------------------------------------------------- 27 ;-----------------------------------------------------------------------------
28 28
69 #DEFINE warn_ceiling .6 69 #DEFINE warn_ceiling .6
70 #DEFINE warn_gas_in_gaslist .7 70 #DEFINE warn_gas_in_gaslist .7
71 #DEFINE warn_ppo2_hud .8 71 #DEFINE warn_ppo2_hud .8
72 #DEFINE warn_battery .9 72 #DEFINE warn_battery .9
73 73
74 ; External O2 cell input parameters
75 #DEFINE min_mv .80 ; = 8mV
76 #DEFINE min_mv_in_o2 .380 ; = 38mV
74 77
75 ; Profile recording parameters 78 ; Profile recording parameters
76 #DEFINE logbook_profile_version 0x23 79 #DEFINE logbook_profile_version 0x23
77 #DEFINE samplingrate_apnoe .1 ; [seconds] 80 #DEFINE samplingrate_apnoe .1 ; [seconds]
78 ; Warning: Divisors must be <.16 ! 81 ; Warning: Divisors must be <.16 !
170 #DEFINE current_ir_reciever .139 173 #DEFINE current_ir_reciever .139
171 #DEFINE current_compass .28 174 #DEFINE current_compass .28
172 175
173 ; Brightness thresholds (between zero (off) and 255 (max. power)) 176 ; Brightness thresholds (between zero (off) and 255 (max. power))
174 #DEFINE ambient_light_max_high_36V .175 ; When used with a 3,6V battery 177 #DEFINE ambient_light_max_high_36V .175 ; When used with a 3,6V battery
175 #DEFINE ambient_light_max_high .150 178 #DEFINE ambient_light_max_high .240 ; For rechargeable battery
179 ;#DEFINE ambient_light_max_high .150
176 #DEFINE ambient_light_min_high .40 180 #DEFINE ambient_light_min_high .40
177 #DEFINE ambient_light_max_medium .135 181 #DEFINE ambient_light_max_medium .135
178 #DEFINE ambient_light_min_medium .30 182 #DEFINE ambient_light_min_medium .30
179 #DEFINE ambient_light_max_eco .90 183 #DEFINE ambient_light_max_eco .90
180 #DEFINE ambient_light_min_eco .15 ; Must be the lowest value! 184 #DEFINE ambient_light_min_eco .15 ; Must be the lowest value!
259 263
260 ; Battery gauge (nAs, nC) 264 ; Battery gauge (nAs, nC)
261 battery_gauge res 6 ; 48Bit -> 78Ah max... 265 battery_gauge res 6 ; 48Bit -> 78Ah max...
262 266
263 ; IR-Link 267 ; IR-Link
264 ir_buffer res .16 268 ir_buffer res .18
265 ir_counter res 1 269 ir_counter res 1
266 ir_timeout res 1 ; Timeout for valid data 270 ir_timeout res 1 ; Timeout for valid data
267 271
268 ; Compass raw data 272 ; Compass raw data
269 compass_DX res 2 273 compass_DX res 2
322 flag5 res 1 326 flag5 res 1
323 flag6 res 1 327 flag6 res 1
324 flag7 res 1 328 flag7 res 1
325 flag8 res 1 329 flag8 res 1
326 flag9 res 1 330 flag9 res 1
331 flag10 res 1
327 332
328 temp1 res 1 333 temp1 res 1
329 temp2 res 1 334 temp2 res 1
330 335
331 ;---- Interface to wait macros 336 ;---- Interface to wait macros
395 active_diluent res 1 ; As a backup when switching back from Bailout to CCR 400 active_diluent res 1 ; As a backup when switching back from Bailout to CCR
396 decoplan_page res 1 401 decoplan_page res 1
397 warning_counter res 1 ; Counts amount of warning in divemode 402 warning_counter res 1 ; Counts amount of warning in divemode
398 warning_counter_backup res 1 ; Backup of warning_counter 403 warning_counter_backup res 1 ; Backup of warning_counter
399 warning_page res 1 ; current # of warning page 404 warning_page res 1 ; current # of warning page
400 rssi_value res 1 ; Current RSSI level
401 405
402 ; Remind history for menu processor (and such): 406 ; Remind history for menu processor (and such):
403 menustack res 5 ; menu stack 407 menustack res 5 ; menu stack
404 menupos res 1 ; Logbook and divemode menu 408 menupos res 1 ; Logbook and divemode menu
405 menupos2 res 1 ; For dive mode simulator and pre-menu 409 menupos2 res 1 ; For dive mode simulator and pre-menu
444 ext_flash_address res 3 ; 24bit Address 448 ext_flash_address res 3 ; 24bit Address
445 ext_flash_log_pointer res 3 ; 24bit Address for logbook profile storing 449 ext_flash_log_pointer res 3 ; 24bit Address for logbook profile storing
446 ext_flash_dive_counter res 3 ; 24bit Counter for dive length (increased in write_byte_ext_flash_plus) 450 ext_flash_dive_counter res 3 ; 24bit Counter for dive length (increased in write_byte_ext_flash_plus)
447 451
448 ; I2C 452 ; I2C
449 i2c_temp res 1 ; Temp 453 i2c_temp res 2 ; Temp
450 454
451 ; O2 Sensor data 455 ; O2 Sensor data
452 o2_mv_sensor1 res 2 ; in 0.1mV steps 456 o2_mv_sensor1 res 2 ; in 0.1mV steps
453 o2_mv_sensor2 res 2 ; in 0.1mV steps 457 o2_mv_sensor2 res 2 ; in 0.1mV steps
454 o2_mv_sensor3 res 2 ; in 0.1mV steps 458 o2_mv_sensor3 res 2 ; in 0.1mV steps
459 hud_status_byte res 1 463 hud_status_byte res 1
460 ;Status Byte/ 464 ;Status Byte/
461 ;Bit0 = 1 -> HUD connection ok 465 ;Bit0 = 1 -> HUD connection ok
462 ;Bit1 = 1 -> HUD is calibrated 466 ;Bit1 = 1 -> HUD is calibrated
463 ;Bit2 = 1 -> HUD Battery is low (<3000mV) 467 ;Bit2 = 1 -> HUD Battery is low (<3000mV)
464 ;Bit3 = 1 -> Sensor 1 active 468 #DEFINE sensor1_active hud_status_byte,3 ; =1: Sensor1 is active
465 ;Bit4 = 1 -> Sensor 2 active 469 #DEFINE sensor2_active hud_status_byte,4 ; =1: Sensor2 is active
466 ;Bit5 = 1 -> Sensor 3 active 470 #DEFINE sensor3_active hud_status_byte,5 ;=1: Sensor3 is active
467 ;Bit6 unused in stand-alone HUD 471 ;Bit6 unused in stand-alone HUD
468 ;Bit7 unused in stand-alone HUD 472 ;Bit7 unused in stand-alone HUD
469 473
470 sensor_setpoint res 1 ; sensor ppo2 in 0.01bar for deco routine 474 sensor_setpoint res 1 ; sensor ppo2 in 0.01bar for deco routine
471 475
472 better_gas_number res 1 ; number (1-5) of the "better gas" in divemode, =0: no better gas available 476 better_gas_number res 1 ; number (1-5) of the "better gas" in divemode, =0: no better gas available
473 customview_divemode res 1 ; keeps last custom view 477 customview_divemode res 1 ; keeps last custom view
474 customview_surfmode res 1 478 customview_surfmode res 1
475 safety_stop_countdown res 1 ; counts seconds of safety stop 479 safety_stop_countdown res 1 ; counts seconds of safety stop
476
477 480
478 ;---------------------------- TMP DATA --------------------------------------- 481 ;---------------------------- TMP DATA ---------------------------------------
479 ; Space for various overlayed data from color, word, menu processors, etc. 482 ; Space for various overlayed data from color, word, menu processors, etc.
480 ; 483 ;
481 484
522 opt_compass_gain res 1 ; 0-7 (230LSB/Gauss to 1370LSB/Gaus) 525 opt_compass_gain res 1 ; 0-7 (230LSB/Gauss to 1370LSB/Gaus)
523 opt_sampling_rate res 1 ; =1: 10s, =0: 2s 526 opt_sampling_rate res 1 ; =1: 10s, =0: 2s
524 opt_dive_color_scheme res 1 ; 0-3 527 opt_dive_color_scheme res 1 ; 0-3
525 opt_pressure_adjust res 1 ; SIGNED int (two's complement), -20/+20mbar max. 528 opt_pressure_adjust res 1 ; SIGNED int (two's complement), -20/+20mbar max.
526 opt_enable_safetystop res 1 ; =1: A safety stop is shown 529 opt_enable_safetystop res 1 ; =1: A safety stop is shown
530 opt_calibration_O2_ratio res 1 ; %O2 of calibration gas
531 opt_x_s1 res 2 ; calibration factor (Not stored in EEPROM)
532 opt_x_s2 res 2 ; calibration factor (Not stored in EEPROM)
533 opt_x_s3 res 2 ; calibration factor (Not stored in EEPROM)
534
527 535
528 ;-----------------------------EEPROM DATA ------------------------------------ 536 ;-----------------------------EEPROM DATA ------------------------------------
529 ; Automatic reset of all options when this is changed: 537 ; Automatic reset of all options when this is changed:
530 #define eeprom_opt_serial 0x0005 ; Version 0.5 538 #define eeprom_opt_serial 0x0005 ; Version 0.5
531 539
607 #DEFINE in_color_menu flag9,1 ; =1: In the color scheme menu 615 #DEFINE in_color_menu flag9,1 ; =1: In the color scheme menu
608 #DEFINE bailoutgas_event flag9,2 ; =1: bailout was selected or a gaschange during bailout 616 #DEFINE bailoutgas_event flag9,2 ; =1: bailout was selected or a gaschange during bailout
609 #DEFINE event2_occured flag9,3 ; =1: An event in the Eventbyte2 occured, store it! 617 #DEFINE event2_occured flag9,3 ; =1: An event in the Eventbyte2 occured, store it!
610 #DEFINE show_safety_stop flag9,4 ; =1: Show the safety stop 618 #DEFINE show_safety_stop flag9,4 ; =1: Show the safety stop
611 #DEFINE safety_stop_active flag9,5 ; =1 The safety stop is currently displayed 619 #DEFINE safety_stop_active flag9,5 ; =1 The safety stop is currently displayed
620 #DEFINE new_s8_data_available flag9,6 ; =1: New data frame recieved
621 #DEFINE c3_hardware flag9,7; =1: OSTC 3C hardware
622
623 #DEFINE s8_digital flag10,0; =1: Digital I/O
624 #DEFINE menu_show_sensors2 flag10,1 ; =1: Update mV data in calibration menu
625
612 ;============================================================================= 626 ;=============================================================================
613 ; C-code Routines 627 ; C-code Routines
614 ; PART 2 628 ; PART 2
615 extern deco_calc_CNS_decrease_15min 629 extern deco_calc_CNS_decrease_15min
616 extern deco_calc_CNS_fraction 630 extern deco_calc_CNS_fraction