-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLL_HL_comm.lst
2843 lines (2842 loc) · 117 KB
/
LL_HL_comm.lst
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
1 .file "LL_HL_comm.c"
9 .Ltext0:
10 .align 2
11 .global LL_write_ctrl_data
13 LL_write_ctrl_data:
14 .LFB4:
15 .file 1 "LL_HL_comm.c"
1:LL_HL_comm.c **** /*
2:LL_HL_comm.c ****
3:LL_HL_comm.c **** Copyright (c) 2011, Ascending Technologies GmbH
4:LL_HL_comm.c **** All rights reserved.
5:LL_HL_comm.c ****
6:LL_HL_comm.c **** Redistribution and use in source and binary forms, with or without
7:LL_HL_comm.c **** modification, are permitted provided that the following conditions are met:
8:LL_HL_comm.c ****
9:LL_HL_comm.c **** * Redistributions of source code must retain the above copyright notice,
10:LL_HL_comm.c **** this list of conditions and the following disclaimer.
11:LL_HL_comm.c **** * Redistributions in binary form must reproduce the above copyright
12:LL_HL_comm.c **** notice, this list of conditions and the following disclaimer in the
13:LL_HL_comm.c **** documentation and/or other materials provided with the distribution.
14:LL_HL_comm.c ****
15:LL_HL_comm.c **** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
16:LL_HL_comm.c **** EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17:LL_HL_comm.c **** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18:LL_HL_comm.c **** DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY
19:LL_HL_comm.c **** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20:LL_HL_comm.c **** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21:LL_HL_comm.c **** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22:LL_HL_comm.c **** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23:LL_HL_comm.c **** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24:LL_HL_comm.c **** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
25:LL_HL_comm.c **** DAMAGE.
26:LL_HL_comm.c ****
27:LL_HL_comm.c **** */
28:LL_HL_comm.c ****
29:LL_HL_comm.c **** #include "main.h"
30:LL_HL_comm.c **** #include "LL_HL_comm.h"
31:LL_HL_comm.c **** #include "system.h"
32:LL_HL_comm.c **** #include "gpsmath.h"
33:LL_HL_comm.c **** #include "sdk.h"
34:LL_HL_comm.c **** #include "declination.h"
35:LL_HL_comm.c **** #include "jetiTelemetry.h"
36:LL_HL_comm.c **** #include "sdk_telemetry.h"
37:LL_HL_comm.c **** #include "buildInfoSetup.h"
38:LL_HL_comm.c **** #include <string.h>
39:LL_HL_comm.c ****
40:LL_HL_comm.c **** unsigned short SSP_ack = 0;
41:LL_HL_comm.c **** extern char SPIWRData[128];
42:LL_HL_comm.c **** extern char data_sent_to_HL;
43:LL_HL_comm.c **** extern char data_sent_to_LL;
44:LL_HL_comm.c **** extern unsigned int SPIWR_num_bytes;
45:LL_HL_comm.c ****
46:LL_HL_comm.c **** struct LL_ATTITUDE_DATA LL_1khz_attitude_data;
47:LL_HL_comm.c **** struct LL_CONTROL_INPUT LL_1khz_control_input;
48:LL_HL_comm.c ****
49:LL_HL_comm.c **** unsigned char wpCtrlWpCmd = 0;
50:LL_HL_comm.c **** unsigned char wpCtrlWpCmdUpdated = 0;
51:LL_HL_comm.c ****
52:LL_HL_comm.c **** unsigned char wpCtrlAckTrigger = 0;
53:LL_HL_comm.c ****
54:LL_HL_comm.c **** unsigned short wpCtrlNavStatus = 0;
55:LL_HL_comm.c **** unsigned short wpCtrlDistToWp = 0;
56:LL_HL_comm.c ****
57:LL_HL_comm.c **** struct WAYPOINT wpToLL;
58:LL_HL_comm.c ****
59:LL_HL_comm.c **** volatile unsigned char transmitBuildInfoTrigger = 0;
60:LL_HL_comm.c ****
61:LL_HL_comm.c **** void SSP_data_distribution_HL(void) {
62:LL_HL_comm.c **** unsigned char i;
63:LL_HL_comm.c **** unsigned char current_page = LL_1khz_attitude_data.system_flags & 0x03;
64:LL_HL_comm.c **** static unsigned char oldKey = 0;
65:LL_HL_comm.c ****
66:LL_HL_comm.c **** if (LL_1khz_attitude_data.system_flags & SF_GPS_NEW)
67:LL_HL_comm.c **** gpsDataOkTrigger = 0;
68:LL_HL_comm.c ****
69:LL_HL_comm.c **** IMU_CalcData.angle_nick = LL_1khz_attitude_data.angle_pitch * 10;
70:LL_HL_comm.c **** IMU_CalcData.angle_roll = LL_1khz_attitude_data.angle_roll * 10;
71:LL_HL_comm.c **** IMU_CalcData.angle_yaw = LL_1khz_attitude_data.angle_yaw * 10;
72:LL_HL_comm.c ****
73:LL_HL_comm.c **** IMU_CalcData.angvel_nick = LL_1khz_attitude_data.angvel_pitch;
74:LL_HL_comm.c **** IMU_CalcData.angvel_roll = LL_1khz_attitude_data.angvel_roll;
75:LL_HL_comm.c **** IMU_CalcData.angvel_yaw = LL_1khz_attitude_data.angvel_yaw;
76:LL_HL_comm.c ****
77:LL_HL_comm.c **** RO_ALL_Data.angle_pitch = IMU_CalcData.angle_nick;
78:LL_HL_comm.c **** RO_ALL_Data.angle_roll = IMU_CalcData.angle_roll;
79:LL_HL_comm.c **** RO_ALL_Data.angle_yaw = IMU_CalcData.angle_yaw;
80:LL_HL_comm.c ****
81:LL_HL_comm.c **** RO_ALL_Data.angvel_pitch = LL_1khz_attitude_data.angvel_pitch;
82:LL_HL_comm.c **** RO_ALL_Data.angvel_roll = LL_1khz_attitude_data.angvel_roll;
83:LL_HL_comm.c **** RO_ALL_Data.angvel_yaw = LL_1khz_attitude_data.angvel_yaw;
84:LL_HL_comm.c ****
85:LL_HL_comm.c **** if (!current_page) //page 0
86:LL_HL_comm.c **** {
87:LL_HL_comm.c **** for (i = 0; i < 8; i++) {
88:LL_HL_comm.c **** RO_RC_Data.channel[i] = LL_1khz_attitude_data.RC_data[i] * 16;
89:LL_HL_comm.c **** RO_ALL_Data.channel[i] = RO_RC_Data.channel[i];
90:LL_HL_comm.c **** }
91:LL_HL_comm.c **** IMU_CalcData.acc_x_calib = LL_1khz_attitude_data.acc_x * 10;
92:LL_HL_comm.c **** IMU_CalcData.acc_y_calib = LL_1khz_attitude_data.acc_y * 10;
93:LL_HL_comm.c **** IMU_CalcData.acc_z_calib = LL_1khz_attitude_data.acc_z * 10;
94:LL_HL_comm.c ****
95:LL_HL_comm.c **** //system is initialized as soon as values differ from 0
96:LL_HL_comm.c **** if (IMU_CalcData.acc_z_calib && (SYSTEM_initialized < 10))
97:LL_HL_comm.c **** SYSTEM_initialized++;
98:LL_HL_comm.c ****
99:LL_HL_comm.c **** RO_ALL_Data.acc_x = IMU_CalcData.acc_x_calib;
100:LL_HL_comm.c **** RO_ALL_Data.acc_y = IMU_CalcData.acc_y_calib;
101:LL_HL_comm.c **** RO_ALL_Data.acc_z = IMU_CalcData.acc_z_calib;
102:LL_HL_comm.c ****
103:LL_HL_comm.c **** RO_ALL_Data.fusion_latitude
104:LL_HL_comm.c **** = LL_1khz_attitude_data.latitude_best_estimate;
105:LL_HL_comm.c **** RO_ALL_Data.fusion_longitude
106:LL_HL_comm.c **** = LL_1khz_attitude_data.longitude_best_estimate;
107:LL_HL_comm.c ****
108:LL_HL_comm.c **** } else if (current_page == 1) //page 1
109:LL_HL_comm.c **** {
110:LL_HL_comm.c **** IMU_CalcData.height = LL_1khz_attitude_data.height;
111:LL_HL_comm.c **** IMU_CalcData.dheight = LL_1khz_attitude_data.dheight;
112:LL_HL_comm.c ****
113:LL_HL_comm.c **** RO_ALL_Data.fusion_height = LL_1khz_attitude_data.height;
114:LL_HL_comm.c **** RO_ALL_Data.fusion_dheight = LL_1khz_attitude_data.dheight;
115:LL_HL_comm.c ****
116:LL_HL_comm.c **** RO_ALL_Data.fusion_speed_x
117:LL_HL_comm.c **** = LL_1khz_attitude_data.speed_x_best_estimate;
118:LL_HL_comm.c **** RO_ALL_Data.fusion_speed_y
119:LL_HL_comm.c **** = LL_1khz_attitude_data.speed_y_best_estimate;
120:LL_HL_comm.c **** for (i = 0; i < 6; i++) {
121:LL_HL_comm.c **** RO_ALL_Data.motor_rpm[i] = LL_1khz_attitude_data.motor_data[i + 8];
122:LL_HL_comm.c **** }
123:LL_HL_comm.c **** } else if (current_page == 2) {
124:LL_HL_comm.c **** IMU_CalcData.Hx = LL_1khz_attitude_data.mag_x;
125:LL_HL_comm.c **** IMU_CalcData.Hy = LL_1khz_attitude_data.mag_y;
126:LL_HL_comm.c **** IMU_CalcData.Hz = LL_1khz_attitude_data.mag_z;
127:LL_HL_comm.c ****
128:LL_HL_comm.c **** RO_ALL_Data.Hx = LL_1khz_attitude_data.mag_x;
129:LL_HL_comm.c **** RO_ALL_Data.Hy = LL_1khz_attitude_data.mag_y;
130:LL_HL_comm.c **** RO_ALL_Data.Hz = LL_1khz_attitude_data.mag_z;
131:LL_HL_comm.c ****
132:LL_HL_comm.c **** RO_ALL_Data.UAV_status = LL_1khz_attitude_data.flightMode;
133:LL_HL_comm.c **** RO_ALL_Data.battery_voltage = HL_Status.battery_voltage_1;
134:LL_HL_comm.c **** RO_ALL_Data.flight_time = HL_Status.flight_time;
135:LL_HL_comm.c **** RO_ALL_Data.HL_cpu_load = HL_Status.cpu_load;
136:LL_HL_comm.c **** RO_ALL_Data.HL_up_time = HL_Status.up_time;
137:LL_HL_comm.c ****
138:LL_HL_comm.c **** if (LL_1khz_attitude_data.status2 & 0x01)
139:LL_HL_comm.c **** RO_ALL_Data.flying = 1;
140:LL_HL_comm.c **** else
141:LL_HL_comm.c **** RO_ALL_Data.flying = 0;
142:LL_HL_comm.c ****
143:LL_HL_comm.c **** unsigned char slowDataUpChannelSelect = (LL_1khz_attitude_data.status2
144:LL_HL_comm.c **** >> 1) & 0x7F;
145:LL_HL_comm.c **** switch (slowDataUpChannelSelect) {
146:LL_HL_comm.c **** case SUDC_FLIGHTTIME:
147:LL_HL_comm.c ****
148:LL_HL_comm.c **** HL_Status.flight_time
149:LL_HL_comm.c **** = LL_1khz_attitude_data.slowDataUpChannelDataShort;
150:LL_HL_comm.c **** break;
151:LL_HL_comm.c **** case SUDC_NAVSTATUS:
152:LL_HL_comm.c **** wpCtrlNavStatus = LL_1khz_attitude_data.slowDataUpChannelDataShort;
153:LL_HL_comm.c **** break;
154:LL_HL_comm.c **** case SUDC_DISTTOWP:
155:LL_HL_comm.c **** wpCtrlDistToWp = LL_1khz_attitude_data.slowDataUpChannelDataShort;
156:LL_HL_comm.c **** break;
157:LL_HL_comm.c **** case SUDC_WPACKTRIGGER:
158:LL_HL_comm.c **** wpCtrlAckTrigger = LL_1khz_attitude_data.slowDataUpChannelDataShort;
159:LL_HL_comm.c **** break;
160:LL_HL_comm.c **** case SUDC_SENDOMTYPE:
161:LL_HL_comm.c **** if ((LL_1khz_attitude_data.slowDataUpChannelDataShort == OM_HEX)
162:LL_HL_comm.c **** && (fireflyLedEnabled == 0))
163:LL_HL_comm.c **** fireflyLedEnabled = 1;
164:LL_HL_comm.c **** break;
165:LL_HL_comm.c **** case SUDC_JETIKEYVAL:
166:LL_HL_comm.c **** if (oldKey != LL_1khz_attitude_data.slowDataUpChannelDataShort)
167:LL_HL_comm.c **** jetiSetKeyChanged(
168:LL_HL_comm.c **** LL_1khz_attitude_data.slowDataUpChannelDataShort);
169:LL_HL_comm.c **** oldKey = LL_1khz_attitude_data.slowDataUpChannelDataShort;
170:LL_HL_comm.c **** break;
171:LL_HL_comm.c **** case SUDC_EM_MODE:
172:LL_HL_comm.c **** if (emergencyModeUpdate == 2) {
173:LL_HL_comm.c **** if (LL_1khz_attitude_data.slowDataUpChannelDataShort
174:LL_HL_comm.c **** != emergencyMode)
175:LL_HL_comm.c **** emergencyModeUpdate = 1;
176:LL_HL_comm.c **** else
177:LL_HL_comm.c **** emergencyModeUpdate = 0;
178:LL_HL_comm.c **** } else
179:LL_HL_comm.c **** emergencyMode
180:LL_HL_comm.c **** = LL_1khz_attitude_data.slowDataUpChannelDataShort;
181:LL_HL_comm.c **** break;
182:LL_HL_comm.c ****
183:LL_HL_comm.c **** }
184:LL_HL_comm.c **** }
185:LL_HL_comm.c **** }
186:LL_HL_comm.c ****
187:LL_HL_comm.c **** int HL2LL_write_cycle(void) //write data to low-level processor
188:LL_HL_comm.c **** {
189:LL_HL_comm.c **** static char pageselect = 0;
190:LL_HL_comm.c **** unsigned char i;
191:LL_HL_comm.c **** static unsigned char jetiValuePartialSyncPending = 0;
192:LL_HL_comm.c **** static unsigned char * transmitPtr;
193:LL_HL_comm.c **** static unsigned short transmitCnt = 0;
194:LL_HL_comm.c ****
195:LL_HL_comm.c **** if (!data_sent_to_LL)
196:LL_HL_comm.c **** return (0);
197:LL_HL_comm.c ****
198:LL_HL_comm.c **** //update 1kHz data
199:LL_HL_comm.c **** LL_1khz_control_input.system_flags = 0 | pageselect;
200:LL_HL_comm.c **** //SSP_ack=0; //reset ack
201:LL_HL_comm.c ****
202:LL_HL_comm.c **** if (gpsDataOkTrigger)
203:LL_HL_comm.c **** LL_1khz_control_input.system_flags |= SF_GPS_NEW;
204:LL_HL_comm.c ****
205:LL_HL_comm.c **** if (WO_SDK.ctrl_enabled)
206:LL_HL_comm.c **** LL_1khz_control_input.system_flags |= SF_HL_CONTROL_ENABLED
207:LL_HL_comm.c **** | SF_NEW_SDK;
208:LL_HL_comm.c **** else
209:LL_HL_comm.c **** LL_1khz_control_input.system_flags &= ~(SF_HL_CONTROL_ENABLED
210:LL_HL_comm.c **** | SF_NEW_SDK);
211:LL_HL_comm.c ****
212:LL_HL_comm.c **** if (WO_SDK.disable_motor_onoff_by_stick)
213:LL_HL_comm.c **** LL_1khz_control_input.system_flags
214:LL_HL_comm.c **** |= SF_SDK_DISABLE_MOTORONOFF_BY_STICK;
215:LL_HL_comm.c **** else
216:LL_HL_comm.c **** LL_1khz_control_input.system_flags
217:LL_HL_comm.c **** &= ~SF_SDK_DISABLE_MOTORONOFF_BY_STICK;
218:LL_HL_comm.c ****
219:LL_HL_comm.c **** if (WO_SDK.ctrl_mode == 0x00) //direct individual motor control
220:LL_HL_comm.c **** {
221:LL_HL_comm.c **** LL_1khz_control_input.system_flags
222:LL_HL_comm.c **** |= SF_DIRECT_MOTOR_CONTROL_INDIVIDUAL;
223:LL_HL_comm.c **** for (i = 0; i < 8; i++) {
224:LL_HL_comm.c **** LL_1khz_control_input.direct_motor_control[i]
225:LL_HL_comm.c **** = WO_Direct_Individual_Motor_Control.motor[i];
226:LL_HL_comm.c **** LL_1khz_control_input.ctrl_flags=WO_Direct_Individual_Motor_Control.motorReverseMask<<8;
227:LL_HL_comm.c **** }
228:LL_HL_comm.c **** } else if (WO_SDK.ctrl_mode == 0x01) //direct motor control with standard output mapping
229:LL_HL_comm.c **** {
230:LL_HL_comm.c **** LL_1khz_control_input.system_flags |= SF_DIRECT_MOTOR_CONTROL;
231:LL_HL_comm.c **** LL_1khz_control_input.direct_motor_control[0]
232:LL_HL_comm.c **** = WO_Direct_Motor_Control.pitch;
233:LL_HL_comm.c **** LL_1khz_control_input.direct_motor_control[1]
234:LL_HL_comm.c **** = WO_Direct_Motor_Control.roll;
235:LL_HL_comm.c **** LL_1khz_control_input.direct_motor_control[2]
236:LL_HL_comm.c **** = WO_Direct_Motor_Control.yaw;
237:LL_HL_comm.c **** LL_1khz_control_input.direct_motor_control[3]
238:LL_HL_comm.c **** = WO_Direct_Motor_Control.thrust;
239:LL_HL_comm.c **** } else if (WO_SDK.ctrl_mode == 0x02) //attitude control
240:LL_HL_comm.c **** {
241:LL_HL_comm.c **** LL_1khz_control_input.system_flags &= ~(SF_DIRECT_MOTOR_CONTROL
242:LL_HL_comm.c **** | SF_DIRECT_MOTOR_CONTROL_INDIVIDUAL | SF_WAYPOINT_MODE); //no additional system flag => attitu
243:LL_HL_comm.c **** LL_1khz_control_input.ctrl_flags = WO_CTRL_Input.ctrl;
244:LL_HL_comm.c **** LL_1khz_control_input.pitch = WO_CTRL_Input.pitch;
245:LL_HL_comm.c **** LL_1khz_control_input.roll = WO_CTRL_Input.roll;
246:LL_HL_comm.c **** LL_1khz_control_input.yaw = WO_CTRL_Input.yaw;
247:LL_HL_comm.c **** LL_1khz_control_input.thrust = WO_CTRL_Input.thrust;
248:LL_HL_comm.c **** } else if (WO_SDK.ctrl_mode == 0x03) //gps waypoint control
249:LL_HL_comm.c **** {
250:LL_HL_comm.c **** LL_1khz_control_input.system_flags |= SF_WAYPOINT_MODE;
251:LL_HL_comm.c ****
252:LL_HL_comm.c **** //check if new command should be send
253:LL_HL_comm.c ****
254:LL_HL_comm.c **** if (wpCtrlWpCmdUpdated) {
255:LL_HL_comm.c ****
256:LL_HL_comm.c **** if (wpCtrlWpCmd == WP_CMD_SINGLE_WP) {
257:LL_HL_comm.c **** if (wpCtrlWpCmdUpdated == 1) {
258:LL_HL_comm.c **** LL_1khz_control_input.ctrl_flags &= 0x00FF;
259:LL_HL_comm.c **** LL_1khz_control_input.ctrl_flags |= WP_CMD_SINGLE_WP_PART1
260:LL_HL_comm.c **** << 8;
261:LL_HL_comm.c ****
262:LL_HL_comm.c **** LL_1khz_control_input.pitch = wpToLL.X & 0xFFFF;
263:LL_HL_comm.c **** LL_1khz_control_input.roll = wpToLL.X >> 16;
264:LL_HL_comm.c **** LL_1khz_control_input.thrust = wpToLL.Y & 0xFFFF;
265:LL_HL_comm.c **** LL_1khz_control_input.yaw = wpToLL.Y >> 16;
266:LL_HL_comm.c **** LL_1khz_control_input.direct_motor_control[0]
267:LL_HL_comm.c **** = wpToLL.height;
268:LL_HL_comm.c **** LL_1khz_control_input.direct_motor_control[1]
269:LL_HL_comm.c **** = wpToLL.height >> 8;
270:LL_HL_comm.c **** LL_1khz_control_input.direct_motor_control[2]
271:LL_HL_comm.c **** = wpToLL.height >> 16;
272:LL_HL_comm.c **** LL_1khz_control_input.direct_motor_control[3]
273:LL_HL_comm.c **** = wpToLL.height >> 24;
274:LL_HL_comm.c **** LL_1khz_control_input.direct_motor_control[4] = wpToLL.yaw;
275:LL_HL_comm.c **** LL_1khz_control_input.direct_motor_control[5] = wpToLL.yaw
276:LL_HL_comm.c **** >> 8;
277:LL_HL_comm.c **** LL_1khz_control_input.direct_motor_control[6] = wpToLL.yaw
278:LL_HL_comm.c **** >> 16;
279:LL_HL_comm.c **** LL_1khz_control_input.direct_motor_control[7] = wpToLL.yaw
280:LL_HL_comm.c **** >> 24;
281:LL_HL_comm.c ****
282:LL_HL_comm.c **** wpCtrlWpCmdUpdated++;
283:LL_HL_comm.c **** } else if (wpCtrlWpCmdUpdated == 2) {
284:LL_HL_comm.c **** LL_1khz_control_input.ctrl_flags &= 0x00FF;
285:LL_HL_comm.c **** LL_1khz_control_input.ctrl_flags |= WP_CMD_SINGLE_WP_PART2
286:LL_HL_comm.c **** << 8;
287:LL_HL_comm.c ****
288:LL_HL_comm.c **** LL_1khz_control_input.pitch = wpToLL.time;
289:LL_HL_comm.c **** LL_1khz_control_input.roll = 0; //wpToLL.cam_angle_pitch;
290:LL_HL_comm.c **** LL_1khz_control_input.thrust = wpToLL.pos_acc;
291:LL_HL_comm.c **** LL_1khz_control_input.yaw = wpToLL.chksum;
292:LL_HL_comm.c **** LL_1khz_control_input.direct_motor_control[0] = 0; //wpToLL.cam_angle_roll;
293:LL_HL_comm.c **** LL_1khz_control_input.direct_motor_control[1]
294:LL_HL_comm.c **** = wpToLL.max_speed;
295:LL_HL_comm.c **** LL_1khz_control_input.direct_motor_control[2]
296:LL_HL_comm.c **** = wpToLL.properties;
297:LL_HL_comm.c **** LL_1khz_control_input.direct_motor_control[3]
298:LL_HL_comm.c **** = wpToLL.wp_activated;
299:LL_HL_comm.c **** LL_1khz_control_input.direct_motor_control[4] = 0;
300:LL_HL_comm.c **** LL_1khz_control_input.direct_motor_control[5] = 0;
301:LL_HL_comm.c **** LL_1khz_control_input.direct_motor_control[6] = 0;
302:LL_HL_comm.c **** LL_1khz_control_input.direct_motor_control[7] = 0;
303:LL_HL_comm.c **** wpCtrlWpCmdUpdated = 0;
304:LL_HL_comm.c **** wpCtrlNavStatus = 0;
305:LL_HL_comm.c **** }
306:LL_HL_comm.c **** } else {
307:LL_HL_comm.c **** LL_1khz_control_input.ctrl_flags &= 0x00FF;
308:LL_HL_comm.c **** LL_1khz_control_input.ctrl_flags |= wpCtrlWpCmd << 8;
309:LL_HL_comm.c **** wpCtrlWpCmdUpdated = 0;
310:LL_HL_comm.c **** }
311:LL_HL_comm.c **** } else {
312:LL_HL_comm.c **** LL_1khz_control_input.ctrl_flags &= 0x00FF;
313:LL_HL_comm.c **** }
314:LL_HL_comm.c **** } else
315:LL_HL_comm.c **** LL_1khz_control_input.system_flags &= ~(SF_DIRECT_MOTOR_CONTROL
316:LL_HL_comm.c **** | SF_DIRECT_MOTOR_CONTROL_INDIVIDUAL | SF_WAYPOINT_MODE);
317:LL_HL_comm.c ****
318:LL_HL_comm.c **** if (pageselect == 0) {
319:LL_HL_comm.c **** if (LL_1khz_control_input.system_flags & SF_GPS_NEW) {
320:LL_HL_comm.c **** //fill struct with 500Hz data
321:LL_HL_comm.c **** LL_1khz_control_input.latitude = GPS_Data.latitude;
322:LL_HL_comm.c **** LL_1khz_control_input.longitude = GPS_Data.longitude;
323:LL_HL_comm.c **** LL_1khz_control_input.height = GPS_Data.height;
324:LL_HL_comm.c **** LL_1khz_control_input.speed_x = GPS_Data.speed_x;
325:LL_HL_comm.c **** LL_1khz_control_input.speed_y = GPS_Data.speed_y;
326:LL_HL_comm.c **** LL_1khz_control_input.heading = GPS_Data.heading;
327:LL_HL_comm.c **** LL_1khz_control_input.status = GPS_Data.status;
328:LL_HL_comm.c **** } else {
329:LL_HL_comm.c **** //default is no command
330:LL_HL_comm.c **** LL_1khz_control_input.status = 0;
331:LL_HL_comm.c ****
332:LL_HL_comm.c **** if (LL_1khz_control_input.system_flags & SF_GPS_NEW) {
333:LL_HL_comm.c **** //fill struct with 500Hz data
334:LL_HL_comm.c **** LL_1khz_control_input.latitude = GPS_Data.latitude;
335:LL_HL_comm.c **** LL_1khz_control_input.longitude = GPS_Data.longitude;
336:LL_HL_comm.c **** LL_1khz_control_input.height = GPS_Data.height;
337:LL_HL_comm.c **** LL_1khz_control_input.speed_x = GPS_Data.speed_x;
338:LL_HL_comm.c **** LL_1khz_control_input.speed_y = GPS_Data.speed_y;
339:LL_HL_comm.c **** LL_1khz_control_input.heading = GPS_Data.heading;
340:LL_HL_comm.c **** LL_1khz_control_input.status = GPS_Data.status;
341:LL_HL_comm.c **** } else {
342:LL_HL_comm.c **** static unsigned char jetiSyncState = 0;
343:LL_HL_comm.c **** static unsigned char jetiSensorCnt = 0;
344:LL_HL_comm.c **** static unsigned char jetiSensorValCnt = 0;
345:LL_HL_comm.c **** static unsigned char jetiSensorValUpdateTimeout = 0;
346:LL_HL_comm.c ****
347:LL_HL_comm.c **** //default is no command
348:LL_HL_comm.c **** LL_1khz_control_input.status = 0;
349:LL_HL_comm.c ****
350:LL_HL_comm.c **** //data fields are used for jeti commands
351:LL_HL_comm.c **** if (jetiValuePartialSyncPending == 1) {
352:LL_HL_comm.c **** jetiValuePartialSyncPending = 0;
353:LL_HL_comm.c **** LL_1khz_control_input.status = PD_JETI_SETSENSOR2;
354:LL_HL_comm.c ****
355:LL_HL_comm.c **** LL_1khz_control_input.height
356:LL_HL_comm.c **** = jetiValues[jetiSensorCnt].active;
357:LL_HL_comm.c **** memcpy(&LL_1khz_control_input.latitude,
358:LL_HL_comm.c **** &jetiValues[jetiSensorCnt].unit[0], 4);
359:LL_HL_comm.c **** LL_1khz_control_input.speed_x
360:LL_HL_comm.c **** = jetiValues[jetiSensorCnt].unit[4];
361:LL_HL_comm.c **** LL_1khz_control_input.speed_y
362:LL_HL_comm.c **** = jetiValues[jetiSensorCnt].varType;
363:LL_HL_comm.c **** LL_1khz_control_input.longitude
364:LL_HL_comm.c **** = jetiValues[jetiSensorCnt].value;
365:LL_HL_comm.c **** jetiSensorCnt++;
366:LL_HL_comm.c **** if (jetiSensorCnt == 15) {
367:LL_HL_comm.c **** jetiSensorCnt = 0;
368:LL_HL_comm.c **** }
369:LL_HL_comm.c **** jetiSyncState++;
370:LL_HL_comm.c **** jetiSensorValCnt = 0;
371:LL_HL_comm.c **** jetiSensorValUpdateTimeout = 0;
372:LL_HL_comm.c ****
373:LL_HL_comm.c **** } else {
374:LL_HL_comm.c **** switch (jetiSyncState) {
375:LL_HL_comm.c **** case 0:
376:LL_HL_comm.c **** //sync name
377:LL_HL_comm.c **** LL_1khz_control_input.status = PD_JETI_SETNAME;
378:LL_HL_comm.c **** memcpy(&LL_1khz_control_input.latitude, &jetiName[0], 4);
379:LL_HL_comm.c **** memcpy(&LL_1khz_control_input.longitude, &jetiName[4],
380:LL_HL_comm.c **** 4);
381:LL_HL_comm.c **** memcpy(&LL_1khz_control_input.speed_x, &jetiName[8], 2);
382:LL_HL_comm.c ****
383:LL_HL_comm.c **** jetiSyncState++;
384:LL_HL_comm.c **** break;
385:LL_HL_comm.c **** case 1:
386:LL_HL_comm.c **** //sync alarm
387:LL_HL_comm.c **** LL_1khz_control_input.status = PD_JETI_SETALARM;
388:LL_HL_comm.c **** LL_1khz_control_input.speed_x = jetiAlarm;
389:LL_HL_comm.c **** LL_1khz_control_input.speed_y = jetiAlarmType;
390:LL_HL_comm.c **** jetiSyncState++;
391:LL_HL_comm.c **** break;
392:LL_HL_comm.c **** case 2:
393:LL_HL_comm.c **** //sync complete sensor fields
394:LL_HL_comm.c **** if (jetiValues[jetiSensorCnt].active) {
395:LL_HL_comm.c **** LL_1khz_control_input.status = PD_JETI_SETSENSOR;
396:LL_HL_comm.c **** LL_1khz_control_input.height
397:LL_HL_comm.c **** = jetiValues[jetiSensorCnt].active;
398:LL_HL_comm.c **** memcpy(&LL_1khz_control_input.latitude,
399:LL_HL_comm.c **** &jetiValues[jetiSensorCnt].name[0], 4);
400:LL_HL_comm.c **** memcpy(&LL_1khz_control_input.longitude,
401:LL_HL_comm.c **** &jetiValues[jetiSensorCnt].name[4], 4);
402:LL_HL_comm.c **** memcpy(&LL_1khz_control_input.speed_x,
403:LL_HL_comm.c **** &jetiValues[jetiSensorCnt].name[8], 2);
404:LL_HL_comm.c **** LL_1khz_control_input.speed_y
405:LL_HL_comm.c **** = jetiValues[jetiSensorCnt].decPoint;
406:LL_HL_comm.c **** jetiValuePartialSyncPending = 1;
407:LL_HL_comm.c **** } else {
408:LL_HL_comm.c **** jetiSensorCnt++;
409:LL_HL_comm.c **** if (jetiSensorCnt == 15) {
410:LL_HL_comm.c **** jetiSensorCnt = 0;
411:LL_HL_comm.c **** }
412:LL_HL_comm.c ****
413:LL_HL_comm.c **** jetiSyncState++;
414:LL_HL_comm.c **** jetiSensorValCnt = 0;
415:LL_HL_comm.c **** jetiSensorValUpdateTimeout = 0;
416:LL_HL_comm.c **** }
417:LL_HL_comm.c **** break;
418:LL_HL_comm.c ****
419:LL_HL_comm.c **** case 3:
420:LL_HL_comm.c **** //sync text
421:LL_HL_comm.c **** LL_1khz_control_input.status = PD_JETI_SETTEXT;
422:LL_HL_comm.c **** memcpy(&LL_1khz_control_input.latitude,
423:LL_HL_comm.c **** &jetiDisplayText[0], 4);
424:LL_HL_comm.c **** memcpy(&LL_1khz_control_input.longitude,
425:LL_HL_comm.c **** &jetiDisplayText[4], 4);
426:LL_HL_comm.c **** memcpy(&LL_1khz_control_input.height,
427:LL_HL_comm.c **** &jetiDisplayText[8], 4);
428:LL_HL_comm.c **** memcpy(&LL_1khz_control_input.speed_x,
429:LL_HL_comm.c **** &jetiDisplayText[12], 2);
430:LL_HL_comm.c **** memcpy(&LL_1khz_control_input.speed_y,
431:LL_HL_comm.c **** &jetiDisplayText[14], 2);
432:LL_HL_comm.c **** jetiSyncState++;
433:LL_HL_comm.c **** break;
434:LL_HL_comm.c ****
435:LL_HL_comm.c **** case 4:
436:LL_HL_comm.c **** //sync text2
437:LL_HL_comm.c **** LL_1khz_control_input.status = PD_JETI_SETTEXT2;
438:LL_HL_comm.c ****
439:LL_HL_comm.c **** memcpy(&LL_1khz_control_input.latitude,
440:LL_HL_comm.c **** &jetiDisplayText[16], 4);
441:LL_HL_comm.c **** memcpy(&LL_1khz_control_input.longitude,
442:LL_HL_comm.c **** &jetiDisplayText[20], 4);
443:LL_HL_comm.c **** memcpy(&LL_1khz_control_input.height,
444:LL_HL_comm.c **** &jetiDisplayText[24], 4);
445:LL_HL_comm.c **** memcpy(&LL_1khz_control_input.speed_x,
446:LL_HL_comm.c **** &jetiDisplayText[28], 2);
447:LL_HL_comm.c **** memcpy(&LL_1khz_control_input.speed_y,
448:LL_HL_comm.c **** &jetiDisplayText[30], 2);
449:LL_HL_comm.c **** jetiSyncState++;
450:LL_HL_comm.c **** break;
451:LL_HL_comm.c ****
452:LL_HL_comm.c **** case 5:
453:LL_HL_comm.c **** //sync all sensor values for 75ms
454:LL_HL_comm.c ****
455:LL_HL_comm.c **** LL_1khz_control_input.status = PD_JETI_UPDATESDATA;
456:LL_HL_comm.c **** LL_1khz_control_input.height = jetiSensorValCnt;
457:LL_HL_comm.c **** LL_1khz_control_input.latitude = jetiValues[3
458:LL_HL_comm.c **** * jetiSensorValCnt].value;
459:LL_HL_comm.c **** LL_1khz_control_input.longitude = jetiValues[3
460:LL_HL_comm.c **** * jetiSensorValCnt + 1].value;
461:LL_HL_comm.c **** memcpy(&LL_1khz_control_input.speed_y,
462:LL_HL_comm.c **** (void *) (((unsigned char *) (&jetiValues[3
463:LL_HL_comm.c **** * jetiSensorValCnt + 2].value)) + 2), 2);
464:LL_HL_comm.c **** memcpy(&LL_1khz_control_input.speed_x, &jetiValues[3
465:LL_HL_comm.c **** * jetiSensorValCnt + 2].value, 2);
466:LL_HL_comm.c ****
467:LL_HL_comm.c **** jetiSensorValCnt++;
468:LL_HL_comm.c **** if (jetiSensorValCnt == 5)
469:LL_HL_comm.c **** jetiSensorValCnt = 0;
470:LL_HL_comm.c ****
471:LL_HL_comm.c **** if (jetiTriggerTextSync) {
472:LL_HL_comm.c **** jetiSyncState = 3; //trigger text resync
473:LL_HL_comm.c **** jetiTriggerTextSync = 0;
474:LL_HL_comm.c **** }
475:LL_HL_comm.c ****
476:LL_HL_comm.c **** jetiSensorValUpdateTimeout++;
477:LL_HL_comm.c **** if (jetiSensorValUpdateTimeout == 75) {
478:LL_HL_comm.c **** jetiSyncState = 0;
479:LL_HL_comm.c **** }
480:LL_HL_comm.c **** break;
481:LL_HL_comm.c **** }
482:LL_HL_comm.c **** }
483:LL_HL_comm.c **** }
484:LL_HL_comm.c **** }
485:LL_HL_comm.c ****
486:LL_HL_comm.c **** //write data
487:LL_HL_comm.c **** LL_write_ctrl_data(pageselect);
488:LL_HL_comm.c **** //set pageselect to other page for next cycle
489:LL_HL_comm.c **** pageselect = 1;
490:LL_HL_comm.c **** } else //pageselect=1
491:LL_HL_comm.c **** {
492:LL_HL_comm.c **** //fill struct with 500Hz data
493:LL_HL_comm.c **** LL_1khz_control_input.hor_accuracy = GPS_Data.horizontal_accuracy;
494:LL_HL_comm.c **** LL_1khz_control_input.vert_accuracy = GPS_Data.vertical_accuracy;
495:LL_HL_comm.c **** LL_1khz_control_input.speed_accuracy = GPS_Data.speed_accuracy;
496:LL_HL_comm.c **** LL_1khz_control_input.numSV = GPS_Data.numSV;
497:LL_HL_comm.c **** LL_1khz_control_input.battery_voltage_1 = HL_Status.battery_voltage_1;
498:LL_HL_comm.c **** LL_1khz_control_input.battery_voltage_2 = HL_Status.battery_voltage_2;
499:LL_HL_comm.c **** if (declinationAvailable == 1) {
500:LL_HL_comm.c **** declinationAvailable = 2;
501:LL_HL_comm.c **** LL_1khz_control_input.slowDataChannelSelect = SDC_DECLINATION;
502:LL_HL_comm.c **** LL_1khz_control_input.slowDataChannelDataShort
503:LL_HL_comm.c **** = estimatedDeclination;
504:LL_HL_comm.c ****
505:LL_HL_comm.c **** } else if (declinationAvailable == 2) {
506:LL_HL_comm.c **** declinationAvailable = 3;
507:LL_HL_comm.c **** LL_1khz_control_input.slowDataChannelSelect = SDC_INCLINATION;
508:LL_HL_comm.c **** LL_1khz_control_input.slowDataChannelDataShort
509:LL_HL_comm.c **** = estimatedInclination;
510:LL_HL_comm.c ****
511:LL_HL_comm.c **** } else if (transmitBuildInfoTrigger == 1) {
512:LL_HL_comm.c **** transmitBuildInfoTrigger = 2;
513:LL_HL_comm.c **** transmitCnt = 0;
514:LL_HL_comm.c **** transmitPtr = (unsigned char *) &buildInfo.version_major;
515:LL_HL_comm.c **** LL_1khz_control_input.slowDataChannelSelect = SDC_BUILDINFO;
516:LL_HL_comm.c **** LL_1khz_control_input.slowDataChannelDataShort = transmitCnt;
517:LL_HL_comm.c **** LL_1khz_control_input.slowDataChannelDataChar = *transmitPtr;
518:LL_HL_comm.c **** transmitPtr++;
519:LL_HL_comm.c **** transmitCnt++;
520:LL_HL_comm.c ****
521:LL_HL_comm.c **** } else if (transmitBuildInfoTrigger == 2) {
522:LL_HL_comm.c **** LL_1khz_control_input.slowDataChannelSelect = SDC_BUILDINFO;
523:LL_HL_comm.c **** LL_1khz_control_input.slowDataChannelDataShort = transmitCnt;
524:LL_HL_comm.c **** LL_1khz_control_input.slowDataChannelDataChar = *transmitPtr;
525:LL_HL_comm.c **** transmitPtr++;
526:LL_HL_comm.c **** transmitCnt++;
527:LL_HL_comm.c ****
528:LL_HL_comm.c **** if (transmitCnt == sizeof(buildInfo))
529:LL_HL_comm.c **** transmitBuildInfoTrigger = 3;
530:LL_HL_comm.c **** } else if (emergencyModeUpdate) {
531:LL_HL_comm.c **** LL_1khz_control_input.slowDataChannelSelect = SDC_EM_MODE;
532:LL_HL_comm.c **** LL_1khz_control_input.slowDataChannelDataShort = emergencyMode;
533:LL_HL_comm.c **** //verify mode
534:LL_HL_comm.c **** emergencyModeUpdate = 2;
535:LL_HL_comm.c **** } else {
536:LL_HL_comm.c **** LL_1khz_control_input.slowDataChannelDataShort = 0;
537:LL_HL_comm.c **** LL_1khz_control_input.slowDataChannelSelect = 0;
538:LL_HL_comm.c **** LL_1khz_control_input.slowDataChannelDataChar = 0;
539:LL_HL_comm.c **** }
540:LL_HL_comm.c ****
541:LL_HL_comm.c **** //write data
542:LL_HL_comm.c **** LL_write_ctrl_data(pageselect);
543:LL_HL_comm.c **** //set pageselect to other page for next cycle
544:LL_HL_comm.c **** pageselect = 0;
545:LL_HL_comm.c **** }
546:LL_HL_comm.c **** return (1);
547:LL_HL_comm.c **** }
548:LL_HL_comm.c ****
549:LL_HL_comm.c **** void LL_write_ctrl_data(char page) {
16 @ Function supports interworking.
17 @ args = 0, pretend = 0, frame = 0
18 @ frame_needed = 0, uses_anonymous_args = 0
19 .LVL0:
20 .loc 1 562 0
550:LL_HL_comm.c **** unsigned int i;
551:LL_HL_comm.c **** unsigned char *dataptr;
552:LL_HL_comm.c **** static volatile short spi_chksum;
553:LL_HL_comm.c ****
554:LL_HL_comm.c **** dataptr = (unsigned char *) &LL_1khz_control_input;
555:LL_HL_comm.c ****
556:LL_HL_comm.c **** //initialize syncbytes
557:LL_HL_comm.c **** SPIWRData[0] = '>';
558:LL_HL_comm.c **** SPIWRData[1] = '*';
559:LL_HL_comm.c ****
560:LL_HL_comm.c **** spi_chksum = 0xAAAA;
561:LL_HL_comm.c ****
562:LL_HL_comm.c **** if (!page) {
21 r0, #255
22 0000 FF0010E3 .loc 1 549 0
23 stmfd sp!, {r4, r5, lr}
24 0004 30402DE9 .LCFI0:
25 .loc 1 560 0
26 ldr ip, .L15
27 0008 F8C09FE5 .loc 1 557 0
28 ldr r5, .L15+4
29 000c F8509FE5 .loc 1 560 0
30 mvn r3, #21760
31 0010 553CE0E3 .loc 1 563 0
563:LL_HL_comm.c **** for (i = 2; i < 40; i++) {
32 .L15+8
33 0014 F4009F15 .LVL1:
34 .loc 1 558 0
35 mov r1, #42
36 0018 2A10A0E3 .loc 1 560 0
37 sub r3, r3, #85
38 001c 553043E2 .loc 1 557 0
39 mov r2, #62
40 0020 3E20A0E3 .loc 1 558 0
41 strb r1, [r5, #1]
42 0024 0110C5E5 .loc 1 557 0
43 strb r2, [r5, #0]
44 0028 0020C5E5 .loc 1 560 0
45 strh r3, [ip, #0] @ movhi
46 002c B030CCE1 .loc 1 563 0
47 movne r1, r5
48 0030 0510A011 addne lr, r0, #20
49 0034 14E08012 .loc 1 562 0
50 bne .L6
51 0038 1900001A ldr r0, .L15+8
52 003c CC009FE5 .LVL2:
53 mov r1, r5
54 0040 0510A0E1 add lr, r0, #38
55 0044 26E080E2 .L4:
56 .loc 1 564 0
564:LL_HL_comm.c **** SPIWRData[i] = *dataptr++;
57 _extendqisi2
58 0048 0120D0E4 .loc 1 565 0
565:LL_HL_comm.c **** spi_chksum += SPIWRData[i];
59 drh r3, [ip, #0]
60 004c B030DCE1 add r3, r3, r2
61 0050 023083E0 mov r3, r3, asl #16
62 0054 0338A0E1 mov r3, r3, lsr #16
63 0058 2338A0E1 .loc 1 563 0
64 cmp lr, r0
65 005c 00005EE1 .loc 1 564 0
66 strb r2, [r1, #2]
67 0060 0220C1E5 .loc 1 565 0
68 strh r3, [ip, #0] @ movhi
69 0064 B030CCE1 add r1, r1, #1
70 0068 011081E2 .loc 1 563 0
71 bne .L4
72 006c F5FFFF1A .LVL3:
73 .L5:
74 .loc 1 579 0
566:LL_HL_comm.c **** }
567:LL_HL_comm.c **** } else {
568:LL_HL_comm.c **** for (i = 2; i < 22; i++) {
569:LL_HL_comm.c **** SPIWRData[i] = *dataptr++;
570:LL_HL_comm.c **** spi_chksum += SPIWRData[i];
571:LL_HL_comm.c **** }
572:LL_HL_comm.c **** dataptr += 18;
573:LL_HL_comm.c **** for (i = 22; i < 40; i++) {
574:LL_HL_comm.c **** SPIWRData[i] = *dataptr++;
575:LL_HL_comm.c **** spi_chksum += SPIWRData[i];
576:LL_HL_comm.c **** }
577:LL_HL_comm.c **** }
578:LL_HL_comm.c ****
579:LL_HL_comm.c **** SPIWRData[40] = spi_chksum; //chksum LSB
75 0]
76 0070 B000DCE1 .LVL4:
77 .loc 1 580 0
580:LL_HL_comm.c **** SPIWRData[41] = (spi_chksum >> 8); //chksum MSB
78 rh r3, [ip, #0]
79 0074 B030DCE1 mov r3, r3, lsr #8
80 0078 2334A0E1 strb r3, [r5, #41]
81 007c 2930C5E5 .loc 1 582 0
581:LL_HL_comm.c ****
582:LL_HL_comm.c **** SPIWR_num_bytes = 42;
82 r3, .L15+12
83 0080 8C309FE5 mov r2, #42
84 0084 2A20A0E3 str r2, [r3, #0]
85 0088 002083E5 .loc 1 583 0
583:LL_HL_comm.c **** data_sent_to_LL = 0;
86 r3, .L15+16
87 008c 84309FE5 mov r1, #0
88 0090 0010A0E3 strb r1, [r3, #0]
89 0094 0010C3E5 .loc 1 579 0
90 strb r0, [r5, #40]
91 0098 2800C5E5 .loc 1 584 0
584:LL_HL_comm.c **** }
92 sp!, {r4, r5, lr}
93 009c 3040BDE8 bx lr
94 00a0 1EFF2FE1 .LVL5:
95 .L6:
96 .loc 1 569 0
97 ldrb r2, [r0], #1 @ zero_extendqisi2
98 00a4 0120D0E4 .loc 1 570 0
99 ldrh r3, [ip, #0]
100 00a8 B030DCE1 add r3, r3, r2
101 00ac 023083E0 mov r3, r3, asl #16
102 00b0 0338A0E1 mov r3, r3, lsr #16
103 00b4 2338A0E1 .loc 1 568 0
104 cmp r0, lr
105 00b8 0E0050E1 .loc 1 569 0
106 strb r2, [r1, #2]
107 00bc 0220C1E5 .loc 1 570 0
108 strh r3, [ip, #0] @ movhi
109 00c0 B030CCE1 add r1, r1, #1
110 00c4 011081E2 .loc 1 568 0
111 bne .L6
112 00c8 F5FFFF1A ldr lr, .L15+4
113 00cc 38E09FE5 add r4, r0, #37
114 00d0 254080E2 add r1, r0, #19
115 00d4 131080E2 .L8:
116 .loc 1 574 0
117 ldrb r2, [r1, #-1] @ zero_extendqisi2
118 00d8 012051E5 .loc 1 575 0
119 ldrh r3, [ip, #0]
120 00dc B030DCE1 add r3, r3, r2
121 00e0 023083E0 mov r3, r3, asl #16
122 00e4 0338A0E1 add r1, r1, #1
123 00e8 011081E2 mov r3, r3, lsr #16
124 00ec 2338A0E1 .loc 1 573 0
125 cmp r1, r4
126 00f0 040051E1 .loc 1 574 0
127 strb r2, [lr, #22]
128 00f4 1620CEE5 .loc 1 575 0
129 strh r3, [ip, #0] @ movhi
130 00f8 B030CCE1 add lr, lr, #1
131 00fc 01E08EE2 .loc 1 573 0
132 bne .L8
133 0100 F4FFFF1A b .L5
134 0104 D9FFFFEA .L16:
135 .align 2
136 .L15:
137 .word spi_chksum.2290
138 0108 12000000 .word SPIWRData
139 010c 00000000 .word LL_1khz_control_input
140 0110 00000000 .word SPIWR_num_bytes
141 0114 00000000 .word data_sent_to_LL
142 0118 00000000 .LFE4:
144 .align 2
145 .global HL2LL_write_cycle
147 HL2LL_write_cycle:
148 .LFB3:
149 .loc 1 188 0
150 @ Function supports interworking.
151 @ args = 0, pretend = 0, frame = 16
152 @ frame_needed = 0, uses_anonymous_args = 0
153 stmfd sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
154 011c F04F2DE9 .LCFI1:
155 .loc 1 195 0
156 ldr r3, .L104
157 0120 C4389FE5 ldrb r0, [r3, #0] @ zero_extendqisi2
158 0124 0000D3E5 cmp r0, #0
159 0128 000050E3 .loc 1 188 0
160 sub sp, sp, #16
161 012c 10D04DE2 .LCFI2:
162 .loc 1 195 0
163 beq .L20
164 0130 5C00000A .loc 1 202 0
165 ldr r3, .L104+4
166 0134 B4389FE5 .loc 1 199 0
167 ldr r8, .L104+8
168 0138 B4889FE5 .loc 1 202 0
169 ldr r2, [r3, #0]
170 013c 002093E5 .loc 1 199 0
171 ldrb r9, [r8, #0] @ zero_extendqisi2
172 0140 0090D8E5 ldr fp, .L104+12
173 0144 ACB89FE5 .loc 1 202 0
174 cmp r2, #0
175 0148 000052E3 .loc 1 205 0
176 ldr r2, .L104+16
177 014c A8289FE5 .loc 1 203 0
178 orrne r3, r9, #8
179 0150 08308913 .loc 1 199 0
180 strh r9, [fp, #0] @ movhi
181 0154 B090CBE1 .loc 1 203 0
182 strneh r3, [fp, #0] @ movhi
183 0158 B030CB11 .loc 1 205 0
184 ldrb r3, [r2, #1] @ zero_extendqisi2
185 015c 0130D2E5 cmp r3, #0
186 0160 000053E3 .loc 1 206 0
187 ldrneh r3, [fp, #0]
188 0164 B030DB11 .loc 1 209 0
189 ldreqh r3, [fp, #0]
190 0168 B030DB01 .loc 1 206 0
191 orrne r3, r3, #-1073741808
192 016c 43318313 .loc 1 209 0
193 biceq r3, r3, #16
194 0170 1030C303 .loc 1 206 0
195 orrne r3, r3, #1069547520
196 0174 FF358313 .loc 1 209 0
197 moveq r3, r3, asl #17
198 0178 8338A001 .loc 1 206 0
199 orrne r3, r3, #4161536
200 017c FE398313 .loc 1 209 0
201 moveq r3, r3, lsr #17
202 0180 A338A001 .loc 1 206 0
203 strneh r3, [fp, #0] @ movhi
204 0184 B030CB11 .loc 1 209 0
205 streqh r3, [fp, #0] @ movhi
206 0188 B030CB01 .loc 1 212 0
207 ldrb r3, [r2, #2] @ zero_extendqisi2
208 018c 0230D2E5 cmp r3, #0
209 0190 000053E3 .loc 1 213 0
210 ldrneh r3, [fp, #0]
211 0194 B030DB11 .loc 1 216 0
212 ldreqh r3, [fp, #0]
213 0198 B030DB01 .loc 1 213 0
214 orrne r3, r3, #256
215 019c 013C8313 .loc 1 216 0
216 biceq r3, r3, #256
217 01a0 013CC303 .loc 1 213 0
218 strneh r3, [fp, #0] @ movhi
219 01a4 B030CB11 .loc 1 216 0
220 streqh r3, [fp, #0] @ movhi
221 01a8 B030CB01 .loc 1 219 0
222 ldrb r3, [r2, #0] @ zero_extendqisi2
223 01ac 0030D2E5 cmp r3, #0
224 01b0 000053E3 beq .L90
225 01b4 3E00000A .loc 1 228 0
226 cmp r3, #1
227 01b8 010053E3 beq .L91
228 01bc 8E00000A .loc 1 239 0
229 cmp r3, #2
230 01c0 020053E3 beq .L92
231 01c4 7500000A .loc 1 248 0
232 cmp r3, #3
233 01c8 030053E3 beq .L93
234 01cc 3B01000A .loc 1 315 0
235 ldrh r3, [fp, #0]
236 01d0 B030DBE1 .loc 1 318 0
237 cmp r9, #0
238 01d4 000059E3 .loc 1 315 0
239 bic r3, r3, #224
240 01d8 E030C3E3 strh r3, [fp, #0] @ movhi
241 01dc B030CBE1 .loc 1 318 0
242 beq .L94
243 01e0 4400000A .L46:
244 .loc 1 499 0
245 ldr r1, .L104+20
246 01e4 14189FE5 ldrb r3, [r1, #0] @ zero_extendqisi2
247 01e8 0030D1E5 and r0, r3, #255
248 01ec FF0003E2 .loc 1 497 0
249 ldr r3, .L104+24
250 01f0 0C389FE5 .loc 1 493 0
251 ldr r2, .L104+28
252 01f4 0C289FE5 .loc 1 498 0
253 ldrh ip, [r3, #2]
254 01f8 B2C0D3E1 strh ip, [fp, #50] @ movhi
255 01fc B2C3CBE1 .loc 1 496 0
256 ldrh ip, [r2, #36]
257 0200 B4C2D2E1 strh ip, [fp, #44] @ movhi
258 0204 BCC2CBE1 .loc 1 493 0
259 ldrh ip, [r2, #24]
260 0208 B8C1D2E1 .loc 1 497 0
261 ldrh r3, [r3, #0]
262 020c B030D3E1 .loc 1 493 0
263 strh ip, [fp, #38] @ movhi
264 0210 B6C2CBE1 .loc 1 494 0
265 ldrh ip, [r2, #28]
266 0214 BCC1D2E1 .loc 1 495 0
267 ldrh r2, [r2, #32]
268 0218 B022D2E1 .loc 1 499 0
269 cmp r0, #1
270 021c 010050E3 .loc 1 494 0
271 strh ip, [fp, #40] @ movhi
272 0220 B8C2CBE1 .loc 1 495 0
273 strh r2, [fp, #42] @ movhi
274 0224 BA22CBE1 .loc 1 497 0
275 strh r3, [fp, #48] @ movhi
276 0228 B033CBE1 .loc 1 493 0
277 ldr lr, .L104+12
278 022c C4E79FE5 .loc 1 499 0
279 beq .L95
280 0230 7E00000A .loc 1 505 0
281 ldrb r3, [r1, #0] @ zero_extendqisi2
282 0234 0030D1E5 cmp r3, #2
283 0238 020053E3 beq .L96
284 023c 6600000A .loc 1 511 0
285 ldr r4, .L104+32
286 0240 C4479FE5 ldrb r3, [r4, #0] @ zero_extendqisi2
287 0244 0030D4E5 and r0, r3, #255
288 0248 FF0003E2 cmp r0, #1
289 024c 010050E3 beq .L97
290 0250 2F01000A .loc 1 521 0
291 ldrb r3, [r4, #0] @ zero_extendqisi2
292 0254 0030D4E5 cmp r3, #2
293 0258 020053E3 beq .L98
294 025c 3A01000A .loc 1 530 0
295 ldr r1, .L104+36
296 0260 A8179FE5 ldrb r3, [r1, #0] @ zero_extendqisi2
297 0264 0030D1E5 cmp r3, #0
298 0268 000053E3 .loc 1 532 0
299 ldrne r3, .L104+40
300 026c A0379F15 ldrneb r2, [r3, #0] @ zero_extendqisi2
301 0270 0020D315 .loc 1 534 0
302 movne r3, #2
303 0274 0230A013 .loc 1 532 0
304 strneh r2, [lr, #54] @ movhi
305 0278 B623CE11 .loc 1 531 0
306 movne r2, #24
307 027c 1820A013 .loc 1 534 0
308 strneb r3, [r1, #0]
309 0280 0030C115 .loc 1 531 0
310 strneb r2, [lr, #52]
311 0284 3420CE15 .loc 1 538 0
312 streqb r3, [lr, #53]
313 0288 3530CE05 .loc 1 536 0
314 streqh r3, [lr, #54] @ movhi
315 028c B633CE01 .loc 1 537 0
316 streqb r3, [lr, #52]
317 0290 3430CE05 .L75:
318 .loc 1 542 0
319 mov r0, r9
320 0294 0900A0E1 bl LL_write_ctrl_data
321 0298 FEFFFFEB .loc 1 544 0
322 mov r3, #0
323 029c 0030A0E3 strb r3, [r8, #0]
324 02a0 0030C8E5 mov r0, #1
325 02a4 0100A0E3 .L20:
326 .loc 1 547 0
327 add sp, sp, #16
328 02a8 10D08DE2 ldmfd sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
329 02ac F04FBDE8 bx lr
330 02b0 1EFF2FE1 .L90:
331 .loc 1 221 0
332 ldrh r3, [fp, #0]
333 02b4 B030DBE1 .loc 1 226 0
334 ldr r1, .L104+44
335 02b8 58179FE5 .loc 1 221 0
336 orr r3, r3, #128
337 02bc 803083E3 strh r3, [fp, #0] @ movhi
338 02c0 B030CBE1 .loc 1 226 0
339 ldrb r2, [r1, #8] @ zero_extendqisi2
340 02c4 0820D1E5 ldr fp, .L104+12
341 02c8 28B79FE5 mov r2, r2, asl #8
342 02cc 0224A0E1 mov r0, fp
343 02d0 0B00A0E1 add ip, r1, #8
344 02d4 08C081E2 .L31:
345 .loc 1 224 0
346 ldrb r3, [r1], #1 @ zero_extendqisi2
347 02d8 0130D1E4 .loc 1 223 0
348 cmp r1, ip
349 02dc 0C0051E1 .loc 1 224 0
350 strb r3, [r0, #12]
351 02e0 0C30C0E5 .loc 1 226 0
352 add r0, r0, #1
353 02e4 010080E2 .loc 1 223 0
354 bne .L31
355 02e8 FAFFFF1A strh r2, [fp, #2] @ movhi
356 02ec B220CBE1 .L32:
357 .loc 1 318 0
358 cmp r9, #0
359 02f0 000059E3 bne .L46
360 02f4 BAFFFF1A .L94:
361 .loc 1 319 0
362 ldrh r3, [fp, #0]
363 02f8 B030DBE1 tst r3, #8
364 02fc 080013E3 ldr r5, .L104+12
365 0300 F0569FE5 bne .L99
366 0304 1000001A .LBB2:
367 .loc 1 351 0
368 ldr r6, .L104+48
369 0308 0C679FE5 ldrb r3, [r6, #0] @ zero_extendqisi2
370 030c 0030D6E5 cmp r3, #1
371 0310 010053E3 .LBE2:
372 .loc 1 330 0
373 strh r9, [r5, #36] @ movhi
374 0314 B492C5E1 mov r7, r9 @ movhi
375 0318 0970A0E1 .LBB3:
376 .loc 1 351 0
377 beq .L100
378 031c 1C01000A .loc 1 374 0
379 ldr sl, .L104+52
380 0320 F8A69FE5 ldrb r3, [sl, #0] @ zero_extendqisi2
381 0324 0030DAE5 cmp r3, #5
382 0328 050053E3 ldrls pc, [pc, r3, asl #2]
383 032c 03F19F97 b .L50
384 0330 140000EA .p2align 2
385 .L63:
386 .word .L57
387 0334 4C040000 .word .L58
388 0338 94040000 .word .L59
389 033c C0040000 .word .L60
390 0340 18050000 .word .L61
391 0344 6C050000 .word .L62
392 0348 C0050000 .L99:
393 .LBE3:
394 .loc 1 321 0
395 ldr r3, .L104+28
396 034c B4369FE5 ldr r2, [r3, #0]
397 0350 002093E5 .loc 1 322 0
398 ldr r1, [r3, #4]
399 0354 041093E5 .loc 1 323 0
400 ldr r0, [r3, #8]
401 0358 080093E5 .loc 1 327 0
402 ldrh ip, [r3, #40]
403 035c B8C2D3E1 .loc 1 321 0
404 str r2, [r5, #20]
405 0360 142085E5 .loc 1 322 0
406 str r1, [r5, #24]
407 0364 181085E5 .loc 1 325 0
408 ldrh r2, [r3, #16]
409 0368 B021D3E1 .loc 1 324 0
410 ldrh r1, [r3, #12]
411 036c BC10D3E1 .loc 1 326 0
412 ldrh r3, [r3, #20]
413 0370 B431D3E1 .loc 1 327 0
414 strh ip, [r5, #36] @ movhi
415 0374 B4C2C5E1 .loc 1 323 0
416 str r0, [r5, #28]
417 0378 1C0085E5 .loc 1 324 0
418 strh r1, [r5, #32] @ movhi
419 037c B012C5E1 .loc 1 325 0
420 strh r2, [r5, #34] @ movhi
421 0380 B222C5E1 .loc 1 326 0
422 strh r3, [r5, #46] @ movhi
423 0384 BE32C5E1 .L50:
424 .loc 1 487 0
425 ldrb r0, [r8, #0] @ zero_extendqisi2
426 0388 0000D8E5 bl LL_write_ctrl_data