Subversion Repositories FlightCtrl

Rev

Blame | Last modification | View Log | RSS feed

   1                            .file   "pitch_md.c"
   2                    __SREG__ = 0x3f
   3                    __SP_H__ = 0x3e
   4                    __SP_L__ = 0x3d
   5                    __CCP__  = 0x34
   6                    __tmp_reg__ = 0
   7                    __zero_reg__ = 1
   8                            .global __do_copy_data
   9                            .global __do_clear_bss
  10                            .text
  11                    .global pitch_md_value
  13                    pitch_md_value:
  14 0000 0F93                  push r16
  15 0002 1F93                  push r17
  16 0004 CF93                  push r28
  17 0006 DF93                  push r29
  18                    /* prologue: function */
  19                    /* frame size = 0 */
  20 0008 8091 0000             lds r24,EE_Parameter+2
  21 000c C82F                  mov r28,r24
  22 000e D0E0                  ldi r29,lo8(0)
  23 0010 FE01                  movw r30,r28
  24 0012 EE0F                  lsl r30
  25 0014 FF1F                  rol r31
  26 0016 E050                  subi r30,lo8(-(PPM_in))
  27 0018 F040                  sbci r31,hi8(-(PPM_in))
  28 001a 0190                  ld __tmp_reg__,Z+
  29 001c F081                  ld r31,Z
  30 001e E02D                  mov r30,__tmp_reg__
  31 0020 8091 0000             lds r24,MotorenEin
  32 0024 8823                  tst r24
  33 0026 01F4                  brne .+2
  34 0028 00C0                  rjmp .L2
  35 002a 0091 0000             lds r16,stickValue
  36 002e 1091 0000             lds r17,(stickValue)+1
  37 0032 1093 0000             sts (lastStickValue)+1,r17
  38 0036 0093 0000             sts lastStickValue,r16
  39 003a EE9F                  mul r30,r30
  40 003c C001                  movw r24,r0
  41 003e EF9F                  mul r30,r31
  42 0040 900D                  add r25,r0
  43 0042 FE9F                  mul r31,r30
  44 0044 900D                  add r25,r0
  45 0046 1124                  clr r1
  46 0048 1E16                  cp __zero_reg__,r30
  47 004a 1F06                  cpc __zero_reg__,r31
  48 004c 04F4                  brge .L3
  49 004e 66E9                  ldi r22,lo8(150)
  50 0050 70E0                  ldi r23,hi8(150)
  51 0052 00C0                  rjmp .L32
  52                    .L3:
  53 0054 6AE6                  ldi r22,lo8(-150)
  54 0056 7FEF                  ldi r23,hi8(-150)
  55                    .L32:
  56 0058 0E94 0000             call __divmodhi4
  57 005c 6E0F                  add r22,r30
  58 005e 7F1F                  adc r23,r31
  59 0060 7093 0000             sts (temp)+1,r23
  60 0064 6093 0000             sts temp,r22
  61 0068 4091 0000             lds r20,temp
  62 006c 5091 0000             lds r21,(temp)+1
  63 0070 5093 0000             sts (stickValue)+1,r21
  64 0074 4093 0000             sts stickValue,r20
  65 0078 6091 0000             lds r22,pitchOffset
  66 007c 7091 0000             lds r23,(pitchOffset)+1
  67 0080 9B01                  movw r18,r22
  68 0082 240F                  add r18,r20
  69 0084 351F                  adc r19,r21
  70 0086 3093 0000             sts (targetPitchCount)+1,r19
  71 008a 2093 0000             sts targetPitchCount,r18
  72 008e 8091 0000             lds r24,state
  73 0092 8430                  cpi r24,lo8(4)
  74 0094 01F4                  brne .+2
  75 0096 00C0                  rjmp .L9
  76 0098 8530                  cpi r24,lo8(5)
  77 009a 00F4                  brsh .L14
  78 009c 8230                  cpi r24,lo8(2)
  79 009e 01F0                  breq .L7
  80 00a0 8330                  cpi r24,lo8(3)
  81 00a2 00F0                  brlo .+2
  82 00a4 00C0                  rjmp .L8
  83 00a6 8130                  cpi r24,lo8(1)
  84 00a8 01F0                  breq .+2
  85 00aa 00C0                  rjmp .L5
  86 00ac 00C0                  rjmp .L35
  87                    .L14:
  88 00ae 8630                  cpi r24,lo8(6)
  89 00b0 01F4                  brne .+2
  90 00b2 00C0                  rjmp .L11
  91 00b4 8630                  cpi r24,lo8(6)
  92 00b6 00F4                  brsh .+2
  93 00b8 00C0                  rjmp .L10
  94 00ba 8730                  cpi r24,lo8(7)
  95 00bc 01F4                  brne .+2
  96 00be 00C0                  rjmp .L12
  97 00c0 8830                  cpi r24,lo8(8)
  98 00c2 01F0                  breq .+2
  99 00c4 00C0                  rjmp .L5
 100 00c6 00C0                  rjmp .L36
 101                    .L35:
 102 00c8 E091 0000             lds r30,EE_Parameter+1
 103 00cc F0E0                  ldi r31,lo8(0)
 104 00ce EE0F                  lsl r30
 105 00d0 FF1F                  rol r31
 106 00d2 E050                  subi r30,lo8(-(PPM_in))
 107 00d4 F040                  sbci r31,hi8(-(PPM_in))
 108 00d6 0190                  ld __tmp_reg__,Z+
 109 00d8 F081                  ld r31,Z
 110 00da E02D                  mov r30,__tmp_reg__
 111 00dc F7FF                  sbrs r31,7
 112 00de 00C0                  rjmp .L16
 113 00e0 F095                  com r31
 114 00e2 E195                  neg r30
 115 00e4 FF4F                  sbci r31,lo8(-1)
 116                    .L16:
 117 00e6 E734                  cpi r30,71
 118 00e8 F105                  cpc r31,__zero_reg__
 119 00ea 04F0                  brlt .L15
 120 00ec 82E0                  ldi r24,lo8(2)
 121 00ee 00C0                  rjmp .L33
 122                    .L15:
 123 00f0 83E0                  ldi r24,lo8(3)
 124 00f2 00C0                  rjmp .L33
 125                    .L7:
 126 00f4 3093 0000             sts (actualPitchCount)+1,r19
 127 00f8 2093 0000             sts actualPitchCount,r18
 128 00fc 7497                  sbiw r30,20
 129 00fe 04F0                  brlt .L17
 130 0100 4017                  cp r20,r16
 131 0102 5107                  cpc r21,r17
 132 0104 01F0                  breq .L18
 133                    .L17:
 134 0106 84E6                  ldi r24,lo8(100)
 135 0108 90E0                  ldi r25,hi8(100)
 136 010a 9093 0000             sts (timer)+1,r25
 137 010e 8093 0000             sts timer,r24
 138 0112 00C0                  rjmp .L5
 139                    .L18:
 140 0114 8091 0000             lds r24,timer
 141 0118 9091 0000             lds r25,(timer)+1
 142 011c 0197                  sbiw r24,1
 143 011e 9093 0000             sts (timer)+1,r25
 144 0122 8093 0000             sts timer,r24
 145 0126 892B                  or r24,r25
 146 0128 01F0                  breq .+2
 147 012a 00C0                  rjmp .L5
 148 012c 8091 0000             lds r24,EE_Parameter+29
 149 0130 90E0                  ldi r25,lo8(0)
 150 0132 8217                  cp r24,r18
 151 0134 9307                  cpc r25,r19
 152 0136 01F4                  brne .+2
 153 0138 00C0                  rjmp .L5
 154 013a 2093 0000             sts EE_Parameter+29,r18
 155 013e 0E94 0000             call GetActiveParamSetNumber
 156 0142 60E0                  ldi r22,lo8(EE_Parameter)
 157 0144 70E0                  ldi r23,hi8(EE_Parameter)
 158 0146 46E5                  ldi r20,lo8(86)
 159 0148 0E94 0000             call WriteParameterSet
 160 014c 84EF                  ldi r24,lo8(500)
 161 014e 91E0                  ldi r25,hi8(500)
 162 0150 9093 0000             sts (beeptime)+1,r25
 163 0154 8093 0000             sts beeptime,r24
 164 0158 00C0                  rjmp .L5
 165                    .L8:
 166 015a 85E0                  ldi r24,lo8(5)
 167 015c 90E0                  ldi r25,hi8(5)
 168 015e 9093 0000             sts (delay)+1,r25
 169 0162 8093 0000             sts delay,r24
 170 0166 3697                  sbiw r30,6
 171 0168 04F0                  brlt .L19
 172 016a 8091 0000             lds r24,EE_Parameter+29
 173 016e 8093 0000             sts pitchOffset,r24
 174 0172 1092 0000             sts pitchOffset+1,__zero_reg__
 175 0176 00C0                  rjmp .L5
 176                    .L19:
 177 0178 8091 0000             lds r24,EE_Parameter+29
 178 017c 90E0                  ldi r25,lo8(0)
 179 017e 6817                  cp r22,r24
 180 0180 7907                  cpc r23,r25
 181 0182 01F0                  breq .+2
 182 0184 00C0                  rjmp .L5
 183 0186 84E0                  ldi r24,lo8(4)
 184 0188 00C0                  rjmp .L33
 185                    .L9:
 186 018a CF01                  movw r24,r30
 187 018c F7FF                  sbrs r31,7
 188 018e 00C0                  rjmp .L20
 189 0190 8827                  clr r24
 190 0192 9927                  clr r25
 191 0194 8E1B                  sub r24,r30
 192 0196 9F0B                  sbc r25,r31
 193                    .L20:
 194 0198 0B97                  sbiw r24,11
 195 019a 04F4                  brge .+2
 196 019c 00C0                  rjmp .L5
 197 019e 1092 0000             sts (delay)+1,__zero_reg__
 198 01a2 1092 0000             sts delay,__zero_reg__
 199 01a6 1E16                  cp __zero_reg__,r30
 200 01a8 1F06                  cpc __zero_reg__,r31
 201 01aa 04F4                  brge .+2
 202 01ac 00C0                  rjmp .L34
 203 01ae 00C0                  rjmp .L5
 204                    .L10:
 205 01b0 8091 0000             lds r24,EE_Parameter+51
 206 01b4 84FF                  sbrs r24,4
 207 01b6 00C0                  rjmp .L21
 208 01b8 CC0F                  lsl r28
 209 01ba DD1F                  rol r29
 210 01bc C050                  subi r28,lo8(-(PPM_in))
 211 01be D040                  sbci r29,hi8(-(PPM_in))
 212 01c0 8881                  ld r24,Y
 213 01c2 9981                  ldd r25,Y+1
 214 01c4 8C5A                  subi r24,lo8(-84)
 215 01c6 9F4F                  sbci r25,hi8(-84)
 216 01c8 04F0                  brlt .L22
 217 01ca 84E6                  ldi r24,lo8(100)
 218 01cc 90E0                  ldi r25,hi8(100)
 219 01ce 9093 0000             sts (timer)+1,r25
 220 01d2 8093 0000             sts timer,r24
 221 01d6 00C0                  rjmp .L21
 222                    .L22:
 223 01d8 8091 0000             lds r24,timer
 224 01dc 9091 0000             lds r25,(timer)+1
 225 01e0 0197                  sbiw r24,1
 226 01e2 9093 0000             sts (timer)+1,r25
 227 01e6 8093 0000             sts timer,r24
 228 01ea 892B                  or r24,r25
 229 01ec 01F4                  brne .L21
 230 01ee 83E0                  ldi r24,lo8(3)
 231 01f0 8093 0000             sts state,r24
 232 01f4 1092 0000             sts (pitchOffset)+1,__zero_reg__
 233 01f8 1092 0000             sts pitchOffset,__zero_reg__
 234 01fc 1092 0000             sts (targetPitchCount)+1,__zero_reg__
 235 0200 1092 0000             sts targetPitchCount,__zero_reg__
 236 0204 1092 0000             sts (actualPitchCount)+1,__zero_reg__
 237 0208 1092 0000             sts actualPitchCount,__zero_reg__
 238 020c 84EF                  ldi r24,lo8(500)
 239 020e 91E0                  ldi r25,hi8(500)
 240 0210 9093 0000             sts (beeptime)+1,r25
 241 0214 8093 0000             sts beeptime,r24
 242                    .L21:
 243 0218 8091 0000             lds r24,EE_Parameter+30
 244 021c 282F                  mov r18,r24
 245 021e 30E0                  ldi r19,lo8(0)
 246 0220 8091 0000             lds r24,targetPitchCount
 247 0224 9091 0000             lds r25,(targetPitchCount)+1
 248 0228 8217                  cp r24,r18
 249 022a 9307                  cpc r25,r19
 250 022c 04F4                  brge .L23
 251 022e 3093 0000             sts (targetPitchCount)+1,r19
 252 0232 2093 0000             sts targetPitchCount,r18
 253                    .L23:
 254 0236 4C5F                  subi r20,lo8(-(4))
 255 0238 5F4F                  sbci r21,hi8(-(4))
 256 023a 4930                  cpi r20,9
 257 023c 5105                  cpc r21,__zero_reg__
 258 023e 00F0                  brlo .+2
 259 0240 00C0                  rjmp .L5
 260 0242 0E94 0000             call altcon_lock
 261 0246 89E1                  ldi r24,lo8(25)
 262 0248 90E0                  ldi r25,hi8(25)
 263 024a 9093 0000             sts (timer)+1,r25
 264 024e 8093 0000             sts timer,r24
 265 0252 86E0                  ldi r24,lo8(6)
 266 0254 00C0                  rjmp .L33
 267                    .L11:
 268 0256 3496                  adiw r30,4
 269 0258 3997                  sbiw r30,9
 270 025a 00F4                  brsh .L34
 271 025c 0417                  cp r16,r20
 272 025e 1507                  cpc r17,r21
 273 0260 01F4                  brne .L34
 274 0262 8091 0000             lds r24,timer
 275 0266 9091 0000             lds r25,(timer)+1
 276 026a 0197                  sbiw r24,1
 277 026c 9093 0000             sts (timer)+1,r25
 278 0270 8093 0000             sts timer,r24
 279 0274 892B                  or r24,r25
 280 0276 01F0                  breq .+2
 281 0278 00C0                  rjmp .L5
 282 027a 87E0                  ldi r24,lo8(7)
 283 027c 00C0                  rjmp .L33
 284                    .L12:
 285 027e 0E94 0000             call altcon_start
 286 0282 88E0                  ldi r24,lo8(8)
 287 0284 00C0                  rjmp .L33
 288                    .L36:
 289 0286 F7FF                  sbrs r31,7
 290 0288 00C0                  rjmp .L25
 291 028a F095                  com r31
 292 028c E195                  neg r30
 293 028e FF4F                  sbci r31,lo8(-1)
 294                    .L25:
 295 0290 3697                  sbiw r30,6
 296 0292 04F0                  brlt .L5
 297 0294 0E94 0000             call altcon_stop
 298 0298 8091 0000             lds r24,averageN
 299 029c 9091 0000             lds r25,(averageN)+1
 300 02a0 64E0                  ldi r22,lo8(4)
 301 02a2 70E0                  ldi r23,hi8(4)
 302 02a4 0E94 0000             call __divmodhi4
 303 02a8 8091 0000             lds r24,pitchOffset
 304 02ac 9091 0000             lds r25,(pitchOffset)+1
 305 02b0 861B                  sub r24,r22
 306 02b2 970B                  sbc r25,r23
 307 02b4 9093 0000             sts (pitchOffset)+1,r25
 308 02b8 8093 0000             sts pitchOffset,r24
 309 02bc 2091 0000             lds r18,stickValue
 310 02c0 3091 0000             lds r19,(stickValue)+1
 311 02c4 820F                  add r24,r18
 312 02c6 931F                  adc r25,r19
 313 02c8 9093 0000             sts (targetPitchCount)+1,r25
 314 02cc 8093 0000             sts targetPitchCount,r24
 315                    .L34:
 316 02d0 85E0                  ldi r24,lo8(5)
 317 02d2 00C0                  rjmp .L33
 318                    .L2:
 319 02d4 1092 0000             sts (actualPitchCount)+1,__zero_reg__
 320 02d8 1092 0000             sts actualPitchCount,__zero_reg__
 321 02dc 1092 0000             sts (targetPitchCount)+1,__zero_reg__
 322 02e0 1092 0000             sts targetPitchCount,__zero_reg__
 323 02e4 1092 0000             sts (pitchOffset)+1,__zero_reg__
 324 02e8 1092 0000             sts pitchOffset,__zero_reg__
 325 02ec 1092 0000             sts (stickValue)+1,__zero_reg__
 326 02f0 1092 0000             sts stickValue,__zero_reg__
 327 02f4 81E0                  ldi r24,lo8(1)
 328                    .L33:
 329 02f6 8093 0000             sts state,r24
 330                    .L5:
 331 02fa 8091 0000             lds r24,pitchOffset
 332 02fe 9091 0000             lds r25,(pitchOffset)+1
 333 0302 97FF                  sbrs r25,7
 334 0304 00C0                  rjmp .L26
 335 0306 1092 0000             sts (pitchOffset)+1,__zero_reg__
 336 030a 1092 0000             sts pitchOffset,__zero_reg__
 337                    .L26:
 338 030e 8091 0000             lds r24,delayCounter
 339 0312 9091 0000             lds r25,(delayCounter)+1
 340 0316 892B                  or r24,r25
 341 0318 01F4                  brne .L27
 342 031a 2091 0000             lds r18,actualPitchCount
 343 031e 3091 0000             lds r19,(actualPitchCount)+1
 344 0322 8091 0000             lds r24,targetPitchCount
 345 0326 9091 0000             lds r25,(targetPitchCount)+1
 346 032a 821B                  sub r24,r18
 347 032c 930B                  sbc r25,r19
 348 032e 8430                  cpi r24,4
 349 0330 9105                  cpc r25,__zero_reg__
 350 0332 04F0                  brlt .L28
 351 0334 83E0                  ldi r24,lo8(3)
 352 0336 90E0                  ldi r25,hi8(3)
 353 0338 00C0                  rjmp .L29
 354                    .L28:
 355 033a 4FEF                  ldi r20,hi8(-3)
 356 033c 8D3F                  cpi r24,lo8(-3)
 357 033e 9407                  cpc r25,r20
 358 0340 04F4                  brge .L29
 359 0342 8DEF                  ldi r24,lo8(-3)
 360 0344 9FEF                  ldi r25,hi8(-3)
 361                    .L29:
 362 0346 820F                  add r24,r18
 363 0348 931F                  adc r25,r19
 364 034a 9093 0000             sts (actualPitchCount)+1,r25
 365 034e 8093 0000             sts actualPitchCount,r24
 366 0352 8091 0000             lds r24,delay
 367 0356 9091 0000             lds r25,(delay)+1
 368 035a 0196                  adiw r24,1
 369 035c 9093 0000             sts (delayCounter)+1,r25
 370 0360 8093 0000             sts delayCounter,r24
 371                    .L27:
 372 0364 8091 0000             lds r24,delayCounter
 373 0368 9091 0000             lds r25,(delayCounter)+1
 374 036c 0197                  sbiw r24,1
 375 036e 9093 0000             sts (delayCounter)+1,r25
 376 0372 8093 0000             sts delayCounter,r24
 377 0376 8091 0000             lds r24,actualPitchCount
 378 037a 9091 0000             lds r25,(actualPitchCount)+1
 379 037e 97FF                  sbrs r25,7
 380 0380 00C0                  rjmp .L30
 381 0382 1092 0000             sts (actualPitchCount)+1,__zero_reg__
 382 0386 1092 0000             sts actualPitchCount,__zero_reg__
 383                    .L30:
 384 038a 8091 0000             lds r24,stickValue
 385 038e 9091 0000             lds r25,(stickValue)+1
 386 0392 9093 0000             sts (DebugOut+54)+1,r25
 387 0396 8093 0000             sts DebugOut+54,r24
 388 039a 8091 0000             lds r24,actualPitchCount
 389 039e 9091 0000             lds r25,actualPitchCount+1
 390 03a2 8093 0000             sts DebugOut+58,r24
 391 03a6 9093 0000             sts DebugOut+59,r25
 392 03aa 2091 0000             lds r18,pitchOffset
 393 03ae 3091 0000             lds r19,(pitchOffset)+1
 394 03b2 3093 0000             sts (DebugOut+60)+1,r19
 395 03b6 2093 0000             sts DebugOut+60,r18
 396                    /* epilogue start */
 397 03ba DF91                  pop r29
 398 03bc CF91                  pop r28
 399 03be 1F91                  pop r17
 400 03c0 0F91                  pop r16
 401 03c2 0895                  ret
 403                    .global stickValue
 404                    .global stickValue
 405                            .section .bss
 408                    stickValue:
 409 0000 0000                  .skip 2,0
 410                    .global lastStickValue
 411                    .global lastStickValue
 414                    lastStickValue:
 415 0002 0000                  .skip 2,0
 416                    .global delay
 417                    .global delay
 420                    delay:
 421 0004 0000                  .skip 2,0
 422                    .global delayCounter
 423                    .global delayCounter
 426                    delayCounter:
 427 0006 0000                  .skip 2,0
 428                            .comm actualPitchCount,2,1
 429                            .comm targetPitchCount,2,1
 430                            .comm pitchOffset,2,1
 431                            .comm state,1,1
 432                            .comm timer,2,1
 433                            .comm temp,2,1
