-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadctest.asm
More file actions
2635 lines (2544 loc) · 106 KB
/
adctest.asm
File metadata and controls
2635 lines (2544 loc) · 106 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
GAS LISTING /tmp/ccPLkBqf.s page 1
1 .file "adcTest.ino.ino.cpp"
2 __SP_H__ = 0x3e
3 __SP_L__ = 0x3d
4 __SREG__ = 0x3f
5 __RAMPZ__ = 0x3b
6 __tmp_reg__ = 0
7 __zero_reg__ = 1
8 .text
9 .Ltext0:
10 .cfi_sections .debug_frame
11 .section .text.__vector_21,"ax",@progbits
12 .global __vector_21
13 .type __vector_21, @function
14 __vector_21:
15 .LFB120:
16 .file 1 "/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino"
1:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** typedef enum {REF_AREF=0, REF_AVCC=64, REF_1V=128, REF_256V=192} ADCREF;
2:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** typedef enum {TRIG_ROUND=0, TRIG_COMPARATOR, TRIG_INT0, TRIG_T0A, TRIG_T0OVF, TRIG_T1B, TRIG_T1OVF,
3:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** typedef enum {
4:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** MUX_0=0, MUX_1, MUX_2, MUX_3, MUX_4, MUX_5, MUX_6, MUX_7,
5:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** MUX_G10_00, MUX_G10_10, MUX_G200_00, MUX_G200_10,
6:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** MUX_G10_22, MUX_G10_32, MUX_G200_22, MUX_G200_32,
7:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** MUX_D01, MUX_D11, MUX_D21, MUX_D31, MUX_D41, MUX_D51, MUX_D61, MUX_D71,
8:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** MUX_D02, MUX_D12, MUX_D22, MUX_D32, MUX_D42, MUX_D52,
9:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** MUX_1V, MUX_GND,
10:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** MUX_8, MUX_9, MUX_A, MUX_B, MUX_C, MUX_D, MUX_E, MUX_F,
11:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** MUX_G10_88, MUX_G10_98, MUX_G200_88, MUX_G200_98,
12:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** MUX_G10_AA, MUX_G10_BA, MUX_G200_AA, MUX_G200_BA,
13:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** MUX_D89, MUX_D99, MUX_DA9, MUX_DB9, MUX_DC9, MUX_DD9, MUX_DE9, MUX_DF9,
14:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** MUX_D8A, MUX_D9A, MUX_DAA, MUX_DBA, MUX_DCA, MUX_DDA
15:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** } ADCMUX;
16:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** /*
17:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** #define adcStart() (ADCSRA |= ADSC)
18:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** #define adc8bit() (ADMUX |= ADLAR)
19:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** #define adc10bit() (ADMUX &= ~ADLAR)
20:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** #define adcIntOn() (ADCSRA |= ADIE)
21:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** #define adcIntOff() (ADCSRA &= ~ADIE)
22:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** #define adc2comp() (ADCSRB |= ACME)
23:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** */
24:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** // ADMUX: REFS1(7), REFS0(6), ADLAR(5), MUX4..0
25:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** // ADCSRA: ADEN(7), ADSC(6), ADATE(5), ADIF(4), ADIE(3), ADPS0..2
26:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** // ADCSRB: ACME(6), ADMUX5(3),ADTS0..2
27:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** // DIDR0: Closed PINx for noise redusing ADC7..0
28:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** // DIDR2: Closed PINx for noise reducing ADC15..8
29:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** // PRR0: bit0=1 ADC power off!
30:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino ****
31:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** extern "C" {
32:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** #define ADC_GO 0
33:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** #define ADC_START 1
34:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** #define ADC_DONE 2
35:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino ****
36:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** int adcCount; // how much need to read samples
37:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** volatile uint8_t * adcBuffer; // pointer to buffer array
38:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** volatile uint8_t adcState = ADC_START;
39:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino ****
40:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** ISR (ADC_vect, ISR_NAKED)
41:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** {
GAS LISTING /tmp/ccPLkBqf.s page 2
17 .loc 1 41 0
18 .cfi_startproc
19 /* prologue: naked */
20 /* frame size = 0 */
21 /* stack size = 0 */
22 .L__stack_usage = 0
42:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** if( adcState == ADC_START ){
23 .loc 1 42 0
24 0000 8091 0000 lds r24,adcState
25 0004 8130 cpi r24,lo8(1)
26 0006 01F4 brne .L1
43:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** if( adcCount-- ){
27 .loc 1 43 0
28 0008 8091 0000 lds r24,adcCount
29 000c 9091 0000 lds r25,adcCount+1
30 0010 9C01 movw r18,r24
31 0012 2150 subi r18,1
32 0014 3109 sbc r19,__zero_reg__
33 0016 3093 0000 sts adcCount+1,r19
34 001a 2093 0000 sts adcCount,r18
35 001e 0097 sbiw r24,0
36 0020 01F0 breq .L3
44:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** *adcBuffer++ = ADCH;
37 .loc 1 44 0
38 0022 E091 0000 lds r30,adcBuffer
39 0026 F091 0000 lds r31,adcBuffer+1
40 002a CF01 movw r24,r30
41 002c 0196 adiw r24,1
42 002e 9093 0000 sts adcBuffer+1,r25
43 0032 8093 0000 sts adcBuffer,r24
44 0036 85B1 in r24,0x5
45 0038 8083 st Z,r24
46 003a 00C0 rjmp .L1
47 .L3:
45:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** }else{
46:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** adcState = ADC_DONE;
48 .loc 1 46 0
49 003c 82E0 ldi r24,lo8(2)
50 003e 8093 0000 sts adcState,r24
47:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** ADCSRA &= ~( _BV(ADIE)|_BV(ADFR) );
51 .loc 1 47 0
52 0042 86B1 in r24,0x6
53 0044 877D andi r24,lo8(-41)
54 0046 86B9 out 0x6,r24
55 .L1:
56 /* epilogue start */
48:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** }
49:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** }
50:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** }
57 .loc 1 50 0
58 .cfi_endproc
59 .LFE120:
60 .size __vector_21, .-__vector_21
61 .section .text.adcReadOne,"ax",@progbits
62 .global adcReadOne
63 .type adcReadOne, @function
64 adcReadOne:
GAS LISTING /tmp/ccPLkBqf.s page 3
65 .LFB121:
51:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino ****
52:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** }
53:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino ****
54:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** uint8_t adcReadOne()
55:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** {
66 .loc 1 55 0
67 .cfi_startproc
68 /* prologue: function */
69 /* frame size = 0 */
70 /* stack size = 0 */
71 .L__stack_usage = 0
56:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** ADCSRA |= _BV(ADSC);
72 .loc 1 56 0
73 0000 369A sbi 0x6,6
74 .L5:
57:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** while( ADCSRA & _BV(ADSC) );
75 .loc 1 57 0 discriminator 1
76 0002 3699 sbic 0x6,6
77 0004 00C0 rjmp .L5
58:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** return ADCH;
78 .loc 1 58 0
79 0006 85B1 in r24,0x5
59:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** }
80 .loc 1 59 0
81 0008 0895 ret
82 .cfi_endproc
83 .LFE121:
84 .size adcReadOne, .-adcReadOne
85 .section .text.adcStart,"ax",@progbits
86 .global adcStart
87 .type adcStart, @function
88 adcStart:
89 .LFB122:
60:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino ****
61:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** void adcStart(uint8_t * from, int len, uint8_t speed)
62:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** {
90 .loc 1 62 0
91 .cfi_startproc
92 .LVL0:
93 /* prologue: function */
94 /* frame size = 0 */
95 /* stack size = 0 */
96 .L__stack_usage = 0
63:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** adcBuffer = from;
97 .loc 1 63 0
98 0000 9093 0000 sts adcBuffer+1,r25
99 0004 8093 0000 sts adcBuffer,r24
64:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** adcCount = len;
100 .loc 1 64 0
101 0008 7093 0000 sts adcCount+1,r23
102 000c 6093 0000 sts adcCount,r22
65:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** adcState = ADC_START;
103 .loc 1 65 0
104 0010 81E0 ldi r24,lo8(1)
105 .LVL1:
106 0012 8093 0000 sts adcState,r24
GAS LISTING /tmp/ccPLkBqf.s page 4
66:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** ADCSRA |= _BV(ADSC) | _BV(ADIE) | _BV(ADFR) | (0x03 & speed);
107 .loc 1 66 0
108 0016 86B1 in r24,0x6
109 0018 8866 ori r24,lo8(104)
110 001a 4370 andi r20,lo8(3)
111 .LVL2:
112 001c 482B or r20,r24
113 001e 46B9 out 0x6,r20
114 .LVL3:
115 0020 0895 ret
116 .cfi_endproc
117 .LFE122:
118 .size adcStart, .-adcStart
119 .section .text.test,"ax",@progbits
120 .global test
121 .type test, @function
122 test:
123 .LFB123:
67:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** }
68:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino ****
69:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** #define MAX_BUF 400
70:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** uint8_t adcs[MAX_BUF];
71:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino ****
72:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** void test(int start, int len)
73:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** {
124 .loc 1 73 0
125 .cfi_startproc
126 .LVL4:
127 0000 EF92 push r14
128 .LCFI0:
129 .cfi_def_cfa_offset 3
130 .cfi_offset 14, -2
131 0002 FF92 push r15
132 .LCFI1:
133 .cfi_def_cfa_offset 4
134 .cfi_offset 15, -3
135 0004 0F93 push r16
136 .LCFI2:
137 .cfi_def_cfa_offset 5
138 .cfi_offset 16, -4
139 0006 1F93 push r17
140 .LCFI3:
141 .cfi_def_cfa_offset 6
142 .cfi_offset 17, -5
143 0008 CF93 push r28
144 .LCFI4:
145 .cfi_def_cfa_offset 7
146 .cfi_offset 28, -6
147 000a DF93 push r29
148 .LCFI5:
149 .cfi_def_cfa_offset 8
150 .cfi_offset 29, -7
151 /* prologue: function */
152 /* frame size = 0 */
153 /* stack size = 6 */
154 .L__stack_usage = 6
155 000c 7B01 movw r14,r22
GAS LISTING /tmp/ccPLkBqf.s page 5
156 .LVL5:
157 .LBB2:
74:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** uint8_t* ptr = &adcs[start];
158 .loc 1 74 0
159 000e EC01 movw r28,r24
160 0010 C050 subi r28,lo8(-(adcs))
161 0012 D040 sbci r29,hi8(-(adcs))
162 0014 8C01 movw r16,r24
163 0016 0C1B sub r16,r28
164 0018 1D0B sbc r17,r29
165 .LVL6:
166 .L10:
167 001a C801 movw r24,r16
168 001c 8C0F add r24,r28
169 001e 9D1F adc r25,r29
170 .LBB3:
75:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino ****
76:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** for(int i=start; i<len; i++){
171 .loc 1 76 0 discriminator 1
172 0020 8E15 cp r24,r14
173 0022 9F05 cpc r25,r15
174 0024 04F4 brge .L12
175 .LVL7:
77:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** *(ptr++) = adcReadOne();
176 .loc 1 77 0 discriminator 3
177 0026 0E94 0000 call adcReadOne
178 .LVL8:
179 002a 8993 st Y+,r24
180 .LVL9:
181 002c 00C0 rjmp .L10
182 .L12:
183 /* epilogue start */
184 .LBE3:
185 .LBE2:
78:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** }
79:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** }
186 .loc 1 79 0
187 002e DF91 pop r29
188 0030 CF91 pop r28
189 .LVL10:
190 0032 1F91 pop r17
191 0034 0F91 pop r16
192 0036 FF90 pop r15
193 0038 EF90 pop r14
194 .LVL11:
195 003a 0895 ret
196 .cfi_endproc
197 .LFE123:
198 .size test, .-test
199 .section .text.setup,"ax",@progbits
200 .global setup
201 .type setup, @function
202 setup:
203 .LFB124:
80:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino ****
81:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** void setup() {
204 .loc 1 81 0
GAS LISTING /tmp/ccPLkBqf.s page 6
205 .cfi_startproc
206 /* prologue: function */
207 /* frame size = 0 */
208 /* stack size = 0 */
209 .L__stack_usage = 0
210 .LVL12:
211 .LBB6:
212 .LBB7:
213 .file 2 "/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSer
1:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** /*
2:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** HardwareSerial.h - Hardware serial library for Wiring
3:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** Copyright (c) 2006 Nicholas Zambetti. All right reserved.
4:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h ****
5:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** This library is free software; you can redistribute it and/or
6:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** modify it under the terms of the GNU Lesser General Public
7:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** License as published by the Free Software Foundation; either
8:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** version 2.1 of the License, or (at your option) any later version.
9:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h ****
10:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** This library is distributed in the hope that it will be useful,
11:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** but WITHOUT ANY WARRANTY; without even the implied warranty of
12:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** Lesser General Public License for more details.
14:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h ****
15:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** You should have received a copy of the GNU Lesser General Public
16:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** License along with this library; if not, write to the Free Software
17:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h ****
19:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** Modified 28 September 2010 by Mark Sproul
20:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** Modified 14 August 2012 by Alarus
21:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** Modified 3 December 2013 by Matthijs Kooijman
22:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** */
23:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h ****
24:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #ifndef HardwareSerial_h
25:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define HardwareSerial_h
26:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h ****
27:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #include <inttypes.h>
28:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h ****
29:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #include "Stream.h"
30:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h ****
31:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** // Define constants and variables for buffering incoming serial data. We're
32:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** // using a ring buffer (I think), in which head is the index of the location
33:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** // to which to write the next incoming character and tail is the index of the
34:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** // location from which to read.
35:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** // NOTE: a "power of 2" buffer size is reccomended to dramatically
36:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** // optimize all the modulo operations for ring buffers.
37:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** // WARNING: When buffer sizes are increased to > 256, the buffer index
38:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** // variables are automatically increased in size, but the extra
39:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** // atomicity guards needed for that are not implemented. This will
40:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** // often work, but occasionally a race condition can occur that makes
41:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** // Serial behave erratically. See https://github.com/arduino/Arduino/issues/2405
42:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #if !defined(SERIAL_TX_BUFFER_SIZE)
43:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #if ((RAMEND - RAMSTART) < 1023)
44:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_TX_BUFFER_SIZE 16
45:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #else
46:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_TX_BUFFER_SIZE 64
47:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #endif
48:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #endif
GAS LISTING /tmp/ccPLkBqf.s page 7
49:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #if !defined(SERIAL_RX_BUFFER_SIZE)
50:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #if ((RAMEND - RAMSTART) < 1023)
51:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_RX_BUFFER_SIZE 16
52:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #else
53:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_RX_BUFFER_SIZE 64
54:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #endif
55:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #endif
56:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #if (SERIAL_TX_BUFFER_SIZE>256)
57:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** typedef uint16_t tx_buffer_index_t;
58:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #else
59:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** typedef uint8_t tx_buffer_index_t;
60:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #endif
61:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #if (SERIAL_RX_BUFFER_SIZE>256)
62:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** typedef uint16_t rx_buffer_index_t;
63:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #else
64:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** typedef uint8_t rx_buffer_index_t;
65:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #endif
66:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h ****
67:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** // Define config for Serial.begin(baud, config);
68:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_5N1 0x00
69:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_6N1 0x02
70:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_7N1 0x04
71:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_8N1 0x06
72:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_5N2 0x08
73:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_6N2 0x0A
74:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_7N2 0x0C
75:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_8N2 0x0E
76:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_5E1 0x20
77:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_6E1 0x22
78:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_7E1 0x24
79:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_8E1 0x26
80:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_5E2 0x28
81:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_6E2 0x2A
82:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_7E2 0x2C
83:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_8E2 0x2E
84:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_5O1 0x30
85:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_6O1 0x32
86:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_7O1 0x34
87:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_8O1 0x36
88:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_5O2 0x38
89:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_6O2 0x3A
90:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_7O2 0x3C
91:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** #define SERIAL_8O2 0x3E
92:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h ****
93:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** class HardwareSerial : public Stream
94:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** {
95:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** protected:
96:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** volatile uint8_t * const _ubrrh;
97:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** volatile uint8_t * const _ubrrl;
98:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** volatile uint8_t * const _ucsra;
99:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** volatile uint8_t * const _ucsrb;
100:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** volatile uint8_t * const _ucsrc;
101:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** volatile uint8_t * const _udr;
102:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** // Has any byte been written to the UART since begin()
103:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** bool _written;
104:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h ****
105:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** volatile rx_buffer_index_t _rx_buffer_head;
GAS LISTING /tmp/ccPLkBqf.s page 8
106:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** volatile rx_buffer_index_t _rx_buffer_tail;
107:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** volatile tx_buffer_index_t _tx_buffer_head;
108:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** volatile tx_buffer_index_t _tx_buffer_tail;
109:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h ****
110:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** // Don't put any members after these buffers, since only the first
111:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** // 32 bytes of this struct can be accessed quickly using the ldd
112:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** // instruction.
113:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** unsigned char _rx_buffer[SERIAL_RX_BUFFER_SIZE];
114:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** unsigned char _tx_buffer[SERIAL_TX_BUFFER_SIZE];
115:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h ****
116:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** public:
117:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** inline HardwareSerial(
118:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** volatile uint8_t *ubrrh, volatile uint8_t *ubrrl,
119:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** volatile uint8_t *ucsra, volatile uint8_t *ucsrb,
120:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** volatile uint8_t *ucsrc, volatile uint8_t *udr);
121:/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/HardwareSerial.h **** void begin(unsigned long baud) { begin(baud, SERIAL_8N1); }
214 .loc 2 121 0
215 0000 26E0 ldi r18,lo8(6)
216 0002 40E0 ldi r20,0
217 0004 52EC ldi r21,lo8(-62)
218 0006 61E0 ldi r22,lo8(1)
219 0008 70E0 ldi r23,0
220 000a 80E0 ldi r24,lo8(Serial)
221 000c 90E0 ldi r25,hi8(Serial)
222 000e 0E94 0000 call _ZN14HardwareSerial5beginEmh
223 .LVL13:
224 .LBE7:
225 .LBE6:
82:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** Serial.begin(115200);
83:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** TCCR3A = 128+32+8+1; // A,B,C normal + 01 - WGM1,WGM0
226 .loc 1 83 0
227 0012 89EA ldi r24,lo8(-87)
228 0014 8093 8B00 sts 139,r24
84:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** TCCR3B = 0+2; // WGM3,WGM2=01 - "5mode:FastPWM255", Prescaler:1=16Mhz, 2=2Mhz
229 .loc 1 84 0
230 0018 82E0 ldi r24,lo8(2)
231 001a 8093 8A00 sts 138,r24
85:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** OCR3A = 192;
232 .loc 1 85 0
233 001e 80EC ldi r24,lo8(-64)
234 0020 90E0 ldi r25,0
235 0022 9093 8700 sts 134+1,r25
236 0026 8093 8600 sts 134,r24
86:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** OCR3B = 128;
237 .loc 1 86 0
238 002a 80E8 ldi r24,lo8(-128)
239 002c 90E0 ldi r25,0
240 002e 9093 8500 sts 132+1,r25
241 0032 8093 8400 sts 132,r24
87:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** OCR3C = 64;
242 .loc 1 87 0
243 0036 80E4 ldi r24,lo8(64)
244 0038 90E0 ldi r25,0
245 003a 9093 8300 sts 130+1,r25
246 003e 8093 8200 sts 130,r24
88:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** DDRE = _BV(3)|_BV(4)|_BV(5); // T3 A,B,C to uptput!
247 .loc 1 88 0
GAS LISTING /tmp/ccPLkBqf.s page 9
248 0042 88E3 ldi r24,lo8(56)
249 0044 82B9 out 0x2,r24
89:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino ****
90:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** ADMUX = 64|32;
250 .loc 1 90 0
251 0046 80E6 ldi r24,lo8(96)
252 0048 87B9 out 0x7,r24
91:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** // DIDR0 = 1;
92:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** // ADCSRB = 0;
93:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** /*
94:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** ADCSRA = _BV(ADEN) | 2; // 1:2 = 8Mhz
95:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** delayMicroseconds(10);
96:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** test(0, MAX_BUF/2);
97:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino ****
98:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** ADCSRA = _BV(ADEN) | 4; // 1:4 = 4Mhz
99:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** delayMicroseconds(10);
100:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** test(MAX_BUF/2+1, MAX_BUF);
101:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino ****
102:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** for(int i=0; i<MAX_BUF; i++){
103:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** Serial.println(adcs[i], DEC);
104:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** }
105:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** */
106:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** ADCSRA = _BV(ADEN);
253 .loc 1 106 0
254 004a 80E8 ldi r24,lo8(-128)
255 004c 86B9 out 0x6,r24
107:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** delayMicroseconds(10);
256 .loc 1 107 0
257 004e 8AE0 ldi r24,lo8(10)
258 0050 90E0 ldi r25,0
259 0052 0E94 0000 call delayMicroseconds
260 .LVL14:
108:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** adcState = 0;
261 .loc 1 108 0
262 0056 1092 0000 sts adcState,__zero_reg__
263 005a 0895 ret
264 .cfi_endproc
265 .LFE124:
266 .size setup, .-setup
267 .section .text.loop,"ax",@progbits
268 .global loop
269 .type loop, @function
270 loop:
271 .LFB125:
109:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** }
110:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino ****
111:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** void loop()
112:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** {
272 .loc 1 112 0
273 .cfi_startproc
274 0000 CF93 push r28
275 .LCFI6:
276 .cfi_def_cfa_offset 3
277 .cfi_offset 28, -2
278 0002 DF93 push r29
279 .LCFI7:
280 .cfi_def_cfa_offset 4
GAS LISTING /tmp/ccPLkBqf.s page 10
281 .cfi_offset 29, -3
282 /* prologue: function */
283 /* frame size = 0 */
284 /* stack size = 2 */
285 .L__stack_usage = 2
286 .LBB8:
113:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** switch(adcState){
287 .loc 1 113 0
288 0004 8091 0000 lds r24,adcState
289 0008 8130 cpi r24,lo8(1)
290 000a 01F0 breq .L14
291 000c 8230 cpi r24,lo8(2)
292 000e 01F4 brne .L15
293 0010 C0E0 ldi r28,lo8(adcs)
294 0012 D0E0 ldi r29,hi8(adcs)
295 .L18:
296 .LVL15:
297 .LBB9:
298 .LBB10:
114:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** case ADC_START:
115:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** break;
116:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** case ADC_DONE:
117:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** for(int i=0; i<MAX_BUF; i++){
118:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** Serial.println(adcs[i], DEC);
299 .loc 1 118 0 discriminator 3
300 0014 6991 ld r22,Y+
301 .LVL16:
302 0016 4AE0 ldi r20,lo8(10)
303 0018 50E0 ldi r21,0
304 001a 80E0 ldi r24,lo8(Serial)
305 001c 90E0 ldi r25,hi8(Serial)
306 001e 0E94 0000 call _ZN5Print7printlnEhi
307 .LVL17:
117:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** Serial.println(adcs[i], DEC);
308 .loc 1 117 0 discriminator 3
309 0022 80E0 ldi r24,hi8(adcs+400)
310 0024 C030 cpi r28,lo8(adcs+400)
311 0026 D807 cpc r29,r24
312 0028 01F4 brne .L18
313 .LBE10:
119:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** }
120:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** adcState=0;
314 .loc 1 120 0
315 002a 1092 0000 sts adcState,__zero_reg__
121:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** delay(10000);
316 .loc 1 121 0
317 002e 60E1 ldi r22,lo8(16)
318 0030 77E2 ldi r23,lo8(39)
319 0032 80E0 ldi r24,0
320 0034 90E0 ldi r25,0
321 0036 0E94 0000 call delay
322 .LVL18:
323 .L15:
122:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** default:
123:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** adcStart(&adcs[0], MAX_BUF, 3);
324 .loc 1 123 0
325 003a 43E0 ldi r20,lo8(3)
GAS LISTING /tmp/ccPLkBqf.s page 11
326 003c 60E9 ldi r22,lo8(-112)
327 003e 71E0 ldi r23,lo8(1)
328 0040 80E0 ldi r24,lo8(adcs)
329 0042 90E0 ldi r25,hi8(adcs)
330 /* epilogue start */
331 .LBE9:
332 .LBE8:
124:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** }
125:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** }
333 .loc 1 125 0
334 0044 DF91 pop r29
335 0046 CF91 pop r28
336 .LBB12:
337 .LBB11:
123:/home/arhat109/Arduino/tests/adcTest.ino/adcTest.ino.ino **** }
338 .loc 1 123 0
339 0048 0C94 0000 jmp adcStart
340 .LVL19:
341 .L14:
342 /* epilogue start */
343 .LBE11:
344 .LBE12:
345 .loc 1 125 0
346 004c DF91 pop r29
347 004e CF91 pop r28
348 0050 0895 ret
349 .cfi_endproc
350 .LFE125:
351 .size loop, .-loop
352 .global adcs
353 .section .bss.adcs,"aw",@nobits
354 .type adcs, @object
355 .size adcs, 400
356 adcs:
357 0000 0000 0000 .zero 400
357 0000 0000
357 0000 0000
357 0000 0000
357 0000 0000
358 .global adcState
359 .section .data.adcState,"aw",@progbits
360 .type adcState, @object
361 .size adcState, 1
362 adcState:
363 0000 01 .byte 1
364 .global adcBuffer
365 .section .bss.adcBuffer,"aw",@nobits
366 .type adcBuffer, @object
367 .size adcBuffer, 2
368 adcBuffer:
369 0000 0000 .zero 2
370 .global adcCount
371 .section .bss.adcCount,"aw",@nobits
372 .type adcCount, @object
373 .size adcCount, 2
374 adcCount:
375 0000 0000 .zero 2
GAS LISTING /tmp/ccPLkBqf.s page 12
376 .text
377 .Letext0:
378 .file 3 "/home/arhat109/progs/arduino-1.8.2/hardware/tools/avr/lib/gcc/avr/4.9.2/include/stddef.h"
379 .file 4 "/home/arhat109/progs/arduino-1.8.2/hardware/tools/avr/avr/include/stdint.h"
380 .file 5 "/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/Print.h"
381 .file 6 "/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/Arduino.h"
382 .file 7 "/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/variants/standard/pins_ard
383 .file 8 "/home/arhat109/.arduino15/packages/MegaCore/hardware/avr/1.0.6/cores/MegaCore/Stream.h"
384 .section .debug_info,"",@progbits
385 .Ldebug_info0:
386 0000 1605 0000 .long 0x516
387 0004 0200 .word 0x2
388 0006 0000 0000 .long .Ldebug_abbrev0
389 000a 04 .byte 0x4
390 000b 01 .uleb128 0x1
391 000c 0000 0000 .long .LASF43
392 0010 04 .byte 0x4
393 0011 0000 0000 .long .LASF44
394 0015 0000 0000 .long .LASF45
395 0019 0000 0000 .long .Ldebug_ranges0+0
396 001d 0000 0000 .long 0
397 0021 0000 0000 .long 0
398 0025 0000 0000 .long .Ldebug_line0
399 0029 02 .uleb128 0x2
400 002a 0000 0000 .long .LASF3
401 002e 03 .byte 0x3
402 002f D4 .byte 0xd4
403 0030 3400 0000 .long 0x34
404 0034 03 .uleb128 0x3
405 0035 02 .byte 0x2
406 0036 07 .byte 0x7
407 0037 0000 0000 .long .LASF0
408 003b 04 .uleb128 0x4
409 003c 02 .byte 0x2
410 003d 05 .byte 0x5
411 003e 696E 7400 .string "int"
412 0042 03 .uleb128 0x3
413 0043 04 .byte 0x4
414 0044 05 .byte 0x5
415 0045 0000 0000 .long .LASF1
416 0049 03 .uleb128 0x3
417 004a 01 .byte 0x1
418 004b 06 .byte 0x6
419 004c 0000 0000 .long .LASF2
420 0050 02 .uleb128 0x2
421 0051 0000 0000 .long .LASF4
422 0055 04 .byte 0x4
423 0056 7E .byte 0x7e
424 0057 5B00 0000 .long 0x5b
425 005b 03 .uleb128 0x3
426 005c 01 .byte 0x1
427 005d 08 .byte 0x8
428 005e 0000 0000 .long .LASF5
429 0062 03 .uleb128 0x3
430 0063 04 .byte 0x4
431 0064 07 .byte 0x7
432 0065 0000 0000 .long .LASF6
GAS LISTING /tmp/ccPLkBqf.s page 13
433 0069 03 .uleb128 0x3
434 006a 08 .byte 0x8
435 006b 05 .byte 0x5
436 006c 0000 0000 .long .LASF7
437 0070 03 .uleb128 0x3
438 0071 08 .byte 0x8
439 0072 07 .byte 0x7
440 0073 0000 0000 .long .LASF8
441 0077 03 .uleb128 0x3
442 0078 01 .byte 0x1
443 0079 02 .byte 0x2
444 007a 0000 0000 .long .LASF9
445 007e 03 .uleb128 0x3
446 007f 01 .byte 0x1
447 0080 06 .byte 0x6
448 0081 0000 0000 .long .LASF10
449 0085 05 .uleb128 0x5
450 0086 02 .byte 0x2
451 0087 8B00 0000 .long 0x8b
452 008b 06 .uleb128 0x6
453 008c 7E00 0000 .long 0x7e
454 0090 03 .uleb128 0x3
455 0091 04 .byte 0x4
456 0092 04 .byte 0x4
457 0093 0000 0000 .long .LASF11
458 0097 03 .uleb128 0x3
459 0098 04 .byte 0x4
460 0099 04 .byte 0x4
461 009a 0000 0000 .long .LASF12
462 009e 07 .uleb128 0x7
463 009f 0000 0000 .long .LASF46
464 00a3 02 .byte 0x2
465 00a4 08 .byte 0x8
466 00a5 29 .byte 0x29
467 00a6 BD00 0000 .long 0xbd
468 00aa 08 .uleb128 0x8
469 00ab 0000 0000 .long .LASF13
470 00af 00 .sleb128 0
471 00b0 08 .uleb128 0x8
472 00b1 0000 0000 .long .LASF14
473 00b5 01 .sleb128 1
474 00b6 08 .uleb128 0x8
475 00b7 0000 0000 .long .LASF15
476 00bb 02 .sleb128 2
477 00bc 00 .byte 0
478 00bd 09 .uleb128 0x9
479 00be 0000 0000 .long .LASF16
480 00c2 01 .byte 0x1
481 00c3 1201 0000 .long 0x112
482 00c7 0A .uleb128 0xa
483 00c8 02 .byte 0x2
484 00c9 5D .byte 0x5d
485 00ca 1C01 0000 .long 0x11c
486 00ce 0B .uleb128 0xb
487 00cf 01 .byte 0x1
488 00d0 0000 0000 .long .LASF18
489 00d4 02 .byte 0x2
GAS LISTING /tmp/ccPLkBqf.s page 14
490 00d5 79 .byte 0x79
491 00d6 0000 0000 .long .LASF20
492 00da 01 .byte 0x1
493 00db E300 0000 .long 0xe3
494 00df EF00 0000 .long 0xef
495 00e3 0C .uleb128 0xc
496 00e4 7502 0000 .long 0x275
497 00e8 01 .byte 0x1
498 00e9 0D .uleb128 0xd
499 00ea 6200 0000 .long 0x62
500 00ee 00 .byte 0
501 00ef 0E .uleb128 0xe
502 00f0 01 .byte 0x1
503 00f1 0000 0000 .long .LASF18
504 00f5 02 .byte 0x2
505 00f6 7A .byte 0x7a
506 00f7 0000 0000 .long .LASF47
507 00fb 01 .byte 0x1
508 00fc 0001 0000 .long 0x100
509 0100 0C .uleb128 0xc
510 0101 7502 0000 .long 0x275
511 0105 01 .byte 0x1
512 0106 0D .uleb128 0xd
513 0107 6200 0000 .long 0x62
514 010b 0D .uleb128 0xd
515 010c 5000 0000 .long 0x50
516 0110 00 .byte 0
517 0111 00 .byte 0
518 0112 09 .uleb128 0x9
519 0113 0000 0000 .long .LASF17
520 0117 01 .byte 0x1
521 0118 6D01 0000 .long 0x16d
522 011c 0F .uleb128 0xf
523 011d 01 .byte 0x1
524 011e 0000 0000 .long .LASF24
525 0122 05 .byte 0x5
526 0123 36 .byte 0x36
527 0124 0000 0000 .long .LASF48
528 0128 2900 0000 .long 0x29
529 012c 01 .byte 0x1
530 012d 3501 0000 .long 0x135
531 0131 4601 0000 .long 0x146
532 0135 0C .uleb128 0xc
533 0136 6D01 0000 .long 0x16d
534 013a 01 .byte 0x1
535 013b 0D .uleb128 0xd
536 013c 8500 0000 .long 0x85
537 0140 0D .uleb128 0xd
538 0141 2900 0000 .long 0x29
539 0145 00 .byte 0
540 0146 10 .uleb128 0x10
541 0147 01 .byte 0x1
542 0148 0000 0000 .long .LASF19
543 014c 05 .byte 0x5
544 014d 4A .byte 0x4a
545 014e 0000 0000 .long .LASF21
546 0152 2900 0000 .long 0x29
GAS LISTING /tmp/ccPLkBqf.s page 15
547 0156 01 .byte 0x1
548 0157 5B01 0000 .long 0x15b
549 015b 0C .uleb128 0xc
550 015c 6D01 0000 .long 0x16d
551 0160 01 .byte 0x1
552 0161 0D .uleb128 0xd
553 0162 5B00 0000 .long 0x5b
554 0166 0D .uleb128 0xd
555 0167 3B00 0000 .long 0x3b
556 016b 00 .byte 0
557 016c 00 .byte 0
558 016d 05 .uleb128 0x5
559 016e 02 .byte 0x2
560 016f 1201 0000 .long 0x112
561 0173 03 .uleb128 0x3
562 0174 04 .byte 0x4
563 0175 04 .byte 0x4
564 0176 0000 0000 .long .LASF22
565 017a 11 .uleb128 0x11
566 017b 0000 0000 .long .LASF49
567 017f 03 .uleb128 0x3
568 0180 02 .byte 0x2
569 0181 07 .byte 0x7
570 0182 0000 0000 .long .LASF23
571 0186 05 .uleb128 0x5
572 0187 02 .byte 0x2
573 0188 5000 0000 .long 0x50
574 018c 12 .uleb128 0x12
575 018d 01 .byte 0x1
576 018e 0000 0000 .long .LASF50
577 0192 01 .byte 0x1
578 0193 28 .byte 0x28
579 0194 0000 0000 .long .LFB120
580 0198 0000 0000 .long .LFE120
581 019c 03 .byte 0x3
582 019d 92 .byte 0x92
583 019e 20 .uleb128 0x20
584 019f 02 .sleb128 2
585 01a0 01 .byte 0x1
586 01a1 13 .uleb128 0x13
587 01a2 01 .byte 0x1
588 01a3 0000 0000 .long .LASF51
589 01a7 01 .byte 0x1
590 01a8 36 .byte 0x36
591 01a9 5000 0000 .long 0x50
592 01ad 0000 0000 .long .LFB121
593 01b1 0000 0000 .long .LFE121
594 01b5 03 .byte 0x3
595 01b6 92 .byte 0x92
596 01b7 20 .uleb128 0x20
597 01b8 02 .sleb128 2
598 01b9 01 .byte 0x1
599 01ba 14 .uleb128 0x14
600 01bb 01 .byte 0x1
601 01bc 0000 0000 .long .LASF25
602 01c0 01 .byte 0x1
603 01c1 3D .byte 0x3d
GAS LISTING /tmp/ccPLkBqf.s page 16
604 01c2 0000 0000 .long .LFB122
605 01c6 0000 0000 .long .LFE122
606 01ca 03 .byte 0x3
607 01cb 92 .byte 0x92
608 01cc 20 .uleb128 0x20
609 01cd 02 .sleb128 2
610 01ce 01 .byte 0x1
611 01cf 0402 0000 .long 0x204
612 01d3 15 .uleb128 0x15
613 01d4 0000 0000 .long .LASF26
614 01d8 01 .byte 0x1
615 01d9 3D .byte 0x3d
616 01da 8601 0000 .long 0x186
617 01de 0000 0000 .long .LLST0
618 01e2 16 .uleb128 0x16
619 01e3 6C65 6E00 .string "len"
620 01e7 01 .byte 0x1
621 01e8 3D .byte 0x3d
622 01e9 3B00 0000 .long 0x3b
623 01ed 06 .byte 0x6
624 01ee 66 .byte 0x66
625 01ef 93 .byte 0x93
626 01f0 01 .uleb128 0x1
627 01f1 67 .byte 0x67
628 01f2 93 .byte 0x93
629 01f3 01 .uleb128 0x1
630 01f4 15 .uleb128 0x15
631 01f5 0000 0000 .long .LASF27
632 01f9 01 .byte 0x1
633 01fa 3D .byte 0x3d
634 01fb 5000 0000 .long 0x50
635 01ff 0000 0000 .long .LLST1
636 0203 00 .byte 0
637 0204 17 .uleb128 0x17
638 0205 01 .byte 0x1
639 0206 0000 0000 .long .LASF28
640 020a 01 .byte 0x1
641 020b 48 .byte 0x48
642 020c 0000 0000 .long .LFB123
643 0210 0000 0000 .long .LFE123
644 0214 0000 0000 .long .LLST2
645 0218 01 .byte 0x1
646 0219 7502 0000 .long 0x275
647 021d 15 .uleb128 0x15
648 021e 0000 0000 .long .LASF29
649 0222 01 .byte 0x1
650 0223 48 .byte 0x48
651 0224 3B00 0000 .long 0x3b
652 0228 0000 0000 .long .LLST3
653 022c 18 .uleb128 0x18
654 022d 6C65 6E00 .string "len"
655 0231 01 .byte 0x1
656 0232 48 .byte 0x48
657 0233 3B00 0000 .long 0x3b
658 0237 0000 0000 .long .LLST4
659 023b 19 .uleb128 0x19
660 023c 0000 0000 .long .LBB2
GAS LISTING /tmp/ccPLkBqf.s page 17
661 0240 0000 0000 .long .LBE2
662 0244 1A .uleb128 0x1a
663 0245 7074 7200 .string "ptr"
664 0249 01 .byte 0x1
665 024a 4A .byte 0x4a
666 024b 8601 0000 .long 0x186
667 024f 0000 0000 .long .LLST5
668 0253 19 .uleb128 0x19
669 0254 0000 0000 .long .LBB3
670 0258 0000 0000 .long .LBE3
671 025c 1A .uleb128 0x1a
672 025d 6900 .string "i"
673 025f 01 .byte 0x1
674 0260 4C .byte 0x4c
675 0261 3B00 0000 .long 0x3b
676 0265 0000 0000 .long .LLST6
677 0269 1B .uleb128 0x1b
678 026a 0000 0000 .long .LVL8
679 026e A101 0000 .long 0x1a1
680 0272 00 .byte 0
681 0273 00 .byte 0
682 0274 00 .byte 0
683 0275 05 .uleb128 0x5
684 0276 02 .byte 0x2
685 0277 BD00 0000 .long 0xbd
686 027b 1C .uleb128 0x1c
687 027c CE00 0000 .long 0xce
688 0280 03 .byte 0x3
689 0281 8902 0000 .long 0x289
690 0285 9F02 0000 .long 0x29f
691 0289 1D .uleb128 0x1d
692 028a 0000 0000 .long .LASF52
693 028e 9F02 0000 .long 0x29f
694 0292 01 .byte 0x1
695 0293 1E .uleb128 0x1e
696 0294 0000 0000 .long .LASF53
697 0298 02 .byte 0x2