comparison code_part1/OSTC_code_asm_part1/customview.asm @ 131:03df42de03e1

Merge 129 with 130
author Heinrichsweikamp
date Wed, 05 Jan 2011 07:46:20 +0100
parents 06c4899ddb4b 4c588c3d1f12
children 35567a646fe5
comparison
equal deleted inserted replaced
130:d721b49b8934 131:03df42de03e1
16 16
17 17
18 ; Customviews for divemode 18 ; Customviews for divemode
19 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com 19 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com
20 ; written: 101212 20 ; written: 101212
21 ; last updated: 101212 21 ; history:
22 ; 2010-12-12: [MH] last updated
23 ; 2011-01-04: [jDG] Saturation graphs in customview divemode
22 ; known bugs: 24 ; known bugs:
23 ; ToDo: 25 ; ToDo:
24 26
25 customview_menu_entry3: ; Show the customview-dependent entry for the divemode menu 27 ;=============================================================================
28 ; Show the customview-dependent entry for the divemode menu
29 ;
30 customview_menu_entry3:
26 bcf menu3_active ;=1: menu entry three in divemode menu is active 31 bcf menu3_active ;=1: menu entry three in divemode menu is active
27 movff menupos3,temp1 ; copy 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
42 ; Menupos3=0, do nothing
43 return
44
45 customview_menu3_stopwatch:
46 bsf menu3_active ; Set Flag
47 DISPLAYTEXT .33 ; ResetAvr
48 return
49
50 customview_menu3_marker:
51 bsf menu3_active ; Set Flag
52 DISPLAYTEXT .30 ; Set Marker
53 return
54
55 customview_menu3_clock: ; No menu entry
56 customview_menu3_lead_tiss ; No menu entry
57 return
58
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
28 dcfsnz temp1,F 72 dcfsnz temp1,F
29 bra customview_menu3_stopwatch ; Show the stopwatch option in divemode menu 73 bra customview_1sec_average ; Update the Average depth
30 dcfsnz temp1,F 74 dcfsnz WREG,F
31 bra customview_menu3_marker ; Show the marker option in divemode menu 75 bra customview_1sec_graphs ; Update the leading tissue
32 dcfsnz temp1,F
33 bra customview_menu3_clock ; Show the clock option in divemode menu
34 dcfsnz temp1,F
35 bra customview_menu3_lead_tiss ; Show the leading tissue option in divemode menu
36 ; Menupos3=0, do nothing
37 return
38
39 customview_menu3_stopwatch:
40 bsf menu3_active ; Set Flag
41 DISPLAYTEXT .33 ; ResetAvr
42 return
43
44 customview_menu3_marker:
45 bsf menu3_active ; Set Flag
46 DISPLAYTEXT .30 ; Set Marker
47 return
48
49 customview_menu3_clock: ; No menu entry
50 customview_menu3_lead_tiss ; No menu entry
51 return
52
53 customview_second: ; Do every-second tasks for the custom view area
54 movff menupos3,temp1 ; copy
55 dcfsnz temp1,F
56 bra customview_1sec_stopwatch ; Update the Stopwatch
57 dcfsnz temp1,F
58 bra customview_1sec_marker ; Update the Marker
59 dcfsnz temp1,F
60 bra customview_1sec_clock ; Update the Clock
61 dcfsnz temp1,F
62 bra customview_1sec_lead_tiss ; Update the leading tissue
63 dcfsnz temp1,F
64 bra customview_1sec_average ; Update the Average depth
65 ; Menupos3=0, do nothing 76 ; Menupos3=0, do nothing
66 return 77 return
67 78
68 customview_1sec_average: 79 customview_1sec_average:
69 call PLED_total_average_show2 ; Update the figures only 80 call PLED_total_average_show2 ; Update the figures only
70 return 81 return
71 82
72 customview_1sec_stopwatch: 83 customview_1sec_stopwatch:
73 call PLED_stopwatch_show2 ; Update figures only 84 call PLED_stopwatch_show2 ; Update figures only
74 return 85 return
75 86
76 customview_1sec_marker: ; Do nothing extra 87 customview_1sec_marker: ; Do nothing extra
77 customview_1sec_lead_tiss: ; Do nothing extra 88 customview_1sec_clock: ; Do nothing extra
78 customview_1sec_clock: ; Do nothing extra 89 customview_1sec_lead_tiss: ; Do nothing extra
79 return 90 customview_1sec_graphs: ; Do nothing extra
80 91 return
81 92
82 customview_minute: ; Do every-minute tasks for the custom view area 93 ;=============================================================================
83 movff menupos3,temp1 ; copy 94 ; Do every-minute tasks for the custom view area
84 dcfsnz temp1,F 95
85 bra customview_minute_stopwatch ; Update the Stopwatch 96 customview_minute:
86 dcfsnz temp1,F 97 movff menupos3,WREG ; copy
87 bra customview_minute_marker ; Update the Marker 98 dcfsnz WREG,F
88 dcfsnz temp1,F 99 bra customview_minute_stopwatch ; Update the Stopwatch
89 bra customview_minute_clock ; Update the Clock 100 dcfsnz WREG,F
90 dcfsnz temp1,F 101 bra customview_minute_marker ; Update the Marker
91 bra customview_minute_lead_tiss ; Update the leading tissue 102 dcfsnz WREG,F
103 bra customview_minute_clock ; Update the Clock
104 dcfsnz WREG,F
105 bra customview_minute_lead_tiss ; Update the leading tissue
92 dcfsnz temp1,F 106 dcfsnz temp1,F
93 bra customview_minute_average ; Update the Average depth 107 bra customview_minute_average ; Update the Average depth
108 dcfsnz WREG,F
109 bra customview_minute_graphs ; Update the graphs
94 ; Menupos3=0, do nothing 110 ; Menupos3=0, do nothing
95 return 111 return
96 112
97 customview_minute_clock: 113 customview_minute_clock:
98 call PLED_diveclock2 ; Update the clock 114 call PLED_diveclock2 ; Update the clock
99 return 115 return
100 116
101 customview_minute_lead_tiss: 117 customview_minute_lead_tiss:
102 call PLED_show_leading_tissue_2 ; Update the leading tissue 118 call PLED_show_leading_tissue_2 ; Update the leading tissue
103 return 119 return
104 120
105 customview_minute_marker: ; Do nothing extra 121 customview_minute_graphs:
106 customview_minute_stopwatch: ; Do nothing extra 122 call PLED_tissue_saturation_graph
123 return
124
125 customview_minute_marker: ; Do nothing extra
126 customview_minute_stopwatch: ; Do nothing extra
107 customview_minute_average: ; Do nothing extra 127 customview_minute_average: ; Do nothing extra
108 return 128 return
109 129
110 customview_toggle: ; Yes, show next customview (and delete this flag) 130 ;=============================================================================
131 ; Yes, show next customview (and delete this flag)
132
133 customview_toggle:
111 ostc_debug 'X' ; Sends debug-information to screen if debugmode active 134 ostc_debug 'X' ; Sends debug-information to screen if debugmode active
112 incf menupos3,F ; Number of customview to show 135 incf menupos3,F ; Number of customview to show
113 movlw d'5' ; Max number 136 movlw d'6' ; Max number
114 cpfsgt menupos3 ; Max reached? 137 cpfsgt menupos3 ; Max reached?
115 bra customview_mask ; No, show 138 bra customview_mask ; No, show
116 clrf menupos3 ; Reset to zero (Zero=no custom view) 139 clrf menupos3 ; Reset to zero (Zero=no custom view)
117 customview_mask: 140 customview_mask:
118 call PLED_clear_customview_divemode 141 call PLED_clear_customview_divemode
119 movff menupos3,temp1 ; Menupos3 holds number of customview function 142 movff menupos3,WREG ; Menupos3 holds number of customview function
120 dcfsnz temp1,F 143 dcfsnz WREG,F
121 bra customview_init_stopwatch ; Show the Stopwatch 144 bra customview_init_stopwatch ; Show the Stopwatch
122 dcfsnz temp1,F 145 dcfsnz WREG,F
123 bra customview_init_marker ; Show the Marker-Menu 146 bra customview_init_marker ; Show the Marker-Menu
124 dcfsnz temp1,F 147 dcfsnz WREG,F
125 bra customview_init_clock ; Show the clock 148 bra customview_init_clock ; Show the clock
126 dcfsnz temp1,F 149 dcfsnz WREG,F
127 bra customview_init_lead_tissue ; Show the leading tissue 150 bra customview_init_lead_tissue ; Show the leading tissue
128 dcfsnz temp1,F 151 dcfsnz temp1,F
129 bra customview_init_average ; Show Total average depth 152 bra customview_init_average ; Show Total average depth
130 ; bra customview_init_nocustomview ; menupos3=0 -> No Customview 153 dcfsnz WREG,F
154 bra customview_init_graphs ; Show the graphs
155
131 customview_init_nocustomview: 156 customview_init_nocustomview:
132 bra customview_toggle_exit 157 bra customview_toggle_exit
133 158
134 customview_init_average: 159 customview_init_average:
135 call PLED_total_average_show ; Show Average with mask 160 call PLED_total_average_show ; Show Average with mask
141 bra customview_toggle ; No, use next Customview 166 bra customview_toggle ; No, use next Customview
142 167
143 call PLED_stopwatch_show ; Init Stopwatch display 168 call PLED_stopwatch_show ; Init Stopwatch display
144 bra customview_toggle_exit 169 bra customview_toggle_exit
145 170
146 customview_init_marker: ; Init Marker 171 customview_init_marker: ; Init Marker
147 GETCUSTOM8 d'50' ; Show Marker? (=1 in WREG) 172 GETCUSTOM8 d'50' ; Show Marker? (=1 in WREG)
148 decfsz WREG,F ; WREG=1? 173 decfsz WREG,F ; WREG=1?
149 bra customview_toggle ; No, use next Customview 174 bra customview_toggle ; No, use next Customview
150 175
176 call PLED_standard_color
151 DISPLAYTEXT d'151' ; Set Marker? 177 DISPLAYTEXT d'151' ; Set Marker?
152 bra customview_toggle_exit 178 bra customview_toggle_exit
153 179
154 customview_init_clock: ; Init Clock 180 customview_init_clock: ; Init Clock
155 call PLED_diveclock 181 call PLED_diveclock
161 bra customview_toggle ; No, use next Customview 187 bra customview_toggle ; No, use next Customview
162 188
163 call PLED_show_leading_tissue 189 call PLED_show_leading_tissue
164 bra customview_toggle_exit 190 bra customview_toggle_exit
165 191
166 ;customview_init_graphs: ; Show tissue graph 192 customview_init_graphs: ; Show tissue graph
167 ; GETCUSTOM8 d'52' ; Show Tissue Graph? (=1 in WREG) 193 GETCUSTOM8 d'52' ; Show Tissue Graph? (=1 in WREG)
168 ; decfsz WREG,F ; WREG=1? 194 decfsz WREG,F ; WREG=1?
169 ; bra customview_toggle ; No, use next Customview 195 call PLED_tissue_saturation_graph
196 bra customview_toggle ; No, use next Customview
170 197
171 customview_toggle_exit: 198 customview_toggle_exit:
172 bcf toggle_customview ; Clear flag 199 bcf toggle_customview ; Clear flag
173 ostc_debug 'Y' ; Sends debug-information to screen if debugmode active 200 ostc_debug 'Y' ; Sends debug-information to screen in debugmode
174 return 201 return
175 202
176 203 ;=============================================================================
177 204 ; Yes, show next customview (and delete this flag)
178 surfcustomview_toggle: ; Yes, show next customview (and delete this flag) 205
206 surfcustomview_toggle:
179 incf menupos3,F ; Number of customview to show 207 incf menupos3,F ; Number of customview to show
180 movlw d'4' ; Max number 208 movlw d'4' ; Max number
181 cpfsgt menupos3 ; Max reached? 209 cpfsgt menupos3 ; Max reached?
182 bra surfcustomview_mask ; No, show 210 bra surfcustomview_mask ; No, show
183 clrf menupos3 ; Reset to zero (Zero=no custom view) 211 clrf menupos3 ; Reset to zero (Zero=no custom view)
184 surfcustomview_mask: 212 surfcustomview_mask:
185 call PLED_clear_customview_surfmode 213 call PLED_clear_customview_surfmode
186 movff menupos3,temp1 ; Menupos3 holds number of customview function 214 movff menupos3,WREG ; Menupos3 holds number of customview function
187 dcfsnz temp1,F 215 dcfsnz WREG,F
188 bra surfcustomview_init_graphs ; Show the tissue graphs 216 bra surfcustomview_init_graphs ; Show the tissue graphs
189 dcfsnz temp1,F 217 dcfsnz WREG,F
190 bra surfcustomview_init_gaslist ; Show pre-dive gaslist/setpoint list 218 bra surfcustomview_init_gaslist ; Show pre-dive gaslist/setpoint list
191 dcfsnz temp1,F 219 dcfsnz WREG,F
192 bra surfcustomview_init_interval ; Show the interval counter 220 bra surfcustomview_init_interval ; Show the interval counter
193 dcfsnz temp1,F 221 dcfsnz WREG,F
194 bra surfcustomview_init_cfview ; Show the interval counter 222 bra surfcustomview_init_cfview ; Show the interval counter
195 ; bra surfcustomview_init_nocustomview ; menupos3=0 -> No Customview 223
196 surfcustomview_init_nocustomview: 224 surfcustomview_init_nocustomview:
197 bra surfcustomview_toggle_exit 225 bra surfcustomview_toggle_exit
198 226
199 surfcustomview_init_graphs: 227 surfcustomview_init_graphs:
200 call PLED_tissue_saturation_graph ; Draw the graphs 228 call PLED_tissue_saturation_graph ; Draw the graphs
232 surfcustomview_toggle_exit: 260 surfcustomview_toggle_exit:
233 bcf toggle_customview ; Clear flag 261 bcf toggle_customview ; Clear flag
234 clrf timeout_counter2 ; Clear timeout 262 clrf timeout_counter2 ; Clear timeout
235 return 263 return
236 264
237 265 ;=============================================================================
238 266 ; Do every-second tasks for the custom view area
239 surfcustomview_second: ; Do every-second tasks for the custom view area 267
240 movff menupos3,temp1 ; copy 268 surfcustomview_second:
241 dcfsnz temp1,F 269 ; movff menupos3,WREG ; copy
242 bra surfcustomview_1sec_graphs ; Update the Graphs 270 ; dcfsnz WREG,F
243 dcfsnz temp1,F 271 ; bra surfcustomview_1sec_graphs ; Update the Graphs
244 bra surfcustomview_1sec_gaslist ; Update the Gaslist/SetPoint List 272 ; dcfsnz WREG,F
245 dcfsnz temp1,F 273 ; bra surfcustomview_1sec_gaslist ; Update the Gaslist/SetPoint List
246 bra surfcustomview_1sec_interval ; Update the Interval display 274 ; dcfsnz WREG,F
247 dcfsnz temp1,F 275 ; bra surfcustomview_1sec_interval ; Update the Interval display
248 bra surfcustomview_1sec_cfview ; Update the critical cf view 276 ; dcfsnz WREG,F
249 ; Menupos3=0, do nothing 277 ; bra surfcustomview_1sec_cfview ; Update the critical cf view
250 return 278 ; ; Menupos3=0, do nothing
251 surfcustomview_1sec_cfview: ; Do nothing extra 279 ; return
252 surfcustomview_1sec_graphs: ; Do nothing extra 280 ;surfcustomview_1sec_cfview: ; Do nothing extra
253 surfcustomview_1sec_gaslist: ; Do nothing extra 281 ;surfcustomview_1sec_graphs: ; Do nothing extra
254 surfcustomview_1sec_interval: ; Do nothing extra 282 ;surfcustomview_1sec_gaslist: ; Do nothing extra
255 return 283 ;surfcustomview_1sec_interval: ; Do nothing extra
256 284 return
285
286 ;=============================================================================
257 287
258 surfcustomview_minute: ; Do every-minute tasks for the custom view area 288 surfcustomview_minute: ; Do every-minute tasks for the custom view area
259 movff menupos3,temp1 ; copy 289 movff menupos3,WREG ; copy
260 dcfsnz temp1,F 290 dcfsnz WREG,F
261 bra surfcustomview_minute_graphs ; Update the Graphs 291 bra surfcustomview_minute_graphs ; Update the Graphs
262 dcfsnz temp1,F 292 dcfsnz WREG,F
263 bra surfcustomview_minute_gaslist ; Update the Gaslist/SetPoint List 293 bra surfcustomview_minute_gaslist ; Update the Gaslist/SetPoint List
264 dcfsnz temp1,F 294 dcfsnz WREG,F
265 bra surfcustomview_minute_interval ; Update the Interval display 295 bra surfcustomview_minute_interval ; Update the Interval display
266 dcfsnz temp1,F 296 dcfsnz WREG,F
267 bra surfcustomview_minute_cfview ; Update the critical cf view 297 bra surfcustomview_minute_cfview ; Update the critical cf view
268 ; Menupos3=0, do nothing 298 ; Menupos3=0, do nothing
269 return 299 return
270 300
271 surfcustomview_minute_graphs: 301 surfcustomview_minute_graphs: