Mercurial > public > hwos_code
annotate src/surfmode.asm @ 640:8c1f1f334275
3.13 release
author | heinrichsweikamp |
---|---|
date | Thu, 29 Oct 2020 09:29:15 +0100 |
parents | 2737ddc643bb |
children | 7d8a4c60ec1a |
rev | line source |
---|---|
0 | 1 ;============================================================================= |
2 ; | |
634 | 3 ; File surfmode.asm * next combined generation V3.09.5 |
0 | 4 ; |
623 | 5 ; Surface Mode |
0 | 6 ; |
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | |
8 ;============================================================================= | |
9 ; HISTORY | |
582 | 10 ; 2011-08-07 : [mH] moving from OSTC code |
0 | 11 |
634 | 12 #include "hwos.inc" ; mandatory header |
13 #include "shared_definitions.h" ; mailbox from/to p2_deco.c | |
582 | 14 #include "start.inc" |
15 #include "tft.inc" | |
16 #include "tft_outputs.inc" | |
17 #include "adc_lightsensor.inc" | |
18 #include "strings.inc" | |
19 #include "sleepmode.inc" | |
623 | 20 #include "wait.inc" |
582 | 21 #include "customview.inc" |
22 #include "divemode.inc" | |
23 #include "i2c.inc" | |
24 #include "comm.inc" | |
634 | 25 #include "colorschemes.inc" |
26 | |
27 IFDEF _rx_functions | |
28 #include "rx_ops.inc" | |
29 ENDIF | |
30 | |
31 IFDEF _external_sensor | |
582 | 32 #include "calibrate.inc" |
634 | 33 ENDIF |
0 | 34 |
604 | 35 |
634 | 36 extern main_menu |
37 extern check_cns_violation_now | |
38 extern check_battery | |
39 extern check_saturation | |
604 | 40 extern check_mbubbles |
41 | |
582 | 42 |
623 | 43 IFDEF _compass |
44 extern TFT_surface_compass_heading | |
45 ENDIF | |
582 | 46 |
213 | 47 |
623 | 48 ;---- Private local variables ------------------------------------------------ |
49 | |
50 CBLOCK local1 ; max size is 16 byte !!! | |
604 | 51 ; currently not used |
52 ENDC ; used: 0 byte, remaining: 16 byte | |
582 | 53 |
0 | 54 |
582 | 55 #DEFINE menu_pos_row .215 |
56 #DEFINE menu_pos_column .1 | |
57 #DEFINE view_row .215 | |
58 #DEFINE view_column .124 | |
0 | 59 |
634 | 60 ;============================================================================= |
61 sfmode1 CODE | |
62 ;============================================================================= | |
0 | 63 |
634 | 64 ;----------------------------------------------------------------------------- |
65 ; Entry Point for Surface Mode | |
623 | 66 ; |
67 ; called after restart via the battery selection, after compass calibration, | |
68 ; and via ghostwriter at the end of a dive | |
69 ; | |
0 | 70 global surfloop |
71 surfloop: | |
634 | 72 clrf STKPTR ; clear return addresses stack |
73 ; clrf CCP1CON ; stop PWM | |
74 ; bcf PORTC,2 ; pull PWM output to GND | |
75 ; clrf CCPR1L ; backlight off | |
76 call TFT_boot ; initialize TFT (includes clear screen) | |
245 | 77 |
634 | 78 btfsc restart_fast ; shall make a fast restart? |
79 bra surfloop_1 ; YES | |
0 | 80 |
623 | 81 ; show heinrichsweikamp logo |
604 | 82 WIN_TOP .40 |
582 | 83 WIN_LEFT .10 |
623 | 84 TFT_WRITE_PROM_IMAGE_BY_ADDR hw_logo_block |
0 | 85 |
634 | 86 ; set font color |
87 FONT_COLOR color_white | |
88 | |
623 | 89 ; show textual OSTC logo |
634 | 90 WIN_STD .30,.90 ; column, row |
91 STRCPY_PRINT "Open Source" ; show OSTC banner text, line 1 | |
92 WIN_STD .20,.130 ; column, row | |
93 STRCPY_PRINT "Tauch-Computer" ; show OSTC banner text, line 2 | |
604 | 94 |
634 | 95 ; show firmware version |
604 | 96 WIN_SMALL .35,.180 |
634 | 97 PUTC "v" ; print "v" |
98 call TFT_print_firmware ; print full firmware version (may change the font color) | |
99 call TFT_Display_FadeIn ; dim up the display | |
604 | 100 |
623 | 101 surfloop_1: |
634 | 102 |
103 ;---- do all useful initializations that take time ----------------------- | |
604 | 104 |
623 | 105 ; set deco mode flags |
106 call restart_set_modes_and_flags | |
107 | |
634 | 108 bsf trigger_pres_cur_changed ; set flag to have pressure written to display on first round of surface loop |
109 bsf trigger_temp_changed ; set flag to have temperature written to display on first round of surface loop | |
623 | 110 |
634 | 111 call I2C_sleep_compass ; shut down compass |
0 | 112 |
623 | 113 IFDEF _ccr_pscr |
634 | 114 movlw surface_sp ; load default surface setpoint (in cbar) |
115 movff WREG,char_I_const_ppO2 ; store it as current setpoint | |
623 | 116 ENDIF |
117 | |
118 IFDEF _external_sensor | |
634 | 119 call transmit_setpoint ; transmit current setpoint (in cbar) via S8 digital interface (currently disabled) |
623 | 120 ENDIF |
221
90923a081ae7
minor: configure buttons during splash screen
heinrichsweikamp
parents:
213
diff
changeset
|
121 |
634 | 122 bcf surfmode_menu ; not in surface menu (any more) |
123 bcf compass_menu ; not in "set bearing" selection (any more) | |
0 | 124 |
634 | 125 bcf switch_left ; clear intermediate button event since start/restart |
126 bcf switch_right ; clear intermediate button event since start/restart | |
623 | 127 |
634 | 128 btfsc restart_fast ; shall make a fast restart? |
129 bra surfloop_2 ; YES | |
604 | 130 |
628 | 131 call deco_calc_desaturation_time ; calculate desaturation and no-fly/no-altitude time (C-code) |
132 banksel common ; back to bank common | |
133 | |
634 | 134 WAITS .2 ; wait 2 seconds |
0 | 135 |
634 | 136 ;---- fade to standard surface view -------------------------------------- |
0 | 137 |
634 | 138 call TFT_Display_FadeOut ; dim down display to black screen |
139 call TFT_ClearScreen ; clear screen | |
623 | 140 |
141 surfloop_2: | |
634 | 142 |
143 call TFT_load_std_color_pallet ; load standard color pallet | |
144 | |
145 ;---- button functionalities --------------------------------------------- | |
0 | 146 |
634 | 147 FONT_COLOR color_lightblue ; set font color |
148 WIN_SMALL menu_pos_column,menu_pos_row ; set font size and output position | |
149 STRCPY_TEXT_PRINT tMenu ; print "<Menu" | |
150 WIN_SMALL view_column,view_row ; set font size and output position | |
151 STRCPY_TEXT_PRINT tView ; print "View>" | |
0 | 152 |
623 | 153 |
634 | 154 ;---- logo in upper right corner ----------------------------------------- |
628 | 155 |
623 | 156 ; show textual OSTC logo |
157 WIN_STD .100,.2 ; set output position | |
634 | 158 FONT_COLOR color_white ; set text color to white |
604 | 159 STRCPY_PRINT "OSTC" ; show "OSTC" |
634 | 160 |
161 FONT_COLOR color_cyan ; set text color to cyan | |
623 | 162 WIN_TINY .138,.2 ; set output position |
604 | 163 STRCPY_PRINT "hwOS" ; show "hwOS" |
623 | 164 WIN_TINY .137,.14 ; set output position |
165 IFDEF _hwos_sport | |
166 STRCPY_PRINT "sport" ; show "sport" | |
167 ELSE | |
604 | 168 STRCPY_PRINT "tech" ; show "tech" |
169 ENDIF | |
634 | 170 |
171 ; firmware version | |
623 | 172 WIN_TINY .100,.32 ; set output position |
634 | 173 FONT_COLOR color_white ; set text color to white |
174 call TFT_print_firmware ; show firmware version (long format) | |
0 | 175 |
176 | |
623 | 177 ;---- fill screen -------------------------------------------------------- |
582 | 178 |
634 | 179 call get_battery_voltage ; get battery voltage |
180 call TFT_surfmode_batt ; show battery voltage | |
181 call TFT_surfmode_time ; show time | |
182 call TFT_surfmode_date ; show date | |
183 call TFT_surfmode_pres ; show surface pressure | |
184 call TFT_surfmode_temp ; show temperature | |
185 call TFT_surfmode_decotype ; show deco mode | |
186 | |
187 TSTOSS opt_dive_mode ; in OC? (0=OC, 1=CC, 2=Gauge, 3=Apnea, 4=pSCR) | |
188 call TFT_surfmode_startgas ; YES - show first gas and "OSTC2-like" active gases | |
0 | 189 |
631 | 190 ; configure tissue graphics |
634 | 191 bcf tissue_graphic_mode ; select surface mode |
192 bsf tissue_graphic_cns ; show CNS value | |
631 | 193 |
634 | 194 bsf tissue_graphic_layout ; default to N2+He |
195 TSTOSS opt_tissue_graphics ; shall show press+sat? | |
196 bcf tissue_graphic_layout ; YES - show press+sat | |
631 | 197 |
634 | 198 bcf tissue_graphic_gf ; default to none-GF |
199 TSTOSC char_I_model ; GF factors enabled? | |
200 bsf tissue_graphic_gf ; YES - show GF lines | |
631 | 201 |
623 | 202 movff customview_surfmode,active_customview ; reload last custom view |
203 call surf_customview_mask ; redraw last custom view | |
582 | 204 |
634 | 205 call TFT_Display_FadeIn ; show resulting surface screen |
0 | 206 |
604 | 207 IFDEF _screendump |
636 | 208 extern enable_rs232 |
634 | 209 btfsc screen_dump_avail ; screen dump function enabled? |
210 call enable_rs232 ; YES - activate RS232 (also sets CPU to normal speed) | |
604 | 211 ENDIF |
212 | |
634 | 213 bcf restart_fast ; clear flag for fast restart |
214 bsf imprint_surfmode_data ; start imprinting surface mode data | |
0 | 215 |
634 | 216 bcf switch_left ; clear pending left button event |
217 bcf switch_right ; clear pending right button event | |
0 | 218 |
634 | 219 rcall reset_timeout_surfmode ; reset timeout |
582 | 220 |
623 | 221 surfloop_loop: |
640 | 222 call TFT_debug_output ; optional debug output |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
187
diff
changeset
|
223 |
634 | 224 call test_switches_surfmode ; check switches |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
187
diff
changeset
|
225 |
634 | 226 btfsc request_next_custview ; shall show next custom view? |
227 call surf_customview_toggle ; YES - show next custom view (and clear this flag) | |
0 | 228 |
634 | 229 btfss surfmode_menu ; shall enter surface menu? |
230 bra surfloop_loop_1 ; NO | |
231 bcf imprint_surfmode_data ; YES - stop imprinting surface mode data | |
232 goto main_menu ; - goto surface menu | |
582 | 233 |
623 | 234 surfloop_loop_1: |
634 | 235 call housekeeping ; handle data imprinting, screen dump request, timeout and entering dive mode |
236 bra surfloop_loop ; loop in surface mode | |
582 | 237 |
0 | 238 |
634 | 239 ;----------------------------------------------------------------------------- |
240 ; Surface Mode HMI Operations | |
241 ; | |
623 | 242 test_switches_surfmode: ; check buttons in surface mode |
243 btfsc switch_right ; right button pressed? | |
244 bra test_switches_surfmode2 ; YES | |
245 btfsc switch_left ; left button pressed? | |
246 bra test_switches_surfmode3 ; YES | |
247 return ; NO to both - done | |
248 | |
249 test_switches_surfmode2: ; right button pressed | |
250 bcf switch_right ; clear button event | |
631 | 251 rcall reset_timeout_surfmode ; set up timeout |
623 | 252 IFDEF _compass |
253 movlw .6 ; coding for surface custom compass view | |
254 cpfseq active_customview ; in compass view? | |
255 bra test_switches_surfmode2a ; NO | |
256 btfss compass_menu ; "set course" selection shown? | |
257 bra test_switches_surfmode2a ; NO | |
258 bsf compass_bearing_set ; YES - set new course | |
259 MOVII compass_heading_shown,compass_bearing | |
260 bra test_switches_surfmode3b ; - clear "Course" label and return | |
261 ENDIF | |
262 test_switches_surfmode2a: | |
263 bsf request_next_custview ; request next custom view | |
264 bcf compass_menu ; "set course" selection not shown anymore | |
0 | 265 return |
266 | |
623 | 267 test_switches_surfmode3: ; left button pressed |
268 bcf switch_left ; clear button event | |
631 | 269 rcall reset_timeout_surfmode ; set up timeout |
623 | 270 IFDEF _compass |
271 movlw .6 ; coding for surface custom view compass | |
272 cpfseq active_customview ; in compass view? | |
604 | 273 bra test_switches_surfmode3a ; NO |
623 | 274 btfsc compass_menu ; YES - "set course" selection already shown? |
275 bra test_switches_surfmode3b ; YES - remove it | |
634 | 276 call TFT_surf_cv_compass_bearing ; NO - show it |
628 | 277 return ; - done |
623 | 278 ENDIF |
382 | 279 test_switches_surfmode3a: |
623 | 280 bcf compass_bearing_set ; clear course on entering menu |
281 bsf surfmode_menu ; flag that the surface menu shall be entered | |
582 | 282 return |
382 | 283 |
623 | 284 IFDEF _compass |
285 test_switches_surfmode3b: | |
628 | 286 WIN_BOX_BLACK .158,.190, .15, .99 ; clear "Course" label (top, bottom, left, right) |
623 | 287 bcf compass_menu ; clear flag for "set course" selection |
582 | 288 return |
623 | 289 ENDIF |
382 | 290 |
623 | 291 |
634 | 292 ;----------------------------------------------------------------------------- |
293 ; Helper Function - Reset and Restart Timeout for Surface Mode | |
294 ; | |
295 global reset_timeout_surfmode | |
296 reset_timeout_surfmode: | |
297 movlw surfmode_timeout_default ; load default timeout value | |
298 btfss battery_is_36v ; running on a 3.6 V battery? | |
299 movlw surfmode_timeout_aa_15v ; NO - replace by timeout for 1.5V battery | |
300 btfsc simulatormode ; currently in simulator (deco calculator) mode? | |
301 movlw surfmode_timeout_simulator ; YES - replace with simulator timeout | |
302 ;bra restart_timeout_time ; restart timeout | |
303 | |
304 global restart_timeout_time | |
305 restart_timeout_time: ; entry point with timeout value in WREG | |
306 movwf isr_timeout_reload ; copy WREG to isr_timeout_reload | |
307 bsf restart_timeout ; request ISR to restart the timeout | |
308 bcf trigger_timeout ; clear any pending timeout trigger | |
309 return ; done | |
310 | |
311 | |
312 ;============================================================================= | |
313 sfmode2 CODE | |
314 ;============================================================================= | |
315 | |
316 ;----------------------------------------------------------------------------- | |
317 ; Helper Function - Check all possible Surface Mode Warning Conditions | |
318 ; | |
319 surfmode_check_warnings: | |
320 clrf message_counter ; clear message counter | |
321 | |
322 ; warnings for all modes | |
323 call check_battery ; check if the battery level should be displayed/warned | |
324 | |
325 btfsc FLAG_apnoe_mode ; done for Apnoe or Gauge mode | |
326 bra surfmode_check_warnings2 | |
327 btfsc FLAG_gauge_mode ; done for Apnoe or Gauge mode | |
328 bra surfmode_check_warnings2 | |
329 | |
330 ; warnings only in deco modes | |
331 call check_saturation ; check/show tissue saturation | |
332 call check_cns_violation_now ; check/show current CNS value | |
333 call check_mbubbles ; check/show micro bubbles | |
334 movff int_O_lead_supersat+1,WREG ; get upper byte of leading tissue's supersaturation | |
335 btfsc WREG,int_warning_flag ; check if the warning flag is set | |
336 bra surfmode_check_warnings2 ; YES - outside of the model | |
337 rcall surfmode_check_for_desat ; NO - check/show desaturation time | |
338 rcall surfmode_check_for_nofly ; - check/show no-fly time | |
339 | |
340 surfmode_check_warnings2: | |
341 ; setup message page number | |
342 incf message_page,F ; increment page number | |
343 bcf STATUS,C ; clear carry bit | |
344 rlcf message_page,W ; each page can take two messages | |
345 cpfsgt message_counter ; number of actual messages > message capacity ? | |
346 clrf message_page ; NO - all messages could be shown, restart from first page next time | |
347 | |
348 ; clear both rows if there is nothing to show at all | |
349 tstfsz message_counter ; any message to show? | |
350 bra surfmode_check_warnings3 ; YES - look if second row needs to be cleared | |
351 goto TFT_clear_message_window ; NO - clear complete message area and return | |
352 | |
353 surfmode_check_warnings3: | |
354 ; clear 2nd row of messages if there is nothing to show (on this page) | |
355 btfss message_2nd_row_used ; does the 2nd row contain a message? | |
356 goto TFT_clear_message_window_row2 ; NO - clear the 2nd row and return | |
357 return ; YES - done | |
358 | |
359 | |
360 ;----------------------------------------------------------------------------- | |
361 ; Helper Function - check if still in Desaturation, if yes show a Message | |
362 ; | |
363 surfmode_check_for_desat: | |
364 banksel int_O_desaturation_time | |
365 movf int_O_desaturation_time+0,W | |
366 iorwf int_O_desaturation_time+1,W | |
367 banksel common ; back to bank common | |
368 bnz surfmode_check_for_desat_1 ; is the desat-time > 0 ? | |
369 return ; NO - done | |
370 surfmode_check_for_desat_1: | |
371 incf message_counter,F ; YES - increase counter | |
372 call TFT_surf_mesg_desat ; - show desaturation time | |
373 return ; - done | |
374 | |
375 | |
376 ;----------------------------------------------------------------------------- | |
377 ; Helper Function - check if still in no-fly, if yes show a Message | |
378 ; | |
379 surfmode_check_for_nofly: | |
380 banksel int_O_nofly_time | |
381 movf int_O_nofly_time+0,W | |
382 iorwf int_O_nofly_time+1,W | |
383 banksel common ; back to bank common | |
384 bnz surfmode_check_for_nofly_1 ; is the nofly-time > 0 ? | |
385 return ; NO - done | |
386 surfmode_check_for_nofly_1: | |
387 incf message_counter,F ; YES - increase counter | |
388 call TFT_surf_mesg_nofly ; - show nofly-time | |
389 return ; - done | |
390 | |
391 | |
392 ;============================================================================= | |
393 sfmode3 CODE | |
394 ;============================================================================= | |
395 | |
396 ;----------------------------------------------------------------------------- | |
397 ; Data Imprinting, Screen Dump request, Timeout and Entering Dive Mode | |
398 ; | |
623 | 399 global housekeeping |
400 housekeeping: | |
401 btfss trigger_full_second ; new 1/1 second begun? | |
402 bra housekeeping_1 ; NO | |
403 | |
634 | 404 ;---- tasks any new second --------- |
405 | |
623 | 406 bcf trigger_full_second ; YES - clear flag |
407 call get_battery_voltage ; - get battery voltage | |
408 | |
409 btfsc imprint_time_date ; - shall imprint the current time & date? | |
634 | 410 call TFT_imprint_time_date ; YES - imprint time and date on display (copies running time to latch registers) |
411 | |
412 btfsc imprint_color_schemes ; - shall imprint color scheme demo? | |
413 call TFT_imprint_color_schemes ; YES - update the color schemes | |
623 | 414 |
415 IFDEF _rx_functions | |
416 btfsc tr_functions_activated ; - TR functions activated? | |
417 call I2C_get_tankdata ; YES - get new transmitter data | |
418 | |
419 btfsc imprint_xmitter_pres ; - shall imprint transmitter ID and pressure? | |
634 | 420 call TFT_imprint_tank_pres ; YES - imprint transmitter ID and pressure |
623 | 421 ENDIF |
422 | |
423 btfss imprint_surfmode_data ; - shall imprint all surface mode data? | |
424 bra housekeeping_0 ; NO | |
634 | 425 call TFT_surfmode_time ; YES - update displayed time |
426 call TFT_surfmode_batt ; - update displayed battery voltage | |
623 | 427 btfss timebase_1sec,0 ; - on even second? |
634 | 428 call surfmode_check_warnings ; YES - check for warnings and display/update them |
623 | 429 |
430 IFDEF _rx_functions | |
431 btfss tr_functions_activated ; - TR functions activated? | |
432 bra housekeeping_0 ; NO - skip tank pressure part | |
433 | |
434 call get_pressure_readings ; YES - get pressure readings | |
634 | 435 call TFT_surfmode_tankpres ; - update first gas/diluent pressure |
623 | 436 |
437 movf active_customview,W ; - get current custom view | |
438 xorlw .10 ; - coding of tank data custom view | |
439 btfsc STATUS,Z ; - equal? | |
634 | 440 call TFT_surf_cv_tankdata ; YES - update tank data custom view |
623 | 441 ENDIF |
442 | |
443 housekeeping_0: | |
444 bsf restart_fast ; default to doing a fast restart (no logos) | |
634 | 445 call check_dive_modes_surf ; check if dive mode needs to be entered, will set dive mode flag if yes |
623 | 446 btfsc simulatormode ; in simulator mode? |
447 bra housekeeping_1 ; YES - can't restart or go to sleep without prior cleanup | |
448 btfsc divemode ; NO - need to enter dive mode? | |
449 goto restart ; YES - restart, will proceed to dive mode | |
450 btfss trigger_timeout ; NO - timeout? | |
451 bra housekeeping_1 ; NO | |
452 btfsc surfmode_menu ; YES - in surface menus? | |
453 goto restart ; YES - goto restart, will proceed to surface mode | |
454 bcf restart_fast ; NO - set next restart to be done slow, i.e. with logos | |
455 goto sleeploop ; - goto sleep mode | |
456 | |
457 housekeeping_1: | |
458 btfss trigger_quarter_second ; new 1/4 second begun? | |
459 bra housekeeping_2 ; NO | |
0 | 460 |
634 | 461 ;---- tasks any new 1/4 second ----- |
462 | |
623 | 463 bcf trigger_quarter_second ; YES - clear flag |
464 IFDEF _external_sensor | |
465 btfsc imprint_sensor_mv ; - shall imprint sensor mV data? | |
634 | 466 call TFT_imprint_menu_mV ; YES - imprint sensor mV data |
623 | 467 ENDIF ; _external_sensor |
468 btfss imprint_surfmode_data ; - shall imprint all surface mode data? | |
469 bra housekeeping_2 ; NO | |
470 btfsc trigger_pres_cur_changed ; YES - pressure changed? | |
634 | 471 call TFT_surfmode_pres_fast ; YES - display surface pressure, but only if change > threshold |
623 | 472 bcf trigger_pres_cur_changed ; - clear flag (anyhow) |
473 IFDEF _compass | |
474 movf active_customview,W ; - get current custom view | |
475 xorlw .6 ; - coding of compass custom view | |
476 btfsc STATUS,Z ; - equal? | |
477 call TFT_surface_compass_heading ; YES - update compass view | |
478 ENDIF ; _compass | |
479 IFDEF _external_sensor | |
480 btfsc FLAG_ccr_mode ; - in CCR mode? | |
481 bra housekeeping_1a ; - YES - handle sensors | |
482 btfsc FLAG_pscr_mode ; - in pSCR mode? | |
483 bra housekeeping_1a ; YES - handle sensors | |
484 bra housekeeping_2 ; NO to both | |
634 | 485 |
623 | 486 housekeeping_1a: ; handle sensors |
487 movff opt_ccr_mode,WREG ; =0: fixed SP, =1: sensor, =2: autoSP | |
488 decfsz WREG ; opt_ccr_mode = 1 (sensor)? | |
489 bra housekeeping_2 ; NO - skip sensor readings | |
490 call calc_deko_divemode_sensor ; YES - read & calculate sensor data | |
634 | 491 call TFT_imprint_surf_ppO2 ; - update displayed sensor data |
492 call TFT_imprint_surf_sensor_eol ; - show a down-arrow behind sensor readings when sensor is at end-of-life | |
623 | 493 movf active_customview,W ; - get current custom view |
494 xorlw .9 ; - coding of sensor mV readings custom view | |
495 btfsc STATUS,Z ; - equal? | |
634 | 496 call TFT_imprint_surf_mV ; YES - update mV readings |
623 | 497 ENDIF ; _external_sensor |
634 | 498 |
623 | 499 housekeeping_2: |
500 btfss trigger_full_minute ; new 1/1 minute begun? | |
501 bra housekeeping_3 ; NO | |
502 | |
634 | 503 ;---- tasks any new minute --------- |
504 | |
623 | 505 bcf trigger_full_minute ; YES - clear flag |
634 | 506 |
507 btfss imprint_surfmode_data ; - shall imprint all surface mode data? | |
508 bra housekeeping_2a ; NO | |
509 btfsc trigger_pres_cur_changed ; YES - pressure changed? | |
510 call TFT_surfmode_pres ; YES - display surface pressure | |
511 bcf trigger_pres_cur_changed ; - clear flag (anyhow) | |
512 | |
513 housekeeping_2a: | |
623 | 514 btfsc simulatormode ; - in simulator mode? |
634 | 515 bra housekeeping_2b ; YES - real tissues are in the vault, skip desaturation calculations |
623 | 516 call deco_calc_dive_interval_1min; NO - calculate 1 minute at surface conditions (C-code) |
517 call deco_calc_desaturation_time ; - calculate desaturation and no-fly/no-altitude time (C-code) | |
518 banksel common ; - back to bank common | |
634 | 519 |
520 housekeeping_2b: | |
623 | 521 btfss imprint_surfmode_data ; - shall imprint all surface mode data? |
522 bra housekeeping_3 ; NO | |
634 | 523 call TFT_surfmode_date ; YES - update displayed date |
623 | 524 |
525 btfsc trigger_temp_changed ; - temperature changed? | |
634 | 526 call TFT_surfmode_temp ; YES - display temperature |
623 | 527 bcf trigger_temp_changed ; - clear flag (anyhow) |
528 | |
529 movf active_customview,W ; - get current custom view | |
530 xorlw .5 ; - coding of tissue custom view | |
531 btfsc STATUS,Z ; - equal? | |
634 | 532 call TFT_surf_cv_tissues ; YES - update tissue diagram |
623 | 533 |
534 movf active_customview,W ; - get current custom view | |
535 xorlw .8 ; - coding of last dive info custom view | |
536 btfsc STATUS,Z ; - equal? | |
634 | 537 call TFT_surf_cv_lastdive ; YES - update last dive infos |
623 | 538 |
539 housekeeping_3: | |
634 | 540 |
541 ;---- tasks any round -------------- | |
542 | |
623 | 543 IFDEF _screendump |
544 btfsc screen_dump_avail ; screen dump function enabled? | |
545 call TFT_dump_screen_check ; YES - check if requested and do it | |
546 ELSE | |
547 btfsc comm_mode_disabled ; COMM mode disabled? | |
548 return ; YES - done | |
604 | 549 ENDIF |
623 | 550 btfss surfmode_menu ; in surface menus? |
551 return ; NO - done | |
552 | |
553 btfsc simulatormode ; currently in simulator (deco calculator) mode? | |
554 return ; YES - suppress COMM mode to not jeopardize backup/restore of tissue data | |
555 | |
556 btfss vusb_in ; USB plugged in? | |
631 | 557 return ; NO - done |
623 | 558 IFDEF _screendump |
559 btfsc screen_dump_avail ; YES - screen dump enabled? | |
560 return ; YES - no COMM mode to be able to make screen shots of the menu and simulator mode | |
561 ENDIF | |
631 | 562 btfss ble_available ; skip "USB" check in all Bluetooth models (required for very old OSTC sport) |
623 | 563 goto comm_mode_usb ; YES / NO - proceed to COMM mode, will also set CPU to speed normal |
629 | 564 return |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
187
diff
changeset
|
565 |
623 | 566 ;----------------------------------------------------------------------------- |
567 | |
568 END |