Mercurial > public > hwos_code
annotate src/customview.asm @ 578:2b8ef780cfa8
work in progress...
author | heinrichsweikamp |
---|---|
date | Sun, 18 Feb 2018 21:04:54 +0100 |
parents | 690bfb76911c |
children | b455b31ce022 |
rev | line source |
---|---|
0 | 1 ;============================================================================= |
2 ; | |
560 | 3 ; File customview.asm REFACTORED VERSION V2.95 |
0 | 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" | |
560 | 24 #include "start.inc" |
0 | 25 |
26 gui CODE | |
27 | |
28 ;============================================================================= | |
29 ; Do every-second tasks for the custom view area (Dive mode) | |
30 | |
31 global customview_second | |
32 customview_second: | |
560 | 33 movff menupos3,WREG ; copy current view (1-...) |
0 | 34 dcfsnz WREG,F |
560 | 35 goto TFT_update_ppo2_sensors ; Update Sensor data ; and return |
0 | 36 dcfsnz WREG,F |
560 | 37 goto TFT_update_avr_stopwatch ; Update average depth and stopwatch; and return |
0 | 38 dcfsnz WREG,F |
560 | 39 goto TFT_decoplan ; Show decoplan ; and return |
0 | 40 dcfsnz WREG,F |
560 | 41 goto TFT_battinfo_tissues_clock ; Update Battery, Tissues and clock ; and return |
0 | 42 dcfsnz WREG,F |
560 | 43 goto TFT_gf_info ; Update GF informations ; and return |
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
44 dcfsnz WREG,F |
560 | 45 return ; Compass updated separately (faster) in divemode; |
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
46 dcfsnz WREG,F |
560 | 47 nop ; ex goto TFT_dyn_gaslist |
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
48 dcfsnz WREG,F |
560 | 49 goto TFT_CNS ; Show CNS values for end-of-dive, ex goto TFT_hud_voltages |
123 | 50 dcfsnz WREG,F |
560 | 51 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
|
52 dcfsnz WREG,F |
560 | 53 goto TFT_sensor_check ; Show ppO2 of O2 and Diluent ; and return |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
54 dcfsnz WREG,F |
560 | 55 goto TFT_ppo2_ead_end_cns ; Show ppO2, END/EAD and CNS; and return |
482
c0ee33f1f399
New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents:
476
diff
changeset
|
56 dcfsnz WREG,F |
c0ee33f1f399
New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents:
476
diff
changeset
|
57 goto TFT_pscr_info ; Show ppO2, drop and lung ratio; and return |
560 | 58 dcfsnz WREG,F |
59 goto TFT_gas_needs ; Show gas needs | |
482
c0ee33f1f399
New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents:
476
diff
changeset
|
60 |
0 | 61 ; Menupos3=0, do nothing |
62 return | |
63 | |
560 | 64 customview_1sec_view9: ; Ceiling |
65 call TFT_ceiling ; Show Ceiling | |
66 call TFT_display_pure_ppo2 ; ppO2 value | |
67 extern char_I_deco_model ; current GF value | |
68 TSTOSS char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF | |
69 return ; No GF info for non-GF modes | |
70 goto TFT_gf_info ; Update GF informations ; and return | |
123 | 71 |
560 | 72 global customview_alternative_second |
73 customview_alternative_second: | |
74 movff menupos3,WREG ; copy current view (1-...) | |
75 dcfsnz WREG,F | |
76 bra customview_alt_second_view1 ; View 1 | |
77 dcfsnz WREG,F | |
78 nop ; View 2 | |
413
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
79 |
560 | 80 ; Menupos3=0, do nothing |
81 return | |
82 | |
83 customview_alt_second_view1: | |
84 bsf FLAG_TFT_max_depth_alt | |
85 bsf FLAG_TFT_big_deco_alt | |
86 return | |
0 | 87 |
88 ;============================================================================= | |
89 ; Do every-minute tasks for the custom view area | |
90 | |
91 global customview_minute | |
92 customview_minute: | |
93 return | |
560 | 94 ; movff menupos3,WREG ; copy |
0 | 95 ; dcfsnz WREG,F |
96 ; bra customview_1min_view1 | |
97 ; dcfsnz WREG,F | |
98 ; bra customview_1min_view2 | |
99 ; dcfsnz WREG,F | |
100 ; bra customview_1min_view3 | |
101 ; dcfsnz WREG,F | |
102 ; bra customview_1min_view4 | |
103 ; dcfsnz WREG,F | |
104 ; bra customview_1min_view5 | |
105 ; dcfsnz WREG,F | |
106 ; bra customview_1min_view6 | |
107 ; dcfsnz WREG,F | |
108 ; bra customview_1min_view7 | |
109 ; dcfsnz WREG,F | |
110 ; bra customview_1min_view8 | |
111 ; dcfsnz WREG,F | |
112 ; bra customview_1min_view9 | |
113 ; dcfsnz WREG,F | |
114 ; bra customview_1min_view10 | |
115 ; dcfsnz WREG,F | |
116 ; bra customview_1min_view11 | |
117 ; ; Menupos3=0, do nothing | |
118 ; return | |
119 ; | |
120 ;customview_1min_view1: | |
121 ;customview_1min_view2: | |
122 ;customview_1min_view3: | |
123 ;customview_1min_view4: | |
124 ;customview_1min_view5: | |
125 ;customview_1min_view6: | |
126 ;customview_1min_view7: | |
127 ;customview_1min_view8: | |
128 ;customview_1min_view9: | |
129 ;customview_1min_view10: | |
130 ;customview_1min_view11: | |
131 ; return | |
132 | |
133 global surf_customview_toggle | |
134 surf_customview_toggle: | |
135 bcf switch_right | |
136 incf menupos3,F ; Number of customview to show | |
560 | 137 movlw d'9' ; Max number of customsviews in surface mode |
0 | 138 cpfsgt menupos3 ; Max reached? |
139 bra surf_customview_mask ; No, show | |
140 movlw .1 | |
141 movwf menupos3 ; Reset to one (Always one custom view visible) | |
142 | |
143 global surf_customview_mask | |
144 surf_customview_mask: | |
48 | 145 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
|
146 ; Prepare title |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
147 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
|
148 WIN_COLOR color_greenish |
0 | 149 movff menupos3,WREG ; Menupos3 holds number of customview function |
150 dcfsnz WREG,F | |
151 bra surf_customview_init_view1 ; OC Gas list | |
152 dcfsnz WREG,F | |
153 bra surf_customview_init_view2 ; CC Dil list | |
154 dcfsnz WREG,F | |
155 bra surf_customview_init_view3 ; CC SP list | |
156 dcfsnz WREG,F | |
157 bra surf_customview_init_view4 ; Custom Text | |
158 dcfsnz WREG,F | |
159 bra surf_customview_init_view5 ; Tissue Diagram | |
503
4542d03f748a
NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents:
502
diff
changeset
|
160 dcfsnz WREG,F |
0 | 161 bra surf_customview_init_view6 ; Compass |
503
4542d03f748a
NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents:
502
diff
changeset
|
162 dcfsnz WREG,F |
41 | 163 bra surf_customview_init_view7 ; Deco settings |
503
4542d03f748a
NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents:
502
diff
changeset
|
164 dcfsnz WREG,F |
4542d03f748a
NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents:
502
diff
changeset
|
165 bra surf_customview_init_view8 ; Last Dive info |
530 | 166 dcfsnz WREG,F |
167 bra surf_customview_init_view9 ; Sensor mV readings | |
0 | 168 |
169 call I2C_sleep_accelerometer ; Stop accelerometer | |
170 call I2C_sleep_compass ; Stop compass | |
171 | |
172 movlw .1 | |
173 movwf menupos3 ; Reset to one (Always one custom view visible) | |
174 | |
175 surf_customview_init_view1: ; View1: OC Gas list | |
176 btfsc FLAG_gauge_mode | |
177 bra surf_customview_toggle | |
178 btfsc FLAG_apnoe_mode | |
179 bra surf_customview_toggle | |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
180 btfsc FLAG_ccr_mode |
502
0910c227018f
BUGFIX: PSCR mode showed bailout gaslist instead of diluent gaslist
heinrichsweikamp
parents:
485
diff
changeset
|
181 bra surf_customview_init_view1_bail ; Bailout version of "OC Gas List" |
0910c227018f
BUGFIX: PSCR mode showed bailout gaslist instead of diluent gaslist
heinrichsweikamp
parents:
485
diff
changeset
|
182 btfsc FLAG_pscr_mode |
0910c227018f
BUGFIX: PSCR mode showed bailout gaslist instead of diluent gaslist
heinrichsweikamp
parents:
485
diff
changeset
|
183 bra surf_customview_init_view1_bail ; Bailout version of "OC Gas List" |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
184 STRCPY_TEXT_PRINT tGaslist ; Title of customview |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
185 call TFT_standard_color |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
186 call TFT_gaslist_surfmode ; Show gas list |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
187 bra customview_toggle_exit ; Done. |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
188 |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
189 surf_customview_init_view1_bail: |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
190 STRCPY_TEXT_PRINT tDiveBailout ; Title of customview |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
191 call TFT_standard_color |
0 | 192 call TFT_gaslist_surfmode ; Show gas list |
193 bra customview_toggle_exit ; Done. | |
194 | |
195 surf_customview_init_view2: ; View2: CC Dil list | |
502
0910c227018f
BUGFIX: PSCR mode showed bailout gaslist instead of diluent gaslist
heinrichsweikamp
parents:
485
diff
changeset
|
196 btfsc FLAG_pscr_mode |
0910c227018f
BUGFIX: PSCR mode showed bailout gaslist instead of diluent gaslist
heinrichsweikamp
parents:
485
diff
changeset
|
197 bra surf_customview_init_view2_2 |
0 | 198 btfss FLAG_ccr_mode |
199 bra surf_customview_toggle | |
200 btfsc FLAG_gauge_mode | |
201 bra surf_customview_toggle | |
202 btfsc FLAG_apnoe_mode | |
203 bra surf_customview_toggle | |
502
0910c227018f
BUGFIX: PSCR mode showed bailout gaslist instead of diluent gaslist
heinrichsweikamp
parents:
485
diff
changeset
|
204 surf_customview_init_view2_2: |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
205 STRCPY_TEXT_PRINT tGaslistCC ; Title of customview |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
206 call TFT_standard_color |
0 | 207 call TFT_dillist_surfmode ; Show diluent list |
208 bra customview_toggle_exit ; Done. | |
209 | |
210 surf_customview_init_view3: ; View3: CC SP list | |
211 btfss FLAG_ccr_mode | |
212 bra surf_customview_toggle | |
213 btfsc FLAG_gauge_mode | |
214 bra surf_customview_toggle | |
215 btfsc FLAG_apnoe_mode | |
216 bra surf_customview_toggle | |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
217 STRCPY_TEXT_PRINT tFixedSetpoints ; Title of customview |
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_splist_surfmode ; Show Setpoint list |
220 bra customview_toggle_exit ; Done. | |
530 | 221 |
560 | 222 surf_customview_init_view9: ; View 9: Sensor mV on the surface |
530 | 223 btfsc FLAG_ccr_mode |
224 bra surf_customview_init_view9a ; we are in CCR mode | |
225 btfsc FLAG_pscr_mode | |
226 bra surf_customview_init_view9a ; we are in PSCR mode | |
560 | 227 bra surf_customview_toggle ; we are not in any rebreather mode, so skip |
530 | 228 surf_customview_init_view9a: |
560 | 229 movff opt_ccr_mode,WREG ; =0: Fixed SP, =1: Sensor, =2: Auto SP |
230 sublw .1 ; opt_ccr_mode = 1 (Sensor)? | |
231 bnz surf_customview_toggle ; sorry, no sensors, skip again | |
530 | 232 STRCPY_TEXT_PRINT tSensorMilliVolt ; Title of customview |
233 call TFT_standard_color | |
234 extern TFT_sensor_mV | |
560 | 235 call TFT_sensor_mV ; write sensor mV readings to screen |
236 bra customview_toggle_exit ; Done. | |
0 | 237 |
238 surf_customview_init_view4: ; View4: Custom text | |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
239 call TFT_standard_color |
0 | 240 call TFT_custom_text ; Show the custom text |
241 bra customview_toggle_exit ; Done. | |
242 | |
243 surf_customview_init_view5: ; View5: Tissue Diagram | |
244 btfsc FLAG_gauge_mode | |
245 bra surf_customview_toggle | |
246 btfsc FLAG_apnoe_mode | |
247 bra surf_customview_toggle | |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
248 call TFT_standard_color |
0 | 249 call TFT_surface_tissues ; Show Tissue diagram |
250 bra customview_toggle_exit ; Done. | |
251 | |
252 surf_customview_init_view6: ; View6: Compass | |
253 call I2C_init_accelerometer ; Start accelerometer | |
254 call I2C_init_compass ; Start compass | |
256
5b4ef0b9090d
place compass display code into compass_ops.asm
heinrichsweikamp
parents:
254
diff
changeset
|
255 extern TFT_surface_compass_mask |
0 | 256 call TFT_surface_compass_mask ; Show compass |
257 bra customview_toggle_exit ; Done. | |
503
4542d03f748a
NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents:
502
diff
changeset
|
258 |
41 | 259 surf_customview_init_view7: |
560 | 260 btfsc FLAG_gauge_mode ; View7: Deco settings |
41 | 261 bra surf_customview_toggle |
262 btfsc FLAG_apnoe_mode | |
263 bra surf_customview_toggle | |
560 | 264 |
41 | 265 call TFT_surface_decosettings ; Show all deco settings |
266 bra customview_toggle_exit ; Done. | |
0 | 267 |
503
4542d03f748a
NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents:
502
diff
changeset
|
268 surf_customview_init_view8: ; View8: Last dive info |
560 | 269 call TFT_surface_lastdive ; Show last dive interval |
503
4542d03f748a
NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents:
502
diff
changeset
|
270 bra customview_toggle_exit ; Done. |
4542d03f748a
NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents:
502
diff
changeset
|
271 |
4542d03f748a
NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents:
502
diff
changeset
|
272 |
0 | 273 global menuview_toggle |
560 | 274 menuview_toggle: ; Show Menu or the simulator tasks |
275 btfss alternative_divelayout ; In alternative layout mode? | |
276 bra menuview_toggle2 ; No | |
277 ; Switch back to normal mode for any menu tasks | |
278 bcf alternative_divelayout ; clear flag | |
279 bsf FLAG_TFT_divemode_mask ; Set flag for mask | |
280 bsf FLAG_TFT_max_depth ; set flag | |
281 btfss decostop_active ; deco? | |
282 bsf FLAG_TFT_display_ndl_mask ; NDL | |
283 btfsc decostop_active ; deco? | |
284 bsf FLAG_TFT_display_deko_mask ; Deco | |
285 call TFT_ClearScreen ; Clear screen | |
286 rcall customview_mask ; Re-Draw customview | |
287 | |
288 menuview_toggle2: | |
0 | 289 movlw divemode_menuview_timeout |
290 movwf timeout_counter3 | |
291 bsf menuview | |
560 | 292 bcf switch_left |
293 incf menupos2,F ; Number of options to show | |
294 movlw d'10' ; Max number of options in divemode | |
295 cpfsgt menupos2 ; Max reached? | |
296 bra menuview_mask ; No, show | |
0 | 297 global menuview_toggle_reset |
560 | 298 menuview_toggle_reset: ; Timeout occurred |
299 clrf menupos2 | |
0 | 300 bcf menuview |
301 menuview_mask: | |
576 | 302 WIN_BOX_BLACK dm_simtext_row, dm_simtext_row+.23, dm_simtext_column, dm_simtext_column+.49 ; top, bottom, left, right |
0 | 303 btfss FLAG_gauge_mode |
304 bra menuview_mask2 | |
315
4f83470dcece
VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents:
300
diff
changeset
|
305 ; 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
|
306 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
|
307 menuview_mask2: |
315
4f83470dcece
VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents:
300
diff
changeset
|
308 call TFT_draw_gassep_line |
0 | 309 movlw color_yellow |
310 call TFT_set_color | |
560 | 311 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
|
312 WIN_SMALL dm_simtext_column,dm_simtext_row |
0 | 313 movff menupos2,WREG ; Menupos2 holds number of menu option to show |
314 dcfsnz WREG,F | |
137 | 315 bra menuview_view_gaschange ; If a better gas is indicated |
316 dcfsnz WREG,F | |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
317 bra menuview_view1 ; "Menu?" (Not in Gauge and Anpnoe) |
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
318 dcfsnz WREG,F |
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
319 bra menuview_view2 ; "Quit Simulation?" (Sim only) |
0 | 320 dcfsnz WREG,F |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
321 bra menuview_view3 ; "Descent 1m" (Sim only) |
0 | 322 dcfsnz WREG,F |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
323 bra menuview_view4 ; "Ascend 1m" (Sim only) |
0 | 324 dcfsnz WREG,F |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
325 bra menuview_view5 ; "Quit Apnea mode?" (Apnea only) |
0 | 326 dcfsnz WREG,F |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
327 bra menuview_view6 ; "Reset Avr." (Gauge only) |
0 | 328 dcfsnz WREG,F |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
329 bra menuview_view7 ; "Sim:+5mins" (Sim only) |
216
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
330 dcfsnz WREG,F |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
331 bra menuview_view8 ; "Heading" (When compass is shown) |
560 | 332 dcfsnz WREG,F |
333 bra menuview_view9 ; "Layout" (Alternative Layout, aka Blind mode) | |
334 | |
0 | 335 menuview_exit: |
336 call TFT_standard_color | |
560 | 337 bcf win_invert ; Reset invert flag |
0 | 338 return ; Menupos2 = 0, Show nothing |
137 | 339 |
340 | |
341 menuview_view_gaschange: | |
342 extern gaslist_strcat_gas_mod | |
343 btfss better_gas_available ; =1: A better gas is available | |
344 bra menuview_toggle ; No, call next option | |
138
2852b0bd6391
minor: some extra protection against wrong gas selection
heinrichsweikamp
parents:
137
diff
changeset
|
345 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
|
346 bra menuview_toggle |
137 | 347 bsf short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint |
348 movff better_gas_number,PRODL ; number (1-5) of the "better gas" in divemode, =0: no better gas available | |
349 decf PRODL,F | |
350 call gaslist_strcat_gas_mod ; Append gas description of gas #PRODL (0-4) to current string | |
351 movlw .5 | |
352 movwf FSR2L ; Point to char 6 (5 chars gas description only) | |
353 STRCAT_PRINT "?" | |
354 bra menuview_exit ; Done. | |
0 | 355 menuview_view1: |
356 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
357 bra menuview_toggle ; Call next option | |
358 btfsc FLAG_gauge_mode ; In Gauge mode? | |
359 bra menuview_toggle ; Call next option | |
360 STRCPY_TEXT_PRINT tDivePreMenu ; "Menu?" | |
361 bra menuview_exit ; Done. | |
362 menuview_view2: | |
363 btfss simulatormode_active ; View only for simulator mode | |
364 bra menuview_toggle ; Call next option | |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
365 STRCPY_TEXT_PRINT tQuitSim ; "Quit Simulation?" |
0 | 366 bra menuview_exit ; Done. |
367 menuview_view3: | |
368 btfss simulatormode_active ; View only for simulator mode | |
369 bra menuview_toggle ; Call next option | |
560 | 370 STRCPY_PRINT "Sim-1m" ; CHANGED, now "-" for going down |
0 | 371 bra menuview_exit ; Done. |
372 menuview_view4: | |
373 btfss simulatormode_active ; View only for simulator mode | |
374 bra menuview_toggle ; Call next option | |
560 | 375 STRCPY_PRINT "Sim+1m" ; CHANGED, now "+" for going up |
0 | 376 bra menuview_exit ; Done. |
377 menuview_view5: | |
378 btfss FLAG_apnoe_mode ; In Apnoe mode? | |
379 bra menuview_toggle ; No, call next option | |
184
faa06c58e977
BUGFIX: Quit Apnea mode on the surface manually
heinrichsweikamp
parents:
148
diff
changeset
|
380 btfss FLAG_active_descent ; Are we descending? |
0 | 381 bra menuview_toggle ; Yes |
382 ; We are at the surface: | |
148 | 383 STRCPY_TEXT_PRINT tQuitSim ; "Quit Apnea mode?" |
0 | 384 bra menuview_exit ; Done. |
385 menuview_view6: | |
386 btfss FLAG_gauge_mode ; In Gauge mode? | |
387 bra menuview_toggle ; No, call next option | |
437 | 388 STRCPY_TEXT_PRINT tDivemenu_ResetAvg ; "Reset Avg." |
0 | 389 bra menuview_exit ; Done. |
216
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
390 menuview_view7: |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
391 btfss simulatormode_active ; View only for simulator mode |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
392 bra menuview_toggle ; Call next option |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
393 btfsc FLAG_gauge_mode ; In Gauge mode? |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
394 bra menuview_toggle ; Yes, call next option |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
395 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
396 bra menuview_toggle ; Yes, call next option |
560 | 397 STRCPY_PRINT "Sim+5'" |
216
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
398 bra menuview_exit ; Done. |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
399 menuview_view8: |
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
400 movlw .6 |
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
401 cpfseq menupos3 ; in compass view? |
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
402 bra menuview_toggle ; No, call next option |
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
403 STRCPY_TEXT_PRINT tSetHeading ; "Heading" |
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
404 bra menuview_exit ; Done. |
560 | 405 menuview_view9: |
406 STRCPY_PRINT "Layout" | |
407 bra menuview_exit ; Done. | |
0 | 408 |
409 | |
560 | 410 |
411 | |
0 | 412 ;============================================================================= |
560 | 413 |
414 customview_toggle_alternative: | |
415 movlw d'1' ; Max number of customviews in divemode, alternative layout | |
416 cpfsgt menupos3 ; Max reached? | |
417 bra customview_mask_alternative ; No, show | |
418 movlw .1 | |
419 movwf menupos3 ; Reset to one, always one customview visible in alternative layout | |
420 customview_mask_alternative: | |
421 ; Clear custom view area in divemode | |
422 WIN_BOX_BLACK dm_customview_row, .239, .0, .159 ; top, bottom, left, right | |
423 call TFT_standard_color | |
424 movff menupos3,WREG ; Menupos3 holds number of customview function | |
425 dcfsnz WREG,F | |
426 bra customview_alt_init_view1 ; View 1: Big deco/ndl and max. depth | |
427 dcfsnz WREG,F | |
428 bra customview_alt_init_view2 ; View 2: | |
429 | |
430 ;bra customview_alternative_toggle_exit ; No view (menupos3=0) | |
431 | |
432 customview_alt_toggle_exit: | |
433 call TFT_standard_color | |
434 bcf toggle_customview ; Clear flag | |
435 return | |
436 | |
437 customview_alt_init_view1: ; View 1: Big deco/ndl and max. depth | |
438 call TFT_max_depth_alternative | |
439 call TFT_big_deco_alt | |
440 bra customview_alt_toggle_exit | |
441 | |
442 customview_alt_init_view2: | |
443 ; /* Just for test... | |
444 call TFT_mask_avr_stopwatch ; Show mask for average depth and stopwatch | |
445 call TFT_update_avr_stopwatch ; Update average depth and stopwatch | |
446 ; ...Just for test */ | |
447 | |
448 bra customview_alt_toggle_exit | |
449 | |
450 | |
0 | 451 ; Show next customview (and delete this flag) |
560 | 452 global customview_toggle |
453 customview_toggle: | |
454 bcf switch_right | |
455 incf menupos3,F ; Number of customview to show | |
456 | |
457 btfsc alternative_divelayout ; In alternative layout mode? | |
458 bra customview_toggle_alternative ; Yes, use the big ones instead | |
459 | |
460 movlw d'13' ; Max number of customviews in divemode | |
461 cpfsgt menupos3 ; Max reached? | |
462 bra customview_mask ; No, show | |
463 clrf menupos3 ; Reset to zero (Zero=no custom view) | |
464 | |
39
e4e91fe8b09d
remember last customview in dive and surface mode
mh@mh-THINK.fritz.box
parents:
0
diff
changeset
|
465 global customview_mask |
0 | 466 customview_mask: |
353
573f2251cf49
NEW: Quit Simulator automatically when starting a real dive
heinrichsweikamp
parents:
337
diff
changeset
|
467 ; Clear custom view area in divemode |
560 | 468 WIN_BOX_BLACK dm_customview_row, dm_customview_bot-.2, 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
|
469 WIN_SMALL dm_customview_column,dm_customview_row |
0 | 470 call TFT_standard_color |
471 movff menupos3,WREG ; Menupos3 holds number of customview function | |
472 dcfsnz WREG,F | |
560 | 473 bra customview_init_view1 ; Update Sensor data |
0 | 474 dcfsnz WREG,F |
560 | 475 bra customview_init_view2 ; average depth and stopwatch |
0 | 476 dcfsnz WREG,F |
560 | 477 bra customview_init_view3 ; Decoplan |
0 | 478 dcfsnz WREG,F |
560 | 479 bra customview_init_view4 ; Battery info, Tissues and clock |
0 | 480 dcfsnz WREG,F |
481 bra customview_init_view5 ; GF informations | |
482 dcfsnz WREG,F | |
483 bra customview_init_view6 ; Compass | |
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
484 dcfsnz WREG,F |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
485 bra customview_init_view7 ; Dynamic gaslist |
105 | 486 dcfsnz WREG,F |
560 | 487 bra customview_init_view8 ; HIJACKED for CNS (ex HUD voltages) |
123 | 488 dcfsnz WREG,F |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
489 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
|
490 dcfsnz WREG,F |
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
491 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
|
492 dcfsnz WREG,F |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
493 bra customview_init_view11 ; ppO2, END/EAD and CNS |
482
c0ee33f1f399
New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents:
476
diff
changeset
|
494 dcfsnz WREG,F |
c0ee33f1f399
New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents:
476
diff
changeset
|
495 bra customview_init_view12 ; PSCR Info |
560 | 496 ; NEW ## bailout gas needs |
497 dcfsnz WREG,F | |
498 bra customview_init_view13 ; Gas needs | |
499 | |
0 | 500 customview_init_nocustomview: |
501 call I2C_sleep_accelerometer ; Stop accelerometer | |
502 call I2C_sleep_compass ; Stop compass | |
560 | 503 bra customview_toggle_exit |
0 | 504 |
505 customview_init_view1: | |
485 | 506 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
507 bra customview_toggle ; yes, Call next view... | |
508 btfsc FLAG_pscr_mode ; In PSCR mode? | |
560 | 509 bra customview_init_view1a ; Yes |
485 | 510 btfss FLAG_ccr_mode ; In CC mode? |
511 bra customview_toggle ; no, Call next view... | |
512 | |
513 customview_init_view1a: | |
249 | 514 movf hardware_flag,W |
515 sublw 0x11 ; 2 with BLE | |
516 btfsc STATUS,Z | |
517 bra customview_toggle ; no, Call next view... | |
476
7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
heinrichsweikamp
parents:
472
diff
changeset
|
518 movf hardware_flag,W |
7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
heinrichsweikamp
parents:
472
diff
changeset
|
519 sublw 0x13 ; + |
7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
heinrichsweikamp
parents:
472
diff
changeset
|
520 btfsc STATUS,Z |
7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
heinrichsweikamp
parents:
472
diff
changeset
|
521 bra customview_toggle ; no, Call next view... |
0 | 522 |
560 | 523 call TFT_hud_mask ; Setup HUD mask |
524 call TFT_update_ppo2_sensors ; Update Sensor data | |
485 | 525 bra customview_toggle_exit |
0 | 526 |
527 customview_init_view2: | |
528 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
529 bra customview_toggle ; Yes, Call next view... | |
560 | 530 call TFT_mask_avr_stopwatch ; Show mask for average depth and stopwatch |
531 call TFT_update_avr_stopwatch ; Update average depth and stopwatch | |
0 | 532 bra customview_toggle_exit |
533 | |
534 customview_init_view3: | |
535 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
536 bra customview_toggle ; Yes, Call next view... | |
537 btfsc FLAG_gauge_mode ; In Gauge mode? | |
538 bra customview_toggle ; Yes, Call next view... | |
539 call TFT_decoplan ; Show decoplan | |
540 bra customview_toggle_exit | |
541 | |
542 customview_init_view4: | |
560 | 543 call TFT_battinfo_tissues_clock_mask ; Setup Mask |
544 call TFT_battinfo_tissues_clock ; Show Battery info, Tissues and clock | |
0 | 545 bra customview_toggle_exit |
546 | |
547 customview_init_view5: | |
548 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
549 bra customview_toggle ; Yes, Call next view... | |
550 btfsc FLAG_gauge_mode ; In Gauge mode? | |
551 bra customview_toggle ; Yes, Call next view... | |
119 | 552 |
553 extern char_I_deco_model | |
554 TSTOSS char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF | |
555 bra customview_toggle ; No GF info for non-GF modes | |
556 | |
0 | 557 call TFT_gf_mask ; Setup Mask |
558 call TFT_gf_info ; Show GF informations | |
559 bra customview_toggle_exit | |
560 | |
561 customview_init_view6: ; Compass (View 6) | |
562 call I2C_init_accelerometer ; Start accelerometer | |
563 call I2C_init_compass ; Start compass | |
256
5b4ef0b9090d
place compass display code into compass_ops.asm
heinrichsweikamp
parents:
254
diff
changeset
|
564 extern TFT_dive_compass_mask |
0 | 565 call TFT_dive_compass_mask ; Show compass |
566 bra customview_toggle_exit | |
567 | |
560 | 568 ; MODIFIED - view disabled ## memory |
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
569 customview_init_view7: ; Dynamic gaslist (View 7) |
560 | 570 ; btfsc FLAG_apnoe_mode ; In Apnoe mode? |
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
571 bra customview_toggle ; Yes, Call next view... |
560 | 572 ; btfsc FLAG_ccr_mode ; In CC mode? |
573 ; bra customview_toggle ; Yes, Call next view... | |
574 ; call TFT_dyn_gaslist ; Show the dyn gaslist | |
575 ; bra customview_toggle_exit | |
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
576 |
560 | 577 customview_init_view8: ; HIJACKED for CNS outputs (ex Sensor millivolts) |
136 | 578 btfsc FLAG_gauge_mode ; In Gauge mode? |
579 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
|
580 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
581 bra customview_toggle ; yes, Call next view... |
560 | 582 ; REPLACE ## CNS at end-of-dive |
583 ; btfsc FLAG_pscr_mode ; In PSCR mode? | |
584 ; bra customview_init_view8a ; Yes | |
585 ; btfss FLAG_ccr_mode ; In CC mode? | |
586 ; bra customview_toggle ; no, Call next view... | |
587 ; customview_init_view8a: | |
588 ; movf hardware_flag,W | |
589 ; sublw 0x13 ; + | |
590 ; btfsc STATUS,Z | |
591 ; bra customview_toggle ; no, Call next view... | |
592 ; movff opt_ccr_mode,WREG ; =0: Fixed SP, =1: Sensor, =2: Auto SP | |
593 ; sublw .1 ; opt_ccr_mode = 1 (Sensor)? | |
594 ; bnz customview_toggle ; no, Call next view... | |
595 ; call TFT_hud_mask ; Setup HUD mask | |
596 ; call TFT_hud_voltages ; Show HUD details | |
597 ; BY | |
598 call TFT_CNS_mask | |
599 call TFT_CNS | |
476
7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
heinrichsweikamp
parents:
472
diff
changeset
|
600 |
560 | 601 goto customview_toggle_exit |
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
602 |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
603 customview_init_view9: ; ppO2, Ceiling and current GF |
123 | 604 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
560 | 605 bra customview_toggle ; yes, Call next view... |
123 | 606 btfsc FLAG_gauge_mode ; In Gauge mode? |
560 | 607 bra customview_toggle ; Yes, Call next view... |
123 | 608 call TFT_ceiling_mask ; Setup mask |
609 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
|
610 |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
611 ; ppO2 value |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
612 call TFT_mask_ppo2 |
560 | 613 call TFT_display_pure_ppo2 |
333
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
614 |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
615 ; current GF value |
525
00df86a5ac01
BUGFIX: Do not show GF in divemode for non-GF deco mode
heinrichsweikamp
parents:
517
diff
changeset
|
616 extern char_I_deco_model |
00df86a5ac01
BUGFIX: Do not show GF in divemode for non-GF deco mode
heinrichsweikamp
parents:
517
diff
changeset
|
617 TSTOSS char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF |
560 | 618 bra customview_toggle_exit ; No GF info for non-GF modes |
525
00df86a5ac01
BUGFIX: Do not show GF in divemode for non-GF deco mode
heinrichsweikamp
parents:
517
diff
changeset
|
619 ; current GF value |
333
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
620 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
|
621 call TFT_gf_info ; Show GF informations |
525
00df86a5ac01
BUGFIX: Do not show GF in divemode for non-GF deco mode
heinrichsweikamp
parents:
517
diff
changeset
|
622 bra customview_toggle_exit |
00df86a5ac01
BUGFIX: Do not show GF in divemode for non-GF deco mode
heinrichsweikamp
parents:
517
diff
changeset
|
623 |
413
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
624 customview_init_view10: ; Sensor check |
560 | 625 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
626 bra customview_toggle ; yes, Call next view... | |
627 btfsc FLAG_gauge_mode ; In Gauge mode? | |
628 bra customview_toggle ; Yes, Call next view... | |
629 btfss FLAG_ccr_mode ; In CC mode? | |
630 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
|
631 |
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
632 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
|
633 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
|
634 bra customview_toggle_exit |
123 | 635 |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
636 customview_init_view11: ; ppO2, END/EAD and CNS |
560 | 637 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
638 bra customview_toggle ; yes, Call next view... | |
639 btfsc FLAG_gauge_mode ; In Gauge mode? | |
640 bra customview_toggle ; Yes, Call next view... | |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
641 |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
642 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
|
643 call TFT_ppo2_ead_end_cns ; Show ppO2, END/EAD and CNS |
485 | 644 goto customview_toggle_exit |
482
c0ee33f1f399
New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents:
476
diff
changeset
|
645 |
560 | 646 customview_init_view12: ; PSCR Info |
647 btfss FLAG_pscr_mode ; In PSCR mode? | |
648 bra customview_toggle ; No, Call next view... | |
482
c0ee33f1f399
New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents:
476
diff
changeset
|
649 |
560 | 650 call TFT_pscr_info_mask ; Show ppO2, drop and lung ratio |
651 call TFT_pscr_info ; Show ppO2, drop and lung ratio | |
482
c0ee33f1f399
New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents:
476
diff
changeset
|
652 bra customview_toggle_exit |
560 | 653 |
654 ; NEW ## bailout gas needs | |
655 customview_init_view13: ; Gas Needs | |
656 TSTOSS opt_calc_asc_gasvolume ; check if gas volume calculations is switched on | |
657 bra customview_toggle ; NO - Call next view... | |
658 call TFT_gas_needs_mask ; YES - Show the mask for gas needs | |
659 call TFT_gas_needs ; Show the gas needs | |
660 bra customview_toggle_exit | |
661 | |
0 | 662 customview_toggle_exit: |
560 | 663 btfsc divemode ; In Dive Mode? |
664 bsf FLAG_TFT_temp_divemode ; Set flag to redraw temp | |
665 call TFT_standard_color | |
666 bcf toggle_customview ; Clear flag | |
667 return | |
0 | 668 |
669 global customview_show_change_depth | |
560 | 670 customview_show_change_depth: ; Put " lom" or " loft" into Postinc2 |
0 | 671 PUTC " " |
560 | 672 TSTOSS opt_units ; 0=m, 1=ft |
0 | 673 bra customview_show_mix_metric |
674 movf lo,W | |
560 | 675 mullw .100 ; convert meters to mbar |
0 | 676 movff PRODL,lo |
677 movff PRODH,hi | |
560 | 678 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet |
0 | 679 bsf leftbind |
560 | 680 output_16 ; Change depth in lo:hi |
0 | 681 bcf leftbind |
682 STRCAT_TEXT tFeets | |
683 return | |
684 customview_show_mix_metric: | |
560 | 685 output_99 ; Change depth in lo |
0 | 686 STRCAT_TEXT tMeters |
687 return | |
688 | |
689 | |
690 global customview_show_mix | |
560 | 691 customview_show_mix: ; Put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2 |
692 tstfsz hi ; He=0? | |
693 bra customview_show_mix5 ; No, Show a TX | |
0 | 694 movlw .21 |
695 cpfseq lo ; Air? | |
560 | 696 bra customview_show_mix2 ; No |
0 | 697 STRCAT_TEXT tSelectAir ; Yes, show "Air" |
698 bra customview_show_mix4b | |
699 customview_show_mix2: | |
700 movlw .100 | |
701 cpfseq lo ; O2? | |
560 | 702 bra customview_show_mix3 ; No |
0 | 703 STRCAT_TEXT tSelectO2 ; Yes, show "O2" |
704 bra customview_show_mix4b | |
705 | |
706 customview_show_mix3: | |
707 movlw .21 | |
708 cpfslt lo ; < Nx21? | |
560 | 709 bra customview_show_mix4 ; No |
710 STRCAT_TEXT tGasErr ; Yes, show "Err" | |
711 output_99 ; O2 ratio is still in "lo" | |
0 | 712 bra customview_show_mix4c |
713 | |
714 customview_show_mix4: | |
560 | 715 STRCAT_TEXT tSelectNx ; Show "Nx" |
716 output_99 ; O2 ratio is still in "lo" | |
0 | 717 customview_show_mix4b: |
718 STRCAT " " | |
719 customview_show_mix4c: | |
560 | 720 btfsc divemode ; In divemode |
721 return ; Yes | |
0 | 722 STRCAT " " |
723 return | |
724 | |
725 customview_show_mix5: | |
726 btfsc divemode | |
727 bra customview_show_mix6 | |
560 | 728 STRCAT_TEXT tSelectTx ; Show "Tx" |
0 | 729 customview_show_mix6: |
560 | 730 output_99 ; O2 ratio is still in "lo" |
0 | 731 PUTC "/" |
732 movff hi,lo | |
560 | 733 output_99 ; He ratio |
0 | 734 return |
735 | |
736 END |