📄 manualboard.lst
字号:
C51 COMPILER V7.09 MANUALBOARD 09/17/2008 16:05:33 PAGE 1
C51 COMPILER V7.09, COMPILATION OF MODULE MANUALBOARD
OBJECT MODULE PLACED IN .\output\manualboard.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE main\manualboard.c LARGE BROWSE INCDIR(audio\;eeprom\;extendUART\;flash\;gp
-s\;inter\;key\;mcu\;menu\;usb\;gprs\;main\;1wire\) DEBUG OBJECTEXTEND PRINT(.\output\manualboard.lst) OBJECT(.\output\ma
-nualboard.obj)
line level source
1 #include "typedef.h"
2 #include "global.h"
3 #include "manualboard.h"
4 #include "playsound.h"
5 #include "systemmanager.h"
6 #include "position.h"
7 #include "trans_process.h"
8 #include "nf_file.h"
9 #include "menu.h"
10 #include "16c554.h"
11 #include <string.h>
12
13 extern xdata BUS_INFO busInfo;//线路当前信息
14 extern xdata STATION_TONE stationTone[128];//上下行车站数据
15 extern char positionMode[128];
16
17 //有关报站按键的处理函数原型定义
18 //返回OK表示当前站以及当前站模式有变化,返回KO表示没有变化
19 typedef Byte (*FUNCTION_STATIONKEY)(void);
20
21 Byte key_arrive_station(void)
22 {
23 1 if (FIRST_STATION == busInfo.attrStation)
24 1 {
25 2 hand_sound_report(2, busInfo.displayCurStation);
26 2 //进行报站
27 2 play_stationsound(busInfo.displayCurStation, busInfo.attrStation);
28 2 return KO;
29 2 }
30 1 else if (CURRENT_STATION == busInfo.attrStation)
31 1 {
32 2 //进行报站
33 2 play_stationsound(busInfo.displayCurStation, busInfo.attrStation);
34 2 return KO;
35 2 }
36 1
37 1 //此时界面上是下一站
38 1 if ((busInfo.displayCurStation == busInfo.firstStation[0]) || (busInfo.displayCurStation == busInfo.fi
-rstStation[1]))
39 1 {
40 2 //此时为首站,这种情况不可能出现
41 2 busInfo.attrStation = FIRST_STATION;
42 2 }
43 1 else
44 1 busInfo.attrStation = CURRENT_STATION;
45 1 //发送手动消息
46 1 hand_sound_report(busInfo.attrStation, busInfo.displayCurStation);
47 1 play_stationsound(busInfo.displayCurStation, busInfo.attrStation);
48 1 set_stationdata_changed();
49 1
50 1 return OK;
51 1 }
52
C51 COMPILER V7.09 MANUALBOARD 09/17/2008 16:05:33 PAGE 2
53 //离站键处理
54 Byte key_leave_station(void)
55 {
56 1 if (NEXT_STATION == busInfo.attrStation)
57 1 {
58 2 //界面上已经是下一站了
59 2 play_stationsound(busInfo.displayCurStation, busInfo.attrStation);
60 2 return KO;
61 2 }
62 1
63 1 //如果是终点站,这里暂时不作任何变化
64 1 if (busInfo.displayCurStation == busInfo.lastStation[0])
65 1 {
66 2 if ((NORMAL_LINE == busInfo.lineAttr) || (SINGAL_LINE == busInfo.lineAttr))
67 2 {
68 3 //上行最后一站,当前状态肯定为CURRENT_STATION
69 3 back_to_firststation(BUS_BACKWARD);
70 3 }
71 2 else
72 2 {
73 3 //直接回首站
74 3 back_to_firststation(BUS_UPWARD);
75 3 }
76 2 }
77 1 else if (busInfo.displayCurStation == busInfo.lastStation[1])
78 1 {
79 2 if ((NORMAL_LINE == busInfo.lineAttr) || (SINGAL_LINE == busInfo.lineAttr))
80 2 {
81 3 //下行最后一站,当前状态肯定为CURRENT_STATION
82 3 back_to_firststation(BUS_UPWARD);
83 3 }
84 2 else
85 2 {
86 3 //直接回首站
87 3 back_to_firststation(BUS_BACKWARD);
88 3 }
89 2 }
90 1 else
91 1 {
92 2 busInfo.displayCurStation = get_nextstationNum(busInfo.displayCurStation);
93 2 busInfo.attrStation = NEXT_STATION;
94 2 busInfo.stationName = stationTone[busInfo.displayCurStation-1].name;
95 2 }
96 1 //其他状态都不处理
97 1 if (FIRST_STATION != busInfo.attrStation)
98 1 {
99 2 hand_sound_report(busInfo.attrStation, busInfo.displayCurStation);
100 2 }
101 1 play_stationsound(busInfo.displayCurStation, busInfo.attrStation);
102 1 set_stationdata_changed();
103 1
104 1 return OK;
105 1 }
106
107 Byte key_repeat_station(void)
108 {
109 1 play_stationsound(busInfo.displayCurStation, busInfo.attrStation);
110 1 return KO;
111 1 }
112
113 //二次报站
114 Byte key_twotime_board(void)
C51 COMPILER V7.09 MANUALBOARD 09/17/2008 16:05:33 PAGE 3
115 {
116 1 Byte bChanged;
117 1 bChanged = 0;
118 1 if ((busInfo.displayCurStation==busInfo.firstStation[0]) || (busInfo.displayCurStation==busInfo.firstS
-tation[1]))
119 1 {
120 2 if (FIRST_STATION != busInfo.attrStation)
121 2 {
122 3 busInfo.attrStation = FIRST_STATION;
123 3 bChanged = 1;
124 3 }
125 2 }
126 1 else
127 1 {
128 2 if (CURRENT_STATION != busInfo.attrStation)
129 2 {
130 3 Byte nTmp;
131 3 nTmp = is_thesecondStation(busInfo.displayCurStation, busInfo.attrStation);
132 3
133 3 if (OK == nTmp)
134 3 {
135 4 //当前站是第二站
136 4 if (BUS_UPWARD == busInfo.direction)
137 4 {
138 5 busInfo.displayCurStation = busInfo.firstStation[0];
139 5 }
140 4 else
141 4 {
142 5 busInfo.displayCurStation = busInfo.firstStation[1];
143 5 }
144 4 busInfo.attrStation = FIRST_STATION;
145 4 }
146 3 else
147 3 {
148 4 //当前站不是第二站,并且当前模式为NEXT
149 4 busInfo.displayCurStation = get_laststationNum(busInfo.displayCurStation);
150 4 busInfo.attrStation = CURRENT_STATION;
151 4 }
152 3 busInfo.stationName = stationTone[busInfo.displayCurStation-1].name;
153 3 bChanged = 1;
154 3 }
155 2 }
156 1
157 1 play_stationsound(busInfo.displayCurStation, busInfo.attrStation);
158 1 if (1 == bChanged)
159 1 {
160 2 set_stationdata_changed();
161 2 return OK;
162 2 }
163 1 else
164 1 return KO;
165 1 }
166 //上翻一站,节约执行时间,但是代码空间可能要大
167 Byte key_last_station(void)
168 {
169 1 xdata Uint8 nTmp;
170 1 //
171 1 if (FIRST_STATION == busInfo.attrStation)
172 1 {
173 2 //当前为FIRST_STATION,当前不处理(看是否需要按键音?)
174 2 return KO;
175 2 }
C51 COMPILER V7.09 MANUALBOARD 09/17/2008 16:05:33 PAGE 4
176 1
177 1 //判断本站是否是第二站
178 1 nTmp = is_thesecondStation(busInfo.displayCurStation, busInfo.attrStation);
179 1
180 1 if (OK == nTmp)
181 1 {
182 2 //当前站是第二站
183 2 if (BUS_UPWARD == busInfo.direction)
184 2 {
185 3 busInfo.displayCurStation = busInfo.firstStation[0];
186 3 }
187 2 else
188 2 {
189 3 busInfo.displayCurStation = busInfo.firstStation[1];
190 3 }
191 2 busInfo.attrStation = FIRST_STATION;
192 2 busInfo.stationName = stationTone[busInfo.displayCurStation-1].name;
193 2 set_stationdata_changed();
194 2 return OK;
195 2 }
196 1
197 1 busInfo.displayCurStation = get_laststationNum(busInfo.displayCurStation);
198 1 busInfo.stationName = stationTone[busInfo.displayCurStation-1].name;
199 1 set_stationdata_changed();
200 1 return OK;
201 1 }
202
203 //下翻一站,节约执行时间,但是代码空间可能要大
204 Byte key_next_station(void)
205 {
206 1 if ((busInfo.displayCurStation==busInfo.lastStation[0]) || (busInfo.displayCurStation==busInfo.lastSta
-tion[1]))
207 1 {
208 2 return KO;
209 2 }
210 1
211 1 busInfo.displayCurStation = get_nextstationNum(busInfo.displayCurStation);
212 1 if (NEXT_STATION == busInfo.attrStation)
213 1 busInfo.attrStation = NEXT_STATION;
214 1 else
215 1 busInfo.attrStation = CURRENT_STATION;
216 1 busInfo.stationName = stationTone[busInfo.displayCurStation-1].name;
217 1 set_stationdata_changed();
218 1 return OK;
219 1 }
220
221 Byte key_change_direction(void)
222 {
223 1 if ((busInfo.displayCurStation == busInfo.lastStation[0]) || (busInfo.displayCurStation == busInfo.fir
-stStation[0]))
224 1 {
225 2 if ((NORMAL_LINE == busInfo.lineAttr) || (SINGAL_LINE == busInfo.lineAttr))
226 2 {
227 3 back_to_firststation(BUS_BACKWARD);
228 3 }
229 2 else if (CIRCUIT_LINE == busInfo.lineAttr)
230 2 {
231 3 //环线
232 3 if (FIRST_STATION == busInfo.attrStation)
233 3 {
234 4 //为首站,需要换方向
235 4 back_to_firststation(BUS_BACKWARD);
C51 COMPILER V7.09 MANUALBOARD 09/17/2008 16:05:33 PAGE 5
236 4 }
237 3 else
238 3 {
239 4 //为末站,不换方向
240 4 back_to_firststation(busInfo.direction);
241 4 }
242 3 }
243 2 else if (SIGAL_DIRECTION == busInfo.lineAttr)
244 2 {
245 3 //单向
246 3 back_to_firststation(busInfo.direction);
247 3 }
248 2 play_stationsound(busInfo.displayCurStation, busInfo.attrStation);
249 2 set_stationdata_changed();
250 2 return OK;
251 2 }
252 1
253 1 if ((busInfo.displayCurStation == busInfo.lastStation[1]) || (busInfo.displayCurStation == busInfo.fir
-stStation[1]))
254 1 {
255 2 if ((NORMAL_LINE == busInfo.lineAttr) || (SINGAL_LINE == busInfo.lineAttr))
256 2 {
257 3 back_to_firststation(BUS_UPWARD);
258 3 }
259 2 else if (CIRCUIT_LINE == busInfo.lineAttr)
260 2 {
261 3 //环线
262 3 if (FIRST_STATION == busInfo.attrStation)
263 3 {
264 4 //为首站,需要换方向
265 4 back_to_firststation(BUS_UPWARD);
266 4
267 4 }
268 3 else
269 3 {
270 4 //为末站,不换方向
271 4 back_to_firststation(busInfo.direction);
272 4 }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -