📄 timer_func.lst
字号:
C51 COMPILER V7.06 TIMER_FUNC 10/10/2004 20:51:47 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE TIMER_FUNC
OBJECT MODULE PLACED IN timer_func.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE timer_func.c LARGE BROWSE DEBUG OBJECTEXTEND
stmt level source
1 // A collection of general functions for WSi evaluation hardware.
2 //
3 // These functions must reside in common FLASH so that they may be
4 // executed from any page.
5
6
7 #include "upsd_cfg.h"
8
9 #include "general.h"
10 #include "timer.h"
11
12 //Timer functions are ready for 1ms interval
13
14 #define TIMER0_SCALE TIMER0_PERIOD/1000
15
16 int counter;
17
18 /*------------------------------------------------------------------------------
19 This function extend Timer0 operation in every timer0 interrupt
20 ------------------------------------------------------------------------------*/
21 void do_timer0(void) {
22 1
23 1 // put your extended functions for timer0 interrupt
24 1
25 1 counter++;
26 1 }
27
28 /*------------------------------------------------------------------------------
29 // Following are a collection of timer routines.
30 ------------------------------------------------------------------------------*/
31 void delay_ms(count)
32 uint count;
33 {
34 1 if(count <= TIMER0_SCALE)
35 1 timer0_wait(count);
36 1 else
37 1 {
38 2 count /= TIMER0_SCALE;
39 2 timer0_wait(count);
40 2 }
41 1 }
42 /*
43 void delay_1sec(void)
44 {
45 timer0_wait(1000);
46 }
47
48
49 void delay_2sec(void)
50 {
51 timer0_wait(200);
52 }
53
54 void delay_10sec(void)
55 {
C51 COMPILER V7.06 TIMER_FUNC 10/10/2004 20:51:47 PAGE 2
56 timer0_wait(1000);
57 }
58
59 void delay_0_5sec(void)
60 {
61 timer0_wait(50);
62 }
63
64 void delay_0_1sec(void)
65 {
66 timer0_wait(10);
67 }
68
69 void delay_46us(void) // Delay of 44.8 usec. measured
70 {
71 delay_14us();
72 delay_14us();
73 delay_14us();
74 }
75
76 void delay_14us(void) // Delay of 14.8us w/16Mhz 8031 measured
77 {
78 uchar a;
79 uchar b;
80 data uint c;
81 a=1;
82 b=2;
83 c=a+b;
84 a=3;
85 b=c;
86 c=4;
87 }
88 */
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 60 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = 2 2
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -