?? util.lst
字號:
C51 COMPILER V7.50 UTIL 05/19/2008 18:30:54 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE UTIL
OBJECT MODULE PLACED IN util.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE util.c BROWSE DEBUG OBJECTEXTEND CODE
line level source
1 /* YuanGao electronic designe co.ldt
2 (c) Copyright 2002,2003, All Rights Reserved */
3
4 #include <w77e58.h>
*** WARNING C318 IN LINE 4 OF util.c: can't open file 'w77e58.h'
5 #include "global.h"
6 #include "io.h"
*** ERROR C202 IN LINE 5 OF IO.H: 'P3': undefined identifier
*** ERROR C202 IN LINE 6 OF IO.H: 'P3': undefined identifier
*** ERROR C202 IN LINE 7 OF IO.H: 'P1': undefined identifier
*** ERROR C202 IN LINE 9 OF IO.H: 'P3': undefined identifier
*** ERROR C202 IN LINE 10 OF IO.H: 'P1': undefined identifier
*** ERROR C202 IN LINE 11 OF IO.H: 'P2': undefined identifier
*** ERROR C202 IN LINE 12 OF IO.H: 'P2': undefined identifier
*** ERROR C202 IN LINE 13 OF IO.H: 'P2': undefined identifier
*** ERROR C202 IN LINE 14 OF IO.H: 'P2': undefined identifier
*** ERROR C202 IN LINE 17 OF IO.H: 'P1': undefined identifier
7 #include "util.h"
8
9
10 //#define UART0_9600_11M
11 #define UART0_19200_11M
12
13 //#define UART0_38400_11M
14
15
16 //uchar idata SysTask;
17 uchar idata SysTimer;
18 uchar idata Uart0Timer;
19 UINT16 idata GPSTimer30;
20
21 uchar idata _timer0=0; /* timer0 interrupt counter, use this counter to adjust timeout counte
-rs period */
22 #define TIMEOUT_FACTOR 17 /* timeout factor x 1.0ms (timer0 period) = actual timeout p
-eriod */
23
24
25
26 //P3.2 0003H INT0
27 void ISR_INT0(void) interrupt 0 //using 1
28 {
29 1 ;
30 1 }
31
32
33
34 //Timer0 000BH
35 void ISR_Timer0(void) interrupt 1 //using 2
36 {
37 1
38 1 //TIMER0: Mode 1每中斷一次的時間間隔是:Timer=T x (2^16-TH0TL0),T=(12/11.0592)/4; 0XF760的定時是:0.27
-126736 X (65536-63328)=0.27126736X2208=599u
39 1 //TIMEOUT_FACTOR=17的定時為:17x599us =10183 us =10(ms)
40 1
41 1
C51 COMPILER V7.50 UTIL 05/19/2008 18:30:54 PAGE 2
42 1 TF0 = 0;
*** ERROR C202 IN LINE 42 OF UTIL.C: 'TF0': undefined identifier
43 1 TH0 = 0xF7;
*** ERROR C202 IN LINE 43 OF UTIL.C: 'TH0': undefined identifier
44 1 TL0 = 0x60;
*** ERROR C202 IN LINE 44 OF UTIL.C: 'TL0': undefined identifier
45 1 TR0 = 1;
*** ERROR C202 IN LINE 45 OF UTIL.C: 'TR0': undefined identifier
46 1
47 1 /* count down timeout counters */
48 1 if( _timer0 < TIMEOUT_FACTOR )
49 1 _timer0++;
50 1 else
51 1 {
52 2 _timer0 = 0;
53 2 if(SysTimer) SysTimer--;
54 2 if(Uart0Timer) Uart0Timer--;
55 2 if(GPSTimer30) GPSTimer30--;
56 2
57 2
58 2 }
59 1
60 1 }
61
62
63 //P3.3 Int1 0013H
64 void ISR_INT1(void) interrupt 2 //using 1
65 {
66 1
67 1
68 1
69 1 }
70
71
72
73
74
75
76
77 /**************************************************************************
78 * Timer1 for 1.5ms interrupt
79 **************************************************************************/
80 //Timer1 001bH
81 void ISR_Timer1(void) interrupt 3 //using 1
82 {
83 1 #if 0
TH1 = 0xf7; /* 0xf7 */
TL1 = 0; /* 0x0 */
TR1 = 1;
/* count down timeout counters */
if( _timer0 < TIMEOUT_FACTOR )
_timer0++;
else
{
_timer0 = 0;
if(SysTimer) SysTimer--;
}
#endif
C51 COMPILER V7.50 UTIL 05/19/2008 18:30:54 PAGE 3
100 1
101 1
102 1 }
103
104
105
106 #if 0
//*****************************************
//串口中斷處理
//serial_0 0023H
void serial(void) interrupt 4 //using 2
{
if (TI)
{
TI = 0;
//SBUF='1';
#if 1
if (outbufsign)
//if (putlast==outlast) outbufsign=0;
//else
{
SBUF=*outlast; //未發送完繼續發送
outlast++; //最后傳出去的字節位置加一
if (outlast==outbuf+OLEN) outlast=outbuf;//地址到頂部回到底部
if (putlast==outlast) outbufsign=0; //數據發送完置發送緩沖區空標志
}
else outbufsign0=0;
#endif
}
if (RI)
{
#if 0
RI = 0;
if(!inbufful)
{
*inlast= SBUF; //放入數據
inlast++; //最后放入的位置加一
inbufsign=1;
if (inlast==inbuf+ILEN) inlast=inbuf; //地址到頂部回到底部
if (inlast==getlast) inbufful=1; //接收緩沖區滿置滿標志
}
#endif
}
}
#endif
152
153
154 /**************************************************************************
155 * Timer2 for 2ms interrupt
156 **************************************************************************/
157 //002BH
158 void ISR_Timer2(void) interrupt 5 //using 1
159 {
160 1
161 1 ;
C51 COMPILER V7.50 UTIL 05/19/2008 18:30:54 PAGE 4
162 1
163 1 }
164
165
166 #if 0
//SERIAL 1 003BH
void serial_1(void) interrupt 7 //using 2
{
if(RI_1)
{
RI_1 = 0;
}
if(TI_1)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -