📄 comtest.lst
字号:
\ 00000C 7B907B00 CMP.B #0x7b, R11
\ 000010 0934 JGE ??vComTxTask_2
163 {
164 if( xSerialPutChar( xPort, cByteToSend, comNO_BLOCK ) == pdPASS )
\ 000012 0312 PUSH.W #0x0
\ 000014 4E4B MOV.B R11, R14
\ 000016 1C42.... MOV.W &xPort, R12
\ 00001A B012.... CALL #xSerialPutChar
165 {
166 // vParTestToggleLED( uxBaseLED + comTX_LED_OFFSET );
167 }
168 }
\ 00001E 5B53 ADD.B #0x1, R11
\ 000020 2153 ADD.W #0x2, SP
\ 000022 F43F JMP ??vComTxTask_0
169
170 /* Turn the LED off while we are not doing anything. */
171 // vParTestSetLED( uxBaseLED + comTX_LED_OFFSET, pdFALSE );
172
173 /* We have posted all the characters in the string - wait before
174 re-sending. Wait a pseudo-random time as this will provide a better
175 test. */
176 xTimeToWait = xTaskGetTickCount() + comOFFSET_TIME;
\ ??vComTxTask_2:
\ 000024 B012.... CALL #xTaskGetTickCount
\ 000028 3C500300 ADD.W #0x3, R12
\ 00002C 084C MOV.W R12, R8
177
178 /* Make sure we don't wait too long... */
179 xTimeToWait %= comTX_MAX_BLOCK_TIME;
\ 00002E 0C48 MOV.W R8, R12
\ 000030 3E409600 MOV.W #0x96, R14
\ 000034 B012.... CALL #?DivMod16u
\ 000038 084E MOV.W R14, R8
180
181 /* ...but we do want to wait. */
182 if( xTimeToWait < comTX_MIN_BLOCK_TIME )
\ 00003A 38903200 CMP.W #0x32, R8
\ 00003E 022C JC ??vComTxTask_3
183 {
184 xTimeToWait = comTX_MIN_BLOCK_TIME;
\ 000040 38403200 MOV.W #0x32, R8
185 }
186
187 vTaskDelay( xTimeToWait );
\ ??vComTxTask_3:
\ 000044 0C48 MOV.W R8, R12
\ 000046 B012.... CALL #vTaskDelay
\ 00004A DE3F JMP ??vComTxTask_1
188 }
189 } /*lint !e715 !e818 pvParameters is required for a task function even if it is not referenced. */
190 /*-----------------------------------------------------------*/
191
\ In segment CODE, align 2
192 static portTASK_FUNCTION( vComRxTask, pvParameters )
\ vComRxTask:
193 {
\ 000000 0A12 PUSH.W R10
\ 000002 0B12 PUSH.W R11
\ 000004 0812 PUSH.W R8
\ 000006 0912 PUSH.W R9
\ 000008 2183 SUB.W #0x2, SP
\ 00000A 0A4C MOV.W R12, R10
194 signed portCHAR cExpectedByte, cByteRxed;
195 portBASE_TYPE xResyncRequired = pdFALSE, xErrorOccurred = pdFALSE;
\ 00000C 0843 MOV.W #0x0, R8
\ 00000E 0943 MOV.W #0x0, R9
196
197 /* Just to stop compiler warnings. */
198 ( void ) pvParameters;
199
200 for( ;; )
201 {
202 /* We expect to receive the characters from comFIRST_BYTE to
203 comLAST_BYTE in an incrementing order. Loop to receive each byte. */
204 for( cExpectedByte = comFIRST_BYTE; cExpectedByte <= comLAST_BYTE; cExpectedByte++ )
\ ??vComRxTask_2:
\ 000010 7B404100 MOV.B #0x41, R11
\ ??vComRxTask_0:
\ 000014 7B907B00 CMP.B #0x7b, R11
\ 000018 1134 JGE ??vComRxTask_3
205 {
206 /* Block on the queue that contains received bytes until a byte is
207 available. */
208 if( xSerialGetChar( xPort, &cByteRxed, comRX_BLOCK_TIME ) )
\ 00001A 3312 PUSH.W #0xffff
\ 00001C 0E41 MOV.W SP, R14
\ 00001E 2E53 ADD.W #0x2, R14
\ 000020 1C42.... MOV.W &xPort, R12
\ 000024 B012.... CALL #xSerialGetChar
\ 000028 2153 ADD.W #0x2, SP
\ 00002A 0C93 CMP.W #0x0, R12
\ 00002C 0524 JEQ ??vComRxTask_4
209 {
210 /* Was this the byte we were expecting? If so, toggle the LED,
211 otherwise we are out on sync and should break out of the loop
212 until the expected character sequence is about to restart. */
213 if( cByteRxed == cExpectedByte )
\ 00002E C19B0000 CMP.B R11, 0x0(SP)
\ 000032 0224 JEQ ??vComRxTask_4
214 {
215 // vParTestToggleLED( uxBaseLED + comRX_LED_OFFSET );
216 }
217 else
218 {
219 xResyncRequired = pdTRUE;
\ 000034 1843 MOV.W #0x1, R8
220 break; /*lint !e960 Non-switch break allowed. */
\ 000036 023C JMP ??vComRxTask_3
221 }
222 }
223 }
\ ??vComRxTask_4:
\ 000038 5B53 ADD.B #0x1, R11
\ 00003A EC3F JMP ??vComRxTask_0
224
225 /* Turn the LED off while we are not doing anything. */
226 // vParTestSetLED( uxBaseLED + comRX_LED_OFFSET, pdFALSE );
227
228 /* Did we break out of the loop because the characters were received in
229 an unexpected order? If so wait here until the character sequence is
230 about to restart. */
231 if( xResyncRequired == pdTRUE )
\ ??vComRxTask_3:
\ 00003C 1893 CMP.W #0x1, R8
\ 00003E 1020 JNE ??vComRxTask_5
232 {
233 while( cByteRxed != comLAST_BYTE )
\ ??vComRxTask_1:
\ 000040 F1907A000000 CMP.B #0x7a, 0x0(SP)
\ 000046 0924 JEQ ??vComRxTask_6
234 {
235 /* Block until the next char is available. */
236 xSerialGetChar( xPort, &cByteRxed, comRX_BLOCK_TIME );
\ 000048 3312 PUSH.W #0xffff
\ 00004A 0E41 MOV.W SP, R14
\ 00004C 2E53 ADD.W #0x2, R14
\ 00004E 1C42.... MOV.W &xPort, R12
\ 000052 B012.... CALL #xSerialGetChar
\ 000056 2153 ADD.W #0x2, SP
\ 000058 F33F JMP ??vComRxTask_1
237 }
238
239 /* Note that an error occurred which caused us to have to resync.
240 We use this to stop incrementing the loop counter so
241 sAreComTestTasksStillRunning() will return false - indicating an
242 error. */
243 xErrorOccurred++;
\ ??vComRxTask_6:
\ 00005A 1953 ADD.W #0x1, R9
244
245 /* We have now resynced with the Tx task and can continue. */
246 xResyncRequired = pdFALSE;
\ 00005C 0843 MOV.W #0x0, R8
\ 00005E D83F JMP ??vComRxTask_2
247 }
248 else
249 {
250 if( xErrorOccurred < comTOTAL_PERMISSIBLE_ERRORS )
\ ??vComRxTask_5:
\ 000060 2993 CMP.W #0x2, R9
\ 000062 D637 JGE ??vComRxTask_2
251 {
252 /* Increment the count of successful loops. As error
253 occurring (i.e. an unexpected character being received) will
254 prevent this counter being incremented for the rest of the
255 execution. Don't worry about mutual exclusion on this
256 variable - it doesn't really matter as we just want it
257 to change. */
258 uxRxLoops++;
\ 000064 9253.... ADD.W #0x1, &uxRxLoops
\ 000068 D33F JMP ??vComRxTask_2
259 }
260 }
261 }
262 } /*lint !e715 !e818 pvParameters is required for a task function even if it is not referenced. */
263 /*-----------------------------------------------------------*/
264
\ In segment CODE, align 2
265 portBASE_TYPE xAreComTestTasksStillRunning( void )
\ xAreComTestTasksStillRunning:
266 {
267 portBASE_TYPE xReturn;
268
269 /* If the count of successful reception loops has not changed than at
270 some time an error occurred (i.e. a character was received out of sequence)
271 and we will return false. */
272 if( uxRxLoops == comINITIAL_RX_COUNT_VALUE )
\ 000000 8293.... CMP.W #0x0, &uxRxLoops
\ 000004 0220 JNE ??xAreComTestTasksStillRunning_0
273 {
274 xReturn = pdFALSE;
\ 000006 0C43 MOV.W #0x0, R12
\ 000008 013C JMP ??xAreComTestTasksStillRunning_1
275 }
276 else
277 {
278 xReturn = pdTRUE;
\ ??xAreComTestTasksStillRunning_0:
\ 00000A 1C43 MOV.W #0x1, R12
279 }
280
281 /* Reset the count of successful Rx loops. When this function is called
282 again we expect this to have been incremented. */
283 uxRxLoops = comINITIAL_RX_COUNT_VALUE;
\ ??xAreComTestTasksStillRunning_1:
\ 00000C 8243.... MOV.W #0x0, &uxRxLoops
284
285 return xReturn;
\ 000010 3041 RET
286 }
\ In segment DATA16_C, align 1, align-sorted
\ `?<Constant "COMTx">`:
\ 000000 434F4D547800 DC8 "COMTx"
\ In segment DATA16_C, align 1, align-sorted
\ `?<Constant "COMRx">`:
\ 000000 434F4D527800 DC8 "COMRx"
287
Maximum stack usage in bytes:
Function CSTACK
-------- ------
vAltStartComTestTasks 26
-> xSerialPortInitMinimal 10
-> xTaskCreate 18
-> xTaskCreate 26
vComRxTask 14
-> xSerialGetChar 14
-> xSerialGetChar 14
vComTxTask 10
-> xSerialPutChar 10
-> xTaskGetTickCount 8
-> vTaskDelay 8
xAreComTestTasksStillRunning 2
Segment part sizes:
Function/Label Bytes
-------------- -----
xPort 2
uxBaseLED 2
uxRxLoops 2
vAltStartComTestTasks 90
vComTxTask 76
vComRxTask 106
xAreComTestTasksStillRunning 18
?<Constant "COMTx"> 6
?<Constant "COMRx"> 6
290 bytes in segment CODE
12 bytes in segment DATA16_C
6 bytes in segment DATA16_Z
290 bytes of CODE memory
12 bytes of CONST memory
6 bytes of DATA memory
Errors: none
Warnings: 3
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -