Subversion Repositories FlightCtrl

Rev

Blame | Last modification | View Log | RSS feed

   1                            .file   "pitch_neutral.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_neutral_value
  13                    pitch_neutral_value:
  14 0000 CF92                  push r12
  15 0002 DF92                  push r13
  16 0004 EF92                  push r14
  17 0006 FF92                  push r15
  18 0008 0F93                  push r16
  19 000a 1F93                  push r17
  20 000c CF93                  push r28
  21 000e DF93                  push r29
  22                    /* prologue: function */
  23                    /* frame size = 0 */
  24 0010 8091 0000             lds r24,MotorenEin
  25 0014 8823                  tst r24
  26 0016 01F4                  brne .+2
  27 0018 00C0                  rjmp .L2
  28 001a C090 0000             lds r12,stickValue
  29 001e D090 0000             lds r13,(stickValue)+1
  30 0022 D092 0000             sts (lastStickValue)+1,r13
  31 0026 C092 0000             sts lastStickValue,r12
  32 002a 8091 0000             lds r24,EE_Parameter+2
  33 002e 082F                  mov r16,r24
  34 0030 10E0                  ldi r17,lo8(0)
  35 0032 F801                  movw r30,r16
  36 0034 EE0F                  lsl r30
  37 0036 FF1F                  rol r31
  38 0038 E050                  subi r30,lo8(-(PPM_in))
  39 003a F040                  sbci r31,hi8(-(PPM_in))
  40 003c 0190                  ld __tmp_reg__,Z+
  41 003e F081                  ld r31,Z
  42 0040 E02D                  mov r30,__tmp_reg__
  43 0042 EE9F                  mul r30,r30
  44 0044 C001                  movw r24,r0
  45 0046 EF9F                  mul r30,r31
  46 0048 900D                  add r25,r0
  47 004a FE9F                  mul r31,r30
  48 004c 900D                  add r25,r0
  49 004e 1124                  clr r1
  50 0050 1E16                  cp __zero_reg__,r30
  51 0052 1F06                  cpc __zero_reg__,r31
  52 0054 04F4                  brge .L3
  53 0056 66E9                  ldi r22,lo8(150)
  54 0058 70E0                  ldi r23,hi8(150)
  55 005a 00C0                  rjmp .L25
  56                    .L3:
  57 005c 6AE6                  ldi r22,lo8(-150)
  58 005e 7FEF                  ldi r23,hi8(-150)
  59                    .L25:
  60 0060 0E94 0000             call __divmodhi4
  61 0064 E60F                  add r30,r22
  62 0066 F71F                  adc r31,r23
  63 0068 F093 0000             sts (temp)+1,r31
  64 006c E093 0000             sts temp,r30
  65 0070 C601                  movw r24,r12
  66 0072 880F                  lsl r24
  67 0074 991F                  rol r25
  68 0076 2091 0000             lds r18,temp
  69 007a 3091 0000             lds r19,(temp)+1
  70 007e 820F                  add r24,r18
  71 0080 931F                  adc r25,r19
  72 0082 63E0                  ldi r22,lo8(3)
  73 0084 70E0                  ldi r23,hi8(3)
  74 0086 0E94 0000             call __divmodhi4
  75 008a 9B01                  movw r18,r22
  76 008c 7093 0000             sts (stickValue)+1,r23
  77 0090 6093 0000             sts stickValue,r22
  78 0094 C091 0000             lds r28,pitchOffset
  79 0098 D091 0000             lds r29,(pitchOffset)+1
  80 009c 7B01                  movw r14,r22
  81 009e EC0E                  add r14,r28
  82 00a0 FD1E                  adc r15,r29
  83 00a2 8091 0000             lds r24,state
  84 00a6 8530                  cpi r24,lo8(5)
  85 00a8 01F4                  brne .+2
  86 00aa 00C0                  rjmp .L9
  87 00ac 8630                  cpi r24,lo8(6)
  88 00ae 00F4                  brsh .L13
  89 00b0 8330                  cpi r24,lo8(3)
  90 00b2 01F0                  breq .L7
  91 00b4 8430                  cpi r24,lo8(4)
  92 00b6 00F0                  brlo .+2
  93 00b8 00C0                  rjmp .L8
  94 00ba 8230                  cpi r24,lo8(2)
  95 00bc 01F0                  breq .+2
  96 00be 00C0                  rjmp .L5
  97 00c0 00C0                  rjmp .L28
  98                    .L13:
  99 00c2 8730                  cpi r24,lo8(7)
 100 00c4 01F4                  brne .+2
 101 00c6 00C0                  rjmp .L11
 102 00c8 8730                  cpi r24,lo8(7)
 103 00ca 00F4                  brsh .+2
 104 00cc 00C0                  rjmp .L10
 105 00ce 8830                  cpi r24,lo8(8)
 106 00d0 01F0                  breq .+2
 107 00d2 00C0                  rjmp .L5
 108 00d4 00C0                  rjmp .L29
 109                    .L28:
 110 00d6 46E0                  ldi r20,lo8(6)
 111 00d8 C416                  cp r12,r20
 112 00da D104                  cpc r13,__zero_reg__
 113 00dc 04F4                  brge .+2
 114 00de 00C0                  rjmp .L5
 115 00e0 C601                  movw r24,r12
 116 00e2 861B                  sub r24,r22
 117 00e4 970B                  sbc r25,r23
 118 00e6 9C01                  movw r18,r24
 119 00e8 8091 0000             lds r24,EE_Parameter+29
 120 00ec 90E0                  ldi r25,lo8(0)
 121 00ee 2817                  cp r18,r24
 122 00f0 3907                  cpc r19,r25
 123 00f2 04F4                  brge .+2
 124 00f4 00C0                  rjmp .L5
 125 00f6 D092 0000             sts (pitchOffset)+1,r13
 126 00fa C092 0000             sts pitchOffset,r12
 127 00fe 83E0                  ldi r24,lo8(3)
 128 0100 8093 0000             sts state,r24
 129 0104 89E1                  ldi r24,lo8(25)
 130 0106 90E0                  ldi r25,hi8(25)
 131 0108 9093 0000             sts (pitchNeutralTimer)+1,r25
 132 010c 8093 0000             sts pitchNeutralTimer,r24
 133 0110 00C0                  rjmp .L5
 134                    .L7:
 135 0112 8091 0000             lds r24,pitchNeutralTimer
 136 0116 9091 0000             lds r25,(pitchNeutralTimer)+1
 137 011a 0197                  sbiw r24,1
 138 011c 9093 0000             sts (pitchNeutralTimer)+1,r25
 139 0120 8093 0000             sts pitchNeutralTimer,r24
 140 0124 892B                  or r24,r25
 141 0126 01F4                  brne .L15
 142 0128 1092 0000             sts (pitchOffset)+1,__zero_reg__
 143 012c 1092 0000             sts pitchOffset,__zero_reg__
 144 0130 82E0                  ldi r24,lo8(2)
 145 0132 8093 0000             sts state,r24
 146                    .L15:
 147 0136 2B5F                  subi r18,lo8(-(5))
 148 0138 3F4F                  sbci r19,hi8(-(5))
 149 013a 2B30                  cpi r18,11
 150 013c 3105                  cpc r19,__zero_reg__
 151 013e 00F0                  brlo .+2
 152 0140 00C0                  rjmp .L14
 153 0142 8091 0000             lds r24,EE_Parameter+8
 154 0146 80FF                  sbrs r24,0
 155 0148 00C0                  rjmp .L16
 156 014a 87E0                  ldi r24,lo8(7)
 157 014c 00C0                  rjmp .L26
 158                    .L16:
 159 014e 84E0                  ldi r24,lo8(4)
 160 0150 00C0                  rjmp .L26
 161                    .L8:
 162 0152 8091 0000             lds r24,EE_Parameter+30
 163 0156 C82F                  mov r28,r24
 164 0158 D0E0                  ldi r29,lo8(0)
 165 015a EC16                  cp r14,r28
 166 015c FD06                  cpc r15,r29
 167 015e 04F4                  brge .+2
 168 0160 00C0                  rjmp .L14
 169 0162 00C0                  rjmp .L5
 170                    .L9:
 171 0164 8091 0000             lds r24,EE_Parameter+51
 172 0168 84FF                  sbrs r24,4
 173 016a 00C0                  rjmp .L17
 174 016c 000F                  lsl r16
 175 016e 111F                  rol r17
 176 0170 0050                  subi r16,lo8(-(PPM_in))
 177 0172 1040                  sbci r17,hi8(-(PPM_in))
 178 0174 F801                  movw r30,r16
 179 0176 8081                  ld r24,Z
 180 0178 9181                  ldd r25,Z+1
 181 017a 8C5A                  subi r24,lo8(-84)
 182 017c 9F4F                  sbci r25,hi8(-84)
 183 017e 04F0                  brlt .L18
 184 0180 84E6                  ldi r24,lo8(100)
 185 0182 90E0                  ldi r25,hi8(100)
 186 0184 9093 0000             sts (pitchNeutralTimer)+1,r25
 187 0188 8093 0000             sts pitchNeutralTimer,r24
 188 018c 00C0                  rjmp .L17
 189                    .L18:
 190 018e 8091 0000             lds r24,pitchNeutralTimer
 191 0192 9091 0000             lds r25,(pitchNeutralTimer)+1
 192 0196 0197                  sbiw r24,1
 193 0198 9093 0000             sts (pitchNeutralTimer)+1,r25
 194 019c 8093 0000             sts pitchNeutralTimer,r24
 195 01a0 892B                  or r24,r25
 196 01a2 01F4                  brne .L17
 197 01a4 82E0                  ldi r24,lo8(2)
 198 01a6 8093 0000             sts state,r24
 199 01aa 1092 0000             sts (pitchOffset)+1,__zero_reg__
 200 01ae 1092 0000             sts pitchOffset,__zero_reg__
 201 01b2 84EF                  ldi r24,lo8(500)
 202 01b4 91E0                  ldi r25,hi8(500)
 203 01b6 9093 0000             sts (beeptime)+1,r25
 204 01ba 8093 0000             sts beeptime,r24
 205                    .L17:
 206 01be 8091 0000             lds r24,EE_Parameter+30
 207 01c2 90E0                  ldi r25,lo8(0)
 208 01c4 E701                  movw r28,r14
 209 01c6 E816                  cp r14,r24
 210 01c8 F906                  cpc r15,r25
 211 01ca 04F4                  brge .L19
 212 01cc EC01                  movw r28,r24
 213                    .L19:
 214 01ce 2C5F                  subi r18,lo8(-(4))
 215 01d0 3F4F                  sbci r19,hi8(-(4))
 216 01d2 2930                  cpi r18,9
 217 01d4 3105                  cpc r19,__zero_reg__
 218 01d6 00F0                  brlo .+2
 219 01d8 00C0                  rjmp .L14
 220 01da 89E1                  ldi r24,lo8(25)
 221 01dc 90E0                  ldi r25,hi8(25)
 222 01de 9093 0000             sts (pitchNeutralTimer)+1,r25
 223 01e2 8093 0000             sts pitchNeutralTimer,r24
 224 01e6 86E0                  ldi r24,lo8(6)
 225 01e8 00C0                  rjmp .L26
 226                    .L10:
 227 01ea CB01                  movw r24,r22
 228 01ec 0496                  adiw r24,4
 229 01ee 0997                  sbiw r24,9
 230 01f0 00F4                  brsh .L20
 231 01f2 C616                  cp r12,r22
 232 01f4 D706                  cpc r13,r23
 233 01f6 01F4                  brne .L20
 234 01f8 8091 0000             lds r24,pitchNeutralTimer
 235 01fc 9091 0000             lds r25,(pitchNeutralTimer)+1
 236 0200 0197                  sbiw r24,1
 237 0202 9093 0000             sts (pitchNeutralTimer)+1,r25
 238 0206 8093 0000             sts pitchNeutralTimer,r24
 239 020a 892B                  or r24,r25
 240 020c 01F4                  brne .L5
 241 020e 87E0                  ldi r24,lo8(7)
 242 0210 00C0                  rjmp .L27
 243                    .L20:
 244 0212 85E0                  ldi r24,lo8(5)
 245                    .L27:
 246 0214 8093 0000             sts state,r24
 247 0218 00C0                  rjmp .L5
 248                    .L11:
 249 021a 0E94 0000             call altcon_start
 250 021e 88E0                  ldi r24,lo8(8)
 251 0220 00C0                  rjmp .L27
 252                    .L29:
 253 0222 CB01                  movw r24,r22
 254 0224 77FF                  sbrs r23,7
 255 0226 00C0                  rjmp .L21
 256 0228 8827                  clr r24
 257 022a 9927                  clr r25
 258 022c 861B                  sub r24,r22
 259 022e 970B                  sbc r25,r23
 260                    .L21:
 261 0230 0697                  sbiw r24,6
 262 0232 04F0                  brlt .L5
 263 0234 8091 0000             lds r24,averageN
 264 0238 9091 0000             lds r25,(averageN)+1
 265 023c 64E0                  ldi r22,lo8(4)
 266 023e 70E0                  ldi r23,hi8(4)
 267 0240 0E94 0000             call __divmodhi4
 268 0244 CE01                  movw r24,r28
 269 0246 861B                  sub r24,r22
 270 0248 970B                  sbc r25,r23
 271 024a 9093 0000             sts (pitchOffset)+1,r25
 272 024e 8093 0000             sts pitchOffset,r24
 273 0252 E901                  movw r28,r18
 274 0254 C80F                  add r28,r24
 275 0256 D91F                  adc r29,r25
 276 0258 0E94 0000             call altcon_stop
 277 025c 85E0                  ldi r24,lo8(5)
 278                    .L26:
 279 025e 8093 0000             sts state,r24
 280 0262 00C0                  rjmp .L14
 281                    .L2:
 282 0264 1092 0000             sts (pitchOffset)+1,__zero_reg__
 283 0268 1092 0000             sts pitchOffset,__zero_reg__
 284 026c 1092 0000             sts (stickValue)+1,__zero_reg__
 285 0270 1092 0000             sts stickValue,__zero_reg__
 286 0274 82E0                  ldi r24,lo8(2)
 287 0276 8093 0000             sts state,r24
 288 027a C0E0                  ldi r28,lo8(0)
 289 027c D0E0                  ldi r29,hi8(0)
 290 027e 00C0                  rjmp .L14
 291                    .L5:
 292 0280 E701                  movw r28,r14
 293                    .L14:
 294 0282 8091 0000             lds r24,pitchOffset
 295 0286 9091 0000             lds r25,(pitchOffset)+1
 296 028a 97FF                  sbrs r25,7
 297 028c 00C0                  rjmp .L22
 298 028e 1092 0000             sts (pitchOffset)+1,__zero_reg__
 299 0292 1092 0000             sts pitchOffset,__zero_reg__
 300                    .L22:
 301 0296 9E01                  movw r18,r28
 302 0298 D7FF                  sbrs r29,7
 303 029a 00C0                  rjmp .L23
 304 029c 20E0                  ldi r18,lo8(0)
 305 029e 30E0                  ldi r19,hi8(0)
 306                    .L23:
 307 02a0 8091 0000             lds r24,stickValue
 308 02a4 9091 0000             lds r25,(stickValue)+1
 309 02a8 9093 0000             sts (DebugOut+54)+1,r25
 310 02ac 8093 0000             sts DebugOut+54,r24
 311 02b0 3093 0000             sts (DebugOut+58)+1,r19
 312 02b4 2093 0000             sts DebugOut+58,r18
 313 02b8 8091 0000             lds r24,pitchOffset
 314 02bc 9091 0000             lds r25,(pitchOffset)+1
 315 02c0 9093 0000             sts (DebugOut+60)+1,r25
 316 02c4 8093 0000             sts DebugOut+60,r24
 317 02c8 C901                  movw r24,r18
 318                    /* epilogue start */
 319 02ca DF91                  pop r29
 320 02cc CF91                  pop r28
 321 02ce 1F91                  pop r17
 322 02d0 0F91                  pop r16
 323 02d2 FF90                  pop r15
 324 02d4 EF90                  pop r14
 325 02d6 DF90                  pop r13
 326 02d8 CF90                  pop r12
 327 02da 0895                  ret
 329                            .lcomm stickValue,2
 330                            .lcomm lastStickValue,2
 331                            .lcomm pitchOffset,2
 332                            .lcomm state,1
 333                            .data
 336                    pitchNeutralTimer:
 337 0000 1900                  .word   25
 338                            .lcomm temp,2
DEFINED SYMBOLS
                            *ABS*:00000000 pitch_neutral.c
  c:\TEMP/ccEXHUa7.s:2      *ABS*:0000003f __SREG__
  c:\TEMP/ccEXHUa7.s:3      *ABS*:0000003e __SP_H__
  c:\TEMP/ccEXHUa7.s:4      *ABS*:0000003d __SP_L__
  c:\TEMP/ccEXHUa7.s:5      *ABS*:00000034 __CCP__
  c:\TEMP/ccEXHUa7.s:6      *ABS*:00000000 __tmp_reg__
  c:\TEMP/ccEXHUa7.s:7      *ABS*:00000001 __zero_reg__
  c:\TEMP/ccEXHUa7.s:13     .text:00000000 pitch_neutral_value
                             .bss:00000000 stickValue
  c:\TEMP/ccEXHUa7.s:329    .bss:00000002 lastStickValue
  c:\TEMP/ccEXHUa7.s:332    .bss:00000007 temp
  c:\TEMP/ccEXHUa7.s:330    .bss:00000004 pitchOffset
  c:\TEMP/ccEXHUa7.s:331    .bss:00000006 state
  c:\TEMP/ccEXHUa7.s:336    .data:00000000 pitchNeutralTimer

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