annotate src/customview.asm @ 592:05053910d668

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