📄 system.lst
字号:
*** ERROR C231 IN LINE 195 OF C:\KEIL\C51\INC\CYGNAL\C8051F320.H: 'CCF1': redefinition
*** ERROR C231 IN LINE 196 OF C:\KEIL\C51\INC\CYGNAL\C8051F320.H: 'CCF2': redefinition
*** ERROR C231 IN LINE 197 OF C:\KEIL\C51\INC\CYGNAL\C8051F320.H: 'CCF3': redefinition
*** ERROR C231 IN LINE 198 OF C:\KEIL\C51\INC\CYGNAL\C8051F320.H: 'CCF4': redefinition
*** ERROR C231 IN LINE 199 OF C:\KEIL\C51\INC\CYGNAL\C8051F320.H: 'CR': redefinition
*** ERROR C231 IN LINE 200 OF C:\KEIL\C51\INC\CYGNAL\C8051F320.H: 'CF': redefinition
*** ERROR C231 IN LINE 203 OF C:\KEIL\C51\INC\CYGNAL\C8051F320.H: 'AD0CM0': redefinition
*** ERROR C231 IN LINE 204 OF C:\KEIL\C51\INC\CYGNAL\C8051F320.H: 'AD0CM1': redefinition
*** ERROR C231 IN LINE 205 OF C:\KEIL\C51\INC\CYGNAL\C8051F320.H: 'AD0CM2': redefinition
*** ERROR C231 IN LINE 206 OF C:\KEIL\C51\INC\CYGNAL\C8051F320.H: 'AD0WINT': redefinition
*** ERROR C231 IN LINE 207 OF C:\KEIL\C51\INC\CYGNAL\C8051F320.H: 'AD0BUSY': redefinition
*** ERROR C231 IN LINE 208 OF C:\KEIL\C51\INC\CYGNAL\C8051F320.H: 'AD0INT': redefinition
*** ERROR C231 IN LINE 209 OF C:\KEIL\C51\INC\CYGNAL\C8051F320.H: 'AD0TM': redefinition
*** ERROR C231 IN LINE 210 OF C:\KEIL\C51\INC\CYGNAL\C8051F320.H: 'AD0EN': redefinition
*** ERROR C231 IN LINE 213 OF C:\KEIL\C51\INC\CYGNAL\C8051F320.H: 'SPIF': redefinition
*** ERROR C231 IN LINE 214 OF C:\KEIL\C51\INC\CYGNAL\C8051F320.H: 'WCOL': redefinition
*** ERROR C231 IN LINE 215 OF C:\KEIL\C51\INC\CYGNAL\C8051F320.H: 'MODF': redefinition
*** ERROR C231 IN LINE 216 OF C:\KEIL\C51\INC\CYGNAL\C8051F320.H: 'RXOVRN': redefinition
*** ERROR C231 IN LINE 217 OF C:\KEIL\C51\INC\CYGNAL\C8051F320.H: 'NSSMD1': redefinition
*** ERROR C231 IN LINE 218 OF C:\KEIL\C51\INC\CYGNAL\C8051F320.H: 'NSSMD0': redefinition
*** ERROR C231 IN LINE 219 OF C:\KEIL\C51\INC\CYGNAL\C8051F320.H: 'TXBMT': redefinition
*** ERROR C231 IN LINE 220 OF C:\KEIL\C51\INC\CYGNAL\C8051F320.H: 'SPIEN': redefinition
27
28 /** Indicates which LED is set to blink. */
29 volatile uint8_t led_blink;
30 /** How many times timer 1 should be restarted to be able to run for the
31 * wanted amount of time.
32 */
33 static uint8_t timer_rounds;
34
35 /** Starts timer 1.
36 *
37 * @param time The runtime in timer cycles
38 */
39 static void run_timer (uint16_t time);
40
41 void device_boot_msg(void)
42 {
43 1 uint8_t ctr;
44 1
45 1 for(ctr=0;ctr<3;ctr++)
46 1 {
47 2 LED1_BLINK();
48 2 while(led_blink) // wait until LED released...
49 2 ;
50 2 delay_10ms();
51 2
52 2 LED2_BLINK();
53 2 while(led_blink) // wait until LED released...
54 2 ;
55 2 delay_10ms();
56 2
57 2 LED3_BLINK();
58 2 while(led_blink) // wait until LED released...
59 2 ;
60 2 delay_10ms();
C51 COMPILER V8.08 SYSTEM 01/02/2009 11:50:56 PAGE 5
61 2
62 2 LED2_BLINK();
63 2 while(led_blink) // wait until LED released...
64 2 ;
65 2 delay_10ms();
66 2
67 2 LED1_BLINK();
68 2 while(led_blink) // wait until LED released...
69 2 ;
70 2 delay_10ms();
71 2
72 2 }
73 1 }
74
75 void delay_10ms(void)
76 {
77 1 start_timer(10);
78 1 wait_for_timer();
79 1 }
80
81 void delay_100ms(void)
82 {
83 1 start_timer(100);
84 1 wait_for_timer();
85 1 }
86
87 /** Interrupt handler for timer0.
88 * Turns off all blinking LED's. Hardware dependant in setting up
89 * timers and interrupt vector.
90 */
91 void t0_ov_interrupt(void) interrupt INTERRUPT_T0
*** ERROR C141 IN LINE 91 OF SYSTEM.C: syntax error near 'INTERRUPT_TIMER0', expected 'const'
92 {
*** ERROR C132 IN LINE 92 OF SYSTEM.C: 'INTERRUPT_TIMER0': not in formal parameter list
*** ERROR C141 IN LINE 92 OF SYSTEM.C: syntax error near '{'
93 TR0 = 0; // stop timer0
*** ERROR C244 IN LINE 93 OF SYSTEM.C: 'TR0': can't initialize, bad type or class
*** ERROR C132 IN LINE 93 OF SYSTEM.C: 'TR0': not in formal parameter list
94 TL0 = 0xE9; // reload timer..
*** ERROR C244 IN LINE 94 OF SYSTEM.C: 'TL0': can't initialize, bad type or class
*** ERROR C132 IN LINE 94 OF SYSTEM.C: 'TL0': not in formal parameter list
95 TH0 = 0xCB;
*** ERROR C244 IN LINE 95 OF SYSTEM.C: 'TH0': can't initialize, bad type or class
*** ERROR C132 IN LINE 95 OF SYSTEM.C: 'TH0': not in formal parameter list
96
97 if (led_blink & (1<<LED1_INDEX))
*** ERROR C141 IN LINE 97 OF SYSTEM.C: syntax error near 'if'
*** ERROR C141 IN LINE 97 OF SYSTEM.C: syntax error near '&', expected ')'
*** ERROR C141 IN LINE 97 OF SYSTEM.C: syntax error near '1'
*** ERROR C129 IN LINE 97 OF SYSTEM.C: missing ';' before ')'
98 {
99 LED1_OFF();
100 }
101 if (led_blink & (1<<LED2_INDEX))
102 {
103 LED2_OFF();
104 }
105 if (led_blink & (1<<LED3_INDEX))
106 {
107 LED3_OFF();
108 }
109
C51 COMPILER V8.08 SYSTEM 01/02/2009 11:50:56 PAGE 6
110 led_blink = 0;
111 }
112
113 void start_timer (uint16_t time)
114 {
115 uint16_t setuptime;
116 uint16_t firstruntime;
117
118 firstruntime = (uint16_t)(time % MAX_RUNTIME);
119
120 setuptime = 0 - (firstruntime * CYCLES_PR_MS);
121 time -= firstruntime;
122 timer_rounds = (uint8_t)(time / MAX_RUNTIME) + 1;
123
124 if (setuptime == 0)
125 {
126 setuptime = MAX_TIME;
127 timer_rounds--;
128 }
129
130 run_timer (setuptime);
131 }
132
133 static void run_timer (uint16_t time)
134 {
135 if (time != 0)
136 {
137 T1_MODE1(); // Setting up mode 1 on timer 1 (16-bit timer)
138 T1_SET_LB((uint8_t)time);
139 T1_SET_HB((uint8_t)(time >> 8));
140 T1_START();
141 }
142 }
143
144 void wait_for_timer (void)
145 {
146 while (timer_rounds > 0)
147 {
148 while (!TIMER1_OVERFLOW())
149 ;
150
151 timer_rounds--;
152
153 if (timer_rounds > 0)
154 {
155 run_timer (MAX_TIME);
156 }
157 }
158
159 T1_STOP();
160 }
161
162 bool timer_done (void)
163 {
164 bool retval = false;
165
166 if (TIMER1_OVERFLOW())
167 {
168 timer_rounds--;
169
170 if (timer_rounds > 0)
171 {
C51 COMPILER V8.08 SYSTEM 01/02/2009 11:50:56 PAGE 7
172 run_timer (MAX_TIME);
173 }
174 else
175 {
176 retval = true;
177 T1_STOP();
178 }
179 }
180
181 return retval;
182 }
C51 COMPILATION COMPLETE. 0 WARNING(S), 193 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -