Subversion Repositories FlightCtrl

Rev

Rev 1755 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1755 - 1
   1               		.file	"capacity.c"
1789 - 2
   2               	__SREG__ = 0x3f
3
   3               	__SP_H__ = 0x3e
4
   4               	__SP_L__ = 0x3d
5
   5               	__CCP__  = 0x34
1755 - 6
   6               	__tmp_reg__ = 0
7
   7               	__zero_reg__ = 1
1789 - 8
   8               		.text
9
   9               	.global	Capacity_Update
10
  11               	Capacity_Update:
11
  12               	/* prologue: function */
12
  13               	/* frame size = 0 */
13
  14 0000 8091 0000 		lds r24,update_timer
14
  15 0004 9091 0000 		lds r25,(update_timer)+1
15
  16 0008 0E94 0000 		call CheckDelay
16
  17 000c 8823      		tst r24
17
  18 000e 01F4      		brne .+2
18
  19 0010 00C0      		rjmp .L13
19
  20 0012 8091 0000 		lds r24,update_timer
20
  21 0016 9091 0000 		lds r25,(update_timer)+1
21
  22 001a 0A96      		adiw r24,10
22
  23 001c 9093 0000 		sts (update_timer)+1,r25
23
  24 0020 8093 0000 		sts update_timer,r24
24
  25 0024 E0E0      		ldi r30,lo8(Motor+1)
25
  26 0026 F0E0      		ldi r31,hi8(Motor+1)
26
  27 0028 60E0      		ldi r22,lo8(0)
27
  28 002a 70E0      		ldi r23,hi8(0)
28
  29 002c 40E0      		ldi r20,lo8(0)
29
  30 002e 50E0      		ldi r21,hi8(0)
30
  31 0030 90E0      		ldi r25,lo8(0)
31
  32 0032 AFEF      		ldi r26,lo8(-1)
32
  33               	.L6:
33
  34 0034 8281      		ldd r24,Z+2
34
  35 0036 87FF      		sbrs r24,7
35
  36 0038 00C0      		rjmp .L3
36
  37 003a 9F5F      		subi r25,lo8(-(1))
37
  38 003c 8481      		ldd r24,Z+4
38
  39 003e 680F      		add r22,r24
39
  40 0040 711D      		adc r23,__zero_reg__
40
  41 0042 8081      		ld r24,Z
41
  42 0044 480F      		add r20,r24
42
  43 0046 511D      		adc r21,__zero_reg__
43
  44 0048 8581      		ldd r24,Z+5
44
  45 004a 8A17      		cp r24,r26
45
  46 004c 00F0      		brlo .L4
46
  47               	.L3:
47
  48 004e 8A2F      		mov r24,r26
48
  49               	.L4:
49
  50 0050 3896      		adiw r30,8
50
  51 0052 20E0      		ldi r18,hi8(Motor+97)
51
  52 0054 E030      		cpi r30,lo8(Motor+97)
52
  53 0056 F207      		cpc r31,r18
53
  54 0058 01F0      		breq .L5
54
  55 005a A82F      		mov r26,r24
55
  56 005c 00C0      		rjmp .L6
56
  57               	.L5:
57
  58 005e 8093 0000 		sts Capacity+6,r24
58
  59 0062 452B      		or r20,r21
59
  60 0064 01F4      		brne .L7
60
  61 0066 8091 0000 		lds r24,SumCurrentOffset.2245
61
  62 006a 9091 0000 		lds r25,(SumCurrentOffset.2245)+1
62
  63 006e A091 0000 		lds r26,(SumCurrentOffset.2245)+2
63
  64 0072 B091 0000 		lds r27,(SumCurrentOffset.2245)+3
64
  65 0076 292F      		mov r18,r25
65
  66 0078 3A2F      		mov r19,r26
66
  67 007a 4B2F      		mov r20,r27
67
  68 007c 5527      		clr r21
68
  69 007e 3093 0000 		sts (CurrentOffset.2244)+1,r19
69
  70 0082 2093 0000 		sts CurrentOffset.2244,r18
70
  71 0086 40E0      		ldi r20,lo8(0)
71
  72 0088 50E0      		ldi r21,hi8(0)
72
  73 008a 821B      		sub r24,r18
73
  74 008c 930B      		sbc r25,r19
74
  75 008e A40B      		sbc r26,r20
