Mercurial > public > hwos_code
comparison src/customview.asm @ 634:4050675965ea
3.10 stable release
author | heinrichsweikamp |
---|---|
date | Tue, 28 Apr 2020 17:34:31 +0200 |
parents | 185ba2f91f59 |
children | 75e90cd0c2c3 |
comparison
equal
deleted
inserted
replaced
633:690c48db7b5b | 634:4050675965ea |
---|---|
1 ;============================================================================= | 1 ;============================================================================= |
2 ; | 2 ; |
3 ; File customview.asm combined next generation V3.08.8 | 3 ; File customview.asm * combined next generation V3.09.5 |
4 ; | 4 ; |
5 ; Custom Views in Surface and Dive Mode | 5 ; Custom Views in Surface and Dive Mode |
6 ; | 6 ; |
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | 7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. |
8 ;============================================================================= | 8 ;============================================================================= |
19 #include "surfmode.inc" | 19 #include "surfmode.inc" |
20 #include "convert.inc" | 20 #include "convert.inc" |
21 #include "divemode.inc" | 21 #include "divemode.inc" |
22 #include "i2c.inc" | 22 #include "i2c.inc" |
23 #include "start.inc" | 23 #include "start.inc" |
24 | 24 #include "colorschemes.inc" |
25 | 25 |
26 extern gaslist_strcat_gas_cd | 26 |
27 extern gaslist_strcat_gas_PRODL | |
27 extern char_I_model | 28 extern char_I_model |
28 | 29 |
29 IFDEF _compass | 30 IFDEF _compass |
30 extern TFT_surface_compass_mask | 31 extern TFT_surface_compass_mask |
31 extern TFT_dive_compass_mask | 32 extern TFT_dive_compass_mask |
32 ENDIF | 33 ENDIF |
33 | 34 |
34 #DEFINE num_premenu_items .11 ; overall number of pre-menu items | 35 |
35 | 36 #DEFINE num_premenu_items .12 ; overall number of pre-menu items |
36 custview CODE | 37 #DEFINE num_surface_cv .10 ; overall number of surface custom views |
38 | |
39 | |
40 ;============================================================================= | |
41 custview1 CODE | |
42 ;============================================================================= | |
37 | 43 |
38 ;----------------------------------------------------------------------------- | 44 ;----------------------------------------------------------------------------- |
39 | 45 ; Jump Table for the every-second Tasks for the Custom View Area (Dive Mode) |
40 | |
41 ;============================================================================= | |
42 ; Jump table for the every-second tasks for the custom view area (dive mode) | |
43 ; | 46 ; |
44 ; Attention: the ordering must be in line with the init jump table and the | 47 ; Attention: the ordering must be in line with the init jump table and the |
45 ; index numbers defined in hwos.inc! | 48 ; index numbers defined in hwos.inc! |
46 | 49 ; |
47 global dive_customview_second | 50 global dive_customview_second |
48 dive_customview_second: | 51 dive_customview_second: |
49 movf active_customview,W ; get current view | 52 movf active_customview,W ; get current view |
50 dcfsnz WREG,F ; | 53 dcfsnz WREG,F ; |
51 goto TFT_avr_stopwatch ; 1: average depth and stopwatch | 54 goto TFT_avr_stopwatch ; 1: average depth and stopwatch |
105 ELSE | 108 ELSE |
106 return ; 15: not available without cave mode functions | 109 return ; 15: not available without cave mode functions |
107 ENDIF | 110 ENDIF |
108 return ; 0: do nothing | 111 return ; 0: do nothing |
109 | 112 |
113 | |
114 ;============================================================================= | |
115 custview2 CODE | |
116 ;============================================================================= | |
117 | |
118 | |
110 ;----------------------------------------------------------------------------- | 119 ;----------------------------------------------------------------------------- |
111 | 120 ; Show next Surface Custom View |
121 ; | |
112 global surf_customview_toggle | 122 global surf_customview_toggle |
113 surf_customview_toggle: | 123 surf_customview_toggle: |
114 bcf switch_right ; clear button event | 124 bcf switch_right ; clear button event |
115 incf active_customview,F ; number of custom view to show | 125 incf active_customview,F ; set number of the next custom view to show |
116 | 126 |
117 IFDEF _compass | 127 IFDEF _compass |
118 movlw .6 ; index of surface custom view compass | 128 movlw .6 ; load index of surface custom view compass |
119 cpfseq active_customview ; will compass be shown in custom view? | 129 cpfseq active_customview ; will the compass be shown in custom view? |
120 call I2C_sleep_compass ; NO - stop compass | 130 call I2C_sleep_compass ; NO - can stop the compass to save on energy |
121 ENDIF | 131 ENDIF |
122 | 132 |
123 movlw d'10' ; max number of custom views in surface mode | 133 movlw num_surface_cv ; load number of custom views available |
124 cpfsgt active_customview ; max reached? | 134 cpfsgt active_customview ; beyond last view? |
125 bra surf_customview_mask ; NO - show | 135 bra surf_customview_mask ; NO - show view |
126 movlw .1 ; YES - wrap around to 1st view | 136 movlw .1 ; YES - wrap around to 1st view |
127 movwf active_customview ; - ... | 137 movwf active_customview ; - ... |
128 ;bra surf_customview_mask ; - show | 138 ;bra surf_customview_mask ; - show view |
129 | 139 |
130 | 140 |
141 ;----------------------------------------------------------------------------- | |
142 ; Show Surface Custom View | |
143 ; | |
131 global surf_customview_mask | 144 global surf_customview_mask |
132 surf_customview_mask: | 145 surf_customview_mask: |
146 | |
147 ; prepare output of custom view title | |
133 WIN_BOX_BLACK .50,surf_warning1_row-1, .0, surf_decotype_column-.1 ; top, bottom, left, right | 148 WIN_BOX_BLACK .50,surf_warning1_row-1, .0, surf_decotype_column-.1 ; top, bottom, left, right |
134 WIN_TINY surf_customview_title_column,surf_customview_title_row ; set title position | 149 WIN_TINY surf_customview_title_column,surf_customview_title_row ; set title position |
135 WIN_COLOR color_greenish ; set title color | 150 FONT_COLOR color_greenish ; set title color |
136 | 151 |
152 ; jump table | |
137 movf active_customview,W ; get custom view to show | 153 movf active_customview,W ; get custom view to show |
138 movff WREG,customview_surfmode ; save number for later recall | 154 movff WREG,customview_surfmode ; save number for later recall |
139 dcfsnz WREG,F ; 1: | 155 dcfsnz WREG,F ; 1: |
140 bra surf_customview_init_view1 ; OC gas list | 156 bra surf_customview_init_view1 ; OC gas list |
141 dcfsnz WREG,F ; 2: | 157 dcfsnz WREG,F ; 2: |
154 bra surf_customview_init_view8 ; last dive info | 170 bra surf_customview_init_view8 ; last dive info |
155 dcfsnz WREG,F ; 9: | 171 dcfsnz WREG,F ; 9: |
156 bra surf_customview_init_view9 ; sensor mV readings | 172 bra surf_customview_init_view9 ; sensor mV readings |
157 dcfsnz WREG,F ; 10: | 173 dcfsnz WREG,F ; 10: |
158 bra surf_customview_init_view10 ; tank data | 174 bra surf_customview_init_view10 ; tank data |
159 bra surf_customview_init_view4 ; default view after restart and loading of new firmware | 175 bra surf_customview_init_view4 ; 0: default view after restart and loading of new firmware |
160 | 176 |
161 | 177 surf_cv_toggle_exit: |
162 surf_customview_init_view1: ; view 1: OC Gas list | 178 bcf request_next_custview ; clear request flag |
179 return ; done | |
180 | |
181 ; ---- view 1: OC Gas list ---- | |
182 ; | |
183 surf_customview_init_view1: | |
163 btfsc FLAG_gauge_mode ; in gauge mode? | 184 btfsc FLAG_gauge_mode ; in gauge mode? |
164 bra surf_customview_toggle ; YES - not available in gauge mode, goto next view | 185 bra surf_customview_toggle ; YES - not available in gauge mode, goto next view |
165 btfsc FLAG_apnoe_mode ; in apnoe mode? | 186 btfsc FLAG_apnoe_mode ; in apnoe mode? |
166 bra surf_customview_toggle ; YES - not available in apnoe mode, goto next view | 187 bra surf_customview_toggle ; YES - not available in apnoe mode, goto next view |
167 IFDEF _ccr_pscr | 188 IFDEF _ccr_pscr |
173 bra surf_customview_init_view1b ; - continue with common part | 194 bra surf_customview_init_view1b ; - continue with common part |
174 surf_customview_init_view1a: | 195 surf_customview_init_view1a: |
175 STRCPY_TEXT_PRINT tDiveBailout ; (1) - title of custom view / CCR & pSCR mode | 196 STRCPY_TEXT_PRINT tDiveBailout ; (1) - title of custom view / CCR & pSCR mode |
176 ENDIF | 197 ENDIF |
177 surf_customview_init_view1b: | 198 surf_customview_init_view1b: |
178 call TFT_standard_color ; set color | 199 call TFT_surf_cv_list_gas ; show gas list |
179 call TFT_gaslist_surfmode ; show gas list | 200 bra surf_cv_toggle_exit ; done |
180 bra customview_toggle_exit ; done | 201 |
181 | 202 |
182 | 203 ; ---- view 2: CCR / pSCR diluent list ---- |
183 surf_customview_init_view2: ; view 2: CCR / pSCR diluent list | 204 ; |
205 surf_customview_init_view2: | |
184 IFDEF _ccr_pscr | 206 IFDEF _ccr_pscr |
185 btfsc FLAG_ccr_mode ; in CCR mode? | 207 btfsc FLAG_ccr_mode ; in CCR mode? |
186 bra surf_customview_init_view2a ; YES - (1) | 208 bra surf_customview_init_view2a ; YES - (1) |
187 btfsc FLAG_pscr_mode ; in pSCR mode? | 209 btfsc FLAG_pscr_mode ; in pSCR mode? |
188 bra surf_customview_init_view2a ; YES - (1) | 210 bra surf_customview_init_view2a ; YES - (1) |
189 bra surf_customview_toggle ; NO - not available if not in CCR or pSCR mode, goto next view | 211 bra surf_customview_toggle ; NO - not available if not in CCR or pSCR mode, goto next view |
190 surf_customview_init_view2a: | 212 surf_customview_init_view2a: |
191 STRCPY_TEXT_PRINT tGaslistCC ; (1) - title of custom view | 213 STRCPY_TEXT_PRINT tGaslistCC ; (1) - title of custom view |
192 call TFT_standard_color ; - set color | 214 call TFT_surf_cv_list_dil ; - show diluent list |
193 call TFT_dillist_surfmode ; - show diluent list | 215 bra surf_cv_toggle_exit ; - done |
194 bra customview_toggle_exit ; - done | |
195 ELSE | 216 ELSE |
196 bra surf_customview_toggle ; not available without CCR/pSCR mode compiled in, goto next view | 217 bra surf_customview_toggle ; not available without CCR/pSCR mode compiled in, goto next view |
197 ENDIF | 218 ENDIF |
198 | 219 |
199 | 220 |
200 surf_customview_init_view3: ; view 3: CC SP list | 221 ; ---- view 3: CC SP list ---- |
222 ; | |
223 surf_customview_init_view3: | |
201 IFDEF _ccr_pscr | 224 IFDEF _ccr_pscr |
202 btfss FLAG_ccr_mode ; in CCR mode? | 225 btfss FLAG_ccr_mode ; in CCR mode? |
203 bra surf_customview_toggle ; NO - not available if not in CCR mode, goto next view | 226 bra surf_customview_toggle ; NO - not available if not in CCR mode, goto next view |
204 STRCPY_TEXT_PRINT tFixedSetpoints ; YES - title of custom view | 227 STRCPY_TEXT_PRINT tFixedSetpoints ; YES - title of custom view |
205 call TFT_standard_color ; - set color | 228 call TFT_surf_cv_list_sp ; - show setpoint list |
206 call TFT_splist_surfmode ; - show setpoint list | 229 bra surf_cv_toggle_exit ; - done |
207 bra customview_toggle_exit ; - done | |
208 ELSE | 230 ELSE |
209 bra surf_customview_toggle ; not available without CCR/pSCR mode compiled in, goto next view | 231 bra surf_customview_toggle ; not available without CCR/pSCR mode compiled in, goto next view |
210 ENDIF | 232 ENDIF |
211 | 233 |
212 | 234 |
213 surf_customview_init_view9: ; view 9: sensor mV at the surface | 235 ; ---- view 4: custom text |
214 IFDEF _external_sensor | 236 ; |
215 btfsc FLAG_ccr_mode ; in CCR mode? | 237 surf_customview_init_view4: |
216 bra surf_customview_init_view9a ; YES - (1) | 238 call TFT_surf_cv_text ; show the custom text |
217 btfsc FLAG_pscr_mode ; in pSCR mode? | 239 bra surf_cv_toggle_exit ; done |
218 bra surf_customview_init_view9a ; YES - (1) | 240 |
219 bra surf_customview_toggle ; NO - not available if not in CCR or pSCR mode, goto next view | 241 |
220 surf_customview_init_view9a: | 242 ; ---- view 5: tissue diagram |
221 movff opt_ccr_mode,WREG ; (1) - get SP mode (0: fixed SP, 1: Sensor, 2: auto SP) | 243 ; |
222 sublw .1 ; - opt_ccr_mode = 1 (sensor)? | 244 surf_customview_init_view5: |
223 bnz surf_customview_toggle ; NO - goto next view | |
224 STRCPY_TEXT_PRINT tSensorMilliVolt ; YES - title of custom view | |
225 call TFT_standard_color ; - set color | |
226 call TFT_sensor_mV ; - write sensor mV readings to screen | |
227 bra customview_toggle_exit ; - done | |
228 ELSE | |
229 bra surf_customview_toggle ; not available without CCR/pSCR mode compiled in, goto next view | |
230 ENDIF | |
231 | |
232 | |
233 surf_customview_init_view4: ; view 4: custom text | |
234 call TFT_standard_color ; set color | |
235 call TFT_custom_text ; show the custom text | |
236 bra customview_toggle_exit ; done | |
237 | |
238 | |
239 surf_customview_init_view5: ; view 5: tissue diagram | |
240 btfsc FLAG_gauge_mode ; in gauge mode? | 245 btfsc FLAG_gauge_mode ; in gauge mode? |
241 bra surf_customview_toggle ; YES - not available in gauge mode, goto next view | 246 bra surf_customview_toggle ; YES - not available in gauge mode, goto next view |
242 btfsc FLAG_apnoe_mode ; in apnoe mode? | 247 btfsc FLAG_apnoe_mode ; in apnoe mode? |
243 bra surf_customview_toggle ; YES - not available in apnoe mode, goto next view | 248 bra surf_customview_toggle ; YES - not available in apnoe mode, goto next view |
244 call TFT_standard_color ; set color | 249 call TFT_surf_cv_tissues ; show tissue diagram |
245 call TFT_surface_tissues ; show tissue diagram | 250 bra surf_cv_toggle_exit ; done |
246 bra customview_toggle_exit ; done | 251 |
247 | 252 |
248 | 253 ; ---- view 6: compass |
249 surf_customview_init_view6: ; view 6: compass | 254 ; |
255 surf_customview_init_view6: | |
250 IFDEF _compass | 256 IFDEF _compass |
251 call I2C_init_compass ; start compass | 257 call I2C_init_compass ; start compass |
252 call TFT_surface_compass_mask ; show compass mask | 258 call TFT_surface_compass_mask ; show compass mask |
253 bra customview_toggle_exit ; done | 259 bra surf_cv_toggle_exit ; done |
254 ELSE | 260 ELSE |
255 bra surf_customview_toggle ; not available without compass compiled in, goto next view | 261 bra surf_customview_toggle ; not available without compass compiled in, goto next view |
256 ENDIF | 262 ENDIF |
257 | 263 |
258 | 264 |
259 surf_customview_init_view7: ; view 7: deco settings | 265 ; ---- view 7: deco settings ---- |
266 ; | |
267 surf_customview_init_view7: | |
260 btfsc FLAG_gauge_mode ; in gauge mode? | 268 btfsc FLAG_gauge_mode ; in gauge mode? |
261 bra surf_customview_toggle ; YES - not available in gauge mode, goto next view | 269 bra surf_customview_toggle ; YES - not available in gauge mode, goto next view |
262 btfsc FLAG_apnoe_mode ; in apnoe mode? | 270 btfsc FLAG_apnoe_mode ; in apnoe mode? |
263 bra surf_customview_toggle ; YES - not available in apnoe mode, goto next view | 271 bra surf_customview_toggle ; YES - not available in apnoe mode, goto next view |
264 call TFT_surface_decosettings ; show all deco settings | 272 call TFT_surf_cv_settings ; show all deco settings |
265 bra customview_toggle_exit ; done | 273 bra surf_cv_toggle_exit ; done |
266 | 274 |
267 | 275 |
268 surf_customview_init_view8: ; view 8: last dive info | 276 ; ---- view 8: last dive info ---- |
269 call TFT_standard_color ; set color | 277 ; |
270 call TFT_surface_lastdive ; show last dive info | 278 surf_customview_init_view8: |
271 bra customview_toggle_exit ; done | 279 call TFT_surf_cv_lastdive ; show last dive info |
272 | 280 bra surf_cv_toggle_exit ; done |
273 | 281 |
274 surf_customview_init_view10: ; view 10: transmitter data / debug | 282 |
283 ; ---- view 9: sensor mV at the surface ---- | |
284 ; | |
285 surf_customview_init_view9: | |
286 IFDEF _external_sensor | |
287 btfsc FLAG_ccr_mode ; in CCR mode? | |
288 bra surf_customview_init_view9a ; YES - show view | |
289 btfsc FLAG_pscr_mode ; NO - in pSCR mode? | |
290 bra surf_customview_init_view9a ; YES - show view | |
291 bra surf_customview_toggle ; NO - not available if not in CCR or pSCR mode, goto next view | |
292 | |
293 surf_customview_init_view9a: | |
294 movff opt_ccr_mode,WREG ; get SP mode (0: fixed SP, 1: Sensor, 2: auto SP) | |
295 decfsz WREG,W ; opt_ccr_mode = 1 (sensor)? | |
296 bra surf_customview_toggle ; NO - goto next view | |
297 STRCPY_TEXT_PRINT tSensorMilliVolt ; YES - title of custom view | |
298 call TFT_imprint_surf_mV ; - write sensor mV readings to screen | |
299 bra surf_cv_toggle_exit ; - done | |
300 ELSE | |
301 bra surf_customview_toggle ; not available without CCR/pSCR mode compiled in, goto next view | |
302 ENDIF | |
303 | |
304 | |
305 ; ---- view 10: transmitter data / debug ---- | |
306 ; | |
307 surf_customview_init_view10: | |
275 IFDEF _rx_functions | 308 IFDEF _rx_functions |
276 btfss tr_functions_activated ; TR functions activated? | 309 btfss tr_functions_activated ; TR functions activated? |
277 bra surf_customview_toggle ; NO - show next view in list | 310 bra surf_customview_toggle ; NO - show next view in list |
278 STRCAT_PRINT "ID bar Volt" ; YES - title of custom view (none language-dependent) | 311 STRCAT_PRINT "ID bar Volt" ; YES - title of custom view (none language-dependent) |
279 call TFT_surface_tankdata ; - show received data | 312 call TFT_surf_cv_tankdata ; - show received data |
280 bra customview_toggle_exit ; - done | 313 bra surf_cv_toggle_exit ; - done |
281 ELSE | 314 ELSE |
282 bra surf_customview_toggle ; not available without RX functions compiled in, goto next view | 315 bra surf_customview_toggle ; not available without RX functions compiled in, goto next view |
283 ENDIF | 316 ENDIF |
284 | 317 |
318 | |
319 ;============================================================================= | |
320 custview3 CODE | |
321 ;============================================================================= | |
322 | |
323 | |
285 ;----------------------------------------------------------------------------- | 324 ;----------------------------------------------------------------------------- |
286 | 325 ; Show next Pre-Menu Item / Clear the Pre-Menu |
326 ; | |
287 global menuview_toggle | 327 global menuview_toggle |
288 global menuview_toggle_reset | 328 menuview_toggle: |
289 menuview_toggle: ; show main menu or the pre-menu | |
290 bcf switch_left ; clear button event | 329 bcf switch_left ; clear button event |
291 movlw divemode_timeout_premenu ; get timeout for dive mode pre-menu | 330 movlw divemode_timeout_premenu ; get timeout for dive mode pre-menu |
292 call reset_timeout_time ; reset timeout | 331 call restart_timeout_time ; restart the timeout |
293 bsf dive_options_menu ; flag that the dive options menu is shown | 332 bsf dive_pre_menu ; flag that the pre-menu is shown |
294 incf active_premenu,F ; increment pre-menu item number | 333 menuview_next_item: |
295 movlw num_premenu_items ; get count of pre-menu items | 334 incf active_premenu,F ; increment pre-menu item number |
296 cpfsgt active_premenu ; max reached? | 335 movlw num_premenu_items ; get number of pre-menu items |
336 cpfsgt active_premenu ; beyond last item? | |
297 bra menuview_mask ; NO - show item | 337 bra menuview_mask ; NO - show item |
298 ;bra menuview_toggle_reset ; YES - reset selector | 338 ;bra menuview_toggle_reset ; YES - reset to first item |
299 menuview_toggle_reset: ; timeout occurred, beyond max number of options, or item executed | 339 |
300 clrf active_premenu ; reset pre-menu selector | 340 global menuview_toggle_reset |
301 bcf dive_options_menu ; the dive options menu is not shown anymore | 341 menuview_toggle_reset: |
342 clrf active_premenu ; reset pre-menu item number | |
343 bcf dive_pre_menu ; flag that the pre-menu is not shown anymore | |
344 ;bra menuview_mask ; clear last item from display | |
345 | |
302 menuview_mask: | 346 menuview_mask: |
303 WIN_BOX_BLACK dm_premenu_row, dm_premenu_bot, dm_premenu_col, dm_premenu_rgt ; top, bottom, left, right | 347 WIN_BOX_BLACK dm_premenu_row, dm_premenu_bot, dm_premenu_col, dm_premenu_rgt ; top, bottom, left, right |
304 tstfsz active_premenu ; any pre-menu selected? | 348 btfsc dive_pre_menu ; shall show pre-menu? |
305 bra menuview_items ; YES - display menu item | 349 bra menuview_show_item ; YES - show menu item |
306 bcf win_invert ; NO - end inverse printing | 350 ;bra menuview_exit ; NO - done with pre-menu |
307 btfss FLAG_apnoe_mode ; - in apnoe mode? | 351 |
308 goto TFT_show_temp_divemode ; YES - restore temperature and done | 352 menuview_exit: |
309 goto TFT_standard_color ; NO - done | 353 bcf win_invert ; clear inverse printing |
310 | 354 btfss dive_pre_menu ; showing pre-menu? |
311 menuview_items: | 355 goto TFT_show_temp_divemode ; NO - restore temperature display and return |
312 call TFT_attention_color ; set color | 356 return ; YES - done |
357 | |
358 menuview_show_item: | |
359 WIN_SMALL dm_premenu_col,dm_premenu_row | |
360 FONT_COLOR_ATTENTION ; set color | |
313 bsf win_invert ; set inverse printing | 361 bsf win_invert ; set inverse printing |
314 WIN_SMALL dm_premenu_col,dm_premenu_row | |
315 movf active_premenu,W ; get active pre-menu item | 362 movf active_premenu,W ; get active pre-menu item |
316 dcfsnz WREG,F | 363 dcfsnz WREG,F |
317 bra menuview_view_gaschange ; 1: gas change (skipped if no better gas/dil cued) | 364 bra menuview_view_gaschange ; 1: gas change (skipped if no better gas/dil cued) |
318 dcfsnz WREG,F | 365 dcfsnz WREG,F |
319 bra menuview_view_divemenu ; 2: "Menu?" (skipped in gauge and apnoe modes) | 366 bra menuview_view_ackn ; 2: "Ackn?" (skipped if no active advice/attention/warning sign) |
367 dcfsnz WREG,F | |
368 bra menuview_view_divemenu ; 3: "Menu?" (skipped in gauge and apnoe modes) | |
320 dcfsnz WREG,F | 369 dcfsnz WREG,F |
321 IFDEF _cave_mode | 370 IFDEF _cave_mode |
322 bra menuview_view_cavemenu ; 3: "Cave?" (skipped if not in cave mode) | 371 bra menuview_view_cavemenu ; 4: "Cave?" (skipped if not in cave mode) |
323 ELSE | 372 ELSE |
324 bra menuview_toggle ; 3: cave mode not implemented, go to next menu item | 373 bra menuview_next_item ; 4: cave mode not implemented, goto next item |
325 ENDIF | 374 ENDIF |
326 dcfsnz WREG,F | 375 dcfsnz WREG,F |
327 bra menuview_view_sim_quit ; 4: "Quit?" (in simulation mode only) | 376 bra menuview_view_sim_quit ; 5: "Quit?" (in simulation mode only) |
328 dcfsnz WREG,F | 377 dcfsnz WREG,F |
329 bra menuview_view_sim_down ; 5: "Sim down" (in simulation mode only) | 378 bra menuview_view_sim_down ; 6: "Sim down" (in simulation mode only) |
330 dcfsnz WREG,F | 379 dcfsnz WREG,F |
331 bra menuview_view_sim_up ; 6: "Sim up" (in simulation mode only) | 380 bra menuview_view_sim_up ; 7: "Sim up" (in simulation mode only) |
332 dcfsnz WREG,F | 381 dcfsnz WREG,F |
333 bra menuview_view_sim_time ; 7: "Sim+5'" (in simulation mode only) | 382 bra menuview_view_sim_time ; 8: "Sim+5'" (in simulation mode only) |
334 dcfsnz WREG,F | 383 dcfsnz WREG,F |
335 bra menuview_view_apnoe_quit ; 8: "Quit?" (in apnoe mode only) | 384 bra menuview_view_apnoe_quit ; 9: "Quit?" (in apnoe mode only) |
336 dcfsnz WREG,F | 385 dcfsnz WREG,F |
337 bra menuview_view_gauge_reset ; 9: "Reset Avr" (in gauge mode only) | 386 bra menuview_view_gauge_reset ; 10: "Reset Avr" (in gauge mode only) |
338 dcfsnz WREG,F | 387 dcfsnz WREG,F |
339 bra menuview_view_course ; 10: "Course" (only when compass is shown) | 388 IFDEF _compass |
340 dcfsnz WREG,F | 389 bra menuview_view_course ; 11: "Course" (only when compass is shown) |
341 bra menuview_view_layout ; 11: "Layout" (offer alternative layout, aka blind mode) | 390 ELSE |
342 | 391 bra menuview_next_item ; 11: compass not implemented, goto next item |
343 ; when adding or removing pre-menu items, adjust the value num_premenu_items in the #DEFINE ! | 392 ENDIF |
344 | 393 dcfsnz WREG,F |
345 menuview_exit: | 394 bra menuview_view_layout ; 12: "Layout" (offer alternative layout, aka blind mode) |
346 call TFT_standard_color | 395 bra menuview_exit ; catch illegal item number |
347 bcf win_invert ; reset invert flag | 396 ; when adding or removing items, adjust the value num_premenu_items in the #DEFINE ! |
348 return ; active pre-menu = 0, i.e. show nothing | 397 |
349 | 398 |
350 | 399 ; --- item 1: gas change advice --- |
400 ; | |
351 menuview_view_gaschange: | 401 menuview_view_gaschange: |
352 btfsc request_gas_change ; last gas change request executed yet? | 402 btfsc request_gas_change ; last gas change request already executed? |
353 bra menuview_toggle ; YES - call next option | 403 bra menuview_next_item ; YES - goto next option |
354 IFDEF _ccr_pscr | 404 IFDEF _ccr_pscr |
355 btfsc FLAG_oc_mode ; in OC mode? | 405 btfsc FLAG_oc_mode ; in OC mode? |
356 bra menuview_view_gaschange_OC ; YES | 406 bra menuview_view_gaschange_OC ; YES |
357 btfsc bailout_mode ; in bailout? | 407 btfsc bailout_mode ; in bailout? |
358 bra menuview_view_gaschange_OC ; YES | 408 bra menuview_view_gaschange_OC ; YES |
359 menuview_view_gaschange_DIL: | 409 menuview_view_gaschange_DIL: |
360 btfss better_dil_available ; is the better diluent still available? | 410 btfss better_dil_available ; is the better diluent still available? |
361 bra menuview_toggle ; NO - call next option | 411 bra menuview_next_item ; NO - goto next item |
362 movff best_dil_number,PRODL ; number (1-5) of the "best diluent" | 412 movff best_dil_number,PRODL ; number (1-5) of the "best diluent" |
363 bsf is_diluent_menu ; setting up diluents | 413 bsf is_diluent_menu ; setting up diluents |
364 bra menuview_view_gaschange_com | 414 bra menuview_view_gaschange_com ; continue with common part |
365 ENDIF | 415 ENDIF ; _ccr_pscr |
366 menuview_view_gaschange_OC: | 416 menuview_view_gaschange_OC: |
367 btfss better_gas_available ; is the better gas still available? | 417 btfss better_gas_available ; is the better gas still available? |
368 bra menuview_toggle ; NO - call next option | 418 bra menuview_next_item ; NO - goto next item |
369 movff best_gas_number,PRODL ; number (1-5) of the "best gas" | 419 movff best_gas_number,PRODL ; YES - number (1-5) of the "best gas" |
370 bcf is_diluent_menu ; setting up OC gases | 420 bcf is_diluent_menu ; - setting up OC gases |
371 menuview_view_gaschange_com: | 421 menuview_view_gaschange_com: |
372 decf PRODL,F ; (1-5) -> (0-4) | 422 decf PRODL,F ; (1-5) -> (0-4) |
373 bsf short_gas_descriptions ; use short version of gaslist_strcat_gas_cd and gaslist_strcat_setpoint | 423 bsf short_gas_descriptions ; use short version of gaslist_strcat_gas_PRODL and gaslist_strcat_setpoint |
374 bsf better_gas_hint ; color-code as best gas/diluent | 424 bsf better_gas_hint ; color-code as best gas/diluent |
375 call gaslist_strcat_gas_cd ; append gas description of gas #PRODL (0-4) to current string | 425 call gaslist_strcat_gas_PRODL ; append gas description of gas #PRODL (0-4) to current string |
376 movlw .5 ; point to 6th character (5 chars are used for the gas/dil description) | 426 movlw .5 ; point to 6th character (5 chars are used for the gas/dil description) |
377 movwf FSR2L ; ... | 427 movwf FSR2L ; ... |
378 STRCAT_PRINT "?" ; print question mark | 428 PUTC_PRINT "?" ; append question and dump buffer to screen |
379 bra menuview_exit ; done | 429 bra menuview_exit ; done |
380 | 430 |
431 ; ---- item 2: acknowledge ---- | |
432 ; | |
433 menuview_view_ackn: | |
434 btfss sign_shown ; advice, attention or warning sign shown? | |
435 bra menuview_next_item ; NO - goto next item | |
436 STRCAT_TEXT_PRINT tDiveAckn ; YES - print "Ackn?" | |
437 bra menuview_exit ; - done | |
438 | |
439 | |
440 ; ---- item 3: dive menu ---- | |
441 ; | |
381 menuview_view_divemenu: | 442 menuview_view_divemenu: |
382 btfsc FLAG_apnoe_mode ; in apnoe mode? | 443 btfsc FLAG_apnoe_mode ; in apnoe mode? |
383 bra menuview_toggle ; YES - goto next option | 444 bra menuview_next_item ; YES - goto next item |
384 btfsc FLAG_gauge_mode ; NO - in gauge mode? | 445 btfsc FLAG_gauge_mode ; NO - in gauge mode? |
385 bra menuview_toggle ; YES - goto next option | 446 bra menuview_next_item ; YES - goto next item |
386 PUTC "\xb7" ; NO - print '->' symbol | 447 PUTC "\xb7" ; NO - print '->' symbol |
387 STRCAT_TEXT_PRINT tDivePreMenu ; - print "Menu?" | 448 STRCAT_TEXT_PRINT tDivePreMenu ; - print "Menu?" |
388 bra menuview_exit ; - done | 449 bra menuview_exit ; - done |
389 | 450 |
451 | |
452 ; ---- item 4: cave menu ---- | |
453 ; | |
390 IFDEF _cave_mode | 454 IFDEF _cave_mode |
391 menuview_view_cavemenu: | 455 menuview_view_cavemenu: |
392 TSTOSS opt_cave_mode ; cave mode switched on? | 456 TSTOSS opt_cave_mode ; cave mode switched on? |
393 bra menuview_toggle ; NO - goto next option | 457 bra menuview_next_item ; NO - goto next item |
394 PUTC "\xb7" ; YES - print '->' symbol | 458 PUTC "\xb7" ; YES - print '->' symbol |
395 STRCAT_TEXT_PRINT tDivePreCave ; - print "Cave?" | 459 STRCAT_TEXT_PRINT tDivePreCave ; - print "Cave?" |
396 bra menuview_exit ; - done | 460 bra menuview_exit ; - done |
397 ENDIF | 461 ENDIF ; _cave_mode |
398 | 462 |
463 | |
464 ; ---- item 5: quit simulator --- | |
465 ; | |
399 menuview_view_sim_quit: | 466 menuview_view_sim_quit: |
400 btfss simulatormode ; in simulator mode? | 467 btfss simulatormode ; in simulator mode? |
401 bra menuview_toggle ; NO - goto next option | 468 bra menuview_next_item ; NO - goto next item |
402 STRCPY_TEXT_PRINT tQuitSim ; YES - print "Quit Simulation?" | 469 STRCPY_TEXT_PRINT tQuitSim ; YES - print "Quit Simulation?" |
403 bra menuview_exit ; - done | 470 bra menuview_exit ; - done |
404 | 471 |
472 | |
473 ; ---- item 6: simulator - go down ---- | |
474 ; | |
405 menuview_view_sim_down: | 475 menuview_view_sim_down: |
406 btfss simulatormode ; in simulator mode? | 476 btfss simulatormode ; in simulator mode? |
407 bra menuview_toggle ; NO - goto next option | 477 bra menuview_next_item ; NO - goto next item |
408 STRCPY_PRINT "Sim\xb8" ; print down arrow for going down | 478 STRCPY_PRINT "Sim\xb8" ; print down arrow for going down |
409 bra menuview_exit ; done | 479 bra menuview_exit ; done |
410 | 480 |
481 | |
482 ; ---- item 7: simulator - go up ---- | |
483 ; | |
411 menuview_view_sim_up: | 484 menuview_view_sim_up: |
412 btfss simulatormode ; in simulator mode? | 485 btfss simulatormode ; in simulator mode? |
413 bra menuview_toggle ; NO - goto next option | 486 bra menuview_next_item ; NO - goto next item |
414 STRCPY_PRINT "Sim\xb9" ; YES - print up arrow for going up | 487 STRCPY_PRINT "Sim\xb9" ; YES - print up arrow for going up |
415 bra menuview_exit ; - done | 488 bra menuview_exit ; - done |
416 | 489 |
490 | |
491 ; ---- item 8: simulator - advance time ---- | |
492 ; | |
417 menuview_view_sim_time: | 493 menuview_view_sim_time: |
418 btfss simulatormode ; in simulator mode? | 494 btfss simulatormode ; in simulator mode? |
419 bra menuview_toggle ; NO - goto next option | 495 bra menuview_next_item ; NO - goto next item |
420 btfsc FLAG_gauge_mode ; YES - in gauge mode? | 496 btfsc FLAG_gauge_mode ; YES - in gauge mode? |
421 bra menuview_toggle ; YES - goto next option | 497 bra menuview_next_item ; YES - goto next item |
422 btfsc FLAG_apnoe_mode ; NO - in apnoe mode? | 498 btfsc FLAG_apnoe_mode ; NO - in apnoe mode? |
423 bra menuview_toggle ; YES - goto next option | 499 bra menuview_next_item ; YES - goto next item |
424 STRCPY_PRINT "Sim+5'" ; NO - print "Sim+5'" | 500 STRCPY_PRINT "Sim+5'" ; NO - print "Sim+5'" |
425 bra menuview_exit ; - done | 501 bra menuview_exit ; - done |
426 | 502 |
503 | |
504 ; ---- item 9: apnoe mode - quit ---- | |
505 ; | |
427 menuview_view_apnoe_quit: | 506 menuview_view_apnoe_quit: |
428 btfss FLAG_apnoe_mode ; in apnoe mode? | 507 btfss FLAG_apnoe_mode ; in apnoe mode? |
429 bra menuview_toggle ; NO - goto next option | 508 bra menuview_next_item ; NO - goto next option |
430 btfss apnoe_at_surface ; YES - at the surface? | 509 btfss apnoe_at_surface ; YES - at the surface? |
431 bra menuview_toggle ; NO - goto next option | 510 bra menuview_next_item ; NO - goto next item |
432 STRCPY_TEXT_PRINT tQuitSim ; YES - print "Quit Apnea mode?" | 511 STRCPY_TEXT_PRINT tQuitSim ; YES - print "Quit Apnea mode?" |
433 bra menuview_exit ; - done | 512 bra menuview_exit ; - done |
434 | 513 |
514 | |
515 ; ---- item 10: gauge mode - reset average ---- | |
516 ; | |
435 menuview_view_gauge_reset: | 517 menuview_view_gauge_reset: |
436 btfss FLAG_gauge_mode ; in gauge mode? | 518 btfss FLAG_gauge_mode ; in gauge mode? |
437 bra menuview_toggle ; NO - goto next option | 519 bra menuview_next_item ; NO - goto next item |
438 STRCPY_TEXT_PRINT tResetAvg ; YES - print "Reset Avg." | 520 STRCPY_TEXT_PRINT tResetAvg ; YES - print "Reset Avg." |
439 bra menuview_exit ; - done | 521 bra menuview_exit ; - done |
440 | 522 |
523 | |
524 ; ---- item 11: set bearing ---- | |
525 IFDEF _compass | |
441 menuview_view_course: | 526 menuview_view_course: |
442 IFDEF _compass | |
443 movlw index_compass_dm ; index of compass view | 527 movlw index_compass_dm ; index of compass view |
444 cpfseq active_customview ; in compass view? | 528 cpfseq active_customview ; in compass view? |
445 bra menuview_toggle ; NO - goto next option | 529 bra menuview_next_item ; NO - goto next item |
446 STRCPY_TEXT_PRINT tSetHeading ; YES - print "Heading" | 530 STRCPY_TEXT_PRINT tSetHeading ; YES - print "Heading" |
447 bra menuview_exit ; - done | 531 bra menuview_exit ; - done |
448 ELSE | 532 ENDIF |
449 bra menuview_toggle ; not available without compass compiled in, goto next option | 533 |
450 ENDIF | 534 |
451 | 535 ; ---- item 12: switch layout ---- |
536 ; | |
452 menuview_view_layout: | 537 menuview_view_layout: |
453 btfsc FLAG_apnoe_mode ; in apnoe mode? | 538 btfsc FLAG_apnoe_mode ; in apnoe mode? |
454 bra menuview_toggle ; YES - goto next option | 539 bra menuview_next_item ; YES - goto next item |
455 STRCPY_TEXT_PRINT tDiveLayout ; NO - print "Layout" | 540 STRCPY_TEXT_PRINT tDiveLayout ; NO - print "Layout" |
456 bra menuview_exit ; - done | 541 bra menuview_exit ; - done |
457 | 542 |
543 | |
544 ;============================================================================= | |
545 custview4 CODE | |
546 ;============================================================================= | |
547 | |
548 | |
458 ;----------------------------------------------------------------------------- | 549 ;----------------------------------------------------------------------------- |
459 | 550 ; Show a specific Dive Mode Custom View |
460 ; Initialize dive mode custom view | 551 ; |
461 | |
462 global dive_customview_show | 552 global dive_customview_show |
463 dive_customview_show: | 553 dive_customview_show: |
464 btfss custom_view_locked ; custom view locked? | 554 btfss custom_view_locked ; custom view locked? |
465 bra dive_customview_show_1 ; NO - call-up the view | 555 bra dive_customview_show_1 ; NO - call-up the view |
466 movwf backup_customview ; YES - store requested custom view for later recall | 556 movwf backup_customview ; YES - store requested custom view for later recall |
467 return ; - done | 557 return ; - done |
468 dive_customview_show_1: | 558 dive_customview_show_1: |
469 movwf active_customview ; set the requested custom view | 559 movwf active_customview ; set the requested custom view |
470 bra dive_customview_callup ; call-up the custom view | 560 bra dive_customview_callup ; call-up the custom view |
471 | 561 |
562 | |
563 ;----------------------------------------------------------------------------- | |
564 ; Show again last Dive Mode Custom View | |
565 ; | |
472 global dive_customview_recall | 566 global dive_customview_recall |
473 dive_customview_recall: | 567 dive_customview_recall: |
474 movff backup_customview,active_customview ; recall the saved custom view | 568 movff backup_customview,active_customview ; recall the saved custom view |
475 bra dive_customview_callup ; call-up the custom view | 569 bra dive_customview_callup ; call-up the custom view |
476 | 570 |
571 | |
572 ;----------------------------------------------------------------------------- | |
573 ; Show next Dive Mode Custom View | |
574 ; | |
477 global dive_customview_toggle | 575 global dive_customview_toggle |
478 dive_customview_toggle: | 576 dive_customview_toggle: |
479 incf active_customview,F ; increment number of custom view to show | 577 incf active_customview,F ; increment number of custom view to show |
480 movlw index_cv_dm_max ; highest index in use in dive mode custom view | 578 movlw index_cv_dm_max ; get highest index in use in dive mode custom view |
481 cpfsgt active_customview ; max reached? | 579 cpfsgt active_customview ; beyond last view? |
482 bra dive_customview_callup ; NO - call-up the custom view | 580 bra dive_customview_callup ; NO - call-up the custom view |
483 clrf active_customview ; YES - reset to zero (zero = blank custom view) | 581 clrf active_customview ; YES - reset to zero (zero = blank custom view) |
484 ;bra dive_customview_callup ; call-up the custom view | 582 ;bra dive_customview_callup ; call-up the custom view |
485 | 583 |
584 | |
585 ;----------------------------------------------------------------------------- | |
586 ; Show current Dive Mode Custom View | |
587 ; | |
486 global dive_customview_callup | 588 global dive_customview_callup |
487 dive_customview_callup: | 589 dive_customview_callup: |
488 movlw index_compass_dm ; get index of compass custom view | 590 movlw index_compass_dm ; get index of compass custom view |
489 cpfseq active_customview ; will compass be shown? | 591 cpfseq active_customview ; will compass be shown? |
490 call I2C_sleep_compass ; NO - stop compass | 592 call I2C_sleep_compass ; NO - stop compass to save on energy |
491 ;bra dive_customview_init ; continue with initializing selected custom view | 593 |
492 | |
493 ;---------------------------------------------------------------------------------- | |
494 ; Jump table for initialization of the every-second tasks in custom view area (dive mode) | |
495 ; | |
496 ; Attention: the ordering must be in line with the every-second update jump table | |
497 ; and the index numbers defined in hwos.inc! | |
498 ; | |
499 dive_customview_init: | |
500 ; clear custom view area in dive mode | 594 ; clear custom view area in dive mode |
501 WIN_BOX_BLACK dm_customview_row, dm_customview_bot-.2, dm_customview_column, dm_customview_rgt ; top, bottom, left, right | 595 WIN_BOX_BLACK dm_customview_row, dm_customview_bot-.2, dm_customview_column, dm_customview_rgt ; top, bottom, left, right |
596 | |
597 ; jump table | |
502 movf active_customview,W ; get custom view to show | 598 movf active_customview,W ; get custom view to show |
503 dcfsnz WREG,F ; | 599 dcfsnz WREG,F ; |
504 bra init_avr_stopwatch ; 1: average depth and stopwatch | 600 bra init_avr_stopwatch ; 1: average depth and stopwatch |
505 dcfsnz WREG,F ; | 601 dcfsnz WREG,F ; |
506 bra init_TFT_dive_compass ; 2: compass | 602 bra init_TFT_dive_compass ; 2: compass |
521 dcfsnz WREG,F ; | 617 dcfsnz WREG,F ; |
522 bra init_ceiling_GF_tissue ; 10: ceiling, current GF and tissues | 618 bra init_ceiling_GF_tissue ; 10: ceiling, current GF and tissues |
523 dcfsnz WREG,F ; | 619 dcfsnz WREG,F ; |
524 bra init_CNS ; 11: CNS values | 620 bra init_CNS ; 11: CNS values |
525 dcfsnz WREG,F ; | 621 dcfsnz WREG,F ; |
526 bra init_ppo2_ead_end_cns ; 12: ppO2, END/EAD and CNS | 622 bra init_ppo2_ead_end_cns ; 12: ppO2, END/EAD and CNS/gas density |
527 dcfsnz WREG,F ; | 623 dcfsnz WREG,F ; |
528 bra init_clock_batt_surfpress ; 13: clock, battery and surface pressure | 624 bra init_clock_batt_surfpress ; 13: clock, battery and surface pressure |
529 dcfsnz WREG,F ; | 625 dcfsnz WREG,F ; |
530 bra init_gf_factors ; 14: GF factors | 626 bra init_gf_factors ; 14: GF factors |
531 dcfsnz WREG,F ; | 627 dcfsnz WREG,F ; |
532 bra init_cave_waypoints ; 15: cave waypoints | 628 bra init_cave_waypoints ; 15: cave waypoints |
533 bra customview_toggle_exit ; 0: no view (blank screen in custom view area) | 629 ;bra dive_cv_toggle_exit ; 0: no view (blank screen in custom view area) |
534 | 630 |
535 | 631 dive_cv_toggle_exit: |
632 bcf request_next_custview ; clear request flag | |
633 return ; done | |
634 | |
635 | |
636 ; ---- view 1: average depth and stopwatch ---- | |
637 ; | |
638 init_avr_stopwatch: | |
639 btfsc FLAG_apnoe_mode ; in apnoe mode? | |
640 bra dive_customview_toggle ; YES - goto next view | |
641 call TFT_avr_stopwatch_mask ; NO - mask for average depth and stopwatch | |
642 call TFT_avr_stopwatch ; - data for average depth and stopwatch | |
643 bra dive_cv_toggle_exit ; - done | |
644 | |
645 | |
646 ; ---- view 2: compass ---- | |
647 ; | |
648 init_TFT_dive_compass: | |
649 IFDEF _compass | |
650 call I2C_init_compass ; start compass | |
651 call TFT_dive_compass_mask ; mask for compass | |
652 bra dive_cv_toggle_exit ; done | |
653 ELSE | |
654 bra dive_customview_toggle ; not available without compass compiled in, goto next view | |
655 ENDIF | |
656 | |
657 | |
658 ; ---- view 3: ppO2 sensors --- | |
659 ; | |
536 init_ppo2_sensors: | 660 init_ppo2_sensors: |
537 IFDEF _external_sensor | 661 IFDEF _external_sensor |
538 bsf trigger_temp_changed ; fake a change of the temperature to have the resettable dive time overwritten which was shown with the compass view | 662 bsf trigger_temp_changed ; fake a change of the temperature to have the resettable dive time overwritten which was shown with the compass view |
539 btfsc FLAG_ccr_mode ; in CC mode? | 663 btfsc FLAG_ccr_mode ; in CC mode? |
540 bra customview_init_view1a ; YES - (1) | 664 bra init_ppo2_sensors_1 ; YES |
541 btfsc FLAG_pscr_mode ; in pSCR mode? | 665 btfsc FLAG_pscr_mode ; in pSCR mode? |
542 bra customview_init_view1a ; YES - (1) | 666 bra init_ppo2_sensors_1 ; YES |
543 bra dive_customview_toggle ; NO to both, goto next view | 667 bra dive_customview_toggle ; NO to both, goto next view |
544 customview_init_view1a: | 668 init_ppo2_sensors_1: |
545 btfsc analog_o2_input ; (1) - do we have an analog input? | 669 btfsc ext_input_s8_ana ; do we have an S8/analog input? |
546 bra customview_init_view1b ; YES - (2) | 670 bra init_ppo2_sensors_2 ; YES - show this view |
547 btfsc s8_digital_avail ; NO - do we have a digital S8 interface? | 671 btfsc ext_input_optical ; NO - do we have an optical input? |
548 bra customview_init_view1b ; YES - (2) | 672 bra init_ppo2_sensors_2 ; YES - show this view |
549 btfss optical_input ; NO - do we have an optical input? | 673 bra dive_customview_toggle ; NO - goto next view |
550 bra dive_customview_toggle ; NO - goto next view | 674 |
551 ; YES - (2) | 675 init_ppo2_sensors_2: |
552 customview_init_view1b: | 676 call TFT_ppo2_sensors_mask ; mask for ppO2 sensors |
553 call TFT_ppo2_sensors_mask ; (2) - mask for ppO2 sensors | 677 call TFT_ppo2_sensors ; data for ppO2 sensors |
554 call TFT_ppo2_sensors ; - data for ppO2 sensors | 678 bra dive_cv_toggle_exit ; done |
555 bra customview_toggle_exit ; - done | |
556 ELSE | 679 ELSE |
557 bra dive_customview_toggle ; not available without external sensors, got next view | 680 bra dive_customview_toggle ; not available without external sensors, got next view |
558 ENDIF | 681 ENDIF |
559 | 682 |
560 init_avr_stopwatch: | 683 ; ---- view 4: sensor check ---- |
684 ; | |
685 init_sensor_check: | |
686 IFDEF _ccr_pscr | |
687 btfss FLAG_ccr_mode ; in CCR mode? | |
688 bra dive_customview_toggle ; NO - goto next view | |
689 call TFT_sensor_check_mask ; YES - mask for sensor check | |
690 call TFT_sensor_check ; - data for sensor check | |
691 bra dive_cv_toggle_exit ; - done | |
692 ELSE | |
693 bra dive_customview_toggle ; not available without CCR mode compiled in, goto next view | |
694 ENDIF | |
695 | |
696 | |
697 ; ---- view 5: pSCR data ---- | |
698 ; | |
699 init_pscr_info: | |
700 IFDEF _ccr_pscr | |
701 btfss FLAG_pscr_mode ; in pSCR mode? | |
702 bra dive_customview_toggle ; NO - goto next view | |
703 call TFT_pscr_info_mask ; YES - mask for pSCR info | |
704 call TFT_pscr_info ; - data for pSCR info | |
705 bra dive_cv_toggle_exit ; - done | |
706 ELSE | |
707 bra dive_customview_toggle ; not available without CCR / pSCR mode, goto next view | |
708 ENDIF | |
709 | |
710 | |
711 ; view 6: tank pressure and SAC rate ---- | |
712 ; | |
713 init_pressures_SAC: | |
714 IFDEF _rx_functions | |
715 btfss tr_functions_activated ; TR functions activated? | |
716 bra dive_customview_toggle ; NO - goto next view | |
717 call TFT_pressures_SAC_mask ; YES - mask for pressures and SAC | |
718 call TFT_pressures_SAC ; - data for pressures and SAC | |
719 bra dive_cv_toggle_exit ; - done | |
720 ELSE | |
721 bra dive_customview_toggle ; not available without RX functions, got next view | |
722 ENDIF | |
723 | |
724 | |
725 ; ---- view 7: gas needs ---- | |
726 ; | |
727 init_gas_needs_ascent: | |
561 btfsc FLAG_apnoe_mode ; in apnoe mode? | 728 btfsc FLAG_apnoe_mode ; in apnoe mode? |
562 bra dive_customview_toggle ; YES - goto next view | 729 bra dive_customview_toggle ; YES - goto next view |
563 call TFT_avr_stopwatch_mask ; NO - mask for average depth and stopwatch | 730 btfsc FLAG_gauge_mode ; NO - in gauge mode? |
564 call TFT_avr_stopwatch ; - data for average depth and stopwatch | 731 bra dive_customview_toggle ; YES - goto next view |
565 bra customview_toggle_exit ; - done | 732 TSTOSS opt_calc_gasvolume ; NO - check if gas volume calculation is switched on |
566 | 733 bra dive_customview_toggle ; NO - goto next view |
734 call TFT_gas_needs_mask ; YES - mask for gas needs ascent | |
735 call TFT_gas_needs ; - data for gas needs ascent | |
736 bra dive_cv_toggle_exit ; - done | |
737 | |
738 | |
739 ; ---- view 8: cave mode TTS ---- | |
740 init_cave_tts: | |
741 IFDEF _cave_mode | |
742 btfss cave_mode ; in cave mode? | |
743 bra dive_customview_toggle ; NO - goto next view | |
744 call TFT_cave_tts_mask ; YES - show mask | |
745 call TFT_cave_tts ; - show data | |
746 bra dive_cv_toggle_exit ; - done | |
747 ELSE | |
748 bra dive_customview_toggle ; not available without cave mode, goto next view | |
749 ENDIF | |
750 | |
751 | |
752 ; ---- view 9: deco plan ---- | |
753 ; | |
567 init_decoplan: | 754 init_decoplan: |
568 btfsc FLAG_apnoe_mode ; in apnoe mode? | 755 btfsc FLAG_apnoe_mode ; in apnoe mode? |
569 bra dive_customview_toggle ; YES - goto next view | 756 bra dive_customview_toggle ; YES - goto next view |
570 btfsc FLAG_gauge_mode ; NO - in gauge mode? | 757 btfsc FLAG_gauge_mode ; NO - in gauge mode? |
571 bra dive_customview_toggle ; YES - goto next view | 758 bra dive_customview_toggle ; YES - goto next view |
572 call TFT_decoplan_mask ; NO - mask for deco plan | 759 call TFT_decoplan_mask ; NO - mask for deco plan |
573 call TFT_decoplan ; - data for deco plan | 760 call TFT_decoplan ; - data for deco plan |
574 bra customview_toggle_exit ; - done | 761 bra dive_cv_toggle_exit ; - done |
575 | 762 |
576 init_clock_batt_surfpress: | 763 |
577 call TFT_clock_batt_surfpress_mask ; mask for clock, battery and surface pressure | 764 ; ---- view 10: ceiling, tissues and current GF |
578 call TFT_clock_batt_surfpress ; data for clock, battery and surface pressure | 765 ; |
579 bra customview_toggle_exit ; done | 766 init_ceiling_GF_tissue: |
580 | 767 btfsc FLAG_apnoe_mode ; in apnoe mode? |
581 init_TFT_dive_compass: ; compass | 768 bra dive_customview_toggle ; YES - goto next view |
582 IFDEF _compass | 769 btfsc FLAG_gauge_mode ; NO - in gauge mode? |
583 call I2C_init_compass ; start compass | 770 bra dive_customview_toggle ; YES - call next view |
584 call TFT_dive_compass_mask ; show compass mask | 771 call TFT_ceiling_GF_tissue_mask ; NO - mask for ceiling, current GF and tissues |
585 bra customview_toggle_exit ; done | 772 call TFT_ceiling_GF_tissue ; - data for ceiling, current GF and tissues |
586 ELSE | 773 bra dive_cv_toggle_exit ; - done |
587 bra dive_customview_toggle ; not available without compass compiled in, goto next view | 774 |
588 ENDIF | 775 |
589 | 776 ; ---- view 11: CNS values ---- |
590 init_pressures_SAC: ; tank pressure and SAC rate | 777 ; |
591 IFDEF _rx_functions | |
592 btfss tr_functions_activated ; TR functions activated? | |
593 bra dive_customview_toggle ; NO - goto next view | |
594 call TFT_pressures_SAC_mask ; YES - mask for pressures and SAC | |
595 call TFT_pressures_SAC ; - data for pressures and SAC | |
596 bra customview_toggle_exit ; - done | |
597 ELSE | |
598 bra dive_customview_toggle ; not available without RX functions, got next view | |
599 ENDIF | |
600 | |
601 init_CNS: ; CNS at end of dive | 778 init_CNS: ; CNS at end of dive |
602 btfsc FLAG_gauge_mode ; in gauge mode? | 779 btfsc FLAG_gauge_mode ; in gauge mode? |
603 bra dive_customview_toggle ; YES - call next view | 780 bra dive_customview_toggle ; YES - call next view |
604 btfsc FLAG_apnoe_mode ; NO - in apnoe mode? | 781 btfsc FLAG_apnoe_mode ; NO - in apnoe mode? |
605 bra dive_customview_toggle ; YES - call next view | 782 bra dive_customview_toggle ; YES - call next view |
606 call TFT_CNS_mask ; NO - mask for CNS values | 783 call TFT_CNS_mask ; NO - mask for CNS values |
607 call TFT_CNS ; - data for CNS values | 784 call TFT_CNS ; - data for CNS values |
608 bra customview_toggle_exit ; - done | 785 bra dive_cv_toggle_exit ; - done |
609 | 786 |
610 init_ceiling_GF_tissue: ; ceiling, tissues and current GF | 787 |
611 btfsc FLAG_apnoe_mode ; in apnoe mode? | 788 ; ---- view 12: ppO2, END/EAD and CNS/gas density ---- |
612 bra dive_customview_toggle ; YES - goto next view | 789 ; |
613 btfsc FLAG_gauge_mode ; NO - in gauge mode? | 790 init_ppo2_ead_end_cns: ; |
614 bra dive_customview_toggle ; YES - call next view | |
615 call TFT_ceiling_GF_tissue_mask ; NO - mask for ceiling, current GF and tissues | |
616 call TFT_ceiling_GF_tissue ; - data for ceiling, current GF and tissues | |
617 bra customview_toggle_exit ; - done | |
618 | |
619 init_sensor_check: ; sensor check | |
620 IFDEF _ccr_pscr | |
621 btfss FLAG_ccr_mode ; in CCR mode? | |
622 bra dive_customview_toggle ; NO - goto next view | |
623 call TFT_sensor_check_mask ; YES - mask for sensor check | |
624 call TFT_sensor_check ; - data for sensor check | |
625 bra customview_toggle_exit ; - done | |
626 ELSE | |
627 bra dive_customview_toggle ; not available without CCR mode compiled in, goto next view | |
628 ENDIF | |
629 | |
630 init_ppo2_ead_end_cns: ; ppO2, END/EAD and CNS | |
631 btfsc FLAG_apnoe_mode ; in apnoe mode? | 791 btfsc FLAG_apnoe_mode ; in apnoe mode? |
632 bra dive_customview_toggle ; YES - goto next view | 792 bra dive_customview_toggle ; YES - goto next view |
633 btfsc FLAG_gauge_mode ; NO - in gauge mode? | 793 btfsc FLAG_gauge_mode ; NO - in gauge mode? |
634 bra dive_customview_toggle ; YES - goto next view | 794 bra dive_customview_toggle ; YES - goto next view |
635 call TFT_ppo2_ead_end_cns_mask ; NO - mask for ppO2, END/EAD and CNS | 795 call TFT_ppo2_ead_end_cns_mask ; NO - mask for ppO2, END/EAD and CNS |
636 call TFT_ppo2_ead_end_cns ; - data for ppO2, END/EAD and CNS | 796 call TFT_ppo2_ead_end_cns ; - data for ppO2, END/EAD and CNS |
637 bra customview_toggle_exit ; - done | 797 bra dive_cv_toggle_exit ; - done |
638 | 798 |
639 init_pscr_info: ; pSCR information | 799 |
640 IFDEF _ccr_pscr | 800 ; ---- view 13: clock, battery and surface pressure |
641 btfss FLAG_pscr_mode ; in pSCR mode? | 801 ; |
642 bra dive_customview_toggle ; NO - goto next view | 802 init_clock_batt_surfpress: |
643 call TFT_pscr_info_mask ; YES - mask for pSCR info | 803 call TFT_clock_batt_surfpress_mask ; mask for clock, battery and surface pressure |
644 call TFT_pscr_info ; - data for pSCR info | 804 call TFT_clock_batt_surfpress ; data for clock, battery and surface pressure |
645 bra customview_toggle_exit ; - done | 805 bra dive_cv_toggle_exit ; done |
646 ELSE | 806 |
647 bra dive_customview_toggle ; not available without CCR / pSCR mode, goto next view | 807 |
648 ENDIF | 808 ; ---- view 14: GF factors |
649 | 809 ; |
650 init_gas_needs_ascent: ; gas needs for ascent | |
651 btfsc FLAG_apnoe_mode ; in apnoe mode? | |
652 bra dive_customview_toggle ; YES - goto next view | |
653 btfsc FLAG_gauge_mode ; NO - in gauge mode? | |
654 bra dive_customview_toggle ; YES - goto next view | |
655 TSTOSS opt_calc_gasvolume ; NO - check if gas volume calculation is switched on | |
656 bra dive_customview_toggle ; NO - goto next view | |
657 call TFT_gas_needs_mask ; YES - mask for gas needs ascent | |
658 call TFT_gas_needs ; - data for gas needs ascent | |
659 bra customview_toggle_exit ; - done | |
660 | |
661 init_cave_tts: ; cave mode data | |
662 IFDEF _cave_mode | |
663 btfss cave_mode ; in cave mode? | |
664 bra dive_customview_toggle ; NO - goto next view | |
665 call TFT_cave_tts_mask ; YES - show mask | |
666 call TFT_cave_tts ; - show data | |
667 bra customview_toggle_exit ; - done | |
668 ELSE | |
669 bra dive_customview_toggle ; not available without cave mode, goto next view | |
670 ENDIF | |
671 | |
672 init_gf_factors: | 810 init_gf_factors: |
673 call TFT_gf_factors_mask ; mask for GF factors (static only) | 811 call TFT_gf_factors_mask ; show GF factors |
674 bra customview_toggle_exit ; done | 812 bra dive_cv_toggle_exit ; done |
675 | 813 |
814 | |
815 ; ---- view 15: cave waypoints ---- | |
816 ; | |
676 init_cave_waypoints: | 817 init_cave_waypoints: |
677 IFDEF _cave_mode | 818 IFDEF _cave_mode |
678 call TFT_cave_waypoints ; show waypoint graphics | 819 call TFT_cave_waypoints ; show waypoint graphics |
679 bra customview_toggle_exit ; done | 820 bra dive_cv_toggle_exit ; done |
680 ELSE | 821 ELSE |
681 bra dive_customview_toggle ; not available without cave mode, goto next view | 822 bra dive_customview_toggle ; not available without cave mode, goto next view |
682 ENDIF | 823 ENDIF |
683 | 824 |
684 | |
685 customview_toggle_exit: | |
686 bcf request_next_custview ; clear request flag | |
687 return ; done | |
688 | |
689 ;----------------------------------------------------------------------------- | 825 ;----------------------------------------------------------------------------- |
690 | 826 |
691 END | 827 END |