timer2.lst
来自「mifarea卡程序mifarea卡程序mifarea卡程序」· LST 代码 · 共 284 行 · 第 1/2 页
LST
284 行
C51 COMPILER V7.02a TIMER2 07/23/2003 18:03:53 PAGE 1
C51 COMPILER V7.02a, COMPILATION OF MODULE TIMER2
OBJECT MODULE PLACED IN Timer2.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE source\Timer2.c LARGE BROWSE ORDER NOAREGS DEBUG OBJECTEXTEND PRINT(.\Timer
-2.lst) OBJECT(Timer2.obj)
stmt level source
1 /****************************************************************************
2 * File: Timer2.c
3 * Version: 1.0
4 * Created: 2003.07.11
5 * Last Change: 2003.07.11
6 * Author: dong yongde
7 * Company: LANTOON TECH
8 * Compiler: KEIL C51 uVision2 V2.32
9 * Description: Timer 2 of 51
10 ****************************************************************************/
11 #include "p89c51rx.h"
*** WARNING C318 IN LINE 11 OF source\Timer2.c: can't open file 'p89c51rx.h'
12 #include "timer2.h"
13
14
15 // Timer 2
16 bit T2IR = 0; // Timer2 timeout flag
17 unsigned int CountDown = 0; // Timeout counter with 50us resolution
18
19 //----------------------------------------------------------------------------
20 //
21 // FUNCTION: start_timeout
22 //
23 // IN: _50us
24 // OUT: -
25 //
26 // COMMENT: Using Timer2 to generate timeout with a resolution of 50 us.
27 // Timeout is calculated in the interrupt routine.
28 // Max Timeout = 65535 x 50us = 3.277s
29 //
30 //----------------------------------------------------------------------------
31 void start_timeout(unsigned int _50us)
32 {
33 1 ET2 = 0; // Disable Timer2 interrupt
*** ERROR C202 IN LINE 33 OF SOURCE\TIMER2.C: 'ET2': undefined identifier
34 1 TR2 = 0;
*** ERROR C202 IN LINE 34 OF SOURCE\TIMER2.C: 'TR2': undefined identifier
35 1 RCAP2LH = RCAP2_50us;
*** ERROR C202 IN LINE 35 OF SOURCE\TIMER2.C: 'RCAP2LH': undefined identifier
36 1 T2LH = RCAP2_50us;
*** ERROR C202 IN LINE 36 OF SOURCE\TIMER2.C: 'T2LH': undefined identifier
37 1 CountDown = _50us;
38 1 T2IR = 0; // Reset timeout state
39 1 T2CON = 0x04; // 16-bit auto-reload, clear TF2, start timer
*** ERROR C202 IN LINE 39 OF SOURCE\TIMER2.C: 'T2CON': undefined identifier
40 1 ET2 = 1; // Enable Timer2 interrupt
*** ERROR C202 IN LINE 40 OF SOURCE\TIMER2.C: 'ET2': undefined identifier
41 1 }
42
43 //----------------------------------------------------------------------------
44 //
45 // FUNCTION: stop_timeout
46 //
47 // IN: -
C51 COMPILER V7.02a TIMER2 07/23/2003 18:03:53 PAGE 2
48 // OUT: -
49 //
50 // COMMENT: Stop Timer2 and clear timeout state
51 //
52 //----------------------------------------------------------------------------
53 void stop_timeout(void)
54 {
55 1 ET2 = 0; // disable Timer2 interrupt
*** ERROR C202 IN LINE 55 OF SOURCE\TIMER2.C: 'ET2': undefined identifier
56 1 CountDown = 0;
57 1 T2CON = 0x00; // 16-bit auto-reload, clear TF2, stop timer
*** ERROR C202 IN LINE 57 OF SOURCE\TIMER2.C: 'T2CON': undefined identifier
58 1 }
59
60 ///////////////////////////////////////////////////////////////////////////////
61 // Interrupt Handler TIMER2
62 ///////////////////////////////////////////////////////////////////////////////
63 void TIMEOUTISR (void) interrupt TF2_VECTOR using 2 //Timer2 interrupt//5
*** ERROR C141 IN LINE 63 OF SOURCE\TIMER2.C: syntax error near 'TF2_VECTOR', expected 'const'
*** ERROR C132 IN LINE 63 OF SOURCE\TIMER2.C: 'TF2_VECTOR': not in formal parameter list
*** ERROR C141 IN LINE 63 OF SOURCE\TIMER2.C: syntax error near 'using'
64 {
65 if(CountDown)
66 CountDown--; // Decrease timeout counter
*** ERROR C132 IN LINE 66 OF SOURCE\TIMER2.C: 'CountDown': not in formal parameter list
*** ERROR C141 IN LINE 66 OF SOURCE\TIMER2.C: syntax error near 'CountDown'
*** ERROR C132 IN LINE 66 OF SOURCE\TIMER2.C: 'CountDown': not in formal parameter list
67 if(!CountDown)
*** ERROR C132 IN LINE 67 OF SOURCE\TIMER2.C: 'CountDown': not in formal parameter list
68 {
69 T2IR = 1; // Set timeout state
*** ERROR C279 IN LINE 69 OF SOURCE\TIMER2.C: 'T2IR': multiple initialization
*** ERROR C244 IN LINE 69 OF SOURCE\TIMER2.C: 'T2IR': can't initialize, bad type or class
*** ERROR C132 IN LINE 69 OF SOURCE\TIMER2.C: 'T2IR': not in formal parameter list
70 TR2 = 0;
*** ERROR C244 IN LINE 70 OF SOURCE\TIMER2.C: 'TR2': can't initialize, bad type or class
*** ERROR C132 IN LINE 70 OF SOURCE\TIMER2.C: 'TR2': not in formal parameter list
71 }
*** ERROR C141 IN LINE 71 OF SOURCE\TIMER2.C: syntax error near '}'
72 TF2 = 0;
73 }
*** ERROR C141 IN LINE 73 OF SOURCE\TIMER2.C: syntax error near '}'
74
75 /////////////////////////////////////////////////////////////////////////
76 /****************************************************************************
77 * *
78 * Function: delay_50us *
79 * *
80 * Input: _50us *
81 * Output: - *
82 * *
83 * Description: *
84 * *
85 * Time delay with a resolution of 50 us. *
86 * *
87 ****************************************************************************/
88
89 void delay_50us (unsigned char _50us)
90 {
91 1
92 1 RCAP2LH = RCAP2_50us;
*** ERROR C202 IN LINE 92 OF SOURCE\TIMER2.C: 'RCAP2LH': undefined identifier
C51 COMPILER V7.02a TIMER2 07/23/2003 18:03:53 PAGE 3
93 1 T2LH = RCAP2_50us;
*** ERROR C202 IN LINE 93 OF SOURCE\TIMER2.C: 'T2LH': undefined identifier
94 1 ET2 = 0; // Disable timer2 interrupt
*** ERROR C202 IN LINE 94 OF SOURCE\TIMER2.C: 'ET2': undefined identifier
95 1 T2CON = 0x04; // 16-bit auto-reload, clear TF2, start timer
*** ERROR C202 IN LINE 95 OF SOURCE\TIMER2.C: 'T2CON': undefined identifier
96 1
97 1 while (_50us--)
98 1 {
99 2 while (!TF2);
100 2 TF2 = 0;//FALSE;
101 2 }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?