-
Notifications
You must be signed in to change notification settings - Fork 1
/
main_8c.html
477 lines (460 loc) · 35.3 KB
/
main_8c.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>Vehicle: main.c 文件参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Vehicle
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.6 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>首页</span></a></li>
<li><a href="pages.html"><span>相关页面</span></a></li>
<li><a href="annotated.html"><span>结构体</span></a></li>
<li class="current"><a href="files.html"><span>文件</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>文件列表</span></a></li>
<li><a href="globals.html"><span>全局定义</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#func-members">函数</a> </div>
<div class="headertitle">
<div class="title">main.c 文件参考</div> </div>
</div><!--header-->
<div class="contents">
<p>赛车模拟控制程序主函数源文件
<a href="#details">更多...</a></p>
<div class="textblock"><code>#include "<a class="el" href="main_8h_source.html">main.h</a>"</code><br/>
<code>#include "<a class="el" href="vehicle_8h_source.html">vehicle.h</a>"</code><br/>
</div><div class="textblock"><div class="dynheader">
main.c 的引用(Include)关系图:</div>
<div class="dyncontent">
<div class="center"><img src="main_8c__incl.png" border="0" usemap="#main_8c" alt=""/></div>
<map name="main_8c" id="main_8c">
<area shape="rect" id="node2" href="main_8h.html" title="汽车模拟控制程序主函数头文件 " alt="" coords="293,80,355,107"/><area shape="rect" id="node10" href="vehicle_8h.html" title="赛车模拟控制程序头文件 " alt="" coords="379,80,451,107"/></map>
</div>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
函数</h2></td></tr>
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr class="memdesc:a840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft"> </td><td class="mdescRight">程序主函数 <a href="#a840291bc02cba5474a4cb46a9b9566fe">更多...</a><br/></td></tr>
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a93f514700ccf00d08dbdcff7f1224eb2"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8c.html#a93f514700ccf00d08dbdcff7f1224eb2">SystemInit</a> (void)</td></tr>
<tr class="memdesc:a93f514700ccf00d08dbdcff7f1224eb2"><td class="mdescLeft"> </td><td class="mdescRight">系统初始化 <a href="#a93f514700ccf00d08dbdcff7f1224eb2">更多...</a><br/></td></tr>
<tr class="separator:a93f514700ccf00d08dbdcff7f1224eb2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8004f8f482dbef7f0522b48a579b8b47"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8c.html#a8004f8f482dbef7f0522b48a579b8b47">PeripheralInit</a> (void)</td></tr>
<tr class="memdesc:a8004f8f482dbef7f0522b48a579b8b47"><td class="mdescLeft"> </td><td class="mdescRight">外设初始化 <a href="#a8004f8f482dbef7f0522b48a579b8b47">更多...</a><br/></td></tr>
<tr class="separator:a8004f8f482dbef7f0522b48a579b8b47"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a85f4f7afb13dec1233f5cfd2473d5a12"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8c.html#a85f4f7afb13dec1233f5cfd2473d5a12">ExitInit</a> (void)</td></tr>
<tr class="memdesc:a85f4f7afb13dec1233f5cfd2473d5a12"><td class="mdescLeft"> </td><td class="mdescRight">中断初始化 <a href="#a85f4f7afb13dec1233f5cfd2473d5a12">更多...</a><br/></td></tr>
<tr class="separator:a85f4f7afb13dec1233f5cfd2473d5a12"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a22ded4a110818b6fb8a72a001ff988ea"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8c.html#a22ded4a110818b6fb8a72a001ff988ea">ShowCover</a> (void)</td></tr>
<tr class="memdesc:a22ded4a110818b6fb8a72a001ff988ea"><td class="mdescLeft"> </td><td class="mdescRight">在LCD上显示成员信息,持续一段时间 <a href="#a22ded4a110818b6fb8a72a001ff988ea">更多...</a><br/></td></tr>
<tr class="separator:a22ded4a110818b6fb8a72a001ff988ea"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a168b12a66c15cec54bd528ee7ed16967"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8c.html#a168b12a66c15cec54bd528ee7ed16967">EINT0_Enable</a> (int flag)</td></tr>
<tr class="memdesc:a168b12a66c15cec54bd528ee7ed16967"><td class="mdescLeft"> </td><td class="mdescRight">中断0使能函数 <a href="#a168b12a66c15cec54bd528ee7ed16967">更多...</a><br/></td></tr>
<tr class="separator:a168b12a66c15cec54bd528ee7ed16967"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8133c22f4d74997b11c8afb973bc8c9f"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8c.html#a8133c22f4d74997b11c8afb973bc8c9f">EINT2_Enable</a> (int flag)</td></tr>
<tr class="memdesc:a8133c22f4d74997b11c8afb973bc8c9f"><td class="mdescLeft"> </td><td class="mdescRight">中断2使能函数 <a href="#a8133c22f4d74997b11c8afb973bc8c9f">更多...</a><br/></td></tr>
<tr class="separator:a8133c22f4d74997b11c8afb973bc8c9f"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>赛车模拟控制程序主函数源文件 </p>
<hr/>
<dl class="section author"><dt>作者</dt><dd>Gump, LDR </dd></dl>
<dl class="section version"><dt>版本</dt><dd>V0.1 </dd></dl>
<dl class="section date"><dt>日期</dt><dd>2019-12-08 <hr/>
</dd></dl>
</div><h2 class="groupheader">函数说明</h2>
<a class="anchor" id="a840291bc02cba5474a4cb46a9b9566fe"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int main </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>程序主函数 </p>
<div class="fragment"><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> {</div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  <span class="comment">/* 系统初始化 */</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  <a class="code" href="main_8c.html#a93f514700ccf00d08dbdcff7f1224eb2">SystemInit</a>();</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  <a class="code" href="main_8c.html#a8004f8f482dbef7f0522b48a579b8b47">PeripheralInit</a>();</div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  <a class="code" href="main_8c.html#a85f4f7afb13dec1233f5cfd2473d5a12">ExitInit</a>();</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  <span class="comment">/* 显示小组成员信息 */</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  <a class="code" href="main_8c.html#a22ded4a110818b6fb8a72a001ff988ea">ShowCover</a>();</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  <span class="comment">/* 赛车模拟控制主程序 */</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  <a class="code" href="vehicle_8c.html#a37b4defbf720b1dc56d488cebe140ba2">VehicleInit</a>();</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  <span class="keywordflow">while</span> (1)</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  {</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  <a class="code" href="vehicle_8c.html#ae06b8941e180800660bab73ca89bb29c">VehicleStatusUpdate</a>();</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  <a class="code" href="vehicle_8c.html#a36a5da33bcf4051796cd7c997bc5c896">VehicleDisplays</a>();</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  }</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> }</div>
<div class="ttc" id="vehicle_8c_html_a36a5da33bcf4051796cd7c997bc5c896"><div class="ttname"><a href="vehicle_8c.html#a36a5da33bcf4051796cd7c997bc5c896">VehicleDisplays</a></div><div class="ttdeci">void VehicleDisplays(void)</div><div class="ttdoc">显示赛车状态 </div><div class="ttdef"><b>Definition:</b> vehicle.c:106</div></div>
<div class="ttc" id="main_8c_html_a8004f8f482dbef7f0522b48a579b8b47"><div class="ttname"><a href="main_8c.html#a8004f8f482dbef7f0522b48a579b8b47">PeripheralInit</a></div><div class="ttdeci">void PeripheralInit(void)</div><div class="ttdoc">外设初始化 </div><div class="ttdef"><b>Definition:</b> main.c:57</div></div>
<div class="ttc" id="main_8c_html_a85f4f7afb13dec1233f5cfd2473d5a12"><div class="ttname"><a href="main_8c.html#a85f4f7afb13dec1233f5cfd2473d5a12">ExitInit</a></div><div class="ttdeci">void ExitInit(void)</div><div class="ttdoc">中断初始化 </div><div class="ttdef"><b>Definition:</b> main.c:70</div></div>
<div class="ttc" id="vehicle_8c_html_ae06b8941e180800660bab73ca89bb29c"><div class="ttname"><a href="vehicle_8c.html#ae06b8941e180800660bab73ca89bb29c">VehicleStatusUpdate</a></div><div class="ttdeci">void VehicleStatusUpdate(void)</div><div class="ttdoc">更新赛车数据 </div><div class="ttdef"><b>Definition:</b> vehicle.c:45</div></div>
<div class="ttc" id="vehicle_8c_html_a37b4defbf720b1dc56d488cebe140ba2"><div class="ttname"><a href="vehicle_8c.html#a37b4defbf720b1dc56d488cebe140ba2">VehicleInit</a></div><div class="ttdeci">void VehicleInit(void)</div><div class="ttdoc">赛车程序初始化函数 </div><div class="ttdef"><b>Definition:</b> vehicle.c:27</div></div>
<div class="ttc" id="main_8c_html_a93f514700ccf00d08dbdcff7f1224eb2"><div class="ttname"><a href="main_8c.html#a93f514700ccf00d08dbdcff7f1224eb2">SystemInit</a></div><div class="ttdeci">void SystemInit(void)</div><div class="ttdoc">系统初始化 </div><div class="ttdef"><b>Definition:</b> main.c:46</div></div>
<div class="ttc" id="main_8c_html_a22ded4a110818b6fb8a72a001ff988ea"><div class="ttname"><a href="main_8c.html#a22ded4a110818b6fb8a72a001ff988ea">ShowCover</a></div><div class="ttdeci">void ShowCover(void)</div><div class="ttdoc">在LCD上显示成员信息,持续一段时间 </div><div class="ttdef"><b>Definition:</b> main.c:102</div></div>
</div><!-- fragment -->
<p><div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="main_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.png" border="0" usemap="#main_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph" alt=""/></div>
<map name="main_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph" id="main_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph">
<area shape="rect" id="node2" href="main_8c.html#a93f514700ccf00d08dbdcff7f1224eb2" title="系统初始化 " alt="" coords="134,56,218,83"/><area shape="rect" id="node3" href="main_8c.html#a8004f8f482dbef7f0522b48a579b8b47" title="外设初始化 " alt="" coords="127,107,225,133"/><area shape="rect" id="node4" href="main_8c.html#a85f4f7afb13dec1233f5cfd2473d5a12" title="中断初始化 " alt="" coords="145,157,207,184"/><area shape="rect" id="node9" href="main_8c.html#a22ded4a110818b6fb8a72a001ff988ea" title="在LCD上显示成员信息,持续一段时间 " alt="" coords="133,208,219,235"/><area shape="rect" id="node11" href="vehicle_8c.html#a37b4defbf720b1dc56d488cebe140ba2" title="赛车程序初始化函数 " alt="" coords="135,259,217,285"/><area shape="rect" id="node14" href="vehicle_8c.html#ae06b8941e180800660bab73ca89bb29c" title="更新赛车数据 " alt="" coords="104,309,248,336"/><area shape="rect" id="node15" href="vehicle_8c.html#a36a5da33bcf4051796cd7c997bc5c896" title="显示赛车状态 " alt="" coords="119,360,233,387"/><area shape="rect" id="node5" href="main_8c.html#a168b12a66c15cec54bd528ee7ed16967" title="中断0使能函数 " alt="" coords="296,5,400,32"/><area shape="rect" id="node6" href="vehicle_8c.html#a7897534f6b2cf9ec2d72af613e6c100d" title="按键1中断处理函数 每按一次“档位”成员变量自减一 " alt="" coords="299,56,397,83"/><area shape="rect" id="node7" href="main_8c.html#a8133c22f4d74997b11c8afb973bc8c9f" title="中断2使能函数 " alt="" coords="296,107,400,133"/><area shape="rect" id="node8" href="vehicle_8c.html#a5d7d4bd8a4ae8dfde93d64d27a492463" title="按键2中断处理函数 每按一次“档位”成员变量自增一 " alt="" coords="299,157,397,184"/><area shape="rect" id="node10" href="vehicle_8c.html#ad56cd570f598052235ff7111f99c6504" title="简单的延时函数 " alt="" coords="481,284,534,311"/><area shape="rect" id="node12" href="vehicle_8c.html#a573e3a73f898d8e69dda05e56716723d" title="绘制圆形赛道 " alt="" coords="307,259,389,285"/><area shape="rect" id="node13" href="vehicle_8c.html#a4fd900a3a7110287db68e11d1fa6d0e3" title="绘制赛车,即一个小矩形 " alt="" coords="301,309,395,336"/><area shape="rect" id="node16" href="vehicle_8c.html#a01f7b1de24a0bfcba4d3fef6345fef99" title="绘制蓝色矩形方块 " alt="" coords="309,360,387,387"/><area shape="rect" id="node17" href="vehicle_8c.html#aea5c29b708bb0d72e962b61515fc44b8" title="数码管显示函数 在左边两位显示当前已走圈数 " alt="" coords="301,411,395,437"/><area shape="rect" id="node18" href="vehicle_8c.html#aaefbc0e26f31cb3185e4126702d08566" title="数码管显示函数 " alt="" coords="448,411,567,437"/></map>
</div>
</p>
</div>
</div>
<a class="anchor" id="a93f514700ccf00d08dbdcff7f1224eb2"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void SystemInit </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>系统初始化 </p>
<div class="fragment"><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> {</div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> </div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  ChangeClockDivider(1, 1); <span class="comment">// 1:2:4</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  ChangeMPllValue(0xa1, 0x3, 0x1); <span class="comment">// FCLK=202.8MHz</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> }</div>
</div><!-- fragment -->
<p><div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="main_8c_a93f514700ccf00d08dbdcff7f1224eb2_icgraph.png" border="0" usemap="#main_8c_a93f514700ccf00d08dbdcff7f1224eb2_icgraph" alt=""/></div>
<map name="main_8c_a93f514700ccf00d08dbdcff7f1224eb2_icgraph" id="main_8c_a93f514700ccf00d08dbdcff7f1224eb2_icgraph">
<area shape="rect" id="node2" href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe" title="程序主函数 " alt="" coords="137,5,188,32"/></map>
</div>
</p>
</div>
</div>
<a class="anchor" id="a8004f8f482dbef7f0522b48a579b8b47"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void PeripheralInit </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>外设初始化 </p>
<div class="fragment"><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> {</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span> </div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  Port_Init();</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  LCD_Init();</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  clrsrc(0xffff); <span class="comment">// 白色清屏</span></div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  LcdHorizontal(); <span class="comment">// 横屏</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> }</div>
</div><!-- fragment -->
<p><div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="main_8c_a8004f8f482dbef7f0522b48a579b8b47_icgraph.png" border="0" usemap="#main_8c_a8004f8f482dbef7f0522b48a579b8b47_icgraph" alt=""/></div>
<map name="main_8c_a8004f8f482dbef7f0522b48a579b8b47_icgraph" id="main_8c_a8004f8f482dbef7f0522b48a579b8b47_icgraph">
<area shape="rect" id="node2" href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe" title="程序主函数 " alt="" coords="151,5,201,32"/></map>
</div>
</p>
</div>
</div>
<a class="anchor" id="a85f4f7afb13dec1233f5cfd2473d5a12"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ExitInit </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>中断初始化 </p>
<div class="fragment"><div class="line"><a name="l00071"></a><span class="lineno"> 71</span> {</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span> </div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  __vInitHaltHandlers();</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span> </div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <a class="code" href="main_8c.html#a168b12a66c15cec54bd528ee7ed16967">EINT0_Enable</a>(True);</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  ISRVector[0] = <a class="code" href="vehicle_8c.html#a7897534f6b2cf9ec2d72af613e6c100d">INT0_Handler</a>; <span class="comment">// 中断0处理函数</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span> </div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  <a class="code" href="main_8c.html#a8133c22f4d74997b11c8afb973bc8c9f">EINT2_Enable</a>(True);</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  ISRVector[2] = <a class="code" href="vehicle_8c.html#a5d7d4bd8a4ae8dfde93d64d27a492463">INT2_Handler</a>; <span class="comment">// 中断2处理函数</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> </div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <span class="comment">/* LED 配置 */</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  rGPFCON |= ((1 << 8) | (1 << 14)); <span class="comment">// set GPF4,GPF7 为输出管脚</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span> </div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <span class="comment">/* 数码管配置 */</span></div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  rGPGCON = (rGPGCON & ~(3 << 4)) | (1 << 4); <span class="comment">// 设置 GPG2 = OUTPUT</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  rGPGUP |= 1 << 2; <span class="comment">// 共16位,将GPG2引脚对应的2号位置设置为拉电流</span></div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span> </div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  rGPECON = (rGPECON & ~(3 << 18)) | (1 << 18); <span class="comment">// 设置 GPE9 = OUTPUT</span></div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  rGPEUP |= 1 << 9; <span class="comment">// 共16位,将GPE9引脚对应的9号位置设置为拉电流</span></div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span> </div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  rGPECON = (rGPECON & ~(0xFF00000)) | (0x5500000); <span class="comment">// 设置 GPE[10 ~ 13] = OUTPUT</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  rGPEUP |= (1 << 10) | (1 << 11) | (1 << 12) | (1 << 13); <span class="comment">// 将GPE10-13引脚设置为拉电流</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span> </div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  rGPHCON = (rGPHCON & ~(3 << 16)) | (1 << 16); <span class="comment">// 设置点,不亮(GPH8 = OUTPUT)</span></div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  rGPHUP |= 1 << 8;</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span> }</div>
<div class="ttc" id="vehicle_8c_html_a5d7d4bd8a4ae8dfde93d64d27a492463"><div class="ttname"><a href="vehicle_8c.html#a5d7d4bd8a4ae8dfde93d64d27a492463">INT2_Handler</a></div><div class="ttdeci">void __irq INT2_Handler(void)</div><div class="ttdoc">按键2中断处理函数 每按一次“档位”成员变量自增一 </div><div class="ttdef"><b>Definition:</b> vehicle.c:274</div></div>
<div class="ttc" id="vehicle_8c_html_a7897534f6b2cf9ec2d72af613e6c100d"><div class="ttname"><a href="vehicle_8c.html#a7897534f6b2cf9ec2d72af613e6c100d">INT0_Handler</a></div><div class="ttdeci">void __irq INT0_Handler(void)</div><div class="ttdoc">按键1中断处理函数 每按一次“档位”成员变量自减一 </div><div class="ttdef"><b>Definition:</b> vehicle.c:288</div></div>
<div class="ttc" id="main_8c_html_a168b12a66c15cec54bd528ee7ed16967"><div class="ttname"><a href="main_8c.html#a168b12a66c15cec54bd528ee7ed16967">EINT0_Enable</a></div><div class="ttdeci">void EINT0_Enable(int flag)</div><div class="ttdoc">中断0使能函数 </div><div class="ttdef"><b>Definition:</b> main.c:115</div></div>
<div class="ttc" id="main_8c_html_a8133c22f4d74997b11c8afb973bc8c9f"><div class="ttname"><a href="main_8c.html#a8133c22f4d74997b11c8afb973bc8c9f">EINT2_Enable</a></div><div class="ttdeci">void EINT2_Enable(int flag)</div><div class="ttdoc">中断2使能函数 </div><div class="ttdef"><b>Definition:</b> main.c:137</div></div>
</div><!-- fragment -->
<p><div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="main_8c_a85f4f7afb13dec1233f5cfd2473d5a12_cgraph.png" border="0" usemap="#main_8c_a85f4f7afb13dec1233f5cfd2473d5a12_cgraph" alt=""/></div>
<map name="main_8c_a85f4f7afb13dec1233f5cfd2473d5a12_cgraph" id="main_8c_a85f4f7afb13dec1233f5cfd2473d5a12_cgraph">
<area shape="rect" id="node2" href="main_8c.html#a168b12a66c15cec54bd528ee7ed16967" title="中断0使能函数 " alt="" coords="116,5,220,32"/><area shape="rect" id="node3" href="vehicle_8c.html#a7897534f6b2cf9ec2d72af613e6c100d" title="按键1中断处理函数 每按一次“档位”成员变量自减一 " alt="" coords="119,56,217,83"/><area shape="rect" id="node4" href="main_8c.html#a8133c22f4d74997b11c8afb973bc8c9f" title="中断2使能函数 " alt="" coords="116,107,220,133"/><area shape="rect" id="node5" href="vehicle_8c.html#a5d7d4bd8a4ae8dfde93d64d27a492463" title="按键2中断处理函数 每按一次“档位”成员变量自增一 " alt="" coords="119,157,217,184"/></map>
</div>
</p>
<p><div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="main_8c_a85f4f7afb13dec1233f5cfd2473d5a12_icgraph.png" border="0" usemap="#main_8c_a85f4f7afb13dec1233f5cfd2473d5a12_icgraph" alt=""/></div>
<map name="main_8c_a85f4f7afb13dec1233f5cfd2473d5a12_icgraph" id="main_8c_a85f4f7afb13dec1233f5cfd2473d5a12_icgraph">
<area shape="rect" id="node2" href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe" title="程序主函数 " alt="" coords="116,5,167,32"/></map>
</div>
</p>
</div>
</div>
<a class="anchor" id="a22ded4a110818b6fb8a72a001ff988ea"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ShowCover </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>在LCD上显示成员信息,持续一段时间 </p>
<div class="fragment"><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  {</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span> </div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *ptr = (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *)<a class="code" href="vehicle_8h.html#a1ebff6b11a4c5a7bd176ca9cc2cb57c7">COVER_BUF</a>;</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  ShowImage(ptr, 0, 0, 1);</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  </div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <a class="code" href="vehicle_8c.html#ad56cd570f598052235ff7111f99c6504">delay</a>(5000);</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span> }</div>
<div class="ttc" id="vehicle_8c_html_ad56cd570f598052235ff7111f99c6504"><div class="ttname"><a href="vehicle_8c.html#ad56cd570f598052235ff7111f99c6504">delay</a></div><div class="ttdeci">void delay(int time)</div><div class="ttdoc">简单的延时函数 </div><div class="ttdef"><b>Definition:</b> vehicle.c:303</div></div>
<div class="ttc" id="vehicle_8h_html_a1ebff6b11a4c5a7bd176ca9cc2cb57c7"><div class="ttname"><a href="vehicle_8h.html#a1ebff6b11a4c5a7bd176ca9cc2cb57c7">COVER_BUF</a></div><div class="ttdeci">#define COVER_BUF</div><div class="ttdef"><b>Definition:</b> vehicle.h:38</div></div>
</div><!-- fragment -->
<p><div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="main_8c_a22ded4a110818b6fb8a72a001ff988ea_cgraph.png" border="0" usemap="#main_8c_a22ded4a110818b6fb8a72a001ff988ea_cgraph" alt=""/></div>
<map name="main_8c_a22ded4a110818b6fb8a72a001ff988ea_cgraph" id="main_8c_a22ded4a110818b6fb8a72a001ff988ea_cgraph">
<area shape="rect" id="node2" href="vehicle_8c.html#ad56cd570f598052235ff7111f99c6504" title="简单的延时函数 " alt="" coords="140,5,193,32"/></map>
</div>
</p>
<p><div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="main_8c_a22ded4a110818b6fb8a72a001ff988ea_icgraph.png" border="0" usemap="#main_8c_a22ded4a110818b6fb8a72a001ff988ea_icgraph" alt=""/></div>
<map name="main_8c_a22ded4a110818b6fb8a72a001ff988ea_icgraph" id="main_8c_a22ded4a110818b6fb8a72a001ff988ea_icgraph">
<area shape="rect" id="node2" href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe" title="程序主函数 " alt="" coords="140,5,191,32"/></map>
</div>
</p>
</div>
</div>
<a class="anchor" id="a168b12a66c15cec54bd528ee7ed16967"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void EINT0_Enable </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>flag</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>中断0使能函数 </p>
<dl class="params"><dt>参数</dt><dd>
<table class="params">
<tr><td class="paramname">flag</td><td>使能标志 </td></tr>
</table>
</dd>
</dl>
<div class="fragment"><div class="line"><a name="l00116"></a><span class="lineno"> 116</span> {</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  <span class="keywordtype">int</span> temp;</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="keywordflow">if</span> (flag == True)</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  {</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  temp = rGPFCON;</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  rGPFCON = temp | 0x02;</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  temp = rGPFDAT;</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  rGPFDAT = temp | 0x01;</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  rINTMSK &= ~(BIT_EINT0); <span class="comment">// 掩盖寄存器掩盖中断0</span></div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  }</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <span class="keywordflow">else</span></div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  {</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  rINTMSK &= BIT_EINT0;</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  }</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span> }</div>
</div><!-- fragment -->
<p><div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="main_8c_a168b12a66c15cec54bd528ee7ed16967_icgraph.png" border="0" usemap="#main_8c_a168b12a66c15cec54bd528ee7ed16967_icgraph" alt=""/></div>
<map name="main_8c_a168b12a66c15cec54bd528ee7ed16967_icgraph" id="main_8c_a168b12a66c15cec54bd528ee7ed16967_icgraph">
<area shape="rect" id="node2" href="main_8h.html#a85f4f7afb13dec1233f5cfd2473d5a12" title="中断初始化 " alt="" coords="157,5,220,32"/><area shape="rect" id="node3" href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe" title="程序主函数 " alt="" coords="268,5,319,32"/></map>
</div>
</p>
</div>
</div>
<a class="anchor" id="a8133c22f4d74997b11c8afb973bc8c9f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void EINT2_Enable </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>flag</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>中断2使能函数 </p>
<dl class="params"><dt>参数</dt><dd>
<table class="params">
<tr><td class="paramname">flag</td><td>使能标志 </td></tr>
</table>
</dd>
</dl>
<div class="fragment"><div class="line"><a name="l00138"></a><span class="lineno"> 138</span> {</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  <span class="keywordtype">int</span> temp;</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  <span class="keywordflow">if</span> (flag == True)</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  {</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  temp = rGPFCON;</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  rGPFCON = temp | 0x20;</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  temp = rGPFDAT;</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  rGPFDAT = temp | 0x01;</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  rINTMSK &= ~(BIT_EINT2); <span class="comment">// 掩盖寄存器掩盖中断0</span></div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  }</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="keywordflow">else</span></div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  {</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  rINTMSK &= BIT_EINT2;</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  }</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span> }</div>
</div><!-- fragment -->
<p><div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="main_8c_a8133c22f4d74997b11c8afb973bc8c9f_icgraph.png" border="0" usemap="#main_8c_a8133c22f4d74997b11c8afb973bc8c9f_icgraph" alt=""/></div>
<map name="main_8c_a8133c22f4d74997b11c8afb973bc8c9f_icgraph" id="main_8c_a8133c22f4d74997b11c8afb973bc8c9f_icgraph">
<area shape="rect" id="node2" href="main_8h.html#a85f4f7afb13dec1233f5cfd2473d5a12" title="中断初始化 " alt="" coords="157,5,220,32"/><area shape="rect" id="node3" href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe" title="程序主函数 " alt="" coords="268,5,319,32"/></map>
</div>
</p>
</div>
</div>
</div><!-- contents -->
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<meta charset="utf-8" />
<style>
body {
padding-bottom: 50px;
}
.footer {
position: fixed;
left: 0px;
bottom: 0px;
width: 100%;
height: 35px;
background-color: #eee;
z-index: 9999;
}
</style>
</head>
<body>
<div class="footer"> Posted by: Gump JunSen, LDR </div>
</body>