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