Subversion Repositories FlightCtrl

Rev

Rev 2302 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2287 - 1
   1               		.file	"capacity.c"
2
   2               		.arch atmega1284p
3
   3               	__SREG__ = 0x3f
4
   4               	__SP_H__ = 0x3e
5
   5               	__SP_L__ = 0x3d
6
   6               	__tmp_reg__ = 0
7
   7               	__zero_reg__ = 1
8
   8               		.global __do_copy_data
9
   9               		.global __do_clear_bss
10
  10               	.global	update_timer
11
  11               	.global	update_timer
12
  12               		.section .bss
13
  15               	update_timer:
14
  16 0000 0000      		.skip 2,0
15
  17               		.text
16
  18               	.global	Capacity_Init
17
  20               	Capacity_Init:
18
  21               	/* prologue: frame size=0 */
19
  22               	/* prologue end (size=0) */
20
  23 0000 1092 0000 		sts (Capacity)+1,__zero_reg__
21
  24 0004 1092 0000 		sts Capacity,__zero_reg__
22
  25 0008 1092 0000 		sts (Capacity+4)+1,__zero_reg__
23
  26 000c 1092 0000 		sts Capacity+4,__zero_reg__
24
  27 0010 1092 0000 		sts (Capacity+2)+1,__zero_reg__
25
  28 0014 1092 0000 		sts Capacity+2,__zero_reg__
26
  29 0018 1092 0000 		sts Capacity+6,__zero_reg__
27
  30 001c 8AE0      		ldi r24,lo8(10)
28
  31 001e 90E0      		ldi r25,hi8(10)
29
  32 0020 0E94 0000 		call SetDelay
30
  33 0024 9093 0000 		sts (update_timer)+1,r25
31
  34 0028 8093 0000 		sts update_timer,r24
32
  35               	/* epilogue: frame size=0 */
33
  36 002c 0895      		ret
34
  37               	/* epilogue end (size=1) */
35
  38               	/* function Capacity_Init size 23 (22) */
36
  40               		.lcomm SubCounter.0,2
37
  41               		.lcomm CurrentOffset.1,2
38
  42               		.lcomm SumCurrentOffset.2,4
39
  43               	.global	Capacity_Update
40
  45               	Capacity_Update:
41
  46               	/* prologue: frame size=0 */
42
  47 002e CF93      		push r28
43
  48 0030 DF93      		push r29
44
  49               	/* prologue end (size=2) */
45
  50 0032 8091 0000 		lds r24,update_timer
46
  51 0036 9091 0000 		lds r25,(update_timer)+1
47
  52 003a 0E94 0000 		call CheckDelay
48
  53 003e 8823      		tst r24
49
  54 0040 01F4      		brne .+2
50
  55 0042 00C0      		rjmp .L2
51
  56 0044 8091 0000 		lds r24,update_timer
52
  57 0048 9091 0000 		lds r25,(update_timer)+1
53
  58 004c 0A96      		adiw r24,10
54
  59 004e 9093 0000 		sts (update_timer)+1,r25
55
  60 0052 8093 0000 		sts update_timer,r24
56
  61 0056 E0E0      		ldi r30,lo8(0)
57
  62 0058 F0E0      		ldi r31,hi8(0)
58
  63 005a 9F01      		movw r18,r30
59
  64 005c 90E0      		ldi r25,lo8(0)
60
  65 005e 5FEF      		ldi r21,lo8(-1)
61
  66 0060 A0E0      		ldi r26,lo8(Motor)
62
  67 0062 B0E0      		ldi r27,hi8(Motor)
63
  68 0064 4BE0      		ldi r20,lo8(11)
64
  69               	.L9:
65
  70 0066 ED01      		movw r28,r26
66
  71 0068 8B81      		ldd r24,Y+3
67
  72 006a 87FF      		sbrs r24,7
68
  73 006c 00C0      		rjmp .L6
69
  74 006e 9F5F      		subi r25,lo8(-(1))
70
  75 0070 8D81      		ldd r24,Y+5
71
  76 0072 E80F      		add r30,r24
72
  77 0074 F11D      		adc r31,__zero_reg__
73
  78 0076 8981      		ldd r24,Y+1
74
  79 0078 280F      		add r18,r24
75
  80 007a 311D      		adc r19,__zero_reg__
76
  81 007c 8E81      		ldd r24,Y+6
77
  82 007e 8517      		cp r24,r21
78
  83 0080 00F4      		brsh .L6