75
  76 0090 B50B      		sbc r27,r21
76
  77 0092 9B01      		movw r18,r22
77
  78 0094 40E0      		ldi r20,lo8(0)
78
  79 0096 50E0      		ldi r21,hi8(0)
79
  80 0098 820F      		add r24,r18
80
  81 009a 931F      		adc r25,r19
81
  82 009c A41F      		adc r26,r20
82
  83 009e B51F      		adc r27,r21
83
  84 00a0 8093 0000 		sts SumCurrentOffset.2245,r24
84
  85 00a4 9093 0000 		sts (SumCurrentOffset.2245)+1,r25
85
  86 00a8 A093 0000 		sts (SumCurrentOffset.2245)+2,r26
86
  87 00ac B093 0000 		sts (SumCurrentOffset.2245)+3,r27
87
  88 00b0 E5E0      		ldi r30,lo8(5)
88
  89 00b2 F0E0      		ldi r31,hi8(5)
89
  90 00b4 00C0      		rjmp .L8
90
  91               	.L7:
91
  92 00b6 4091 0000 		lds r20,CurrentOffset.2244
92
  93 00ba 5091 0000 		lds r21,(CurrentOffset.2244)+1
93
  94 00be 4617      		cp r20,r22
94
  95 00c0 5707      		cpc r21,r23
95
  96 00c2 00F0      		brlo .L9
96
  97 00c4 20E0      		ldi r18,lo8(0)
97
  98 00c6 30E0      		ldi r19,hi8(0)
98
  99 00c8 00C0      		rjmp .L10
99
 100               	.L9:
100
 101 00ca 9B01      		movw r18,r22
101
 102 00cc 241B      		sub r18,r20
102
 103 00ce 350B      		sbc r19,r21
103
 104               	.L10:
104
 105 00d0 E92F      		mov r30,r25
105
 106 00d2 F0E0      		ldi r31,lo8(0)
106
 107 00d4 EE0F      		lsl r30
107
 108 00d6 FF1F      		rol r31
108
 109 00d8 3596      		adiw r30,5
109
 110 00da E20F      		add r30,r18
110
 111 00dc F31F      		adc r31,r19
111
 112               	.L8:
112
 113 00de F093 0000 		sts (Capacity)+1,r31
113
 114 00e2 E093 0000 		sts Capacity,r30
114
 115 00e6 EF3F      		cpi r30,255
115
 116 00e8 F105      		cpc r31,__zero_reg__
116
 117 00ea 00F4      		brsh .L11
117
 118 00ec 8091 0000 		lds r24,UBat
118
 119 00f0 9091 0000 		lds r25,(UBat)+1
119
 120 00f4 AC01      		movw r20,r24
120
 121 00f6 E49F      		mul r30,r20
121
 122 00f8 C001      		movw r24,r0
122
 123 00fa E59F      		mul r30,r21
123
 124 00fc 900D      		add r25,r0
124
 125 00fe F49F      		mul r31,r20
125
 126 0100 900D      		add r25,r0
126
 127 0102 1124      		clr r1
127
 128 0104 64E6      		ldi r22,lo8(100)
128
 129 0106 70E0      		ldi r23,hi8(100)
129
 130 0108 00C0      		rjmp .L14
130
 131               	.L11:
131
 132 010a 8091 0000 		lds r24,UBat
132
 133 010e 9091 0000 		lds r25,(UBat)+1
133
 134 0112 9F01      		movw r18,r30
134
 135 0114 3695      		lsr r19
135
 136 0116 2795      		ror r18
136
 137 0118 3695      		lsr r19
137
 138 011a 2795      		ror r18
138
 139 011c AC01      		movw r20,r24
139
 140 011e 249F      		mul r18,r20
140
 141 0120 C001      		movw r24,r0
141
 142 0122 259F      		mul r18,r21
142
 143 0124 900D      		add r25,r0
143
 144 0126 349F      		mul r19,r20
144
 145 0128 900D      		add r25,r0
145
 146 012a 1124      		clr r1
146
 147 012c 69E1      		ldi r22,lo8(25)
147
 148 012e 70E0      		ldi r23,hi8(25)
148
 149               	.L14:
149
 150 0130 0E94 0000 		call __udivmodhi4
150
 151 0134 7093 0000 		sts (Capacity+2)+1,r23
151
 152 0138 6093 0000 		sts Capacity+2,r22
