calculation.txt
82.1 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
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
; 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\calculation.o --asm_dir=.\Flash\List\ --list_dir=.\Flash\List\ --depend=.\flash\obj\calculation.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\calculation.crf ..\..\User\CONTROLFUNCTION\Calculation.c]
THUMB
AREA ||i.CalCoordinateDis||, CODE, READONLY, ALIGN=2
CalCoordinateDis PROC
;;;441 // 计算点到边的距离
;;;442 double CalCoordinateDis(CoordinatePoints CurrentCenterPoint, CoordinatePoints StartPoint, CoordinatePoints TargetPoint)
000000 b500 PUSH {lr}
;;;443 {
000002 ed2d0b0a VPUSH {d0-d4}
000006 ed2d8b10 VPUSH {d8-d15}
00000a b089 SUB sp,sp,#0x24
;;;444 double x, y, startx, starty, endx, endy;
;;;445
;;;446 double h, s, p, sum, a, b, c;
;;;447
;;;448 x = CurrentCenterPoint.TarX;
00000c 9819 LDR r0,[sp,#0x64]
00000e f7fffffe BL __aeabi_f2d
000012 ec410b19 VMOV d9,r0,r1
;;;449
;;;450 y = CurrentCenterPoint.TarY;
000016 981a LDR r0,[sp,#0x68]
000018 f7fffffe BL __aeabi_f2d
00001c ec410b1a VMOV d10,r0,r1
;;;451
;;;452 startx = StartPoint.TarX;
000020 981c LDR r0,[sp,#0x70]
000022 f7fffffe BL __aeabi_f2d
000026 ec410b1b VMOV d11,r0,r1
;;;453
;;;454 starty = StartPoint.TarY;
00002a 981d LDR r0,[sp,#0x74]
00002c f7fffffe BL __aeabi_f2d
000030 ec410b1c VMOV d12,r0,r1
;;;455
;;;456 endx = TargetPoint.TarX;
000034 981f LDR r0,[sp,#0x7c]
000036 f7fffffe BL __aeabi_f2d
00003a ec410b1d VMOV d13,r0,r1
;;;457
;;;458 endy = TargetPoint.TarY;
00003e 9820 LDR r0,[sp,#0x80]
000040 f7fffffe BL __aeabi_f2d
000044 ec410b1e VMOV d14,r0,r1
;;;459
;;;460 sum = pow((x - startx), 2) + pow((y - starty), 2);
000048 ec532b1c VMOV r2,r3,d12
00004c ec510b1a VMOV r0,r1,d10
000050 f7fffffe BL __aeabi_dsub
000054 ec410b10 VMOV d0,r0,r1
000058 ed9f1b77 VLDR d1,|L1.568|
00005c f7fffffe BL __hardfp_pow
000060 eeb08a40 VMOV.F32 s16,s0
000064 eef08a60 VMOV.F32 s17,s1
000068 ec532b1b VMOV r2,r3,d11
00006c ec510b19 VMOV r0,r1,d9
000070 f7fffffe BL __aeabi_dsub
000074 ec410b10 VMOV d0,r0,r1
000078 ed9f1b6f VLDR d1,|L1.568|
00007c f7fffffe BL __hardfp_pow
000080 ec532b18 VMOV r2,r3,d8
000084 ec510b10 VMOV r0,r1,d0
000088 f7fffffe BL __aeabi_dadd
00008c ec410b10 VMOV d0,r0,r1
;;;461
;;;462 a = sqrt(sum);
000090 f7fffffe BL __hardfp_sqrt
000094 ed8d0b06 VSTR d0,[sp,#0x18]
;;;463
;;;464 sum = pow((x - endx), 2) + pow((y - endy), 2);
000098 ec532b1e VMOV r2,r3,d14
00009c ec510b1a VMOV r0,r1,d10
0000a0 f7fffffe BL __aeabi_dsub
0000a4 ec410b10 VMOV d0,r0,r1
0000a8 ed9f1b63 VLDR d1,|L1.568|
0000ac f7fffffe BL __hardfp_pow
0000b0 eeb08a40 VMOV.F32 s16,s0
0000b4 eef08a60 VMOV.F32 s17,s1
0000b8 ec532b1d VMOV r2,r3,d13
0000bc ec510b19 VMOV r0,r1,d9
0000c0 f7fffffe BL __aeabi_dsub
0000c4 ec410b10 VMOV d0,r0,r1
0000c8 ed9f1b5b VLDR d1,|L1.568|
0000cc f7fffffe BL __hardfp_pow
0000d0 ec532b18 VMOV r2,r3,d8
0000d4 ec510b10 VMOV r0,r1,d0
0000d8 f7fffffe BL __aeabi_dadd
0000dc ec410b10 VMOV d0,r0,r1
;;;465
;;;466 b = sqrt(sum);
0000e0 f7fffffe BL __hardfp_sqrt
0000e4 ed8d0b04 VSTR d0,[sp,#0x10]
;;;467
;;;468 sum = pow((startx - endx), 2) + pow((starty - endy), 2);
0000e8 ec532b1e VMOV r2,r3,d14
0000ec ec510b1c VMOV r0,r1,d12
0000f0 f7fffffe BL __aeabi_dsub
0000f4 ec410b10 VMOV d0,r0,r1
0000f8 ed9f1b4f VLDR d1,|L1.568|
0000fc f7fffffe BL __hardfp_pow
000100 eeb08a40 VMOV.F32 s16,s0
000104 eef08a60 VMOV.F32 s17,s1
000108 ec532b1d VMOV r2,r3,d13
00010c ec510b1b VMOV r0,r1,d11
000110 f7fffffe BL __aeabi_dsub
000114 ec410b10 VMOV d0,r0,r1
000118 ed9f1b47 VLDR d1,|L1.568|
00011c f7fffffe BL __hardfp_pow
000120 ec532b18 VMOV r2,r3,d8
000124 ec510b10 VMOV r0,r1,d0
000128 f7fffffe BL __aeabi_dadd
00012c ec410b10 VMOV d0,r0,r1
;;;469
;;;470 c = sqrt(sum);
000130 f7fffffe BL __hardfp_sqrt
000134 eeb0fa40 VMOV.F32 s30,s0
000138 eef0fa60 VMOV.F32 s31,s1
;;;471
;;;472 p = (a + b + c) / 2;
00013c ed9d0b04 VLDR d0,[sp,#0x10]
000140 ec532b10 VMOV r2,r3,d0
000144 ed9d0b06 VLDR d0,[sp,#0x18]
000148 ec510b10 VMOV r0,r1,d0
00014c f7fffffe BL __aeabi_dadd
000150 ec532b1f VMOV r2,r3,d15
000154 f7fffffe BL __aeabi_dadd
000158 ed9f1b39 VLDR d1,|L1.576|
00015c ec532b11 VMOV r2,r3,d1
000160 f7fffffe BL __aeabi_dmul
000164 ec410b18 VMOV d8,r0,r1
;;;473
;;;474 sum = p * (p - a) * (p - b) * (p - c);
000168 ec532b1f VMOV r2,r3,d15
00016c ec510b18 VMOV r0,r1,d8
000170 f7fffffe BL __aeabi_dsub
000174 e9cd0102 STRD r0,r1,[sp,#8]
000178 ed9d0b04 VLDR d0,[sp,#0x10]
00017c ec510b18 VMOV r0,r1,d8
000180 ec532b10 VMOV r2,r3,d0
000184 f7fffffe BL __aeabi_dsub
000188 e9cd0100 STRD r0,r1,[sp,#0]
00018c ed9d0b06 VLDR d0,[sp,#0x18]
000190 ec510b18 VMOV r0,r1,d8
000194 ec532b10 VMOV r2,r3,d0
000198 f7fffffe BL __aeabi_dsub
00019c ec532b18 VMOV r2,r3,d8
0001a0 f7fffffe BL __aeabi_dmul
0001a4 ed9d1b00 VLDR d1,[sp,#0]
0001a8 ec532b11 VMOV r2,r3,d1
0001ac f7fffffe BL __aeabi_dmul
0001b0 ed9d1b02 VLDR d1,[sp,#8]
0001b4 ec532b11 VMOV r2,r3,d1
0001b8 f7fffffe BL __aeabi_dmul
0001bc ec410b10 VMOV d0,r0,r1
;;;475
;;;476 s = sqrt(sum);
0001c0 f7fffffe BL __hardfp_sqrt
0001c4 eeb08a40 VMOV.F32 s16,s0
0001c8 eef08a60 VMOV.F32 s17,s1
;;;477
;;;478 h = (2 / c) * s;
0001cc ed9f0b1a VLDR d0,|L1.568|
0001d0 ec532b1f VMOV r2,r3,d15
0001d4 ec510b10 VMOV r0,r1,d0
0001d8 f7fffffe BL __aeabi_ddiv
0001dc ec532b18 VMOV r2,r3,d8
0001e0 f7fffffe BL __aeabi_dmul
0001e4 ec410b18 VMOV d8,r0,r1
;;;479
;;;480 int direction = Point_Line_Pos(x, y, startx, starty, endx, endy);
0001e8 eeb05a4e VMOV.F32 s10,s28
0001ec eef05a6e VMOV.F32 s11,s29
0001f0 eeb04a4d VMOV.F32 s8,s26
0001f4 eef04a6d VMOV.F32 s9,s27
0001f8 eeb03a4c VMOV.F32 s6,s24
0001fc eef03a6c VMOV.F32 s7,s25
000200 eeb02a4b VMOV.F32 s4,s22
000204 eef02a6b VMOV.F32 s5,s23
000208 eeb01a4a VMOV.F32 s2,s20
00020c eef01a6a VMOV.F32 s3,s21
000210 eeb00a49 VMOV.F32 s0,s18
000214 eef00a69 VMOV.F32 s1,s19
000218 f7fffffe BL Point_Line_Pos
;;;481
;;;482 return h * direction;
00021c f7fffffe BL __aeabi_i2d
000220 ec532b18 VMOV r2,r3,d8
000224 f7fffffe BL __aeabi_dmul
;;;483 }
000228 b009 ADD sp,sp,#0x24
00022a ec410b10 VMOV d0,r0,r1 ;482
00022e ecbd8b10 VPOP {d8-d15}
000232 b00a ADD sp,sp,#0x28
000234 bd00 POP {pc}
;;;484
ENDP
000236 0000 DCW 0x0000
|L1.568|
000238 00000000 DCFD 0x4000000000000000 ; 2
00023c 40000000
|L1.576|
000240 00000000 DCFD 0x3fe0000000000000 ; 0.5
000244 3fe00000
AREA ||i.CalculateDistance||, CODE, READONLY, ALIGN=2
CalculateDistance PROC
;;;404
;;;405 void CalculateDistance()
000000 b510 PUSH {r4,lr}
;;;406 {
000002 ed2d8b04 VPUSH {d8-d9}
;;;407 // navi.Public.DistanceAgvToSTART = TwoPointDistance(StartPoint, CurrentCenterPoint); //起始点到agv实际距离
;;;408
;;;409 // navi.Public.VerticalDistanceAgvToSTART =
;;;410 // sqrt(pow(navi.Public.DistanceAgvToSTART, 2.0f) - pow(navi.Public.CenterOffset, 2.0f)); //起始点到agv垂直距离
;;;411
;;;412 navi.Public.DistanceAgvToTARGET = TwoPointDistance(CurrentCenterPoint, TargetPoint); //agv到目标点实际距离
000006 4820 LDR r0,|L2.136|
000008 edd02a02 VLDR s5,[r0,#8]
00000c ed902a01 VLDR s4,[r0,#4]
000010 edd01a00 VLDR s3,[r0,#0]
000014 481d LDR r0,|L2.140|
000016 ed901a02 VLDR s2,[r0,#8]
00001a edd00a01 VLDR s1,[r0,#4]
00001e ed900a00 VLDR s0,[r0,#0]
000022 f7fffffe BL TwoPointDistance
000026 4c1a LDR r4,|L2.144|
000028 ed840a04 VSTR s0,[r4,#0x10]
;;;413
;;;414 navi.Public.VerticalDistanceAgvToTARGET =
00002c 6860 LDR r0,[r4,#4] ; navi
00002e f7fffffe BL __aeabi_f2d
000032 ed9f9b18 VLDR d9,|L2.148|
000036 ec410b10 VMOV d0,r0,r1
00003a eeb01a49 VMOV.F32 s2,s18
00003e eef01a69 VMOV.F32 s3,s19
000042 f7fffffe BL __hardfp_pow
000046 eeb08a40 VMOV.F32 s16,s0
00004a eef08a60 VMOV.F32 s17,s1
00004e 6920 LDR r0,[r4,#0x10] ; navi
000050 f7fffffe BL __aeabi_f2d
000054 ec410b10 VMOV d0,r0,r1
000058 eeb01a49 VMOV.F32 s2,s18
00005c eef01a69 VMOV.F32 s3,s19
000060 f7fffffe BL __hardfp_pow
000064 ec532b18 VMOV r2,r3,d8
000068 ec510b10 VMOV r0,r1,d0
00006c f7fffffe BL __aeabi_dsub
000070 ec410b10 VMOV d0,r0,r1
000074 f7fffffe BL __hardfp_sqrt
000078 ec510b10 VMOV r0,r1,d0
00007c f7fffffe BL __aeabi_d2f
000080 61a0 STR r0,[r4,#0x18] ; navi
;;;415 sqrt(pow(navi.Public.DistanceAgvToTARGET, 2.0f) - pow(navi.Public.CenterOffset, 2.0f)); //agv到目标点垂直距离
;;;416
;;;417 // navi.Public.DistanceSTARTtoTARGET = TwoPointDistance(StartPoint, TargetPoint); //起始点到目标点距离
;;;418 }
000082 ecbd8b04 VPOP {d8-d9}
000086 bd10 POP {r4,pc}
;;;419
ENDP
|L2.136|
DCD TargetPoint
|L2.140|
DCD CurrentCenterPoint
|L2.144|
DCD navi
|L2.148|
000094 00000000 DCFD 0x4000000000000000 ; 2
000098 40000000
AREA ||i.CalculateXBias||, CODE, READONLY, ALIGN=2
CalculateXBias PROC
;;;485 //位置积分
;;;486 void CalculateXBias(float Vx, float Vy, float palstance, float timecount, float *XBias, float *YBias, float *Theta)
000000 b570 PUSH {r4-r6,lr}
;;;487 {
000002 4605 MOV r5,r0
000004 ed2d8b0c VPUSH {d8-d13}
000008 eef0aa40 VMOV.F32 s21,s0
00000c eeb0da60 VMOV.F32 s26,s1
000010 eeb0aa41 VMOV.F32 s20,s2
000014 460e MOV r6,r1
;;;488 static float Angle = 0;
;;;489 switch (agv.Command.RunState)
000016 487e LDR r0,|L3.528|
;;;490 {
;;;491 case 0:
;;;492 Angle = *Theta;
000018 4c7e LDR r4,|L3.532|
00001a 7fc0 LDRB r0,[r0,#0x1f] ;489 ; agv
00001c 2800 CMP r0,#0 ;489
00001e d008 BEQ |L3.50|
;;;493 break;
;;;494 case 1:
;;;495 Angle = *Theta - PI/2;
000020 ed9f0a7d VLDR s0,|L3.536|
000024 2801 CMP r0,#1 ;489
000026 d009 BEQ |L3.60|
000028 2802 CMP r0,#2 ;489
00002a d00e BEQ |L3.74|
00002c 2803 CMP r0,#3 ;489
00002e d11b BNE |L3.104|
000030 e014 B |L3.92|
|L3.50|
000032 ed920a00 VLDR s0,[r2,#0] ;492
000036 ed840a02 VSTR s0,[r4,#8] ;492
00003a e015 B |L3.104|
|L3.60|
00003c edd20a00 VLDR s1,[r2,#0]
000040 ee300ac0 VSUB.F32 s0,s1,s0
000044 ed840a02 VSTR s0,[r4,#8]
;;;496 break;
000048 e00e B |L3.104|
|L3.74|
;;;497 case 2:
;;;498 Angle = *Theta - PI;
00004a ed920a00 VLDR s0,[r2,#0]
00004e eddf0a73 VLDR s1,|L3.540|
000052 ee300a60 VSUB.F32 s0,s0,s1
000056 ed840a02 VSTR s0,[r4,#8]
;;;499 break;
00005a e005 B |L3.104|
|L3.92|
;;;500 case 3:
;;;501 Angle = *Theta - PI/2;
00005c edd20a00 VLDR s1,[r2,#0]
000060 ee300ac0 VSUB.F32 s0,s1,s0
000064 ed840a02 VSTR s0,[r4,#8]
|L3.104|
;;;502 break;
;;;503 default:
;;;504 break;
;;;505 }
;;;506 double Time = timecount;
000068 ee110a90 VMOV r0,s3
00006c f7fffffe BL __aeabi_f2d
000070 ec410b18 VMOV d8,r0,r1
;;;507 double Dx = Vx * Time * cos((Angle) + palstance * Time / 2) - Vy * Time * sin((Angle) + palstance * Time / 2);
000074 ee1a0a10 VMOV r0,s20
000078 f7fffffe BL __aeabi_f2d
00007c ec532b18 VMOV r2,r3,d8
000080 f7fffffe BL __aeabi_dmul
000084 ed9f9b66 VLDR d9,|L3.544|
000088 ec532b19 VMOV r2,r3,d9
00008c f7fffffe BL __aeabi_dmul
000090 ec410b1b VMOV d11,r0,r1
000094 68a0 LDR r0,[r4,#8] ; Angle
000096 f7fffffe BL __aeabi_f2d
00009a ec532b1b VMOV r2,r3,d11
00009e f7fffffe BL __aeabi_dadd
0000a2 ec410b10 VMOV d0,r0,r1
0000a6 f7fffffe BL __hardfp_sin
0000aa eeb0ba40 VMOV.F32 s22,s0
0000ae eef0ba60 VMOV.F32 s23,s1
0000b2 ee1d0a10 VMOV r0,s26
0000b6 f7fffffe BL __aeabi_f2d
0000ba ec532b18 VMOV r2,r3,d8
0000be f7fffffe BL __aeabi_dmul
0000c2 ec532b1b VMOV r2,r3,d11
0000c6 f7fffffe BL __aeabi_dmul
0000ca ec410b1b VMOV d11,r0,r1
0000ce ee1a0a10 VMOV r0,s20
0000d2 f7fffffe BL __aeabi_f2d
0000d6 ec532b18 VMOV r2,r3,d8
0000da f7fffffe BL __aeabi_dmul
0000de ec532b19 VMOV r2,r3,d9
0000e2 f7fffffe BL __aeabi_dmul
0000e6 ec410b1c VMOV d12,r0,r1
0000ea 68a0 LDR r0,[r4,#8] ; Angle
0000ec f7fffffe BL __aeabi_f2d
0000f0 ec532b1c VMOV r2,r3,d12
0000f4 f7fffffe BL __aeabi_dadd
0000f8 ec410b10 VMOV d0,r0,r1
0000fc f7fffffe BL __hardfp_cos
000100 eeb0ca40 VMOV.F32 s24,s0
000104 eef0ca60 VMOV.F32 s25,s1
000108 ee1a0a90 VMOV r0,s21
00010c f7fffffe BL __aeabi_f2d
000110 ec532b18 VMOV r2,r3,d8
000114 f7fffffe BL __aeabi_dmul
000118 ec532b1c VMOV r2,r3,d12
00011c f7fffffe BL __aeabi_dmul
000120 ec532b1b VMOV r2,r3,d11
000124 f7fffffe BL __aeabi_dsub
000128 ec410b1b VMOV d11,r0,r1
;;;508 double Dy = Vx * Time * sin((Angle) + palstance * Time / 2) + Vy * Time * cos((Angle) + palstance * Time / 2);
00012c ee1a0a10 VMOV r0,s20
000130 f7fffffe BL __aeabi_f2d
000134 ec532b18 VMOV r2,r3,d8
000138 f7fffffe BL __aeabi_dmul
00013c ec532b19 VMOV r2,r3,d9
000140 f7fffffe BL __aeabi_dmul
000144 ec410b1c VMOV d12,r0,r1
000148 68a0 LDR r0,[r4,#8] ; Angle
00014a f7fffffe BL __aeabi_f2d
00014e ec532b1c VMOV r2,r3,d12
000152 f7fffffe BL __aeabi_dadd
000156 ec410b10 VMOV d0,r0,r1
00015a f7fffffe BL __hardfp_cos
00015e eeb0ca40 VMOV.F32 s24,s0
000162 eef0ca60 VMOV.F32 s25,s1
000166 ee1d0a10 VMOV r0,s26
00016a f7fffffe BL __aeabi_f2d
00016e ec532b18 VMOV r2,r3,d8
000172 f7fffffe BL __aeabi_dmul
000176 ec532b1c VMOV r2,r3,d12
00017a f7fffffe BL __aeabi_dmul
00017e ec410b1c VMOV d12,r0,r1
000182 ee1a0a10 VMOV r0,s20
000186 f7fffffe BL __aeabi_f2d
00018a ec532b18 VMOV r2,r3,d8
00018e f7fffffe BL __aeabi_dmul
000192 ec532b19 VMOV r2,r3,d9
000196 f7fffffe BL __aeabi_dmul
00019a ec410b19 VMOV d9,r0,r1
00019e 68a0 LDR r0,[r4,#8] ; Angle
0001a0 f7fffffe BL __aeabi_f2d
0001a4 ec532b19 VMOV r2,r3,d9
0001a8 f7fffffe BL __aeabi_dadd
0001ac ec410b10 VMOV d0,r0,r1
0001b0 f7fffffe BL __hardfp_sin
0001b4 eeb09a40 VMOV.F32 s18,s0
0001b8 eef09a60 VMOV.F32 s19,s1
0001bc ee1a0a90 VMOV r0,s21
0001c0 f7fffffe BL __aeabi_f2d
0001c4 ec532b18 VMOV r2,r3,d8
0001c8 f7fffffe BL __aeabi_dmul
0001cc ec532b19 VMOV r2,r3,d9
0001d0 f7fffffe BL __aeabi_dmul
0001d4 ec532b1c VMOV r2,r3,d12
0001d8 f7fffffe BL __aeabi_dadd
0001dc ec410b18 VMOV d8,r0,r1
;;;509
;;;510 // *Theta ;//+= palstance * timecount;
;;;511 *XBias += Dx;
0001e0 6828 LDR r0,[r5,#0]
0001e2 f7fffffe BL __aeabi_f2d
0001e6 ec532b1b VMOV r2,r3,d11
0001ea f7fffffe BL __aeabi_dadd
0001ee f7fffffe BL __aeabi_d2f
0001f2 6028 STR r0,[r5,#0]
;;;512 *YBias += Dy;
0001f4 6830 LDR r0,[r6,#0]
0001f6 f7fffffe BL __aeabi_f2d
0001fa ec532b18 VMOV r2,r3,d8
0001fe f7fffffe BL __aeabi_dadd
000202 f7fffffe BL __aeabi_d2f
000206 6030 STR r0,[r6,#0]
;;;513 }
000208 ecbd8b0c VPOP {d8-d13}
00020c bd70 POP {r4-r6,pc}
;;;514 //void CalculateXBias(double Vx, double palstance, double timecount, float *YBias, float *Theta)
ENDP
00020e 0000 DCW 0x0000
|L3.528|
DCD agv
|L3.532|
DCD ||.data||
|L3.536|
000218 3fc90fda DCFS 0x3fc90fda ; 1.5707962512969971
|L3.540|
00021c 40490fda DCFS 0x40490fda ; 3.1415925025939941
|L3.544|
000220 00000000 DCFD 0x3fe0000000000000 ; 0.5
000224 3fe00000
AREA ||i.CalculatingCurrentAndTargetAngle||, CODE, READONLY, ALIGN=2
CalculatingCurrentAndTargetAngle PROC
;;;32 //计算目标方向与当前车体方向的夹角 偏左大于0 偏右 小于0
;;;33 float CalculatingCurrentAndTargetAngle(float agvActualAngle, float agvTargetAngle)
000000 ee300a60 VSUB.F32 s0,s0,s1
;;;34 {
;;;35 float IncludedAngle = 0;
;;;36
;;;37 IncludedAngle = agvActualAngle - agvTargetAngle;
;;;38
;;;39 if (IncludedAngle <= -PI)
000004 4908 LDR r1,|L4.40|
;;;40 IncludedAngle += 2.0f * PI;
000006 eddf0a09 VLDR s1,|L4.44|
00000a ee100a10 VMOV r0,s0 ;39
00000e 4288 CMP r0,r1 ;39
000010 d301 BCC |L4.22|
000012 ee300a20 VADD.F32 s0,s0,s1
|L4.22|
;;;41
;;;42 if (IncludedAngle >= PI)
000016 4906 LDR r1,|L4.48|
000018 ee100a10 VMOV r0,s0
00001c 4288 CMP r0,r1
00001e db01 BLT |L4.36|
;;;43 IncludedAngle -= 2.0f * PI;
000020 ee300a60 VSUB.F32 s0,s0,s1
|L4.36|
;;;44
;;;45 return IncludedAngle;
;;;46 }
000024 4770 BX lr
;;;47
ENDP
000026 0000 DCW 0x0000
|L4.40|
DCD 0xc0490fda
|L4.44|
00002c 40c90fda DCFS 0x40c90fda ; 6.2831850051879883
|L4.48|
DCD 0x40490fda
AREA ||i.CalculatingDirectionAngle||, CODE, READONLY, ALIGN=2
CalculatingDirectionAngle PROC
;;;10 }
;;;11 float CalculatingDirectionAngle(CoordinatePoints PointOne, CoordinatePoints PointTwo)
000000 b510 PUSH {r4,lr}
;;;12 {
000002 ed2d0b06 VPUSH {d0-d2}
000006 ed2d8b04 VPUSH {d8-d9}
;;;13 float Angle = 0;
00000a ed9f0a1d VLDR s0,|L5.128|
;;;14
;;;15 if(PointOne.TarX == PointTwo.TarX)//垂直于X轴
00000e ed9d1a04 VLDR s2,[sp,#0x10]
000012 eddd0a07 VLDR s1,[sp,#0x1c]
;;;16 {
;;;17 if(PointTwo.TarY > PointOne.TarY)
000016 ed9d9a08 VLDR s18,[sp,#0x20]
00001a eddd9a05 VLDR s19,[sp,#0x14]
00001e eeb41a60 VCMP.F32 s2,s1 ;15
000022 eef1fa10 VMRS APSR_nzcv,FPSCR ;15
000026 d10e BNE |L5.70|
000028 eeb49ae9 VCMPE.F32 s18,s19
00002c eef1fa10 VMRS APSR_nzcv,FPSCR
000030 dd05 BLE |L5.62|
;;;18 {
;;;19 Angle = PI/2;
000032 ed9f0a14 VLDR s0,|L5.132|
|L5.54|
;;;20 }
;;;21 else if(PointTwo.TarY < PointOne.TarY)
;;;22 {
;;;23 Angle = -PI/2;
;;;24 }
;;;25 }
;;;26 else//不垂直于X轴
;;;27 Angle = atan2((PointTwo.TarY - PointOne.TarY) , (PointTwo.TarX - PointOne.TarX));
;;;28
;;;29 return Angle;
;;;30 }
000036 ecbd8b04 VPOP {d8-d9}
00003a b006 ADD sp,sp,#0x18
00003c bd10 POP {r4,pc}
|L5.62|
00003e d2fa BCS |L5.54|
000040 ed9f0a11 VLDR s0,|L5.136|
000044 e7f7 B |L5.54|
|L5.70|
000046 ee300ac1 VSUB.F32 s0,s1,s2 ;27
00004a ee100a10 VMOV r0,s0 ;27
00004e f7fffffe BL __aeabi_f2d
000052 ee390a69 VSUB.F32 s0,s18,s19 ;27
000056 ec410b18 VMOV d8,r0,r1 ;27
00005a ee100a10 VMOV r0,s0 ;27
00005e f7fffffe BL __aeabi_f2d
000062 ec410b10 VMOV d0,r0,r1 ;27
000066 eeb01a48 VMOV.F32 s2,s16 ;27
00006a eef01a68 VMOV.F32 s3,s17 ;27
00006e f7fffffe BL __hardfp_atan2
000072 ec510b10 VMOV r0,r1,d0 ;27
000076 f7fffffe BL __aeabi_d2f
00007a ee000a10 VMOV s0,r0 ;27
00007e e7da B |L5.54|
;;;31
ENDP
|L5.128|
000080 00000000 DCFS 0x00000000 ; 0
|L5.132|
000084 3fc90fda DCFS 0x3fc90fda ; 1.5707962512969971
|L5.136|
000088 bfc90fda DCFS 0xbfc90fda ; -1.5707962512969971
AREA ||i.GetCircleCenterPoint||, CODE, READONLY, ALIGN=2
GetCircleCenterPoint PROC
;;;321 /*车体实时位置,路径B点C点*/
;;;322 CoordinatePoints GetCircleCenterPoint(CoordinatePoints P,CoordinatePoints Point2,CoordinatePoints Point3)
000000 b510 PUSH {r4,lr}
;;;323 {
000002 ed2d0b0a VPUSH {d0-d4}
000006 ed2d8b02 VPUSH {d8}
00000a b0c2 SUB sp,sp,#0x108
;;;324 static float DisPB = 0;
;;;325 /*当沿X轴方向前进转弯时用,-1代表往X轴负方向,1代表往X轴正方向*/
;;;326 static int DirFlag = -1;
;;;327 if(P.TarX > Point2.TarX)//往X轴负方向
;;;328 DirFlag = -1;
00000c 4c45 LDR r4,|L6.292|
00000e ed9d0a44 VLDR s0,[sp,#0x110] ;327
000012 ed9d8a47 VLDR s16,[sp,#0x11c] ;327
000016 eeb40ac8 VCMPE.F32 s0,s16 ;327
00001a eef1fa10 VMRS APSR_nzcv,FPSCR ;327
00001e dd03 BLE |L6.40|
000020 f04f30ff MOV r0,#0xffffffff
000024 6060 STR r0,[r4,#4] ; DirFlag
000026 e001 B |L6.44|
|L6.40|
;;;329 else
;;;330 DirFlag = 1;
000028 2001 MOVS r0,#1
00002a 6060 STR r0,[r4,#4] ; DirFlag
|L6.44|
;;;331 /***********************************/
;;;332 CoordinatePoints PTurnOff,PCROSS,Circle;//计算点位
;;;333 Line L1,L2,L3,L4;
;;;334 L1 = getLine1(P);//以一个点构造直线
00002c ed9d1a46 VLDR s2,[sp,#0x118]
000030 eddd0a45 VLDR s1,[sp,#0x114]
000034 4668 MOV r0,sp
000036 f7fffffe BL getLine1
00003a 2230 MOVS r2,#0x30
00003c 4669 MOV r1,sp
00003e a830 ADD r0,sp,#0xc0
000040 f7fffffe BL __aeabi_memcpy4
;;;335 L2 = getLine2(Point2,Point3);//两个点构造直线
000044 eddd2a4c VLDR s5,[sp,#0x130]
000048 ed9d2a4b VLDR s4,[sp,#0x12c]
00004c eddd1a4a VLDR s3,[sp,#0x128]
000050 ed9d1a49 VLDR s2,[sp,#0x124]
000054 eddd0a48 VLDR s1,[sp,#0x120]
000058 eeb00a48 VMOV.F32 s0,s16
00005c 4668 MOV r0,sp
00005e f7fffffe BL getLine2
000062 2230 MOVS r2,#0x30
000064 4669 MOV r1,sp
000066 a824 ADD r0,sp,#0x90
000068 f7fffffe BL __aeabi_memcpy4
;;;336 PCROSS = getCrossPoint(&L1,&L2);
00006c a924 ADD r1,sp,#0x90
00006e a830 ADD r0,sp,#0xc0
000070 f7fffffe BL getCrossPoint
000074 ed8d0a3c VSTR s0,[sp,#0xf0]
000078 edcd0a3d VSTR s1,[sp,#0xf4]
00007c ed8d1a3e VSTR s2,[sp,#0xf8]
;;;337 DisPB = TwoPointDistance(P,PCROSS);
000080 eef02a41 VMOV.F32 s5,s2
000084 eeb02a60 VMOV.F32 s4,s1
000088 eef01a40 VMOV.F32 s3,s0
00008c ed9d1a46 VLDR s2,[sp,#0x118]
000090 eddd0a45 VLDR s1,[sp,#0x114]
000094 ed9d0a44 VLDR s0,[sp,#0x110]
000098 f7fffffe BL TwoPointDistance
00009c ed840a00 VSTR s0,[r4,#0]
;;;338 if(agv.Command.CurDirection == 8 || agv.Command.CurDirection == 10)//右转
0000a0 4821 LDR r0,|L6.296|
0000a2 7f00 LDRB r0,[r0,#0x1c] ; agv
0000a4 2808 CMP r0,#8
0000a6 d006 BEQ |L6.182|
0000a8 280a CMP r0,#0xa
0000aa d004 BEQ |L6.182|
;;;339 {
;;;340 PTurnOff = getTurnOffPoint(&L2,&PCROSS,DisPB,1,DirFlag);
;;;341 }
;;;342 else if(agv.Command.CurDirection == 7 || agv.Command.CurDirection == 9)
0000ac 2807 CMP r0,#7
0000ae d00f BEQ |L6.208|
0000b0 2809 CMP r0,#9
0000b2 d00d BEQ |L6.208|
0000b4 e018 B |L6.232|
|L6.182|
0000b6 2201 MOVS r2,#1 ;340
0000b8 a93c ADD r1,sp,#0xf0 ;340
0000ba a824 ADD r0,sp,#0x90 ;340
0000bc 6863 LDR r3,[r4,#4] ;340 ; DirFlag
0000be f7fffffe BL getTurnOffPoint
0000c2 ed8d0a3f VSTR s0,[sp,#0xfc] ;340
0000c6 edcd0a40 VSTR s1,[sp,#0x100] ;340
0000ca ed8d1a41 VSTR s2,[sp,#0x104] ;340
0000ce e00b B |L6.232|
|L6.208|
;;;343 {
;;;344 PTurnOff = getTurnOffPoint(&L2,&PCROSS,DisPB,0,DirFlag);
0000d0 2200 MOVS r2,#0
0000d2 a93c ADD r1,sp,#0xf0
0000d4 a824 ADD r0,sp,#0x90
0000d6 6863 LDR r3,[r4,#4] ; DirFlag
0000d8 f7fffffe BL getTurnOffPoint
0000dc ed8d0a3f VSTR s0,[sp,#0xfc]
0000e0 edcd0a40 VSTR s1,[sp,#0x100]
0000e4 ed8d1a41 VSTR s2,[sp,#0x104]
|L6.232|
;;;345 }
;;;346 L3 = getVerticalLine(&L1,&P);
0000e8 aa44 ADD r2,sp,#0x110
0000ea a930 ADD r1,sp,#0xc0
0000ec 4668 MOV r0,sp
0000ee f7fffffe BL getVerticalLine
0000f2 2230 MOVS r2,#0x30
0000f4 4669 MOV r1,sp
0000f6 a818 ADD r0,sp,#0x60
0000f8 f7fffffe BL __aeabi_memcpy4
;;;347 L4 = getVerticalLine(&L2,&PTurnOff);
0000fc aa3f ADD r2,sp,#0xfc
0000fe a924 ADD r1,sp,#0x90
000100 4668 MOV r0,sp
000102 f7fffffe BL getVerticalLine
000106 2230 MOVS r2,#0x30
000108 4669 MOV r1,sp
00010a a80c ADD r0,sp,#0x30
00010c f7fffffe BL __aeabi_memcpy4
;;;348 Circle = getCrossPoint(&L3,&L4);
000110 a90c ADD r1,sp,#0x30
000112 a818 ADD r0,sp,#0x60
000114 f7fffffe BL getCrossPoint
;;;349 return Circle;
;;;350 }
000118 b042 ADD sp,sp,#0x108
00011a ecbd8b02 VPOP {d8}
00011e b00a ADD sp,sp,#0x28
000120 bd10 POP {r4,pc}
;;;351
ENDP
000122 0000 DCW 0x0000
|L6.292|
DCD ||.data||
|L6.296|
DCD agv
AREA ||i.Point_Line_Pos||, CODE, READONLY, ALIGN=2
Point_Line_Pos PROC
;;;420 /********判断点位于向量的哪侧**********/
;;;421 int Point_Line_Pos(double x, double y, double startx, double starty, double endx, double endy)
000000 b570 PUSH {r4-r6,lr}
;;;422 {
000002 ed2d8b0c VPUSH {d8-d13}
000006 eeb0aa41 VMOV.F32 s20,s2
00000a eef0aa61 VMOV.F32 s21,s3
00000e eeb08a42 VMOV.F32 s16,s4
000012 eef08a62 VMOV.F32 s17,s5
000016 eeb09a43 VMOV.F32 s18,s6
00001a eef09a63 VMOV.F32 s19,s7
00001e eeb0ca44 VMOV.F32 s24,s8
000022 eef0ca64 VMOV.F32 s25,s9
000026 eeb0da45 VMOV.F32 s26,s10
00002a eef0da65 VMOV.F32 s27,s11
;;;423 double m;
;;;424
;;;425 float vx, vy;
;;;426
;;;427 vx = x - startx;
;;;428
;;;429 vy = y - starty;
;;;430
;;;431 m = (endx - startx) * vy - (endy - starty) * vx;
;;;432
;;;433 if (m > 0) //左侧
00002e ed9fbb28 VLDR d11,|L7.208|
000032 ec532b18 VMOV r2,r3,d8 ;427
000036 ec510b10 VMOV r0,r1,d0 ;427
00003a f7fffffe BL __aeabi_dsub
00003e f7fffffe BL __aeabi_d2f
000042 4605 MOV r5,r0 ;427
000044 ec532b19 VMOV r2,r3,d9 ;429
000048 ec510b1a VMOV r0,r1,d10 ;429
00004c f7fffffe BL __aeabi_dsub
000050 f7fffffe BL __aeabi_d2f
000054 4604 MOV r4,r0 ;429
000056 4628 MOV r0,r5 ;431
000058 f7fffffe BL __aeabi_f2d
00005c ec410b1a VMOV d10,r0,r1 ;431
000060 ec532b19 VMOV r2,r3,d9 ;431
000064 ec510b1d VMOV r0,r1,d13 ;431
000068 f7fffffe BL __aeabi_dsub
00006c ec532b1a VMOV r2,r3,d10 ;431
000070 f7fffffe BL __aeabi_dmul
000074 ec410b19 VMOV d9,r0,r1 ;431
000078 4620 MOV r0,r4 ;431
00007a f7fffffe BL __aeabi_f2d
00007e ec410b1a VMOV d10,r0,r1 ;431
000082 ec532b18 VMOV r2,r3,d8 ;431
000086 ec510b1c VMOV r0,r1,d12 ;431
00008a f7fffffe BL __aeabi_dsub
00008e ec532b1a VMOV r2,r3,d10 ;431
000092 f7fffffe BL __aeabi_dmul
000096 ec532b19 VMOV r2,r3,d9 ;431
00009a f7fffffe BL __aeabi_dsub
00009e ec410b18 VMOV d8,r0,r1 ;431
0000a2 ec532b1b VMOV r2,r3,d11
0000a6 ec510b18 VMOV r0,r1,d8
0000aa f7fffffe BL __aeabi_cdrcmple
0000ae d204 BCS |L7.186|
;;;434 return -1;
0000b0 f04f30ff MOV r0,#0xffffffff
|L7.180|
;;;435 else if (m < 0) //右侧
;;;436 return 1;
;;;437 else //共线
;;;438 return 0;
;;;439 }
0000b4 ecbd8b0c VPOP {d8-d13}
0000b8 bd70 POP {r4-r6,pc}
|L7.186|
0000ba ec532b1b VMOV r2,r3,d11 ;435
0000be ec510b18 VMOV r0,r1,d8 ;435
0000c2 f7fffffe BL __aeabi_cdcmple
0000c6 d201 BCS |L7.204|
0000c8 2001 MOVS r0,#1 ;436
0000ca e7f3 B |L7.180|
|L7.204|
0000cc 2000 MOVS r0,#0 ;438
0000ce e7f1 B |L7.180|
;;;440
ENDP
|L7.208|
0000d0 00000000 DCFD 0x0000000000000000 ; 0
0000d4 00000000
AREA ||i.TwoPointDistance||, CODE, READONLY, ALIGN=2
TwoPointDistance PROC
;;;48 //两点距离公式
;;;49 float TwoPointDistance(CoordinatePoints PointOne, CoordinatePoints PointTwo)
000000 b510 PUSH {r4,lr}
;;;50 {
000002 ed2d0b06 VPUSH {d0-d2}
000006 ed2d8b04 VPUSH {d8-d9}
;;;51 return sqrt(pow((PointOne.TarX - PointTwo.TarX), 2.0f) + pow((PointOne.TarY - PointTwo.TarY), 2.0f));
00000a ed9d0a05 VLDR s0,[sp,#0x14]
00000e eddd0a08 VLDR s1,[sp,#0x20]
000012 ee300a60 VSUB.F32 s0,s0,s1
000016 ee100a10 VMOV r0,s0
00001a f7fffffe BL __aeabi_f2d
00001e ed9f9b1a VLDR d9,|L8.136|
000022 ec410b10 VMOV d0,r0,r1
000026 eeb01a49 VMOV.F32 s2,s18
00002a eef01a69 VMOV.F32 s3,s19
00002e f7fffffe BL __hardfp_pow
000032 eeb08a40 VMOV.F32 s16,s0
000036 eef08a60 VMOV.F32 s17,s1
00003a ed9d0a04 VLDR s0,[sp,#0x10]
00003e eddd0a07 VLDR s1,[sp,#0x1c]
000042 ee300a60 VSUB.F32 s0,s0,s1
000046 ee100a10 VMOV r0,s0
00004a f7fffffe BL __aeabi_f2d
00004e ec410b10 VMOV d0,r0,r1
000052 eeb01a49 VMOV.F32 s2,s18
000056 eef01a69 VMOV.F32 s3,s19
00005a f7fffffe BL __hardfp_pow
00005e ec532b18 VMOV r2,r3,d8
000062 ec510b10 VMOV r0,r1,d0
000066 f7fffffe BL __aeabi_dadd
00006a ec410b10 VMOV d0,r0,r1
00006e f7fffffe BL __hardfp_sqrt
000072 ec510b10 VMOV r0,r1,d0
000076 f7fffffe BL __aeabi_d2f
;;;52 }
00007a ecbd8b04 VPOP {d8-d9}
00007e b006 ADD sp,sp,#0x18
000080 ee000a10 VMOV s0,r0 ;51
000084 bd10 POP {r4,pc}
;;;53
ENDP
000086 0000 DCW 0x0000
|L8.136|
000088 00000000 DCFD 0x4000000000000000 ; 2
00008c 40000000
AREA ||i.getControlTargetPoint||, CODE, READONLY, ALIGN=2
getControlTargetPoint PROC
;;;180 //根据当前点和已知路径直线,以及预瞄距离,求预瞄点
;;;181 CoordinatePoints getControlTargetPoint(CoordinatePoints Point,Line Lpath,float dis)
000000 b40f PUSH {r0-r3}
;;;182 {
000002 ed2d0b04 VPUSH {d0-d1}
000006 b530 PUSH {r4,r5,lr}
000008 ed2d8b06 VPUSH {d8-d10}
00000c b09f SUB sp,sp,#0x7c
00000e eeb08a61 VMOV.F32 s16,s3
;;;183 CoordinatePoints Pfoot;
;;;184
;;;185 Line Lfoot;//垂线
;;;186
;;;187 Lfoot = getVerticalLine(&Lpath,&Point);
000012 aa28 ADD r2,sp,#0xa0
000014 a92c ADD r1,sp,#0xb0
000016 4668 MOV r0,sp
000018 f7fffffe BL getVerticalLine
00001c 2230 MOVS r2,#0x30
00001e 4669 MOV r1,sp
000020 a810 ADD r0,sp,#0x40
000022 f7fffffe BL __aeabi_memcpy4
;;;188
;;;189 Pfoot = getCrossPoint(&Lpath,&Lfoot);//垂足
000026 a910 ADD r1,sp,#0x40
000028 a82c ADD r0,sp,#0xb0
00002a f7fffffe BL getCrossPoint
00002e ed8d0a1c VSTR s0,[sp,#0x70]
000032 edcd0a1d VSTR s1,[sp,#0x74]
000036 eef08a40 VMOV.F32 s17,s0
00003a eeb09a60 VMOV.F32 s18,s1
00003e ed8d1a1e VSTR s2,[sp,#0x78]
;;;190
;;;191 CoordinatePoints valuePoint;
;;;192 if(Lpath.VerticalWithX == 1)//垂直于X轴
;;;193 {
;;;194 valuePoint.TarX = Pfoot.TarX;
;;;195 if(TargetPoint.TarY > StartPoint.TarY)
000042 4db8 LDR r5,|L9.804|
000044 4cb8 LDR r4,|L9.808|
;;;196 valuePoint.TarY = Pfoot.TarY + dis;
;;;197 else
;;;198 valuePoint.TarY = Pfoot.TarY - dis;
;;;199 }
;;;200 else//不垂直于X轴
;;;201 {
;;;202 if(Lpath.k > 0)
000046 ed9fabb9 VLDR d10,|L9.812|
00004a 9832 LDR r0,[sp,#0xc8] ;192
00004c 2801 CMP r0,#1 ;192
00004e d04e BEQ |L9.238|
000050 ed9d0b34 VLDR d0,[sp,#0xd0]
000054 ec532b1a VMOV r2,r3,d10
000058 ec510b10 VMOV r0,r1,d0
00005c f7fffffe BL __aeabi_cdrcmple
000060 d27d BCS |L9.350|
;;;203 {
;;;204 if(TargetPoint.TarY > StartPoint.TarY)
000062 ed950a01 VLDR s0,[r5,#4]
000066 edd40a01 VLDR s1,[r4,#4]
00006a eeb40ae0 VCMPE.F32 s0,s1
00006e eef1fa10 VMRS APSR_nzcv,FPSCR
000072 dd51 BLE |L9.280|
;;;205 {
;;;206 valuePoint.TarX = Pfoot.TarX + dis*cos(atan(Lpath.k));
000074 ed9d0b34 VLDR d0,[sp,#0xd0]
000078 f7fffffe BL __hardfp_atan
00007c f7fffffe BL __hardfp_cos
000080 eeb09a40 VMOV.F32 s18,s0
000084 eef09a60 VMOV.F32 s19,s1
000088 ee180a10 VMOV r0,s16
00008c f7fffffe BL __aeabi_f2d
000090 ec532b19 VMOV r2,r3,d9
000094 f7fffffe BL __aeabi_dmul
000098 ec410b19 VMOV d9,r0,r1
00009c 981c LDR r0,[sp,#0x70]
00009e f7fffffe BL __aeabi_f2d
0000a2 ec532b19 VMOV r2,r3,d9
0000a6 f7fffffe BL __aeabi_dadd
0000aa f7fffffe BL __aeabi_d2f
0000ae 900d STR r0,[sp,#0x34]
;;;207
;;;208 valuePoint.TarY = Pfoot.TarY + dis*sin(atan(Lpath.k));
0000b0 ed9d0b34 VLDR d0,[sp,#0xd0]
0000b4 f7fffffe BL __hardfp_atan
0000b8 f7fffffe BL __hardfp_sin
0000bc eeb09a40 VMOV.F32 s18,s0
0000c0 eef09a60 VMOV.F32 s19,s1
0000c4 ee180a10 VMOV r0,s16
0000c8 f7fffffe BL __aeabi_f2d
0000cc ec532b19 VMOV r2,r3,d9
0000d0 f7fffffe BL __aeabi_dmul
0000d4 ec410b18 VMOV d8,r0,r1
0000d8 981d LDR r0,[sp,#0x74]
0000da f7fffffe BL __aeabi_f2d
0000de ec532b18 VMOV r2,r3,d8
0000e2 f7fffffe BL __aeabi_dadd
0000e6 f7fffffe BL __aeabi_d2f
0000ea 900e STR r0,[sp,#0x38]
0000ec e10d B |L9.778|
|L9.238|
0000ee edcd8a0d VSTR s17,[sp,#0x34] ;194
0000f2 ed950a01 VLDR s0,[r5,#4] ;195
0000f6 edd40a01 VLDR s1,[r4,#4] ;195
0000fa eeb40ae0 VCMPE.F32 s0,s1 ;195
0000fe eef1fa10 VMRS APSR_nzcv,FPSCR ;195
000102 dd04 BLE |L9.270|
000104 ee390a08 VADD.F32 s0,s18,s16 ;196
000108 ed8d0a0e VSTR s0,[sp,#0x38] ;196
00010c e0fd B |L9.778|
|L9.270|
00010e ee390a48 VSUB.F32 s0,s18,s16 ;198
000112 ed8d0a0e VSTR s0,[sp,#0x38] ;198
000116 e0f8 B |L9.778|
|L9.280|
;;;209 }
;;;210 else
;;;211 {
;;;212 valuePoint.TarX = Pfoot.TarX - dis*cos(atan(Lpath.k));
000118 ed9d0b34 VLDR d0,[sp,#0xd0]
00011c f7fffffe BL __hardfp_atan
000120 f7fffffe BL __hardfp_cos
000124 eeb09a40 VMOV.F32 s18,s0
000128 eef09a60 VMOV.F32 s19,s1
00012c ee180a10 VMOV r0,s16
000130 f7fffffe BL __aeabi_f2d
000134 ec532b19 VMOV r2,r3,d9
000138 f7fffffe BL __aeabi_dmul
00013c ec410b19 VMOV d9,r0,r1
000140 981c LDR r0,[sp,#0x70]
000142 f7fffffe BL __aeabi_f2d
000146 ec532b19 VMOV r2,r3,d9
00014a f7fffffe BL __aeabi_dsub
00014e f7fffffe BL __aeabi_d2f
000152 900d STR r0,[sp,#0x34]
;;;213
;;;214 valuePoint.TarY = Pfoot.TarY - dis*sin(atan(Lpath.k));
000154 ed9d0b34 VLDR d0,[sp,#0xd0]
000158 f7fffffe BL __hardfp_atan
00015c e000 B |L9.352|
|L9.350|
00015e e01a B |L9.406|
|L9.352|
000160 f7fffffe BL __hardfp_sin
000164 eeb09a40 VMOV.F32 s18,s0
000168 eef09a60 VMOV.F32 s19,s1
00016c ee180a10 VMOV r0,s16
000170 f7fffffe BL __aeabi_f2d
000174 ec532b19 VMOV r2,r3,d9
000178 f7fffffe BL __aeabi_dmul
00017c ec410b18 VMOV d8,r0,r1
000180 981d LDR r0,[sp,#0x74]
000182 f7fffffe BL __aeabi_f2d
000186 ec532b18 VMOV r2,r3,d8
00018a f7fffffe BL __aeabi_dsub
00018e f7fffffe BL __aeabi_d2f
000192 900e STR r0,[sp,#0x38]
000194 e0b9 B |L9.778|
|L9.406|
;;;215 }
;;;216 }
;;;217 else if(Lpath.k < 0)
000196 ed9d0b34 VLDR d0,[sp,#0xd0]
00019a ec532b1a VMOV r2,r3,d10
00019e ec510b10 VMOV r0,r1,d0
0001a2 f7fffffe BL __aeabi_cdcmple
0001a6 d27c BCS |L9.674|
;;;218 {
;;;219 if(TargetPoint.TarY > StartPoint.TarY)
0001a8 ed950a01 VLDR s0,[r5,#4]
0001ac edd40a01 VLDR s1,[r4,#4]
0001b0 eeb40ae0 VCMPE.F32 s0,s1
0001b4 eef1fa10 VMRS APSR_nzcv,FPSCR
0001b8 dd48 BLE |L9.588|
;;;220 {
;;;221 valuePoint.TarX = Pfoot.TarX - dis*cos(atan(-Lpath.k));
0001ba ed9d0b34 VLDR d0,[sp,#0xd0]
0001be ec510b10 VMOV r0,r1,d0
0001c2 f7fffffe BL __aeabi_dneg
0001c6 ec410b10 VMOV d0,r0,r1
0001ca f7fffffe BL __hardfp_atan
0001ce f7fffffe BL __hardfp_cos
0001d2 eeb09a40 VMOV.F32 s18,s0
0001d6 eef09a60 VMOV.F32 s19,s1
0001da ee180a10 VMOV r0,s16
0001de f7fffffe BL __aeabi_f2d
0001e2 ec532b19 VMOV r2,r3,d9
0001e6 f7fffffe BL __aeabi_dmul
0001ea ec410b19 VMOV d9,r0,r1
0001ee 981c LDR r0,[sp,#0x70]
0001f0 f7fffffe BL __aeabi_f2d
0001f4 ec532b19 VMOV r2,r3,d9
0001f8 f7fffffe BL __aeabi_dsub
0001fc f7fffffe BL __aeabi_d2f
000200 900d STR r0,[sp,#0x34]
;;;222
;;;223 valuePoint.TarY = Pfoot.TarY + dis*sin(atan(-Lpath.k));
000202 ed9d0b34 VLDR d0,[sp,#0xd0]
000206 ec510b10 VMOV r0,r1,d0
00020a f7fffffe BL __aeabi_dneg
00020e ec410b10 VMOV d0,r0,r1
000212 f7fffffe BL __hardfp_atan
000216 f7fffffe BL __hardfp_sin
00021a eeb09a40 VMOV.F32 s18,s0
00021e eef09a60 VMOV.F32 s19,s1
000222 ee180a10 VMOV r0,s16
000226 f7fffffe BL __aeabi_f2d
00022a ec532b19 VMOV r2,r3,d9
00022e f7fffffe BL __aeabi_dmul
000232 ec410b18 VMOV d8,r0,r1
000236 981d LDR r0,[sp,#0x74]
000238 f7fffffe BL __aeabi_f2d
00023c ec532b18 VMOV r2,r3,d8
000240 f7fffffe BL __aeabi_dadd
000244 f7fffffe BL __aeabi_d2f
000248 900e STR r0,[sp,#0x38]
00024a e05e B |L9.778|
|L9.588|
;;;224 }
;;;225 else
;;;226 {
;;;227 valuePoint.TarX = Pfoot.TarX + dis*cos(atan(-Lpath.k));
00024c ed9d0b34 VLDR d0,[sp,#0xd0]
000250 ec510b10 VMOV r0,r1,d0
000254 f7fffffe BL __aeabi_dneg
000258 ec410b10 VMOV d0,r0,r1
00025c f7fffffe BL __hardfp_atan
000260 f7fffffe BL __hardfp_cos
000264 eeb09a40 VMOV.F32 s18,s0
000268 eef09a60 VMOV.F32 s19,s1
00026c ee180a10 VMOV r0,s16
000270 f7fffffe BL __aeabi_f2d
000274 ec532b19 VMOV r2,r3,d9
000278 f7fffffe BL __aeabi_dmul
00027c ec410b19 VMOV d9,r0,r1
000280 981c LDR r0,[sp,#0x70]
000282 f7fffffe BL __aeabi_f2d
000286 ec532b19 VMOV r2,r3,d9
00028a f7fffffe BL __aeabi_dadd
00028e f7fffffe BL __aeabi_d2f
000292 900d STR r0,[sp,#0x34]
;;;228
;;;229 valuePoint.TarY = Pfoot.TarY - dis*sin(atan(-Lpath.k));
000294 ed9d0b34 VLDR d0,[sp,#0xd0]
000298 ec510b10 VMOV r0,r1,d0
00029c f7fffffe BL __aeabi_dneg
0002a0 e000 B |L9.676|
|L9.674|
0002a2 e01e B |L9.738|
|L9.676|
0002a4 ec410b10 VMOV d0,r0,r1
0002a8 f7fffffe BL __hardfp_atan
0002ac f7fffffe BL __hardfp_sin
0002b0 eeb09a40 VMOV.F32 s18,s0
0002b4 eef09a60 VMOV.F32 s19,s1
0002b8 ee180a10 VMOV r0,s16
0002bc f7fffffe BL __aeabi_f2d
0002c0 ec532b19 VMOV r2,r3,d9
0002c4 f7fffffe BL __aeabi_dmul
0002c8 ec410b18 VMOV d8,r0,r1
0002cc 981d LDR r0,[sp,#0x74]
0002ce f7fffffe BL __aeabi_f2d
0002d2 ec532b18 VMOV r2,r3,d8
0002d6 f7fffffe BL __aeabi_dsub
0002da f7fffffe BL __aeabi_d2f
0002de 900e STR r0,[sp,#0x38]
0002e0 e013 B |L9.778|
|L9.738|
;;;230 }
;;;231 }
;;;232 else
;;;233 {
;;;234 valuePoint.TarY = Pfoot.TarY;
0002e2 ed8d9a0e VSTR s18,[sp,#0x38]
;;;235
;;;236 if(TargetPoint.TarX > StartPoint.TarX)
0002e6 ed950a00 VLDR s0,[r5,#0]
0002ea edd40a00 VLDR s1,[r4,#0]
0002ee eeb40ae0 VCMPE.F32 s0,s1
0002f2 eef1fa10 VMRS APSR_nzcv,FPSCR
0002f6 dd04 BLE |L9.770|
;;;237 {
;;;238 valuePoint.TarX = Pfoot.TarX + dis;
0002f8 ee380a88 VADD.F32 s0,s17,s16
0002fc ed8d0a0d VSTR s0,[sp,#0x34]
000300 e003 B |L9.778|
|L9.770|
;;;239
;;;240 }
;;;241 else
;;;242 {
;;;243 valuePoint.TarX = Pfoot.TarX - dis;
000302 ee380ac8 VSUB.F32 s0,s17,s16
000306 ed8d0a0d VSTR s0,[sp,#0x34]
|L9.778|
;;;244
;;;245 }
;;;246 }
;;;247 }
;;;248
;;;249 return valuePoint;
00030a ed9d0a0d VLDR s0,[sp,#0x34]
00030e eddd0a0e VLDR s1,[sp,#0x38]
000312 ed9d1a0f VLDR s2,[sp,#0x3c]
;;;250
;;;251 }
000316 b01f ADD sp,sp,#0x7c
000318 ecbd8b06 VPOP {d8-d10}
00031c bc30 POP {r4,r5}
00031e f85dfb24 LDR pc,[sp],#0x24
;;;252
ENDP
000322 0000 DCW 0x0000
|L9.804|
DCD TargetPoint
|L9.808|
DCD StartPoint
|L9.812|
00032c 00000000 DCFD 0x0000000000000000 ; 0
000330 00000000
AREA ||i.getCrossPoint||, CODE, READONLY, ALIGN=2
getCrossPoint PROC
;;;145 /*求两条直线交点*/
;;;146 CoordinatePoints getCrossPoint(Line *L1,Line *L2)
000000 b530 PUSH {r4,r5,lr}
;;;147 {
000002 4604 MOV r4,r0
000004 ed2d8b06 VPUSH {d8-d10}
000008 b083 SUB sp,sp,#0xc
00000a 460d MOV r5,r1
;;;148 CoordinatePoints PCROSS;
;;;149 if(L1->VerticalWithX == 1)
00000c 69a0 LDR r0,[r4,#0x18]
00000e 2801 CMP r0,#1
000010 d021 BEQ |L10.86|
;;;150 {
;;;151 PCROSS.TarX = L1->p1.TarX;
;;;152 PCROSS.TarY = L2->k*PCROSS.TarX + L2->b;
;;;153 }
;;;154 else if(L2->VerticalWithX == 1)
;;;155 {
;;;156 PCROSS.TarX = L2->p1.TarX;
;;;157 PCROSS.TarY = L1->k*PCROSS.TarX + L1->b;
;;;158 }
;;;159 else
;;;160 {
;;;161 if(L1->k == 0)//直线一垂直于Y轴
000012 ed9f8b4d VLDR d8,|L10.328|
000016 69a8 LDR r0,[r5,#0x18] ;154
000018 2801 CMP r0,#1 ;154
00001a d030 BEQ |L10.126|
00001c ed940b08 VLDR d0,[r4,#0x20]
000020 ec532b18 VMOV r2,r3,d8
000024 ec510b10 VMOV r0,r1,d0
000028 f7fffffe BL __aeabi_cdcmpeq
00002c d13b BNE |L10.166|
;;;162 {
;;;163 PCROSS.TarY = L1->p1.TarY;
00002e 6860 LDR r0,[r4,#4]
000030 9001 STR r0,[sp,#4]
;;;164 PCROSS.TarX = (PCROSS.TarY - L2->b)/L2->k;
000032 f7fffffe BL __aeabi_f2d
000036 ed951b0a VLDR d1,[r5,#0x28]
00003a ec532b11 VMOV r2,r3,d1
00003e f7fffffe BL __aeabi_dsub
000042 ed951b08 VLDR d1,[r5,#0x20]
000046 ec532b11 VMOV r2,r3,d1
00004a f7fffffe BL __aeabi_ddiv
00004e f7fffffe BL __aeabi_d2f
000052 9000 STR r0,[sp,#0]
000054 e06e B |L10.308|
|L10.86|
000056 6820 LDR r0,[r4,#0] ;151
000058 9000 STR r0,[sp,#0] ;151
00005a f7fffffe BL __aeabi_f2d
00005e ed951b08 VLDR d1,[r5,#0x20] ;152
000062 ec532b11 VMOV r2,r3,d1 ;152
000066 f7fffffe BL __aeabi_dmul
00006a ed951b0a VLDR d1,[r5,#0x28] ;152
00006e ec532b11 VMOV r2,r3,d1 ;152
000072 f7fffffe BL __aeabi_dadd
000076 f7fffffe BL __aeabi_d2f
00007a 9001 STR r0,[sp,#4] ;152
00007c e05a B |L10.308|
|L10.126|
00007e 6828 LDR r0,[r5,#0] ;156
000080 9000 STR r0,[sp,#0] ;156
000082 f7fffffe BL __aeabi_f2d
000086 ed941b08 VLDR d1,[r4,#0x20] ;157
00008a ec532b11 VMOV r2,r3,d1 ;157
00008e f7fffffe BL __aeabi_dmul
000092 ed941b0a VLDR d1,[r4,#0x28] ;157
000096 ec532b11 VMOV r2,r3,d1 ;157
00009a f7fffffe BL __aeabi_dadd
00009e f7fffffe BL __aeabi_d2f
0000a2 9001 STR r0,[sp,#4] ;157
0000a4 e046 B |L10.308|
|L10.166|
;;;165 }
;;;166 else if(L2->k == 0)//直线2垂直于Y轴
0000a6 ed950b08 VLDR d0,[r5,#0x20]
0000aa ec532b18 VMOV r2,r3,d8
0000ae ec510b10 VMOV r0,r1,d0
0000b2 f7fffffe BL __aeabi_cdcmpeq
0000b6 d113 BNE |L10.224|
;;;167 {
;;;168 PCROSS.TarY = L2->p1.TarY;
0000b8 6868 LDR r0,[r5,#4]
0000ba 9001 STR r0,[sp,#4]
;;;169 PCROSS.TarX = (PCROSS.TarY - L1->b)/L1->k;
0000bc f7fffffe BL __aeabi_f2d
0000c0 ed941b0a VLDR d1,[r4,#0x28]
0000c4 ec532b11 VMOV r2,r3,d1
0000c8 f7fffffe BL __aeabi_dsub
0000cc ed941b08 VLDR d1,[r4,#0x20]
0000d0 ec532b11 VMOV r2,r3,d1
0000d4 f7fffffe BL __aeabi_ddiv
0000d8 f7fffffe BL __aeabi_d2f
0000dc 9000 STR r0,[sp,#0]
0000de e029 B |L10.308|
|L10.224|
;;;170 }
;;;171 else
;;;172 {
;;;173 PCROSS.TarX = (L2->b - L1->b)/(L1->k - L2->k);
0000e0 ed950b08 VLDR d0,[r5,#0x20]
0000e4 ed948b08 VLDR d8,[r4,#0x20]
0000e8 ec532b10 VMOV r2,r3,d0
0000ec ec510b18 VMOV r0,r1,d8
0000f0 f7fffffe BL __aeabi_dsub
0000f4 ed949b0a VLDR d9,[r4,#0x28]
0000f8 ed950b0a VLDR d0,[r5,#0x28]
0000fc ec410b1a VMOV d10,r0,r1
000100 ec532b19 VMOV r2,r3,d9
000104 ec510b10 VMOV r0,r1,d0
000108 f7fffffe BL __aeabi_dsub
00010c ec532b1a VMOV r2,r3,d10
000110 f7fffffe BL __aeabi_ddiv
000114 f7fffffe BL __aeabi_d2f
000118 9000 STR r0,[sp,#0]
;;;174 PCROSS.TarY = PCROSS.TarX*L1->k + L1->b;
00011a f7fffffe BL __aeabi_f2d
00011e ec532b18 VMOV r2,r3,d8
000122 f7fffffe BL __aeabi_dmul
000126 ec532b19 VMOV r2,r3,d9
00012a f7fffffe BL __aeabi_dadd
00012e f7fffffe BL __aeabi_d2f
000132 9001 STR r0,[sp,#4]
|L10.308|
;;;175 }
;;;176 }
;;;177 return PCROSS;
000134 ed9d0a00 VLDR s0,[sp,#0]
000138 eddd0a01 VLDR s1,[sp,#4]
00013c ed9d1a02 VLDR s2,[sp,#8]
;;;178 }
000140 b003 ADD sp,sp,#0xc
000142 ecbd8b06 VPOP {d8-d10}
000146 bd30 POP {r4,r5,pc}
;;;179
ENDP
|L10.328|
000148 00000000 DCFD 0x0000000000000000 ; 0
00014c 00000000
AREA ||i.getLine1||, CODE, READONLY, ALIGN=2
getLine1 PROC
;;;53
;;;54 Line getLine1(CoordinatePoints Point)//一点生成直线
000000 b531 PUSH {r0,r4,r5,lr}
;;;55 {
000002 4604 MOV r4,r0
000004 ed2d0b04 VPUSH {d0-d1}
000008 ed2d8b02 VPUSH {d8}
00000c b08c SUB sp,sp,#0x30
;;;56 Line L;
;;;57 L.p1 = Point;
;;;58 if(fabs(fabs(Point.CurAngle) - PI/2) < 0.001)//垂直于X轴
00000e 9d10 LDR r5,[sp,#0x40]
000010 a80e ADD r0,sp,#0x38 ;57
000012 c807 LDM r0,{r0-r2} ;57
000014 e88d0007 STM sp,{r0-r2} ;57
000018 4628 MOV r0,r5
00001a f7fffffe BL __aeabi_f2d
00001e ec410b10 VMOV d0,r0,r1
000022 f7fffffe BL __hardfp_fabs
000026 ed9f1b21 VLDR d1,|L11.172|
00002a ec510b10 VMOV r0,r1,d0
00002e ec532b11 VMOV r2,r3,d1
000032 f7fffffe BL __aeabi_dsub
000036 ec410b10 VMOV d0,r0,r1
00003a f7fffffe BL __hardfp_fabs
00003e ed9f1b1d VLDR d1,|L11.180|
000042 ec510b10 VMOV r0,r1,d0
000046 ec532b11 VMOV r2,r3,d1
00004a f7fffffe BL __aeabi_cdcmple
00004e d202 BCS |L11.86|
;;;59 {
;;;60 L.VerticalWithX = 1;
000050 2001 MOVS r0,#1
000052 9006 STR r0,[sp,#0x18]
000054 e020 B |L11.152|
|L11.86|
;;;61 }
;;;62 else //不垂直于X轴
;;;63 {
;;;64 L.VerticalWithX = 0;
000056 2000 MOVS r0,#0
000058 9006 STR r0,[sp,#0x18]
;;;65 L.k = tan(Point.CurAngle);
00005a 4628 MOV r0,r5
00005c f7fffffe BL __aeabi_f2d
000060 ec410b10 VMOV d0,r0,r1
000064 f7fffffe BL __hardfp_tan
000068 ed8d0b08 VSTR d0,[sp,#0x20]
00006c eeb08a40 VMOV.F32 s16,s0
000070 eef08a60 VMOV.F32 s17,s1
;;;66 L.b = Point.TarY - Point.TarX*L.k;
000074 980e LDR r0,[sp,#0x38]
000076 f7fffffe BL __aeabi_f2d
00007a ec532b18 VMOV r2,r3,d8
00007e f7fffffe BL __aeabi_dmul
000082 ec410b18 VMOV d8,r0,r1
000086 980f LDR r0,[sp,#0x3c]
000088 f7fffffe BL __aeabi_f2d
00008c ec532b18 VMOV r2,r3,d8
000090 f7fffffe BL __aeabi_dsub
000094 e9cd010a STRD r0,r1,[sp,#0x28]
|L11.152|
;;;67 }
;;;68 return L;
000098 2230 MOVS r2,#0x30
00009a 4669 MOV r1,sp
00009c 4620 MOV r0,r4
00009e f7fffffe BL __aeabi_memcpy4
;;;69 }
0000a2 b00c ADD sp,sp,#0x30
0000a4 ecbd8b02 VPOP {d8}
0000a8 b005 ADD sp,sp,#0x14
0000aa bd30 POP {r4,r5,pc}
;;;70
ENDP
|L11.172|
0000ac 40000000 DCFD 0x3ff921fb40000000 ; 1.5707962512969971
0000b0 3ff921fb
|L11.180|
0000b4 d2f1a9fc DCFD 0x3f50624dd2f1a9fc ; 0.001
0000b8 3f50624d
AREA ||i.getLine2||, CODE, READONLY, ALIGN=1
getLine2 PROC
;;;70
;;;71 Line getLine2(CoordinatePoints Point1,CoordinatePoints Point2)//两点生成直线
000000 b511 PUSH {r0,r4,lr}
;;;72 {
000002 4604 MOV r4,r0
000004 ed2d0b06 VPUSH {d0-d2}
000008 ed2d8b04 VPUSH {d8-d9}
00000c b08d SUB sp,sp,#0x34
;;;73 Line L;
;;;74 L.p1 = Point1;
00000e a811 ADD r0,sp,#0x44
000010 c807 LDM r0,{r0-r2}
000012 e88d0007 STM sp,{r0-r2}
;;;75 L.p2 = Point2;
000016 a814 ADD r0,sp,#0x50
000018 ab03 ADD r3,sp,#0xc
00001a c807 LDM r0,{r0-r2}
00001c c307 STM r3!,{r0-r2}
;;;76
;;;77 if(L.p1.TarX == L.p2.TarX)//垂直于X轴
00001e ed9d9a00 VLDR s18,[sp,#0]
000022 ed9d0a03 VLDR s0,[sp,#0xc]
000026 eeb49a40 VCMP.F32 s18,s0
00002a eef1fa10 VMRS APSR_nzcv,FPSCR
00002e d102 BNE |L12.54|
;;;78 {
;;;79 L.VerticalWithX = 1;
000030 2001 MOVS r0,#1
000032 9006 STR r0,[sp,#0x18]
000034 e027 B |L12.134|
|L12.54|
;;;80 }
;;;81 else
;;;82 {
;;;83 L.VerticalWithX = 0;
000036 2000 MOVS r0,#0
000038 9006 STR r0,[sp,#0x18]
;;;84 L.k = (L.p1.TarY - L.p2.TarY)/(L.p1.TarX - L.p2.TarX);
00003a eddd9a01 VLDR s19,[sp,#4]
00003e eddd0a04 VLDR s1,[sp,#0x10]
000042 ee391a40 VSUB.F32 s2,s18,s0
000046 ee790ae0 VSUB.F32 s1,s19,s1
00004a ee800a81 VDIV.F32 s0,s1,s2
00004e ee100a10 VMOV r0,s0
000052 f7fffffe BL __aeabi_f2d
000056 ec410b18 VMOV d8,r0,r1
00005a ed8d8b08 VSTR d8,[sp,#0x20]
;;;85 L.b = L.p1.TarY - L.p1.TarX*L.k;
00005e ee190a10 VMOV r0,s18
000062 f7fffffe BL __aeabi_f2d
000066 ec532b18 VMOV r2,r3,d8
00006a f7fffffe BL __aeabi_dmul
00006e ec410b18 VMOV d8,r0,r1
000072 ee190a90 VMOV r0,s19
000076 f7fffffe BL __aeabi_f2d
00007a ec532b18 VMOV r2,r3,d8
00007e f7fffffe BL __aeabi_dsub
000082 e9cd010a STRD r0,r1,[sp,#0x28]
|L12.134|
;;;86 }
;;;87 return L;
000086 2230 MOVS r2,#0x30
000088 4669 MOV r1,sp
00008a 4620 MOV r0,r4
00008c f7fffffe BL __aeabi_memcpy4
;;;88 }
000090 b00d ADD sp,sp,#0x34
000092 ecbd8b04 VPOP {d8-d9}
000096 b007 ADD sp,sp,#0x1c
000098 bd10 POP {r4,pc}
;;;89
ENDP
AREA ||i.getTurnOffPoint||, CODE, READONLY, ALIGN=2
getTurnOffPoint PROC
;;;264 // 由①②表达式得到:(k^2+1)x^2+2[(b-y0)k-x0]x+[(b-y0)^2+x0^2-L^2]=0
;;;265 CoordinatePoints getTurnOffPoint(Line *L,CoordinatePoints *P,float Dis,int TurnFlag,int DirFlag)
000000 e92d43f0 PUSH {r4-r9,lr}
;;;266 {
000004 4604 MOV r4,r0
000006 ed2d8b0a VPUSH {d8-d12}
00000a b083 SUB sp,sp,#0xc
00000c 460d MOV r5,r1
00000e eeb0aa40 VMOV.F32 s20,s0
000012 4617 MOV r7,r2
;;;267 CoordinatePoints TurnOffP;
;;;268 if(L->VerticalWithX == 0)
000014 69a0 LDR r0,[r4,#0x18]
000016 2800 CMP r0,#0
000018 d018 BEQ |L13.76|
;;;269 {
;;;270 double A =pow(L->k, 2) + 1;// A=k^2+1;
;;;271
;;;272 double B = 2 * ((L->b - P->TarY) * L->k - P->TarX);// B=2[(b-y0)k-x0];
;;;273
;;;274 // C=(b-y0)^2+x0^2-L^2
;;;275
;;;276 double C = pow(L->b - P->TarY, 2) + pow(P->TarX, 2) - pow(Dis, 2);
;;;277
;;;278 // 两根x1,x2= [-B±√(B^2-4AC)]/2A
;;;279
;;;280 double x1 = (-B + sqrt(pow(B, 2) - 4 * A * C)) / (2 * A);
;;;281
;;;282 double x2 = (-B - sqrt(pow(B, 2) - 4 * A * C)) / (2 * A);
;;;283
;;;284 if(TurnFlag == 1)
;;;285 {
;;;286 TurnOffP.TarX = x1;
;;;287 TurnOffP.TarY = L->k*TurnOffP.TarX + L->b;
;;;288 }
;;;289 else
;;;290 {
;;;291 TurnOffP.TarX = x2;
;;;292 TurnOffP.TarY = L->k*TurnOffP.TarX + L->b;
;;;293 }
;;;294 }
;;;295 else
;;;296 {
;;;297 if(TurnFlag == 1)//右转
00001a 2f01 CMP r7,#1
00001c d07d BEQ |L13.282|
;;;298 {
;;;299 TurnOffP.TarX = P->TarX;
;;;300 if(DirFlag == -1)//沿X负方向走
;;;301 {
;;;302 TurnOffP.TarY = P->TarY+Dis;
;;;303 }
;;;304 else//沿X正方形走
;;;305 TurnOffP.TarY = P->TarY-Dis;
;;;306 }
;;;307 else//左转
;;;308 {
;;;309 TurnOffP.TarX = P->TarX;
00001e ed950a00 VLDR s0,[r5,#0]
000022 ed8d0a00 VSTR s0,[sp,#0]
;;;310 if(DirFlag == -1)//沿X负方向走
000026 1c5b ADDS r3,r3,#1
000028 d078 BEQ |L13.284|
;;;311 {
;;;312 TurnOffP.TarY = P->TarY-Dis;
;;;313 }
;;;314 else//沿X正方形走
;;;315 TurnOffP.TarY = P->TarY+Dis;
00002a ed950a01 VLDR s0,[r5,#4]
00002e ee300a0a VADD.F32 s0,s0,s20
000032 ed8d0a01 VSTR s0,[sp,#4]
|L13.54|
;;;316 }
;;;317 }
;;;318 return TurnOffP;
000036 ed9d0a00 VLDR s0,[sp,#0]
00003a eddd0a01 VLDR s1,[sp,#4]
00003e ed9d1a02 VLDR s2,[sp,#8]
;;;319 }
000042 b003 ADD sp,sp,#0xc
000044 ecbd8b0a VPOP {d8-d12}
000048 e8bd83f0 POP {r4-r9,pc}
|L13.76|
00004c ed940b08 VLDR d0,[r4,#0x20] ;270
000050 ed9fbb92 VLDR d11,|L13.668|
000054 eeb01a4b VMOV.F32 s2,s22 ;270
000058 eef01a6b VMOV.F32 s3,s23 ;270
00005c f7fffffe BL __hardfp_pow
000060 ed9f1b90 VLDR d1,|L13.676|
000064 ec510b10 VMOV r0,r1,d0 ;270
000068 ec532b11 VMOV r2,r3,d1 ;270
00006c f7fffffe BL __aeabi_dadd
000070 ec410b19 VMOV d9,r0,r1 ;270
000074 6828 LDR r0,[r5,#0] ;272
000076 f7fffffe BL __aeabi_f2d
00007a ec410b18 VMOV d8,r0,r1 ;272
00007e 6868 LDR r0,[r5,#4] ;272
000080 f7fffffe BL __aeabi_f2d
000084 ed941b0a VLDR d1,[r4,#0x28] ;272
000088 ec532b11 VMOV r2,r3,d1 ;272
00008c f7fffffe BL __aeabi_drsub
000090 ed941b08 VLDR d1,[r4,#0x20] ;272
000094 ec532b11 VMOV r2,r3,d1 ;272
000098 f7fffffe BL __aeabi_dmul
00009c ec532b18 VMOV r2,r3,d8 ;272
0000a0 f7fffffe BL __aeabi_dsub
0000a4 ec532b1b VMOV r2,r3,d11 ;272
0000a8 f7fffffe BL __aeabi_dmul
0000ac ec410b18 VMOV d8,r0,r1 ;272
0000b0 ee1a0a10 VMOV r0,s20 ;276
0000b4 f7fffffe BL __aeabi_f2d
0000b8 ec410b10 VMOV d0,r0,r1 ;276
0000bc eeb01a4b VMOV.F32 s2,s22 ;276
0000c0 eef01a6b VMOV.F32 s3,s23 ;276
0000c4 f7fffffe BL __hardfp_pow
0000c8 eeb0aa40 VMOV.F32 s20,s0 ;276
0000cc eef0aa60 VMOV.F32 s21,s1 ;276
0000d0 6828 LDR r0,[r5,#0] ;276
0000d2 f7fffffe BL __aeabi_f2d
0000d6 ec410b10 VMOV d0,r0,r1 ;276
0000da eeb01a4b VMOV.F32 s2,s22 ;276
0000de eef01a6b VMOV.F32 s3,s23 ;276
0000e2 f7fffffe BL __hardfp_pow
0000e6 eeb0ca40 VMOV.F32 s24,s0 ;276
0000ea eef0ca60 VMOV.F32 s25,s1 ;276
0000ee 6868 LDR r0,[r5,#4] ;276
0000f0 f7fffffe BL __aeabi_f2d
0000f4 ed941b0a VLDR d1,[r4,#0x28] ;276
0000f8 ec532b11 VMOV r2,r3,d1 ;276
0000fc f7fffffe BL __aeabi_drsub
000100 ec410b10 VMOV d0,r0,r1 ;276
000104 eeb01a4b VMOV.F32 s2,s22 ;276
000108 eef01a6b VMOV.F32 s3,s23 ;276
00010c f7fffffe BL __hardfp_pow
000110 ec532b1c VMOV r2,r3,d12 ;276
000114 ec510b10 VMOV r0,r1,d0 ;276
000118 e001 B |L13.286|
|L13.282|
00011a e0a4 B |L13.614|
|L13.284|
00011c e0b7 B |L13.654|
|L13.286|
00011e f7fffffe BL __aeabi_dadd
000122 ec532b1a VMOV r2,r3,d10 ;276
000126 f7fffffe BL __aeabi_dsub
00012a ec410b1a VMOV d10,r0,r1 ;276
00012e ec532b1b VMOV r2,r3,d11 ;280
000132 ec510b19 VMOV r0,r1,d9 ;280
000136 f7fffffe BL __aeabi_dmul
00013a ec410b1c VMOV d12,r0,r1 ;280
00013e 4689 MOV r9,r1 ;280
000140 4605 MOV r5,r0 ;280
000142 ed9f0b5a VLDR d0,|L13.684|
000146 ec510b19 VMOV r0,r1,d9 ;280
00014a ec532b10 VMOV r2,r3,d0 ;280
00014e f7fffffe BL __aeabi_dmul
000152 4688 MOV r8,r1 ;280
000154 4606 MOV r6,r0 ;280
000156 ec532b1a VMOV r2,r3,d10 ;280
00015a f7fffffe BL __aeabi_dmul
00015e ec410b19 VMOV d9,r0,r1 ;280
000162 eeb01a4b VMOV.F32 s2,s22 ;280
000166 eef01a6b VMOV.F32 s3,s23 ;280
00016a eeb00a48 VMOV.F32 s0,s16 ;280
00016e eef00a68 VMOV.F32 s1,s17 ;280
000172 f7fffffe BL __hardfp_pow
000176 ec532b19 VMOV r2,r3,d9 ;280
00017a ec510b10 VMOV r0,r1,d0 ;280
00017e f7fffffe BL __aeabi_dsub
000182 ec410b10 VMOV d0,r0,r1 ;280
000186 f7fffffe BL __hardfp_sqrt
00018a ec532b18 VMOV r2,r3,d8 ;280
00018e ec510b10 VMOV r0,r1,d0 ;280
000192 f7fffffe BL __aeabi_dsub
000196 ec532b1c VMOV r2,r3,d12 ;280
00019a f7fffffe BL __aeabi_ddiv
00019e ec410b1c VMOV d12,r0,r1 ;280
0001a2 ec486b10 VMOV d0,r6,r8 ;282
0001a6 ec495b19 VMOV d9,r5,r9 ;282
0001aa ec532b1a VMOV r2,r3,d10 ;282
0001ae ec510b10 VMOV r0,r1,d0 ;282
0001b2 f7fffffe BL __aeabi_dmul
0001b6 ec410b1a VMOV d10,r0,r1 ;282
0001ba eeb01a4b VMOV.F32 s2,s22 ;282
0001be eef01a6b VMOV.F32 s3,s23 ;282
0001c2 eeb00a48 VMOV.F32 s0,s16 ;282
0001c6 eef00a68 VMOV.F32 s1,s17 ;282
0001ca f7fffffe BL __hardfp_pow
0001ce ec532b1a VMOV r2,r3,d10 ;282
0001d2 ec510b10 VMOV r0,r1,d0 ;282
0001d6 f7fffffe BL __aeabi_dsub
0001da ec410b10 VMOV d0,r0,r1 ;282
0001de f7fffffe BL __hardfp_sqrt
0001e2 eeb0aa40 VMOV.F32 s20,s0 ;282
0001e6 eef0aa60 VMOV.F32 s21,s1 ;282
0001ea ec510b18 VMOV r0,r1,d8 ;282
0001ee f7fffffe BL __aeabi_dneg
0001f2 ec532b1a VMOV r2,r3,d10 ;282
0001f6 f7fffffe BL __aeabi_dsub
0001fa ec532b19 VMOV r2,r3,d9 ;282
0001fe f7fffffe BL __aeabi_ddiv
000202 ec410b10 VMOV d0,r0,r1 ;282
000206 2f01 CMP r7,#1 ;284
000208 d016 BEQ |L13.568|
00020a ec510b10 VMOV r0,r1,d0 ;291
00020e f7fffffe BL __aeabi_d2f
000212 9000 STR r0,[sp,#0] ;291
000214 f7fffffe BL __aeabi_f2d
000218 ed941b08 VLDR d1,[r4,#0x20] ;292
00021c ec532b11 VMOV r2,r3,d1 ;292
000220 f7fffffe BL __aeabi_dmul
000224 ed941b0a VLDR d1,[r4,#0x28] ;292
000228 ec532b11 VMOV r2,r3,d1 ;292
00022c f7fffffe BL __aeabi_dadd
000230 f7fffffe BL __aeabi_d2f
000234 9001 STR r0,[sp,#4] ;292
000236 e6fe B |L13.54|
|L13.568|
000238 ec510b1c VMOV r0,r1,d12 ;286
00023c f7fffffe BL __aeabi_d2f
000240 9000 STR r0,[sp,#0] ;286
000242 f7fffffe BL __aeabi_f2d
000246 ed941b08 VLDR d1,[r4,#0x20] ;287
00024a ec532b11 VMOV r2,r3,d1 ;287
00024e f7fffffe BL __aeabi_dmul
000252 ed941b0a VLDR d1,[r4,#0x28] ;287
000256 ec532b11 VMOV r2,r3,d1 ;287
00025a f7fffffe BL __aeabi_dadd
00025e f7fffffe BL __aeabi_d2f
000262 9001 STR r0,[sp,#4] ;287
000264 e6e7 B |L13.54|
|L13.614|
000266 ed950a00 VLDR s0,[r5,#0] ;299
00026a ed8d0a00 VSTR s0,[sp,#0] ;299
00026e 1c5b ADDS r3,r3,#1 ;300
000270 d006 BEQ |L13.640|
000272 ed950a01 VLDR s0,[r5,#4] ;305
000276 ee300a4a VSUB.F32 s0,s0,s20 ;305
00027a ed8d0a01 VSTR s0,[sp,#4] ;305
00027e e6da B |L13.54|
|L13.640|
000280 ed950a01 VLDR s0,[r5,#4] ;302
000284 ee300a0a VADD.F32 s0,s0,s20 ;302
000288 ed8d0a01 VSTR s0,[sp,#4] ;302
00028c e6d3 B |L13.54|
|L13.654|
00028e ed950a01 VLDR s0,[r5,#4] ;312
000292 ee300a4a VSUB.F32 s0,s0,s20 ;312
000296 ed8d0a01 VSTR s0,[sp,#4] ;312
00029a e6cc B |L13.54|
;;;320
ENDP
|L13.668|
00029c 00000000 DCFD 0x4000000000000000 ; 2
0002a0 40000000
|L13.676|
0002a4 00000000 DCFD 0x3ff0000000000000 ; 1
0002a8 3ff00000
|L13.684|
0002ac 00000000 DCFD 0x4010000000000000 ; 4
0002b0 40100000
AREA ||i.getVerticalLine||, CODE, READONLY, ALIGN=2
getVerticalLine PROC
;;;119 //}
;;;120 Line getVerticalLine(Line *L,CoordinatePoints *P)//过P点垂直于L的直线
000000 b570 PUSH {r4-r6,lr}
;;;121 {
000002 4604 MOV r4,r0
000004 ed2d8b02 VPUSH {d8}
000008 b08c SUB sp,sp,#0x30
00000a 460d MOV r5,r1
;;;122 Line VerticalLine;
;;;123 VerticalLine.p1 = *P;
00000c e892000b LDM r2,{r0,r1,r3}
000010 e88d000b STM sp,{r0,r1,r3}
;;;124 if(L->VerticalWithX == 1)
000014 69a8 LDR r0,[r5,#0x18]
000016 2600 MOVS r6,#0
;;;125 {
;;;126 VerticalLine.VerticalWithX = 0;
;;;127 VerticalLine.k = 0;
000018 ed9f1b21 VLDR d1,|L14.160|
00001c 2801 CMP r0,#1 ;124
00001e d00b BEQ |L14.56|
;;;128 VerticalLine.b = P->TarY;
;;;129 }
;;;130 else
;;;131 {
;;;132 if(L->k == 0)
000020 ed950b08 VLDR d0,[r5,#0x20]
000024 ec532b11 VMOV r2,r3,d1
000028 ec510b10 VMOV r0,r1,d0
00002c f7fffffe BL __aeabi_cdcmpeq
000030 d10b BNE |L14.74|
;;;133 {
;;;134 VerticalLine.VerticalWithX = 1;
000032 2001 MOVS r0,#1
000034 9006 STR r0,[sp,#0x18]
000036 e029 B |L14.140|
|L14.56|
000038 9606 STR r6,[sp,#0x18] ;126
00003a ed8d1b08 VSTR d1,[sp,#0x20] ;127
00003e 6850 LDR r0,[r2,#4] ;128
000040 f7fffffe BL __aeabi_f2d
000044 e9cd010a STRD r0,r1,[sp,#0x28] ;128
000048 e020 B |L14.140|
|L14.74|
;;;135 }
;;;136 else
;;;137 {
;;;138 VerticalLine.VerticalWithX = 0;
00004a 9606 STR r6,[sp,#0x18]
;;;139 VerticalLine.k = -1/L->k;
00004c ed950b08 VLDR d0,[r5,#0x20]
000050 ec532b10 VMOV r2,r3,d0
000054 ed9f0b14 VLDR d0,|L14.168|
000058 ec510b10 VMOV r0,r1,d0
00005c f7fffffe BL __aeabi_ddiv
000060 ec410b18 VMOV d8,r0,r1
000064 ed8d8b08 VSTR d8,[sp,#0x20]
;;;140 VerticalLine.b = VerticalLine.p1.TarY - VerticalLine.k*VerticalLine.p1.TarX;
000068 9800 LDR r0,[sp,#0]
00006a f7fffffe BL __aeabi_f2d
00006e ec532b18 VMOV r2,r3,d8
000072 f7fffffe BL __aeabi_dmul
000076 ec410b18 VMOV d8,r0,r1
00007a 9801 LDR r0,[sp,#4]
00007c f7fffffe BL __aeabi_f2d
000080 ec532b18 VMOV r2,r3,d8
000084 f7fffffe BL __aeabi_dsub
000088 e9cd010a STRD r0,r1,[sp,#0x28]
|L14.140|
;;;141 }
;;;142 }
;;;143 return VerticalLine;
00008c 2230 MOVS r2,#0x30
00008e 4669 MOV r1,sp
000090 4620 MOV r0,r4
000092 f7fffffe BL __aeabi_memcpy4
;;;144 }
000096 b00c ADD sp,sp,#0x30
000098 ecbd8b02 VPOP {d8}
00009c bd70 POP {r4-r6,pc}
;;;145 /*求两条直线交点*/
ENDP
00009e 0000 DCW 0x0000
|L14.160|
0000a0 00000000 DCFD 0x0000000000000000 ; 0
0000a4 00000000
|L14.168|
0000a8 00000000 DCFD 0xbff0000000000000 ; -1
0000ac bff00000
AREA ||i.mapping||, CODE, READONLY, ALIGN=1
mapping PROC
;;;2
;;;3 float mapping(float val, float I_Min, float I_Max, float O_Min, float O_Max)
000000 eeb40ae0 VCMPE.F32 s0,s1
;;;4 {
;;;5 val = val < I_Min ? I_Min : val;
000004 eef1fa10 VMRS APSR_nzcv,FPSCR
000008 d201 BCS |L15.14|
00000a eeb00a60 VMOV.F32 s0,s1
|L15.14|
;;;6
;;;7 val = val > I_Max ? I_Max : val;
00000e eeb40ac1 VCMPE.F32 s0,s2
000012 eef1fa10 VMRS APSR_nzcv,FPSCR
000016 dd01 BLE |L15.28|
000018 eeb00a41 VMOV.F32 s0,s2
|L15.28|
;;;8
;;;9 return ((val - I_Min) * (O_Max - O_Min) / (I_Max - I_Min)) + O_Min;
00001c ee322a61 VSUB.F32 s4,s4,s3
000020 ee300a60 VSUB.F32 s0,s0,s1
000024 ee311a60 VSUB.F32 s2,s2,s1
000028 ee200a02 VMUL.F32 s0,s0,s4
00002c eec00a01 VDIV.F32 s1,s0,s2
000030 ee300aa1 VADD.F32 s0,s1,s3
;;;10 }
000034 4770 BX lr
;;;11 float CalculatingDirectionAngle(CoordinatePoints PointOne, CoordinatePoints PointTwo)
ENDP
AREA ||.data||, DATA, ALIGN=2
DisPB
000000 00000000 DCFS 0x00000000 ; 0
DirFlag
DCD 0xffffffff
Angle
000008 00000000 DCFS 0x00000000 ; 0
;*** Start embedded assembler ***
#line 1 "..\\..\\User\\CONTROLFUNCTION\\Calculation.c"
AREA ||.rev16_text||, CODE
THUMB
EXPORT |__asm___13_Calculation_c_mapping____REV16|
#line 129 "..\\..\\Libraries\\CMSIS\\Include\\core_cmInstr.h"
|__asm___13_Calculation_c_mapping____REV16| PROC
#line 130
rev16 r0, r0
bx lr
ENDP
AREA ||.revsh_text||, CODE
THUMB
EXPORT |__asm___13_Calculation_c_mapping____REVSH|
#line 144
|__asm___13_Calculation_c_mapping____REVSH| PROC
#line 145
revsh r0, r0
bx lr
ENDP
AREA ||.rrx_text||, CODE
THUMB
EXPORT |__asm___13_Calculation_c_mapping____RRX|
#line 300
|__asm___13_Calculation_c_mapping____RRX| PROC
#line 301
rrx r0, r0
bx lr
ENDP
;*** End embedded assembler ***