79
  84 0082 582F      		mov r21,r24
80
  85               	.L6:
81
  86 0084 4150      		subi r20,lo8(-(-1))
82
  87 0086 1896      		adiw r26,8
83
  88 0088 47FF      		sbrs r20,7
84
  89 008a 00C0      		rjmp .L9
85
  90 008c 5093 0000 		sts Capacity+6,r21
86
  91 0090 232B      		or r18,r19
87
  92 0092 01F4      		brne .L10
88
  93 0094 2091 0000 		lds r18,SumCurrentOffset.2
89
  94 0098 3091 0000 		lds r19,(SumCurrentOffset.2)+1
90
  95 009c 4091 0000 		lds r20,(SumCurrentOffset.2)+2
91
  96 00a0 5091 0000 		lds r21,(SumCurrentOffset.2)+3
92
  97 00a4 BB27      		clr r27
93
  98 00a6 A52F      		mov r26,r21
94
  99 00a8 942F      		mov r25,r20
95
 100 00aa 832F      		mov r24,r19
96
 101 00ac 9093 0000 		sts (CurrentOffset.1)+1,r25
97
 102 00b0 8093 0000 		sts CurrentOffset.1,r24
98
 103 00b4 AA27      		clr r26
99
 104 00b6 BB27      		clr r27
100
 105 00b8 281B      		sub r18,r24
101
 106 00ba 390B      		sbc r19,r25
102
 107 00bc 4A0B      		sbc r20,r26
103
 108 00be 5B0B      		sbc r21,r27
104
 109 00c0 CF01      		movw r24,r30
105
 110 00c2 AA27      		clr r26
106
 111 00c4 BB27      		clr r27
107
 112 00c6 280F      		add r18,r24
108
 113 00c8 391F      		adc r19,r25
109
 114 00ca 4A1F      		adc r20,r26
110
 115 00cc 5B1F      		adc r21,r27
111
 116 00ce 2093 0000 		sts SumCurrentOffset.2,r18
112
 117 00d2 3093 0000 		sts (SumCurrentOffset.2)+1,r19
113
 118 00d6 4093 0000 		sts (SumCurrentOffset.2)+2,r20
114
 119 00da 5093 0000 		sts (SumCurrentOffset.2)+3,r21
115
 120 00de E5E0      		ldi r30,lo8(5)
116
 121 00e0 F0E0      		ldi r31,hi8(5)
117
 122 00e2 00C0      		rjmp .L11
118
 123               	.L10:
119
 124 00e4 2091 0000 		lds r18,CurrentOffset.1
120
 125 00e8 3091 0000 		lds r19,(CurrentOffset.1)+1
121
 126 00ec 2E17      		cp r18,r30
122
 127 00ee 3F07      		cpc r19,r31
123
 128 00f0 00F4      		brsh .L12
124
 129 00f2 E21B      		sub r30,r18
125
 130 00f4 F30B      		sbc r31,r19
126
 131 00f6 00C0      		rjmp .L13
127
 132               	.L12:
128
 133 00f8 E0E0      		ldi r30,lo8(0)
129
 134 00fa F0E0      		ldi r31,hi8(0)
130
 135               	.L13:
131
 136 00fc 892F      		mov r24,r25
132
 137 00fe 9927      		clr r25
133
 138 0100 880F      		add r24,r24
134
 139 0102 991F      		adc r25,r25
135
 140 0104 E80F      		add r30,r24
136
 141 0106 F91F      		adc r31,r25
137
 142 0108 3596      		adiw r30,5
138
 143               	.L11:
139
 144 010a F093 0000 		sts (Capacity)+1,r31
140
 145 010e E093 0000 		sts Capacity,r30
141
 146 0112 EF3F      		cpi r30,255
142
 147 0114 F105      		cpc r31,__zero_reg__
143
 148 0116 00F4      		brsh .L14
144
 149 0118 8091 0000 		lds r24,UBat
145
 150 011c 9091 0000 		lds r25,(UBat)+1
146
 151 0120 8E9F      		mul r24,r30
147
 152 0122 9001      		movw r18,r0
148
 153 0124 8F9F      		mul r24,r31
149
 154 0126 300D      		add r19,r0
150
 155 0128 9E9F      		mul r25,r30
151
 156 012a 300D      		add r19,r0
152
 157 012c 1124      		clr r1
153
 158 012e C901      		movw r24,r18
154
 159 0130 64E6      		ldi r22,lo8(100)
