⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 probe_com.txt

📁 ucos2.86版本结合STM板极支持包
💻 TXT
📖 第 1 页 / 共 4 页
字号:
;;;1227                                                                       /*         .... Store only [rd_ix, rd_ix + tx_buf_sz)   */
;;;1228   
;;;1229                   nbytes  = tx_buf_sz - PROBE_COM_SIZE_TX_HEADER - 1; /*              (A) Store number of bytes read          */
000112  b2b6              UXTH     r6,r6
;;;1230                   rd_ix_n = rd_ix + tx_buf_sz - PROBE_COM_SIZE_TX_HEADER;
000114  19e2              ADDS     r2,r4,r7
000116  1f15              SUBS     r5,r2,#4
;;;1231                                                                       /*              (B) Read from string buffer             */
;;;1232                   Mem_Copy((void *)tx_buf, (void *)&ProbeComStrBuf[rd_ix], nbytes);
000118  4421              ADD      r1,r1,r4
00011a  4632              MOV      r2,r6
00011c  f7fff7ff          BL       Mem_Copy
;;;1233   
;;;1234                   ProbeComStrBufRdIx  = rd_ix_n;                      /*              (C) Update global read index            */
000120  f8c8f8c8          STR      r5,[r8,#0]  ; ProbeComStrBufRdIx
000124  e01a              B        |L1.348|
                  |L1.294|
;;;1235   
;;;1236               } else {                                                /*         (iii) If not too much for packet             */
;;;1237   
;;;1238                                                                       /*               ------- [rd_ix, end_ix) ------         */
;;;1239   
;;;1240                   nbytes  = nbytes_rd;                                /*              (A) Store number of bytes read          */
000126  fa1ffa1f          UXTH     r10,r11
;;;1241                   rd_ix_n = 0;                                        /*              (B) Buffer read ix after read           */
;;;1242   
;;;1243                                                                       /*              (C) Read from the string buffer         */
;;;1244                   Mem_Copy((void *)tx_buf, (void *)&ProbeComStrBuf[rd_ix], nbytes_rd);
00012a  49b3              LDR      r1,|L1.1016|
00012c  465a              MOV      r2,r11
00012e  4421              ADD      r1,r1,r4
000130  f7fff7ff          BL       Mem_Copy
;;;1245                   rd_ix     = rd_ix_n;                                /*              (D) Update local read index             */
;;;1246   
;;;1247                                                                       /*               --------- [0, wr_ix) ---------         */
;;;1248                   tx_buf   += nbytes_rd;
000134  9801              LDR      r0,[sp,#4]
000136  4458              ADD      r0,r0,r11
000138  9001              STR      r0,[sp,#4]
;;;1249                   nbytes_rd = wr_ix;                                  /*              (E) Number of bytes to read             */
00013a  462a              MOV      r2,r5
;;;1250   
;;;1251                                                                       /*              (F) Too much to fit in packet           */
;;;1252                   if (nbytes_rd + nbytes >= tx_buf_sz - PROBE_COM_SIZE_TX_HEADER - 1) {
00013c  eb02eb02          ADD      r1,r2,r10
000140  42b1              CMP      r1,r6
000142  d302              BCC      |L1.330|
;;;1253                                                                       /*              ... Store only [0, tx_buf_sz - 5]       */
;;;1254                       nbytes_rd = tx_buf_sz - nbytes - PROBE_COM_SIZE_TX_HEADER - 1;
000144  eba7eba7          SUB      r1,r7,r10
000148  1f4a              SUBS     r2,r1,#5
                  |L1.330|
;;;1255                   }
;;;1256   
;;;1257                   nbytes  += nbytes_rd;                               /*              (G) Update total num. bytes read        */
00014a  eb0aeb0a          ADD      r1,r10,r2
00014e  b28e              UXTH     r6,r1
;;;1258                   rd_ix_n  = rd_ix + nbytes_rd;                       /*              (H) Buffer read ix after read           */
000150  4614              MOV      r4,r2
;;;1259   
;;;1260                                                                       /*              (I) Read from the string buffer         */
;;;1261                   Mem_Copy((void *)tx_buf, (void *)&ProbeComStrBuf[rd_ix], nbytes_rd);
000152  49a9              LDR      r1,|L1.1016|
000154  f7fff7ff          BL       Mem_Copy
;;;1262   
;;;1263                   ProbeComStrBufRdIx = rd_ix_n;                       /*              (J) Update global read index            */
000158  f8c8f8c8          STR      r4,[r8,#0]  ; ProbeComStrBufRdIx
                  |L1.348|
;;;1264               }
;;;1265           }
;;;1266   
;;;1267         *(tx_buf_p + nbytes) = 0;
00015c  2000              MOVS     r0,#0
00015e  f809f809          STRB     r0,[r9,r6]
;;;1268   
;;;1269   #if (PROBE_COM_STAT_EN == DEF_ENABLED)
;;;1270           ProbeCom_TxStrCtr += nbytes;
000162  48a4              LDR      r0,|L1.1012|
000164  6941              LDR      r1,[r0,#0x14]  ; ProbeCom_TxStrCtr
000166  4431              ADD      r1,r1,r6
000168  6141              STR      r1,[r0,#0x14]  ; ProbeCom_TxStrCtr
;;;1271   #endif
;;;1272   
;;;1273           return (nbytes + PROBE_COM_SIZE_TX_HEADER + 1);             /*  (d) Return TX data segment size                     */
00016a  1d70              ADDS     r0,r6,#5
00016c  b280              UXTH     r0,r0
;;;1274                                                                       /*        =  nbytes (= String    size)                  */
;;;1275                                                                       /*        +  4      (= Tx header size)                  */
;;;1276                                                                       /*        +  1      (= NULL byte     )                  */
;;;1277       }
;;;1278   }
00016e  b004              ADD      sp,sp,#0x10
000170  e8bde8bd          POP      {r4-r12,pc}
;;;1279   #endif
                          ENDP

                  ProbeCom_CmdMultipleRd PROC
;;;1035                                               CPU_INT16U   tx_buf_sz)
;;;1036   {
000174  e92de92d          PUSH     {r0-r11,lr}
000178  b081              SUB      sp,sp,#4
00017a  4604              MOV      r4,r0
00017c  460e              MOV      r6,r1
00017e  4692              MOV      r10,r2
;;;1037       CPU_INT08U  *tx_buf_start;
;;;1038       CPU_INT32U   tx_length;
;;;1039   
;;;1040       CPU_INT32U   addr;
;;;1041       CPU_INT16U   nbytes;
;;;1042       CPU_INT32U   rx_pkt_ix;
;;;1043   
;;;1044   #if (PROBE_COM_STAT_EN == DEF_ENABLED)
;;;1045       CPU_INT32U   sym_ctr;
;;;1046       CPU_INT32U   sym_byte_ctr;
;;;1047   #endif
;;;1048   
;;;1049       tx_buf_start = tx_buf;                                          /* Save beginning of TX buffer in case packet           */
000180  9600              STR      r6,[sp,#0]
;;;1050                                                                       /*  ... ends up being too long.                         */
;;;1051       tx_length    = PROBE_COM_SIZE_TX_HEADER;                        /* Initial TX packet length = 4 = size of header        */
000182  2504              MOVS     r5,#4
;;;1052   
;;;1053       if (rx_pkt_sz  < 7) {                                           /* If the RX data packet is NOT expected size           */
000184  f1baf1ba          CMP      r10,#7
000188  d205              BCS      |L1.406|
;;;1054                                                                       /*        =  2      (= Rx header size   )               */
;;;1055                                                                       /*        +  5      (= 1 item descriptor)               */
;;;1056           return (ProbeCom_CmdError(tx_buf, PROBE_COM_STATUS_RX_PKT_WRONG_SIZE));
00018a  4630              MOV      r0,r6
00018c  b005              ADD      sp,sp,#0x14
00018e  e8bde8bd          POP      {r4-r11,lr}
000192  21fe              MOVS     r1,#0xfe
000194  e7fe              B        ProbeCom_CmdError
                  |L1.406|
;;;1057       }
;;;1058   
;;;1059                                                                       /* No error (yet)                                       */
;;;1060                                                                       /*  (a) Save TX data segment header                     */
;;;1061       tx_buf[0]  = PROBE_COM_FMT_TX_MULTIPLE_RD_LO;                   /*          (i) TX packet format                        */
000196  2007              MOVS     r0,#7
000198  7030              STRB     r0,[r6,#0]
;;;1062       tx_buf[1]  = PROBE_COM_FMT_TX_MULTIPLE_RD_HI;
00019a  2080              MOVS     r0,#0x80
00019c  7070              STRB     r0,[r6,#1]
;;;1063       tx_buf[2]  = PROBE_COM_STATUS_OK;                               /*         (ii) Target status                           */
00019e  2001              MOVS     r0,#1
0001a0  70b0              STRB     r0,[r6,#2]
;;;1064       tx_buf[3]  = ProbeCom_PktModifier();                            /*        (iii) Modifier                                */
0001a2  f7fff7ff          BL       ProbeCom_PktModifier
0001a6  70f0              STRB     r0,[r6,#3]
;;;1065       tx_buf    += PROBE_COM_SIZE_TX_HEADER;
0001a8  f106f106          ADD      r11,r6,#4
;;;1066   
;;;1067       rx_pkt_ix  = 7;                                                 /*  (b) Receive packet index after first item           */
0001ac  2707              MOVS     r7,#7
;;;1068                                                                       /*        =  2      (= Rx header size   )               */
;;;1069                                                                       /*        +  5      (= 1 item descriptor)               */
;;;1070   
;;;1071   #if (PROBE_COM_STAT_EN == DEF_ENABLED)
;;;1072       sym_ctr      = 0;
0001ae  f04ff04f          MOV      r8,#0
;;;1073       sym_byte_ctr = 0;
0001b2  f04ff04f          MOV      r9,#0
                  |L1.438|
;;;1074   #endif
;;;1075                                                                       /*  (c) Store data for each item                        */
;;;1076       while (rx_pkt_ix <= rx_pkt_sz) {
;;;1077           nbytes     =  rx_buf[0];
0001b6  7826              LDRB     r6,[r4,#0]
;;;1078           addr       = (rx_buf[4] << 8) + rx_buf[3];
0001b8  78e0              LDRB     r0,[r4,#3]
0001ba  7921              LDRB     r1,[r4,#4]
0001bc  eb00eb00          ADD      r0,r0,r1,LSL #8
;;;1079           addr       = (addr      << 8) + rx_buf[2];
0001c0  78a1              LDRB     r1,[r4,#2]
0001c2  eb01eb01          ADD      r0,r1,r0,LSL #8
;;;1080           addr       = (addr      << 8) + rx_buf[1];
0001c6  7861              LDRB     r1,[r4,#1]
0001c8  eb01eb01          ADD      r1,r1,r0,LSL #8
;;;1081   
;;;1082           rx_buf    += 5;
0001cc  1d64              ADDS     r4,r4,#5
;;;1083   
;;;1084           tx_length += nbytes;                                        /*        (iii) Add number of bytes to pkt len.         */
0001ce  4435              ADD      r5,r5,r6
;;;1085   
;;;1086           if (tx_length > tx_buf_sz) {                                /*         (iv) Will be too long for TX buffer?         */
0001d0  9804              LDR      r0,[sp,#0x10]
0001d2  4285              CMP      r5,r0
0001d4  d905              BLS      |L1.482|
;;;1087               tx_buf = tx_buf_start;
0001d6  9800              LDR      r0,[sp,#0]
;;;1088               return (ProbeCom_CmdError(tx_buf, PROBE_COM_STATUS_TX_PKT_TOO_LARGE));
0001d8  b005              ADD      sp,sp,#0x14
0001da  e8bde8bd          POP      {r4-r11,lr}
0001de  21fd              MOVS     r1,#0xfd
0001e0  e7fe              B        ProbeCom_CmdError
                  |L1.482|
;;;1089           }
;;;1090   
;;;1091   #if (PROBE_COM_STAT_EN == DEF_ENABLED)
;;;1092           sym_ctr++;                                                  /*          (v) Increment local sym. counter            */
0001e2  f108f108          ADD      r8,r8,#1
;;;1093           sym_byte_ctr += nbytes;
0001e6  44b1              ADD      r9,r9,r6
;;;1094   #endif
;;;1095   
;;;1096           Mem_Copy((void *)tx_buf, (void *)((CPU_ADDR)addr), nbytes); /*         (vi) Otherwise, save TX data                 */
0001e8  4632              MOV      r2,r6
0001ea  4658              MOV      r0,r11
0001ec  f7fff7ff          BL       Mem_Copy
;;;1097   
;;;1098           tx_buf    += nbytes;
0001f0  44b3              ADD      r11,r11,r6
;;;1099           rx_pkt_ix += 5;
0001f2  1d7f              ADDS     r7,r7,#5
0001f4  4557              CMP      r7,r10
0001f6  d9de              BLS      |L1.438|
;;;1100       }
;;;1101   
;;;1102   #if (PROBE_COM_STAT_EN == DEF_ENABLED)
;;;1103           ProbeCom_TxSymCtr     += sym_ctr;                           /* Increment global sym. counter                        */
0001f8  487e              LDR      r0,|L1.1012|
0001fa  6881              LDR      r1,[r0,#8]  ; ProbeCom_TxSymCtr
0001fc  4441              ADD      r1,r1,r8
0001fe  6081              STR      r1,[r0,#8]  ; ProbeCom_TxSymCtr
;;;1104           ProbeCom_TxSymByteCtr += sym_byte_ctr;
000200  68c1              LDR      r1,[r0,#0xc]  ; ProbeCom_TxSymByteCtr
000202  4449              ADD      r1,r1,r9
000204  60c1              STR      r1,[r0,#0xc]  ; ProbeCom_TxSymByteCtr
;;;1105   #endif
;;;1106   
;;;1107       return (tx_length);
000206  b2a8              UXTH     r0,r5
;;;1108   }
000208  b005              ADD      sp,sp,#0x14
00020a  e8bde8bd          POP      {r4-r11,pc}
;;;1109   
                          ENDP

                  ProbeCom_GetINT8U PROC
;;;1303   {
;;;1304       return (*((*buf)++));
00020e  6801              LDR      r1,[r0,#0]
000210  1c4a              ADDS     r2,r1,#1
000212  6002              STR      r2,[r0,#0]
000214  7808              LDRB     r0,[r1,#0]
;;;1305   }
000216  4770              BX       lr
;;;1306   
                          ENDP

                  ProbeCom_GetINT16U PROC
;;;1308   static  CPU_INT16U  ProbeCom_GetINT16U (CPU_INT08U **buf)
;;;1309   {
000218  b510              PUSH     {r4,lr}
00021a  4604              MOV      r4,r0
;;;1310       CPU_INT16U  lowbyte;
;;;1311       CPU_INT16U  highbyte;
;;;1312   
;;;1313   
;;;1314       lowbyte  = ProbeCom_GetINT8U(buf);
00021c  4620              MOV      r0,r4
00021e  f7fff7ff          BL       ProbeCom_GetINT8U
000222  4603              MOV      r3,r0
;;;1315       highbyte = ProbeCom_GetINT8U(buf);
000224  4620              MOV      r0,r4
000226  f7fff7ff          BL       ProbeCom_GetINT8U
;;;1316       return ((highbyte << 8) | lowbyte);
00022a  ea43ea43          ORR      r0,r3,r0,LSL #8
;;;1317   }
00022e  bd10              POP      {r4,pc}
;;;1318   
                          ENDP

                  ProbeCom_GetINT32U PROC
;;;1320   static  CPU_INT32U  ProbeCom_GetINT32U (CPU_INT08U **buf)
;;;1321   {
000230  b530              PUSH     {r4,r5,lr}
000232  4605              MOV      r5,r0
;;;1322       CPU_INT32U  highword;
;;;1323       CPU_INT32U  lowword;
;;;1324   
;;;1325   
;;;1326       lowword  = ProbeCom_GetINT16U(buf);
000234  4628              MOV      r0,r5
000236  f7fff7ff          BL       ProbeCom_GetINT16U
00023a  4604              MOV      r4,r0
;;;1327       highword = ProbeCom_GetINT16U(buf);
00023c  4628              MOV      r0,r5
00023e  f7fff7ff          BL       ProbeCom_GetINT16U
;;;1328       return ((highword << 16) | lowword);
000242  ea44ea44          ORR      r0,r4,r0,LSL #16

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -