📄 main.lst
字号:
C51 COMPILER V7.00 MAIN 05/22/2007 16:53:18 PAGE 1
C51 COMPILER V7.00, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN MAIN.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE MAIN.C BROWSE DEBUG OBJECTEXTEND
stmt level source
1 //--------------------------------------------------------------------------//
2 // 源程序 //
3 // (c) Copyright 2004-2005 sunzefeng //
4 // All Rights Reserved //
5 // V1.6 //
6 //--------------------------------------------------------------------------//
7 //标 题: KET-S1型输液泵 //
8 //文件名: KET.PRJ //
9 //版 本: V1.6(2006.04.04第6版) //
10 //修改人: sunzefeng E-mail:sunzefeng11@163.com //
11 //日 期: 05-03-23 //
12 //描 述: 带液滴检测器版 //
13 //声 明: //
14 //--------------------------------------------------------------------------//
15 #include <REG54.H>
16 #include <intrins.h>
17 #include <zk2.h>
18 #define uchar unsigned char
19 #define uint unsigned int
20 #define ulong unsigned long int
21 #define FLASE 0
22 #define TRUE 1
23 #define TH0DATA 0x15
24 #define TL0DATA 0xc0
25 #define POWER 0x03
26 #define SELECT 0x02
27 #define CLR 0x20
28 #define START 0x08
29 #define STOP 0x80
30 #define INC 0x04
31 #define INCC 0x01
32 #define DEC 0x40
33 #define DECC 0x10
34 #define ZHUHE 0x11
35 #define clrdata 10000
36
37 #define JingDuInit1 5000 //1000-901
38 #define JingDuInit2 5200 //900-801
39 #define JingDuInit3 5300 //800-701
40 #define JingDuInit4 5400 //700-601
41 #define JingDuInit5 5500 //600-501
42 #define JingDuInit6 5700 //500-401
43 #define JingDuInit7 6200 //400-301
44 #define JingDuInit8 6500 //300-201
45 #define JingDuInit9 7300 //200-101
46 #define JingDuInit10 8300 //100-1
47 #define qipaoconstant 150
48 #define yaliconstant 150
49 #define Warnaddr 20
50 #define canshuadr 8
51 #define canshuadr1 35
52 #define canshuadrh 11
53 #define QIPAODATA 0X01
54 #define PAIKONGDATA 0X02
55 #define ZHUSAIDATA 0X03
C51 COMPILER V7.00 MAIN 05/22/2007 16:53:18 PAGE 2
56 #define DOORDATA 0X04
57 #define OVERDATA 0X05
58 #define LOWBATDATA 0x09
59 #define SYSTEMTROUBLE 0x10
60 #define BATLOWSTOP 0x11
61 #define YEDISHIXIAO 0x12
62 #define INSTALLHINT 0x13
63 //======LED desin============
64 #define GLED1 0x60
65 #define GLED2 0x48
66 #define GLED3 0x50
67 #define RLED1 0x04
68 #define RLED2 0x02
69 #define RLED3 0x01
70 #define GFLED 0x78
71 #define RFLED 0x07
72 #define OFFLED 0x00
73 #define STOPLEDON 0XBF;
74 #define STOPLEDOFF 0X40;
75 #define CLRWDT WDT=0;WDT=0;WDT=0;WDT=0;WDT=1;
76 sbit Int1= P3^3;
77 sbit YEDIFlag= P1^7;
78 sbit ShutOff =P3^4;
79 sbit DoorFlag =P2^5;
80 sbit ACFlag =P2^1;
81 sbit EL_LCD =P1^0;
82 sbit KEY_POWER =P2^0;
83 sbit WDT =P1^5;
84 //=============外部函数声明==================
85 extern void LcmInition( void ); //液晶初始化
86 extern void LcmClear( void );
87 extern void Displayspeed(uchar col,uchar row,uchar hzcode);
88 extern void Displaytime(uchar col,uchar row,uchar hzcode);
89 extern void DisplayTotal(uchar col,uchar row,uchar hzcode);
90 extern void DisplayCanShu(uchar col,uchar row,uchar hzcode);
91 extern void Displayyedichar(uchar col,uchar row,uchar hzcode);//显示点滴计数值
92 extern void Displayonebmp3(uchar col,uchar row,uchar x,uchar y,uchar *adr);
93 extern void DisplayClear(uchar col,uchar row,uchar x,uchar y);
94 extern void DisplayOn(uchar x1,uchar y1,uchar x2,uchar y2);
95 extern void extbmp(uchar x0,uchar y0,uchar *bmp);
96 extern void Displayonebmp(uchar x,uchar y,uchar *adr);
97 extern void LcdDrawPoint(int x,int y,bit Point);
98 //============================================
99
100 extern uchar Key(void);
101 extern void StepperDrive0();
102 extern void StepperDrive1();
103 extern void StepperDrive2();
104 extern void StopMotor();
105 extern uchar ADConver(uchar n);
106 extern void KeySound(uchar num);
107 extern void Delay(unsigned int MS);
108 extern bit WriteEeprom(uchar *s, int addr,int len);
109 extern bit ReadEeprom(uchar *s,int addr,int len);
110 extern void HC164(uchar a);
111 //==============函数声明================================
112 void Interrput0();
113 void Time0();
114 void Time1();
115 void PowerKey();
116 void SelectKey();
117 void ClrKey();
C51 COMPILER V7.00 MAIN 05/22/2007 16:53:18 PAGE 3
118 void SetKey();
119 void StartKey();
120 void StopKey();
121 void InccKey();
122 void IncSet();
123 void DecSet();
124 void Display1(uchar a);
125 void Display2(uchar a);
126 void Display3();
127 void KeyAgain();
128 void Inition();
129 void QiPaoWarning();
130 void DrugEmptyWarning();
131 void ZhuSaiWarning();
132 void OpenDoorWarning();
133 void LowBatWarning();
134 void TransfusionOkWarning();
135 void YeDiWarning();
136 void JingDuSet();
137 void LedTurn();
138 void YeDiJingDuSet();
139 void MenuSet();
140 void DisplayRefurbish(); //显示刷新
141 void GetsAdData();
142 void JudgeWarn();
143 void WarnDisposal();
144 void TurnOffSystem();
145 void YeDiAdjust(); //液滴调整
146 void DisGlint(uchar i,uint n);
147 void ModeCover();
148 void DisplayCumulate(uint);
149 void MovPicture();
150 void DisplayBat();
151 //========全局变量设置====================================
152 uint idata yalistartcount;//压力起作用时间计时
153 ulong idata JingDuInt;
154 ulong idata speedset; //电机速度调节寄存器
155 uchar speedseth; //调速高位(1表示60MS)
156 uint speedsetl; //调速低位(单位为微秒)
157 uchar speedsetcount; //精度调整计数
158 uint idata cumulate; //累积量寄存器
159 uint idata cumulatedata;
160 uint idata cumulatecopy;
161 ulong idata cumulatereg;
162 uchar quicktotal;
163 uchar quicktotalcount;
164 uchar qipao; //气泡值寄存器
165 uint qipao_jing_value; //气泡精度存储器
166 uint qipao1flagcount;
167 uchar Adqipaocount11;
168 uchar yali; //压力值寄存器
169 //uchar jingdu; //输液精度寄存器
170 uchar jingducopy; //用于液滴计数方式精度调整
171 uchar Adqipao1; //气泡检测值1
172 uchar Adqipao2; //气泡检测值2
173 uchar qipaofirstvalue1;
174 uchar qipaofirstvalue2;
175 uchar seconddata2;
176 uchar minutedata2;
177 uchar hourdata2;
178 ulong idata cumulatedata2;
179
C51 COMPILER V7.00 MAIN 05/22/2007 16:53:18 PAGE 4
180 uchar Adyali; //压力检测值
181 uchar Adbat; //精度检测值
182 uchar AdbatBuff;
183 uchar KeyData; //
184 uchar KeyDataP;
185 uchar AdData; //
186 uchar clrcount; //清零键按下计时器
187 uchar dropspeed=0; //
188 uchar dropspeedcopy; //
189 uint Ex0Count=0; //
190 uchar shanshuocount; //闪烁速度计时
191 uchar selectdata; //输液及预置量选择
192 uchar buttoncount;
193 uchar buttonquickcount;//
194 uchar quickruncount; //起动键按下计时寄存器
195 uchar time; //
196 uchar second;
197 uchar minute;
198 uchar hour;
199 uchar second1;
200 uchar minute1;
201 uchar hour1;
202 uchar seconddata;
203 uchar minutedata;
204 uchar hourdata;
205 uchar timel;
206 uchar timeh;
207 uchar warndata;
208 uchar dropfactdata;
209 uchar sound;
210 uchar speedsethTT0;
211 uchar LEDSUBFF;
212 uchar Kvotime;
213 uchar Kvosecond;
214 uchar Kvominute;
215 uchar Kvohour;
216 uchar secondcopy;
217 uchar minutecopy;
218 uchar hourcopy;
219 uchar BatState;
220 uchar yedicountl;
221 uchar yedicounth;
222 uchar batlowglingcount;
223 uchar Adqipaocount1;
224 uint Adqipaocount2;
225 uint batlowtimecount;//电池低电压计时
226
227 uchar idata yedi_val;
228 uchar idata yeditime;
229 uchar idata yedidata;
230 uchar idata yedishiwei;
231 uchar idata yedigewei;
232 uchar idata batlowcount;
233 uint idata ledcount;
234 uchar idata led;
235 uchar idata Adyalicount;
236 uchar idata troublecount;
237 uchar idata troublecount2;
238 uchar idata Adbatcount;
239 uchar idata jingducopyset;
240 ulong idata t; //总时间,单位秒
241 ulong idata t1;
C51 COMPILER V7.00 MAIN 05/22/2007 16:53:18 PAGE 5
242 uchar idata jingdudata;
243 uint idata Keycount;
244 uchar qipao2hicount;
245 uchar YEDIFlagcount;
246
247 //======位变更声明================
248 bit QuickRunFlag; //快速冲洗标志
249 bit StartOnFlag; //起动键按下标志
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -