Mercurial > public > hwos_code
annotate src/customview.asm @ 252:d912fb71d606
change warning sign
author | heinrichsweikamp |
---|---|
date | Thu, 19 Mar 2015 12:28:23 +0100 |
parents | 94bf757690cf |
children | 5fe7aff622f3 |
rev | line source |
---|---|
0 | 1 ;============================================================================= |
2 ; | |
3 ; File customview.asm | |
4 ; | |
5 ; Customview in Surfacemode and Divemode | |
6 ; | |
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | |
8 ;============================================================================= | |
9 ; HISTORY | |
10 ; 2011-08-10 : [mH] moving from OSTC code | |
11 | |
12 ;============================================================================= | |
13 | |
14 #include "ostc3.inc" ; Mandatory header | |
15 #include "tft_outputs.inc" | |
16 #include "strings.inc" | |
17 #include "tft.inc" | |
18 #include "isr.inc" | |
19 #include "wait.inc" | |
20 #include "surfmode.inc" | |
21 #include "convert.inc" | |
22 #include "divemode.inc" | |
23 #include "i2c.inc" | |
24 | |
25 gui CODE | |
26 | |
27 ;============================================================================= | |
28 ; Do every-second tasks for the custom view area (Dive mode) | |
29 | |
30 global customview_second | |
31 customview_second: | |
32 movff menupos3,WREG ; copy | |
33 dcfsnz WREG,F | |
34 bra customview_1sec_view1 | |
35 dcfsnz WREG,F | |
36 bra customview_1sec_view2 | |
37 dcfsnz WREG,F | |
38 bra customview_1sec_view3 | |
39 dcfsnz WREG,F | |
40 bra customview_1sec_view4 | |
41 dcfsnz WREG,F | |
42 bra customview_1sec_view5 | |
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
43 dcfsnz WREG,F |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
44 bra customview_1sec_view6 |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
45 dcfsnz WREG,F |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
46 bra customview_1sec_view7 |
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
47 dcfsnz WREG,F |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
48 bra customview_1sec_view8 |
123 | 49 dcfsnz WREG,F |
50 bra customview_1sec_view9 | |
0 | 51 ; Menupos3=0, do nothing |
52 return | |
53 | |
54 customview_1sec_view3: | |
55 call TFT_decoplan ; Show decoplan | |
56 return | |
57 customview_1sec_view2: | |
58 call TFT_update_avr_stopwatch ; Update average depth and stopwatch | |
59 return | |
60 customview_1sec_view1: | |
192 | 61 call TFT_update_ppo2_sensors ; Update Sensor data |
0 | 62 return |
63 customview_1sec_view4: | |
64 call TFT_ead_end_tissues_clock ; Update EAD/END, Tissues and clock | |
65 return | |
66 customview_1sec_view5: | |
67 call TFT_gf_info ; Update GF informations | |
68 return | |
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
69 customview_1sec_view6: |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
70 ; Compass updated seperately (Faster) in divemode |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
71 return |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
72 customview_1sec_view7: ; Dynamic gaslist |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
73 call TFT_dyn_gaslist ; Update the gaslist |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
74 return |
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
75 customview_1sec_view8: ; Sensor voltages |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
76 call TFT_hud_voltages ; Show HUD details |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
77 return |
123 | 78 customview_1sec_view9: ; Ceiling |
79 call TFT_ceiling ; Show Ceiling | |
80 return | |
81 | |
0 | 82 |
83 ;============================================================================= | |
84 ; Do every-minute tasks for the custom view area | |
85 | |
86 global customview_minute | |
87 customview_minute: | |
88 return | |
89 ; movff menupos3,WREG ; copy | |
90 ; dcfsnz WREG,F | |
91 ; bra customview_1min_view1 | |
92 ; dcfsnz WREG,F | |
93 ; bra customview_1min_view2 | |
94 ; dcfsnz WREG,F | |
95 ; bra customview_1min_view3 | |
96 ; dcfsnz WREG,F | |
97 ; bra customview_1min_view4 | |
98 ; dcfsnz WREG,F | |
99 ; bra customview_1min_view5 | |
100 ; dcfsnz WREG,F | |
101 ; bra customview_1min_view6 | |
102 ; dcfsnz WREG,F | |
103 ; bra customview_1min_view7 | |
104 ; dcfsnz WREG,F | |
105 ; bra customview_1min_view8 | |
106 ; dcfsnz WREG,F | |
107 ; bra customview_1min_view9 | |
108 ; dcfsnz WREG,F | |
109 ; bra customview_1min_view10 | |
110 ; dcfsnz WREG,F | |
111 ; bra customview_1min_view11 | |
112 ; ; Menupos3=0, do nothing | |
113 ; return | |
114 ; | |
115 ;customview_1min_view1: | |
116 ;customview_1min_view2: | |
117 ;customview_1min_view3: | |
118 ;customview_1min_view4: | |
119 ;customview_1min_view5: | |
120 ;customview_1min_view6: | |
121 ;customview_1min_view7: | |
122 ;customview_1min_view8: | |
123 ;customview_1min_view9: | |
124 ;customview_1min_view10: | |
125 ;customview_1min_view11: | |
126 ; return | |
127 | |
128 global surf_customview_toggle | |
129 surf_customview_toggle: | |
130 bcf switch_right | |
131 incf menupos3,F ; Number of customview to show | |
41 | 132 movlw d'7' ; Max number of customsviews in surface mode |
0 | 133 cpfsgt menupos3 ; Max reached? |
134 bra surf_customview_mask ; No, show | |
135 movlw .1 | |
136 movwf menupos3 ; Reset to one (Always one custom view visible) | |
137 | |
138 global surf_customview_mask | |
139 surf_customview_mask: | |
48 | 140 WIN_BOX_BLACK .50,surf_warning1_row-1, .0, surf_decotype_column-.1 ; top, bottom, left, right |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
141 ; Prepare title |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
142 WIN_TINY surf_customview_title_column,surf_customview_title_row |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
143 WIN_COLOR color_greenish |
0 | 144 movff menupos3,WREG ; Menupos3 holds number of customview function |
145 dcfsnz WREG,F | |
146 bra surf_customview_init_view1 ; OC Gas list | |
147 dcfsnz WREG,F | |
148 bra surf_customview_init_view2 ; CC Dil list | |
149 dcfsnz WREG,F | |
150 bra surf_customview_init_view3 ; CC SP list | |
151 dcfsnz WREG,F | |
152 bra surf_customview_init_view4 ; Custom Text | |
153 dcfsnz WREG,F | |
154 bra surf_customview_init_view5 ; Tissue Diagram | |
41 | 155 dcfsnz WREG,F |
0 | 156 bra surf_customview_init_view6 ; Compass |
41 | 157 dcfsnz WREG,F |
158 bra surf_customview_init_view7 ; Deco settings | |
0 | 159 |
160 call I2C_sleep_accelerometer ; Stop accelerometer | |
161 call I2C_sleep_compass ; Stop compass | |
162 | |
163 movlw .1 | |
164 movwf menupos3 ; Reset to one (Always one custom view visible) | |
165 | |
166 surf_customview_init_view1: ; View1: OC Gas list | |
167 btfsc FLAG_gauge_mode | |
168 bra surf_customview_toggle | |
169 btfsc FLAG_apnoe_mode | |
170 bra surf_customview_toggle | |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
171 btfsc FLAG_ccr_mode |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
172 bra surf_customview_init_view1_bail ; Bailoutversion |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
173 STRCPY_TEXT_PRINT tGaslist ; Title of customview |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
174 call TFT_standard_color |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
175 call TFT_gaslist_surfmode ; Show gas list |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
176 bra customview_toggle_exit ; Done. |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
177 |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
178 surf_customview_init_view1_bail: |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
179 STRCPY_TEXT_PRINT tDiveBailout ; Title of customview |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
180 call TFT_standard_color |
0 | 181 call TFT_gaslist_surfmode ; Show gas list |
182 bra customview_toggle_exit ; Done. | |
183 | |
184 surf_customview_init_view2: ; View2: CC Dil list | |
185 btfss FLAG_ccr_mode | |
186 bra surf_customview_toggle | |
187 btfsc FLAG_gauge_mode | |
188 bra surf_customview_toggle | |
189 btfsc FLAG_apnoe_mode | |
190 bra surf_customview_toggle | |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
191 STRCPY_TEXT_PRINT tGaslistCC ; Title of customview |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
192 call TFT_standard_color |
0 | 193 call TFT_dillist_surfmode ; Show diluent list |
194 bra customview_toggle_exit ; Done. | |
195 | |
196 surf_customview_init_view3: ; View3: CC SP list | |
197 btfss FLAG_ccr_mode | |
198 bra surf_customview_toggle | |
199 btfsc FLAG_gauge_mode | |
200 bra surf_customview_toggle | |
201 btfsc FLAG_apnoe_mode | |
202 bra surf_customview_toggle | |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
203 STRCPY_TEXT_PRINT tFixedSetpoints ; Title of customview |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
204 call TFT_standard_color |
0 | 205 call TFT_splist_surfmode ; Show Setpoint list |
206 bra customview_toggle_exit ; Done. | |
207 | |
208 surf_customview_init_view4: ; View4: Custom text | |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
209 call TFT_standard_color |
0 | 210 call TFT_custom_text ; Show the custom text |
211 bra customview_toggle_exit ; Done. | |
212 | |
213 surf_customview_init_view5: ; View5: Tissue Diagram | |
214 btfsc FLAG_gauge_mode | |
215 bra surf_customview_toggle | |
216 btfsc FLAG_apnoe_mode | |
217 bra surf_customview_toggle | |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
218 call TFT_standard_color |
0 | 219 call TFT_surface_tissues ; Show Tissue diagram |
220 bra customview_toggle_exit ; Done. | |
221 | |
222 surf_customview_init_view6: ; View6: Compass | |
223 call I2C_init_accelerometer ; Start accelerometer | |
224 call I2C_init_compass ; Start compass | |
225 call TFT_surface_compass_mask ; Show compass | |
226 bra customview_toggle_exit ; Done. | |
41 | 227 surf_customview_init_view7: |
228 btfsc FLAG_gauge_mode | |
229 bra surf_customview_toggle | |
230 btfsc FLAG_apnoe_mode | |
231 bra surf_customview_toggle | |
232 extern deco_setup_dive | |
233 call deco_setup_dive | |
234 call TFT_surface_decosettings ; Show all deco settings | |
235 bra customview_toggle_exit ; Done. | |
0 | 236 |
237 global menuview_toggle | |
238 menuview_toggle: ; Show Menu or the simulator tasks | |
239 movlw divemode_menuview_timeout | |
240 movwf timeout_counter3 | |
241 bsf menuview | |
242 bcf switch_left | |
243 incf menupos2,F ; Number of options to show | |
216
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
244 movlw d'8' ; Max number of options in divemode |
0 | 245 cpfsgt menupos2 ; Max reached? |
246 bra menuview_mask ; No, show | |
247 global menuview_toggle_reset | |
248 menuview_toggle_reset: ; Timeout occured | |
249 clrf menupos2 | |
250 bcf menuview | |
251 menuview_mask: | |
252 WIN_BOX_BLACK divemode_simtext_row, divemode_simtext_row+.24, divemode_simtext_column, divemode_simtext_column+.49 ; top, bottom, left, right | |
253 btfss FLAG_gauge_mode | |
254 bra menuview_mask2 | |
255 ; Clear some more in gauge mode | |
256 WIN_BOX_BLACK divemode_simtext_row, divemode_simtext_row+.24, divemode_simtext_column+.50, divemode_simtext_column+.70 ; top, bottom, left, right | |
257 menuview_mask2: | |
258 movlw color_yellow | |
259 call TFT_set_color | |
189
e79bc535ef9e
ignore un-calibrated sensors even if they become valid
heinrichsweikamp
parents:
188
diff
changeset
|
260 bsf win_invert ; Set invert flag |
e79bc535ef9e
ignore un-calibrated sensors even if they become valid
heinrichsweikamp
parents:
188
diff
changeset
|
261 WIN_SMALL divemode_simtext_column,divemode_simtext_row |
0 | 262 movff menupos2,WREG ; Menupos2 holds number of menu option to show |
263 dcfsnz WREG,F | |
137 | 264 bra menuview_view_gaschange ; If a better gas is indicated |
265 dcfsnz WREG,F | |
0 | 266 bra menuview_view1 |
267 dcfsnz WREG,F | |
268 bra menuview_view2 | |
269 dcfsnz WREG,F | |
270 bra menuview_view3 | |
271 dcfsnz WREG,F | |
272 bra menuview_view4 | |
273 dcfsnz WREG,F | |
274 bra menuview_view5 | |
275 dcfsnz WREG,F | |
276 bra menuview_view6 | |
216
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
277 dcfsnz WREG,F |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
278 bra menuview_view7 |
0 | 279 menuview_exit: |
280 call TFT_standard_color | |
189
e79bc535ef9e
ignore un-calibrated sensors even if they become valid
heinrichsweikamp
parents:
188
diff
changeset
|
281 bcf win_invert ; Reset invert flag |
0 | 282 return ; Menupos2 = 0, Show nothing |
137 | 283 |
284 | |
285 menuview_view_gaschange: | |
286 extern gaslist_strcat_gas_mod | |
287 btfss better_gas_available ; =1: A better gas is available | |
288 bra menuview_toggle ; No, call next option | |
138
2852b0bd6391
minor: some extra protection against wrong gas selection
heinrichsweikamp
parents:
137
diff
changeset
|
289 btfsc divemode_gaschange ; Skip if the last gas change is not done yet. |
2852b0bd6391
minor: some extra protection against wrong gas selection
heinrichsweikamp
parents:
137
diff
changeset
|
290 bra menuview_toggle |
137 | 291 bsf short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint |
292 movff better_gas_number,PRODL ; number (1-5) of the "better gas" in divemode, =0: no better gas available | |
293 decf PRODL,F | |
294 call gaslist_strcat_gas_mod ; Append gas description of gas #PRODL (0-4) to current string | |
295 movlw .5 | |
296 movwf FSR2L ; Point to char 6 (5 chars gas description only) | |
297 STRCAT_PRINT "?" | |
298 bra menuview_exit ; Done. | |
0 | 299 menuview_view1: |
300 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
301 bra menuview_toggle ; Call next option | |
302 btfsc FLAG_gauge_mode ; In Gauge mode? | |
303 bra menuview_toggle ; Call next option | |
304 STRCPY_TEXT_PRINT tDivePreMenu ; "Menu?" | |
305 bra menuview_exit ; Done. | |
306 menuview_view2: | |
307 btfss simulatormode_active ; View only for simulator mode | |
308 bra menuview_toggle ; Call next option | |
309 STRCPY_TEXT_PRINT tQuitSim ;"Quit Simulation?" | |
310 bra menuview_exit ; Done. | |
311 menuview_view3: | |
312 btfss simulatormode_active ; View only for simulator mode | |
313 bra menuview_toggle ; Call next option | |
314 STRCPY_TEXT_PRINT tDescent1m ; "Descent 1m" | |
315 bra menuview_exit ; Done. | |
316 menuview_view4: | |
317 btfss simulatormode_active ; View only for simulator mode | |
318 bra menuview_toggle ; Call next option | |
319 STRCPY_TEXT_PRINT tAscent1m ; "Ascend 1m" | |
320 bra menuview_exit ; Done. | |
321 menuview_view5: | |
322 btfss FLAG_apnoe_mode ; In Apnoe mode? | |
323 bra menuview_toggle ; No, call next option | |
184
faa06c58e977
BUGFIX: Quit Apnea mode on the surface manually
heinrichsweikamp
parents:
148
diff
changeset
|
324 btfss FLAG_active_descent ; Are we descending? |
0 | 325 bra menuview_toggle ; Yes |
326 ; We are at the surface: | |
148 | 327 STRCPY_TEXT_PRINT tQuitSim ; "Quit Apnea mode?" |
0 | 328 bra menuview_exit ; Done. |
329 menuview_view6: | |
330 btfss FLAG_gauge_mode ; In Gauge mode? | |
331 bra menuview_toggle ; No, call next option | |
332 STRCPY_TEXT_PRINT tDivemenu_ResetAvr ; "Reset Avr." | |
333 bra menuview_exit ; Done. | |
216
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
334 menuview_view7: |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
335 btfss simulatormode_active ; View only for simulator mode |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
336 bra menuview_toggle ; Call next option |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
337 btfsc FLAG_gauge_mode ; In Gauge mode? |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
338 bra menuview_toggle ; Yes, call next option |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
339 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
340 bra menuview_toggle ; Yes, call next option |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
341 STRCPY_TEXT_PRINT tplus5min ; "Sim:+5mins" |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
342 bra menuview_exit ; Done. |
0 | 343 |
344 | |
345 ;============================================================================= | |
346 ; Show next customview (and delete this flag) | |
347 global customview_toggle | |
348 customview_toggle: | |
349 bcf switch_right | |
350 incf menupos3,F ; Number of customview to show | |
123 | 351 movlw d'9' ; Max number of customsviews in divemode |
0 | 352 cpfsgt menupos3 ; Max reached? |
353 bra customview_mask ; No, show | |
354 customview_toggle_reset: ; Timeout occured | |
355 clrf menupos3 ; Reset to zero (Zero=no custom view) | |
39
e4e91fe8b09d
remember last customview in dive and surface mode
mh@mh-THINK.fritz.box
parents:
0
diff
changeset
|
356 global customview_mask |
0 | 357 customview_mask: |
358 call TFT_clear_customview_divemode | |
359 WIN_SMALL divemode_customview_column,divemode_customview_row | |
360 call TFT_standard_color | |
361 movff menupos3,WREG ; Menupos3 holds number of customview function | |
362 dcfsnz WREG,F | |
363 bra customview_init_view1 | |
364 dcfsnz WREG,F | |
365 bra customview_init_view2 | |
366 dcfsnz WREG,F | |
367 bra customview_init_view3 | |
368 dcfsnz WREG,F | |
369 bra customview_init_view4 | |
370 dcfsnz WREG,F | |
371 bra customview_init_view5 ; GF informations | |
372 dcfsnz WREG,F | |
373 bra customview_init_view6 ; Compass | |
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
374 dcfsnz WREG,F |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
375 bra customview_init_view7 ; Dynamic gaslist |
105 | 376 dcfsnz WREG,F |
377 bra customview_init_view8 ; HUD voltages | |
123 | 378 dcfsnz WREG,F |
379 bra customview_init_view9 ; Ceiling | |
0 | 380 customview_init_nocustomview: |
381 call I2C_sleep_accelerometer ; Stop accelerometer | |
382 call I2C_sleep_compass ; Stop compass | |
383 bra customview_toggle_exit | |
384 | |
385 customview_init_view1: | |
386 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
387 bra customview_toggle ; yes, Call next view... | |
388 btfss FLAG_ccr_mode ; In CC mode? | |
389 bra customview_toggle ; no, Call next view... | |
249 | 390 movf hardware_flag,W |
391 sublw 0x11 ; 2 with BLE | |
392 btfsc STATUS,Z | |
393 bra customview_toggle ; no, Call next view... | |
0 | 394 |
395 bsf dive_hud1_displayed ; Set display flag | |
396 bsf dive_hud2_displayed ; Set display flag | |
397 bsf dive_hud3_displayed ; Set display flag | |
398 call TFT_hud_mask ; Setup HUD mask | |
192 | 399 call TFT_update_ppo2_sensors ; Update Sensor data |
0 | 400 bra customview_toggle_exit |
401 | |
402 customview_init_view2: | |
403 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
404 bra customview_toggle ; Yes, Call next view... | |
405 call TFT_mask_avr_stopwatch ; Show mask for average depth and stopwatch | |
406 call TFT_update_avr_stopwatch ; Update average depth and stopwatch | |
407 bra customview_toggle_exit | |
408 | |
409 customview_init_view3: | |
410 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
411 bra customview_toggle ; Yes, Call next view... | |
412 btfsc FLAG_gauge_mode ; In Gauge mode? | |
413 bra customview_toggle ; Yes, Call next view... | |
414 call TFT_decoplan ; Show decoplan | |
415 bra customview_toggle_exit | |
416 | |
417 customview_init_view4: | |
418 call TFT_ead_end_tissues_clock_mask ; Setup Mask | |
419 call TFT_ead_end_tissues_clock ; Show EAD/END, Tissues and clock | |
420 bra customview_toggle_exit | |
421 | |
422 customview_init_view5: | |
423 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
424 bra customview_toggle ; Yes, Call next view... | |
425 btfsc FLAG_gauge_mode ; In Gauge mode? | |
426 bra customview_toggle ; Yes, Call next view... | |
119 | 427 |
428 extern char_I_deco_model | |
429 TSTOSS char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF | |
430 bra customview_toggle ; No GF info for non-GF modes | |
431 | |
0 | 432 call TFT_gf_mask ; Setup Mask |
433 call TFT_gf_info ; Show GF informations | |
434 bra customview_toggle_exit | |
435 | |
436 customview_init_view6: ; Compass (View 6) | |
437 call I2C_init_accelerometer ; Start accelerometer | |
438 call I2C_init_compass ; Start compass | |
439 call TFT_dive_compass_mask ; Show compass | |
440 bra customview_toggle_exit | |
441 | |
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
442 customview_init_view7: ; Dynamic gaslist (View 7) |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
443 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
444 bra customview_toggle ; Yes, Call next view... |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
445 btfsc FLAG_ccr_mode ; In CC mode? |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
446 bra customview_toggle ; Yes, Call next view... |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
447 call TFT_dyn_gaslist ; Show the dyn gaslist |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
448 bra customview_toggle_exit |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
449 |
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
450 customview_init_view8: ; Sensor millivolts |
136 | 451 btfsc FLAG_gauge_mode ; In Gauge mode? |
452 bra customview_toggle ; Yes, Call next view... | |
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
453 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
454 bra customview_toggle ; yes, Call next view... |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
455 btfss FLAG_ccr_mode ; In CC mode? |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
456 bra customview_toggle ; no, Call next view... |
136 | 457 TSTOSS opt_ccr_mode ; =0: Fixed SP, =1: Sensor |
458 bra customview_toggle ; no, Call next view... | |
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
459 call TFT_hud_mask ; Setup HUD mask |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
460 call TFT_hud_voltages ; Show HUD details |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
461 bra customview_toggle_exit |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
462 |
123 | 463 customview_init_view9: ; Ceiling |
464 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
465 bra customview_toggle ; yes, Call next view... | |
466 btfsc FLAG_gauge_mode ; In Gauge mode? | |
467 bra customview_toggle ; Yes, Call next view... | |
468 call TFT_ceiling_mask ; Setup mask | |
469 call TFT_ceiling ; Show Ceiling | |
470 bra customview_toggle_exit | |
471 | |
472 | |
0 | 473 customview_toggle_exit: |
474 call TFT_standard_color | |
475 bcf toggle_customview ; Clear flag | |
476 return | |
477 | |
478 global customview_show_change_depth | |
479 customview_show_change_depth: ; Put " lom" or " loft" into Postinc2 | |
480 PUTC " " | |
481 TSTOSS opt_units ; 0=m, 1=ft | |
482 bra customview_show_mix_metric | |
483 movf lo,W | |
484 mullw .100 ; convert meters to mbar | |
485 movff PRODL,lo | |
486 movff PRODH,hi | |
487 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet | |
488 bsf leftbind | |
489 output_16 ; Change depth in lo:hi | |
490 bcf leftbind | |
491 STRCAT_TEXT tFeets | |
492 return | |
493 customview_show_mix_metric: | |
494 output_99 ; Change depth in lo | |
495 STRCAT_TEXT tMeters | |
496 return | |
497 | |
498 | |
499 global customview_show_mix | |
500 customview_show_mix: ; Put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2 | |
501 tstfsz hi ; He=0? | |
502 bra customview_show_mix5 ; No, Show a TX | |
503 movlw .21 | |
504 cpfseq lo ; Air? | |
505 bra customview_show_mix2 ; No | |
506 STRCAT_TEXT tSelectAir ; Yes, show "Air" | |
507 bra customview_show_mix4b | |
508 customview_show_mix2: | |
509 movlw .100 | |
510 cpfseq lo ; O2? | |
511 bra customview_show_mix3 ; No | |
512 STRCAT_TEXT tSelectO2 ; Yes, show "O2" | |
513 bra customview_show_mix4b | |
514 | |
515 customview_show_mix3: | |
516 movlw .21 | |
517 cpfslt lo ; < Nx21? | |
518 bra customview_show_mix4 ; No | |
519 STRCAT_TEXT tGasErr ; Yes, show "Err" | |
520 output_99 ; O2 ratio is still in "lo" | |
521 bra customview_show_mix4c | |
522 | |
523 customview_show_mix4: | |
524 STRCAT_TEXT tSelectNx ; Show "Nx" | |
525 output_99 ; O2 ratio is still in "lo" | |
526 customview_show_mix4b: | |
527 STRCAT " " | |
528 customview_show_mix4c: | |
529 btfsc divemode ; In divemode | |
530 return ; Yes | |
531 STRCAT " " | |
532 return | |
533 | |
534 customview_show_mix5: | |
535 btfsc divemode | |
536 bra customview_show_mix6 | |
537 STRCAT_TEXT tSelectTx ; Show "Tx" | |
538 customview_show_mix6: | |
539 output_99 ; O2 ratio is still in "lo" | |
540 PUTC "/" | |
541 movff hi,lo | |
542 output_99 ; He ratio | |
543 return | |
544 | |
545 END |