annotate src/hwos.inc @ 594:b891cd260d1b

2.97 SP1 release
author heinrichsweikamp
date Thu, 17 May 2018 20:46:33 +0200
parents e81cf407261a
children 1719de53e497
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
587
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 582
diff changeset
3 ; File hwos.inc REFACTORED VERSION V2.97 SP1
0
heinrichsweikamp
parents:
diff changeset
4 ;
275
653a3ab08062 rename into hwOS
heinrichsweikamp
parents: 273
diff changeset
5 ; OSTC Platform definitions
0
heinrichsweikamp
parents:
diff changeset
6 ;
heinrichsweikamp
parents:
diff changeset
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
heinrichsweikamp
parents:
diff changeset
8 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
9 ; HISTORY
heinrichsweikamp
parents:
diff changeset
10 ; 2011-05-24 : [jDG] Cleanups from initial Matthias code.
heinrichsweikamp
parents:
diff changeset
11
heinrichsweikamp
parents:
diff changeset
12 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
13
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
14 LIST P=18F87K22 ; change also: Configure->SelectDevice from Mplab
0
heinrichsweikamp
parents:
diff changeset
15
99
87cc1adfe4da show event "bailout" in the internal logbook
heinrichsweikamp
parents: 98
diff changeset
16 ;#DEFINE __DEBUG
0
heinrichsweikamp
parents:
diff changeset
17
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
18 ;#DEFINE french_italian ; If defined, use french and italian instead of english and german
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
19
0
heinrichsweikamp
parents:
diff changeset
20 #include <p18f87k22.inc>
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
21 #include <ports.inc> ; Portmap
0
heinrichsweikamp
parents:
diff changeset
22
180
abc429e8b46a 1.60 work...
heinrichsweikamp
parents: 179
diff changeset
23 ; Firmware definition
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
24 #DEFINE softwareversion_x .2 ; Software version XX.YY
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
25 #DEFINE softwareversion_y .97 ; Software version XX.YY
587
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 582
diff changeset
26 #DEFINE softwareversion_beta .2 ; 0= release, 1=beta, 2=SP1, 3=SP2, ...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 559
diff changeset
27
180
abc429e8b46a 1.60 work...
heinrichsweikamp
parents: 179
diff changeset
28 ; Firmware version will appear in "Change Firmware" style
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
29 #DEFINE firmware_expire_year .19
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
30 #DEFINE firmware_expire_month .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
31 #DEFINE firmware_expire_day .24
0
heinrichsweikamp
parents:
diff changeset
32
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
33 #DEFINE comm_service_key 0xABCDEF
0
heinrichsweikamp
parents:
diff changeset
34
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
35 ;-----------------------------EEPROM DATA ------------------------------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
36 ; Automatic reset of all options when this is changed:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
37 #define eeprom_opt_serial 0x0006 ; Version 0.6
0
heinrichsweikamp
parents:
diff changeset
38 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
39
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
40 #DEFINE CCP1CON_VALUE b'00001100' ; PWM1 for LED dimming
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
41 #DEFINE T2CON_ECO b'00000100' ; 1:1 Postscaler, 1:1 Prescaler, Timer 2 start -> 980Hz (Good compromise of no-flicker and efficiency)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
42 #DEFINE T2CON_NORMAL b'00001110'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
43 #DEFINE T2CON_FASTEST b'00001110' ; 1:2 Postscaler, 1:16 Prescaler, Timer 2 start -> 1960Hz (no-flicker)
28
heinrichsweikamp
parents: 26
diff changeset
44
0
heinrichsweikamp
parents:
diff changeset
45 ; Timing for button hold-down flags
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
46 #DEFINE TMR1H_VALUE_FIRST .255-.128 ; in steps of 7,8125ms -> 1s
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
47 #DEFINE TMR1H_VALUE_CONT .255-.32 ; in steps of 7,8125ms -> 0.25s
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
48 #DEFINE TMR1H_VALUE_CONT_DIVE .255-.64 ; in steps of 7,8125ms -> 0.5s
0
heinrichsweikamp
parents:
diff changeset
49
heinrichsweikamp
parents:
diff changeset
50 ; Color Definitions: 8Bit RGB b'RRRGGGBB'
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
51 #DEFINE color_red b'11100000' ; (7,0,0)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
52 #DEFINE color_dark_red b'10000101' ; (4,1,1)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
53 #DEFINE color_violet b'11101011' ; (7,2,3)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
54 #DEFINE color_blue b'11000111' ; (6,1,3)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
55 #DEFINE color_green b'00011100' ; (0,7,0)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
56 #DEFINE color_greenish b'00111110' ; (1,7,2)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
57 #DEFINE color_dark_green b'00111001' ; (1,6,1)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
58 #DEFINE color_yellow b'11111101' ; (7,7,1)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
59 #DEFINE color_white b'11111111' ; (7,7,3)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
60 #DEFINE color_black b'00000000' ; (0,0,0)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
61 #DEFINE color_deepblue b'00000010' ; (0,0,2)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
62 #DEFINE color_grey b'11011111' ; (6,7,3)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
63 #DEFINE color_cyan b'11011111' ; (6,7,3)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
64 #DEFINE color_lightblue b'11011011' ; (6,7,3)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
65 #DEFINE color_orange b'11111000' ; (7,6,0)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
66 #DEFINE color_pink b'11111010' ; (7,6,2)
0
heinrichsweikamp
parents:
diff changeset
67
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
68 #DEFINE FT_TINY .0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
69 #DEFINE FT_SMALL .1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
70 #DEFINE FT_MEDIUM .2 ; not used
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
71 #DEFINE FT_LARGE .3 ; not used
0
heinrichsweikamp
parents:
diff changeset
72
113
heinrichsweikamp
parents: 111
diff changeset
73 ; External O2 cell input parameters
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
74 #DEFINE min_mv .80 ; = 8mV
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
75 #DEFINE max_mv .2500 ; = 250mV
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
76 #DEFINE ignore_mv .3500 ; = 350mV (to suppress ghost readings for long, open cables)
0
heinrichsweikamp
parents:
diff changeset
77
heinrichsweikamp
parents:
diff changeset
78 ; Profile recording parameters
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
79 #DEFINE logbook_profile_version 0x24
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
80 #DEFINE samplingrate_apnoe .1 ; [seconds]
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 559
diff changeset
81
0
heinrichsweikamp
parents:
diff changeset
82 ; Warning: Divisors must be <.16 !
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
83 #DEFINE div_temperature .6 ; x samplingrate [s]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
84 #DEFINE div_deco .6 ; x samplingrate [s]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
85 #DEFINE div_gf .12 ; x samplingrate [s]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
86 #DEFINE div_ppo2_sensors .2 ; x samplingrate [s]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
87 #DEFINE div_decoplan .12 ; x samplingrate [s]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
88 #DEFINE div_cns .12 ; x samplingrate [s]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
89 #DEFINE div_tank .0 ; x samplingrate [s]
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 559
diff changeset
90
0
heinrichsweikamp
parents:
diff changeset
91 ; Warning: Information lengths must be <.16 !
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
92 #DEFINE infolength_temperature .2 ; [byte]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
93 #DEFINE infolength_deco .2 ; [byte]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
94 #DEFINE infolength_gf .1 ; [byte]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
95 #DEFINE infolength_ppo2_sensors .9 ; [byte]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
96 #DEFINE infolength_decoplan .15 ; [byte]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
97 #DEFINE infolength_cns .2 ; [byte]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
98 #DEFINE infolength_tank .0 ; [byte]
0
heinrichsweikamp
parents:
diff changeset
99
heinrichsweikamp
parents:
diff changeset
100 ; "Better Gas" behavior
heinrichsweikamp
parents:
diff changeset
101 ; better_gas_window <= minimum_change_depth !
heinrichsweikamp
parents:
diff changeset
102 ; minimum_change_depth >=5 !
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
103 #DEFINE minimum_change_depth .3 ; [m]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
104 #DEFINE better_gas_window_neg .3 ; [m] (Depth above change depth)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
105 #DEFINE better_gas_window_pos .1 ; [m] (Depth below change depth, if ppO2<opt_ppO2_max)
0
heinrichsweikamp
parents:
diff changeset
106
heinrichsweikamp
parents:
diff changeset
107 ; Dive mode limits and thresholds
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
108 #DEFINE start_dive_threshold .100 ; [cm]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
109 #DEFINE high_altitude_dive_threshold .300 ; [cm]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
110 #DEFINE apnoe_timeout .15 ; [min]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
111 #DEFINE divemode_menuview_timeout .10 ; [s]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
112 #DEFINE divemode_menu_timeout .30 ; [s]
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 559
diff changeset
113
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
114 #DEFINE ppo2_warning_low_lowest .16 ; [cbar] (Min. value) for minimum on OC
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
115 #DEFINE ppo2_warning_low_default .19 ; [cbar] (Default value) for minimum on OC
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
116 #DEFINE ppo2_warning_low_highest .21 ; [cbar] (Max. value) for minimum on OC
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
117
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
118 #DEFINE ppo2_warning_loop_lowest .20 ; [cbar] (Min. value) for minimum on loop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
119 #DEFINE ppo2_warning_loop_default .40 ; [cbar] (Default Value) for minimum on loop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
120 #DEFINE ppo2_warning_loop_highest .60 ; [cbar] (Max. value) for minimum on loop
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 559
diff changeset
121
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
122 #DEFINE ppo2_warning_high_lowest .120 ; [cbar] (Min. value) for maximum in none-deco phase
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
123 #DEFINE ppo2_warning_high_default .140 ; [cbar] (Default value) for maximum in none-deco phase
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
124 #DEFINE ppo2_warning_high_highest .160 ; [cbar] (Max. value) for maximum in none-deco phase
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 559
diff changeset
125
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
126 #DEFINE ppo2_warning_deco_lowest .120 ; [cbar] (Min. value) for maximum in deco phase
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
127 #DEFINE ppo2_warning_deco_default .160 ; [cbar] (Default Value) for maximum in deco phase
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
128 #DEFINE ppo2_warning_deco_highest .160 ; [cbar] (Max. value) for maximum in deco phase
192
efe70488a04b voting logic for external monitoring
heinrichsweikamp
parents: 189
diff changeset
129
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
130 #DEFINE depth_warn_mbar .13000 ; [mbar]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
131 #DEFINE wake_up_from_sleep .1160 ; [mbar]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
132 #DEFINE simulator_timeout .15 ; [s]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
133
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
134 #DEFINE sensor_voting_logic_threshold .10 ; Threshold in 0.01bar
0
heinrichsweikamp
parents:
diff changeset
135
heinrichsweikamp
parents:
diff changeset
136 ; Surface mode limits and thresholds
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
137 #DEFINE high_altitude_threshold .880 ; [mbar]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
138 #DEFINE max_surfpressure .1080 ; [mbar]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
139 #DEFINE timeout_surfacemode .90 ; [s]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
140 #DEFINE timeout_calibrate_menu .240 ; [s]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
141 #DEFINE timeout_ccr_surface .240 ; [s]
0
heinrichsweikamp
parents:
diff changeset
142
heinrichsweikamp
parents:
diff changeset
143 ; Decomodel paramters
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
144 #DEFINE deco_distance .10 ; [dm]
0
heinrichsweikamp
parents:
diff changeset
145
heinrichsweikamp
parents:
diff changeset
146 ; Color-code parameters for the divemode
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
147 #DEFINE color_code_velocity_warn_high .11 ; [m/min]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
148 #DEFINE color_code_velocity_attn_high .10 ; [m/min]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
149 #DEFINE velocity_display_threshold_1 .3 ; [m/min]
0
heinrichsweikamp
parents:
diff changeset
150
heinrichsweikamp
parents:
diff changeset
151 ; Battery thresholds
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
152 #DEFINE lithium_36v_empty .2400 ; [mV] Saft 3,6V LS14500 AA - threshold for battery percent display
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
153 #DEFINE lithium_36v_low .2000 ; [mV] (Must be bigger then aa_15v_high!)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
154 #DEFINE aa_15v_high .1550 ; [mV] Energizer 1,5V E2 AA
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
155 #DEFINE aa_15v_low .1100 ; [mV] According to Energizer Datasheet EBC-4201R, Page 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
156 #DEFINE color_code_battery_low .10 ; [%]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
157 #DEFINE battery_show_level .24 ; [%]
0
heinrichsweikamp
parents:
diff changeset
158
92
7ca1105751c7 add sensor calibration option (PC only), some cleanup
heinrichsweikamp
parents: 89
diff changeset
159 ; 3,6V battery sensing data points at 70mA load
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
160 #DEFINE lithium_36v_75 .3000 ; [mV]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
161 #DEFINE lithium_36v_50 .2900 ; [mV]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
162 #DEFINE lithium_36v_25 .2600 ; [mV]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
163 #DEFINE lithium_36v_10 .2500 ; [mV]
448
aadfe9f2edaf work on new battery options
heinrichsweikamp
parents: 445
diff changeset
164
aadfe9f2edaf work on new battery options
heinrichsweikamp
parents: 445
diff changeset
165 ; Capacity for 2.4Ah Saft LS14500 and 0.8Ah Panasonic UR14500P
aadfe9f2edaf work on new battery options
heinrichsweikamp
parents: 445
diff changeset
166 ; battery_gauge:6 is nAs
aadfe9f2edaf work on new battery options
heinrichsweikamp
parents: 445
diff changeset
167 ; devide through 65536
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 559
diff changeset
168 ; a) devide through 364 -> Result is in percent of a 2.4Ah Battery
448
aadfe9f2edaf work on new battery options
heinrichsweikamp
parents: 445
diff changeset
169 ; or b) devide through 121 -> Result is in percent of a 0.8Ah Battery
37
0e1723f2761e use four additional data points for the battery monitor
mh@mh-THINK.fritz.box
parents: 35
diff changeset
170
448
aadfe9f2edaf work on new battery options
heinrichsweikamp
parents: 445
diff changeset
171 ; For internal battery gauging
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
172 #DEFINE internal_saft_capacity .364
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
173 #DEFINE internal_panasonic_capacity .121
448
aadfe9f2edaf work on new battery options
heinrichsweikamp
parents: 445
diff changeset
174
aadfe9f2edaf work on new battery options
heinrichsweikamp
parents: 445
diff changeset
175 ; For gauge IC
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
176 #DEFINE saft_capacity .281 ; 2.4Ah/0.085mAh/100 [%]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
177 #DEFINE saft_offset .37300 ; 65536-(2.4Ah/0.085mAh)
448
aadfe9f2edaf work on new battery options
heinrichsweikamp
parents: 445
diff changeset
178
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
179 #DEFINE panasonic_capacity .94 ; 0.8Ah/0.085mAh/100 [%]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
180 #DEFINE panasonic_offset .56124 ; 65536-(0.8Ah/0.085mAh)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
181
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
182 #DEFINE ncr18650_capacity .364 ; 3.1Ah/0.085mAh/100 [%]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
183 #DEFINE ncr18650_offset .29065 ; 65536-(3.1Ah/0.085mAh)
448
aadfe9f2edaf work on new battery options
heinrichsweikamp
parents: 445
diff changeset
184
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
185 #DEFINE ur16650_capacity .271 ; 2.3Ah/0.085mAh/100 [%]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
186 #DEFINE ur16650_offset .38477 ; 65536-(2.3Ah/0.085mAh)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
187
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
188 #DEFINE current_sleepmode .31
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
189 #DEFINE current_backlight_multi .115 ; * CCPR1L + current_backlight_offset
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
190 #DEFINE current_backlight_offset .216
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
191 #DEFINE current_speed_eco .1914
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
192 #DEFINE current_speed_normal .4027
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
193 #DEFINE current_speed_fastest .5050
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
194 #DEFINE current_ir_receiver .139
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
195 #DEFINE current_compass .28
0
heinrichsweikamp
parents:
diff changeset
196
heinrichsweikamp
parents:
diff changeset
197 ; Brightness thresholds (between zero (off) and 255 (max. power))
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
198 #DEFINE ambient_light_max_high_36V .170
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
199 #DEFINE ambient_light_max_high_cr .240
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
200 #DEFINE ambient_light_max_high_15V .140
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
201 #DEFINE ambient_light_min_high .35
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
202 #DEFINE ambient_light_max_medium .125
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
203 #DEFINE ambient_light_min_medium .25
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
204 #DEFINE ambient_light_max_eco .70
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
205 #DEFINE ambient_light_min_eco .10 ; must be the lowest value!
0
heinrichsweikamp
parents:
diff changeset
206
heinrichsweikamp
parents:
diff changeset
207 ; IR Link timeout
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
208 #DEFINE ir_timeout_value .64 ; multiples of 62,5ms
0
heinrichsweikamp
parents:
diff changeset
209
352
5c6da9fa5cb0 add setpoint change to first sample in CCR mode
heinrichsweikamp
parents: 344
diff changeset
210 ; Sp control constants
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
211 #DEFINE surface_sp .50 ; in cbar
352
5c6da9fa5cb0 add setpoint change to first sample in CCR mode
heinrichsweikamp
parents: 344
diff changeset
212
0
heinrichsweikamp
parents:
diff changeset
213 ; Gaslist hard-coded limits
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
214 #DEFINE gaslist_min_o2 .5 ; Minimum O2 [%]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
215 #DEFINE gaslist_max_He .100-gaslist_min_o2 ; Maximum He [%]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
216
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
217 #DEFINE gaslist_max_change_depth .99 ; Max. change depth [m]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
218 #DEFINE gaslist_sp_stepsize .10 ; Steps for Setpoint Setup [cbar]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
219 #DEFINE gaslist_sp_max .160 ; Max. Setpoint [cbar]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
220 #DEFINE gaslist_sp_min .50 ; Min. Setpoint [cbar]
0
heinrichsweikamp
parents:
diff changeset
221
16
7b06f20881be calm compass reading for minor heading changes
heinrichsweikamp
parents: 15
diff changeset
222 ; Compass display
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
223 #DEFINE compass_fast_treshold .9 ; show new heading instantly if new and old > compass_fast_treshold
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
224 #DEFINE compass_averaging .10 ; numbers of extra averaging
0
heinrichsweikamp
parents:
diff changeset
225
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
226 ; Bit Masks for communication with p2_deco.c - char_O_deco_status
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
227 #define DECO_STATUS_MASK .3
0
heinrichsweikamp
parents:
diff changeset
228
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
229 ; Bit Flags for communication with p2_deco.c - char_O_deco_status
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
230 #define DECO_STATUS_0_FLAG .0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
231 #define DECO_STATUS_1_FLAG .1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
232 #define DECO_MODE_LOOP_FLAG .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
233 #define DECO_MODE_PSCR_FLAG .3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
234 #define DECO_PLAN_FLAG .4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
235 #define DECO_CNS_FLAG .5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
236 #define DECO_VOLUME_FLAG .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
237 #define DECO_ASCENT_FLAG .7
0
heinrichsweikamp
parents:
diff changeset
238
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
239 ; Bit Flags for communication with p2_deco.c - char_O_main_status
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
240 ; .0 ; unused
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
241 ; .1 ; unused
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
242 ; DECO_MODE_LOOP_FLAG .2 ; defined below, also used for char_O_main_status
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
243 ; DECO_MODE_PSCR_FLAG .3 ; defined below, also used for char_O_main_status
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
244 #define DECO_GASCHANGE_OVRD .4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
245 ; .5 ; unused
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
246 #define DECO_BOTTOM_FLAG .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
247 ; .7 ; unused
0
heinrichsweikamp
parents:
diff changeset
248
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
249 ; Bit Values for communication with p2_deco.c
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
250 #define DECO_STATUS_INIT .3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
251 #define DECO_MODE_LOOP .4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
252 #define DECO_MODE_PSCR .8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
253 #define DECO_PLAN_ALTERNATE .16
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
254 #define DECO_CNS_CALCULATE .32
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
255 #define DECO_VOLUME_CALCULATE .64
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
256 #define DECO_ASCENT_DELAYED .128
268
29acdb601548 BUGFIX: Increase timing tolerance for S8 HUD (cR only)
heinrichsweikamp
parents: 266
diff changeset
257
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
258 ; Bit Flags for char_O_deco_warnings
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
259 #define IBCD_warning .0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
260 #define IBCD_warning_lock .1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
261 #define mbubble_warning .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
262 #define mbubble_warning_lock .3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
263 #define outside_warning .4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
264 #define outside_warning_lock .5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
265 #define stoptable_overflow .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
266 #define deco_flag .7
0
heinrichsweikamp
parents:
diff changeset
267
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
268 ; Bit Flags for status on CHARs
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
269 #define char_invalid_flag .7
0
heinrichsweikamp
parents:
diff changeset
270
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
271 ; Bit Flags for status on INTs
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
272 #define int_invalid_flag .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
273 #define int_not_yet_computed .3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
274 #define int_is_zero .3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
275 #define int_low_flag .4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
276 #define int_high_flag .5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
277 #define int_attention_flag .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
278 #define int_warning_flag .7
0
heinrichsweikamp
parents:
diff changeset
279
heinrichsweikamp
parents:
diff changeset
280 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
281 ; Flags
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
282
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
283 ; Hardware defines
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
284 #DEFINE battery_gauge_available hardware_flag,0 ; =1: OSTC has rechargeable battery with battery management chip
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
285 #DEFINE ambient_sensor hardware_flag,1 ; =1: OSTC has an ambient light sensor
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
286 #DEFINE analog_o2_input hardware_flag,2 ; =1: OSTC has analog inputs and S8 digital
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
287 #DEFINE optical_input hardware_flag,3 ; =1: OSTC has an digital optical input
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
288 #DEFINE ble_available hardware_flag,4 ; =1: OSTC has an BLE module
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
289 #DEFINE ostc_rx_present hardware_flag,5 ; =1: OSTC RX circuity present
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
290 ; hardware_flag,6 ; unused
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
291 ; hardware_flag,7 ; unused
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
292
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
293 #DEFINE leftbind cvt_flags+0,0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
294 #DEFINE ignore_digit3 cvt_flags+0,1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
295 #DEFINE ignore_digit4 cvt_flags+0,2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
296 #DEFINE ignore_digit5 cvt_flags+0,3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
297 #DEFINE enable_screen_dumps cvt_flags+0,4 ; =1: Ignore vin_usb, wait for "l" command (Screen dump
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
298 #DEFINE screen_type cvt_flags+0,5 ; =1: display1, =0; display0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
299 #DEFINE compass_type cvt_flags+0,6 ; =1: compass1, =0: compass0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
300 #DEFINE analog_switches cvt_flags+0,7 ; =1: Analog switches available
0
heinrichsweikamp
parents:
diff changeset
301
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
302 #define pre_zero_flag cvt_flags+1,0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
303 #define all_zeros_flag cvt_flags+1,1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
304 #define DP_done cvt_flags+1,2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
305 #define DP_done2 cvt_flags+1,3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
306 #define show_last3 cvt_flags+1,4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
307 #define leading_zeros cvt_flags+1,5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
308 #define show_last4 cvt_flags+1,6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
309 #DEFINE compass_type2 cvt_flags+1,7 ; =1: Compass2, =0: Compass1 or compass0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
310
0
heinrichsweikamp
parents:
diff changeset
311
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
312 ; HUD Status Byte
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
313 #DEFINE hud_connection_ok hud_status_byte,0 ; =1 -> HUD connection ok
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
314 ; hud_status_byte,1 ; =1 -> HUD is calibrated
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
315 ; hud_status_byte,2 ; =1 -> HUD Battery is low (<3000mV)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
316 #DEFINE sensor1_active hud_status_byte,3 ; =1: Sensor1 is active
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
317 #DEFINE sensor2_active hud_status_byte,4 ; =1: Sensor2 is active
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
318 #DEFINE sensor3_active hud_status_byte,5 ; =1: Sensor3 is active
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
319 ; hud_status_byte,6 ; unused in stand-alone HUD
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
320 ; hud_status_byte,7 ; unused in stand-alone HUD
0
heinrichsweikamp
parents:
diff changeset
321
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
322 #DEFINE switch_left flag1,0 ; =1: left button was pressed
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
323 #DEFINE switch_right flag1,1 ; =1: right button was pressed
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
324 #DEFINE neg_flag flag1,2 ; e.g. sub16 (sub_c = sub_a - sub_b)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
325 #DEFINE pressure_refresh flag1,3 ; =1: A new pressure/temperature is available
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
326 #DEFINE sleepmode flag1,4 ; =1: in Sleepmode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
327 #DEFINE tft_is_dimming flag1,5 ; =1: the TFT is dimming, ignore light sensor
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
328 #DEFINE display_velocity flag1,6 ; =1: show velocity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
329 #DEFINE no_sensor_int flag1,7 ; =1: block any further access to pressure sensor
0
heinrichsweikamp
parents:
diff changeset
330
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
331 #DEFINE rs232_receive_overflow flag2,0 ; =1: a RS232 timeout overflow occoured
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
332 #DEFINE stored_gas_changed flag2,1 ; =1: Stored Gas changed
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
333 #DEFINE high_altitude_mode flag2,2 ; =1: unit was manually turned on with ambient pressure <880mbar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
334 #DEFINE FLAG_apnoe_mode flag2,3 ; =1: Apnoe mode selected
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
335 #DEFINE restore_deco_data flag2,4 ; =1: restore deco data (After simulation)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
336 #DEFINE premenu flag2,5 ; =1: Premenu/Divemenu selected
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
337 #DEFINE menubit flag2,6 ; menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
338 #DEFINE simulatormode_active flag2,7 ; =1: simulator mode active, override pressure sensor readings
0
heinrichsweikamp
parents:
diff changeset
339
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
340 #DEFINE divemode_menu flag3,0 ; =1: divemode menu is shown
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
341 #DEFINE onesecupdate flag3,1 ; =1: after any second
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
342 #DEFINE twosecupdate flag3,2 ; =1: new two-second update
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
343 #DEFINE toggle_customview flag3,3 ; =1: next customview
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
344 #DEFINE oneminupdate flag3,4 ; =1: after any minute
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
345 #DEFINE divemode flag3,5 ; =1: in Divemode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
346 #DEFINE battery_is_36v flag3,6 ; =1: 3,6V Battery is in use
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
347 #DEFINE warning_active flag3,7 ; =1: a warning is active in divemode or surfacemode
0
heinrichsweikamp
parents:
diff changeset
348
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
349 #DEFINE better_gas_available flag4,0 ; =1: a better gas is available
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
350 #DEFINE blinking_better_gas flag4,1 ; =1: gas is blinking
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
351 #DEFINE menuview flag4,2 ; =1: a menuview is shown in divemode (e.g. "Menu?")
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
352 #DEFINE quarter_second_update flag4,3 ; =1: a new 1/4 second has begun
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
353 #DEFINE divemode_gaschange flag4,4 ; =1: the gas will change very soon
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
354 #DEFINE decostop_active flag4,5 ; =1: decompression stop shown
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
355 #DEFINE depth_greater_100m flag4,6 ; =1: current depth > 100m
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
356 #DEFINE realdive flag4,7 ; =1: a real dive during divemode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
357
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
358 #DEFINE dive_warning_displayed flag5,0 ; =1: the warning sign is shown
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
359 #DEFINE reset_average_depth flag5,1 ; =1: reset the average depth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
360 #DEFINE store_sample flag5,2 ; =1: store a new sample
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
361 #DEFINE divemode2 flag5,3 ; =1: dive longer than one minute
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
362 #DEFINE FLAG_active_descent flag5,4 ; used in Apnoe mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
363 #DEFINE event_occured flag5,5 ; =1: an event occured, store it!
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
364 #DEFINE divemode_menu_active flag5,6 ; =1: the divemode menu is shown
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
365 #DEFINE temp_changed flag5,7 ; =1: the temperature changed
0
heinrichsweikamp
parents:
diff changeset
366
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
367 #DEFINE gas6_changed flag6,0 ; =1: gas 6 has been selected/changed underwater
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
368 #DEFINE onehourupdate flag6,1 ; =1: a new hour has just begun
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
369 #DEFINE settime_setdate flag6,2 ; =1: in the Set Time or Set Date Menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
370 #DEFINE setpoint_changed flag6,3 ; =1: setpoint has been changed
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
371 #DEFINE second_row_warning flag6,4 ; =1: the second row contains a warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
372 #DEFINE FLAG_ccr_mode flag6,5 ; =1: CCR mode (fixed ppO2 or sensor) active
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
373 #DEFINE FLAG_back_to_loop flag6,6 ; =1: a switchback from bailout to loop occured
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
374 #DEFINE FLAG_set_marker flag6,7 ; =1: set a marker in the logbook
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
375
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
376 ; flag7,0 ; unused
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
377 #DEFINE no_more_divesecs flag7,1 ; =1: Do no longer show seconds in divemode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
378 #DEFINE FLAG_gauge_mode flag7,2 ; =1: In Gauge mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
379 #DEFINE ignore_last_edited_gas flag7,3 ; Used in gaslist_cleanup_list
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
380 #DEFINE ccr_diluent_setup flag7,4 ; =1: Setting up Diluents ("Gas6-10")
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
381 #DEFINE space_gas_decriptions flag7,5 ; =1: add a space in front of gas numbers < 9 for alignment
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
382 #DEFINE short_gas_decriptions flag7,6 ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
383 #DEFINE max_depth_greater_100m flag7,7 ; =1: Max. Depth > 100m
0
heinrichsweikamp
parents:
diff changeset
384
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
385 #DEFINE is_bailout flag8,0 ; =1: Bailout
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
386 #DEFINE is_bailout_menu flag8,1 ; =1: Bailout
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
387 #DEFINE toggle_gf flag8,2 ; =1: Toggle GF/aGF
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
388 #DEFINE use_agf flag8,3 ; =1: Use aGF (instead of GF)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
389 #DEFINE battery_removed_in_usb flag8,4 ; =1: The battery has been removed in USB (probably not used for anything useful)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
390 #DEFINE adc_running flag8,5 ; =1: The ADC is in use
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
391 #DEFINE comm_service_enabled flag8,6 ; =1: COMM Service mode unlocked
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
392 #DEFINE compass_enabled flag8,7 ; =1: The compass and accelerometer chip is active
113
heinrichsweikamp
parents: 111
diff changeset
393
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
394 #DEFINE compass_fast_mode flag9,0 ; =1: The compass is in fast mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
395 #DEFINE in_color_menu flag9,1 ; =1: In the color scheme menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
396 #DEFINE bailoutgas_event flag9,2 ; =1: bailout was selected or a gaschange during bailout
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
397 #DEFINE win_invert flag9,3 ; =1: Invert font output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
398 #DEFINE show_safety_stop flag9,4 ; =1: Show the safety stop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
399 #DEFINE safety_stop_active flag9,5 ; =1: The safety stop is currently displayed
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
400 #DEFINE new_s8_data_available flag9,6 ; =1: New data frame received
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
401 #DEFINE print_compass_label flag9,7 ; =1: print the graphical comapss label
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
402
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
403 #DEFINE s8_digital flag10,0 ; =1: Digital I/O
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
404 #DEFINE menu_show_sensors2 flag10,1 ; =1: Update mV data in calibration menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
405 #DEFINE use_O2_sensor1 flag10,2 ; =1: Use this sensor
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
406 #DEFINE use_O2_sensor2 flag10,3 ; =1: Use this sensor
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
407 #DEFINE use_O2_sensor3 flag10,4 ; =1: Use this sensor
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
408 #DEFINE setpoint_fallback flag10,5 ; =1: Fallback to SP1 due to external O2 sensor failure
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
409 #DEFINE blinking_setpoint flag10,6 ; =1: SP is blinking
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
410 #DEFINE flip_screen flag10,7 ; =1: Screen is flipped by 180°
189
e79bc535ef9e ignore un-calibrated sensors even if they become valid
heinrichsweikamp
parents: 188
diff changeset
411
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
412 #DEFINE sensor1_calibrated_ok flag11,0 ; =1: This sensor has been calibrated ok
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
413 #DEFINE sensor2_calibrated_ok flag11,1 ; =1: This sensor has been calibrated ok
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
414 #DEFINE sensor3_calibrated_ok flag11,2 ; =1: This sensor has been calibrated ok
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
415 #DEFINE voting_logic_sensor1 flag11,3 ; =1: This sensor is within the voting logic threshold
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
416 #DEFINE voting_logic_sensor2 flag11,4 ; =1: This sensor is within the voting logic threshold
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
417 #DEFINE voting_logic_sensor3 flag11,5 ; =1: This sensor is within the voting logic threshold
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
418 #DEFINE cc_active flag11,6 ; =1: Constant Current active (cR Hardware)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
419 #DEFINE cv_active flag11,7 ; =1: Constant Voltage active (cR Hardware)
250
20e3bad0b0f2 Graphical compass from kovacs
heinrichsweikamp
parents: 239
diff changeset
420
587
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 582
diff changeset
421 #DEFINE neg_flag_velocity flag12,0 ; neg_flag backup for velocity logic
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
422 #DEFINE compass_bearing_eq flag12,1 ; bearing is in direction? do not show << or >>
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
423 #DEFINE compass_bearing_lft flag12,2 ; bearing is to the left/<< if set, otherwise to the right/>>
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
424 #DEFINE compass_bearing_vis flag12,3 ; bearing is visible? (either ahead or behind/-180°)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
425 #DEFINE compass_bearing_ahd flag12,4 ; bearing is ahead or behind?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
426 #DEFINE blinking_depth_warning flag12,5 ; set by the color_depth. =1: warning color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
427 #DEFINE blinking_depth_prev flag12,6 ; set by the TFT_depth. =1: prev display had warning color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
428 #DEFINE blinking_depth_toggle flag12,7 ; toggle to blink
255
ad62dff7739a add bearing option to compass
heinrichsweikamp
parents: 254
diff changeset
429
587
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 582
diff changeset
430 #DEFINE compass_bearing_set flag13,0 ; bearing set
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
431 #DEFINE analog_sw1_pressed flag13,1 ; =1: Analog switch 1 pressed
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
432 #DEFINE analog_sw2_pressed flag13,2 ; =1: Analog switch 2 pressed
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
433 #DEFINE sp2_switched flag13,3 ; =1: This setpoint has been autoselected already
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
434 #DEFINE sp3_switched flag13,4 ; =1: This setpoint has been autoselected already
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
435 #DEFINE sp4_switched flag13,5 ; =1: This setpoint has been autoselected already
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
436 #DEFINE sp5_switched flag13,6 ; =1: This setpoint has been autoselected already
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
437 #DEFINE use_old_batt_flag flag13,7 ; =1: load old battery information after power-on reset
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
438
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
439 #DEFINE FLAG_pscr_mode flag14,0 ; =1: OSTC is in PSCR mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
440 #DEFINE deep_sleep flag14,1 ; =1: OSTC is in deep sleep (ignore buttons, etc)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
441 #DEFINE sensors_agree flag14,2 ; =1: the ppO2 of all sensors are within the threshold range
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
442 #DEFINE gas_needs_attention flag14,3 ; =1: the gas needs attention has been raised before
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
443 #DEFINE gas_needs_warning flag14,4 ; =1: the gas needs warning has been raised before
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
444 #DEFINE sensor_warning flag14,5 ; =1: the sensors disagree warning has been raised before
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
445 #DEFINE alternative_divelayout flag14,6 ; =1: the alternative divelayout is used (aka Blind Mode)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
446 #DEFINE i2c_error_flag flag14,7 ; =1: an I2C error occured
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
447
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
448 #define aa_antialias aa_flags,0 ; used by aa_wordprocessor
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
449 #define aa_color_quart aa_flags,1 ; used by aa_wordprocessor
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
450 #define aa_color_half aa_flags,2 ; used by aa_wordprocessor
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
451 ; aa_flags,3 ; unused
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
452 ; aa_flags,4 ; unused
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
453 ; aa_flags,5 ; unused
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
454 ; aa_flags,6 ; unused
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
455 ; aa_flags,7 ; unused
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 559
diff changeset
456
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 559
diff changeset
457
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 559
diff changeset
458 ; Update flags in divemode, =1: Update the screen
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
459 #DEFINE FLAG_TFT_divemode_mask tft_update_flags+0,0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
460 #DEFINE FLAG_TFT_display_ndl_mask tft_update_flags+0,1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 559
diff changeset
461 #DEFINE FLAG_TFT_depth tft_update_flags+0,2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 559
diff changeset
462 #DEFINE FLAG_TFT_divemins tft_update_flags+0,3
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
463 #DEFINE FLAG_TFT_show_safety_stop tft_update_flags+0,4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
464 #DEFINE FLAG_TFT_display_ndl tft_update_flags+0,5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
465 #DEFINE FLAG_TFT_display_deko_mask tft_update_flags+0,6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
466 #DEFINE FLAG_TFT_display_deko tft_update_flags+0,7
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
467 #DEFINE FLAG_TFT_display_tts tft_update_flags+1,0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
468 #DEFINE FLAG_TFT_temp_divemode tft_update_flags+1,1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
469 #DEFINE FLAG_TFT_divemode_warning tft_update_flags+1,2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
470 #DEFINE FLAG_TFT_divemode_warning_clear tft_update_flags+1,3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
471 #DEFINE FLAG_TFT_active_gas_divemode tft_update_flags+1,4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
472 #DEFINE FLAG_TFT_clear_safety_stop tft_update_flags+1,5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
473 #DEFINE FLAG_TFT_max_depth tft_update_flags+1,6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
474 #DEFINE FLAG_TFT_divemode_mask_alt tft_update_flags+1,7
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
475 #DEFINE FLAG_TFT_dive_warning_text_clear tft_update_flags+2,0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
476 #DEFINE FLAG_TFT_dive_warning_text_clr2 tft_update_flags+2,1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
477 #DEFINE FLAG_TFT_max_depth_alt tft_update_flags+2,2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
478 #DEFINE FLAG_TFT_big_deco_alt tft_update_flags+2,3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
479 ; tft_update_flags+2,4 ; unused
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
480 ; tft_update_flags+2,5 ; unused
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
481 ; tft_update_flags+2,6 ; unused
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
482 ; tft_update_flags+2,7 ; unused
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
483
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
484
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
485 ;---------------------------- Macros ------------------------------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
486
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
487 TSTOSS macro opt_reg ; TeST Option Skip if not Zero
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
488 movff opt_reg,WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
489 tstfsz WREG,A
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
490 bra $+4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
491 endm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
492
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
493 ;---------------------------- C-code Routines ----------------------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
494
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
495 extern deco_calc_desaturation_time
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
496 extern deco_calc_hauptroutine
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
497 extern deco_calc_dive_interval_1min
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
498 extern deco_calc_dive_interval_10min
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
499 extern deco_calc_dive_interval
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
500 extern deco_clear_tissue
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
501 extern deco_pull_tissues_from_vault
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
502 extern deco_push_tissues_to_vault
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 559
diff changeset
503
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 559
diff changeset
504
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
505 ;---------------------------- Bank0 DATA ------------------------------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
506 isr_backup equ 0x60
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
507 isr_backup udata_ovr isr_backup ; Reserved space for interupt data
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
508
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
509 ;---- Backup for general registers
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
510 isr_prod res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
511
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
512 ;---- MS5541 subroutines
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
513 amb_pressure res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
514 temperature res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
515
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
516 C1 res 2 ; Decoded calibration data
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
517 C2 res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
518 C3 res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
519 C4 res 2 ; Here: C4-250
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
520 C5 res 2 ; Here: Reference Temperature UT1 = 8*C5 + 10000 (u16 range 10.000 .. +42.760)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
521 C6 res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
522 D1 res 2 ; raw pressure
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
523 D2 res 2 ; raw temperature
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
524 xdT res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
525 xdT2 res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
526 OFF res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
527 SENS res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
528 dLSB res 1 ; Pressure sensor interface
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
529 dMSB res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
530 clock_count res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
531 sensor_state_counter res 1 ; counts to eight for state maschine
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
532 amb_pressure_avg res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
533 temperature_avg res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
534 minimum_temperature res 2 ; minimum temperature
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
535 last_temperature res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
536 last_pressure res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
537 last_pressure_velocity res 2 ; For velocity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
538 last_surfpressure res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
539 last_surfpressure_15min res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
540 last_surfpressure_30min res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
541 rel_pressure res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
542 sim_pressure res 2 ; hold simulated pressure in mbar if in Simulator mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
543 max_pressure res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
544 avg_rel_pressure res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
545 avg_rel_pressure_total res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
546
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
547 ;---- Data for ISR math subroutines
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
548 isr_xC res 4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
549 isr_xA res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
550 isr_xB res 2
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 559
diff changeset
551
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
552 ;---- Data for ISR routines
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
553 isr1_temp res 1 ; ISR temp variable, used in ms5541.asm, isr_rtcc, isr_battery_gauge
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
554 isr2_temp res 1 ; ISR temp variable, used isr_battery_gauge
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
555
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
556 ;---- Display brightness
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
557 max_CCPR1L res 1 ; Max. brightness value for CCPR1L
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
558
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
559 ; Battery gauge (nAs, nC)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
560 battery_gauge res 6 ; 48Bit -> 78Ah max...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
561
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
562 ; IR/S8-Link
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
563 ir_s8_buffer res .18 ; temporally used in get_calibration_data for the raw (packed) calibration data
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
564 ir_s8_counter res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
565 ir_s8_timeout res 1 ; Timeout for valid data
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
566
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
567 ; Compass raw data
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
568 compass_DX res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
569 compass_DY res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
570 compass_DZ res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
571
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
572 accel_DX res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
573 accel_DY res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
574 accel_DZ res 2
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 559
diff changeset
575
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
576 ; Compass FILTERED data
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
577 compass_DX_f res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
578 compass_DY_f res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
579 compass_DZ_f res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
580
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
581 accel_DX_f res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
582 accel_DY_f res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
583 accel_DZ_f res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
584
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
585 ; Compass calibration data
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
586 compass_CX_f res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
587 compass_CY_f res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
588 compass_CZ_f res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
589
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
590 ; Compass more data
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
591 compass_heading res 2 ; Corrected heading (in 1°) : -180 .. 180
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
592 compass_heading_old res 2 ; Old heading (For smoother display)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
593 compass_heading_shown res 2 ; Displayed heading
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
594 ;compass_roll res 2 ; Rotation around the X axis
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
595 ;compass_pitch res 2 ; Rotation around the Y axis
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
596
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
597 compass_a res 2 ; Tmp data for Q15 arithmetics
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
598 compass_b res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
599 compass_r res 3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
600
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
601 CNS_start res 2 ; CNS value at beginning of dive
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
602 GF_start res 1 ; GF value at beginning of dive
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
603
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
604 speed_setting res 1 ; =1: Eco, =2: Normal, =3: Fastest
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 559
diff changeset
605
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
606 ;---- Data for graphical compass
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
607 xRD res 2 ; virtual compass ruler offset
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
608 xRDr res 2 ; virtual compass ruler offset - right end
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
609 xRD180 res 2 ; virtual compass ruler offset for the -180 marker
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
610 xLO res 1 ; lo backup to prevent trashing
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
611 xHI res 1 ; hi backup to prevent trashing
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
612 xCM res 1 ; compass bearing relative position
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
613 compass_bearing res 2 ; this is where the bearing menu stores the actual heading for bearing
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
614
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
615 ;---------------------------- Common DATA ------------------------------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
616 common equ 0x100 ; Alias for "banksel common"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
617 common udata_ovr common ; Bank 1 general variables
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
618
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
619 ;---- Time and Date
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
620 secs res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
621 mins res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
622 hours res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
623 day res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
624 month res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
625 year res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
626 surface_interval res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
627
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
628 ;---- State Information
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
629 flag1 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
630 flag2 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
631 flag3 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
632 flag4 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
633 flag5 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
634 flag6 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
635 flag7 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
636 flag8 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
637 flag9 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
638 flag10 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
639 flag11 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
640 flag12 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
641 flag13 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
642 flag14 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
643 hardware_flag res 1 ; hardware descriptor flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
644 tft_update_flags res 3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
645
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
646 ;---- Interface to Data Conversion &
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
647 ;---- Output Functions, as well as
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
648 ;---- General-Purpose Temp Storage
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
649 lo res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
650 hi res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
651 up res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
652 ignore_digits res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
653
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
654 ;---- Interface to Graphic Functions
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
655 win_leftx2 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
656 win_top res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
657 win_width res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
658 win_height res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
659 win_bargraph res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
660 win_color1 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
661 win_color2 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
662 win_font res 1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 559
diff changeset
663
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
664 ;---- Interface to Math Functions
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
665 divA res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
666 divB res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
667 xC res 4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
668 xA res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
669 xB res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
670 sub_c res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
671 sub_a res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
672 sub_b res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
673
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
674 ;---- Misc.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
675 timeout_counter1 res 2 ; timeout for dive operations
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
676 timeout_counter2 res 1 ; timeout for menu operations
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
677 batt_voltage res 2 ; battery voltage in mV
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
678 batt_percent res 1 ; battery in percent (1-100)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
679 warning_counter res 1 ; counts amount of warning in divemode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
680 warning_page res 1 ; current # of warning page
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
681
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
682 ;---- Dive Mode / General
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
683 divemins res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
684 divesecs res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
685 total_divetime_seconds res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
686 average_divesecs res 2 ; for the resettable stopwatch
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
687 safety_stop_countdown res 1 ; counts seconds of safety stop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
688 gaslist_gas res 1 ; used for transfer between gaslist.asm and menu_tree.asm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
689 active_gas res 1 ; the currently breathed gas (1-5)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
690 ;active_gas_type res 1 ; 0=Disabled, 1=First, 2=Travel, 3=Deco for OC gases and 0=Disabled, 1=First, 2=Normal for diluents
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 559
diff changeset
691
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
692 ;---- Dive Mode / Apnoe
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
693 apnoe_surface_mins res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
694 apnoe_surface_secs res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
695 apnoe_mins res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
696 apnoe_secs res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
697 apnoe_max_pressure res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
698
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
699 ;---- Profile Recording
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
700 samplingrate res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
701 samplesecs res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
702 samplesecs_value res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
703 AlarmType res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
704 EventByte1 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
705 EventByte2 res 1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 559
diff changeset
706
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
707 ;---- External Flash
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
708 ext_flash_rw res 1 ; transfer register for data read / write
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
709 ext_flash_address res 3 ; 24 bit address
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
710 ext_flash_log_pointer res 3 ; 24 bit address for logbook profile storing
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
711 ext_flash_end_pointer res 3 ; 24 bit address for logbook profile storing
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
712 ext_flash_dive_counter res 3 ; 24 bit counter for dive length (increased in write_byte_ext_flash_plus)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
713
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
714 ;---- O2 Sensor Data
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
715 o2_mv_sensor1 res 2 ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
716 o2_mv_sensor2 res 2 ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
717 o2_mv_sensor3 res 2 ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
718 o2_ppo2_sensor1 res 1 ; Sensor1 ppO2 (in 0.01bar steps)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
719 o2_ppo2_sensor2 res 1 ; Sensor2 ppO2 (in 0.01bar steps)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
720 o2_ppo2_sensor3 res 1 ; Sensor3 ppO2 (in 0.01bar steps)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
721 hud_status_byte res 1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 559
diff changeset
722
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 559
diff changeset
723
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
724 ;========================= privte Variables ===================================
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
725 ; do not access from outside of the respective source files!
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 559
diff changeset
726
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
727 ;---- aa_wordprocessor.asm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
728 aa_flags res 1 ; various flags for aa_wordprocessor
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
729 aa_bitlen res 1 ; count of pixels when decoding bitmaps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
730 aa_start res 2 ; PROM ptr to start of encoded bitmap
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
731 aa_end res 2 ; and end of it
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
732 aa_temp res 2 ; current color, divided by 2 or 4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
733
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
734 ;--- adc_lightsensor.asm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
735 get_bat_volt_counter res 1 ; counter for 10x reading the charger chip
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
736
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
737 ;---- convert.asm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
738 cvt_flags res 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
739 cvt_temp1 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
740 cvt_temp2 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
741 cvt_temp3 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
742 cvt_temp4 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
743 lo_temp res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
744 hi_temp res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
745
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
746 ;---- color_processor.asm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
747 img_pixels res 3 ; used by color_processor.asm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
748 img_count res 2 ; used by color_processor.asm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
749
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
750 ;---- comm.asm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
751 comm_timeout res 1 ; timeout for communication
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
752
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
753 ;---- eeprom_rs232.asm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
754 uart1_temp res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
755 uart2_temp res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
756 uart3_temp res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
757
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
758 ;---- i2c.asm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
759 i2c_temp1 res 1 ; temporary data
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
760 i2c_temp2 res 1 ; temporary data
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
761
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
762 ;---- menu_processor.asm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
763 menupos1 res 1 ; logbook and divemode menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
764 menupos2 res 1 ; used for dive mode simulator and pre-menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
765 menupos3 res 1 ; used for Customviews
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
766 menupos4 res 1 ; used for divemode menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
767 menu_flags res 1 ; flags for menu entries
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
768 menu_item res 1 ; index of the current item
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
769 start_item res 1 ; index of the first item (scrolling)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
770 item_max res 1 ; number of items in menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
771 selected_item res 1 ; index of the current item
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
772 value_type res 1 ; type for vertical menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
773 dynamic_item res 3 ; callback addr
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
774 menu_block res 3 ; address of the menu block (i.e. item 0)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
775 menu_title res 3 ; text or proc for dynamic menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
776 menu_center res 1 ; centering for line menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
777 proc_item res 3 ; address of the current proc
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
778 text_item res 2 ; address of the current text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
779
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
780 ;---- options.asm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
781 opt_type res 1 ;
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
782 opt_default res 1 ;
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
783 opt_inc res 1 ; also used for default+1 (string) and enum low
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
784 opt_min res 1 ; also used for enum high
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
785 opt_max res 1 ;
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
786 opt_unit res 2 ; multi-lingual unit text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
787 opt_eeprom res 1 ;
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
788 opt_backup_tbl res 3 ; buffer for table pointer
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
789
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
790 ;---- tft.asm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
791 save_top res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
792 save_height res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
793 save_left res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
794 save_width res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
795 ds_line res 1 ; current line (0..239)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
796 ds_column res 1 ; current columnx2 (0..159)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
797 ds_pixel res 2 ; current pixel color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
798 ds_count res 1 ; repetition count
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
799 tft_temp1 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
800 tft_temp2 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
801 tft_temp3 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
802 tft_temp4 res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
803
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
804 ;---- wait.asm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
805 wait_counter res 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
806
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
807 ; ==> 187 bytes used - 21 bytes free
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
808
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
809
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
810 ;============================ LOCAL DATA ======================================
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
811 ; Space for various overlayed local data from top-level applications,
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
812 ; i.e. applications that never run in parallel to each other
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
813 ;
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
814 ; --------------------- local Data Users --------------------------------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
815 ; -------------- Applications using -------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
816 ; Mode local1 local2 local3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
817 ; -----------------------------------------------------------------------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
818 ; sleepmode sleepmode.asm (unused) (unused)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
819 ; surfmode surfmode.asm* (unused) (unused)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
820 ; simulator simulator.asm (unused) (unused)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
821 ; divemode divemode.asm ghostwriter.asm (unused)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
822 ; logbook logboock.asm logbook.asm logbook.asm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
823 ;
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
824 ; * assigned to this slot, but currently no local memory used
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
825
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
826 local1 equ 0x1D0 ; Alias for CBLOCK directive
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
827 local1 udata_ovr 0x1D0 ; Bank1 shared local space
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
828 res 0x10 ; 16 Byte (0x1D0 ... 0x1DF)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
829
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
830 local2 equ 0x1E0 ; Alias for CBLOCK directive
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
831 local2 udata_ovr 0x1E0 ; Bank1 shared local space
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
832 res 0x10 ; 16 Byte (0x1E0 ... 0x1EF)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
833
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
834 local3 equ 0x1F0 ; Alias for CBLOCK directive
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
835 local3 udata_ovr 0x1F0 ; Bank1 shared local space
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
836 res 0x10 ; 16 Byte (0x1F0 ... 0x1FF)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
837
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
838
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
839 ;---------------------------- Common2 DATA ------------------------------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
840 common2 equ 0xA00 ; Alias for "banksel common2"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
841 common2 udata_ovr common2 ; Bank 10 general variables
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
842
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
843 s8_rawdata_sensor1 res 3 ; 24bit A/D raw data from S8 HUD sensor 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
844 s8_rawdata_sensor2 res 3 ; 24bit A/D raw data from S8 HUD sensor 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
845 s8_rawdata_sensor3 res 3 ; 24bit A/D raw data from S8 HUD sensor 3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
846 hud_battery_mv res 2 ; hud/ppo2 monitor battery voltage in mV
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
847
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
848 start_day res 1 ; At start of dive (For logbook)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
849 start_month res 1 ; At start of dive (For logbook)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
850 start_year res 1 ; At start of dive (For logbook)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
851 start_hours res 1 ; At start of dive (For logbook)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
852 start_mins res 1 ; At start of dive (For logbook)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
853
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
854 opt_gas_type_backup res 5 ; 0=Disabled, 1=First, 2=Travel, 3=Deco * need to be in same bank
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
855 opt_dil_type_backup res 5 ; 0=Disabled, 1=First, 2=Normal + need to be in same bank
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
856 opt_OC_bail_gas_change_backup res 5 ; Gas change depths OC/Bailout *
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
857 opt_dil_change_backup res 5 ; Gas change depths Diluents +
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
858
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
859 internal_battery_capacity res 2 ; For internal battery gauging
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
860 battery_capacity res 2 ; For battery gauge IC
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
861 battery_offset res 2 ; For battery gauge IC
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
862 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
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
863 battery_acumulated_charge res 2 ; Raw values in battery gauge IC
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
864 gauge_status_byte res 1 ; Gauge IC status byte
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
865
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
866 analog_sw1_raw res 2 ; idle values (average)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
867 analog_sw2_raw res 2 ; idle values (average)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
868 analog_counter res 1 ; for averaging
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
869 analog_sw1 res 1 ; analog value for switch 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
870 analog_sw2 res 1 ; analog value for switch 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
871 button_polarity res 1 ; 0xFF (Both normal), 0x00 (Both inverted), 0x01 (Left inverted only), 0x02 (Right inverted only)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
872
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
873 uptime res 4 ; Uptime [s]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
874 lastdive_time res 4 ; Time since last dive [s]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
875 lastdive_duration res 3 ; mins:2 and secs
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
876 lastdive_maxdepth res 2 ; in mbar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
877
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
878 rx_buffer res .48 ; Buffer for RX data (Slots 0-7)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
879 rx_firmware res 2 ; The RX firmware version xx.yy
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
880
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
881 customview_surfmode res 1 ; storage to remember last selected custom view in surface mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
882 customview_divemode res 1 ; storage to remember last selected custom view in dive mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
883
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
884 ambient_light res 2 ; ambient_light level
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
885 better_gas_number res 1 ; number (1-5) of the "better gas" in divemode, =0: no better gas available
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
886 old_velocity res 4 ; Stores the last 4 speeds (8 seconds) in m/min
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
887
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
888 menustack res 5 ; menu stack from menu_processor.asm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
889
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
890 gas6_O2_ratio res 1 ; gas6 O2 ratio
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
891 gas6_He_ratio res 1 ; gas6 He ratio
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
892 gas6_temp res 1 ; temp used in divemenu_tree.asm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
893
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
894 ; ==> 134 bytes used - 122 bytes free
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
895
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
896
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
897 ;---------------------------- Bank 2 general purpose buffer -------------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
898 ; Reserved for general purpose buffer (strings, images, etc).
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
899 ; NOTE: Needs to be aligned with a bank (LOW(buffer)==0).
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
900
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
901 buffer udata_ovr 0x200
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
902
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
903 buffer res .256
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
904
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
905
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
906 ;---------------------------- Bank 14 for options table -----------------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
907 opt_table equ 0xE00
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
908 opt_table udata_ovr opt_table
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
909
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
910 ;---- Dive Options
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
911 opt_gas_O2_ratio res 5 ; Needed because deco gaslist use N2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
912 opt_dil_O2_ratio res 5 ; Must be in line with opt_gas_O2_ratio
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
913 opt_gas_He_ratio res 5 ; He ratio Gas1-5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
914 opt_dil_He_ratio res 5 ; Must be in line with opt_gas_He_ratio
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
915 opt_gas_type res 5 ; 0=Disabled, 1=First, 2=Travel, 3=Deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
916 opt_dil_type res 5 ; 0=Disabled, 1=First, 2=Normal ; Must be in line with opt_gas_type
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
917 opt_dive_mode res 1 ; 0=OC, 1=CC, 2=Gauge, 3=Apnea, 4=PSCR
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
918 opt_ccr_mode res 1 ; =0: Fixed SP, =1: Sensor
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
919 opt_OC_bail_gas_change res 5 ; Gas change depths OC/Bailout
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
920
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
921 ;---- Managing Settings
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
922 opt_brightness res 1 ; =0: Eco, =1:Medium, =2:Full
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
923 opt_salinity res 1 ; 0-5%
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
924 #DEFINE opt_name_length .60 ; Custom text string 5 rows with 12 chars
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
925 opt_name res opt_name_length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
926 opt_language res 1 ; Current language. 0=EN, 1=DE, 2=FR, 3=SP
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
927 opt_units res 1 ; 0:m/°C, 1:ft/°F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
928 opt_dateformat res 1 ; =0:MMDDYY, =1:DDMMYY, =2:YYMMDD
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
929 opt_last_stop res 1 ; =3:3m, =4:4m, =5:5m, =6:6m
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
930 opt_aGF_high res 1 ; Alternative GF HIGH
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
931 opt_aGF_low res 1 ; Alternative GF LOW
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
932 opt_GF_high res 1 ; GF HIGH
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
933 opt_GF_low res 1 ; GF LOW
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
934 opt_enable_aGF res 1 ; =1: aGF can be selected underwater
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
935 opt_compass_gain res 1 ; 0-7 (230LSB/Gauss to 1370LSB/Gaus)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
936 opt_sampling_rate res 1 ; =1: 10s, =0: 2s
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
937 opt_dive_color_scheme res 1 ; 0-3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
938 opt_pressure_adjust res 1 ; SIGNED char (two's complement), -20/+20mbar max.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
939 opt_enable_safetystop res 1 ; =1: A safety stop is shown
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
940 opt_calibration_O2_ratio res 1 ; %O2 of calibration gas
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
941 opt_x_s1 res 2 ; calibration factor (Not stored in EEPROM)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
942 opt_x_s2 res 2 ; calibration factor (Not stored in EEPROM)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
943 opt_x_s3 res 2 ; calibration factor (Not stored in EEPROM)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
944 opt_sensor_fallback res 1 ; NOT USED ANY MORE, KEPT FOR COMPATIBILITY WITH EEPROM IMAGE
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
945 opt_flip_screen res 1 ; =1: Flip the screen
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
946 opt_cR_button_left res 1 ; Left button sensitivity (cR hardware)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
947 opt_cR_button_right res 1 ; Right button sensitivity (cR hardware)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
948 opt_modwarning res 1 ; =1:do a red blinking warning, =0:default behaviour
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
949 opt_vsitextv2 res 1 ; =1:use the depth dependent ascend rate limits
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
950 opt_vsigraph res 1 ; =1:draw the graphical VSI bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
951 opt_showppo2 res 1 ; =1:always show the ppO2 value in the warning position
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
952 opt_temperature_adjust res 1 ; SIGNED char (two's complement), -2.0/+2.0 °C max.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
953 opt_safety_stop_length res 1 ; [s]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
954 opt_safety_stop_start res 1 ; [cbar]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
955 opt_safety_stop_end res 1 ; [cbar]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
956 opt_safety_stop_reset res 1 ; [cbar]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
957 opt_diveTimeout res 1 ; Timeout for Divemode [min]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
958 opt_sim_setpoint_number res 1 ; setpoint to use for deco calculation
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
959 opt_calc_asc_gasvolume res 1 ; calculate OC gas volume needs for ascent
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
960 opt_sim_use_aGF res 1 ; =0: use GF, =1: use aGF for deco calculation
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
961 opt_enable_IBCD res 1 ; enable IBCD warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
962 opt_sat_multiplier_gf res 1 ; Buhlmann safety factor for GF deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
963 opt_desat_multiplier_gf res 1 ; Buhlmann safety factor for GF deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
964 opt_sat_multiplier_non_gf res 1 ; Buhlmann safety factor for NON-GF deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
965 opt_desat_multiplier_non_gf res 1 ; Buhlmann safety factor for NON-GF deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
966
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 580
diff changeset
967 ;-----------------------------------------------------------------------------