annotate src/customview.asm @ 625:5c2ca77ce2df

doc update (Byte 59)
author heinrichsweikamp
date Sun, 23 Jun 2019 13:29:17 +0200
parents d866684249bd
children c40025d8e750 be8787f2034d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
3 ; File customview.asm REFACTORED VERSION V2.99e
0
heinrichsweikamp
parents:
diff changeset
4 ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
5 ; Custom Views in Surface and Dive Mode
0
heinrichsweikamp
parents:
diff changeset
6 ;
heinrichsweikamp
parents:
diff changeset
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
heinrichsweikamp
parents:
diff changeset
8 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
9 ; HISTORY
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
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
14 #include "hwos.inc" ; mandatory header
582
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
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
27 extern gaslist_strcat_gas_cd
582
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_surface_compass_mask
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
30 extern TFT_dive_compass_mask
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
31
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
32 custview CODE
0
heinrichsweikamp
parents:
diff changeset
33
heinrichsweikamp
parents:
diff changeset
34 ;=============================================================================
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
35 ; Jump table for the every-second tasks for the custom view area (dive mode)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
36 ;
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
37 ; Attention: the ordering must be in line with the init jump table and the
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
38 ; index numbers defined in hwos.inc!
0
heinrichsweikamp
parents:
diff changeset
39
heinrichsweikamp
parents:
diff changeset
40 global customview_second
heinrichsweikamp
parents:
diff changeset
41 customview_second:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
42 movf menupos3,W ; copy current view (1-...)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
43 dcfsnz WREG,F ; 1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
44 goto TFT_avr_stopwatch ; average depth and stopwatch
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
45 dcfsnz WREG,F ; 2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
46 return ; compass - will be updated separately (faster) in divemode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
47 dcfsnz WREG,F ; 3:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
48 goto TFT_ppo2_sensors ; ppO2 sensors
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
49 dcfsnz WREG,F ; 4:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
50 goto TFT_sensor_check ; sensor check
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
51 dcfsnz WREG,F ; 5;
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
52 goto TFT_pscr_info ; pSCR data
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
53 dcfsnz WREG,F ; 6:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
54 IFDEF _rx_functions
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
55 goto TFT_pressures_SAC ; tank pressure and SAC rate
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
56 ELSE
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
57 return ; not available without RX functions
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
58 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
59 dcfsnz WREG,F ; 7:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
60 goto TFT_gas_needs_ascent ; gas needs for ascent / cave return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
61 dcfsnz WREG,F ; 8:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
62 goto TFT_decoplan ; deco plan
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
63 dcfsnz WREG,F ; 9:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
64 goto TFT_ceiling_GF_tissue ; ceiling, current GF and tissues
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
65 dcfsnz WREG,F ; 10:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
66 goto TFT_CNS ; CNS values
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
67 dcfsnz WREG,F ; 11:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
68 goto TFT_ppo2_ead_end_cns ; ppO2, END/EAD and CNS
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
69 dcfsnz WREG,F ; 12:
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
70 return ; GF factors - only static data
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
71 dcfsnz WREG,F ; 13:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
72 goto TFT_clock_batt_surfpress ; clock, battery and surface pressure
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
73 return ; menupos3 = 0 -> do nothing
482
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 476
diff changeset
74
123
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 119
diff changeset
75
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
76 global customview_alternative_second
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
77 customview_alternative_second:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
78 movf menupos3,W ; copy current view (0-...)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 530
diff changeset
79 dcfsnz WREG,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
80 nop ; view 1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 530
diff changeset
81 dcfsnz WREG,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
82 nop ; view 2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
83 ;bra customview_alt_second_view0 ; default view
413
12e85930d95c NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents: 376
diff changeset
84
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
85 customview_alt_second_view0:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
86 bsf FLAG_TFT_big_deco_alt
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
87 return
0
heinrichsweikamp
parents:
diff changeset
88
heinrichsweikamp
parents:
diff changeset
89 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
90 ; Do every-minute tasks for the custom view area
heinrichsweikamp
parents:
diff changeset
91
heinrichsweikamp
parents:
diff changeset
92 global customview_minute
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
93 customview_minute: ; called from dive mode, call disabled at present
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
94 return
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
95 ; movf menupos3,W ; copy
0
heinrichsweikamp
parents:
diff changeset
96 ; dcfsnz WREG,F
heinrichsweikamp
parents:
diff changeset
97 ; bra customview_1min_view1
heinrichsweikamp
parents:
diff changeset
98 ; dcfsnz WREG,F
heinrichsweikamp
parents:
diff changeset
99 ; bra customview_1min_view2
heinrichsweikamp
parents:
diff changeset
100 ; dcfsnz WREG,F
heinrichsweikamp
parents:
diff changeset
101 ; bra customview_1min_view3
heinrichsweikamp
parents:
diff changeset
102 ; dcfsnz WREG,F
heinrichsweikamp
parents:
diff changeset
103 ; bra customview_1min_view4
heinrichsweikamp
parents:
diff changeset
104 ; dcfsnz WREG,F
heinrichsweikamp
parents:
diff changeset
105 ; bra customview_1min_view5
heinrichsweikamp
parents:
diff changeset
106 ; dcfsnz WREG,F
heinrichsweikamp
parents:
diff changeset
107 ; bra customview_1min_view6
heinrichsweikamp
parents:
diff changeset
108 ; dcfsnz WREG,F
heinrichsweikamp
parents:
diff changeset
109 ; bra customview_1min_view7
heinrichsweikamp
parents:
diff changeset
110 ; dcfsnz WREG,F
heinrichsweikamp
parents:
diff changeset
111 ; bra customview_1min_view8
heinrichsweikamp
parents:
diff changeset
112 ; dcfsnz WREG,F
heinrichsweikamp
parents:
diff changeset
113 ; bra customview_1min_view9
heinrichsweikamp
parents:
diff changeset
114 ; dcfsnz WREG,F
heinrichsweikamp
parents:
diff changeset
115 ; bra customview_1min_view10
heinrichsweikamp
parents:
diff changeset
116 ; dcfsnz WREG,F
heinrichsweikamp
parents:
diff changeset
117 ; bra customview_1min_view11
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
118 ; ; menupos3=0, do nothing
0
heinrichsweikamp
parents:
diff changeset
119 ; return
heinrichsweikamp
parents:
diff changeset
120 ;
heinrichsweikamp
parents:
diff changeset
121 ;customview_1min_view1:
heinrichsweikamp
parents:
diff changeset
122 ;customview_1min_view2:
heinrichsweikamp
parents:
diff changeset
123 ;customview_1min_view3:
heinrichsweikamp
parents:
diff changeset
124 ;customview_1min_view4:
heinrichsweikamp
parents:
diff changeset
125 ;customview_1min_view5:
heinrichsweikamp
parents:
diff changeset
126 ;customview_1min_view6:
heinrichsweikamp
parents:
diff changeset
127 ;customview_1min_view7:
heinrichsweikamp
parents:
diff changeset
128 ;customview_1min_view8:
heinrichsweikamp
parents:
diff changeset
129 ;customview_1min_view9:
heinrichsweikamp
parents:
diff changeset
130 ;customview_1min_view10:
heinrichsweikamp
parents:
diff changeset
131 ;customview_1min_view11:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
132 ;return
0
heinrichsweikamp
parents:
diff changeset
133
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
134 global surf_customview_toggle
0
heinrichsweikamp
parents:
diff changeset
135 surf_customview_toggle:
heinrichsweikamp
parents:
diff changeset
136 bcf switch_right
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
137 incf menupos3,F ; number of custom view to show
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
138
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
139 movlw .6 ; index of surface custom view compass
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
140 cpfseq menupos3 ; will compass be shown in custom view?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
141 call I2C_sleep_accelerometer ; NO - stop accelerometer
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
142 cpfseq menupos3 ; will compass be shown in custom view?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
143 call I2C_sleep_compass ; NO - stop compass
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
144
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
145 movlw d'10' ; max number of custom views in surface mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
146 cpfsgt menupos3 ; max reached?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
147 bra surf_customview_mask ; NO - show
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
148 movlw .1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
149 movwf menupos3 ; reset to one (always one custom view visible)
0
heinrichsweikamp
parents:
diff changeset
150
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
151 global surf_customview_mask
0
heinrichsweikamp
parents:
diff changeset
152 surf_customview_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
153 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
154 ; Prepare title
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
155 WIN_TINY surf_customview_title_column,surf_customview_title_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
156 WIN_COLOR color_greenish
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
157 movf menupos3,W ; menupos3 holds number of custom view function
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
158 dcfsnz WREG,F ; 1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
159 bra surf_customview_init_view1 ; OC gas list
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
160 dcfsnz WREG,F ; 2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
161 bra surf_customview_init_view2 ; CC dil list
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
162 dcfsnz WREG,F ; 3:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
163 bra surf_customview_init_view3 ; CC SP list
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
164 dcfsnz WREG,F ; 4:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
165 bra surf_customview_init_view4 ; custom text
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
166 dcfsnz WREG,F ; 5:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
167 bra surf_customview_init_view5 ; tissue diagram
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
168 dcfsnz WREG,F ; 6:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
169 bra surf_customview_init_view6 ; compass
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
170 dcfsnz WREG,F ; 7:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
171 bra surf_customview_init_view7 ; deco settings
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
172 dcfsnz WREG,F ; 8:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
173 bra surf_customview_init_view8 ; last dive info
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
174 dcfsnz WREG,F ; 9:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
175 bra surf_customview_init_view9 ; sensor mV readings
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
176 dcfsnz WREG,F ; 10:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
177 bra surf_customview_init_view10 ; tank data
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
178 bra surf_customview_init_view4 ; default view after restart and loading new firmware
0
heinrichsweikamp
parents:
diff changeset
179
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
180 surf_customview_init_view1: ; view 1: OC Gas list
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
181 btfsc FLAG_gauge_mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
182 bra surf_customview_toggle
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
183 btfsc FLAG_apnoe_mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
184 bra surf_customview_toggle
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
185 btfss FLAG_oc_mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
186 bra surf_customview_init_view1a ; bailout version of "OC Gas List"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
187 STRCPY_TEXT_PRINT tGaslist ; title of custom view / OC mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
188 bra surf_customview_init_view1b
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
189 surf_customview_init_view1a:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
190 STRCPY_TEXT_PRINT tDiveBailout ; title of custom view / CCR & pSCR mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
191 surf_customview_init_view1b: ; remaining common part
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
192 call TFT_standard_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
193 call TFT_gaslist_surfmode ; show gas list
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
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
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
196 surf_customview_init_view2: ; view 2: CCR / pSCR diluent list
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
197 btfsc FLAG_ccr_mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
198 bra surf_customview_init_view2a
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
199 btfsc FLAG_pscr_mode
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
200 bra surf_customview_init_view2a
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
201 bra surf_customview_toggle
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
202 surf_customview_init_view2a:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
203 STRCPY_TEXT_PRINT tGaslistCC ; title of custom view
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
204 call TFT_standard_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
205 call TFT_dillist_surfmode ; show diluent list
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
206 bra customview_toggle_exit ; done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
207
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
208 surf_customview_init_view3: ; view 3: CC SP list
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
209 btfsc FLAG_ccr_mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
210 bra surf_customview_init_view3a
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
211 bra surf_customview_toggle
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
212 surf_customview_init_view3a:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
213 STRCPY_TEXT_PRINT tFixedSetpoints ; title of custom view
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
214 call TFT_standard_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
215 call TFT_splist_surfmode ; show setpoint list
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
216 bra customview_toggle_exit ; done
0
heinrichsweikamp
parents:
diff changeset
217
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
218 surf_customview_init_view9: ; view 9: sensor mV at the surface
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
219 btfsc FLAG_ccr_mode
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
220 bra surf_customview_init_view9a ; we are in CCR mode
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
221 btfsc FLAG_pscr_mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
222 bra surf_customview_init_view9a ; we are in PSCR mode
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
223 bra surf_customview_toggle ; we are not in any rebreather mode, so skip
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
224 surf_customview_init_view9a:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
225 movff opt_ccr_mode,WREG ; =0: fixed SP, =1: Sensor, =2: auto SP
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
226 sublw .1 ; opt_ccr_mode = 1 (sensor)?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
227 bnz surf_customview_toggle ; sorry, no sensors, skip again
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
228 STRCPY_TEXT_PRINT tSensorMilliVolt ; title of custom view
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
229 call TFT_sensor_mV ; write sensor mV readings to screen
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
230 bra customview_toggle_exit ; done
0
heinrichsweikamp
parents:
diff changeset
231
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
232 surf_customview_init_view4: ; view 4: custom text
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
233 call TFT_custom_text ; show the custom text
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
234 bra customview_toggle_exit ; done
0
heinrichsweikamp
parents:
diff changeset
235
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
236 surf_customview_init_view5: ; view 5: tissue diagram
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
237 btfsc FLAG_gauge_mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
238 bra surf_customview_toggle
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
239 btfsc FLAG_apnoe_mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
240 bra surf_customview_toggle
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
241 call TFT_standard_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
242 call TFT_surface_tissues ; show tissue diagram
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
243 bra customview_toggle_exit ; done
0
heinrichsweikamp
parents:
diff changeset
244
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
245 surf_customview_init_view6: ; view 6: compass
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
246 call I2C_init_accelerometer ; start accelerometer
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
247 call I2C_init_compass ; start compass
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
248 call TFT_surface_compass_mask ; show compass mask
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
249 bra customview_toggle_exit ; done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
250
41
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 39
diff changeset
251 surf_customview_init_view7:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
252 btfsc FLAG_gauge_mode ; view 7: deco settings
582
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 btfsc FLAG_apnoe_mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
255 bra surf_customview_toggle
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
256 call TFT_surface_decosettings ; show all deco settings
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
257 bra customview_toggle_exit ; done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
258
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
259 surf_customview_init_view8: ; view 8: last dive info
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
260 call TFT_surface_lastdive ; show last dive interval
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
261 bra customview_toggle_exit ; done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
262
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
263 surf_customview_init_view10: ; transmitter data / debug
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
264 IFDEF _rx_functions
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
265 btfss FLAG_tr_enabled ; TR functions enabled?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
266 bra surf_customview_toggle ; NO - show next view in list
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
267 STRCAT_PRINT "ID bar Volt" ; title of custom view (none language-dependent)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
268 call TFT_surface_tankdata
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
269 bra customview_toggle_exit ; done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
270 ELSE
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
271 bra surf_customview_toggle
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
272 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
273
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
274
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
275 global switch_layout_to_normal
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
276 switch_layout_to_normal: ; switch back from alternative to normal layout
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
277 ; needs custom view to be selected / restored separately!
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
278 bcf alternative_divelayout ; clear flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
279 bsf FLAG_TFT_divemode_mask ; set flag for normal layout mask
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
280 bsf FLAG_TFT_max_depth ; set flag for normal layout data
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
281 btfss decostop_active ; deco?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
282 bsf FLAG_TFT_display_ndl_mask ; NO - set flag for normal layout NDL data
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
283 btfsc decostop_active ; deco?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
284 bsf FLAG_TFT_display_deko_mask ; YES - set flag for normal layout deco data
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
285 clrf menupos3 ; set to no active custom view
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
286 call TFT_ClearScreen ; clear the whole screen
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
287 return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
288
0
heinrichsweikamp
parents:
diff changeset
289
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
290 global menuview_toggle
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
291 menuview_toggle: ; show menu or the simulator tasks
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
292 bcf switch_left
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
293 btfss alternative_divelayout ; in alternative layout mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
294 bra menuview_toggle2 ; NO - continue with menu or simulator tasks
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
295 rcall switch_layout_to_normal ; YES - switch back to normal layout
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
296 movff customview_divemode,menupos3; - restore the custom view shown in normal layout
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
297 rcall customview_mask ; - re-draw the custom view
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
298 bra menuview_toggle_reset ; - suppress the menu when returning from alternative layout
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
299
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 530
diff changeset
300 menuview_toggle2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
301 movlw divemode_menuview_timeout
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
302 movwf timeout_counter2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
303 bsf menuview ; flag that the options menu is shown
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
304 incf menupos2,F ; number of option to show
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
305 movlw d'10' ; max number of options in divemode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
306 cpfsgt menupos2 ; max reached?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
307 bra menuview_mask ; NO - show option
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
308 global menuview_toggle_reset
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
309 menuview_toggle_reset: ; timeout occurred, beyond max number of options, or item executed
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
310 clrf menupos2 ; reset option selector
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
311 bcf menuview ; revoke options menu if shown
0
heinrichsweikamp
parents:
diff changeset
312 menuview_mask:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
313 WIN_BOX_BLACK dm_simtext_row, dm_simtext_row+.23, dm_simtext_column, dm_simtext_column+.46 ; top, bottom, left, right
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
314 btfss FLAG_gauge_mode ; in gauge mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
315 bra menuview_mask2 ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
316 ; YES - clear some more in gauge mode -- "Reset Avg." text is longer than all the other texts
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
317 WIN_BOX_BLACK dm_simtext_row, dm_simtext_row+.23, dm_simtext_column+.47, 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
318 menuview_mask2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
319 call TFT_draw_gassep_line
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
320 movlw color_yellow
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
321 call TFT_set_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
322 bsf win_invert ; set invert flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
323 WIN_SMALL dm_simtext_column,dm_simtext_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
324 movf menupos2,W ; menupos2 holds number of menu option to show
0
heinrichsweikamp
parents:
diff changeset
325 dcfsnz WREG,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
326 bra menuview_view_gaschange ; check if a better gas/diluent is advised and prompt for switching if yes
137
28b057aa9f75 Simplify gas change
heinrichsweikamp
parents: 136
diff changeset
327 dcfsnz WREG,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
328 bra menuview_view1 ; "Menu?" (skipped in gauge and apnoe modes)
254
5fe7aff622f3 preparations to set a course for the compass display
heinrichsweikamp
parents: 249
diff changeset
329 dcfsnz WREG,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
330 bra menuview_view2 ; "Quit?" (in simulation mode only)
0
heinrichsweikamp
parents:
diff changeset
331 dcfsnz WREG,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
332 bra menuview_view3 ; "Sim-1m" (in simulation mode only)
0
heinrichsweikamp
parents:
diff changeset
333 dcfsnz WREG,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
334 bra menuview_view4 ; "Sim+1m" (in simulation mode only)
0
heinrichsweikamp
parents:
diff changeset
335 dcfsnz WREG,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
336 bra menuview_view5 ; "Quit?" (in apnoe mode only)
0
heinrichsweikamp
parents:
diff changeset
337 dcfsnz WREG,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
338 bra menuview_view6 ; "Reset Avr." (in gauge mode only)
0
heinrichsweikamp
parents:
diff changeset
339 dcfsnz WREG,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
340 bra menuview_view7 ; "Sim+5'" (in simulation mode only)
216
973a0969e0ac NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents: 192
diff changeset
341 dcfsnz WREG,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
342 bra menuview_view8 ; "Heading" (only when compass is shown)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 530
diff changeset
343 dcfsnz WREG,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
344 bra menuview_view9 ; "Layout" (offer alternative layout, aka blind mode)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
345
0
heinrichsweikamp
parents:
diff changeset
346 menuview_exit:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
347 call TFT_standard_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
348 bcf win_invert ; reset invert flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
349 btfss alternative_divelayout ; in alternative layout?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
350 bsf FLAG_TFT_active_gas_divemode; NO - redraw gas and setpoint (eventually needed to restore the "Bailout" text)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
351 return ; menupos2 = 0, show nothing
137
28b057aa9f75 Simplify gas change
heinrichsweikamp
parents: 136
diff changeset
352
28b057aa9f75 Simplify gas change
heinrichsweikamp
parents: 136
diff changeset
353
28b057aa9f75 Simplify gas change
heinrichsweikamp
parents: 136
diff changeset
354 menuview_view_gaschange:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
355 btfsc divemode_gaschange ; last gas change done yet?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
356 bra menuview_toggle ; NO - call next option
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
357 btfsc FLAG_oc_mode ; in OC mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
358 bra menuview_view_gaschange_OC ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
359 btfsc FLAG_bailout_mode ; in bailout?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
360 bra menuview_view_gaschange_OC ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
361 menuview_view_gaschange_DIL:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
362 btfss better_dil_available ; is the better diluent still available?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
363 bra menuview_toggle ; NO - call next option
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
364 movff best_dil_number,PRODL ; number (1-5) of the "best diluent"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
365 bsf FLAG_diluent_setup ; flag to use diluents
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
366 bra menuview_view_gaschange_com
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
367 menuview_view_gaschange_OC:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
368 btfss better_gas_available ; is the better gas still available?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
369 bra menuview_toggle ; NO - call next option
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
370 movff best_gas_number,PRODL ; number (1-5) of the "best gas"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
371 bcf FLAG_diluent_setup ; flag to use oc gases
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
372 menuview_view_gaschange_com:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
373 decf PRODL,F ; (1-5) -> (0-4)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
374 bsf short_gas_decriptions ; =1: use short version of gaslist_strcat_gas_cd and gaslist_strcat_setpoint
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
375 bsf better_gas_hint ; color-code as best gas/diluent
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
376 call gaslist_strcat_gas_cd ; append gas description of gas #PRODL (0-4) to current string
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
377 movlw .5
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
378 movwf FSR2L ; point to 6th character (5 chars are used for the gas/dil description)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
379 STRCAT_PRINT "?"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
380 bra menuview_exit ; done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
381
0
heinrichsweikamp
parents:
diff changeset
382 menuview_view1:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
383 btfsc FLAG_apnoe_mode ; in Apnoe mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
384 bra menuview_toggle ; YES - goto next option
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
385 btfsc FLAG_gauge_mode ; in Gauge mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
386 bra menuview_toggle ; YES - goto next option
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
387 STRCPY_TEXT_PRINT tDivePreMenu ; print "Menu?"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
388 bra menuview_exit ; done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
389
0
heinrichsweikamp
parents:
diff changeset
390 menuview_view2:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
391 btfss simulatormode_active ; in simulator mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
392 bra menuview_toggle ; NO - goto next option
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
393 STRCPY_TEXT_PRINT tQuitSim ; print "Quit Simulation?"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
394 bra menuview_exit ; done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
395
0
heinrichsweikamp
parents:
diff changeset
396 menuview_view3:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
397 btfss simulatormode_active ; in simulator mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
398 bra menuview_toggle ; NO - goto next option
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
399 ; STRCPY_PRINT "Sim-1m" ; print "-" for going down
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
400 STRCPY_PRINT "Sim\xb8" ; print down arrow for going down
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
401 bra menuview_exit ; done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
402
0
heinrichsweikamp
parents:
diff changeset
403 menuview_view4:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
404 btfss simulatormode_active ; in simulator mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
405 bra menuview_toggle ; NO - goto next option
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
406 ; STRCPY_PRINT "Sim+1m" ; "+" for going up
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
407 STRCPY_PRINT "Sim\xb9" ; print up arrow for going up
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
408 bra menuview_exit ; done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
409
0
heinrichsweikamp
parents:
diff changeset
410 menuview_view5:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
411 btfss FLAG_apnoe_mode ; in Apnoe mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
412 bra menuview_toggle ; NO - goto next option
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
413 btfss FLAG_active_descent ; descending?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
414 bra menuview_toggle ; YES - goto next option
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
415 ; We are at the surface:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
416 STRCPY_TEXT_PRINT tQuitSim ; print "Quit Apnea mode?"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
417 bra menuview_exit ; done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
418
0
heinrichsweikamp
parents:
diff changeset
419 menuview_view6:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
420 btfss FLAG_gauge_mode ; in Gauge mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
421 bra menuview_toggle ; NO - goto next option
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
422 STRCPY_TEXT_PRINT tDivemenu_ResetAvg; print "Reset Avg."
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
423 bra menuview_exit ; done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
424
216
973a0969e0ac NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents: 192
diff changeset
425 menuview_view7:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
426 btfss simulatormode_active ; in simulator mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
427 bra menuview_toggle ; NO - goto next option
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
428 btfsc FLAG_gauge_mode ; in Gauge mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
429 bra menuview_toggle ; YES - goto next option
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
430 btfsc FLAG_apnoe_mode ; in Apnoe mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
431 bra menuview_toggle ; YES - goto next option
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
432 STRCPY_PRINT "Sim+5'" ; print "Sim+5'"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
433 bra menuview_exit ; done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
434
254
5fe7aff622f3 preparations to set a course for the compass display
heinrichsweikamp
parents: 249
diff changeset
435 menuview_view8:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
436 movlw index_compass_dm ; index of compass view
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
437 cpfseq menupos3 ; in compass view?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
438 bra menuview_toggle ; NO - goto next option
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
439 STRCPY_TEXT_PRINT tSetHeading ; print "Heading"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
440 bra menuview_exit ; done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
441
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 530
diff changeset
442 menuview_view9:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
443 btfsc FLAG_apnoe_mode ; in Apnoe mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
444 bra menuview_toggle ; YES - goto next option
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
445 STRCPY_PRINT "Layout"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
446 bra menuview_exit ; done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
447
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
448 ;=============================================================================
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
449
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
450 global customview_mask_alternative
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
451 customview_toggle_alternative:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
452 call I2C_sleep_accelerometer ; no compass in alternative layout - stop accelerometer
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
453 call I2C_sleep_compass ; no compass in alternative layout - stop compass
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
454 movlw d'0' ; max number of custom views in divemode, alternative layout
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
455 cpfsgt menupos3 ; max reached?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
456 bra customview_mask_alternative ; NO - show
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
457 clrf menupos3 ; reset to zero (zero = default custom view in alternative layout)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
458 customview_mask_alternative:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
459 ; Clear custom view area in divemode
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
460 WIN_BOX_BLACK dm_customview_row, .239, .0, .159 ; top, bottom, left, right
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
461 movf menupos3,W ; menupos3 holds number of custom view function
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
462 dcfsnz WREG,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
463 bra customview_alt_init_view1 ; view 1: -- for test only --
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
464 dcfsnz WREG,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
465 nop ; view 2: ...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
466 ;bra customview_alt_init_view0 ; default view: big deco/ndl and max. depth
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
467
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
468 customview_alt_init_view0: ; default view: big deco/ndl and max. depth
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
469 call TFT_max_depth_alternative
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
470 call TFT_big_deco_alt
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
471 bra customview_alt_toggle_exit
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
472
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
473 customview_alt_init_view1: ; view 1 - just for test use
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
474 call TFT_avr_stopwatch_mask ; mask for average depth and stopwatch
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
475 call TFT_avr_stopwatch ; data for average depth and stopwatch
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
476 bra customview_alt_toggle_exit
0
heinrichsweikamp
parents:
diff changeset
477
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
478 customview_alt_toggle_exit:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
479 bcf toggle_customview ; clear flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
480 return
0
heinrichsweikamp
parents:
diff changeset
481
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
482
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
483 ; Show next dive mode custom view (and delete this flag)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 530
diff changeset
484 global customview_toggle
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 530
diff changeset
485 customview_toggle:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
486 bcf switch_right
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
487 incf menupos3,F ; number of custom view to show
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
488
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
489 btfsc alternative_divelayout ; in alternative layout mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
490 bra customview_toggle_alternative ; YES - use the big ones instead
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
491
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
492 movlw index_compass_dm ; index of custom view compass
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
493 cpfseq menupos3 ; will compass be shown in custom view?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
494 call I2C_sleep_accelerometer ; NO - stop accelerometer
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
495 cpfseq menupos3 ; will compass be shown in custom view?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
496 call I2C_sleep_compass ; NO - stop compass
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 530
diff changeset
497
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
498 movlw index_cv_dm_max ; highest index in use in dive mode custom view
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
499 cpfsgt menupos3 ; max reached?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
500 bra customview_mask ; NO - show
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
501 clrf menupos3 ; reset to zero (zero = no custom view)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
502
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
503 ;----------------------------------------------------------------------------------
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
504 ; Jump table for initialization of the every-second tasks in custom view area (dive mode)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
505 ;
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
506 ; Attention: the ordering must be in line with the every-second update jump table
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
507 ; and the index numbers defined in hwos.inc!
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
508 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
509 global customview_mask
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
510 customview_mask:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
511 bcf redraw_custview_mask ; clear redraw request flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
512 ; Clear custom view area in divemode
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
513 WIN_BOX_BLACK dm_customview_row, dm_customview_bot-.2, dm_customview_column, dm_customview_rgt ; top, bottom, left, right
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
514 movf menupos3,W ; menupos3 holds number of custom view function
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
515 dcfsnz WREG,F ; 1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
516 bra init_avr_stopwatch ; average depth and stopwatch
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
517 dcfsnz WREG,F ; 2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
518 bra init_TFT_dive_compass ; compass
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
519 dcfsnz WREG,F ; 3:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
520 bra init_ppo2_sensors ; ppO2 sensors
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
521 dcfsnz WREG,F ; 4:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
522 bra init_sensor_check ; sensor check
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
523 dcfsnz WREG,F ; 5:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
524 bra init_pscr_info ; pSCR data
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
525 dcfsnz WREG,F ; 6:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
526 bra init_pressures_SAC ; tank pressure and SAC rate
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
527 dcfsnz WREG,F ; 7:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
528 bra init_gas_needs_ascent ; gas needs for ascent / cave return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
529 dcfsnz WREG,F ; 8:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
530 bra init_decoplan ; deco plan
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
531 dcfsnz WREG,F ; 9:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
532 bra init_ceiling_GF_tissue ; ceiling, current GF and tissues
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
533 dcfsnz WREG,F ; 10:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
534 bra init_CNS ; CNS values
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
535 dcfsnz WREG,F ; 11:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
536 bra init_ppo2_ead_end_cns ; ppO2, END/EAD and CNS
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
537 dcfsnz WREG,F ; 12:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
538 bra init_gf_factors ; GF factors
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
539 dcfsnz WREG,F ; 13:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
540 bra init_clock_batt_surfpress ; clock, battery and surface pressure
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
541 bra customview_toggle_exit ; no view (blank screen in custom view area)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
542
0
heinrichsweikamp
parents:
diff changeset
543
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
544 init_ppo2_sensors:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
545 btfsc FLAG_ccr_mode ; in CC mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
546 bra customview_init_view1a ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
547 btfsc FLAG_pscr_mode ; in PSCR mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
548 bra customview_init_view1a ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
549 bra customview_toggle ; NO to both, call next view
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
550 customview_init_view1a:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
551 btfsc analog_o2_input ; do we have an analog input?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
552 bra customview_init_view1b ; YES - show this view
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
553 btfsc s8_digital ; NO - do we have a digital input?
583
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
554 bra customview_init_view1b ; YES - show this view
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
555 btfss optical_input ; NO - do we have an optical input?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
556 bra customview_toggle ; NO - call next view
583
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
557 ; YES - show this view
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
558 customview_init_view1b:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
559 call TFT_ppo2_sensors_mask ; mask for ppO2 sensors
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
560 call TFT_ppo2_sensors ; data for ppO2 sensors
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
561 bra customview_toggle_exit
0
heinrichsweikamp
parents:
diff changeset
562
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
563 init_avr_stopwatch:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
564 btfsc FLAG_apnoe_mode ; in apnoe mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
565 bra customview_toggle ; YES - call next view
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
566 call TFT_avr_stopwatch_mask ; mask for average depth and stopwatch
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
567 call TFT_avr_stopwatch ; data for average depth and stopwatch
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
568 bra customview_toggle_exit
0
heinrichsweikamp
parents:
diff changeset
569
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
570 init_decoplan:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
571 btfsc FLAG_apnoe_mode ; in apnoe mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
572 bra customview_toggle ; YES - call next view
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
573 btfsc FLAG_gauge_mode ; in gauge mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
574 bra customview_toggle ; YES - call next view
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
575 call TFT_decoplan_mask ; mask for deco plan
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
576 call TFT_decoplan ; data for deco plan
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
577 bra customview_toggle_exit
0
heinrichsweikamp
parents:
diff changeset
578
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
579 init_clock_batt_surfpress:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
580 call TFT_clock_batt_surfpress_mask ; mask for clock, battery and surface pressure
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
581 call TFT_clock_batt_surfpress ; data for clock, battery and surface pressure
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
582 bra customview_toggle_exit
0
heinrichsweikamp
parents:
diff changeset
583
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
584 init_gf_factors:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
585 btfsc FLAG_apnoe_mode ; in apnoe mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
586 bra customview_toggle ; YES - call next view
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
587 btfsc FLAG_gauge_mode ; in gauge mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
588 bra customview_toggle ; YES - call next view
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
589 TSTOSS char_I_deco_model ; in GF mode (0 = ZH-L16, 1 = ZH-L16-GF)?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
590 bra customview_toggle ; NO - no GF info for non-GF modes
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
591 call TFT_gf_factors_mask ; mask for GF factors
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
592 bra customview_toggle_exit
0
heinrichsweikamp
parents:
diff changeset
593
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
594 init_TFT_dive_compass: ; compass
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
595 call I2C_init_accelerometer ; start accelerometer
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
596 call I2C_init_compass ; start compass
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
597 call TFT_dive_compass_mask ; show compass mask
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
598 bra customview_toggle_exit
53
2825f1d2262f NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents: 48
diff changeset
599
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
600 init_pressures_SAC: ; tank pressure and SAC rate
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
601 IFDEF _rx_functions
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
602 btfss FLAG_tr_enabled ; TR functions enabled?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
603 bra customview_toggle ; NO - call next view
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
604 call TFT_pressures_SAC_mask ; mask for pressures and SAC
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
605 call TFT_pressures_SAC ; data for pressures and SAC
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
606 bra customview_toggle_exit
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
607 ELSE
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
608 bra customview_toggle ; skip, not available without RX functions
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
609 ENDIF
102
37275e0fa7f5 NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents: 53
diff changeset
610
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
611 init_CNS: ; CNS at end of dive
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
612 btfsc FLAG_gauge_mode ; in Gauge mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
613 bra customview_toggle ; YES - call next view
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
614 btfsc FLAG_apnoe_mode ; in apnoe mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
615 bra customview_toggle ; YES - call next view
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
616 call TFT_CNS_mask ; mask for CNS values
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
617 call TFT_CNS ; data for CNS values
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
618 bra customview_toggle_exit
333
14b466f66a7f Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents: 327
diff changeset
619
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
620 init_ceiling_GF_tissue: ; ceiling, tissues and current GF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
621 btfsc FLAG_apnoe_mode ; in apnoe mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
622 bra customview_toggle ; YES - call next view
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
623 btfsc FLAG_gauge_mode ; in gauge mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
624 bra customview_toggle ; YES - call next view
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
625 call TFT_ceiling_GF_tissue_mask ; mask for ceiling, current GF and tissues
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
626 call TFT_ceiling_GF_tissue ; data for ceiling, current GF and tissues
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
627 bra customview_toggle_exit
525
00df86a5ac01 BUGFIX: Do not show GF in divemode for non-GF deco mode
heinrichsweikamp
parents: 517
diff changeset
628
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
629 init_sensor_check: ; sensor check
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
630 btfsc FLAG_ccr_mode ; in CCR mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
631 bra customview_init_view10a ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
632 ; btfsc FLAG_pscr_mode ; in pSCR mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
633 ; bra customview_init_view10a ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
634 bra customview_toggle ; NO to both, call next view
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
635 customview_init_view10a:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
636 call TFT_sensor_check_mask ; mask for sensor check
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
637 call TFT_sensor_check ; data for sensor check
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
638 bra customview_toggle_exit
123
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 119
diff changeset
639
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
640 init_ppo2_ead_end_cns: ; ppO2, END/EAD and CNS
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
641 btfsc FLAG_apnoe_mode ; in apnoe mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
642 bra customview_toggle ; YES - call next view
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
643 btfsc FLAG_gauge_mode ; in gauge mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
644 bra customview_toggle ; YES - call next view
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
645 call TFT_ppo2_ead_end_cns_mask ; mask for ppO2, END/EAD and CNS
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
646 call TFT_ppo2_ead_end_cns ; data for ppO2, END/EAD and CNS
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
647 bra customview_toggle_exit
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 530
diff changeset
648
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
649 init_pscr_info: ; pSCR information
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
650 btfss FLAG_pscr_mode ; in pSCR mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
651 bra customview_toggle ; NO - call next view
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
652 call TFT_pscr_info_mask ; mask for pSCR info
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
653 call TFT_pscr_info ; data for pSCR info
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
654 bra customview_toggle_exit
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
655
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
656 init_gas_needs_ascent: ; gas needs for ascent
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
657 btfsc FLAG_apnoe_mode ; in apnoe mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
658 bra customview_toggle ; YES - call next view
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
659 btfsc FLAG_gauge_mode ; in gauge mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
660 bra customview_toggle ; YES - call next view
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
661 TSTOSS opt_calc_asc_gasvolume ; check if gas volume calculation is switched on
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
662 bra customview_toggle ; NO - call next view
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
663 call TFT_gas_needs_ascent_mask ; mask for gas needs ascent
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
664 call TFT_gas_needs_ascent ; data for gas needs ascent
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
665 bra customview_toggle_exit
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
666
0
heinrichsweikamp
parents:
diff changeset
667 customview_toggle_exit:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
668 bcf toggle_customview ; clear flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
669 btfsc divemode ; in dive mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
670 bsf FLAG_TFT_temp_divemode ; YES - set flag to redraw temp
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
671 return
0
heinrichsweikamp
parents:
diff changeset
672
heinrichsweikamp
parents:
diff changeset
673
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
674 global customview_show_mix
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
675 customview_show_mix: ; put "Nxlo", "Txlo/hi", "Air" or "O2" into postinc2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
676 tstfsz hi ; He=0?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
677 bra customview_show_mix5 ; NO - show a TX
0
heinrichsweikamp
parents:
diff changeset
678 movlw .21
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
679 cpfseq lo ; Air?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
680 bra customview_show_mix2 ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
681 STRCAT_TEXT tSelectAir ; YES - show "Air"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
682 bra customview_show_mix4b
0
heinrichsweikamp
parents:
diff changeset
683 customview_show_mix2:
heinrichsweikamp
parents:
diff changeset
684 movlw .100
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
685 cpfseq lo ; O2?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
686 bra customview_show_mix3 ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
687 STRCAT_TEXT tSelectO2 ; YES - show "O2"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
688 bra customview_show_mix4b
0
heinrichsweikamp
parents:
diff changeset
689 customview_show_mix3:
heinrichsweikamp
parents:
diff changeset
690 movlw .21
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
691 cpfslt lo ; < Nx21?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
692 bra customview_show_mix4 ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
693 STRCAT_TEXT tGasErr ; YES - show "Err"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
694 output_99 ; O2 ratio is still in "lo"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
695 bra customview_show_mix4c
0
heinrichsweikamp
parents:
diff changeset
696 customview_show_mix4:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
697 STRCAT_TEXT tSelectNx ; show "Nx"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
698 output_99 ; O2 ratio is still in "lo"
0
heinrichsweikamp
parents:
diff changeset
699 customview_show_mix4b:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
700 STRCAT " "
0
heinrichsweikamp
parents:
diff changeset
701 customview_show_mix4c:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
702 btfsc divemode ; in divemode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
703 return ; YES
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
704 STRCAT " "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
705 return
0
heinrichsweikamp
parents:
diff changeset
706 customview_show_mix5:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
707 btfsc divemode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
708 bra customview_show_mix6
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
709 STRCAT_TEXT tSelectTx ; show "Tx"
0
heinrichsweikamp
parents:
diff changeset
710 customview_show_mix6:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
711 output_99 ; O2 ratio is still in "lo"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
712 PUTC "/"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
713 movff hi,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
714 output_99 ; He ratio
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 576
diff changeset
715 return
0
heinrichsweikamp
parents:
diff changeset
716
heinrichsweikamp
parents:
diff changeset
717 END