📄 serial.s43
字号:
// 214 xReturn = pdPASS;
MOV.W #0x1, R8
JMP ??xSerialPutChar_1
// 215 }
// 216 else
// 217 {
// 218 /* sTHREEmpty is false, so there are still characters waiting to be
// 219 transmitted. We have to queue this character so it gets
// 220 transmitted in turn. */
// 221
// 222 /* Return false if after the block time there is no room on the Tx
// 223 queue. It is ok to block inside a critical section as each task
// 224 maintains it's own critical section status. */
// 225 xReturn = xQueueSend( xCharsForTx, &cOutChar, xBlockTime );
??xSerialPutChar_0:
PUSH.W R11
CFI CFA SP+12
MOV.W SP, R14
ADD.W #0x2, R14
MOV.W &xCharsForTx, R12
CALL #xQueueSend
MOV.W R12, R8
// 226
// 227 /* Depending on queue sizing and task prioritisation: While we
// 228 were blocked waiting to post on the queue interrupts were not
// 229 disabled. It is possible that the serial ISR has emptied the
// 230 Tx queue, in which case we need to start the Tx off again
// 231 writing directly to the Tx register. */
// 232 if( ( sTHREEmpty == pdTRUE ) && ( xReturn == pdPASS ) )
ADD.W #0x2, SP
CFI CFA SP+10
CMP.W #0x1, &sTHREEmpty
JNE ??xSerialPutChar_1
CMP.W #0x1, R8
JNE ??xSerialPutChar_1
// 233 {
// 234 /* Get back the character we just posted. */
// 235 xQueueReceive( xCharsForTx, &cOutChar, serNO_BLOCK );
PUSH.W #0x0
CFI CFA SP+12
MOV.W SP, R14
ADD.W #0x2, R14
MOV.W &xCharsForTx, R12
CALL #xQueueReceive
// 236 sTHREEmpty = pdFALSE;
MOV.W #0x0, &sTHREEmpty
// 237 U1TXBUF = cOutChar;
MOV.B 0x2(SP), &0x7f
ADD.W #0x2, SP
CFI CFA SP+10
// 238 }
// 239 }
// 240 }
// 241 portEXIT_CRITICAL();
??xSerialPutChar_1:
CMP.W #0x0, &usCriticalNesting
JEQ ??xSerialPutChar_2
ADD.W #0xffff, &usCriticalNesting
CMP.W #0x0, &usCriticalNesting
JNE ??xSerialPutChar_2
EINT
// 242
// 243 return pdPASS;
??xSerialPutChar_2:
MOV.W #0x1, R12
ADD.W #0x2, SP
CFI CFA SP+8
BR #?Epilogue3
CFI EndBlock cfiBlock2
// 244 }
// 245 /*-----------------------------------------------------------*/
// 246
// 247 #ifdef MSP_ROWLEY_RB_PORT
// 248
// 249 /* Serial interrupt service routines for the RB port. */
// 250
// 251 /*
// 252 * UART RX interrupt service routine.
// 253 */
// 254 #pragma vector=UART1RX_VECTOR
RSEG CODE:CODE:REORDER:NOROOT(1)
// 255 __interrupt void vRxISR( void )
vRxISR:
CFI Block cfiBlock3 Using cfiCommon1
CFI Function vRxISR
// 256 {
FUNCALL vRxISR, xQueueSendFromISR
LOCFRAME CSTACK, 16, STACK
FUNCALL vRxISR, vPortYield
LOCFRAME CSTACK, 14, STACK
PUSH.W R13
CFI R13 Frame(CFA, -6)
CFI CFA SP+6
PUSH.W R12
CFI R12 Frame(CFA, -8)
CFI CFA SP+8
PUSH.W R15
CFI R15 Frame(CFA, -10)
CFI CFA SP+10
PUSH.W R14
CFI R14 Frame(CFA, -12)
CFI CFA SP+12
SUB.W #0x2, SP
CFI CFA SP+14
// 257 signed portCHAR cChar;
// 258
// 259 /* Get the character from the UART and post it on the queue of Rxed
// 260 characters. */
// 261 cChar = U1RXBUF;
MOV.B &0x7e, 0x0(SP)
// 262
// 263 if( xQueueSendFromISR( xRxedChars, &cChar, pdFALSE ) )
PUSH.W #0x0
CFI CFA SP+16
MOV.W SP, R14
ADD.W #0x2, R14
MOV.W &xRxedChars, R12
CALL #xQueueSendFromISR
ADD.W #0x2, SP
CFI CFA SP+14
CMP.W #0x0, R12
JEQ ??vRxISR_0
// 264 {
// 265 /*If the post causes a task to wake force a context switch
// 266 as the woken task may have a higher priority than the task we have
// 267 interrupted. */
// 268 taskYIELD();
CALL #vPortYield
// 269 }
// 270 }
??vRxISR_0:
ADD.W #0x2, SP
CFI CFA SP+12
POP.W R14
CFI R14 SameValue
CFI CFA SP+10
POP.W R15
CFI R15 SameValue
CFI CFA SP+8
POP.W R12
CFI R12 SameValue
CFI CFA SP+6
POP.W R13
CFI R13 SameValue
CFI CFA SP+4
RETI
CFI EndBlock cfiBlock3
// 271 /*-----------------------------------------------------------*/
// 272
// 273 /*
// 274 * UART Tx interrupt service routine.
// 275 */
// 276 #pragma vector=UART1TX_VECTOR
RSEG CODE:CODE:REORDER:NOROOT(1)
// 277 __interrupt void vTxISR( void )
vTxISR:
CFI Block cfiBlock4 Using cfiCommon1
CFI Function vTxISR
// 278 {
FUNCALL vTxISR, xQueueReceiveFromISR
LOCFRAME CSTACK, 18, STACK
PUSH.W R13
CFI R13 Frame(CFA, -6)
CFI CFA SP+6
PUSH.W R12
CFI R12 Frame(CFA, -8)
CFI CFA SP+8
PUSH.W R15
CFI R15 Frame(CFA, -10)
CFI CFA SP+10
PUSH.W R14
CFI R14 Frame(CFA, -12)
CFI CFA SP+12
SUB.W #0x4, SP
CFI CFA SP+16
// 279 signed portCHAR cChar;
// 280 portBASE_TYPE xTaskWoken;
// 281
// 282 /* The previous character has been transmitted. See if there are any
// 283 further characters waiting transmission. */
// 284
// 285 if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xTaskWoken ) == pdTRUE )
MOV.W SP, R15
ADD.W #0x2, R15
PUSH.W R15
CFI CFA SP+18
MOV.W SP, R14
ADD.W #0x2, R14
MOV.W &xCharsForTx, R12
CALL #xQueueReceiveFromISR
ADD.W #0x2, SP
CFI CFA SP+16
CMP.W #0x1, R12
JNE ??vTxISR_0
// 286 {
// 287 /* There was another character queued - transmit it now. */
// 288 U1TXBUF = cChar;
MOV.B 0x0(SP), &0x7f
JMP ??vTxISR_1
// 289 }
// 290 else
// 291 {
// 292 /* There were no other characters to transmit. */
// 293 sTHREEmpty = pdTRUE;
??vTxISR_0:
MOV.W #0x1, &sTHREEmpty
// 294 }
// 295 }
??vTxISR_1:
ADD.W #0x4, SP
CFI CFA SP+12
POP.W R14
CFI R14 SameValue
CFI CFA SP+10
POP.W R15
CFI R15 SameValue
CFI CFA SP+8
POP.W R12
CFI R12 SameValue
CFI CFA SP+6
POP.W R13
CFI R13 SameValue
CFI CFA SP+4
RETI
CFI EndBlock cfiBlock4
COMMON INTVEC:CONST:ROOT(1)
ORG 4
`??vTxISR??INTVEC 4`:
DC16 vTxISR
COMMON INTVEC:CONST:ROOT(1)
ORG 6
`??vRxISR??INTVEC 6`:
DC16 vRxISR
RSEG CODE:CODE:REORDER:NOROOT(1)
?setjmp_save_r4:
REQUIRE ?setjmp_r4
REQUIRE ?longjmp_r4
RSEG CODE:CODE:REORDER:NOROOT(1)
?setjmp_save_r5:
REQUIRE ?setjmp_r5
REQUIRE ?longjmp_r5
END
// 296
// 297 #endif
// 298 /*-----------------------------------------------------------*/
// 299
// 300 #ifdef THAT_WHICH_IS_NOT_DEFINED
// 301
// 302 /* Serial port interrupts for the alternative port code. */
// 303
// 304 void ISRCom1Rx( void )
// 305 {
// 306 signed portCHAR cChar;
// 307
// 308 /* Get the character from the UART and post it on the queue of Rxed
// 309 characters. */
// 310 cChar = U1RXBUF;
// 311
// 312 if( xQueueSendFromISR( xRxedChars, &cChar, pdFALSE ) )
// 313 {
// 314 /*If the post causes a task to wake force a context switch
// 315 as the woken task may have a higher priority than the task we have
// 316 interrupted. */
// 317 portEXIT_SWITCHING_ISR( pdTRUE );
// 318 }
// 319 }
// 320 /*-----------------------------------------------------------*/
// 321
// 322 void ISRCom1Tx( void )
// 323 {
// 324 signed portCHAR cChar;
// 325 portBASE_TYPE xTaskWoken;
// 326
// 327 /* The previous character has been transmitted. See if there are any
// 328 further characters waiting transmission. */
// 329
// 330 if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xTaskWoken ) == pdTRUE )
// 331 {
// 332 /* There was another character queued - transmit it now. */
// 333 U1TXBUF = cChar;
// 334 }
// 335 else
// 336 {
// 337 /* There were no other characters to transmit. */
// 338 sTHREEmpty = pdTRUE;
// 339 }
// 340 }
// 341
// 342 #endif
// 343 /*-----------------------------------------------------------*/
//
// 538 bytes in segment CODE
// 12 bytes in segment DATA16_AN
// 6 bytes in segment DATA16_Z
// 4 bytes in segment INTVEC
//
// 538 bytes of CODE memory
// 0 bytes of CONST memory (+ 4 bytes shared)
// 6 bytes of DATA memory (+ 12 bytes shared)
//
//Errors: none
//Warnings: 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -