ch_serial.txt 48.2 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988
; generated by Component: ARM Compiler 5.06 update 6 (build 750) Tool: ArmCC [4d3637]
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave -o.\flash\obj\ch_serial.o --asm_dir=.\Flash\List\ --list_dir=.\Flash\List\ --depend=.\flash\obj\ch_serial.d --cpu=Cortex-M4.fp --apcs=interwork -O1 --diag_suppress=9931,870 -I..\..\Libraries\CMSIS\Include -I..\..\Libraries\CMSIS\Device\ST\STM32F4xx\Include -I..\..\Libraries\STM32F4xx_StdPeriph_Driver\inc -I..\..\uCOS-III\uC-CPU -I..\..\uCOS-III\uC-LIB -I..\..\uCOS-III\uCOS-III\Ports -I..\..\uCOS-III\uCOS-III\Source -I..\..\uCOS-III\uC-CPU\ARM-Cortex-M4\RealView -I..\..\uCOS-III\uC-LIB\Ports\ARM-Cortex-M4\RealView -I..\..\uCOS-III\uCOS-III\Ports\ARM-Cortex-M4\Generic\RealView -I..\..\User -I..\..\User\bsp -I..\..\User\bsp\inc -I..\..\User\libapp -I..\..\RL-ARM\Config -I..\..\RL-ARM\Driver -I..\..\RL-ARM\RL-RTX\inc -I..\..\User\bsp\BSP -I..\..\RL-ARM\RL-CAN -I..\..\Libraries\DSP_LIB\Include -I..\..\MODBUS\modbus\rtu -I..\..\MODBUS\BARE\port -I..\..\MODBUS\modbus\include -I..\..\User\bsp\BSP -I..\..\PLC -I..\..\Avoid -I..\..\User\parameter -I..\..\User\LaserMotionCtr -I..\..\User\W5100S -I..\..\User\bsp -I..\..\User\CHASSIS -I..\..\User\CONTROLFUNCTION -I..\..\User\DATAUPDATE -I..\..\User\HARAWARE -I..\..\User\MOTORDRIVER -I..\..\User\NAVAGATION -I..\..\User\PLATFORM -I..\..\User\SENSOR -I.\RTE\_Flash -IC:\Users\YDJ\AppData\Local\Arm\Packs\ARM\CMSIS\5.5.1\CMSIS\Core\Include -IC:\Users\YDJ\AppData\Local\Arm\Packs\Keil\STM32F4xx_DFP\2.13.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include -D__UVISION_VERSION=527 -D_RTE_ -DSTM32F407xx -DUSE_STDPERIPH_DRIVER -DSTM32F40_41xxx -D__RTX -D__FPU_USED=1 --omf_browse=.\flash\obj\ch_serial.crf ..\..\User\HARAWARE\ch_serial.c]
                          THUMB

                          AREA ||i.DecodeIMUdata||, CODE, READONLY, ALIGN=2

                  DecodeIMUdata PROC