152
 153 013c 2091 0000 		lds r18,SubCounter.2243
153
 154 0140 3091 0000 		lds r19,(SubCounter.2243)+1
154
 155 0144 2E0F      		add r18,r30
155
 156 0146 3F1F      		adc r19,r31
156
 157 0148 3093 0000 		sts (SubCounter.2243)+1,r19
157
 158 014c 2093 0000 		sts SubCounter.2243,r18
158
 159 0150 5EE0      		ldi r21,hi8(3601)
159
 160 0152 2131      		cpi r18,lo8(3601)
160
 161 0154 3507      		cpc r19,r21
161
 162 0156 00F0      		brlo .L13
162
 163 0158 8091 0000 		lds r24,Capacity+4
163
 164 015c 9091 0000 		lds r25,(Capacity+4)+1
164
 165 0160 0196      		adiw r24,1
165
 166 0162 9093 0000 		sts (Capacity+4)+1,r25
166
 167 0166 8093 0000 		sts Capacity+4,r24
167
 168 016a 2051      		subi r18,lo8(-(-3600))
168
 169 016c 3E40      		sbci r19,hi8(-(-3600))
169
 170 016e 3093 0000 		sts (SubCounter.2243)+1,r19
170
 171 0172 2093 0000 		sts SubCounter.2243,r18
171
 172               	.L13:
172
 173 0176 0895      		ret
173
 175               	.global	Capacity_Init
174
 177               	Capacity_Init:
175
 178               	/* prologue: function */
176
 179               	/* frame size = 0 */
177
 180 0178 1092 0000 		sts (Capacity)+1,__zero_reg__
178
 181 017c 1092 0000 		sts Capacity,__zero_reg__
179
 182 0180 1092 0000 		sts (Capacity+4)+1,__zero_reg__
180
 183 0184 1092 0000 		sts Capacity+4,__zero_reg__
181
 184 0188 1092 0000 		sts (Capacity+2)+1,__zero_reg__
182
 185 018c 1092 0000 		sts Capacity+2,__zero_reg__
183
 186 0190 1092 0000 		sts Capacity+6,__zero_reg__
184
 187 0194 8AE0      		ldi r24,lo8(10)
185
 188 0196 90E0      		ldi r25,hi8(10)
186
 189 0198 0E94 0000 		call SetDelay
187
 190 019c 9093 0000 		sts (update_timer)+1,r25
188
 191 01a0 8093 0000 		sts update_timer,r24
189
 192               	/* epilogue start */
190
 193 01a4 0895      		ret
191
 195               	.global	update_timer
192
 196               	.global	update_timer
193
 197               		.section .bss
194
 200               	update_timer:
195
 201 0000 0000      		.skip 2,0
196
 202               		.lcomm SumCurrentOffset.2245,4
197
 203               		.lcomm CurrentOffset.2244,2
198
 204               		.lcomm SubCounter.2243,2
199
 205               		.comm Capacity,7,1
200
 206               	.global __do_clear_bss
1755 - 201
DEFINED SYMBOLS
202
                            *ABS*:00000000 capacity.c
1789 - 203
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cc3DnvEP.s:2      *ABS*:0000003f __SREG__
204
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cc3DnvEP.s:3      *ABS*:0000003e __SP_H__
205
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cc3DnvEP.s:4      *ABS*:0000003d __SP_L__
206
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cc3DnvEP.s:5      *ABS*:00000034 __CCP__
207
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cc3DnvEP.s:6      *ABS*:00000000 __tmp_reg__
208
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cc3DnvEP.s:7      *ABS*:00000001 __zero_reg__
209
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cc3DnvEP.s:11     .text:00000000 Capacity_Update
210
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cc3DnvEP.s:200    .bss:00000000 update_timer
1755 - 211
                            *COM*:00000007 Capacity
1789 - 212
                             .bss:00000002 SumCurrentOffset.2245
213
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cc3DnvEP.s:202    .bss:00000006 CurrentOffset.2244
214
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cc3DnvEP.s:203    .bss:00000008 SubCounter.2243
215
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cc3DnvEP.s:177    .text:00000178 Capacity_Init
1755 - 216
 
217
UNDEFINED SYMBOLS
218
CheckDelay
219
Motor
220
UBat
221
__udivmodhi4
1789 - 222
SetDelay
223
__do_clear_bss