155
 160 0132 70E0      		ldi r23,hi8(100)
156
 161 0134 00C0      		rjmp .L19
157
 162               	.L14:
158
 163 0136 CF01      		movw r24,r30
159
 164 0138 9695      		lsr r25
160
 165 013a 8795      		ror r24
161
 166 013c 9695      		lsr r25
162
 167 013e 8795      		ror r24
163
 168 0140 2091 0000 		lds r18,UBat
164
 169 0144 3091 0000 		lds r19,(UBat)+1
165
 170 0148 289F      		mul r18,r24
166
 171 014a A001      		movw r20,r0
167
 172 014c 299F      		mul r18,r25
168
 173 014e 500D      		add r21,r0
169
 174 0150 389F      		mul r19,r24
170
 175 0152 500D      		add r21,r0
171
 176 0154 1124      		clr r1
172
 177 0156 CA01      		movw r24,r20
173
 178 0158 69E1      		ldi r22,lo8(25)
174
 179 015a 70E0      		ldi r23,hi8(25)
175
 180               	.L19:
176
 181 015c 0E94 0000 		call __udivmodhi4
177
 182 0160 7093 0000 		sts (Capacity+2)+1,r23
178
 183 0164 6093 0000 		sts Capacity+2,r22
179
 184 0168 2091 0000 		lds r18,SubCounter.0
180
 185 016c 3091 0000 		lds r19,(SubCounter.0)+1
181
 186 0170 2E0F      		add r18,r30
182
 187 0172 3F1F      		adc r19,r31
183
 188 0174 3093 0000 		sts (SubCounter.0)+1,r19
184
 189 0178 2093 0000 		sts SubCounter.0,r18
185
 190 017c 5EE0      		ldi r21,hi8(3601)
186
 191 017e 2131      		cpi r18,lo8(3601)
187
 192 0180 3507      		cpc r19,r21
188
 193 0182 00F0      		brlo .L2
189
 194 0184 8091 0000 		lds r24,Capacity+4
190
 195 0188 9091 0000 		lds r25,(Capacity+4)+1
191
 196 018c 0196      		adiw r24,1
192
 197 018e 9093 0000 		sts (Capacity+4)+1,r25
193
 198 0192 8093 0000 		sts Capacity+4,r24
194
 199 0196 2051      		subi r18,lo8(-(-3600))
195
 200 0198 3E40      		sbci r19,hi8(-(-3600))
196
 201 019a 3093 0000 		sts (SubCounter.0)+1,r19
197
 202 019e 2093 0000 		sts SubCounter.0,r18
198
 203               	.L2:
199
 204               	/* epilogue: frame size=0 */
200
 205 01a2 DF91      		pop r29
201
 206 01a4 CF91      		pop r28
202
 207 01a6 0895      		ret
203
 208               	/* epilogue end (size=3) */
204
 209               	/* function Capacity_Update size 189 (184) */
205
 211               		.comm Capacity,7,1
206
 212               	/* File "capacity.c": code  212 = 0x00d4 ( 206), prologues   2, epilogues   4 */
207
DEFINED SYMBOLS
208
                            *ABS*:00000000 capacity.c
209
  C:\Temp/ccPQ1Vdc.s:3      *ABS*:0000003f __SREG__
210
  C:\Temp/ccPQ1Vdc.s:4      *ABS*:0000003e __SP_H__
211
  C:\Temp/ccPQ1Vdc.s:5      *ABS*:0000003d __SP_L__
212
  C:\Temp/ccPQ1Vdc.s:6      *ABS*:00000000 __tmp_reg__
213
  C:\Temp/ccPQ1Vdc.s:7      *ABS*:00000001 __zero_reg__
214
  C:\Temp/ccPQ1Vdc.s:15     .bss:00000000 update_timer
215
  C:\Temp/ccPQ1Vdc.s:20     .text:00000000 Capacity_Init
216
                            *COM*:00000007 Capacity
217
                             .bss:00000002 SubCounter.0
218
  C:\Temp/ccPQ1Vdc.s:40     .bss:00000004 CurrentOffset.1
219
  C:\Temp/ccPQ1Vdc.s:41     .bss:00000006 SumCurrentOffset.2
220
  C:\Temp/ccPQ1Vdc.s:45     .text:0000002e Capacity_Update
221
 
222
UNDEFINED SYMBOLS
223
__do_copy_data
224
__do_clear_bss
225
SetDelay
226
CheckDelay
227
Motor
228
UBat
229
__udivmodhi4