📄 isr.lst
字号:
C51 COMPILER V7.06 ISR 09/09/2005 13:57:31 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE ISR
OBJECT MODULE PLACED IN ISR.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE ISR.C BROWSE DEBUG OBJECTEXTEND
stmt level source
1 #include "stdio.h"
2 #include "HAL.H"
3 //#include "USBD12.H"
4 #include "SMPro.H"
5 //#include "USB110.H"
6 #include "USB.H"
7 #include "VDOR.H"
8 #include "Isp1581.h"
9 #include "main.h"
10 #include "Isr.h"
11 #include "Iso.h"
12 //#include "Hal4sys.h"
13 #include <AT89X52.H>
14
15 /*
16 //*************************************************************************
17 // Public static data
18 //*************************************************************************
19 */
20
21 extern ZBOARDFLAGS bZBoardFlags;
22 extern CONTROL_XFER ControlData;
23 extern GLOBE_VARIABLE globe_variable;
24 extern IO_REQUEST idata ioRequest;
25 unsigned char idata GenEpBuf[EP1_PACKET_SIZE];
26 /* ISR static vars */
27 unsigned long lClockTicks = 0;
28 unsigned char dmanum=0;
29
30 extern bit writeramflag;
31 extern unsigned char writeramlen;
32
33 /*
34 void ISR_Timer2(void) interrupt 5
35 {
36 }
37
38 void ISR_COMM(void) interrupt 4
39 {
40 }
41
42 void ISR_Timer1(void) interrupt 3
43 {
44 }
45
46 void ISR_INT1(void) interrupt 2
47 {
48 }
49 */
50 void ISR_Timer0(void) interrupt 1
51 {
52 1 DISABLE_INTERRUPTS;
53 1 lClockTicks ++;
54 1 bZBoardFlags.bits.bTimer = 1;
55 1 ENABLE_INTERRUPTS;
C51 COMPILER V7.06 ISR 09/09/2005 13:57:31 PAGE 2
56 1 }
57
58
59 void ISR_INT0(void) interrupt 0
60 {
61 1 DISABLE_INTERRUPTS;
62 1 ISRx_FN_USB();
63 1 ENABLE_INTERRUPTS;
64 1 }
65 /*void ISR_timer1(void) interrupt 3
66 {
67 DISABLE_INTERRUPTS;
68 T1=0;
69 T1=1;
70 //MCU_LED0=!MCU_LED0;
71 //dmanum+=1;
72 //TF1=0;
73 ENABLE_INTERRUPTS;
74 }*/
75 void ISRx_FN_USB()
76 {
77 1 //unsigned int nST;
78 1 USHORT int_low, int_high;
79 1 unsigned char nosetup;
80 1 //bZBoardFlags.bits.bIN_ISR = 1;
81 1 bZBoardFlags.bits.At_IRQL1 = 1;
82 1
83 1 int_low = ISP1581_ReadInterruptRegisterLow();
84 1 int_high = ISP1581_ReadInterruptRegisterHigh();
85 1 if(int_low != 0 || int_high != 0)
86 1 {
87 2 if(int_low & int_busreset)
88 2 {
89 3 ISP1581_IntClearl(int_busreset);
90 3 if(int_low & int_hs_stat)
91 3 {
92 4 bZBoardFlags.bits.ConnectSpeed = HighSpeed;
93 4 bZBoardFlags.bits.bBus_Reset = 1;
94 4 int_low &= ~int_hs_stat;
95 4 ISP1581_IntClearl(int_hs_stat);
96 4
97 4 }
98 3 else
99 3 {
100 4 bZBoardFlags.bits.ConnectSpeed = FullSpeed;
101 4 bZBoardFlags.bits.bBus_Reset = 1;
102 4 MCU_LED1 = 1;
103 4 }
104 3 }
105 2 if(int_low & int_hs_stat)
106 2 {
107 3 ISP1581_IntClearl(int_hs_stat);
108 3 if(bZBoardFlags.bits.ConnectSpeed == FullSpeed)
109 3 {
110 4 bZBoardFlags.bits.ConnectSpeed = HighSpeed;
111 4 bZBoardFlags.bits.bBus_Reset = 1;
112 4 MCU_LED1 = 0;
113 4 }
114 3 }
115 2 else if(int_low & int_susp)
116 2 {Isr_SuspendChange();}
117 2 else if(int_low & int_resume)
C51 COMPILER V7.06 ISR 09/09/2005 13:57:31 PAGE 3
118 2 {Isr_Resume();}
119 2 else if(int_low & int_dma)
120 2 {Isr_DmaEot();}
121 2 else if(int_low & (int_sof|int_psof))
122 2 {Isr_SOF();}
123 2 else {
124 3 if(int_low & int_ep0set)
125 3 {nosetup = 0x0;}
126 3 else
127 3 {nosetup = 0x1;}
128 3 if(int_low & int_ep1rx)
129 3 Isr_Ep01rxDone();
130 3 if(int_low & int_ep1tx)
131 3 Isr_Ep01txDone();
132 3 if(int_low & int_ep2rx)
133 3 Isr_Ep02rxDone();
134 3 if(int_low & int_ep2tx)
135 3 Isr_Ep02txDone();
136 3 if(int_high & int_ep3rx)
137 3 Isr_Ep03rxDone();
138 3 if(int_high & int_ep3tx)
139 3 Isr_Ep03txDone();
140 3 // *************************** Control pipe *******************************
141 3 if(int_low & int_ep0tx)
142 3 Isr_Ep00TxDone(nosetup);
143 3
144 3 if(int_low & int_ep0rx) /*Keep Control Out of EP0 at Highest priority*/
145 3 Isr_Ep00RxDone(nosetup);
146 3
147 3 if(nosetup == 0)
148 3 Isr_EP0Setup();
149 3 //**************************** not used endpoints*************************
150 3 if(int_high & int_ep4rx)
151 3 Isr_Ep04rxDone();
152 3 if(int_high & int_ep4tx)
153 3 Isr_Ep04txDone();
154 3 }
155 2
156 2 }
157 1 bZBoardFlags.bits.At_IRQL1 = 0;
158 1
159 1 }
160 ///////////////////////////////////////////////////////////////////////////
161 void Isr_SuspendChange(void)
162 {
163 1 ISP1581_IntClearl(int_susp);
164 1 ISP1581_GoSuspend();
165 1 }
166
167 void Isr_Resume(void)
168 {
169 1 ISP1581_UnlockDevice();
170 1 ISP1581_SendResume();
171 1 ISP1581_IntClearl(int_resume);
172 1 }
173
174 void Isr_DmaEot(void)
175 {
176 1 unsigned short dmaeot_reason;// dma_width16, isp1581_dma_counter_remains;
177 1 //unsigned int c;
178 1 dmaeot_reason = ISP1581_GetDMAInt();
179 1 ISP1581_SetDMAInt(dmaeot_reason);//clear DMA interrupt ;
C51 COMPILER V7.06 ISR 09/09/2005 13:57:31 PAGE 4
180 1 ISP1581_IntClearl(int_dma);
181 1
182 1 //CPLD_ctl(dmactl_stop);
183 1 //ISP1581_SetDMACMD(dmacmd_reset);
184 1 //ISP1581_SetDMAIntMask(0);
185 1 //c = ISP1581_GetIntEnableLow();
186 1 //ISP1581_SetIntEnableLow(c|bulkinendpointinterrupt|bulkoutendpointinterrupt);
187 1
188 1 //清除中断标志
189 1 MCU_LED1=!MCU_LED1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -