Mercurial > public > mk2
annotate code_part1/OSTC_code_asm_part1/customview.asm @ 606:4f43aee67da0
2.27beta start
author | heinrichsweikamp |
---|---|
date | Thu, 05 Jul 2012 11:25:32 +0200 |
parents | cda5b45b953f |
children | bab5a9fc1b10 |
rev | line source |
---|---|
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
1 ; OSTC - diving computer code |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
2 ; Copyright (C) 2008 HeinrichsWeikamp GbR |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
3 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
4 ; This program is free software: you can redistribute it and/or modify |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
5 ; it under the terms of the GNU General Public License as published by |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
6 ; the Free Software Foundation, either version 3 of the License, or |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
7 ; (at your option) any later version. |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
8 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
9 ; This program is distributed in the hope that it will be useful, |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
10 ; but WITHOUT ANY WARRANTY; without even the implied warranty of |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
11 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
12 ; GNU General Public License for more details. |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
13 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
14 ; You should have received a copy of the GNU General Public License |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
15 ; along with this program. If not, see <http://www.gnu.org/licenses/>. |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
16 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
17 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
18 ; Customviews for divemode |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
19 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com |
128 | 20 ; history: |
478
fd8266b511cc
New SAC (CF56/CF57) in 5..50 l/min range (no more decimal).
JeanDo
parents:
476
diff
changeset
|
21 ; 2010-12-12: [MH] First updated |
128 | 22 ; 2011-01-04: [jDG] Saturation graphs in customview divemode |
478
fd8266b511cc
New SAC (CF56/CF57) in 5..50 l/min range (no more decimal).
JeanDo
parents:
476
diff
changeset
|
23 ; 2011-10-10: [jDG] Added Cave live gas counter |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
24 ; known bugs: |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
25 ; ToDo: |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
26 |
128 | 27 ;============================================================================= |
28 ; Show the customview-dependent entry for the divemode menu | |
29 ; | |
479
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
30 customview_menu_entry3: |
128 | 31 movff menupos3,WREG ; copy |
32 dcfsnz WREG,F | |
33 bra customview_menu3_stopwatch ; Show the stopwatch option in divemode menu | |
34 dcfsnz WREG,F | |
35 bra customview_menu3_marker ; Show the marker option in divemode menu | |
36 dcfsnz WREG,F | |
479
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
37 bra customview_menu3_clock ; Show nothing |
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
38 dcfsnz WREG,F |
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
39 bra customview_menu3_lead_tiss ; Show nothing |
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
40 dcfsnz WREG,F |
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
41 bra customview_menu3_average ; Show nothing |
128 | 42 dcfsnz WREG,F |
479
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
43 bra customview_menu3_graphs ; Show nothing |
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
44 dcfsnz WREG,F |
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
45 bra customview_menu3_ead_end ; Show nothing |
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
46 dcfsnz WREG,F |
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
47 bra customview_menu3_@5 ; Show nothing |
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
48 dcfsnz WREG,F |
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
49 bra customview_menu3_cave_bailout; Show reset option |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
50 return |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
51 |
479
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
52 customview_menu3_cave_bailout: |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
53 customview_menu3_stopwatch: |
128 | 54 DISPLAYTEXT .33 ; ResetAvr |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
55 return |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
56 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
57 customview_menu3_marker: |
128 | 58 DISPLAYTEXT .30 ; Set Marker |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
59 return |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
60 |
128 | 61 customview_menu3_clock: ; No menu entry |
479
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
62 customview_menu3_lead_tiss: |
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
63 customview_menu3_average: |
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
64 customview_menu3_graphs: |
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
65 customview_menu3_ead_end: |
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
66 customview_menu3_@5: |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
67 return |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
68 |
128 | 69 ;============================================================================= |
70 ; Do every-second tasks for the custom view area | |
71 | |
72 customview_second: | |
73 movff menupos3,WREG ; copy | |
74 dcfsnz WREG,F | |
75 bra customview_1sec_stopwatch ; Update the Stopwatch | |
76 dcfsnz WREG,F | |
77 bra customview_1sec_marker ; Update the Marker | |
78 dcfsnz WREG,F | |
79 bra customview_1sec_clock ; Update the Clock | |
80 dcfsnz WREG,F | |
81 bra customview_1sec_lead_tiss ; Update the leading tissue | |
133 | 82 dcfsnz WREG,F |
131 | 83 bra customview_1sec_average ; Update the Average depth |
128 | 84 dcfsnz WREG,F |
85 bra customview_1sec_graphs ; Update the leading tissue | |
274
a728b4a1b660
Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
heinrichsweikamp
parents:
150
diff
changeset
|
86 dcfsnz WREG,F |
a728b4a1b660
Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
heinrichsweikamp
parents:
150
diff
changeset
|
87 bra customview_1sec_ead_end ; Show END and EAD in divemode |
312
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
88 dcfsnz WREG,F |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
89 bra customview_1sec_@5 ; Show TTS for extra time. |
476 | 90 dcfsnz WREG,F |
91 bra customview_1sec_cave_bailout; Show Cave conso prediction. | |
552 | 92 dcfsnz WREG,F |
93 bra customview_1sec_pSCR_ppO2 ; Show/Update pSCR ppO2 | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
94 ; Menupos3=0, do nothing |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
95 return |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
123
diff
changeset
|
96 |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
123
diff
changeset
|
97 customview_1sec_average: |
312
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
98 goto PLED_total_average_show2 ; Update the figures only |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
99 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
100 customview_1sec_stopwatch: |
386
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
323
diff
changeset
|
101 btfsc gauge_mode ; In Gauge mode? |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
323
diff
changeset
|
102 bra customview_1sec_stopwatch_gauge; Yes |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
323
diff
changeset
|
103 |
295 | 104 bsf menu3_active ; Set Flag |
312
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
105 goto PLED_stopwatch_show2 ; Update figures only |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
106 |
386
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
323
diff
changeset
|
107 customview_1sec_stopwatch_gauge: |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
323
diff
changeset
|
108 bsf menu3_active ; Set Flag |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
323
diff
changeset
|
109 goto PLED_stopwatch_show_gauge ; Update figures + Description |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
323
diff
changeset
|
110 |
128 | 111 customview_1sec_marker: ; Do nothing extra |
295 | 112 bsf menu3_active ; Set Flag |
128 | 113 customview_1sec_clock: ; Do nothing extra |
114 customview_1sec_lead_tiss: ; Do nothing extra | |
133 | 115 return |
116 | |
128 | 117 customview_1sec_graphs: ; Do nothing extra |
150 | 118 decfsz apnoe_mins ; 10 sec passed ? |
119 return ; No: skip. | |
120 movlw .10 ; Yes: reset counter. | |
121 movwf apnoe_mins | |
122 | |
123 call deco_calc_desaturation_time ; calculate desaturation time | |
124 movlb b'00000001' ; select ram bank 1 | |
312
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
125 goto PLED_tissue_saturation_graph |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
126 |
274
a728b4a1b660
Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
heinrichsweikamp
parents:
150
diff
changeset
|
127 customview_1sec_ead_end: |
312
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
128 goto PLED_show_end_ead_divemode |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
129 |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
130 customview_1sec_@5: |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
131 goto PLED_show_@5 |
274
a728b4a1b660
Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
heinrichsweikamp
parents:
150
diff
changeset
|
132 |
476 | 133 customview_1sec_cave_bailout: |
479
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
134 bsf menu3_active ; Set Flag |
476 | 135 goto PLED_show_cave_bailout |
136 | |
552 | 137 customview_1sec_pSCR_ppO2: |
138 goto PLED_show_pSCR_ppO2 ; Yes, compute and show value | |
139 | |
140 | |
128 | 141 ;============================================================================= |
142 ; Do every-minute tasks for the custom view area | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
143 |
128 | 144 customview_minute: |
145 movff menupos3,WREG ; copy | |
146 dcfsnz WREG,F | |
147 bra customview_minute_stopwatch ; Update the Stopwatch | |
148 dcfsnz WREG,F | |
149 bra customview_minute_marker ; Update the Marker | |
150 dcfsnz WREG,F | |
151 bra customview_minute_clock ; Update the Clock | |
152 dcfsnz WREG,F | |
153 bra customview_minute_lead_tiss ; Update the leading tissue | |
133 | 154 dcfsnz WREG,F |
274
a728b4a1b660
Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
heinrichsweikamp
parents:
150
diff
changeset
|
155 bra customview_minute_average ; Update the Average depth |
128 | 156 dcfsnz WREG,F |
157 bra customview_minute_graphs ; Update the graphs | |
274
a728b4a1b660
Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
heinrichsweikamp
parents:
150
diff
changeset
|
158 dcfsnz WREG,F |
312
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
159 bra customview_minute_ead_end ; Show END and EAD in divemode |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
160 dcfsnz WREG,F |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
161 bra customview_minute_@5 ; Show TTS for extra time. |
476 | 162 dcfsnz WREG,F |
163 bra customview_minute_cave_bailout; Show Cave consomation prediction. | |
552 | 164 dcfsnz WREG,F |
165 bra customview_minute_pSCR_ppO2; Show pSCR ppO2 level | |
274
a728b4a1b660
Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
heinrichsweikamp
parents:
150
diff
changeset
|
166 |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
167 ; Menupos3=0, do nothing |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
168 return |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
169 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
170 customview_minute_clock: |
312
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
171 goto PLED_diveclock2 ; Update the clock |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
172 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
173 customview_minute_lead_tiss: |
312
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
174 goto PLED_show_leading_tissue_2 ; Update the leading tissue |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
175 |
476 | 176 customview_minute_cave_bailout: ; Do nothing extra |
312
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
177 customview_minute_@5: ; Do nothing extra |
274
a728b4a1b660
Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
heinrichsweikamp
parents:
150
diff
changeset
|
178 customview_minute_ead_end: ; Do nothing extra |
128 | 179 customview_minute_marker: ; Do nothing extra |
180 customview_minute_stopwatch: ; Do nothing extra | |
137 | 181 customview_minute_average: ; Do nothing extra |
274
a728b4a1b660
Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
heinrichsweikamp
parents:
150
diff
changeset
|
182 customview_minute_graphs: ; Do nothing extra |
552 | 183 customview_minute_pSCR_ppO2: ; Do nothing extra |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
184 return |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
185 |
128 | 186 ;============================================================================= |
312
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
187 ; Show next customview (and delete this flag) |
128 | 188 |
277
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
189 customview_toggle: |
479
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
190 bcf menu3_active ;=1: menu entry three in divemode menu is active |
119 | 191 ostc_debug 'X' ; Sends debug-information to screen if debugmode active |
137 | 192 |
193 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
194 bra customview_toggle_exit ; Yes, ignore custom view in divemode completely | |
195 | |
128 | 196 incf menupos3,F ; Number of customview to show |
552 | 197 movlw d'10' ; Max number |
128 | 198 cpfsgt menupos3 ; Max reached? |
199 bra customview_mask ; No, show | |
200 clrf menupos3 ; Reset to zero (Zero=no custom view) | |
312
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
201 |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
202 customview_mask: |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
203 call PLED_clear_customview_divemode |
476 | 204 bcf tts_extra_time ; By default, CLEAR computation of @5 request. |
205 | |
128 | 206 movff menupos3,WREG ; Menupos3 holds number of customview function |
207 dcfsnz WREG,F | |
476 | 208 bra customview_init_stopwatch ; 1: Show the Stopwatch |
128 | 209 dcfsnz WREG,F |
476 | 210 bra customview_init_marker ; 2: Show the Marker-Menu |
128 | 211 dcfsnz WREG,F |
476 | 212 bra customview_init_clock ; 3: Show the clock |
128 | 213 dcfsnz WREG,F |
476 | 214 bra customview_init_lead_tissue ; 4: Show the leading tissue |
133 | 215 dcfsnz WREG,F |
476 | 216 bra customview_init_average ; 5: Show Total average depth |
128 | 217 dcfsnz WREG,F |
476 | 218 bra customview_init_graphs ; 6: Show the graphs |
274
a728b4a1b660
Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
heinrichsweikamp
parents:
150
diff
changeset
|
219 dcfsnz WREG,F |
476 | 220 bra customview_init_ead_end ; 7: Show END and EAD in divemode |
312
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
221 dcfsnz WREG,F |
476 | 222 bra customview_init_@5 ; 8: Show TTS for extra time. |
223 dcfsnz WREG,F | |
224 bra customview_init_cave_bailout ; 9: Show Cave consomation prediction. | |
552 | 225 dcfsnz WREG,F |
226 bra customview_init_pSCR_ppo2 ; 10: Show ppO2 for pSCR users | |
128 | 227 |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
228 customview_init_nocustomview: |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
229 bra customview_toggle_exit |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
230 |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
123
diff
changeset
|
231 customview_init_average: |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
123
diff
changeset
|
232 call PLED_total_average_show ; Show Average with mask |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
123
diff
changeset
|
233 bra customview_toggle_exit |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
123
diff
changeset
|
234 |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
235 customview_init_stopwatch: |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
123
diff
changeset
|
236 GETCUSTOM8 d'51' ; Show Stopwatch? (=1 in WREG) |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
123
diff
changeset
|
237 decfsz WREG,F ; WREG=1? |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
123
diff
changeset
|
238 bra customview_toggle ; No, use next Customview |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
123
diff
changeset
|
239 |
386
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
323
diff
changeset
|
240 btfsc gauge_mode ; In Gauge mode? |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
323
diff
changeset
|
241 bra customview_init_stopwatch_gauge ; Yes |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
323
diff
changeset
|
242 |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
123
diff
changeset
|
243 call PLED_stopwatch_show ; Init Stopwatch display |
277
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
244 bsf menu3_active ; Set Flag |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
245 bra customview_toggle_exit |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
246 |
386
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
323
diff
changeset
|
247 customview_init_stopwatch_gauge: |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
323
diff
changeset
|
248 call PLED_stopwatch_show_gauge ; Init Stopwatch display |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
323
diff
changeset
|
249 bsf menu3_active ; Set Flag |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
323
diff
changeset
|
250 bra customview_toggle_exit |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
323
diff
changeset
|
251 |
128 | 252 customview_init_marker: ; Init Marker |
386
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
323
diff
changeset
|
253 btfsc gauge_mode ; In Gauge mode? |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
323
diff
changeset
|
254 call PLED_clear_divemode_menu; Yes, clear BIG stopwatch |
deced1cacff7
Added velocity in divemode, BIG stopwatch in Gauge mode
heinrichsweikamp
parents:
323
diff
changeset
|
255 |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
123
diff
changeset
|
256 GETCUSTOM8 d'50' ; Show Marker? (=1 in WREG) |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
123
diff
changeset
|
257 decfsz WREG,F ; WREG=1? |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
123
diff
changeset
|
258 bra customview_toggle ; No, use next Customview |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
123
diff
changeset
|
259 |
150 | 260 call PLED_standard_color |
261 DISPLAYTEXT d'151' ; Set Marker? | |
479
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
262 bsf menu3_active ; Set Flag |
150 | 263 bra customview_toggle_exit |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
264 |
107 | 265 customview_init_clock: ; Init Clock |
150 | 266 call PLED_diveclock |
267 bra customview_toggle_exit | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
268 |
107 | 269 customview_init_lead_tissue: ; Show leading tissue |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
123
diff
changeset
|
270 GETCUSTOM8 d'53' ; Show Lead Tissue? (=1 in WREG) |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
123
diff
changeset
|
271 decfsz WREG,F ; WREG=1? |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
123
diff
changeset
|
272 bra customview_toggle ; No, use next Customview |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
123
diff
changeset
|
273 |
137 | 274 btfsc no_deco_customviews ; no-deco-mode-flag = 1 |
275 bra customview_toggle ; Yes, use next Customview! | |
276 | |
150 | 277 call PLED_show_leading_tissue |
278 bra customview_toggle_exit | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
279 |
274
a728b4a1b660
Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
heinrichsweikamp
parents:
150
diff
changeset
|
280 customview_init_ead_end: |
312
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
281 btfsc no_deco_customviews ; no-deco-mode-flag = 1 |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
282 bra customview_toggle ; Yes, use next Customview! |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
283 |
274
a728b4a1b660
Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
heinrichsweikamp
parents:
150
diff
changeset
|
284 call PLED_show_end_ead_divemode |
a728b4a1b660
Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
heinrichsweikamp
parents:
150
diff
changeset
|
285 bra customview_toggle_exit |
a728b4a1b660
Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
heinrichsweikamp
parents:
150
diff
changeset
|
286 |
312
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
287 customview_init_@5: |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
288 GETCUSTOM8 d'58' ; Extra time to simulate |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
289 iorwf WREG,F ; Null ? |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
290 bz customview_toggle ; Yes: use next Customview ! |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
291 |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
292 btfsc no_deco_customviews ; no-deco-mode-flag = 1 |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
293 bra customview_toggle ; Yes, use next Customview! |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
294 |
323 | 295 setf WREG ; WAIT marker: display "---" |
312
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
296 movff WREG,int_O_extra_ascenttime+0 |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
297 movff WREG,int_O_extra_ascenttime+1 |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
298 |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
299 movlw 1 |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
300 movwf apnoe_mins ; Start compute after next cycle. |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
301 bsf tts_extra_time |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
302 call PLED_show_@5 ; Show (wait) |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
303 |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
304 bra customview_toggle_exit |
b7e4e74c0e17
New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents:
295
diff
changeset
|
305 |
476 | 306 customview_init_cave_bailout: |
307 GETCUSTOM15 d'59' ; Conso level warning set ? | |
308 movf lo,W | |
309 iorwf hi,W | |
310 bz customview_toggle ; No: jump to next Customview ! | |
311 | |
479
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
478
diff
changeset
|
312 bsf menu3_active ; Set Flag |
476 | 313 call PLED_show_cave_bailout |
314 bra customview_toggle_exit | |
315 | |
131 | 316 customview_init_graphs: ; Show tissue graph |
317 GETCUSTOM8 d'52' ; Show Tissue Graph? (=1 in WREG) | |
318 decfsz WREG,F ; WREG=1? | |
319 bra customview_toggle ; No, use next Customview | |
128 | 320 |
137 | 321 btfsc no_deco_customviews ; no-deco-mode-flag = 1 |
322 bra customview_toggle ; Yes, use next Customview! | |
323 | |
150 | 324 movlw .1 ; Draw next second. |
325 movwf apnoe_mins ; 10sec counter. | |
326 | |
327 call deco_calc_desaturation_time ; calculate desaturation time | |
328 movlb b'00000001' ; select ram bank 1 | |
329 call PLED_tissue_saturation_graph | |
330 | |
331 bra customview_toggle_exit | |
332 | |
552 | 333 customview_init_pSCR_ppo2: |
334 GETCUSTOM8 d'61' ; Show pSCR ppO2? | |
335 decfsz WREG,F ; WREG=1? | |
336 bra customview_toggle ; No, use next Customview | |
337 | |
338 call PLED_show_pSCR_ppO2 ; Yes, compute and show value | |
339 | |
340 bra customview_toggle_exit | |
341 | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
342 customview_toggle_exit: |
107 | 343 bcf toggle_customview ; Clear flag |
128 | 344 ostc_debug 'Y' ; Sends debug-information to screen in debugmode |
107 | 345 return |
346 | |
128 | 347 ;============================================================================= |
348 ; Yes, show next customview (and delete this flag) | |
107 | 349 |
128 | 350 surfcustomview_toggle: |
107 | 351 incf menupos3,F ; Number of customview to show |
111 | 352 movlw d'4' ; Max number |
353 cpfsgt menupos3 ; Max reached? | |
107 | 354 bra surfcustomview_mask ; No, show |
355 clrf menupos3 ; Reset to zero (Zero=no custom view) | |
356 surfcustomview_mask: | |
115 | 357 call PLED_clear_customview_surfmode |
128 | 358 movff menupos3,WREG ; Menupos3 holds number of customview function |
359 dcfsnz WREG,F | |
107 | 360 bra surfcustomview_init_graphs ; Show the tissue graphs |
128 | 361 dcfsnz WREG,F |
107 | 362 bra surfcustomview_init_gaslist ; Show pre-dive gaslist/setpoint list |
128 | 363 dcfsnz WREG,F |
133 | 364 bra surfcustomview_init_interval; Show the interval counter |
128 | 365 dcfsnz WREG,F |
111 | 366 bra surfcustomview_init_cfview ; Show the interval counter |
128 | 367 |
107 | 368 surfcustomview_init_nocustomview: |
369 bra surfcustomview_toggle_exit | |
370 | |
371 surfcustomview_init_graphs: | |
137 | 372 btfsc no_deco_customviews ; no-deco-mode-flag = 1 |
373 bra surfcustomview_toggle ; Yes, use next Customview! | |
374 | |
133 | 375 call PLED_tissue_saturation_graph; Draw the graphs |
107 | 376 bra surfcustomview_toggle_exit |
377 | |
378 surfcustomview_init_gaslist: | |
137 | 379 btfsc no_deco_customviews ; no-deco-mode-flag = 1 |
380 bra surfcustomview_toggle ; Yes, use next Customview! | |
381 | |
107 | 382 call PLED_pre_dive_screen ; Show the Gaslist/Setpoint list |
383 bra surfcustomview_toggle_exit | |
384 | |
111 | 385 surfcustomview_init_interval: |
123 | 386 call PLED_standard_color |
111 | 387 DISPLAYTEXT d'189' ; Surface |
388 DISPLAYTEXT d'240' ; Interval: | |
389 call PLED_interval ; Display the interval | |
390 bra surfcustomview_toggle_exit | |
391 | |
392 surfcustomview_init_cfview: | |
393 read_int_eeprom d'34' ; Get Decomode | |
394 incf EEDATA,W ; +1 -> WREG | |
395 movwf temp10 | |
396 dcfsnz temp10,F | |
397 call PLED_show_cf11_cf12_cf29 ; =0 (ZH-L16 OC) | |
398 dcfsnz temp10,F | |
399 bra surfcustomview_toggle_exit ; =1 (Gauge) | |
400 dcfsnz temp10,F | |
401 call PLED_show_cf11_cf12_cf29 ; =2 (ZH-L16 CC) | |
402 dcfsnz temp10,F | |
403 bra surfcustomview_toggle_exit ; =3 (Apnoe) | |
404 dcfsnz temp10,F | |
405 call PLED_show_cf32_cf33_cf29 ; =4 (L16-GF OC) | |
406 dcfsnz temp10,F | |
407 call PLED_show_cf32_cf33_cf29 ; =5 (L16-GF CC) | |
592
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
552
diff
changeset
|
408 dcfsnz temp10,F |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
552
diff
changeset
|
409 call PLED_show_cf32_cf33_cf62_cf63 ; =6 (pSCR-GF) |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
552
diff
changeset
|
410 |
111 | 411 bra surfcustomview_toggle_exit |
412 | |
107 | 413 surfcustomview_toggle_exit: |
414 bcf toggle_customview ; Clear flag | |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
123
diff
changeset
|
415 clrf timeout_counter2 ; Clear timeout |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
123
diff
changeset
|
416 return |
107 | 417 |
128 | 418 ;============================================================================= |
419 ; Do every-second tasks for the custom view area | |
107 | 420 |
128 | 421 surfcustomview_second: |
422 ; movff menupos3,WREG ; copy | |
423 ; dcfsnz WREG,F | |
424 ; bra surfcustomview_1sec_graphs ; Update the Graphs | |
425 ; dcfsnz WREG,F | |
426 ; bra surfcustomview_1sec_gaslist ; Update the Gaslist/SetPoint List | |
427 ; dcfsnz WREG,F | |
428 ; bra surfcustomview_1sec_interval ; Update the Interval display | |
429 ; dcfsnz WREG,F | |
430 ; bra surfcustomview_1sec_cfview ; Update the critical cf view | |
431 ; ; Menupos3=0, do nothing | |
432 ; return | |
433 ;surfcustomview_1sec_cfview: ; Do nothing extra | |
434 ;surfcustomview_1sec_graphs: ; Do nothing extra | |
137 | 435 ;surfcustomview_1sec_gaslist: ; Do nothing extra |
436 ;surfcustomview_1sec_interval: ; Do nothing extra | |
107 | 437 return |
438 | |
128 | 439 ;============================================================================= |
107 | 440 |
441 surfcustomview_minute: ; Do every-minute tasks for the custom view area | |
128 | 442 movff menupos3,WREG ; copy |
443 dcfsnz WREG,F | |
107 | 444 bra surfcustomview_minute_graphs ; Update the Graphs |
128 | 445 dcfsnz WREG,F |
107 | 446 bra surfcustomview_minute_gaslist ; Update the Gaslist/SetPoint List |
128 | 447 dcfsnz WREG,F |
111 | 448 bra surfcustomview_minute_interval ; Update the Interval display |
128 | 449 dcfsnz WREG,F |
137 | 450 bra surfcustomview_minute_cfview ; Update the critical cf view |
107 | 451 ; Menupos3=0, do nothing |
452 return | |
453 | |
454 surfcustomview_minute_graphs: | |
150 | 455 call deco_calc_desaturation_time ; calculate desaturation time |
456 movlb b'00000001' ; select ram bank 1 | |
457 call PLED_tissue_saturation_graph ; Draw/Update the graphs | |
107 | 458 return |
459 | |
111 | 460 surfcustomview_minute_interval: |
112 | 461 DISPLAYTEXT d'189' ; Surface |
462 DISPLAYTEXT d'240' ; Interval: | |
111 | 463 call PLED_interval ; Display the interval |
464 return | |
465 | |
107 | 466 surfcustomview_minute_gaslist: ; Do nothing extra |
111 | 467 surfcustomview_minute_cfview: ; Do nothing extra |
468 return |