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