Mercurial > public > hwos_code
comparison src/isr.asm @ 204:93085f540746
minor
author | heinrichsweikamp |
---|---|
date | Sun, 23 Nov 2014 22:33:41 +0100 |
parents | dcd513840c6c |
children | 03946aa48fa5 |
comparison
equal
deleted
inserted
replaced
203:dd9b167e82dc | 204:93085f540746 |
---|---|
71 bsf RCSTA2,CREN | 71 bsf RCSTA2,CREN |
72 banksel isr_backup | 72 banksel isr_backup |
73 incf ir_s8_counter,F ; Increase counter | 73 incf ir_s8_counter,F ; Increase counter |
74 movff ir_s8_counter,isr1_temp ; Copy | 74 movff ir_s8_counter,isr1_temp ; Copy |
75 dcfsnz isr1_temp,F | 75 dcfsnz isr1_temp,F |
76 movwf ir_s8_buffer+.0 | 76 movwf ir_s8_buffer+.0 |
77 dcfsnz isr1_temp,F | 77 dcfsnz isr1_temp,F |
78 movwf ir_s8_buffer+.1 | 78 movwf ir_s8_buffer+.1 |
79 dcfsnz isr1_temp,F | 79 dcfsnz isr1_temp,F |
80 movwf ir_s8_buffer+.2 | 80 movwf ir_s8_buffer+.2 |
81 dcfsnz isr1_temp,F | 81 dcfsnz isr1_temp,F |
82 movwf ir_s8_buffer+.3 | 82 movwf ir_s8_buffer+.3 |
83 dcfsnz isr1_temp,F | 83 dcfsnz isr1_temp,F |
84 movwf ir_s8_buffer+.4 | 84 movwf ir_s8_buffer+.4 |
85 dcfsnz isr1_temp,F | 85 dcfsnz isr1_temp,F |
86 movwf ir_s8_buffer+.5 | 86 movwf ir_s8_buffer+.5 |
87 dcfsnz isr1_temp,F | 87 dcfsnz isr1_temp,F |
88 movwf ir_s8_buffer+.6 | 88 movwf ir_s8_buffer+.6 |
89 dcfsnz isr1_temp,F | 89 dcfsnz isr1_temp,F |
90 movwf ir_s8_buffer+.7 | 90 movwf ir_s8_buffer+.7 |
91 dcfsnz isr1_temp,F | 91 dcfsnz isr1_temp,F |
92 movwf ir_s8_buffer+.8 | 92 movwf ir_s8_buffer+.8 |
93 dcfsnz isr1_temp,F | 93 dcfsnz isr1_temp,F |
94 movwf ir_s8_buffer+.9 | 94 movwf ir_s8_buffer+.9 |
95 dcfsnz isr1_temp,F | 95 dcfsnz isr1_temp,F |
96 movwf ir_s8_buffer+.10 | 96 movwf ir_s8_buffer+.10 |
97 dcfsnz isr1_temp,F | 97 dcfsnz isr1_temp,F |
98 movwf ir_s8_buffer+.11 | 98 movwf ir_s8_buffer+.11 |
99 dcfsnz isr1_temp,F | 99 dcfsnz isr1_temp,F |
100 movwf ir_s8_buffer+.12 | 100 movwf ir_s8_buffer+.12 |
101 dcfsnz isr1_temp,F | 101 dcfsnz isr1_temp,F |
102 movwf ir_s8_buffer+.13 | 102 movwf ir_s8_buffer+.13 |
103 dcfsnz isr1_temp,F | 103 dcfsnz isr1_temp,F |
104 movwf ir_s8_buffer+.14 | 104 movwf ir_s8_buffer+.14 |
105 dcfsnz isr1_temp,F | 105 dcfsnz isr1_temp,F |
106 movwf ir_s8_buffer+.15 | 106 movwf ir_s8_buffer+.15 |
107 dcfsnz isr1_temp,F | 107 dcfsnz isr1_temp,F |
108 movwf ir_s8_buffer+.16 | 108 movwf ir_s8_buffer+.16 |
109 dcfsnz isr1_temp,F | 109 dcfsnz isr1_temp,F |
110 movwf ir_s8_buffer+.17 | 110 movwf ir_s8_buffer+.17 |
111 | 111 |
112 clrf TMR3L ; Preload timer | 112 clrf TMR3L ; Preload timer |
113 movlw .253 | 113 movlw .253 |
114 movwf TMR3H | 114 movwf TMR3H |
115 bsf T3CON,TMR3ON ; (Re)Start Timeout counter | 115 bsf T3CON,TMR3ON ; (Re)Start Timeout counter |
614 addwf isr1_temp,F | 614 addwf isr1_temp,F |
615 movlw HIGH current_speed_normal | 615 movlw HIGH current_speed_normal |
616 addwfc isr2_temp,F | 616 addwfc isr2_temp,F |
617 bra isr_battery_gauge5 | 617 bra isr_battery_gauge5 |
618 isr_battery_gauge4: | 618 isr_battery_gauge4: |
619 ; movlw .3 | |
620 ; cpfseq speed_setting | |
621 ; bra isr_battery_gauge5 | |
622 banksel isr_backup ; Bank0 ISR data | 619 banksel isr_backup ; Bank0 ISR data |
623 movlw LOW current_speed_fastest | 620 movlw LOW current_speed_fastest |
624 addwf isr1_temp,F | 621 addwf isr1_temp,F |
625 movlw HIGH current_speed_fastest | 622 movlw HIGH current_speed_fastest |
626 addwfc isr2_temp,F | 623 addwfc isr2_temp,F |
700 | 697 |
701 ;============================================================================= | 698 ;============================================================================= |
702 | 699 |
703 isr_switch_right: ; | 700 isr_switch_right: ; |
704 bcf INTCON,INT0IE ; Disable INT0 | 701 bcf INTCON,INT0IE ; Disable INT0 |
705 ; bcf power_sw2 ; Power-down switch circuity | |
706 banksel common ; flag1 is in Bank1 | 702 banksel common ; flag1 is in Bank1 |
707 btfss flip_screen ; 180° flipped? | 703 btfss flip_screen ; 180° flipped? |
708 bsf switch_right ; Set flag | 704 bsf switch_right ; Set flag |
709 btfsc flip_screen ; 180° flipped? | 705 btfsc flip_screen ; 180° flipped? |
710 bsf switch_left ; Set flag | 706 bsf switch_left ; Set flag |
711 bra isr_switch_common ; Continue... | 707 bra isr_switch_common ; Continue... |
712 | 708 |
713 isr_switch_left: ; | 709 isr_switch_left: ; |
714 bcf INTCON3,INT1IE ; Disable INT1 | 710 bcf INTCON3,INT1IE ; Disable INT1 |
715 ; bcf power_sw1 ; Power-down switch circuity | |
716 banksel common ; flag1 is in Bank1 | 711 banksel common ; flag1 is in Bank1 |
717 btfss flip_screen ; 180° flipped? | 712 btfss flip_screen ; 180° flipped? |
718 bsf switch_left ; Set flag | 713 bsf switch_left ; Set flag |
719 btfsc flip_screen ; 180° flipped? | 714 btfsc flip_screen ; 180° flipped? |
720 bsf switch_right ; Set flag | 715 bsf switch_right ; Set flag |
721 | |
722 isr_switch_common: | 716 isr_switch_common: |
723 ; load timer1 for first press | 717 ; load timer1 for first press |
724 clrf TMR1L | 718 clrf TMR1L |
725 movlw TMR1H_VALUE_FIRST ; in steps of 7,8125ms | 719 movlw TMR1H_VALUE_FIRST ; in steps of 7,8125ms |
726 movwf TMR1H | 720 movwf TMR1H |
727 bsf T1CON,TMR1ON ; Start Timer 1 | 721 bsf T1CON,TMR1ON ; Start Timer 1 |
728 ; nop | |
729 ; nop | |
730 ; nop | |
731 ; nop | |
732 ; nop | |
733 ; nop | |
734 ; nop | |
735 ; nop | |
736 ; nop | |
737 ; nop | |
738 ; nop | |
739 ; nop | |
740 ; nop | |
741 ; nop | |
742 ; nop | |
743 ; nop | |
744 ; nop | |
745 ; nop | |
746 ; nop | |
747 ; nop | |
748 ; nop | |
749 ; nop | |
750 ; nop | |
751 ; nop | |
752 | |
753 banksel isr_backup ; Select Bank0 for ISR data. | 722 banksel isr_backup ; Select Bank0 for ISR data. |
754 ; bsf power_sw1 | |
755 bcf INTCON3,INT1IF ; Clear flag | 723 bcf INTCON3,INT1IF ; Clear flag |
756 ; bsf power_sw2 ; Power-up switch circuity | |
757 bcf INTCON,INT0IF ; Clear flag | 724 bcf INTCON,INT0IF ; Clear flag |
758 return | 725 return |
759 | 726 |
760 timer1int: | 727 timer1int: |
761 bcf PIR1,TMR1IF ; Clear flag | 728 bcf PIR1,TMR1IF ; Clear flag |
762 banksel common ; flag1 is in Bank1 | 729 banksel common ; flag1 is in Bank1 |
730 bcf INTCON,INT0IF ; Clear flag | |
731 bcf INTCON3,INT1IF ; Clear flag | |
763 btfss switch_left1 ; Left button hold-down? | 732 btfss switch_left1 ; Left button hold-down? |
764 bra timer1int_left ; Yes | 733 bra timer1int_left ; Yes |
765 btfss switch_right2 ; Right button hold-down? | 734 btfss switch_right2 ; Right button hold-down? |
766 bra timer1int_right ; Yes | 735 bra timer1int_right ; Yes |
767 | 736 |
768 ; No button hold-down, stop Timer 1 | 737 ; No button hold-down, stop Timer 1 |
769 bcf T1CON,TMR1ON ; Stop Timer 1 | 738 bcf T1CON,TMR1ON ; Stop Timer 1 |
770 bsf INTCON,INT0IE ; Enable INT0 | 739 bsf INTCON,INT0IE ; Enable INT0 |
771 bsf INTCON3,INT1IE ; Enable INT1 | 740 bsf INTCON3,INT1IE ; Enable INT1 |
772 bcf INTCON,INT0IF ; Clear flag | |
773 bcf INTCON3,INT1IF ; Clear flag | |
774 return | 741 return |
775 | 742 |
776 timer1int_left: | 743 timer1int_left: |
777 btfss flip_screen ; 180° flipped? | 744 btfss flip_screen ; 180° flipped? |
778 bsf switch_left ; (Re-)Set flag | 745 bsf switch_left ; (Re-)Set flag |
789 clrf TMR1L | 756 clrf TMR1L |
790 movlw TMR1H_VALUE_CONT ; Surface mode | 757 movlw TMR1H_VALUE_CONT ; Surface mode |
791 btfsc divemode | 758 btfsc divemode |
792 movlw TMR1H_VALUE_CONT_DIVE ; Dive mode | 759 movlw TMR1H_VALUE_CONT_DIVE ; Dive mode |
793 movwf TMR1H | 760 movwf TMR1H |
794 ; nop | |
795 ; nop | |
796 ; nop | |
797 ; nop | |
798 ; nop | |
799 ; nop | |
800 ; nop | |
801 ; nop | |
802 ; nop | |
803 ; nop | |
804 ; nop | |
805 ; nop | |
806 ; nop | |
807 ; nop | |
808 ; nop | |
809 ; nop | |
810 ; | |
811 ; nop | |
812 ; nop | |
813 ; nop | |
814 ; nop | |
815 ; nop | |
816 ; nop | |
817 ; nop | |
818 ; nop | |
819 ; bsf power_sw1 | |
820 bcf INTCON3,INT1IF ; Clear flag | |
821 ; bsf power_sw2 ; Power-up switch circuity | |
822 bcf INTCON,INT0IF ; Clear flag | |
823 return ; Return from timer1int with timer1 kept running | 761 return ; Return from timer1int with timer1 kept running |
824 | 762 |
825 ;============================================================================= | 763 ;============================================================================= |
826 | 764 |
827 check_nofly_desat_time: | 765 check_nofly_desat_time: |