Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/customview.asm @ 681:6e456a6398e0
Hardware4 support
author | heinrichsweikamp |
---|---|
date | Fri, 25 Jan 2013 18:00:49 +0100 |
parents | 3927bc5019c9 |
children | 3096294bb06e |
comparison
equal
deleted
inserted
replaced
680:c6220d340684 | 681:6e456a6398e0 |
---|---|
105 bra customview_1sec_show_change_gf; Show and/or change GF values | 105 bra customview_1sec_show_change_gf; Show and/or change GF values |
106 ; Menupos3=0, do nothing | 106 ; Menupos3=0, do nothing |
107 return | 107 return |
108 | 108 |
109 customview_1sec_average: | 109 customview_1sec_average: |
110 goto PLED_total_average_show2 ; Update the figures only | 110 goto DISP_total_average_show2 ; Update the figures only |
111 | 111 |
112 customview_1sec_stopwatch: | 112 customview_1sec_stopwatch: |
113 btfsc gauge_mode ; In Gauge mode? | 113 btfsc gauge_mode ; In Gauge mode? |
114 bra customview_1sec_stopwatch_gauge; Yes | 114 bra customview_1sec_stopwatch_gauge; Yes |
115 | 115 |
116 bsf menu3_active ; Set Flag | 116 bsf menu3_active ; Set Flag |
117 goto PLED_stopwatch_show2 ; Update figures only | 117 goto DISP_stopwatch_show2 ; Update figures only |
118 | 118 |
119 customview_1sec_stopwatch_gauge: | 119 customview_1sec_stopwatch_gauge: |
120 bsf menu3_active ; Set Flag | 120 bsf menu3_active ; Set Flag |
121 goto PLED_stopwatch_show_gauge ; Update figures + Description | 121 goto DISP_stopwatch_show_gauge ; Update figures + Description |
122 | 122 |
123 customview_1sec_marker: ; Do nothing extra | 123 customview_1sec_marker: ; Do nothing extra |
124 customview_1sec_show_change_gf: ; Do nothing extra | 124 customview_1sec_show_change_gf: ; Do nothing extra |
125 bsf menu3_active ; Set Flag | 125 bsf menu3_active ; Set Flag |
126 customview_1sec_clock: ; Do nothing extra | 126 customview_1sec_clock: ; Do nothing extra |
133 movlw .10 ; Yes: reset counter. | 133 movlw .10 ; Yes: reset counter. |
134 movwf apnoe_mins | 134 movwf apnoe_mins |
135 | 135 |
136 call deco_calc_desaturation_time ; calculate desaturation time | 136 call deco_calc_desaturation_time ; calculate desaturation time |
137 movlb b'00000001' ; select ram bank 1 | 137 movlb b'00000001' ; select ram bank 1 |
138 goto PLED_tissue_saturation_graph | 138 goto DISP_tissue_saturation_graph |
139 | 139 |
140 customview_1sec_ead_end: | 140 customview_1sec_ead_end: |
141 goto PLED_show_end_ead_divemode | 141 goto DISP_show_end_ead_divemode |
142 | 142 |
143 customview_1sec_@5: | 143 customview_1sec_@5: |
144 goto PLED_show_@5 | 144 goto DISP_show_@5 |
145 | 145 |
146 customview_1sec_cave_bailout: | 146 customview_1sec_cave_bailout: |
147 bsf menu3_active ; Set Flag | 147 bsf menu3_active ; Set Flag |
148 goto PLED_show_cave_bailout | 148 goto DISP_show_cave_bailout |
149 | 149 |
150 customview_1sec_pSCR_ppO2: | 150 customview_1sec_pSCR_ppO2: |
151 goto PLED_show_pSCR_ppO2 ; Yes, compute and show value | 151 goto DISP_show_pSCR_ppO2 ; Yes, compute and show value |
152 | 152 |
153 | 153 |
154 ;============================================================================= | 154 ;============================================================================= |
155 ; Do every-minute tasks for the custom view area | 155 ; Do every-minute tasks for the custom view area |
156 | 156 |
181 | 181 |
182 ; Menupos3=0, do nothing | 182 ; Menupos3=0, do nothing |
183 return | 183 return |
184 | 184 |
185 customview_minute_clock: | 185 customview_minute_clock: |
186 goto PLED_diveclock2 ; Update the clock | 186 goto DISP_diveclock2 ; Update the clock |
187 | 187 |
188 customview_minute_lead_tiss: | 188 customview_minute_lead_tiss: |
189 goto PLED_show_leading_tissue_2 ; Update the leading tissue | 189 goto DISP_show_leading_tissue_2 ; Update the leading tissue |
190 | 190 |
191 customview_minute_show_change_gf: ; Do nothing extra | 191 customview_minute_show_change_gf: ; Do nothing extra |
192 customview_minute_cave_bailout: ; Do nothing extra | 192 customview_minute_cave_bailout: ; Do nothing extra |
193 customview_minute_@5: ; Do nothing extra | 193 customview_minute_@5: ; Do nothing extra |
194 customview_minute_ead_end: ; Do nothing extra | 194 customview_minute_ead_end: ; Do nothing extra |
215 cpfsgt menupos3 ; Max reached? | 215 cpfsgt menupos3 ; Max reached? |
216 bra customview_mask ; No, show | 216 bra customview_mask ; No, show |
217 clrf menupos3 ; Reset to zero (Zero=no custom view) | 217 clrf menupos3 ; Reset to zero (Zero=no custom view) |
218 | 218 |
219 customview_mask: | 219 customview_mask: |
220 call PLED_clear_customview_divemode | 220 call DISP_clear_customview_divemode |
221 bcf tts_extra_time ; By default, CLEAR computation of @5 request. | 221 bcf tts_extra_time ; By default, CLEAR computation of @5 request. |
222 | 222 |
223 movff menupos3,WREG ; Menupos3 holds number of customview function | 223 movff menupos3,WREG ; Menupos3 holds number of customview function |
224 dcfsnz WREG,F | 224 dcfsnz WREG,F |
225 bra customview_init_stopwatch ; 1: Show the Stopwatch | 225 bra customview_init_stopwatch ; 1: Show the Stopwatch |
246 | 246 |
247 customview_init_nocustomview: | 247 customview_init_nocustomview: |
248 bra customview_toggle_exit | 248 bra customview_toggle_exit |
249 | 249 |
250 customview_init_average: | 250 customview_init_average: |
251 call PLED_total_average_show ; Show Average with mask | 251 call DISP_total_average_show ; Show Average with mask |
252 bra customview_toggle_exit | 252 bra customview_toggle_exit |
253 | 253 |
254 customview_init_stopwatch: | 254 customview_init_stopwatch: |
255 GETCUSTOM8 d'51' ; Show Stopwatch? (=1 in WREG) | 255 GETCUSTOM8 d'51' ; Show Stopwatch? (=1 in WREG) |
256 decfsz WREG,F ; WREG=1? | 256 decfsz WREG,F ; WREG=1? |
257 bra customview_toggle ; No, use next Customview | 257 bra customview_toggle ; No, use next Customview |
258 | 258 |
259 btfsc gauge_mode ; In Gauge mode? | 259 btfsc gauge_mode ; In Gauge mode? |
260 bra customview_init_stopwatch_gauge ; Yes | 260 bra customview_init_stopwatch_gauge ; Yes |
261 | 261 |
262 call PLED_stopwatch_show ; Init Stopwatch display | 262 call DISP_stopwatch_show ; Init Stopwatch display |
263 bsf menu3_active ; Set Flag | 263 bsf menu3_active ; Set Flag |
264 bra customview_toggle_exit | 264 bra customview_toggle_exit |
265 | 265 |
266 customview_init_stopwatch_gauge: | 266 customview_init_stopwatch_gauge: |
267 call PLED_stopwatch_show_gauge ; Init Stopwatch display | 267 call DISP_stopwatch_show_gauge ; Init Stopwatch display |
268 bsf menu3_active ; Set Flag | 268 bsf menu3_active ; Set Flag |
269 bra customview_toggle_exit | 269 bra customview_toggle_exit |
270 | 270 |
271 customview_init_marker: ; Init Marker | 271 customview_init_marker: ; Init Marker |
272 btfsc gauge_mode ; In Gauge mode? | 272 btfsc gauge_mode ; In Gauge mode? |
273 call PLED_clear_divemode_menu; Yes, clear BIG stopwatch | 273 call DISP_clear_divemode_menu; Yes, clear BIG stopwatch |
274 | 274 |
275 GETCUSTOM8 d'50' ; Show Marker? (=1 in WREG) | 275 GETCUSTOM8 d'50' ; Show Marker? (=1 in WREG) |
276 decfsz WREG,F ; WREG=1? | 276 decfsz WREG,F ; WREG=1? |
277 bra customview_toggle ; No, use next Customview | 277 bra customview_toggle ; No, use next Customview |
278 | 278 |
279 call PLED_standard_color | 279 call DISP_standard_color |
280 DISPLAYTEXT d'151' ; Set Marker? | 280 DISPLAYTEXT d'151' ; Set Marker? |
281 bsf menu3_active ; Set Flag | 281 bsf menu3_active ; Set Flag |
282 | 282 |
283 btfss event_occured ; Is an event active? | 283 btfss event_occured ; Is an event active? |
284 bra customview_toggle_exit ; No | 284 bra customview_toggle_exit ; No |
285 | 285 |
286 movlw d'6' ; Type of Alarm (Manual Marker) | 286 movlw d'6' ; Type of Alarm (Manual Marker) |
287 cpfseq AlarmType ; Marker recently set? | 287 cpfseq AlarmType ; Marker recently set? |
288 bra customview_toggle_exit ; No | 288 bra customview_toggle_exit ; No |
289 | 289 |
290 call PLED_marker_set ; Show some feedback | 290 call DISP_marker_set ; Show some feedback |
291 bra customview_toggle_exit | 291 bra customview_toggle_exit |
292 | 292 |
293 customview_init_clock: ; Init Clock | 293 customview_init_clock: ; Init Clock |
294 call PLED_diveclock | 294 call DISP_diveclock |
295 bra customview_toggle_exit | 295 bra customview_toggle_exit |
296 | 296 |
297 customview_init_lead_tissue: ; Show leading tissue | 297 customview_init_lead_tissue: ; Show leading tissue |
298 GETCUSTOM8 d'53' ; Show Lead Tissue? (=1 in WREG) | 298 GETCUSTOM8 d'53' ; Show Lead Tissue? (=1 in WREG) |
299 decfsz WREG,F ; WREG=1? | 299 decfsz WREG,F ; WREG=1? |
300 bra customview_toggle ; No, use next Customview | 300 bra customview_toggle ; No, use next Customview |
301 | 301 |
302 btfsc no_deco_customviews ; no-deco-mode-flag = 1 | 302 btfsc no_deco_customviews ; no-deco-mode-flag = 1 |
303 bra customview_toggle ; Yes, use next Customview! | 303 bra customview_toggle ; Yes, use next Customview! |
304 | 304 |
305 call PLED_show_leading_tissue | 305 call DISP_show_leading_tissue |
306 bra customview_toggle_exit | 306 bra customview_toggle_exit |
307 | 307 |
308 customview_init_ead_end: | 308 customview_init_ead_end: |
309 btfsc no_deco_customviews ; no-deco-mode-flag = 1 | 309 btfsc no_deco_customviews ; no-deco-mode-flag = 1 |
310 bra customview_toggle ; Yes, use next Customview! | 310 bra customview_toggle ; Yes, use next Customview! |
311 | 311 |
312 call PLED_show_end_ead_divemode | 312 call DISP_show_end_ead_divemode |
313 bra customview_toggle_exit | 313 bra customview_toggle_exit |
314 | 314 |
315 customview_init_@5: | 315 customview_init_@5: |
316 GETCUSTOM8 d'58' ; Extra time to simulate | 316 GETCUSTOM8 d'58' ; Extra time to simulate |
317 iorwf WREG,F ; Null ? | 317 iorwf WREG,F ; Null ? |
325 movff WREG,int_O_extra_ascenttime+1 | 325 movff WREG,int_O_extra_ascenttime+1 |
326 | 326 |
327 movlw 1 | 327 movlw 1 |
328 movwf apnoe_mins ; Start compute after next cycle. | 328 movwf apnoe_mins ; Start compute after next cycle. |
329 bsf tts_extra_time | 329 bsf tts_extra_time |
330 call PLED_show_@5 ; Show (wait) | 330 call DISP_show_@5 ; Show (wait) |
331 | 331 |
332 bra customview_toggle_exit | 332 bra customview_toggle_exit |
333 | 333 |
334 customview_init_cave_bailout: | 334 customview_init_cave_bailout: |
335 GETCUSTOM15 d'59' ; Conso level warning set ? | 335 GETCUSTOM15 d'59' ; Conso level warning set ? |
336 movf lo,W | 336 movf lo,W |
337 iorwf hi,W | 337 iorwf hi,W |
338 bz customview_toggle ; No: jump to next Customview ! | 338 bz customview_toggle ; No: jump to next Customview ! |
339 | 339 |
340 bsf menu3_active ; Set Flag | 340 bsf menu3_active ; Set Flag |
341 call PLED_show_cave_bailout | 341 call DISP_show_cave_bailout |
342 bra customview_toggle_exit | 342 bra customview_toggle_exit |
343 | 343 |
344 customview_init_graphs: ; Show tissue graph | 344 customview_init_graphs: ; Show tissue graph |
345 GETCUSTOM8 d'52' ; Show Tissue Graph? (=1 in WREG) | 345 GETCUSTOM8 d'52' ; Show Tissue Graph? (=1 in WREG) |
346 decfsz WREG,F ; WREG=1? | 346 decfsz WREG,F ; WREG=1? |
352 movlw .1 ; Draw next second. | 352 movlw .1 ; Draw next second. |
353 movwf apnoe_mins ; 10sec counter. | 353 movwf apnoe_mins ; 10sec counter. |
354 | 354 |
355 call deco_calc_desaturation_time ; calculate desaturation time | 355 call deco_calc_desaturation_time ; calculate desaturation time |
356 movlb b'00000001' ; select ram bank 1 | 356 movlb b'00000001' ; select ram bank 1 |
357 call PLED_tissue_saturation_graph | 357 call DISP_tissue_saturation_graph |
358 | 358 |
359 bra customview_toggle_exit | 359 bra customview_toggle_exit |
360 | 360 |
361 customview_init_pSCR_ppo2: | 361 customview_init_pSCR_ppo2: |
362 GETCUSTOM8 d'61' ; Show pSCR ppO2? | 362 GETCUSTOM8 d'61' ; Show pSCR ppO2? |
364 bra customview_toggle ; No, use next Customview | 364 bra customview_toggle ; No, use next Customview |
365 | 365 |
366 btfsc no_deco_customviews ; no-deco-mode-flag = 1 | 366 btfsc no_deco_customviews ; no-deco-mode-flag = 1 |
367 bra customview_toggle ; Yes, use next Customview! | 367 bra customview_toggle ; Yes, use next Customview! |
368 | 368 |
369 call PLED_show_pSCR_ppO2 ; Yes, compute and show value | 369 call DISP_show_pSCR_ppO2 ; Yes, compute and show value |
370 | 370 |
371 bra customview_toggle_exit | 371 bra customview_toggle_exit |
372 | 372 |
373 customview_init_show_change_gf: | 373 customview_init_show_change_gf: |
374 GETCUSTOM8 d'69' ; Allow GF change? | 374 GETCUSTOM8 d'69' ; Allow GF change? |
381 movff char_I_deco_model,lo | 381 movff char_I_deco_model,lo |
382 decfsz lo,F ; jump over next line if char_I_deco_model == 1 | 382 decfsz lo,F ; jump over next line if char_I_deco_model == 1 |
383 bra customview_toggle_exit | 383 bra customview_toggle_exit |
384 | 384 |
385 bsf menu3_active ; Set Flag | 385 bsf menu3_active ; Set Flag |
386 call PLED_show_gf_customview ; Show info | 386 call DISP_show_gf_customview ; Show info |
387 bra customview_toggle_exit | 387 bra customview_toggle_exit |
388 | 388 |
389 customview_toggle_exit: | 389 customview_toggle_exit: |
390 bcf toggle_customview ; Clear flag | 390 bcf toggle_customview ; Clear flag |
391 ostc_debug 'Y' ; Sends debug-information to screen in debugmode | 391 ostc_debug 'Y' ; Sends debug-information to screen in debugmode |
400 movlw d'4' ; Max number | 400 movlw d'4' ; Max number |
401 cpfsgt menupos3 ; Max reached? | 401 cpfsgt menupos3 ; Max reached? |
402 bra surfcustomview_mask ; No, show | 402 bra surfcustomview_mask ; No, show |
403 clrf menupos3 ; Reset to zero (Zero=no custom view) | 403 clrf menupos3 ; Reset to zero (Zero=no custom view) |
404 surfcustomview_mask: | 404 surfcustomview_mask: |
405 call PLED_clear_customview_surfmode | 405 call DISP_clear_customview_surfmode |
406 movff menupos3,WREG ; Menupos3 holds number of customview function | 406 movff menupos3,WREG ; Menupos3 holds number of customview function |
407 dcfsnz WREG,F | 407 dcfsnz WREG,F |
408 bra surfcustomview_init_graphs ; Show the tissue graphs | 408 bra surfcustomview_init_graphs ; Show the tissue graphs |
409 dcfsnz WREG,F | 409 dcfsnz WREG,F |
410 bra surfcustomview_init_gaslist ; Show pre-dive gaslist/setpoint list | 410 bra surfcustomview_init_gaslist ; Show pre-dive gaslist/setpoint list |
418 | 418 |
419 surfcustomview_init_graphs: | 419 surfcustomview_init_graphs: |
420 btfsc no_deco_customviews ; no-deco-mode-flag = 1 | 420 btfsc no_deco_customviews ; no-deco-mode-flag = 1 |
421 bra surfcustomview_toggle ; Yes, use next Customview! | 421 bra surfcustomview_toggle ; Yes, use next Customview! |
422 | 422 |
423 call PLED_tissue_saturation_graph; Draw the graphs | 423 call DISP_tissue_saturation_graph; Draw the graphs |
424 bra surfcustomview_toggle_exit | 424 bra surfcustomview_toggle_exit |
425 | 425 |
426 surfcustomview_init_gaslist: | 426 surfcustomview_init_gaslist: |
427 btfsc no_deco_customviews ; no-deco-mode-flag = 1 | 427 btfsc no_deco_customviews ; no-deco-mode-flag = 1 |
428 bra surfcustomview_toggle ; Yes, use next Customview! | 428 bra surfcustomview_toggle ; Yes, use next Customview! |
429 | 429 |
430 call PLED_pre_dive_screen ; Show the Gaslist/Setpoint list | 430 call DISP_pre_dive_screen ; Show the Gaslist/Setpoint list |
431 bra surfcustomview_toggle_exit | 431 bra surfcustomview_toggle_exit |
432 | 432 |
433 surfcustomview_init_interval: | 433 surfcustomview_init_interval: |
434 call PLED_standard_color | 434 call DISP_standard_color |
435 DISPLAYTEXT d'189' ; Surface | 435 DISPLAYTEXT d'189' ; Surface |
436 DISPLAYTEXT d'240' ; Interval: | 436 DISPLAYTEXT d'240' ; Interval: |
437 call PLED_interval ; Display the interval | 437 call DISP_interval ; Display the interval |
438 bra surfcustomview_toggle_exit | 438 bra surfcustomview_toggle_exit |
439 | 439 |
440 surfcustomview_init_cfview: | 440 surfcustomview_init_cfview: |
441 read_int_eeprom d'34' ; Get Decomode | 441 read_int_eeprom d'34' ; Get Decomode |
442 incf EEDATA,W ; +1 -> WREG | 442 incf EEDATA,W ; +1 -> WREG |
443 movwf temp10 | 443 movwf temp10 |
444 dcfsnz temp10,F | 444 dcfsnz temp10,F |
445 call PLED_show_cf11_cf12_cf29 ; =0 (ZH-L16 OC) | 445 call DISP_show_cf11_cf12_cf29 ; =0 (ZH-L16 OC) |
446 dcfsnz temp10,F | 446 dcfsnz temp10,F |
447 bra surfcustomview_toggle_exit ; =1 (Gauge) | 447 bra surfcustomview_toggle_exit ; =1 (Gauge) |
448 dcfsnz temp10,F | 448 dcfsnz temp10,F |
449 call PLED_show_cf11_cf12_cf29 ; =2 (ZH-L16 CC) | 449 call DISP_show_cf11_cf12_cf29 ; =2 (ZH-L16 CC) |
450 dcfsnz temp10,F | 450 dcfsnz temp10,F |
451 bra surfcustomview_toggle_exit ; =3 (Apnoe) | 451 bra surfcustomview_toggle_exit ; =3 (Apnoe) |
452 dcfsnz temp10,F | 452 dcfsnz temp10,F |
453 call PLED_show_cf32_cf33_cf29 ; =4 (L16-GF OC) | 453 call DISP_show_cf32_cf33_cf29 ; =4 (L16-GF OC) |
454 dcfsnz temp10,F | 454 dcfsnz temp10,F |
455 call PLED_show_cf32_cf33_cf29 ; =5 (L16-GF CC) | 455 call DISP_show_cf32_cf33_cf29 ; =5 (L16-GF CC) |
456 dcfsnz temp10,F | 456 dcfsnz temp10,F |
457 call PLED_show_cf32_cf33_cf62_cf63 ; =6 (pSCR-GF) | 457 call DISP_show_cf32_cf33_cf62_cf63 ; =6 (pSCR-GF) |
458 | 458 |
459 bra surfcustomview_toggle_exit | 459 bra surfcustomview_toggle_exit |
460 | 460 |
461 surfcustomview_toggle_exit: | 461 surfcustomview_toggle_exit: |
462 bcf toggle_customview ; Clear flag | 462 bcf toggle_customview ; Clear flag |
500 return | 500 return |
501 | 501 |
502 surfcustomview_minute_graphs: | 502 surfcustomview_minute_graphs: |
503 call deco_calc_desaturation_time ; calculate desaturation time | 503 call deco_calc_desaturation_time ; calculate desaturation time |
504 movlb b'00000001' ; select ram bank 1 | 504 movlb b'00000001' ; select ram bank 1 |
505 call PLED_tissue_saturation_graph ; Draw/Update the graphs | 505 call DISP_tissue_saturation_graph ; Draw/Update the graphs |
506 return | 506 return |
507 | 507 |
508 surfcustomview_minute_interval: | 508 surfcustomview_minute_interval: |
509 DISPLAYTEXT d'189' ; Surface | 509 DISPLAYTEXT d'189' ; Surface |
510 DISPLAYTEXT d'240' ; Interval: | 510 DISPLAYTEXT d'240' ; Interval: |
511 call PLED_interval ; Display the interval | 511 call DISP_interval ; Display the interval |
512 return | 512 return |
513 | 513 |
514 surfcustomview_minute_gaslist: ; Do nothing extra | 514 surfcustomview_minute_gaslist: ; Do nothing extra |
515 surfcustomview_minute_cfview: ; Do nothing extra | 515 surfcustomview_minute_cfview: ; Do nothing extra |
516 return | 516 return |