📄 main.lst
字号:
ARM COMPILER V2.00d, main 23/10/05 18:16:18 PAGE 1
ARM COMPILER V2.00d, COMPILATION OF MODULE main
OBJECT MODULE PLACED IN .\Flash\main.obj
COMPILER INVOKED BY: C:\KEIL\ARM\BIN\CA.EXE main.c THUMB OPTIMIZE(7,SPEED) BROWSE DEBUG PRINT(.\FLASH\MAIN.LST) TABS(4)
-OBJECT(.\Flash\main.obj)
stmt level source
1 /******************************************************************************/
2 /* This file is part of the kp weather station development */
3 /* Copyright kp 2005 */
4 /******************************************************************************/
5 /* */
6 /* Main.C: kp weather station main routine */
7 /* */
8 /******************************************************************************/
9 #include <stdio.h> // standard I/O .h-file
10 #include <LPC213x.H> // LPC213x definitions
11 #include <bsp.h> // include board support package
12 #include <math.h>
13
14 extern void init_registers(); // setup regiters to support MCB2180 and project
15 extern void init_serial (void); // Init Serial Interface function prototype
16 extern void init_clock (void); // Init clock Interface function prototype
17 extern void set_LED (unsigned char led_no, unsigned char led_cmd);
18 extern void init_timer();
19 extern void init_timer_1();
20 extern void delay(int delay_val);
21 extern int kp_printf(const char *fmt, ...);
22 extern void wr_byte(unsigned char d, unsigned char x); //d is the number of digits (leading zeros)
23 extern void wr_32hex(unsigned int x);
24 extern float wind_dir (void);
25 extern void wind_dir_char(void);
26 extern double wind_speed (unsigned int filterred_data);
27 extern void disp_lum(unsigned char x);
28 extern void disp_set_cursor(unsigned char r, unsigned char c);
29 extern void disp_clr(void);
30 extern float air_temp (unsigned char ad0);
31 extern float air_temp_F (float air_c);
32 extern int read_wind_dir_bits();
33 extern char wind_dir_str[3];
34 extern int volatile T0_flag;
35 extern unsigned volatile int timer_0_capture;
36 extern float wind_dir_ave;
37 extern unsigned int tval;
38 extern unsigned int val;
39 double speed;
40 unsigned char last_sec;
41
42 int main (void) {
43 1 float tmp1, tmp2, tmp3;
44 1 float ad0, ad1;
45 1 unsigned int n;
46 1 unsigned char task_active = 0x80; // lets try some tasking
47 1 // b x x | x x | x x | x x
48 1 // M | T1 | T2 | RTC 1st indicates "active"
49 1 init_registers();
50 1 init_serial(); // Initialize Serial Interface
51 1 init_timer(); // init timer 0
52 1 init_timer_1(); // init timer 1
53 1 init_clock(); // init real-time clock
54 1
55 1 printf("\n"); // clear displar
56 1 while (ON) { // while microprocess is on, Loop forever
57 2 if ( ((task_active)&(0x80)) == 0x80 ) { // test for active
58 3 set_LED(ZERO,ON); // indicate active
ARM COMPILER V2.00d, main 23/10/05 18:16:18 PAGE 2
59 3 task_active &= 0x7F; // clear active bit (preserve all others)
60 3 }
61 2 else {
62 3 set_LED(ZERO,OFF); // indicate inactive
63 3 task_active |= 0x80; // set active bit
64 3 }
65 2 disp_lum(1); // display lighting (0=off, 1=20%...,5=100%
66 2 disp_set_cursor(0,0);
67 2 wind_dir_char();
68 2 speed=wind_speed(timer_0_capture);
69 2 printf(" Wind %s",wind_dir_str);
70 2 printf(" %2.1f MPH ",speed);
71 2 disp_set_cursor(1,0);
72 2 printf("Temp %3.0f",air_temp_F(air_temp(tval)));
73 2 putchar(0xDF); printf("F");
74 2 printf(" "); wr_byte(2,HOUR);
75 2 printf(":"); wr_byte(2,MIN);
76 2 printf(":"); wr_byte(2,SEC);
77 2
78 2 last_sec = SEC;
79 2 while (last_sec == SEC);
80 2 }
81 1 }
ARM COMPILER V2.00d, main 23/10/05 18:16:18 PAGE 3
ASSEMBLY LISTING OF GENERATED OBJECT CODE
*** EXTERNALS:
EXTERN CODE16 (putchar?T)
EXTERN CODE16 (printf?T)
EXTERN CODE16 (init_registers?T)
EXTERN CODE16 (init_serial?T)
EXTERN CODE16 (init_clock?T)
EXTERN CODE16 (set_LED?T)
EXTERN CODE16 (init_timer?T)
EXTERN CODE16 (init_timer_1?T)
EXTERN CODE16 (wr_byte?T)
EXTERN CODE16 (wind_dir_char?T)
EXTERN CODE16 (wind_speed?T)
EXTERN CODE16 (disp_lum?T)
EXTERN CODE16 (disp_set_cursor?T)
EXTERN CODE16 (air_temp?T)
EXTERN CODE16 (air_temp_F?T)
EXTERN DATA (wind_dir_str)
EXTERN DATA (timer_0_capture)
EXTERN DATA (tval)
EXTERN NUMBER (__startup)
*** PUBLICS:
PUBLIC main
PUBLIC speed
PUBLIC last_sec
*** DATA SEGMENT '?CON?main':
00000000 ??S_7:
00000000 DB ':',0x00
00000002 ??S_6:
00000002 DB ' ',0x00
00000005 ??S_5:
00000005 DB 'F',0x00
00000007 ??S_4:
00000007 DB 'Temp %3.0f',0x00
00000012 ??S_3:
00000012 DB ' %2.1f MPH ',0x00
00000020 ??S_2:
00000020 DB ' Wind %s',0x00
0000002A ??S_1:
0000002A DB 0x0A,0x00
*** DATA SEGMENT '?DT0?main':
00000000 speed:
00000000 DS 4
00000004 last_sec:
00000004 DS 1
*** CODE SEGMENT '?PR?main?main':
42: int main (void) {
00000000 B500 PUSH {LR}
00000002 ; SCOPE-START
46: unsigned char task_active = 0x80; // lets try some tasking
00000002 2480 MOV R4,#0x80
00000004 ---- Variable 'task_active' assigned to Register 'R4' ----
49: init_registers();
00000004 F7FF BL init_registers?T ; T=0x0001 (1)
00000006 FFFC BL init_registers?T ; T=0x0001 (2)
50: init_serial(); // Initialize Serial Interface
0000000A F7FF BL init_serial?T ; T=0x0001 (1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -