Mercurial > public > hwos_code
comparison src/customview.asm @ 582:b455b31ce022
work on 2.97 stable
author | heinrichsweikamp |
---|---|
date | Mon, 26 Feb 2018 16:40:28 +0100 |
parents | 690bfb76911c |
children | 6636cbe64c6d |
comparison
equal
deleted
inserted
replaced
581:f5de1ff88814 | 582:b455b31ce022 |
---|---|
1 ;============================================================================= | 1 ;============================================================================= |
2 ; | 2 ; |
3 ; File customview.asm REFACTORED VERSION V2.95 | 3 ; File customview.asm REFACTORED VERSION V2.98 |
4 ; | 4 ; |
5 ; Customview in Surfacemode and Divemode | 5 ; Customview in Surfacemode and Divemode |
6 ; | 6 ; |
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | 7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. |
8 ;============================================================================= | 8 ;============================================================================= |
9 ; HISTORY | 9 ; HISTORY |
10 ; 2011-08-10 : [mH] moving from OSTC code | 10 ; 2011-08-10 : [mH] moving from OSTC code |
11 | 11 |
12 ;============================================================================= | 12 ;============================================================================= |
13 | 13 |
14 #include "hwos.inc" ; Mandatory header | 14 #include "hwos.inc" ; Mandatory header |
15 #include "tft_outputs.inc" | 15 #include "tft_outputs.inc" |
16 #include "strings.inc" | 16 #include "strings.inc" |
17 #include "tft.inc" | 17 #include "tft.inc" |
18 #include "isr.inc" | 18 #include "isr.inc" |
19 #include "wait.inc" | 19 #include "wait.inc" |
20 #include "surfmode.inc" | 20 #include "surfmode.inc" |
21 #include "convert.inc" | 21 #include "convert.inc" |
22 #include "divemode.inc" | 22 #include "divemode.inc" |
23 #include "i2c.inc" | 23 #include "i2c.inc" |
24 #include "start.inc" | 24 #include "start.inc" |
25 | 25 |
26 gui CODE | 26 |
27 extern gaslist_strcat_gas_mod | |
28 extern char_I_deco_model | |
29 extern TFT_sensor_mV | |
30 extern TFT_surface_compass_mask | |
31 extern TFT_dive_compass_mask | |
32 | |
33 | |
34 gui CODE | |
27 | 35 |
28 ;============================================================================= | 36 ;============================================================================= |
29 ; Do every-second tasks for the custom view area (Dive mode) | 37 ; Do every-second tasks for the custom view area (Dive mode) |
30 | 38 |
31 global customview_second | 39 global customview_second |
32 customview_second: | 40 customview_second: |
33 movff menupos3,WREG ; copy current view (1-...) | 41 movff menupos3,WREG ; copy current view (1-...) |
34 dcfsnz WREG,F | 42 dcfsnz WREG,F |
35 goto TFT_update_ppo2_sensors ; Update Sensor data ; and return | 43 goto TFT_update_ppo2_sensors ; Update Sensor data ; and return |
36 dcfsnz WREG,F | 44 dcfsnz WREG,F |
37 goto TFT_update_avr_stopwatch ; Update average depth and stopwatch; and return | 45 goto TFT_update_avr_stopwatch ; Update average depth and stopwatch; and return |
38 dcfsnz WREG,F | 46 dcfsnz WREG,F |
39 goto TFT_decoplan ; Show decoplan ; and return | 47 goto TFT_decoplan ; Show decoplan ; and return |
40 dcfsnz WREG,F | 48 dcfsnz WREG,F |
41 goto TFT_battinfo_tissues_clock ; Update Battery, Tissues and clock ; and return | 49 goto TFT_battinfo_tissues_clock ; Update Battery, Tissues and clock ; and return |
42 dcfsnz WREG,F | 50 dcfsnz WREG,F |
43 goto TFT_gf_info ; Update GF informations ; and return | 51 goto TFT_gf_info ; Update GF informations ; and return |
44 dcfsnz WREG,F | 52 dcfsnz WREG,F |
45 return ; Compass updated separately (faster) in divemode; | 53 return ; Compass updated separately (faster) in divemode; |
46 dcfsnz WREG,F | 54 dcfsnz WREG,F |
47 nop ; ex goto TFT_dyn_gaslist | 55 nop ; ex goto TFT_dyn_gaslist |
48 dcfsnz WREG,F | 56 dcfsnz WREG,F |
49 goto TFT_CNS ; Show CNS values for end-of-dive, ex goto TFT_hud_voltages | 57 goto TFT_CNS ; Show CNS values for end-of-dive, ex goto TFT_hud_voltages |
50 dcfsnz WREG,F | 58 dcfsnz WREG,F |
51 bra customview_1sec_view9 ; Make sure to change value in "check_ppo2_display:" when moving around custom views | 59 bra customview_1sec_view9 ; Make sure to change value in "check_ppo2_display:" when moving around custom views |
52 dcfsnz WREG,F | 60 dcfsnz WREG,F |
53 goto TFT_sensor_check ; Show ppO2 of O2 and Diluent ; and return | 61 goto TFT_sensor_check ; Show ppO2 of O2 and Diluent ; and return |
54 dcfsnz WREG,F | 62 dcfsnz WREG,F |
55 goto TFT_ppo2_ead_end_cns ; Show ppO2, END/EAD and CNS; and return | 63 goto TFT_ppo2_ead_end_cns ; Show ppO2, END/EAD and CNS; and return |
56 dcfsnz WREG,F | 64 dcfsnz WREG,F |
57 goto TFT_pscr_info ; Show ppO2, drop and lung ratio; and return | 65 goto TFT_pscr_info ; Show ppO2, drop and lung ratio; and return |
58 dcfsnz WREG,F | 66 dcfsnz WREG,F |
59 goto TFT_gas_needs ; Show gas needs | 67 goto TFT_gas_needs ; Show gas needs |
60 | 68 |
61 ; Menupos3=0, do nothing | 69 ; Menupos3=0, do nothing |
62 return | 70 return |
63 | 71 |
64 customview_1sec_view9: ; Ceiling | 72 customview_1sec_view9: ; Ceiling |
65 call TFT_ceiling ; Show Ceiling | 73 call TFT_ceiling ; Show Ceiling |
66 call TFT_display_pure_ppo2 ; ppO2 value | 74 call TFT_display_pure_ppo2 ; ppO2 value |
67 extern char_I_deco_model ; current GF value | 75 TSTOSS char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF |
68 TSTOSS char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF | 76 return ; No GF info for non-GF modes |
69 return ; No GF info for non-GF modes | 77 goto TFT_gf_info ; Update GF informations ; and return |
70 goto TFT_gf_info ; Update GF informations ; and return | 78 |
71 | 79 global customview_alternative_second |
72 global customview_alternative_second | 80 customview_alternative_second: |
73 customview_alternative_second: | 81 movff menupos3,WREG ; copy current view (1-...) |
74 movff menupos3,WREG ; copy current view (1-...) | |
75 dcfsnz WREG,F | 82 dcfsnz WREG,F |
76 bra customview_alt_second_view1 ; View 1 | 83 bra customview_alt_second_view1 ; View 1 |
77 dcfsnz WREG,F | 84 dcfsnz WREG,F |
78 nop ; View 2 | 85 nop ; View 2 |
79 | 86 |
80 ; Menupos3=0, do nothing | 87 ; Menupos3=0, do nothing |
81 return | 88 return |
82 | 89 |
83 customview_alt_second_view1: | 90 customview_alt_second_view1: |
84 bsf FLAG_TFT_max_depth_alt | 91 bsf FLAG_TFT_max_depth_alt |
85 bsf FLAG_TFT_big_deco_alt | 92 bsf FLAG_TFT_big_deco_alt |
86 return | 93 return |
87 | 94 |
88 ;============================================================================= | 95 ;============================================================================= |
89 ; Do every-minute tasks for the custom view area | 96 ; Do every-minute tasks for the custom view area |
90 | 97 |
91 global customview_minute | 98 global customview_minute |
92 customview_minute: | 99 customview_minute: |
93 return | 100 return |
94 ; movff menupos3,WREG ; copy | 101 ; movff menupos3,WREG ; copy |
95 ; dcfsnz WREG,F | 102 ; dcfsnz WREG,F |
96 ; bra customview_1min_view1 | 103 ; bra customview_1min_view1 |
97 ; dcfsnz WREG,F | 104 ; dcfsnz WREG,F |
98 ; bra customview_1min_view2 | 105 ; bra customview_1min_view2 |
99 ; dcfsnz WREG,F | 106 ; dcfsnz WREG,F |
126 ;customview_1min_view7: | 133 ;customview_1min_view7: |
127 ;customview_1min_view8: | 134 ;customview_1min_view8: |
128 ;customview_1min_view9: | 135 ;customview_1min_view9: |
129 ;customview_1min_view10: | 136 ;customview_1min_view10: |
130 ;customview_1min_view11: | 137 ;customview_1min_view11: |
131 ; return | 138 ;return |
132 | 139 |
133 global surf_customview_toggle | 140 global surf_customview_toggle |
134 surf_customview_toggle: | 141 surf_customview_toggle: |
135 bcf switch_right | 142 bcf switch_right |
136 incf menupos3,F ; Number of customview to show | 143 incf menupos3,F ; Number of customview to show |
137 movlw d'9' ; Max number of customsviews in surface mode | 144 movlw d'9' ; Max number of customsviews in surface mode |
138 cpfsgt menupos3 ; Max reached? | 145 cpfsgt menupos3 ; Max reached? |
139 bra surf_customview_mask ; No, show | 146 bra surf_customview_mask ; No, show |
140 movlw .1 | 147 movlw .1 |
141 movwf menupos3 ; Reset to one (Always one custom view visible) | 148 movwf menupos3 ; Reset to one (Always one custom view visible) |
142 | 149 |
143 global surf_customview_mask | 150 global surf_customview_mask |
144 surf_customview_mask: | 151 surf_customview_mask: |
145 WIN_BOX_BLACK .50,surf_warning1_row-1, .0, surf_decotype_column-.1 ; top, bottom, left, right | 152 WIN_BOX_BLACK .50,surf_warning1_row-1, .0, surf_decotype_column-.1 ; top, bottom, left, right |
146 ; Prepare title | 153 ; Prepare title |
147 WIN_TINY surf_customview_title_column,surf_customview_title_row | 154 WIN_TINY surf_customview_title_column,surf_customview_title_row |
148 WIN_COLOR color_greenish | 155 WIN_COLOR color_greenish |
149 movff menupos3,WREG ; Menupos3 holds number of customview function | 156 movff menupos3,WREG ; Menupos3 holds number of customview function |
150 dcfsnz WREG,F | 157 dcfsnz WREG,F |
151 bra surf_customview_init_view1 ; OC Gas list | 158 bra surf_customview_init_view1 ; OC Gas list |
152 dcfsnz WREG,F | 159 dcfsnz WREG,F |
153 bra surf_customview_init_view2 ; CC Dil list | 160 bra surf_customview_init_view2 ; CC Dil list |
154 dcfsnz WREG,F | 161 dcfsnz WREG,F |
155 bra surf_customview_init_view3 ; CC SP list | 162 bra surf_customview_init_view3 ; CC SP list |
156 dcfsnz WREG,F | 163 dcfsnz WREG,F |
157 bra surf_customview_init_view4 ; Custom Text | 164 bra surf_customview_init_view4 ; Custom Text |
158 dcfsnz WREG,F | 165 dcfsnz WREG,F |
159 bra surf_customview_init_view5 ; Tissue Diagram | 166 bra surf_customview_init_view5 ; Tissue Diagram |
160 dcfsnz WREG,F | 167 dcfsnz WREG,F |
161 bra surf_customview_init_view6 ; Compass | 168 bra surf_customview_init_view6 ; Compass |
162 dcfsnz WREG,F | 169 dcfsnz WREG,F |
163 bra surf_customview_init_view7 ; Deco settings | 170 bra surf_customview_init_view7 ; Deco settings |
164 dcfsnz WREG,F | 171 dcfsnz WREG,F |
165 bra surf_customview_init_view8 ; Last Dive info | 172 bra surf_customview_init_view8 ; Last Dive info |
166 dcfsnz WREG,F | 173 dcfsnz WREG,F |
167 bra surf_customview_init_view9 ; Sensor mV readings | 174 bra surf_customview_init_view9 ; Sensor mV readings |
168 | 175 |
169 call I2C_sleep_accelerometer ; Stop accelerometer | 176 call I2C_sleep_accelerometer ; Stop accelerometer |
170 call I2C_sleep_compass ; Stop compass | 177 call I2C_sleep_compass ; Stop compass |
171 | 178 |
172 movlw .1 | 179 movlw .1 |
173 movwf menupos3 ; Reset to one (Always one custom view visible) | 180 movwf menupos3 ; Reset to one (Always one custom view visible) |
174 | 181 |
175 surf_customview_init_view1: ; View1: OC Gas list | 182 surf_customview_init_view1: ; View1: OC Gas list |
176 btfsc FLAG_gauge_mode | 183 btfsc FLAG_gauge_mode |
177 bra surf_customview_toggle | 184 bra surf_customview_toggle |
178 btfsc FLAG_apnoe_mode | 185 btfsc FLAG_apnoe_mode |
179 bra surf_customview_toggle | 186 bra surf_customview_toggle |
180 btfsc FLAG_ccr_mode | 187 btfsc FLAG_ccr_mode |
181 bra surf_customview_init_view1_bail ; Bailout version of "OC Gas List" | 188 bra surf_customview_init_view1_bail ; Bailout version of "OC Gas List" |
182 btfsc FLAG_pscr_mode | 189 btfsc FLAG_pscr_mode |
183 bra surf_customview_init_view1_bail ; Bailout version of "OC Gas List" | 190 bra surf_customview_init_view1_bail ; Bailout version of "OC Gas List" |
184 STRCPY_TEXT_PRINT tGaslist ; Title of customview | 191 STRCPY_TEXT_PRINT tGaslist ; Title of customview |
185 call TFT_standard_color | 192 call TFT_standard_color |
186 call TFT_gaslist_surfmode ; Show gas list | 193 call TFT_gaslist_surfmode ; Show gas list |
187 bra customview_toggle_exit ; Done. | 194 bra customview_toggle_exit ; Done. |
188 | 195 |
189 surf_customview_init_view1_bail: | 196 surf_customview_init_view1_bail: |
190 STRCPY_TEXT_PRINT tDiveBailout ; Title of customview | 197 STRCPY_TEXT_PRINT tDiveBailout ; Title of customview |
191 call TFT_standard_color | 198 call TFT_standard_color |
192 call TFT_gaslist_surfmode ; Show gas list | 199 call TFT_gaslist_surfmode ; Show gas list |
193 bra customview_toggle_exit ; Done. | 200 bra customview_toggle_exit ; Done. |
194 | 201 |
195 surf_customview_init_view2: ; View2: CC Dil list | 202 surf_customview_init_view2: ; View2: CC Dil list |
196 btfsc FLAG_pscr_mode | 203 btfsc FLAG_pscr_mode |
197 bra surf_customview_init_view2_2 | 204 bra surf_customview_init_view2_2 |
198 btfss FLAG_ccr_mode | 205 btfss FLAG_ccr_mode |
199 bra surf_customview_toggle | 206 bra surf_customview_toggle |
200 btfsc FLAG_gauge_mode | 207 btfsc FLAG_gauge_mode |
201 bra surf_customview_toggle | 208 bra surf_customview_toggle |
202 btfsc FLAG_apnoe_mode | 209 btfsc FLAG_apnoe_mode |
203 bra surf_customview_toggle | 210 bra surf_customview_toggle |
204 surf_customview_init_view2_2: | 211 surf_customview_init_view2_2: |
205 STRCPY_TEXT_PRINT tGaslistCC ; Title of customview | 212 STRCPY_TEXT_PRINT tGaslistCC ; Title of customview |
206 call TFT_standard_color | 213 call TFT_standard_color |
207 call TFT_dillist_surfmode ; Show diluent list | 214 call TFT_dillist_surfmode ; Show diluent list |
208 bra customview_toggle_exit ; Done. | 215 bra customview_toggle_exit ; Done. |
209 | 216 |
210 surf_customview_init_view3: ; View3: CC SP list | 217 surf_customview_init_view3: ; View3: CC SP list |
211 btfss FLAG_ccr_mode | 218 btfss FLAG_ccr_mode |
212 bra surf_customview_toggle | 219 bra surf_customview_toggle |
213 btfsc FLAG_gauge_mode | 220 btfsc FLAG_gauge_mode |
214 bra surf_customview_toggle | 221 bra surf_customview_toggle |
215 btfsc FLAG_apnoe_mode | 222 btfsc FLAG_apnoe_mode |
216 bra surf_customview_toggle | 223 bra surf_customview_toggle |
217 STRCPY_TEXT_PRINT tFixedSetpoints ; Title of customview | 224 STRCPY_TEXT_PRINT tFixedSetpoints ; Title of customview |
218 call TFT_standard_color | 225 call TFT_standard_color |
219 call TFT_splist_surfmode ; Show Setpoint list | 226 call TFT_splist_surfmode ; Show Setpoint list |
220 bra customview_toggle_exit ; Done. | 227 bra customview_toggle_exit ; Done. |
221 | 228 |
222 surf_customview_init_view9: ; View 9: Sensor mV on the surface | 229 surf_customview_init_view9: ; View 9: Sensor mV on the surface |
223 btfsc FLAG_ccr_mode | 230 btfsc FLAG_ccr_mode |
224 bra surf_customview_init_view9a ; we are in CCR mode | 231 bra surf_customview_init_view9a ; we are in CCR mode |
225 btfsc FLAG_pscr_mode | 232 btfsc FLAG_pscr_mode |
226 bra surf_customview_init_view9a ; we are in PSCR mode | 233 bra surf_customview_init_view9a ; we are in PSCR mode |
227 bra surf_customview_toggle ; we are not in any rebreather mode, so skip | 234 bra surf_customview_toggle ; we are not in any rebreather mode, so skip |
228 surf_customview_init_view9a: | 235 surf_customview_init_view9a: |
229 movff opt_ccr_mode,WREG ; =0: Fixed SP, =1: Sensor, =2: Auto SP | 236 movff opt_ccr_mode,WREG ; =0: Fixed SP, =1: Sensor, =2: Auto SP |
230 sublw .1 ; opt_ccr_mode = 1 (Sensor)? | 237 sublw .1 ; opt_ccr_mode = 1 (Sensor)? |
231 bnz surf_customview_toggle ; sorry, no sensors, skip again | 238 bnz surf_customview_toggle ; sorry, no sensors, skip again |
232 STRCPY_TEXT_PRINT tSensorMilliVolt ; Title of customview | 239 STRCPY_TEXT_PRINT tSensorMilliVolt ; Title of customview |
233 call TFT_standard_color | 240 call TFT_standard_color |
234 extern TFT_sensor_mV | 241 call TFT_sensor_mV ; write sensor mV readings to screen |
235 call TFT_sensor_mV ; write sensor mV readings to screen | 242 bra customview_toggle_exit ; Done. |
236 bra customview_toggle_exit ; Done. | 243 |
237 | 244 surf_customview_init_view4: ; View4: Custom text |
238 surf_customview_init_view4: ; View4: Custom text | 245 call TFT_standard_color |
239 call TFT_standard_color | 246 call TFT_custom_text ; Show the custom text |
240 call TFT_custom_text ; Show the custom text | 247 bra customview_toggle_exit ; Done. |
241 bra customview_toggle_exit ; Done. | 248 |
242 | 249 surf_customview_init_view5: ; View5: Tissue Diagram |
243 surf_customview_init_view5: ; View5: Tissue Diagram | 250 btfsc FLAG_gauge_mode |
244 btfsc FLAG_gauge_mode | 251 bra surf_customview_toggle |
245 bra surf_customview_toggle | 252 btfsc FLAG_apnoe_mode |
246 btfsc FLAG_apnoe_mode | 253 bra surf_customview_toggle |
247 bra surf_customview_toggle | 254 call TFT_standard_color |
248 call TFT_standard_color | 255 call TFT_surface_tissues ; Show Tissue diagram |
249 call TFT_surface_tissues ; Show Tissue diagram | 256 bra customview_toggle_exit ; Done. |
250 bra customview_toggle_exit ; Done. | 257 |
251 | 258 surf_customview_init_view6: ; View6: Compass |
252 surf_customview_init_view6: ; View6: Compass | 259 call I2C_init_accelerometer ; Start accelerometer |
253 call I2C_init_accelerometer ; Start accelerometer | 260 call I2C_init_compass ; Start compass |
254 call I2C_init_compass ; Start compass | 261 call TFT_surface_compass_mask ; Show compass |
255 extern TFT_surface_compass_mask | 262 bra customview_toggle_exit ; Done. |
256 call TFT_surface_compass_mask ; Show compass | 263 |
257 bra customview_toggle_exit ; Done. | |
258 | |
259 surf_customview_init_view7: | 264 surf_customview_init_view7: |
260 btfsc FLAG_gauge_mode ; View7: Deco settings | 265 btfsc FLAG_gauge_mode ; View7: Deco settings |
261 bra surf_customview_toggle | 266 bra surf_customview_toggle |
262 btfsc FLAG_apnoe_mode | 267 btfsc FLAG_apnoe_mode |
263 bra surf_customview_toggle | 268 bra surf_customview_toggle |
264 | 269 |
265 call TFT_surface_decosettings ; Show all deco settings | 270 call TFT_surface_decosettings ; Show all deco settings |
266 bra customview_toggle_exit ; Done. | 271 bra customview_toggle_exit ; Done. |
267 | 272 |
268 surf_customview_init_view8: ; View8: Last dive info | 273 surf_customview_init_view8: ; View8: Last dive info |
269 call TFT_surface_lastdive ; Show last dive interval | 274 call TFT_surface_lastdive ; Show last dive interval |
270 bra customview_toggle_exit ; Done. | 275 bra customview_toggle_exit ; Done. |
271 | 276 |
272 | 277 |
273 global menuview_toggle | 278 global menuview_toggle |
274 menuview_toggle: ; Show Menu or the simulator tasks | 279 menuview_toggle: ; Show Menu or the simulator tasks |
275 btfss alternative_divelayout ; In alternative layout mode? | 280 btfss alternative_divelayout ; In alternative layout mode? |
276 bra menuview_toggle2 ; No | 281 bra menuview_toggle2 ; No |
277 ; Switch back to normal mode for any menu tasks | 282 ; Switch back to normal mode for any menu tasks |
278 bcf alternative_divelayout ; clear flag | 283 bcf alternative_divelayout ; clear flag |
279 bsf FLAG_TFT_divemode_mask ; Set flag for mask | 284 bsf FLAG_TFT_divemode_mask ; Set flag for mask |
280 bsf FLAG_TFT_max_depth ; set flag | 285 bsf FLAG_TFT_max_depth ; set flag |
281 btfss decostop_active ; deco? | 286 btfss decostop_active ; deco? |
282 bsf FLAG_TFT_display_ndl_mask ; NDL | 287 bsf FLAG_TFT_display_ndl_mask ; NDL |
283 btfsc decostop_active ; deco? | 288 btfsc decostop_active ; deco? |
284 bsf FLAG_TFT_display_deko_mask ; Deco | 289 bsf FLAG_TFT_display_deko_mask ; Deco |
285 call TFT_ClearScreen ; Clear screen | 290 call TFT_ClearScreen ; Clear screen |
286 rcall customview_mask ; Re-Draw customview | 291 rcall customview_mask ; Re-Draw customview |
287 | 292 |
288 menuview_toggle2: | 293 menuview_toggle2: |
289 movlw divemode_menuview_timeout | 294 movlw divemode_menuview_timeout |
290 movwf timeout_counter3 | 295 movwf timeout_counter2 |
291 bsf menuview | 296 bsf menuview |
292 bcf switch_left | 297 bcf switch_left |
293 incf menupos2,F ; Number of options to show | 298 incf menupos2,F ; Number of options to show |
294 movlw d'10' ; Max number of options in divemode | 299 movlw d'10' ; Max number of options in divemode |
295 cpfsgt menupos2 ; Max reached? | 300 cpfsgt menupos2 ; Max reached? |
296 bra menuview_mask ; No, show | 301 bra menuview_mask ; No, show |
297 global menuview_toggle_reset | 302 global menuview_toggle_reset |
298 menuview_toggle_reset: ; Timeout occurred | 303 menuview_toggle_reset: ; Timeout occurred |
299 clrf menupos2 | 304 clrf menupos2 |
300 bcf menuview | 305 bcf menuview |
301 menuview_mask: | 306 menuview_mask: |
302 WIN_BOX_BLACK dm_simtext_row, dm_simtext_row+.23, dm_simtext_column, dm_simtext_column+.49 ; top, bottom, left, right | 307 WIN_BOX_BLACK dm_simtext_row, dm_simtext_row+.23, dm_simtext_column, dm_simtext_column+.49 ; top, bottom, left, right |
303 btfss FLAG_gauge_mode | 308 btfss FLAG_gauge_mode |
304 bra menuview_mask2 | 309 bra menuview_mask2 |
305 ; Clear some more in gauge mode -- "Reset Avg." text is longer than normal simtext | 310 ; Clear some more in gauge mode -- "Reset Avg." text is longer than normal simtext |
306 WIN_BOX_BLACK dm_simtext_row, dm_simtext_row+.23, dm_simtext_column+.50, dm_simtext_column+.70 ; top, bottom, left, right | 311 WIN_BOX_BLACK dm_simtext_row, dm_simtext_row+.23, dm_simtext_column+.50, dm_simtext_column+.70 ; top, bottom, left, right |
307 menuview_mask2: | 312 menuview_mask2: |
308 call TFT_draw_gassep_line | 313 call TFT_draw_gassep_line |
309 movlw color_yellow | 314 movlw color_yellow |
310 call TFT_set_color | 315 call TFT_set_color |
311 bsf win_invert ; Set invert flag | 316 bsf win_invert ; Set invert flag |
312 WIN_SMALL dm_simtext_column,dm_simtext_row | 317 WIN_SMALL dm_simtext_column,dm_simtext_row |
313 movff menupos2,WREG ; Menupos2 holds number of menu option to show | 318 movff menupos2,WREG ; Menupos2 holds number of menu option to show |
314 dcfsnz WREG,F | 319 dcfsnz WREG,F |
315 bra menuview_view_gaschange ; If a better gas is indicated | 320 bra menuview_view_gaschange ; If a better gas is indicated |
316 dcfsnz WREG,F | 321 dcfsnz WREG,F |
317 bra menuview_view1 ; "Menu?" (Not in Gauge and Anpnoe) | 322 bra menuview_view1 ; "Menu?" (Not in Gauge and Anpnoe) |
318 dcfsnz WREG,F | 323 dcfsnz WREG,F |
319 bra menuview_view2 ; "Quit Simulation?" (Sim only) | 324 bra menuview_view2 ; "Quit Simulation?" (Sim only) |
320 dcfsnz WREG,F | 325 dcfsnz WREG,F |
321 bra menuview_view3 ; "Descent 1m" (Sim only) | 326 bra menuview_view3 ; "Descent 1m" (Sim only) |
322 dcfsnz WREG,F | 327 dcfsnz WREG,F |
323 bra menuview_view4 ; "Ascend 1m" (Sim only) | 328 bra menuview_view4 ; "Ascend 1m" (Sim only) |
324 dcfsnz WREG,F | 329 dcfsnz WREG,F |
325 bra menuview_view5 ; "Quit Apnea mode?" (Apnea only) | 330 bra menuview_view5 ; "Quit Apnea mode?" (Apnea only) |
326 dcfsnz WREG,F | 331 dcfsnz WREG,F |
327 bra menuview_view6 ; "Reset Avr." (Gauge only) | 332 bra menuview_view6 ; "Reset Avr." (Gauge only) |
328 dcfsnz WREG,F | 333 dcfsnz WREG,F |
329 bra menuview_view7 ; "Sim:+5mins" (Sim only) | 334 bra menuview_view7 ; "Sim:+5mins" (Sim only) |
330 dcfsnz WREG,F | 335 dcfsnz WREG,F |
331 bra menuview_view8 ; "Heading" (When compass is shown) | 336 bra menuview_view8 ; "Heading" (When compass is shown) |
332 dcfsnz WREG,F | 337 dcfsnz WREG,F |
333 bra menuview_view9 ; "Layout" (Alternative Layout, aka Blind mode) | 338 bra menuview_view9 ; "Layout" (Alternative Layout, aka Blind mode) |
334 | 339 |
335 menuview_exit: | 340 menuview_exit: |
336 call TFT_standard_color | 341 call TFT_standard_color |
337 bcf win_invert ; Reset invert flag | 342 bcf win_invert ; Reset invert flag |
338 return ; Menupos2 = 0, Show nothing | 343 return ; Menupos2 = 0, Show nothing |
339 | 344 |
340 | 345 |
341 menuview_view_gaschange: | 346 menuview_view_gaschange: |
342 extern gaslist_strcat_gas_mod | 347 btfss better_gas_available ; =1: A better gas is available |
343 btfss better_gas_available ; =1: A better gas is available | 348 bra menuview_toggle ; No, call next option |
344 bra menuview_toggle ; No, call next option | 349 btfsc divemode_gaschange ; Skip if the last gas change is not done yet. |
345 btfsc divemode_gaschange ; Skip if the last gas change is not done yet. | 350 bra menuview_toggle |
346 bra menuview_toggle | 351 bsf short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint |
347 bsf short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint | 352 movff better_gas_number,PRODL ; number (1-5) of the "better gas" in divemode, =0: no better gas available |
348 movff better_gas_number,PRODL ; number (1-5) of the "better gas" in divemode, =0: no better gas available | 353 decf PRODL,F |
349 decf PRODL,F | 354 call gaslist_strcat_gas_mod ; Append gas description of gas #PRODL (0-4) to current string |
350 call gaslist_strcat_gas_mod ; Append gas description of gas #PRODL (0-4) to current string | 355 movlw .5 |
351 movlw .5 | 356 movwf FSR2L ; Point to char 6 (5 chars gas description only) |
352 movwf FSR2L ; Point to char 6 (5 chars gas description only) | 357 STRCAT_PRINT "?" |
353 STRCAT_PRINT "?" | 358 bra menuview_exit ; Done. |
354 bra menuview_exit ; Done. | |
355 menuview_view1: | 359 menuview_view1: |
356 btfsc FLAG_apnoe_mode ; In Apnoe mode? | 360 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
357 bra menuview_toggle ; Call next option | 361 bra menuview_toggle ; Call next option |
358 btfsc FLAG_gauge_mode ; In Gauge mode? | 362 btfsc FLAG_gauge_mode ; In Gauge mode? |
359 bra menuview_toggle ; Call next option | 363 bra menuview_toggle ; Call next option |
360 STRCPY_TEXT_PRINT tDivePreMenu ; "Menu?" | 364 STRCPY_TEXT_PRINT tDivePreMenu ; "Menu?" |
361 bra menuview_exit ; Done. | 365 bra menuview_exit ; Done. |
362 menuview_view2: | 366 menuview_view2: |
363 btfss simulatormode_active ; View only for simulator mode | 367 btfss simulatormode_active ; View only for simulator mode |
364 bra menuview_toggle ; Call next option | 368 bra menuview_toggle ; Call next option |
365 STRCPY_TEXT_PRINT tQuitSim ; "Quit Simulation?" | 369 STRCPY_TEXT_PRINT tQuitSim ; "Quit Simulation?" |
366 bra menuview_exit ; Done. | 370 bra menuview_exit ; Done. |
367 menuview_view3: | 371 menuview_view3: |
368 btfss simulatormode_active ; View only for simulator mode | 372 btfss simulatormode_active ; View only for simulator mode |
369 bra menuview_toggle ; Call next option | 373 bra menuview_toggle ; Call next option |
370 STRCPY_PRINT "Sim-1m" ; CHANGED, now "-" for going down | 374 STRCPY_PRINT "Sim-1m" ; "-" for going down |
371 bra menuview_exit ; Done. | 375 bra menuview_exit ; Done. |
372 menuview_view4: | 376 menuview_view4: |
373 btfss simulatormode_active ; View only for simulator mode | 377 btfss simulatormode_active ; View only for simulator mode |
374 bra menuview_toggle ; Call next option | 378 bra menuview_toggle ; Call next option |
375 STRCPY_PRINT "Sim+1m" ; CHANGED, now "+" for going up | 379 STRCPY_PRINT "Sim+1m" ; "+" for going up |
376 bra menuview_exit ; Done. | 380 bra menuview_exit ; Done. |
377 menuview_view5: | 381 menuview_view5: |
378 btfss FLAG_apnoe_mode ; In Apnoe mode? | 382 btfss FLAG_apnoe_mode ; In Apnoe mode? |
379 bra menuview_toggle ; No, call next option | 383 bra menuview_toggle ; No, call next option |
380 btfss FLAG_active_descent ; Are we descending? | 384 btfss FLAG_active_descent ; Are we descending? |
381 bra menuview_toggle ; Yes | 385 bra menuview_toggle ; Yes |
382 ; We are at the surface: | 386 ; We are at the surface: |
383 STRCPY_TEXT_PRINT tQuitSim ; "Quit Apnea mode?" | 387 STRCPY_TEXT_PRINT tQuitSim ; "Quit Apnea mode?" |
384 bra menuview_exit ; Done. | 388 bra menuview_exit ; Done. |
385 menuview_view6: | 389 menuview_view6: |
386 btfss FLAG_gauge_mode ; In Gauge mode? | 390 btfss FLAG_gauge_mode ; In Gauge mode? |
387 bra menuview_toggle ; No, call next option | 391 bra menuview_toggle ; No, call next option |
388 STRCPY_TEXT_PRINT tDivemenu_ResetAvg ; "Reset Avg." | 392 STRCPY_TEXT_PRINT tDivemenu_ResetAvg; "Reset Avg." |
389 bra menuview_exit ; Done. | 393 bra menuview_exit ; Done. |
390 menuview_view7: | 394 menuview_view7: |
391 btfss simulatormode_active ; View only for simulator mode | 395 btfss simulatormode_active ; View only for simulator mode |
392 bra menuview_toggle ; Call next option | 396 bra menuview_toggle ; Call next option |
393 btfsc FLAG_gauge_mode ; In Gauge mode? | 397 btfsc FLAG_gauge_mode ; In Gauge mode? |
394 bra menuview_toggle ; Yes, call next option | 398 bra menuview_toggle ; Yes, call next option |
395 btfsc FLAG_apnoe_mode ; In Apnoe mode? | 399 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
396 bra menuview_toggle ; Yes, call next option | 400 bra menuview_toggle ; Yes, call next option |
397 STRCPY_PRINT "Sim+5'" | 401 STRCPY_PRINT "Sim+5'" |
398 bra menuview_exit ; Done. | 402 bra menuview_exit ; Done. |
399 menuview_view8: | 403 menuview_view8: |
400 movlw .6 | 404 movlw .6 |
401 cpfseq menupos3 ; in compass view? | 405 cpfseq menupos3 ; in compass view? |
402 bra menuview_toggle ; No, call next option | 406 bra menuview_toggle ; No, call next option |
403 STRCPY_TEXT_PRINT tSetHeading ; "Heading" | 407 STRCPY_TEXT_PRINT tSetHeading ; "Heading" |
404 bra menuview_exit ; Done. | 408 bra menuview_exit ; Done. |
405 menuview_view9: | 409 menuview_view9: |
406 STRCPY_PRINT "Layout" | 410 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
407 bra menuview_exit ; Done. | 411 bra menuview_toggle ; Yes, call next option |
408 | 412 btfsc FLAG_gauge_mode ; In Gauge mode? |
409 | 413 bra menuview_toggle ; Yes, call next option |
410 | 414 STRCPY_PRINT "Layout" |
411 | 415 bra menuview_exit ; Done. |
416 | |
412 ;============================================================================= | 417 ;============================================================================= |
413 | 418 |
414 customview_toggle_alternative: | 419 customview_toggle_alternative: |
415 movlw d'1' ; Max number of customviews in divemode, alternative layout | 420 movlw d'1' ; Max number of customviews in divemode, alternative layout |
416 cpfsgt menupos3 ; Max reached? | 421 cpfsgt menupos3 ; Max reached? |
417 bra customview_mask_alternative ; No, show | 422 bra customview_mask_alternative ; No, show |
418 movlw .1 | 423 movlw .1 |
419 movwf menupos3 ; Reset to one, always one customview visible in alternative layout | 424 movwf menupos3 ; Reset to one, always one customview visible in alternative layout |
420 customview_mask_alternative: | 425 customview_mask_alternative: |
421 ; Clear custom view area in divemode | 426 ; Clear custom view area in divemode |
422 WIN_BOX_BLACK dm_customview_row, .239, .0, .159 ; top, bottom, left, right | 427 WIN_BOX_BLACK dm_customview_row, .239, .0, .159 ; top, bottom, left, right |
423 call TFT_standard_color | 428 call TFT_standard_color |
424 movff menupos3,WREG ; Menupos3 holds number of customview function | 429 movff menupos3,WREG ; Menupos3 holds number of customview function |
425 dcfsnz WREG,F | 430 dcfsnz WREG,F |
426 bra customview_alt_init_view1 ; View 1: Big deco/ndl and max. depth | 431 bra customview_alt_init_view1 ; View 1: Big deco/ndl and max. depth |
427 dcfsnz WREG,F | 432 dcfsnz WREG,F |
428 bra customview_alt_init_view2 ; View 2: | 433 bra customview_alt_init_view2 ; View 2: |
429 | 434 |
430 ;bra customview_alternative_toggle_exit ; No view (menupos3=0) | 435 ;bra customview_alternative_toggle_exit ; No view (menupos3=0) |
431 | 436 |
432 customview_alt_toggle_exit: | 437 customview_alt_toggle_exit: |
433 call TFT_standard_color | 438 call TFT_standard_color |
434 bcf toggle_customview ; Clear flag | 439 bcf toggle_customview ; Clear flag |
435 return | 440 return |
436 | 441 |
437 customview_alt_init_view1: ; View 1: Big deco/ndl and max. depth | 442 customview_alt_init_view1: ; View 1: Big deco/ndl and max. depth |
438 call TFT_max_depth_alternative | 443 call TFT_max_depth_alternative |
439 call TFT_big_deco_alt | 444 call TFT_big_deco_alt |
440 bra customview_alt_toggle_exit | 445 bra customview_alt_toggle_exit |
441 | 446 |
442 customview_alt_init_view2: | 447 customview_alt_init_view2: |
443 ; /* Just for test... | 448 ; /* Just for test... |
444 call TFT_mask_avr_stopwatch ; Show mask for average depth and stopwatch | 449 call TFT_mask_avr_stopwatch ; Show mask for average depth and stopwatch |
445 call TFT_update_avr_stopwatch ; Update average depth and stopwatch | 450 call TFT_update_avr_stopwatch ; Update average depth and stopwatch |
446 ; ...Just for test */ | 451 ; ...Just for test */ |
447 | 452 bra customview_alt_toggle_exit |
448 bra customview_alt_toggle_exit | 453 |
449 | 454 |
450 | |
451 ; Show next customview (and delete this flag) | 455 ; Show next customview (and delete this flag) |
452 global customview_toggle | 456 global customview_toggle |
453 customview_toggle: | 457 customview_toggle: |
454 bcf switch_right | 458 bcf switch_right |
455 incf menupos3,F ; Number of customview to show | 459 incf menupos3,F ; Number of customview to show |
456 | 460 |
457 btfsc alternative_divelayout ; In alternative layout mode? | 461 btfsc alternative_divelayout ; In alternative layout mode? |
458 bra customview_toggle_alternative ; Yes, use the big ones instead | 462 bra customview_toggle_alternative ; Yes, use the big ones instead |
459 | 463 |
460 movlw d'13' ; Max number of customviews in divemode | 464 movlw d'13' ; Max number of customviews in divemode |
461 cpfsgt menupos3 ; Max reached? | 465 cpfsgt menupos3 ; Max reached? |
462 bra customview_mask ; No, show | 466 bra customview_mask ; No, show |
463 clrf menupos3 ; Reset to zero (Zero=no custom view) | 467 clrf menupos3 ; Reset to zero (Zero=no custom view) |
464 | 468 |
465 global customview_mask | 469 global customview_mask |
466 customview_mask: | 470 customview_mask: |
467 ; Clear custom view area in divemode | 471 ; Clear custom view area in divemode |
468 WIN_BOX_BLACK dm_customview_row, dm_customview_bot-.2, dm_customview_column, dm_customview_rgt ; top, bottom, left, right | 472 WIN_BOX_BLACK dm_customview_row, dm_customview_bot-.2, dm_customview_column, dm_customview_rgt ; top, bottom, left, right |
469 WIN_SMALL dm_customview_column,dm_customview_row | 473 WIN_SMALL dm_customview_column,dm_customview_row |
470 call TFT_standard_color | 474 call TFT_standard_color |
471 movff menupos3,WREG ; Menupos3 holds number of customview function | 475 movff menupos3,WREG ; Menupos3 holds number of customview function |
472 dcfsnz WREG,F | 476 dcfsnz WREG,F |
473 bra customview_init_view1 ; Update Sensor data | 477 bra customview_init_view1 ; Update Sensor data |
474 dcfsnz WREG,F | 478 dcfsnz WREG,F |
475 bra customview_init_view2 ; average depth and stopwatch | 479 bra customview_init_view2 ; average depth and stopwatch |
476 dcfsnz WREG,F | 480 dcfsnz WREG,F |
477 bra customview_init_view3 ; Decoplan | 481 bra customview_init_view3 ; Decoplan |
478 dcfsnz WREG,F | 482 dcfsnz WREG,F |
479 bra customview_init_view4 ; Battery info, Tissues and clock | 483 bra customview_init_view4 ; Battery info, Tissues and clock |
480 dcfsnz WREG,F | 484 dcfsnz WREG,F |
481 bra customview_init_view5 ; GF informations | 485 bra customview_init_view5 ; GF informations |
482 dcfsnz WREG,F | 486 dcfsnz WREG,F |
483 bra customview_init_view6 ; Compass | 487 bra customview_init_view6 ; Compass |
484 dcfsnz WREG,F | 488 dcfsnz WREG,F |
485 bra customview_init_view7 ; Dynamic gaslist | 489 bra customview_init_view7 ; Dynamic gaslist |
486 dcfsnz WREG,F | 490 dcfsnz WREG,F |
487 bra customview_init_view8 ; HIJACKED for CNS (ex HUD voltages) | 491 bra customview_init_view8 ; CNS |
488 dcfsnz WREG,F | 492 dcfsnz WREG,F |
489 bra customview_init_view9 ; ppO2, Ceiling and current GF | 493 bra customview_init_view9 ; ppO2, Ceiling and current GF |
490 dcfsnz WREG,F | 494 dcfsnz WREG,F |
491 bra customview_init_view10 ; Sensor check | 495 bra customview_init_view10 ; Sensor check |
492 dcfsnz WREG,F | 496 dcfsnz WREG,F |
493 bra customview_init_view11 ; ppO2, END/EAD and CNS | 497 bra customview_init_view11 ; ppO2, END/EAD and CNS |
494 dcfsnz WREG,F | 498 dcfsnz WREG,F |
495 bra customview_init_view12 ; PSCR Info | 499 bra customview_init_view12 ; PSCR Info |
496 ; NEW ## bailout gas needs | 500 dcfsnz WREG,F |
497 dcfsnz WREG,F | 501 bra customview_init_view13 ; Gas needs |
498 bra customview_init_view13 ; Gas needs | 502 |
499 | |
500 customview_init_nocustomview: | 503 customview_init_nocustomview: |
501 call I2C_sleep_accelerometer ; Stop accelerometer | 504 call I2C_sleep_accelerometer ; Stop accelerometer |
502 call I2C_sleep_compass ; Stop compass | 505 call I2C_sleep_compass ; Stop compass |
503 bra customview_toggle_exit | 506 bra customview_toggle_exit |
504 | 507 |
505 customview_init_view1: | 508 customview_init_view1: |
506 btfsc FLAG_apnoe_mode ; In Apnoe mode? | 509 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
507 bra customview_toggle ; yes, Call next view... | 510 bra customview_toggle ; yes, Call next view... |
508 btfsc FLAG_pscr_mode ; In PSCR mode? | 511 btfsc FLAG_pscr_mode ; In PSCR mode? |
509 bra customview_init_view1a ; Yes | 512 bra customview_init_view1a ; Yes |
510 btfss FLAG_ccr_mode ; In CC mode? | 513 btfss FLAG_ccr_mode ; In CC mode? |
511 bra customview_toggle ; no, Call next view... | 514 bra customview_toggle ; no, Call next view... |
512 | 515 |
513 customview_init_view1a: | 516 customview_init_view1a: |
514 movf hardware_flag,W | 517 btfsc analog_o2_input ; do we have an analog input? |
515 sublw 0x11 ; 2 with BLE | 518 bra customview_init_view1b ; YES - show this view |
516 btfsc STATUS,Z | 519 btfss s8_digital ; NO - do we have a digital input? |
517 bra customview_toggle ; no, Call next view... | 520 bra customview_toggle ; NO - call next view... |
518 movf hardware_flag,W | 521 ; YES - show this view |
519 sublw 0x13 ; + | 522 customview_init_view1b: |
520 btfsc STATUS,Z | 523 call TFT_hud_mask ; Setup HUD mask |
521 bra customview_toggle ; no, Call next view... | 524 call TFT_update_ppo2_sensors ; Update Sensor data |
522 | 525 bra customview_toggle_exit |
523 call TFT_hud_mask ; Setup HUD mask | |
524 call TFT_update_ppo2_sensors ; Update Sensor data | |
525 bra customview_toggle_exit | |
526 | 526 |
527 customview_init_view2: | 527 customview_init_view2: |
528 btfsc FLAG_apnoe_mode ; In Apnoe mode? | 528 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
529 bra customview_toggle ; Yes, Call next view... | 529 bra customview_toggle ; Yes, Call next view... |
530 call TFT_mask_avr_stopwatch ; Show mask for average depth and stopwatch | 530 call TFT_mask_avr_stopwatch ; Show mask for average depth and stopwatch |
531 call TFT_update_avr_stopwatch ; Update average depth and stopwatch | 531 call TFT_update_avr_stopwatch ; Update average depth and stopwatch |
532 bra customview_toggle_exit | 532 bra customview_toggle_exit |
533 | 533 |
534 customview_init_view3: | 534 customview_init_view3: |
535 btfsc FLAG_apnoe_mode ; In Apnoe mode? | 535 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
536 bra customview_toggle ; Yes, Call next view... | 536 bra customview_toggle ; Yes, Call next view... |
537 btfsc FLAG_gauge_mode ; In Gauge mode? | 537 btfsc FLAG_gauge_mode ; In Gauge mode? |
538 bra customview_toggle ; Yes, Call next view... | 538 bra customview_toggle ; Yes, Call next view... |
539 call TFT_decoplan ; Show decoplan | 539 call TFT_decoplan ; Show decoplan |
540 bra customview_toggle_exit | 540 bra customview_toggle_exit |
541 | 541 |
542 customview_init_view4: | 542 customview_init_view4: |
543 call TFT_battinfo_tissues_clock_mask ; Setup Mask | 543 call TFT_battinfo_tissues_clock_mask ; Setup Mask |
544 call TFT_battinfo_tissues_clock ; Show Battery info, Tissues and clock | 544 call TFT_battinfo_tissues_clock ; Show Battery info, Tissues and clock |
545 bra customview_toggle_exit | 545 bra customview_toggle_exit |
546 | 546 |
547 customview_init_view5: | 547 customview_init_view5: |
548 btfsc FLAG_apnoe_mode ; In Apnoe mode? | 548 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
549 bra customview_toggle ; Yes, Call next view... | 549 bra customview_toggle ; Yes, Call next view... |
550 btfsc FLAG_gauge_mode ; In Gauge mode? | 550 btfsc FLAG_gauge_mode ; In Gauge mode? |
551 bra customview_toggle ; Yes, Call next view... | 551 bra customview_toggle ; Yes, Call next view... |
552 | 552 |
553 extern char_I_deco_model | 553 TSTOSS char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF |
554 TSTOSS char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF | 554 bra customview_toggle ; No GF info for non-GF modes |
555 bra customview_toggle ; No GF info for non-GF modes | 555 |
556 | 556 call TFT_gf_mask ; Setup Mask |
557 call TFT_gf_mask ; Setup Mask | 557 call TFT_gf_info ; Show GF informations |
558 call TFT_gf_info ; Show GF informations | 558 bra customview_toggle_exit |
559 bra customview_toggle_exit | 559 |
560 | 560 customview_init_view6: ; Compass (View 6) |
561 customview_init_view6: ; Compass (View 6) | 561 call I2C_init_accelerometer ; Start accelerometer |
562 call I2C_init_accelerometer ; Start accelerometer | 562 call I2C_init_compass ; Start compass |
563 call I2C_init_compass ; Start compass | 563 call TFT_dive_compass_mask ; Show compass |
564 extern TFT_dive_compass_mask | 564 bra customview_toggle_exit |
565 call TFT_dive_compass_mask ; Show compass | 565 |
566 bra customview_toggle_exit | 566 customview_init_view7: ; view disabled |
567 | 567 bra customview_toggle |
568 ; MODIFIED - view disabled ## memory | 568 |
569 customview_init_view7: ; Dynamic gaslist (View 7) | 569 customview_init_view8: ; CNS at end of dive |
570 ; btfsc FLAG_apnoe_mode ; In Apnoe mode? | 570 btfsc FLAG_gauge_mode ; In Gauge mode? |
571 bra customview_toggle ; Yes, Call next view... | 571 bra customview_toggle ; Yes, Call next view... |
572 ; btfsc FLAG_ccr_mode ; In CC mode? | 572 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
573 ; bra customview_toggle ; Yes, Call next view... | 573 bra customview_toggle ; yes, Call next view... |
574 ; call TFT_dyn_gaslist ; Show the dyn gaslist | |
575 ; bra customview_toggle_exit | |
576 | |
577 customview_init_view8: ; HIJACKED for CNS outputs (ex Sensor millivolts) | |
578 btfsc FLAG_gauge_mode ; In Gauge mode? | |
579 bra customview_toggle ; Yes, Call next view... | |
580 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
581 bra customview_toggle ; yes, Call next view... | |
582 ; REPLACE ## CNS at end-of-dive | |
583 ; btfsc FLAG_pscr_mode ; In PSCR mode? | |
584 ; bra customview_init_view8a ; Yes | |
585 ; btfss FLAG_ccr_mode ; In CC mode? | |
586 ; bra customview_toggle ; no, Call next view... | |
587 ; customview_init_view8a: | |
588 ; movf hardware_flag,W | |
589 ; sublw 0x13 ; + | |
590 ; btfsc STATUS,Z | |
591 ; bra customview_toggle ; no, Call next view... | |
592 ; movff opt_ccr_mode,WREG ; =0: Fixed SP, =1: Sensor, =2: Auto SP | |
593 ; sublw .1 ; opt_ccr_mode = 1 (Sensor)? | |
594 ; bnz customview_toggle ; no, Call next view... | |
595 ; call TFT_hud_mask ; Setup HUD mask | |
596 ; call TFT_hud_voltages ; Show HUD details | |
597 ; BY | |
598 call TFT_CNS_mask | 574 call TFT_CNS_mask |
599 call TFT_CNS | 575 call TFT_CNS |
600 | 576 goto customview_toggle_exit |
601 goto customview_toggle_exit | 577 |
602 | 578 customview_init_view9: ; ppO2, Ceiling and current GF |
603 customview_init_view9: ; ppO2, Ceiling and current GF | 579 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
604 btfsc FLAG_apnoe_mode ; In Apnoe mode? | 580 bra customview_toggle ; yes, Call next view... |
605 bra customview_toggle ; yes, Call next view... | 581 btfsc FLAG_gauge_mode ; In Gauge mode? |
606 btfsc FLAG_gauge_mode ; In Gauge mode? | 582 bra customview_toggle ; Yes, Call next view... |
607 bra customview_toggle ; Yes, Call next view... | 583 call TFT_ceiling_mask ; Setup mask |
608 call TFT_ceiling_mask ; Setup mask | 584 call TFT_ceiling ; Show Ceiling |
609 call TFT_ceiling ; Show Ceiling | 585 |
610 | 586 ; ppO2 value |
611 ; ppO2 value | 587 call TFT_mask_ppo2 |
612 call TFT_mask_ppo2 | 588 call TFT_display_pure_ppo2 |
613 call TFT_display_pure_ppo2 | 589 |
614 | 590 ; current GF value |
615 ; current GF value | 591 TSTOSS char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF |
616 extern char_I_deco_model | 592 bra customview_toggle_exit ; No GF info for non-GF modes |
617 TSTOSS char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF | 593 ; current GF value |
618 bra customview_toggle_exit ; No GF info for non-GF modes | 594 call TFT_gf_mask_cGF ; Setup Mask - current GF only |
619 ; current GF value | 595 call TFT_gf_info ; Show GF informations |
620 call TFT_gf_mask_cGF ; Setup Mask - current GF only | 596 bra customview_toggle_exit |
621 call TFT_gf_info ; Show GF informations | 597 |
622 bra customview_toggle_exit | 598 customview_init_view10: ; Sensor check |
623 | 599 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
624 customview_init_view10: ; Sensor check | 600 bra customview_toggle ; yes, Call next view... |
625 btfsc FLAG_apnoe_mode ; In Apnoe mode? | 601 btfsc FLAG_gauge_mode ; In Gauge mode? |
626 bra customview_toggle ; yes, Call next view... | 602 bra customview_toggle ; Yes, Call next view... |
627 btfsc FLAG_gauge_mode ; In Gauge mode? | 603 btfss FLAG_ccr_mode ; In CC mode? |
628 bra customview_toggle ; Yes, Call next view... | 604 bra customview_toggle ; no, Call next view... |
629 btfss FLAG_ccr_mode ; In CC mode? | 605 |
630 bra customview_toggle ; no, Call next view... | 606 call TFT_sensor_check_mask ; Show ppO2 of O2 and Diluent mask |
631 | 607 call TFT_sensor_check ; Show ppO2 of O2 and Diluent |
632 call TFT_sensor_check_mask ; Show ppO2 of O2 and Diluent mask | 608 bra customview_toggle_exit |
633 call TFT_sensor_check ; Show ppO2 of O2 and Diluent | 609 |
634 bra customview_toggle_exit | 610 customview_init_view11: ; ppO2, END/EAD and CNS |
635 | 611 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
636 customview_init_view11: ; ppO2, END/EAD and CNS | 612 bra customview_toggle ; yes, Call next view... |
637 btfsc FLAG_apnoe_mode ; In Apnoe mode? | 613 btfsc FLAG_gauge_mode ; In Gauge mode? |
638 bra customview_toggle ; yes, Call next view... | 614 bra customview_toggle ; Yes, Call next view... |
639 btfsc FLAG_gauge_mode ; In Gauge mode? | 615 |
640 bra customview_toggle ; Yes, Call next view... | 616 call TFT_ppo2_ead_end_cns_mask ; Show ppO2, END/EAD and CNS mask |
641 | 617 call TFT_ppo2_ead_end_cns ; Show ppO2, END/EAD and CNS |
642 call TFT_ppo2_ead_end_cns_mask ; Show ppO2, END/EAD and CNS mask | 618 goto customview_toggle_exit |
643 call TFT_ppo2_ead_end_cns ; Show ppO2, END/EAD and CNS | 619 |
644 goto customview_toggle_exit | 620 customview_init_view12: ; PSCR Info |
645 | 621 btfss FLAG_pscr_mode ; In PSCR mode? |
646 customview_init_view12: ; PSCR Info | 622 bra customview_toggle ; No, Call next view... |
647 btfss FLAG_pscr_mode ; In PSCR mode? | |
648 bra customview_toggle ; No, Call next view... | |
649 | |
650 call TFT_pscr_info_mask ; Show ppO2, drop and lung ratio | |
651 call TFT_pscr_info ; Show ppO2, drop and lung ratio | |
652 bra customview_toggle_exit | |
653 | |
654 ; NEW ## bailout gas needs | |
655 customview_init_view13: ; Gas Needs | |
656 TSTOSS opt_calc_asc_gasvolume ; check if gas volume calculations is switched on | |
657 bra customview_toggle ; NO - Call next view... | |
658 call TFT_gas_needs_mask ; YES - Show the mask for gas needs | |
659 call TFT_gas_needs ; Show the gas needs | |
660 bra customview_toggle_exit | |
661 | 623 |
624 call TFT_pscr_info_mask ; Show ppO2, drop and lung ratio | |
625 call TFT_pscr_info ; Show ppO2, drop and lung ratio | |
626 bra customview_toggle_exit | |
627 | |
628 customview_init_view13: ; Gas Needs | |
629 TSTOSS opt_calc_asc_gasvolume ; check if gas volume calculations is switched on | |
630 bra customview_toggle ; NO - Call next view... | |
631 call TFT_gas_needs_mask ; YES - Show the mask for gas needs | |
632 call TFT_gas_needs ; Show the gas needs | |
633 bra customview_toggle_exit | |
634 | |
662 customview_toggle_exit: | 635 customview_toggle_exit: |
663 btfsc divemode ; In Dive Mode? | 636 btfsc divemode ; In Dive Mode? |
664 bsf FLAG_TFT_temp_divemode ; Set flag to redraw temp | 637 bsf FLAG_TFT_temp_divemode ; Set flag to redraw temp |
665 call TFT_standard_color | 638 call TFT_standard_color |
666 bcf toggle_customview ; Clear flag | 639 bcf toggle_customview ; Clear flag |
667 return | 640 return |
668 | 641 |
669 global customview_show_change_depth | 642 global customview_show_change_depth |
670 customview_show_change_depth: ; Put " lom" or " loft" into Postinc2 | 643 customview_show_change_depth: ; Put " lom" or " loft" into Postinc2 |
671 PUTC " " | 644 PUTC " " |
672 TSTOSS opt_units ; 0=m, 1=ft | 645 TSTOSS opt_units ; 0=m, 1=ft |
673 bra customview_show_mix_metric | 646 bra customview_show_mix_metric |
674 movf lo,W | 647 movf lo,W |
675 mullw .100 ; convert meters to mbar | 648 mullw .100 ; convert meters to mbar |
676 movff PRODL,lo | 649 movff PRODL,lo |
677 movff PRODH,hi | 650 movff PRODH,hi |
678 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet | 651 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet |
679 bsf leftbind | 652 bsf leftbind |
680 output_16 ; Change depth in lo:hi | 653 output_16 ; Change depth in lo:hi |
681 bcf leftbind | 654 bcf leftbind |
682 STRCAT_TEXT tFeets | 655 STRCAT_TEXT tFeets |
683 return | 656 return |
684 customview_show_mix_metric: | 657 customview_show_mix_metric: |
685 output_99 ; Change depth in lo | 658 output_99 ; Change depth in lo |
686 STRCAT_TEXT tMeters | 659 STRCAT_TEXT tMeters |
687 return | 660 return |
688 | 661 |
689 | 662 |
690 global customview_show_mix | 663 global customview_show_mix |
691 customview_show_mix: ; Put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2 | 664 customview_show_mix: ; Put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2 |
692 tstfsz hi ; He=0? | 665 tstfsz hi ; He=0? |
693 bra customview_show_mix5 ; No, Show a TX | 666 bra customview_show_mix5 ; No, Show a TX |
694 movlw .21 | 667 movlw .21 |
695 cpfseq lo ; Air? | 668 cpfseq lo ; Air? |
696 bra customview_show_mix2 ; No | 669 bra customview_show_mix2 ; No |
697 STRCAT_TEXT tSelectAir ; Yes, show "Air" | 670 STRCAT_TEXT tSelectAir ; Yes, show "Air" |
698 bra customview_show_mix4b | 671 bra customview_show_mix4b |
699 customview_show_mix2: | 672 customview_show_mix2: |
700 movlw .100 | 673 movlw .100 |
701 cpfseq lo ; O2? | 674 cpfseq lo ; O2? |
702 bra customview_show_mix3 ; No | 675 bra customview_show_mix3 ; No |
703 STRCAT_TEXT tSelectO2 ; Yes, show "O2" | 676 STRCAT_TEXT tSelectO2 ; Yes, show "O2" |
704 bra customview_show_mix4b | 677 bra customview_show_mix4b |
705 | 678 |
706 customview_show_mix3: | 679 customview_show_mix3: |
707 movlw .21 | 680 movlw .21 |
708 cpfslt lo ; < Nx21? | 681 cpfslt lo ; < Nx21? |
709 bra customview_show_mix4 ; No | 682 bra customview_show_mix4 ; No |
710 STRCAT_TEXT tGasErr ; Yes, show "Err" | 683 STRCAT_TEXT tGasErr ; Yes, show "Err" |
711 output_99 ; O2 ratio is still in "lo" | 684 output_99 ; O2 ratio is still in "lo" |
712 bra customview_show_mix4c | 685 bra customview_show_mix4c |
713 | 686 |
714 customview_show_mix4: | 687 customview_show_mix4: |
715 STRCAT_TEXT tSelectNx ; Show "Nx" | 688 STRCAT_TEXT tSelectNx ; Show "Nx" |
716 output_99 ; O2 ratio is still in "lo" | 689 output_99 ; O2 ratio is still in "lo" |
717 customview_show_mix4b: | 690 customview_show_mix4b: |
718 STRCAT " " | 691 STRCAT " " |
719 customview_show_mix4c: | 692 customview_show_mix4c: |
720 btfsc divemode ; In divemode | 693 btfsc divemode ; In divemode |
721 return ; Yes | 694 return ; Yes |
722 STRCAT " " | 695 STRCAT " " |
723 return | 696 return |
724 | 697 |
725 customview_show_mix5: | 698 customview_show_mix5: |
726 btfsc divemode | 699 btfsc divemode |
727 bra customview_show_mix6 | 700 bra customview_show_mix6 |
728 STRCAT_TEXT tSelectTx ; Show "Tx" | 701 STRCAT_TEXT tSelectTx ; Show "Tx" |
729 customview_show_mix6: | 702 customview_show_mix6: |
730 output_99 ; O2 ratio is still in "lo" | 703 output_99 ; O2 ratio is still in "lo" |
731 PUTC "/" | 704 PUTC "/" |
732 movff hi,lo | 705 movff hi,lo |
733 output_99 ; He ratio | 706 output_99 ; He ratio |
734 return | 707 return |
735 | 708 |
736 END | 709 END |