DEFINED SYMBOLS
                            *ABS*:00000000 pitch_md.c
  c:\TEMP/ccyyuOZC.s:2      *ABS*:0000003f __SREG__
  c:\TEMP/ccyyuOZC.s:3      *ABS*:0000003e __SP_H__
  c:\TEMP/ccyyuOZC.s:4      *ABS*:0000003d __SP_L__
  c:\TEMP/ccyyuOZC.s:5      *ABS*:00000034 __CCP__
  c:\TEMP/ccyyuOZC.s:6      *ABS*:00000000 __tmp_reg__
  c:\TEMP/ccyyuOZC.s:7      *ABS*:00000001 __zero_reg__
  c:\TEMP/ccyyuOZC.s:13     .text:00000000 pitch_md_value
  c:\TEMP/ccyyuOZC.s:408    .bss:00000000 stickValue
  c:\TEMP/ccyyuOZC.s:414    .bss:00000002 lastStickValue
                            *COM*:00000002 temp
                            *COM*:00000002 pitchOffset
                            *COM*:00000002 targetPitchCount
                            *COM*:00000001 state
                            *COM*:00000002 actualPitchCount
                            *COM*:00000002 timer
  c:\TEMP/ccyyuOZC.s:420    .bss:00000004 delay
  c:\TEMP/ccyyuOZC.s:426    .bss:00000006 delayCounter

UNDEFINED SYMBOLS
__do_copy_data
__do_clear_bss
EE_Parameter
PPM_in
MotorenEin
__divmodhi4
GetActiveParamSetNumber
WriteParameterSet
beeptime
altcon_lock
altcon_start
altcon_stop
averageN
DebugOut