comparison src/isr.asm @ 560:b7eb98dbd800

bump to 2.96beta (REFACTORED VERSION)
author heinrichsweikamp
date Wed, 31 Jan 2018 19:39:37 +0100
parents 8dfb93e80338
children 0ba88db66492
comparison
equal deleted inserted replaced
559:9cb967d844f0 560:b7eb98dbd800
1 ;============================================================================= 1 ;=============================================================================
2 ; 2 ;
3 ; File isr.asm 3 ; File isr.asm REFACTORED VERSION V2.92
4 ; 4 ;
5 ; INTERUPT subroutines 5 ; INTERUPT subroutines
6 ; 6 ;
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. 7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
8 ;============================================================================= 8 ;=============================================================================
17 17
18 ;============================================================================= 18 ;=============================================================================
19 19
20 extern start 20 extern start
21 21
22 isr_high CODE 0x0008 ;High Priority Interrups 22 isr_high CODE 0x0008 ; High Priority Interrups
23 bra HighInt 23 bra HighInt
24 nop 24 nop
25 nop 25 nop
26 nop 26 nop
27 nop 27 nop
28 nop 28 nop
29 nop 29 nop
30 bra HighInt 30 bra HighInt
31 31
32 isr_low CODE 0x00018 ;Low Priority Interrups 32 isr_low CODE 0x00018 ; Low Priority Interrups
33 ; *** low priority interrupts not used 33 ; *** low priority interrupts not used
34 retfie FAST ; Restores BSR, STATUS and WREG 34 retfie FAST ; Restores BSR, STATUS and WREG
35 35
36 HighInt: 36 HighInt:
37 movff PRODL,isr_prod+0 37 movff PRODL,isr_prod+0
43 btfsc INTCON,INT0IF ; Buttons 43 btfsc INTCON,INT0IF ; Buttons
44 rcall isr_switch_right 44 rcall isr_switch_right
45 btfsc INTCON3,INT1IF ; Buttons 45 btfsc INTCON3,INT1IF ; Buttons
46 rcall isr_switch_left 46 rcall isr_switch_left
47 47
48 ; IR/S8-Link 48 ; IR/S8-Linktimer1int
49 btfsc PIR3,RC2IF ; UART2 49 btfsc PIR3,RC2IF ; UART2
50 rcall isr_uart2 ; IR/S8-Link 50 rcall isr_uart2 ; IR/S8-Link
51 btfsc PIR2,TMR3IF ; Timer 3 51 btfsc PIR2,TMR3IF ; Timer 3
52 rcall isr_timer3 ; IR-Link Timeout 52 rcall isr_timer3 ; IR-Link Timeout
53 53
102 102
103 isr_restore CODE 0x00080 ; Restore first flash page from EEPROM 103 isr_restore CODE 0x00080 ; Restore first flash page from EEPROM
104 restore_flash_0x00080: 104 restore_flash_0x00080:
105 goto restore_flash 105 goto restore_flash
106 106
107 107 isr_routines; CODE
108 ;============================================================================= 108 ;=============================================================================
109 109
110 isr_uart2: ; IR/S8-Link 110 isr_uart2: ; IR/S8-Link
111 banksel RCREG2 111 banksel RCREG2
112 movf RCREG2,W 112 movf RCREG2,W
836 return ; Return from timer1int with timer1 kept running 836 return ; Return from timer1int with timer1 kept running
837 837
838 ;============================================================================= 838 ;=============================================================================
839 839
840 check_nofly_desat_time: 840 check_nofly_desat_time:
841 movf nofly_time+0,W ; Is nofly null ? 841
842 iorwf nofly_time+1,W 842 ; DELETE - no-fly time is now re-computed every second ## no fly
843 bz check_nofly_desat_time2 ; yes... 843 ; ; REPLACE ## no fly
844 844 ; ; movf nofly_time+0,W ; Is nofly null ?
845 movlw d'1' 845 ; ; iorwf nofly_time+1,W
846 subwf nofly_time+0,F 846 ; ; BY
847 movlw d'0' 847 ; banksel int_O_nofly_time
848 subwfb nofly_time+1,F ; reduce by one 848 ; movf int_O_nofly_time+0,W ; Is nofly null ?
849 ; iorwf int_O_nofly_time+1,W
850
851 ; bz check_nofly_desat_time2 ; yes...
852
853 ; movlw d'1'
854 ; ; REPLACE ## no fly
855 ; ; subwf nofly_time+0,F
856 ; ; BY
857 ; subwf int_O_nofly_time+0,F
858
859 ; movlw d'0'
860
861 ; ; REPLACE ## no fly
862 ; ; subwfb nofly_time+1,F ; reduce by one
863 ; ; BY
864 ; subwfb int_O_nofly_time+1,F ; reduce by one
849 865
850 check_nofly_desat_time2: 866 check_nofly_desat_time2:
851 movf desaturation_time+0,W ; Is Desat null ? 867 ; REPLACE
852 iorwf desaturation_time+1,W 868 ; movf desaturation_time+0,W ; Is Desat null ?
853 bz check_nofly_desat_time3 ; yes... 869 ; iorwf desaturation_time+1,W
854 870 ; BY
855 movlw d'1' 871 banksel int_O_desaturation_time
856 subwf desaturation_time+0,F 872 movf int_O_desaturation_time+0,W ; Is Desat null ?
857 movlw d'0' 873 iorwf int_O_desaturation_time+1,W
858 subwfb desaturation_time+1,F ; reduce by one... 874
875 bz check_nofly_desat_time3 ; yes...
876
877 ; DELETE - desat-time is now re-computed every second ## no fly
878 ; movlw d'1'
879 ; ; REPLACE ## no fly
880 ; ; subwf desaturation_time+0,F
881 ; ; BY
882 ; subwf int_O_desaturation_time+0,F
883
884 ; movlw d'0'
885
886 ; ; REPLACE ## no fly
887 ; ; subwfb desaturation_time+1,F ; reduce by one...
888 ; ; by
889 ; subwfb int_O_desaturation_time+1,F ; reduce by one...
890 banksel common
859 891
860 ; Increase surface interval timer 892 ; Increase surface interval timer
861 infsnz surface_interval+0,F 893 infsnz surface_interval+0,F
862 incf surface_interval+1,F 894 incf surface_interval+1,F
863 return ; Done 895 return ; Done
864 896
865 check_nofly_desat_time3: 897 check_nofly_desat_time3:
898 ; NEW ## no fly
899 banksel common
900
866 clrf surface_interval+0 901 clrf surface_interval+0
867 clrf surface_interval+1 ; Clear surface interval timer 902 clrf surface_interval+1 ; Clear surface interval timer
868 return ; Done. 903 return ; Done.
869 904
870 ;============================================================================= 905 ;=============================================================================