📄 main.lst
字号:
126 */
127 static void prvSetupHardware( void );
128
129
\ In segment DATA16_Z, align 2, align-sorted
\ 000000 REQUIRE ?cstart_init_zero
130 portBASE_TYPE xLocalError = pdFALSE;
\ xLocalError:
\ 000000 DS8 2
131
132 /*-----------------------------------------------------------*/
133
134 /*
135 * Start the demo application tasks - then start the real time scheduler.
136 */
\ In segment CODE, align 2
137 int main( void )
\ main:
138 {
139 /* Setup the hardware ready for the demo. */
140 prvSetupHardware();
\ 000000 B012.... CALL #prvSetupHardware
141 vParTestInitialise(); // '169
\ 000004 B012.... CALL #vParTestInitialise
142
143 /* Start the standard demo application tasks. */
144 vStartLEDFlashTasks( mainLED_TASK_PRIORITY ); // '169 - 4 of 8 tasks
\ 000008 1C43 MOV.W #0x1, R12
\ 00000A B012.... CALL #vStartLEDFlashTasks
145 vStartMathTasks( tskIDLE_PRIORITY );
^
Warning[Pe223]: function "vStartMathTasks" declared implicitly
\ 00000E 0C43 MOV.W #0x0, R12
\ 000010 B012.... CALL #vStartMathTasks
146 vStartIntegerMathTasks( tskIDLE_PRIORITY );
\ 000014 0C43 MOV.W #0x0, R12
\ 000016 B012.... CALL #vStartIntegerMathTasks
147 vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED - 1 ); // '169 - 2 of 8 tasks
\ 00001A 30120900 PUSH.W #0x9
\ 00001E 3E4000C2 MOV.W #0xc200, R14
\ 000022 1F43 MOV.W #0x1, R15
\ 000024 2C43 MOV.W #0x2, R12
\ 000026 B012.... CALL #vAltStartComTestTasks
148 vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
\ 00002A 2C43 MOV.W #0x2, R12
\ 00002C B012.... CALL #vStartPolledQueueTasks
149 vStartBlockingQueueTasks( tskIDLE_PRIORITY );
^
Warning[Pe223]: function "vStartBlockingQueueTasks" declared implicitly
\ 000030 0C43 MOV.W #0x0, R12
\ 000032 B012.... CALL #vStartBlockingQueueTasks
150 vStartDynamicPriorityTasks();
\ 000036 B012.... CALL #vStartDynamicPriorityTasks
151
152 /* Start the 'Check' task which is defined in this file. */
153 // '169 - 1 of 8 tasks
154 xTaskCreate( vErrorChecks, ( const signed portCHAR * const ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
^
Warning[Pe191]: type qualifier is meaningless on cast type
\ 00003A 0312 PUSH.W #0x0
\ 00003C 30120300 PUSH.W #0x3
\ 000040 0312 PUSH.W #0x0
\ 000042 30124000 PUSH.W #0x40
\ 000046 3E40.... MOV.W #`?<Constant "Check">`, R14
\ 00004A 3C40.... MOV.W #vErrorChecks, R12
\ 00004E B012.... CALL #xTaskCreate
155
156 /* Start the scheduler. */
157 // '169 - IDLE task is '8th' task so to speak
158 vTaskStartScheduler();
\ 000052 B012.... CALL #vTaskStartScheduler
159
160 /* As the scheduler has been started the demo applications tasks will be
161 executing and we should never get here! */
162 return 0;
\ 000056 0C43 MOV.W #0x0, R12
\ 000058 31500A00 ADD.W #0xa, SP
\ 00005C 3041 RET
163 }
164 /*-----------------------------------------------------------*/
165
\ In segment CODE, align 2
166 static portTASK_FUNCTION( vErrorChecks, pvParameters )
^
Remark[Pe826]: parameter "pvParameters" was never referenced
\ vErrorChecks:
167 {
\ 000000 0A12 PUSH.W R10
\ 000002 0B12 PUSH.W R11
\ 000004 0A4C MOV.W R12, R10
168 portTickType xDelayPeriod = mainNO_ERROR_CHECK_DELAY;
\ 000006 3B40B80B MOV.W #0xbb8, R11
169
170 /* Cycle for ever, delaying then checking all the other tasks are still
171 operating without error. */
172 for( ;; )
173 {
174 /* Wait until it is time to check again. The time we wait here depends
175 on whether an error has been detected or not. When an error is
176 detected the time is shortened resulting in a faster LED flash rate. */
177 vTaskDelay( xDelayPeriod );
\ ??vErrorChecks_0:
\ 00000A 0C4B MOV.W R11, R12
\ 00000C B012.... CALL #vTaskDelay
178
179 /* See if the other tasks are all ok. */
180 if( prvCheckOtherTasksAreStillRunning() != pdPASS )
\ 000010 B012.... CALL #prvCheckOtherTasksAreStillRunning
\ 000014 1C93 CMP.W #0x1, R12
\ 000016 F927 JEQ ??vErrorChecks_0
181 {
182 /* An error occurred in one of the tasks so shorten the delay
183 period - which has the effect of increasing the frequency of the
184 LED toggle. */
185 xDelayPeriod = mainERROR_CHECK_DELAY;
\ 000018 3B40F401 MOV.W #0x1f4, R11
\ 00001C F63F JMP ??vErrorChecks_0
186 }
187
188 /* Flash! */
189 // vParTestToggleLED( mainCHECK_LED );
190 }
191 }
192 /*-----------------------------------------------------------*/
193
\ In segment CODE, align 2
194 static portSHORT prvCheckOtherTasksAreStillRunning( void )
\ prvCheckOtherTasksAreStillRunning:
195 {
196 static portSHORT sNoErrorFound = pdTRUE;
197
198 /* The demo tasks maintain a count that increments every cycle of the task
199 provided that the task has never encountered an error. This function
200 checks the counts maintained by the tasks to ensure they are still being
201 incremented. A count remaining at the same value between calls therefore
202 indicates that an error has been detected. Only tasks that do not flash
203 an LED are checked. */
204
205 if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
\ 000000 B012.... CALL #xAreIntegerMathsTaskStillRunning
\ 000004 1C93 CMP.W #0x1, R12
\ 000006 0224 JEQ ??prvCheckOtherTasksAreStillRunning_0
206 {
207 sNoErrorFound = pdFALSE;
\ 000008 8243.... MOV.W #0x0, &??sNoErrorFound
208 }
209
210 if( xAreComTestTasksStillRunning() != pdTRUE )
\ ??prvCheckOtherTasksAreStillRunning_0:
\ 00000C B012.... CALL #xAreComTestTasksStillRunning
\ 000010 1C93 CMP.W #0x1, R12
\ 000012 0224 JEQ ??prvCheckOtherTasksAreStillRunning_1
211 {
212 sNoErrorFound = pdFALSE;
\ 000014 8243.... MOV.W #0x0, &??sNoErrorFound
213 }
214
215 if( xArePollingQueuesStillRunning() != pdTRUE )
\ ??prvCheckOtherTasksAreStillRunning_1:
\ 000018 B012.... CALL #xArePollingQueuesStillRunning
\ 00001C 1C93 CMP.W #0x1, R12
\ 00001E 0224 JEQ ??prvCheckOtherTasksAreStillRunning_2
216 {
217 sNoErrorFound = pdFALSE;
\ 000020 8243.... MOV.W #0x0, &??sNoErrorFound
218 }
219
220 if( xLocalError == pdTRUE )
\ ??prvCheckOtherTasksAreStillRunning_2:
\ 000024 9293.... CMP.W #0x1, &xLocalError
\ 000028 0220 JNE ??prvCheckOtherTasksAreStillRunning_3
221 {
222 sNoErrorFound = pdFALSE;
\ 00002A 8243.... MOV.W #0x0, &??sNoErrorFound
223 }
224
225 return sNoErrorFound;
\ ??prvCheckOtherTasksAreStillRunning_3:
\ 00002E 1C42.... MOV.W &??sNoErrorFound, R12
\ 000032 3041 RET
226 }
\ In segment DATA16_I, align 2, align-sorted
\ 000000 REQUIRE ?cstart_init_copy
\ ??sNoErrorFound:
\ 000000 DS8 2
\ 000002 REQUIRE `?<Initializer for sNoErrorFound>`
227 /*-----------------------------------------------------------*/
228
\ In segment CODE, align 2
229 static void prvSetupHardware( void )
\ prvSetupHardware:
230 {
231
232 // XXX - Not using DCO - replace this with correct clock stuff...
233
234 /* Stop the watchdog. */
235 WDTCTL = WDTPW + WDTHOLD;
\ 000000 B240805A2001 MOV.W #0x5a80, &0x120
236 // CLK_init();
237
238 BCSCTL1 = DIVA_0 | RSEL2;
\ 000006 E2425700 MOV.B #0x4, &0x57
239
240 // per UG:
241
242 do
243 {
244 unsigned int i;
245
246 IFG1 &= ~OFIFG;
\ ??prvSetupHardware_1:
\ 00000A E2C30200 BIC.B #0x2, &0x2
247 for (i = 0; i < 0xff; i++)
\ 00000E 0F43 MOV.W #0x0, R15
\ ??prvSetupHardware_0:
\ 000010 3F90FF00 CMP.W #0xff, R15
\ 000014 022C JC ??prvSetupHardware_2
248 {
249 continue;
\ 000016 1F53 ADD.W #0x1, R15
\ 000018 FB3F JMP ??prvSetupHardware_0
250 }
251 }
252 while ((IFG1 & OFIFG) != 0);
\ ??prvSetupHardware_2:
\ 00001A E2B30200 BIT.B #0x2, &0x2
\ 00001E F52F JC ??prvSetupHardware_1
253
254 // set 8MHz Clk: (NOTE: this will be different for other
255 // frequencies. If using the DCO - comment this out and look at
256 // the commented code below.
257
258 BCSCTL2 = SELM1 | DIVM_0 | SELS | DIVS_3;
\ 000020 F2408E005800 MOV.B #0x8e, &0x58
259
260 // IO_init();
261
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -