102 lines
3.5 KiB
Plaintext
102 lines
3.5 KiB
Plaintext
|
C51 COMPILER V9.59.0.0 LED 03/12/2024 11:36:12 PAGE 1
|
|||
|
|
|||
|
|
|||
|
C51 COMPILER V9.59.0.0, COMPILATION OF MODULE LED
|
|||
|
OBJECT MODULE PLACED IN .\Objects\Led.obj
|
|||
|
COMPILER INVOKED BY: D:\Keil_v5\C51\BIN\C51.EXE ..\Driver\Led.c OPTIMIZE(8,SPEED) BROWSE INCDIR(..\Driver) DEBUG OBJECTE
|
|||
|
-XTEND PRINT(.\Listings\Led.lst) TABS(2) OBJECT(.\Objects\Led.obj)
|
|||
|
|
|||
|
line level source
|
|||
|
|
|||
|
1 #include "Led.h"
|
|||
|
2 /// @brief Led<65><64>ʾ
|
|||
|
3 /// @param addr <20><>Ҫ<EFBFBD><D2AA>д<EFBFBD><D0B4>Led<65><64>λ<EFBFBD><CEBB>0-7
|
|||
|
4 /// @param enable <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD> 0<><30> 1<><31>
|
|||
|
5 void Led_Disp(unsigned char addr, unsigned char enable)
|
|||
|
6 {
|
|||
|
7 1 static unsigned char temp = 0x00;
|
|||
|
8 1 static unsigned char temp_old = 0xff;
|
|||
|
9 1 // ָ<><D6B8>λ<EFBFBD>õ<EFBFBD><C3B5><EFBFBD>
|
|||
|
10 1 if (enable)
|
|||
|
11 1 temp |= 0x01 << addr;
|
|||
|
12 1 else
|
|||
|
13 1 temp &= ~(0x01 << addr);
|
|||
|
14 1 if (temp != temp_old)
|
|||
|
15 1 {
|
|||
|
16 2 P0 = ~temp;
|
|||
|
17 2 P2 = P2 & 0x1f | 0x80;
|
|||
|
18 2 P2 &= 0x1f;
|
|||
|
19 2 temp_old = temp;
|
|||
|
20 2 }
|
|||
|
21 1 }
|
|||
|
22 /// @brief <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
23 /// @param enable 0 <20><> 1 <20><>
|
|||
|
24 void Beep(bit enable)
|
|||
|
25 {
|
|||
|
26 1 static unsigned char temp = 0x00;
|
|||
|
27 1 static unsigned char temp_old = 0xff;
|
|||
|
28 1 if (enable)
|
|||
|
29 1 temp |= 0x40;
|
|||
|
30 1 else
|
|||
|
31 1 temp &= ~(0x40);
|
|||
|
32 1 if (temp != temp_old)
|
|||
|
33 1 {
|
|||
|
34 2 P0 = temp;
|
|||
|
35 2 P2 = P2 & 0x1f | 0xa0;
|
|||
|
36 2 P2 &= 0x1f;
|
|||
|
37 2 temp_old = temp;
|
|||
|
38 2 }
|
|||
|
39 1 }
|
|||
|
40 /// @brief <20>̵<EFBFBD><CCB5><EFBFBD>
|
|||
|
41 /// @param enable 0 <20><> 1 <20><>
|
|||
|
42 void Relay(bit enable)
|
|||
|
43 {
|
|||
|
44 1 static unsigned char temp = 0x00;
|
|||
|
45 1 static unsigned char temp_old = 0xff;
|
|||
|
46 1 if (enable)
|
|||
|
47 1 temp |= 0x10;
|
|||
|
48 1 else
|
|||
|
49 1 temp &= ~(0x10);
|
|||
|
50 1 if (temp != temp_old)
|
|||
|
51 1 {
|
|||
|
52 2 P0 = temp;
|
|||
|
53 2 P2 = P2 & 0x1f | 0xa0;
|
|||
|
54 2 P2 &= 0x1f;
|
|||
|
C51 COMPILER V9.59.0.0 LED 03/12/2024 11:36:12 PAGE 2
|
|||
|
|
|||
|
55 2 temp_old = temp;
|
|||
|
56 2 }
|
|||
|
57 1 }
|
|||
|
58 /// @brief <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĸ<C4B8><DFBB>ǵ͵<C7B5>ƽ
|
|||
|
59 /// @param enable 0 <20><> 1 <20><>
|
|||
|
60 void MOTOR(bit enable)
|
|||
|
61 {
|
|||
|
62 1 static unsigned char temp = 0x00;
|
|||
|
63 1 static unsigned char temp_old = 0xff;
|
|||
|
64 1 if (enable)
|
|||
|
65 1 temp |= 0x20;
|
|||
|
66 1 else
|
|||
|
67 1 temp &= ~(0x20);
|
|||
|
68 1 if (temp != temp_old)
|
|||
|
69 1 {
|
|||
|
70 2 P0 = temp;
|
|||
|
71 2 P2 = P2 & 0x1f | 0xa0;
|
|||
|
72 2 P2 &= 0x1f;
|
|||
|
73 2 temp_old = temp;
|
|||
|
74 2 }
|
|||
|
75 1 }
|
|||
|
|
|||
|
|
|||
|
MODULE INFORMATION: STATIC OVERLAYABLE
|
|||
|
CODE SIZE = 163 ----
|
|||
|
CONSTANT SIZE = ---- ----
|
|||
|
XDATA SIZE = ---- ----
|
|||
|
PDATA SIZE = ---- ----
|
|||
|
DATA SIZE = 8 ----
|
|||
|
IDATA SIZE = ---- ----
|
|||
|
BIT SIZE = ---- 3
|
|||
|
END OF MODULE INFORMATION.
|
|||
|
|
|||
|
|
|||
|
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
|