annotate src/customview.asm @ 503:4542d03f748a

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