annotate src/ostc3.inc @ 67:7815bf21d353

second debug mode page
author heinrichsweikamp
date Sat, 11 Jan 2014 22:36:17 +0100
parents 00636132cca6
children 50697bd41c54
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
heinrichsweikamp
parents:
diff changeset
3 ; File ostc3.asm
heinrichsweikamp
parents:
diff changeset
4 ;
heinrichsweikamp
parents:
diff changeset
5 ; OSTC3 Platform definitions
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
heinrichsweikamp
parents:
diff changeset
14 LIST P=18F87K22 ; change also: Configure->SelectDevice from Mplab
heinrichsweikamp
parents:
diff changeset
15
heinrichsweikamp
parents:
diff changeset
16 ;#DEFINE __DEBUG
heinrichsweikamp
parents:
diff changeset
17
heinrichsweikamp
parents:
diff changeset
18 #include <p18f87k22.inc>
heinrichsweikamp
parents:
diff changeset
19 #include <ports.inc> ; Portmap
heinrichsweikamp
parents:
diff changeset
20
44
18fe4e668baa BUGFIX: Percent display with 1,5V batteries
heinrichsweikamp
parents: 43
diff changeset
21 #DEFINE softwareversion_x d'1' ; Software version XX.YY
66
00636132cca6 BUGFIX: Maintain last selected customview in surface mode
heinrichsweikamp
parents: 62
diff changeset
22 #DEFINE softwareversion_y d'12' ; Software version XX.YY
62
e7c7c7eeea58 show battery voltage in info menu
heinrichsweikamp
parents: 61
diff changeset
23 #DEFINE softwareversion_beta 1 ; (and 0 for release)
0
heinrichsweikamp
parents:
diff changeset
24
heinrichsweikamp
parents:
diff changeset
25 #DEFINE comm_service_key 0xABCDEF
heinrichsweikamp
parents:
diff changeset
26
heinrichsweikamp
parents:
diff changeset
27 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
28
heinrichsweikamp
parents:
diff changeset
29 #DEFINE CCP1CON_VALUE b'00001100' ; PWM1 for LED dimming
heinrichsweikamp
parents:
diff changeset
30 #DEFINE T2CON_ECO b'00000100' ; 1:1 Postscaler, 1:1 Prescaler, Timer 2 start -> 980Hz (Good compromise of no-flicker and efficiency)
heinrichsweikamp
parents:
diff changeset
31 #DEFINE T2CON_NORMAL b'00001110'
heinrichsweikamp
parents:
diff changeset
32 #DEFINE T2CON_FASTEST b'00001110' ; 1:2 Postscaler, 1:16 Prescaler, Timer 2 start -> 1960Hz (no-flicker)
heinrichsweikamp
parents:
diff changeset
33
28
heinrichsweikamp
parents: 26
diff changeset
34 #DEFINE TMR0H_VALUE .245 ; RX Timeout (~3ms)
heinrichsweikamp
parents: 26
diff changeset
35
0
heinrichsweikamp
parents:
diff changeset
36 ; Timing for button hold-down flags
heinrichsweikamp
parents:
diff changeset
37 #DEFINE TMR1H_VALUE_FIRST .255-.128 ; in steps of 7,8125ms -> 1s
heinrichsweikamp
parents:
diff changeset
38 #DEFINE TMR1H_VALUE_CONT .255-.32 ; in steps of 7,8125ms -> 0.25s
heinrichsweikamp
parents:
diff changeset
39 #DEFINE TMR1H_VALUE_CONT_DIVE .255-.64 ; in steps of 7,8125ms -> 0.5s
heinrichsweikamp
parents:
diff changeset
40
heinrichsweikamp
parents:
diff changeset
41 ; Color Definitions: 8Bit RGB b'RRRGGGBB'
heinrichsweikamp
parents:
diff changeset
42 #DEFINE color_red b'11100000' ; (7,0,0)
heinrichsweikamp
parents:
diff changeset
43 #DEFINE color_dark_red b'10000101' ; (4,1,1)
heinrichsweikamp
parents:
diff changeset
44 #DEFINE color_violet b'11101011' ; (7,2,3)
heinrichsweikamp
parents:
diff changeset
45 #DEFINE color_blue b'11000111' ; (6,1,3)
heinrichsweikamp
parents:
diff changeset
46 #DEFINE color_green b'00011100' ; (0,7,0)
heinrichsweikamp
parents:
diff changeset
47 #DEFINE color_greenish b'00111110' ; (1,7,2)
heinrichsweikamp
parents:
diff changeset
48 #DEFINE color_dark_green b'00111001' ; (1,6,1)
heinrichsweikamp
parents:
diff changeset
49 #DEFINE color_yellow b'11111101' ; (7,7,1)
heinrichsweikamp
parents:
diff changeset
50 #DEFINE color_white b'11111111' ; (7,7,3)
heinrichsweikamp
parents:
diff changeset
51 #DEFINE color_black b'00000000' ; (0,0,0)
heinrichsweikamp
parents:
diff changeset
52 #DEFINE color_deepblue b'00000010' ; (0,0,2)
heinrichsweikamp
parents:
diff changeset
53 #DEFINE color_grey b'11011111' ; (6,7,3)
heinrichsweikamp
parents:
diff changeset
54 #DEFINE color_cyan b'11011111' ; (6,7,3)
heinrichsweikamp
parents:
diff changeset
55 #DEFINE color_lightblue b'11011011' ; (6,7,3)
heinrichsweikamp
parents:
diff changeset
56 #DEFINE color_orange b'11111000' ; (7,6,0)
heinrichsweikamp
parents:
diff changeset
57 #DEFINE color_pink b'11111010' ; (7,6,2)
heinrichsweikamp
parents:
diff changeset
58
heinrichsweikamp
parents:
diff changeset
59 #DEFINE FT_TINY .0
heinrichsweikamp
parents:
diff changeset
60 #DEFINE FT_SMALL .1
heinrichsweikamp
parents:
diff changeset
61 #DEFINE FT_MEDIUM .2
heinrichsweikamp
parents:
diff changeset
62 #DEFINE FT_LARGE .3
heinrichsweikamp
parents:
diff changeset
63
heinrichsweikamp
parents:
diff changeset
64 #DEFINE warn_depth .1
heinrichsweikamp
parents:
diff changeset
65 #DEFINE warn_cns .2
heinrichsweikamp
parents:
diff changeset
66 #DEFINE warn_gf .3
heinrichsweikamp
parents:
diff changeset
67 #DEFINE warn_ppo2 .4
heinrichsweikamp
parents:
diff changeset
68 #DEFINE warn_velocity .5
heinrichsweikamp
parents:
diff changeset
69 #DEFINE warn_ceiling .6
heinrichsweikamp
parents:
diff changeset
70 #DEFINE warn_gas_in_gaslist .7
heinrichsweikamp
parents:
diff changeset
71 #DEFINE warn_ppo2_hud .8
heinrichsweikamp
parents:
diff changeset
72 #DEFINE warn_battery .9
heinrichsweikamp
parents:
diff changeset
73
heinrichsweikamp
parents:
diff changeset
74
heinrichsweikamp
parents:
diff changeset
75 ; Profile recording parameters
heinrichsweikamp
parents:
diff changeset
76 #DEFINE logbook_profile_version 0x23
heinrichsweikamp
parents:
diff changeset
77 #DEFINE samplingrate_apnoe .1 ; [seconds]
heinrichsweikamp
parents:
diff changeset
78 ; Warning: Divisors must be <.16 !
heinrichsweikamp
parents:
diff changeset
79 #DEFINE div_temperature .6 ; x samplingrate [s]
heinrichsweikamp
parents:
diff changeset
80 #DEFINE div_deco .6 ; x samplingrate [s]
heinrichsweikamp
parents:
diff changeset
81 #DEFINE div_gf .12 ; x samplingrate [s]
heinrichsweikamp
parents:
diff changeset
82 #DEFINE div_ppo2_sensors .2 ; x samplingrate [s]
heinrichsweikamp
parents:
diff changeset
83 #DEFINE div_decoplan .12 ; x samplingrate [s]
heinrichsweikamp
parents:
diff changeset
84 #DEFINE div_cns .12 ; x samplingrate [s]
heinrichsweikamp
parents:
diff changeset
85 #DEFINE div_tank .0 ; x samplingrate [s]
heinrichsweikamp
parents:
diff changeset
86 ; Warning: Information lengths must be <.16 !
heinrichsweikamp
parents:
diff changeset
87 #DEFINE infolength_temperature .2 ; [byte]
heinrichsweikamp
parents:
diff changeset
88 #DEFINE infolength_deco .2 ; [byte]
heinrichsweikamp
parents:
diff changeset
89 #DEFINE infolength_gf .1 ; [byte]
heinrichsweikamp
parents:
diff changeset
90 #DEFINE infolength_ppo2_sensors .9 ; [byte]
heinrichsweikamp
parents:
diff changeset
91 #DEFINE infolength_decoplan .15 ; [byte]
heinrichsweikamp
parents:
diff changeset
92 #DEFINE infolength_cns .2 ; [byte]
heinrichsweikamp
parents:
diff changeset
93 #DEFINE infolength_tank .0 ; [byte]
heinrichsweikamp
parents:
diff changeset
94
heinrichsweikamp
parents:
diff changeset
95 ; "Better Gas" behavior
heinrichsweikamp
parents:
diff changeset
96 ; better_gas_window <= minimum_change_depth !
heinrichsweikamp
parents:
diff changeset
97 ; minimum_change_depth >=5 !
heinrichsweikamp
parents:
diff changeset
98 #DEFINE minimum_change_depth .3 ; [m]
heinrichsweikamp
parents:
diff changeset
99 #DEFINE better_gas_window .3 ; [m]
heinrichsweikamp
parents:
diff changeset
100
heinrichsweikamp
parents:
diff changeset
101 ; Dive mode limits and thresholds
heinrichsweikamp
parents:
diff changeset
102 #DEFINE start_dive_threshold .100 ; [cm]
heinrichsweikamp
parents:
diff changeset
103 #DEFINE high_altitude_dive_threshold .300;[cm]
35
eca4a201d8cf change apnea timeout, do no longer store apnea dives in logbook
heinrichsweikamp
parents: 31
diff changeset
104 #DEFINE apnoe_timeout .15 ; [min]
0
heinrichsweikamp
parents:
diff changeset
105 #DEFINE divemode_menuview_timeout .10 ; [s]
heinrichsweikamp
parents:
diff changeset
106 #DEFINE divemode_timeout .300 ; [s]
heinrichsweikamp
parents:
diff changeset
107 #DEFINE divemode_menu_timeout .30 ; [s]
heinrichsweikamp
parents:
diff changeset
108 #DEFINE ppo2_warning_low .19 ; [cbar] (Default value)
heinrichsweikamp
parents:
diff changeset
109 #DEFINE ppo2_lowest_setting .16 ; [cbar] (Minimum value)
heinrichsweikamp
parents:
diff changeset
110 #DEFINE ppo2_display_high .120 ; [cbar]
heinrichsweikamp
parents:
diff changeset
111 #DEFINE ppo2_warning_high .160 ; [cbar] (Default value)
heinrichsweikamp
parents:
diff changeset
112 #DEFINE ppo2_highest_setting .160 ; [cbar] (Max. Value)
heinrichsweikamp
parents:
diff changeset
113 #DEFINE cns_display_high .70 ; [%]
heinrichsweikamp
parents:
diff changeset
114 #DEFINE cns_warning_high .100 ; [%]
heinrichsweikamp
parents:
diff changeset
115 #DEFINE gf_display_high .75 ; [%]
heinrichsweikamp
parents:
diff changeset
116 #DEFINE gf_warning_high .100 ; [%]
heinrichsweikamp
parents:
diff changeset
117 #DEFINE depth_warn_mbar .13000 ; [mbar]
heinrichsweikamp
parents:
diff changeset
118 #DEFINE wake_up_from_sleep .1160 ; [mbar]
heinrichsweikamp
parents:
diff changeset
119 #DEFINE gf_display_threshold .20 ; [%]
heinrichsweikamp
parents:
diff changeset
120 #DEFINE simulator_start_depth .2500 ; [mbar] + 1000mbar surface
heinrichsweikamp
parents:
diff changeset
121 #DEFINE simulator_timeout .15 ; [s]
heinrichsweikamp
parents:
diff changeset
122
heinrichsweikamp
parents:
diff changeset
123
heinrichsweikamp
parents:
diff changeset
124 ; Surface mode limits and thresholds
heinrichsweikamp
parents:
diff changeset
125 #DEFINE cns_display_surface_high .70 ; [%]
heinrichsweikamp
parents:
diff changeset
126 #DEFINE high_altitude_threshold .880 ; [mbar]
heinrichsweikamp
parents:
diff changeset
127 #DEFINE max_surfpressure .1080 ; [mbar]
heinrichsweikamp
parents:
diff changeset
128 #DEFINE timeout_surfacemode .90 ; [s]
heinrichsweikamp
parents:
diff changeset
129
heinrichsweikamp
parents:
diff changeset
130
heinrichsweikamp
parents:
diff changeset
131 ; Decomodel paramters
heinrichsweikamp
parents:
diff changeset
132 #DEFINE no_fly_time_ratio .60 ; [%]
heinrichsweikamp
parents:
diff changeset
133 #DEFINE deco_distance .10 ; [dm]
heinrichsweikamp
parents:
diff changeset
134
heinrichsweikamp
parents:
diff changeset
135
heinrichsweikamp
parents:
diff changeset
136 ; Color-code parameters for the divemode
heinrichsweikamp
parents:
diff changeset
137 #DEFINE color_code_cns_high .100 ; [%]
heinrichsweikamp
parents:
diff changeset
138 #DEFINE color_code_gf_warn_high .101 ; [%]
heinrichsweikamp
parents:
diff changeset
139 #DEFINE color_code_velocity_warn_high .10;[m/min]
heinrichsweikamp
parents:
diff changeset
140
heinrichsweikamp
parents:
diff changeset
141 ; Velocity threshold
heinrichsweikamp
parents:
diff changeset
142 #DEFINE velocity_warning_level_1 .7 ; [m/min]
heinrichsweikamp
parents:
diff changeset
143
heinrichsweikamp
parents:
diff changeset
144 ; Battery thresholds
37
0e1723f2761e use four additional data points for the battery monitor
mh@mh-THINK.fritz.box
parents: 35
diff changeset
145 #DEFINE lithium_36v_empty .2400 ; [mV] Saft 3,6V LS14500 AA - threshold for battery percent display
0
heinrichsweikamp
parents:
diff changeset
146 #DEFINE lithium_36v_low .2000 ; [mV] (Must be bigger then aa_15v_high!)
heinrichsweikamp
parents:
diff changeset
147 #DEFINE aa_15v_high .1550 ; [mV] Energizer 1,5V E2 AA
heinrichsweikamp
parents:
diff changeset
148 #DEFINE aa_15v_low .1100 ; [mV] According to Energizer Datasheet EBC-4201R, Page 2
43
83794355f927 .99 release
heinrichsweikamp
parents: 39
diff changeset
149 #DEFINE color_code_battery_low .10 ; [%]
83794355f927 .99 release
heinrichsweikamp
parents: 39
diff changeset
150 #DEFINE battery_show_level .24 ; [%]
0
heinrichsweikamp
parents:
diff changeset
151
37
0e1723f2761e use four additional data points for the battery monitor
mh@mh-THINK.fritz.box
parents: 35
diff changeset
152 ; 3,6V battery sensing data points at 55mA load
0e1723f2761e use four additional data points for the battery monitor
mh@mh-THINK.fritz.box
parents: 35
diff changeset
153 #DEFINE lithium_36v_75 .3200 ; [mV]
0e1723f2761e use four additional data points for the battery monitor
mh@mh-THINK.fritz.box
parents: 35
diff changeset
154 #DEFINE lithium_36v_50 .3100 ; [mV]
0e1723f2761e use four additional data points for the battery monitor
mh@mh-THINK.fritz.box
parents: 35
diff changeset
155 #DEFINE lithium_36v_25 .2900 ; [mV]
0e1723f2761e use four additional data points for the battery monitor
mh@mh-THINK.fritz.box
parents: 35
diff changeset
156 #DEFINE lithium_36v_10 .2600 ; [mV]
0e1723f2761e use four additional data points for the battery monitor
mh@mh-THINK.fritz.box
parents: 35
diff changeset
157
0
heinrichsweikamp
parents:
diff changeset
158 #DEFINE current_sleepmode .62
heinrichsweikamp
parents:
diff changeset
159 #DEFINE current_backlight_multi .115 ; *CCPR1L+current_backlight_offset
heinrichsweikamp
parents:
diff changeset
160 #DEFINE current_backlight_offset .216
heinrichsweikamp
parents:
diff changeset
161 #DEFINE current_speed_eco .1914
heinrichsweikamp
parents:
diff changeset
162 #DEFINE current_speed_normal .4027
heinrichsweikamp
parents:
diff changeset
163 #DEFINE current_speed_fastest .5050
heinrichsweikamp
parents:
diff changeset
164 #DEFINE current_ir_reciever .139
heinrichsweikamp
parents:
diff changeset
165 #DEFINE current_compass .28
heinrichsweikamp
parents:
diff changeset
166
heinrichsweikamp
parents:
diff changeset
167 ; Brightness thresholds (between zero (off) and 255 (max. power))
2
ab8a7c3f1db0 battery warning levels, max. brightnes setting
heinrichsweikamp
parents: 0
diff changeset
168 #DEFINE ambient_light_max_high_36V .175 ; When used with a 3,6V battery
ab8a7c3f1db0 battery warning levels, max. brightnes setting
heinrichsweikamp
parents: 0
diff changeset
169 #DEFINE ambient_light_max_high .150
0
heinrichsweikamp
parents:
diff changeset
170 #DEFINE ambient_light_min_high .40
2
ab8a7c3f1db0 battery warning levels, max. brightnes setting
heinrichsweikamp
parents: 0
diff changeset
171 #DEFINE ambient_light_max_medium .135
0
heinrichsweikamp
parents:
diff changeset
172 #DEFINE ambient_light_min_medium .30
59
3e65636a8462 Backlight level in eco mode
heinrichsweikamp
parents: 53
diff changeset
173 #DEFINE ambient_light_max_eco .100
31
53a09c1b7410 BUGFIX: alternating brightness at very low ambient light
heinrichsweikamp
parents: 28
diff changeset
174 #DEFINE ambient_light_min_eco .15 ; Must be the lowest value!
0
heinrichsweikamp
parents:
diff changeset
175
heinrichsweikamp
parents:
diff changeset
176 ; IR Link timeout
heinrichsweikamp
parents:
diff changeset
177 #DEFINE ir_timeout_value .48 ; multiples of 62,5ms
heinrichsweikamp
parents:
diff changeset
178
heinrichsweikamp
parents:
diff changeset
179 ; Gaslist hard-coded limits
heinrichsweikamp
parents:
diff changeset
180 #DEFINE gaslist_min_o2 .7 ; Minimum O2 [%]
heinrichsweikamp
parents:
diff changeset
181 #DEFINE gaslist_max_change_depth .100 ; Max. change depth [m]
heinrichsweikamp
parents:
diff changeset
182 #DEFINE gaslist_sp_stepsize .10 ; Steps for Setpoint Setup [cbar]
heinrichsweikamp
parents:
diff changeset
183 #DEFINE gaslist_sp_max .160 ; Max. Setpoint [cbar]
heinrichsweikamp
parents:
diff changeset
184 #DEFINE gaslist_sp_min .50 ; Min. Setpoint [cbar]
heinrichsweikamp
parents:
diff changeset
185
16
7b06f20881be calm compass reading for minor heading changes
heinrichsweikamp
parents: 15
diff changeset
186 ; Compass display
7b06f20881be calm compass reading for minor heading changes
heinrichsweikamp
parents: 15
diff changeset
187 #DEFINE compass_fast_treshold .12 ; Faster update if new and old > compass_fast_treshold
7b06f20881be calm compass reading for minor heading changes
heinrichsweikamp
parents: 15
diff changeset
188
0
heinrichsweikamp
parents:
diff changeset
189 ;---------------------------- Macros ------------------------------------
heinrichsweikamp
parents:
diff changeset
190
heinrichsweikamp
parents:
diff changeset
191 TSTOSS macro opt_reg ; TeST Option Skip if not Zero
heinrichsweikamp
parents:
diff changeset
192 movff opt_reg,WREG
heinrichsweikamp
parents:
diff changeset
193 tstfsz WREG,A
heinrichsweikamp
parents:
diff changeset
194 bra $+4
heinrichsweikamp
parents:
diff changeset
195 endm
heinrichsweikamp
parents:
diff changeset
196
heinrichsweikamp
parents:
diff changeset
197 ;---------------------------- Bank0 DATA ------------------------------------
heinrichsweikamp
parents:
diff changeset
198 isr_backup equ 0x60
heinrichsweikamp
parents:
diff changeset
199 isr_backup udata_ovr isr_backup ; Reserved space for interupt data
heinrichsweikamp
parents:
diff changeset
200
heinrichsweikamp
parents:
diff changeset
201 ;---- Backup for general registers
heinrichsweikamp
parents:
diff changeset
202 isr_prod res 2
heinrichsweikamp
parents:
diff changeset
203
heinrichsweikamp
parents:
diff changeset
204 ;---- MS5541 subroutines
heinrichsweikamp
parents:
diff changeset
205 amb_pressure res 2
heinrichsweikamp
parents:
diff changeset
206 temperature res 2
heinrichsweikamp
parents:
diff changeset
207
heinrichsweikamp
parents:
diff changeset
208 W1 res 2 ; Raw (packed) calibration data
heinrichsweikamp
parents:
diff changeset
209 W2 res 2
heinrichsweikamp
parents:
diff changeset
210 W3 res 2
heinrichsweikamp
parents:
diff changeset
211 W4 res 2 ; 100
heinrichsweikamp
parents:
diff changeset
212 C1 res 2 ; Decoded calibration data
heinrichsweikamp
parents:
diff changeset
213 C2 res 2
heinrichsweikamp
parents:
diff changeset
214 C3 res 2
heinrichsweikamp
parents:
diff changeset
215 C4 res 2 ; Here: C4-250
heinrichsweikamp
parents:
diff changeset
216 C5 res 2 ; Here: Reference Temperature UT1 = 8*C5 + 10000 (u16 range 10.000 .. +42.760)
heinrichsweikamp
parents:
diff changeset
217 C6 res 2
heinrichsweikamp
parents:
diff changeset
218 D1 res 2 ; raw pressure
heinrichsweikamp
parents:
diff changeset
219 D2 res 2 ; raw temperature
heinrichsweikamp
parents:
diff changeset
220 xdT res 2
heinrichsweikamp
parents:
diff changeset
221 xdT2 res 2
heinrichsweikamp
parents:
diff changeset
222 OFF res 2
heinrichsweikamp
parents:
diff changeset
223 SENS res 2
heinrichsweikamp
parents:
diff changeset
224 dLSB res 1 ;Pressure sensor interface
heinrichsweikamp
parents:
diff changeset
225 dMSB res 1
heinrichsweikamp
parents:
diff changeset
226 clock_count res 1
heinrichsweikamp
parents:
diff changeset
227 sensor_state_counter res 1 ; counts to eight for state maschine
heinrichsweikamp
parents:
diff changeset
228 amb_pressure_avg res 2
heinrichsweikamp
parents:
diff changeset
229 temperature_avg res 2
heinrichsweikamp
parents:
diff changeset
230 minimum_temperature res 2 ; minimum temperature
heinrichsweikamp
parents:
diff changeset
231 last_temperature res 2
heinrichsweikamp
parents:
diff changeset
232 last_pressure res 2
heinrichsweikamp
parents:
diff changeset
233 last_pressure_velocity res 2 ; For velocity
heinrichsweikamp
parents:
diff changeset
234 last_surfpressure res 2
heinrichsweikamp
parents:
diff changeset
235 last_surfpressure_15min res 2
heinrichsweikamp
parents:
diff changeset
236 last_surfpressure_30min res 2
heinrichsweikamp
parents:
diff changeset
237 rel_pressure res 2
heinrichsweikamp
parents:
diff changeset
238 sim_pressure res 2 ; hold simulated pressure in mbar if in Simulator mode
heinrichsweikamp
parents:
diff changeset
239 max_pressure res 2
heinrichsweikamp
parents:
diff changeset
240 avr_rel_pressure res 2
heinrichsweikamp
parents:
diff changeset
241 avr_rel_pressure_total res 2
heinrichsweikamp
parents:
diff changeset
242 ;---- Data for ISR math subroutines
heinrichsweikamp
parents:
diff changeset
243 isr_xC res 4
heinrichsweikamp
parents:
diff changeset
244 isr_xA res 2
heinrichsweikamp
parents:
diff changeset
245 isr_xB res 2
heinrichsweikamp
parents:
diff changeset
246
heinrichsweikamp
parents:
diff changeset
247 ;---- Data for ISR routines
heinrichsweikamp
parents:
diff changeset
248 isr1_temp res 1 ; ISR temp variable, used in ms5541.asm, isr_rtcc, isr_battery_gauge
heinrichsweikamp
parents:
diff changeset
249 isr2_temp res 1 ; ISR temp variable, used isr_battery_gauge
heinrichsweikamp
parents:
diff changeset
250
heinrichsweikamp
parents:
diff changeset
251 ;---- Display brightness
heinrichsweikamp
parents:
diff changeset
252 max_CCPR1L res 1 ; Max. brightness value for CCPR1L
heinrichsweikamp
parents:
diff changeset
253
heinrichsweikamp
parents:
diff changeset
254 ; Battery gauge (nAs, nC)
heinrichsweikamp
parents:
diff changeset
255 battery_gauge res 6 ; 48Bit -> 78Ah max...
heinrichsweikamp
parents:
diff changeset
256
heinrichsweikamp
parents:
diff changeset
257 ; IR-Link
heinrichsweikamp
parents:
diff changeset
258 ir_buffer res .16
heinrichsweikamp
parents:
diff changeset
259 ir_counter res 1
heinrichsweikamp
parents:
diff changeset
260 ir_timeout res 1 ; Timeout for valid data
heinrichsweikamp
parents:
diff changeset
261
heinrichsweikamp
parents:
diff changeset
262 ; Compass raw data
heinrichsweikamp
parents:
diff changeset
263 compass_DX res 2
heinrichsweikamp
parents:
diff changeset
264 compass_DY res 2
heinrichsweikamp
parents:
diff changeset
265 compass_DZ res 2
heinrichsweikamp
parents:
diff changeset
266
heinrichsweikamp
parents:
diff changeset
267 accel_DX res 2
heinrichsweikamp
parents:
diff changeset
268 accel_DY res 2
heinrichsweikamp
parents:
diff changeset
269 accel_DZ res 2
heinrichsweikamp
parents:
diff changeset
270
heinrichsweikamp
parents:
diff changeset
271 ; Compass FILTERED data
heinrichsweikamp
parents:
diff changeset
272 compass_DX_f res 2
heinrichsweikamp
parents:
diff changeset
273 compass_DY_f res 2
heinrichsweikamp
parents:
diff changeset
274 compass_DZ_f res 2
heinrichsweikamp
parents:
diff changeset
275
heinrichsweikamp
parents:
diff changeset
276 accel_DX_f res 2
heinrichsweikamp
parents:
diff changeset
277 accel_DY_f res 2
heinrichsweikamp
parents:
diff changeset
278 accel_DZ_f res 2
heinrichsweikamp
parents:
diff changeset
279
heinrichsweikamp
parents:
diff changeset
280 ; Compass calibration data
heinrichsweikamp
parents:
diff changeset
281 compass_CX_f res 2
heinrichsweikamp
parents:
diff changeset
282 compass_CY_f res 2
heinrichsweikamp
parents:
diff changeset
283 compass_CZ_f res 2
heinrichsweikamp
parents:
diff changeset
284
heinrichsweikamp
parents:
diff changeset
285 ; Compass more data
heinrichsweikamp
parents:
diff changeset
286 compass_heading res 2 ; Corrected heading (in 1°) : -180 .. 180
16
7b06f20881be calm compass reading for minor heading changes
heinrichsweikamp
parents: 15
diff changeset
287 compass_heading_old res 2 ; Old heading (For smoother display)
0
heinrichsweikamp
parents:
diff changeset
288 compass_roll res 2 ; Rotation around the X axis
heinrichsweikamp
parents:
diff changeset
289 compass_pitch res 2 ; Rotation arounf the Y axis
heinrichsweikamp
parents:
diff changeset
290
heinrichsweikamp
parents:
diff changeset
291 compass_a res 2 ; Tmp data for Q15 arithmetics
heinrichsweikamp
parents:
diff changeset
292 compass_b res 2
heinrichsweikamp
parents:
diff changeset
293 compass_r res 3
heinrichsweikamp
parents:
diff changeset
294
heinrichsweikamp
parents:
diff changeset
295 CNS_start res 2 ; CNS value at beginning of dive
heinrichsweikamp
parents:
diff changeset
296 GF_start res 1 ; GF value at beginning of dive
heinrichsweikamp
parents:
diff changeset
297
heinrichsweikamp
parents:
diff changeset
298 ;---------------------------- Common DATA ------------------------------------
heinrichsweikamp
parents:
diff changeset
299
heinrichsweikamp
parents:
diff changeset
300 common equ 0x100 ; Alias for "banksel common"
heinrichsweikamp
parents:
diff changeset
301 common udata_ovr common ; Bank1 general variables
heinrichsweikamp
parents:
diff changeset
302
heinrichsweikamp
parents:
diff changeset
303 ;---- Time and Date
heinrichsweikamp
parents:
diff changeset
304 secs res 1
heinrichsweikamp
parents:
diff changeset
305 mins res 1
heinrichsweikamp
parents:
diff changeset
306 hours res 1
heinrichsweikamp
parents:
diff changeset
307 day res 1
heinrichsweikamp
parents:
diff changeset
308 month res 1
heinrichsweikamp
parents:
diff changeset
309 year res 1
heinrichsweikamp
parents:
diff changeset
310 surface_interval res 2
heinrichsweikamp
parents:
diff changeset
311
heinrichsweikamp
parents:
diff changeset
312 flag1 res 1
heinrichsweikamp
parents:
diff changeset
313 flag2 res 1
heinrichsweikamp
parents:
diff changeset
314 flag3 res 1
heinrichsweikamp
parents:
diff changeset
315 flag4 res 1
heinrichsweikamp
parents:
diff changeset
316 flag5 res 1
heinrichsweikamp
parents:
diff changeset
317 flag6 res 1
heinrichsweikamp
parents:
diff changeset
318 flag7 res 1
heinrichsweikamp
parents:
diff changeset
319 flag8 res 1
16
7b06f20881be calm compass reading for minor heading changes
heinrichsweikamp
parents: 15
diff changeset
320 flag9 res 1
0
heinrichsweikamp
parents:
diff changeset
321
heinrichsweikamp
parents:
diff changeset
322 temp1 res 1
heinrichsweikamp
parents:
diff changeset
323 temp2 res 1
heinrichsweikamp
parents:
diff changeset
324
heinrichsweikamp
parents:
diff changeset
325 ;---- Interface to wait macros
heinrichsweikamp
parents:
diff changeset
326 wait_temp res 1
heinrichsweikamp
parents:
diff changeset
327 waitms_temp res 1
heinrichsweikamp
parents:
diff changeset
328
heinrichsweikamp
parents:
diff changeset
329 ;---- Interface to graphic subroutines (aa_wordprocessor, color_processor, ...)
heinrichsweikamp
parents:
diff changeset
330 win_leftx2 res 1
heinrichsweikamp
parents:
diff changeset
331 win_top res 1
heinrichsweikamp
parents:
diff changeset
332 win_width res 2
heinrichsweikamp
parents:
diff changeset
333 win_height res 1
heinrichsweikamp
parents:
diff changeset
334 win_bargraph res 1
heinrichsweikamp
parents:
diff changeset
335 win_color1 res 1
heinrichsweikamp
parents:
diff changeset
336 win_color2 res 1
heinrichsweikamp
parents:
diff changeset
337 win_font res 1
heinrichsweikamp
parents:
diff changeset
338 win_invert res 1
heinrichsweikamp
parents:
diff changeset
339
heinrichsweikamp
parents:
diff changeset
340 ;---- Draw subroutines
heinrichsweikamp
parents:
diff changeset
341 tft_temp4 res 1
heinrichsweikamp
parents:
diff changeset
342 tft_temp3 res 1
heinrichsweikamp
parents:
diff changeset
343 tft_temp2 res 1
heinrichsweikamp
parents:
diff changeset
344 tft_temp1 res 1
heinrichsweikamp
parents:
diff changeset
345
heinrichsweikamp
parents:
diff changeset
346 ;---- data conversion subroutines
heinrichsweikamp
parents:
diff changeset
347 lo res 1
heinrichsweikamp
parents:
diff changeset
348 hi res 1
heinrichsweikamp
parents:
diff changeset
349 up res 1
heinrichsweikamp
parents:
diff changeset
350
heinrichsweikamp
parents:
diff changeset
351 ;---- RS232 temp variables
heinrichsweikamp
parents:
diff changeset
352 uart1_temp res 1
heinrichsweikamp
parents:
diff changeset
353 uart2_temp res 1
heinrichsweikamp
parents:
diff changeset
354
heinrichsweikamp
parents:
diff changeset
355 ;---- Data for math subroutines
heinrichsweikamp
parents:
diff changeset
356 divA res 2
heinrichsweikamp
parents:
diff changeset
357 divB res 1
heinrichsweikamp
parents:
diff changeset
358 xC res 4
heinrichsweikamp
parents:
diff changeset
359 xA res 2
heinrichsweikamp
parents:
diff changeset
360 xB res 2
heinrichsweikamp
parents:
diff changeset
361 sub_c res 2
heinrichsweikamp
parents:
diff changeset
362 sub_a res 2
heinrichsweikamp
parents:
diff changeset
363 sub_b res 2
heinrichsweikamp
parents:
diff changeset
364
heinrichsweikamp
parents:
diff changeset
365 ;---- Data for conversion subroutines
heinrichsweikamp
parents:
diff changeset
366 cvt_flags res 1
heinrichsweikamp
parents:
diff changeset
367 ignore_digits res 1
heinrichsweikamp
parents:
diff changeset
368
heinrichsweikamp
parents:
diff changeset
369 #define leftbind cvt_flags,0
heinrichsweikamp
parents:
diff changeset
370 #define ignore_digit3 cvt_flags,1
heinrichsweikamp
parents:
diff changeset
371 #define ignore_digit4 cvt_flags,2
heinrichsweikamp
parents:
diff changeset
372 #define ignore_digit5 cvt_flags,3
heinrichsweikamp
parents:
diff changeset
373 #DEFINE enable_screen_dumps cvt_flags,4 ; =1: Ignore vin_usb, wait for "l" command (Screen dump)
heinrichsweikamp
parents:
diff changeset
374
heinrichsweikamp
parents:
diff changeset
375 ;---- Misc.
heinrichsweikamp
parents:
diff changeset
376 speed_setting res 1 ; =1: Eco, =2: Normal, =3: Fastest
heinrichsweikamp
parents:
diff changeset
377 nofly_time res 2 ; No Fly time in Minutes (Calculated after Dive)
heinrichsweikamp
parents:
diff changeset
378 timeout_counter res 1
heinrichsweikamp
parents:
diff changeset
379 timeout_counter2 res 1
heinrichsweikamp
parents:
diff changeset
380 timeout_counter3 res 1
heinrichsweikamp
parents:
diff changeset
381 batt_voltage res 2 ; Battery voltage in mV
heinrichsweikamp
parents:
diff changeset
382 batt_percent res 1 ; Battery in percent (1-100)
heinrichsweikamp
parents:
diff changeset
383 ambient_light res 2 ; ambient_light level
heinrichsweikamp
parents:
diff changeset
384 lo_temp res 1
heinrichsweikamp
parents:
diff changeset
385 hi_temp res 1
heinrichsweikamp
parents:
diff changeset
386 desaturation_time res 2
heinrichsweikamp
parents:
diff changeset
387 convert_value_temp res 3 ; used in menu_battery_state_convert_date
heinrichsweikamp
parents:
diff changeset
388 active_gas res 1
heinrichsweikamp
parents:
diff changeset
389 decoplan_page res 1
heinrichsweikamp
parents:
diff changeset
390 warning_counter res 1 ; Counts amount of warning in divemode
heinrichsweikamp
parents:
diff changeset
391 warning_counter_backup res 1 ; Backup of warning_counter
heinrichsweikamp
parents:
diff changeset
392 warning_page res 1 ; current # of warning page
heinrichsweikamp
parents:
diff changeset
393 rssi_value res 1 ; Current RSSI level
heinrichsweikamp
parents:
diff changeset
394
heinrichsweikamp
parents:
diff changeset
395 ; Remind history for menu processor (and such):
heinrichsweikamp
parents:
diff changeset
396 menustack res 5 ; menu stack
heinrichsweikamp
parents:
diff changeset
397 menupos res 1 ; Logbook and divemode menu
heinrichsweikamp
parents:
diff changeset
398 menupos2 res 1 ; For dive mode simulator and pre-menu
heinrichsweikamp
parents:
diff changeset
399 menupos3 res 1 ; For Customviews
heinrichsweikamp
parents:
diff changeset
400 menupos4 res 1 ; For divemode menu
heinrichsweikamp
parents:
diff changeset
401
heinrichsweikamp
parents:
diff changeset
402 ; Apnoe stuff that must be in bank common
heinrichsweikamp
parents:
diff changeset
403 apnoe_mins res 1
heinrichsweikamp
parents:
diff changeset
404 apnoe_secs res 1
heinrichsweikamp
parents:
diff changeset
405 apnoe_max_pressure res 2
heinrichsweikamp
parents:
diff changeset
406
heinrichsweikamp
parents:
diff changeset
407 ; Divemode
heinrichsweikamp
parents:
diff changeset
408 divemins res 2
heinrichsweikamp
parents:
diff changeset
409 divesecs res 1
23
e402813343b6 new option to switch samplingrate between 10s and 2s
heinrichsweikamp
parents: 18
diff changeset
410 samplingrate res 1
0
heinrichsweikamp
parents:
diff changeset
411 samplesecs_value res 1
heinrichsweikamp
parents:
diff changeset
412 divisor_temperature res 1
heinrichsweikamp
parents:
diff changeset
413 divisor_deco res 1
heinrichsweikamp
parents:
diff changeset
414 divisor_gf res 1
heinrichsweikamp
parents:
diff changeset
415 divisor_ppo2_sensors res 1
heinrichsweikamp
parents:
diff changeset
416 divisor_decoplan res 1
heinrichsweikamp
parents:
diff changeset
417 divisor_cns res 1
heinrichsweikamp
parents:
diff changeset
418 divisor_tank res 1
heinrichsweikamp
parents:
diff changeset
419 average_depth_hold res 4
heinrichsweikamp
parents:
diff changeset
420 average_depth_hold_total res 4
heinrichsweikamp
parents:
diff changeset
421 total_divetime_seconds res 2
heinrichsweikamp
parents:
diff changeset
422 average_divesecs res 2 ; For the resettable stopwatch
heinrichsweikamp
parents:
diff changeset
423 decodata res 2
heinrichsweikamp
parents:
diff changeset
424 apnoe_timeout_counter res 1
heinrichsweikamp
parents:
diff changeset
425 apnoe_surface_mins res 1
heinrichsweikamp
parents:
diff changeset
426 apnoe_surface_secs res 1
heinrichsweikamp
parents:
diff changeset
427
heinrichsweikamp
parents:
diff changeset
428 ; Profile storing
heinrichsweikamp
parents:
diff changeset
429 AlarmType res 1
heinrichsweikamp
parents:
diff changeset
430 samplesecs res 1
heinrichsweikamp
parents:
diff changeset
431 EventByte res 1
heinrichsweikamp
parents:
diff changeset
432 ProfileFlagByte res 1
heinrichsweikamp
parents:
diff changeset
433
heinrichsweikamp
parents:
diff changeset
434 ; External flash
heinrichsweikamp
parents:
diff changeset
435 ext_flash_address res 3 ; 24bit Address
heinrichsweikamp
parents:
diff changeset
436 ext_flash_log_pointer res 3 ; 24bit Address for logbook profile storing
heinrichsweikamp
parents:
diff changeset
437 ext_flash_dive_counter res 3 ; 24bit Counter for dive length (increased in write_byte_ext_flash_plus)
heinrichsweikamp
parents:
diff changeset
438
heinrichsweikamp
parents:
diff changeset
439 ; I2C
heinrichsweikamp
parents:
diff changeset
440 i2c_temp res 1 ; Temp
heinrichsweikamp
parents:
diff changeset
441
heinrichsweikamp
parents:
diff changeset
442 ; MCP
heinrichsweikamp
parents:
diff changeset
443 mcp_temp res 4 ; For RX
heinrichsweikamp
parents:
diff changeset
444
heinrichsweikamp
parents:
diff changeset
445 ; O2 Sensor data
heinrichsweikamp
parents:
diff changeset
446 o2_mv_sensor1 res 2 ; in 0.1mV steps
heinrichsweikamp
parents:
diff changeset
447 o2_mv_sensor2 res 2 ; in 0.1mV steps
heinrichsweikamp
parents:
diff changeset
448 o2_mv_sensor3 res 2 ; in 0.1mV steps
heinrichsweikamp
parents:
diff changeset
449 o2_ppo2_sensor1 res 1 ; Sensor1 ppO2 (in 0.01bar steps)
heinrichsweikamp
parents:
diff changeset
450 o2_ppo2_sensor2 res 1 ; Sensor2 ppO2 (in 0.01bar steps)
heinrichsweikamp
parents:
diff changeset
451 o2_ppo2_sensor3 res 1 ; Sensor3 ppO2 (in 0.01bar steps)
heinrichsweikamp
parents:
diff changeset
452 hud_battery_mv res 2
heinrichsweikamp
parents:
diff changeset
453 hud_status_byte res 1
heinrichsweikamp
parents:
diff changeset
454 ;Status Byte/
heinrichsweikamp
parents:
diff changeset
455 ;Bit0 = 1 -> HUD connection ok
heinrichsweikamp
parents:
diff changeset
456 ;Bit1 = 1 -> HUD is calibrated
heinrichsweikamp
parents:
diff changeset
457 ;Bit2 = 1 -> HUD Battery is low (<3000mV)
heinrichsweikamp
parents:
diff changeset
458 ;Bit3 = 1 -> Sensor 1 active
heinrichsweikamp
parents:
diff changeset
459 ;Bit4 = 1 -> Sensor 2 active
heinrichsweikamp
parents:
diff changeset
460 ;Bit5 = 1 -> Sensor 3 active
heinrichsweikamp
parents:
diff changeset
461 ;Bit6 unused in stand-alone HUD
heinrichsweikamp
parents:
diff changeset
462 ;Bit7 unused in stand-alone HUD
heinrichsweikamp
parents:
diff changeset
463
heinrichsweikamp
parents:
diff changeset
464 sensor_setpoint res 1 ; sensor ppo2 in 0.01bar for deco routine
heinrichsweikamp
parents:
diff changeset
465
heinrichsweikamp
parents:
diff changeset
466 better_gas_number res 1 ; number (1-5) of the "better gas" in divemode, =0: no better gas available
39
e4e91fe8b09d remember last customview in dive and surface mode
mh@mh-THINK.fritz.box
parents: 37
diff changeset
467 customview_divemode res 1 ; keeps last custom view
e4e91fe8b09d remember last customview in dive and surface mode
mh@mh-THINK.fritz.box
parents: 37
diff changeset
468 customview_surfmode res 1
0
heinrichsweikamp
parents:
diff changeset
469
heinrichsweikamp
parents:
diff changeset
470 ;---------------------------- TMP DATA ---------------------------------------
heinrichsweikamp
parents:
diff changeset
471 ; Space for various overlayed data from color, word, menu processors, etc.
heinrichsweikamp
parents:
diff changeset
472 ;
heinrichsweikamp
parents:
diff changeset
473
heinrichsweikamp
parents:
diff changeset
474 tmp udata_ovr 0x1A0 ; Bank1 shared TMP space
heinrichsweikamp
parents:
diff changeset
475 tmp equ 0x1A0 ; Alias for CBLOCK directive.
heinrichsweikamp
parents:
diff changeset
476 res 0x060 ; RESERVED area.
heinrichsweikamp
parents:
diff changeset
477
heinrichsweikamp
parents:
diff changeset
478 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
479 ; Reserve BANK2 for general purpose buffer (strings, images, etc).
heinrichsweikamp
parents:
diff changeset
480 ; NOTE: Needs to be aligned with a bank (LOW(buffer)==0).
heinrichsweikamp
parents:
diff changeset
481 buffer udata_ovr 0x200
heinrichsweikamp
parents:
diff changeset
482 buffer res .256
heinrichsweikamp
parents:
diff changeset
483
heinrichsweikamp
parents:
diff changeset
484 opt_table equ 0xE00
heinrichsweikamp
parents:
diff changeset
485 opt_table udata_ovr opt_table
heinrichsweikamp
parents:
diff changeset
486
heinrichsweikamp
parents:
diff changeset
487 ;---- Dive Options
heinrichsweikamp
parents:
diff changeset
488 opt_gas_O2_ratio res 5 ; Needed because deco gaslist use N2
heinrichsweikamp
parents:
diff changeset
489 opt_dil_O2_ratio res 5 ; Must be in line with opt_gas_O2_ratio
heinrichsweikamp
parents:
diff changeset
490 opt_gas_He_ratio res 5 ; He ratio Gas1-5
heinrichsweikamp
parents:
diff changeset
491 opt_dil_He_ratio res 5 ; Must be in line with opt_gas_He_ratio
heinrichsweikamp
parents:
diff changeset
492 opt_gas_type res 5 ; 0=Disabled, 1=First, 2=Travel, 3=Deco
heinrichsweikamp
parents:
diff changeset
493 opt_dil_type res 5 ; 0=Disabled, 1=First, 2=Normal
heinrichsweikamp
parents:
diff changeset
494 opt_dive_mode res 1 ; 0=OC, 1=CC, 2=Gauge, 3=Apnea
heinrichsweikamp
parents:
diff changeset
495 opt_ppO2_max res 1 ; PPO2 Max for MOD calculation and color coding in divemode
heinrichsweikamp
parents:
diff changeset
496 opt_ccr_mode res 1 ; =0: Fixed SP, =1: Sensor
heinrichsweikamp
parents:
diff changeset
497 opt_ppO2_min res 1 ; PPO2 min for Sensors and color coding in divemode
heinrichsweikamp
parents:
diff changeset
498
heinrichsweikamp
parents:
diff changeset
499 ;---- Managing Settings
heinrichsweikamp
parents:
diff changeset
500
heinrichsweikamp
parents:
diff changeset
501 opt_brightness res 1 ; =0: Eco, =1:Medium, =2:Full
heinrichsweikamp
parents:
diff changeset
502 opt_salinity res 1 ; 0-5%
heinrichsweikamp
parents:
diff changeset
503 #DEFINE opt_name_length .60 ; Custom text string 5 rows with 12 chars
heinrichsweikamp
parents:
diff changeset
504 opt_name res opt_name_length
heinrichsweikamp
parents:
diff changeset
505 opt_language res 1 ; Current language. 0=EN, 1=DE, 2=FR, 3=SP
heinrichsweikamp
parents:
diff changeset
506 opt_units res 1 ; 0:m/°C, 1:ft/°F
heinrichsweikamp
parents:
diff changeset
507 opt_dateformat res 1 ; =0:MMDDYY, =1:DDMMYY, =2:YYMMDD
heinrichsweikamp
parents:
diff changeset
508 opt_last_stop res 1 ; =3:3m, =4:4m, =5:5m, =6:6m
heinrichsweikamp
parents:
diff changeset
509 opt_aGF_high res 1 ; Alternative GF HIGH
heinrichsweikamp
parents:
diff changeset
510 opt_aGF_low res 1 ; Alternative GF LOW
heinrichsweikamp
parents:
diff changeset
511 opt_GF_high res 1 ; GF HIGH
heinrichsweikamp
parents:
diff changeset
512 opt_GF_low res 1 ; GF LOW
heinrichsweikamp
parents:
diff changeset
513 opt_enable_aGF res 1 ; =1: aGF can be selected underwater
18
4e3f133dfbf4 add new opt_compass_gain option to work with more magnetic battery types
heinrichsweikamp
parents: 17
diff changeset
514 opt_compass_gain res 1 ; 0-7 (230LSB/Gauss to 1370LSB/Gaus)
24
f51caad821b4 save logbook recording interval
heinrichsweikamp
parents: 23
diff changeset
515 opt_sampling_rate res 1 ; =1: 10s, =0: 2s
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 47
diff changeset
516 opt_dive_color_scheme res 1 ; 0-3
0
heinrichsweikamp
parents:
diff changeset
517
heinrichsweikamp
parents:
diff changeset
518 ;-----------------------------EEPROM DATA ------------------------------------
heinrichsweikamp
parents:
diff changeset
519 ; Automatic reset of all options when this is changed:
heinrichsweikamp
parents:
diff changeset
520 #define eeprom_opt_serial 0x0005 ; Version 0.5
heinrichsweikamp
parents:
diff changeset
521
heinrichsweikamp
parents:
diff changeset
522 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
523 ; Flags
heinrichsweikamp
parents:
diff changeset
524 #DEFINE switch_left flag1,0
heinrichsweikamp
parents:
diff changeset
525 #DEFINE switch_right flag1,1
heinrichsweikamp
parents:
diff changeset
526 #DEFINE neg_flag flag1,2 ; e.g. sub16 (sub_c = sub_a - sub_b)
heinrichsweikamp
parents:
diff changeset
527 #DEFINE pressure_refresh flag1,3 ; =1: A new pressure/temperature is available
heinrichsweikamp
parents:
diff changeset
528 #DEFINE sleepmode flag1,4 ; =1: In Sleepmode
heinrichsweikamp
parents:
diff changeset
529 #DEFINE tft_is_dimming flag1,5 ; =1: The TFT is dimming, ignore light sensor
heinrichsweikamp
parents:
diff changeset
530 #DEFINE display_velocity flag1,6 ; =1: show velocity
heinrichsweikamp
parents:
diff changeset
531 #DEFINE no_sensor_int flag1,7 ; =1: block any further access to pressure sensor
heinrichsweikamp
parents:
diff changeset
532
heinrichsweikamp
parents:
diff changeset
533 #DEFINE rs232_recieve_overflow flag2,0 ; =1: An RS232 timeout overflow occoured
heinrichsweikamp
parents:
diff changeset
534 #DEFINE stored_gas_changed flag2,1 ; =1: Stored Gas changed
heinrichsweikamp
parents:
diff changeset
535 #DEFINE high_altitude_mode flag2,2 ; =1: Unit was manually turned on with ambient pressure <880mbar
heinrichsweikamp
parents:
diff changeset
536 #DEFINE FLAG_apnoe_mode flag2,3 ; =1: Apnoe mode selected
heinrichsweikamp
parents:
diff changeset
537 #DEFINE restore_deco_data flag2,4 ; =1: Restore deco data (After simulation)
heinrichsweikamp
parents:
diff changeset
538 #DEFINE premenu flag2,5 ; =1: Premenu/Divemenu selected
heinrichsweikamp
parents:
diff changeset
539 #DEFINE menubit flag2,6 ; menu
heinrichsweikamp
parents:
diff changeset
540 #DEFINE simulatormode_active flag2,7 ; =1: Simulator mode active, override pressure sensor readings
heinrichsweikamp
parents:
diff changeset
541
heinrichsweikamp
parents:
diff changeset
542 #DEFINE divemode_menu flag3,0 ; =1: Divemode menu is shown
heinrichsweikamp
parents:
diff changeset
543 #DEFINE onesecupdate flag3,1 ; =1 after any second
heinrichsweikamp
parents:
diff changeset
544 #DEFINE twosecupdate flag3,2 ; =1: New two-second update
heinrichsweikamp
parents:
diff changeset
545 #DEFINE toggle_customview flag3,3 ; =1: Next customview
heinrichsweikamp
parents:
diff changeset
546 #DEFINE oneminupdate flag3,4 ; =1 after any minute
heinrichsweikamp
parents:
diff changeset
547 #DEFINE divemode flag3,5 ; =1: in Divemode
heinrichsweikamp
parents:
diff changeset
548 #DEFINE battery_is_36v flag3,6 ; =1: 3,6V Battery is in use
heinrichsweikamp
parents:
diff changeset
549 #DEFINE warning_active flag3,7 ; =1: A warning is active in divemode or surfacemode
heinrichsweikamp
parents:
diff changeset
550
heinrichsweikamp
parents:
diff changeset
551 #DEFINE better_gas_available flag4,0 ; =1: A better gas is available
heinrichsweikamp
parents:
diff changeset
552 #DEFINE blinking_better_gas flag4,1 ; =1: Gas is blinking
heinrichsweikamp
parents:
diff changeset
553 #DEFINE menuview flag4,2 ; =1: A menuview is shown in divemode (e.g. "Menu?")
heinrichsweikamp
parents:
diff changeset
554 #DEFINE quarter_second_update flag4,3 ; =1: A new 1/4 second has begun
heinrichsweikamp
parents:
diff changeset
555 #DEFINE divemode_gaschange flag4,4 ; =1: The gas will change very soon
heinrichsweikamp
parents:
diff changeset
556 #DEFINE decostop_active flag4,5 ; =1: Decompression stop shown
heinrichsweikamp
parents:
diff changeset
557 #DEFINE depth_greater_100m flag4,6 ; =1: Current Depth > 100m
heinrichsweikamp
parents:
diff changeset
558 #DEFINE realdive flag4,7 ; =1: A real dive during divemode
heinrichsweikamp
parents:
diff changeset
559
heinrichsweikamp
parents:
diff changeset
560 #DEFINE dive_warning_displayed flag5,0 ; =1: The warning sign is shown
heinrichsweikamp
parents:
diff changeset
561 #DEFINE reset_average_depth flag5,1 ; =1: Reset the average depth
heinrichsweikamp
parents:
diff changeset
562 #DEFINE store_sample flag5,2 ; =1: Store a new sample
heinrichsweikamp
parents:
diff changeset
563 #DEFINE divemode2 flag5,3 ; =1: Dive longer then one minute
heinrichsweikamp
parents:
diff changeset
564 #DEFINE FLAG_active_descent flag5,4 ; Used in Apnoe mode
heinrichsweikamp
parents:
diff changeset
565 #DEFINE event_occured flag5,5 ; =1: An event occured, store it!
heinrichsweikamp
parents:
diff changeset
566 #DEFINE divemode_menu_active flag5,6 ; =1: The divemode menu is shown
heinrichsweikamp
parents:
diff changeset
567 #DEFINE temp_changed flag5,7 ; =1: The temperature changed
heinrichsweikamp
parents:
diff changeset
568
heinrichsweikamp
parents:
diff changeset
569 #DEFINE gas6_changed flag6,0 ; =1: Gas 6 has been selected/changed underwater
heinrichsweikamp
parents:
diff changeset
570 #DEFINE onehourupdate flag6,1 ; =1: A new hour has just begun
heinrichsweikamp
parents:
diff changeset
571 #DEFINE settime_setdate flag6,2 ; =1: In the Set Time or Set Date Menu
heinrichsweikamp
parents:
diff changeset
572 #DEFINE setpoint_changed flag6,3 ; =1: Setpoint has been changed
heinrichsweikamp
parents:
diff changeset
573 #DEFINE second_row_warning flag6,4 ; =1: The second row contains a warning
heinrichsweikamp
parents:
diff changeset
574 #DEFINE FLAG_ccr_mode flag6,5 ; =1: CCR mode (Fixed ppO2 or Sensor) active
heinrichsweikamp
parents:
diff changeset
575 #DEFINE dive_hud1_displayed flag6,6 ; =1: The Sensor1 HUD reading is displayed
heinrichsweikamp
parents:
diff changeset
576 #DEFINE dive_hud2_displayed flag6,7 ; =1: The Sensor2 HUD reading is displayed
heinrichsweikamp
parents:
diff changeset
577
heinrichsweikamp
parents:
diff changeset
578 #DEFINE dive_hud3_displayed flag7,0 ; =1: The Sensor3 HUD reading is displayed
heinrichsweikamp
parents:
diff changeset
579 #DEFINE no_more_divesecs flag7,1 ; =1: Do no longer show seconds in divemode
heinrichsweikamp
parents:
diff changeset
580 #DEFINE FLAG_gauge_mode flag7,2 ; =1: In Gauge mode
heinrichsweikamp
parents:
diff changeset
581 #DEFINE ignore_last_edited_gas flag7,3 ; Used in gaslist_cleanup_list
heinrichsweikamp
parents:
diff changeset
582 #DEFINE ccr_diluent_setup flag7,4 ; =1: Setting up Diluents ("Gas6-10")
heinrichsweikamp
parents:
diff changeset
583 #DEFINE menu_show_sensors flag7,5 ; =1: Update HUD data in menu
heinrichsweikamp
parents:
diff changeset
584 #DEFINE short_gas_decriptions flag7,6 ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 7
diff changeset
585 #DEFINE max_depth_greater_100m flag7,7 ; =1: Max. Depth > 100m
0
heinrichsweikamp
parents:
diff changeset
586
heinrichsweikamp
parents:
diff changeset
587 #DEFINE is_bailout flag8,0 ; =1: Bailout
heinrichsweikamp
parents:
diff changeset
588 #DEFINE is_bailout_menu flag8,1 ; =1: Bailout
heinrichsweikamp
parents:
diff changeset
589 #DEFINE toggle_gf flag8,2 ; =1: Toggle GF/aGF
heinrichsweikamp
parents:
diff changeset
590 #DEFINE use_agf flag8,3 ; =1: Use aGF (instead of GF)
heinrichsweikamp
parents:
diff changeset
591 #DEFINE battery_removed_in_usb flag8,4 ; =1: The battery has been removed in USB
heinrichsweikamp
parents:
diff changeset
592 #DEFINE adc_running flag8,5 ; =1: The ADC is in use
heinrichsweikamp
parents:
diff changeset
593 #DEFINE comm_service_enabled flag8,6 ; =1: COMM Service mode unlocked
heinrichsweikamp
parents:
diff changeset
594 #DEFINE compass_enabled flag8,7 ; =1: The compass and accelerometer chip is active
heinrichsweikamp
parents:
diff changeset
595
16
7b06f20881be calm compass reading for minor heading changes
heinrichsweikamp
parents: 15
diff changeset
596 #DEFINE compass_fast_mode flag9,0 ; =1: The compass is in fast mode
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 47
diff changeset
597 #DEFINE in_color_menu flag9,1 ; =1: In the color scheme menu
16
7b06f20881be calm compass reading for minor heading changes
heinrichsweikamp
parents: 15
diff changeset
598
0
heinrichsweikamp
parents:
diff changeset
599 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
600 ; C-code Routines
heinrichsweikamp
parents:
diff changeset
601 ; PART 2
heinrichsweikamp
parents:
diff changeset
602 extern deco_calc_CNS_decrease_15min
heinrichsweikamp
parents:
diff changeset
603 extern deco_calc_CNS_fraction
heinrichsweikamp
parents:
diff changeset
604 extern deco_calc_desaturation_time
heinrichsweikamp
parents:
diff changeset
605 extern deco_calc_hauptroutine
heinrichsweikamp
parents:
diff changeset
606 extern deco_calc_tissue
heinrichsweikamp
parents:
diff changeset
607 extern deco_calc_percentage
heinrichsweikamp
parents:
diff changeset
608 extern deco_calc_wo_deco_step_1_min
heinrichsweikamp
parents:
diff changeset
609 extern deco_calc_dive_interval
heinrichsweikamp
parents:
diff changeset
610 extern deco_clear_CNS_fraction
heinrichsweikamp
parents:
diff changeset
611 extern deco_clear_tissue
heinrichsweikamp
parents:
diff changeset
612 extern deco_pull_tissues_from_vault
heinrichsweikamp
parents:
diff changeset
613 extern deco_push_tissues_to_vault
heinrichsweikamp
parents:
diff changeset
614