📄 main.lst
字号:
C51 COMPILER V8.15 MAIN 08/06/2009 13:49:09 PAGE 1
C51 COMPILER V8.15, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN main.OBJ
COMPILER INVOKED BY: D:\专业软件SLF\keil\C51\BIN\C51.EXE main.c BROWSE DEBUG OBJECTEXTEND
line level source
1 #include "reg52.h"
2 #include "44KEY.h"
3 #include "LED.h"
4 #include "SHT10.h"
5 #include "Psener.h"
6
7 #define uchar unsigned char
8 #define uint unsigned int
9 unsigned char a;
10 bit read_flag=0;
11
12 void mDelay(unsigned int j)
13 {
14 1 uint i;
15 1 for(;j>0;j--)
16 1 {
17 2 for(i=124;i>0;i--)
18 2 {;}
19 2 }
20 1 }
21
22 void init_serialcomm(void)
23 {
24 1 SCON = 0x50; //SCON: serail mode 1, 8-bit UART, enable ucvr
25 1 TMOD |= 0x20; //TMOD: timer 1, mode 2, 8-bit reload
26 1 PCON |= 0x80; //SMOD=1;
27 1 TH1 = 0xF3; //Baud:4800 fosc=12MHz
28 1 IE |= 0x90; //Enable Serial Interrupt
29 1 TR1 = 1; // timer 1 run
30 1 //TI=0;
31 1 }
32
33 void send_char_com(unsigned char ch) //向串口发送一个字符
34 {
35 1 SBUF=ch;
36 1 while(!TI);
37 1 TI=0;
38 1 }
39
40 //向串口发送一个字符串,strlen为该字符串长度
41 /*void send_string_com(unsigned char *str,unsigned int strlen)
42 {
43 unsigned int k=0;
44 do
45 {
46 send_char_com(*(str + k));
47 k++;
48 } while(k < strlen);
49 }*/
50
51 void serial () interrupt 4 using 3 //串口接收中断函数
52 {
53 1 if(RI)
54 1 {
55 2 unsigned char ch;
C51 COMPILER V8.15 MAIN 08/06/2009 13:49:09 PAGE 2
56 2 RI = 0;
57 2 ch=SBUF;
58 2 a=ch;
59 2
60 2 //checksum ^= ch;
61 2 //if((count3==(INBUF_LEN-1))&&(!checksum))//如果串口接收的数据达到INBUF_LEN个,且校验没错,就置位取
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -