?? probe_com.txt
字號:
; generated by ARM/Thumb C/C++ Compiler with , RVCT3.1 [Build 914] for uVision
; commandline ArmCC [--debug -c --asm --interleave -o.\rvmdk\probe_com.o --depend=.\rvmdk\probe_com.d --device=DARMSTM -O1 -Otime -I. -I..\BSP -I..\..\..\..\..\uCOS-II\Ports\arm-cortex-m3\Generic\RealView -I..\..\..\..\..\uCOS-II\Source -I..\..\..\..\..\CPU\ST\STM32\inc -I..\..\..\..\..\uC-CPU -I..\..\..\..\..\uC-CPU\Arm-Cortex-M3\RealView -I..\..\..\..\..\uC-LIB -I..\..\..\..\..\uC-Probe\Target\Plugins\uCOS-II -I..\..\..\..\..\uC-Probe\Target\Communication\Generic\Source -I..\..\..\..\..\uC-Probe\Target\Communication\Generic\RS-232\Ports\ST\STM32 -I..\..\..\..\..\uC-Probe\Target\Communication\Generic\RS-232\Source -ID:\Keil\ARM\INC\ST\STM32F10x ..\..\..\..\..\uC-Probe\Target\Communication\Generic\Source\probe_com.c]
THUMB
AREA ||.text||, CODE, READONLY, ALIGN=2
ProbeCom_Init PROC
;;;312 void ProbeCom_Init (void)
;;;313 {
000000 b510 PUSH {r4,lr}
;;;314 #if (PROBE_COM_SUPPORT_STR == DEF_TRUE)
;;;315 ProbeComStrBufWrIx = 0;
000002 48fa LDR r0,|L1.1004|
000004 2400 MOVS r4,#0
000006 6004 STR r4,[r0,#0] ; ProbeComStrBufWrIx
;;;316 ProbeComStrBufRdIx = 0;
000008 48f9 LDR r0,|L1.1008|
00000a 6004 STR r4,[r0,#0] ; ProbeComStrBufRdIx
;;;317
;;;318 ProbeCom_OS_Init();
00000c f7fff7ff BL ProbeCom_OS_Init
;;;319 #endif
;;;320
;;;321 #if (PROBE_COM_STAT_EN == DEF_ENABLED)
;;;322 ProbeCom_RxPktCtr = 0;
000010 48f8 LDR r0,|L1.1012|
000012 6004 STR r4,[r0,#0] ; ProbeCom_RxPktCtr
;;;323 ProbeCom_TxPktCtr = 0;
000014 6044 STR r4,[r0,#4] ; ProbeCom_TxPktCtr
;;;324 ProbeCom_TxSymByteCtr = 0;
000016 60c4 STR r4,[r0,#0xc] ; ProbeCom_TxSymByteCtr
;;;325 ProbeCom_TxSymCtr = 0;
000018 6084 STR r4,[r0,#8] ; ProbeCom_TxSymCtr
;;;326 ProbeCom_ErrPktCtr = 0;
00001a 6104 STR r4,[r0,#0x10] ; ProbeCom_ErrPktCtr
;;;327
;;;328 #if (PROBE_COM_SUPPORT_STR == DEF_TRUE)
;;;329 ProbeCom_TxStrCtr = 0;
00001c 6144 STR r4,[r0,#0x14] ; ProbeCom_TxStrCtr
;;;330 #endif
;;;331 #endif
;;;332 }
00001e bd10 POP {r4,pc}
;;;333
ENDP
ProbeCom_StrRdy PROC
;;;556
;;;557 wr_ix = ProbeComStrBufWrIx;
000020 48f2 LDR r0,|L1.1004|
000022 6801 LDR r1,[r0,#0] ; ProbeComStrBufWrIx
;;;558 rd_ix = ProbeComStrBufRdIx;
000024 48f2 LDR r0,|L1.1008|
000026 6800 LDR r0,[r0,#0] ; ProbeComStrBufRdIx
;;;559
;;;560 if (wr_ix == rd_ix) {
000028 4281 CMP r1,r0
00002a d101 BNE |L1.48|
;;;561 rdy = DEF_FALSE;
00002c 2000 MOVS r0,#0
;;;562 } else {
;;;563 rdy = DEF_TRUE;
;;;564 }
;;;565
;;;566 return (rdy);
;;;567 }
00002e 4770 BX lr
|L1.48|
000030 2001 MOVS r0,#1
000032 4770 BX lr
;;;568 #endif
ENDP
ProbeCom_PktModifier PROC
;;;579 static CPU_INT08U ProbeCom_PktModifier (void)
;;;580 {
000034 b500 PUSH {lr}
;;;581 #if (PROBE_COM_SUPPORT_STR == DEF_TRUE)
;;;582
;;;583 if (ProbeCom_StrRdy() == DEF_TRUE) {
000036 f7fff7ff BL ProbeCom_StrRdy
00003a 2801 CMP r0,#1
00003c d101 BNE |L1.66|
;;;584 return (PROBE_COM_MODIFIER_STR_HAVE);
00003e 2001 MOVS r0,#1
;;;585 } else {
;;;586 return (PROBE_COM_MODIFIER_NONE);
;;;587 }
;;;588
;;;589 #else
;;;590
;;;591 return (PROBE_COM_MODIFIER_NONE);
;;;592
;;;593 #endif
;;;594 }
000040 bd00 POP {pc}
|L1.66|
000042 2000 MOVS r0,#0
000044 bd00 POP {pc}
;;;595
ENDP
ProbeCom_StoINT8U PROC
;;;1346 {
;;;1347 *((*buf)++) = data;
000046 6802 LDR r2,[r0,#0]
000048 1c53 ADDS r3,r2,#1
00004a 6003 STR r3,[r0,#0]
00004c 7011 STRB r1,[r2,#0]
;;;1348 }
00004e 4770 BX lr
;;;1349
ENDP
ProbeCom_StoINT16U PROC
;;;1351 static void ProbeCom_StoINT16U (CPU_INT08U **buf, CPU_INT16U data)
;;;1352 {
000050 b530 PUSH {r4,r5,lr}
000052 4605 MOV r5,r0
000054 460c MOV r4,r1
;;;1353 ProbeCom_StoINT8U(buf, data & 0x00FF);
000056 b2e1 UXTB r1,r4
000058 4628 MOV r0,r5
00005a f7fff7ff BL ProbeCom_StoINT8U
;;;1354 ProbeCom_StoINT8U(buf, data >> 8);
00005e 0a21 LSRS r1,r4,#8
000060 4628 MOV r0,r5
000062 e8bde8bd POP {r4,r5,lr}
000066 e7fe B ProbeCom_StoINT8U
;;;1355 }
;;;1356
ENDP
ProbeCom_CmdError PROC
;;;625 CPU_INT16U com_error)
;;;626 {
000068 b513 PUSH {r0,r1,r4,lr}
00006a 460c MOV r4,r1
;;;627 #if (PROBE_COM_STAT_EN == DEF_ENABLED)
;;;628 ProbeCom_ErrPktCtr++;
00006c 48e1 LDR r0,|L1.1012|
00006e 6901 LDR r1,[r0,#0x10] ; ProbeCom_ErrPktCtr
000070 1c49 ADDS r1,r1,#1
000072 6101 STR r1,[r0,#0x10] ; ProbeCom_ErrPktCtr
;;;629 #endif
;;;630
;;;631 ProbeCom_StoINT16U(&tx_buf, PROBE_COM_FMT_TX_ERROR); /* (a) TX packet format */
000074 f44ff44f MOV r1,#0x8000
000078 4668 MOV r0,sp
00007a f7fff7ff BL ProbeCom_StoINT16U
;;;632 ProbeCom_StoINT8U( &tx_buf, com_error); /* (b) Target status */
00007e b2e1 UXTB r1,r4
000080 4668 MOV r0,sp
000082 f7fff7ff BL ProbeCom_StoINT8U
;;;633 ProbeCom_StoINT8U( &tx_buf, ProbeCom_PktModifier()); /* (c) Modifier */
000086 f7fff7ff BL ProbeCom_PktModifier
00008a 4601 MOV r1,r0
00008c 4668 MOV r0,sp
00008e f7fff7ff BL ProbeCom_StoINT8U
;;;634 return (PROBE_COM_SIZE_TX_HEADER); /* (d) Return TX data segment size */
000092 2004 MOVS r0,#4
;;;635 /* = 4 (= Tx header size) */
;;;636 }
000094 b002 ADD sp,sp,#8
000096 bd10 POP {r4,pc}
;;;637
ENDP
ProbeCom_CmdStrGet PROC
;;;1157 CPU_INT16U tx_buf_sz)
;;;1158 {
000098 e92de92d PUSH {r0-r12,lr}
00009c 461f MOV r7,r3
;;;1159 CPU_INT08U error;
;;;1160 CPU_INT32U wr_ix;
;;;1161 CPU_INT32U rd_ix;
;;;1162 CPU_INT16U nbytes;
;;;1163
;;;1164 CPU_INT32U nbytes_rd;
;;;1165 CPU_INT32U rd_ix_n;
;;;1166 CPU_INT08U *tx_buf_p;
;;;1167
;;;1168
;;;1169 error = PROBE_COM_STATUS_OK;
00009e 2101 MOVS r1,#1
;;;1170 wr_ix = ProbeComStrBufWrIx;
0000a0 48d2 LDR r0,|L1.1004|
0000a2 6805 LDR r5,[r0,#0] ; ProbeComStrBufWrIx
;;;1171 rd_ix = ProbeComStrBufRdIx;
0000a4 f8dff8df LDR r8,|L1.1008|
0000a8 f8d8f8d8 LDR r4,[r8,#0] ; ProbeComStrBufRdIx
;;;1172 nbytes = 0;
;;;1173
;;;1174 if (rx_pkt_sz == 4) { /* If RX data segment is the expected size */
0000ac 2a04 CMP r2,#4
0000ae d103 BNE |L1.184|
;;;1175 /* = 2 (= Rx header size) */
;;;1176 /* + 2 (= Padding ) */
;;;1177
;;;1178 if (wr_ix == rd_ix) { /* (a) If there is NO string, then error */
0000b0 42a5 CMP r5,r4
0000b2 d102 BNE |L1.186|
;;;1179 error = PROBE_COM_STATUS_STR_NONE;
0000b4 21f8 MOVS r1,#0xf8
0000b6 e000 B |L1.186|
|L1.184|
;;;1180 }
;;;1181
;;;1182 } else { /* If RX data segment is NOT the expected size */
;;;1183
;;;1184 error = PROBE_COM_STATUS_RX_PKT_WRONG_SIZE;
0000b8 21fe MOVS r1,#0xfe
|L1.186|
;;;1185 }
;;;1186
;;;1187 if (error != PROBE_COM_STATUS_OK) { /* Error */
0000ba 2901 CMP r1,#1
0000bc d005 BEQ |L1.202|
;;;1188 return (ProbeCom_CmdError(tx_buf, error));
0000be 9801 LDR r0,[sp,#4]
0000c0 f7fff7ff BL ProbeCom_CmdError
0000c4 b004 ADD sp,sp,#0x10
0000c6 e8bde8bd POP {r4-r12,pc}
|L1.202|
;;;1189
;;;1190 } else { /* No error */
;;;1191 /* (a) Save TX data segment header */
;;;1192 ProbeCom_StoINT16U(&tx_buf, PROBE_COM_FMT_TX_STR_GET); /* (i) TX packet format */
0000ca f248f248 MOV r1,#0x8009
0000ce a801 ADD r0,sp,#4
0000d0 f7fff7ff BL ProbeCom_StoINT16U
;;;1193 ProbeCom_StoINT8U( &tx_buf, PROBE_COM_STATUS_OK); /* (ii) Target status */
0000d4 2101 MOVS r1,#1
0000d6 a801 ADD r0,sp,#4
0000d8 f7fff7ff BL ProbeCom_StoINT8U
;;;1194 ProbeCom_StoINT8U( &tx_buf, 0); /* (iii) Modifier */
0000dc 2100 MOVS r1,#0
0000de a801 ADD r0,sp,#4
0000e0 f7fff7ff BL ProbeCom_StoINT8U
;;;1195
;;;1196 tx_buf_p = tx_buf;
0000e4 9801 LDR r0,[sp,#4]
0000e6 4681 MOV r9,r0
;;;1197
;;;1198 if (wr_ix > rd_ix) { /* (b) If wr_ix > rd_ix */
0000e8 1f7e SUBS r6,r7,#5
0000ea 49c3 LDR r1,|L1.1016|
0000ec 42a5 CMP r5,r4
0000ee d90c BLS |L1.266|
;;;1199 /* ... Store in pkt the bytes [rd_ix, wr_ix) */
;;;1200
;;;1201 nbytes_rd = wr_ix - rd_ix; /* (i) Calculate num. bytes to read */
0000f0 1b2a SUBS r2,r5,r4
;;;1202
;;;1203 if (nbytes_rd >= tx_buf_sz - PROBE_COM_SIZE_TX_HEADER - 1) { /* (ii) If too much to fit in packet */
0000f2 42b2 CMP r2,r6
0000f4 d302 BCC |L1.252|
;;;1204 /* .... Store only [rd_ix,rd_ix + tx_buf_sz - 5)*/
;;;1205 /* .... Where 5 = 1 (NULL byte) */
;;;1206 /* + 4 (TX header) */
;;;1207 nbytes_rd = tx_buf_sz - PROBE_COM_SIZE_TX_HEADER - 1;
0000f6 1f7a SUBS r2,r7,#5
;;;1208 rd_ix_n = rd_ix + tx_buf_sz - PROBE_COM_SIZE_TX_HEADER;
0000f8 19e3 ADDS r3,r4,r7
0000fa 1f1d SUBS r5,r3,#4
|L1.252|
;;;1209
;;;1210 } else {
;;;1211 rd_ix_n = wr_ix;
;;;1212 }
;;;1213
;;;1214 nbytes = nbytes_rd; /* (iii) Store number of bytes read */
0000fc b296 UXTH r6,r2
;;;1215 /* (iv) Read from the string buffer */
;;;1216 Mem_Copy((void *)tx_buf, (void *)&ProbeComStrBuf[rd_ix], nbytes_rd);
0000fe 4421 ADD r1,r1,r4
000100 f7fff7ff BL Mem_Copy
;;;1217
;;;1218 ProbeComStrBufRdIx = rd_ix_n; /* (v) Update global read index */
000104 f8c8f8c8 STR r5,[r8,#0] ; ProbeComStrBufRdIx
000108 e028 B |L1.348|
|L1.266|
;;;1219
;;;1220 } else { /* (c) If wr_ix < rd_ix */
;;;1221 /* ... Store in pkt the bytes [rd_ix, end_ix) */
;;;1222 /* ... Then store in pkt the bytes [0, wr_ix) */
;;;1223
;;;1224 nbytes_rd = PROBE_COM_STR_BUF_SIZE - rd_ix; /* (i) Calculate num. bytes to read */
00010a f1c4f1c4 RSB r11,r4,#0x80
;;;1225
;;;1226 if (nbytes_rd >= tx_buf_sz - PROBE_COM_SIZE_TX_HEADER - 1) { /* (ii) If to much to fit in packet */
00010e 45b3 CMP r11,r6
000110 d309 BCC |L1.294|
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -