Mercurial > public > hwos_code
annotate src/customview.asm @ 471:9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
CHANGE: Customview 4 shows Clock, Battery Information and Tissue Information
author | heinrichsweikamp |
---|---|
date | Sun, 11 Dec 2016 14:43:56 +0100 |
parents | 23b58c4bc6aa |
children | 4fdf6886004b |
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 | |
275 | 14 #include "hwos.inc" ; Mandatory header |
0 | 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 | |
428 | 34 goto TFT_update_ppo2_sensors ; Update Sensor data ; and return; bra customview_1sec_view1 |
0 | 35 dcfsnz WREG,F |
428 | 36 goto TFT_update_avr_stopwatch ; Update average depth and stopwatch; and return ;bra customview_1sec_view2 |
0 | 37 dcfsnz WREG,F |
428 | 38 goto TFT_decoplan ; Show decoplan ; and return; bra customview_1sec_view3 |
0 | 39 dcfsnz WREG,F |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
40 goto TFT_battinfo_tissues_clock ; Update EAD/END, Tissues and clock ; and return; bra customview_1sec_view4 |
0 | 41 dcfsnz WREG,F |
428 | 42 goto TFT_gf_info ; Update GF informations ; and return bra customview_1sec_view5 |
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
43 dcfsnz WREG,F |
428 | 44 return ; Compass updated seperately (Faster) in divemode; bra customview_1sec_view6 |
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
45 dcfsnz WREG,F |
428 | 46 goto TFT_dyn_gaslist ; Update the gaslist ; and return 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 |
428 | 48 goto TFT_hud_voltages ; Show HUD details ; and return bra customview_1sec_view8 |
123 | 49 dcfsnz WREG,F |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
50 bra customview_1sec_view9 ; Make sure to change value in "check_ppo2_display:" when moving around custom views |
413
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
51 dcfsnz WREG,F |
428 | 52 goto TFT_sensor_check ; Show ppO2 of O2 and Diluent ; and return bra customview_1sec_view10 |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
53 dcfsnz WREG,F |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
54 goto TFT_ppo2_ead_end_cns ; Show ppO2, END/EAD and CNS |
0 | 55 ; Menupos3=0, do nothing |
56 return | |
57 | |
428 | 58 ;customview_1sec_view3: |
59 ; goto TFT_decoplan ; Show decoplan ; and return | |
60 ;customview_1sec_view2: | |
61 ; goto TFT_update_avr_stopwatch ; Update average depth and stopwatch; and return | |
62 ;customview_1sec_view1: | |
63 ; goto TFT_update_ppo2_sensors ; Update Sensor data ; and return | |
64 ;customview_1sec_view4: | |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
65 ; goto TFT_battinfo_tissues_clock ; Update EAD/END, Tissues and clock ; and return |
428 | 66 ;customview_1sec_view5: |
67 ; goto TFT_gf_info ; Update GF informations ; and return | |
68 ;customview_1sec_view6: | |
69 ; return ; Compass updated seperately (Faster) in divemode | |
70 ; | |
71 ;customview_1sec_view7: ; Dynamic gaslist | |
72 ; goto TFT_dyn_gaslist ; Update the gaslist ; and return | |
73 ;customview_1sec_view8: ; Sensor voltages | |
74 ; goto TFT_hud_voltages ; Show HUD details ; and return | |
123 | 75 customview_1sec_view9: ; Ceiling |
76 call TFT_ceiling ; Show Ceiling | |
333
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
77 |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
78 ; ppO2 value |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
79 call TFT_display_ppo2_val |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
80 |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
81 ; current GF value |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
82 extern char_I_deco_model |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
83 TSTOSS char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
84 return ; No GF info for non-GF modes |
428 | 85 goto TFT_gf_info ; Update GF informations ; and return |
123 | 86 |
428 | 87 ;customview_1sec_view10: ; Sensor check |
88 ; goto TFT_sensor_check ; Show ppO2 of O2 and Diluent ; and return | |
413
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
89 |
0 | 90 |
91 ;============================================================================= | |
92 ; Do every-minute tasks for the custom view area | |
93 | |
94 global customview_minute | |
95 customview_minute: | |
96 return | |
97 ; movff menupos3,WREG ; copy | |
98 ; dcfsnz WREG,F | |
99 ; bra customview_1min_view1 | |
100 ; dcfsnz WREG,F | |
101 ; bra customview_1min_view2 | |
102 ; dcfsnz WREG,F | |
103 ; bra customview_1min_view3 | |
104 ; dcfsnz WREG,F | |
105 ; bra customview_1min_view4 | |
106 ; dcfsnz WREG,F | |
107 ; bra customview_1min_view5 | |
108 ; dcfsnz WREG,F | |
109 ; bra customview_1min_view6 | |
110 ; dcfsnz WREG,F | |
111 ; bra customview_1min_view7 | |
112 ; dcfsnz WREG,F | |
113 ; bra customview_1min_view8 | |
114 ; dcfsnz WREG,F | |
115 ; bra customview_1min_view9 | |
116 ; dcfsnz WREG,F | |
117 ; bra customview_1min_view10 | |
118 ; dcfsnz WREG,F | |
119 ; bra customview_1min_view11 | |
120 ; ; Menupos3=0, do nothing | |
121 ; return | |
122 ; | |
123 ;customview_1min_view1: | |
124 ;customview_1min_view2: | |
125 ;customview_1min_view3: | |
126 ;customview_1min_view4: | |
127 ;customview_1min_view5: | |
128 ;customview_1min_view6: | |
129 ;customview_1min_view7: | |
130 ;customview_1min_view8: | |
131 ;customview_1min_view9: | |
132 ;customview_1min_view10: | |
133 ;customview_1min_view11: | |
134 ; return | |
135 | |
136 global surf_customview_toggle | |
137 surf_customview_toggle: | |
138 bcf switch_right | |
139 incf menupos3,F ; Number of customview to show | |
41 | 140 movlw d'7' ; Max number of customsviews in surface mode |
0 | 141 cpfsgt menupos3 ; Max reached? |
142 bra surf_customview_mask ; No, show | |
143 movlw .1 | |
144 movwf menupos3 ; Reset to one (Always one custom view visible) | |
145 | |
146 global surf_customview_mask | |
147 surf_customview_mask: | |
48 | 148 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
|
149 ; Prepare title |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
150 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
|
151 WIN_COLOR color_greenish |
0 | 152 movff menupos3,WREG ; Menupos3 holds number of customview function |
153 dcfsnz WREG,F | |
154 bra surf_customview_init_view1 ; OC Gas list | |
155 dcfsnz WREG,F | |
156 bra surf_customview_init_view2 ; CC Dil list | |
157 dcfsnz WREG,F | |
158 bra surf_customview_init_view3 ; CC SP list | |
159 dcfsnz WREG,F | |
160 bra surf_customview_init_view4 ; Custom Text | |
161 dcfsnz WREG,F | |
162 bra surf_customview_init_view5 ; Tissue Diagram | |
41 | 163 dcfsnz WREG,F |
0 | 164 bra surf_customview_init_view6 ; Compass |
41 | 165 dcfsnz WREG,F |
166 bra surf_customview_init_view7 ; Deco settings | |
0 | 167 |
168 call I2C_sleep_accelerometer ; Stop accelerometer | |
169 call I2C_sleep_compass ; Stop compass | |
170 | |
171 movlw .1 | |
172 movwf menupos3 ; Reset to one (Always one custom view visible) | |
173 | |
174 surf_customview_init_view1: ; View1: OC Gas list | |
175 btfsc FLAG_gauge_mode | |
176 bra surf_customview_toggle | |
177 btfsc FLAG_apnoe_mode | |
178 bra surf_customview_toggle | |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
179 btfsc FLAG_ccr_mode |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
180 bra surf_customview_init_view1_bail ; Bailoutversion |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
181 STRCPY_TEXT_PRINT tGaslist ; Title of customview |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
182 call TFT_standard_color |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
183 call TFT_gaslist_surfmode ; Show gas list |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
184 bra customview_toggle_exit ; Done. |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
185 |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
186 surf_customview_init_view1_bail: |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
187 STRCPY_TEXT_PRINT tDiveBailout ; Title of customview |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
188 call TFT_standard_color |
0 | 189 call TFT_gaslist_surfmode ; Show gas list |
190 bra customview_toggle_exit ; Done. | |
191 | |
192 surf_customview_init_view2: ; View2: CC Dil list | |
193 btfss FLAG_ccr_mode | |
194 bra surf_customview_toggle | |
195 btfsc FLAG_gauge_mode | |
196 bra surf_customview_toggle | |
197 btfsc FLAG_apnoe_mode | |
198 bra surf_customview_toggle | |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
199 STRCPY_TEXT_PRINT tGaslistCC ; Title of customview |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
200 call TFT_standard_color |
0 | 201 call TFT_dillist_surfmode ; Show diluent list |
202 bra customview_toggle_exit ; Done. | |
203 | |
204 surf_customview_init_view3: ; View3: CC SP list | |
205 btfss FLAG_ccr_mode | |
206 bra surf_customview_toggle | |
207 btfsc FLAG_gauge_mode | |
208 bra surf_customview_toggle | |
209 btfsc FLAG_apnoe_mode | |
210 bra surf_customview_toggle | |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
211 STRCPY_TEXT_PRINT tFixedSetpoints ; Title of customview |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
212 call TFT_standard_color |
0 | 213 call TFT_splist_surfmode ; Show Setpoint list |
214 bra customview_toggle_exit ; Done. | |
215 | |
216 surf_customview_init_view4: ; View4: Custom text | |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
217 call TFT_standard_color |
0 | 218 call TFT_custom_text ; Show the custom text |
219 bra customview_toggle_exit ; Done. | |
220 | |
221 surf_customview_init_view5: ; View5: Tissue Diagram | |
222 btfsc FLAG_gauge_mode | |
223 bra surf_customview_toggle | |
224 btfsc FLAG_apnoe_mode | |
225 bra surf_customview_toggle | |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
226 call TFT_standard_color |
0 | 227 call TFT_surface_tissues ; Show Tissue diagram |
228 bra customview_toggle_exit ; Done. | |
229 | |
230 surf_customview_init_view6: ; View6: Compass | |
231 call I2C_init_accelerometer ; Start accelerometer | |
232 call I2C_init_compass ; Start compass | |
256
5b4ef0b9090d
place compass display code into compass_ops.asm
heinrichsweikamp
parents:
254
diff
changeset
|
233 extern TFT_surface_compass_mask |
0 | 234 call TFT_surface_compass_mask ; Show compass |
235 bra customview_toggle_exit ; Done. | |
41 | 236 surf_customview_init_view7: |
237 btfsc FLAG_gauge_mode | |
238 bra surf_customview_toggle | |
239 btfsc FLAG_apnoe_mode | |
240 bra surf_customview_toggle | |
241 extern deco_setup_dive | |
242 call deco_setup_dive | |
243 call TFT_surface_decosettings ; Show all deco settings | |
244 bra customview_toggle_exit ; Done. | |
0 | 245 |
246 global menuview_toggle | |
247 menuview_toggle: ; Show Menu or the simulator tasks | |
248 movlw divemode_menuview_timeout | |
249 movwf timeout_counter3 | |
250 bsf menuview | |
251 bcf switch_left | |
252 incf menupos2,F ; Number of options to show | |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
253 movlw d'9' ; Max number of options in divemode |
0 | 254 cpfsgt menupos2 ; Max reached? |
255 bra menuview_mask ; No, show | |
256 global menuview_toggle_reset | |
257 menuview_toggle_reset: ; Timeout occured | |
258 clrf menupos2 | |
259 bcf menuview | |
260 menuview_mask: | |
300
5ad479f2a868
Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents:
275
diff
changeset
|
261 WIN_BOX_BLACK dm_simtext_row, dm_simtext_row+.23, dm_simtext_column, dm_simtext_column+.49 ; top, bottom, left, right |
0 | 262 btfss FLAG_gauge_mode |
263 bra menuview_mask2 | |
315
4f83470dcece
VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents:
300
diff
changeset
|
264 ; Clear some more in gauge mode -- "Reset Avg." text is longer than normal simtext |
300
5ad479f2a868
Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents:
275
diff
changeset
|
265 WIN_BOX_BLACK dm_simtext_row, dm_simtext_row+.23, dm_simtext_column+.50, dm_simtext_column+.70 ; top, bottom, left, right |
327
ca5df826437a
Small fix for the custom grid layout
janos_kovacs <kovjanos@gmail.com>
parents:
315
diff
changeset
|
266 menuview_mask2: |
315
4f83470dcece
VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents:
300
diff
changeset
|
267 call TFT_draw_gassep_line |
0 | 268 movlw color_yellow |
269 call TFT_set_color | |
189
e79bc535ef9e
ignore un-calibrated sensors even if they become valid
heinrichsweikamp
parents:
188
diff
changeset
|
270 bsf win_invert ; Set invert flag |
300
5ad479f2a868
Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents:
275
diff
changeset
|
271 WIN_SMALL dm_simtext_column,dm_simtext_row |
0 | 272 movff menupos2,WREG ; Menupos2 holds number of menu option to show |
273 dcfsnz WREG,F | |
137 | 274 bra menuview_view_gaschange ; If a better gas is indicated |
275 dcfsnz WREG,F | |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
276 bra menuview_view1 ; "Menu?" (Not in Gauge and Anpnoe) |
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
277 dcfsnz WREG,F |
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
278 bra menuview_view2 ; "Quit Simulation?" (Sim only) |
0 | 279 dcfsnz WREG,F |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
280 bra menuview_view3 ; "Descent 1m" (Sim only) |
0 | 281 dcfsnz WREG,F |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
282 bra menuview_view4 ; "Ascend 1m" (Sim only) |
0 | 283 dcfsnz WREG,F |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
284 bra menuview_view5 ; "Quit Apnea mode?" (Apnea only) |
0 | 285 dcfsnz WREG,F |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
286 bra menuview_view6 ; "Reset Avr." (Gauge only) |
0 | 287 dcfsnz WREG,F |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
288 bra menuview_view7 ; "Sim:+5mins" (Sim only) |
216
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
289 dcfsnz WREG,F |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
290 bra menuview_view8 ; "Heading" (When compass is shown) |
0 | 291 menuview_exit: |
292 call TFT_standard_color | |
189
e79bc535ef9e
ignore un-calibrated sensors even if they become valid
heinrichsweikamp
parents:
188
diff
changeset
|
293 bcf win_invert ; Reset invert flag |
0 | 294 return ; Menupos2 = 0, Show nothing |
137 | 295 |
296 | |
297 menuview_view_gaschange: | |
298 extern gaslist_strcat_gas_mod | |
299 btfss better_gas_available ; =1: A better gas is available | |
300 bra menuview_toggle ; No, call next option | |
138
2852b0bd6391
minor: some extra protection against wrong gas selection
heinrichsweikamp
parents:
137
diff
changeset
|
301 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
|
302 bra menuview_toggle |
137 | 303 bsf short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint |
304 movff better_gas_number,PRODL ; number (1-5) of the "better gas" in divemode, =0: no better gas available | |
305 decf PRODL,F | |
306 call gaslist_strcat_gas_mod ; Append gas description of gas #PRODL (0-4) to current string | |
307 movlw .5 | |
308 movwf FSR2L ; Point to char 6 (5 chars gas description only) | |
309 STRCAT_PRINT "?" | |
310 bra menuview_exit ; Done. | |
0 | 311 menuview_view1: |
312 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
313 bra menuview_toggle ; Call next option | |
314 btfsc FLAG_gauge_mode ; In Gauge mode? | |
315 bra menuview_toggle ; Call next option | |
316 STRCPY_TEXT_PRINT tDivePreMenu ; "Menu?" | |
317 bra menuview_exit ; Done. | |
318 menuview_view2: | |
319 btfss simulatormode_active ; View only for simulator mode | |
320 bra menuview_toggle ; Call next option | |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
321 STRCPY_TEXT_PRINT tQuitSim ; "Quit Simulation?" |
0 | 322 bra menuview_exit ; Done. |
323 menuview_view3: | |
324 btfss simulatormode_active ; View only for simulator mode | |
325 bra menuview_toggle ; Call next option | |
428 | 326 STRCPY_PRINT "Sim:-1m" |
0 | 327 bra menuview_exit ; Done. |
328 menuview_view4: | |
329 btfss simulatormode_active ; View only for simulator mode | |
330 bra menuview_toggle ; Call next option | |
428 | 331 STRCPY_PRINT "Sim:+1m" |
0 | 332 bra menuview_exit ; Done. |
333 menuview_view5: | |
334 btfss FLAG_apnoe_mode ; In Apnoe mode? | |
335 bra menuview_toggle ; No, call next option | |
184
faa06c58e977
BUGFIX: Quit Apnea mode on the surface manually
heinrichsweikamp
parents:
148
diff
changeset
|
336 btfss FLAG_active_descent ; Are we descending? |
0 | 337 bra menuview_toggle ; Yes |
338 ; We are at the surface: | |
148 | 339 STRCPY_TEXT_PRINT tQuitSim ; "Quit Apnea mode?" |
0 | 340 bra menuview_exit ; Done. |
341 menuview_view6: | |
342 btfss FLAG_gauge_mode ; In Gauge mode? | |
343 bra menuview_toggle ; No, call next option | |
437 | 344 STRCPY_TEXT_PRINT tDivemenu_ResetAvg ; "Reset Avg." |
0 | 345 bra menuview_exit ; Done. |
216
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
346 menuview_view7: |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
347 btfss simulatormode_active ; View only for simulator mode |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
348 bra menuview_toggle ; Call next option |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
349 btfsc FLAG_gauge_mode ; In Gauge mode? |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
350 bra menuview_toggle ; Yes, call next option |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
351 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
352 bra menuview_toggle ; Yes, call next option |
428 | 353 STRCPY_PRINT "Sim:+5'" |
216
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
354 bra menuview_exit ; Done. |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
355 menuview_view8: |
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
356 movlw .6 |
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
357 cpfseq menupos3 ; in compass view? |
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
358 bra menuview_toggle ; No, call next option |
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
359 STRCPY_TEXT_PRINT tSetHeading ; "Heading" |
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
360 bra menuview_exit ; Done. |
0 | 361 |
362 | |
363 ;============================================================================= | |
364 ; Show next customview (and delete this flag) | |
365 global customview_toggle | |
366 customview_toggle: | |
367 bcf switch_right | |
368 incf menupos3,F ; Number of customview to show | |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
369 movlw d'11' ; Max number of customsviews in divemode |
0 | 370 cpfsgt menupos3 ; Max reached? |
371 bra customview_mask ; No, show | |
372 customview_toggle_reset: ; Timeout occured | |
373 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
|
374 global customview_mask |
0 | 375 customview_mask: |
353
573f2251cf49
NEW: Quit Simulator automatically when starting a real dive
heinrichsweikamp
parents:
337
diff
changeset
|
376 ; Clear custom view area in divemode |
573f2251cf49
NEW: Quit Simulator automatically when starting a real dive
heinrichsweikamp
parents:
337
diff
changeset
|
377 WIN_BOX_BLACK dm_customview_row, dm_customview_bot, dm_customview_column, dm_customview_rgt ; top, bottom, left, right |
300
5ad479f2a868
Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents:
275
diff
changeset
|
378 WIN_SMALL dm_customview_column,dm_customview_row |
0 | 379 call TFT_standard_color |
380 movff menupos3,WREG ; Menupos3 holds number of customview function | |
381 dcfsnz WREG,F | |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
382 bra customview_init_view1 ; Update Sensor data |
0 | 383 dcfsnz WREG,F |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
384 bra customview_init_view2 ; average depth and stopwatch |
0 | 385 dcfsnz WREG,F |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
386 bra customview_init_view3 ; Decoplan |
0 | 387 dcfsnz WREG,F |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
388 bra customview_init_view4 ; Battery info, Tissues and clock |
0 | 389 dcfsnz WREG,F |
390 bra customview_init_view5 ; GF informations | |
391 dcfsnz WREG,F | |
392 bra customview_init_view6 ; Compass | |
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
393 dcfsnz WREG,F |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
394 bra customview_init_view7 ; Dynamic gaslist |
105 | 395 dcfsnz WREG,F |
396 bra customview_init_view8 ; HUD voltages | |
123 | 397 dcfsnz WREG,F |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
398 bra customview_init_view9 ; ppO2, Ceiling and current GF |
413
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
399 dcfsnz WREG,F |
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
400 bra customview_init_view10 ; Sensor check |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
401 dcfsnz WREG,F |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
402 bra customview_init_view11 ; ppO2, END/EAD and CNS |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
403 |
0 | 404 customview_init_nocustomview: |
405 call I2C_sleep_accelerometer ; Stop accelerometer | |
406 call I2C_sleep_compass ; Stop compass | |
407 bra customview_toggle_exit | |
408 | |
409 customview_init_view1: | |
410 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
411 bra customview_toggle ; yes, Call next view... | |
412 btfss FLAG_ccr_mode ; In CC mode? | |
413 bra customview_toggle ; no, Call next view... | |
249 | 414 movf hardware_flag,W |
415 sublw 0x11 ; 2 with BLE | |
416 btfsc STATUS,Z | |
417 bra customview_toggle ; no, Call next view... | |
0 | 418 |
419 bsf dive_hud1_displayed ; Set display flag | |
420 bsf dive_hud2_displayed ; Set display flag | |
421 bsf dive_hud3_displayed ; Set display flag | |
422 call TFT_hud_mask ; Setup HUD mask | |
192 | 423 call TFT_update_ppo2_sensors ; Update Sensor data |
0 | 424 bra customview_toggle_exit |
425 | |
426 customview_init_view2: | |
427 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
428 bra customview_toggle ; Yes, Call next view... | |
429 call TFT_mask_avr_stopwatch ; Show mask for average depth and stopwatch | |
430 call TFT_update_avr_stopwatch ; Update average depth and stopwatch | |
431 bra customview_toggle_exit | |
432 | |
433 customview_init_view3: | |
434 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
435 bra customview_toggle ; Yes, Call next view... | |
436 btfsc FLAG_gauge_mode ; In Gauge mode? | |
437 bra customview_toggle ; Yes, Call next view... | |
438 call TFT_decoplan ; Show decoplan | |
439 bra customview_toggle_exit | |
440 | |
441 customview_init_view4: | |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
442 call TFT_battinfo_tissues_clock_mask ; Setup Mask |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
443 call TFT_battinfo_tissues_clock ; Show Battery info, Tissues and clock |
0 | 444 bra customview_toggle_exit |
445 | |
446 customview_init_view5: | |
447 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
448 bra customview_toggle ; Yes, Call next view... | |
449 btfsc FLAG_gauge_mode ; In Gauge mode? | |
450 bra customview_toggle ; Yes, Call next view... | |
119 | 451 |
452 extern char_I_deco_model | |
453 TSTOSS char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF | |
454 bra customview_toggle ; No GF info for non-GF modes | |
455 | |
0 | 456 call TFT_gf_mask ; Setup Mask |
457 call TFT_gf_info ; Show GF informations | |
458 bra customview_toggle_exit | |
459 | |
460 customview_init_view6: ; Compass (View 6) | |
461 call I2C_init_accelerometer ; Start accelerometer | |
462 call I2C_init_compass ; Start compass | |
256
5b4ef0b9090d
place compass display code into compass_ops.asm
heinrichsweikamp
parents:
254
diff
changeset
|
463 extern TFT_dive_compass_mask |
0 | 464 call TFT_dive_compass_mask ; Show compass |
465 bra customview_toggle_exit | |
466 | |
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
467 customview_init_view7: ; Dynamic gaslist (View 7) |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
468 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
469 bra customview_toggle ; Yes, Call next view... |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
470 btfsc FLAG_ccr_mode ; In CC mode? |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
471 bra customview_toggle ; Yes, Call next view... |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
472 call TFT_dyn_gaslist ; Show the dyn gaslist |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
473 bra customview_toggle_exit |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
474 |
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
475 customview_init_view8: ; Sensor millivolts |
136 | 476 btfsc FLAG_gauge_mode ; In Gauge mode? |
477 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
|
478 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
479 bra customview_toggle ; yes, Call next view... |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
480 btfss FLAG_ccr_mode ; In CC mode? |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
481 bra customview_toggle ; no, Call next view... |
337
508d7fb98b34
cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents:
333
diff
changeset
|
482 movff opt_ccr_mode,WREG ; =0: Fixed SP, =1: Sensor, =2: Auto SP |
508d7fb98b34
cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents:
333
diff
changeset
|
483 sublw .1 ; opt_ccr_mode = 1 (Sensor)? |
508d7fb98b34
cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents:
333
diff
changeset
|
484 bnz customview_toggle ; no, Call next view... |
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
485 call TFT_hud_mask ; Setup HUD mask |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
486 call TFT_hud_voltages ; Show HUD details |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
487 bra customview_toggle_exit |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
488 |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
489 customview_init_view9: ; ppO2, Ceiling and current GF |
123 | 490 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
491 bra customview_toggle ; yes, Call next view... | |
492 btfsc FLAG_gauge_mode ; In Gauge mode? | |
493 bra customview_toggle ; Yes, Call next view... | |
494 call TFT_ceiling_mask ; Setup mask | |
495 call TFT_ceiling ; Show Ceiling | |
333
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
496 |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
497 ; ppO2 value |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
498 call TFT_mask_ppo2 |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
499 call TFT_display_ppo2_val |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
500 |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
501 ; current GF value |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
502 extern char_I_deco_model |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
503 TSTOSS char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
504 bra customview_toggle_exit ; No GF info for non-GF modes |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
505 call TFT_gf_mask_cGF ; Setup Mask - current GF only |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
506 call TFT_gf_info ; Show GF informations |
123 | 507 bra customview_toggle_exit |
508 | |
413
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
509 customview_init_view10: ; Sensor check |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
510 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
511 bra customview_toggle ; yes, Call next view... |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
512 btfsc FLAG_gauge_mode ; In Gauge mode? |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
513 bra customview_toggle ; Yes, Call next view... |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
514 btfss FLAG_ccr_mode ; In CC mode? |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
515 bra customview_toggle ; no, Call next view... |
413
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
516 |
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
517 call TFT_sensor_check_mask ; Show ppO2 of O2 and Diluent mask |
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
518 call TFT_sensor_check ; Show ppO2 of O2 and Diluent |
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
519 bra customview_toggle_exit |
123 | 520 |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
521 customview_init_view11: ; ppO2, END/EAD and CNS |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
522 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
523 bra customview_toggle ; yes, Call next view... |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
524 btfsc FLAG_gauge_mode ; In Gauge mode? |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
525 bra customview_toggle ; Yes, Call next view... |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
526 |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
527 call TFT_ppo2_ead_end_cns_mask ; Show ppO2, END/EAD and CNS mask |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
528 call TFT_ppo2_ead_end_cns ; Show ppO2, END/EAD and CNS |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
529 bra customview_toggle_exit |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
530 |
0 | 531 customview_toggle_exit: |
532 call TFT_standard_color | |
533 bcf toggle_customview ; Clear flag | |
534 return | |
535 | |
536 global customview_show_change_depth | |
537 customview_show_change_depth: ; Put " lom" or " loft" into Postinc2 | |
538 PUTC " " | |
539 TSTOSS opt_units ; 0=m, 1=ft | |
540 bra customview_show_mix_metric | |
541 movf lo,W | |
542 mullw .100 ; convert meters to mbar | |
543 movff PRODL,lo | |
544 movff PRODH,hi | |
545 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet | |
546 bsf leftbind | |
547 output_16 ; Change depth in lo:hi | |
548 bcf leftbind | |
549 STRCAT_TEXT tFeets | |
550 return | |
551 customview_show_mix_metric: | |
552 output_99 ; Change depth in lo | |
553 STRCAT_TEXT tMeters | |
554 return | |
555 | |
556 | |
557 global customview_show_mix | |
558 customview_show_mix: ; Put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2 | |
559 tstfsz hi ; He=0? | |
560 bra customview_show_mix5 ; No, Show a TX | |
561 movlw .21 | |
562 cpfseq lo ; Air? | |
563 bra customview_show_mix2 ; No | |
564 STRCAT_TEXT tSelectAir ; Yes, show "Air" | |
565 bra customview_show_mix4b | |
566 customview_show_mix2: | |
567 movlw .100 | |
568 cpfseq lo ; O2? | |
569 bra customview_show_mix3 ; No | |
570 STRCAT_TEXT tSelectO2 ; Yes, show "O2" | |
571 bra customview_show_mix4b | |
572 | |
573 customview_show_mix3: | |
574 movlw .21 | |
575 cpfslt lo ; < Nx21? | |
576 bra customview_show_mix4 ; No | |
577 STRCAT_TEXT tGasErr ; Yes, show "Err" | |
578 output_99 ; O2 ratio is still in "lo" | |
579 bra customview_show_mix4c | |
580 | |
581 customview_show_mix4: | |
582 STRCAT_TEXT tSelectNx ; Show "Nx" | |
583 output_99 ; O2 ratio is still in "lo" | |
584 customview_show_mix4b: | |
585 STRCAT " " | |
586 customview_show_mix4c: | |
587 btfsc divemode ; In divemode | |
588 return ; Yes | |
589 STRCAT " " | |
590 return | |
591 | |
592 customview_show_mix5: | |
593 btfsc divemode | |
594 bra customview_show_mix6 | |
595 STRCAT_TEXT tSelectTx ; Show "Tx" | |
596 customview_show_mix6: | |
597 output_99 ; O2 ratio is still in "lo" | |
598 PUTC "/" | |
599 movff hi,lo | |
600 output_99 ; He ratio | |
601 return | |
602 | |
603 END |