;;;360    
;;;361    void DecodeIMUdata()
000000  b570              PUSH     {r4-r6,lr}
;;;362    {
;;;363    	if(decode_succ)
000002  4813              LDR      r0,|L1.80|
000004  7801              LDRB     r1,[r0,#0]  ; decode_succ
000006  2900              CMP      r1,#0
000008  d004              BEQ      |L1.20|
;;;364    	{
;;;365    			decode_succ = 0;
00000a  2100              MOVS     r1,#0
00000c  7001              STRB     r1,[r0,#0]
;;;366    			dump_imu_data(&raw);
00000e  4811              LDR      r0,|L1.84|
000010  f7fffffe          BL       dump_imu_data
                  |L1.20|
;;;367    	}
;;;368    	IMU.palstance = raw.imu[0].gyr[2]*0.017453;
000014  4c0f              LDR      r4,|L1.84|
000016  f8d40224          LDR      r0,[r4,#0x224]  ; raw
00001a  f7fffffe          BL       __aeabi_f2d
00001e  ed9f1b0e          VLDR     d1,|L1.88|
000022  ec532b11          VMOV     r2,r3,d1
000026  f7fffffe          BL       __aeabi_dmul
00002a  f7fffffe          BL       __aeabi_d2f
00002e  4d0c              LDR      r5,|L1.96|
000030  6028              STR      r0,[r5,#0]  ; IMU
;;;369    	IMU.angle = raw.imu[0].eul[2]/57.3;
000032  f8d4023c          LDR      r0,[r4,#0x23c]  ; raw
000036  f7fffffe          BL       __aeabi_f2d
00003a  ed9f1b0a          VLDR     d1,|L1.100|
00003e  ec532b11          VMOV     r2,r3,d1
000042  f7fffffe          BL       __aeabi_ddiv
000046  f7fffffe          BL       __aeabi_d2f
00004a  6068              STR      r0,[r5,#4]  ; IMU
;;;370    }
00004c  bd70              POP      {r4-r6,pc}
                          ENDP

00004e  0000              DCW      0x0000
                  |L1.80|
                          DCD      ||.data||
                  |L1.84|
                          DCD      ||.bss||
                  |L1.88|
000058  00de4c51          DCFD     0x3f91df3300de4c51 ; 0.017453
00005c  3f91df33
                  |L1.96|
                          DCD      IMU
                  |L1.100|
000064  66666666          DCFD     0x404ca66666666666 ; 57.299999999999997
000068  404ca666

                          AREA ||i.R4||, CODE, READONLY, ALIGN=1

                  ||R4|| PROC
;;;20     static uint32_t U4(uint8_t *p) {uint32_t u; memcpy(&u,p,4); return u;}
;;;21     static float    R4(uint8_t *p) {float    r; memcpy(&r,p,4); return r;}
000000  b508              PUSH     {r3,lr}
000002  6800              LDR      r0,[r0,#0]
000004  9000              STR      r0,[sp,#0]
000006  ed9d0a00          VLDR     s0,[sp,#0]
00000a  bd08              POP      {r3,pc}
;;;22     
                          ENDP


                          AREA ||i.U2||, CODE, READONLY, ALIGN=1

                  ||U2|| PROC
;;;18     #define I2(p) (*((int16_t  *)(p)))
;;;19     static uint16_t U2(uint8_t *p) {uint16_t u; memcpy(&u,p,2); return u;}
000000  b508              PUSH     {r3,lr}
000002  8800              LDRH     r0,[r0,#0]
000004  9000              STR      r0,[sp,#0]
000006  f8bd0000          LDRH     r0,[sp,#0]
00000a  bd08              POP      {r3,pc}
;;;20     static uint32_t U4(uint8_t *p) {uint32_t u; memcpy(&u,p,4); return u;}
                          ENDP


                          AREA ||i.U4||, CODE, READONLY, ALIGN=1

                  ||U4|| PROC
;;;19     static uint16_t U2(uint8_t *p) {uint16_t u; memcpy(&u,p,2); return u;}
;;;20     static uint32_t U4(uint8_t *p) {uint32_t u; memcpy(&u,p,4); return u;}
000000  6800              LDR      r0,[r0,#0]
000002  4770              BX       lr
;;;21     static float    R4(uint8_t *p) {float    r; memcpy(&r,p,4); return r;}
                          ENDP


                          AREA ||i.ch_dump_imu_data||, CODE, READONLY, ALIGN=1

                  ch_dump_imu_data PROC
;;;123    /* dump hi229 or hi226 data packet*/
;;;124    void ch_dump_imu_data(raw_t *raw)
000000  4770              BX       lr
;;;125    {
;;;126        int i;
;;;127        if(raw->item_code[0] != KItemGWSOL)
;;;128        {
;;;129    //        CH_TRACE("%-16s%d\r\n",       "id:",  raw->imu[0].id);
;;;130    //        CH_TRACE("%-16s%.3f %.3f %.3f\r\n",       "acc(G):",        raw->imu[0].acc[0], raw->imu[0].acc[1],  raw->imu[0].acc[2]);
;;;131    //        CH_TRACE("%-16s%.3f %.3f %.3f\r\n",       "gyr(deg/s):",    raw->imu[0].gyr[0], raw->imu[0].gyr[1],  raw->imu[0].gyr[2]);
;;;132    //        CH_TRACE("%-16s%.3f %.3f %.3f\r\n",       "mag(uT):",       raw->imu[0].mag[0], raw->imu[0].mag[1],  raw->imu[0].mag[2]);
;;;133    //        CH_TRACE("%-16s%.3f %.3f %.3f\r\n",       "eul(deg):",      raw->imu[0].eul[0], raw->imu[0].eul[1],  raw->imu[0].eul[2]);
;;;134    //        CH_TRACE("%-16s%.3f %.3f %.3f %.3f\r\n",  "quat:",          raw->imu[0].quat[0], raw->imu[0].quat[1],  raw->imu[0].quat[2], raw->imu[0].quat[3]);
;;;135    //        CH_TRACE("%-16s%.3f\r\n",       "presure(pa):",  raw->imu[0].pressure);
;;;136    //        CH_TRACE("%-16s%d\r\n",       "timestamp(ms):",  raw->imu[0].timestamp);
;;;137    //        
;;;138    //        CH_TRACE("item: ");
;;;139    //        for(i=0; i<raw->nitem_code; i++)
;;;140    //        {
;;;141    //            CH_TRACE("0x%02X ", raw->item_code[i]);
;;;142    //        }
;;;143    //        CH_TRACE("\r\n");
;;;144        }
;;;145        else
;;;146        {
;;;147    //        CH_TRACE("gateway: %s%d, %s%d\r\n",       "gwid:",      raw->gwid, "node cnt:", raw->nimu);
;;;148    //        for(i=0; i<raw->nimu; i++)
;;;149    //        {
;;;150    //            CH_TRACE("%-16s%d\r\n",       "id:",  raw->imu[i].id);
;;;151    //            CH_TRACE("%-16s%.3f %.3f %.3f\r\n",       "acc(G):",        raw->imu[i].acc[0], raw->imu[i].acc[1],  raw->imu[i].acc[2]);
;;;152    //            CH_TRACE("%-16s%.3f %.3f %.3f\r\n",       "gyr(deg/s):",    raw->imu[i].gyr[0], raw->imu[i].gyr[1],  raw->imu[i].gyr[2]);
;;;153    //            CH_TRACE("%-16s%.3f %.3f %.3f\r\n",       "mag(uT):",       raw->imu[i].mag[0], raw->imu[i].mag[1],  raw->imu[i].mag[2]);
;;;154    //            CH_TRACE("%-16s%.3f %.3f %.3f\r\n",       "eul(deg):",      raw->imu[i].eul[0], raw->imu[i].eul[1],  raw->imu[i].eul[2]);
;;;155    //            CH_TRACE("%-16s%.3f %.3f %.3f %.3f\r\n",  "quat:",          raw->imu[i].quat[0], raw->imu[i].quat[1],  raw->imu[i].quat[2], raw->imu[i].quat[3]);
;;;156    //            CH_TRACE("%-16s%.3f\r\n",       "presure(pa):",  raw->imu[i].pressure);
;;;157    //            CH_TRACE("%-16s%d\r\n",       "timestamp(ms):",  raw->imu[i].timestamp);
;;;158    //        }
;;;159        }
;;;160    }
;;;161    
                          ENDP


                          AREA ||i.ch_serial_input||, CODE, READONLY, ALIGN=1

                  ch_serial_input PROC
;;;315    
;;;316    int ch_serial_input(raw_t *raw, uint8_t data)
000000  b570              PUSH     {r4-r6,lr}
;;;317    {
000002  4604              MOV      r4,r0
;;;318        /* synchronize frame */
;;;319        if (raw->nbyte == 0)
000004  6820              LDR      r0,[r4,#0]
000006  2800              CMP      r0,#0
000008  d008              BEQ      |L6.28|
;;;320        {
;;;321            if (!sync_ch(raw->buf, data)) return 0;
;;;322            raw->nbyte = 2;
;;;323            return 0;
;;;324        }
;;;325    
;;;326        raw->buf[raw->nbyte++] = data;
00000a  1c42              ADDS     r2,r0,#1
00000c  4420              ADD      r0,r0,r4
00000e  6022              STR      r2,[r4,#0]
000010  7201              STRB     r1,[r0,#8]
;;;327        
;;;328        if (raw->nbyte == CH_HDR_SIZE)
000012  6820              LDR      r0,[r4,#0]
000014  2500              MOVS     r5,#0
000016  2806              CMP      r0,#6
000018  d00b              BEQ      |L6.50|
00001a  e016              B        |L6.74|
                  |L6.28|
00001c  f1040008          ADD      r0,r4,#8              ;321
000020  f7fffffe          BL       sync_ch
000024  b118              CBZ      r0,|L6.46|
000026  2002              MOVS     r0,#2                 ;322
000028  6020              STR      r0,[r4,#0]            ;322
00002a  2000              MOVS     r0,#0                 ;323
;;;329        {
;;;330            if ((raw->len = U2(raw->buf+2)) > (MAXRAWLEN - CH_HDR_SIZE))
;;;331            {
;;;332    //            CH_TRACE("ch length error: len=%d\n",raw->len);
;;;333                raw->nbyte = 0;
;;;334                return -1;
;;;335            }
;;;336        }
;;;337        
;;;338        if (raw->nbyte < (raw->len + CH_HDR_SIZE)) 
;;;339        {
;;;340            return 0;
;;;341        }
;;;342        
;;;343        raw->nbyte = 0;
;;;344        
;;;345        return decode_ch(raw);
;;;346    }
00002c  bd70              POP      {r4-r6,pc}
                  |L6.46|
00002e  2000              MOVS     r0,#0                 ;321
000030  bd70              POP      {r4-r6,pc}
                  |L6.50|
000032  f104000a          ADD      r0,r4,#0xa            ;330
000036  f7fffffe          BL       ||U2||
00003a  6060              STR      r0,[r4,#4]            ;330
00003c  f5b07ffd          CMP      r0,#0x1fa             ;330
000040  d903              BLS      |L6.74|
000042  6025              STR      r5,[r4,#0]            ;333
000044  f04f30ff          MOV      r0,#0xffffffff        ;334
000048  bd70              POP      {r4-r6,pc}
                  |L6.74|
00004a  e9d41000          LDRD     r1,r0,[r4,#0]         ;338
00004e  1d80              ADDS     r0,r0,#6              ;338
000050  4281              CMP      r1,r0                 ;338
000052  da01              BGE      |L6.88|
000054  2000              MOVS     r0,#0                 ;340
000056  bd70              POP      {r4-r6,pc}
                  |L6.88|
000058  6025              STR      r5,[r4,#0]            ;343
00005a  4620              MOV      r0,r4                 ;345
00005c  e8bd4070          POP      {r4-r6,lr}            ;345
000060  f7ffbffe          B.W      decode_ch
;;;347    //void USART2_IRQHandler(void)
                          ENDP


                          AREA ||i.crc16_update||, CODE, READONLY, ALIGN=1

                  crc16_update PROC
;;;100    
;;;101    static void crc16_update(uint16_t *currect_crc, const uint8_t *src, uint32_t len)
000000  b5f0              PUSH     {r4-r7,lr}
;;;102    {
;;;103        uint32_t crc = *currect_crc;
000002  8803              LDRH     r3,[r0,#0]
;;;104        uint32_t j;
;;;105        for (j=0; j < len; ++j)
000004  2600              MOVS     r6,#0
000006  e00e              B        |L7.38|
                  |L7.8|
;;;106        {
;;;107            uint32_t i;
;;;108            uint32_t byte = src[j];
000008  5d8c              LDRB     r4,[r1,r6]
;;;109            crc ^= byte << 8;
00000a  ea832304          EOR      r3,r3,r4,LSL #8
;;;110            for (i = 0; i < 8; ++i)
00000e  2500              MOVS     r5,#0
;;;111            {
;;;112                uint32_t temp = crc << 1;
;;;113                if (crc & 0x8000)
;;;114                {
;;;115                    temp ^= 0x1021;
000010  f2410721          MOV      r7,#0x1021
                  |L7.20|
000014  005c              LSLS     r4,r3,#1              ;112
000016  041b              LSLS     r3,r3,#16             ;113
000018  d500              BPL      |L7.28|
00001a  407c              EORS     r4,r4,r7
                  |L7.28|
;;;116                }
;;;117                crc = temp;
00001c  4623              MOV      r3,r4
00001e  1c6d              ADDS     r5,r5,#1              ;110
000020  2d08              CMP      r5,#8                 ;110
000022  d3f7              BCC      |L7.20|
000024  1c76              ADDS     r6,r6,#1              ;105
                  |L7.38|
000026  4296              CMP      r6,r2                 ;105
000028  d3ee              BCC      |L7.8|
;;;118            }
;;;119        } 
;;;120        *currect_crc = crc;
00002a  8003              STRH     r3,[r0,#0]
;;;121    }
00002c  bdf0              POP      {r4-r7,pc}
;;;122    
                          ENDP


                          AREA ||i.decode_ch||, CODE, READONLY, ALIGN=1

                  decode_ch PROC
;;;291    
;;;292    static int decode_ch(raw_t *raw)
000000  b538              PUSH     {r3-r5,lr}
;;;293    {
000002  4604              MOV      r4,r0
;;;294        uint16_t crc = 0;   
000004  2000              MOVS     r0,#0
000006  9000              STR      r0,[sp,#0]
;;;295    
;;;296        /* checksum */
;;;297        crc16_update(&crc, raw->buf, 4);
000008  2204              MOVS     r2,#4
00000a  f1040108          ADD      r1,r4,#8
00000e  4668              MOV      r0,sp
000010  f7fffffe          BL       crc16_update
;;;298        crc16_update(&crc, raw->buf+6, raw->len);
000014  f104010e          ADD      r1,r4,#0xe
000018  4668              MOV      r0,sp
00001a  6862              LDR      r2,[r4,#4]
00001c  f7fffffe          BL       crc16_update
;;;299        if (crc != U2(raw->buf+4))
000020  f104000c          ADD      r0,r4,#0xc
000024  f7fffffe          BL       ||U2||
000028  f8bd1000          LDRH     r1,[sp,#0]
00002c  4288              CMP      r0,r1
00002e  d002              BEQ      |L8.54|
;;;300        {
;;;301    //        CH_TRACE("ch checksum error: frame:0x%X calcuate:0x%X, len:%d\n", U2(raw->buf+4), crc, raw->len);
;;;302            return -1;
000030  f04f30ff          MOV      r0,#0xffffffff
;;;303        }
;;;304        
;;;305        return parse_data(raw);
;;;306    }
000034  bd38              POP      {r3-r5,pc}
                  |L8.54|
000036  4620              MOV      r0,r4                 ;305
000038  f7fffffe          BL       parse_data
00003c  bd38              POP      {r3-r5,pc}
;;;307    
                          ENDP


                          AREA ||i.dump_imu_data||, CODE, READONLY, ALIGN=1

                  dump_imu_data PROC
;;;60     
;;;61     static void dump_imu_data(raw_t *raw)
000000  f89016cc          LDRB     r1,[r0,#0x6cc]
;;;62     {
;;;63         int i;
;;;64         if(raw->item_code[0] != KItemGWSOL) /* HI226 HI229 CH100 CH110 */  
000004  2962              CMP      r1,#0x62
000006  d106              BNE      |L9.22|
;;;65         {
;;;66     //        Uart_Printf(COM1,"%-16s%d\r\n",       "id:",  raw->imu[0].id);
;;;67     //        Uart_Printf(COM1,"%-16s%.3f %.3f %.3f\r\n",       "acc(G):",        raw->imu[0].acc[0], raw->imu[0].acc[1],  raw->imu[0].acc[2]);
;;;68     //        Uart_Printf(COM1,"%-16s%.3f %.3f %.3f\r\n",       "gyr(deg/s):",    raw->imu[0].gyr[0], raw->imu[0].gyr[1],  raw->imu[0].gyr[2]);
;;;69     //        Uart_Printf(COM1,"%-16s%.3f %.3f %.3f\r\n",       "mag(uT):",       raw->imu[0].mag[0], raw->imu[0].mag[1],  raw->imu[0].mag[2]);
;;;70     //        Uart_Printf(COM1,"%-16s%.3f %.3f %.3f\r\n",       "eul(deg):",      raw->imu[0].eul[0], raw->imu[0].eul[1],  raw->imu[0].eul[2]);
;;;71     //        Uart_Printf(COM1,"%-16s%.3f %.3f %.3f %.3f\r\n",  "quat:",          raw->imu[0].quat[0], raw->imu[0].quat[1],  raw->imu[0].quat[2], raw->imu[0].quat[3]);
;;;72     //        Uart_Printf(COM1,"%-16s%.3f\r\n",       "presure(pa):",  raw->imu[0].pressure);
;;;73     //        Uart_Printf(COM1,"%-16s%d\r\n",       "timestamp(ms):",  raw->imu[0].timestamp);
;;;74     //        Uart_Printf(COM1,"item: ");
;;;75     //        for(i=0; i<raw->nitem_code; i++)
;;;76     //        {
;;;77     //            Uart_Printf(COM1,"0x%02X(%s)", raw->item_code[i], code2name(raw->item_code[i]));
;;;78     //        }
;;;79     //        Uart_Printf(COM1,"\r\n");
;;;80         }
;;;81         else /* HI222(HI221GW) */
;;;82         {
;;;83     //        putchar(10);
;;;84     //        Uart_Printf(COM1,"gateway: %s%d, %s%d\r\n",       "gwid:",      raw->gwid, "node cnt:", raw->nimu);
;;;85             for(i=0; i<raw->nimu; i++)
000008  2100              MOVS     r1,#0
00000a  f8900209          LDRB     r0,[r0,#0x209]
00000e  e000              B        |L9.18|
                  |L9.16|
000010  1c49              ADDS     r1,r1,#1
                  |L9.18|
000012  4288              CMP      r0,r1
000014  dcfc              BGT      |L9.16|
                  |L9.22|
;;;86             {
;;;87     //            putchar(10);
;;;88     //            Uart_Printf(COM1,"%-16s%d\r\n",       "id:",  raw->imu[i].id);
;;;89     //            Uart_Printf(COM1,"%-16s%.3f %.3f %.3f\r\n",       "acc(G):",        raw->imu[i].acc[0], raw->imu[i].acc[1],  raw->imu[i].acc[2]);
;;;90     //            Uart_Printf(COM1,"%-16s%.3f %.3f %.3f\r\n",       "gyr(deg/s):",    raw->imu[i].gyr[0], raw->imu[i].gyr[1],  raw->imu[i].gyr[2]);
;;;91     //            Uart_Printf(COM1,"%-16s%.3f %.3f %.3f\r\n",       "mag(uT):",       raw->imu[i].mag[0], raw->imu[i].mag[1],  raw->imu[i].mag[2]);
;;;92     //            Uart_Printf(COM1,"%-16s%.3f %.3f %.3f\r\n",       "eul(deg):",      raw->imu[i].eul[0], raw->imu[i].eul[1],  raw->imu[i].eul[2]);
;;;93     //            Uart_Printf(COM1,"%-16s%.3f %.3f %.3f %.3f\r\n",  "quat:",          raw->imu[i].quat[0], raw->imu[i].quat[1],  raw->imu[i].quat[2], raw->imu[i].quat[3]);
;;;94     //            Uart_Printf(COM1,"%-16s%.3f\r\n",       "presure(pa):",  raw->imu[i].pressure);
;;;95     //            Uart_Printf(COM1,"%-16s%d\r\n",       "timestamp(ms):",  raw->imu[i].timestamp);
;;;96             }
;;;97         }
;;;98     }
000016  4770              BX       lr
;;;99     
                          ENDP


                          AREA ||i.parse_data||, CODE, READONLY, ALIGN=2

                  parse_data PROC
;;;164    /* parse the payload of a frame and feed into data section */
;;;165    static int parse_data(raw_t *raw)
000000  e92d47f0          PUSH     {r4-r10,lr}
;;;166    {
000004  4604              MOV      r4,r0
000006  ed2d8b02          VPUSH    {d8}
;;;167        int ofs = 0, i = 0;
00000a  2500              MOVS     r5,#0
;;;168        uint8_t *p = &raw->buf[CH_HDR_SIZE];
00000c  f104080e          ADD      r8,r4,#0xe
;;;169        memset(raw->item_code, 0, sizeof(raw->item_code));
000010  2000              MOVS     r0,#0
000012  f8c406cc          STR      r0,[r4,#0x6cc]
000016  f8c406d0          STR      r0,[r4,#0x6d0]
;;;170        raw->nitem_code = 0;
00001a  f88406d4          STRB     r0,[r4,#0x6d4]
;;;171    
;;;172    	while(ofs < raw->len)
;;;173    	{
;;;174    		switch(p[ofs])
;;;175    		{
;;;176                case kItemID:
;;;177                    raw->nimu = 1;
;;;178                    raw->item_code[raw->nitem_code++] = kItemID;
;;;179                    raw->imu[0].id = U1(p+ofs+1);
;;;180                    ofs += 2;
;;;181                    break;
;;;182                case kItemAccRaw:
;;;183                    raw->nimu = 1;
;;;184                    raw->item_code[raw->nitem_code++] = kItemAccRaw;
;;;185                    raw->imu[0].acc[0] = (float)I2(p+ofs+1) / 1000;
;;;186                    raw->imu[0].acc[1] = (float)I2(p+ofs+3) / 1000;
;;;187                    raw->imu[0].acc[2] = (float)I2(p+ofs+5) / 1000;
;;;188                    ofs += 7;
;;;189                    break;
;;;190                case kItemGyrRaw:
;;;191                    raw->nimu = 1;
;;;192                    raw->item_code[raw->nitem_code++] = kItemGyrRaw;
;;;193                    raw->imu[0].gyr[0] = (float)I2(p+ofs+1) / 10;
00001e  eeb28a04          VMOV.F32 s16,#10.00000000
000022  f04f0901          MOV      r9,#1                 ;177
                  |L10.38|
000026  e016              B        |L10.86|
                  |L10.40|
000028  f8180005          LDRB     r0,[r8,r5]            ;174
00002c  28b0              CMP      r0,#0xb0              ;174
00002e  d05b              BEQ      |L10.232|
000030  dc08              BGT      |L10.68|
000032  2862              CMP      r0,#0x62              ;174
000034  d07e              BEQ      |L10.308|
000036  2890              CMP      r0,#0x90              ;174
000038  d015              BEQ      |L10.102|
00003a  2891              CMP      r0,#0x91              ;174
00003c  d07b              BEQ      |L10.310|
00003e  28a0              CMP      r0,#0xa0              ;174
000040  d108              BNE      |L10.84|
000042  e022              B        |L10.138|
                  |L10.68|
000044  28c0              CMP      r0,#0xc0              ;174
000046  d077              BEQ      |L10.312|
000048  28d0              CMP      r0,#0xd0              ;174
00004a  d076              BEQ      |L10.314|
00004c  28d1              CMP      r0,#0xd1              ;174
00004e  d075              BEQ      |L10.316|
000050  28f0              CMP      r0,#0xf0              ;174
000052  d074              BEQ      |L10.318|
                  |L10.84|
;;;194                    raw->imu[0].gyr[1] = (float)I2(p+ofs+3) / 10;
;;;195                    raw->imu[0].gyr[2] = (float)I2(p+ofs+5) / 10;
;;;196                    ofs += 7;
;;;197                    break;
;;;198                case kItemMagRaw:
;;;199                    raw->nimu = 1;
;;;200                    raw->item_code[raw->nitem_code++] = kItemMagRaw;
;;;201                    raw->imu[0].mag[0] = (float)I2(p+ofs+1) / 10;
;;;202                    raw->imu[0].mag[1] = (float)I2(p+ofs+3) / 10;
;;;203                    raw->imu[0].mag[2] = (float)I2(p+ofs+5) / 10;
;;;204                    ofs += 7;
;;;205                    break;
;;;206                case kItemRotationEul:
;;;207                    raw->item_code[raw->nitem_code++] = kItemRotationEul;
;;;208                    raw->imu[0].eul[0] = (float)I2(p+ofs+1) / 100;
;;;209                    raw->imu[0].eul[1] = (float)I2(p+ofs+3) / 100;
;;;210                    raw->imu[0].eul[2] = (float)I2(p+ofs+5) / 10;
;;;211                    ofs += 7;
;;;212                    break;
;;;213                case kItemRotationQuat:
;;;214                    raw->nimu = 1;
;;;215                    raw->item_code[raw->nitem_code++] = kItemRotationQuat;
;;;216                    raw->imu[0].quat[0] = R4(p+ofs+1);
;;;217                    raw->imu[0].quat[1] = R4(p+ofs+5);
;;;218                    raw->imu[0].quat[2] = R4(p+ofs+9);
;;;219                    raw->imu[0].quat[3] = R4(p+ofs+13);
;;;220                    ofs += 17;
;;;221                    break;
;;;222                case kItemPressure:
;;;223                    raw->nimu = 1;
;;;224                    raw->item_code[raw->nitem_code++] = kItemPressure;
;;;225                    raw->imu[0].pressure = R4(p+ofs+1);
;;;226                    ofs += 5;
;;;227                    break;
;;;228    
;;;229                case KItemIMUSOL:
;;;230                    raw->nimu = 1;
;;;231                    raw->item_code[raw->nitem_code++] = KItemIMUSOL;
;;;232                    raw->imu[0].id = U1(p+ofs+1);
;;;233                    raw->imu[0].pressure = R4(p+ofs+4);
;;;234                    raw->imu[0].timestamp = U4(p+ofs+8);
;;;235                    raw->imu[0].acc[0] = R4(p+ofs+12);
;;;236                    raw->imu[0].acc[1] = R4(p+ofs+16);
;;;237                    raw->imu[0].acc[2] = R4(p+ofs+20);
;;;238                    raw->imu[0].gyr[0] = R4(p+ofs+24);
;;;239                    raw->imu[0].gyr[1] = R4(p+ofs+28);
;;;240                    raw->imu[0].gyr[2] = R4(p+ofs+32);
;;;241                    raw->imu[0].mag[0] = R4(p+ofs+36);
;;;242                    raw->imu[0].mag[1] = R4(p+ofs+40);
;;;243                    raw->imu[0].mag[2] = R4(p+ofs+44);
;;;244                    raw->imu[0].eul[0] = R4(p+ofs+48);
;;;245                    raw->imu[0].eul[1] = R4(p+ofs+52);
;;;246                    raw->imu[0].eul[2] = R4(p+ofs+56);
;;;247                    raw->imu[0].quat[0] = R4(p+ofs+60);
;;;248                    raw->imu[0].quat[1] = R4(p+ofs+64);
;;;249                    raw->imu[0].quat[2] = R4(p+ofs+68);
;;;250                    raw->imu[0].quat[3] = R4(p+ofs+72);
;;;251                    ofs += 76;
;;;252                    break;
;;;253    				
;;;254                case KItemGWSOL:
;;;255                    raw->item_code[raw->nitem_code++] = KItemGWSOL;
;;;256                    raw->gwid = U1(p+ofs+1);
;;;257                    raw->nimu = U1(p+ofs+2);
;;;258                    ofs += 8;
;;;259                    for (i=0; i<raw->nimu; i++)
;;;260                    {
;;;261                        raw->imu[i].id = U1(p+ofs+1);
;;;262                        raw->imu[i].pressure = R4(p+ofs+4);
;;;263                        raw->imu[i].timestamp = U4(p+ofs+8);
;;;264                        raw->imu[i].acc[0] = R4(p+ofs+12);
;;;265                        raw->imu[i].acc[1] = R4(p+ofs+16);
;;;266                        raw->imu[i].acc[2] = R4(p+ofs+20);
;;;267                        raw->imu[i].gyr[0] = R4(p+ofs+24);
;;;268                        raw->imu[i].gyr[1] = R4(p+ofs+28);
;;;269                        raw->imu[i].gyr[2] = R4(p+ofs+32);
;;;270                        raw->imu[i].mag[0] = R4(p+ofs+36);
;;;271                        raw->imu[i].mag[1] = R4(p+ofs+40);
;;;272                        raw->imu[i].mag[2] = R4(p+ofs+44);
;;;273                        raw->imu[i].eul[0] = R4(p+ofs+48);
;;;274                        raw->imu[i].eul[1] = R4(p+ofs+52);
;;;275                        raw->imu[i].eul[2] = R4(p+ofs+56);
;;;276                        raw->imu[i].quat[0] = R4(p+ofs+60);
;;;277                        raw->imu[i].quat[1] = R4(p+ofs+64);
;;;278                        raw->imu[i].quat[2] = R4(p+ofs+68);
;;;279                        raw->imu[i].quat[3] = R4(p+ofs+72);
;;;280                        ofs += 76;
;;;281                    }
;;;282                    break;
;;;283                default:
;;;284    				ofs++;
000054  1c6d              ADDS     r5,r5,#1
                  |L10.86|
000056  6860              LDR      r0,[r4,#4]            ;172
000058  42a8              CMP      r0,r5                 ;172
00005a  dce5              BGT      |L10.40|
;;;285                    break;
;;;286    		}
;;;287        }
;;;288        
;;;289        return 1;
;;;290    }
00005c  ecbd8b02          VPOP     {d8}
000060  2001              MOVS     r0,#1                 ;289
000062  e8bd87f0          POP      {r4-r10,pc}
                  |L10.102|
000066  f8849209          STRB     r9,[r4,#0x209]        ;177
00006a  f89406d4          LDRB     r0,[r4,#0x6d4]        ;178
00006e  2290              MOVS     r2,#0x90              ;178
000070  1c41              ADDS     r1,r0,#1              ;178
000072  4420              ADD      r0,r0,r4              ;178
000074  f88416d4          STRB     r1,[r4,#0x6d4]        ;178
000078  f88026cc          STRB     r2,[r0,#0x6cc]        ;178
00007c  eb080005          ADD      r0,r8,r5              ;179
000080  7840              LDRB     r0,[r0,#1]            ;179
000082  f8c4020c          STR      r0,[r4,#0x20c]        ;179
000086  1cad              ADDS     r5,r5,#2              ;180
000088  e7e5              B        |L10.86|
                  |L10.138|
00008a  f8849209          STRB     r9,[r4,#0x209]        ;183
00008e  f89406d4          LDRB     r0,[r4,#0x6d4]        ;184
000092  22a0              MOVS     r2,#0xa0              ;184
000094  1c41              ADDS     r1,r0,#1              ;184
000096  4420              ADD      r0,r0,r4              ;184
000098  f88416d4          STRB     r1,[r4,#0x6d4]        ;184
00009c  f88026cc          STRB     r2,[r0,#0x6cc]        ;184
0000a0  eb080005          ADD      r0,r8,r5              ;185
0000a4  f9301f01          LDRSH    r1,[r0,#1]!           ;185
0000a8  ee001a10          VMOV     s0,r1                 ;185
0000ac  eef80ac0          VCVT.F32.S32 s1,s0                 ;185
0000b0  ed9f0af9          VLDR     s0,|L10.1176|
0000b4  ee801a80          VDIV.F32 s2,s1,s0              ;185
0000b8  ed841a84          VSTR     s2,[r4,#0x210]        ;185
0000bc  f9b01002          LDRSH    r1,[r0,#2]            ;186
0000c0  ee001a90          VMOV     s1,r1                 ;186
0000c4  eef80ae0          VCVT.F32.S32 s1,s1                 ;186
0000c8  ee801a80          VDIV.F32 s2,s1,s0              ;186
0000cc  ed841a85          VSTR     s2,[r4,#0x214]        ;186
0000d0  f9b00004          LDRSH    r0,[r0,#4]            ;187
0000d4  ee000a90          VMOV     s1,r0                 ;187
0000d8  eef80ae0          VCVT.F32.S32 s1,s1                 ;187
0000dc  ee801a80          VDIV.F32 s2,s1,s0              ;187
0000e0  ed841a86          VSTR     s2,[r4,#0x218]        ;187
0000e4  1ded              ADDS     r5,r5,#7              ;188
0000e6  e7b6              B        |L10.86|
                  |L10.232|
0000e8  f8849209          STRB     r9,[r4,#0x209]        ;191
0000ec  f89406d4          LDRB     r0,[r4,#0x6d4]        ;192
0000f0  22b0              MOVS     r2,#0xb0              ;192
0000f2  1c41              ADDS     r1,r0,#1              ;192
0000f4  4420              ADD      r0,r0,r4              ;192
0000f6  f88416d4          STRB     r1,[r4,#0x6d4]        ;192
0000fa  f88026cc          STRB     r2,[r0,#0x6cc]        ;192
0000fe  eb080005          ADD      r0,r8,r5              ;193
000102  f9301f01          LDRSH    r1,[r0,#1]!           ;193
000106  ee001a10          VMOV     s0,r1                 ;193
00010a  eeb80ac0          VCVT.F32.S32 s0,s0                 ;193
00010e  eec00a08          VDIV.F32 s1,s0,s16             ;193
000112  edc40a87          VSTR     s1,[r4,#0x21c]        ;193
000116  f9b01002          LDRSH    r1,[r0,#2]            ;194
00011a  ee001a10          VMOV     s0,r1                 ;194
00011e  eeb80ac0          VCVT.F32.S32 s0,s0                 ;194
000122  eec00a08          VDIV.F32 s1,s0,s16             ;194
000126  edc40a88          VSTR     s1,[r4,#0x220]        ;194
00012a  f9b00004          LDRSH    r0,[r0,#4]            ;195
00012e  ee000a10          VMOV     s0,r0                 ;195
000132  e005              B        |L10.320|
                  |L10.308|
000134  e11c              B        |L10.880|
                  |L10.310|
000136  e09e              B        |L10.630|
                  |L10.312|
000138  e00a              B        |L10.336|
                  |L10.314|
00013a  e036              B        |L10.426|
                  |L10.316|
00013c  e062              B        |L10.516|
                  |L10.318|
00013e  e086              B        |L10.590|
                  |L10.320|
000140  eeb80ac0          VCVT.F32.S32 s0,s0                 ;195
000144  eec00a08          VDIV.F32 s1,s0,s16             ;195
000148  edc40a89          VSTR     s1,[r4,#0x224]        ;195
00014c  1ded              ADDS     r5,r5,#7              ;196
00014e  e782              B        |L10.86|
                  |L10.336|
000150  f8849209          STRB     r9,[r4,#0x209]        ;199
000154  f89406d4          LDRB     r0,[r4,#0x6d4]        ;200
000158  22c0              MOVS     r2,#0xc0              ;200
00015a  1c41              ADDS     r1,r0,#1              ;200
00015c  4420              ADD      r0,r0,r4              ;200
00015e  f88416d4          STRB     r1,[r4,#0x6d4]        ;200
000162  f88026cc          STRB     r2,[r0,#0x6cc]        ;200
000166  eb080005          ADD      r0,r8,r5              ;201
00016a  f9301f01          LDRSH    r1,[r0,#1]!           ;201
00016e  ee001a10          VMOV     s0,r1                 ;201
000172  eeb80ac0          VCVT.F32.S32 s0,s0                 ;201
000176  eec00a08          VDIV.F32 s1,s0,s16             ;201
00017a  edc40a8a          VSTR     s1,[r4,#0x228]        ;201
00017e  f9b01002          LDRSH    r1,[r0,#2]            ;202
000182  ee001a10          VMOV     s0,r1                 ;202
000186  eeb80ac0          VCVT.F32.S32 s0,s0                 ;202
00018a  eec00a08          VDIV.F32 s1,s0,s16             ;202
00018e  edc40a8b          VSTR     s1,[r4,#0x22c]        ;202
000192  f9b00004          LDRSH    r0,[r0,#4]            ;203
000196  ee000a10          VMOV     s0,r0                 ;203
00019a  eeb80ac0          VCVT.F32.S32 s0,s0                 ;203
00019e  eec00a08          VDIV.F32 s1,s0,s16             ;203
0001a2  edc40a8c          VSTR     s1,[r4,#0x230]        ;203
0001a6  1ded              ADDS     r5,r5,#7              ;204
0001a8  e755              B        |L10.86|
                  |L10.426|
0001aa  f89406d4          LDRB     r0,[r4,#0x6d4]        ;207
0001ae  22d0              MOVS     r2,#0xd0              ;207
0001b0  1c41              ADDS     r1,r0,#1              ;207
0001b2  4420              ADD      r0,r0,r4              ;207
0001b4  f88416d4          STRB     r1,[r4,#0x6d4]        ;207
0001b8  f88026cc          STRB     r2,[r0,#0x6cc]        ;207
0001bc  eb080005          ADD      r0,r8,r5              ;208
0001c0  f9301f01          LDRSH    r1,[r0,#1]!           ;208
0001c4  ee001a10          VMOV     s0,r1                 ;208
0001c8  eef80ac0          VCVT.F32.S32 s1,s0                 ;208
0001cc  ed9f0ab3          VLDR     s0,|L10.1180|
0001d0  ee801a80          VDIV.F32 s2,s1,s0              ;208
0001d4  ed841a8d          VSTR     s2,[r4,#0x234]        ;208
0001d8  f9b01002          LDRSH    r1,[r0,#2]            ;209
0001dc  ee001a90          VMOV     s1,r1                 ;209
0001e0  eef80ae0          VCVT.F32.S32 s1,s1                 ;209
0001e4  ee801a80          VDIV.F32 s2,s1,s0              ;209
0001e8  ed841a8e          VSTR     s2,[r4,#0x238]        ;209
0001ec  f9b00004          LDRSH    r0,[r0,#4]            ;210
0001f0  ee000a10          VMOV     s0,r0                 ;210
0001f4  eeb80ac0          VCVT.F32.S32 s0,s0                 ;210
0001f8  eec00a08          VDIV.F32 s1,s0,s16             ;210
0001fc  edc40a8f          VSTR     s1,[r4,#0x23c]        ;210
000200  1ded              ADDS     r5,r5,#7              ;211
000202  e728              B        |L10.86|
                  |L10.516|
000204  f8849209          STRB     r9,[r4,#0x209]        ;214
000208  f89406d4          LDRB     r0,[r4,#0x6d4]        ;215
00020c  22d1              MOVS     r2,#0xd1              ;215
00020e  1c41              ADDS     r1,r0,#1              ;215
000210  4420              ADD      r0,r0,r4              ;215
000212  f88416d4          STRB     r1,[r4,#0x6d4]        ;215
000216  f88026cc          STRB     r2,[r0,#0x6cc]        ;215
00021a  eb080605          ADD      r6,r8,r5              ;216
00021e  1c70              ADDS     r0,r6,#1              ;216
000220  f7fffffe          BL       ||R4||
000224  ed840a90          VSTR     s0,[r4,#0x240]        ;216
000228  1d70              ADDS     r0,r6,#5              ;217
00022a  f7fffffe          BL       ||R4||
00022e  ed840a91          VSTR     s0,[r4,#0x244]        ;217
000232  f1060009          ADD      r0,r6,#9              ;218
000236  f7fffffe          BL       ||R4||
00023a  ed840a92          VSTR     s0,[r4,#0x248]        ;218
00023e  f106000d          ADD      r0,r6,#0xd            ;219
000242  f7fffffe          BL       ||R4||
000246  ed840a93          VSTR     s0,[r4,#0x24c]        ;219
00024a  3511              ADDS     r5,r5,#0x11           ;220
00024c  e703              B        |L10.86|
                  |L10.590|
00024e  f8849209          STRB     r9,[r4,#0x209]        ;223
000252  f89406d4          LDRB     r0,[r4,#0x6d4]        ;224
000256  22f0              MOVS     r2,#0xf0              ;224
000258  1c41              ADDS     r1,r0,#1              ;224
00025a  4420              ADD      r0,r0,r4              ;224
00025c  f88416d4          STRB     r1,[r4,#0x6d4]        ;224
000260  f88026cc          STRB     r2,[r0,#0x6cc]        ;224
000264  eb080005          ADD      r0,r8,r5              ;225
000268  1c40              ADDS     r0,r0,#1              ;225
00026a  f7fffffe          BL       ||R4||
00026e  ed840a94          VSTR     s0,[r4,#0x250]        ;225
000272  1d6d              ADDS     r5,r5,#5              ;226
000274  e6ef              B        |L10.86|
                  |L10.630|
000276  f8849209          STRB     r9,[r4,#0x209]        ;230
00027a  f89406d4          LDRB     r0,[r4,#0x6d4]        ;231
00027e  2291              MOVS     r2,#0x91              ;231
000280  1c41              ADDS     r1,r0,#1              ;231
000282  4420              ADD      r0,r0,r4              ;231
000284  f88416d4          STRB     r1,[r4,#0x6d4]        ;231
000288  f88026cc          STRB     r2,[r0,#0x6cc]        ;231
00028c  eb080605          ADD      r6,r8,r5              ;232
000290  7870              LDRB     r0,[r6,#1]            ;232
000292  f8c4020c          STR      r0,[r4,#0x20c]        ;232
000296  1d30              ADDS     r0,r6,#4              ;233
000298  f7fffffe          BL       ||R4||
00029c  ed840a94          VSTR     s0,[r4,#0x250]        ;233
0002a0  f1060008          ADD      r0,r6,#8              ;234
0002a4  f7fffffe          BL       ||U4||
0002a8  f8c40254          STR      r0,[r4,#0x254]        ;234
0002ac  f106000c          ADD      r0,r6,#0xc            ;235
0002b0  f7fffffe          BL       ||R4||
0002b4  ed840a84          VSTR     s0,[r4,#0x210]        ;235
0002b8  f1060010          ADD      r0,r6,#0x10           ;236
0002bc  f7fffffe          BL       ||R4||
0002c0  ed840a85          VSTR     s0,[r4,#0x214]        ;236
0002c4  f1060014          ADD      r0,r6,#0x14           ;237
0002c8  f7fffffe          BL       ||R4||
0002cc  ed840a86          VSTR     s0,[r4,#0x218]        ;237
0002d0  f1060018          ADD      r0,r6,#0x18           ;238
0002d4  f7fffffe          BL       ||R4||
0002d8  ed840a87          VSTR     s0,[r4,#0x21c]        ;238
0002dc  f106001c          ADD      r0,r6,#0x1c           ;239
0002e0  f7fffffe          BL       ||R4||
0002e4  ed840a88          VSTR     s0,[r4,#0x220]        ;239
0002e8  f1060020          ADD      r0,r6,#0x20           ;240
0002ec  f7fffffe          BL       ||R4||
0002f0  ed840a89          VSTR     s0,[r4,#0x224]        ;240
0002f4  f1060024          ADD      r0,r6,#0x24           ;241
0002f8  f7fffffe          BL       ||R4||
0002fc  ed840a8a          VSTR     s0,[r4,#0x228]        ;241
000300  f1060028          ADD      r0,r6,#0x28           ;242
000304  f7fffffe          BL       ||R4||
000308  ed840a8b          VSTR     s0,[r4,#0x22c]        ;242
00030c  f106002c          ADD      r0,r6,#0x2c           ;243
000310  f7fffffe          BL       ||R4||
000314  ed840a8c          VSTR     s0,[r4,#0x230]        ;243
000318  f1060030          ADD      r0,r6,#0x30           ;244
00031c  f7fffffe          BL       ||R4||
000320  ed840a8d          VSTR     s0,[r4,#0x234]        ;244
000324  f1060034          ADD      r0,r6,#0x34           ;245
000328  f7fffffe          BL       ||R4||
00032c  ed840a8e          VSTR     s0,[r4,#0x238]        ;245
000330  f1060038          ADD      r0,r6,#0x38           ;246
000334  f7fffffe          BL       ||R4||
000338  ed840a8f          VSTR     s0,[r4,#0x23c]        ;246
00033c  f106003c          ADD      r0,r6,#0x3c           ;247
000340  f7fffffe          BL       ||R4||
000344  ed840a90          VSTR     s0,[r4,#0x240]        ;247
000348  f1060040          ADD      r0,r6,#0x40           ;248
00034c  f7fffffe          BL       ||R4||
000350  ed840a91          VSTR     s0,[r4,#0x244]        ;248
000354  f1060044          ADD      r0,r6,#0x44           ;249
000358  f7fffffe          BL       ||R4||
00035c  ed840a92          VSTR     s0,[r4,#0x248]        ;249
000360  f1060048          ADD      r0,r6,#0x48           ;250
000364  f7fffffe          BL       ||R4||
000368  ed840a93          VSTR     s0,[r4,#0x24c]        ;250
00036c  354c              ADDS     r5,r5,#0x4c           ;251
00036e  e672              B        |L10.86|
                  |L10.880|
000370  f89406d4          LDRB     r0,[r4,#0x6d4]        ;255
000374  2262              MOVS     r2,#0x62              ;255
000376  1c41              ADDS     r1,r0,#1              ;255
000378  4420              ADD      r0,r0,r4              ;255
00037a  f88416d4          STRB     r1,[r4,#0x6d4]        ;255
00037e  f88026cc          STRB     r2,[r0,#0x6cc]        ;255
000382  eb080005          ADD      r0,r8,r5              ;256
000386  7841              LDRB     r1,[r0,#1]            ;256
000388  f8841208          STRB     r1,[r4,#0x208]        ;256
00038c  7880              LDRB     r0,[r0,#2]            ;257
00038e  f8840209          STRB     r0,[r4,#0x209]        ;257
000392  3508              ADDS     r5,r5,#8              ;258
000394  f04f0a00          MOV      r10,#0                ;259
000398  e078              B        |L10.1164|
                  |L10.922|
00039a  eb0a014a          ADD      r1,r10,r10,LSL #1     ;261
00039e  eb080605          ADD      r6,r8,r5              ;261
0003a2  eb01110a          ADD      r1,r1,r10,LSL #4      ;261
0003a6  eb040781          ADD      r7,r4,r1,LSL #2       ;261
0003aa  7870              LDRB     r0,[r6,#1]            ;261
0003ac  f8c7020c          STR      r0,[r7,#0x20c]        ;261
0003b0  1d30              ADDS     r0,r6,#4              ;262
0003b2  f7fffffe          BL       ||R4||
0003b6  ed870a94          VSTR     s0,[r7,#0x250]        ;262
0003ba  f1060008          ADD      r0,r6,#8              ;263
0003be  f7fffffe          BL       ||U4||
0003c2  f8c70254          STR      r0,[r7,#0x254]        ;263
0003c6  f106000c          ADD      r0,r6,#0xc            ;264
0003ca  f7fffffe          BL       ||R4||
0003ce  ed870a84          VSTR     s0,[r7,#0x210]        ;264
0003d2  f1060010          ADD      r0,r6,#0x10           ;265
0003d6  f7fffffe          BL       ||R4||
0003da  ed870a85          VSTR     s0,[r7,#0x214]        ;265
0003de  f1060014          ADD      r0,r6,#0x14           ;266
0003e2  f7fffffe          BL       ||R4||
0003e6  ed870a86          VSTR     s0,[r7,#0x218]        ;266
0003ea  f1060018          ADD      r0,r6,#0x18           ;267
0003ee  f7fffffe          BL       ||R4||
0003f2  ed870a87          VSTR     s0,[r7,#0x21c]        ;267
0003f6  f106001c          ADD      r0,r6,#0x1c           ;268
0003fa  f7fffffe          BL       ||R4||
0003fe  ed870a88          VSTR     s0,[r7,#0x220]        ;268
000402  f1060020          ADD      r0,r6,#0x20           ;269
000406  f7fffffe          BL       ||R4||
00040a  ed870a89          VSTR     s0,[r7,#0x224]        ;269
00040e  f1060024          ADD      r0,r6,#0x24           ;270
000412  f7fffffe          BL       ||R4||
000416  ed870a8a          VSTR     s0,[r7,#0x228]        ;270
00041a  f1060028          ADD      r0,r6,#0x28           ;271
00041e  f7fffffe          BL       ||R4||
000422  ed870a8b          VSTR     s0,[r7,#0x22c]        ;271
000426  f106002c          ADD      r0,r6,#0x2c           ;272
00042a  f7fffffe          BL       ||R4||
00042e  ed870a8c          VSTR     s0,[r7,#0x230]        ;272
000432  f1060030          ADD      r0,r6,#0x30           ;273
000436  f7fffffe          BL       ||R4||
00043a  ed870a8d          VSTR     s0,[r7,#0x234]        ;273
00043e  f1060034          ADD      r0,r6,#0x34           ;274
000442  f7fffffe          BL       ||R4||
000446  ed870a8e          VSTR     s0,[r7,#0x238]        ;274
00044a  f1060038          ADD      r0,r6,#0x38           ;275
00044e  f7fffffe          BL       ||R4||
000452  ed870a8f          VSTR     s0,[r7,#0x23c]        ;275
000456  f106003c          ADD      r0,r6,#0x3c           ;276
00045a  f7fffffe          BL       ||R4||
00045e  ed870a90          VSTR     s0,[r7,#0x240]        ;276
000462  f1060040          ADD      r0,r6,#0x40           ;277
000466  f7fffffe          BL       ||R4||
00046a  ed870a91          VSTR     s0,[r7,#0x244]        ;277
00046e  f1060044          ADD      r0,r6,#0x44           ;278
000472  f7fffffe          BL       ||R4||
000476  ed870a92          VSTR     s0,[r7,#0x248]        ;278
00047a  f1060048          ADD      r0,r6,#0x48           ;279
00047e  f7fffffe          BL       ||R4||
000482  ed870a93          VSTR     s0,[r7,#0x24c]        ;279
000486  354c              ADDS     r5,r5,#0x4c           ;280
000488  f10a0a01          ADD      r10,r10,#1            ;259
                  |L10.1164|
00048c  f8940209          LDRB     r0,[r4,#0x209]        ;259
000490  4550              CMP      r0,r10                ;259
000492  f77fadc8          BLE      |L10.38|
000496  e780              B        |L10.922|
                  |L10.1176|
000498  447a0000          DCFS     0x447a0000 ; 1000
                  |L10.1180|
00049c  42c80000          DCFS     0x42c80000 ; 100
                          ENDP


                          AREA ||i.sync_ch||, CODE, READONLY, ALIGN=1

                  sync_ch PROC
;;;308    /* sync code */
;;;309    static int sync_ch(uint8_t *buf, uint8_t data)
000000  7842              LDRB     r2,[r0,#1]
;;;310    {
;;;311        buf[0] = buf[1];
000002  7002              STRB     r2,[r0,#0]
;;;312        buf[1] = data;
000004  7041              STRB     r1,[r0,#1]
;;;313        return buf[0] == CHSYNC1 && buf[1] == CHSYNC2;
000006  2a5a              CMP      r2,#0x5a
000008  d101              BNE      |L11.14|
00000a  29a5              CMP      r1,#0xa5
00000c  d001              BEQ      |L11.18|
                  |L11.14|
00000e  2000              MOVS     r0,#0
;;;314    }
000010  4770              BX       lr
                  |L11.18|
000012  2001              MOVS     r0,#1                 ;313
000014  4770              BX       lr
;;;315    
                          ENDP


                          AREA ||.bss||, DATA, NOINIT, ALIGN=2

                  ||raw||
                          %        1752

                          AREA ||.constdata||, DATA, READONLY, ALIGN=0

                  item_code_name
000000  90696400          DCB      0x90,0x69,0x64,0x00
                          DCDU     0x00000000
000008  00a06163          DCB      0x00,0xa0,0x61,0x63
00000c  63000000          DCB      0x63,0x00,0x00,0x00
000010  0000b067          DCB      0x00,0x00,0xb0,0x67
000014  79720000          DCB      0x79,0x72,0x00,0x00
000018  000000c0          DCB      0x00,0x00,0x00,0xc0
00001c  6d616700          DCB      0x6d,0x61,0x67,0x00
                          DCDU     0x00000000
000024  d065756c          DCB      0xd0,0x65,0x75,0x6c
000028  00000000          DCB      0x00,0x00,0x00,0x00
00002c  00d17175          DCB      0x00,0xd1,0x71,0x75
000030  61740000          DCB      0x61,0x74,0x00,0x00
000034  0000f070          DCB      0x00,0x00,0xf0,0x70
000038  72657373          DCB      0x72,0x65,0x73,0x73
00003c  75726591          DCB      0x75,0x72,0x65,0x91
000040  494d5553          DCB      0x49,0x4d,0x55,0x53
000044  4f4c0000          DCB      0x4f,0x4c,0x00,0x00
000048  60475753          DCB      0x60,0x47,0x57,0x53
00004c  4f4c0000          DCB      0x4f,0x4c,0x00,0x00
000050  00                DCB      0x00

                          AREA ||.data||, DATA, ALIGN=0

                  decode_succ
000000  00                DCB      0x00

;*** Start embedded assembler ***

#line 1 "..\\..\\User\\HARAWARE\\ch_serial.c"
	AREA ||.rev16_text||, CODE
	THUMB
	EXPORT |__asm___11_ch_serial_c_64120237____REV16|
#line 129 "..\\..\\Libraries\\CMSIS\\Include\\core_cmInstr.h"
|__asm___11_ch_serial_c_64120237____REV16| PROC
#line 130

 rev16 r0, r0
 bx lr
	ENDP
	AREA ||.revsh_text||, CODE
	THUMB
	EXPORT |__asm___11_ch_serial_c_64120237____REVSH|
#line 144
|__asm___11_ch_serial_c_64120237____REVSH| PROC
#line 145

 revsh r0, r0
 bx lr
	ENDP
	AREA ||.rrx_text||, CODE
	THUMB
	EXPORT |__asm___11_ch_serial_c_64120237____RRX|
#line 300
|__asm___11_ch_serial_c_64120237____RRX| PROC
#line 301

 rrx r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***