📄 main.s43
字号:
xLocalError:
DS8 2
// 131
// 132 /*-----------------------------------------------------------*/
// 133
// 134 /*
// 135 * Start the demo application tasks - then start the real time scheduler.
// 136 */
RSEG CODE:CODE:REORDER:NOROOT(1)
// 137 int main( void )
main:
CFI Block cfiBlock0 Using cfiCommon0
CFI Function main
// 138 {
// 139 /* Setup the hardware ready for the demo. */
// 140 prvSetupHardware();
FUNCALL main, prvSetupHardware
LOCFRAME CSTACK, 2, STACK
FUNCALL main, vParTestInitialise
LOCFRAME CSTACK, 2, STACK
FUNCALL main, vStartLEDFlashTasks
LOCFRAME CSTACK, 2, STACK
FUNCALL main, vStartMathTasks
LOCFRAME CSTACK, 2, STACK
FUNCALL main, vStartIntegerMathTasks
LOCFRAME CSTACK, 2, STACK
FUNCALL main, vAltStartComTestTasks
LOCFRAME CSTACK, 4, STACK
FUNCALL main, vStartPolledQueueTasks
LOCFRAME CSTACK, 4, STACK
FUNCALL main, vStartBlockingQueueTasks
LOCFRAME CSTACK, 4, STACK
FUNCALL main, vStartDynamicPriorityTasks
LOCFRAME CSTACK, 4, STACK
FUNCALL main, xTaskCreate
LOCFRAME CSTACK, 12, STACK
FUNCALL main, vTaskStartScheduler
LOCFRAME CSTACK, 12, STACK
CALL #prvSetupHardware
// 141 vParTestInitialise(); // '169
CALL #vParTestInitialise
// 142
// 143 /* Start the standard demo application tasks. */
// 144 vStartLEDFlashTasks( mainLED_TASK_PRIORITY ); // '169 - 4 of 8 tasks
MOV.W #0x1, R12
CALL #vStartLEDFlashTasks
// 145 vStartMathTasks( tskIDLE_PRIORITY );
MOV.W #0x0, R12
CALL #vStartMathTasks
// 146 vStartIntegerMathTasks( tskIDLE_PRIORITY );
MOV.W #0x0, R12
CALL #vStartIntegerMathTasks
// 147 vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED - 1 ); // '169 - 2 of 8 tasks
PUSH.W #0x9
CFI CFA SP+4
MOV.W #0xc200, R14
MOV.W #0x1, R15
MOV.W #0x2, R12
CALL #vAltStartComTestTasks
// 148 vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
MOV.W #0x2, R12
CALL #vStartPolledQueueTasks
// 149 vStartBlockingQueueTasks( tskIDLE_PRIORITY );
MOV.W #0x0, R12
CALL #vStartBlockingQueueTasks
// 150 vStartDynamicPriorityTasks();
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 );
PUSH.W #0x0
CFI CFA SP+6
PUSH.W #0x3
CFI CFA SP+8
PUSH.W #0x0
CFI CFA SP+10
PUSH.W #0x40
CFI CFA SP+12
MOV.W #`?<Constant "Check">`, R14
MOV.W #vErrorChecks, R12
CALL #xTaskCreate
// 155
// 156 /* Start the scheduler. */
// 157 // '169 - IDLE task is '8th' task so to speak
// 158 vTaskStartScheduler();
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;
MOV.W #0x0, R12
ADD.W #0xa, SP
CFI CFA SP+2
RET
CFI EndBlock cfiBlock0
// 163 }
// 164 /*-----------------------------------------------------------*/
// 165
RSEG CODE:CODE:REORDER:NOROOT(1)
// 166 static portTASK_FUNCTION( vErrorChecks, pvParameters )
vErrorChecks:
CFI Block cfiBlock1 Using cfiCommon0
CFI Function vErrorChecks
// 167 {
FUNCALL vErrorChecks, vTaskDelay
LOCFRAME CSTACK, 6, STACK
FUNCALL vErrorChecks, prvCheckOtherTasksAreStillRunning
LOCFRAME CSTACK, 6, STACK
PUSH.W R10
CFI R10 Frame(CFA, -4)
CFI CFA SP+4
PUSH.W R11
CFI R11 Frame(CFA, -6)
CFI CFA SP+6
MOV.W R12, R10
// 168 portTickType xDelayPeriod = mainNO_ERROR_CHECK_DELAY;
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:
MOV.W R11, R12
CALL #vTaskDelay
// 178
// 179 /* See if the other tasks are all ok. */
// 180 if( prvCheckOtherTasksAreStillRunning() != pdPASS )
CALL #prvCheckOtherTasksAreStillRunning
CMP.W #0x1, R12
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;
MOV.W #0x1f4, R11
JMP ??vErrorChecks_0
CFI EndBlock cfiBlock1
// 186 }
// 187
// 188 /* Flash! */
// 189 // vParTestToggleLED( mainCHECK_LED );
// 190 }
// 191 }
// 192 /*-----------------------------------------------------------*/
// 193
RSEG CODE:CODE:REORDER:NOROOT(1)
// 194 static portSHORT prvCheckOtherTasksAreStillRunning( void )
prvCheckOtherTasksAreStillRunning:
CFI Block cfiBlock2 Using cfiCommon0
CFI Function 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 )
FUNCALL prvCheckOtherTasksAreStillRunning, xAreIntegerMathsTaskStillRunning
LOCFRAME CSTACK, 2, STACK
FUNCALL prvCheckOtherTasksAreStillRunning, xAreComTestTasksStillRunning
LOCFRAME CSTACK, 2, STACK
FUNCALL prvCheckOtherTasksAreStillRunning, xArePollingQueuesStillRunning
LOCFRAME CSTACK, 2, STACK
CALL #xAreIntegerMathsTaskStillRunning
CMP.W #0x1, R12
JEQ ??prvCheckOtherTasksAreStillRunning_0
// 206 {
// 207 sNoErrorFound = pdFALSE;
MOV.W #0x0, &??sNoErrorFound
// 208 }
// 209
// 210 if( xAreComTestTasksStillRunning() != pdTRUE )
??prvCheckOtherTasksAreStillRunning_0:
CALL #xAreComTestTasksStillRunning
CMP.W #0x1, R12
JEQ ??prvCheckOtherTasksAreStillRunning_1
// 211 {
// 212 sNoErrorFound = pdFALSE;
MOV.W #0x0, &??sNoErrorFound
// 213 }
// 214
// 215 if( xArePollingQueuesStillRunning() != pdTRUE )
??prvCheckOtherTasksAreStillRunning_1:
CALL #xArePollingQueuesStillRunning
CMP.W #0x1, R12
JEQ ??prvCheckOtherTasksAreStillRunning_2
// 216 {
// 217 sNoErrorFound = pdFALSE;
MOV.W #0x0, &??sNoErrorFound
// 218 }
// 219
// 220 if( xLocalError == pdTRUE )
??prvCheckOtherTasksAreStillRunning_2:
CMP.W #0x1, &xLocalError
JNE ??prvCheckOtherTasksAreStillRunning_3
// 221 {
// 222 sNoErrorFound = pdFALSE;
MOV.W #0x0, &??sNoErrorFound
// 223 }
// 224
// 225 return sNoErrorFound;
??prvCheckOtherTasksAreStillRunning_3:
MOV.W &??sNoErrorFound, R12
RET
CFI EndBlock cfiBlock2
// 226 }
RSEG DATA16_I:DATA:SORT:NOROOT(1)
REQUIRE ?cstart_init_copy
??sNoErrorFound:
DS8 2
REQUIRE `?<Initializer for sNoErrorFound>`
// 227 /*-----------------------------------------------------------*/
// 228
RSEG CODE:CODE:REORDER:NOROOT(1)
// 229 static void prvSetupHardware( void )
prvSetupHardware:
CFI Block cfiBlock3 Using cfiCommon0
CFI Function prvSetupHardware
// 230 {
// 231
// 232 // XXX - Not using DCO - replace this with correct clock stuff...
// 233
// 234 /* Stop the watchdog. */
// 235 WDTCTL = WDTPW + WDTHOLD;
MOV.W #0x5a80, &0x120
// 236 // CLK_init();
// 237
// 238 BCSCTL1 = DIVA_0 | RSEL2;
MOV.B #0x4, &0x57
// 239
// 240 // per UG:
// 241
// 242 do
// 243 {
// 244 unsigned int i;
// 245
// 246 IFG1 &= ~OFIFG;
??prvSetupHardware_1:
BIC.B #0x2, &0x2
// 247 for (i = 0; i < 0xff; i++)
MOV.W #0x0, R15
??prvSetupHardware_0:
CMP.W #0xff, R15
JC ??prvSetupHardware_2
// 248 {
// 249 continue;
ADD.W #0x1, R15
JMP ??prvSetupHardware_0
// 250 }
// 251 }
// 252 while ((IFG1 & OFIFG) != 0);
??prvSetupHardware_2:
BIT.B #0x2, &0x2
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;
MOV.B #0x8e, &0x58
// 259
// 260 // IO_init();
// 261
// 262 // set I/O as required by your board. Do this with CAUTION!
// 263 // the following is supplied as an example only.
// 264
// 265 // P1:
// 266
// 267 P1SEL_bit.P1SEL_0 = 0; // 0 is digital I/O
BIC.B #0x1, &0x26
// 268 P1SEL_bit.P1SEL_1 = 0; // 0 is digital I/O
BIC.B #0x2, &0x26
// 269 P1SEL_bit.P1SEL_2 = 0; // 0 is digital I/O
BIC.B #0x4, &0x26
// 270 P1SEL_bit.P1SEL_3 = 0; // 0 is digital I/O
BIC.B #0x8, &0x26
// 271 P1SEL_bit.P1SEL_4 = 0; // 0 is digital I/O
BIC.B #0x10, &0x26
// 272 P1SEL_bit.P1SEL_5 = 0; // 0 is digital I/O
BIC.B #0x20, &0x26
// 273 P1SEL_bit.P1SEL_6 = 0; // 0 is digital I/O
BIC.B #0x40, &0x26
// 274 P1SEL_bit.P1SEL_7 = 0; // 0 is digital I/O
BIC.B #0x80, &0x26
// 275
// 276 P1DIR_bit.P1DIR_0 = 0; // 0 is input
BIC.B #0x1, &0x22
// 277 P1DIR_bit.P1DIR_1 = 0; // 0 is input
BIC.B #0x2, &0x22
// 278 P1DIR_bit.P1DIR_2 = 0; // 0 is input
BIC.B #0x4, &0x22
// 279 P1DIR_bit.P1DIR_3 = 0; // 0 is input
BIC.B #0x8, &0x22
// 280 P1DIR_bit.P1DIR_4 = 0; // 0 is input
BIC.B #0x10, &0x22
// 281 P1DIR_bit.P1DIR_5 = 0; // 0 is input
BIC.B #0x20, &0x22
// 282 P1DIR_bit.P1DIR_6 = 0; // 0 is input
BIC.B #0x40, &0x22
// 283 P1DIR_bit.P1DIR_7 = 0; // 0 is input
BIC.B #0x80, &0x22
// 284
// 285 // P2:
// 286
// 287 P2SEL_bit.P2SEL_0 = 0; // 0 is digital I/O
BIC.B #0x1, &0x2e
// 288 P2SEL_bit.P2SEL_1 = 0; // 0 is digital I/O
BIC.B #0x2, &0x2e
// 289 P2SEL_bit.P2SEL_2 = 0; // 0 is digital I/O
BIC.B #0x4, &0x2e
// 290 P2SEL_bit.P2SEL_3 = 0; // 0 is digital I/O
BIC.B #0x8, &0x2e
// 291 P2SEL_bit.P2SEL_4 = 0; // 0 is digital I/O
BIC.B #0x10, &0x2e
// 292 P2SEL_bit.P2SEL_5 = 0; // 0 is digital I/O
BIC.B #0x20, &0x2e
// 293 P2SEL_bit.P2SEL_6 = 0; // 0 is digital I/O
BIC.B #0x40, &0x2e
// 294 P2SEL_bit.P2SEL_7 = 0; // 0 is digital I/O
BIC.B #0x80, &0x2e
// 295
// 296 P2DIR_bit.P2DIR_0 = 0; // 0 is input
BIC.B #0x1, &0x2a
// 297 P2DIR_bit.P2DIR_1 = 0; // 0 is input
BIC.B #0x2, &0x2a
// 298 P2DIR_bit.P2DIR_2 = 0; // 0 is input
BIC.B #0x4, &0x2a
// 299 P2DIR_bit.P2DIR_3 = 0; // 0 is input
BIC.B #0x8, &0x2a
// 300 P2DIR_bit.P2DIR_4 = 1; // 1 is output -- NC
BIS.B #0x10, &0x2a
// 301 P2DIR_bit.P2DIR_5 = 0; // 0 is input
BIC.B #0x20, &0x2a
// 302 P2DIR_bit.P2DIR_6 = 1; // 1 is output -- NC
BIS.B #0x40, &0x2a
// 303 P2DIR_bit.P2DIR_7 = 1; // 1 is output -- NC
BIS.B #0x80, &0x2a
// 304
// 305 // P3:
// 306
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -