Mercurial > public > mk2
annotate code_part1/OSTC_code_asm_part1/customview.asm @ 128:4c588c3d1f12
Saturation graphs in customview divemode
author | JeanDo |
---|---|
date | Tue, 04 Jan 2011 15:14:42 +0100 |
parents | 6a94f96e9cea |
children | 03df42de03e1 |
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 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
20 ; written: 101212 |
128 | 21 ; history: |
22 ; 2010-12-12: [MH] last updated | |
23 ; 2011-01-04: [jDG] Saturation graphs in customview divemode | |
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 ; | |
30 customview_menu_entry3: | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
31 bcf menu3_active ;=1: menu entry three in divemode menu is active |
128 | 32 |
33 movff menupos3,WREG ; copy | |
34 dcfsnz WREG,F | |
35 bra customview_menu3_stopwatch ; Show the stopwatch option in divemode menu | |
36 dcfsnz WREG,F | |
37 bra customview_menu3_marker ; Show the marker option in divemode menu | |
38 dcfsnz WREG,F | |
39 bra customview_menu3_clock ; Show the clock option in divemode menu | |
40 dcfsnz WREG,F | |
41 bra customview_menu3_lead_tiss ; Show the leading tissue option in divemode menu | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
42 ; Menupos3=0, do nothing |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
43 return |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
44 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
45 customview_menu3_stopwatch: |
128 | 46 bsf menu3_active ; Set Flag |
47 DISPLAYTEXT .33 ; ResetAvr | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
48 return |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
49 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
50 customview_menu3_marker: |
128 | 51 bsf menu3_active ; Set Flag |
52 DISPLAYTEXT .30 ; Set Marker | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
53 return |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
54 |
128 | 55 customview_menu3_clock: ; No menu entry |
56 customview_menu3_lead_tiss ; No menu entry | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
57 return |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
58 |
128 | 59 ;============================================================================= |
60 ; Do every-second tasks for the custom view area | |
61 | |
62 customview_second: | |
63 movff menupos3,WREG ; copy | |
64 dcfsnz WREG,F | |
65 bra customview_1sec_stopwatch ; Update the Stopwatch | |
66 dcfsnz WREG,F | |
67 bra customview_1sec_marker ; Update the Marker | |
68 dcfsnz WREG,F | |
69 bra customview_1sec_clock ; Update the Clock | |
70 dcfsnz WREG,F | |
71 bra customview_1sec_lead_tiss ; Update the leading tissue | |
72 dcfsnz WREG,F | |
73 bra customview_1sec_graphs ; Update the leading tissue | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
74 ; Menupos3=0, do nothing |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
75 return |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
76 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
77 customview_1sec_stopwatch: |
128 | 78 call PLED_stopwatch_show2 ; Update figures only |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
79 return |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
80 |
128 | 81 customview_1sec_marker: ; Do nothing extra |
82 customview_1sec_clock: ; Do nothing extra | |
83 customview_1sec_lead_tiss: ; Do nothing extra | |
84 customview_1sec_graphs: ; Do nothing extra | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
85 return |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
86 |
128 | 87 ;============================================================================= |
88 ; Do every-minute tasks for the custom view area | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
89 |
128 | 90 customview_minute: |
91 movff menupos3,WREG ; copy | |
92 dcfsnz WREG,F | |
93 bra customview_minute_stopwatch ; Update the Stopwatch | |
94 dcfsnz WREG,F | |
95 bra customview_minute_marker ; Update the Marker | |
96 dcfsnz WREG,F | |
97 bra customview_minute_clock ; Update the Clock | |
98 dcfsnz WREG,F | |
99 bra customview_minute_lead_tiss ; Update the leading tissue | |
100 dcfsnz WREG,F | |
101 bra customview_minute_graphs ; Update the graphs | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
102 ; Menupos3=0, do nothing |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
103 return |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
104 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
105 customview_minute_clock: |
128 | 106 call PLED_diveclock2 ; Update the clock |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
107 return |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
108 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
109 customview_minute_lead_tiss: |
128 | 110 call PLED_show_leading_tissue_2 ; Update the leading tissue |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
111 return |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
112 |
128 | 113 customview_minute_graphs: |
114 call PLED_tissue_saturation_graph | |
115 return | |
116 | |
117 customview_minute_marker: ; Do nothing extra | |
118 customview_minute_stopwatch: ; Do nothing extra | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
119 return |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
120 |
128 | 121 ;============================================================================= |
122 ; Yes, show next customview (and delete this flag) | |
123 | |
124 customview_toggle: | |
119 | 125 ostc_debug 'X' ; Sends debug-information to screen if debugmode active |
128 | 126 incf menupos3,F ; Number of customview to show |
127 movlw d'5' ; Max number | |
128 cpfsgt menupos3 ; Max reached? | |
129 bra customview_mask ; No, show | |
130 clrf menupos3 ; Reset to zero (Zero=no custom view) | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
131 customview_mask: |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
132 call PLED_clear_customview_divemode |
128 | 133 movff menupos3,WREG ; Menupos3 holds number of customview function |
134 dcfsnz WREG,F | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
135 bra customview_init_stopwatch ; Show the Stopwatch |
128 | 136 dcfsnz WREG,F |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
137 bra customview_init_marker ; Show the Marker-Menu |
128 | 138 dcfsnz WREG,F |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
139 bra customview_init_clock ; Show the clock |
128 | 140 dcfsnz WREG,F |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
141 bra customview_init_lead_tissue ; Show the leading tissue |
128 | 142 dcfsnz WREG,F |
143 bra customview_init_graphs ; Show the graphs | |
144 | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
145 customview_init_nocustomview: |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
146 bra customview_toggle_exit |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
147 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
148 customview_init_stopwatch: |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
149 ; Init Stopwatch |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
150 call PLED_stopwatch_show |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
151 bra customview_toggle_exit |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
152 |
128 | 153 customview_init_marker: ; Init Marker |
154 call PLED_standard_color | |
107 | 155 DISPLAYTEXT d'151' ; Set Marker? |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
156 bra customview_toggle_exit |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
157 |
107 | 158 customview_init_clock: ; Init Clock |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
159 call PLED_diveclock |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
160 bra customview_toggle_exit |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
161 |
107 | 162 customview_init_lead_tissue: ; Show leading tissue |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
163 call PLED_show_leading_tissue |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
164 bra customview_toggle_exit |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
165 |
128 | 166 customview_init_graphs: ; Show graphs |
167 call PLED_tissue_saturation_graph | |
168 bra customview_toggle_exit | |
169 | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
diff
changeset
|
170 customview_toggle_exit: |
107 | 171 bcf toggle_customview ; Clear flag |
128 | 172 ostc_debug 'Y' ; Sends debug-information to screen in debugmode |
107 | 173 return |
174 | |
128 | 175 ;============================================================================= |
176 ; Yes, show next customview (and delete this flag) | |
107 | 177 |
128 | 178 surfcustomview_toggle: |
107 | 179 incf menupos3,F ; Number of customview to show |
111 | 180 movlw d'4' ; Max number |
181 cpfsgt menupos3 ; Max reached? | |
107 | 182 bra surfcustomview_mask ; No, show |
183 clrf menupos3 ; Reset to zero (Zero=no custom view) | |
184 surfcustomview_mask: | |
115 | 185 call PLED_clear_customview_surfmode |
128 | 186 movff menupos3,WREG ; Menupos3 holds number of customview function |
187 dcfsnz WREG,F | |
107 | 188 bra surfcustomview_init_graphs ; Show the tissue graphs |
128 | 189 dcfsnz WREG,F |
107 | 190 bra surfcustomview_init_gaslist ; Show pre-dive gaslist/setpoint list |
128 | 191 dcfsnz WREG,F |
111 | 192 bra surfcustomview_init_interval ; Show the interval counter |
128 | 193 dcfsnz WREG,F |
111 | 194 bra surfcustomview_init_cfview ; Show the interval counter |
128 | 195 |
107 | 196 surfcustomview_init_nocustomview: |
197 bra surfcustomview_toggle_exit | |
198 | |
199 surfcustomview_init_graphs: | |
200 call PLED_tissue_saturation_graph ; Draw the graphs | |
201 bra surfcustomview_toggle_exit | |
202 | |
203 surfcustomview_init_gaslist: | |
204 call PLED_pre_dive_screen ; Show the Gaslist/Setpoint list | |
205 bra surfcustomview_toggle_exit | |
206 | |
111 | 207 surfcustomview_init_interval: |
123 | 208 call PLED_standard_color |
111 | 209 DISPLAYTEXT d'189' ; Surface |
210 DISPLAYTEXT d'240' ; Interval: | |
211 call PLED_interval ; Display the interval | |
212 bra surfcustomview_toggle_exit | |
213 | |
214 surfcustomview_init_cfview: | |
215 read_int_eeprom d'34' ; Get Decomode | |
216 incf EEDATA,W ; +1 -> WREG | |
217 movwf temp10 | |
218 dcfsnz temp10,F | |
219 call PLED_show_cf11_cf12_cf29 ; =0 (ZH-L16 OC) | |
220 dcfsnz temp10,F | |
221 bra surfcustomview_toggle_exit ; =1 (Gauge) | |
222 dcfsnz temp10,F | |
223 call PLED_show_cf11_cf12_cf29 ; =2 (ZH-L16 CC) | |
224 dcfsnz temp10,F | |
225 bra surfcustomview_toggle_exit ; =3 (Apnoe) | |
226 dcfsnz temp10,F | |
227 call PLED_show_cf32_cf33_cf29 ; =4 (L16-GF OC) | |
228 dcfsnz temp10,F | |
229 call PLED_show_cf32_cf33_cf29 ; =5 (L16-GF CC) | |
230 bra surfcustomview_toggle_exit | |
231 | |
107 | 232 surfcustomview_toggle_exit: |
233 bcf toggle_customview ; Clear flag | |
128 | 234 bra surfcustomview_second |
107 | 235 |
128 | 236 ;============================================================================= |
237 ; Do every-second tasks for the custom view area | |
107 | 238 |
128 | 239 surfcustomview_second: |
240 ; movff menupos3,WREG ; copy | |
241 ; dcfsnz WREG,F | |
242 ; bra surfcustomview_1sec_graphs ; Update the Graphs | |
243 ; dcfsnz WREG,F | |
244 ; bra surfcustomview_1sec_gaslist ; Update the Gaslist/SetPoint List | |
245 ; dcfsnz WREG,F | |
246 ; bra surfcustomview_1sec_interval ; Update the Interval display | |
247 ; dcfsnz WREG,F | |
248 ; bra surfcustomview_1sec_cfview ; Update the critical cf view | |
249 ; ; Menupos3=0, do nothing | |
250 ; return | |
251 ;surfcustomview_1sec_cfview: ; Do nothing extra | |
252 ;surfcustomview_1sec_graphs: ; Do nothing extra | |
253 ;surfcustomview_1sec_gaslist: ; Do nothing extra | |
254 ;surfcustomview_1sec_interval: ; Do nothing extra | |
107 | 255 return |
256 | |
128 | 257 ;============================================================================= |
107 | 258 |
259 surfcustomview_minute: ; Do every-minute tasks for the custom view area | |
128 | 260 movff menupos3,WREG ; copy |
261 dcfsnz WREG,F | |
107 | 262 bra surfcustomview_minute_graphs ; Update the Graphs |
128 | 263 dcfsnz WREG,F |
107 | 264 bra surfcustomview_minute_gaslist ; Update the Gaslist/SetPoint List |
128 | 265 dcfsnz WREG,F |
111 | 266 bra surfcustomview_minute_interval ; Update the Interval display |
128 | 267 dcfsnz WREG,F |
111 | 268 bra surfcustomview_minute_cfview ; Update the critical cf view |
107 | 269 ; Menupos3=0, do nothing |
270 return | |
271 | |
272 surfcustomview_minute_graphs: | |
273 call PLED_tissue_saturation_graph ; Draw/Update the graphs | |
274 return | |
275 | |
111 | 276 surfcustomview_minute_interval: |
112 | 277 DISPLAYTEXT d'189' ; Surface |
278 DISPLAYTEXT d'240' ; Interval: | |
111 | 279 call PLED_interval ; Display the interval |
280 return | |
281 | |
107 | 282 surfcustomview_minute_gaslist: ; Do nothing extra |
111 | 283 surfcustomview_minute_cfview: ; Do nothing extra |
284 return |