Mercurial > public > hwos_code
annotate src/customview.asm @ 554:a5d2e6083b1d
initialize blinking flags properly, apply fixes from 2.92 into 2.27beta
author | heinrichsweikamp |
---|---|
date | Sun, 19 Nov 2017 20:04:16 +0100 |
parents | d36f9fca10ae |
children | b7eb98dbd800 |
rev | line source |
---|---|
0 | 1 ;============================================================================= |
2 ; | |
3 ; File customview.asm | |
4 ; | |
5 ; Customview in Surfacemode and Divemode | |
6 ; | |
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | |
8 ;============================================================================= | |
9 ; HISTORY | |
10 ; 2011-08-10 : [mH] moving from OSTC code | |
11 | |
12 ;============================================================================= | |
13 | |
275 | 14 #include "hwos.inc" ; Mandatory header |
0 | 15 #include "tft_outputs.inc" |
16 #include "strings.inc" | |
17 #include "tft.inc" | |
18 #include "isr.inc" | |
19 #include "wait.inc" | |
20 #include "surfmode.inc" | |
21 #include "convert.inc" | |
22 #include "divemode.inc" | |
23 #include "i2c.inc" | |
24 | |
25 gui CODE | |
26 | |
27 ;============================================================================= | |
28 ; Do every-second tasks for the custom view area (Dive mode) | |
29 | |
30 global customview_second | |
31 customview_second: | |
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
471
diff
changeset
|
32 movff menupos3,WREG ; copy current view (1-...) |
0 | 33 dcfsnz WREG,F |
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
471
diff
changeset
|
34 goto TFT_update_ppo2_sensors ; Update Sensor data ; and return |
0 | 35 dcfsnz WREG,F |
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
471
diff
changeset
|
36 goto TFT_update_avr_stopwatch ; Update average depth and stopwatch; and return |
0 | 37 dcfsnz WREG,F |
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
471
diff
changeset
|
38 goto TFT_decoplan ; Show decoplan ; and return |
0 | 39 dcfsnz WREG,F |
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
471
diff
changeset
|
40 goto TFT_battinfo_tissues_clock ; Update Battery, Tissues and clock ; and return |
0 | 41 dcfsnz WREG,F |
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
471
diff
changeset
|
42 goto TFT_gf_info ; Update GF informations ; and return |
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
43 dcfsnz WREG,F |
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
471
diff
changeset
|
44 return ; Compass updated seperately (Faster) in divemode; |
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
45 dcfsnz WREG,F |
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
471
diff
changeset
|
46 goto TFT_dyn_gaslist ; Update the gaslist ; and return |
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
47 dcfsnz WREG,F |
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
471
diff
changeset
|
48 goto TFT_hud_voltages ; Show HUD details ; and return |
123 | 49 dcfsnz WREG,F |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
50 bra customview_1sec_view9 ; Make sure to change value in "check_ppo2_display:" when moving around custom views |
413
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
51 dcfsnz WREG,F |
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
471
diff
changeset
|
52 goto TFT_sensor_check ; Show ppO2 of O2 and Diluent ; and return |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
53 dcfsnz WREG,F |
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
471
diff
changeset
|
54 goto TFT_ppo2_ead_end_cns ; Show ppO2, END/EAD and CNS; and return |
482
c0ee33f1f399
New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents:
476
diff
changeset
|
55 dcfsnz WREG,F |
c0ee33f1f399
New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents:
476
diff
changeset
|
56 goto TFT_pscr_info ; Show ppO2, drop and lung ratio; and return |
c0ee33f1f399
New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents:
476
diff
changeset
|
57 |
0 | 58 ; Menupos3=0, do nothing |
59 return | |
60 | |
123 | 61 customview_1sec_view9: ; Ceiling |
62 call TFT_ceiling ; Show Ceiling | |
333
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
63 ; ppO2 value |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
64 call TFT_display_ppo2_val |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
65 ; current GF value |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
66 extern char_I_deco_model |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
67 TSTOSS char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
68 return ; No GF info for non-GF modes |
428 | 69 goto TFT_gf_info ; Update GF informations ; and return |
123 | 70 |
413
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
71 |
0 | 72 |
73 ;============================================================================= | |
74 ; Do every-minute tasks for the custom view area | |
75 | |
76 global customview_minute | |
77 customview_minute: | |
78 return | |
79 ; movff menupos3,WREG ; copy | |
80 ; dcfsnz WREG,F | |
81 ; bra customview_1min_view1 | |
82 ; dcfsnz WREG,F | |
83 ; bra customview_1min_view2 | |
84 ; dcfsnz WREG,F | |
85 ; bra customview_1min_view3 | |
86 ; dcfsnz WREG,F | |
87 ; bra customview_1min_view4 | |
88 ; dcfsnz WREG,F | |
89 ; bra customview_1min_view5 | |
90 ; dcfsnz WREG,F | |
91 ; bra customview_1min_view6 | |
92 ; dcfsnz WREG,F | |
93 ; bra customview_1min_view7 | |
94 ; dcfsnz WREG,F | |
95 ; bra customview_1min_view8 | |
96 ; dcfsnz WREG,F | |
97 ; bra customview_1min_view9 | |
98 ; dcfsnz WREG,F | |
99 ; bra customview_1min_view10 | |
100 ; dcfsnz WREG,F | |
101 ; bra customview_1min_view11 | |
102 ; ; Menupos3=0, do nothing | |
103 ; return | |
104 ; | |
105 ;customview_1min_view1: | |
106 ;customview_1min_view2: | |
107 ;customview_1min_view3: | |
108 ;customview_1min_view4: | |
109 ;customview_1min_view5: | |
110 ;customview_1min_view6: | |
111 ;customview_1min_view7: | |
112 ;customview_1min_view8: | |
113 ;customview_1min_view9: | |
114 ;customview_1min_view10: | |
115 ;customview_1min_view11: | |
116 ; return | |
117 | |
118 global surf_customview_toggle | |
119 surf_customview_toggle: | |
120 bcf switch_right | |
121 incf menupos3,F ; Number of customview to show | |
530 | 122 movlw d'9' ; Max number of customsviews in surface mode |
0 | 123 cpfsgt menupos3 ; Max reached? |
124 bra surf_customview_mask ; No, show | |
125 movlw .1 | |
126 movwf menupos3 ; Reset to one (Always one custom view visible) | |
127 | |
128 global surf_customview_mask | |
129 surf_customview_mask: | |
48 | 130 WIN_BOX_BLACK .50,surf_warning1_row-1, .0, surf_decotype_column-.1 ; top, bottom, left, right |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
131 ; Prepare title |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
132 WIN_TINY surf_customview_title_column,surf_customview_title_row |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
133 WIN_COLOR color_greenish |
0 | 134 movff menupos3,WREG ; Menupos3 holds number of customview function |
135 dcfsnz WREG,F | |
136 bra surf_customview_init_view1 ; OC Gas list | |
137 dcfsnz WREG,F | |
138 bra surf_customview_init_view2 ; CC Dil list | |
139 dcfsnz WREG,F | |
140 bra surf_customview_init_view3 ; CC SP list | |
141 dcfsnz WREG,F | |
142 bra surf_customview_init_view4 ; Custom Text | |
143 dcfsnz WREG,F | |
144 bra surf_customview_init_view5 ; Tissue Diagram | |
503
4542d03f748a
NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents:
502
diff
changeset
|
145 dcfsnz WREG,F |
0 | 146 bra surf_customview_init_view6 ; Compass |
503
4542d03f748a
NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents:
502
diff
changeset
|
147 dcfsnz WREG,F |
41 | 148 bra surf_customview_init_view7 ; Deco settings |
503
4542d03f748a
NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents:
502
diff
changeset
|
149 dcfsnz WREG,F |
4542d03f748a
NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents:
502
diff
changeset
|
150 bra surf_customview_init_view8 ; Last Dive info |
530 | 151 dcfsnz WREG,F |
152 bra surf_customview_init_view9 ; Sensor mV readings | |
0 | 153 |
154 call I2C_sleep_accelerometer ; Stop accelerometer | |
155 call I2C_sleep_compass ; Stop compass | |
156 | |
157 movlw .1 | |
158 movwf menupos3 ; Reset to one (Always one custom view visible) | |
159 | |
160 surf_customview_init_view1: ; View1: OC Gas list | |
161 btfsc FLAG_gauge_mode | |
162 bra surf_customview_toggle | |
163 btfsc FLAG_apnoe_mode | |
164 bra surf_customview_toggle | |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
165 btfsc FLAG_ccr_mode |
502
0910c227018f
BUGFIX: PSCR mode showed bailout gaslist instead of diluent gaslist
heinrichsweikamp
parents:
485
diff
changeset
|
166 bra surf_customview_init_view1_bail ; Bailout version of "OC Gas List" |
0910c227018f
BUGFIX: PSCR mode showed bailout gaslist instead of diluent gaslist
heinrichsweikamp
parents:
485
diff
changeset
|
167 btfsc FLAG_pscr_mode |
0910c227018f
BUGFIX: PSCR mode showed bailout gaslist instead of diluent gaslist
heinrichsweikamp
parents:
485
diff
changeset
|
168 bra surf_customview_init_view1_bail ; Bailout version of "OC Gas List" |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
169 STRCPY_TEXT_PRINT tGaslist ; Title of customview |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
170 call TFT_standard_color |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
171 call TFT_gaslist_surfmode ; Show gas list |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
172 bra customview_toggle_exit ; Done. |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
173 |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
174 surf_customview_init_view1_bail: |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
175 STRCPY_TEXT_PRINT tDiveBailout ; Title of customview |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
176 call TFT_standard_color |
0 | 177 call TFT_gaslist_surfmode ; Show gas list |
178 bra customview_toggle_exit ; Done. | |
179 | |
180 surf_customview_init_view2: ; View2: CC Dil list | |
502
0910c227018f
BUGFIX: PSCR mode showed bailout gaslist instead of diluent gaslist
heinrichsweikamp
parents:
485
diff
changeset
|
181 btfsc FLAG_pscr_mode |
0910c227018f
BUGFIX: PSCR mode showed bailout gaslist instead of diluent gaslist
heinrichsweikamp
parents:
485
diff
changeset
|
182 bra surf_customview_init_view2_2 |
0 | 183 btfss FLAG_ccr_mode |
184 bra surf_customview_toggle | |
185 btfsc FLAG_gauge_mode | |
186 bra surf_customview_toggle | |
187 btfsc FLAG_apnoe_mode | |
188 bra surf_customview_toggle | |
502
0910c227018f
BUGFIX: PSCR mode showed bailout gaslist instead of diluent gaslist
heinrichsweikamp
parents:
485
diff
changeset
|
189 surf_customview_init_view2_2: |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
190 STRCPY_TEXT_PRINT tGaslistCC ; Title of customview |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
191 call TFT_standard_color |
0 | 192 call TFT_dillist_surfmode ; Show diluent list |
193 bra customview_toggle_exit ; Done. | |
194 | |
195 surf_customview_init_view3: ; View3: CC SP list | |
196 btfss FLAG_ccr_mode | |
197 bra surf_customview_toggle | |
198 btfsc FLAG_gauge_mode | |
199 bra surf_customview_toggle | |
200 btfsc FLAG_apnoe_mode | |
201 bra surf_customview_toggle | |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
202 STRCPY_TEXT_PRINT tFixedSetpoints ; Title of customview |
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
203 call TFT_standard_color |
0 | 204 call TFT_splist_surfmode ; Show Setpoint list |
205 bra customview_toggle_exit ; Done. | |
530 | 206 |
207 surf_customview_init_view9: ; View 9: Sensor mV on the surface | |
208 btfsc FLAG_ccr_mode | |
209 bra surf_customview_init_view9a ; we are in CCR mode | |
210 btfsc FLAG_pscr_mode | |
211 bra surf_customview_init_view9a ; we are in PSCR mode | |
212 bra surf_customview_toggle ; we are not in any rebreather mode, so skip | |
213 surf_customview_init_view9a: | |
214 movff opt_ccr_mode,WREG ; =0: Fixed SP, =1: Sensor, =2: Auto SP | |
215 sublw .1 ; opt_ccr_mode = 1 (Sensor)? | |
216 bnz surf_customview_toggle ; sorry, no sensors, skip again | |
217 STRCPY_TEXT_PRINT tSensorMilliVolt ; Title of customview | |
218 call TFT_standard_color | |
219 extern TFT_sensor_mV | |
220 call TFT_sensor_mV ; write sensor mV readings to screen | |
221 bra customview_toggle_exit ; Done. | |
0 | 222 |
223 surf_customview_init_view4: ; View4: Custom text | |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
224 call TFT_standard_color |
0 | 225 call TFT_custom_text ; Show the custom text |
226 bra customview_toggle_exit ; Done. | |
227 | |
228 surf_customview_init_view5: ; View5: Tissue Diagram | |
229 btfsc FLAG_gauge_mode | |
230 bra surf_customview_toggle | |
231 btfsc FLAG_apnoe_mode | |
232 bra surf_customview_toggle | |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
233 call TFT_standard_color |
0 | 234 call TFT_surface_tissues ; Show Tissue diagram |
235 bra customview_toggle_exit ; Done. | |
236 | |
237 surf_customview_init_view6: ; View6: Compass | |
238 call I2C_init_accelerometer ; Start accelerometer | |
239 call I2C_init_compass ; Start compass | |
256
5b4ef0b9090d
place compass display code into compass_ops.asm
heinrichsweikamp
parents:
254
diff
changeset
|
240 extern TFT_surface_compass_mask |
0 | 241 call TFT_surface_compass_mask ; Show compass |
242 bra customview_toggle_exit ; Done. | |
503
4542d03f748a
NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents:
502
diff
changeset
|
243 |
41 | 244 surf_customview_init_view7: |
503
4542d03f748a
NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents:
502
diff
changeset
|
245 btfsc FLAG_gauge_mode ; View7: Deco settings |
41 | 246 bra surf_customview_toggle |
247 btfsc FLAG_apnoe_mode | |
248 bra surf_customview_toggle | |
249 extern deco_setup_dive | |
250 call deco_setup_dive | |
251 call TFT_surface_decosettings ; Show all deco settings | |
252 bra customview_toggle_exit ; Done. | |
0 | 253 |
503
4542d03f748a
NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents:
502
diff
changeset
|
254 surf_customview_init_view8: ; View8: Last dive info |
4542d03f748a
NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents:
502
diff
changeset
|
255 call TFT_surface_lastdive ; Show last dive interval |
4542d03f748a
NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents:
502
diff
changeset
|
256 bra customview_toggle_exit ; Done. |
4542d03f748a
NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents:
502
diff
changeset
|
257 |
4542d03f748a
NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents:
502
diff
changeset
|
258 |
0 | 259 global menuview_toggle |
260 menuview_toggle: ; Show Menu or the simulator tasks | |
261 movlw divemode_menuview_timeout | |
262 movwf timeout_counter3 | |
263 bsf menuview | |
264 bcf switch_left | |
265 incf menupos2,F ; Number of options to show | |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
266 movlw d'9' ; Max number of options in divemode |
0 | 267 cpfsgt menupos2 ; Max reached? |
268 bra menuview_mask ; No, show | |
269 global menuview_toggle_reset | |
270 menuview_toggle_reset: ; Timeout occured | |
271 clrf menupos2 | |
272 bcf menuview | |
273 menuview_mask: | |
300
5ad479f2a868
Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents:
275
diff
changeset
|
274 WIN_BOX_BLACK dm_simtext_row, dm_simtext_row+.23, dm_simtext_column, dm_simtext_column+.49 ; top, bottom, left, right |
0 | 275 btfss FLAG_gauge_mode |
276 bra menuview_mask2 | |
315
4f83470dcece
VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents:
300
diff
changeset
|
277 ; Clear some more in gauge mode -- "Reset Avg." text is longer than normal simtext |
300
5ad479f2a868
Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents:
275
diff
changeset
|
278 WIN_BOX_BLACK dm_simtext_row, dm_simtext_row+.23, dm_simtext_column+.50, dm_simtext_column+.70 ; top, bottom, left, right |
327
ca5df826437a
Small fix for the custom grid layout
janos_kovacs <kovjanos@gmail.com>
parents:
315
diff
changeset
|
279 menuview_mask2: |
315
4f83470dcece
VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents:
300
diff
changeset
|
280 call TFT_draw_gassep_line |
0 | 281 movlw color_yellow |
282 call TFT_set_color | |
189
e79bc535ef9e
ignore un-calibrated sensors even if they become valid
heinrichsweikamp
parents:
188
diff
changeset
|
283 bsf win_invert ; Set invert flag |
300
5ad479f2a868
Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents:
275
diff
changeset
|
284 WIN_SMALL dm_simtext_column,dm_simtext_row |
0 | 285 movff menupos2,WREG ; Menupos2 holds number of menu option to show |
286 dcfsnz WREG,F | |
137 | 287 bra menuview_view_gaschange ; If a better gas is indicated |
288 dcfsnz WREG,F | |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
289 bra menuview_view1 ; "Menu?" (Not in Gauge and Anpnoe) |
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
290 dcfsnz WREG,F |
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
291 bra menuview_view2 ; "Quit Simulation?" (Sim only) |
0 | 292 dcfsnz WREG,F |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
293 bra menuview_view3 ; "Descent 1m" (Sim only) |
0 | 294 dcfsnz WREG,F |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
295 bra menuview_view4 ; "Ascend 1m" (Sim only) |
0 | 296 dcfsnz WREG,F |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
297 bra menuview_view5 ; "Quit Apnea mode?" (Apnea only) |
0 | 298 dcfsnz WREG,F |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
299 bra menuview_view6 ; "Reset Avr." (Gauge only) |
0 | 300 dcfsnz WREG,F |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
301 bra menuview_view7 ; "Sim:+5mins" (Sim only) |
216
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
302 dcfsnz WREG,F |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
303 bra menuview_view8 ; "Heading" (When compass is shown) |
0 | 304 menuview_exit: |
305 call TFT_standard_color | |
189
e79bc535ef9e
ignore un-calibrated sensors even if they become valid
heinrichsweikamp
parents:
188
diff
changeset
|
306 bcf win_invert ; Reset invert flag |
0 | 307 return ; Menupos2 = 0, Show nothing |
137 | 308 |
309 | |
310 menuview_view_gaschange: | |
311 extern gaslist_strcat_gas_mod | |
312 btfss better_gas_available ; =1: A better gas is available | |
313 bra menuview_toggle ; No, call next option | |
138
2852b0bd6391
minor: some extra protection against wrong gas selection
heinrichsweikamp
parents:
137
diff
changeset
|
314 btfsc divemode_gaschange ; Skip if the last gas change is not done yet. |
2852b0bd6391
minor: some extra protection against wrong gas selection
heinrichsweikamp
parents:
137
diff
changeset
|
315 bra menuview_toggle |
137 | 316 bsf short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint |
317 movff better_gas_number,PRODL ; number (1-5) of the "better gas" in divemode, =0: no better gas available | |
318 decf PRODL,F | |
319 call gaslist_strcat_gas_mod ; Append gas description of gas #PRODL (0-4) to current string | |
320 movlw .5 | |
321 movwf FSR2L ; Point to char 6 (5 chars gas description only) | |
322 STRCAT_PRINT "?" | |
323 bra menuview_exit ; Done. | |
0 | 324 menuview_view1: |
325 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
326 bra menuview_toggle ; Call next option | |
327 btfsc FLAG_gauge_mode ; In Gauge mode? | |
328 bra menuview_toggle ; Call next option | |
329 STRCPY_TEXT_PRINT tDivePreMenu ; "Menu?" | |
330 bra menuview_exit ; Done. | |
331 menuview_view2: | |
332 btfss simulatormode_active ; View only for simulator mode | |
333 bra menuview_toggle ; Call next option | |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
334 STRCPY_TEXT_PRINT tQuitSim ; "Quit Simulation?" |
0 | 335 bra menuview_exit ; Done. |
336 menuview_view3: | |
337 btfss simulatormode_active ; View only for simulator mode | |
338 bra menuview_toggle ; Call next option | |
428 | 339 STRCPY_PRINT "Sim:-1m" |
0 | 340 bra menuview_exit ; Done. |
341 menuview_view4: | |
342 btfss simulatormode_active ; View only for simulator mode | |
343 bra menuview_toggle ; Call next option | |
428 | 344 STRCPY_PRINT "Sim:+1m" |
0 | 345 bra menuview_exit ; Done. |
346 menuview_view5: | |
347 btfss FLAG_apnoe_mode ; In Apnoe mode? | |
348 bra menuview_toggle ; No, call next option | |
184
faa06c58e977
BUGFIX: Quit Apnea mode on the surface manually
heinrichsweikamp
parents:
148
diff
changeset
|
349 btfss FLAG_active_descent ; Are we descending? |
0 | 350 bra menuview_toggle ; Yes |
351 ; We are at the surface: | |
148 | 352 STRCPY_TEXT_PRINT tQuitSim ; "Quit Apnea mode?" |
0 | 353 bra menuview_exit ; Done. |
354 menuview_view6: | |
355 btfss FLAG_gauge_mode ; In Gauge mode? | |
356 bra menuview_toggle ; No, call next option | |
437 | 357 STRCPY_TEXT_PRINT tDivemenu_ResetAvg ; "Reset Avg." |
0 | 358 bra menuview_exit ; Done. |
216
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
359 menuview_view7: |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
360 btfss simulatormode_active ; View only for simulator mode |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
361 bra menuview_toggle ; Call next option |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
362 btfsc FLAG_gauge_mode ; In Gauge mode? |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
363 bra menuview_toggle ; Yes, call next option |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
364 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
365 bra menuview_toggle ; Yes, call next option |
428 | 366 STRCPY_PRINT "Sim:+5'" |
216
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
367 bra menuview_exit ; Done. |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
368 menuview_view8: |
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
369 movlw .6 |
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
370 cpfseq menupos3 ; in compass view? |
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
371 bra menuview_toggle ; No, call next option |
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
372 STRCPY_TEXT_PRINT tSetHeading ; "Heading" |
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
373 bra menuview_exit ; Done. |
0 | 374 |
375 | |
376 ;============================================================================= | |
377 ; Show next customview (and delete this flag) | |
378 customview_toggle_reset: ; Timeout occured | |
379 clrf menupos3 ; Reset to zero (Zero=no custom view) | |
39
e4e91fe8b09d
remember last customview in dive and surface mode
mh@mh-THINK.fritz.box
parents:
0
diff
changeset
|
380 global customview_mask |
0 | 381 customview_mask: |
353
573f2251cf49
NEW: Quit Simulator automatically when starting a real dive
heinrichsweikamp
parents:
337
diff
changeset
|
382 ; Clear custom view area in divemode |
573f2251cf49
NEW: Quit Simulator automatically when starting a real dive
heinrichsweikamp
parents:
337
diff
changeset
|
383 WIN_BOX_BLACK dm_customview_row, dm_customview_bot, dm_customview_column, dm_customview_rgt ; top, bottom, left, right |
300
5ad479f2a868
Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents:
275
diff
changeset
|
384 WIN_SMALL dm_customview_column,dm_customview_row |
0 | 385 call TFT_standard_color |
386 movff menupos3,WREG ; Menupos3 holds number of customview function | |
387 dcfsnz WREG,F | |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
388 bra customview_init_view1 ; Update Sensor data |
0 | 389 dcfsnz WREG,F |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
390 bra customview_init_view2 ; average depth and stopwatch |
0 | 391 dcfsnz WREG,F |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
392 bra customview_init_view3 ; Decoplan |
0 | 393 dcfsnz WREG,F |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
394 bra customview_init_view4 ; Battery info, Tissues and clock |
0 | 395 dcfsnz WREG,F |
396 bra customview_init_view5 ; GF informations | |
397 dcfsnz WREG,F | |
398 bra customview_init_view6 ; Compass | |
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
399 dcfsnz WREG,F |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
400 bra customview_init_view7 ; Dynamic gaslist |
105 | 401 dcfsnz WREG,F |
402 bra customview_init_view8 ; HUD voltages | |
123 | 403 dcfsnz WREG,F |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
404 bra customview_init_view9 ; ppO2, Ceiling and current GF |
413
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
405 dcfsnz WREG,F |
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
406 bra customview_init_view10 ; Sensor check |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
407 dcfsnz WREG,F |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
408 bra customview_init_view11 ; ppO2, END/EAD and CNS |
482
c0ee33f1f399
New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents:
476
diff
changeset
|
409 dcfsnz WREG,F |
c0ee33f1f399
New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents:
476
diff
changeset
|
410 bra customview_init_view12 ; PSCR Info |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
411 |
0 | 412 customview_init_nocustomview: |
413 call I2C_sleep_accelerometer ; Stop accelerometer | |
414 call I2C_sleep_compass ; Stop compass | |
415 bra customview_toggle_exit | |
416 | |
417 customview_init_view1: | |
485 | 418 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
419 bra customview_toggle ; yes, Call next view... | |
420 btfsc FLAG_pscr_mode ; In PSCR mode? | |
421 bra customview_init_view1a ; Yes | |
422 btfss FLAG_ccr_mode ; In CC mode? | |
423 bra customview_toggle ; no, Call next view... | |
424 | |
425 customview_init_view1a: | |
249 | 426 movf hardware_flag,W |
427 sublw 0x11 ; 2 with BLE | |
428 btfsc STATUS,Z | |
429 bra customview_toggle ; no, Call next view... | |
476
7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
heinrichsweikamp
parents:
472
diff
changeset
|
430 movf hardware_flag,W |
7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
heinrichsweikamp
parents:
472
diff
changeset
|
431 sublw 0x13 ; + |
7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
heinrichsweikamp
parents:
472
diff
changeset
|
432 btfsc STATUS,Z |
7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
heinrichsweikamp
parents:
472
diff
changeset
|
433 bra customview_toggle ; no, Call next view... |
0 | 434 |
435 bsf dive_hud1_displayed ; Set display flag | |
436 bsf dive_hud2_displayed ; Set display flag | |
437 bsf dive_hud3_displayed ; Set display flag | |
438 call TFT_hud_mask ; Setup HUD mask | |
192 | 439 call TFT_update_ppo2_sensors ; Update Sensor data |
485 | 440 bra customview_toggle_exit |
0 | 441 |
442 customview_init_view2: | |
443 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
444 bra customview_toggle ; Yes, Call next view... | |
445 call TFT_mask_avr_stopwatch ; Show mask for average depth and stopwatch | |
446 call TFT_update_avr_stopwatch ; Update average depth and stopwatch | |
447 bra customview_toggle_exit | |
448 | |
449 customview_init_view3: | |
450 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
451 bra customview_toggle ; Yes, Call next view... | |
452 btfsc FLAG_gauge_mode ; In Gauge mode? | |
453 bra customview_toggle ; Yes, Call next view... | |
454 call TFT_decoplan ; Show decoplan | |
455 bra customview_toggle_exit | |
456 | |
457 customview_init_view4: | |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
458 call TFT_battinfo_tissues_clock_mask ; Setup Mask |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
459 call TFT_battinfo_tissues_clock ; Show Battery info, Tissues and clock |
0 | 460 bra customview_toggle_exit |
461 | |
462 customview_init_view5: | |
463 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
464 bra customview_toggle ; Yes, Call next view... | |
465 btfsc FLAG_gauge_mode ; In Gauge mode? | |
466 bra customview_toggle ; Yes, Call next view... | |
119 | 467 |
468 extern char_I_deco_model | |
469 TSTOSS char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF | |
470 bra customview_toggle ; No GF info for non-GF modes | |
471 | |
0 | 472 call TFT_gf_mask ; Setup Mask |
473 call TFT_gf_info ; Show GF informations | |
474 bra customview_toggle_exit | |
475 | |
476 customview_init_view6: ; Compass (View 6) | |
477 call I2C_init_accelerometer ; Start accelerometer | |
478 call I2C_init_compass ; Start compass | |
256
5b4ef0b9090d
place compass display code into compass_ops.asm
heinrichsweikamp
parents:
254
diff
changeset
|
479 extern TFT_dive_compass_mask |
0 | 480 call TFT_dive_compass_mask ; Show compass |
481 bra customview_toggle_exit | |
482 | |
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
483 customview_init_view7: ; Dynamic gaslist (View 7) |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
484 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
485 bra customview_toggle ; Yes, Call next view... |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
486 btfsc FLAG_ccr_mode ; In CC mode? |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
487 bra customview_toggle ; Yes, Call next view... |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
488 call TFT_dyn_gaslist ; Show the dyn gaslist |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
489 bra customview_toggle_exit |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
490 |
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
491 customview_init_view8: ; Sensor millivolts |
136 | 492 btfsc FLAG_gauge_mode ; In Gauge mode? |
493 bra customview_toggle ; Yes, Call next view... | |
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
494 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
495 bra customview_toggle ; yes, Call next view... |
485 | 496 btfsc FLAG_pscr_mode ; In PSCR mode? |
497 bra customview_init_view8a ; Yes | |
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
498 btfss FLAG_ccr_mode ; In CC mode? |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
499 bra customview_toggle ; no, Call next view... |
485 | 500 customview_init_view8a: |
476
7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
heinrichsweikamp
parents:
472
diff
changeset
|
501 movf hardware_flag,W |
7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
heinrichsweikamp
parents:
472
diff
changeset
|
502 sublw 0x13 ; + |
7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
heinrichsweikamp
parents:
472
diff
changeset
|
503 btfsc STATUS,Z |
7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
heinrichsweikamp
parents:
472
diff
changeset
|
504 bra customview_toggle ; no, Call next view... |
7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
heinrichsweikamp
parents:
472
diff
changeset
|
505 |
337
508d7fb98b34
cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents:
333
diff
changeset
|
506 movff opt_ccr_mode,WREG ; =0: Fixed SP, =1: Sensor, =2: Auto SP |
508d7fb98b34
cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents:
333
diff
changeset
|
507 sublw .1 ; opt_ccr_mode = 1 (Sensor)? |
508d7fb98b34
cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents:
333
diff
changeset
|
508 bnz customview_toggle ; no, Call next view... |
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
509 call TFT_hud_mask ; Setup HUD mask |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
510 call TFT_hud_voltages ; Show HUD details |
485 | 511 goto customview_toggle_exit |
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
512 |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
513 customview_init_view9: ; ppO2, Ceiling and current GF |
123 | 514 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
485 | 515 bra customview_toggle ; yes, Call next view... |
123 | 516 btfsc FLAG_gauge_mode ; In Gauge mode? |
485 | 517 bra customview_toggle ; Yes, Call next view... |
123 | 518 call TFT_ceiling_mask ; Setup mask |
519 call TFT_ceiling ; Show Ceiling | |
333
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
520 |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
521 ; ppO2 value |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
522 call TFT_mask_ppo2 |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
523 call TFT_display_ppo2_val |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
524 |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
525 ; current GF value |
525
00df86a5ac01
BUGFIX: Do not show GF in divemode for non-GF deco mode
heinrichsweikamp
parents:
517
diff
changeset
|
526 extern char_I_deco_model |
00df86a5ac01
BUGFIX: Do not show GF in divemode for non-GF deco mode
heinrichsweikamp
parents:
517
diff
changeset
|
527 TSTOSS char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF |
00df86a5ac01
BUGFIX: Do not show GF in divemode for non-GF deco mode
heinrichsweikamp
parents:
517
diff
changeset
|
528 bra customview_toggle_exit ; No GF info for non-GF modes |
00df86a5ac01
BUGFIX: Do not show GF in divemode for non-GF deco mode
heinrichsweikamp
parents:
517
diff
changeset
|
529 ; current GF value |
333
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
530 call TFT_gf_mask_cGF ; Setup Mask - current GF only |
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
531 call TFT_gf_info ; Show GF informations |
525
00df86a5ac01
BUGFIX: Do not show GF in divemode for non-GF deco mode
heinrichsweikamp
parents:
517
diff
changeset
|
532 bra customview_toggle_exit |
00df86a5ac01
BUGFIX: Do not show GF in divemode for non-GF deco mode
heinrichsweikamp
parents:
517
diff
changeset
|
533 |
123 | 534 |
485 | 535 ;============================================================================= |
536 ; Show next customview (and delete this flag) | |
537 global customview_toggle | |
538 customview_toggle: | |
539 bcf switch_right | |
540 incf menupos3,F ; Number of customview to show | |
541 movlw d'12' ; Max number of customsviews in divemode | |
542 cpfsgt menupos3 ; Max reached? | |
543 goto customview_mask ; No, show | |
544 goto customview_toggle_reset | |
545 | |
546 | |
413
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
547 customview_init_view10: ; Sensor check |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
548 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
549 bra customview_toggle ; yes, Call next view... |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
550 btfsc FLAG_gauge_mode ; In Gauge mode? |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
551 bra customview_toggle ; Yes, Call next view... |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
552 btfss FLAG_ccr_mode ; In CC mode? |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
553 bra customview_toggle ; no, Call next view... |
413
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
554 |
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
555 call TFT_sensor_check_mask ; Show ppO2 of O2 and Diluent mask |
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
556 call TFT_sensor_check ; Show ppO2 of O2 and Diluent |
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
557 bra customview_toggle_exit |
123 | 558 |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
559 customview_init_view11: ; ppO2, END/EAD and CNS |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
560 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
561 bra customview_toggle ; yes, Call next view... |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
562 btfsc FLAG_gauge_mode ; In Gauge mode? |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
563 bra customview_toggle ; Yes, Call next view... |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
564 |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
565 call TFT_ppo2_ead_end_cns_mask ; Show ppO2, END/EAD and CNS mask |
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
566 call TFT_ppo2_ead_end_cns ; Show ppO2, END/EAD and CNS |
485 | 567 goto customview_toggle_exit |
482
c0ee33f1f399
New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents:
476
diff
changeset
|
568 |
c0ee33f1f399
New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents:
476
diff
changeset
|
569 customview_init_view12: ; PSCR Info |
c0ee33f1f399
New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents:
476
diff
changeset
|
570 btfss FLAG_pscr_mode ; In PSCR mode? |
c0ee33f1f399
New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents:
476
diff
changeset
|
571 bra customview_toggle ; No, Call next view... |
c0ee33f1f399
New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents:
476
diff
changeset
|
572 |
c0ee33f1f399
New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents:
476
diff
changeset
|
573 call TFT_pscr_info_mask ; Show ppO2, drop and lung ratio |
c0ee33f1f399
New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents:
476
diff
changeset
|
574 call TFT_pscr_info ; Show ppO2, drop and lung ratio |
c0ee33f1f399
New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents:
476
diff
changeset
|
575 bra customview_toggle_exit |
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
576 |
0 | 577 customview_toggle_exit: |
530 | 578 btfsc divemode ; In Dive Mode? |
579 call TFT_temp_divemode ; Yes, redraw temperature | |
0 | 580 call TFT_standard_color |
581 bcf toggle_customview ; Clear flag | |
582 return | |
583 | |
584 global customview_show_change_depth | |
585 customview_show_change_depth: ; Put " lom" or " loft" into Postinc2 | |
586 PUTC " " | |
587 TSTOSS opt_units ; 0=m, 1=ft | |
588 bra customview_show_mix_metric | |
589 movf lo,W | |
590 mullw .100 ; convert meters to mbar | |
591 movff PRODL,lo | |
592 movff PRODH,hi | |
593 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet | |
594 bsf leftbind | |
595 output_16 ; Change depth in lo:hi | |
596 bcf leftbind | |
597 STRCAT_TEXT tFeets | |
598 return | |
599 customview_show_mix_metric: | |
600 output_99 ; Change depth in lo | |
601 STRCAT_TEXT tMeters | |
602 return | |
603 | |
604 | |
605 global customview_show_mix | |
606 customview_show_mix: ; Put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2 | |
607 tstfsz hi ; He=0? | |
608 bra customview_show_mix5 ; No, Show a TX | |
609 movlw .21 | |
610 cpfseq lo ; Air? | |
611 bra customview_show_mix2 ; No | |
612 STRCAT_TEXT tSelectAir ; Yes, show "Air" | |
613 bra customview_show_mix4b | |
614 customview_show_mix2: | |
615 movlw .100 | |
616 cpfseq lo ; O2? | |
617 bra customview_show_mix3 ; No | |
618 STRCAT_TEXT tSelectO2 ; Yes, show "O2" | |
619 bra customview_show_mix4b | |
620 | |
621 customview_show_mix3: | |
622 movlw .21 | |
623 cpfslt lo ; < Nx21? | |
624 bra customview_show_mix4 ; No | |
625 STRCAT_TEXT tGasErr ; Yes, show "Err" | |
626 output_99 ; O2 ratio is still in "lo" | |
627 bra customview_show_mix4c | |
628 | |
629 customview_show_mix4: | |
630 STRCAT_TEXT tSelectNx ; Show "Nx" | |
631 output_99 ; O2 ratio is still in "lo" | |
632 customview_show_mix4b: | |
633 STRCAT " " | |
634 customview_show_mix4c: | |
635 btfsc divemode ; In divemode | |
636 return ; Yes | |
637 STRCAT " " | |
638 return | |
639 | |
640 customview_show_mix5: | |
641 btfsc divemode | |
642 bra customview_show_mix6 | |
643 STRCAT_TEXT tSelectTx ; Show "Tx" | |
644 customview_show_mix6: | |
645 output_99 ; O2 ratio is still in "lo" | |
646 PUTC "/" | |
647 movff hi,lo | |
648 output_99 ; He ratio | |
649 return | |
650 | |
651 END |