annotate src/surfmode.asm @ 653:8bcd138ab744

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