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