user_canupdate.txt
50.6 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
; 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\user_canupdate.o --asm_dir=.\Flash\List\ --list_dir=.\Flash\List\ --depend=.\flash\obj\user_canupdate.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.\RTE\_Flash -IC:\Users\软件部\AppData\Local\Arm\Packs\ARM\CMSIS\5.5.1\CMSIS\Core\Include -IC:\Users\软件部\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\user_canupdate.crf ..\..\User\parameter\user_Canupdate.c]
THUMB
AREA ||i.AppTaskCanUpdate||, CODE, READONLY, ALIGN=2
AppTaskCanUpdate PROC
;;;258
;;;259 void AppTaskCanUpdate(void *p_arg)
000000 ed2d8b02 VPUSH {d8}
;;;260 {
000004 b084 SUB sp,sp,#0x10
;;;261
;;;262 OS_ERR p_err;
;;;263 if(CompileSwitch)
;;;264 InitDriverInfo();//初始化驱动数据
;;;265
;;;266 short LiftSpeedOne = 0,LiftSpeedTwo = 0;
;;;267
;;;268
;;;269 CAN2_Send_Msg_Extend(CYLINDER_SEND1,ResetTransformer,8,30);
000006 231e MOVS r3,#0x1e
000008 2208 MOVS r2,#8
00000a 494d LDR r1,|L1.320|
00000c 484d LDR r0,|L1.324|
00000e f7fffffe BL CAN2_Send_Msg_Extend
;;;270 CAN2_Send_Msg_Extend(CYLINDER_SEND2,ResetTransformer,8,30);
000012 231e MOVS r3,#0x1e
000014 2208 MOVS r2,#8
000016 494a LDR r1,|L1.320|
000018 484b LDR r0,|L1.328|
00001a f7fffffe BL CAN2_Send_Msg_Extend
;;;271 //CAN2_Send_Msg_Extend(CYLINDER_SEND3,ResetTransformer,8,30);
;;;272
;;;273 while(1)
;;;274 {
;;;275 if(CompileSwitch)
;;;276 {
;;;277 /****************************行走驱动************************************************/
;;;278 if(pSetup[SETUP_MOTOR_NUM] > 0)
;;;279 {
;;;280 OSTimeDly(1, OS_OPT_TIME_PERIODIC, &p_err);
;;;281 DriverFunction(&Driver_first_motor);//创建行走驱动实例
;;;282 }
;;;283 if(pSetup[SETUP_MOTOR_NUM] > 1)
;;;284 {
;;;285 DriverFunction(&Driver_second_motor);
;;;286 }
;;;287 if(pSetup[SETUP_MOTOR_NUM] > 2)
;;;288 {
;;;289 OSTimeDly(1, OS_OPT_TIME_PERIODIC, &p_err);
;;;290 DriverFunction(&Driver_third_motor);
;;;291 }
;;;292 if(pSetup[SETUP_MOTOR_NUM] > 3)
;;;293 {
;;;294 DriverFunction(&Driver_fourth_motor);
;;;295 }
;;;296
;;;297 if(pSetup[SETUP_MOTOR_NUM] > 0)
;;;298 {
;;;299 OSTimeDly(2, OS_OPT_TIME_PERIODIC, &p_err);
;;;300 DriverState(&Driver_first_motor,10.0f);//创建行走读状态实例 保证发送速度指令之间无延迟
;;;301 }
;;;302 if(pSetup[SETUP_MOTOR_NUM] > 1)
;;;303 {
;;;304 DriverState(&Driver_second_motor,10.0f);
;;;305 }
;;;306 if(pSetup[SETUP_MOTOR_NUM] > 2)
;;;307 {
;;;308 OSTimeDly(2, OS_OPT_TIME_PERIODIC, &p_err);
;;;309 DriverState(&Driver_third_motor,10.0f);
;;;310 }
;;;311 if(pSetup[SETUP_MOTOR_NUM] > 3)
;;;312 {
;;;313 DriverState(&Driver_fourth_motor,10.0f);
;;;314 }
;;;315
;;;316 /****************************转向驱动************************************************/
;;;317 if(pSetup[SETUP_STEERING_NUM] > 0)
;;;318 {
;;;319 OSTimeDly(1, OS_OPT_TIME_PERIODIC, &p_err);
;;;320 steeringFunction(&Driver_first_steering,&Driver_first_motor);//创建转向驱动实例
;;;321 }
;;;322 if(pSetup[SETUP_STEERING_NUM] > 1)
;;;323 {
;;;324 steeringFunction(&Driver_second_steering,&Driver_second_motor);
;;;325 }
;;;326 if(pSetup[SETUP_STEERING_NUM] > 2)
;;;327 {
;;;328 OSTimeDly(1, OS_OPT_TIME_PERIODIC, &p_err);
;;;329 steeringFunction(&Driver_third_steering,&Driver_third_motor);
;;;330 }
;;;331 if(pSetup[SETUP_STEERING_NUM] > 3)
;;;332 {
;;;333 steeringFunction(&Driver_fourth_steering,&Driver_fourth_motor);
;;;334 }
;;;335
;;;336 if(pSetup[SETUP_STEERING_NUM] > 0)
;;;337 {
;;;338 OSTimeDly(2, OS_OPT_TIME_PERIODIC, &p_err);
;;;339 DriverState(&Driver_first_steering,0.01f);//创建转向驱动实例
;;;340 }
;;;341 if(pSetup[SETUP_STEERING_NUM] > 1)
;;;342 {
;;;343 DriverState(&Driver_second_steering,0.01f);
;;;344 }
;;;345 if(pSetup[SETUP_STEERING_NUM] > 2)
;;;346 {
;;;347 OSTimeDly(2, OS_OPT_TIME_PERIODIC, &p_err);
;;;348 DriverState(&Driver_third_steering,0.01f);
;;;349 }
;;;350 if(pSetup[SETUP_STEERING_NUM] > 3)
;;;351 {
;;;352 DriverState(&Driver_fourth_steering,0.01f);
;;;353 }
;;;354 /****************************举升驱动************************************************/
;;;355 if(pSetup[SETUP_LIFTER_NUM] > 0)
;;;356 {
;;;357 OSTimeDly(1, OS_OPT_TIME_PERIODIC, &p_err);
;;;358 DriverFunction(&Driver_first_lifter);//创建举升驱动实例
;;;359 }
;;;360 if(pSetup[SETUP_LIFTER_NUM] > 1)
;;;361 {
;;;362 DriverFunction(&Driver_second_lifter);
;;;363 }
;;;364 if(pSetup[SETUP_LIFTER_NUM] > 2)
;;;365 {
;;;366 OSTimeDly(1, OS_OPT_TIME_PERIODIC, &p_err);
;;;367 DriverFunction(&Driver_third_lifter);
;;;368 }
;;;369 if(pSetup[SETUP_LIFTER_NUM] > 3)
;;;370 {
;;;371 DriverFunction(&Driver_fourth_lifter);
;;;372 }
;;;373
;;;374 if(pSetup[SETUP_LIFTER_NUM] > 0)
;;;375 {
;;;376 OSTimeDly(2, OS_OPT_TIME_PERIODIC, &p_err);
;;;377 DriverState(&Driver_first_lifter,10.0f);//创建举升驱动实例
;;;378 }
;;;379 if(pSetup[SETUP_LIFTER_NUM] > 1)
;;;380 {
;;;381 DriverState(&Driver_second_lifter,10.0f);
;;;382 }
;;;383 if(pSetup[SETUP_LIFTER_NUM] > 2)
;;;384 {
;;;385 OSTimeDly(2, OS_OPT_TIME_PERIODIC, &p_err);
;;;386 DriverState(&Driver_third_lifter,10.0f);
;;;387 }
;;;388 if(pSetup[SETUP_LIFTER_NUM] > 3)
;;;389 {
;;;390 DriverState(&Driver_fourth_lifter,10.0f);
;;;391 }
;;;392 /****************************移轴驱动************************************************/
;;;393 if(pSetup[SETUP_SHIFTER_NUM] > 0)
;;;394 {
;;;395 OSTimeDly(1, OS_OPT_TIME_PERIODIC, &p_err);
;;;396 DriverFunction(&Driver_first_shifter);//创建移轴驱动实例
;;;397 }
;;;398 if(pSetup[SETUP_SHIFTER_NUM] > 1)
;;;399 {
;;;400 DriverFunction(&Driver_second_shifter);
;;;401 }
;;;402
;;;403 if(pSetup[SETUP_SHIFTER_NUM] > 2)
;;;404 {
;;;405 OSTimeDly(1, OS_OPT_TIME_PERIODIC, &p_err);
;;;406 DriverFunction(&Driver_third_shifter);
;;;407 }
;;;408
;;;409 if(pSetup[SETUP_SHIFTER_NUM] > 0)
;;;410 {
;;;411 OSTimeDly(2, OS_OPT_TIME_PERIODIC, &p_err);
;;;412 DriverState(&Driver_first_shifter,10.0f);//创建移轴读状态实例
;;;413 }
;;;414
;;;415 if(pSetup[SETUP_SHIFTER_NUM] > 1)
;;;416 {
;;;417 DriverState(&Driver_second_shifter,10.0f);
;;;418 }
;;;419 if(pSetup[SETUP_SHIFTER_NUM] > 2)
;;;420 {
;;;421 OSTimeDly(2, OS_OPT_TIME_PERIODIC, &p_err);
;;;422 DriverState(&Driver_third_shifter,10.0f);
;;;423 }
;;;424 }
;;;425
;;;426 //电缸
;;;427 if(pSetup[SETUP_ELECCYLINDER_NUM] > 0)
00001e f8df812c LDR r8,|L1.332|
;;;428 {
;;;429 GetElecHDFeedBackData();
;;;430 LiftSpeedOne = (short)HandlePlcData.RecvPlcData.FirstLiftSetSpeed;
000022 4f4b LDR r7,|L1.336|
000024 2400 MOVS r4,#0
;;;431 LiftSpeedTwo = (short)HandlePlcData.RecvPlcData.SecondLiftSetSpeed;
;;;432
;;;433 TransformerFun(LiftSpeedOne,LiftSpeedTwo);
;;;434 }
;;;435
;;;436 //改造车型
;;;437 if(pSetup[SETUP_REMODEL_AGV_OPEN])
;;;438 {
;;;439 RemodelThrModel.DccelerationRamp = 20;
;;;440 RemodelThrModel.AccelerationRamp = 20;
;;;441
;;;442 CAN2_Send_Msg(LIFT_SETTRING_ONE_ID,LiftEncoderPosBack,8,0);
;;;443 //if(ControlInputValue.agvControlStatus)
;;;444 RemodelTheModelSendCommend(&RemodelThrModel);
;;;445
;;;446 ControlInputValue.AgvActualFirstSpeed = (short)RmodelTheModelReadData(&RemodelThrModel);
;;;447 ControlInputValue.AgvFirstRudderWheelAngle = (float)(RemodelThrModelBack.GetAnglePosition) / 100.0f;
;;;448
;;;449 float DeltaTime = ((float)TIM_GetCounter(TIM3)) / 2000.0f;//清空计时器
;;;450 TIM_SetCounter(TIM3,0);//清空计时器
;;;451
;;;452 ControlInputValue.AgvActualFirstDis += (ControlInputValue.AgvActualFirstSpeed * DeltaTime);
;;;453
;;;454 unsigned char ChargeBUFF[8] = {0};
;;;455
;;;456 //充电信号
;;;457 if(HandlePlcData.RecvPlcData.agvChargeSignal)
;;;458 {
;;;459 ChargeBUFF[0] = 0x0;
;;;460 ChargeBUFF[1] = 0x1;
000026 2601 MOVS r6,#1
;;;461 ChargeBUFF[2] = 0x0;
;;;462 ChargeBUFF[3] = 0x1;
;;;463 ChargeBUFF[4] = 0x1;
;;;464 ChargeBUFF[5] = 0x0;
;;;465 ChargeBUFF[6] = 0x0;
;;;466 ChargeBUFF[7] = 0x0;
;;;467
;;;468 CAN2_Send_Msg(CHARGE_CTR,ChargeBUFF,8,0);
000028 f44f7988 MOV r9,#0x110
|L1.44|
00002c f8d80000 LDR r0,[r8,#0] ;427 ; pSetup
000030 f8d00084 LDR r0,[r0,#0x84] ;427
000034 b138 CBZ r0,|L1.70|
000036 f7fffffe BL GetElecHDFeedBackData
00003a f9b70018 LDRSH r0,[r7,#0x18] ;430 ; HandlePlcData
00003e f9b7101a LDRSH r1,[r7,#0x1a] ;431 ; HandlePlcData
000042 f7fffffe BL TransformerFun
|L1.70|
000046 f8d80000 LDR r0,[r8,#0] ;437 ; pSetup
00004a f8d00168 LDR r0,[r0,#0x168] ;437
00004e 2800 CMP r0,#0 ;437
000050 d070 BEQ |L1.308|
000052 4940 LDR r1,|L1.340|
000054 2014 MOVS r0,#0x14 ;439
000056 80c8 STRH r0,[r1,#6] ;439
000058 8088 STRH r0,[r1,#4] ;440
00005a 4939 LDR r1,|L1.320|
00005c 2300 MOVS r3,#0 ;442
00005e 2208 MOVS r2,#8 ;442
000060 3908 SUBS r1,r1,#8 ;442
000062 f2406014 MOV r0,#0x614 ;442
000066 f7fffffe BL CAN2_Send_Msg
00006a 483a LDR r0,|L1.340|
00006c f7fffffe BL RemodelTheModelSendCommend
000070 4838 LDR r0,|L1.340|
000072 f7fffffe BL RmodelTheModelReadData
000076 eebd0ac0 VCVT.S32.F32 s0,s0 ;446
00007a 4d37 LDR r5,|L1.344|
00007c ee100a10 VMOV r0,s0 ;446
000080 81a8 STRH r0,[r5,#0xc] ;446
000082 4836 LDR r0,|L1.348|
000084 eddf0a36 VLDR s1,|L1.352|
000088 f9b00002 LDRSH r0,[r0,#2] ;447 ; RemodelThrModelBack
00008c ee000a10 VMOV s0,r0 ;447
000090 eeb80ac0 VCVT.F32.S32 s0,s0 ;447
000094 ee801a20 VDIV.F32 s2,s0,s1 ;447
000098 ed851a09 VSTR s2,[r5,#0x24] ;447
00009c f8dfa0c4 LDR r10,|L1.356|
0000a0 4650 MOV r0,r10 ;449
0000a2 f7fffffe BL TIM_GetCounter
0000a6 ee000a10 VMOV s0,r0 ;449
0000aa eddf0a2f VLDR s1,|L1.360|
0000ae eeb80a40 VCVT.F32.U32 s0,s0 ;449
0000b2 ee808a20 VDIV.F32 s16,s0,s1 ;449
0000b6 2100 MOVS r1,#0 ;450
0000b8 4650 MOV r0,r10 ;450
0000ba f7fffffe BL TIM_SetCounter
0000be f9b5000c LDRSH r0,[r5,#0xc] ;452 ; ControlInputValue
0000c2 ed950a05 VLDR s0,[r5,#0x14] ;452
0000c6 ee000a90 VMOV s1,r0 ;452
0000ca eeb80ac0 VCVT.F32.S32 s0,s0 ;452
0000ce eef80ae0 VCVT.F32.S32 s1,s1 ;452
0000d2 ee000a88 VMLA.F32 s0,s1,s16 ;452
0000d6 eebd0ac0 VCVT.S32.F32 s0,s0 ;452
0000da ed850a05 VSTR s0,[r5,#0x14] ;452
0000de 9401 STR r4,[sp,#4] ;454
0000e0 9402 STR r4,[sp,#8] ;454
0000e2 f897003c LDRB r0,[r7,#0x3c] ;457 ; HandlePlcData
0000e6 b1b0 CBZ r0,|L1.278|
0000e8 f88d4004 STRB r4,[sp,#4] ;459
0000ec f88d6005 STRB r6,[sp,#5] ;460
0000f0 f88d4006 STRB r4,[sp,#6] ;461
0000f4 f88d6007 STRB r6,[sp,#7] ;462
0000f8 f88d6008 STRB r6,[sp,#8] ;463
0000fc f88d4009 STRB r4,[sp,#9] ;464
000100 f88d400a STRB r4,[sp,#0xa] ;465
000104 f88d400b STRB r4,[sp,#0xb] ;466
000108 2300 MOVS r3,#0
00010a 2208 MOVS r2,#8
00010c a901 ADD r1,sp,#4
00010e 4648 MOV r0,r9
000110 f7fffffe BL CAN2_Send_Msg
000114 e00e B |L1.308|
|L1.278|
;;;469 }
;;;470 else
;;;471 {
;;;472 ChargeBUFF[0] = 0x0;
000116 f88d4004 STRB r4,[sp,#4]
;;;473 ChargeBUFF[1] = 0x0;
00011a f88d4005 STRB r4,[sp,#5]
;;;474 ChargeBUFF[2] = 0x1;
00011e f88d6006 STRB r6,[sp,#6]
;;;475 ChargeBUFF[3] = 0x1;
000122 f88d6007 STRB r6,[sp,#7]
;;;476 ChargeBUFF[4] = 0x0;
;;;477 ChargeBUFF[5] = 0x0;
;;;478 ChargeBUFF[6] = 0x0;
;;;479 ChargeBUFF[7] = 0x0;
000126 9402 STR r4,[sp,#8]
;;;480
;;;481 CAN2_Send_Msg(CHARGE_CTR,ChargeBUFF,8,0);
000128 2300 MOVS r3,#0
00012a 2208 MOVS r2,#8
00012c a901 ADD r1,sp,#4
00012e 4648 MOV r0,r9
000130 f7fffffe BL CAN2_Send_Msg
|L1.308|
;;;482
;;;483 }
;;;484 }
;;;485 OSTimeDly(8, OS_OPT_TIME_PERIODIC, &p_err);
000134 2108 MOVS r1,#8
000136 aa03 ADD r2,sp,#0xc
000138 4608 MOV r0,r1
00013a f7fffffe BL OSTimeDly
00013e e775 B |L1.44|
;;;486 }
;;;487 }
;;;488
ENDP
|L1.320|
DCD ||.data||+0x10
|L1.324|
DCD 0x18ef1301
|L1.328|
DCD 0x18ef1401
|L1.332|
DCD pSetup
|L1.336|
DCD HandlePlcData
|L1.340|
DCD ||.bss||
|L1.344|
DCD ControlInputValue
|L1.348|
DCD RemodelThrModelBack
|L1.352|
000160 42c80000 DCFS 0x42c80000 ; 100
|L1.356|
DCD 0x40000400
|L1.360|
000168 44fa0000 DCFS 0x44fa0000 ; 2000
AREA ||i.DriverFunction||, CODE, READONLY, ALIGN=1
DriverFunction PROC
;;;58
;;;59 void DriverFunction(DriverStruct *Motor)//行走 举升 移轴电机
000000 b510 PUSH {r4,lr}
;;;60 {
000002 4604 MOV r4,r0
;;;61 if(0)//如果拍了急停信号
;;;62 {
;;;63 Motor->Private.initStep = 0;
;;;64 }
;;;65
;;;66 if(Motor->Private.initStep != 255)//*****************************************如果未初始化先初始化
000004 f8940050 LDRB r0,[r4,#0x50]
000008 28ff CMP r0,#0xff
00000a d004 BEQ |L2.22|
;;;67 {
;;;68 init_driver(Motor);//非阻塞函数
00000c 4620 MOV r0,r4
00000e e8bd4010 POP {r4,lr}
000012 f7ffbffe B.W init_driver
|L2.22|
;;;69 }
;;;70 else//**************************************************************************无其他问题则发速度 读速度等
;;;71 {
;;;72 if(set_speed(Motor) == 1)//返回0证明发了指令 则本轮不要发指令 否则会造成上一条指令无法匹配
000016 4620 MOV r0,r4
000018 f7fffffe BL set_speed
00001c 2801 CMP r0,#1
00001e d10f BNE |L2.64|
;;;73 {
;;;74 if(Motor->Private.sendStep == 0)
000020 f8940051 LDRB r0,[r4,#0x51]
000024 b130 CBZ r0,|L2.52|
;;;75 {
;;;76 get_actual_speed(Motor);//获取速度
;;;77 Motor->Private.sendStep = 1;
;;;78 }
;;;79 else
;;;80 {
;;;81 if(Motor->Command.clrPos != 1)
000026 6960 LDR r0,[r4,#0x14]
000028 2801 CMP r0,#1
00002a d00a BEQ |L2.66|
;;;82 {
;;;83 get_actual_pos(Motor);//获取位置
00002c 4620 MOV r0,r4
00002e f7fffffe BL get_actual_pos
000032 e009 B |L2.72|
|L2.52|
000034 4620 MOV r0,r4 ;76
000036 f7fffffe BL get_actual_speed
00003a 2001 MOVS r0,#1 ;77
00003c f8840051 STRB r0,[r4,#0x51] ;77
|L2.64|
;;;84 }
;;;85 else
;;;86 {
;;;87 clr_actual_pos(Motor);//清除位置
;;;88 }
;;;89 Motor->Private.sendStep = 0;
;;;90 }
;;;91 }
;;;92 }
;;;93 }
000040 bd10 POP {r4,pc}
|L2.66|
000042 4620 MOV r0,r4 ;87
000044 f7fffffe BL clr_actual_pos
|L2.72|
000048 2000 MOVS r0,#0 ;89
00004a f8840051 STRB r0,[r4,#0x51] ;89
00004e bd10 POP {r4,pc}
;;;94
ENDP
AREA ||i.DriverState||, CODE, READONLY, ALIGN=2
DriverState PROC
;;;13
;;;14 void DriverState(DriverStruct *Motor,float speedThreshold)
000000 b510 PUSH {r4,lr}
;;;15 {
000002 4604 MOV r4,r0
000004 ed2d8b04 VPUSH {d8-d9}
000008 b084 SUB sp,sp,#0x10
00000a eeb09a40 VMOV.F32 s18,s0
;;;16 Motor->Private.readStateCount++;
00000e 3452 ADDS r4,r4,#0x52
000010 78a0 LDRB r0,[r4,#2]
000012 1c40 ADDS r0,r0,#1
000014 b2c0 UXTB r0,r0
000016 70a0 STRB r0,[r4,#2]
;;;17 Motor->Private.sendHeartBeatCount++;
000018 7861 LDRB r1,[r4,#1]
00001a 1c49 ADDS r1,r1,#1
00001c b2ca UXTB r2,r1
00001e 7062 STRB r2,[r4,#1]
;;;18 Motor->Private.readAmpereCount++;
000020 7821 LDRB r1,[r4,#0]
000022 1c49 ADDS r1,r1,#1
000024 b2c9 UXTB r1,r1
000026 f8041952 STRB r1,[r4],#-0x52
;;;19 if(Motor->Private.readAmpereCount > 30)
00002a 2300 MOVS r3,#0
00002c 291e CMP r1,#0x1e
00002e d91a BLS |L3.102|
;;;20 {
;;;21 Motor->Private.readAmpereCount = 0;
000030 f8843052 STRB r3,[r4,#0x52]
;;;22 if(fabs(Motor->Command.speed) > 0.01f)
000034 6860 LDR r0,[r4,#4]
000036 f7fffffe BL __aeabi_f2d
00003a ec410b10 VMOV d0,r0,r1
00003e f7fffffe BL __hardfp_fabs
000042 ed9f1b38 VLDR d1,|L3.292|
000046 ec510b10 VMOV r0,r1,d0
00004a ec532b11 VMOV r2,r3,d1
00004e f7fffffe BL __aeabi_cdrcmple
000052 d203 BCS |L3.92|
;;;23 {
;;;24 get_driver_ampere(Motor);//获取状态
000054 4620 MOV r0,r4
000056 f7fffffe BL get_driver_ampere
00005a e016 B |L3.138|
|L3.92|
;;;25 }
;;;26 else
;;;27 {
;;;28 Motor->Public.ampere = 0;
00005c ed9f0a33 VLDR s0,|L3.300|
000060 ed840a1d VSTR s0,[r4,#0x74]
000064 e011 B |L3.138|
|L3.102|
;;;29 }
;;;30 }
;;;31 else if(Motor->Private.readStateCount > 15)//已经给驱动发的速度和实际驱动反馈的速度差值大的时候查询驱动状态
000066 280f CMP r0,#0xf
000068 d905 BLS |L3.118|
;;;32 {
;;;33 Motor->Private.readStateCount = 0;
00006a f8843054 STRB r3,[r4,#0x54]
;;;34 get_driver_state(Motor);//获取状态
00006e 4620 MOV r0,r4
000070 f7fffffe BL get_driver_state
000074 e009 B |L3.138|
|L3.118|
;;;35 }
;;;36 else if(Motor->Private.sendHeartBeatCount > 14 || (*Motor->driverShareErrorInfo))
000076 2a0e CMP r2,#0xe
000078 d802 BHI |L3.128|
00007a 6820 LDR r0,[r4,#0]
00007c 6800 LDR r0,[r0,#0]
00007e b120 CBZ r0,|L3.138|
|L3.128|
;;;37 {
;;;38 Motor->Private.sendHeartBeatCount = 0;
000080 f8843053 STRB r3,[r4,#0x53]
;;;39 send_heartbeat(Motor);//发送心跳
000084 4620 MOV r0,r4
000086 f7fffffe BL send_heartbeat
|L3.138|
;;;40 }
;;;41
;;;42 if(Motor->Private.realEnable == 0 && (fabs(Motor->Command.speed) > speedThreshold))//如果还未真正使能
00008a 6ae0 LDR r0,[r4,#0x2c]
00008c 2800 CMP r0,#0
00008e d141 BNE |L3.276|
000090 ee190a10 VMOV r0,s18
000094 f7fffffe BL __aeabi_f2d
000098 ec410b18 VMOV d8,r0,r1
00009c 6860 LDR r0,[r4,#4]
00009e f7fffffe BL __aeabi_f2d
0000a2 ec410b10 VMOV d0,r0,r1
0000a6 f7fffffe BL __hardfp_fabs
0000aa ec532b18 VMOV r2,r3,d8
0000ae ec510b10 VMOV r0,r1,d0
0000b2 f7fffffe BL __aeabi_cdrcmple
0000b6 d22d BCS |L3.276|
;;;43 {
;;;44 if(fabs(Motor->Public.encoderSpeed) > speedThreshold && Motor->Private.enable == 1)//如果已经发了使能指令和速度并且有返回速度
0000b8 ee190a10 VMOV r0,s18
0000bc f7fffffe BL __aeabi_f2d
0000c0 ec410b18 VMOV d8,r0,r1
0000c4 6ea0 LDR r0,[r4,#0x68]
0000c6 f7fffffe BL __aeabi_f2d
0000ca ec410b10 VMOV d0,r0,r1
0000ce f7fffffe BL __hardfp_fabs
0000d2 ec532b18 VMOV r2,r3,d8
0000d6 ec510b10 VMOV r0,r1,d0
0000da f7fffffe BL __aeabi_cdrcmple
0000de d202 BCS |L3.230|
0000e0 6a60 LDR r0,[r4,#0x24]
0000e2 2801 CMP r0,#1
0000e4 d01a BEQ |L3.284|
|L3.230|
;;;45 {
;;;46 Motor->Private.realEnable = 1;//真正使能信号置1
;;;47 }
;;;48 else
;;;49 {
;;;50 OS_ERR p_err;
;;;51 OSTimeDly(1, OS_OPT_TIME_PERIODIC, &p_err);
0000e6 aa03 ADD r2,sp,#0xc
0000e8 2108 MOVS r1,#8
0000ea 2001 MOVS r0,#1
0000ec f7fffffe BL OSTimeDly
;;;52 Uart_Printf(COM1,"id:%x speed: %.1f\r\n",Motor->Private.driverID,Motor->Public.encoderSpeed);
0000f0 6ea0 LDR r0,[r4,#0x68]
0000f2 f7fffffe BL __aeabi_f2d
0000f6 e9cd0100 STRD r0,r1,[sp,#0]
0000fa 8fa2 LDRH r2,[r4,#0x3c]
0000fc a10c ADR r1,|L3.304|
0000fe 2001 MOVS r0,#1
000100 f7fffffe BL Uart_Printf
;;;53 get_actual_speed(Motor);//获取速度
000104 4620 MOV r0,r4
000106 f7fffffe BL get_actual_speed
;;;54 OSTimeDly(1, OS_OPT_TIME_PERIODIC, &p_err);
00010a aa03 ADD r2,sp,#0xc
00010c 2108 MOVS r1,#8
00010e 2001 MOVS r0,#1
000110 f7fffffe BL OSTimeDly
|L3.276|
;;;55 }
;;;56 }
;;;57 }
000114 b004 ADD sp,sp,#0x10
000116 ecbd8b04 VPOP {d8-d9}
00011a bd10 POP {r4,pc}
|L3.284|
00011c 2001 MOVS r0,#1 ;46
00011e 62e0 STR r0,[r4,#0x2c] ;46
000120 e7f8 B |L3.276|
;;;58
ENDP
000122 0000 DCW 0x0000
|L3.292|
000124 40000000 DCFD 0x3f847ae140000000 ; 0.0099999997764825821
000128 3f847ae1
|L3.300|
00012c 00000000 DCFS 0x00000000 ; 0
|L3.304|
000130 6964a3ba DCB "id",163,186,"%x speed: %.1f\r\n",0
000134 25782073
000138 70656564
00013c 3a20252e
000140 31660d0a
000144 00
000145 00 DCB 0
000146 00 DCB 0
000147 00 DCB 0
AREA ||i.RmodelTheModelReadData||, CODE, READONLY, ALIGN=2
RmodelTheModelReadData PROC
;;;250 //转换速度
;;;251 float RmodelTheModelReadData(agvRemodelThrModel *RemodelThrModel)
000000 480b LDR r0,|L4.48|
;;;252 {
;;;253 return ((float)(RemodelThrModelBack.GetMoveRPMspeed) / WHEEL_RADIO / 60.0f) * PI * WHEEL_DIAMETER;
000002 eeb31a0c VMOV.F32 s2,#28.00000000
000006 f9b00000 LDRSH r0,[r0,#0] ; RemodelThrModelBack
00000a ee000a10 VMOV s0,r0
00000e eef80ac0 VCVT.F32.S32 s1,s0
000012 ee800a81 VDIV.F32 s0,s1,s2
000016 ed9f1a07 VLDR s2,|L4.52|
00001a eec00a01 VDIV.F32 s1,s0,s2
00001e ed9f0a06 VLDR s0,|L4.56|
000022 ee200a80 VMUL.F32 s0,s1,s0
000026 eddf0a05 VLDR s1,|L4.60|
00002a ee200a20 VMUL.F32 s0,s0,s1
;;;254 }
00002e 4770 BX lr
;;;255
ENDP
|L4.48|
DCD RemodelThrModelBack
|L4.52|
000034 42700000 DCFS 0x42700000 ; 60
|L4.56|
000038 40490fda DCFS 0x40490fda ; 3.1415925025939941
|L4.60|
00003c 43660000 DCFS 0x43660000 ; 230
AREA ||i.TransformerFun||, CODE, READONLY, ALIGN=2
TransformerFun PROC
;;;113 //电缸控制函数
;;;114 void TransformerFun(short speedOne,short speedTwo)
000000 e92d4ff0 PUSH {r4-r11,lr}
;;;115 {
000004 b087 SUB sp,sp,#0x1c
000006 4604 MOV r4,r0
000008 460d MOV r5,r1
;;;116 unsigned char buffOne[8] = {0X00,0X00,0X00,0X10,0X00,0X00,0X00,0X00};
00000a a0b3 ADR r0,|L5.728|
00000c c803 LDM r0,{r0,r1}
00000e e9cd0105 STRD r0,r1,[sp,#0x14]
;;;117 unsigned char buffTwo[8] = {0X00,0X00,0X00,0X10,0X00,0X00,0X00,0X00};
000012 a0b1 ADR r0,|L5.728|
000014 c803 LDM r0,{r0,r1}
000016 e9cd0103 STRD r0,r1,[sp,#0xc]
;;;118 unsigned char DisEnable[] = {0X00,0X00,0X14,0X00,0X00,0X00,0X00,0X00};
00001a a0b1 ADR r0,|L5.736|
00001c c803 LDM r0,{r0,r1}
00001e e9cd0101 STRD r0,r1,[sp,#4]
;;;119
;;;120 short distanceOne = 0,ss1 = 0;
;;;121 short distanceTwo = 0,ss2 = 0;
;;;122
;;;123 static int i = 51,sssssss = 0;
;;;124 static short CurSpeed = 0,LastSpeed = 0;
;;;125
;;;126 CurSpeed = speedOne;
000022 4eb1 LDR r6,|L5.744|
000024 8034 STRH r4,[r6,#0]
;;;127 if(speedOne == 0)
000026 2c00 CMP r4,#0
000028 d106 BNE |L5.56|
;;;128 {
;;;129 CAN2_Send_Msg_Extend(CYLINDER_SEND1,ResetTransformer,8,30);
00002a 231e MOVS r3,#0x1e
00002c 2208 MOVS r2,#8
00002e f1060110 ADD r1,r6,#0x10
000032 48ae LDR r0,|L5.748|
000034 f7fffffe BL CAN2_Send_Msg_Extend
|L5.56|
;;;130 }
;;;131 if(speedTwo == 0)
000038 b935 CBNZ r5,|L5.72|
;;;132 {
;;;133 CAN2_Send_Msg_Extend(CYLINDER_SEND2,ResetTransformer,8,30);
00003a 49ab LDR r1,|L5.744|
00003c 231e MOVS r3,#0x1e
00003e 2208 MOVS r2,#8
000040 3110 ADDS r1,r1,#0x10
000042 48ab LDR r0,|L5.752|
000044 f7fffffe BL CAN2_Send_Msg_Extend
|L5.72|
;;;134 }
;;;135
;;;136 LastSpeed = CurSpeed;
000048 8831 LDRH r1,[r6,#0] ; CurSpeed
00004a 4630 MOV r0,r6
00004c 8071 STRH r1,[r6,#2]
;;;137
;;;138 if(speedOne > 0)
;;;139 {
;;;140 sssssss = 1;
;;;141 distanceOne = 4000;
;;;142
;;;143 buffOne[0] = (distanceOne & 0XFF);
;;;144 buffOne[1] = ((distanceOne >> 8) & 0XFF);
;;;145
;;;146 ss1 = speedOne / 5;
00004e 2705 MOVS r7,#5
;;;147
;;;148 if((ss1 == 1) || (ss1 == 3) || (ss1 == 5) ||(ss1 == 7) || (ss1 == 9) || (ss1 == 11) || (ss1 == 13) || (ss1 == 15))
;;;149 {
;;;150 buffOne[2] = 148;
;;;151 buffOne[3] |= ((speedOne / 10) & 0XF);
000050 260a MOVS r6,#0xa
000052 f04f0ba0 MOV r11,#0xa0 ;143
000056 f04f0a00 MOV r10,#0 ;143
00005a f04f0894 MOV r8,#0x94 ;150
;;;152 }
;;;153 else if((ss1 == 2) || (ss1 == 4) || (ss1 == 6) ||(ss1 == 8) || (ss1 == 10) || (ss1 == 12) || (ss1 == 14) || (ss1 == 16))
;;;154 {
;;;155 buffOne[2] = 20;
00005e f04f0914 MOV r9,#0x14
000062 2c00 CMP r4,#0 ;138
000064 dd4a BLE |L5.252|
000066 f04f0101 MOV r1,#1 ;140
00006a 6041 STR r1,[r0,#4] ;140 ; sssssss
00006c f88db014 STRB r11,[sp,#0x14] ;143
000070 f04f000f MOV r0,#0xf ;144
000074 f88d0015 STRB r0,[sp,#0x15] ;144
000078 fb94f0f7 SDIV r0,r4,r7 ;146
00007c b200 SXTH r0,r0 ;146
00007e 2801 CMP r0,#1 ;148
000080 d01e BEQ |L5.192|
000082 2803 CMP r0,#3 ;148
000084 d01c BEQ |L5.192|
000086 2805 CMP r0,#5 ;148
000088 d01a BEQ |L5.192|
00008a 2807 CMP r0,#7 ;148
00008c d018 BEQ |L5.192|
00008e 2809 CMP r0,#9 ;148
000090 d016 BEQ |L5.192|
000092 280b CMP r0,#0xb ;148
000094 d014 BEQ |L5.192|
000096 280d CMP r0,#0xd ;148
000098 d012 BEQ |L5.192|
00009a 280f CMP r0,#0xf ;148
00009c d010 BEQ |L5.192|
00009e 2802 CMP r0,#2 ;153
0000a0 d01a BEQ |L5.216|
0000a2 2804 CMP r0,#4 ;153
0000a4 d018 BEQ |L5.216|
0000a6 2806 CMP r0,#6 ;153
0000a8 d016 BEQ |L5.216|
0000aa 2808 CMP r0,#8 ;153
0000ac d014 BEQ |L5.216|
0000ae 280a CMP r0,#0xa ;153
0000b0 d012 BEQ |L5.216|
0000b2 280c CMP r0,#0xc ;153
0000b4 d010 BEQ |L5.216|
0000b6 280e CMP r0,#0xe ;153
0000b8 d00e BEQ |L5.216|
0000ba 2810 CMP r0,#0x10 ;153
0000bc d00c BEQ |L5.216|
0000be e016 B |L5.238|
|L5.192|
0000c0 f88d8016 STRB r8,[sp,#0x16] ;150
0000c4 fb94f0f6 SDIV r0,r4,r6 ;151
0000c8 f89d1017 LDRB r1,[sp,#0x17] ;151
0000cc f000000f AND r0,r0,#0xf ;151
0000d0 4308 ORRS r0,r0,r1 ;151
0000d2 f88d0017 STRB r0,[sp,#0x17] ;151
0000d6 e00a B |L5.238|
|L5.216|
0000d8 f88d9016 STRB r9,[sp,#0x16]
;;;156 buffOne[3] |= ((speedOne / 10) & 0XF);
0000dc fb94f0f6 SDIV r0,r4,r6
0000e0 f89d1017 LDRB r1,[sp,#0x17]
0000e4 f000000f AND r0,r0,#0xf
0000e8 4308 ORRS r0,r0,r1
0000ea f88d0017 STRB r0,[sp,#0x17]
|L5.238|
;;;157 }
;;;158
;;;159 // buffOne[3] |= ((speedOne / 10) & 0XF);
;;;160
;;;161 CAN2_Send_Msg_Extend(CYLINDER_SEND1,buffOne,8,2);
0000ee 2302 MOVS r3,#2
0000f0 2208 MOVS r2,#8
0000f2 a905 ADD r1,sp,#0x14
0000f4 487d LDR r0,|L5.748|
0000f6 f7fffffe BL CAN2_Send_Msg_Extend
0000fa e051 B |L5.416|
|L5.252|
;;;162 }
;;;163 else if(speedOne < 0)
0000fc da48 BGE |L5.400|
;;;164 {
;;;165 sssssss =2;
0000fe 2102 MOVS r1,#2
000100 6041 STR r1,[r0,#4] ; sssssss
;;;166 distanceOne = 0;
;;;167 buffOne[0] = (distanceOne & 0XFF);
000102 f88da014 STRB r10,[sp,#0x14]
;;;168 buffOne[1] = ((distanceOne >> 8) & 0XFF);
000106 f88da015 STRB r10,[sp,#0x15]
;;;169
;;;170 ss1 = abs(speedOne) / 5;
00010a 4261 RSBS r1,r4,#0
00010c fb91f0f7 SDIV r0,r1,r7
000110 b200 SXTH r0,r0
;;;171 if((ss1 == 1) || (ss1 == 3) || (ss1 == 5) ||(ss1 == 7) || (ss1 == 9) || (ss1 == 11) || (ss1 == 13) || (ss1 == 15))
000112 2801 CMP r0,#1
000114 d01e BEQ |L5.340|
000116 2803 CMP r0,#3
000118 d01c BEQ |L5.340|
00011a 2805 CMP r0,#5
00011c d01a BEQ |L5.340|
00011e 2807 CMP r0,#7
000120 d018 BEQ |L5.340|
000122 2809 CMP r0,#9
000124 d016 BEQ |L5.340|
000126 280b CMP r0,#0xb
000128 d014 BEQ |L5.340|
00012a 280d CMP r0,#0xd
00012c d012 BEQ |L5.340|
00012e 280f CMP r0,#0xf
000130 d010 BEQ |L5.340|
;;;172 {
;;;173 buffOne[2] = 148;
;;;174 buffOne[3] |= ((abs(speedOne)/ 10) & 0XF);
;;;175 }
;;;176 else if((ss1 == 2) || (ss1 == 4) || (ss1 == 6) ||(ss1 == 8) || (ss1 == 10) || (ss1 == 12) || (ss1 == 14) || (ss1 == 16))
000132 2802 CMP r0,#2
000134 d01a BEQ |L5.364|
000136 2804 CMP r0,#4
000138 d018 BEQ |L5.364|
00013a 2806 CMP r0,#6
00013c d016 BEQ |L5.364|
00013e 2808 CMP r0,#8
000140 d014 BEQ |L5.364|
000142 280a CMP r0,#0xa
000144 d012 BEQ |L5.364|
000146 280c CMP r0,#0xc
000148 d010 BEQ |L5.364|
00014a 280e CMP r0,#0xe
00014c d00e BEQ |L5.364|
00014e 2810 CMP r0,#0x10
000150 d00c BEQ |L5.364|
000152 e016 B |L5.386|
|L5.340|
000154 f88d8016 STRB r8,[sp,#0x16] ;173
000158 fb91f0f6 SDIV r0,r1,r6 ;174
00015c f89d1017 LDRB r1,[sp,#0x17] ;174
000160 f000000f AND r0,r0,#0xf ;174
000164 4308 ORRS r0,r0,r1 ;174
000166 f88d0017 STRB r0,[sp,#0x17] ;174
00016a e00a B |L5.386|
|L5.364|
;;;177 {
;;;178 buffOne[2] = 20;
00016c f88d9016 STRB r9,[sp,#0x16]
;;;179 buffOne[3] |= ((abs(speedOne) / 10) & 0XF);
000170 fb91f0f6 SDIV r0,r1,r6
000174 f89d1017 LDRB r1,[sp,#0x17]
000178 f000000f AND r0,r0,#0xf
00017c 4308 ORRS r0,r0,r1
00017e f88d0017 STRB r0,[sp,#0x17]
|L5.386|
;;;180 }
;;;181
;;;182 CAN2_Send_Msg_Extend(CYLINDER_SEND1,buffOne,8,2);
000182 2302 MOVS r3,#2
000184 2208 MOVS r2,#8
000186 a905 ADD r1,sp,#0x14
000188 4858 LDR r0,|L5.748|
00018a f7fffffe BL CAN2_Send_Msg_Extend
00018e e007 B |L5.416|
|L5.400|
;;;183 }
;;;184 else
;;;185 {
;;;186 sssssss = 3;
000190 2103 MOVS r1,#3
000192 6041 STR r1,[r0,#4] ; sssssss
;;;187 CAN2_Send_Msg_Extend(CYLINDER_SEND1,DisEnable,8,2);
000194 2302 MOVS r3,#2
000196 2208 MOVS r2,#8
000198 a901 ADD r1,sp,#4
00019a 4854 LDR r0,|L5.748|
00019c f7fffffe BL CAN2_Send_Msg_Extend
|L5.416|
;;;188 }
;;;189
;;;190 if(speedTwo > 0)
0001a0 2d00 CMP r5,#0
0001a2 dd49 BLE |L5.568|
;;;191 {
;;;192 distanceTwo = 4000;
;;;193
;;;194 buffTwo[0] = (distanceTwo & 0XFF);
0001a4 f88db00c STRB r11,[sp,#0xc]
;;;195 buffTwo[1] = ((distanceTwo >> 8) & 0XFF);
0001a8 f04f000f MOV r0,#0xf
0001ac f88d000d STRB r0,[sp,#0xd]
;;;196
;;;197 ss2 = speedTwo / 5;
0001b0 fb95f0f7 SDIV r0,r5,r7
0001b4 b200 SXTH r0,r0
;;;198 if((ss2 == 1) || (ss2 == 3) || (ss2 == 5) ||(ss2 == 7) || (ss2 == 9) || (ss2 == 11) || (ss2 == 13) || (ss2 == 15))
0001b6 2801 CMP r0,#1
0001b8 d01e BEQ |L5.504|
0001ba 2803 CMP r0,#3
0001bc d01c BEQ |L5.504|
0001be 2805 CMP r0,#5
0001c0 d01a BEQ |L5.504|
0001c2 2807 CMP r0,#7
0001c4 d018 BEQ |L5.504|
0001c6 2809 CMP r0,#9
0001c8 d016 BEQ |L5.504|
0001ca 280b CMP r0,#0xb
0001cc d014 BEQ |L5.504|
0001ce 280d CMP r0,#0xd
0001d0 d012 BEQ |L5.504|
0001d2 280f CMP r0,#0xf
0001d4 d010 BEQ |L5.504|
;;;199 {
;;;200 buffTwo[2] = 148;
;;;201 buffTwo[3] |= ((speedTwo / 10) & 0XF);
;;;202 }
;;;203 else if((ss2 == 2) || (ss2 == 4) || (ss2 == 6) ||(ss2 == 8) || (ss2 == 10) || (ss2 == 12) || (ss2 == 14) || (ss2 == 16))
0001d6 2802 CMP r0,#2
0001d8 d01a BEQ |L5.528|
0001da 2804 CMP r0,#4
0001dc d018 BEQ |L5.528|
0001de 2806 CMP r0,#6
0001e0 d016 BEQ |L5.528|
0001e2 2808 CMP r0,#8
0001e4 d014 BEQ |L5.528|
0001e6 280a CMP r0,#0xa
0001e8 d012 BEQ |L5.528|
0001ea 280c CMP r0,#0xc
0001ec d010 BEQ |L5.528|
0001ee 280e CMP r0,#0xe
0001f0 d00e BEQ |L5.528|
0001f2 2810 CMP r0,#0x10
0001f4 d00c BEQ |L5.528|
0001f6 e016 B |L5.550|
|L5.504|
0001f8 f88d800e STRB r8,[sp,#0xe] ;200
0001fc fb95f0f6 SDIV r0,r5,r6 ;201
000200 f89d100f LDRB r1,[sp,#0xf] ;201
000204 f000000f AND r0,r0,#0xf ;201
000208 4308 ORRS r0,r0,r1 ;201
00020a f88d000f STRB r0,[sp,#0xf] ;201
00020e e00a B |L5.550|
|L5.528|
;;;204 {
;;;205 buffTwo[2] = 20;
000210 f88d900e STRB r9,[sp,#0xe]
;;;206 buffTwo[3] |= ((speedTwo / 10) & 0XF);
000214 fb95f0f6 SDIV r0,r5,r6
000218 f89d100f LDRB r1,[sp,#0xf]
00021c f000000f AND r0,r0,#0xf
000220 4308 ORRS r0,r0,r1
000222 f88d000f STRB r0,[sp,#0xf]
|L5.550|
;;;207 }
;;;208
;;;209 CAN2_Send_Msg_Extend(CYLINDER_SEND2,buffTwo,8,2);
000226 2302 MOVS r3,#2
000228 2208 MOVS r2,#8
00022a a903 ADD r1,sp,#0xc
00022c 4830 LDR r0,|L5.752|
00022e f7fffffe BL CAN2_Send_Msg_Extend
|L5.562|
;;;210 }
;;;211 else if(speedTwo < 0)
;;;212 {
;;;213 distanceTwo = 0;
;;;214
;;;215 buffTwo[0] = (distanceTwo & 0XFF);
;;;216 buffTwo[1] = ((distanceTwo >> 8) & 0XFF);
;;;217
;;;218 ss2 = abs(speedTwo) / 5;
;;;219 if((ss2 == 1) || (ss2 == 3) || (ss2 == 5) ||(ss2 == 7) || (ss2 == 9) || (ss2 == 11) || (ss2 == 13) || (ss2 == 15))
;;;220 {
;;;221 buffTwo[2] = 148;
;;;222 buffTwo[3] |= ((abs(speedTwo)/ 10) & 0XF);
;;;223 }
;;;224 else if((ss2 == 2) || (ss2 == 4) || (ss2 == 6) ||(ss2 == 8) || (ss2 == 10) || (ss2 == 12) || (ss2 == 14) || (ss2 == 16))
;;;225 {
;;;226 buffTwo[2] = 20;
;;;227 buffTwo[3] |= ((abs(speedTwo) / 10) & 0XF);
;;;228 }
;;;229
;;;230 CAN2_Send_Msg_Extend(CYLINDER_SEND2,buffTwo,8,2);
;;;231 }
;;;232 else
;;;233 {
;;;234 CAN2_Send_Msg_Extend(CYLINDER_SEND2,DisEnable,8,2);
;;;235 }
;;;236
;;;237 //Uart_Printf(COM1,"ss1=%d ss2=%d\r\n",ss1,ss2);
;;;238 // if(i++ >= 20)
;;;239 // {
;;;240 // Uart_Printf(COM1,"speedOne=%d two=%d %d buffOne[2]=%x buffOne[3]=%x buffTwo[2]=%x buffTwo[3]=%x SPEED=%d %d dis1=%d dis2=%d\r\n",
;;;241 // speedOne,speedTwo,sssssss,
;;;242 // buffOne[2],buffOne[3],buffTwo[2],buffTwo[3],speedOne,speedTwo,HandlePlcData.SendPlcData.FirstLiftAcDis,HandlePlcData.SendPlcData.SecondLiftAcDis);
;;;243 // i = 0;
;;;244 // }
;;;245 }
000232 b007 ADD sp,sp,#0x1c
000234 e8bd8ff0 POP {r4-r11,pc}
|L5.568|
000238 da46 BGE |L5.712|
00023a f88da00c STRB r10,[sp,#0xc] ;215
00023e f88da00d STRB r10,[sp,#0xd] ;216
000242 4269 RSBS r1,r5,#0 ;218
000244 fb91f0f7 SDIV r0,r1,r7 ;218
000248 b200 SXTH r0,r0 ;218
00024a 2801 CMP r0,#1 ;219
00024c d01e BEQ |L5.652|
00024e 2803 CMP r0,#3 ;219
000250 d01c BEQ |L5.652|
000252 2805 CMP r0,#5 ;219
000254 d01a BEQ |L5.652|
000256 2807 CMP r0,#7 ;219
000258 d018 BEQ |L5.652|
00025a 2809 CMP r0,#9 ;219
00025c d016 BEQ |L5.652|
00025e 280b CMP r0,#0xb ;219
000260 d014 BEQ |L5.652|
000262 280d CMP r0,#0xd ;219
000264 d012 BEQ |L5.652|
000266 280f CMP r0,#0xf ;219
000268 d010 BEQ |L5.652|
00026a 2802 CMP r0,#2 ;224
00026c d01a BEQ |L5.676|
00026e 2804 CMP r0,#4 ;224
000270 d018 BEQ |L5.676|
000272 2806 CMP r0,#6 ;224
000274 d016 BEQ |L5.676|
000276 2808 CMP r0,#8 ;224
000278 d014 BEQ |L5.676|
00027a 280a CMP r0,#0xa ;224
00027c d012 BEQ |L5.676|
00027e 280c CMP r0,#0xc ;224
000280 d010 BEQ |L5.676|
000282 280e CMP r0,#0xe ;224
000284 d00e BEQ |L5.676|
000286 2810 CMP r0,#0x10 ;224
000288 d00c BEQ |L5.676|
00028a e016 B |L5.698|
|L5.652|
00028c f88d800e STRB r8,[sp,#0xe] ;221
000290 fb91f0f6 SDIV r0,r1,r6 ;222
000294 f89d100f LDRB r1,[sp,#0xf] ;222
000298 f000000f AND r0,r0,#0xf ;222
00029c 4308 ORRS r0,r0,r1 ;222
00029e f88d000f STRB r0,[sp,#0xf] ;222
0002a2 e00a B |L5.698|
|L5.676|
0002a4 f88d900e STRB r9,[sp,#0xe] ;226
0002a8 fb91f0f6 SDIV r0,r1,r6 ;227
0002ac f89d100f LDRB r1,[sp,#0xf] ;227
0002b0 f000000f AND r0,r0,#0xf ;227
0002b4 4308 ORRS r0,r0,r1 ;227
0002b6 f88d000f STRB r0,[sp,#0xf] ;227
|L5.698|
0002ba 2302 MOVS r3,#2 ;230
0002bc 2208 MOVS r2,#8 ;230
0002be a903 ADD r1,sp,#0xc ;230
0002c0 480b LDR r0,|L5.752|
0002c2 f7fffffe BL CAN2_Send_Msg_Extend
0002c6 e7b4 B |L5.562|
|L5.712|
0002c8 2302 MOVS r3,#2 ;234
0002ca 2208 MOVS r2,#8 ;234
0002cc a901 ADD r1,sp,#4 ;234
0002ce 4808 LDR r0,|L5.752|
0002d0 f7fffffe BL CAN2_Send_Msg_Extend
0002d4 e7ad B |L5.562|
;;;246
ENDP
0002d6 0000 DCW 0x0000
|L5.728|
0002d8 00 DCB 0
0002d9 00 DCB 0
0002da 00 DCB 0
0002db 1000 DCB 16,0
0002dd 00 DCB 0
0002de 00 DCB 0
0002df 00 DCB 0
|L5.736|
0002e0 00 DCB 0
0002e1 00 DCB 0
0002e2 1400 DCB 20,0
0002e4 00 DCB 0
0002e5 00 DCB 0
0002e6 00 DCB 0
0002e7 00 DCB 0
|L5.744|
DCD ||.data||
|L5.748|
DCD 0x18ef1301
|L5.752|
DCD 0x18ef1401
AREA ||i.steeringFunction||, CODE, READONLY, ALIGN=1
steeringFunction PROC
;;;94
;;;95 void steeringFunction(DriverStruct *Motor,DriverStruct *refMotor)//转向电机 行走轮有速度则开使能 无速度则视情况关使能
000000 f8902050 LDRB r2,[r0,#0x50]
;;;96 {
;;;97 if(0)//如果拍了急停信号
;;;98 {
;;;99 Motor->Private.initStep = 0;
;;;100 }
;;;101
;;;102 if(Motor->Private.initStep != 255)//如果未初始化先初始化
000004 2aff CMP r2,#0xff
000006 d001 BEQ |L6.12|
;;;103 {
;;;104 init_driver(Motor);//非阻塞函数
000008 f7ffbffe B.W init_driver
|L6.12|
;;;105 }
;;;106 else
;;;107 {
;;;108 set_steering_speed(Motor,refMotor);//发速度
00000c f7ffbffe B.W set_steering_speed
;;;109 }
;;;110 }
;;;111
ENDP
AREA ||.bss||, DATA, NOINIT, ALIGN=1
RemodelThrModel
% 14
AREA ||.data||, DATA, ALIGN=2
CurSpeed
000000 0000 DCW 0x0000
LastSpeed
000002 0000 DCW 0x0000
sssssss
DCD 0x00000000
LiftEncoderPosBack
000008 40046000 DCB 0x40,0x04,0x60,0x00
00000c 00000000 DCB 0x00,0x00,0x00,0x00
ResetTransformer
000010 ee029907 DCB 0xee,0x02,0x99,0x07
000014 00000000 DCB 0x00,0x00,0x00,0x00
;*** Start embedded assembler ***
#line 1 "..\\..\\User\\parameter\\user_Canupdate.c"
AREA ||.rev16_text||, CODE
THUMB
EXPORT |__asm___16_user_Canupdate_c_30135412____REV16|
#line 129 "..\\..\\Libraries\\CMSIS\\Include\\core_cmInstr.h"
|__asm___16_user_Canupdate_c_30135412____REV16| PROC
#line 130
rev16 r0, r0
bx lr
ENDP
AREA ||.revsh_text||, CODE
THUMB
EXPORT |__asm___16_user_Canupdate_c_30135412____REVSH|
#line 144
|__asm___16_user_Canupdate_c_30135412____REVSH| PROC
#line 145
revsh r0, r0
bx lr
ENDP
AREA ||.rrx_text||, CODE
THUMB
EXPORT |__asm___16_user_Canupdate_c_30135412____RRX|
#line 300
|__asm___16_user_Canupdate_c_30135412____RRX| PROC
#line 301
rrx r0, r0
bx lr
ENDP
;*** End embedded assembler ***