comparison code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 492:19b9e19ea4da

+CHANGE: Velocity display updated every second +NEW: CF60: Show graphical velocity indicator (Ascend only)
author heinrichsweikamp
date Sun, 06 Nov 2011 11:02:03 +0100
parents 9fc8feff27a5
children 06db5dd9149f
comparison
equal deleted inserted replaced
491:560764da0629 492:19b9e19ea4da
608 movlw d'6' 608 movlw d'6'
609 movwf temp1 609 movwf temp1
610 bcf timeout_display ; Clear flag 610 bcf timeout_display ; Clear flag
611 bra PLED_display_clear_common_y1 611 bra PLED_display_clear_common_y1
612 612
613 PLED_display_velocity_graphical:
614 btfss neg_flag
615 bra PLED_display_velocity_clear ; No display for descend speed, clear instead
616 bsf pled_velocity_display
617 ; divA+0 holding the ascend speed in m/min
618 movff divA+0,hi ; Copy
619 WIN_BOX_BLACK .20, .90, .65, .75 ; Clear graphic display
620 GETCUSTOM8 d'36' ; Divemode mask
621 WIN_FRAME_COLOR .20, .90, .65, .75 ; Outer frame
622 GETCUSTOM8 d'36' ; Divemode mask
623 WIN_FRAME_COLOR .20+.10, .90-.10, .65, .75 ; Inner frames
624 GETCUSTOM8 d'36' ; Divemode mask
625 WIN_FRAME_COLOR .20+.20, .90-.20, .65, .75 ;
626 GETCUSTOM8 d'36' ; Divemode mask
627 WIN_FRAME_COLOR .20+.30, .90-.30, .65, .75 ;
628
629 GETCUSTOM8 d'47' ; color_warn_celocity_mmin
630 movwf xA+0
631 clrf xA+1
632 movlw .5
633 movwf xB+0 ; Threshold for color warning (5 color normal + 2 color warning)
634 clrf xB+1
635 call div16x16 ;xA/xB=xC with xA as remainder
636 ; xC+0 holds stepsize in m/min (e.g. =3 for 15m/min warning treshold)
637 movff hi,xA+0 ; Velocity in m/min
638 clrf xA+1
639 movff xC+0,xB+0 ; Step size
640 clrf xB+1
641 call div16x16 ;xA/xB=xC with xA as remainder
642 ; xC+0 now holds amount of segments to show
643
644 movlw d'7'
645 cpfslt xC+0
646 bra PLED_graph_vel_7
647 movlw d'6'
648 cpfslt xC+0
649 bra PLED_graph_vel_6
650 movlw d'5'
651 cpfslt xC+0
652 bra PLED_graph_vel_5
653 movlw d'4'
654 cpfslt xC+0
655 bra PLED_graph_vel_4
656 movlw d'3'
657 cpfslt xC+0
658 bra PLED_graph_vel_3
659 movlw d'2'
660 cpfslt xC+0
661 bra PLED_graph_vel_2
662 movlw d'1'
663 cpfslt xC+0
664 bra PLED_graph_vel_1
665 bra PLED_graph_vel_0 ; Should not happen...
666
667 PLED_graph_vel_7:
668 GETCUSTOM8 d'37' ; Color warning
669 WIN_BOX_COLOR .22, .22+.6, .67, .73 ; Fill box
670 PLED_graph_vel_6:
671 GETCUSTOM8 d'37' ; Color warning
672 WIN_BOX_COLOR .32, .32+.6, .67, .73 ; Fill box
673 PLED_graph_vel_5:
674 WIN_BOX_STD .42, .42+.6, .67, .73 ; Fill box
675 PLED_graph_vel_4:
676 WIN_BOX_STD .52, .52+.6, .67, .73 ; Fill box
677 PLED_graph_vel_3:
678 WIN_BOX_STD .62, .62+.6, .67, .73 ; Fill box
679 PLED_graph_vel_2:
680 WIN_BOX_STD .72, .72+.6, .67, .73 ; Fill box
681 PLED_graph_vel_1:
682 WIN_BOX_STD .82, .82+.6, .67, .73 ; Fill box
683 PLED_graph_vel_0:
684 ; WIN_TOP .90
685 ; WIN_LEFT .0
686 ; WIN_FONT FT_SMALL
687 ; lfsr FSR2,letter
688 ; movff xC+0,lo
689 ; output_99
690 ; PUTC ' '
691 ; movff divA+0,lo
692 ; output_99
693 ; PUTC ' '
694 ; call word_processor
695 return
696
697
613 PLED_display_velocity: 698 PLED_display_velocity:
614 ostc_debug 'v' ; Sends debug-information to screen if debugmode active 699 ostc_debug 'v' ; Sends debug-information to screen if debugmode active
615 WIN_TOP .90 700 WIN_TOP .90
616 WIN_LEFT .0 701 WIN_LEFT .0
617 WIN_FONT FT_SMALL 702 WIN_FONT FT_SMALL
628 call PLED_standard_color 713 call PLED_standard_color
629 bsf pled_velocity_display 714 bsf pled_velocity_display
630 return 715 return
631 716
632 PLED_display_velocity_clear: 717 PLED_display_velocity_clear:
718 GETCUSTOM8 d'60' ; use graphic velocity (=1)?
719 movwf lo
720 movlw d'1'
721 cpfseq lo ; =1?
722 bra PLED_display_velocity_clear1 ; No, clear text display
723 WIN_BOX_BLACK .20, .90, .65, .75 ; Clear graphic display
724 return
725
726
727 PLED_display_velocity_clear1:
633 movlw d'8' 728 movlw d'8'
634 movwf temp1 729 movwf temp1
635 WIN_TOP .90 730 WIN_TOP .90
636 WIN_LEFT .0 731 WIN_LEFT .0
637 bcf pled_velocity_display 732 bcf pled_velocity_display