/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/Flight-Ctrl_MEGA644_V0_61.eep |
---|
0,0 → 1,129 |
:1000000000000000000000000000000000000000F0 |
:1000100000000000000000000000000000000000E0 |
:1000200000000000000000000000000000000000D0 |
:1000300000000000000000000000000000000000C0 |
:1000400000000000000000000000000000000000B0 |
:1000500000000000000000000000000000000000A0 |
:100060000000000000000000000000000000000090 |
:100070000000000000000000000000000000000080 |
:100080000000000000000000000000000000000070 |
:100090000000000000000000000000000000000060 |
:1000A0000000000000000000000000000000000050 |
:1000B0000000000000000000000000000000000040 |
:1000C0000000000000000000000000000000000030 |
:1000D0000000000000000000000000000000000020 |
:1000E0000000000000000000000000000000000010 |
:1000F0000000000000000000000000000000000000 |
:1001000000000000000000000000000000000000EF |
:1001100000000000000000000000000000000000DF |
:1001200000000000000000000000000000000000CF |
:1001300000000000000000000000000000000000BF |
:1001400000000000000000000000000000000000AF |
:10015000000000000000000000000000000000009F |
:10016000000000000000000000000000000000008F |
:10017000000000000000000000000000000000007F |
:10018000000000000000000000000000000000006F |
:10019000000000000000000000000000000000005F |
:1001A000000000000000000000000000000000004F |
:1001B000000000000000000000000000000000003F |
:1001C000000000000000000000000000000000002F |
:1001D000000000000000000000000000000000001F |
:1001E000000000000000000000000000000000000F |
:1001F00000000000000000000000000000000000FF |
:1002000000000000000000000000000000000000EE |
:1002100000000000000000000000000000000000DE |
:1002200000000000000000000000000000000000CE |
:1002300000000000000000000000000000000000BE |
:1002400000000000000000000000000000000000AE |
:10025000000000000000000000000000000000009E |
:10026000000000000000000000000000000000008E |
:10027000000000000000000000000000000000007E |
:10028000000000000000000000000000000000006E |
:10029000000000000000000000000000000000005E |
:1002A000000000000000000000000000000000004E |
:1002B000000000000000000000000000000000003E |
:1002C000000000000000000000000000000000002E |
:1002D000000000000000000000000000000000001E |
:1002E000000000000000000000000000000000000E |
:1002F00000000000000000000000000000000000FE |
:1003000000000000000000000000000000000000ED |
:1003100000000000000000000000000000000000DD |
:1003200000000000000000000000000000000000CD |
:1003300000000000000000000000000000000000BD |
:1003400000000000000000000000000000000000AD |
:10035000000000000000000000000000000000009D |
:10036000000000000000000000000000000000008D |
:10037000000000000000000000000000000000007D |
:10038000000000000000000000000000000000006D |
:10039000000000000000000000000000000000005D |
:1003A000000000000000000000000000000000004D |
:1003B000000000000000000000000000000000003D |
:1003C000000000000000000000000000000000002D |
:1003D000000000000000000000000000000000001D |
:1003E000000000000000000000000000000000000D |
:1003F00000000000000000000000000000000000FD |
:1004000000000000000000000000000000000000EC |
:1004100000000000000000000000000000000000DC |
:1004200000000000000000000000000000000000CC |
:1004300000000000000000000000000000000000BC |
:1004400000000000000000000000000000000000AC |
:10045000000000000000000000000000000000009C |
:10046000000000000000000000000000000000008C |
:10047000000000000000000000000000000000007C |
:10048000000000000000000000000000000000006C |
:10049000000000000000000000000000000000005C |
:1004A000000000000000000000000000000000004C |
:1004B000000000000000000000000000000000003C |
:1004C000000000000000000000000000000000002C |
:1004D000000000000000000000000000000000001C |
:1004E000000000000000000000000000000000000C |
:1004F00000000000000000000000000000000000FC |
:1005000000000000000000000000000000000000EB |
:1005100000000000000000000000000000000000DB |
:1005200000000000000000000000000000000000CB |
:1005300000000000000000000000000000000000BB |
:1005400000000000000000000000000000000000AB |
:10055000000000000000000000000000000000009B |
:10056000000000000000000000000000000000008B |
:10057000000000000000000000000000000000007B |
:10058000000000000000000000000000000000006B |
:10059000000000000000000000000000000000005B |
:1005A000000000000000000000000000000000004B |
:1005B000000000000000000000000000000000003B |
:1005C000000000000000000000000000000000002B |
:1005D000000000000000000000000000000000001B |
:1005E000000000000000000000000000000000000B |
:1005F00000000000000000000000000000000000FB |
:1006000000000000000000000000000000000000EA |
:1006100000000000000000000000000000000000DA |
:1006200000000000000000000000000000000000CA |
:1006300000000000000000000000000000000000BA |
:1006400000000000000000000000000000000000AA |
:10065000000000000000000000000000000000009A |
:10066000000000000000000000000000000000008A |
:10067000000000000000000000000000000000007A |
:10068000000000000000000000000000000000006A |
:10069000000000000000000000000000000000005A |
:1006A000000000000000000000000000000000004A |
:1006B000000000000000000000000000000000003A |
:1006C000000000000000000000000000000000002A |
:1006D000000000000000000000000000000000001A |
:1006E000000000000000000000000000000000000A |
:1006F00000000000000000000000000000000000FA |
:1007000000000000000000000000000000000000E9 |
:1007100000000000000000000000000000000000D9 |
:1007200000000000000000000000000000000000C9 |
:1007300000000000000000000000000000000000B9 |
:1007400000000000000000000000000000000000A9 |
:100750000000000000000000000000000000000099 |
:100760000000000000000000000000000000000089 |
:100770000000000000000000000000000000000079 |
:100780000000000000000000000000000000000069 |
:100790000000000000000000000000000000000059 |
:1007A0000000000000000000000000000000000049 |
:1007B0000000000000000000000000000000000039 |
:1007C0000000000000000000000000000000000029 |
:1007D0000000000000000000000000000000000019 |
:1007E0000000000000000000000000000000000009 |
:1007F00000000000000000000000000000000000F9 |
:00000001FF |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/Flight-Ctrl_MEGA644_V0_61.elf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/Flight-Ctrl_MEGA644_V0_61.lss |
---|
0,0 → 1,13096 |
Flight-Ctrl_MEGA644_V0_61.elf: file format elf32-avr |
Sections: |
Idx Name Size VMA LMA File off Algn |
0 .data 0000072a 00800100 00007e8e 00007f42 2**0 |
CONTENTS, ALLOC, LOAD, DATA |
1 .text 00007e8e 00000000 00000000 000000b4 2**1 |
CONTENTS, ALLOC, LOAD, READONLY, CODE |
2 .bss 000004f6 0080082a 0080082a 0000866c 2**0 |
ALLOC |
3 .eeprom 00000800 00810000 00810000 0000866c 2**0 |
CONTENTS, ALLOC, LOAD, DATA |
4 .stab 00000378 00000000 00000000 00008e6c 2**2 |
CONTENTS, READONLY, DEBUGGING |
5 .stabstr 00000071 00000000 00000000 000091e4 2**0 |
CONTENTS, READONLY, DEBUGGING |
Disassembly of section .text: |
00000000 <__vectors>: |
0: 0c 94 e5 01 jmp 0x3ca ; 0x3ca <__ctors_end> |
4: 0c 94 02 02 jmp 0x404 ; 0x404 <__bad_interrupt> |
8: 0c 94 02 02 jmp 0x404 ; 0x404 <__bad_interrupt> |
c: 0c 94 02 02 jmp 0x404 ; 0x404 <__bad_interrupt> |
10: 0c 94 02 02 jmp 0x404 ; 0x404 <__bad_interrupt> |
14: 0c 94 02 02 jmp 0x404 ; 0x404 <__bad_interrupt> |
18: 0c 94 02 02 jmp 0x404 ; 0x404 <__bad_interrupt> |
1c: 0c 94 02 02 jmp 0x404 ; 0x404 <__bad_interrupt> |
20: 0c 94 02 02 jmp 0x404 ; 0x404 <__bad_interrupt> |
24: 0c 94 ab 0c jmp 0x1956 ; 0x1956 <__vector_9> |
28: 0c 94 02 02 jmp 0x404 ; 0x404 <__bad_interrupt> |
2c: 0c 94 02 02 jmp 0x404 ; 0x404 <__bad_interrupt> |
30: 0c 94 9c 15 jmp 0x2b38 ; 0x2b38 <__vector_12> |
34: 0c 94 02 02 jmp 0x404 ; 0x404 <__bad_interrupt> |
38: 0c 94 02 02 jmp 0x404 ; 0x404 <__bad_interrupt> |
3c: 0c 94 02 02 jmp 0x404 ; 0x404 <__bad_interrupt> |
40: 0c 94 02 02 jmp 0x404 ; 0x404 <__bad_interrupt> |
44: 0c 94 02 02 jmp 0x404 ; 0x404 <__bad_interrupt> |
48: 0c 94 ff 0b jmp 0x17fe ; 0x17fe <__vector_18> |
4c: 0c 94 02 02 jmp 0x404 ; 0x404 <__bad_interrupt> |
50: 0c 94 ad 04 jmp 0x95a ; 0x95a <__vector_20> |
54: 0c 94 02 02 jmp 0x404 ; 0x404 <__bad_interrupt> |
58: 0c 94 9e 03 jmp 0x73c ; 0x73c <__vector_22> |
5c: 0c 94 02 02 jmp 0x404 ; 0x404 <__bad_interrupt> |
60: 0c 94 91 0d jmp 0x1b22 ; 0x1b22 <__vector_24> |
64: 0c 94 02 02 jmp 0x404 ; 0x404 <__bad_interrupt> |
68: 0c 94 e9 14 jmp 0x29d2 ; 0x29d2 <__vector_26> |
6c: 0c 94 02 02 jmp 0x404 ; 0x404 <__bad_interrupt> |
00000070 <__c.2052>: |
70: 0a 0a 0d 00 .... |
00000074 <__c.2050>: |
74: 4e 65 75 74 72 61 6c 00 Neutral. |
0000007c <__c.2048>: |
7c: 48 65 61 64 69 6e 67 48 6f 6c 64 00 HeadingHold. |
00000088 <__c.2046>: |
88: 0a 0d 53 74 65 75 65 72 75 6e 67 3a 20 00 ..Steuerung: . |
00000096 <__c.2044>: |
96: 4f 4b 0a 0d 00 OK... |
0000009b <__c.2039>: |
9b: 0a 0d 41 62 67 6c 65 69 63 68 20 4c 75 66 74 64 ..Abgleich Luftd |
ab: 72 75 63 6b 73 65 6e 73 6f 72 2e 2e 00 rucksensor... |
000000b8 <__c.2037>: |
b8: 0a 0d 42 65 6e 75 74 7a 65 20 50 61 72 61 6d 65 ..Benutze Parame |
c8: 74 65 72 73 61 74 7a 20 25 64 00 tersatz %d. |
000000d3 <__c.2031>: |
d3: 0a 0d 49 6e 69 74 2e 20 45 45 50 52 4f 4d 3a 20 ..Init. EEPROM: |
e3: 47 65 6e 65 72 69 65 72 65 20 44 65 66 61 75 6c Generiere Defaul |
f3: 74 2d 50 61 72 61 6d 65 74 65 72 2e 2e 2e 00 t-Parameter.... |
00000102 <__c.2029>: |
102: 0a 0d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ..============== |
112: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================ |
... |
00000123 <__c.2027>: |
123: 0a 0d 46 6c 69 67 68 74 43 6f 6e 74 72 6f 6c 20 ..FlightControl |
133: 56 25 64 2e 25 64 20 00 V%d.%d . |
0000013b <__c.2026>: |
13b: 2e 00 .. |
0000013d <__c.2108>: |
13d: 52 61 6e 67 65 3a 25 33 69 2d 25 33 69 00 Range:%3i-%3i. |
0000014b <__c.2106>: |
14b: 53 74 65 6c 6c 75 6e 67 3a 20 25 33 69 00 Stellung: %3i. |
00000159 <__c.2104>: |
159: 53 65 74 70 6f 69 6e 74 20 20 25 33 69 00 Setpoint %3i. |
00000167 <__c.2102>: |
167: 53 65 72 76 6f 20 20 00 Servo . |
0000016f <__c.2099>: |
16f: 50 6f 34 3a 20 25 33 69 20 50 6f 38 3a 20 25 33 Po4: %3i Po8: %3 |
17f: 69 00 i. |
00000181 <__c.2097>: |
181: 50 6f 33 3a 20 25 33 69 20 50 6f 37 3a 20 25 33 Po3: %3i Po7: %3 |
191: 69 00 i. |
00000193 <__c.2095>: |
193: 50 6f 32 3a 20 25 33 69 20 50 6f 36 3a 20 25 33 Po2: %3i Po6: %3 |
1a3: 69 00 i. |
000001a5 <__c.2093>: |
1a5: 50 6f 31 3a 20 25 33 69 20 50 6f 35 3a 20 25 33 Po1: %3i Po5: %3 |
1b5: 69 00 i. |
000001b7 <__c.2090>: |
1b7: 53 74 61 72 74 3a 20 20 20 20 20 25 35 69 00 Start: %5i. |
000001c6 <__c.2088>: |
1c6: 4d 65 73 73 77 65 72 74 3a 20 20 25 35 69 00 Messwert: %5i. |
000001d5 <__c.2086>: |
1d5: 52 69 63 68 74 75 6e 67 3a 20 20 25 35 69 00 Richtung: %5i. |
000001e4 <__c.2084>: |
1e4: 4b 6f 6d 70 61 73 73 20 20 20 20 20 20 20 00 Kompass . |
000001f3 <__c.2081>: |
1f3: 45 6d 70 66 2e 50 65 67 65 6c 3a 25 35 69 00 Empf.Pegel:%5i. |
00000202 <__c.2079>: |
202: 53 70 61 6e 6e 75 6e 67 3a 20 20 25 35 69 00 Spannung: %5i. |
00000211 <__c.2076>: |
211: 48 6f 63 68 20 25 34 69 20 28 25 33 69 29 00 Hoch %4i (%3i). |
00000220 <__c.2074>: |
220: 52 6f 6c 6c 20 25 34 69 20 28 25 33 69 29 00 Roll %4i (%3i). |
0000022f <__c.2072>: |
22f: 4e 69 63 6b 20 25 34 69 20 28 25 33 69 29 00 Nick %4i (%3i). |
0000023e <__c.2070>: |
23e: 41 43 43 20 2d 20 53 65 6e 73 6f 72 00 ACC - Sensor. |
0000024b <__c.2067>: |
24b: 47 69 65 72 20 25 34 69 20 28 25 33 69 29 00 Gier %4i (%3i). |
0000025a <__c.2065>: |
25a: 52 6f 6c 6c 20 25 34 69 20 28 25 33 69 29 00 Roll %4i (%3i). |
00000269 <__c.2063>: |
269: 4e 69 63 6b 20 25 34 69 20 28 25 33 69 29 00 Nick %4i (%3i). |
00000278 <__c.2061>: |
278: 47 79 72 6f 20 2d 20 53 65 6e 73 6f 72 00 Gyro - Sensor. |
00000286 <__c.2058>: |
286: 50 33 3a 25 34 69 20 20 50 34 3a 25 34 69 20 00 P3:%4i P4:%4i . |
00000296 <__c.2056>: |
296: 50 31 3a 25 34 69 20 20 50 32 3a 25 34 69 20 00 P1:%4i P2:%4i . |
000002a6 <__c.2054>: |
2a6: 47 73 3a 25 34 69 20 20 47 69 3a 25 34 69 20 00 Gs:%4i Gi:%4i . |
000002b6 <__c.2052>: |
2b6: 4e 69 3a 25 34 69 20 20 52 6f 3a 25 34 69 20 00 Ni:%4i Ro:%4i . |
000002c6 <__c.2049>: |
2c6: 4b 37 3a 25 34 69 20 20 4b 38 3a 25 34 69 20 00 K7:%4i K8:%4i . |
000002d6 <__c.2047>: |
2d6: 4b 35 3a 25 34 69 20 20 4b 36 3a 25 34 69 20 00 K5:%4i K6:%4i . |
000002e6 <__c.2045>: |
2e6: 4b 33 3a 25 34 69 20 20 4b 34 3a 25 34 69 20 00 K3:%4i K4:%4i . |
000002f6 <__c.2043>: |
2f6: 4b 31 3a 25 34 69 20 20 4b 32 3a 25 34 69 20 00 K1:%4i K2:%4i . |
00000306 <__c.2040>: |
306: 4b 6f 6d 70 61 73 73 3a 20 20 20 25 35 69 00 Kompass: %5i. |
00000315 <__c.2038>: |
315: 52 6f 6c 6c 3a 20 20 20 20 20 20 25 35 69 00 Roll: %5i. |
00000324 <__c.2036>: |
324: 4e 69 63 6b 3a 20 20 20 20 20 20 25 35 69 00 Nick: %5i. |
00000333 <__c.2034>: |
333: 61 6b 74 2e 20 4c 61 67 65 00 akt. Lage. |
0000033d <__c.2031>: |
33d: 48 f6 68 65 6e 72 65 67 65 6c 75 6e 67 00 H.henregelung. |
0000034b <__c.2029>: |
34b: 4b 65 69 6e 65 20 00 Keine . |
00000352 <__c.2027>: |
352: 4f 66 66 20 20 20 20 20 20 3a 20 25 35 69 00 Off : %5i. |
00000361 <__c.2025>: |
361: 4c 75 66 74 64 72 75 63 6b 3a 20 25 35 69 00 Luftdruck: %5i. |
00000370 <__c.2023>: |
370: 53 6f 6c 6c 48 6f 65 68 65 3a 20 25 35 69 00 SollHoehe: %5i. |
0000037f <__c.2021>: |
37f: 48 6f 65 68 65 3a 20 20 20 20 20 25 35 69 00 Hoehe: %5i. |
0000038e <__c.2017>: |
38e: 28 63 29 20 48 6f 6c 67 65 72 20 42 75 73 73 00 (c) Holger Buss. |
0000039e <__c.2015>: |
39e: 53 65 74 74 69 6e 67 3a 20 25 64 20 00 Setting: %d . |
000003ab <__c.2013>: |
3ab: 56 25 64 2e 25 64 00 V%d.%d. |
000003b2 <__c.2011>: |
3b2: 2b 2b 20 4d 69 6b 72 6f 4b 6f 70 74 65 72 20 2b ++ MikroKopter + |
3c2: 2b 00 +. |
000003c4 <__c.2008>: |
3c4: 5b 25 69 5d 00 00 [%i].. |
000003ca <__ctors_end>: |
3ca: 11 24 eor r1, r1 |
3cc: 1f be out 0x3f, r1 ; 63 |
3ce: cf ef ldi r28, 0xFF ; 255 |
3d0: d0 e1 ldi r29, 0x10 ; 16 |
3d2: de bf out 0x3e, r29 ; 62 |
3d4: cd bf out 0x3d, r28 ; 61 |
000003d6 <__do_copy_data>: |
3d6: 18 e0 ldi r17, 0x08 ; 8 |
3d8: a0 e0 ldi r26, 0x00 ; 0 |
3da: b1 e0 ldi r27, 0x01 ; 1 |
3dc: ee e8 ldi r30, 0x8E ; 142 |
3de: fe e7 ldi r31, 0x7E ; 126 |
3e0: 02 c0 rjmp .+4 ; 0x3e6 <.do_copy_data_start> |
000003e2 <.do_copy_data_loop>: |
3e2: 05 90 lpm r0, Z+ |
3e4: 0d 92 st X+, r0 |
000003e6 <.do_copy_data_start>: |
3e6: aa 32 cpi r26, 0x2A ; 42 |
3e8: b1 07 cpc r27, r17 |
3ea: d9 f7 brne .-10 ; 0x3e2 <.do_copy_data_loop> |
000003ec <__do_clear_bss>: |
3ec: 1d e0 ldi r17, 0x0D ; 13 |
3ee: aa e2 ldi r26, 0x2A ; 42 |
3f0: b8 e0 ldi r27, 0x08 ; 8 |
3f2: 01 c0 rjmp .+2 ; 0x3f6 <.do_clear_bss_start> |
000003f4 <.do_clear_bss_loop>: |
3f4: 1d 92 st X+, r1 |
000003f6 <.do_clear_bss_start>: |
3f6: a0 32 cpi r26, 0x20 ; 32 |
3f8: b1 07 cpc r27, r17 |
3fa: e1 f7 brne .-8 ; 0x3f4 <.do_clear_bss_loop> |
3fc: 0e 94 39 02 call 0x472 ; 0x472 <main> |
400: 0c 94 46 3f jmp 0x7e8c ; 0x7e8c <_exit> |
00000404 <__bad_interrupt>: |
404: 0c 94 00 00 jmp 0 ; 0x0 <__vectors> |
00000408 <GetActiveParamSetNumber>: |
408: a2 e0 ldi r26, 0x02 ; 2 |
40a: b0 e0 ldi r27, 0x00 ; 0 |
40c: 0e 94 32 3f call 0x7e64 ; 0x7e64 <__eeprom_read_byte_1F2021> |
410: 80 2d mov r24, r0 |
412: 99 27 eor r25, r25 |
414: 08 95 ret |
00000416 <WriteParameterSet>: |
416: fb 01 movw r30, r22 |
418: 28 2f mov r18, r24 |
41a: 86 30 cpi r24, 0x06 ; 6 |
41c: 08 f0 brcs .+2 ; 0x420 <WriteParameterSet+0xa> |
41e: 25 e0 ldi r18, 0x05 ; 5 |
420: 84 2f mov r24, r20 |
422: 99 27 eor r25, r25 |
424: 42 9f mul r20, r18 |
426: d0 01 movw r26, r0 |
428: 11 24 eor r1, r1 |
42a: ac 59 subi r26, 0x9C ; 156 |
42c: bf 4f sbci r27, 0xFF ; 255 |
0000042e <.26_start>: |
42e: 01 97 sbiw r24, 0x01 ; 1 |
430: 24 f0 brlt .+8 ; 0x43a <.26_finished> |
432: 01 90 ld r0, Z+ |
434: 0e 94 3a 3f call 0x7e74 ; 0x7e74 <__eeprom_write_byte_1F2021> |
438: fa cf rjmp .-12 ; 0x42e <.26_start> |
0000043a <.26_finished>: |
43a: a2 e0 ldi r26, 0x02 ; 2 |
43c: b0 e0 ldi r27, 0x00 ; 0 |
43e: 02 2e mov r0, r18 |
440: 0e 94 3a 3f call 0x7e74 ; 0x7e74 <__eeprom_write_byte_1F2021> |
444: 08 95 ret |
00000446 <ReadParameterSet>: |
446: cf 93 push r28 |
448: df 93 push r29 |
44a: fb 01 movw r30, r22 |
44c: c4 2f mov r28, r20 |
44e: dd 27 eor r29, r29 |
450: 86 30 cpi r24, 0x06 ; 6 |
452: 08 f0 brcs .+2 ; 0x456 <ReadParameterSet+0x10> |
454: 85 e0 ldi r24, 0x05 ; 5 |
456: 48 9f mul r20, r24 |
458: d0 01 movw r26, r0 |
45a: 11 24 eor r1, r1 |
45c: ac 59 subi r26, 0x9C ; 156 |
45e: bf 4f sbci r27, 0xFF ; 255 |
00000460 <.44_start>: |
460: 21 97 sbiw r28, 0x01 ; 1 |
462: 24 f0 brlt .+8 ; 0x46c <.44_finished> |
464: 0e 94 32 3f call 0x7e64 ; 0x7e64 <__eeprom_read_byte_1F2021> |
468: 01 92 st Z+, r0 |
46a: fa cf rjmp .-12 ; 0x460 <.44_start> |
0000046c <.44_finished>: |
46c: df 91 pop r29 |
46e: cf 91 pop r28 |
470: 08 95 ret |
00000472 <main>: |
472: 0f 93 push r16 |
474: 1f 93 push r17 |
476: cf 93 push r28 |
478: df 93 push r29 |
47a: 91 e0 ldi r25, 0x01 ; 1 |
47c: 97 b9 out 0x07, r25 ; 7 |
47e: 8f ef ldi r24, 0xFF ; 255 |
480: 88 b9 out 0x08, r24 ; 8 |
482: 8b e1 ldi r24, 0x1B ; 27 |
484: 84 b9 out 0x04, r24 ; 4 |
486: 95 b9 out 0x05, r25 ; 5 |
488: 8e e3 ldi r24, 0x3E ; 62 |
48a: 8a b9 out 0x0a, r24 ; 10 |
48c: 57 9a sbi 0x0a, 7 ; 10 |
48e: 87 ef ldi r24, 0xF7 ; 247 |
490: 8b b9 out 0x0b, r24 ; 11 |
492: 84 b7 in r24, 0x34 ; 52 |
494: 87 7f andi r24, 0xF7 ; 247 |
496: 84 bf out 0x34, r24 ; 52 |
498: 80 91 60 00 lds r24, 0x0060 |
49c: 88 61 ori r24, 0x18 ; 24 |
49e: 80 93 60 00 sts 0x0060, r24 |
4a2: 10 92 60 00 sts 0x0060, r1 |
4a6: 80 ed ldi r24, 0xD0 ; 208 |
4a8: 97 e0 ldi r25, 0x07 ; 7 |
4aa: 90 93 48 08 sts 0x0848, r25 |
4ae: 80 93 47 08 sts 0x0847, r24 |
4b2: 10 92 d5 08 sts 0x08D5, r1 |
4b6: 10 92 d4 08 sts 0x08D4, r1 |
4ba: 10 92 59 0c sts 0x0C59, r1 |
4be: 10 92 58 0c sts 0x0C58, r1 |
4c2: 10 92 d3 08 sts 0x08D3, r1 |
4c6: 10 92 d2 08 sts 0x08D2, r1 |
4ca: 10 92 d1 08 sts 0x08D1, r1 |
4ce: 10 92 d0 08 sts 0x08D0, r1 |
4d2: 28 98 cbi 0x05, 0 ; 5 |
4d4: 0e 94 52 0d call 0x1aa4 ; 0x1aa4 <Timer_Init> |
4d8: 0e 94 c8 07 call 0xf90 ; 0xf90 <UART_Init> |
4dc: 0e 94 87 15 call 0x2b0e ; 0x2b0e <rc_sum_init> |
4e0: 0e 94 8b 0d call 0x1b16 ; 0x1b16 <ADC_Init> |
4e4: 0e 94 cf 14 call 0x299e ; 0x299e <i2c_init> |
4e8: 78 94 sei |
4ea: 10 92 c6 0a sts 0x0AC6, r1 |
4ee: 8d e3 ldi r24, 0x3D ; 61 |
4f0: 80 93 c7 0a sts 0x0AC7, r24 |
4f4: 84 e0 ldi r24, 0x04 ; 4 |
4f6: 80 93 c8 0a sts 0x0AC8, r24 |
4fa: 8d e3 ldi r24, 0x3D ; 61 |
4fc: 90 e0 ldi r25, 0x00 ; 0 |
4fe: 9f 93 push r25 |
500: 8f 93 push r24 |
502: 1f 92 push r1 |
504: 1f 92 push r1 |
506: 83 e2 ldi r24, 0x23 ; 35 |
508: 91 e0 ldi r25, 0x01 ; 1 |
50a: 9f 93 push r25 |
50c: 8f 93 push r24 |
50e: 1f 92 push r1 |
510: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
514: 82 e0 ldi r24, 0x02 ; 2 |
516: 91 e0 ldi r25, 0x01 ; 1 |
518: 9f 93 push r25 |
51a: 8f 93 push r24 |
51c: 1f 92 push r1 |
51e: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
522: 29 9a sbi 0x05, 1 ; 5 |
524: a1 e0 ldi r26, 0x01 ; 1 |
526: b0 e0 ldi r27, 0x00 ; 0 |
528: 0e 94 32 3f call 0x7e64 ; 0x7e64 <__eeprom_read_byte_1F2021> |
52c: 80 2d mov r24, r0 |
52e: 2d b7 in r18, 0x3d ; 61 |
530: 3e b7 in r19, 0x3e ; 62 |
532: 26 5f subi r18, 0xF6 ; 246 |
534: 3f 4f sbci r19, 0xFF ; 255 |
536: 0f b6 in r0, 0x3f ; 63 |
538: f8 94 cli |
53a: 3e bf out 0x3e, r19 ; 62 |
53c: 0f be out 0x3f, r0 ; 63 |
53e: 2d bf out 0x3d, r18 ; 61 |
540: 8b 33 cpi r24, 0x3B ; 59 |
542: a9 f1 breq .+106 ; 0x5ae <main+0x13c> |
544: 83 ed ldi r24, 0xD3 ; 211 |
546: 90 e0 ldi r25, 0x00 ; 0 |
548: 9f 93 push r25 |
54a: 8f 93 push r24 |
54c: 1f 92 push r1 |
54e: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
552: 0e 94 09 1f call 0x3e12 ; 0x3e12 <DefaultKonstanten1> |
556: 4a e3 ldi r20, 0x3A ; 58 |
558: 60 e9 ldi r22, 0x90 ; 144 |
55a: 7c e0 ldi r23, 0x0C ; 12 |
55c: 80 e0 ldi r24, 0x00 ; 0 |
55e: 0e 94 0b 02 call 0x416 ; 0x416 <WriteParameterSet> |
562: 01 e0 ldi r16, 0x01 ; 1 |
564: 0f 90 pop r0 |
566: 0f 90 pop r0 |
568: 0f 90 pop r0 |
56a: 02 30 cpi r16, 0x02 ; 2 |
56c: 49 f4 brne .+18 ; 0x580 <main+0x10e> |
56e: 0e 94 9d 1e call 0x3d3a ; 0x3d3a <DefaultKonstanten2> |
572: 4a e3 ldi r20, 0x3A ; 58 |
574: 60 e9 ldi r22, 0x90 ; 144 |
576: 7c e0 ldi r23, 0x0C ; 12 |
578: 82 e0 ldi r24, 0x02 ; 2 |
57a: 0e 94 0b 02 call 0x416 ; 0x416 <WriteParameterSet> |
57e: 03 e0 ldi r16, 0x03 ; 3 |
580: 4a e3 ldi r20, 0x3A ; 58 |
582: 60 e9 ldi r22, 0x90 ; 144 |
584: 7c e0 ldi r23, 0x0C ; 12 |
586: 80 2f mov r24, r16 |
588: 0e 94 0b 02 call 0x416 ; 0x416 <WriteParameterSet> |
58c: 0f 5f subi r16, 0xFF ; 255 |
58e: 06 30 cpi r16, 0x06 ; 6 |
590: 60 f3 brcs .-40 ; 0x56a <main+0xf8> |
592: 81 e0 ldi r24, 0x01 ; 1 |
594: 22 e0 ldi r18, 0x02 ; 2 |
596: 30 e0 ldi r19, 0x00 ; 0 |
598: d9 01 movw r26, r18 |
59a: 08 2e mov r0, r24 |
59c: 0e 94 3a 3f call 0x7e74 ; 0x7e74 <__eeprom_write_byte_1F2021> |
5a0: 8b e3 ldi r24, 0x3B ; 59 |
5a2: 21 50 subi r18, 0x01 ; 1 |
5a4: 30 40 sbci r19, 0x00 ; 0 |
5a6: d9 01 movw r26, r18 |
5a8: 08 2e mov r0, r24 |
5aa: 0e 94 3a 3f call 0x7e74 ; 0x7e74 <__eeprom_write_byte_1F2021> |
5ae: 02 e0 ldi r16, 0x02 ; 2 |
5b0: 10 e0 ldi r17, 0x00 ; 0 |
5b2: d8 01 movw r26, r16 |
5b4: 0e 94 32 3f call 0x7e64 ; 0x7e64 <__eeprom_read_byte_1F2021> |
5b8: 80 2d mov r24, r0 |
5ba: 4a e3 ldi r20, 0x3A ; 58 |
5bc: 60 e9 ldi r22, 0x90 ; 144 |
5be: 7c e0 ldi r23, 0x0C ; 12 |
5c0: 0e 94 23 02 call 0x446 ; 0x446 <ReadParameterSet> |
5c4: d8 01 movw r26, r16 |
5c6: 0e 94 32 3f call 0x7e64 ; 0x7e64 <__eeprom_read_byte_1F2021> |
5ca: 80 2d mov r24, r0 |
5cc: 99 27 eor r25, r25 |
5ce: 9f 93 push r25 |
5d0: 8f 93 push r24 |
5d2: 88 eb ldi r24, 0xB8 ; 184 |
5d4: 90 e0 ldi r25, 0x00 ; 0 |
5d6: 9f 93 push r25 |
5d8: 8f 93 push r24 |
5da: 1f 92 push r1 |
5dc: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
5e0: 80 91 98 0c lds r24, 0x0C98 |
5e4: 0f 90 pop r0 |
5e6: 0f 90 pop r0 |
5e8: 0f 90 pop r0 |
5ea: 0f 90 pop r0 |
5ec: 0f 90 pop r0 |
5ee: 80 ff sbrs r24, 0 |
5f0: 20 c0 rjmp .+64 ; 0x632 <main+0x1c0> |
5f2: 8b e9 ldi r24, 0x9B ; 155 |
5f4: 90 e0 ldi r25, 0x00 ; 0 |
5f6: 9f 93 push r25 |
5f8: 8f 93 push r24 |
5fa: 1f 92 push r1 |
5fc: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
600: 84 ec ldi r24, 0xC4 ; 196 |
602: 99 e0 ldi r25, 0x09 ; 9 |
604: 0e 94 96 0c call 0x192c ; 0x192c <SetDelay> |
608: ec 01 movw r28, r24 |
60a: 0e 94 b5 10 call 0x216a ; 0x216a <SucheLuftruckOffset> |
60e: 0f 90 pop r0 |
610: 0f 90 pop r0 |
612: 0f 90 pop r0 |
614: ce 01 movw r24, r28 |
616: 0e 94 9f 0c call 0x193e ; 0x193e <CheckDelay> |
61a: 88 23 and r24, r24 |
61c: d9 f3 breq .-10 ; 0x614 <main+0x1a2> |
61e: 86 e9 ldi r24, 0x96 ; 150 |
620: 90 e0 ldi r25, 0x00 ; 0 |
622: 9f 93 push r25 |
624: 8f 93 push r24 |
626: 1f 92 push r1 |
628: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
62c: 0f 90 pop r0 |
62e: 0f 90 pop r0 |
630: 0f 90 pop r0 |
632: 0e 94 a4 1f call 0x3f48 ; 0x3f48 <SetNeutral> |
636: 28 98 cbi 0x05, 0 ; 5 |
638: 80 ed ldi r24, 0xD0 ; 208 |
63a: 97 e0 ldi r25, 0x07 ; 7 |
63c: 90 93 48 08 sts 0x0848, r25 |
640: 80 93 47 08 sts 0x0847, r24 |
644: 88 ee ldi r24, 0xE8 ; 232 |
646: 93 e0 ldi r25, 0x03 ; 3 |
648: 90 93 c1 0a sts 0x0AC1, r25 |
64c: 80 93 c0 0a sts 0x0AC0, r24 |
650: 85 e5 ldi r24, 0x55 ; 85 |
652: 80 93 bb 0a sts 0x0ABB, r24 |
656: 88 e8 ldi r24, 0x88 ; 136 |
658: 90 e0 ldi r25, 0x00 ; 0 |
65a: 9f 93 push r25 |
65c: 8f 93 push r24 |
65e: 1f 92 push r1 |
660: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
664: 80 91 98 0c lds r24, 0x0C98 |
668: 0f 90 pop r0 |
66a: 0f 90 pop r0 |
66c: 0f 90 pop r0 |
66e: 82 ff sbrs r24, 2 |
670: 03 c0 rjmp .+6 ; 0x678 <main+0x206> |
672: 8c e7 ldi r24, 0x7C ; 124 |
674: 90 e0 ldi r25, 0x00 ; 0 |
676: 02 c0 rjmp .+4 ; 0x67c <main+0x20a> |
678: 84 e7 ldi r24, 0x74 ; 116 |
67a: 90 e0 ldi r25, 0x00 ; 0 |
67c: 9f 93 push r25 |
67e: 8f 93 push r24 |
680: 1f 92 push r1 |
682: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
686: 0f 90 pop r0 |
688: 0f 90 pop r0 |
68a: 0f 90 pop r0 |
68c: 80 e7 ldi r24, 0x70 ; 112 |
68e: 90 e0 ldi r25, 0x00 ; 0 |
690: 9f 93 push r25 |
692: 8f 93 push r24 |
694: 1f 92 push r1 |
696: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
69a: 0e 94 dc 10 call 0x21b8 ; 0x21b8 <LcdClear> |
69e: 0f 90 pop r0 |
6a0: 0f 90 pop r0 |
6a2: 0f 90 pop r0 |
6a4: 80 91 44 08 lds r24, 0x0844 |
6a8: 88 23 and r24, r24 |
6aa: 79 f1 breq .+94 ; 0x70a <main+0x298> |
6ac: 10 92 44 08 sts 0x0844, r1 |
6b0: 0e 94 b5 20 call 0x416a ; 0x416a <MotorRegler> |
6b4: 0e 94 79 1f call 0x3ef2 ; 0x3ef2 <SendMotorData> |
6b8: 28 98 cbi 0x05, 0 ; 5 |
6ba: 80 91 01 01 lds r24, 0x0101 |
6be: 88 23 and r24, r24 |
6c0: 19 f0 breq .+6 ; 0x6c8 <main+0x256> |
6c2: 81 50 subi r24, 0x01 ; 1 |
6c4: 80 93 01 01 sts 0x0101, r24 |
6c8: 80 91 cf 08 lds r24, 0x08CF |
6cc: 88 23 and r24, r24 |
6ce: 29 f0 breq .+10 ; 0x6da <main+0x268> |
6d0: 80 91 cf 08 lds r24, 0x08CF |
6d4: 81 50 subi r24, 0x01 ; 1 |
6d6: 80 93 cf 08 sts 0x08CF, r24 |
6da: 20 91 04 01 lds r18, 0x0104 |
6de: 30 91 05 01 lds r19, 0x0105 |
6e2: 80 91 a8 0c lds r24, 0x0CA8 |
6e6: 99 27 eor r25, r25 |
6e8: 28 17 cp r18, r24 |
6ea: 39 07 cpc r19, r25 |
6ec: 34 f4 brge .+12 ; 0x6fa <main+0x288> |
6ee: 80 ed ldi r24, 0xD0 ; 208 |
6f0: 97 e0 ldi r25, 0x07 ; 7 |
6f2: 90 93 48 08 sts 0x0848, r25 |
6f6: 80 93 47 08 sts 0x0847, r24 |
6fa: 80 91 72 08 lds r24, 0x0872 |
6fe: 88 23 and r24, r24 |
700: 19 f4 brne .+6 ; 0x708 <main+0x296> |
702: 0e 94 cf 14 call 0x299e ; 0x299e <i2c_init> |
706: 01 c0 rjmp .+2 ; 0x70a <main+0x298> |
708: 28 98 cbi 0x05, 0 ; 5 |
70a: 0e 94 e5 07 call 0xfca ; 0xfca <DatenUebertragung> |
70e: 0e 94 53 08 call 0x10a6 ; 0x10a6 <BearbeiteRxDaten> |
712: 80 e0 ldi r24, 0x00 ; 0 |
714: 90 e0 ldi r25, 0x00 ; 0 |
716: 0e 94 9f 0c call 0x193e ; 0x193e <CheckDelay> |
71a: 88 23 and r24, r24 |
71c: 19 f2 breq .-122 ; 0x6a4 <main+0x232> |
71e: 80 91 d6 08 lds r24, 0x08D6 |
722: 88 23 and r24, r24 |
724: 29 f0 breq .+10 ; 0x730 <main+0x2be> |
726: 88 b1 in r24, 0x08 ; 8 |
728: 90 e1 ldi r25, 0x10 ; 16 |
72a: 89 27 eor r24, r25 |
72c: 88 b9 out 0x08, r24 ; 8 |
72e: 01 c0 rjmp .+2 ; 0x732 <main+0x2c0> |
730: 44 98 cbi 0x08, 4 ; 8 |
732: 84 ef ldi r24, 0xF4 ; 244 |
734: 91 e0 ldi r25, 0x01 ; 1 |
736: 0e 94 96 0c call 0x192c ; 0x192c <SetDelay> |
73a: b4 cf rjmp .-152 ; 0x6a4 <main+0x232> |
0000073c <__vector_22>: |
73c: 1f 92 push r1 |
73e: 0f 92 push r0 |
740: 0f b6 in r0, 0x3f ; 63 |
742: 0f 92 push r0 |
744: 11 24 eor r1, r1 |
746: 8f 93 push r24 |
748: 9f 93 push r25 |
74a: ef 93 push r30 |
74c: ff 93 push r31 |
74e: 80 91 00 01 lds r24, 0x0100 |
752: 88 23 and r24, r24 |
754: e1 f4 brne .+56 ; 0x78e <__vector_22+0x52> |
756: 80 91 3f 08 lds r24, 0x083F |
75a: 90 91 40 08 lds r25, 0x0840 |
75e: 01 96 adiw r24, 0x01 ; 1 |
760: 90 93 40 08 sts 0x0840, r25 |
764: 80 93 3f 08 sts 0x083F, r24 |
768: fc 01 movw r30, r24 |
76a: e5 58 subi r30, 0x85 ; 133 |
76c: f6 4f sbci r31, 0xF6 ; 246 |
76e: e0 81 ld r30, Z |
770: ed 30 cpi r30, 0x0D ; 13 |
772: 19 f0 breq .+6 ; 0x77a <__vector_22+0x3e> |
774: 86 39 cpi r24, 0x96 ; 150 |
776: 91 05 cpc r25, r1 |
778: 39 f4 brne .+14 ; 0x788 <__vector_22+0x4c> |
77a: 10 92 40 08 sts 0x0840, r1 |
77e: 10 92 3f 08 sts 0x083F, r1 |
782: 81 e0 ldi r24, 0x01 ; 1 |
784: 80 93 00 01 sts 0x0100, r24 |
788: e0 93 c6 00 sts 0x00C6, r30 |
78c: 04 c0 rjmp .+8 ; 0x796 <__vector_22+0x5a> |
78e: 10 92 40 08 sts 0x0840, r1 |
792: 10 92 3f 08 sts 0x083F, r1 |
796: ff 91 pop r31 |
798: ef 91 pop r30 |
79a: 9f 91 pop r25 |
79c: 8f 91 pop r24 |
79e: 0f 90 pop r0 |
7a0: 0f be out 0x3f, r0 ; 63 |
7a2: 0f 90 pop r0 |
7a4: 1f 90 pop r1 |
7a6: 18 95 reti |
000007a8 <GPSscanData>: |
7a8: 80 91 b0 0b lds r24, 0x0BB0 |
7ac: 81 30 cpi r24, 0x01 ; 1 |
7ae: 91 f5 brne .+100 ; 0x814 <GPSscanData+0x6c> |
7b0: 80 91 a0 0b lds r24, 0x0BA0 |
7b4: 90 91 a1 0b lds r25, 0x0BA1 |
7b8: a0 91 a2 0b lds r26, 0x0BA2 |
7bc: b0 91 a3 0b lds r27, 0x0BA3 |
7c0: 80 93 e3 0b sts 0x0BE3, r24 |
7c4: 90 93 e4 0b sts 0x0BE4, r25 |
7c8: a0 93 e5 0b sts 0x0BE5, r26 |
7cc: b0 93 e6 0b sts 0x0BE6, r27 |
7d0: 80 91 a4 0b lds r24, 0x0BA4 |
7d4: 90 91 a5 0b lds r25, 0x0BA5 |
7d8: a0 91 a6 0b lds r26, 0x0BA6 |
7dc: b0 91 a7 0b lds r27, 0x0BA7 |
7e0: 80 93 e7 0b sts 0x0BE7, r24 |
7e4: 90 93 e8 0b sts 0x0BE8, r25 |
7e8: a0 93 e9 0b sts 0x0BE9, r26 |
7ec: b0 93 ea 0b sts 0x0BEA, r27 |
7f0: 80 91 a8 0b lds r24, 0x0BA8 |
7f4: 90 91 a9 0b lds r25, 0x0BA9 |
7f8: a0 91 aa 0b lds r26, 0x0BAA |
7fc: b0 91 ab 0b lds r27, 0x0BAB |
800: 80 93 eb 0b sts 0x0BEB, r24 |
804: 90 93 ec 0b sts 0x0BEC, r25 |
808: a0 93 ed 0b sts 0x0BED, r26 |
80c: b0 93 ee 0b sts 0x0BEE, r27 |
810: 10 92 b0 0b sts 0x0BB0, r1 |
814: 90 91 ba 0a lds r25, 0x0ABA |
818: 91 30 cpi r25, 0x01 ; 1 |
81a: 41 f4 brne .+16 ; 0x82c <GPSscanData+0x84> |
81c: 80 91 ae 0a lds r24, 0x0AAE |
820: 80 93 10 0c sts 0x0C10, r24 |
824: 90 93 0f 0c sts 0x0C0F, r25 |
828: 10 92 ba 0a sts 0x0ABA, r1 |
82c: 80 91 ea 0a lds r24, 0x0AEA |
830: 81 30 cpi r24, 0x01 ; 1 |
832: 91 f5 brne .+100 ; 0x898 <GPSscanData+0xf0> |
834: 80 91 da 0a lds r24, 0x0ADA |
838: 90 91 db 0a lds r25, 0x0ADB |
83c: a0 91 dc 0a lds r26, 0x0ADC |
840: b0 91 dd 0a lds r27, 0x0ADD |
844: 80 93 ef 0b sts 0x0BEF, r24 |
848: 90 93 f0 0b sts 0x0BF0, r25 |
84c: a0 93 f1 0b sts 0x0BF1, r26 |
850: b0 93 f2 0b sts 0x0BF2, r27 |
854: 80 91 de 0a lds r24, 0x0ADE |
858: 90 91 df 0a lds r25, 0x0ADF |
85c: a0 91 e0 0a lds r26, 0x0AE0 |
860: b0 91 e1 0a lds r27, 0x0AE1 |
864: 80 93 f3 0b sts 0x0BF3, r24 |
868: 90 93 f4 0b sts 0x0BF4, r25 |
86c: a0 93 f5 0b sts 0x0BF5, r26 |
870: b0 93 f6 0b sts 0x0BF6, r27 |
874: 80 91 e2 0a lds r24, 0x0AE2 |
878: 90 91 e3 0a lds r25, 0x0AE3 |
87c: a0 91 e4 0a lds r26, 0x0AE4 |
880: b0 91 e5 0a lds r27, 0x0AE5 |
884: 80 93 f7 0b sts 0x0BF7, r24 |
888: 90 93 f8 0b sts 0x0BF8, r25 |
88c: a0 93 f9 0b sts 0x0BF9, r26 |
890: b0 93 fa 0b sts 0x0BFA, r27 |
894: 10 92 ea 0a sts 0x0AEA, r1 |
898: 80 91 93 0b lds r24, 0x0B93 |
89c: 81 30 cpi r24, 0x01 ; 1 |
89e: 91 f5 brne .+100 ; 0x904 <GPSscanData+0x15c> |
8a0: 80 91 89 0b lds r24, 0x0B89 |
8a4: 90 91 8a 0b lds r25, 0x0B8A |
8a8: a0 91 8b 0b lds r26, 0x0B8B |
8ac: b0 91 8c 0b lds r27, 0x0B8C |
8b0: 80 93 fb 0b sts 0x0BFB, r24 |
8b4: 90 93 fc 0b sts 0x0BFC, r25 |
8b8: a0 93 fd 0b sts 0x0BFD, r26 |
8bc: b0 93 fe 0b sts 0x0BFE, r27 |
8c0: 80 91 85 0b lds r24, 0x0B85 |
8c4: 90 91 86 0b lds r25, 0x0B86 |
8c8: a0 91 87 0b lds r26, 0x0B87 |
8cc: b0 91 88 0b lds r27, 0x0B88 |
8d0: 80 93 ff 0b sts 0x0BFF, r24 |
8d4: 90 93 00 0c sts 0x0C00, r25 |
8d8: a0 93 01 0c sts 0x0C01, r26 |
8dc: b0 93 02 0c sts 0x0C02, r27 |
8e0: 80 91 8d 0b lds r24, 0x0B8D |
8e4: 90 91 8e 0b lds r25, 0x0B8E |
8e8: a0 91 8f 0b lds r26, 0x0B8F |
8ec: b0 91 90 0b lds r27, 0x0B90 |
8f0: 80 93 03 0c sts 0x0C03, r24 |
8f4: 90 93 04 0c sts 0x0C04, r25 |
8f8: a0 93 05 0c sts 0x0C05, r26 |
8fc: b0 93 06 0c sts 0x0C06, r27 |
900: 10 92 93 0b sts 0x0B93, r1 |
904: 80 91 38 0c lds r24, 0x0C38 |
908: 81 30 cpi r24, 0x01 ; 1 |
90a: 11 f5 brne .+68 ; 0x950 <GPSscanData+0x1a8> |
90c: 80 91 18 0c lds r24, 0x0C18 |
910: 90 91 19 0c lds r25, 0x0C19 |
914: a0 91 1a 0c lds r26, 0x0C1A |
918: b0 91 1b 0c lds r27, 0x0C1B |
91c: 80 93 07 0c sts 0x0C07, r24 |
920: 90 93 08 0c sts 0x0C08, r25 |
924: a0 93 09 0c sts 0x0C09, r26 |
928: b0 93 0a 0c sts 0x0C0A, r27 |
92c: 80 91 1c 0c lds r24, 0x0C1C |
930: 90 91 1d 0c lds r25, 0x0C1D |
934: a0 91 1e 0c lds r26, 0x0C1E |
938: b0 91 1f 0c lds r27, 0x0C1F |
93c: 80 93 0b 0c sts 0x0C0B, r24 |
940: 90 93 0c 0c sts 0x0C0C, r25 |
944: a0 93 0d 0c sts 0x0C0D, r26 |
948: b0 93 0e 0c sts 0x0C0E, r27 |
94c: 10 92 38 0c sts 0x0C38, r1 |
950: 80 91 0f 0c lds r24, 0x0C0F |
954: 81 11 cpse r24, r1 |
956: 28 9a sbi 0x05, 0 ; 5 |
958: 08 95 ret |
0000095a <__vector_20>: |
95a: 1f 92 push r1 |
95c: 0f 92 push r0 |
95e: 0f b6 in r0, 0x3f ; 63 |
960: 0f 92 push r0 |
962: 11 24 eor r1, r1 |
964: 2f 93 push r18 |
966: 3f 93 push r19 |
968: 4f 93 push r20 |
96a: 5f 93 push r21 |
96c: 6f 93 push r22 |
96e: 7f 93 push r23 |
970: 8f 93 push r24 |
972: 9f 93 push r25 |
974: af 93 push r26 |
976: bf 93 push r27 |
978: cf 93 push r28 |
97a: df 93 push r29 |
97c: ef 93 push r30 |
97e: ff 93 push r31 |
980: 80 91 c6 00 lds r24, 0x00C6 |
984: 80 93 2e 08 sts 0x082E, r24 |
988: 80 91 c0 00 lds r24, 0x00C0 |
98c: 40 91 2e 08 lds r20, 0x082E |
990: 88 71 andi r24, 0x18 ; 24 |
992: 09 f0 breq .+2 ; 0x996 <__vector_20+0x3c> |
994: 36 c1 rjmp .+620 ; 0xc02 <__vector_20+0x2a8> |
996: 80 91 41 08 lds r24, 0x0841 |
99a: 84 30 cpi r24, 0x04 ; 4 |
99c: 09 f4 brne .+2 ; 0x9a0 <__vector_20+0x46> |
99e: bb c0 rjmp .+374 ; 0xb16 <__vector_20+0x1bc> |
9a0: 85 30 cpi r24, 0x05 ; 5 |
9a2: 50 f4 brcc .+20 ; 0x9b8 <__vector_20+0x5e> |
9a4: 81 30 cpi r24, 0x01 ; 1 |
9a6: d1 f0 breq .+52 ; 0x9dc <__vector_20+0x82> |
9a8: 81 30 cpi r24, 0x01 ; 1 |
9aa: 98 f0 brcs .+38 ; 0x9d2 <__vector_20+0x78> |
9ac: 82 30 cpi r24, 0x02 ; 2 |
9ae: 01 f1 breq .+64 ; 0x9f0 <__vector_20+0x96> |
9b0: 83 30 cpi r24, 0x03 ; 3 |
9b2: 09 f0 breq .+2 ; 0x9b6 <__vector_20+0x5c> |
9b4: 23 c1 rjmp .+582 ; 0xbfc <__vector_20+0x2a2> |
9b6: 21 c0 rjmp .+66 ; 0x9fa <__vector_20+0xa0> |
9b8: 86 30 cpi r24, 0x06 ; 6 |
9ba: 09 f4 brne .+2 ; 0x9be <__vector_20+0x64> |
9bc: dc c0 rjmp .+440 ; 0xb76 <__vector_20+0x21c> |
9be: 86 30 cpi r24, 0x06 ; 6 |
9c0: 08 f4 brcc .+2 ; 0x9c4 <__vector_20+0x6a> |
9c2: bd c0 rjmp .+378 ; 0xb3e <__vector_20+0x1e4> |
9c4: 87 30 cpi r24, 0x07 ; 7 |
9c6: 09 f4 brne .+2 ; 0x9ca <__vector_20+0x70> |
9c8: 07 c1 rjmp .+526 ; 0xbd8 <__vector_20+0x27e> |
9ca: 88 30 cpi r24, 0x08 ; 8 |
9cc: 09 f0 breq .+2 ; 0x9d0 <__vector_20+0x76> |
9ce: 16 c1 rjmp .+556 ; 0xbfc <__vector_20+0x2a2> |
9d0: 09 c1 rjmp .+530 ; 0xbe4 <__vector_20+0x28a> |
9d2: 45 3b cpi r20, 0xB5 ; 181 |
9d4: 09 f0 breq .+2 ; 0x9d8 <__vector_20+0x7e> |
9d6: 19 c1 rjmp .+562 ; 0xc0a <__vector_20+0x2b0> |
9d8: 81 e0 ldi r24, 0x01 ; 1 |
9da: 03 c0 rjmp .+6 ; 0x9e2 <__vector_20+0x88> |
9dc: 42 36 cpi r20, 0x62 ; 98 |
9de: 21 f4 brne .+8 ; 0x9e8 <__vector_20+0x8e> |
9e0: 82 e0 ldi r24, 0x02 ; 2 |
9e2: 80 93 41 08 sts 0x0841, r24 |
9e6: 11 c1 rjmp .+546 ; 0xc0a <__vector_20+0x2b0> |
9e8: 45 3b cpi r20, 0xB5 ; 181 |
9ea: 09 f4 brne .+2 ; 0x9ee <__vector_20+0x94> |
9ec: 0e c1 rjmp .+540 ; 0xc0a <__vector_20+0x2b0> |
9ee: 06 c1 rjmp .+524 ; 0xbfc <__vector_20+0x2a2> |
9f0: 41 30 cpi r20, 0x01 ; 1 |
9f2: 09 f0 breq .+2 ; 0x9f6 <__vector_20+0x9c> |
9f4: 03 c1 rjmp .+518 ; 0xbfc <__vector_20+0x2a2> |
9f6: 83 e0 ldi r24, 0x03 ; 3 |
9f8: f4 cf rjmp .-24 ; 0x9e2 <__vector_20+0x88> |
9fa: 40 93 12 0c sts 0x0C12, r20 |
9fe: 4f 5f subi r20, 0xFF ; 255 |
a00: 40 93 7a 09 sts 0x097A, r20 |
a04: 80 91 7a 09 lds r24, 0x097A |
a08: 8f 5f subi r24, 0xFF ; 255 |
a0a: 80 93 a9 0a sts 0x0AA9, r24 |
a0e: 84 e0 ldi r24, 0x04 ; 4 |
a10: 80 93 41 08 sts 0x0841, r24 |
a14: 80 91 12 0c lds r24, 0x0C12 |
a18: 88 30 cpi r24, 0x08 ; 8 |
a1a: 09 f4 brne .+2 ; 0xa1e <__vector_20+0xc4> |
a1c: 4a c0 rjmp .+148 ; 0xab2 <__vector_20+0x158> |
a1e: 89 30 cpi r24, 0x09 ; 9 |
a20: 30 f4 brcc .+12 ; 0xa2e <__vector_20+0xd4> |
a22: 81 30 cpi r24, 0x01 ; 1 |
a24: f1 f0 breq .+60 ; 0xa62 <__vector_20+0x108> |
a26: 83 30 cpi r24, 0x03 ; 3 |
a28: 09 f0 breq .+2 ; 0xa2c <__vector_20+0xd2> |
a2a: 6d c0 rjmp .+218 ; 0xb06 <__vector_20+0x1ac> |
a2c: 06 c0 rjmp .+12 ; 0xa3a <__vector_20+0xe0> |
a2e: 81 31 cpi r24, 0x11 ; 17 |
a30: 61 f1 breq .+88 ; 0xa8a <__vector_20+0x130> |
a32: 82 31 cpi r24, 0x12 ; 18 |
a34: 09 f0 breq .+2 ; 0xa38 <__vector_20+0xde> |
a36: 67 c0 rjmp .+206 ; 0xb06 <__vector_20+0x1ac> |
a38: 50 c0 rjmp .+160 ; 0xada <__vector_20+0x180> |
a3a: 8a ea ldi r24, 0xAA ; 170 |
a3c: 9a e0 ldi r25, 0x0A ; 10 |
a3e: 90 93 d5 0a sts 0x0AD5, r25 |
a42: 80 93 d4 0a sts 0x0AD4, r24 |
a46: 2b ec ldi r18, 0xCB ; 203 |
a48: 3b e0 ldi r19, 0x0B ; 11 |
a4a: 30 93 78 09 sts 0x0978, r19 |
a4e: 20 93 77 09 sts 0x0977, r18 |
a52: 40 96 adiw r24, 0x10 ; 16 |
a54: 90 93 95 0b sts 0x0B95, r25 |
a58: 80 93 94 0b sts 0x0B94, r24 |
a5c: 80 91 ba 0a lds r24, 0x0ABA |
a60: 4f c0 rjmp .+158 ; 0xb00 <__vector_20+0x1a6> |
a62: 8c e9 ldi r24, 0x9C ; 156 |
a64: 9b e0 ldi r25, 0x0B ; 11 |
a66: 90 93 d5 0a sts 0x0AD5, r25 |
a6a: 80 93 d4 0a sts 0x0AD4, r24 |
a6e: 25 e5 ldi r18, 0x55 ; 85 |
a70: 3d e0 ldi r19, 0x0D ; 13 |
a72: 30 93 78 09 sts 0x0978, r19 |
a76: 20 93 77 09 sts 0x0977, r18 |
a7a: 44 96 adiw r24, 0x14 ; 20 |
a7c: 90 93 95 0b sts 0x0B95, r25 |
a80: 80 93 94 0b sts 0x0B94, r24 |
a84: 80 91 b0 0b lds r24, 0x0BB0 |
a88: 3b c0 rjmp .+118 ; 0xb00 <__vector_20+0x1a6> |
a8a: 86 ed ldi r24, 0xD6 ; 214 |
a8c: 9a e0 ldi r25, 0x0A ; 10 |
a8e: 90 93 d5 0a sts 0x0AD5, r25 |
a92: 80 93 d4 0a sts 0x0AD4, r24 |
a96: 2f e8 ldi r18, 0x8F ; 143 |
a98: 3c e0 ldi r19, 0x0C ; 12 |
a9a: 30 93 78 09 sts 0x0978, r19 |
a9e: 20 93 77 09 sts 0x0977, r18 |
aa2: 44 96 adiw r24, 0x14 ; 20 |
aa4: 90 93 95 0b sts 0x0B95, r25 |
aa8: 80 93 94 0b sts 0x0B94, r24 |
aac: 80 91 ea 0a lds r24, 0x0AEA |
ab0: 27 c0 rjmp .+78 ; 0xb00 <__vector_20+0x1a6> |
ab2: 81 e8 ldi r24, 0x81 ; 129 |
ab4: 9b e0 ldi r25, 0x0B ; 11 |
ab6: 90 93 d5 0a sts 0x0AD5, r25 |
aba: 80 93 d4 0a sts 0x0AD4, r24 |
abe: 2a ee ldi r18, 0xEA ; 234 |
ac0: 3c e0 ldi r19, 0x0C ; 12 |
ac2: 30 93 78 09 sts 0x0978, r19 |
ac6: 20 93 77 09 sts 0x0977, r18 |
aca: 42 96 adiw r24, 0x12 ; 18 |
acc: 90 93 95 0b sts 0x0B95, r25 |
ad0: 80 93 94 0b sts 0x0B94, r24 |
ad4: 80 91 93 0b lds r24, 0x0B93 |
ad8: 13 c0 rjmp .+38 ; 0xb00 <__vector_20+0x1a6> |
ada: 84 e1 ldi r24, 0x14 ; 20 |
adc: 9c e0 ldi r25, 0x0C ; 12 |
ade: 90 93 d5 0a sts 0x0AD5, r25 |
ae2: 80 93 d4 0a sts 0x0AD4, r24 |
ae6: 2d e6 ldi r18, 0x6D ; 109 |
ae8: 31 e1 ldi r19, 0x11 ; 17 |
aea: 30 93 78 09 sts 0x0978, r19 |
aee: 20 93 77 09 sts 0x0977, r18 |
af2: 84 96 adiw r24, 0x24 ; 36 |
af4: 90 93 95 0b sts 0x0B95, r25 |
af8: 80 93 94 0b sts 0x0B94, r24 |
afc: 80 91 38 0c lds r24, 0x0C38 |
b00: 80 93 13 0c sts 0x0C13, r24 |
b04: 82 c0 rjmp .+260 ; 0xc0a <__vector_20+0x2b0> |
b06: 81 e0 ldi r24, 0x01 ; 1 |
b08: 80 93 13 0c sts 0x0C13, r24 |
b0c: 10 92 95 0b sts 0x0B95, r1 |
b10: 10 92 94 0b sts 0x0B94, r1 |
b14: 7a c0 rjmp .+244 ; 0xc0a <__vector_20+0x2b0> |
b16: 84 2f mov r24, r20 |
b18: 99 27 eor r25, r25 |
b1a: 90 93 97 0b sts 0x0B97, r25 |
b1e: 80 93 96 0b sts 0x0B96, r24 |
b22: 80 91 7a 09 lds r24, 0x097A |
b26: 84 0f add r24, r20 |
b28: 80 93 7a 09 sts 0x097A, r24 |
b2c: 80 91 a9 0a lds r24, 0x0AA9 |
b30: 90 91 7a 09 lds r25, 0x097A |
b34: 89 0f add r24, r25 |
b36: 80 93 a9 0a sts 0x0AA9, r24 |
b3a: 85 e0 ldi r24, 0x05 ; 5 |
b3c: 52 cf rjmp .-348 ; 0x9e2 <__vector_20+0x88> |
b3e: 20 91 96 0b lds r18, 0x0B96 |
b42: 30 91 97 0b lds r19, 0x0B97 |
b46: 84 2f mov r24, r20 |
b48: 99 27 eor r25, r25 |
b4a: 98 2f mov r25, r24 |
b4c: 88 27 eor r24, r24 |
b4e: 28 0f add r18, r24 |
b50: 39 1f adc r19, r25 |
b52: 30 93 97 0b sts 0x0B97, r19 |
b56: 20 93 96 0b sts 0x0B96, r18 |
b5a: 80 91 7a 09 lds r24, 0x097A |
b5e: 84 0f add r24, r20 |
b60: 80 93 7a 09 sts 0x097A, r24 |
b64: 80 91 a9 0a lds r24, 0x0AA9 |
b68: 90 91 7a 09 lds r25, 0x097A |
b6c: 89 0f add r24, r25 |
b6e: 80 93 a9 0a sts 0x0AA9, r24 |
b72: 86 e0 ldi r24, 0x06 ; 6 |
b74: 36 cf rjmp .-404 ; 0x9e2 <__vector_20+0x88> |
b76: 80 91 7a 09 lds r24, 0x097A |
b7a: 84 0f add r24, r20 |
b7c: 80 93 7a 09 sts 0x097A, r24 |
b80: 80 91 a9 0a lds r24, 0x0AA9 |
b84: 90 91 7a 09 lds r25, 0x097A |
b88: 89 0f add r24, r25 |
b8a: 80 93 a9 0a sts 0x0AA9, r24 |
b8e: 80 91 13 0c lds r24, 0x0C13 |
b92: 88 23 and r24, r24 |
b94: 81 f4 brne .+32 ; 0xbb6 <__vector_20+0x25c> |
b96: e0 91 d4 0a lds r30, 0x0AD4 |
b9a: f0 91 d5 0a lds r31, 0x0AD5 |
b9e: 80 91 77 09 lds r24, 0x0977 |
ba2: 90 91 78 09 lds r25, 0x0978 |
ba6: e8 17 cp r30, r24 |
ba8: f9 07 cpc r31, r25 |
baa: 28 f4 brcc .+10 ; 0xbb6 <__vector_20+0x25c> |
bac: 41 93 st Z+, r20 |
bae: f0 93 d5 0a sts 0x0AD5, r31 |
bb2: e0 93 d4 0a sts 0x0AD4, r30 |
bb6: 80 91 96 0b lds r24, 0x0B96 |
bba: 90 91 97 0b lds r25, 0x0B97 |
bbe: 01 97 sbiw r24, 0x01 ; 1 |
bc0: 90 93 97 0b sts 0x0B97, r25 |
bc4: 80 93 96 0b sts 0x0B96, r24 |
bc8: 80 91 96 0b lds r24, 0x0B96 |
bcc: 90 91 97 0b lds r25, 0x0B97 |
bd0: 89 2b or r24, r25 |
bd2: d9 f4 brne .+54 ; 0xc0a <__vector_20+0x2b0> |
bd4: 87 e0 ldi r24, 0x07 ; 7 |
bd6: 05 cf rjmp .-502 ; 0x9e2 <__vector_20+0x88> |
bd8: 80 91 7a 09 lds r24, 0x097A |
bdc: 48 17 cp r20, r24 |
bde: 71 f4 brne .+28 ; 0xbfc <__vector_20+0x2a2> |
be0: 88 e0 ldi r24, 0x08 ; 8 |
be2: ff ce rjmp .-514 ; 0x9e2 <__vector_20+0x88> |
be4: 80 91 a9 0a lds r24, 0x0AA9 |
be8: 48 17 cp r20, r24 |
bea: 41 f4 brne .+16 ; 0xbfc <__vector_20+0x2a2> |
bec: e0 91 94 0b lds r30, 0x0B94 |
bf0: f0 91 95 0b lds r31, 0x0B95 |
bf4: 30 97 sbiw r30, 0x00 ; 0 |
bf6: 11 f0 breq .+4 ; 0xbfc <__vector_20+0x2a2> |
bf8: 81 e0 ldi r24, 0x01 ; 1 |
bfa: 80 83 st Z, r24 |
bfc: 10 92 41 08 sts 0x0841, r1 |
c00: 04 c0 rjmp .+8 ; 0xc0a <__vector_20+0x2b0> |
c02: 10 92 41 08 sts 0x0841, r1 |
c06: 0e 94 d4 03 call 0x7a8 ; 0x7a8 <GPSscanData> |
c0a: 0e 94 d4 03 call 0x7a8 ; 0x7a8 <GPSscanData> |
c0e: 40 91 3a 08 lds r20, 0x083A |
c12: 46 39 cpi r20, 0x96 ; 150 |
c14: 10 f0 brcs .+4 ; 0xc1a <__vector_20+0x2c0> |
c16: 10 92 39 08 sts 0x0839, r1 |
c1a: 80 91 2e 08 lds r24, 0x082E |
c1e: 8d 30 cpi r24, 0x0D ; 13 |
c20: 09 f0 breq .+2 ; 0xc24 <__vector_20+0x2ca> |
c22: 5c c0 rjmp .+184 ; 0xcdc <__vector_20+0x382> |
c24: 80 91 39 08 lds r24, 0x0839 |
c28: 82 30 cpi r24, 0x02 ; 2 |
c2a: 09 f0 breq .+2 ; 0xc2e <__vector_20+0x2d4> |
c2c: 57 c0 rjmp .+174 ; 0xcdc <__vector_20+0x382> |
c2e: 10 92 39 08 sts 0x0839, r1 |
c32: a4 2f mov r26, r20 |
c34: bb 27 eor r27, r27 |
c36: fd 01 movw r30, r26 |
c38: e7 51 subi r30, 0x17 ; 23 |
c3a: f5 4f sbci r31, 0xF5 ; 245 |
c3c: 30 81 ld r19, Z |
c3e: ed 01 movw r28, r26 |
c40: c6 51 subi r28, 0x16 ; 22 |
c42: d5 4f sbci r29, 0xF5 ; 245 |
c44: 28 81 ld r18, Y |
c46: 80 91 3d 08 lds r24, 0x083D |
c4a: 90 91 3e 08 lds r25, 0x083E |
c4e: 83 1b sub r24, r19 |
c50: 91 09 sbc r25, r1 |
c52: 82 1b sub r24, r18 |
c54: 91 09 sbc r25, r1 |
c56: 9f 70 andi r25, 0x0F ; 15 |
c58: 90 93 3e 08 sts 0x083E, r25 |
c5c: 80 93 3d 08 sts 0x083D, r24 |
c60: 9c 01 movw r18, r24 |
c62: 96 e0 ldi r25, 0x06 ; 6 |
c64: 36 95 lsr r19 |
c66: 27 95 ror r18 |
c68: 9a 95 dec r25 |
c6a: e1 f7 brne .-8 ; 0xc64 <__vector_20+0x30a> |
c6c: 23 5c subi r18, 0xC3 ; 195 |
c6e: 20 93 3c 08 sts 0x083C, r18 |
c72: 98 2f mov r25, r24 |
c74: 9f 73 andi r25, 0x3F ; 63 |
c76: 93 5c subi r25, 0xC3 ; 195 |
c78: 90 93 3b 08 sts 0x083B, r25 |
c7c: 80 81 ld r24, Z |
c7e: 28 17 cp r18, r24 |
c80: 29 f4 brne .+10 ; 0xc8c <__vector_20+0x332> |
c82: 88 81 ld r24, Y |
c84: 98 17 cp r25, r24 |
c86: 11 f4 brne .+4 ; 0xc8c <__vector_20+0x332> |
c88: 91 e0 ldi r25, 0x01 ; 1 |
c8a: 06 c0 rjmp .+12 ; 0xc98 <__vector_20+0x33e> |
c8c: 80 91 31 08 lds r24, 0x0831 |
c90: 8f 5f subi r24, 0xFF ; 255 |
c92: 80 93 31 08 sts 0x0831, r24 |
c96: 90 e0 ldi r25, 0x00 ; 0 |
c98: 80 91 2f 08 lds r24, 0x082F |
c9c: 88 23 and r24, r24 |
c9e: 09 f0 breq .+2 ; 0xca2 <__vector_20+0x348> |
ca0: 64 c0 rjmp .+200 ; 0xd6a <__vector_20+0x410> |
ca2: 99 23 and r25, r25 |
ca4: 09 f4 brne .+2 ; 0xca8 <__vector_20+0x34e> |
ca6: 61 c0 rjmp .+194 ; 0xd6a <__vector_20+0x410> |
ca8: 81 e0 ldi r24, 0x01 ; 1 |
caa: 80 93 2f 08 sts 0x082F, r24 |
cae: 40 93 32 08 sts 0x0832, r20 |
cb2: a5 51 subi r26, 0x15 ; 21 |
cb4: b5 4f sbci r27, 0xF5 ; 245 |
cb6: 8d e0 ldi r24, 0x0D ; 13 |
cb8: 8c 93 st X, r24 |
cba: 80 91 ed 0a lds r24, 0x0AED |
cbe: 82 35 cpi r24, 0x52 ; 82 |
cc0: 09 f0 breq .+2 ; 0xcc4 <__vector_20+0x36a> |
cc2: 53 c0 rjmp .+166 ; 0xd6a <__vector_20+0x410> |
cc4: 88 e1 ldi r24, 0x18 ; 24 |
cc6: 90 e0 ldi r25, 0x00 ; 0 |
cc8: 2c e0 ldi r18, 0x0C ; 12 |
cca: 0f b6 in r0, 0x3f ; 63 |
ccc: f8 94 cli |
cce: a8 95 wdr |
cd0: 80 93 60 00 sts 0x0060, r24 |
cd4: 0f be out 0x3f, r0 ; 63 |
cd6: 20 93 60 00 sts 0x0060, r18 |
cda: 47 c0 rjmp .+142 ; 0xd6a <__vector_20+0x410> |
cdc: 80 91 39 08 lds r24, 0x0839 |
ce0: 81 30 cpi r24, 0x01 ; 1 |
ce2: d9 f0 breq .+54 ; 0xd1a <__vector_20+0x3c0> |
ce4: 81 30 cpi r24, 0x01 ; 1 |
ce6: 18 f0 brcs .+6 ; 0xcee <__vector_20+0x394> |
ce8: 82 30 cpi r24, 0x02 ; 2 |
cea: e9 f5 brne .+122 ; 0xd66 <__vector_20+0x40c> |
cec: 30 c0 rjmp .+96 ; 0xd4e <__vector_20+0x3f4> |
cee: 80 91 2e 08 lds r24, 0x082E |
cf2: 83 32 cpi r24, 0x23 ; 35 |
cf4: 39 f4 brne .+14 ; 0xd04 <__vector_20+0x3aa> |
cf6: 80 91 2f 08 lds r24, 0x082F |
cfa: 88 23 and r24, r24 |
cfc: 19 f4 brne .+6 ; 0xd04 <__vector_20+0x3aa> |
cfe: 81 e0 ldi r24, 0x01 ; 1 |
d00: 80 93 39 08 sts 0x0839, r24 |
d04: 80 91 2e 08 lds r24, 0x082E |
d08: 80 93 eb 0a sts 0x0AEB, r24 |
d0c: 81 e0 ldi r24, 0x01 ; 1 |
d0e: 80 93 3a 08 sts 0x083A, r24 |
d12: 80 91 2e 08 lds r24, 0x082E |
d16: 99 27 eor r25, r25 |
d18: 15 c0 rjmp .+42 ; 0xd44 <__vector_20+0x3ea> |
d1a: 82 e0 ldi r24, 0x02 ; 2 |
d1c: 80 93 39 08 sts 0x0839, r24 |
d20: e4 2f mov r30, r20 |
d22: ff 27 eor r31, r31 |
d24: 80 91 2e 08 lds r24, 0x082E |
d28: e5 51 subi r30, 0x15 ; 21 |
d2a: f5 4f sbci r31, 0xF5 ; 245 |
d2c: 80 83 st Z, r24 |
d2e: 4f 5f subi r20, 0xFF ; 255 |
d30: 40 93 3a 08 sts 0x083A, r20 |
d34: 20 91 2e 08 lds r18, 0x082E |
d38: 80 91 3d 08 lds r24, 0x083D |
d3c: 90 91 3e 08 lds r25, 0x083E |
d40: 82 0f add r24, r18 |
d42: 91 1d adc r25, r1 |
d44: 90 93 3e 08 sts 0x083E, r25 |
d48: 80 93 3d 08 sts 0x083D, r24 |
d4c: 0e c0 rjmp .+28 ; 0xd6a <__vector_20+0x410> |
d4e: e4 2f mov r30, r20 |
d50: ff 27 eor r31, r31 |
d52: 80 91 2e 08 lds r24, 0x082E |
d56: e5 51 subi r30, 0x15 ; 21 |
d58: f5 4f sbci r31, 0xF5 ; 245 |
d5a: 80 83 st Z, r24 |
d5c: 46 39 cpi r20, 0x96 ; 150 |
d5e: 38 f3 brcs .-50 ; 0xd2e <__vector_20+0x3d4> |
d60: 10 92 39 08 sts 0x0839, r1 |
d64: e7 cf rjmp .-50 ; 0xd34 <__vector_20+0x3da> |
d66: 10 92 39 08 sts 0x0839, r1 |
d6a: ff 91 pop r31 |
d6c: ef 91 pop r30 |
d6e: df 91 pop r29 |
d70: cf 91 pop r28 |
d72: bf 91 pop r27 |
d74: af 91 pop r26 |
d76: 9f 91 pop r25 |
d78: 8f 91 pop r24 |
d7a: 7f 91 pop r23 |
d7c: 6f 91 pop r22 |
d7e: 5f 91 pop r21 |
d80: 4f 91 pop r20 |
d82: 3f 91 pop r19 |
d84: 2f 91 pop r18 |
d86: 0f 90 pop r0 |
d88: 0f be out 0x3f, r0 ; 63 |
d8a: 0f 90 pop r0 |
d8c: 1f 90 pop r1 |
d8e: 18 95 reti |
00000d90 <AddCRC>: |
d90: dc 01 movw r26, r24 |
d92: 20 e0 ldi r18, 0x00 ; 0 |
d94: 30 e0 ldi r19, 0x00 ; 0 |
d96: 40 e0 ldi r20, 0x00 ; 0 |
d98: 50 e0 ldi r21, 0x00 ; 0 |
d9a: eb e7 ldi r30, 0x7B ; 123 |
d9c: f9 e0 ldi r31, 0x09 ; 9 |
d9e: 05 c0 rjmp .+10 ; 0xdaa <AddCRC+0x1a> |
da0: 81 91 ld r24, Z+ |
da2: 28 0f add r18, r24 |
da4: 31 1d adc r19, r1 |
da6: 4f 5f subi r20, 0xFF ; 255 |
da8: 5f 4f sbci r21, 0xFF ; 255 |
daa: 4a 17 cp r20, r26 |
dac: 5b 07 cpc r21, r27 |
dae: c1 f7 brne .-16 ; 0xda0 <AddCRC+0x10> |
db0: 3f 70 andi r19, 0x0F ; 15 |
db2: c9 01 movw r24, r18 |
db4: 66 e0 ldi r22, 0x06 ; 6 |
db6: 96 95 lsr r25 |
db8: 87 95 ror r24 |
dba: 6a 95 dec r22 |
dbc: e1 f7 brne .-8 ; 0xdb6 <AddCRC+0x26> |
dbe: 83 5c subi r24, 0xC3 ; 195 |
dc0: fd 01 movw r30, r26 |
dc2: e5 58 subi r30, 0x85 ; 133 |
dc4: f6 4f sbci r31, 0xF6 ; 246 |
dc6: 80 83 st Z, r24 |
dc8: 11 96 adiw r26, 0x01 ; 1 |
dca: 2f 73 andi r18, 0x3F ; 63 |
dcc: 23 5c subi r18, 0xC3 ; 195 |
dce: fd 01 movw r30, r26 |
dd0: e5 58 subi r30, 0x85 ; 133 |
dd2: f6 4f sbci r31, 0xF6 ; 246 |
dd4: 20 83 st Z, r18 |
dd6: a4 58 subi r26, 0x84 ; 132 |
dd8: b6 4f sbci r27, 0xF6 ; 246 |
dda: 8d e0 ldi r24, 0x0D ; 13 |
ddc: 8c 93 st X, r24 |
dde: 10 92 00 01 sts 0x0100, r1 |
de2: 80 91 7b 09 lds r24, 0x097B |
de6: 80 93 c6 00 sts 0x00C6, r24 |
dea: 08 95 ret |
00000dec <SendOutData>: |
dec: ef 92 push r14 |
dee: ff 92 push r15 |
df0: 0f 93 push r16 |
df2: 1f 93 push r17 |
df4: cf 93 push r28 |
df6: df 93 push r29 |
df8: 7a 01 movw r14, r20 |
dfa: 72 2f mov r23, r18 |
dfc: 93 e2 ldi r25, 0x23 ; 35 |
dfe: 90 93 7b 09 sts 0x097B, r25 |
e02: 60 93 7c 09 sts 0x097C, r22 |
e06: 80 93 7d 09 sts 0x097D, r24 |
e0a: 03 e0 ldi r16, 0x03 ; 3 |
e0c: 10 e0 ldi r17, 0x00 ; 0 |
e0e: 60 e0 ldi r22, 0x00 ; 0 |
e10: ae e7 ldi r26, 0x7E ; 126 |
e12: b9 e0 ldi r27, 0x09 ; 9 |
e14: 46 c0 rjmp .+140 ; 0xea2 <SendOutData+0xb6> |
e16: f7 01 movw r30, r14 |
e18: e6 0f add r30, r22 |
e1a: f1 1d adc r31, r1 |
e1c: 90 81 ld r25, Z |
e1e: 6f 5f subi r22, 0xFF ; 255 |
e20: 71 50 subi r23, 0x01 ; 1 |
e22: 19 f4 brne .+6 ; 0xe2a <SendOutData+0x3e> |
e24: e0 e0 ldi r30, 0x00 ; 0 |
e26: 40 e0 ldi r20, 0x00 ; 0 |
e28: 0f c0 rjmp .+30 ; 0xe48 <SendOutData+0x5c> |
e2a: f7 01 movw r30, r14 |
e2c: e6 0f add r30, r22 |
e2e: f1 1d adc r31, r1 |
e30: 40 81 ld r20, Z |
e32: 6f 5f subi r22, 0xFF ; 255 |
e34: 71 50 subi r23, 0x01 ; 1 |
e36: 11 f4 brne .+4 ; 0xe3c <SendOutData+0x50> |
e38: e0 e0 ldi r30, 0x00 ; 0 |
e3a: 06 c0 rjmp .+12 ; 0xe48 <SendOutData+0x5c> |
e3c: f7 01 movw r30, r14 |
e3e: e6 0f add r30, r22 |
e40: f1 1d adc r31, r1 |
e42: e0 81 ld r30, Z |
e44: 6f 5f subi r22, 0xFF ; 255 |
e46: 71 50 subi r23, 0x01 ; 1 |
e48: 89 2f mov r24, r25 |
e4a: 86 95 lsr r24 |
e4c: 86 95 lsr r24 |
e4e: 83 5c subi r24, 0xC3 ; 195 |
e50: 8c 93 st X, r24 |
e52: 55 27 eor r21, r21 |
e54: 89 2f mov r24, r25 |
e56: 99 27 eor r25, r25 |
e58: 83 70 andi r24, 0x03 ; 3 |
e5a: 90 70 andi r25, 0x00 ; 0 |
e5c: 24 e0 ldi r18, 0x04 ; 4 |
e5e: 88 0f add r24, r24 |
e60: 99 1f adc r25, r25 |
e62: 2a 95 dec r18 |
e64: e1 f7 brne .-8 ; 0xe5e <SendOutData+0x72> |
e66: 9a 01 movw r18, r20 |
e68: 94 e0 ldi r25, 0x04 ; 4 |
e6a: 36 95 lsr r19 |
e6c: 27 95 ror r18 |
e6e: 9a 95 dec r25 |
e70: e1 f7 brne .-8 ; 0xe6a <SendOutData+0x7e> |
e72: 82 2b or r24, r18 |
e74: 83 5c subi r24, 0xC3 ; 195 |
e76: ed 01 movw r28, r26 |
e78: 89 83 std Y+1, r24 ; 0x01 |
e7a: 4f 70 andi r20, 0x0F ; 15 |
e7c: 50 70 andi r21, 0x00 ; 0 |
e7e: 44 0f add r20, r20 |
e80: 55 1f adc r21, r21 |
e82: 44 0f add r20, r20 |
e84: 55 1f adc r21, r21 |
e86: 8e 2f mov r24, r30 |
e88: 82 95 swap r24 |
e8a: 86 95 lsr r24 |
e8c: 86 95 lsr r24 |
e8e: 83 70 andi r24, 0x03 ; 3 |
e90: 84 2b or r24, r20 |
e92: 83 5c subi r24, 0xC3 ; 195 |
e94: 8a 83 std Y+2, r24 ; 0x02 |
e96: ef 73 andi r30, 0x3F ; 63 |
e98: e3 5c subi r30, 0xC3 ; 195 |
e9a: eb 83 std Y+3, r30 ; 0x03 |
e9c: 0c 5f subi r16, 0xFC ; 252 |
e9e: 1f 4f sbci r17, 0xFF ; 255 |
ea0: 14 96 adiw r26, 0x04 ; 4 |
ea2: 77 23 and r23, r23 |
ea4: 09 f0 breq .+2 ; 0xea8 <SendOutData+0xbc> |
ea6: b7 cf rjmp .-146 ; 0xe16 <SendOutData+0x2a> |
ea8: c8 01 movw r24, r16 |
eaa: 0e 94 c8 06 call 0xd90 ; 0xd90 <AddCRC> |
eae: df 91 pop r29 |
eb0: cf 91 pop r28 |
eb2: 1f 91 pop r17 |
eb4: 0f 91 pop r16 |
eb6: ff 90 pop r15 |
eb8: ef 90 pop r14 |
eba: 08 95 ret |
00000ebc <Decode64>: |
ebc: 1f 93 push r17 |
ebe: cf 93 push r28 |
ec0: df 93 push r29 |
ec2: ec 01 movw r28, r24 |
ec4: 70 e0 ldi r23, 0x00 ; 0 |
ec6: a2 2f mov r26, r18 |
ec8: bb 27 eor r27, r27 |
eca: 12 97 sbiw r26, 0x02 ; 2 |
ecc: 48 c0 rjmp .+144 ; 0xf5e <Decode64+0xa2> |
ece: e4 2f mov r30, r20 |
ed0: ff 27 eor r31, r31 |
ed2: e5 51 subi r30, 0x15 ; 21 |
ed4: f5 4f sbci r31, 0xF5 ; 245 |
ed6: 30 81 ld r19, Z |
ed8: 4f 5f subi r20, 0xFF ; 255 |
eda: e4 2f mov r30, r20 |
edc: ff 27 eor r31, r31 |
ede: e5 51 subi r30, 0x15 ; 21 |
ee0: f5 4f sbci r31, 0xF5 ; 245 |
ee2: 50 81 ld r21, Z |
ee4: 4f 5f subi r20, 0xFF ; 255 |
ee6: e4 2f mov r30, r20 |
ee8: ff 27 eor r31, r31 |
eea: e5 51 subi r30, 0x15 ; 21 |
eec: f5 4f sbci r31, 0xF5 ; 245 |
eee: 10 81 ld r17, Z |
ef0: 4f 5f subi r20, 0xFF ; 255 |
ef2: e4 2f mov r30, r20 |
ef4: ff 27 eor r31, r31 |
ef6: e5 51 subi r30, 0x15 ; 21 |
ef8: f5 4f sbci r31, 0xF5 ; 245 |
efa: 20 81 ld r18, Z |
efc: 4f 5f subi r20, 0xFF ; 255 |
efe: 84 2f mov r24, r20 |
f00: 99 27 eor r25, r25 |
f02: a8 17 cp r26, r24 |
f04: b9 07 cpc r27, r25 |
f06: 74 f1 brlt .+92 ; 0xf64 <Decode64+0xa8> |
f08: 5d 53 subi r21, 0x3D ; 61 |
f0a: fe 01 movw r30, r28 |
f0c: e7 0f add r30, r23 |
f0e: f1 1d adc r31, r1 |
f10: 3d 53 subi r19, 0x3D ; 61 |
f12: 33 0f add r19, r19 |
f14: 33 0f add r19, r19 |
f16: 85 2f mov r24, r21 |
f18: 82 95 swap r24 |
f1a: 8f 70 andi r24, 0x0F ; 15 |
f1c: 38 2b or r19, r24 |
f1e: 30 83 st Z, r19 |
f20: 61 30 cpi r22, 0x01 ; 1 |
f22: 01 f1 breq .+64 ; 0xf64 <Decode64+0xa8> |
f24: 91 2f mov r25, r17 |
f26: 9d 53 subi r25, 0x3D ; 61 |
f28: 7f 5f subi r23, 0xFF ; 255 |
f2a: fe 01 movw r30, r28 |
f2c: e7 0f add r30, r23 |
f2e: f1 1d adc r31, r1 |
f30: 71 50 subi r23, 0x01 ; 1 |
f32: 52 95 swap r21 |
f34: 50 7f andi r21, 0xF0 ; 240 |
f36: 89 2f mov r24, r25 |
f38: 86 95 lsr r24 |
f3a: 86 95 lsr r24 |
f3c: 58 2b or r21, r24 |
f3e: 50 83 st Z, r21 |
f40: 63 50 subi r22, 0x03 ; 3 |
f42: 6f 3f cpi r22, 0xFF ; 255 |
f44: 79 f0 breq .+30 ; 0xf64 <Decode64+0xa8> |
f46: 7e 5f subi r23, 0xFE ; 254 |
f48: fe 01 movw r30, r28 |
f4a: e7 0f add r30, r23 |
f4c: f1 1d adc r31, r1 |
f4e: 92 95 swap r25 |
f50: 99 0f add r25, r25 |
f52: 99 0f add r25, r25 |
f54: 90 7c andi r25, 0xC0 ; 192 |
f56: 2d 53 subi r18, 0x3D ; 61 |
f58: 92 2b or r25, r18 |
f5a: 90 83 st Z, r25 |
f5c: 7f 5f subi r23, 0xFF ; 255 |
f5e: 66 23 and r22, r22 |
f60: 09 f0 breq .+2 ; 0xf64 <Decode64+0xa8> |
f62: b5 cf rjmp .-150 ; 0xece <Decode64+0x12> |
f64: df 91 pop r29 |
f66: cf 91 pop r28 |
f68: 1f 91 pop r17 |
f6a: 08 95 ret |
00000f6c <uart_putchar>: |
f6c: 1f 93 push r17 |
f6e: 18 2f mov r17, r24 |
f70: 8a 30 cpi r24, 0x0A ; 10 |
f72: 19 f4 brne .+6 ; 0xf7a <uart_putchar+0xe> |
f74: 8d e0 ldi r24, 0x0D ; 13 |
f76: 0e 94 b6 07 call 0xf6c ; 0xf6c <uart_putchar> |
f7a: 80 91 c0 00 lds r24, 0x00C0 |
f7e: 85 ff sbrs r24, 5 |
f80: fc cf rjmp .-8 ; 0xf7a <uart_putchar+0xe> |
f82: 10 93 c6 00 sts 0x00C6, r17 |
f86: 80 e0 ldi r24, 0x00 ; 0 |
f88: 90 e0 ldi r25, 0x00 ; 0 |
f8a: 1f 91 pop r17 |
f8c: 08 95 ret |
00000f8e <WriteProgramData>: |
f8e: 08 95 ret |
00000f90 <UART_Init>: |
f90: e1 ec ldi r30, 0xC1 ; 193 |
f92: f0 e0 ldi r31, 0x00 ; 0 |
f94: 88 e1 ldi r24, 0x18 ; 24 |
f96: 80 83 st Z, r24 |
f98: a0 ec ldi r26, 0xC0 ; 192 |
f9a: b0 e0 ldi r27, 0x00 ; 0 |
f9c: 8c 91 ld r24, X |
f9e: 82 60 ori r24, 0x02 ; 2 |
fa0: 8c 93 st X, r24 |
fa2: 80 81 ld r24, Z |
fa4: 80 68 ori r24, 0x80 ; 128 |
fa6: 80 83 st Z, r24 |
fa8: 80 81 ld r24, Z |
faa: 80 64 ori r24, 0x40 ; 64 |
fac: 80 83 st Z, r24 |
fae: 8a e2 ldi r24, 0x2A ; 42 |
fb0: 80 93 c4 00 sts 0x00C4, r24 |
fb4: 88 ec ldi r24, 0xC8 ; 200 |
fb6: 90 e0 ldi r25, 0x00 ; 0 |
fb8: 0e 94 96 0c call 0x192c ; 0x192c <SetDelay> |
fbc: 90 93 a8 0a sts 0x0AA8, r25 |
fc0: 80 93 a7 0a sts 0x0AA7, r24 |
fc4: 10 92 41 08 sts 0x0841, r1 |
fc8: 08 95 ret |
00000fca <DatenUebertragung>: |
fca: 80 91 00 01 lds r24, 0x0100 |
fce: 88 23 and r24, r24 |
fd0: 09 f4 brne .+2 ; 0xfd4 <DatenUebertragung+0xa> |
fd2: 68 c0 rjmp .+208 ; 0x10a4 <DatenUebertragung+0xda> |
fd4: 80 91 2a 08 lds r24, 0x082A |
fd8: 88 23 and r24, r24 |
fda: 71 f0 breq .+28 ; 0xff8 <DatenUebertragung+0x2e> |
fdc: 80 91 00 01 lds r24, 0x0100 |
fe0: 88 23 and r24, r24 |
fe2: 51 f0 breq .+20 ; 0xff8 <DatenUebertragung+0x2e> |
fe4: 2b e0 ldi r18, 0x0B ; 11 |
fe6: 4b eb ldi r20, 0xBB ; 187 |
fe8: 5a e0 ldi r21, 0x0A ; 10 |
fea: 60 91 79 09 lds r22, 0x0979 |
fee: 87 e4 ldi r24, 0x47 ; 71 |
ff0: 0e 94 f6 06 call 0xdec ; 0xdec <SendOutData> |
ff4: 10 92 2a 08 sts 0x082A, r1 |
ff8: 80 91 a7 0a lds r24, 0x0AA7 |
ffc: 90 91 a8 0a lds r25, 0x0AA8 |
1000: 0e 94 9f 0c call 0x193e ; 0x193e <CheckDelay> |
1004: 88 23 and r24, r24 |
1006: 21 f4 brne .+8 ; 0x1010 <DatenUebertragung+0x46> |
1008: 80 91 2c 08 lds r24, 0x082C |
100c: 88 23 and r24, r24 |
100e: b1 f0 breq .+44 ; 0x103c <DatenUebertragung+0x72> |
1010: 80 91 00 01 lds r24, 0x0100 |
1014: 88 23 and r24, r24 |
1016: 91 f0 breq .+36 ; 0x103c <DatenUebertragung+0x72> |
1018: 22 e3 ldi r18, 0x32 ; 50 |
101a: 41 eb ldi r20, 0xB1 ; 177 |
101c: 5b e0 ldi r21, 0x0B ; 11 |
101e: 60 91 79 09 lds r22, 0x0979 |
1022: 84 e4 ldi r24, 0x44 ; 68 |
1024: 0e 94 f6 06 call 0xdec ; 0xdec <SendOutData> |
1028: 10 92 2c 08 sts 0x082C, r1 |
102c: 8a ef ldi r24, 0xFA ; 250 |
102e: 90 e0 ldi r25, 0x00 ; 0 |
1030: 0e 94 96 0c call 0x192c ; 0x192c <SetDelay> |
1034: 90 93 a8 0a sts 0x0AA8, r25 |
1038: 80 93 a7 0a sts 0x0AA7, r24 |
103c: 80 91 2b 08 lds r24, 0x082B |
1040: 88 23 and r24, r24 |
1042: f1 f0 breq .+60 ; 0x1080 <DatenUebertragung+0xb6> |
1044: 80 91 00 01 lds r24, 0x0100 |
1048: 88 23 and r24, r24 |
104a: d1 f0 breq .+52 ; 0x1080 <DatenUebertragung+0xb6> |
104c: 0e 94 e5 10 call 0x21ca ; 0x21ca <Menu> |
1050: 10 92 2b 08 sts 0x082B, r1 |
1054: 80 91 38 08 lds r24, 0x0838 |
1058: 8f 5f subi r24, 0xFF ; 255 |
105a: 80 93 38 08 sts 0x0838, r24 |
105e: 84 30 cpi r24, 0x04 ; 4 |
1060: 11 f4 brne .+4 ; 0x1066 <DatenUebertragung+0x9c> |
1062: 10 92 38 08 sts 0x0838, r1 |
1066: 80 91 38 08 lds r24, 0x0838 |
106a: 44 e1 ldi r20, 0x14 ; 20 |
106c: 84 9f mul r24, r20 |
106e: a0 01 movw r20, r0 |
1070: 11 24 eor r1, r1 |
1072: 4a 5e subi r20, 0xEA ; 234 |
1074: 5e 4f sbci r21, 0xFE ; 254 |
1076: 24 e1 ldi r18, 0x14 ; 20 |
1078: 60 e0 ldi r22, 0x00 ; 0 |
107a: 80 5d subi r24, 0xD0 ; 208 |
107c: 0e 94 f6 06 call 0xdec ; 0xdec <SendOutData> |
1080: 80 91 2d 08 lds r24, 0x082D |
1084: 88 23 and r24, r24 |
1086: 71 f0 breq .+28 ; 0x10a4 <DatenUebertragung+0xda> |
1088: 80 91 00 01 lds r24, 0x0100 |
108c: 88 23 and r24, r24 |
108e: 51 f0 breq .+20 ; 0x10a4 <DatenUebertragung+0xda> |
1090: 2a e0 ldi r18, 0x0A ; 10 |
1092: 46 ec ldi r20, 0xC6 ; 198 |
1094: 5a e0 ldi r21, 0x0A ; 10 |
1096: 60 91 79 09 lds r22, 0x0979 |
109a: 86 e5 ldi r24, 0x56 ; 86 |
109c: 0e 94 f6 06 call 0xdec ; 0xdec <SendOutData> |
10a0: 10 92 2d 08 sts 0x082D, r1 |
10a4: 08 95 ret |
000010a6 <BearbeiteRxDaten>: |
10a6: 1f 93 push r17 |
10a8: cf 93 push r28 |
10aa: df 93 push r29 |
10ac: cd b7 in r28, 0x3d ; 61 |
10ae: de b7 in r29, 0x3e ; 62 |
10b0: 22 97 sbiw r28, 0x02 ; 2 |
10b2: 0f b6 in r0, 0x3f ; 63 |
10b4: f8 94 cli |
10b6: de bf out 0x3e, r29 ; 62 |
10b8: 0f be out 0x3f, r0 ; 63 |
10ba: cd bf out 0x3d, r28 ; 61 |
10bc: 80 91 2f 08 lds r24, 0x082F |
10c0: 88 23 and r24, r24 |
10c2: 09 f4 brne .+2 ; 0x10c6 <BearbeiteRxDaten+0x20> |
10c4: 97 c0 rjmp .+302 ; 0x11f4 <__stack+0xf5> |
10c6: 8f ef ldi r24, 0xFF ; 255 |
10c8: 80 93 01 01 sts 0x0101, r24 |
10cc: 80 91 ed 0a lds r24, 0x0AED |
10d0: 81 37 cpi r24, 0x71 ; 113 |
10d2: 60 f4 brcc .+24 ; 0x10ec <BearbeiteRxDaten+0x46> |
10d4: 8c 36 cpi r24, 0x6C ; 108 |
10d6: 08 f0 brcs .+2 ; 0x10da <BearbeiteRxDaten+0x34> |
10d8: 6f c0 rjmp .+222 ; 0x11b8 <__stack+0xb9> |
10da: 87 36 cpi r24, 0x67 ; 103 |
10dc: 09 f4 brne .+2 ; 0x10e0 <BearbeiteRxDaten+0x3a> |
10de: 40 c0 rjmp .+128 ; 0x1160 <__stack+0x61> |
10e0: 88 36 cpi r24, 0x68 ; 104 |
10e2: f9 f0 breq .+62 ; 0x1122 <__stack+0x23> |
10e4: 83 36 cpi r24, 0x63 ; 99 |
10e6: 09 f0 breq .+2 ; 0x10ea <BearbeiteRxDaten+0x44> |
10e8: 83 c0 rjmp .+262 ; 0x11f0 <__stack+0xf1> |
10ea: 08 c0 rjmp .+16 ; 0x10fc <BearbeiteRxDaten+0x56> |
10ec: 84 37 cpi r24, 0x74 ; 116 |
10ee: 59 f1 breq .+86 ; 0x1146 <__stack+0x47> |
10f0: 86 37 cpi r24, 0x76 ; 118 |
10f2: 91 f1 breq .+100 ; 0x1158 <__stack+0x59> |
10f4: 81 37 cpi r24, 0x71 ; 113 |
10f6: 09 f0 breq .+2 ; 0x10fa <BearbeiteRxDaten+0x54> |
10f8: 7b c0 rjmp .+246 ; 0x11f0 <__stack+0xf1> |
10fa: 36 c0 rjmp .+108 ; 0x1168 <__stack+0x69> |
10fc: 20 91 32 08 lds r18, 0x0832 |
1100: 43 e0 ldi r20, 0x03 ; 3 |
1102: 6b e0 ldi r22, 0x0B ; 11 |
1104: 8b eb ldi r24, 0xBB ; 187 |
1106: 9a e0 ldi r25, 0x0A ; 10 |
1108: 0e 94 5e 07 call 0xebc ; 0xebc <Decode64> |
110c: 80 91 69 08 lds r24, 0x0869 |
1110: 90 91 bd 0a lds r25, 0x0ABD |
1114: 89 2b or r24, r25 |
1116: 80 93 69 08 sts 0x0869, r24 |
111a: 81 e0 ldi r24, 0x01 ; 1 |
111c: 80 93 2c 08 sts 0x082C, r24 |
1120: 67 c0 rjmp .+206 ; 0x11f0 <__stack+0xf1> |
1122: 20 91 32 08 lds r18, 0x0832 |
1126: 43 e0 ldi r20, 0x03 ; 3 |
1128: 62 e0 ldi r22, 0x02 ; 2 |
112a: ce 01 movw r24, r28 |
112c: 01 96 adiw r24, 0x01 ; 1 |
112e: 0e 94 5e 07 call 0xebc ; 0xebc <Decode64> |
1132: 80 91 69 08 lds r24, 0x0869 |
1136: 99 81 ldd r25, Y+1 ; 0x01 |
1138: 89 2b or r24, r25 |
113a: 80 93 69 08 sts 0x0869, r24 |
113e: 81 e0 ldi r24, 0x01 ; 1 |
1140: 80 93 2b 08 sts 0x082B, r24 |
1144: 55 c0 rjmp .+170 ; 0x11f0 <__stack+0xf1> |
1146: 20 91 32 08 lds r18, 0x0832 |
114a: 43 e0 ldi r20, 0x03 ; 3 |
114c: 64 e0 ldi r22, 0x04 ; 4 |
114e: 84 e3 ldi r24, 0x34 ; 52 |
1150: 98 e0 ldi r25, 0x08 ; 8 |
1152: 0e 94 5e 07 call 0xebc ; 0xebc <Decode64> |
1156: 4c c0 rjmp .+152 ; 0x11f0 <__stack+0xf1> |
1158: 81 e0 ldi r24, 0x01 ; 1 |
115a: 80 93 2d 08 sts 0x082D, r24 |
115e: 48 c0 rjmp .+144 ; 0x11f0 <__stack+0xf1> |
1160: 81 e0 ldi r24, 0x01 ; 1 |
1162: 80 93 2a 08 sts 0x082A, r24 |
1166: 44 c0 rjmp .+136 ; 0x11f0 <__stack+0xf1> |
1168: 20 91 32 08 lds r18, 0x0832 |
116c: 43 e0 ldi r20, 0x03 ; 3 |
116e: 62 e0 ldi r22, 0x02 ; 2 |
1170: ce 01 movw r24, r28 |
1172: 01 96 adiw r24, 0x01 ; 1 |
1174: 0e 94 5e 07 call 0xebc ; 0xebc <Decode64> |
1178: 89 81 ldd r24, Y+1 ; 0x01 |
117a: 8f 3f cpi r24, 0xFF ; 255 |
117c: 89 f0 breq .+34 ; 0x11a0 <__stack+0xa1> |
117e: 86 30 cpi r24, 0x06 ; 6 |
1180: 10 f0 brcs .+4 ; 0x1186 <__stack+0x87> |
1182: 85 e0 ldi r24, 0x05 ; 5 |
1184: 89 83 std Y+1, r24 ; 0x01 |
1186: 4a e3 ldi r20, 0x3A ; 58 |
1188: 60 e9 ldi r22, 0x90 ; 144 |
118a: 7c e0 ldi r23, 0x0C ; 12 |
118c: 89 81 ldd r24, Y+1 ; 0x01 |
118e: 0e 94 23 02 call 0x446 ; 0x446 <ReadParameterSet> |
1192: 89 81 ldd r24, Y+1 ; 0x01 |
1194: 2a e3 ldi r18, 0x3A ; 58 |
1196: 40 e9 ldi r20, 0x90 ; 144 |
1198: 5c e0 ldi r21, 0x0C ; 12 |
119a: 60 91 79 09 lds r22, 0x0979 |
119e: 08 c0 rjmp .+16 ; 0x11b0 <__stack+0xb1> |
11a0: 10 91 79 09 lds r17, 0x0979 |
11a4: 0e 94 04 02 call 0x408 ; 0x408 <GetActiveParamSetNumber> |
11a8: 2a e3 ldi r18, 0x3A ; 58 |
11aa: 40 e9 ldi r20, 0x90 ; 144 |
11ac: 5c e0 ldi r21, 0x0C ; 12 |
11ae: 61 2f mov r22, r17 |
11b0: 85 5b subi r24, 0xB5 ; 181 |
11b2: 0e 94 f6 06 call 0xdec ; 0xdec <SendOutData> |
11b6: 1c c0 rjmp .+56 ; 0x11f0 <__stack+0xf1> |
11b8: 20 91 32 08 lds r18, 0x0832 |
11bc: 43 e0 ldi r20, 0x03 ; 3 |
11be: 6a e3 ldi r22, 0x3A ; 58 |
11c0: 80 e9 ldi r24, 0x90 ; 144 |
11c2: 9c e0 ldi r25, 0x0C ; 12 |
11c4: 0e 94 5e 07 call 0xebc ; 0xebc <Decode64> |
11c8: 80 91 ed 0a lds r24, 0x0AED |
11cc: 4a e3 ldi r20, 0x3A ; 58 |
11ce: 60 e9 ldi r22, 0x90 ; 144 |
11d0: 7c e0 ldi r23, 0x0C ; 12 |
11d2: 8b 56 subi r24, 0x6B ; 107 |
11d4: 0e 94 0b 02 call 0x416 ; 0x416 <WriteParameterSet> |
11d8: 80 91 ed 0a lds r24, 0x0AED |
11dc: 8b 56 subi r24, 0x6B ; 107 |
11de: a2 e0 ldi r26, 0x02 ; 2 |
11e0: b0 e0 ldi r27, 0x00 ; 0 |
11e2: 08 2e mov r0, r24 |
11e4: 0e 94 3a 3f call 0x7e74 ; 0x7e74 <__eeprom_write_byte_1F2021> |
11e8: 0e 94 04 02 call 0x408 ; 0x408 <GetActiveParamSetNumber> |
11ec: 0e 94 a0 20 call 0x4140 ; 0x4140 <Piep> |
11f0: 10 92 2f 08 sts 0x082F, r1 |
11f4: 22 96 adiw r28, 0x02 ; 2 |
11f6: 0f b6 in r0, 0x3f ; 63 |
11f8: f8 94 cli |
11fa: de bf out 0x3e, r29 ; 62 |
11fc: 0f be out 0x3f, r0 ; 63 |
11fe: cd bf out 0x3d, r28 ; 61 |
1200: df 91 pop r29 |
1202: cf 91 pop r28 |
1204: 1f 91 pop r17 |
1206: 08 95 ret |
00001208 <Putchar>: |
1208: 98 2f mov r25, r24 |
120a: 80 91 39 0c lds r24, 0x0C39 |
120e: 81 30 cpi r24, 0x01 ; 1 |
1210: 69 f4 brne .+26 ; 0x122c <Putchar+0x24> |
1212: 80 91 68 08 lds r24, 0x0868 |
1216: e8 2f mov r30, r24 |
1218: ff 27 eor r31, r31 |
121a: ea 5e subi r30, 0xEA ; 234 |
121c: fe 4f sbci r31, 0xFE ; 254 |
121e: 90 83 st Z, r25 |
1220: 8f 5f subi r24, 0xFF ; 255 |
1222: 80 93 68 08 sts 0x0868, r24 |
1226: 21 e0 ldi r18, 0x01 ; 1 |
1228: 30 e0 ldi r19, 0x00 ; 0 |
122a: 05 c0 rjmp .+10 ; 0x1236 <Putchar+0x2e> |
122c: 89 2f mov r24, r25 |
122e: 0e 94 b6 07 call 0xf6c ; 0xf6c <uart_putchar> |
1232: 28 2f mov r18, r24 |
1234: 33 27 eor r19, r19 |
1236: c9 01 movw r24, r18 |
1238: 08 95 ret |
0000123a <PAD_0>: |
123a: 1f 93 push r17 |
123c: 18 2f mov r17, r24 |
123e: 04 c0 rjmp .+8 ; 0x1248 <PAD_0+0xe> |
1240: 80 e3 ldi r24, 0x30 ; 48 |
1242: 0e 94 04 09 call 0x1208 ; 0x1208 <Putchar> |
1246: 11 50 subi r17, 0x01 ; 1 |
1248: 11 16 cp r1, r17 |
124a: d4 f3 brlt .-12 ; 0x1240 <PAD_0+0x6> |
124c: 1f 91 pop r17 |
124e: 08 95 ret |
00001250 <PAD_SP>: |
1250: 1f 93 push r17 |
1252: 18 2f mov r17, r24 |
1254: 04 c0 rjmp .+8 ; 0x125e <PAD_SP+0xe> |
1256: 80 e2 ldi r24, 0x20 ; 32 |
1258: 0e 94 04 09 call 0x1208 ; 0x1208 <Putchar> |
125c: 11 50 subi r17, 0x01 ; 1 |
125e: 11 16 cp r1, r17 |
1260: d4 f3 brlt .-12 ; 0x1256 <PAD_SP+0x6> |
1262: 1f 91 pop r17 |
1264: 08 95 ret |
00001266 <PRINTP>: |
1266: 0f 93 push r16 |
1268: 1f 93 push r17 |
126a: cf 93 push r28 |
126c: df 93 push r29 |
126e: 8c 01 movw r16, r24 |
1270: eb 01 movw r28, r22 |
1272: 08 c0 rjmp .+16 ; 0x1284 <PRINTP+0x1e> |
1274: f8 01 movw r30, r16 |
1276: 0f 5f subi r16, 0xFF ; 255 |
1278: 1f 4f sbci r17, 0xFF ; 255 |
127a: e4 91 lpm r30, Z |
127c: 8e 2f mov r24, r30 |
127e: 0e 94 04 09 call 0x1208 ; 0x1208 <Putchar> |
1282: 21 97 sbiw r28, 0x01 ; 1 |
1284: 20 97 sbiw r28, 0x00 ; 0 |
1286: b1 f7 brne .-20 ; 0x1274 <PRINTP+0xe> |
1288: df 91 pop r29 |
128a: cf 91 pop r28 |
128c: 1f 91 pop r17 |
128e: 0f 91 pop r16 |
1290: 08 95 ret |
00001292 <PRINT>: |
1292: 0f 93 push r16 |
1294: 1f 93 push r17 |
1296: cf 93 push r28 |
1298: df 93 push r29 |
129a: 8c 01 movw r16, r24 |
129c: eb 01 movw r28, r22 |
129e: 06 c0 rjmp .+12 ; 0x12ac <PRINT+0x1a> |
12a0: f8 01 movw r30, r16 |
12a2: 81 91 ld r24, Z+ |
12a4: 8f 01 movw r16, r30 |
12a6: 0e 94 04 09 call 0x1208 ; 0x1208 <Putchar> |
12aa: 21 97 sbiw r28, 0x01 ; 1 |
12ac: 20 97 sbiw r28, 0x00 ; 0 |
12ae: c1 f7 brne .-16 ; 0x12a0 <PRINT+0xe> |
12b0: df 91 pop r29 |
12b2: cf 91 pop r28 |
12b4: 1f 91 pop r17 |
12b6: 0f 91 pop r16 |
12b8: 08 95 ret |
000012ba <_printf_P>: |
12ba: 2f 92 push r2 |
12bc: 3f 92 push r3 |
12be: 4f 92 push r4 |
12c0: 5f 92 push r5 |
12c2: 6f 92 push r6 |
12c4: 7f 92 push r7 |
12c6: 8f 92 push r8 |
12c8: 9f 92 push r9 |
12ca: af 92 push r10 |
12cc: bf 92 push r11 |
12ce: cf 92 push r12 |
12d0: df 92 push r13 |
12d2: ef 92 push r14 |
12d4: ff 92 push r15 |
12d6: 0f 93 push r16 |
12d8: 1f 93 push r17 |
12da: cf 93 push r28 |
12dc: df 93 push r29 |
12de: cd b7 in r28, 0x3d ; 61 |
12e0: de b7 in r29, 0x3e ; 62 |
12e2: e3 97 sbiw r28, 0x33 ; 51 |
12e4: 0f b6 in r0, 0x3f ; 63 |
12e6: f8 94 cli |
12e8: de bf out 0x3e, r29 ; 62 |
12ea: 0f be out 0x3f, r0 ; 63 |
12ec: cd bf out 0x3d, r28 ; 61 |
12ee: 29 96 adiw r28, 0x09 ; 9 |
12f0: 8f ad ldd r24, Y+63 ; 0x3f |
12f2: 29 97 sbiw r28, 0x09 ; 9 |
12f4: 80 93 39 0c sts 0x0C39, r24 |
12f8: ce 01 movw r24, r28 |
12fa: 85 5b subi r24, 0xB5 ; 181 |
12fc: 9f 4f sbci r25, 0xFF ; 255 |
12fe: 9d 83 std Y+5, r25 ; 0x05 |
1300: 8c 83 std Y+4, r24 ; 0x04 |
1302: 2b 96 adiw r28, 0x0b ; 11 |
1304: 8e ad ldd r24, Y+62 ; 0x3e |
1306: 9f ad ldd r25, Y+63 ; 0x3f |
1308: 2b 97 sbiw r28, 0x0b ; 11 |
130a: 9f a7 std Y+47, r25 ; 0x2f |
130c: 8e a7 std Y+46, r24 ; 0x2e |
130e: 22 24 eor r2, r2 |
1310: 33 24 eor r3, r3 |
1312: 21 01 movw r4, r2 |
1314: 02 c0 rjmp .+4 ; 0x131a <_printf_P+0x60> |
1316: 13 01 movw r2, r6 |
1318: 24 01 movw r4, r8 |
131a: 0e a5 ldd r16, Y+46 ; 0x2e |
131c: 1f a5 ldd r17, Y+47 ; 0x2f |
131e: 02 c0 rjmp .+4 ; 0x1324 <_printf_P+0x6a> |
1320: 0f 5f subi r16, 0xFF ; 255 |
1322: 1f 4f sbci r17, 0xFF ; 255 |
1324: f8 01 movw r30, r16 |
1326: f4 90 lpm r15, Z |
1328: ff 20 and r15, r15 |
132a: 19 f0 breq .+6 ; 0x1332 <_printf_P+0x78> |
132c: f5 e2 ldi r31, 0x25 ; 37 |
132e: ff 16 cp r15, r31 |
1330: b9 f7 brne .-18 ; 0x1320 <_printf_P+0x66> |
1332: b8 01 movw r22, r16 |
1334: 8e a5 ldd r24, Y+46 ; 0x2e |
1336: 9f a5 ldd r25, Y+47 ; 0x2f |
1338: 68 1b sub r22, r24 |
133a: 79 0b sbc r23, r25 |
133c: 11 f0 breq .+4 ; 0x1342 <_printf_P+0x88> |
133e: 0e 94 33 09 call 0x1266 ; 0x1266 <PRINTP> |
1342: ff 20 and r15, r15 |
1344: 09 f4 brne .+2 ; 0x1348 <_printf_P+0x8e> |
1346: 42 c2 rjmp .+1156 ; 0x17cc <_printf_P+0x512> |
1348: 0f 5f subi r16, 0xFF ; 255 |
134a: 1f 4f sbci r17, 0xFF ; 255 |
134c: 1f a7 std Y+47, r17 ; 0x2f |
134e: 0e a7 std Y+46, r16 ; 0x2e |
1350: 19 82 std Y+1, r1 ; 0x01 |
1352: ac 81 ldd r26, Y+4 ; 0x04 |
1354: bd 81 ldd r27, Y+5 ; 0x05 |
1356: 1b aa std Y+51, r1 ; 0x33 |
1358: 1a aa std Y+50, r1 ; 0x32 |
135a: 9f ef ldi r25, 0xFF ; 255 |
135c: 99 ab std Y+49, r25 ; 0x31 |
135e: ee a5 ldd r30, Y+46 ; 0x2e |
1360: ff a5 ldd r31, Y+47 ; 0x2f |
1362: cf 01 movw r24, r30 |
1364: 01 96 adiw r24, 0x01 ; 1 |
1366: 9f a7 std Y+47, r25 ; 0x2f |
1368: 8e a7 std Y+46, r24 ; 0x2e |
136a: b4 90 lpm r11, Z |
136c: 95 e7 ldi r25, 0x75 ; 117 |
136e: b9 16 cp r11, r25 |
1370: 21 f0 breq .+8 ; 0x137a <_printf_P+0xc0> |
1372: 8b 2d mov r24, r11 |
1374: 80 62 ori r24, 0x20 ; 32 |
1376: 88 37 cpi r24, 0x78 ; 120 |
1378: 89 f4 brne .+34 ; 0x139c <_printf_P+0xe2> |
137a: eb a9 ldd r30, Y+51 ; 0x33 |
137c: e0 ff sbrs r30, 0 |
137e: 07 c0 rjmp .+14 ; 0x138e <_printf_P+0xd4> |
1380: 2d 90 ld r2, X+ |
1382: 3d 90 ld r3, X+ |
1384: 4d 90 ld r4, X+ |
1386: 5c 90 ld r5, X |
1388: 13 97 sbiw r26, 0x03 ; 3 |
138a: 14 96 adiw r26, 0x04 ; 4 |
138c: 07 c0 rjmp .+14 ; 0x139c <_printf_P+0xe2> |
138e: 8d 91 ld r24, X+ |
1390: 9c 91 ld r25, X |
1392: 11 97 sbiw r26, 0x01 ; 1 |
1394: 1c 01 movw r2, r24 |
1396: 44 24 eor r4, r4 |
1398: 55 24 eor r5, r5 |
139a: 12 96 adiw r26, 0x02 ; 2 |
139c: f0 e2 ldi r31, 0x20 ; 32 |
139e: bf 16 cp r11, r31 |
13a0: 21 f4 brne .+8 ; 0x13aa <_printf_P+0xf0> |
13a2: 89 81 ldd r24, Y+1 ; 0x01 |
13a4: 88 23 and r24, r24 |
13a6: d9 f6 brne .-74 ; 0x135e <_printf_P+0xa4> |
13a8: 85 c0 rjmp .+266 ; 0x14b4 <_printf_P+0x1fa> |
13aa: 83 e2 ldi r24, 0x23 ; 35 |
13ac: b8 16 cp r11, r24 |
13ae: 09 f4 brne .+2 ; 0x13b2 <_printf_P+0xf8> |
13b0: 83 c0 rjmp .+262 ; 0x14b8 <_printf_P+0x1fe> |
13b2: 9a e2 ldi r25, 0x2A ; 42 |
13b4: b9 16 cp r11, r25 |
13b6: 21 f0 breq .+8 ; 0x13c0 <_printf_P+0x106> |
13b8: ed e2 ldi r30, 0x2D ; 45 |
13ba: be 16 cp r11, r30 |
13bc: 69 f4 brne .+26 ; 0x13d8 <_printf_P+0x11e> |
13be: 08 c0 rjmp .+16 ; 0x13d0 <_printf_P+0x116> |
13c0: fd 01 movw r30, r26 |
13c2: 12 96 adiw r26, 0x02 ; 2 |
13c4: e0 81 ld r30, Z |
13c6: ea ab std Y+50, r30 ; 0x32 |
13c8: e7 ff sbrs r30, 7 |
13ca: c9 cf rjmp .-110 ; 0x135e <_printf_P+0xa4> |
13cc: e1 95 neg r30 |
13ce: ea ab std Y+50, r30 ; 0x32 |
13d0: fb a9 ldd r31, Y+51 ; 0x33 |
13d2: f0 61 ori r31, 0x10 ; 16 |
13d4: ff 7d andi r31, 0xDF ; 223 |
13d6: 72 c0 rjmp .+228 ; 0x14bc <_printf_P+0x202> |
13d8: 8b e2 ldi r24, 0x2B ; 43 |
13da: b8 16 cp r11, r24 |
13dc: 09 f4 brne .+2 ; 0x13e0 <_printf_P+0x126> |
13de: 6a c0 rjmp .+212 ; 0x14b4 <_printf_P+0x1fa> |
13e0: 9e e2 ldi r25, 0x2E ; 46 |
13e2: b9 16 cp r11, r25 |
13e4: b1 f5 brne .+108 ; 0x1452 <_printf_P+0x198> |
13e6: 2e a5 ldd r18, Y+46 ; 0x2e |
13e8: 3f a5 ldd r19, Y+47 ; 0x2f |
13ea: 2f 5f subi r18, 0xFF ; 255 |
13ec: 3f 4f sbci r19, 0xFF ; 255 |
13ee: ee a5 ldd r30, Y+46 ; 0x2e |
13f0: ff a5 ldd r31, Y+47 ; 0x2f |
13f2: 84 91 lpm r24, Z |
13f4: 8a 32 cpi r24, 0x2A ; 42 |
13f6: 21 f0 breq .+8 ; 0x1400 <_printf_P+0x146> |
13f8: b8 2e mov r11, r24 |
13fa: 20 e0 ldi r18, 0x00 ; 0 |
13fc: 30 e0 ldi r19, 0x00 ; 0 |
13fe: 1b c0 rjmp .+54 ; 0x1436 <_printf_P+0x17c> |
1400: fd 01 movw r30, r26 |
1402: 12 96 adiw r26, 0x02 ; 2 |
1404: 40 81 ld r20, Z |
1406: 51 81 ldd r21, Z+1 ; 0x01 |
1408: 57 ff sbrs r21, 7 |
140a: 02 c0 rjmp .+4 ; 0x1410 <_printf_P+0x156> |
140c: 4f ef ldi r20, 0xFF ; 255 |
140e: 5f ef ldi r21, 0xFF ; 255 |
1410: 49 ab std Y+49, r20 ; 0x31 |
1412: 3f a7 std Y+47, r19 ; 0x2f |
1414: 2e a7 std Y+46, r18 ; 0x2e |
1416: a3 cf rjmp .-186 ; 0x135e <_printf_P+0xa4> |
1418: c9 01 movw r24, r18 |
141a: 03 e0 ldi r16, 0x03 ; 3 |
141c: 88 0f add r24, r24 |
141e: 99 1f adc r25, r25 |
1420: 0a 95 dec r16 |
1422: e1 f7 brne .-8 ; 0x141c <_printf_P+0x162> |
1424: 22 0f add r18, r18 |
1426: 33 1f adc r19, r19 |
1428: 28 0f add r18, r24 |
142a: 39 1f adc r19, r25 |
142c: 2b 0d add r18, r11 |
142e: 31 1d adc r19, r1 |
1430: 20 53 subi r18, 0x30 ; 48 |
1432: 30 40 sbci r19, 0x00 ; 0 |
1434: b4 90 lpm r11, Z |
1436: 31 96 adiw r30, 0x01 ; 1 |
1438: 8b 2d mov r24, r11 |
143a: 80 53 subi r24, 0x30 ; 48 |
143c: 8a 30 cpi r24, 0x0A ; 10 |
143e: 60 f3 brcs .-40 ; 0x1418 <_printf_P+0x15e> |
1440: ff a7 std Y+47, r31 ; 0x2f |
1442: ee a7 std Y+46, r30 ; 0x2e |
1444: a9 01 movw r20, r18 |
1446: 37 ff sbrs r19, 7 |
1448: 02 c0 rjmp .+4 ; 0x144e <_printf_P+0x194> |
144a: 4f ef ldi r20, 0xFF ; 255 |
144c: 5f ef ldi r21, 0xFF ; 255 |
144e: 49 ab std Y+49, r20 ; 0x31 |
1450: 8d cf rjmp .-230 ; 0x136c <_printf_P+0xb2> |
1452: f0 e3 ldi r31, 0x30 ; 48 |
1454: bf 16 cp r11, r31 |
1456: 31 f4 brne .+12 ; 0x1464 <_printf_P+0x1aa> |
1458: 8b a9 ldd r24, Y+51 ; 0x33 |
145a: 84 fd sbrc r24, 4 |
145c: 80 cf rjmp .-256 ; 0x135e <_printf_P+0xa4> |
145e: 80 62 ori r24, 0x20 ; 32 |
1460: 8b ab std Y+51, r24 ; 0x33 |
1462: 7d cf rjmp .-262 ; 0x135e <_printf_P+0xa4> |
1464: 8b 2d mov r24, r11 |
1466: 81 53 subi r24, 0x31 ; 49 |
1468: 89 30 cpi r24, 0x09 ; 9 |
146a: e8 f4 brcc .+58 ; 0x14a6 <_printf_P+0x1ec> |
146c: 20 e0 ldi r18, 0x00 ; 0 |
146e: 30 e0 ldi r19, 0x00 ; 0 |
1470: c9 01 movw r24, r18 |
1472: f3 e0 ldi r31, 0x03 ; 3 |
1474: 88 0f add r24, r24 |
1476: 99 1f adc r25, r25 |
1478: fa 95 dec r31 |
147a: e1 f7 brne .-8 ; 0x1474 <_printf_P+0x1ba> |
147c: 22 0f add r18, r18 |
147e: 33 1f adc r19, r19 |
1480: 28 0f add r18, r24 |
1482: 39 1f adc r19, r25 |
1484: 2b 0d add r18, r11 |
1486: 31 1d adc r19, r1 |
1488: 20 53 subi r18, 0x30 ; 48 |
148a: 30 40 sbci r19, 0x00 ; 0 |
148c: ee a5 ldd r30, Y+46 ; 0x2e |
148e: ff a5 ldd r31, Y+47 ; 0x2f |
1490: cf 01 movw r24, r30 |
1492: 01 96 adiw r24, 0x01 ; 1 |
1494: 9f a7 std Y+47, r25 ; 0x2f |
1496: 8e a7 std Y+46, r24 ; 0x2e |
1498: b4 90 lpm r11, Z |
149a: 8b 2d mov r24, r11 |
149c: 80 53 subi r24, 0x30 ; 48 |
149e: 8a 30 cpi r24, 0x0A ; 10 |
14a0: 38 f3 brcs .-50 ; 0x1470 <_printf_P+0x1b6> |
14a2: 2a ab std Y+50, r18 ; 0x32 |
14a4: 63 cf rjmp .-314 ; 0x136c <_printf_P+0xb2> |
14a6: 98 e6 ldi r25, 0x68 ; 104 |
14a8: b9 16 cp r11, r25 |
14aa: 51 f4 brne .+20 ; 0x14c0 <_printf_P+0x206> |
14ac: eb a9 ldd r30, Y+51 ; 0x33 |
14ae: e4 60 ori r30, 0x04 ; 4 |
14b0: eb ab std Y+51, r30 ; 0x33 |
14b2: 55 cf rjmp .-342 ; 0x135e <_printf_P+0xa4> |
14b4: b9 82 std Y+1, r11 ; 0x01 |
14b6: 53 cf rjmp .-346 ; 0x135e <_printf_P+0xa4> |
14b8: fb a9 ldd r31, Y+51 ; 0x33 |
14ba: f8 60 ori r31, 0x08 ; 8 |
14bc: fb ab std Y+51, r31 ; 0x33 |
14be: 4f cf rjmp .-354 ; 0x135e <_printf_P+0xa4> |
14c0: 8c e6 ldi r24, 0x6C ; 108 |
14c2: b8 16 cp r11, r24 |
14c4: 21 f4 brne .+8 ; 0x14ce <_printf_P+0x214> |
14c6: 9b a9 ldd r25, Y+51 ; 0x33 |
14c8: 91 60 ori r25, 0x01 ; 1 |
14ca: 9b ab std Y+51, r25 ; 0x33 |
14cc: 48 cf rjmp .-368 ; 0x135e <_printf_P+0xa4> |
14ce: bd 83 std Y+5, r27 ; 0x05 |
14d0: ac 83 std Y+4, r26 ; 0x04 |
14d2: e3 e6 ldi r30, 0x63 ; 99 |
14d4: be 16 cp r11, r30 |
14d6: 39 f4 brne .+14 ; 0x14e6 <_printf_P+0x22c> |
14d8: 12 96 adiw r26, 0x02 ; 2 |
14da: bd 83 std Y+5, r27 ; 0x05 |
14dc: ac 83 std Y+4, r26 ; 0x04 |
14de: 12 97 sbiw r26, 0x02 ; 2 |
14e0: 8c 91 ld r24, X |
14e2: 8e 83 std Y+6, r24 ; 0x06 |
14e4: 18 c1 rjmp .+560 ; 0x1716 <_printf_P+0x45c> |
14e6: f4 e4 ldi r31, 0x44 ; 68 |
14e8: bf 16 cp r11, r31 |
14ea: 39 f0 breq .+14 ; 0x14fa <_printf_P+0x240> |
14ec: 84 e6 ldi r24, 0x64 ; 100 |
14ee: b8 16 cp r11, r24 |
14f0: 39 f0 breq .+14 ; 0x1500 <_printf_P+0x246> |
14f2: 99 e6 ldi r25, 0x69 ; 105 |
14f4: b9 16 cp r11, r25 |
14f6: 59 f5 brne .+86 ; 0x154e <_printf_P+0x294> |
14f8: 03 c0 rjmp .+6 ; 0x1500 <_printf_P+0x246> |
14fa: eb a9 ldd r30, Y+51 ; 0x33 |
14fc: e1 60 ori r30, 0x01 ; 1 |
14fe: eb ab std Y+51, r30 ; 0x33 |
1500: fb a9 ldd r31, Y+51 ; 0x33 |
1502: f0 ff sbrs r31, 0 |
1504: 08 c0 rjmp .+16 ; 0x1516 <_printf_P+0x25c> |
1506: 14 96 adiw r26, 0x04 ; 4 |
1508: bd 83 std Y+5, r27 ; 0x05 |
150a: ac 83 std Y+4, r26 ; 0x04 |
150c: 5e 90 ld r5, -X |
150e: 4e 90 ld r4, -X |
1510: 3e 90 ld r3, -X |
1512: 2e 90 ld r2, -X |
1514: 0a c0 rjmp .+20 ; 0x152a <_printf_P+0x270> |
1516: 12 96 adiw r26, 0x02 ; 2 |
1518: bd 83 std Y+5, r27 ; 0x05 |
151a: ac 83 std Y+4, r26 ; 0x04 |
151c: 9e 91 ld r25, -X |
151e: 8e 91 ld r24, -X |
1520: 1c 01 movw r2, r24 |
1522: 44 24 eor r4, r4 |
1524: 37 fc sbrc r3, 7 |
1526: 40 94 com r4 |
1528: 54 2c mov r5, r4 |
152a: 57 fc sbrc r5, 7 |
152c: 03 c0 rjmp .+6 ; 0x1534 <_printf_P+0x27a> |
152e: 8a e0 ldi r24, 0x0A ; 10 |
1530: 88 ab std Y+48, r24 ; 0x30 |
1532: 92 c0 rjmp .+292 ; 0x1658 <_printf_P+0x39e> |
1534: 50 94 com r5 |
1536: 40 94 com r4 |
1538: 30 94 com r3 |
153a: 20 94 com r2 |
153c: 21 1c adc r2, r1 |
153e: 31 1c adc r3, r1 |
1540: 41 1c adc r4, r1 |
1542: 51 1c adc r5, r1 |
1544: 8d e2 ldi r24, 0x2D ; 45 |
1546: 89 83 std Y+1, r24 ; 0x01 |
1548: 9a e0 ldi r25, 0x0A ; 10 |
154a: 98 ab std Y+48, r25 ; 0x30 |
154c: 85 c0 rjmp .+266 ; 0x1658 <_printf_P+0x39e> |
154e: ef e4 ldi r30, 0x4F ; 79 |
1550: be 16 cp r11, r30 |
1552: 29 f0 breq .+10 ; 0x155e <_printf_P+0x2a4> |
1554: ff e6 ldi r31, 0x6F ; 111 |
1556: bf 16 cp r11, r31 |
1558: 39 f4 brne .+14 ; 0x1568 <_printf_P+0x2ae> |
155a: 88 e0 ldi r24, 0x08 ; 8 |
155c: 61 c0 rjmp .+194 ; 0x1620 <_printf_P+0x366> |
155e: 9b a9 ldd r25, Y+51 ; 0x33 |
1560: 91 60 ori r25, 0x01 ; 1 |
1562: 9b ab std Y+51, r25 ; 0x33 |
1564: e8 e0 ldi r30, 0x08 ; 8 |
1566: 56 c0 rjmp .+172 ; 0x1614 <_printf_P+0x35a> |
1568: f0 e7 ldi r31, 0x70 ; 112 |
156a: bf 16 cp r11, r31 |
156c: 71 f4 brne .+28 ; 0x158a <_printf_P+0x2d0> |
156e: 12 96 adiw r26, 0x02 ; 2 |
1570: bd 83 std Y+5, r27 ; 0x05 |
1572: ac 83 std Y+4, r26 ; 0x04 |
1574: 9e 91 ld r25, -X |
1576: 8e 91 ld r24, -X |
1578: 1c 01 movw r2, r24 |
157a: 44 24 eor r4, r4 |
157c: 55 24 eor r5, r5 |
157e: 8b a9 ldd r24, Y+51 ; 0x33 |
1580: 80 64 ori r24, 0x40 ; 64 |
1582: 8b ab std Y+51, r24 ; 0x33 |
1584: 78 e7 ldi r23, 0x78 ; 120 |
1586: b7 2e mov r11, r23 |
1588: 5e c0 rjmp .+188 ; 0x1646 <_printf_P+0x38c> |
158a: e3 e7 ldi r30, 0x73 ; 115 |
158c: be 16 cp r11, r30 |
158e: d9 f5 brne .+118 ; 0x1606 <_printf_P+0x34c> |
1590: 12 96 adiw r26, 0x02 ; 2 |
1592: bd 83 std Y+5, r27 ; 0x05 |
1594: ac 83 std Y+4, r26 ; 0x04 |
1596: de 90 ld r13, -X |
1598: ce 90 ld r12, -X |
159a: c1 14 cp r12, r1 |
159c: d1 04 cpc r13, r1 |
159e: 89 f4 brne .+34 ; 0x15c2 <_printf_P+0x308> |
15a0: 88 e2 ldi r24, 0x28 ; 40 |
15a2: 8e 83 std Y+6, r24 ; 0x06 |
15a4: 8e e6 ldi r24, 0x6E ; 110 |
15a6: 8f 83 std Y+7, r24 ; 0x07 |
15a8: 85 e7 ldi r24, 0x75 ; 117 |
15aa: 88 87 std Y+8, r24 ; 0x08 |
15ac: 8c e6 ldi r24, 0x6C ; 108 |
15ae: 89 87 std Y+9, r24 ; 0x09 |
15b0: 8a 87 std Y+10, r24 ; 0x0a |
15b2: 89 e2 ldi r24, 0x29 ; 41 |
15b4: 8b 87 std Y+11, r24 ; 0x0b |
15b6: 1c 86 std Y+12, r1 ; 0x0c |
15b8: 66 e0 ldi r22, 0x06 ; 6 |
15ba: c6 2e mov r12, r22 |
15bc: d1 2c mov r13, r1 |
15be: cc 0e add r12, r28 |
15c0: dd 1e adc r13, r29 |
15c2: f9 a9 ldd r31, Y+49 ; 0x31 |
15c4: f7 fd sbrc r31, 7 |
15c6: 13 c0 rjmp .+38 ; 0x15ee <_printf_P+0x334> |
15c8: 4f 2f mov r20, r31 |
15ca: 55 27 eor r21, r21 |
15cc: 47 fd sbrc r20, 7 |
15ce: 50 95 com r21 |
15d0: 60 e0 ldi r22, 0x00 ; 0 |
15d2: 70 e0 ldi r23, 0x00 ; 0 |
15d4: c6 01 movw r24, r12 |
15d6: 0e 94 03 3d call 0x7a06 ; 0x7a06 <memchr> |
15da: 00 97 sbiw r24, 0x00 ; 0 |
15dc: 11 f4 brne .+4 ; 0x15e2 <_printf_P+0x328> |
15de: 19 a9 ldd r17, Y+49 ; 0x31 |
15e0: 0d c0 rjmp .+26 ; 0x15fc <_printf_P+0x342> |
15e2: 8c 19 sub r24, r12 |
15e4: 19 a9 ldd r17, Y+49 ; 0x31 |
15e6: 81 17 cp r24, r17 |
15e8: 4c f4 brge .+18 ; 0x15fc <_printf_P+0x342> |
15ea: 18 2f mov r17, r24 |
15ec: 07 c0 rjmp .+14 ; 0x15fc <_printf_P+0x342> |
15ee: f6 01 movw r30, r12 |
15f0: 01 90 ld r0, Z+ |
15f2: 00 20 and r0, r0 |
15f4: e9 f7 brne .-6 ; 0x15f0 <_printf_P+0x336> |
15f6: 31 97 sbiw r30, 0x01 ; 1 |
15f8: 1e 2f mov r17, r30 |
15fa: 1c 19 sub r17, r12 |
15fc: 19 82 std Y+1, r1 ; 0x01 |
15fe: 42 01 movw r8, r4 |
1600: 31 01 movw r6, r2 |
1602: 40 e0 ldi r20, 0x00 ; 0 |
1604: 94 c0 rjmp .+296 ; 0x172e <_printf_P+0x474> |
1606: 85 e5 ldi r24, 0x55 ; 85 |
1608: b8 16 cp r11, r24 |
160a: 31 f0 breq .+12 ; 0x1618 <_printf_P+0x35e> |
160c: 95 e7 ldi r25, 0x75 ; 117 |
160e: b9 16 cp r11, r25 |
1610: 49 f4 brne .+18 ; 0x1624 <_printf_P+0x36a> |
1612: ea e0 ldi r30, 0x0A ; 10 |
1614: e8 ab std Y+48, r30 ; 0x30 |
1616: 1f c0 rjmp .+62 ; 0x1656 <_printf_P+0x39c> |
1618: fb a9 ldd r31, Y+51 ; 0x33 |
161a: f1 60 ori r31, 0x01 ; 1 |
161c: fb ab std Y+51, r31 ; 0x33 |
161e: 8a e0 ldi r24, 0x0A ; 10 |
1620: 88 ab std Y+48, r24 ; 0x30 |
1622: 19 c0 rjmp .+50 ; 0x1656 <_printf_P+0x39c> |
1624: 98 e5 ldi r25, 0x58 ; 88 |
1626: b9 16 cp r11, r25 |
1628: 21 f0 breq .+8 ; 0x1632 <_printf_P+0x378> |
162a: e8 e7 ldi r30, 0x78 ; 120 |
162c: be 16 cp r11, r30 |
162e: 09 f0 breq .+2 ; 0x1632 <_printf_P+0x378> |
1630: 6e c0 rjmp .+220 ; 0x170e <_printf_P+0x454> |
1632: fb a9 ldd r31, Y+51 ; 0x33 |
1634: f3 fd sbrc r31, 3 |
1636: 02 c0 rjmp .+4 ; 0x163c <_printf_P+0x382> |
1638: 80 e1 ldi r24, 0x10 ; 16 |
163a: f2 cf rjmp .-28 ; 0x1620 <_printf_P+0x366> |
163c: 21 14 cp r2, r1 |
163e: 31 04 cpc r3, r1 |
1640: 41 04 cpc r4, r1 |
1642: 51 04 cpc r5, r1 |
1644: 19 f4 brne .+6 ; 0x164c <_printf_P+0x392> |
1646: 90 e1 ldi r25, 0x10 ; 16 |
1648: 98 ab std Y+48, r25 ; 0x30 |
164a: 05 c0 rjmp .+10 ; 0x1656 <_printf_P+0x39c> |
164c: eb a9 ldd r30, Y+51 ; 0x33 |
164e: e0 64 ori r30, 0x40 ; 64 |
1650: eb ab std Y+51, r30 ; 0x33 |
1652: f0 e1 ldi r31, 0x10 ; 16 |
1654: f8 ab std Y+48, r31 ; 0x30 |
1656: 19 82 std Y+1, r1 ; 0x01 |
1658: 89 a9 ldd r24, Y+49 ; 0x31 |
165a: 87 fd sbrc r24, 7 |
165c: 03 c0 rjmp .+6 ; 0x1664 <_printf_P+0x3aa> |
165e: 9b a9 ldd r25, Y+51 ; 0x33 |
1660: 9f 7d andi r25, 0xDF ; 223 |
1662: 9b ab std Y+51, r25 ; 0x33 |
1664: 21 14 cp r2, r1 |
1666: 31 04 cpc r3, r1 |
1668: 41 04 cpc r4, r1 |
166a: 51 04 cpc r5, r1 |
166c: 61 f4 brne .+24 ; 0x1686 <_printf_P+0x3cc> |
166e: e9 a9 ldd r30, Y+49 ; 0x31 |
1670: ee 23 and r30, r30 |
1672: 49 f4 brne .+18 ; 0x1686 <_printf_P+0x3cc> |
1674: 66 24 eor r6, r6 |
1676: 77 24 eor r7, r7 |
1678: 43 01 movw r8, r6 |
167a: 5e e2 ldi r21, 0x2E ; 46 |
167c: c5 2e mov r12, r21 |
167e: d1 2c mov r13, r1 |
1680: cc 0e add r12, r28 |
1682: dd 1e adc r13, r29 |
1684: 3e c0 rjmp .+124 ; 0x1702 <_printf_P+0x448> |
1686: 4e e2 ldi r20, 0x2E ; 46 |
1688: c4 2e mov r12, r20 |
168a: d1 2c mov r13, r1 |
168c: cc 0e add r12, r28 |
168e: dd 1e adc r13, r29 |
1690: f8 a9 ldd r31, Y+48 ; 0x30 |
1692: ef 2e mov r14, r31 |
1694: ff 24 eor r15, r15 |
1696: 00 27 eor r16, r16 |
1698: 11 27 eor r17, r17 |
169a: c2 01 movw r24, r4 |
169c: b1 01 movw r22, r2 |
169e: a8 01 movw r20, r16 |
16a0: 97 01 movw r18, r14 |
16a2: 0e 94 be 3e call 0x7d7c ; 0x7d7c <__udivmodsi4> |
16a6: 6a 30 cpi r22, 0x0A ; 10 |
16a8: 20 f4 brcc .+8 ; 0x16b2 <_printf_P+0x3f8> |
16aa: 30 e3 ldi r19, 0x30 ; 48 |
16ac: a3 2e mov r10, r19 |
16ae: a6 0e add r10, r22 |
16b0: 08 c0 rjmp .+16 ; 0x16c2 <_printf_P+0x408> |
16b2: 27 e5 ldi r18, 0x57 ; 87 |
16b4: a2 2e mov r10, r18 |
16b6: a6 0e add r10, r22 |
16b8: 88 e5 ldi r24, 0x58 ; 88 |
16ba: b8 16 cp r11, r24 |
16bc: 11 f4 brne .+4 ; 0x16c2 <_printf_P+0x408> |
16be: 9f ed ldi r25, 0xDF ; 223 |
16c0: a9 22 and r10, r25 |
16c2: f6 01 movw r30, r12 |
16c4: a2 92 st -Z, r10 |
16c6: 6f 01 movw r12, r30 |
16c8: c2 01 movw r24, r4 |
16ca: b1 01 movw r22, r2 |
16cc: a8 01 movw r20, r16 |
16ce: 97 01 movw r18, r14 |
16d0: 0e 94 be 3e call 0x7d7c ; 0x7d7c <__udivmodsi4> |
16d4: 39 01 movw r6, r18 |
16d6: 4a 01 movw r8, r20 |
16d8: 2e 14 cp r2, r14 |
16da: 3f 04 cpc r3, r15 |
16dc: 40 06 cpc r4, r16 |
16de: 51 06 cpc r5, r17 |
16e0: 18 f0 brcs .+6 ; 0x16e8 <_printf_P+0x42e> |
16e2: 19 01 movw r2, r18 |
16e4: 2a 01 movw r4, r20 |
16e6: d9 cf rjmp .-78 ; 0x169a <_printf_P+0x3e0> |
16e8: f8 a9 ldd r31, Y+48 ; 0x30 |
16ea: f8 30 cpi r31, 0x08 ; 8 |
16ec: 51 f4 brne .+20 ; 0x1702 <_printf_P+0x448> |
16ee: 8b a9 ldd r24, Y+51 ; 0x33 |
16f0: 83 ff sbrs r24, 3 |
16f2: 07 c0 rjmp .+14 ; 0x1702 <_printf_P+0x448> |
16f4: 90 e3 ldi r25, 0x30 ; 48 |
16f6: a9 16 cp r10, r25 |
16f8: 21 f0 breq .+8 ; 0x1702 <_printf_P+0x448> |
16fa: 80 e3 ldi r24, 0x30 ; 48 |
16fc: f6 01 movw r30, r12 |
16fe: 82 93 st -Z, r24 |
1700: 6f 01 movw r12, r30 |
1702: ce 01 movw r24, r28 |
1704: 8c 19 sub r24, r12 |
1706: 18 2f mov r17, r24 |
1708: 12 5d subi r17, 0xD2 ; 210 |
170a: 49 a9 ldd r20, Y+49 ; 0x31 |
170c: 10 c0 rjmp .+32 ; 0x172e <_printf_P+0x474> |
170e: bb 20 and r11, r11 |
1710: 09 f4 brne .+2 ; 0x1714 <_printf_P+0x45a> |
1712: 5c c0 rjmp .+184 ; 0x17cc <_printf_P+0x512> |
1714: be 82 std Y+6, r11 ; 0x06 |
1716: 19 82 std Y+1, r1 ; 0x01 |
1718: 42 01 movw r8, r4 |
171a: 31 01 movw r6, r2 |
171c: 00 e0 ldi r16, 0x00 ; 0 |
171e: 96 e0 ldi r25, 0x06 ; 6 |
1720: c9 2e mov r12, r25 |
1722: d1 2c mov r13, r1 |
1724: cc 0e add r12, r28 |
1726: dd 1e adc r13, r29 |
1728: 11 e0 ldi r17, 0x01 ; 1 |
172a: 21 e0 ldi r18, 0x01 ; 1 |
172c: 05 c0 rjmp .+10 ; 0x1738 <_printf_P+0x47e> |
172e: 21 2f mov r18, r17 |
1730: 04 2f mov r16, r20 |
1732: 01 1b sub r16, r17 |
1734: 07 fd sbrc r16, 7 |
1736: 00 e0 ldi r16, 0x00 ; 0 |
1738: 89 81 ldd r24, Y+1 ; 0x01 |
173a: 88 23 and r24, r24 |
173c: 19 f0 breq .+6 ; 0x1744 <_printf_P+0x48a> |
173e: 81 2f mov r24, r17 |
1740: 8f 5f subi r24, 0xFF ; 255 |
1742: 07 c0 rjmp .+14 ; 0x1752 <_printf_P+0x498> |
1744: 9b a9 ldd r25, Y+51 ; 0x33 |
1746: 96 fd sbrc r25, 6 |
1748: 02 c0 rjmp .+4 ; 0x174e <_printf_P+0x494> |
174a: 81 2f mov r24, r17 |
174c: 02 c0 rjmp .+4 ; 0x1752 <_printf_P+0x498> |
174e: 82 2f mov r24, r18 |
1750: 8e 5f subi r24, 0xFE ; 254 |
1752: a8 2e mov r10, r24 |
1754: a0 0e add r10, r16 |
1756: eb a9 ldd r30, Y+51 ; 0x33 |
1758: ee 2e mov r14, r30 |
175a: ff 24 eor r15, r15 |
175c: 80 e3 ldi r24, 0x30 ; 48 |
175e: 48 2e mov r4, r24 |
1760: 51 2c mov r5, r1 |
1762: 4e 20 and r4, r14 |
1764: 5f 20 and r5, r15 |
1766: 41 14 cp r4, r1 |
1768: 51 04 cpc r5, r1 |
176a: 21 f4 brne .+8 ; 0x1774 <_printf_P+0x4ba> |
176c: 8a a9 ldd r24, Y+50 ; 0x32 |
176e: 8a 19 sub r24, r10 |
1770: 0e 94 28 09 call 0x1250 ; 0x1250 <PAD_SP> |
1774: 89 81 ldd r24, Y+1 ; 0x01 |
1776: 88 23 and r24, r24 |
1778: 29 f0 breq .+10 ; 0x1784 <_printf_P+0x4ca> |
177a: 61 e0 ldi r22, 0x01 ; 1 |
177c: 70 e0 ldi r23, 0x00 ; 0 |
177e: ce 01 movw r24, r28 |
1780: 01 96 adiw r24, 0x01 ; 1 |
1782: 09 c0 rjmp .+18 ; 0x1796 <_printf_P+0x4dc> |
1784: e6 fe sbrs r14, 6 |
1786: 09 c0 rjmp .+18 ; 0x179a <_printf_P+0x4e0> |
1788: 80 e3 ldi r24, 0x30 ; 48 |
178a: 8a 83 std Y+2, r24 ; 0x02 |
178c: bb 82 std Y+3, r11 ; 0x03 |
178e: 62 e0 ldi r22, 0x02 ; 2 |
1790: 70 e0 ldi r23, 0x00 ; 0 |
1792: ce 01 movw r24, r28 |
1794: 02 96 adiw r24, 0x02 ; 2 |
1796: 0e 94 49 09 call 0x1292 ; 0x1292 <PRINT> |
179a: f0 e2 ldi r31, 0x20 ; 32 |
179c: 4f 16 cp r4, r31 |
179e: 51 04 cpc r5, r1 |
17a0: 21 f4 brne .+8 ; 0x17aa <_printf_P+0x4f0> |
17a2: 8a a9 ldd r24, Y+50 ; 0x32 |
17a4: 8a 19 sub r24, r10 |
17a6: 0e 94 1d 09 call 0x123a ; 0x123a <PAD_0> |
17aa: 80 2f mov r24, r16 |
17ac: 0e 94 1d 09 call 0x123a ; 0x123a <PAD_0> |
17b0: 61 2f mov r22, r17 |
17b2: 77 27 eor r23, r23 |
17b4: 67 fd sbrc r22, 7 |
17b6: 70 95 com r23 |
17b8: c6 01 movw r24, r12 |
17ba: 0e 94 49 09 call 0x1292 ; 0x1292 <PRINT> |
17be: e4 fe sbrs r14, 4 |
17c0: aa cd rjmp .-1196 ; 0x1316 <_printf_P+0x5c> |
17c2: 8a a9 ldd r24, Y+50 ; 0x32 |
17c4: 8a 19 sub r24, r10 |
17c6: 0e 94 28 09 call 0x1250 ; 0x1250 <PAD_SP> |
17ca: a5 cd rjmp .-1206 ; 0x1316 <_printf_P+0x5c> |
17cc: e3 96 adiw r28, 0x33 ; 51 |
17ce: 0f b6 in r0, 0x3f ; 63 |
17d0: f8 94 cli |
17d2: de bf out 0x3e, r29 ; 62 |
17d4: 0f be out 0x3f, r0 ; 63 |
17d6: cd bf out 0x3d, r28 ; 61 |
17d8: df 91 pop r29 |
17da: cf 91 pop r28 |
17dc: 1f 91 pop r17 |
17de: 0f 91 pop r16 |
17e0: ff 90 pop r15 |
17e2: ef 90 pop r14 |
17e4: df 90 pop r13 |
17e6: cf 90 pop r12 |
17e8: bf 90 pop r11 |
17ea: af 90 pop r10 |
17ec: 9f 90 pop r9 |
17ee: 8f 90 pop r8 |
17f0: 7f 90 pop r7 |
17f2: 6f 90 pop r6 |
17f4: 5f 90 pop r5 |
17f6: 4f 90 pop r4 |
17f8: 3f 90 pop r3 |
17fa: 2f 90 pop r2 |
17fc: 08 95 ret |
000017fe <__vector_18>: |
17fe: 1f 92 push r1 |
1800: 0f 92 push r0 |
1802: 0f b6 in r0, 0x3f ; 63 |
1804: 0f 92 push r0 |
1806: 11 24 eor r1, r1 |
1808: 2f 93 push r18 |
180a: 3f 93 push r19 |
180c: 5f 93 push r21 |
180e: 6f 93 push r22 |
1810: 7f 93 push r23 |
1812: 8f 93 push r24 |
1814: 9f 93 push r25 |
1816: af 93 push r26 |
1818: bf 93 push r27 |
181a: 80 91 4b 08 lds r24, 0x084B |
181e: 81 50 subi r24, 0x01 ; 1 |
1820: 80 93 4b 08 sts 0x084B, r24 |
1824: 8f 3f cpi r24, 0xFF ; 255 |
1826: 01 f5 brne .+64 ; 0x1868 <__vector_18+0x6a> |
1828: 89 e0 ldi r24, 0x09 ; 9 |
182a: 80 93 4b 08 sts 0x084B, r24 |
182e: 80 91 03 01 lds r24, 0x0103 |
1832: 8f 5f subi r24, 0xFF ; 255 |
1834: 81 70 andi r24, 0x01 ; 1 |
1836: 80 93 03 01 sts 0x0103, r24 |
183a: 88 23 and r24, r24 |
183c: 19 f4 brne .+6 ; 0x1844 <__vector_18+0x46> |
183e: 81 e0 ldi r24, 0x01 ; 1 |
1840: 80 93 44 08 sts 0x0844, r24 |
1844: 80 91 42 08 lds r24, 0x0842 |
1848: 90 91 43 08 lds r25, 0x0843 |
184c: 01 96 adiw r24, 0x01 ; 1 |
184e: 90 93 43 08 sts 0x0843, r25 |
1852: 80 93 42 08 sts 0x0842, r24 |
1856: 80 91 72 08 lds r24, 0x0872 |
185a: 88 23 and r24, r24 |
185c: 29 f0 breq .+10 ; 0x1868 <__vector_18+0x6a> |
185e: 80 91 72 08 lds r24, 0x0872 |
1862: 81 50 subi r24, 0x01 ; 1 |
1864: 80 93 72 08 sts 0x0872, r24 |
1868: 80 91 47 08 lds r24, 0x0847 |
186c: 90 91 48 08 lds r25, 0x0848 |
1870: 02 97 sbiw r24, 0x02 ; 2 |
1872: 58 f0 brcs .+22 ; 0x188a <__vector_18+0x8c> |
1874: 80 91 47 08 lds r24, 0x0847 |
1878: 90 91 48 08 lds r25, 0x0848 |
187c: 01 97 sbiw r24, 0x01 ; 1 |
187e: 90 93 48 08 sts 0x0848, r25 |
1882: 80 93 47 08 sts 0x0847, r24 |
1886: 5a 9a sbi 0x0b, 2 ; 11 |
1888: 01 c0 rjmp .+2 ; 0x188c <__vector_18+0x8e> |
188a: 5a 98 cbi 0x0b, 2 ; 11 |
188c: 80 91 98 0c lds r24, 0x0C98 |
1890: 99 27 eor r25, r25 |
1892: 83 fd sbrc r24, 3 |
1894: 02 c0 rjmp .+4 ; 0x189a <__vector_18+0x9c> |
1896: 85 ff sbrs r24, 5 |
1898: 3b c0 rjmp .+118 ; 0x1910 <__vector_18+0x112> |
189a: 34 9b sbis 0x06, 4 ; 6 |
189c: 0a c0 rjmp .+20 ; 0x18b2 <__vector_18+0xb4> |
189e: 80 91 45 08 lds r24, 0x0845 |
18a2: 90 91 46 08 lds r25, 0x0846 |
18a6: 01 96 adiw r24, 0x01 ; 1 |
18a8: 90 93 46 08 sts 0x0846, r25 |
18ac: 80 93 45 08 sts 0x0845, r24 |
18b0: 2f c0 rjmp .+94 ; 0x1910 <__vector_18+0x112> |
18b2: 80 91 45 08 lds r24, 0x0845 |
18b6: 90 91 46 08 lds r25, 0x0846 |
18ba: 89 2b or r24, r25 |
18bc: 79 f0 breq .+30 ; 0x18dc <__vector_18+0xde> |
18be: 80 91 45 08 lds r24, 0x0845 |
18c2: 90 91 46 08 lds r25, 0x0846 |
18c6: 80 5a subi r24, 0xA0 ; 160 |
18c8: 9f 40 sbci r25, 0x0F ; 15 |
18ca: 40 f4 brcc .+16 ; 0x18dc <__vector_18+0xde> |
18cc: 80 91 45 08 lds r24, 0x0845 |
18d0: 90 91 46 08 lds r25, 0x0846 |
18d4: 90 93 b4 08 sts 0x08B4, r25 |
18d8: 80 93 b3 08 sts 0x08B3, r24 |
18dc: 80 91 b3 08 lds r24, 0x08B3 |
18e0: 90 91 b4 08 lds r25, 0x08B4 |
18e4: 20 91 b5 08 lds r18, 0x08B5 |
18e8: 30 91 b6 08 lds r19, 0x08B6 |
18ec: 82 1b sub r24, r18 |
18ee: 93 0b sbc r25, r19 |
18f0: 84 5e subi r24, 0xE4 ; 228 |
18f2: 9d 4f sbci r25, 0xFD ; 253 |
18f4: 68 e6 ldi r22, 0x68 ; 104 |
18f6: 71 e0 ldi r23, 0x01 ; 1 |
18f8: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
18fc: 84 5b subi r24, 0xB4 ; 180 |
18fe: 90 40 sbci r25, 0x00 ; 0 |
1900: 90 93 b8 08 sts 0x08B8, r25 |
1904: 80 93 b7 08 sts 0x08B7, r24 |
1908: 10 92 46 08 sts 0x0846, r1 |
190c: 10 92 45 08 sts 0x0845, r1 |
1910: bf 91 pop r27 |
1912: af 91 pop r26 |
1914: 9f 91 pop r25 |
1916: 8f 91 pop r24 |
1918: 7f 91 pop r23 |
191a: 6f 91 pop r22 |
191c: 5f 91 pop r21 |
191e: 3f 91 pop r19 |
1920: 2f 91 pop r18 |
1922: 0f 90 pop r0 |
1924: 0f be out 0x3f, r0 ; 63 |
1926: 0f 90 pop r0 |
1928: 1f 90 pop r1 |
192a: 18 95 reti |
0000192c <SetDelay>: |
192c: 20 91 42 08 lds r18, 0x0842 |
1930: 30 91 43 08 lds r19, 0x0843 |
1934: 2f 5f subi r18, 0xFF ; 255 |
1936: 3f 4f sbci r19, 0xFF ; 255 |
1938: 82 0f add r24, r18 |
193a: 93 1f adc r25, r19 |
193c: 08 95 ret |
0000193e <CheckDelay>: |
193e: 20 91 42 08 lds r18, 0x0842 |
1942: 30 91 43 08 lds r19, 0x0843 |
1946: 82 1b sub r24, r18 |
1948: 93 0b sbc r25, r19 |
194a: 89 2f mov r24, r25 |
194c: 99 27 eor r25, r25 |
194e: 86 95 lsr r24 |
1950: 80 74 andi r24, 0x40 ; 64 |
1952: 99 27 eor r25, r25 |
1954: 08 95 ret |
00001956 <__vector_9>: |
1956: 1f 92 push r1 |
1958: 0f 92 push r0 |
195a: 0f b6 in r0, 0x3f ; 63 |
195c: 0f 92 push r0 |
195e: 11 24 eor r1, r1 |
1960: ef 92 push r14 |
1962: ff 92 push r15 |
1964: 0f 93 push r16 |
1966: 1f 93 push r17 |
1968: 2f 93 push r18 |
196a: 3f 93 push r19 |
196c: 4f 93 push r20 |
196e: 5f 93 push r21 |
1970: 6f 93 push r22 |
1972: 7f 93 push r23 |
1974: 8f 93 push r24 |
1976: 9f 93 push r25 |
1978: af 93 push r26 |
197a: bf 93 push r27 |
197c: cf 93 push r28 |
197e: df 93 push r29 |
1980: ef 93 push r30 |
1982: ff 93 push r31 |
1984: 80 91 02 01 lds r24, 0x0102 |
1988: 81 50 subi r24, 0x01 ; 1 |
198a: 80 93 02 01 sts 0x0102, r24 |
198e: 8f 3f cpi r24, 0xFF ; 255 |
1990: 09 f0 breq .+2 ; 0x1994 <__vector_9+0x3e> |
1992: 6d c0 rjmp .+218 ; 0x1a6e <__vector_9+0x118> |
1994: 83 e8 ldi r24, 0x83 ; 131 |
1996: 80 93 b0 00 sts 0x00B0, r24 |
199a: 80 91 89 01 lds r24, 0x0189 |
199e: c8 2f mov r28, r24 |
19a0: dd 27 eor r29, r29 |
19a2: d0 93 4a 08 sts 0x084A, r29 |
19a6: c0 93 49 08 sts 0x0849, r28 |
19aa: 80 91 b6 0c lds r24, 0x0CB6 |
19ae: e0 90 b2 0c lds r14, 0x0CB2 |
19b2: 80 ff sbrs r24, 0 |
19b4: 1e c0 rjmp .+60 ; 0x19f2 <__vector_9+0x9c> |
19b6: 60 91 83 08 lds r22, 0x0883 |
19ba: 70 91 84 08 lds r23, 0x0884 |
19be: 80 91 85 08 lds r24, 0x0885 |
19c2: 90 91 86 08 lds r25, 0x0886 |
19c6: ff 24 eor r15, r15 |
19c8: 00 27 eor r16, r16 |
19ca: 11 27 eor r17, r17 |
19cc: 20 e8 ldi r18, 0x80 ; 128 |
19ce: 30 e0 ldi r19, 0x00 ; 0 |
19d0: 40 e0 ldi r20, 0x00 ; 0 |
19d2: 50 e0 ldi r21, 0x00 ; 0 |
19d4: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
19d8: c8 01 movw r24, r16 |
19da: b7 01 movw r22, r14 |
19dc: 0e 94 78 3e call 0x7cf0 ; 0x7cf0 <__mulsi3> |
19e0: 20 e0 ldi r18, 0x00 ; 0 |
19e2: 32 e0 ldi r19, 0x02 ; 2 |
19e4: 40 e0 ldi r20, 0x00 ; 0 |
19e6: 50 e0 ldi r21, 0x00 ; 0 |
19e8: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
19ec: c2 0f add r28, r18 |
19ee: d3 1f adc r29, r19 |
19f0: 1d c0 rjmp .+58 ; 0x1a2c <__vector_9+0xd6> |
19f2: 60 91 83 08 lds r22, 0x0883 |
19f6: 70 91 84 08 lds r23, 0x0884 |
19fa: 80 91 85 08 lds r24, 0x0885 |
19fe: 90 91 86 08 lds r25, 0x0886 |
1a02: ff 24 eor r15, r15 |
1a04: 00 27 eor r16, r16 |
1a06: 11 27 eor r17, r17 |
1a08: 20 e8 ldi r18, 0x80 ; 128 |
1a0a: 30 e0 ldi r19, 0x00 ; 0 |
1a0c: 40 e0 ldi r20, 0x00 ; 0 |
1a0e: 50 e0 ldi r21, 0x00 ; 0 |
1a10: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
1a14: c8 01 movw r24, r16 |
1a16: b7 01 movw r22, r14 |
1a18: 0e 94 78 3e call 0x7cf0 ; 0x7cf0 <__mulsi3> |
1a1c: 20 e0 ldi r18, 0x00 ; 0 |
1a1e: 32 e0 ldi r19, 0x02 ; 2 |
1a20: 40 e0 ldi r20, 0x00 ; 0 |
1a22: 50 e0 ldi r21, 0x00 ; 0 |
1a24: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
1a28: c2 1b sub r28, r18 |
1a2a: d3 0b sbc r29, r19 |
1a2c: d0 93 4a 08 sts 0x084A, r29 |
1a30: c0 93 49 08 sts 0x0849, r28 |
1a34: 20 91 49 08 lds r18, 0x0849 |
1a38: 30 91 4a 08 lds r19, 0x084A |
1a3c: 80 91 b3 0c lds r24, 0x0CB3 |
1a40: 99 27 eor r25, r25 |
1a42: 28 17 cp r18, r24 |
1a44: 39 07 cpc r19, r25 |
1a46: 34 f0 brlt .+12 ; 0x1a54 <__vector_9+0xfe> |
1a48: 80 91 b4 0c lds r24, 0x0CB4 |
1a4c: 99 27 eor r25, r25 |
1a4e: 82 17 cp r24, r18 |
1a50: 93 07 cpc r25, r19 |
1a52: 24 f4 brge .+8 ; 0x1a5c <__vector_9+0x106> |
1a54: 90 93 4a 08 sts 0x084A, r25 |
1a58: 80 93 49 08 sts 0x0849, r24 |
1a5c: 80 91 49 08 lds r24, 0x0849 |
1a60: 80 93 b3 00 sts 0x00B3, r24 |
1a64: 80 91 b5 0c lds r24, 0x0CB5 |
1a68: 80 93 02 01 sts 0x0102, r24 |
1a6c: 04 c0 rjmp .+8 ; 0x1a76 <__vector_9+0x120> |
1a6e: 83 e0 ldi r24, 0x03 ; 3 |
1a70: 80 93 b0 00 sts 0x00B0, r24 |
1a74: 5f 98 cbi 0x0b, 7 ; 11 |
1a76: ff 91 pop r31 |
1a78: ef 91 pop r30 |
1a7a: df 91 pop r29 |
1a7c: cf 91 pop r28 |
1a7e: bf 91 pop r27 |
1a80: af 91 pop r26 |
1a82: 9f 91 pop r25 |
1a84: 8f 91 pop r24 |
1a86: 7f 91 pop r23 |
1a88: 6f 91 pop r22 |
1a8a: 5f 91 pop r21 |
1a8c: 4f 91 pop r20 |
1a8e: 3f 91 pop r19 |
1a90: 2f 91 pop r18 |
1a92: 1f 91 pop r17 |
1a94: 0f 91 pop r16 |
1a96: ff 90 pop r15 |
1a98: ef 90 pop r14 |
1a9a: 0f 90 pop r0 |
1a9c: 0f be out 0x3f, r0 ; 63 |
1a9e: 0f 90 pop r0 |
1aa0: 1f 90 pop r1 |
1aa2: 18 95 reti |
00001aa4 <Timer_Init>: |
1aa4: 80 91 42 08 lds r24, 0x0842 |
1aa8: 90 91 43 08 lds r25, 0x0843 |
1aac: 0b 96 adiw r24, 0x0b ; 11 |
1aae: 90 93 4d 08 sts 0x084D, r25 |
1ab2: 80 93 4c 08 sts 0x084C, r24 |
1ab6: 82 e0 ldi r24, 0x02 ; 2 |
1ab8: 85 bd out 0x25, r24 ; 37 |
1aba: 83 ea ldi r24, 0xA3 ; 163 |
1abc: 84 bd out 0x24, r24 ; 36 |
1abe: 17 bc out 0x27, r1 ; 39 |
1ac0: 88 e7 ldi r24, 0x78 ; 120 |
1ac2: 88 bd out 0x28, r24 ; 40 |
1ac4: 96 e0 ldi r25, 0x06 ; 6 |
1ac6: 96 bd out 0x26, r25 ; 38 |
1ac8: 83 ec ldi r24, 0xC3 ; 195 |
1aca: 80 93 b0 00 sts 0x00B0, r24 |
1ace: 90 93 b1 00 sts 0x00B1, r25 |
1ad2: e0 e7 ldi r30, 0x70 ; 112 |
1ad4: f0 e0 ldi r31, 0x00 ; 0 |
1ad6: 80 81 ld r24, Z |
1ad8: 82 60 ori r24, 0x02 ; 2 |
1ada: 80 83 st Z, r24 |
1adc: ee e6 ldi r30, 0x6E ; 110 |
1ade: f0 e0 ldi r31, 0x00 ; 0 |
1ae0: 80 81 ld r24, Z |
1ae2: 81 60 ori r24, 0x01 ; 1 |
1ae4: 80 83 st Z, r24 |
1ae6: 8a e0 ldi r24, 0x0A ; 10 |
1ae8: 80 93 b3 00 sts 0x00B3, r24 |
1aec: 10 92 b2 00 sts 0x00B2, r1 |
1af0: 08 95 ret |
00001af2 <Delay_ms>: |
1af2: 20 91 42 08 lds r18, 0x0842 |
1af6: 30 91 43 08 lds r19, 0x0843 |
1afa: 2f 5f subi r18, 0xFF ; 255 |
1afc: 3f 4f sbci r19, 0xFF ; 255 |
1afe: 28 0f add r18, r24 |
1b00: 39 1f adc r19, r25 |
1b02: 80 91 42 08 lds r24, 0x0842 |
1b06: 90 91 43 08 lds r25, 0x0843 |
1b0a: a9 01 movw r20, r18 |
1b0c: 48 1b sub r20, r24 |
1b0e: 59 0b sbc r21, r25 |
1b10: 57 ff sbrs r21, 7 |
1b12: f7 cf rjmp .-18 ; 0x1b02 <Delay_ms+0x10> |
1b14: 08 95 ret |
00001b16 <ADC_Init>: |
1b16: 10 92 7c 00 sts 0x007C, r1 |
1b1a: 8f ee ldi r24, 0xEF ; 239 |
1b1c: 80 93 7a 00 sts 0x007A, r24 |
1b20: 08 95 ret |
00001b22 <__vector_24>: |
1b22: 1f 92 push r1 |
1b24: 0f 92 push r0 |
1b26: 0f b6 in r0, 0x3f ; 63 |
1b28: 0f 92 push r0 |
1b2a: 11 24 eor r1, r1 |
1b2c: ef 92 push r14 |
1b2e: ff 92 push r15 |
1b30: 0f 93 push r16 |
1b32: 1f 93 push r17 |
1b34: 2f 93 push r18 |
1b36: 3f 93 push r19 |
1b38: 4f 93 push r20 |
1b3a: 5f 93 push r21 |
1b3c: 6f 93 push r22 |
1b3e: 7f 93 push r23 |
1b40: 8f 93 push r24 |
1b42: 9f 93 push r25 |
1b44: af 93 push r26 |
1b46: bf 93 push r27 |
1b48: cf 93 push r28 |
1b4a: df 93 push r29 |
1b4c: ef 93 push r30 |
1b4e: ff 93 push r31 |
1b50: 10 92 7a 00 sts 0x007A, r1 |
1b54: 40 91 64 08 lds r20, 0x0864 |
1b58: 4f 5f subi r20, 0xFF ; 255 |
1b5a: 40 93 64 08 sts 0x0864, r20 |
1b5e: 41 50 subi r20, 0x01 ; 1 |
1b60: 43 30 cpi r20, 0x03 ; 3 |
1b62: 09 f4 brne .+2 ; 0x1b66 <__vector_24+0x44> |
1b64: 1c c1 rjmp .+568 ; 0x1d9e <__vector_24+0x27c> |
1b66: 44 30 cpi r20, 0x04 ; 4 |
1b68: 38 f4 brcc .+14 ; 0x1b78 <__vector_24+0x56> |
1b6a: 41 30 cpi r20, 0x01 ; 1 |
1b6c: 09 f4 brne .+2 ; 0x1b70 <__vector_24+0x4e> |
1b6e: 63 c0 rjmp .+198 ; 0x1c36 <__vector_24+0x114> |
1b70: 42 30 cpi r20, 0x02 ; 2 |
1b72: 08 f0 brcs .+2 ; 0x1b76 <__vector_24+0x54> |
1b74: b9 c0 rjmp .+370 ; 0x1ce8 <__vector_24+0x1c6> |
1b76: 0d c0 rjmp .+26 ; 0x1b92 <__vector_24+0x70> |
1b78: 45 30 cpi r20, 0x05 ; 5 |
1b7a: 09 f4 brne .+2 ; 0x1b7e <__vector_24+0x5c> |
1b7c: 50 c1 rjmp .+672 ; 0x1e1e <__vector_24+0x2fc> |
1b7e: 45 30 cpi r20, 0x05 ; 5 |
1b80: 08 f4 brcc .+2 ; 0x1b84 <__vector_24+0x62> |
1b82: 2a c1 rjmp .+596 ; 0x1dd8 <__vector_24+0x2b6> |
1b84: 46 30 cpi r20, 0x06 ; 6 |
1b86: 09 f4 brne .+2 ; 0x1b8a <__vector_24+0x68> |
1b88: 6f c1 rjmp .+734 ; 0x1e68 <__vector_24+0x346> |
1b8a: 47 30 cpi r20, 0x07 ; 7 |
1b8c: 09 f0 breq .+2 ; 0x1b90 <__vector_24+0x6e> |
1b8e: cb c2 rjmp .+1430 ; 0x2126 <__vector_24+0x604> |
1b90: 52 c2 rjmp .+1188 ; 0x2036 <__vector_24+0x514> |
1b92: 20 91 77 08 lds r18, 0x0877 |
1b96: 30 91 78 08 lds r19, 0x0878 |
1b9a: 80 91 78 00 lds r24, 0x0078 |
1b9e: 90 91 79 00 lds r25, 0x0079 |
1ba2: 28 1b sub r18, r24 |
1ba4: 39 0b sbc r19, r25 |
1ba6: 80 91 52 08 lds r24, 0x0852 |
1baa: 90 91 53 08 lds r25, 0x0853 |
1bae: 82 0f add r24, r18 |
1bb0: 93 1f adc r25, r19 |
1bb2: 90 93 53 08 sts 0x0853, r25 |
1bb6: 80 93 52 08 sts 0x0852, r24 |
1bba: 80 91 5c 08 lds r24, 0x085C |
1bbe: 8f 5f subi r24, 0xFF ; 255 |
1bc0: 80 93 5c 08 sts 0x085C, r24 |
1bc4: 80 91 a7 08 lds r24, 0x08A7 |
1bc8: 90 91 a8 08 lds r25, 0x08A8 |
1bcc: a0 91 a9 08 lds r26, 0x08A9 |
1bd0: b0 91 aa 08 lds r27, 0x08AA |
1bd4: 44 27 eor r20, r20 |
1bd6: 37 fd sbrc r19, 7 |
1bd8: 40 95 com r20 |
1bda: 54 2f mov r21, r20 |
1bdc: 82 0f add r24, r18 |
1bde: 93 1f adc r25, r19 |
1be0: a4 1f adc r26, r20 |
1be2: b5 1f adc r27, r21 |
1be4: 80 93 a7 08 sts 0x08A7, r24 |
1be8: 90 93 a8 08 sts 0x08A8, r25 |
1bec: a0 93 a9 08 sts 0x08A9, r26 |
1bf0: b0 93 aa 08 sts 0x08AA, r27 |
1bf4: 80 91 ab 08 lds r24, 0x08AB |
1bf8: 90 91 ac 08 lds r25, 0x08AC |
1bfc: a0 91 ad 08 lds r26, 0x08AD |
1c00: b0 91 ae 08 lds r27, 0x08AE |
1c04: 82 0f add r24, r18 |
1c06: 93 1f adc r25, r19 |
1c08: a4 1f adc r26, r20 |
1c0a: b5 1f adc r27, r21 |
1c0c: 80 93 ab 08 sts 0x08AB, r24 |
1c10: 90 93 ac 08 sts 0x08AC, r25 |
1c14: a0 93 ad 08 sts 0x08AD, r26 |
1c18: b0 93 ae 08 sts 0x08AE, r27 |
1c1c: 81 e0 ldi r24, 0x01 ; 1 |
1c1e: 80 93 65 08 sts 0x0865, r24 |
1c22: 80 91 62 08 lds r24, 0x0862 |
1c26: 90 91 63 08 lds r25, 0x0863 |
1c2a: 01 96 adiw r24, 0x01 ; 1 |
1c2c: 90 93 63 08 sts 0x0863, r25 |
1c30: 80 93 62 08 sts 0x0862, r24 |
1c34: 7c c2 rjmp .+1272 ; 0x212e <__vector_24+0x60c> |
1c36: 60 91 78 00 lds r22, 0x0078 |
1c3a: 70 91 79 00 lds r23, 0x0079 |
1c3e: 80 91 75 08 lds r24, 0x0875 |
1c42: 90 91 76 08 lds r25, 0x0876 |
1c46: 68 1b sub r22, r24 |
1c48: 79 0b sbc r23, r25 |
1c4a: 80 91 9f 08 lds r24, 0x089F |
1c4e: 90 91 a0 08 lds r25, 0x08A0 |
1c52: a0 91 a1 08 lds r26, 0x08A1 |
1c56: b0 91 a2 08 lds r27, 0x08A2 |
1c5a: 9b 01 movw r18, r22 |
1c5c: 44 27 eor r20, r20 |
1c5e: 37 fd sbrc r19, 7 |
1c60: 40 95 com r20 |
1c62: 54 2f mov r21, r20 |
1c64: 82 0f add r24, r18 |
1c66: 93 1f adc r25, r19 |
1c68: a4 1f adc r26, r20 |
1c6a: b5 1f adc r27, r21 |
1c6c: 80 93 9f 08 sts 0x089F, r24 |
1c70: 90 93 a0 08 sts 0x08A0, r25 |
1c74: a0 93 a1 08 sts 0x08A1, r26 |
1c78: b0 93 a2 08 sts 0x08A2, r27 |
1c7c: 80 91 a3 08 lds r24, 0x08A3 |
1c80: 90 91 a4 08 lds r25, 0x08A4 |
1c84: a0 91 a5 08 lds r26, 0x08A5 |
1c88: b0 91 a6 08 lds r27, 0x08A6 |
1c8c: 82 0f add r24, r18 |
1c8e: 93 1f adc r25, r19 |
1c90: a4 1f adc r26, r20 |
1c92: b5 1f adc r27, r21 |
1c94: 80 93 a3 08 sts 0x08A3, r24 |
1c98: 90 93 a4 08 sts 0x08A4, r25 |
1c9c: a0 93 a5 08 sts 0x08A5, r26 |
1ca0: b0 93 a6 08 sts 0x08A6, r27 |
1ca4: 80 91 78 00 lds r24, 0x0078 |
1ca8: 90 91 79 00 lds r25, 0x0079 |
1cac: 0a 97 sbiw r24, 0x0a ; 10 |
1cae: 10 f4 brcc .+4 ; 0x1cb4 <__vector_24+0x192> |
1cb0: 64 e4 ldi r22, 0x44 ; 68 |
1cb2: 7d ef ldi r23, 0xFD ; 253 |
1cb4: 80 91 78 00 lds r24, 0x0078 |
1cb8: 90 91 79 00 lds r25, 0x0079 |
1cbc: 89 5e subi r24, 0xE9 ; 233 |
1cbe: 93 40 sbci r25, 0x03 ; 3 |
1cc0: 10 f0 brcs .+4 ; 0x1cc6 <__vector_24+0x1a4> |
1cc2: 6c eb ldi r22, 0xBC ; 188 |
1cc4: 72 e0 ldi r23, 0x02 ; 2 |
1cc6: 80 91 50 08 lds r24, 0x0850 |
1cca: 90 91 51 08 lds r25, 0x0851 |
1cce: 86 0f add r24, r22 |
1cd0: 97 1f adc r25, r23 |
1cd2: 90 93 51 08 sts 0x0851, r25 |
1cd6: 80 93 50 08 sts 0x0850, r24 |
1cda: 80 91 5b 08 lds r24, 0x085B |
1cde: 8f 5f subi r24, 0xFF ; 255 |
1ce0: 80 93 5b 08 sts 0x085B, r24 |
1ce4: 82 e0 ldi r24, 0x02 ; 2 |
1ce6: 58 c0 rjmp .+176 ; 0x1d98 <__vector_24+0x276> |
1ce8: 60 91 78 00 lds r22, 0x0078 |
1cec: 70 91 79 00 lds r23, 0x0079 |
1cf0: 80 91 73 08 lds r24, 0x0873 |
1cf4: 90 91 74 08 lds r25, 0x0874 |
1cf8: 68 1b sub r22, r24 |
1cfa: 79 0b sbc r23, r25 |
1cfc: 80 91 97 08 lds r24, 0x0897 |
1d00: 90 91 98 08 lds r25, 0x0898 |
1d04: a0 91 99 08 lds r26, 0x0899 |
1d08: b0 91 9a 08 lds r27, 0x089A |
1d0c: 9b 01 movw r18, r22 |
1d0e: 44 27 eor r20, r20 |
1d10: 37 fd sbrc r19, 7 |
1d12: 40 95 com r20 |
1d14: 54 2f mov r21, r20 |
1d16: 82 0f add r24, r18 |
1d18: 93 1f adc r25, r19 |
1d1a: a4 1f adc r26, r20 |
1d1c: b5 1f adc r27, r21 |
1d1e: 80 93 97 08 sts 0x0897, r24 |
1d22: 90 93 98 08 sts 0x0898, r25 |
1d26: a0 93 99 08 sts 0x0899, r26 |
1d2a: b0 93 9a 08 sts 0x089A, r27 |
1d2e: 80 91 9b 08 lds r24, 0x089B |
1d32: 90 91 9c 08 lds r25, 0x089C |
1d36: a0 91 9d 08 lds r26, 0x089D |
1d3a: b0 91 9e 08 lds r27, 0x089E |
1d3e: 82 0f add r24, r18 |
1d40: 93 1f adc r25, r19 |
1d42: a4 1f adc r26, r20 |
1d44: b5 1f adc r27, r21 |
1d46: 80 93 9b 08 sts 0x089B, r24 |
1d4a: 90 93 9c 08 sts 0x089C, r25 |
1d4e: a0 93 9d 08 sts 0x089D, r26 |
1d52: b0 93 9e 08 sts 0x089E, r27 |
1d56: 80 91 78 00 lds r24, 0x0078 |
1d5a: 90 91 79 00 lds r25, 0x0079 |
1d5e: 0a 97 sbiw r24, 0x0a ; 10 |
1d60: 10 f4 brcc .+4 ; 0x1d66 <__vector_24+0x244> |
1d62: 64 e4 ldi r22, 0x44 ; 68 |
1d64: 7d ef ldi r23, 0xFD ; 253 |
1d66: 80 91 78 00 lds r24, 0x0078 |
1d6a: 90 91 79 00 lds r25, 0x0079 |
1d6e: 89 5e subi r24, 0xE9 ; 233 |
1d70: 93 40 sbci r25, 0x03 ; 3 |
1d72: 10 f0 brcs .+4 ; 0x1d78 <__vector_24+0x256> |
1d74: 6c eb ldi r22, 0xBC ; 188 |
1d76: 72 e0 ldi r23, 0x02 ; 2 |
1d78: 80 91 4e 08 lds r24, 0x084E |
1d7c: 90 91 4f 08 lds r25, 0x084F |
1d80: 86 0f add r24, r22 |
1d82: 97 1f adc r25, r23 |
1d84: 90 93 4f 08 sts 0x084F, r25 |
1d88: 80 93 4e 08 sts 0x084E, r24 |
1d8c: 80 91 5a 08 lds r24, 0x085A |
1d90: 8f 5f subi r24, 0xFF ; 255 |
1d92: 80 93 5a 08 sts 0x085A, r24 |
1d96: 84 e0 ldi r24, 0x04 ; 4 |
1d98: 80 93 65 08 sts 0x0865, r24 |
1d9c: c8 c1 rjmp .+912 ; 0x212e <__vector_24+0x60c> |
1d9e: 40 91 04 01 lds r20, 0x0104 |
1da2: 50 91 05 01 lds r21, 0x0105 |
1da6: 80 91 78 00 lds r24, 0x0078 |
1daa: 90 91 79 00 lds r25, 0x0079 |
1dae: 9a 01 movw r18, r20 |
1db0: 22 0f add r18, r18 |
1db2: 33 1f adc r19, r19 |
1db4: 24 0f add r18, r20 |
1db6: 35 1f adc r19, r21 |
1db8: 63 e0 ldi r22, 0x03 ; 3 |
1dba: 70 e0 ldi r23, 0x00 ; 0 |
1dbc: 0e 94 97 3e call 0x7d2e ; 0x7d2e <__udivmodhi4> |
1dc0: 26 0f add r18, r22 |
1dc2: 37 1f adc r19, r23 |
1dc4: 36 95 lsr r19 |
1dc6: 27 95 ror r18 |
1dc8: 36 95 lsr r19 |
1dca: 27 95 ror r18 |
1dcc: 30 93 05 01 sts 0x0105, r19 |
1dd0: 20 93 04 01 sts 0x0104, r18 |
1dd4: 86 e0 ldi r24, 0x06 ; 6 |
1dd6: e0 cf rjmp .-64 ; 0x1d98 <__vector_24+0x276> |
1dd8: 80 91 7b 08 lds r24, 0x087B |
1ddc: 90 91 7c 08 lds r25, 0x087C |
1de0: 20 91 78 00 lds r18, 0x0078 |
1de4: 30 91 79 00 lds r19, 0x0079 |
1de8: 82 1b sub r24, r18 |
1dea: 93 0b sbc r25, r19 |
1dec: 90 93 3b 0c sts 0x0C3B, r25 |
1df0: 80 93 3a 0c sts 0x0C3A, r24 |
1df4: 80 91 54 08 lds r24, 0x0854 |
1df8: 90 91 55 08 lds r25, 0x0855 |
1dfc: 20 91 3a 0c lds r18, 0x0C3A |
1e00: 30 91 3b 0c lds r19, 0x0C3B |
1e04: 82 0f add r24, r18 |
1e06: 93 1f adc r25, r19 |
1e08: 90 93 55 08 sts 0x0855, r25 |
1e0c: 80 93 54 08 sts 0x0854, r24 |
1e10: 80 91 5e 08 lds r24, 0x085E |
1e14: 8f 5f subi r24, 0xFF ; 255 |
1e16: 80 93 5e 08 sts 0x085E, r24 |
1e1a: 87 e0 ldi r24, 0x07 ; 7 |
1e1c: bd cf rjmp .-134 ; 0x1d98 <__vector_24+0x276> |
1e1e: 80 91 78 00 lds r24, 0x0078 |
1e22: 90 91 79 00 lds r25, 0x0079 |
1e26: 20 91 79 08 lds r18, 0x0879 |
1e2a: 30 91 7a 08 lds r19, 0x087A |
1e2e: 82 1b sub r24, r18 |
1e30: 93 0b sbc r25, r19 |
1e32: 90 93 46 0c sts 0x0C46, r25 |
1e36: 80 93 45 0c sts 0x0C45, r24 |
1e3a: 80 91 56 08 lds r24, 0x0856 |
1e3e: 90 91 57 08 lds r25, 0x0857 |
1e42: 20 91 45 0c lds r18, 0x0C45 |
1e46: 30 91 46 0c lds r19, 0x0C46 |
1e4a: 82 0f add r24, r18 |
1e4c: 93 1f adc r25, r19 |
1e4e: 90 93 57 08 sts 0x0857, r25 |
1e52: 80 93 56 08 sts 0x0856, r24 |
1e56: 80 91 5d 08 lds r24, 0x085D |
1e5a: 8f 5f subi r24, 0xFF ; 255 |
1e5c: 80 93 5d 08 sts 0x085D, r24 |
1e60: 40 93 65 08 sts 0x0865, r20 |
1e64: 86 e0 ldi r24, 0x06 ; 6 |
1e66: e4 c0 rjmp .+456 ; 0x2030 <__vector_24+0x50e> |
1e68: 60 91 78 00 lds r22, 0x0078 |
1e6c: 70 91 79 00 lds r23, 0x0079 |
1e70: e0 90 7d 08 lds r14, 0x087D |
1e74: f0 90 7e 08 lds r15, 0x087E |
1e78: 00 91 7f 08 lds r16, 0x087F |
1e7c: 10 91 80 08 lds r17, 0x0880 |
1e80: 88 27 eor r24, r24 |
1e82: 77 fd sbrc r23, 7 |
1e84: 80 95 com r24 |
1e86: 98 2f mov r25, r24 |
1e88: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
1e8c: a8 01 movw r20, r16 |
1e8e: 97 01 movw r18, r14 |
1e90: 0e 94 10 3d call 0x7a20 ; 0x7a20 <__subsf3> |
1e94: 0e 94 99 3d call 0x7b32 ; 0x7b32 <__fixsfsi> |
1e98: 70 93 59 08 sts 0x0859, r23 |
1e9c: 60 93 58 08 sts 0x0858, r22 |
1ea0: 20 91 58 08 lds r18, 0x0858 |
1ea4: 30 91 59 08 lds r19, 0x0859 |
1ea8: e0 91 3a 0c lds r30, 0x0C3A |
1eac: f0 91 3b 0c lds r31, 0x0C3B |
1eb0: 80 91 45 0c lds r24, 0x0C45 |
1eb4: 90 91 46 0c lds r25, 0x0C46 |
1eb8: 97 ff sbrs r25, 7 |
1eba: 03 c0 rjmp .+6 ; 0x1ec2 <__vector_24+0x3a0> |
1ebc: 90 95 com r25 |
1ebe: 81 95 neg r24 |
1ec0: 9f 4f sbci r25, 0xFF ; 255 |
1ec2: 64 e0 ldi r22, 0x04 ; 4 |
1ec4: 70 e0 ldi r23, 0x00 ; 0 |
1ec6: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
1eca: eb 01 movw r28, r22 |
1ecc: cf 01 movw r24, r30 |
1ece: f7 ff sbrs r31, 7 |
1ed0: 03 c0 rjmp .+6 ; 0x1ed8 <__vector_24+0x3b6> |
1ed2: 90 95 com r25 |
1ed4: 81 95 neg r24 |
1ed6: 9f 4f sbci r25, 0xFF ; 255 |
1ed8: 64 e0 ldi r22, 0x04 ; 4 |
1eda: 70 e0 ldi r23, 0x00 ; 0 |
1edc: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
1ee0: 26 0f add r18, r22 |
1ee2: 37 1f adc r19, r23 |
1ee4: 2c 0f add r18, r28 |
1ee6: 3d 1f adc r19, r29 |
1ee8: 30 93 59 08 sts 0x0859, r19 |
1eec: 20 93 58 08 sts 0x0858, r18 |
1ef0: 80 91 58 08 lds r24, 0x0858 |
1ef4: 90 91 59 08 lds r25, 0x0859 |
1ef8: 02 97 sbiw r24, 0x02 ; 2 |
1efa: 04 f1 brlt .+64 ; 0x1f3c <__vector_24+0x41a> |
1efc: 60 91 7d 08 lds r22, 0x087D |
1f00: 70 91 7e 08 lds r23, 0x087E |
1f04: 80 91 7f 08 lds r24, 0x087F |
1f08: 90 91 80 08 lds r25, 0x0880 |
1f0c: 20 e0 ldi r18, 0x00 ; 0 |
1f0e: 30 e0 ldi r19, 0x00 ; 0 |
1f10: 48 e4 ldi r20, 0x48 ; 72 |
1f12: 54 e4 ldi r21, 0x44 ; 68 |
1f14: 0e 94 c0 3d call 0x7b80 ; 0x7b80 <__eqsf2> |
1f18: 88 23 and r24, r24 |
1f1a: 0c f0 brlt .+2 ; 0x1f1e <__vector_24+0x3fc> |
1f1c: 3c c0 rjmp .+120 ; 0x1f96 <__vector_24+0x474> |
1f1e: 60 91 7d 08 lds r22, 0x087D |
1f22: 70 91 7e 08 lds r23, 0x087E |
1f26: 80 91 7f 08 lds r24, 0x087F |
1f2a: 90 91 80 08 lds r25, 0x0880 |
1f2e: 2a e0 ldi r18, 0x0A ; 10 |
1f30: 37 ed ldi r19, 0xD7 ; 215 |
1f32: 43 ea ldi r20, 0xA3 ; 163 |
1f34: 5c e3 ldi r21, 0x3C ; 60 |
1f36: 0e 94 11 3d call 0x7a22 ; 0x7a22 <__addsf3> |
1f3a: 25 c0 rjmp .+74 ; 0x1f86 <__vector_24+0x464> |
1f3c: 80 91 58 08 lds r24, 0x0858 |
1f40: 90 91 59 08 lds r25, 0x0859 |
1f44: 8f 5f subi r24, 0xFF ; 255 |
1f46: 9f 4f sbci r25, 0xFF ; 255 |
1f48: 34 f5 brge .+76 ; 0x1f96 <__vector_24+0x474> |
1f4a: 60 91 7d 08 lds r22, 0x087D |
1f4e: 70 91 7e 08 lds r23, 0x087E |
1f52: 80 91 7f 08 lds r24, 0x087F |
1f56: 90 91 80 08 lds r25, 0x0880 |
1f5a: 20 e0 ldi r18, 0x00 ; 0 |
1f5c: 30 e0 ldi r19, 0x00 ; 0 |
1f5e: 46 e1 ldi r20, 0x16 ; 22 |
1f60: 54 e4 ldi r21, 0x44 ; 68 |
1f62: 0e 94 c3 3d call 0x7b86 ; 0x7b86 <__gesf2> |
1f66: 18 16 cp r1, r24 |
1f68: b4 f4 brge .+44 ; 0x1f96 <__vector_24+0x474> |
1f6a: 60 91 7d 08 lds r22, 0x087D |
1f6e: 70 91 7e 08 lds r23, 0x087E |
1f72: 80 91 7f 08 lds r24, 0x087F |
1f76: 90 91 80 08 lds r25, 0x0880 |
1f7a: 2a e0 ldi r18, 0x0A ; 10 |
1f7c: 37 ed ldi r19, 0xD7 ; 215 |
1f7e: 43 ea ldi r20, 0xA3 ; 163 |
1f80: 5c e3 ldi r21, 0x3C ; 60 |
1f82: 0e 94 10 3d call 0x7a20 ; 0x7a20 <__subsf3> |
1f86: 60 93 7d 08 sts 0x087D, r22 |
1f8a: 70 93 7e 08 sts 0x087E, r23 |
1f8e: 80 93 7f 08 sts 0x087F, r24 |
1f92: 90 93 80 08 sts 0x0880, r25 |
1f96: 81 e0 ldi r24, 0x01 ; 1 |
1f98: 80 93 5f 08 sts 0x085F, r24 |
1f9c: 80 91 78 00 lds r24, 0x0078 |
1fa0: 90 91 79 00 lds r25, 0x0079 |
1fa4: 90 93 3d 0c sts 0x0C3D, r25 |
1fa8: 80 93 3c 0c sts 0x0C3C, r24 |
1fac: 20 91 af 08 lds r18, 0x08AF |
1fb0: 30 91 b0 08 lds r19, 0x08B0 |
1fb4: 40 91 b1 08 lds r20, 0x08B1 |
1fb8: 50 91 b2 08 lds r21, 0x08B2 |
1fbc: 80 91 58 08 lds r24, 0x0858 |
1fc0: 90 91 59 08 lds r25, 0x0859 |
1fc4: aa 27 eor r26, r26 |
1fc6: 97 fd sbrc r25, 7 |
1fc8: a0 95 com r26 |
1fca: ba 2f mov r27, r26 |
1fcc: 28 0f add r18, r24 |
1fce: 39 1f adc r19, r25 |
1fd0: 4a 1f adc r20, r26 |
1fd2: 5b 1f adc r21, r27 |
1fd4: 20 93 af 08 sts 0x08AF, r18 |
1fd8: 30 93 b0 08 sts 0x08B0, r19 |
1fdc: 40 93 b1 08 sts 0x08B1, r20 |
1fe0: 50 93 b2 08 sts 0x08B2, r21 |
1fe4: e0 90 af 08 lds r14, 0x08AF |
1fe8: f0 90 b0 08 lds r15, 0x08B0 |
1fec: 00 91 b1 08 lds r16, 0x08B1 |
1ff0: 10 91 b2 08 lds r17, 0x08B2 |
1ff4: 60 91 af 08 lds r22, 0x08AF |
1ff8: 70 91 b0 08 lds r23, 0x08B0 |
1ffc: 80 91 b1 08 lds r24, 0x08B1 |
2000: 90 91 b2 08 lds r25, 0x08B2 |
2004: 20 e0 ldi r18, 0x00 ; 0 |
2006: 34 e0 ldi r19, 0x04 ; 4 |
2008: 40 e0 ldi r20, 0x00 ; 0 |
200a: 50 e0 ldi r21, 0x00 ; 0 |
200c: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
2010: e2 1a sub r14, r18 |
2012: f3 0a sbc r15, r19 |
2014: 04 0b sbc r16, r20 |
2016: 15 0b sbc r17, r21 |
2018: e0 92 af 08 sts 0x08AF, r14 |
201c: f0 92 b0 08 sts 0x08B0, r15 |
2020: 00 93 b1 08 sts 0x08B1, r16 |
2024: 10 93 b2 08 sts 0x08B2, r17 |
2028: 83 e0 ldi r24, 0x03 ; 3 |
202a: 80 93 65 08 sts 0x0865, r24 |
202e: 87 e0 ldi r24, 0x07 ; 7 |
2030: 80 93 64 08 sts 0x0864, r24 |
2034: 7c c0 rjmp .+248 ; 0x212e <__vector_24+0x60c> |
2036: 80 91 4a 0c lds r24, 0x0C4A |
203a: 90 91 4b 0c lds r25, 0x0C4B |
203e: 20 91 78 00 lds r18, 0x0078 |
2042: 30 91 79 00 lds r19, 0x0079 |
2046: 82 0f add r24, r18 |
2048: 93 1f adc r25, r19 |
204a: 90 93 4b 0c sts 0x0C4B, r25 |
204e: 80 93 4a 0c sts 0x0C4A, r24 |
2052: 80 91 42 0c lds r24, 0x0C42 |
2056: 8f 5f subi r24, 0xFF ; 255 |
2058: 80 93 42 0c sts 0x0C42, r24 |
205c: 80 91 42 0c lds r24, 0x0C42 |
2060: 85 30 cpi r24, 0x05 ; 5 |
2062: 08 f4 brcc .+2 ; 0x2066 <__vector_24+0x544> |
2064: 60 c0 rjmp .+192 ; 0x2126 <__vector_24+0x604> |
2066: 80 91 78 00 lds r24, 0x0078 |
206a: 90 91 79 00 lds r25, 0x0079 |
206e: 90 93 0b 01 sts 0x010B, r25 |
2072: 80 93 0a 01 sts 0x010A, r24 |
2076: 10 92 42 0c sts 0x0C42, r1 |
207a: 80 91 3e 0c lds r24, 0x0C3E |
207e: 90 91 3f 0c lds r25, 0x0C3F |
2082: 20 91 4a 0c lds r18, 0x0C4A |
2086: 30 91 4b 0c lds r19, 0x0C4B |
208a: 82 1b sub r24, r18 |
208c: 93 0b sbc r25, r19 |
208e: 20 91 d7 08 lds r18, 0x08D7 |
2092: 30 91 d8 08 lds r19, 0x08D8 |
2096: 82 1b sub r24, r18 |
2098: 93 0b sbc r25, r19 |
209a: 90 93 61 08 sts 0x0861, r25 |
209e: 80 93 60 08 sts 0x0860, r24 |
20a2: 60 91 4a 0c lds r22, 0x0C4A |
20a6: 70 91 4b 0c lds r23, 0x0C4B |
20aa: e0 90 06 01 lds r14, 0x0106 |
20ae: f0 90 07 01 lds r15, 0x0107 |
20b2: 00 91 08 01 lds r16, 0x0108 |
20b6: 10 91 09 01 lds r17, 0x0109 |
20ba: 88 27 eor r24, r24 |
20bc: 77 fd sbrc r23, 7 |
20be: 80 95 com r24 |
20c0: 98 2f mov r25, r24 |
20c2: a8 01 movw r20, r16 |
20c4: 97 01 movw r18, r14 |
20c6: 22 0f add r18, r18 |
20c8: 33 1f adc r19, r19 |
20ca: 44 1f adc r20, r20 |
20cc: 55 1f adc r21, r21 |
20ce: 2e 0d add r18, r14 |
20d0: 3f 1d adc r19, r15 |
20d2: 40 1f adc r20, r16 |
20d4: 51 1f adc r21, r17 |
20d6: 62 0f add r22, r18 |
20d8: 73 1f adc r23, r19 |
20da: 84 1f adc r24, r20 |
20dc: 95 1f adc r25, r21 |
20de: 24 e0 ldi r18, 0x04 ; 4 |
20e0: 30 e0 ldi r19, 0x00 ; 0 |
20e2: 40 e0 ldi r20, 0x00 ; 0 |
20e4: 50 e0 ldi r21, 0x00 ; 0 |
20e6: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
20ea: 20 93 06 01 sts 0x0106, r18 |
20ee: 30 93 07 01 sts 0x0107, r19 |
20f2: 40 93 08 01 sts 0x0108, r20 |
20f6: 50 93 09 01 sts 0x0109, r21 |
20fa: 20 91 3e 0c lds r18, 0x0C3E |
20fe: 30 91 3f 0c lds r19, 0x0C3F |
2102: 80 91 06 01 lds r24, 0x0106 |
2106: 90 91 07 01 lds r25, 0x0107 |
210a: a0 91 08 01 lds r26, 0x0108 |
210e: b0 91 09 01 lds r27, 0x0109 |
2112: 28 1b sub r18, r24 |
2114: 39 0b sbc r19, r25 |
2116: 30 93 d8 08 sts 0x08D8, r19 |
211a: 20 93 d7 08 sts 0x08D7, r18 |
211e: 10 92 4b 0c sts 0x0C4B, r1 |
2122: 10 92 4a 0c sts 0x0C4A, r1 |
2126: 10 92 65 08 sts 0x0865, r1 |
212a: 10 92 64 08 sts 0x0864, r1 |
212e: 80 91 65 08 lds r24, 0x0865 |
2132: 80 93 7c 00 sts 0x007C, r24 |
2136: 8f ee ldi r24, 0xEF ; 239 |
2138: 80 93 7a 00 sts 0x007A, r24 |
213c: ff 91 pop r31 |
213e: ef 91 pop r30 |
2140: df 91 pop r29 |
2142: cf 91 pop r28 |
2144: bf 91 pop r27 |
2146: af 91 pop r26 |
2148: 9f 91 pop r25 |
214a: 8f 91 pop r24 |
214c: 7f 91 pop r23 |
214e: 6f 91 pop r22 |
2150: 5f 91 pop r21 |
2152: 4f 91 pop r20 |
2154: 3f 91 pop r19 |
2156: 2f 91 pop r18 |
2158: 1f 91 pop r17 |
215a: 0f 91 pop r16 |
215c: ff 90 pop r15 |
215e: ef 90 pop r14 |
2160: 0f 90 pop r0 |
2162: 0f be out 0x3f, r0 ; 63 |
2164: 0f 90 pop r0 |
2166: 1f 90 pop r1 |
2168: 18 95 reti |
0000216a <SucheLuftruckOffset>: |
216a: cf 93 push r28 |
216c: df 93 push r29 |
216e: c0 e0 ldi r28, 0x00 ; 0 |
2170: d0 e0 ldi r29, 0x00 ; 0 |
2172: c7 bd out 0x27, r28 ; 39 |
2174: 82 e3 ldi r24, 0x32 ; 50 |
2176: 90 e0 ldi r25, 0x00 ; 0 |
2178: 0e 94 79 0d call 0x1af2 ; 0x1af2 <Delay_ms> |
217c: 8b e3 ldi r24, 0x3B ; 59 |
217e: 91 e0 ldi r25, 0x01 ; 1 |
2180: 9f 93 push r25 |
2182: 8f 93 push r24 |
2184: 1f 92 push r1 |
2186: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
218a: 80 91 0a 01 lds r24, 0x010A |
218e: 90 91 0b 01 lds r25, 0x010B |
2192: 0f 90 pop r0 |
2194: 0f 90 pop r0 |
2196: 0f 90 pop r0 |
2198: 84 58 subi r24, 0x84 ; 132 |
219a: 93 40 sbci r25, 0x03 ; 3 |
219c: 20 f0 brcs .+8 ; 0x21a6 <SucheLuftruckOffset+0x3c> |
219e: 21 96 adiw r28, 0x01 ; 1 |
21a0: ca 3f cpi r28, 0xFA ; 250 |
21a2: d1 05 cpc r29, r1 |
21a4: 31 f7 brne .-52 ; 0x2172 <SucheLuftruckOffset+0x8> |
21a6: c0 93 47 0c sts 0x0C47, r28 |
21aa: 88 ec ldi r24, 0xC8 ; 200 |
21ac: 90 e0 ldi r25, 0x00 ; 0 |
21ae: 0e 94 79 0d call 0x1af2 ; 0x1af2 <Delay_ms> |
21b2: df 91 pop r29 |
21b4: cf 91 pop r28 |
21b6: 08 95 ret |
000021b8 <LcdClear>: |
21b8: e6 e1 ldi r30, 0x16 ; 22 |
21ba: f1 e0 ldi r31, 0x01 ; 1 |
21bc: 80 e2 ldi r24, 0x20 ; 32 |
21be: 81 93 st Z+, r24 |
21c0: 91 e0 ldi r25, 0x01 ; 1 |
21c2: e6 36 cpi r30, 0x66 ; 102 |
21c4: f9 07 cpc r31, r25 |
21c6: d9 f7 brne .-10 ; 0x21be <LcdClear+0x6> |
21c8: 08 95 ret |
000021ca <Menu>: |
21ca: ff 92 push r15 |
21cc: 0f 93 push r16 |
21ce: 1f 93 push r17 |
21d0: 80 91 69 08 lds r24, 0x0869 |
21d4: 28 2f mov r18, r24 |
21d6: 33 27 eor r19, r19 |
21d8: c9 01 movw r24, r18 |
21da: 81 70 andi r24, 0x01 ; 1 |
21dc: 90 70 andi r25, 0x00 ; 0 |
21de: 68 2f mov r22, r24 |
21e0: 88 23 and r24, r24 |
21e2: 91 f0 breq .+36 ; 0x2208 <Menu+0x3e> |
21e4: 80 91 6a 08 lds r24, 0x086A |
21e8: 88 23 and r24, r24 |
21ea: 11 f0 breq .+4 ; 0x21f0 <Menu+0x26> |
21ec: 81 50 subi r24, 0x01 ; 1 |
21ee: 02 c0 rjmp .+4 ; 0x21f4 <Menu+0x2a> |
21f0: 80 91 66 01 lds r24, 0x0166 |
21f4: 80 93 6a 08 sts 0x086A, r24 |
21f8: e6 e1 ldi r30, 0x16 ; 22 |
21fa: f1 e0 ldi r31, 0x01 ; 1 |
21fc: 80 e2 ldi r24, 0x20 ; 32 |
21fe: 81 93 st Z+, r24 |
2200: 91 e0 ldi r25, 0x01 ; 1 |
2202: e6 36 cpi r30, 0x66 ; 102 |
2204: f9 07 cpc r31, r25 |
2206: d9 f7 brne .-10 ; 0x21fe <Menu+0x34> |
2208: a9 01 movw r20, r18 |
220a: 42 70 andi r20, 0x02 ; 2 |
220c: 50 70 andi r21, 0x00 ; 0 |
220e: 21 ff sbrs r18, 1 |
2210: 0d c0 rjmp .+26 ; 0x222c <Menu+0x62> |
2212: 80 91 6a 08 lds r24, 0x086A |
2216: 8f 5f subi r24, 0xFF ; 255 |
2218: 80 93 6a 08 sts 0x086A, r24 |
221c: e6 e1 ldi r30, 0x16 ; 22 |
221e: f1 e0 ldi r31, 0x01 ; 1 |
2220: 80 e2 ldi r24, 0x20 ; 32 |
2222: 81 93 st Z+, r24 |
2224: 91 e0 ldi r25, 0x01 ; 1 |
2226: e6 36 cpi r30, 0x66 ; 102 |
2228: f9 07 cpc r31, r25 |
222a: d9 f7 brne .-10 ; 0x2222 <Menu+0x58> |
222c: 66 23 and r22, r22 |
222e: 21 f0 breq .+8 ; 0x2238 <Menu+0x6e> |
2230: 45 2b or r20, r21 |
2232: 11 f0 breq .+4 ; 0x2238 <Menu+0x6e> |
2234: 10 92 6a 08 sts 0x086A, r1 |
2238: 81 e1 ldi r24, 0x11 ; 17 |
223a: 80 93 68 08 sts 0x0868, r24 |
223e: 80 91 6a 08 lds r24, 0x086A |
2242: 99 27 eor r25, r25 |
2244: 9f 93 push r25 |
2246: 8f 93 push r24 |
2248: 84 ec ldi r24, 0xC4 ; 196 |
224a: 93 e0 ldi r25, 0x03 ; 3 |
224c: 9f 93 push r25 |
224e: 8f 93 push r24 |
2250: 11 e0 ldi r17, 0x01 ; 1 |
2252: f1 2e mov r15, r17 |
2254: ff 92 push r15 |
2256: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
225a: 00 91 6a 08 lds r16, 0x086A |
225e: 0f 90 pop r0 |
2260: 0f 90 pop r0 |
2262: 0f 90 pop r0 |
2264: 0f 90 pop r0 |
2266: 0f 90 pop r0 |
2268: 05 30 cpi r16, 0x05 ; 5 |
226a: 09 f4 brne .+2 ; 0x226e <Menu+0xa4> |
226c: e0 c1 rjmp .+960 ; 0x262e <Menu+0x464> |
226e: 06 30 cpi r16, 0x06 ; 6 |
2270: 90 f4 brcc .+36 ; 0x2296 <Menu+0xcc> |
2272: 02 30 cpi r16, 0x02 ; 2 |
2274: 09 f4 brne .+2 ; 0x2278 <Menu+0xae> |
2276: b8 c0 rjmp .+368 ; 0x23e8 <Menu+0x21e> |
2278: 03 30 cpi r16, 0x03 ; 3 |
227a: 30 f4 brcc .+12 ; 0x2288 <Menu+0xbe> |
227c: 00 23 and r16, r16 |
227e: f1 f0 breq .+60 ; 0x22bc <Menu+0xf2> |
2280: 01 30 cpi r16, 0x01 ; 1 |
2282: 09 f0 breq .+2 ; 0x2286 <Menu+0xbc> |
2284: 81 c3 rjmp .+1794 ; 0x2988 <Menu+0x7be> |
2286: 4d c0 rjmp .+154 ; 0x2322 <Menu+0x158> |
2288: 03 30 cpi r16, 0x03 ; 3 |
228a: 09 f4 brne .+2 ; 0x228e <Menu+0xc4> |
228c: 02 c1 rjmp .+516 ; 0x2492 <Menu+0x2c8> |
228e: 04 30 cpi r16, 0x04 ; 4 |
2290: 09 f0 breq .+2 ; 0x2294 <Menu+0xca> |
2292: 7a c3 rjmp .+1780 ; 0x2988 <Menu+0x7be> |
2294: 51 c1 rjmp .+674 ; 0x2538 <Menu+0x36e> |
2296: 08 30 cpi r16, 0x08 ; 8 |
2298: 09 f4 brne .+2 ; 0x229c <Menu+0xd2> |
229a: a1 c2 rjmp .+1346 ; 0x27de <Menu+0x614> |
229c: 09 30 cpi r16, 0x09 ; 9 |
229e: 38 f4 brcc .+14 ; 0x22ae <Menu+0xe4> |
22a0: 06 30 cpi r16, 0x06 ; 6 |
22a2: 09 f4 brne .+2 ; 0x22a6 <Menu+0xdc> |
22a4: 1a c2 rjmp .+1076 ; 0x26da <Menu+0x510> |
22a6: 07 30 cpi r16, 0x07 ; 7 |
22a8: 09 f0 breq .+2 ; 0x22ac <Menu+0xe2> |
22aa: 6e c3 rjmp .+1756 ; 0x2988 <Menu+0x7be> |
22ac: 75 c2 rjmp .+1258 ; 0x2798 <Menu+0x5ce> |
22ae: 09 30 cpi r16, 0x09 ; 9 |
22b0: 09 f4 brne .+2 ; 0x22b4 <Menu+0xea> |
22b2: d2 c2 rjmp .+1444 ; 0x2858 <Menu+0x68e> |
22b4: 0a 30 cpi r16, 0x0A ; 10 |
22b6: 09 f0 breq .+2 ; 0x22ba <Menu+0xf0> |
22b8: 67 c3 rjmp .+1742 ; 0x2988 <Menu+0x7be> |
22ba: 29 c3 rjmp .+1618 ; 0x290e <Menu+0x744> |
22bc: 10 92 68 08 sts 0x0868, r1 |
22c0: 82 eb ldi r24, 0xB2 ; 178 |
22c2: 93 e0 ldi r25, 0x03 ; 3 |
22c4: 9f 93 push r25 |
22c6: 8f 93 push r24 |
22c8: ff 92 push r15 |
22ca: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
22ce: 84 e1 ldi r24, 0x14 ; 20 |
22d0: 80 93 68 08 sts 0x0868, r24 |
22d4: 8d e3 ldi r24, 0x3D ; 61 |
22d6: 90 e0 ldi r25, 0x00 ; 0 |
22d8: 9f 93 push r25 |
22da: 8f 93 push r24 |
22dc: 1f 92 push r1 |
22de: 1f 92 push r1 |
22e0: 8b ea ldi r24, 0xAB ; 171 |
22e2: 93 e0 ldi r25, 0x03 ; 3 |
22e4: 9f 93 push r25 |
22e6: 8f 93 push r24 |
22e8: ff 92 push r15 |
22ea: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
22ee: 88 e2 ldi r24, 0x28 ; 40 |
22f0: 80 93 68 08 sts 0x0868, r24 |
22f4: 0e 94 04 02 call 0x408 ; 0x408 <GetActiveParamSetNumber> |
22f8: 99 27 eor r25, r25 |
22fa: 9f 93 push r25 |
22fc: 8f 93 push r24 |
22fe: 8e e9 ldi r24, 0x9E ; 158 |
2300: 93 e0 ldi r25, 0x03 ; 3 |
2302: 9f 93 push r25 |
2304: 8f 93 push r24 |
2306: ff 92 push r15 |
2308: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
230c: 8c e3 ldi r24, 0x3C ; 60 |
230e: 80 93 68 08 sts 0x0868, r24 |
2312: 8e e8 ldi r24, 0x8E ; 142 |
2314: 93 e0 ldi r25, 0x03 ; 3 |
2316: 9f 93 push r25 |
2318: 8f 93 push r24 |
231a: ff 92 push r15 |
231c: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
2320: 97 c2 rjmp .+1326 ; 0x2850 <Menu+0x686> |
2322: 80 91 98 0c lds r24, 0x0C98 |
2326: 80 ff sbrs r24, 0 |
2328: 47 c0 rjmp .+142 ; 0x23b8 <Menu+0x1ee> |
232a: 10 92 68 08 sts 0x0868, r1 |
232e: 80 91 d7 08 lds r24, 0x08D7 |
2332: 90 91 d8 08 lds r25, 0x08D8 |
2336: 9f 93 push r25 |
2338: 8f 93 push r24 |
233a: 8f e7 ldi r24, 0x7F ; 127 |
233c: 93 e0 ldi r25, 0x03 ; 3 |
233e: 9f 93 push r25 |
2340: 8f 93 push r24 |
2342: 0f 93 push r16 |
2344: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
2348: 84 e1 ldi r24, 0x14 ; 20 |
234a: 80 93 68 08 sts 0x0868, r24 |
234e: 80 91 d9 08 lds r24, 0x08D9 |
2352: 90 91 da 08 lds r25, 0x08DA |
2356: 9f 93 push r25 |
2358: 8f 93 push r24 |
235a: 80 e7 ldi r24, 0x70 ; 112 |
235c: 93 e0 ldi r25, 0x03 ; 3 |
235e: 9f 93 push r25 |
2360: 8f 93 push r24 |
2362: 0f 93 push r16 |
2364: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
2368: 88 e2 ldi r24, 0x28 ; 40 |
236a: 80 93 68 08 sts 0x0868, r24 |
236e: 80 91 0a 01 lds r24, 0x010A |
2372: 90 91 0b 01 lds r25, 0x010B |
2376: 9f 93 push r25 |
2378: 8f 93 push r24 |
237a: 81 e6 ldi r24, 0x61 ; 97 |
237c: 93 e0 ldi r25, 0x03 ; 3 |
237e: 9f 93 push r25 |
2380: 8f 93 push r24 |
2382: 0f 93 push r16 |
2384: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
2388: 8c e3 ldi r24, 0x3C ; 60 |
238a: 80 93 68 08 sts 0x0868, r24 |
238e: 80 91 47 0c lds r24, 0x0C47 |
2392: 99 27 eor r25, r25 |
2394: 9f 93 push r25 |
2396: 8f 93 push r24 |
2398: 82 e5 ldi r24, 0x52 ; 82 |
239a: 93 e0 ldi r25, 0x03 ; 3 |
239c: 9f 93 push r25 |
239e: 8f 93 push r24 |
23a0: 0f 93 push r16 |
23a2: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
23a6: 8d b7 in r24, 0x3d ; 61 |
23a8: 9e b7 in r25, 0x3e ; 62 |
23aa: 44 96 adiw r24, 0x14 ; 20 |
23ac: 0f b6 in r0, 0x3f ; 63 |
23ae: f8 94 cli |
23b0: 9e bf out 0x3e, r25 ; 62 |
23b2: 0f be out 0x3f, r0 ; 63 |
23b4: 8d bf out 0x3d, r24 ; 61 |
23b6: ed c2 rjmp .+1498 ; 0x2992 <Menu+0x7c8> |
23b8: 84 e1 ldi r24, 0x14 ; 20 |
23ba: 80 93 68 08 sts 0x0868, r24 |
23be: 8b e4 ldi r24, 0x4B ; 75 |
23c0: 93 e0 ldi r25, 0x03 ; 3 |
23c2: 9f 93 push r25 |
23c4: 8f 93 push r24 |
23c6: 0f 93 push r16 |
23c8: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
23cc: 88 e2 ldi r24, 0x28 ; 40 |
23ce: 80 93 68 08 sts 0x0868, r24 |
23d2: 8d e3 ldi r24, 0x3D ; 61 |
23d4: 93 e0 ldi r25, 0x03 ; 3 |
23d6: 9f 93 push r25 |
23d8: 8f 93 push r24 |
23da: 0f 93 push r16 |
23dc: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
23e0: 8d b7 in r24, 0x3d ; 61 |
23e2: 9e b7 in r25, 0x3e ; 62 |
23e4: 06 96 adiw r24, 0x06 ; 6 |
23e6: e2 cf rjmp .-60 ; 0x23ac <Menu+0x1e2> |
23e8: 10 92 68 08 sts 0x0868, r1 |
23ec: 83 e3 ldi r24, 0x33 ; 51 |
23ee: 93 e0 ldi r25, 0x03 ; 3 |
23f0: 9f 93 push r25 |
23f2: 8f 93 push r24 |
23f4: ff 92 push r15 |
23f6: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
23fa: 84 e1 ldi r24, 0x14 ; 20 |
23fc: 80 93 68 08 sts 0x0868, r24 |
2400: 60 91 83 08 lds r22, 0x0883 |
2404: 70 91 84 08 lds r23, 0x0884 |
2408: 80 91 85 08 lds r24, 0x0885 |
240c: 90 91 86 08 lds r25, 0x0886 |
2410: 20 e0 ldi r18, 0x00 ; 0 |
2412: 34 e0 ldi r19, 0x04 ; 4 |
2414: 40 e0 ldi r20, 0x00 ; 0 |
2416: 50 e0 ldi r21, 0x00 ; 0 |
2418: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
241c: 5f 93 push r21 |
241e: 4f 93 push r20 |
2420: 3f 93 push r19 |
2422: 2f 93 push r18 |
2424: 84 e2 ldi r24, 0x24 ; 36 |
2426: 93 e0 ldi r25, 0x03 ; 3 |
2428: 9f 93 push r25 |
242a: 8f 93 push r24 |
242c: ff 92 push r15 |
242e: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
2432: 88 e2 ldi r24, 0x28 ; 40 |
2434: 80 93 68 08 sts 0x0868, r24 |
2438: 60 91 8b 08 lds r22, 0x088B |
243c: 70 91 8c 08 lds r23, 0x088C |
2440: 80 91 8d 08 lds r24, 0x088D |
2444: 90 91 8e 08 lds r25, 0x088E |
2448: 20 e0 ldi r18, 0x00 ; 0 |
244a: 34 e0 ldi r19, 0x04 ; 4 |
244c: 40 e0 ldi r20, 0x00 ; 0 |
244e: 50 e0 ldi r21, 0x00 ; 0 |
2450: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
2454: 5f 93 push r21 |
2456: 4f 93 push r20 |
2458: 3f 93 push r19 |
245a: 2f 93 push r18 |
245c: 85 e1 ldi r24, 0x15 ; 21 |
245e: 93 e0 ldi r25, 0x03 ; 3 |
2460: 9f 93 push r25 |
2462: 8f 93 push r24 |
2464: ff 92 push r15 |
2466: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
246a: 8c e3 ldi r24, 0x3C ; 60 |
246c: 80 93 68 08 sts 0x0868, r24 |
2470: 80 91 b3 08 lds r24, 0x08B3 |
2474: 90 91 b4 08 lds r25, 0x08B4 |
2478: 9f 93 push r25 |
247a: 8f 93 push r24 |
247c: 86 e0 ldi r24, 0x06 ; 6 |
247e: 93 e0 ldi r25, 0x03 ; 3 |
2480: 9f 93 push r25 |
2482: 8f 93 push r24 |
2484: ff 92 push r15 |
2486: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
248a: 8d b7 in r24, 0x3d ; 61 |
248c: 9e b7 in r25, 0x3e ; 62 |
248e: 46 96 adiw r24, 0x16 ; 22 |
2490: 8d cf rjmp .-230 ; 0x23ac <Menu+0x1e2> |
2492: 10 92 68 08 sts 0x0868, r1 |
2496: 80 91 58 0c lds r24, 0x0C58 |
249a: 90 91 59 0c lds r25, 0x0C59 |
249e: 20 91 56 0c lds r18, 0x0C56 |
24a2: 30 91 57 0c lds r19, 0x0C57 |
24a6: 9f 93 push r25 |
24a8: 8f 93 push r24 |
24aa: 3f 93 push r19 |
24ac: 2f 93 push r18 |
24ae: 86 ef ldi r24, 0xF6 ; 246 |
24b0: 92 e0 ldi r25, 0x02 ; 2 |
24b2: 9f 93 push r25 |
24b4: 8f 93 push r24 |
24b6: ff 92 push r15 |
24b8: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
24bc: 84 e1 ldi r24, 0x14 ; 20 |
24be: 80 93 68 08 sts 0x0868, r24 |
24c2: 80 91 5c 0c lds r24, 0x0C5C |
24c6: 90 91 5d 0c lds r25, 0x0C5D |
24ca: 20 91 5a 0c lds r18, 0x0C5A |
24ce: 30 91 5b 0c lds r19, 0x0C5B |
24d2: 9f 93 push r25 |
24d4: 8f 93 push r24 |
24d6: 3f 93 push r19 |
24d8: 2f 93 push r18 |
24da: 86 ee ldi r24, 0xE6 ; 230 |
24dc: 92 e0 ldi r25, 0x02 ; 2 |
24de: 9f 93 push r25 |
24e0: 8f 93 push r24 |
24e2: ff 92 push r15 |
24e4: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
24e8: 88 e2 ldi r24, 0x28 ; 40 |
24ea: 80 93 68 08 sts 0x0868, r24 |
24ee: 80 91 60 0c lds r24, 0x0C60 |
24f2: 90 91 61 0c lds r25, 0x0C61 |
24f6: 20 91 5e 0c lds r18, 0x0C5E |
24fa: 30 91 5f 0c lds r19, 0x0C5F |
24fe: 9f 93 push r25 |
2500: 8f 93 push r24 |
2502: 3f 93 push r19 |
2504: 2f 93 push r18 |
2506: 86 ed ldi r24, 0xD6 ; 214 |
2508: 92 e0 ldi r25, 0x02 ; 2 |
250a: 9f 93 push r25 |
250c: 8f 93 push r24 |
250e: ff 92 push r15 |
2510: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
2514: 8c e3 ldi r24, 0x3C ; 60 |
2516: 80 93 68 08 sts 0x0868, r24 |
251a: 80 91 64 0c lds r24, 0x0C64 |
251e: 90 91 65 0c lds r25, 0x0C65 |
2522: 20 91 62 0c lds r18, 0x0C62 |
2526: 30 91 63 0c lds r19, 0x0C63 |
252a: 9f 93 push r25 |
252c: 8f 93 push r24 |
252e: 3f 93 push r19 |
2530: 2f 93 push r18 |
2532: 86 ec ldi r24, 0xC6 ; 198 |
2534: 92 e0 ldi r25, 0x02 ; 2 |
2536: e2 c1 rjmp .+964 ; 0x28fc <Menu+0x732> |
2538: 10 92 68 08 sts 0x0868, r1 |
253c: e0 91 91 0c lds r30, 0x0C91 |
2540: ff 27 eor r31, r31 |
2542: ee 0f add r30, r30 |
2544: ff 1f adc r31, r31 |
2546: ec 5a subi r30, 0xAC ; 172 |
2548: f3 4f sbci r31, 0xF3 ; 243 |
254a: 20 81 ld r18, Z |
254c: 31 81 ldd r19, Z+1 ; 0x01 |
254e: e0 91 90 0c lds r30, 0x0C90 |
2552: ff 27 eor r31, r31 |
2554: ee 0f add r30, r30 |
2556: ff 1f adc r31, r31 |
2558: ec 5a subi r30, 0xAC ; 172 |
255a: f3 4f sbci r31, 0xF3 ; 243 |
255c: 80 81 ld r24, Z |
255e: 91 81 ldd r25, Z+1 ; 0x01 |
2560: 3f 93 push r19 |
2562: 2f 93 push r18 |
2564: 9f 93 push r25 |
2566: 8f 93 push r24 |
2568: 86 eb ldi r24, 0xB6 ; 182 |
256a: 92 e0 ldi r25, 0x02 ; 2 |
256c: 9f 93 push r25 |
256e: 8f 93 push r24 |
2570: ff 92 push r15 |
2572: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
2576: 84 e1 ldi r24, 0x14 ; 20 |
2578: 80 93 68 08 sts 0x0868, r24 |
257c: e0 91 93 0c lds r30, 0x0C93 |
2580: ff 27 eor r31, r31 |
2582: ee 0f add r30, r30 |
2584: ff 1f adc r31, r31 |
2586: ec 5a subi r30, 0xAC ; 172 |
2588: f3 4f sbci r31, 0xF3 ; 243 |
258a: 20 81 ld r18, Z |
258c: 31 81 ldd r19, Z+1 ; 0x01 |
258e: e0 91 92 0c lds r30, 0x0C92 |
2592: ff 27 eor r31, r31 |
2594: ee 0f add r30, r30 |
2596: ff 1f adc r31, r31 |
2598: ec 5a subi r30, 0xAC ; 172 |
259a: f3 4f sbci r31, 0xF3 ; 243 |
259c: 80 81 ld r24, Z |
259e: 91 81 ldd r25, Z+1 ; 0x01 |
25a0: 3f 93 push r19 |
25a2: 2f 93 push r18 |
25a4: 9f 93 push r25 |
25a6: 8f 93 push r24 |
25a8: 86 ea ldi r24, 0xA6 ; 166 |
25aa: 92 e0 ldi r25, 0x02 ; 2 |
25ac: 9f 93 push r25 |
25ae: 8f 93 push r24 |
25b0: ff 92 push r15 |
25b2: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
25b6: 88 e2 ldi r24, 0x28 ; 40 |
25b8: 80 93 68 08 sts 0x0868, r24 |
25bc: e0 91 95 0c lds r30, 0x0C95 |
25c0: ff 27 eor r31, r31 |
25c2: ee 0f add r30, r30 |
25c4: ff 1f adc r31, r31 |
25c6: ec 5a subi r30, 0xAC ; 172 |
25c8: f3 4f sbci r31, 0xF3 ; 243 |
25ca: 20 81 ld r18, Z |
25cc: 31 81 ldd r19, Z+1 ; 0x01 |
25ce: e0 91 94 0c lds r30, 0x0C94 |
25d2: ff 27 eor r31, r31 |
25d4: ee 0f add r30, r30 |
25d6: ff 1f adc r31, r31 |
25d8: ec 5a subi r30, 0xAC ; 172 |
25da: f3 4f sbci r31, 0xF3 ; 243 |
25dc: 80 81 ld r24, Z |
25de: 91 81 ldd r25, Z+1 ; 0x01 |
25e0: 3f 93 push r19 |
25e2: 2f 93 push r18 |
25e4: 9f 93 push r25 |
25e6: 8f 93 push r24 |
25e8: 86 e9 ldi r24, 0x96 ; 150 |
25ea: 92 e0 ldi r25, 0x02 ; 2 |
25ec: 9f 93 push r25 |
25ee: 8f 93 push r24 |
25f0: ff 92 push r15 |
25f2: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
25f6: 8c e3 ldi r24, 0x3C ; 60 |
25f8: 80 93 68 08 sts 0x0868, r24 |
25fc: e0 91 97 0c lds r30, 0x0C97 |
2600: ff 27 eor r31, r31 |
2602: ee 0f add r30, r30 |
2604: ff 1f adc r31, r31 |
2606: ec 5a subi r30, 0xAC ; 172 |
2608: f3 4f sbci r31, 0xF3 ; 243 |
260a: 20 81 ld r18, Z |
260c: 31 81 ldd r19, Z+1 ; 0x01 |
260e: e0 91 96 0c lds r30, 0x0C96 |
2612: ff 27 eor r31, r31 |
2614: ee 0f add r30, r30 |
2616: ff 1f adc r31, r31 |
2618: ec 5a subi r30, 0xAC ; 172 |
261a: f3 4f sbci r31, 0xF3 ; 243 |
261c: 80 81 ld r24, Z |
261e: 91 81 ldd r25, Z+1 ; 0x01 |
2620: 3f 93 push r19 |
2622: 2f 93 push r18 |
2624: 9f 93 push r25 |
2626: 8f 93 push r24 |
2628: 86 e8 ldi r24, 0x86 ; 134 |
262a: 92 e0 ldi r25, 0x02 ; 2 |
262c: 67 c1 rjmp .+718 ; 0x28fc <Menu+0x732> |
262e: 10 92 68 08 sts 0x0868, r1 |
2632: 88 e7 ldi r24, 0x78 ; 120 |
2634: 92 e0 ldi r25, 0x02 ; 2 |
2636: 9f 93 push r25 |
2638: 8f 93 push r24 |
263a: ff 92 push r15 |
263c: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
2640: 84 e1 ldi r24, 0x14 ; 20 |
2642: 80 93 68 08 sts 0x0868, r24 |
2646: 20 91 73 08 lds r18, 0x0873 |
264a: 30 91 74 08 lds r19, 0x0874 |
264e: 80 91 4e 08 lds r24, 0x084E |
2652: 90 91 4f 08 lds r25, 0x084F |
2656: 60 91 5a 08 lds r22, 0x085A |
265a: 3f 93 push r19 |
265c: 2f 93 push r18 |
265e: 77 27 eor r23, r23 |
2660: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
2664: 7f 93 push r23 |
2666: 6f 93 push r22 |
2668: 89 e6 ldi r24, 0x69 ; 105 |
266a: 92 e0 ldi r25, 0x02 ; 2 |
266c: 9f 93 push r25 |
266e: 8f 93 push r24 |
2670: ff 92 push r15 |
2672: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
2676: 88 e2 ldi r24, 0x28 ; 40 |
2678: 80 93 68 08 sts 0x0868, r24 |
267c: 20 91 75 08 lds r18, 0x0875 |
2680: 30 91 76 08 lds r19, 0x0876 |
2684: 80 91 50 08 lds r24, 0x0850 |
2688: 90 91 51 08 lds r25, 0x0851 |
268c: 60 91 5b 08 lds r22, 0x085B |
2690: 3f 93 push r19 |
2692: 2f 93 push r18 |
2694: 77 27 eor r23, r23 |
2696: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
269a: 7f 93 push r23 |
269c: 6f 93 push r22 |
269e: 8a e5 ldi r24, 0x5A ; 90 |
26a0: 92 e0 ldi r25, 0x02 ; 2 |
26a2: 9f 93 push r25 |
26a4: 8f 93 push r24 |
26a6: ff 92 push r15 |
26a8: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
26ac: 8c e3 ldi r24, 0x3C ; 60 |
26ae: 80 93 68 08 sts 0x0868, r24 |
26b2: 20 91 77 08 lds r18, 0x0877 |
26b6: 30 91 78 08 lds r19, 0x0878 |
26ba: 80 91 52 08 lds r24, 0x0852 |
26be: 90 91 53 08 lds r25, 0x0853 |
26c2: 60 91 5c 08 lds r22, 0x085C |
26c6: 3f 93 push r19 |
26c8: 2f 93 push r18 |
26ca: 77 27 eor r23, r23 |
26cc: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
26d0: 7f 93 push r23 |
26d2: 6f 93 push r22 |
26d4: 8b e4 ldi r24, 0x4B ; 75 |
26d6: 92 e0 ldi r25, 0x02 ; 2 |
26d8: 56 c0 rjmp .+172 ; 0x2786 <Menu+0x5bc> |
26da: 10 92 68 08 sts 0x0868, r1 |
26de: 8e e3 ldi r24, 0x3E ; 62 |
26e0: 92 e0 ldi r25, 0x02 ; 2 |
26e2: 9f 93 push r25 |
26e4: 8f 93 push r24 |
26e6: ff 92 push r15 |
26e8: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
26ec: 84 e1 ldi r24, 0x14 ; 20 |
26ee: 80 93 68 08 sts 0x0868, r24 |
26f2: 20 91 79 08 lds r18, 0x0879 |
26f6: 30 91 7a 08 lds r19, 0x087A |
26fa: 80 91 56 08 lds r24, 0x0856 |
26fe: 90 91 57 08 lds r25, 0x0857 |
2702: 60 91 5d 08 lds r22, 0x085D |
2706: 3f 93 push r19 |
2708: 2f 93 push r18 |
270a: 77 27 eor r23, r23 |
270c: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
2710: 7f 93 push r23 |
2712: 6f 93 push r22 |
2714: 8f e2 ldi r24, 0x2F ; 47 |
2716: 92 e0 ldi r25, 0x02 ; 2 |
2718: 9f 93 push r25 |
271a: 8f 93 push r24 |
271c: ff 92 push r15 |
271e: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
2722: 88 e2 ldi r24, 0x28 ; 40 |
2724: 80 93 68 08 sts 0x0868, r24 |
2728: 20 91 7b 08 lds r18, 0x087B |
272c: 30 91 7c 08 lds r19, 0x087C |
2730: 80 91 54 08 lds r24, 0x0854 |
2734: 90 91 55 08 lds r25, 0x0855 |
2738: 60 91 5e 08 lds r22, 0x085E |
273c: 3f 93 push r19 |
273e: 2f 93 push r18 |
2740: 77 27 eor r23, r23 |
2742: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
2746: 7f 93 push r23 |
2748: 6f 93 push r22 |
274a: 80 e2 ldi r24, 0x20 ; 32 |
274c: 92 e0 ldi r25, 0x02 ; 2 |
274e: 9f 93 push r25 |
2750: 8f 93 push r24 |
2752: ff 92 push r15 |
2754: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
2758: 8c e3 ldi r24, 0x3C ; 60 |
275a: 80 93 68 08 sts 0x0868, r24 |
275e: 60 91 7d 08 lds r22, 0x087D |
2762: 70 91 7e 08 lds r23, 0x087E |
2766: 80 91 7f 08 lds r24, 0x087F |
276a: 90 91 80 08 lds r25, 0x0880 |
276e: 00 91 3c 0c lds r16, 0x0C3C |
2772: 10 91 3d 0c lds r17, 0x0C3D |
2776: 0e 94 99 3d call 0x7b32 ; 0x7b32 <__fixsfsi> |
277a: 7f 93 push r23 |
277c: 6f 93 push r22 |
277e: 1f 93 push r17 |
2780: 0f 93 push r16 |
2782: 81 e1 ldi r24, 0x11 ; 17 |
2784: 92 e0 ldi r25, 0x02 ; 2 |
2786: 9f 93 push r25 |
2788: 8f 93 push r24 |
278a: ff 92 push r15 |
278c: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
2790: 8d b7 in r24, 0x3d ; 61 |
2792: 9e b7 in r25, 0x3e ; 62 |
2794: 48 96 adiw r24, 0x18 ; 24 |
2796: 0a ce rjmp .-1004 ; 0x23ac <Menu+0x1e2> |
2798: 84 e1 ldi r24, 0x14 ; 20 |
279a: 80 93 68 08 sts 0x0868, r24 |
279e: 80 91 04 01 lds r24, 0x0104 |
27a2: 90 91 05 01 lds r25, 0x0105 |
27a6: 9f 93 push r25 |
27a8: 8f 93 push r24 |
27aa: 82 e0 ldi r24, 0x02 ; 2 |
27ac: 92 e0 ldi r25, 0x02 ; 2 |
27ae: 9f 93 push r25 |
27b0: 8f 93 push r24 |
27b2: ff 92 push r15 |
27b4: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
27b8: 88 e2 ldi r24, 0x28 ; 40 |
27ba: 80 93 68 08 sts 0x0868, r24 |
27be: 80 91 cf 08 lds r24, 0x08CF |
27c2: 99 27 eor r25, r25 |
27c4: 9f 93 push r25 |
27c6: 8f 93 push r24 |
27c8: 83 ef ldi r24, 0xF3 ; 243 |
27ca: 91 e0 ldi r25, 0x01 ; 1 |
27cc: 9f 93 push r25 |
27ce: 8f 93 push r24 |
27d0: ff 92 push r15 |
27d2: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
27d6: 8d b7 in r24, 0x3d ; 61 |
27d8: 9e b7 in r25, 0x3e ; 62 |
27da: 0a 96 adiw r24, 0x0a ; 10 |
27dc: e7 cd rjmp .-1074 ; 0x23ac <Menu+0x1e2> |
27de: 10 92 68 08 sts 0x0868, r1 |
27e2: 84 ee ldi r24, 0xE4 ; 228 |
27e4: 91 e0 ldi r25, 0x01 ; 1 |
27e6: 9f 93 push r25 |
27e8: 8f 93 push r24 |
27ea: ff 92 push r15 |
27ec: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
27f0: 84 e1 ldi r24, 0x14 ; 20 |
27f2: 80 93 68 08 sts 0x0868, r24 |
27f6: 80 91 b7 08 lds r24, 0x08B7 |
27fa: 90 91 b8 08 lds r25, 0x08B8 |
27fe: 9f 93 push r25 |
2800: 8f 93 push r24 |
2802: 85 ed ldi r24, 0xD5 ; 213 |
2804: 91 e0 ldi r25, 0x01 ; 1 |
2806: 9f 93 push r25 |
2808: 8f 93 push r24 |
280a: ff 92 push r15 |
280c: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
2810: 88 e2 ldi r24, 0x28 ; 40 |
2812: 80 93 68 08 sts 0x0868, r24 |
2816: 80 91 b3 08 lds r24, 0x08B3 |
281a: 90 91 b4 08 lds r25, 0x08B4 |
281e: 9f 93 push r25 |
2820: 8f 93 push r24 |
2822: 86 ec ldi r24, 0xC6 ; 198 |
2824: 91 e0 ldi r25, 0x01 ; 1 |
2826: 9f 93 push r25 |
2828: 8f 93 push r24 |
282a: ff 92 push r15 |
282c: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
2830: 8c e3 ldi r24, 0x3C ; 60 |
2832: 80 93 68 08 sts 0x0868, r24 |
2836: 80 91 b5 08 lds r24, 0x08B5 |
283a: 90 91 b6 08 lds r25, 0x08B6 |
283e: 9f 93 push r25 |
2840: 8f 93 push r24 |
2842: 87 eb ldi r24, 0xB7 ; 183 |
2844: 91 e0 ldi r25, 0x01 ; 1 |
2846: 9f 93 push r25 |
2848: 8f 93 push r24 |
284a: ff 92 push r15 |
284c: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
2850: 8d b7 in r24, 0x3d ; 61 |
2852: 9e b7 in r25, 0x3e ; 62 |
2854: 42 96 adiw r24, 0x12 ; 18 |
2856: aa cd rjmp .-1196 ; 0x23ac <Menu+0x1e2> |
2858: 10 92 68 08 sts 0x0868, r1 |
285c: 80 91 c7 08 lds r24, 0x08C7 |
2860: 90 91 c8 08 lds r25, 0x08C8 |
2864: 9f 93 push r25 |
2866: 8f 93 push r24 |
2868: 80 91 bf 08 lds r24, 0x08BF |
286c: 90 91 c0 08 lds r25, 0x08C0 |
2870: 9f 93 push r25 |
2872: 8f 93 push r24 |
2874: 85 ea ldi r24, 0xA5 ; 165 |
2876: 91 e0 ldi r25, 0x01 ; 1 |
2878: 9f 93 push r25 |
287a: 8f 93 push r24 |
287c: ff 92 push r15 |
287e: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
2882: 84 e1 ldi r24, 0x14 ; 20 |
2884: 80 93 68 08 sts 0x0868, r24 |
2888: 80 91 c9 08 lds r24, 0x08C9 |
288c: 90 91 ca 08 lds r25, 0x08CA |
2890: 9f 93 push r25 |
2892: 8f 93 push r24 |
2894: 80 91 c1 08 lds r24, 0x08C1 |
2898: 90 91 c2 08 lds r25, 0x08C2 |
289c: 9f 93 push r25 |
289e: 8f 93 push r24 |
28a0: 83 e9 ldi r24, 0x93 ; 147 |
28a2: 91 e0 ldi r25, 0x01 ; 1 |
28a4: 9f 93 push r25 |
28a6: 8f 93 push r24 |
28a8: ff 92 push r15 |
28aa: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
28ae: 88 e2 ldi r24, 0x28 ; 40 |
28b0: 80 93 68 08 sts 0x0868, r24 |
28b4: 80 91 cb 08 lds r24, 0x08CB |
28b8: 90 91 cc 08 lds r25, 0x08CC |
28bc: 9f 93 push r25 |
28be: 8f 93 push r24 |
28c0: 80 91 c3 08 lds r24, 0x08C3 |
28c4: 90 91 c4 08 lds r25, 0x08C4 |
28c8: 9f 93 push r25 |
28ca: 8f 93 push r24 |
28cc: 81 e8 ldi r24, 0x81 ; 129 |
28ce: 91 e0 ldi r25, 0x01 ; 1 |
28d0: 9f 93 push r25 |
28d2: 8f 93 push r24 |
28d4: ff 92 push r15 |
28d6: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
28da: 8c e3 ldi r24, 0x3C ; 60 |
28dc: 80 93 68 08 sts 0x0868, r24 |
28e0: 80 91 cd 08 lds r24, 0x08CD |
28e4: 90 91 ce 08 lds r25, 0x08CE |
28e8: 9f 93 push r25 |
28ea: 8f 93 push r24 |
28ec: 80 91 c5 08 lds r24, 0x08C5 |
28f0: 90 91 c6 08 lds r25, 0x08C6 |
28f4: 9f 93 push r25 |
28f6: 8f 93 push r24 |
28f8: 8f e6 ldi r24, 0x6F ; 111 |
28fa: 91 e0 ldi r25, 0x01 ; 1 |
28fc: 9f 93 push r25 |
28fe: 8f 93 push r24 |
2900: ff 92 push r15 |
2902: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
2906: 8d b7 in r24, 0x3d ; 61 |
2908: 9e b7 in r25, 0x3e ; 62 |
290a: 4c 96 adiw r24, 0x1c ; 28 |
290c: 4f cd rjmp .-1378 ; 0x23ac <Menu+0x1e2> |
290e: 10 92 68 08 sts 0x0868, r1 |
2912: 87 e6 ldi r24, 0x67 ; 103 |
2914: 91 e0 ldi r25, 0x01 ; 1 |
2916: 9f 93 push r25 |
2918: 8f 93 push r24 |
291a: ff 92 push r15 |
291c: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
2920: 84 e1 ldi r24, 0x14 ; 20 |
2922: 80 93 68 08 sts 0x0868, r24 |
2926: 80 91 89 01 lds r24, 0x0189 |
292a: 99 27 eor r25, r25 |
292c: 9f 93 push r25 |
292e: 8f 93 push r24 |
2930: 89 e5 ldi r24, 0x59 ; 89 |
2932: 91 e0 ldi r25, 0x01 ; 1 |
2934: 9f 93 push r25 |
2936: 8f 93 push r24 |
2938: ff 92 push r15 |
293a: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
293e: 88 e2 ldi r24, 0x28 ; 40 |
2940: 80 93 68 08 sts 0x0868, r24 |
2944: 80 91 49 08 lds r24, 0x0849 |
2948: 90 91 4a 08 lds r25, 0x084A |
294c: 9f 93 push r25 |
294e: 8f 93 push r24 |
2950: 8b e4 ldi r24, 0x4B ; 75 |
2952: 91 e0 ldi r25, 0x01 ; 1 |
2954: 9f 93 push r25 |
2956: 8f 93 push r24 |
2958: ff 92 push r15 |
295a: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
295e: 8c e3 ldi r24, 0x3C ; 60 |
2960: 80 93 68 08 sts 0x0868, r24 |
2964: 80 91 b4 0c lds r24, 0x0CB4 |
2968: 99 27 eor r25, r25 |
296a: 9f 93 push r25 |
296c: 8f 93 push r24 |
296e: 80 91 b3 0c lds r24, 0x0CB3 |
2972: 99 27 eor r25, r25 |
2974: 9f 93 push r25 |
2976: 8f 93 push r24 |
2978: 8d e3 ldi r24, 0x3D ; 61 |
297a: 91 e0 ldi r25, 0x01 ; 1 |
297c: 9f 93 push r25 |
297e: 8f 93 push r24 |
2980: ff 92 push r15 |
2982: 0e 94 5d 09 call 0x12ba ; 0x12ba <_printf_P> |
2986: 0f cd rjmp .-1506 ; 0x23a6 <Menu+0x1dc> |
2988: 01 50 subi r16, 0x01 ; 1 |
298a: 00 93 66 01 sts 0x0166, r16 |
298e: 10 92 6a 08 sts 0x086A, r1 |
2992: 10 92 69 08 sts 0x0869, r1 |
2996: 1f 91 pop r17 |
2998: 0f 91 pop r16 |
299a: ff 90 pop r15 |
299c: 08 95 ret |
0000299e <i2c_init>: |
299e: 10 92 b9 00 sts 0x00B9, r1 |
29a2: 8a e2 ldi r24, 0x2A ; 42 |
29a4: 80 93 b8 00 sts 0x00B8, r24 |
29a8: 08 95 ret |
000029aa <i2c_start>: |
29aa: 85 ea ldi r24, 0xA5 ; 165 |
29ac: 80 93 bc 00 sts 0x00BC, r24 |
29b0: 80 e0 ldi r24, 0x00 ; 0 |
29b2: 90 e0 ldi r25, 0x00 ; 0 |
29b4: 08 95 ret |
000029b6 <i2c_stop>: |
29b6: 84 e9 ldi r24, 0x94 ; 148 |
29b8: 80 93 bc 00 sts 0x00BC, r24 |
29bc: 08 95 ret |
000029be <i2c_write_byte>: |
29be: 10 92 b9 00 sts 0x00B9, r1 |
29c2: 80 93 bb 00 sts 0x00BB, r24 |
29c6: 85 e8 ldi r24, 0x85 ; 133 |
29c8: 80 93 bc 00 sts 0x00BC, r24 |
29cc: 80 e0 ldi r24, 0x00 ; 0 |
29ce: 90 e0 ldi r25, 0x00 ; 0 |
29d0: 08 95 ret |
000029d2 <__vector_26>: |
29d2: 1f 92 push r1 |
29d4: 0f 92 push r0 |
29d6: 0f b6 in r0, 0x3f ; 63 |
29d8: 0f 92 push r0 |
29da: 11 24 eor r1, r1 |
29dc: 8f 93 push r24 |
29de: 9f 93 push r25 |
29e0: ef 93 push r30 |
29e2: ff 93 push r31 |
29e4: 80 91 6b 08 lds r24, 0x086B |
29e8: 8f 5f subi r24, 0xFF ; 255 |
29ea: 80 93 6b 08 sts 0x086B, r24 |
29ee: 81 50 subi r24, 0x01 ; 1 |
29f0: 83 30 cpi r24, 0x03 ; 3 |
29f2: 09 f4 brne .+2 ; 0x29f6 <__vector_26+0x24> |
29f4: 42 c0 rjmp .+132 ; 0x2a7a <__vector_26+0xa8> |
29f6: 84 30 cpi r24, 0x04 ; 4 |
29f8: 28 f4 brcc .+10 ; 0x2a04 <__vector_26+0x32> |
29fa: 81 30 cpi r24, 0x01 ; 1 |
29fc: a1 f0 breq .+40 ; 0x2a26 <__vector_26+0x54> |
29fe: 82 30 cpi r24, 0x02 ; 2 |
2a00: 70 f5 brcc .+92 ; 0x2a5e <__vector_26+0x8c> |
2a02: 0c c0 rjmp .+24 ; 0x2a1c <__vector_26+0x4a> |
2a04: 85 30 cpi r24, 0x05 ; 5 |
2a06: 09 f4 brne .+2 ; 0x2a0a <__vector_26+0x38> |
2a08: 48 c0 rjmp .+144 ; 0x2a9a <__vector_26+0xc8> |
2a0a: 85 30 cpi r24, 0x05 ; 5 |
2a0c: d8 f1 brcs .+118 ; 0x2a84 <__vector_26+0xb2> |
2a0e: 86 30 cpi r24, 0x06 ; 6 |
2a10: 09 f4 brne .+2 ; 0x2a14 <__vector_26+0x42> |
2a12: 4b c0 rjmp .+150 ; 0x2aaa <__vector_26+0xd8> |
2a14: 87 30 cpi r24, 0x07 ; 7 |
2a16: 09 f0 breq .+2 ; 0x2a1a <__vector_26+0x48> |
2a18: 71 c0 rjmp .+226 ; 0x2afc <__vector_26+0x12a> |
2a1a: 5b c0 rjmp .+182 ; 0x2ad2 <__vector_26+0x100> |
2a1c: 80 91 6c 08 lds r24, 0x086C |
2a20: 88 0f add r24, r24 |
2a22: 8e 5a subi r24, 0xAE ; 174 |
2a24: 14 c0 rjmp .+40 ; 0x2a4e <__vector_26+0x7c> |
2a26: 80 91 6c 08 lds r24, 0x086C |
2a2a: 8f 5f subi r24, 0xFF ; 255 |
2a2c: 80 93 6c 08 sts 0x086C, r24 |
2a30: 81 50 subi r24, 0x01 ; 1 |
2a32: 81 30 cpi r24, 0x01 ; 1 |
2a34: 09 f4 brne .+2 ; 0x2a38 <__vector_26+0x66> |
2a36: 44 c0 rjmp .+136 ; 0x2ac0 <__vector_26+0xee> |
2a38: 81 30 cpi r24, 0x01 ; 1 |
2a3a: 38 f0 brcs .+14 ; 0x2a4a <__vector_26+0x78> |
2a3c: 82 30 cpi r24, 0x02 ; 2 |
2a3e: 09 f4 brne .+2 ; 0x2a42 <__vector_26+0x70> |
2a40: 42 c0 rjmp .+132 ; 0x2ac6 <__vector_26+0xf4> |
2a42: 83 30 cpi r24, 0x03 ; 3 |
2a44: 09 f0 breq .+2 ; 0x2a48 <__vector_26+0x76> |
2a46: 5a c0 rjmp .+180 ; 0x2afc <__vector_26+0x12a> |
2a48: 41 c0 rjmp .+130 ; 0x2acc <__vector_26+0xfa> |
2a4a: 80 91 60 09 lds r24, 0x0960 |
2a4e: 10 92 b9 00 sts 0x00B9, r1 |
2a52: 80 93 bb 00 sts 0x00BB, r24 |
2a56: 85 e8 ldi r24, 0x85 ; 133 |
2a58: 80 93 bc 00 sts 0x00BC, r24 |
2a5c: 4f c0 rjmp .+158 ; 0x2afc <__vector_26+0x12a> |
2a5e: 84 e9 ldi r24, 0x94 ; 148 |
2a60: 80 93 bc 00 sts 0x00BC, r24 |
2a64: 80 91 6c 08 lds r24, 0x086C |
2a68: 84 30 cpi r24, 0x04 ; 4 |
2a6a: 18 f4 brcc .+6 ; 0x2a72 <__vector_26+0xa0> |
2a6c: 10 92 6b 08 sts 0x086B, r1 |
2a70: 02 c0 rjmp .+4 ; 0x2a76 <__vector_26+0xa4> |
2a72: 10 92 6c 08 sts 0x086C, r1 |
2a76: 85 ea ldi r24, 0xA5 ; 165 |
2a78: ef cf rjmp .-34 ; 0x2a58 <__vector_26+0x86> |
2a7a: 80 91 6d 08 lds r24, 0x086D |
2a7e: 88 0f add r24, r24 |
2a80: 8d 5a subi r24, 0xAD ; 173 |
2a82: e5 cf rjmp .-54 ; 0x2a4e <__vector_26+0x7c> |
2a84: 80 91 6d 08 lds r24, 0x086D |
2a88: 81 30 cpi r24, 0x01 ; 1 |
2a8a: d1 f0 breq .+52 ; 0x2ac0 <__vector_26+0xee> |
2a8c: 81 30 cpi r24, 0x01 ; 1 |
2a8e: e8 f2 brcs .-70 ; 0x2a4a <__vector_26+0x78> |
2a90: 82 30 cpi r24, 0x02 ; 2 |
2a92: c9 f0 breq .+50 ; 0x2ac6 <__vector_26+0xf4> |
2a94: 83 30 cpi r24, 0x03 ; 3 |
2a96: 91 f5 brne .+100 ; 0x2afc <__vector_26+0x12a> |
2a98: 19 c0 rjmp .+50 ; 0x2acc <__vector_26+0xfa> |
2a9a: 80 91 bb 00 lds r24, 0x00BB |
2a9e: e0 91 6d 08 lds r30, 0x086D |
2aa2: ff 27 eor r31, r31 |
2aa4: e4 5b subi r30, 0xB4 ; 180 |
2aa6: f3 4f sbci r31, 0xF3 ; 243 |
2aa8: 80 83 st Z, r24 |
2aaa: 80 91 6d 08 lds r24, 0x086D |
2aae: 81 30 cpi r24, 0x01 ; 1 |
2ab0: 39 f0 breq .+14 ; 0x2ac0 <__vector_26+0xee> |
2ab2: 81 30 cpi r24, 0x01 ; 1 |
2ab4: 50 f2 brcs .-108 ; 0x2a4a <__vector_26+0x78> |
2ab6: 82 30 cpi r24, 0x02 ; 2 |
2ab8: 31 f0 breq .+12 ; 0x2ac6 <__vector_26+0xf4> |
2aba: 83 30 cpi r24, 0x03 ; 3 |
2abc: f9 f4 brne .+62 ; 0x2afc <__vector_26+0x12a> |
2abe: 06 c0 rjmp .+12 ; 0x2acc <__vector_26+0xfa> |
2ac0: 80 91 61 09 lds r24, 0x0961 |
2ac4: c4 cf rjmp .-120 ; 0x2a4e <__vector_26+0x7c> |
2ac6: 80 91 66 09 lds r24, 0x0966 |
2aca: c1 cf rjmp .-126 ; 0x2a4e <__vector_26+0x7c> |
2acc: 80 91 6c 09 lds r24, 0x096C |
2ad0: be cf rjmp .-132 ; 0x2a4e <__vector_26+0x7c> |
2ad2: 80 91 6d 08 lds r24, 0x086D |
2ad6: 90 91 bb 00 lds r25, 0x00BB |
2ada: e8 2f mov r30, r24 |
2adc: ff 27 eor r31, r31 |
2ade: e4 5b subi r30, 0xB4 ; 180 |
2ae0: f3 4f sbci r31, 0xF3 ; 243 |
2ae2: 94 83 std Z+4, r25 ; 0x04 |
2ae4: 8f 5f subi r24, 0xFF ; 255 |
2ae6: 80 93 6d 08 sts 0x086D, r24 |
2aea: 84 30 cpi r24, 0x04 ; 4 |
2aec: 10 f0 brcs .+4 ; 0x2af2 <__vector_26+0x120> |
2aee: 10 92 6d 08 sts 0x086D, r1 |
2af2: 84 e9 ldi r24, 0x94 ; 148 |
2af4: 80 93 bc 00 sts 0x00BC, r24 |
2af8: 10 92 6b 08 sts 0x086B, r1 |
2afc: ff 91 pop r31 |
2afe: ef 91 pop r30 |
2b00: 9f 91 pop r25 |
2b02: 8f 91 pop r24 |
2b04: 0f 90 pop r0 |
2b06: 0f be out 0x3f, r0 ; 63 |
2b08: 0f 90 pop r0 |
2b0a: 1f 90 pop r1 |
2b0c: 18 95 reti |
00002b0e <rc_sum_init>: |
2b0e: 83 ec ldi r24, 0xC3 ; 195 |
2b10: 80 93 81 00 sts 0x0081, r24 |
2b14: ef e6 ldi r30, 0x6F ; 111 |
2b16: f0 e0 ldi r31, 0x00 ; 0 |
2b18: 80 81 ld r24, Z |
2b1a: 80 62 ori r24, 0x20 ; 32 |
2b1c: 80 83 st Z, r24 |
2b1e: 10 92 78 08 sts 0x0878, r1 |
2b22: 10 92 77 08 sts 0x0877, r1 |
2b26: 10 92 76 08 sts 0x0876, r1 |
2b2a: 10 92 75 08 sts 0x0875, r1 |
2b2e: 10 92 74 08 sts 0x0874, r1 |
2b32: 10 92 73 08 sts 0x0873, r1 |
2b36: 08 95 ret |
00002b38 <__vector_12>: |
2b38: 1f 92 push r1 |
2b3a: 0f 92 push r0 |
2b3c: 0f b6 in r0, 0x3f ; 63 |
2b3e: 0f 92 push r0 |
2b40: 11 24 eor r1, r1 |
2b42: 0f 93 push r16 |
2b44: 1f 93 push r17 |
2b46: 2f 93 push r18 |
2b48: 3f 93 push r19 |
2b4a: 4f 93 push r20 |
2b4c: 5f 93 push r21 |
2b4e: 6f 93 push r22 |
2b50: 7f 93 push r23 |
2b52: 8f 93 push r24 |
2b54: 9f 93 push r25 |
2b56: af 93 push r26 |
2b58: bf 93 push r27 |
2b5a: cf 93 push r28 |
2b5c: df 93 push r29 |
2b5e: ef 93 push r30 |
2b60: ff 93 push r31 |
2b62: 20 91 86 00 lds r18, 0x0086 |
2b66: 30 91 87 00 lds r19, 0x0087 |
2b6a: 80 91 70 08 lds r24, 0x0870 |
2b6e: 90 91 71 08 lds r25, 0x0871 |
2b72: 28 1b sub r18, r24 |
2b74: 39 0b sbc r19, r25 |
2b76: 80 91 86 00 lds r24, 0x0086 |
2b7a: 90 91 87 00 lds r25, 0x0087 |
2b7e: 90 93 71 08 sts 0x0871, r25 |
2b82: 80 93 70 08 sts 0x0870, r24 |
2b86: c9 01 movw r24, r18 |
2b88: 8d 5d subi r24, 0xDD ; 221 |
2b8a: 95 40 sbci r25, 0x05 ; 5 |
2b8c: 83 56 subi r24, 0x63 ; 99 |
2b8e: 99 41 sbci r25, 0x19 ; 25 |
2b90: 48 f4 brcc .+18 ; 0x2ba4 <__vector_12+0x6c> |
2b92: 81 e0 ldi r24, 0x01 ; 1 |
2b94: 90 e0 ldi r25, 0x00 ; 0 |
2b96: 90 93 6f 08 sts 0x086F, r25 |
2b9a: 80 93 6e 08 sts 0x086E, r24 |
2b9e: 10 92 67 01 sts 0x0167, r1 |
2ba2: 54 c0 rjmp .+168 ; 0x2c4c <__vector_12+0x114> |
2ba4: c0 91 6e 08 lds r28, 0x086E |
2ba8: d0 91 6f 08 lds r29, 0x086F |
2bac: ce 30 cpi r28, 0x0E ; 14 |
2bae: d1 05 cpc r29, r1 |
2bb0: 0c f0 brlt .+2 ; 0x2bb4 <__vector_12+0x7c> |
2bb2: 4c c0 rjmp .+152 ; 0x2c4c <__vector_12+0x114> |
2bb4: c9 01 movw r24, r18 |
2bb6: 8b 5f subi r24, 0xFB ; 251 |
2bb8: 90 40 sbci r25, 0x00 ; 0 |
2bba: 84 5b subi r24, 0xB4 ; 180 |
2bbc: 91 40 sbci r25, 0x01 ; 1 |
2bbe: 08 f0 brcs .+2 ; 0x2bc2 <__vector_12+0x8a> |
2bc0: 40 c0 rjmp .+128 ; 0x2c42 <__vector_12+0x10a> |
2bc2: a9 01 movw r20, r18 |
2bc4: 42 5d subi r20, 0xD2 ; 210 |
2bc6: 51 40 sbci r21, 0x01 ; 1 |
2bc8: fe 01 movw r30, r28 |
2bca: ee 0f add r30, r30 |
2bcc: ff 1f adc r31, r31 |
2bce: ec 5a subi r30, 0xAC ; 172 |
2bd0: f3 4f sbci r31, 0xF3 ; 243 |
2bd2: 80 81 ld r24, Z |
2bd4: 91 81 ldd r25, Z+1 ; 0x01 |
2bd6: fa 01 movw r30, r20 |
2bd8: e8 1b sub r30, r24 |
2bda: f9 0b sbc r31, r25 |
2bdc: cf 01 movw r24, r30 |
2bde: f7 ff sbrs r31, 7 |
2be0: 03 c0 rjmp .+6 ; 0x2be8 <__vector_12+0xb0> |
2be2: 90 95 com r25 |
2be4: 81 95 neg r24 |
2be6: 9f 4f sbci r25, 0xFF ; 255 |
2be8: 06 97 sbiw r24, 0x06 ; 6 |
2bea: 4c f4 brge .+18 ; 0x2bfe <__vector_12+0xc6> |
2bec: 80 91 cf 08 lds r24, 0x08CF |
2bf0: 88 3c cpi r24, 0xC8 ; 200 |
2bf2: 28 f4 brcc .+10 ; 0x2bfe <__vector_12+0xc6> |
2bf4: 80 91 cf 08 lds r24, 0x08CF |
2bf8: 86 5f subi r24, 0xF6 ; 246 |
2bfa: 80 93 cf 08 sts 0x08CF, r24 |
2bfe: fe 01 movw r30, r28 |
2c00: ee 0f add r30, r30 |
2c02: ff 1f adc r31, r31 |
2c04: 8f 01 movw r16, r30 |
2c06: 0c 5a subi r16, 0xAC ; 172 |
2c08: 13 4f sbci r17, 0xF3 ; 243 |
2c0a: d8 01 movw r26, r16 |
2c0c: 2d 91 ld r18, X+ |
2c0e: 3c 91 ld r19, X |
2c10: c9 01 movw r24, r18 |
2c12: 88 0f add r24, r24 |
2c14: 99 1f adc r25, r25 |
2c16: 82 0f add r24, r18 |
2c18: 93 1f adc r25, r19 |
2c1a: 84 0f add r24, r20 |
2c1c: 95 1f adc r25, r21 |
2c1e: 64 e0 ldi r22, 0x04 ; 4 |
2c20: 70 e0 ldi r23, 0x00 ; 0 |
2c22: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
2c26: d8 01 movw r26, r16 |
2c28: 8d 91 ld r24, X+ |
2c2a: 9c 91 ld r25, X |
2c2c: 11 97 sbiw r26, 0x01 ; 1 |
2c2e: 9b 01 movw r18, r22 |
2c30: 28 1b sub r18, r24 |
2c32: 39 0b sbc r19, r25 |
2c34: ee 58 subi r30, 0x8E ; 142 |
2c36: f3 4f sbci r31, 0xF3 ; 243 |
2c38: 31 83 std Z+1, r19 ; 0x01 |
2c3a: 20 83 st Z, r18 |
2c3c: 11 96 adiw r26, 0x01 ; 1 |
2c3e: 7c 93 st X, r23 |
2c40: 6e 93 st -X, r22 |
2c42: 21 96 adiw r28, 0x01 ; 1 |
2c44: d0 93 6f 08 sts 0x086F, r29 |
2c48: c0 93 6e 08 sts 0x086E, r28 |
2c4c: ff 91 pop r31 |
2c4e: ef 91 pop r30 |
2c50: df 91 pop r29 |
2c52: cf 91 pop r28 |
2c54: bf 91 pop r27 |
2c56: af 91 pop r26 |
2c58: 9f 91 pop r25 |
2c5a: 8f 91 pop r24 |
2c5c: 7f 91 pop r23 |
2c5e: 6f 91 pop r22 |
2c60: 5f 91 pop r21 |
2c62: 4f 91 pop r20 |
2c64: 3f 91 pop r19 |
2c66: 2f 91 pop r18 |
2c68: 1f 91 pop r17 |
2c6a: 0f 91 pop r16 |
2c6c: 0f 90 pop r0 |
2c6e: 0f be out 0x3f, r0 ; 63 |
2c70: 0f 90 pop r0 |
2c72: 1f 90 pop r1 |
2c74: 18 95 reti |
00002c76 <Mittelwert>: |
2c76: af 92 push r10 |
2c78: bf 92 push r11 |
2c7a: cf 92 push r12 |
2c7c: df 92 push r13 |
2c7e: ef 92 push r14 |
2c80: ff 92 push r15 |
2c82: 0f 93 push r16 |
2c84: 1f 93 push r17 |
2c86: 10 92 7a 00 sts 0x007A, r1 |
2c8a: 80 91 5a 08 lds r24, 0x085A |
2c8e: 88 23 and r24, r24 |
2c90: 69 f0 breq .+26 ; 0x2cac <Mittelwert+0x36> |
2c92: 80 91 4e 08 lds r24, 0x084E |
2c96: 90 91 4f 08 lds r25, 0x084F |
2c9a: 60 91 5a 08 lds r22, 0x085A |
2c9e: 77 27 eor r23, r23 |
2ca0: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
2ca4: 70 93 cd 0c sts 0x0CCD, r23 |
2ca8: 60 93 cc 0c sts 0x0CCC, r22 |
2cac: 80 91 5b 08 lds r24, 0x085B |
2cb0: 88 23 and r24, r24 |
2cb2: 69 f0 breq .+26 ; 0x2cce <Mittelwert+0x58> |
2cb4: 80 91 50 08 lds r24, 0x0850 |
2cb8: 90 91 51 08 lds r25, 0x0851 |
2cbc: 60 91 5b 08 lds r22, 0x085B |
2cc0: 77 27 eor r23, r23 |
2cc2: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
2cc6: 70 93 cb 0c sts 0x0CCB, r23 |
2cca: 60 93 ca 0c sts 0x0CCA, r22 |
2cce: 80 91 5c 08 lds r24, 0x085C |
2cd2: 88 23 and r24, r24 |
2cd4: 69 f0 breq .+26 ; 0x2cf0 <Mittelwert+0x7a> |
2cd6: 80 91 52 08 lds r24, 0x0852 |
2cda: 90 91 53 08 lds r25, 0x0853 |
2cde: 60 91 5c 08 lds r22, 0x085C |
2ce2: 77 27 eor r23, r23 |
2ce4: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
2ce8: 70 93 d9 0c sts 0x0CD9, r23 |
2cec: 60 93 d8 0c sts 0x0CD8, r22 |
2cf0: 80 91 5d 08 lds r24, 0x085D |
2cf4: 88 23 and r24, r24 |
2cf6: d9 f1 breq .+118 ; 0x2d6e <Mittelwert+0xf8> |
2cf8: e0 90 d5 0c lds r14, 0x0CD5 |
2cfc: f0 90 d6 0c lds r15, 0x0CD6 |
2d00: 60 91 56 08 lds r22, 0x0856 |
2d04: 70 91 57 08 lds r23, 0x0857 |
2d08: 20 91 5d 08 lds r18, 0x085D |
2d0c: 00 27 eor r16, r16 |
2d0e: f7 fc sbrc r15, 7 |
2d10: 00 95 com r16 |
2d12: 10 2f mov r17, r16 |
2d14: 57 01 movw r10, r14 |
2d16: 68 01 movw r12, r16 |
2d18: 43 e0 ldi r20, 0x03 ; 3 |
2d1a: aa 0c add r10, r10 |
2d1c: bb 1c adc r11, r11 |
2d1e: cc 1c adc r12, r12 |
2d20: dd 1c adc r13, r13 |
2d22: 4a 95 dec r20 |
2d24: d1 f7 brne .-12 ; 0x2d1a <Mittelwert+0xa4> |
2d26: ae 18 sub r10, r14 |
2d28: bf 08 sbc r11, r15 |
2d2a: c0 0a sbc r12, r16 |
2d2c: d1 0a sbc r13, r17 |
2d2e: 88 27 eor r24, r24 |
2d30: 77 fd sbrc r23, 7 |
2d32: 80 95 com r24 |
2d34: 98 2f mov r25, r24 |
2d36: 34 e0 ldi r19, 0x04 ; 4 |
2d38: 66 0f add r22, r22 |
2d3a: 77 1f adc r23, r23 |
2d3c: 88 1f adc r24, r24 |
2d3e: 99 1f adc r25, r25 |
2d40: 3a 95 dec r19 |
2d42: d1 f7 brne .-12 ; 0x2d38 <Mittelwert+0xc2> |
2d44: 33 27 eor r19, r19 |
2d46: 44 27 eor r20, r20 |
2d48: 55 27 eor r21, r21 |
2d4a: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
2d4e: a2 0e add r10, r18 |
2d50: b3 1e adc r11, r19 |
2d52: c4 1e adc r12, r20 |
2d54: d5 1e adc r13, r21 |
2d56: c6 01 movw r24, r12 |
2d58: b5 01 movw r22, r10 |
2d5a: 28 e0 ldi r18, 0x08 ; 8 |
2d5c: 30 e0 ldi r19, 0x00 ; 0 |
2d5e: 40 e0 ldi r20, 0x00 ; 0 |
2d60: 50 e0 ldi r21, 0x00 ; 0 |
2d62: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
2d66: 30 93 d6 0c sts 0x0CD6, r19 |
2d6a: 20 93 d5 0c sts 0x0CD5, r18 |
2d6e: 80 91 5e 08 lds r24, 0x085E |
2d72: 88 23 and r24, r24 |
2d74: d9 f1 breq .+118 ; 0x2dec <Mittelwert+0x176> |
2d76: e0 90 de 0c lds r14, 0x0CDE |
2d7a: f0 90 df 0c lds r15, 0x0CDF |
2d7e: 60 91 54 08 lds r22, 0x0854 |
2d82: 70 91 55 08 lds r23, 0x0855 |
2d86: 20 91 5e 08 lds r18, 0x085E |
2d8a: 00 27 eor r16, r16 |
2d8c: f7 fc sbrc r15, 7 |
2d8e: 00 95 com r16 |
2d90: 10 2f mov r17, r16 |
2d92: 57 01 movw r10, r14 |
2d94: 68 01 movw r12, r16 |
2d96: 83 e0 ldi r24, 0x03 ; 3 |
2d98: aa 0c add r10, r10 |
2d9a: bb 1c adc r11, r11 |
2d9c: cc 1c adc r12, r12 |
2d9e: dd 1c adc r13, r13 |
2da0: 8a 95 dec r24 |
2da2: d1 f7 brne .-12 ; 0x2d98 <Mittelwert+0x122> |
2da4: ae 18 sub r10, r14 |
2da6: bf 08 sbc r11, r15 |
2da8: c0 0a sbc r12, r16 |
2daa: d1 0a sbc r13, r17 |
2dac: 88 27 eor r24, r24 |
2dae: 77 fd sbrc r23, 7 |
2db0: 80 95 com r24 |
2db2: 98 2f mov r25, r24 |
2db4: b4 e0 ldi r27, 0x04 ; 4 |
2db6: 66 0f add r22, r22 |
2db8: 77 1f adc r23, r23 |
2dba: 88 1f adc r24, r24 |
2dbc: 99 1f adc r25, r25 |
2dbe: ba 95 dec r27 |
2dc0: d1 f7 brne .-12 ; 0x2db6 <Mittelwert+0x140> |
2dc2: 33 27 eor r19, r19 |
2dc4: 44 27 eor r20, r20 |
2dc6: 55 27 eor r21, r21 |
2dc8: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
2dcc: a2 0e add r10, r18 |
2dce: b3 1e adc r11, r19 |
2dd0: c4 1e adc r12, r20 |
2dd2: d5 1e adc r13, r21 |
2dd4: c6 01 movw r24, r12 |
2dd6: b5 01 movw r22, r10 |
2dd8: 28 e0 ldi r18, 0x08 ; 8 |
2dda: 30 e0 ldi r19, 0x00 ; 0 |
2ddc: 40 e0 ldi r20, 0x00 ; 0 |
2dde: 50 e0 ldi r21, 0x00 ; 0 |
2de0: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
2de4: 30 93 df 0c sts 0x0CDF, r19 |
2de8: 20 93 de 0c sts 0x0CDE, r18 |
2dec: 80 91 5f 08 lds r24, 0x085F |
2df0: 88 23 and r24, r24 |
2df2: a1 f1 breq .+104 ; 0x2e5c <Mittelwert+0x1e6> |
2df4: e0 90 cf 0c lds r14, 0x0CCF |
2df8: f0 90 d0 0c lds r15, 0x0CD0 |
2dfc: 60 91 58 08 lds r22, 0x0858 |
2e00: 70 91 59 08 lds r23, 0x0859 |
2e04: 20 91 5f 08 lds r18, 0x085F |
2e08: 00 27 eor r16, r16 |
2e0a: f7 fc sbrc r15, 7 |
2e0c: 00 95 com r16 |
2e0e: 10 2f mov r17, r16 |
2e10: 57 01 movw r10, r14 |
2e12: 68 01 movw r12, r16 |
2e14: a3 e0 ldi r26, 0x03 ; 3 |
2e16: aa 0c add r10, r10 |
2e18: bb 1c adc r11, r11 |
2e1a: cc 1c adc r12, r12 |
2e1c: dd 1c adc r13, r13 |
2e1e: aa 95 dec r26 |
2e20: d1 f7 brne .-12 ; 0x2e16 <Mittelwert+0x1a0> |
2e22: ae 18 sub r10, r14 |
2e24: bf 08 sbc r11, r15 |
2e26: c0 0a sbc r12, r16 |
2e28: d1 0a sbc r13, r17 |
2e2a: 88 27 eor r24, r24 |
2e2c: 77 fd sbrc r23, 7 |
2e2e: 80 95 com r24 |
2e30: 98 2f mov r25, r24 |
2e32: 33 27 eor r19, r19 |
2e34: 44 27 eor r20, r20 |
2e36: 55 27 eor r21, r21 |
2e38: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
2e3c: a2 0e add r10, r18 |
2e3e: b3 1e adc r11, r19 |
2e40: c4 1e adc r12, r20 |
2e42: d5 1e adc r13, r21 |
2e44: c6 01 movw r24, r12 |
2e46: b5 01 movw r22, r10 |
2e48: 28 e0 ldi r18, 0x08 ; 8 |
2e4a: 30 e0 ldi r19, 0x00 ; 0 |
2e4c: 40 e0 ldi r20, 0x00 ; 0 |
2e4e: 50 e0 ldi r21, 0x00 ; 0 |
2e50: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
2e54: 30 93 d0 0c sts 0x0CD0, r19 |
2e58: 20 93 cf 0c sts 0x0CCF, r18 |
2e5c: 10 92 4f 08 sts 0x084F, r1 |
2e60: 10 92 4e 08 sts 0x084E, r1 |
2e64: 10 92 5a 08 sts 0x085A, r1 |
2e68: 10 92 51 08 sts 0x0851, r1 |
2e6c: 10 92 50 08 sts 0x0850, r1 |
2e70: 10 92 5b 08 sts 0x085B, r1 |
2e74: 10 92 53 08 sts 0x0853, r1 |
2e78: 10 92 52 08 sts 0x0852, r1 |
2e7c: 10 92 5c 08 sts 0x085C, r1 |
2e80: 10 92 55 08 sts 0x0855, r1 |
2e84: 10 92 54 08 sts 0x0854, r1 |
2e88: 10 92 5e 08 sts 0x085E, r1 |
2e8c: 10 92 57 08 sts 0x0857, r1 |
2e90: 10 92 56 08 sts 0x0856, r1 |
2e94: 10 92 5d 08 sts 0x085D, r1 |
2e98: 10 92 59 08 sts 0x0859, r1 |
2e9c: 10 92 58 08 sts 0x0858, r1 |
2ea0: 10 92 5f 08 sts 0x085F, r1 |
2ea4: 80 91 a7 08 lds r24, 0x08A7 |
2ea8: 90 91 a8 08 lds r25, 0x08A8 |
2eac: a0 91 a9 08 lds r26, 0x08A9 |
2eb0: b0 91 aa 08 lds r27, 0x08AA |
2eb4: 80 93 93 08 sts 0x0893, r24 |
2eb8: 90 93 94 08 sts 0x0894, r25 |
2ebc: a0 93 95 08 sts 0x0895, r26 |
2ec0: b0 93 96 08 sts 0x0896, r27 |
2ec4: 80 91 97 08 lds r24, 0x0897 |
2ec8: 90 91 98 08 lds r25, 0x0898 |
2ecc: a0 91 99 08 lds r26, 0x0899 |
2ed0: b0 91 9a 08 lds r27, 0x089A |
2ed4: 80 93 83 08 sts 0x0883, r24 |
2ed8: 90 93 84 08 sts 0x0884, r25 |
2edc: a0 93 85 08 sts 0x0885, r26 |
2ee0: b0 93 86 08 sts 0x0886, r27 |
2ee4: 80 91 9f 08 lds r24, 0x089F |
2ee8: 90 91 a0 08 lds r25, 0x08A0 |
2eec: a0 91 a1 08 lds r26, 0x08A1 |
2ef0: b0 91 a2 08 lds r27, 0x08A2 |
2ef4: 80 93 8b 08 sts 0x088B, r24 |
2ef8: 90 93 8c 08 sts 0x088C, r25 |
2efc: a0 93 8d 08 sts 0x088D, r26 |
2f00: b0 93 8e 08 sts 0x088E, r27 |
2f04: 80 91 9b 08 lds r24, 0x089B |
2f08: 90 91 9c 08 lds r25, 0x089C |
2f0c: a0 91 9d 08 lds r26, 0x089D |
2f10: b0 91 9e 08 lds r27, 0x089E |
2f14: 80 93 87 08 sts 0x0887, r24 |
2f18: 90 93 88 08 sts 0x0888, r25 |
2f1c: a0 93 89 08 sts 0x0889, r26 |
2f20: b0 93 8a 08 sts 0x088A, r27 |
2f24: 80 91 a3 08 lds r24, 0x08A3 |
2f28: 90 91 a4 08 lds r25, 0x08A4 |
2f2c: a0 91 a5 08 lds r26, 0x08A5 |
2f30: b0 91 a6 08 lds r27, 0x08A6 |
2f34: 80 93 8f 08 sts 0x088F, r24 |
2f38: 90 93 90 08 sts 0x0890, r25 |
2f3c: a0 93 91 08 sts 0x0891, r26 |
2f40: b0 93 92 08 sts 0x0892, r27 |
2f44: 8f ee ldi r24, 0xEF ; 239 |
2f46: 80 93 7a 00 sts 0x007A, r24 |
2f4a: 80 91 cc 0c lds r24, 0x0CCC |
2f4e: 90 91 cd 0c lds r25, 0x0CCD |
2f52: 89 3c cpi r24, 0xC9 ; 201 |
2f54: 91 05 cpc r25, r1 |
2f56: 7c f0 brlt .+30 ; 0x2f76 <Mittelwert+0x300> |
2f58: 20 91 cc 0c lds r18, 0x0CCC |
2f5c: 30 91 cd 0c lds r19, 0x0CCD |
2f60: 80 91 cc 0c lds r24, 0x0CCC |
2f64: 90 91 cd 0c lds r25, 0x0CCD |
2f68: 88 0f add r24, r24 |
2f6a: 99 1f adc r25, r25 |
2f6c: 88 0f add r24, r24 |
2f6e: 99 1f adc r25, r25 |
2f70: 20 52 subi r18, 0x20 ; 32 |
2f72: 33 40 sbci r19, 0x03 ; 3 |
2f74: 15 c0 rjmp .+42 ; 0x2fa0 <Mittelwert+0x32a> |
2f76: 80 91 cc 0c lds r24, 0x0CCC |
2f7a: 90 91 cd 0c lds r25, 0x0CCD |
2f7e: 88 53 subi r24, 0x38 ; 56 |
2f80: 9f 4f sbci r25, 0xFF ; 255 |
2f82: a4 f4 brge .+40 ; 0x2fac <Mittelwert+0x336> |
2f84: 20 91 cc 0c lds r18, 0x0CCC |
2f88: 30 91 cd 0c lds r19, 0x0CCD |
2f8c: 80 91 cc 0c lds r24, 0x0CCC |
2f90: 90 91 cd 0c lds r25, 0x0CCD |
2f94: 88 0f add r24, r24 |
2f96: 99 1f adc r25, r25 |
2f98: 88 0f add r24, r24 |
2f9a: 99 1f adc r25, r25 |
2f9c: 20 5e subi r18, 0xE0 ; 224 |
2f9e: 3c 4f sbci r19, 0xFC ; 252 |
2fa0: 82 0f add r24, r18 |
2fa2: 93 1f adc r25, r19 |
2fa4: 90 93 cd 0c sts 0x0CCD, r25 |
2fa8: 80 93 cc 0c sts 0x0CCC, r24 |
2fac: 80 91 ca 0c lds r24, 0x0CCA |
2fb0: 90 91 cb 0c lds r25, 0x0CCB |
2fb4: 89 3c cpi r24, 0xC9 ; 201 |
2fb6: 91 05 cpc r25, r1 |
2fb8: 7c f0 brlt .+30 ; 0x2fd8 <Mittelwert+0x362> |
2fba: 20 91 ca 0c lds r18, 0x0CCA |
2fbe: 30 91 cb 0c lds r19, 0x0CCB |
2fc2: 80 91 ca 0c lds r24, 0x0CCA |
2fc6: 90 91 cb 0c lds r25, 0x0CCB |
2fca: 88 0f add r24, r24 |
2fcc: 99 1f adc r25, r25 |
2fce: 88 0f add r24, r24 |
2fd0: 99 1f adc r25, r25 |
2fd2: 20 52 subi r18, 0x20 ; 32 |
2fd4: 33 40 sbci r19, 0x03 ; 3 |
2fd6: 15 c0 rjmp .+42 ; 0x3002 <Mittelwert+0x38c> |
2fd8: 80 91 ca 0c lds r24, 0x0CCA |
2fdc: 90 91 cb 0c lds r25, 0x0CCB |
2fe0: 88 53 subi r24, 0x38 ; 56 |
2fe2: 9f 4f sbci r25, 0xFF ; 255 |
2fe4: a4 f4 brge .+40 ; 0x300e <Mittelwert+0x398> |
2fe6: 20 91 ca 0c lds r18, 0x0CCA |
2fea: 30 91 cb 0c lds r19, 0x0CCB |
2fee: 80 91 ca 0c lds r24, 0x0CCA |
2ff2: 90 91 cb 0c lds r25, 0x0CCB |
2ff6: 88 0f add r24, r24 |
2ff8: 99 1f adc r25, r25 |
2ffa: 88 0f add r24, r24 |
2ffc: 99 1f adc r25, r25 |
2ffe: 20 5e subi r18, 0xE0 ; 224 |
3000: 3c 4f sbci r19, 0xFC ; 252 |
3002: 82 0f add r24, r18 |
3004: 93 1f adc r25, r19 |
3006: 90 93 cb 0c sts 0x0CCB, r25 |
300a: 80 93 ca 0c sts 0x0CCA, r24 |
300e: 20 91 bf 08 lds r18, 0x08BF |
3012: 30 91 c0 08 lds r19, 0x08C0 |
3016: 80 91 94 0c lds r24, 0x0C94 |
301a: e8 2f mov r30, r24 |
301c: ff 27 eor r31, r31 |
301e: ee 0f add r30, r30 |
3020: ff 1f adc r31, r31 |
3022: ec 5a subi r30, 0xAC ; 172 |
3024: f3 4f sbci r31, 0xF3 ; 243 |
3026: 80 81 ld r24, Z |
3028: 91 81 ldd r25, Z+1 ; 0x01 |
302a: 82 59 subi r24, 0x92 ; 146 |
302c: 9f 4f sbci r25, 0xFF ; 255 |
302e: 28 17 cp r18, r24 |
3030: 39 07 cpc r19, r25 |
3032: 1c f4 brge .+6 ; 0x303a <Mittelwert+0x3c4> |
3034: 2f 5f subi r18, 0xFF ; 255 |
3036: 3f 4f sbci r19, 0xFF ; 255 |
3038: 0c c0 rjmp .+24 ; 0x3052 <Mittelwert+0x3dc> |
303a: 80 81 ld r24, Z |
303c: 91 81 ldd r25, Z+1 ; 0x01 |
303e: 82 59 subi r24, 0x92 ; 146 |
3040: 9f 4f sbci r25, 0xFF ; 255 |
3042: 82 17 cp r24, r18 |
3044: 93 07 cpc r25, r19 |
3046: 4c f4 brge .+18 ; 0x305a <Mittelwert+0x3e4> |
3048: 21 15 cp r18, r1 |
304a: 31 05 cpc r19, r1 |
304c: 31 f0 breq .+12 ; 0x305a <Mittelwert+0x3e4> |
304e: 21 50 subi r18, 0x01 ; 1 |
3050: 30 40 sbci r19, 0x00 ; 0 |
3052: 30 93 c0 08 sts 0x08C0, r19 |
3056: 20 93 bf 08 sts 0x08BF, r18 |
305a: 20 91 c1 08 lds r18, 0x08C1 |
305e: 30 91 c2 08 lds r19, 0x08C2 |
3062: 80 91 95 0c lds r24, 0x0C95 |
3066: e8 2f mov r30, r24 |
3068: ff 27 eor r31, r31 |
306a: ee 0f add r30, r30 |
306c: ff 1f adc r31, r31 |
306e: ec 5a subi r30, 0xAC ; 172 |
3070: f3 4f sbci r31, 0xF3 ; 243 |
3072: 80 81 ld r24, Z |
3074: 91 81 ldd r25, Z+1 ; 0x01 |
3076: 82 59 subi r24, 0x92 ; 146 |
3078: 9f 4f sbci r25, 0xFF ; 255 |
307a: 28 17 cp r18, r24 |
307c: 39 07 cpc r19, r25 |
307e: 1c f4 brge .+6 ; 0x3086 <Mittelwert+0x410> |
3080: 2f 5f subi r18, 0xFF ; 255 |
3082: 3f 4f sbci r19, 0xFF ; 255 |
3084: 0c c0 rjmp .+24 ; 0x309e <Mittelwert+0x428> |
3086: 80 81 ld r24, Z |
3088: 91 81 ldd r25, Z+1 ; 0x01 |
308a: 82 59 subi r24, 0x92 ; 146 |
308c: 9f 4f sbci r25, 0xFF ; 255 |
308e: 82 17 cp r24, r18 |
3090: 93 07 cpc r25, r19 |
3092: 4c f4 brge .+18 ; 0x30a6 <Mittelwert+0x430> |
3094: 21 15 cp r18, r1 |
3096: 31 05 cpc r19, r1 |
3098: 31 f0 breq .+12 ; 0x30a6 <Mittelwert+0x430> |
309a: 21 50 subi r18, 0x01 ; 1 |
309c: 30 40 sbci r19, 0x00 ; 0 |
309e: 30 93 c2 08 sts 0x08C2, r19 |
30a2: 20 93 c1 08 sts 0x08C1, r18 |
30a6: 20 91 c3 08 lds r18, 0x08C3 |
30aa: 30 91 c4 08 lds r19, 0x08C4 |
30ae: 80 91 96 0c lds r24, 0x0C96 |
30b2: e8 2f mov r30, r24 |
30b4: ff 27 eor r31, r31 |
30b6: ee 0f add r30, r30 |
30b8: ff 1f adc r31, r31 |
30ba: ec 5a subi r30, 0xAC ; 172 |
30bc: f3 4f sbci r31, 0xF3 ; 243 |
30be: 80 81 ld r24, Z |
30c0: 91 81 ldd r25, Z+1 ; 0x01 |
30c2: 82 59 subi r24, 0x92 ; 146 |
30c4: 9f 4f sbci r25, 0xFF ; 255 |
30c6: 28 17 cp r18, r24 |
30c8: 39 07 cpc r19, r25 |
30ca: 1c f4 brge .+6 ; 0x30d2 <Mittelwert+0x45c> |
30cc: 2f 5f subi r18, 0xFF ; 255 |
30ce: 3f 4f sbci r19, 0xFF ; 255 |
30d0: 0c c0 rjmp .+24 ; 0x30ea <Mittelwert+0x474> |
30d2: 80 81 ld r24, Z |
30d4: 91 81 ldd r25, Z+1 ; 0x01 |
30d6: 82 59 subi r24, 0x92 ; 146 |
30d8: 9f 4f sbci r25, 0xFF ; 255 |
30da: 82 17 cp r24, r18 |
30dc: 93 07 cpc r25, r19 |
30de: 4c f4 brge .+18 ; 0x30f2 <Mittelwert+0x47c> |
30e0: 21 15 cp r18, r1 |
30e2: 31 05 cpc r19, r1 |
30e4: 31 f0 breq .+12 ; 0x30f2 <Mittelwert+0x47c> |
30e6: 21 50 subi r18, 0x01 ; 1 |
30e8: 30 40 sbci r19, 0x00 ; 0 |
30ea: 30 93 c4 08 sts 0x08C4, r19 |
30ee: 20 93 c3 08 sts 0x08C3, r18 |
30f2: 20 91 c5 08 lds r18, 0x08C5 |
30f6: 30 91 c6 08 lds r19, 0x08C6 |
30fa: 80 91 97 0c lds r24, 0x0C97 |
30fe: e8 2f mov r30, r24 |
3100: ff 27 eor r31, r31 |
3102: ee 0f add r30, r30 |
3104: ff 1f adc r31, r31 |
3106: ec 5a subi r30, 0xAC ; 172 |
3108: f3 4f sbci r31, 0xF3 ; 243 |
310a: 80 81 ld r24, Z |
310c: 91 81 ldd r25, Z+1 ; 0x01 |
310e: 82 59 subi r24, 0x92 ; 146 |
3110: 9f 4f sbci r25, 0xFF ; 255 |
3112: 28 17 cp r18, r24 |
3114: 39 07 cpc r19, r25 |
3116: 1c f4 brge .+6 ; 0x311e <Mittelwert+0x4a8> |
3118: 2f 5f subi r18, 0xFF ; 255 |
311a: 3f 4f sbci r19, 0xFF ; 255 |
311c: 0c c0 rjmp .+24 ; 0x3136 <Mittelwert+0x4c0> |
311e: 80 81 ld r24, Z |
3120: 91 81 ldd r25, Z+1 ; 0x01 |
3122: 82 59 subi r24, 0x92 ; 146 |
3124: 9f 4f sbci r25, 0xFF ; 255 |
3126: 82 17 cp r24, r18 |
3128: 93 07 cpc r25, r19 |
312a: 4c f4 brge .+18 ; 0x313e <Mittelwert+0x4c8> |
312c: 21 15 cp r18, r1 |
312e: 31 05 cpc r19, r1 |
3130: 31 f0 breq .+12 ; 0x313e <Mittelwert+0x4c8> |
3132: 21 50 subi r18, 0x01 ; 1 |
3134: 30 40 sbci r19, 0x00 ; 0 |
3136: 30 93 c6 08 sts 0x08C6, r19 |
313a: 20 93 c5 08 sts 0x08C5, r18 |
313e: 20 91 c7 08 lds r18, 0x08C7 |
3142: 30 91 c8 08 lds r19, 0x08C8 |
3146: 80 91 66 0c lds r24, 0x0C66 |
314a: 90 91 67 0c lds r25, 0x0C67 |
314e: 82 59 subi r24, 0x92 ; 146 |
3150: 9f 4f sbci r25, 0xFF ; 255 |
3152: 28 17 cp r18, r24 |
3154: 39 07 cpc r19, r25 |
3156: 1c f4 brge .+6 ; 0x315e <Mittelwert+0x4e8> |
3158: 2f 5f subi r18, 0xFF ; 255 |
315a: 3f 4f sbci r19, 0xFF ; 255 |
315c: 0e c0 rjmp .+28 ; 0x317a <Mittelwert+0x504> |
315e: 80 91 66 0c lds r24, 0x0C66 |
3162: 90 91 67 0c lds r25, 0x0C67 |
3166: 82 59 subi r24, 0x92 ; 146 |
3168: 9f 4f sbci r25, 0xFF ; 255 |
316a: 82 17 cp r24, r18 |
316c: 93 07 cpc r25, r19 |
316e: 4c f4 brge .+18 ; 0x3182 <Mittelwert+0x50c> |
3170: 21 15 cp r18, r1 |
3172: 31 05 cpc r19, r1 |
3174: 31 f0 breq .+12 ; 0x3182 <Mittelwert+0x50c> |
3176: 21 50 subi r18, 0x01 ; 1 |
3178: 30 40 sbci r19, 0x00 ; 0 |
317a: 30 93 c8 08 sts 0x08C8, r19 |
317e: 20 93 c7 08 sts 0x08C7, r18 |
3182: 20 91 c9 08 lds r18, 0x08C9 |
3186: 30 91 ca 08 lds r19, 0x08CA |
318a: 80 91 68 0c lds r24, 0x0C68 |
318e: 90 91 69 0c lds r25, 0x0C69 |
3192: 82 59 subi r24, 0x92 ; 146 |
3194: 9f 4f sbci r25, 0xFF ; 255 |
3196: 28 17 cp r18, r24 |
3198: 39 07 cpc r19, r25 |
319a: 1c f4 brge .+6 ; 0x31a2 <Mittelwert+0x52c> |
319c: 2f 5f subi r18, 0xFF ; 255 |
319e: 3f 4f sbci r19, 0xFF ; 255 |
31a0: 0e c0 rjmp .+28 ; 0x31be <Mittelwert+0x548> |
31a2: 80 91 68 0c lds r24, 0x0C68 |
31a6: 90 91 69 0c lds r25, 0x0C69 |
31aa: 82 59 subi r24, 0x92 ; 146 |
31ac: 9f 4f sbci r25, 0xFF ; 255 |
31ae: 82 17 cp r24, r18 |
31b0: 93 07 cpc r25, r19 |
31b2: 4c f4 brge .+18 ; 0x31c6 <Mittelwert+0x550> |
31b4: 21 15 cp r18, r1 |
31b6: 31 05 cpc r19, r1 |
31b8: 31 f0 breq .+12 ; 0x31c6 <Mittelwert+0x550> |
31ba: 21 50 subi r18, 0x01 ; 1 |
31bc: 30 40 sbci r19, 0x00 ; 0 |
31be: 30 93 ca 08 sts 0x08CA, r19 |
31c2: 20 93 c9 08 sts 0x08C9, r18 |
31c6: 20 91 cb 08 lds r18, 0x08CB |
31ca: 30 91 cc 08 lds r19, 0x08CC |
31ce: 80 91 6a 0c lds r24, 0x0C6A |
31d2: 90 91 6b 0c lds r25, 0x0C6B |
31d6: 82 59 subi r24, 0x92 ; 146 |
31d8: 9f 4f sbci r25, 0xFF ; 255 |
31da: 28 17 cp r18, r24 |
31dc: 39 07 cpc r19, r25 |
31de: 1c f4 brge .+6 ; 0x31e6 <Mittelwert+0x570> |
31e0: 2f 5f subi r18, 0xFF ; 255 |
31e2: 3f 4f sbci r19, 0xFF ; 255 |
31e4: 0e c0 rjmp .+28 ; 0x3202 <Mittelwert+0x58c> |
31e6: 80 91 6a 0c lds r24, 0x0C6A |
31ea: 90 91 6b 0c lds r25, 0x0C6B |
31ee: 82 59 subi r24, 0x92 ; 146 |
31f0: 9f 4f sbci r25, 0xFF ; 255 |
31f2: 82 17 cp r24, r18 |
31f4: 93 07 cpc r25, r19 |
31f6: 4c f4 brge .+18 ; 0x320a <Mittelwert+0x594> |
31f8: 21 15 cp r18, r1 |
31fa: 31 05 cpc r19, r1 |
31fc: 31 f0 breq .+12 ; 0x320a <Mittelwert+0x594> |
31fe: 21 50 subi r18, 0x01 ; 1 |
3200: 30 40 sbci r19, 0x00 ; 0 |
3202: 30 93 cc 08 sts 0x08CC, r19 |
3206: 20 93 cb 08 sts 0x08CB, r18 |
320a: 20 91 cd 08 lds r18, 0x08CD |
320e: 30 91 ce 08 lds r19, 0x08CE |
3212: 80 91 6c 0c lds r24, 0x0C6C |
3216: 90 91 6d 0c lds r25, 0x0C6D |
321a: 82 59 subi r24, 0x92 ; 146 |
321c: 9f 4f sbci r25, 0xFF ; 255 |
321e: 28 17 cp r18, r24 |
3220: 39 07 cpc r19, r25 |
3222: 1c f4 brge .+6 ; 0x322a <Mittelwert+0x5b4> |
3224: 2f 5f subi r18, 0xFF ; 255 |
3226: 3f 4f sbci r19, 0xFF ; 255 |
3228: 0e c0 rjmp .+28 ; 0x3246 <Mittelwert+0x5d0> |
322a: 80 91 6c 0c lds r24, 0x0C6C |
322e: 90 91 6d 0c lds r25, 0x0C6D |
3232: 82 59 subi r24, 0x92 ; 146 |
3234: 9f 4f sbci r25, 0xFF ; 255 |
3236: 82 17 cp r24, r18 |
3238: 93 07 cpc r25, r19 |
323a: 4c f4 brge .+18 ; 0x324e <Mittelwert+0x5d8> |
323c: 21 15 cp r18, r1 |
323e: 31 05 cpc r19, r1 |
3240: 31 f0 breq .+12 ; 0x324e <Mittelwert+0x5d8> |
3242: 21 50 subi r18, 0x01 ; 1 |
3244: 30 40 sbci r19, 0x00 ; 0 |
3246: 30 93 ce 08 sts 0x08CE, r19 |
324a: 20 93 cd 08 sts 0x08CD, r18 |
324e: 80 91 bf 08 lds r24, 0x08BF |
3252: 90 91 c0 08 lds r25, 0x08C0 |
3256: 97 ff sbrs r25, 7 |
3258: 05 c0 rjmp .+10 ; 0x3264 <Mittelwert+0x5ee> |
325a: 10 92 c0 08 sts 0x08C0, r1 |
325e: 10 92 bf 08 sts 0x08BF, r1 |
3262: 0a c0 rjmp .+20 ; 0x3278 <Mittelwert+0x602> |
3264: 8f 3f cpi r24, 0xFF ; 255 |
3266: 91 05 cpc r25, r1 |
3268: 39 f0 breq .+14 ; 0x3278 <Mittelwert+0x602> |
326a: 34 f0 brlt .+12 ; 0x3278 <Mittelwert+0x602> |
326c: 8f ef ldi r24, 0xFF ; 255 |
326e: 90 e0 ldi r25, 0x00 ; 0 |
3270: 90 93 c0 08 sts 0x08C0, r25 |
3274: 80 93 bf 08 sts 0x08BF, r24 |
3278: 80 91 c1 08 lds r24, 0x08C1 |
327c: 90 91 c2 08 lds r25, 0x08C2 |
3280: 97 ff sbrs r25, 7 |
3282: 05 c0 rjmp .+10 ; 0x328e <Mittelwert+0x618> |
3284: 10 92 c2 08 sts 0x08C2, r1 |
3288: 10 92 c1 08 sts 0x08C1, r1 |
328c: 0a c0 rjmp .+20 ; 0x32a2 <Mittelwert+0x62c> |
328e: 8f 3f cpi r24, 0xFF ; 255 |
3290: 91 05 cpc r25, r1 |
3292: 39 f0 breq .+14 ; 0x32a2 <Mittelwert+0x62c> |
3294: 34 f0 brlt .+12 ; 0x32a2 <Mittelwert+0x62c> |
3296: 8f ef ldi r24, 0xFF ; 255 |
3298: 90 e0 ldi r25, 0x00 ; 0 |
329a: 90 93 c2 08 sts 0x08C2, r25 |
329e: 80 93 c1 08 sts 0x08C1, r24 |
32a2: 80 91 c3 08 lds r24, 0x08C3 |
32a6: 90 91 c4 08 lds r25, 0x08C4 |
32aa: 97 ff sbrs r25, 7 |
32ac: 05 c0 rjmp .+10 ; 0x32b8 <Mittelwert+0x642> |
32ae: 10 92 c4 08 sts 0x08C4, r1 |
32b2: 10 92 c3 08 sts 0x08C3, r1 |
32b6: 0a c0 rjmp .+20 ; 0x32cc <Mittelwert+0x656> |
32b8: 8f 3f cpi r24, 0xFF ; 255 |
32ba: 91 05 cpc r25, r1 |
32bc: 39 f0 breq .+14 ; 0x32cc <Mittelwert+0x656> |
32be: 34 f0 brlt .+12 ; 0x32cc <Mittelwert+0x656> |
32c0: 8f ef ldi r24, 0xFF ; 255 |
32c2: 90 e0 ldi r25, 0x00 ; 0 |
32c4: 90 93 c4 08 sts 0x08C4, r25 |
32c8: 80 93 c3 08 sts 0x08C3, r24 |
32cc: 80 91 c5 08 lds r24, 0x08C5 |
32d0: 90 91 c6 08 lds r25, 0x08C6 |
32d4: 97 ff sbrs r25, 7 |
32d6: 05 c0 rjmp .+10 ; 0x32e2 <Mittelwert+0x66c> |
32d8: 10 92 c6 08 sts 0x08C6, r1 |
32dc: 10 92 c5 08 sts 0x08C5, r1 |
32e0: 0a c0 rjmp .+20 ; 0x32f6 <Mittelwert+0x680> |
32e2: 8f 3f cpi r24, 0xFF ; 255 |
32e4: 91 05 cpc r25, r1 |
32e6: 39 f0 breq .+14 ; 0x32f6 <Mittelwert+0x680> |
32e8: 34 f0 brlt .+12 ; 0x32f6 <Mittelwert+0x680> |
32ea: 8f ef ldi r24, 0xFF ; 255 |
32ec: 90 e0 ldi r25, 0x00 ; 0 |
32ee: 90 93 c6 08 sts 0x08C6, r25 |
32f2: 80 93 c5 08 sts 0x08C5, r24 |
32f6: 80 91 c7 08 lds r24, 0x08C7 |
32fa: 90 91 c8 08 lds r25, 0x08C8 |
32fe: 97 ff sbrs r25, 7 |
3300: 05 c0 rjmp .+10 ; 0x330c <Mittelwert+0x696> |
3302: 10 92 c8 08 sts 0x08C8, r1 |
3306: 10 92 c7 08 sts 0x08C7, r1 |
330a: 0a c0 rjmp .+20 ; 0x3320 <Mittelwert+0x6aa> |
330c: 8f 3f cpi r24, 0xFF ; 255 |
330e: 91 05 cpc r25, r1 |
3310: 39 f0 breq .+14 ; 0x3320 <Mittelwert+0x6aa> |
3312: 34 f0 brlt .+12 ; 0x3320 <Mittelwert+0x6aa> |
3314: 8f ef ldi r24, 0xFF ; 255 |
3316: 90 e0 ldi r25, 0x00 ; 0 |
3318: 90 93 c8 08 sts 0x08C8, r25 |
331c: 80 93 c7 08 sts 0x08C7, r24 |
3320: 80 91 c9 08 lds r24, 0x08C9 |
3324: 90 91 ca 08 lds r25, 0x08CA |
3328: 97 ff sbrs r25, 7 |
332a: 05 c0 rjmp .+10 ; 0x3336 <Mittelwert+0x6c0> |
332c: 10 92 ca 08 sts 0x08CA, r1 |
3330: 10 92 c9 08 sts 0x08C9, r1 |
3334: 0a c0 rjmp .+20 ; 0x334a <Mittelwert+0x6d4> |
3336: 8f 3f cpi r24, 0xFF ; 255 |
3338: 91 05 cpc r25, r1 |
333a: 39 f0 breq .+14 ; 0x334a <Mittelwert+0x6d4> |
333c: 34 f0 brlt .+12 ; 0x334a <Mittelwert+0x6d4> |
333e: 8f ef ldi r24, 0xFF ; 255 |
3340: 90 e0 ldi r25, 0x00 ; 0 |
3342: 90 93 ca 08 sts 0x08CA, r25 |
3346: 80 93 c9 08 sts 0x08C9, r24 |
334a: 80 91 cb 08 lds r24, 0x08CB |
334e: 90 91 cc 08 lds r25, 0x08CC |
3352: 97 ff sbrs r25, 7 |
3354: 05 c0 rjmp .+10 ; 0x3360 <Mittelwert+0x6ea> |
3356: 10 92 cc 08 sts 0x08CC, r1 |
335a: 10 92 cb 08 sts 0x08CB, r1 |
335e: 0a c0 rjmp .+20 ; 0x3374 <Mittelwert+0x6fe> |
3360: 8f 3f cpi r24, 0xFF ; 255 |
3362: 91 05 cpc r25, r1 |
3364: 39 f0 breq .+14 ; 0x3374 <Mittelwert+0x6fe> |
3366: 34 f0 brlt .+12 ; 0x3374 <Mittelwert+0x6fe> |
3368: 8f ef ldi r24, 0xFF ; 255 |
336a: 90 e0 ldi r25, 0x00 ; 0 |
336c: 90 93 cc 08 sts 0x08CC, r25 |
3370: 80 93 cb 08 sts 0x08CB, r24 |
3374: 80 91 cd 08 lds r24, 0x08CD |
3378: 90 91 ce 08 lds r25, 0x08CE |
337c: 97 ff sbrs r25, 7 |
337e: 05 c0 rjmp .+10 ; 0x338a <Mittelwert+0x714> |
3380: 10 92 ce 08 sts 0x08CE, r1 |
3384: 10 92 cd 08 sts 0x08CD, r1 |
3388: 0a c0 rjmp .+20 ; 0x339e <Mittelwert+0x728> |
338a: 8f 3f cpi r24, 0xFF ; 255 |
338c: 91 05 cpc r25, r1 |
338e: 39 f0 breq .+14 ; 0x339e <Mittelwert+0x728> |
3390: 34 f0 brlt .+12 ; 0x339e <Mittelwert+0x728> |
3392: 8f ef ldi r24, 0xFF ; 255 |
3394: 90 e0 ldi r25, 0x00 ; 0 |
3396: 90 93 ce 08 sts 0x08CE, r25 |
339a: 80 93 cd 08 sts 0x08CD, r24 |
339e: 1f 91 pop r17 |
33a0: 0f 91 pop r16 |
33a2: ff 90 pop r15 |
33a4: ef 90 pop r14 |
33a6: df 90 pop r13 |
33a8: cf 90 pop r12 |
33aa: bf 90 pop r11 |
33ac: af 90 pop r10 |
33ae: 08 95 ret |
000033b0 <CalibrierMittelwert>: |
33b0: 10 92 7a 00 sts 0x007A, r1 |
33b4: 80 91 5a 08 lds r24, 0x085A |
33b8: 88 23 and r24, r24 |
33ba: 69 f0 breq .+26 ; 0x33d6 <CalibrierMittelwert+0x26> |
33bc: 80 91 4e 08 lds r24, 0x084E |
33c0: 90 91 4f 08 lds r25, 0x084F |
33c4: 60 91 5a 08 lds r22, 0x085A |
33c8: 77 27 eor r23, r23 |
33ca: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
33ce: 70 93 cd 0c sts 0x0CCD, r23 |
33d2: 60 93 cc 0c sts 0x0CCC, r22 |
33d6: 80 91 5b 08 lds r24, 0x085B |
33da: 88 23 and r24, r24 |
33dc: 69 f0 breq .+26 ; 0x33f8 <CalibrierMittelwert+0x48> |
33de: 80 91 50 08 lds r24, 0x0850 |
33e2: 90 91 51 08 lds r25, 0x0851 |
33e6: 60 91 5b 08 lds r22, 0x085B |
33ea: 77 27 eor r23, r23 |
33ec: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
33f0: 70 93 cb 0c sts 0x0CCB, r23 |
33f4: 60 93 ca 0c sts 0x0CCA, r22 |
33f8: 80 91 5c 08 lds r24, 0x085C |
33fc: 88 23 and r24, r24 |
33fe: 69 f0 breq .+26 ; 0x341a <CalibrierMittelwert+0x6a> |
3400: 80 91 52 08 lds r24, 0x0852 |
3404: 90 91 53 08 lds r25, 0x0853 |
3408: 60 91 5c 08 lds r22, 0x085C |
340c: 77 27 eor r23, r23 |
340e: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
3412: 70 93 d9 0c sts 0x0CD9, r23 |
3416: 60 93 d8 0c sts 0x0CD8, r22 |
341a: 80 91 5d 08 lds r24, 0x085D |
341e: 88 23 and r24, r24 |
3420: d1 f0 breq .+52 ; 0x3456 <CalibrierMittelwert+0xa6> |
3422: 60 91 56 08 lds r22, 0x0856 |
3426: 70 91 57 08 lds r23, 0x0857 |
342a: 20 91 5d 08 lds r18, 0x085D |
342e: 88 27 eor r24, r24 |
3430: 77 fd sbrc r23, 7 |
3432: 80 95 com r24 |
3434: 98 2f mov r25, r24 |
3436: 34 e0 ldi r19, 0x04 ; 4 |
3438: 66 0f add r22, r22 |
343a: 77 1f adc r23, r23 |
343c: 88 1f adc r24, r24 |
343e: 99 1f adc r25, r25 |
3440: 3a 95 dec r19 |
3442: d1 f7 brne .-12 ; 0x3438 <CalibrierMittelwert+0x88> |
3444: 33 27 eor r19, r19 |
3446: 44 27 eor r20, r20 |
3448: 55 27 eor r21, r21 |
344a: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
344e: 30 93 d6 0c sts 0x0CD6, r19 |
3452: 20 93 d5 0c sts 0x0CD5, r18 |
3456: 80 91 5e 08 lds r24, 0x085E |
345a: 88 23 and r24, r24 |
345c: d1 f0 breq .+52 ; 0x3492 <CalibrierMittelwert+0xe2> |
345e: 60 91 54 08 lds r22, 0x0854 |
3462: 70 91 55 08 lds r23, 0x0855 |
3466: 20 91 5e 08 lds r18, 0x085E |
346a: 88 27 eor r24, r24 |
346c: 77 fd sbrc r23, 7 |
346e: 80 95 com r24 |
3470: 98 2f mov r25, r24 |
3472: b4 e0 ldi r27, 0x04 ; 4 |
3474: 66 0f add r22, r22 |
3476: 77 1f adc r23, r23 |
3478: 88 1f adc r24, r24 |
347a: 99 1f adc r25, r25 |
347c: ba 95 dec r27 |
347e: d1 f7 brne .-12 ; 0x3474 <CalibrierMittelwert+0xc4> |
3480: 33 27 eor r19, r19 |
3482: 44 27 eor r20, r20 |
3484: 55 27 eor r21, r21 |
3486: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
348a: 30 93 df 0c sts 0x0CDF, r19 |
348e: 20 93 de 0c sts 0x0CDE, r18 |
3492: 80 91 5f 08 lds r24, 0x085F |
3496: 88 23 and r24, r24 |
3498: 99 f0 breq .+38 ; 0x34c0 <CalibrierMittelwert+0x110> |
349a: 60 91 58 08 lds r22, 0x0858 |
349e: 70 91 59 08 lds r23, 0x0859 |
34a2: 20 91 5f 08 lds r18, 0x085F |
34a6: 88 27 eor r24, r24 |
34a8: 77 fd sbrc r23, 7 |
34aa: 80 95 com r24 |
34ac: 98 2f mov r25, r24 |
34ae: 33 27 eor r19, r19 |
34b0: 44 27 eor r20, r20 |
34b2: 55 27 eor r21, r21 |
34b4: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
34b8: 30 93 d0 0c sts 0x0CD0, r19 |
34bc: 20 93 cf 0c sts 0x0CCF, r18 |
34c0: 10 92 4f 08 sts 0x084F, r1 |
34c4: 10 92 4e 08 sts 0x084E, r1 |
34c8: 10 92 5a 08 sts 0x085A, r1 |
34cc: 10 92 51 08 sts 0x0851, r1 |
34d0: 10 92 50 08 sts 0x0850, r1 |
34d4: 10 92 5b 08 sts 0x085B, r1 |
34d8: 10 92 53 08 sts 0x0853, r1 |
34dc: 10 92 52 08 sts 0x0852, r1 |
34e0: 10 92 5c 08 sts 0x085C, r1 |
34e4: 10 92 55 08 sts 0x0855, r1 |
34e8: 10 92 54 08 sts 0x0854, r1 |
34ec: 10 92 5e 08 sts 0x085E, r1 |
34f0: 10 92 57 08 sts 0x0857, r1 |
34f4: 10 92 56 08 sts 0x0856, r1 |
34f8: 10 92 5d 08 sts 0x085D, r1 |
34fc: 10 92 59 08 sts 0x0859, r1 |
3500: 10 92 58 08 sts 0x0858, r1 |
3504: 10 92 5f 08 sts 0x085F, r1 |
3508: 8f ee ldi r24, 0xEF ; 239 |
350a: 80 93 7a 00 sts 0x007A, r24 |
350e: 20 91 bf 08 lds r18, 0x08BF |
3512: 30 91 c0 08 lds r19, 0x08C0 |
3516: 80 91 94 0c lds r24, 0x0C94 |
351a: e8 2f mov r30, r24 |
351c: ff 27 eor r31, r31 |
351e: ee 0f add r30, r30 |
3520: ff 1f adc r31, r31 |
3522: ec 5a subi r30, 0xAC ; 172 |
3524: f3 4f sbci r31, 0xF3 ; 243 |
3526: 80 81 ld r24, Z |
3528: 91 81 ldd r25, Z+1 ; 0x01 |
352a: 82 59 subi r24, 0x92 ; 146 |
352c: 9f 4f sbci r25, 0xFF ; 255 |
352e: 28 17 cp r18, r24 |
3530: 39 07 cpc r19, r25 |
3532: 1c f4 brge .+6 ; 0x353a <CalibrierMittelwert+0x18a> |
3534: 2f 5f subi r18, 0xFF ; 255 |
3536: 3f 4f sbci r19, 0xFF ; 255 |
3538: 0c c0 rjmp .+24 ; 0x3552 <CalibrierMittelwert+0x1a2> |
353a: 80 81 ld r24, Z |
353c: 91 81 ldd r25, Z+1 ; 0x01 |
353e: 82 59 subi r24, 0x92 ; 146 |
3540: 9f 4f sbci r25, 0xFF ; 255 |
3542: 82 17 cp r24, r18 |
3544: 93 07 cpc r25, r19 |
3546: 4c f4 brge .+18 ; 0x355a <CalibrierMittelwert+0x1aa> |
3548: 21 15 cp r18, r1 |
354a: 31 05 cpc r19, r1 |
354c: 31 f0 breq .+12 ; 0x355a <CalibrierMittelwert+0x1aa> |
354e: 21 50 subi r18, 0x01 ; 1 |
3550: 30 40 sbci r19, 0x00 ; 0 |
3552: 30 93 c0 08 sts 0x08C0, r19 |
3556: 20 93 bf 08 sts 0x08BF, r18 |
355a: 20 91 c1 08 lds r18, 0x08C1 |
355e: 30 91 c2 08 lds r19, 0x08C2 |
3562: 80 91 95 0c lds r24, 0x0C95 |
3566: e8 2f mov r30, r24 |
3568: ff 27 eor r31, r31 |
356a: ee 0f add r30, r30 |
356c: ff 1f adc r31, r31 |
356e: ec 5a subi r30, 0xAC ; 172 |
3570: f3 4f sbci r31, 0xF3 ; 243 |
3572: 80 81 ld r24, Z |
3574: 91 81 ldd r25, Z+1 ; 0x01 |
3576: 82 59 subi r24, 0x92 ; 146 |
3578: 9f 4f sbci r25, 0xFF ; 255 |
357a: 28 17 cp r18, r24 |
357c: 39 07 cpc r19, r25 |
357e: 1c f4 brge .+6 ; 0x3586 <CalibrierMittelwert+0x1d6> |
3580: 2f 5f subi r18, 0xFF ; 255 |
3582: 3f 4f sbci r19, 0xFF ; 255 |
3584: 0c c0 rjmp .+24 ; 0x359e <CalibrierMittelwert+0x1ee> |
3586: 80 81 ld r24, Z |
3588: 91 81 ldd r25, Z+1 ; 0x01 |
358a: 82 59 subi r24, 0x92 ; 146 |
358c: 9f 4f sbci r25, 0xFF ; 255 |
358e: 82 17 cp r24, r18 |
3590: 93 07 cpc r25, r19 |
3592: 4c f4 brge .+18 ; 0x35a6 <CalibrierMittelwert+0x1f6> |
3594: 21 15 cp r18, r1 |
3596: 31 05 cpc r19, r1 |
3598: 31 f0 breq .+12 ; 0x35a6 <CalibrierMittelwert+0x1f6> |
359a: 21 50 subi r18, 0x01 ; 1 |
359c: 30 40 sbci r19, 0x00 ; 0 |
359e: 30 93 c2 08 sts 0x08C2, r19 |
35a2: 20 93 c1 08 sts 0x08C1, r18 |
35a6: 20 91 c3 08 lds r18, 0x08C3 |
35aa: 30 91 c4 08 lds r19, 0x08C4 |
35ae: 80 91 96 0c lds r24, 0x0C96 |
35b2: e8 2f mov r30, r24 |
35b4: ff 27 eor r31, r31 |
35b6: ee 0f add r30, r30 |
35b8: ff 1f adc r31, r31 |
35ba: ec 5a subi r30, 0xAC ; 172 |
35bc: f3 4f sbci r31, 0xF3 ; 243 |
35be: 80 81 ld r24, Z |
35c0: 91 81 ldd r25, Z+1 ; 0x01 |
35c2: 82 59 subi r24, 0x92 ; 146 |
35c4: 9f 4f sbci r25, 0xFF ; 255 |
35c6: 28 17 cp r18, r24 |
35c8: 39 07 cpc r19, r25 |
35ca: 1c f4 brge .+6 ; 0x35d2 <CalibrierMittelwert+0x222> |
35cc: 2f 5f subi r18, 0xFF ; 255 |
35ce: 3f 4f sbci r19, 0xFF ; 255 |
35d0: 0c c0 rjmp .+24 ; 0x35ea <CalibrierMittelwert+0x23a> |
35d2: 80 81 ld r24, Z |
35d4: 91 81 ldd r25, Z+1 ; 0x01 |
35d6: 82 59 subi r24, 0x92 ; 146 |
35d8: 9f 4f sbci r25, 0xFF ; 255 |
35da: 82 17 cp r24, r18 |
35dc: 93 07 cpc r25, r19 |
35de: 4c f4 brge .+18 ; 0x35f2 <CalibrierMittelwert+0x242> |
35e0: 21 15 cp r18, r1 |
35e2: 31 05 cpc r19, r1 |
35e4: 31 f0 breq .+12 ; 0x35f2 <CalibrierMittelwert+0x242> |
35e6: 21 50 subi r18, 0x01 ; 1 |
35e8: 30 40 sbci r19, 0x00 ; 0 |
35ea: 30 93 c4 08 sts 0x08C4, r19 |
35ee: 20 93 c3 08 sts 0x08C3, r18 |
35f2: 20 91 c5 08 lds r18, 0x08C5 |
35f6: 30 91 c6 08 lds r19, 0x08C6 |
35fa: 80 91 97 0c lds r24, 0x0C97 |
35fe: e8 2f mov r30, r24 |
3600: ff 27 eor r31, r31 |
3602: ee 0f add r30, r30 |
3604: ff 1f adc r31, r31 |
3606: ec 5a subi r30, 0xAC ; 172 |
3608: f3 4f sbci r31, 0xF3 ; 243 |
360a: 80 81 ld r24, Z |
360c: 91 81 ldd r25, Z+1 ; 0x01 |
360e: 82 59 subi r24, 0x92 ; 146 |
3610: 9f 4f sbci r25, 0xFF ; 255 |
3612: 28 17 cp r18, r24 |
3614: 39 07 cpc r19, r25 |
3616: 1c f4 brge .+6 ; 0x361e <CalibrierMittelwert+0x26e> |
3618: 2f 5f subi r18, 0xFF ; 255 |
361a: 3f 4f sbci r19, 0xFF ; 255 |
361c: 0c c0 rjmp .+24 ; 0x3636 <CalibrierMittelwert+0x286> |
361e: 80 81 ld r24, Z |
3620: 91 81 ldd r25, Z+1 ; 0x01 |
3622: 82 59 subi r24, 0x92 ; 146 |
3624: 9f 4f sbci r25, 0xFF ; 255 |
3626: 82 17 cp r24, r18 |
3628: 93 07 cpc r25, r19 |
362a: 4c f4 brge .+18 ; 0x363e <CalibrierMittelwert+0x28e> |
362c: 21 15 cp r18, r1 |
362e: 31 05 cpc r19, r1 |
3630: 31 f0 breq .+12 ; 0x363e <CalibrierMittelwert+0x28e> |
3632: 21 50 subi r18, 0x01 ; 1 |
3634: 30 40 sbci r19, 0x00 ; 0 |
3636: 30 93 c6 08 sts 0x08C6, r19 |
363a: 20 93 c5 08 sts 0x08C5, r18 |
363e: 20 91 c7 08 lds r18, 0x08C7 |
3642: 30 91 c8 08 lds r19, 0x08C8 |
3646: 80 91 66 0c lds r24, 0x0C66 |
364a: 90 91 67 0c lds r25, 0x0C67 |
364e: 82 59 subi r24, 0x92 ; 146 |
3650: 9f 4f sbci r25, 0xFF ; 255 |
3652: 28 17 cp r18, r24 |
3654: 39 07 cpc r19, r25 |
3656: 1c f4 brge .+6 ; 0x365e <CalibrierMittelwert+0x2ae> |
3658: 2f 5f subi r18, 0xFF ; 255 |
365a: 3f 4f sbci r19, 0xFF ; 255 |
365c: 0e c0 rjmp .+28 ; 0x367a <CalibrierMittelwert+0x2ca> |
365e: 80 91 66 0c lds r24, 0x0C66 |
3662: 90 91 67 0c lds r25, 0x0C67 |
3666: 82 59 subi r24, 0x92 ; 146 |
3668: 9f 4f sbci r25, 0xFF ; 255 |
366a: 82 17 cp r24, r18 |
366c: 93 07 cpc r25, r19 |
366e: 4c f4 brge .+18 ; 0x3682 <CalibrierMittelwert+0x2d2> |
3670: 21 15 cp r18, r1 |
3672: 31 05 cpc r19, r1 |
3674: 31 f0 breq .+12 ; 0x3682 <CalibrierMittelwert+0x2d2> |
3676: 21 50 subi r18, 0x01 ; 1 |
3678: 30 40 sbci r19, 0x00 ; 0 |
367a: 30 93 c8 08 sts 0x08C8, r19 |
367e: 20 93 c7 08 sts 0x08C7, r18 |
3682: 20 91 c9 08 lds r18, 0x08C9 |
3686: 30 91 ca 08 lds r19, 0x08CA |
368a: 80 91 68 0c lds r24, 0x0C68 |
368e: 90 91 69 0c lds r25, 0x0C69 |
3692: 82 59 subi r24, 0x92 ; 146 |
3694: 9f 4f sbci r25, 0xFF ; 255 |
3696: 28 17 cp r18, r24 |
3698: 39 07 cpc r19, r25 |
369a: 1c f4 brge .+6 ; 0x36a2 <CalibrierMittelwert+0x2f2> |
369c: 2f 5f subi r18, 0xFF ; 255 |
369e: 3f 4f sbci r19, 0xFF ; 255 |
36a0: 0e c0 rjmp .+28 ; 0x36be <CalibrierMittelwert+0x30e> |
36a2: 80 91 68 0c lds r24, 0x0C68 |
36a6: 90 91 69 0c lds r25, 0x0C69 |
36aa: 82 59 subi r24, 0x92 ; 146 |
36ac: 9f 4f sbci r25, 0xFF ; 255 |
36ae: 82 17 cp r24, r18 |
36b0: 93 07 cpc r25, r19 |
36b2: 4c f4 brge .+18 ; 0x36c6 <CalibrierMittelwert+0x316> |
36b4: 21 15 cp r18, r1 |
36b6: 31 05 cpc r19, r1 |
36b8: 31 f0 breq .+12 ; 0x36c6 <CalibrierMittelwert+0x316> |
36ba: 21 50 subi r18, 0x01 ; 1 |
36bc: 30 40 sbci r19, 0x00 ; 0 |
36be: 30 93 ca 08 sts 0x08CA, r19 |
36c2: 20 93 c9 08 sts 0x08C9, r18 |
36c6: 20 91 cb 08 lds r18, 0x08CB |
36ca: 30 91 cc 08 lds r19, 0x08CC |
36ce: 80 91 6a 0c lds r24, 0x0C6A |
36d2: 90 91 6b 0c lds r25, 0x0C6B |
36d6: 82 59 subi r24, 0x92 ; 146 |
36d8: 9f 4f sbci r25, 0xFF ; 255 |
36da: 28 17 cp r18, r24 |
36dc: 39 07 cpc r19, r25 |
36de: 1c f4 brge .+6 ; 0x36e6 <CalibrierMittelwert+0x336> |
36e0: 2f 5f subi r18, 0xFF ; 255 |
36e2: 3f 4f sbci r19, 0xFF ; 255 |
36e4: 0e c0 rjmp .+28 ; 0x3702 <CalibrierMittelwert+0x352> |
36e6: 80 91 6a 0c lds r24, 0x0C6A |
36ea: 90 91 6b 0c lds r25, 0x0C6B |
36ee: 82 59 subi r24, 0x92 ; 146 |
36f0: 9f 4f sbci r25, 0xFF ; 255 |
36f2: 82 17 cp r24, r18 |
36f4: 93 07 cpc r25, r19 |
36f6: 4c f4 brge .+18 ; 0x370a <CalibrierMittelwert+0x35a> |
36f8: 21 15 cp r18, r1 |
36fa: 31 05 cpc r19, r1 |
36fc: 31 f0 breq .+12 ; 0x370a <CalibrierMittelwert+0x35a> |
36fe: 21 50 subi r18, 0x01 ; 1 |
3700: 30 40 sbci r19, 0x00 ; 0 |
3702: 30 93 cc 08 sts 0x08CC, r19 |
3706: 20 93 cb 08 sts 0x08CB, r18 |
370a: 20 91 cd 08 lds r18, 0x08CD |
370e: 30 91 ce 08 lds r19, 0x08CE |
3712: 80 91 6c 0c lds r24, 0x0C6C |
3716: 90 91 6d 0c lds r25, 0x0C6D |
371a: 82 59 subi r24, 0x92 ; 146 |
371c: 9f 4f sbci r25, 0xFF ; 255 |
371e: 28 17 cp r18, r24 |
3720: 39 07 cpc r19, r25 |
3722: 1c f4 brge .+6 ; 0x372a <CalibrierMittelwert+0x37a> |
3724: 2f 5f subi r18, 0xFF ; 255 |
3726: 3f 4f sbci r19, 0xFF ; 255 |
3728: 0e c0 rjmp .+28 ; 0x3746 <CalibrierMittelwert+0x396> |
372a: 80 91 6c 0c lds r24, 0x0C6C |
372e: 90 91 6d 0c lds r25, 0x0C6D |
3732: 82 59 subi r24, 0x92 ; 146 |
3734: 9f 4f sbci r25, 0xFF ; 255 |
3736: 82 17 cp r24, r18 |
3738: 93 07 cpc r25, r19 |
373a: 4c f4 brge .+18 ; 0x374e <CalibrierMittelwert+0x39e> |
373c: 21 15 cp r18, r1 |
373e: 31 05 cpc r19, r1 |
3740: 31 f0 breq .+12 ; 0x374e <CalibrierMittelwert+0x39e> |
3742: 21 50 subi r18, 0x01 ; 1 |
3744: 30 40 sbci r19, 0x00 ; 0 |
3746: 30 93 ce 08 sts 0x08CE, r19 |
374a: 20 93 cd 08 sts 0x08CD, r18 |
374e: 80 91 bf 08 lds r24, 0x08BF |
3752: 90 91 c0 08 lds r25, 0x08C0 |
3756: 97 ff sbrs r25, 7 |
3758: 05 c0 rjmp .+10 ; 0x3764 <CalibrierMittelwert+0x3b4> |
375a: 10 92 c0 08 sts 0x08C0, r1 |
375e: 10 92 bf 08 sts 0x08BF, r1 |
3762: 0a c0 rjmp .+20 ; 0x3778 <CalibrierMittelwert+0x3c8> |
3764: 8f 3f cpi r24, 0xFF ; 255 |
3766: 91 05 cpc r25, r1 |
3768: 39 f0 breq .+14 ; 0x3778 <CalibrierMittelwert+0x3c8> |
376a: 34 f0 brlt .+12 ; 0x3778 <CalibrierMittelwert+0x3c8> |
376c: 8f ef ldi r24, 0xFF ; 255 |
376e: 90 e0 ldi r25, 0x00 ; 0 |
3770: 90 93 c0 08 sts 0x08C0, r25 |
3774: 80 93 bf 08 sts 0x08BF, r24 |
3778: 80 91 c1 08 lds r24, 0x08C1 |
377c: 90 91 c2 08 lds r25, 0x08C2 |
3780: 97 ff sbrs r25, 7 |
3782: 05 c0 rjmp .+10 ; 0x378e <CalibrierMittelwert+0x3de> |
3784: 10 92 c2 08 sts 0x08C2, r1 |
3788: 10 92 c1 08 sts 0x08C1, r1 |
378c: 0a c0 rjmp .+20 ; 0x37a2 <CalibrierMittelwert+0x3f2> |
378e: 8f 3f cpi r24, 0xFF ; 255 |
3790: 91 05 cpc r25, r1 |
3792: 39 f0 breq .+14 ; 0x37a2 <CalibrierMittelwert+0x3f2> |
3794: 34 f0 brlt .+12 ; 0x37a2 <CalibrierMittelwert+0x3f2> |
3796: 8f ef ldi r24, 0xFF ; 255 |
3798: 90 e0 ldi r25, 0x00 ; 0 |
379a: 90 93 c2 08 sts 0x08C2, r25 |
379e: 80 93 c1 08 sts 0x08C1, r24 |
37a2: 80 91 c3 08 lds r24, 0x08C3 |
37a6: 90 91 c4 08 lds r25, 0x08C4 |
37aa: 97 ff sbrs r25, 7 |
37ac: 05 c0 rjmp .+10 ; 0x37b8 <CalibrierMittelwert+0x408> |
37ae: 10 92 c4 08 sts 0x08C4, r1 |
37b2: 10 92 c3 08 sts 0x08C3, r1 |
37b6: 0a c0 rjmp .+20 ; 0x37cc <CalibrierMittelwert+0x41c> |
37b8: 8f 3f cpi r24, 0xFF ; 255 |
37ba: 91 05 cpc r25, r1 |
37bc: 39 f0 breq .+14 ; 0x37cc <CalibrierMittelwert+0x41c> |
37be: 34 f0 brlt .+12 ; 0x37cc <CalibrierMittelwert+0x41c> |
37c0: 8f ef ldi r24, 0xFF ; 255 |
37c2: 90 e0 ldi r25, 0x00 ; 0 |
37c4: 90 93 c4 08 sts 0x08C4, r25 |
37c8: 80 93 c3 08 sts 0x08C3, r24 |
37cc: 80 91 c5 08 lds r24, 0x08C5 |
37d0: 90 91 c6 08 lds r25, 0x08C6 |
37d4: 97 ff sbrs r25, 7 |
37d6: 05 c0 rjmp .+10 ; 0x37e2 <CalibrierMittelwert+0x432> |
37d8: 10 92 c6 08 sts 0x08C6, r1 |
37dc: 10 92 c5 08 sts 0x08C5, r1 |
37e0: 0a c0 rjmp .+20 ; 0x37f6 <CalibrierMittelwert+0x446> |
37e2: 8f 3f cpi r24, 0xFF ; 255 |
37e4: 91 05 cpc r25, r1 |
37e6: 39 f0 breq .+14 ; 0x37f6 <CalibrierMittelwert+0x446> |
37e8: 34 f0 brlt .+12 ; 0x37f6 <CalibrierMittelwert+0x446> |
37ea: 8f ef ldi r24, 0xFF ; 255 |
37ec: 90 e0 ldi r25, 0x00 ; 0 |
37ee: 90 93 c6 08 sts 0x08C6, r25 |
37f2: 80 93 c5 08 sts 0x08C5, r24 |
37f6: 80 91 c7 08 lds r24, 0x08C7 |
37fa: 90 91 c8 08 lds r25, 0x08C8 |
37fe: 97 ff sbrs r25, 7 |
3800: 05 c0 rjmp .+10 ; 0x380c <CalibrierMittelwert+0x45c> |
3802: 10 92 c8 08 sts 0x08C8, r1 |
3806: 10 92 c7 08 sts 0x08C7, r1 |
380a: 0a c0 rjmp .+20 ; 0x3820 <CalibrierMittelwert+0x470> |
380c: 8f 3f cpi r24, 0xFF ; 255 |
380e: 91 05 cpc r25, r1 |
3810: 39 f0 breq .+14 ; 0x3820 <CalibrierMittelwert+0x470> |
3812: 34 f0 brlt .+12 ; 0x3820 <CalibrierMittelwert+0x470> |
3814: 8f ef ldi r24, 0xFF ; 255 |
3816: 90 e0 ldi r25, 0x00 ; 0 |
3818: 90 93 c8 08 sts 0x08C8, r25 |
381c: 80 93 c7 08 sts 0x08C7, r24 |
3820: 80 91 c9 08 lds r24, 0x08C9 |
3824: 90 91 ca 08 lds r25, 0x08CA |
3828: 97 ff sbrs r25, 7 |
382a: 05 c0 rjmp .+10 ; 0x3836 <CalibrierMittelwert+0x486> |
382c: 10 92 ca 08 sts 0x08CA, r1 |
3830: 10 92 c9 08 sts 0x08C9, r1 |
3834: 0a c0 rjmp .+20 ; 0x384a <CalibrierMittelwert+0x49a> |
3836: 8f 3f cpi r24, 0xFF ; 255 |
3838: 91 05 cpc r25, r1 |
383a: 39 f0 breq .+14 ; 0x384a <CalibrierMittelwert+0x49a> |
383c: 34 f0 brlt .+12 ; 0x384a <CalibrierMittelwert+0x49a> |
383e: 8f ef ldi r24, 0xFF ; 255 |
3840: 90 e0 ldi r25, 0x00 ; 0 |
3842: 90 93 ca 08 sts 0x08CA, r25 |
3846: 80 93 c9 08 sts 0x08C9, r24 |
384a: 80 91 cb 08 lds r24, 0x08CB |
384e: 90 91 cc 08 lds r25, 0x08CC |
3852: 97 ff sbrs r25, 7 |
3854: 05 c0 rjmp .+10 ; 0x3860 <CalibrierMittelwert+0x4b0> |
3856: 10 92 cc 08 sts 0x08CC, r1 |
385a: 10 92 cb 08 sts 0x08CB, r1 |
385e: 0a c0 rjmp .+20 ; 0x3874 <CalibrierMittelwert+0x4c4> |
3860: 8f 3f cpi r24, 0xFF ; 255 |
3862: 91 05 cpc r25, r1 |
3864: 39 f0 breq .+14 ; 0x3874 <CalibrierMittelwert+0x4c4> |
3866: 34 f0 brlt .+12 ; 0x3874 <CalibrierMittelwert+0x4c4> |
3868: 8f ef ldi r24, 0xFF ; 255 |
386a: 90 e0 ldi r25, 0x00 ; 0 |
386c: 90 93 cc 08 sts 0x08CC, r25 |
3870: 80 93 cb 08 sts 0x08CB, r24 |
3874: 80 91 cd 08 lds r24, 0x08CD |
3878: 90 91 ce 08 lds r25, 0x08CE |
387c: 97 ff sbrs r25, 7 |
387e: 05 c0 rjmp .+10 ; 0x388a <CalibrierMittelwert+0x4da> |
3880: 10 92 ce 08 sts 0x08CE, r1 |
3884: 10 92 cd 08 sts 0x08CD, r1 |
3888: 08 95 ret |
388a: 8f 3f cpi r24, 0xFF ; 255 |
388c: 91 05 cpc r25, r1 |
388e: 39 f0 breq .+14 ; 0x389e <CalibrierMittelwert+0x4ee> |
3890: 34 f0 brlt .+12 ; 0x389e <CalibrierMittelwert+0x4ee> |
3892: 8f ef ldi r24, 0xFF ; 255 |
3894: 90 e0 ldi r25, 0x00 ; 0 |
3896: 90 93 ce 08 sts 0x08CE, r25 |
389a: 80 93 cd 08 sts 0x08CD, r24 |
389e: 08 95 ret |
000038a0 <ParameterZuordnung>: |
38a0: 1f 93 push r17 |
38a2: 80 91 9b 0c lds r24, 0x0C9B |
38a6: 8b 3f cpi r24, 0xFB ; 251 |
38a8: 98 f0 brcs .+38 ; 0x38d0 <ParameterZuordnung+0x30> |
38aa: 8b 3f cpi r24, 0xFB ; 251 |
38ac: 19 f4 brne .+6 ; 0x38b4 <ParameterZuordnung+0x14> |
38ae: 80 91 bf 08 lds r24, 0x08BF |
38b2: 0e c0 rjmp .+28 ; 0x38d0 <ParameterZuordnung+0x30> |
38b4: 8c 3f cpi r24, 0xFC ; 252 |
38b6: 19 f4 brne .+6 ; 0x38be <ParameterZuordnung+0x1e> |
38b8: 80 91 c1 08 lds r24, 0x08C1 |
38bc: 09 c0 rjmp .+18 ; 0x38d0 <ParameterZuordnung+0x30> |
38be: 8d 3f cpi r24, 0xFD ; 253 |
38c0: 19 f4 brne .+6 ; 0x38c8 <ParameterZuordnung+0x28> |
38c2: 80 91 c3 08 lds r24, 0x08C3 |
38c6: 04 c0 rjmp .+8 ; 0x38d0 <ParameterZuordnung+0x30> |
38c8: 8e 3f cpi r24, 0xFE ; 254 |
38ca: 21 f4 brne .+8 ; 0x38d4 <ParameterZuordnung+0x34> |
38cc: 80 91 c5 08 lds r24, 0x08C5 |
38d0: 80 93 81 01 sts 0x0181, r24 |
38d4: 80 91 81 01 lds r24, 0x0181 |
38d8: 88 23 and r24, r24 |
38da: 19 f4 brne .+6 ; 0x38e2 <ParameterZuordnung+0x42> |
38dc: 10 92 81 01 sts 0x0181, r1 |
38e0: 04 c0 rjmp .+8 ; 0x38ea <ParameterZuordnung+0x4a> |
38e2: 8f 3f cpi r24, 0xFF ; 255 |
38e4: 11 f4 brne .+4 ; 0x38ea <ParameterZuordnung+0x4a> |
38e6: 80 93 81 01 sts 0x0181, r24 |
38ea: 80 91 9a 0c lds r24, 0x0C9A |
38ee: 8b 3f cpi r24, 0xFB ; 251 |
38f0: 98 f0 brcs .+38 ; 0x3918 <ParameterZuordnung+0x78> |
38f2: 8b 3f cpi r24, 0xFB ; 251 |
38f4: 19 f4 brne .+6 ; 0x38fc <ParameterZuordnung+0x5c> |
38f6: 80 91 bf 08 lds r24, 0x08BF |
38fa: 0e c0 rjmp .+28 ; 0x3918 <ParameterZuordnung+0x78> |
38fc: 8c 3f cpi r24, 0xFC ; 252 |
38fe: 19 f4 brne .+6 ; 0x3906 <ParameterZuordnung+0x66> |
3900: 80 91 c1 08 lds r24, 0x08C1 |
3904: 09 c0 rjmp .+18 ; 0x3918 <ParameterZuordnung+0x78> |
3906: 8d 3f cpi r24, 0xFD ; 253 |
3908: 19 f4 brne .+6 ; 0x3910 <ParameterZuordnung+0x70> |
390a: 80 91 c3 08 lds r24, 0x08C3 |
390e: 04 c0 rjmp .+8 ; 0x3918 <ParameterZuordnung+0x78> |
3910: 8e 3f cpi r24, 0xFE ; 254 |
3912: 21 f4 brne .+8 ; 0x391c <ParameterZuordnung+0x7c> |
3914: 80 91 c5 08 lds r24, 0x08C5 |
3918: 80 93 80 01 sts 0x0180, r24 |
391c: 80 91 80 01 lds r24, 0x0180 |
3920: 88 23 and r24, r24 |
3922: 19 f4 brne .+6 ; 0x392a <ParameterZuordnung+0x8a> |
3924: 10 92 80 01 sts 0x0180, r1 |
3928: 05 c0 rjmp .+10 ; 0x3934 <ParameterZuordnung+0x94> |
392a: 84 36 cpi r24, 0x64 ; 100 |
392c: 18 f0 brcs .+6 ; 0x3934 <ParameterZuordnung+0x94> |
392e: 84 e6 ldi r24, 0x64 ; 100 |
3930: 80 93 80 01 sts 0x0180, r24 |
3934: 80 91 9c 0c lds r24, 0x0C9C |
3938: 8b 3f cpi r24, 0xFB ; 251 |
393a: 98 f0 brcs .+38 ; 0x3962 <ParameterZuordnung+0xc2> |
393c: 8b 3f cpi r24, 0xFB ; 251 |
393e: 19 f4 brne .+6 ; 0x3946 <ParameterZuordnung+0xa6> |
3940: 80 91 bf 08 lds r24, 0x08BF |
3944: 0e c0 rjmp .+28 ; 0x3962 <ParameterZuordnung+0xc2> |
3946: 8c 3f cpi r24, 0xFC ; 252 |
3948: 19 f4 brne .+6 ; 0x3950 <ParameterZuordnung+0xb0> |
394a: 80 91 c1 08 lds r24, 0x08C1 |
394e: 09 c0 rjmp .+18 ; 0x3962 <ParameterZuordnung+0xc2> |
3950: 8d 3f cpi r24, 0xFD ; 253 |
3952: 19 f4 brne .+6 ; 0x395a <ParameterZuordnung+0xba> |
3954: 80 91 c3 08 lds r24, 0x08C3 |
3958: 04 c0 rjmp .+8 ; 0x3962 <ParameterZuordnung+0xc2> |
395a: 8e 3f cpi r24, 0xFE ; 254 |
395c: 21 f4 brne .+8 ; 0x3966 <ParameterZuordnung+0xc6> |
395e: 80 91 c5 08 lds r24, 0x08C5 |
3962: 80 93 82 01 sts 0x0182, r24 |
3966: 80 91 82 01 lds r24, 0x0182 |
396a: 88 23 and r24, r24 |
396c: 19 f4 brne .+6 ; 0x3974 <ParameterZuordnung+0xd4> |
396e: 10 92 82 01 sts 0x0182, r1 |
3972: 05 c0 rjmp .+10 ; 0x397e <ParameterZuordnung+0xde> |
3974: 84 36 cpi r24, 0x64 ; 100 |
3976: 18 f0 brcs .+6 ; 0x397e <ParameterZuordnung+0xde> |
3978: 84 e6 ldi r24, 0x64 ; 100 |
397a: 80 93 82 01 sts 0x0182, r24 |
397e: 80 91 9e 0c lds r24, 0x0C9E |
3982: 8b 3f cpi r24, 0xFB ; 251 |
3984: 98 f0 brcs .+38 ; 0x39ac <ParameterZuordnung+0x10c> |
3986: 8b 3f cpi r24, 0xFB ; 251 |
3988: 19 f4 brne .+6 ; 0x3990 <ParameterZuordnung+0xf0> |
398a: 80 91 bf 08 lds r24, 0x08BF |
398e: 0e c0 rjmp .+28 ; 0x39ac <ParameterZuordnung+0x10c> |
3990: 8c 3f cpi r24, 0xFC ; 252 |
3992: 19 f4 brne .+6 ; 0x399a <ParameterZuordnung+0xfa> |
3994: 80 91 c1 08 lds r24, 0x08C1 |
3998: 09 c0 rjmp .+18 ; 0x39ac <ParameterZuordnung+0x10c> |
399a: 8d 3f cpi r24, 0xFD ; 253 |
399c: 19 f4 brne .+6 ; 0x39a4 <ParameterZuordnung+0x104> |
399e: 80 91 c3 08 lds r24, 0x08C3 |
39a2: 04 c0 rjmp .+8 ; 0x39ac <ParameterZuordnung+0x10c> |
39a4: 8e 3f cpi r24, 0xFE ; 254 |
39a6: 21 f4 brne .+8 ; 0x39b0 <ParameterZuordnung+0x110> |
39a8: 80 91 c5 08 lds r24, 0x08C5 |
39ac: 80 93 83 01 sts 0x0183, r24 |
39b0: 80 91 83 01 lds r24, 0x0183 |
39b4: 88 23 and r24, r24 |
39b6: 19 f4 brne .+6 ; 0x39be <ParameterZuordnung+0x11e> |
39b8: 10 92 83 01 sts 0x0183, r1 |
39bc: 04 c0 rjmp .+8 ; 0x39c6 <ParameterZuordnung+0x126> |
39be: 8f 3f cpi r24, 0xFF ; 255 |
39c0: 11 f4 brne .+4 ; 0x39c6 <ParameterZuordnung+0x126> |
39c2: 80 93 83 01 sts 0x0183, r24 |
39c6: 80 91 a5 0c lds r24, 0x0CA5 |
39ca: 8b 3f cpi r24, 0xFB ; 251 |
39cc: 98 f0 brcs .+38 ; 0x39f4 <ParameterZuordnung+0x154> |
39ce: 8b 3f cpi r24, 0xFB ; 251 |
39d0: 19 f4 brne .+6 ; 0x39d8 <ParameterZuordnung+0x138> |
39d2: 80 91 bf 08 lds r24, 0x08BF |
39d6: 0e c0 rjmp .+28 ; 0x39f4 <ParameterZuordnung+0x154> |
39d8: 8c 3f cpi r24, 0xFC ; 252 |
39da: 19 f4 brne .+6 ; 0x39e2 <ParameterZuordnung+0x142> |
39dc: 80 91 c1 08 lds r24, 0x08C1 |
39e0: 09 c0 rjmp .+18 ; 0x39f4 <ParameterZuordnung+0x154> |
39e2: 8d 3f cpi r24, 0xFD ; 253 |
39e4: 19 f4 brne .+6 ; 0x39ec <ParameterZuordnung+0x14c> |
39e6: 80 91 c3 08 lds r24, 0x08C3 |
39ea: 04 c0 rjmp .+8 ; 0x39f4 <ParameterZuordnung+0x154> |
39ec: 8e 3f cpi r24, 0xFE ; 254 |
39ee: 21 f4 brne .+8 ; 0x39f8 <ParameterZuordnung+0x158> |
39f0: 80 91 c5 08 lds r24, 0x08C5 |
39f4: 80 93 84 01 sts 0x0184, r24 |
39f8: 80 91 84 01 lds r24, 0x0184 |
39fc: 88 23 and r24, r24 |
39fe: 19 f4 brne .+6 ; 0x3a06 <ParameterZuordnung+0x166> |
3a00: 10 92 84 01 sts 0x0184, r1 |
3a04: 04 c0 rjmp .+8 ; 0x3a0e <ParameterZuordnung+0x16e> |
3a06: 8f 3f cpi r24, 0xFF ; 255 |
3a08: 11 f4 brne .+4 ; 0x3a0e <ParameterZuordnung+0x16e> |
3a0a: 80 93 84 01 sts 0x0184, r24 |
3a0e: 80 91 a6 0c lds r24, 0x0CA6 |
3a12: 8b 3f cpi r24, 0xFB ; 251 |
3a14: 98 f0 brcs .+38 ; 0x3a3c <ParameterZuordnung+0x19c> |
3a16: 8b 3f cpi r24, 0xFB ; 251 |
3a18: 19 f4 brne .+6 ; 0x3a20 <ParameterZuordnung+0x180> |
3a1a: 80 91 bf 08 lds r24, 0x08BF |
3a1e: 0e c0 rjmp .+28 ; 0x3a3c <ParameterZuordnung+0x19c> |
3a20: 8c 3f cpi r24, 0xFC ; 252 |
3a22: 19 f4 brne .+6 ; 0x3a2a <ParameterZuordnung+0x18a> |
3a24: 80 91 c1 08 lds r24, 0x08C1 |
3a28: 09 c0 rjmp .+18 ; 0x3a3c <ParameterZuordnung+0x19c> |
3a2a: 8d 3f cpi r24, 0xFD ; 253 |
3a2c: 19 f4 brne .+6 ; 0x3a34 <ParameterZuordnung+0x194> |
3a2e: 80 91 c3 08 lds r24, 0x08C3 |
3a32: 04 c0 rjmp .+8 ; 0x3a3c <ParameterZuordnung+0x19c> |
3a34: 8e 3f cpi r24, 0xFE ; 254 |
3a36: 21 f4 brne .+8 ; 0x3a40 <ParameterZuordnung+0x1a0> |
3a38: 80 91 c5 08 lds r24, 0x08C5 |
3a3c: 80 93 85 01 sts 0x0185, r24 |
3a40: 80 91 85 01 lds r24, 0x0185 |
3a44: 8b 30 cpi r24, 0x0B ; 11 |
3a46: 10 f4 brcc .+4 ; 0x3a4c <ParameterZuordnung+0x1ac> |
3a48: 8a e0 ldi r24, 0x0A ; 10 |
3a4a: 02 c0 rjmp .+4 ; 0x3a50 <ParameterZuordnung+0x1b0> |
3a4c: 8f 3f cpi r24, 0xFF ; 255 |
3a4e: 11 f4 brne .+4 ; 0x3a54 <ParameterZuordnung+0x1b4> |
3a50: 80 93 85 01 sts 0x0185, r24 |
3a54: 80 91 a7 0c lds r24, 0x0CA7 |
3a58: 8b 3f cpi r24, 0xFB ; 251 |
3a5a: 98 f0 brcs .+38 ; 0x3a82 <ParameterZuordnung+0x1e2> |
3a5c: 8b 3f cpi r24, 0xFB ; 251 |
3a5e: 19 f4 brne .+6 ; 0x3a66 <ParameterZuordnung+0x1c6> |
3a60: 80 91 bf 08 lds r24, 0x08BF |
3a64: 0e c0 rjmp .+28 ; 0x3a82 <ParameterZuordnung+0x1e2> |
3a66: 8c 3f cpi r24, 0xFC ; 252 |
3a68: 19 f4 brne .+6 ; 0x3a70 <ParameterZuordnung+0x1d0> |
3a6a: 80 91 c1 08 lds r24, 0x08C1 |
3a6e: 09 c0 rjmp .+18 ; 0x3a82 <ParameterZuordnung+0x1e2> |
3a70: 8d 3f cpi r24, 0xFD ; 253 |
3a72: 19 f4 brne .+6 ; 0x3a7a <ParameterZuordnung+0x1da> |
3a74: 80 91 c3 08 lds r24, 0x08C3 |
3a78: 04 c0 rjmp .+8 ; 0x3a82 <ParameterZuordnung+0x1e2> |
3a7a: 8e 3f cpi r24, 0xFE ; 254 |
3a7c: 21 f4 brne .+8 ; 0x3a86 <ParameterZuordnung+0x1e6> |
3a7e: 80 91 c5 08 lds r24, 0x08C5 |
3a82: 80 93 86 01 sts 0x0186, r24 |
3a86: 80 91 86 01 lds r24, 0x0186 |
3a8a: 88 23 and r24, r24 |
3a8c: 19 f4 brne .+6 ; 0x3a94 <ParameterZuordnung+0x1f4> |
3a8e: 10 92 86 01 sts 0x0186, r1 |
3a92: 04 c0 rjmp .+8 ; 0x3a9c <ParameterZuordnung+0x1fc> |
3a94: 8f 3f cpi r24, 0xFF ; 255 |
3a96: 11 f4 brne .+4 ; 0x3a9c <ParameterZuordnung+0x1fc> |
3a98: 80 93 86 01 sts 0x0186, r24 |
3a9c: 80 91 ac 0c lds r24, 0x0CAC |
3aa0: 8b 3f cpi r24, 0xFB ; 251 |
3aa2: 98 f0 brcs .+38 ; 0x3aca <ParameterZuordnung+0x22a> |
3aa4: 8b 3f cpi r24, 0xFB ; 251 |
3aa6: 19 f4 brne .+6 ; 0x3aae <ParameterZuordnung+0x20e> |
3aa8: 80 91 bf 08 lds r24, 0x08BF |
3aac: 0e c0 rjmp .+28 ; 0x3aca <ParameterZuordnung+0x22a> |
3aae: 8c 3f cpi r24, 0xFC ; 252 |
3ab0: 19 f4 brne .+6 ; 0x3ab8 <ParameterZuordnung+0x218> |
3ab2: 80 91 c1 08 lds r24, 0x08C1 |
3ab6: 09 c0 rjmp .+18 ; 0x3aca <ParameterZuordnung+0x22a> |
3ab8: 8d 3f cpi r24, 0xFD ; 253 |
3aba: 19 f4 brne .+6 ; 0x3ac2 <ParameterZuordnung+0x222> |
3abc: 80 91 c3 08 lds r24, 0x08C3 |
3ac0: 04 c0 rjmp .+8 ; 0x3aca <ParameterZuordnung+0x22a> |
3ac2: 8e 3f cpi r24, 0xFE ; 254 |
3ac4: 21 f4 brne .+8 ; 0x3ace <ParameterZuordnung+0x22e> |
3ac6: 80 91 c5 08 lds r24, 0x08C5 |
3aca: 80 93 88 01 sts 0x0188, r24 |
3ace: 80 91 88 01 lds r24, 0x0188 |
3ad2: 88 23 and r24, r24 |
3ad4: 19 f4 brne .+6 ; 0x3adc <ParameterZuordnung+0x23c> |
3ad6: 10 92 88 01 sts 0x0188, r1 |
3ada: 04 c0 rjmp .+8 ; 0x3ae4 <ParameterZuordnung+0x244> |
3adc: 8f 3f cpi r24, 0xFF ; 255 |
3ade: 11 f4 brne .+4 ; 0x3ae4 <ParameterZuordnung+0x244> |
3ae0: 80 93 88 01 sts 0x0188, r24 |
3ae4: 80 91 ad 0c lds r24, 0x0CAD |
3ae8: 8b 3f cpi r24, 0xFB ; 251 |
3aea: 98 f0 brcs .+38 ; 0x3b12 <ParameterZuordnung+0x272> |
3aec: 8b 3f cpi r24, 0xFB ; 251 |
3aee: 19 f4 brne .+6 ; 0x3af6 <ParameterZuordnung+0x256> |
3af0: 80 91 bf 08 lds r24, 0x08BF |
3af4: 0e c0 rjmp .+28 ; 0x3b12 <ParameterZuordnung+0x272> |
3af6: 8c 3f cpi r24, 0xFC ; 252 |
3af8: 19 f4 brne .+6 ; 0x3b00 <ParameterZuordnung+0x260> |
3afa: 80 91 c1 08 lds r24, 0x08C1 |
3afe: 09 c0 rjmp .+18 ; 0x3b12 <ParameterZuordnung+0x272> |
3b00: 8d 3f cpi r24, 0xFD ; 253 |
3b02: 19 f4 brne .+6 ; 0x3b0a <ParameterZuordnung+0x26a> |
3b04: 80 91 c3 08 lds r24, 0x08C3 |
3b08: 04 c0 rjmp .+8 ; 0x3b12 <ParameterZuordnung+0x272> |
3b0a: 8e 3f cpi r24, 0xFE ; 254 |
3b0c: 21 f4 brne .+8 ; 0x3b16 <ParameterZuordnung+0x276> |
3b0e: 80 91 c5 08 lds r24, 0x08C5 |
3b12: 80 93 db 08 sts 0x08DB, r24 |
3b16: 80 91 db 08 lds r24, 0x08DB |
3b1a: 88 23 and r24, r24 |
3b1c: 19 f4 brne .+6 ; 0x3b24 <ParameterZuordnung+0x284> |
3b1e: 10 92 db 08 sts 0x08DB, r1 |
3b22: 04 c0 rjmp .+8 ; 0x3b2c <ParameterZuordnung+0x28c> |
3b24: 8f 3f cpi r24, 0xFF ; 255 |
3b26: 11 f4 brne .+4 ; 0x3b2c <ParameterZuordnung+0x28c> |
3b28: 80 93 db 08 sts 0x08DB, r24 |
3b2c: 80 91 ae 0c lds r24, 0x0CAE |
3b30: 8b 3f cpi r24, 0xFB ; 251 |
3b32: 98 f0 brcs .+38 ; 0x3b5a <ParameterZuordnung+0x2ba> |
3b34: 8b 3f cpi r24, 0xFB ; 251 |
3b36: 19 f4 brne .+6 ; 0x3b3e <ParameterZuordnung+0x29e> |
3b38: 80 91 bf 08 lds r24, 0x08BF |
3b3c: 0e c0 rjmp .+28 ; 0x3b5a <ParameterZuordnung+0x2ba> |
3b3e: 8c 3f cpi r24, 0xFC ; 252 |
3b40: 19 f4 brne .+6 ; 0x3b48 <ParameterZuordnung+0x2a8> |
3b42: 80 91 c1 08 lds r24, 0x08C1 |
3b46: 09 c0 rjmp .+18 ; 0x3b5a <ParameterZuordnung+0x2ba> |
3b48: 8d 3f cpi r24, 0xFD ; 253 |
3b4a: 19 f4 brne .+6 ; 0x3b52 <ParameterZuordnung+0x2b2> |
3b4c: 80 91 c3 08 lds r24, 0x08C3 |
3b50: 04 c0 rjmp .+8 ; 0x3b5a <ParameterZuordnung+0x2ba> |
3b52: 8e 3f cpi r24, 0xFE ; 254 |
3b54: 21 f4 brne .+8 ; 0x3b5e <ParameterZuordnung+0x2be> |
3b56: 80 91 c5 08 lds r24, 0x08C5 |
3b5a: 80 93 dc 08 sts 0x08DC, r24 |
3b5e: 80 91 dc 08 lds r24, 0x08DC |
3b62: 88 23 and r24, r24 |
3b64: 19 f4 brne .+6 ; 0x3b6c <ParameterZuordnung+0x2cc> |
3b66: 10 92 dc 08 sts 0x08DC, r1 |
3b6a: 04 c0 rjmp .+8 ; 0x3b74 <ParameterZuordnung+0x2d4> |
3b6c: 8f 3f cpi r24, 0xFF ; 255 |
3b6e: 11 f4 brne .+4 ; 0x3b74 <ParameterZuordnung+0x2d4> |
3b70: 80 93 dc 08 sts 0x08DC, r24 |
3b74: 80 91 af 0c lds r24, 0x0CAF |
3b78: 8b 3f cpi r24, 0xFB ; 251 |
3b7a: 98 f0 brcs .+38 ; 0x3ba2 <ParameterZuordnung+0x302> |
3b7c: 8b 3f cpi r24, 0xFB ; 251 |
3b7e: 19 f4 brne .+6 ; 0x3b86 <ParameterZuordnung+0x2e6> |
3b80: 80 91 bf 08 lds r24, 0x08BF |
3b84: 0e c0 rjmp .+28 ; 0x3ba2 <ParameterZuordnung+0x302> |
3b86: 8c 3f cpi r24, 0xFC ; 252 |
3b88: 19 f4 brne .+6 ; 0x3b90 <ParameterZuordnung+0x2f0> |
3b8a: 80 91 c1 08 lds r24, 0x08C1 |
3b8e: 09 c0 rjmp .+18 ; 0x3ba2 <ParameterZuordnung+0x302> |
3b90: 8d 3f cpi r24, 0xFD ; 253 |
3b92: 19 f4 brne .+6 ; 0x3b9a <ParameterZuordnung+0x2fa> |
3b94: 80 91 c3 08 lds r24, 0x08C3 |
3b98: 04 c0 rjmp .+8 ; 0x3ba2 <ParameterZuordnung+0x302> |
3b9a: 8e 3f cpi r24, 0xFE ; 254 |
3b9c: 21 f4 brne .+8 ; 0x3ba6 <ParameterZuordnung+0x306> |
3b9e: 80 91 c5 08 lds r24, 0x08C5 |
3ba2: 80 93 dd 08 sts 0x08DD, r24 |
3ba6: 80 91 dd 08 lds r24, 0x08DD |
3baa: 88 23 and r24, r24 |
3bac: 19 f4 brne .+6 ; 0x3bb4 <ParameterZuordnung+0x314> |
3bae: 10 92 dd 08 sts 0x08DD, r1 |
3bb2: 04 c0 rjmp .+8 ; 0x3bbc <ParameterZuordnung+0x31c> |
3bb4: 8f 3f cpi r24, 0xFF ; 255 |
3bb6: 11 f4 brne .+4 ; 0x3bbc <ParameterZuordnung+0x31c> |
3bb8: 80 93 dd 08 sts 0x08DD, r24 |
3bbc: 80 91 b0 0c lds r24, 0x0CB0 |
3bc0: 8b 3f cpi r24, 0xFB ; 251 |
3bc2: 98 f0 brcs .+38 ; 0x3bea <ParameterZuordnung+0x34a> |
3bc4: 8b 3f cpi r24, 0xFB ; 251 |
3bc6: 19 f4 brne .+6 ; 0x3bce <ParameterZuordnung+0x32e> |
3bc8: 80 91 bf 08 lds r24, 0x08BF |
3bcc: 0e c0 rjmp .+28 ; 0x3bea <ParameterZuordnung+0x34a> |
3bce: 8c 3f cpi r24, 0xFC ; 252 |
3bd0: 19 f4 brne .+6 ; 0x3bd8 <ParameterZuordnung+0x338> |
3bd2: 80 91 c1 08 lds r24, 0x08C1 |
3bd6: 09 c0 rjmp .+18 ; 0x3bea <ParameterZuordnung+0x34a> |
3bd8: 8d 3f cpi r24, 0xFD ; 253 |
3bda: 19 f4 brne .+6 ; 0x3be2 <ParameterZuordnung+0x342> |
3bdc: 80 91 c3 08 lds r24, 0x08C3 |
3be0: 04 c0 rjmp .+8 ; 0x3bea <ParameterZuordnung+0x34a> |
3be2: 8e 3f cpi r24, 0xFE ; 254 |
3be4: 21 f4 brne .+8 ; 0x3bee <ParameterZuordnung+0x34e> |
3be6: 80 91 c5 08 lds r24, 0x08C5 |
3bea: 80 93 de 08 sts 0x08DE, r24 |
3bee: 80 91 de 08 lds r24, 0x08DE |
3bf2: 88 23 and r24, r24 |
3bf4: 19 f4 brne .+6 ; 0x3bfc <ParameterZuordnung+0x35c> |
3bf6: 10 92 de 08 sts 0x08DE, r1 |
3bfa: 04 c0 rjmp .+8 ; 0x3c04 <ParameterZuordnung+0x364> |
3bfc: 8f 3f cpi r24, 0xFF ; 255 |
3bfe: 11 f4 brne .+4 ; 0x3c04 <ParameterZuordnung+0x364> |
3c00: 80 93 de 08 sts 0x08DE, r24 |
3c04: 90 91 b1 0c lds r25, 0x0CB1 |
3c08: 9b 3f cpi r25, 0xFB ; 251 |
3c0a: b0 f0 brcs .+44 ; 0x3c38 <ParameterZuordnung+0x398> |
3c0c: 9b 3f cpi r25, 0xFB ; 251 |
3c0e: 19 f4 brne .+6 ; 0x3c16 <ParameterZuordnung+0x376> |
3c10: 80 91 bf 08 lds r24, 0x08BF |
3c14: 04 c0 rjmp .+8 ; 0x3c1e <ParameterZuordnung+0x37e> |
3c16: 9c 3f cpi r25, 0xFC ; 252 |
3c18: 29 f4 brne .+10 ; 0x3c24 <ParameterZuordnung+0x384> |
3c1a: 80 91 c1 08 lds r24, 0x08C1 |
3c1e: 80 93 89 01 sts 0x0189, r24 |
3c22: 0c c0 rjmp .+24 ; 0x3c3c <ParameterZuordnung+0x39c> |
3c24: 9d 3f cpi r25, 0xFD ; 253 |
3c26: 19 f4 brne .+6 ; 0x3c2e <ParameterZuordnung+0x38e> |
3c28: 80 91 c3 08 lds r24, 0x08C3 |
3c2c: f8 cf rjmp .-16 ; 0x3c1e <ParameterZuordnung+0x37e> |
3c2e: 9e 3f cpi r25, 0xFE ; 254 |
3c30: 29 f4 brne .+10 ; 0x3c3c <ParameterZuordnung+0x39c> |
3c32: 80 91 c5 08 lds r24, 0x08C5 |
3c36: f3 cf rjmp .-26 ; 0x3c1e <ParameterZuordnung+0x37e> |
3c38: 90 93 89 01 sts 0x0189, r25 |
3c3c: 80 91 89 01 lds r24, 0x0189 |
3c40: 88 23 and r24, r24 |
3c42: 19 f4 brne .+6 ; 0x3c4a <ParameterZuordnung+0x3aa> |
3c44: 10 92 89 01 sts 0x0189, r1 |
3c48: 04 c0 rjmp .+8 ; 0x3c52 <ParameterZuordnung+0x3b2> |
3c4a: 8f 3f cpi r24, 0xFF ; 255 |
3c4c: 11 f4 brne .+4 ; 0x3c52 <ParameterZuordnung+0x3b2> |
3c4e: 80 93 89 01 sts 0x0189, r24 |
3c52: 9b 3f cpi r25, 0xFB ; 251 |
3c54: b0 f0 brcs .+44 ; 0x3c82 <ParameterZuordnung+0x3e2> |
3c56: 9b 3f cpi r25, 0xFB ; 251 |
3c58: 19 f4 brne .+6 ; 0x3c60 <ParameterZuordnung+0x3c0> |
3c5a: 80 91 bf 08 lds r24, 0x08BF |
3c5e: 04 c0 rjmp .+8 ; 0x3c68 <ParameterZuordnung+0x3c8> |
3c60: 9c 3f cpi r25, 0xFC ; 252 |
3c62: 29 f4 brne .+10 ; 0x3c6e <ParameterZuordnung+0x3ce> |
3c64: 80 91 c1 08 lds r24, 0x08C1 |
3c68: 80 93 89 01 sts 0x0189, r24 |
3c6c: 0c c0 rjmp .+24 ; 0x3c86 <ParameterZuordnung+0x3e6> |
3c6e: 9d 3f cpi r25, 0xFD ; 253 |
3c70: 19 f4 brne .+6 ; 0x3c78 <ParameterZuordnung+0x3d8> |
3c72: 80 91 c3 08 lds r24, 0x08C3 |
3c76: f8 cf rjmp .-16 ; 0x3c68 <ParameterZuordnung+0x3c8> |
3c78: 9e 3f cpi r25, 0xFE ; 254 |
3c7a: 29 f4 brne .+10 ; 0x3c86 <ParameterZuordnung+0x3e6> |
3c7c: 80 91 c5 08 lds r24, 0x08C5 |
3c80: f3 cf rjmp .-26 ; 0x3c68 <ParameterZuordnung+0x3c8> |
3c82: 90 93 89 01 sts 0x0189, r25 |
3c86: 80 91 89 01 lds r24, 0x0189 |
3c8a: 88 23 and r24, r24 |
3c8c: 19 f4 brne .+6 ; 0x3c94 <ParameterZuordnung+0x3f4> |
3c8e: 10 92 89 01 sts 0x0189, r1 |
3c92: 04 c0 rjmp .+8 ; 0x3c9c <ParameterZuordnung+0x3fc> |
3c94: 8f 3f cpi r24, 0xFF ; 255 |
3c96: 11 f4 brne .+4 ; 0x3c9c <ParameterZuordnung+0x3fc> |
3c98: 80 93 89 01 sts 0x0189, r24 |
3c9c: 9b 3f cpi r25, 0xFB ; 251 |
3c9e: b0 f0 brcs .+44 ; 0x3ccc <ParameterZuordnung+0x42c> |
3ca0: 9b 3f cpi r25, 0xFB ; 251 |
3ca2: 19 f4 brne .+6 ; 0x3caa <ParameterZuordnung+0x40a> |
3ca4: 80 91 bf 08 lds r24, 0x08BF |
3ca8: 04 c0 rjmp .+8 ; 0x3cb2 <ParameterZuordnung+0x412> |
3caa: 9c 3f cpi r25, 0xFC ; 252 |
3cac: 29 f4 brne .+10 ; 0x3cb8 <ParameterZuordnung+0x418> |
3cae: 80 91 c1 08 lds r24, 0x08C1 |
3cb2: 80 93 89 01 sts 0x0189, r24 |
3cb6: 0c c0 rjmp .+24 ; 0x3cd0 <ParameterZuordnung+0x430> |
3cb8: 9d 3f cpi r25, 0xFD ; 253 |
3cba: 19 f4 brne .+6 ; 0x3cc2 <ParameterZuordnung+0x422> |
3cbc: 80 91 c3 08 lds r24, 0x08C3 |
3cc0: f8 cf rjmp .-16 ; 0x3cb2 <ParameterZuordnung+0x412> |
3cc2: 9e 3f cpi r25, 0xFE ; 254 |
3cc4: 29 f4 brne .+10 ; 0x3cd0 <ParameterZuordnung+0x430> |
3cc6: 80 91 c5 08 lds r24, 0x08C5 |
3cca: f3 cf rjmp .-26 ; 0x3cb2 <ParameterZuordnung+0x412> |
3ccc: 90 93 89 01 sts 0x0189, r25 |
3cd0: 80 91 89 01 lds r24, 0x0189 |
3cd4: 88 23 and r24, r24 |
3cd6: 19 f4 brne .+6 ; 0x3cde <ParameterZuordnung+0x43e> |
3cd8: 10 92 89 01 sts 0x0189, r1 |
3cdc: 04 c0 rjmp .+8 ; 0x3ce6 <ParameterZuordnung+0x446> |
3cde: 8f 3f cpi r24, 0xFF ; 255 |
3ce0: 11 f4 brne .+4 ; 0x3ce6 <ParameterZuordnung+0x446> |
3ce2: 80 93 89 01 sts 0x0189, r24 |
3ce6: 10 91 88 01 lds r17, 0x0188 |
3cea: 61 2f mov r22, r17 |
3cec: 77 27 eor r23, r23 |
3cee: 67 fd sbrc r22, 7 |
3cf0: 70 95 com r23 |
3cf2: 87 2f mov r24, r23 |
3cf4: 97 2f mov r25, r23 |
3cf6: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
3cfa: 17 ff sbrs r17, 7 |
3cfc: 06 c0 rjmp .+12 ; 0x3d0a <ParameterZuordnung+0x46a> |
3cfe: 20 e0 ldi r18, 0x00 ; 0 |
3d00: 30 e0 ldi r19, 0x00 ; 0 |
3d02: 40 e8 ldi r20, 0x80 ; 128 |
3d04: 53 e4 ldi r21, 0x43 ; 67 |
3d06: 0e 94 11 3d call 0x7a22 ; 0x7a22 <__addsf3> |
3d0a: 27 e1 ldi r18, 0x17 ; 23 |
3d0c: 37 eb ldi r19, 0xB7 ; 183 |
3d0e: 41 ed ldi r20, 0xD1 ; 209 |
3d10: 58 e3 ldi r21, 0x38 ; 56 |
3d12: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
3d16: 60 93 7c 01 sts 0x017C, r22 |
3d1a: 70 93 7d 01 sts 0x017D, r23 |
3d1e: 80 93 7e 01 sts 0x017E, r24 |
3d22: 90 93 7f 01 sts 0x017F, r25 |
3d26: 80 91 a3 0c lds r24, 0x0CA3 |
3d2a: 80 93 d7 0c sts 0x0CD7, r24 |
3d2e: 80 91 a2 0c lds r24, 0x0CA2 |
3d32: 80 93 ce 0c sts 0x0CCE, r24 |
3d36: 1f 91 pop r17 |
3d38: 08 95 ret |
00003d3a <DefaultKonstanten2>: |
3d3a: 83 e0 ldi r24, 0x03 ; 3 |
3d3c: 80 93 90 0c sts 0x0C90, r24 |
3d40: 42 e0 ldi r20, 0x02 ; 2 |
3d42: 40 93 91 0c sts 0x0C91, r20 |
3d46: 81 e0 ldi r24, 0x01 ; 1 |
3d48: 80 93 92 0c sts 0x0C92, r24 |
3d4c: 34 e0 ldi r19, 0x04 ; 4 |
3d4e: 30 93 93 0c sts 0x0C93, r19 |
3d52: 25 e0 ldi r18, 0x05 ; 5 |
3d54: 20 93 94 0c sts 0x0C94, r18 |
3d58: 86 e0 ldi r24, 0x06 ; 6 |
3d5a: 80 93 95 0c sts 0x0C95, r24 |
3d5e: 87 e0 ldi r24, 0x07 ; 7 |
3d60: 80 93 96 0c sts 0x0C96, r24 |
3d64: 10 92 98 0c sts 0x0C98, r1 |
3d68: 8e e1 ldi r24, 0x1E ; 30 |
3d6a: 80 93 99 0c sts 0x0C99, r24 |
3d6e: 8b ef ldi r24, 0xFB ; 251 |
3d70: 80 93 9b 0c sts 0x0C9B, r24 |
3d74: 8a e0 ldi r24, 0x0A ; 10 |
3d76: 80 93 9c 0c sts 0x0C9C, r24 |
3d7a: 92 e3 ldi r25, 0x32 ; 50 |
3d7c: 90 93 9a 0c sts 0x0C9A, r25 |
3d80: 90 93 9e 0c sts 0x0C9E, r25 |
3d84: 40 93 9d 0c sts 0x0C9D, r20 |
3d88: 30 93 9f 0c sts 0x0C9F, r19 |
3d8c: 10 92 a0 0c sts 0x0CA0, r1 |
3d90: 80 e1 ldi r24, 0x10 ; 16 |
3d92: 80 93 a1 0c sts 0x0CA1, r24 |
3d96: 20 93 a2 0c sts 0x0CA2, r18 |
3d9a: 8a ef ldi r24, 0xFA ; 250 |
3d9c: 80 93 a3 0c sts 0x0CA3, r24 |
3da0: 8a e1 ldi r24, 0x1A ; 26 |
3da2: 80 93 a4 0c sts 0x0CA4, r24 |
3da6: 80 e8 ldi r24, 0x80 ; 128 |
3da8: 80 93 a5 0c sts 0x0CA5, r24 |
3dac: 8f ea ldi r24, 0xAF ; 175 |
3dae: 80 93 a6 0c sts 0x0CA6, r24 |
3db2: 80 93 a7 0c sts 0x0CA7, r24 |
3db6: 8a e5 ldi r24, 0x5A ; 90 |
3db8: 80 93 a8 0c sts 0x0CA8, r24 |
3dbc: 83 e2 ldi r24, 0x23 ; 35 |
3dbe: 80 93 a9 0c sts 0x0CA9, r24 |
3dc2: 84 e1 ldi r24, 0x14 ; 20 |
3dc4: 80 93 aa 0c sts 0x0CAA, r24 |
3dc8: 10 92 ab 0c sts 0x0CAB, r1 |
3dcc: 20 93 ac 0c sts 0x0CAC, r18 |
3dd0: 10 92 ad 0c sts 0x0CAD, r1 |
3dd4: 10 92 ae 0c sts 0x0CAE, r1 |
3dd8: 10 92 af 0c sts 0x0CAF, r1 |
3ddc: 10 92 b0 0c sts 0x0CB0, r1 |
3de0: 84 e6 ldi r24, 0x64 ; 100 |
3de2: 80 93 b1 0c sts 0x0CB1, r24 |
3de6: 88 e2 ldi r24, 0x28 ; 40 |
3de8: 80 93 b2 0c sts 0x0CB2, r24 |
3dec: 10 92 b6 0c sts 0x0CB6, r1 |
3df0: 90 93 b3 0c sts 0x0CB3, r25 |
3df4: 86 e9 ldi r24, 0x96 ; 150 |
3df6: 80 93 b4 0c sts 0x0CB4, r24 |
3dfa: 20 93 b5 0c sts 0x0CB5, r18 |
3dfe: ae eb ldi r26, 0xBE ; 190 |
3e00: bc e0 ldi r27, 0x0C ; 12 |
3e02: e8 e6 ldi r30, 0x68 ; 104 |
3e04: f1 e0 ldi r31, 0x01 ; 1 |
3e06: 8c e0 ldi r24, 0x0C ; 12 |
3e08: 01 90 ld r0, Z+ |
3e0a: 0d 92 st X+, r0 |
3e0c: 81 50 subi r24, 0x01 ; 1 |
3e0e: e1 f7 brne .-8 ; 0x3e08 <DefaultKonstanten2+0xce> |
3e10: 08 95 ret |
00003e12 <DefaultKonstanten1>: |
3e12: 83 e0 ldi r24, 0x03 ; 3 |
3e14: 80 93 90 0c sts 0x0C90, r24 |
3e18: 42 e0 ldi r20, 0x02 ; 2 |
3e1a: 40 93 91 0c sts 0x0C91, r20 |
3e1e: 81 e0 ldi r24, 0x01 ; 1 |
3e20: 80 93 92 0c sts 0x0C92, r24 |
3e24: 34 e0 ldi r19, 0x04 ; 4 |
3e26: 30 93 93 0c sts 0x0C93, r19 |
3e2a: 25 e0 ldi r18, 0x05 ; 5 |
3e2c: 20 93 94 0c sts 0x0C94, r18 |
3e30: 86 e0 ldi r24, 0x06 ; 6 |
3e32: 80 93 95 0c sts 0x0C95, r24 |
3e36: 87 e0 ldi r24, 0x07 ; 7 |
3e38: 80 93 96 0c sts 0x0C96, r24 |
3e3c: 88 e0 ldi r24, 0x08 ; 8 |
3e3e: 80 93 97 0c sts 0x0C97, r24 |
3e42: 10 92 98 0c sts 0x0C98, r1 |
3e46: 9e e1 ldi r25, 0x1E ; 30 |
3e48: 90 93 99 0c sts 0x0C99, r25 |
3e4c: 8b ef ldi r24, 0xFB ; 251 |
3e4e: 80 93 9b 0c sts 0x0C9B, r24 |
3e52: 8a e0 ldi r24, 0x0A ; 10 |
3e54: 80 93 9c 0c sts 0x0C9C, r24 |
3e58: 86 e4 ldi r24, 0x46 ; 70 |
3e5a: 80 93 9a 0c sts 0x0C9A, r24 |
3e5e: 90 93 9e 0c sts 0x0C9E, r25 |
3e62: 40 93 9d 0c sts 0x0C9D, r20 |
3e66: 30 93 9f 0c sts 0x0C9F, r19 |
3e6a: 10 92 a0 0c sts 0x0CA0, r1 |
3e6e: 80 e1 ldi r24, 0x10 ; 16 |
3e70: 80 93 a1 0c sts 0x0CA1, r24 |
3e74: 20 93 a2 0c sts 0x0CA2, r18 |
3e78: 8a ef ldi r24, 0xFA ; 250 |
3e7a: 80 93 a3 0c sts 0x0CA3, r24 |
3e7e: 8a e1 ldi r24, 0x1A ; 26 |
3e80: 80 93 a4 0c sts 0x0CA4, r24 |
3e84: 80 e8 ldi r24, 0x80 ; 128 |
3e86: 80 93 a5 0c sts 0x0CA5, r24 |
3e8a: 88 e7 ldi r24, 0x78 ; 120 |
3e8c: 80 93 a6 0c sts 0x0CA6, r24 |
3e90: 96 e9 ldi r25, 0x96 ; 150 |
3e92: 90 93 a7 0c sts 0x0CA7, r25 |
3e96: 8a e5 ldi r24, 0x5A ; 90 |
3e98: 80 93 a8 0c sts 0x0CA8, r24 |
3e9c: 83 e2 ldi r24, 0x23 ; 35 |
3e9e: 80 93 a9 0c sts 0x0CA9, r24 |
3ea2: 84 e1 ldi r24, 0x14 ; 20 |
3ea4: 80 93 aa 0c sts 0x0CAA, r24 |
3ea8: 10 92 ab 0c sts 0x0CAB, r1 |
3eac: 20 93 ac 0c sts 0x0CAC, r18 |
3eb0: 10 92 ad 0c sts 0x0CAD, r1 |
3eb4: 10 92 ae 0c sts 0x0CAE, r1 |
3eb8: 10 92 af 0c sts 0x0CAF, r1 |
3ebc: 10 92 b0 0c sts 0x0CB0, r1 |
3ec0: 84 e6 ldi r24, 0x64 ; 100 |
3ec2: 80 93 b1 0c sts 0x0CB1, r24 |
3ec6: 88 e2 ldi r24, 0x28 ; 40 |
3ec8: 80 93 b2 0c sts 0x0CB2, r24 |
3ecc: 10 92 b6 0c sts 0x0CB6, r1 |
3ed0: 82 e3 ldi r24, 0x32 ; 50 |
3ed2: 80 93 b3 0c sts 0x0CB3, r24 |
3ed6: 90 93 b4 0c sts 0x0CB4, r25 |
3eda: 20 93 b5 0c sts 0x0CB5, r18 |
3ede: ae eb ldi r26, 0xBE ; 190 |
3ee0: bc e0 ldi r27, 0x0C ; 12 |
3ee2: e0 e7 ldi r30, 0x70 ; 112 |
3ee4: f1 e0 ldi r31, 0x01 ; 1 |
3ee6: 8c e0 ldi r24, 0x0C ; 12 |
3ee8: 01 90 ld r0, Z+ |
3eea: 0d 92 st X+, r0 |
3eec: 81 50 subi r24, 0x01 ; 1 |
3eee: e1 f7 brne .-8 ; 0x3ee8 <DefaultKonstanten1+0xd6> |
3ef0: 08 95 ret |
00003ef2 <SendMotorData>: |
3ef2: 80 91 d6 08 lds r24, 0x08D6 |
3ef6: 88 23 and r24, r24 |
3ef8: 01 f5 brne .+64 ; 0x3f3a <SendMotorData+0x48> |
3efa: 10 92 61 09 sts 0x0961, r1 |
3efe: 10 92 60 09 sts 0x0960, r1 |
3f02: 10 92 66 09 sts 0x0966, r1 |
3f06: 10 92 6c 09 sts 0x096C, r1 |
3f0a: 80 91 34 08 lds r24, 0x0834 |
3f0e: 88 23 and r24, r24 |
3f10: 11 f0 breq .+4 ; 0x3f16 <SendMotorData+0x24> |
3f12: 80 93 60 09 sts 0x0960, r24 |
3f16: 80 91 35 08 lds r24, 0x0835 |
3f1a: 88 23 and r24, r24 |
3f1c: 11 f0 breq .+4 ; 0x3f22 <SendMotorData+0x30> |
3f1e: 80 93 61 09 sts 0x0961, r24 |
3f22: 80 91 36 08 lds r24, 0x0836 |
3f26: 88 23 and r24, r24 |
3f28: 11 f0 breq .+4 ; 0x3f2e <SendMotorData+0x3c> |
3f2a: 80 93 6c 09 sts 0x096C, r24 |
3f2e: 80 91 37 08 lds r24, 0x0837 |
3f32: 88 23 and r24, r24 |
3f34: 11 f0 breq .+4 ; 0x3f3a <SendMotorData+0x48> |
3f36: 80 93 66 09 sts 0x0966, r24 |
3f3a: 10 92 6b 08 sts 0x086B, r1 |
3f3e: 10 92 6c 08 sts 0x086C, r1 |
3f42: 0e 94 d5 14 call 0x29aa ; 0x29aa <i2c_start> |
3f46: 08 95 ret |
00003f48 <SetNeutral>: |
3f48: cf 93 push r28 |
3f4a: df 93 push r29 |
3f4c: 10 92 7a 08 sts 0x087A, r1 |
3f50: 10 92 79 08 sts 0x0879, r1 |
3f54: 10 92 7c 08 sts 0x087C, r1 |
3f58: 10 92 7b 08 sts 0x087B, r1 |
3f5c: 80 e0 ldi r24, 0x00 ; 0 |
3f5e: 90 e0 ldi r25, 0x00 ; 0 |
3f60: a0 e0 ldi r26, 0x00 ; 0 |
3f62: b0 e0 ldi r27, 0x00 ; 0 |
3f64: 80 93 7d 08 sts 0x087D, r24 |
3f68: 90 93 7e 08 sts 0x087E, r25 |
3f6c: a0 93 7f 08 sts 0x087F, r26 |
3f70: b0 93 80 08 sts 0x0880, r27 |
3f74: 10 92 74 08 sts 0x0874, r1 |
3f78: 10 92 73 08 sts 0x0873, r1 |
3f7c: 10 92 76 08 sts 0x0876, r1 |
3f80: 10 92 75 08 sts 0x0875, r1 |
3f84: 10 92 78 08 sts 0x0878, r1 |
3f88: 10 92 77 08 sts 0x0877, r1 |
3f8c: 0e 94 d8 19 call 0x33b0 ; 0x33b0 <CalibrierMittelwert> |
3f90: 85 e0 ldi r24, 0x05 ; 5 |
3f92: 90 e0 ldi r25, 0x00 ; 0 |
3f94: 0e 94 96 0c call 0x192c ; 0x192c <SetDelay> |
3f98: ec 01 movw r28, r24 |
3f9a: ce 01 movw r24, r28 |
3f9c: 0e 94 9f 0c call 0x193e ; 0x193e <CheckDelay> |
3fa0: 88 23 and r24, r24 |
3fa2: d9 f3 breq .-10 ; 0x3f9a <SetNeutral+0x52> |
3fa4: 0e 94 d8 19 call 0x33b0 ; 0x33b0 <CalibrierMittelwert> |
3fa8: 80 91 98 0c lds r24, 0x0C98 |
3fac: 80 ff sbrs r24, 0 |
3fae: 10 c0 rjmp .+32 ; 0x3fd0 <SetNeutral+0x88> |
3fb0: 80 91 0a 01 lds r24, 0x010A |
3fb4: 90 91 0b 01 lds r25, 0x010B |
3fb8: 87 5b subi r24, 0xB7 ; 183 |
3fba: 93 40 sbci r25, 0x03 ; 3 |
3fbc: 38 f4 brcc .+14 ; 0x3fcc <SetNeutral+0x84> |
3fbe: 80 91 0a 01 lds r24, 0x010A |
3fc2: 90 91 0b 01 lds r25, 0x010B |
3fc6: 8e 5e subi r24, 0xEE ; 238 |
3fc8: 92 40 sbci r25, 0x02 ; 2 |
3fca: 10 f4 brcc .+4 ; 0x3fd0 <SetNeutral+0x88> |
3fcc: 0e 94 b5 10 call 0x216a ; 0x216a <SucheLuftruckOffset> |
3fd0: 80 91 cc 0c lds r24, 0x0CCC |
3fd4: 90 91 cd 0c lds r25, 0x0CCD |
3fd8: 97 ff sbrs r25, 7 |
3fda: 03 c0 rjmp .+6 ; 0x3fe2 <SetNeutral+0x9a> |
3fdc: 90 95 com r25 |
3fde: 81 95 neg r24 |
3fe0: 9f 4f sbci r25, 0xFF ; 255 |
3fe2: 90 93 74 08 sts 0x0874, r25 |
3fe6: 80 93 73 08 sts 0x0873, r24 |
3fea: 80 91 ca 0c lds r24, 0x0CCA |
3fee: 90 91 cb 0c lds r25, 0x0CCB |
3ff2: 97 ff sbrs r25, 7 |
3ff4: 03 c0 rjmp .+6 ; 0x3ffc <SetNeutral+0xb4> |
3ff6: 90 95 com r25 |
3ff8: 81 95 neg r24 |
3ffa: 9f 4f sbci r25, 0xFF ; 255 |
3ffc: 90 93 76 08 sts 0x0876, r25 |
4000: 80 93 75 08 sts 0x0875, r24 |
4004: 80 91 d8 0c lds r24, 0x0CD8 |
4008: 90 91 d9 0c lds r25, 0x0CD9 |
400c: 97 ff sbrs r25, 7 |
400e: 03 c0 rjmp .+6 ; 0x4016 <SetNeutral+0xce> |
4010: 90 95 com r25 |
4012: 81 95 neg r24 |
4014: 9f 4f sbci r25, 0xFF ; 255 |
4016: 90 93 78 08 sts 0x0878, r25 |
401a: 80 93 77 08 sts 0x0877, r24 |
401e: 80 91 de 0c lds r24, 0x0CDE |
4022: 90 91 df 0c lds r25, 0x0CDF |
4026: 97 ff sbrs r25, 7 |
4028: 03 c0 rjmp .+6 ; 0x4030 <SetNeutral+0xe8> |
402a: 90 95 com r25 |
402c: 81 95 neg r24 |
402e: 9f 4f sbci r25, 0xFF ; 255 |
4030: 60 e1 ldi r22, 0x10 ; 16 |
4032: 70 e0 ldi r23, 0x00 ; 0 |
4034: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
4038: 70 93 7c 08 sts 0x087C, r23 |
403c: 60 93 7b 08 sts 0x087B, r22 |
4040: 80 91 d5 0c lds r24, 0x0CD5 |
4044: 90 91 d6 0c lds r25, 0x0CD6 |
4048: 97 ff sbrs r25, 7 |
404a: 03 c0 rjmp .+6 ; 0x4052 <SetNeutral+0x10a> |
404c: 90 95 com r25 |
404e: 81 95 neg r24 |
4050: 9f 4f sbci r25, 0xFF ; 255 |
4052: 60 e1 ldi r22, 0x10 ; 16 |
4054: 70 e0 ldi r23, 0x00 ; 0 |
4056: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
405a: 70 93 7a 08 sts 0x087A, r23 |
405e: 60 93 79 08 sts 0x0879, r22 |
4062: 60 91 3c 0c lds r22, 0x0C3C |
4066: 70 91 3d 0c lds r23, 0x0C3D |
406a: 88 27 eor r24, r24 |
406c: 77 fd sbrc r23, 7 |
406e: 80 95 com r24 |
4070: 98 2f mov r25, r24 |
4072: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
4076: 60 93 7d 08 sts 0x087D, r22 |
407a: 70 93 7e 08 sts 0x087E, r23 |
407e: 80 93 7f 08 sts 0x087F, r24 |
4082: 90 93 80 08 sts 0x0880, r25 |
4086: 10 92 97 08 sts 0x0897, r1 |
408a: 10 92 98 08 sts 0x0898, r1 |
408e: 10 92 99 08 sts 0x0899, r1 |
4092: 10 92 9a 08 sts 0x089A, r1 |
4096: 10 92 9b 08 sts 0x089B, r1 |
409a: 10 92 9c 08 sts 0x089C, r1 |
409e: 10 92 9d 08 sts 0x089D, r1 |
40a2: 10 92 9e 08 sts 0x089E, r1 |
40a6: 10 92 9f 08 sts 0x089F, r1 |
40aa: 10 92 a0 08 sts 0x08A0, r1 |
40ae: 10 92 a1 08 sts 0x08A1, r1 |
40b2: 10 92 a2 08 sts 0x08A2, r1 |
40b6: 10 92 a3 08 sts 0x08A3, r1 |
40ba: 10 92 a4 08 sts 0x08A4, r1 |
40be: 10 92 a5 08 sts 0x08A5, r1 |
40c2: 10 92 a6 08 sts 0x08A6, r1 |
40c6: 10 92 a7 08 sts 0x08A7, r1 |
40ca: 10 92 a8 08 sts 0x08A8, r1 |
40ce: 10 92 a9 08 sts 0x08A9, r1 |
40d2: 10 92 aa 08 sts 0x08AA, r1 |
40d6: 10 92 cd 0c sts 0x0CCD, r1 |
40da: 10 92 cc 0c sts 0x0CCC, r1 |
40de: 10 92 cb 0c sts 0x0CCB, r1 |
40e2: 10 92 ca 0c sts 0x0CCA, r1 |
40e6: 10 92 d9 0c sts 0x0CD9, r1 |
40ea: 10 92 d8 0c sts 0x0CD8, r1 |
40ee: 80 91 06 01 lds r24, 0x0106 |
40f2: 90 91 07 01 lds r25, 0x0107 |
40f6: a0 91 08 01 lds r26, 0x0108 |
40fa: b0 91 09 01 lds r27, 0x0109 |
40fe: 90 93 3f 0c sts 0x0C3F, r25 |
4102: 80 93 3e 0c sts 0x0C3E, r24 |
4106: 10 92 61 08 sts 0x0861, r1 |
410a: 10 92 60 08 sts 0x0860, r1 |
410e: 10 92 af 08 sts 0x08AF, r1 |
4112: 10 92 b0 08 sts 0x08B0, r1 |
4116: 10 92 b1 08 sts 0x08B1, r1 |
411a: 10 92 b2 08 sts 0x08B2, r1 |
411e: 80 91 b3 08 lds r24, 0x08B3 |
4122: 90 91 b4 08 lds r25, 0x08B4 |
4126: 90 93 b6 08 sts 0x08B6, r25 |
412a: 80 93 b5 08 sts 0x08B5, r24 |
412e: 82 e3 ldi r24, 0x32 ; 50 |
4130: 90 e0 ldi r25, 0x00 ; 0 |
4132: 90 93 48 08 sts 0x0848, r25 |
4136: 80 93 47 08 sts 0x0847, r24 |
413a: df 91 pop r29 |
413c: cf 91 pop r28 |
413e: 08 95 ret |
00004140 <Piep>: |
4140: 1f 93 push r17 |
4142: 18 2f mov r17, r24 |
4144: 0e c0 rjmp .+28 ; 0x4162 <Piep+0x22> |
4146: 80 91 d6 08 lds r24, 0x08D6 |
414a: 88 23 and r24, r24 |
414c: 61 f4 brne .+24 ; 0x4166 <Piep+0x26> |
414e: 84 e6 ldi r24, 0x64 ; 100 |
4150: 90 e0 ldi r25, 0x00 ; 0 |
4152: 90 93 48 08 sts 0x0848, r25 |
4156: 80 93 47 08 sts 0x0847, r24 |
415a: 8a ef ldi r24, 0xFA ; 250 |
415c: 90 e0 ldi r25, 0x00 ; 0 |
415e: 0e 94 79 0d call 0x1af2 ; 0x1af2 <Delay_ms> |
4162: 11 50 subi r17, 0x01 ; 1 |
4164: 80 f7 brcc .-32 ; 0x4146 <Piep+0x6> |
4166: 1f 91 pop r17 |
4168: 08 95 ret |
0000416a <MotorRegler>: |
416a: 2f 92 push r2 |
416c: 3f 92 push r3 |
416e: 4f 92 push r4 |
4170: 5f 92 push r5 |
4172: 6f 92 push r6 |
4174: 7f 92 push r7 |
4176: 8f 92 push r8 |
4178: 9f 92 push r9 |
417a: af 92 push r10 |
417c: bf 92 push r11 |
417e: cf 92 push r12 |
4180: df 92 push r13 |
4182: ef 92 push r14 |
4184: ff 92 push r15 |
4186: 0f 93 push r16 |
4188: 1f 93 push r17 |
418a: cf 93 push r28 |
418c: df 93 push r29 |
418e: cd b7 in r28, 0x3d ; 61 |
4190: de b7 in r29, 0x3e ; 62 |
4192: 24 97 sbiw r28, 0x04 ; 4 |
4194: 0f b6 in r0, 0x3f ; 63 |
4196: f8 94 cli |
4198: de bf out 0x3e, r29 ; 62 |
419a: 0f be out 0x3f, r0 ; 63 |
419c: cd bf out 0x3d, r28 ; 61 |
419e: 0e 94 3b 16 call 0x2c76 ; 0x2c76 <Mittelwert> |
41a2: 29 9a sbi 0x05, 1 ; 5 |
41a4: e0 91 92 0c lds r30, 0x0C92 |
41a8: ae 2f mov r26, r30 |
41aa: bb 27 eor r27, r27 |
41ac: aa 0f add r26, r26 |
41ae: bb 1f adc r27, r27 |
41b0: ac 5a subi r26, 0xAC ; 172 |
41b2: b3 4f sbci r27, 0xF3 ; 243 |
41b4: 0d 90 ld r0, X+ |
41b6: bc 91 ld r27, X |
41b8: a0 2d mov r26, r0 |
41ba: 9d 01 movw r18, r26 |
41bc: 28 58 subi r18, 0x88 ; 136 |
41be: 3f 4f sbci r19, 0xFF ; 255 |
41c0: 3a 83 std Y+2, r19 ; 0x02 |
41c2: 29 83 std Y+1, r18 ; 0x01 |
41c4: 37 ff sbrs r19, 7 |
41c6: 02 c0 rjmp .+4 ; 0x41cc <MotorRegler+0x62> |
41c8: 1a 82 std Y+2, r1 ; 0x02 |
41ca: 19 82 std Y+1, r1 ; 0x01 |
41cc: 80 91 cf 08 lds r24, 0x08CF |
41d0: 84 36 cpi r24, 0x64 ; 100 |
41d2: 08 f0 brcs .+2 ; 0x41d6 <MotorRegler+0x6c> |
41d4: 4a c0 rjmp .+148 ; 0x426a <MotorRegler+0x100> |
41d6: 80 91 01 01 lds r24, 0x0101 |
41da: 88 23 and r24, r24 |
41dc: 31 f4 brne .+12 ; 0x41ea <MotorRegler+0x80> |
41de: 84 ef ldi r24, 0xF4 ; 244 |
41e0: 91 e0 ldi r25, 0x01 ; 1 |
41e2: 90 93 48 08 sts 0x0848, r25 |
41e6: 80 93 47 08 sts 0x0847, r24 |
41ea: 80 91 ea 08 lds r24, 0x08EA |
41ee: 90 91 eb 08 lds r25, 0x08EB |
41f2: 00 97 sbiw r24, 0x00 ; 0 |
41f4: 31 f0 breq .+12 ; 0x4202 <MotorRegler+0x98> |
41f6: 01 97 sbiw r24, 0x01 ; 1 |
41f8: 90 93 eb 08 sts 0x08EB, r25 |
41fc: 80 93 ea 08 sts 0x08EA, r24 |
4200: 04 c0 rjmp .+8 ; 0x420a <MotorRegler+0xa0> |
4202: 10 92 d6 08 sts 0x08D6, r1 |
4206: 10 92 b9 08 sts 0x08B9, r1 |
420a: 28 9a sbi 0x05, 0 ; 5 |
420c: 80 91 e5 08 lds r24, 0x08E5 |
4210: 90 91 e6 08 lds r25, 0x08E6 |
4214: 81 5d subi r24, 0xD1 ; 209 |
4216: 97 40 sbci r25, 0x07 ; 7 |
4218: 28 f1 brcs .+74 ; 0x4264 <MotorRegler+0xfa> |
421a: 80 91 a9 0c lds r24, 0x0CA9 |
421e: 48 2f mov r20, r24 |
4220: 55 27 eor r21, r21 |
4222: 5a 83 std Y+2, r21 ; 0x02 |
4224: 49 83 std Y+1, r20 ; 0x01 |
4226: 81 e0 ldi r24, 0x01 ; 1 |
4228: 80 93 b9 08 sts 0x08B9, r24 |
422c: e0 91 90 0c lds r30, 0x0C90 |
4230: ff 27 eor r31, r31 |
4232: ee 0f add r30, r30 |
4234: ff 1f adc r31, r31 |
4236: ec 5a subi r30, 0xAC ; 172 |
4238: f3 4f sbci r31, 0xF3 ; 243 |
423a: 11 82 std Z+1, r1 ; 0x01 |
423c: 10 82 st Z, r1 |
423e: e0 91 91 0c lds r30, 0x0C91 |
4242: ff 27 eor r31, r31 |
4244: ee 0f add r30, r30 |
4246: ff 1f adc r31, r31 |
4248: ec 5a subi r30, 0xAC ; 172 |
424a: f3 4f sbci r31, 0xF3 ; 243 |
424c: 11 82 std Z+1, r1 ; 0x01 |
424e: 10 82 st Z, r1 |
4250: e0 91 93 0c lds r30, 0x0C93 |
4254: ff 27 eor r31, r31 |
4256: ee 0f add r30, r30 |
4258: ff 1f adc r31, r31 |
425a: ec 5a subi r30, 0xAC ; 172 |
425c: f3 4f sbci r31, 0xF3 ; 243 |
425e: 11 82 std Z+1, r1 ; 0x01 |
4260: 10 82 st Z, r1 |
4262: d6 c1 rjmp .+940 ; 0x4610 <MotorRegler+0x4a6> |
4264: 10 92 d6 08 sts 0x08D6, r1 |
4268: d3 c1 rjmp .+934 ; 0x4610 <MotorRegler+0x4a6> |
426a: 80 91 cf 08 lds r24, 0x08CF |
426e: 8d 38 cpi r24, 0x8D ; 141 |
4270: 08 f4 brcc .+2 ; 0x4274 <MotorRegler+0x10a> |
4272: ce c1 rjmp .+924 ; 0x4610 <MotorRegler+0x4a6> |
4274: 10 92 b9 08 sts 0x08B9, r1 |
4278: 80 91 aa 0c lds r24, 0x0CAA |
427c: 22 e3 ldi r18, 0x32 ; 50 |
427e: 82 9f mul r24, r18 |
4280: c0 01 movw r24, r0 |
4282: 11 24 eor r1, r1 |
4284: 90 93 eb 08 sts 0x08EB, r25 |
4288: 80 93 ea 08 sts 0x08EA, r24 |
428c: 69 81 ldd r22, Y+1 ; 0x01 |
428e: 7a 81 ldd r23, Y+2 ; 0x02 |
4290: 69 32 cpi r22, 0x29 ; 41 |
4292: 71 05 cpc r23, r1 |
4294: ac f0 brlt .+42 ; 0x42c0 <MotorRegler+0x156> |
4296: 80 91 e5 08 lds r24, 0x08E5 |
429a: 90 91 e6 08 lds r25, 0x08E6 |
429e: 7f ef ldi r23, 0xFF ; 255 |
42a0: 8f 3f cpi r24, 0xFF ; 255 |
42a2: 97 07 cpc r25, r23 |
42a4: 29 f0 breq .+10 ; 0x42b0 <MotorRegler+0x146> |
42a6: 01 96 adiw r24, 0x01 ; 1 |
42a8: 90 93 e6 08 sts 0x08E6, r25 |
42ac: 80 93 e5 08 sts 0x08E5, r24 |
42b0: 80 91 e5 08 lds r24, 0x08E5 |
42b4: 90 91 e6 08 lds r25, 0x08E6 |
42b8: 90 93 bd 08 sts 0x08BD, r25 |
42bc: 80 93 bc 08 sts 0x08BC, r24 |
42c0: 80 91 e5 08 lds r24, 0x08E5 |
42c4: 90 91 e6 08 lds r25, 0x08E6 |
42c8: 88 3c cpi r24, 0xC8 ; 200 |
42ca: 91 05 cpc r25, r1 |
42cc: 20 f0 brcs .+8 ; 0x42d6 <MotorRegler+0x16c> |
42ce: 89 81 ldd r24, Y+1 ; 0x01 |
42d0: 9a 81 ldd r25, Y+2 ; 0x02 |
42d2: 88 97 sbiw r24, 0x28 ; 40 |
42d4: 04 f5 brge .+64 ; 0x4316 <MotorRegler+0x1ac> |
42d6: 10 92 00 09 sts 0x0900, r1 |
42da: 10 92 01 09 sts 0x0901, r1 |
42de: 10 92 02 09 sts 0x0902, r1 |
42e2: 10 92 03 09 sts 0x0903, r1 |
42e6: 10 92 fc 08 sts 0x08FC, r1 |
42ea: 10 92 fd 08 sts 0x08FD, r1 |
42ee: 10 92 fe 08 sts 0x08FE, r1 |
42f2: 10 92 ff 08 sts 0x08FF, r1 |
42f6: 10 92 a7 08 sts 0x08A7, r1 |
42fa: 10 92 a8 08 sts 0x08A8, r1 |
42fe: 10 92 a9 08 sts 0x08A9, r1 |
4302: 10 92 aa 08 sts 0x08AA, r1 |
4306: 10 92 ab 08 sts 0x08AB, r1 |
430a: 10 92 ac 08 sts 0x08AC, r1 |
430e: 10 92 ad 08 sts 0x08AD, r1 |
4312: 10 92 ae 08 sts 0x08AE, r1 |
4316: e9 81 ldd r30, Y+1 ; 0x01 |
4318: fa 81 ldd r31, Y+2 ; 0x02 |
431a: e9 3c cpi r30, 0xC9 ; 201 |
431c: f1 05 cpc r31, r1 |
431e: 0c f4 brge .+2 ; 0x4322 <MotorRegler+0x1b8> |
4320: d6 c0 rjmp .+428 ; 0x44ce <MotorRegler+0x364> |
4322: 80 91 d6 08 lds r24, 0x08D6 |
4326: 88 23 and r24, r24 |
4328: 09 f0 breq .+2 ; 0x432c <MotorRegler+0x1c2> |
432a: 72 c1 rjmp .+740 ; 0x4610 <MotorRegler+0x4a6> |
432c: e0 91 93 0c lds r30, 0x0C93 |
4330: ff 27 eor r31, r31 |
4332: ee 0f add r30, r30 |
4334: ff 1f adc r31, r31 |
4336: ec 5a subi r30, 0xAC ; 172 |
4338: f3 4f sbci r31, 0xF3 ; 243 |
433a: 80 81 ld r24, Z |
433c: 91 81 ldd r25, Z+1 ; 0x01 |
433e: 8c 34 cpi r24, 0x4C ; 76 |
4340: 91 05 cpc r25, r1 |
4342: 0c f4 brge .+2 ; 0x4346 <MotorRegler+0x1dc> |
4344: c1 c0 rjmp .+386 ; 0x44c8 <MotorRegler+0x35e> |
4346: 80 91 e9 08 lds r24, 0x08E9 |
434a: 8f 5f subi r24, 0xFF ; 255 |
434c: 80 93 e9 08 sts 0x08E9, r24 |
4350: 89 3c cpi r24, 0xC9 ; 201 |
4352: 08 f4 brcc .+2 ; 0x4356 <MotorRegler+0x1ec> |
4354: 5d c1 rjmp .+698 ; 0x4610 <MotorRegler+0x4a6> |
4356: 29 98 cbi 0x05, 1 ; 5 |
4358: 0e 94 a4 1f call 0x3f48 ; 0x3f48 <SetNeutral> |
435c: 10 92 d6 08 sts 0x08D6, r1 |
4360: 10 92 e9 08 sts 0x08E9, r1 |
4364: 10 92 e6 08 sts 0x08E6, r1 |
4368: 10 92 e5 08 sts 0x08E5, r1 |
436c: 80 91 90 0c lds r24, 0x0C90 |
4370: 28 2f mov r18, r24 |
4372: 33 27 eor r19, r19 |
4374: f9 01 movw r30, r18 |
4376: ee 0f add r30, r30 |
4378: ff 1f adc r31, r31 |
437a: ec 5a subi r30, 0xAC ; 172 |
437c: f3 4f sbci r31, 0xF3 ; 243 |
437e: 80 81 ld r24, Z |
4380: 91 81 ldd r25, Z+1 ; 0x01 |
4382: 87 34 cpi r24, 0x47 ; 71 |
4384: 91 05 cpc r25, r1 |
4386: 9c f4 brge .+38 ; 0x43ae <MotorRegler+0x244> |
4388: e0 91 91 0c lds r30, 0x0C91 |
438c: ff 27 eor r31, r31 |
438e: ee 0f add r30, r30 |
4390: ff 1f adc r31, r31 |
4392: ec 5a subi r30, 0xAC ; 172 |
4394: f3 4f sbci r31, 0xF3 ; 243 |
4396: 01 90 ld r0, Z+ |
4398: f0 81 ld r31, Z |
439a: e0 2d mov r30, r0 |
439c: f7 ff sbrs r31, 7 |
439e: 03 c0 rjmp .+6 ; 0x43a6 <MotorRegler+0x23c> |
43a0: f0 95 com r31 |
43a2: e1 95 neg r30 |
43a4: ff 4f sbci r31, 0xFF ; 255 |
43a6: e7 34 cpi r30, 0x47 ; 71 |
43a8: f1 05 cpc r31, r1 |
43aa: 0c f4 brge .+2 ; 0x43ae <MotorRegler+0x244> |
43ac: 6c c0 rjmp .+216 ; 0x4486 <MotorRegler+0x31c> |
43ae: 80 91 91 0c lds r24, 0x0C91 |
43b2: 68 2f mov r22, r24 |
43b4: 77 27 eor r23, r23 |
43b6: db 01 movw r26, r22 |
43b8: aa 0f add r26, r26 |
43ba: bb 1f adc r27, r27 |
43bc: ac 5a subi r26, 0xAC ; 172 |
43be: b3 4f sbci r27, 0xF3 ; 243 |
43c0: 8d 91 ld r24, X+ |
43c2: 9c 91 ld r25, X |
43c4: 11 97 sbiw r26, 0x01 ; 1 |
43c6: 87 34 cpi r24, 0x47 ; 71 |
43c8: 91 05 cpc r25, r1 |
43ca: 3c f0 brlt .+14 ; 0x43da <MotorRegler+0x270> |
43cc: f9 01 movw r30, r18 |
43ce: ee 0f add r30, r30 |
43d0: ff 1f adc r31, r31 |
43d2: ec 5a subi r30, 0xAC ; 172 |
43d4: f3 4f sbci r31, 0xF3 ; 243 |
43d6: 80 81 ld r24, Z |
43d8: 91 81 ldd r25, Z+1 ; 0x01 |
43da: 8d 91 ld r24, X+ |
43dc: 9c 91 ld r25, X |
43de: 87 34 cpi r24, 0x47 ; 71 |
43e0: 91 05 cpc r25, r1 |
43e2: 64 f0 brlt .+24 ; 0x43fc <MotorRegler+0x292> |
43e4: f9 01 movw r30, r18 |
43e6: ee 0f add r30, r30 |
43e8: ff 1f adc r31, r31 |
43ea: ec 5a subi r30, 0xAC ; 172 |
43ec: f3 4f sbci r31, 0xF3 ; 243 |
43ee: 80 81 ld r24, Z |
43f0: 91 81 ldd r25, Z+1 ; 0x01 |
43f2: 87 34 cpi r24, 0x47 ; 71 |
43f4: 91 05 cpc r25, r1 |
43f6: 14 f0 brlt .+4 ; 0x43fc <MotorRegler+0x292> |
43f8: 42 e0 ldi r20, 0x02 ; 2 |
43fa: 01 c0 rjmp .+2 ; 0x43fe <MotorRegler+0x294> |
43fc: 41 e0 ldi r20, 0x01 ; 1 |
43fe: fb 01 movw r30, r22 |
4400: ee 0f add r30, r30 |
4402: ff 1f adc r31, r31 |
4404: ec 5a subi r30, 0xAC ; 172 |
4406: f3 4f sbci r31, 0xF3 ; 243 |
4408: 80 81 ld r24, Z |
440a: 91 81 ldd r25, Z+1 ; 0x01 |
440c: 86 34 cpi r24, 0x46 ; 70 |
440e: 91 05 cpc r25, r1 |
4410: 5c f4 brge .+22 ; 0x4428 <MotorRegler+0x2be> |
4412: f9 01 movw r30, r18 |
4414: ee 0f add r30, r30 |
4416: ff 1f adc r31, r31 |
4418: ec 5a subi r30, 0xAC ; 172 |
441a: f3 4f sbci r31, 0xF3 ; 243 |
441c: 80 81 ld r24, Z |
441e: 91 81 ldd r25, Z+1 ; 0x01 |
4420: 87 34 cpi r24, 0x47 ; 71 |
4422: 91 05 cpc r25, r1 |
4424: 0c f0 brlt .+2 ; 0x4428 <MotorRegler+0x2be> |
4426: 43 e0 ldi r20, 0x03 ; 3 |
4428: fb 01 movw r30, r22 |
442a: ee 0f add r30, r30 |
442c: ff 1f adc r31, r31 |
442e: ec 5a subi r30, 0xAC ; 172 |
4430: f3 4f sbci r31, 0xF3 ; 243 |
4432: 80 81 ld r24, Z |
4434: 91 81 ldd r25, Z+1 ; 0x01 |
4436: 8a 5b subi r24, 0xBA ; 186 |
4438: 9f 4f sbci r25, 0xFF ; 255 |
443a: 5c f4 brge .+22 ; 0x4452 <MotorRegler+0x2e8> |
443c: f9 01 movw r30, r18 |
443e: ee 0f add r30, r30 |
4440: ff 1f adc r31, r31 |
4442: ec 5a subi r30, 0xAC ; 172 |
4444: f3 4f sbci r31, 0xF3 ; 243 |
4446: 80 81 ld r24, Z |
4448: 91 81 ldd r25, Z+1 ; 0x01 |
444a: 87 34 cpi r24, 0x47 ; 71 |
444c: 91 05 cpc r25, r1 |
444e: 0c f0 brlt .+2 ; 0x4452 <MotorRegler+0x2e8> |
4450: 44 e0 ldi r20, 0x04 ; 4 |
4452: 66 0f add r22, r22 |
4454: 77 1f adc r23, r23 |
4456: 6c 5a subi r22, 0xAC ; 172 |
4458: 73 4f sbci r23, 0xF3 ; 243 |
445a: fb 01 movw r30, r22 |
445c: 80 81 ld r24, Z |
445e: 91 81 ldd r25, Z+1 ; 0x01 |
4460: 8a 5b subi r24, 0xBA ; 186 |
4462: 9f 4f sbci r25, 0xFF ; 255 |
4464: 5c f4 brge .+22 ; 0x447c <MotorRegler+0x312> |
4466: 22 0f add r18, r18 |
4468: 33 1f adc r19, r19 |
446a: 2c 5a subi r18, 0xAC ; 172 |
446c: 33 4f sbci r19, 0xF3 ; 243 |
446e: f9 01 movw r30, r18 |
4470: 80 81 ld r24, Z |
4472: 91 81 ldd r25, Z+1 ; 0x01 |
4474: 86 34 cpi r24, 0x46 ; 70 |
4476: 91 05 cpc r25, r1 |
4478: 0c f4 brge .+2 ; 0x447c <MotorRegler+0x312> |
447a: 45 e0 ldi r20, 0x05 ; 5 |
447c: a2 e0 ldi r26, 0x02 ; 2 |
447e: b0 e0 ldi r27, 0x00 ; 0 |
4480: 04 2e mov r0, r20 |
4482: 0e 94 3a 3f call 0x7e74 ; 0x7e74 <__eeprom_write_byte_1F2021> |
4486: 0e 94 04 02 call 0x408 ; 0x408 <GetActiveParamSetNumber> |
448a: 4a e3 ldi r20, 0x3A ; 58 |
448c: 60 e9 ldi r22, 0x90 ; 144 |
448e: 7c e0 ldi r23, 0x0C ; 12 |
4490: 0e 94 23 02 call 0x446 ; 0x446 <ReadParameterSet> |
4494: 0e 94 04 02 call 0x408 ; 0x408 <GetActiveParamSetNumber> |
4498: 0e 94 a0 20 call 0x4140 ; 0x4140 <Piep> |
449c: 80 91 98 0c lds r24, 0x0C98 |
44a0: 80 ff sbrs r24, 0 |
44a2: b6 c0 rjmp .+364 ; 0x4610 <MotorRegler+0x4a6> |
44a4: 80 91 0a 01 lds r24, 0x010A |
44a8: 90 91 0b 01 lds r25, 0x010B |
44ac: 87 5b subi r24, 0xB7 ; 183 |
44ae: 93 40 sbci r25, 0x03 ; 3 |
44b0: 40 f4 brcc .+16 ; 0x44c2 <MotorRegler+0x358> |
44b2: 80 91 0a 01 lds r24, 0x010A |
44b6: 90 91 0b 01 lds r25, 0x010B |
44ba: 8e 5e subi r24, 0xEE ; 238 |
44bc: 92 40 sbci r25, 0x02 ; 2 |
44be: 08 f0 brcs .+2 ; 0x44c2 <MotorRegler+0x358> |
44c0: a7 c0 rjmp .+334 ; 0x4610 <MotorRegler+0x4a6> |
44c2: 0e 94 b5 10 call 0x216a ; 0x216a <SucheLuftruckOffset> |
44c6: a4 c0 rjmp .+328 ; 0x4610 <MotorRegler+0x4a6> |
44c8: 10 92 e9 08 sts 0x08E9, r1 |
44cc: a1 c0 rjmp .+322 ; 0x4610 <MotorRegler+0x4a6> |
44ce: 49 81 ldd r20, Y+1 ; 0x01 |
44d0: 5a 81 ldd r21, Y+2 ; 0x02 |
44d2: 43 32 cpi r20, 0x23 ; 35 |
44d4: 51 05 cpc r21, r1 |
44d6: 0c f0 brlt .+2 ; 0x44da <MotorRegler+0x370> |
44d8: 9b c0 rjmp .+310 ; 0x4610 <MotorRegler+0x4a6> |
44da: 80 91 93 0c lds r24, 0x0C93 |
44de: 48 2f mov r20, r24 |
44e0: 55 27 eor r21, r21 |
44e2: fa 01 movw r30, r20 |
44e4: ee 0f add r30, r30 |
44e6: ff 1f adc r31, r31 |
44e8: ec 5a subi r30, 0xAC ; 172 |
44ea: f3 4f sbci r31, 0xF3 ; 243 |
44ec: 80 81 ld r24, Z |
44ee: 91 81 ldd r25, Z+1 ; 0x01 |
44f0: 85 5b subi r24, 0xB5 ; 181 |
44f2: 9f 4f sbci r25, 0xFF ; 255 |
44f4: 0c f0 brlt .+2 ; 0x44f8 <MotorRegler+0x38e> |
44f6: 6d c0 rjmp .+218 ; 0x45d2 <MotorRegler+0x468> |
44f8: 80 91 e8 08 lds r24, 0x08E8 |
44fc: 8f 5f subi r24, 0xFF ; 255 |
44fe: 80 93 e8 08 sts 0x08E8, r24 |
4502: 89 3c cpi r24, 0xC9 ; 201 |
4504: 08 f4 brcc .+2 ; 0x4508 <MotorRegler+0x39e> |
4506: 67 c0 rjmp .+206 ; 0x45d6 <MotorRegler+0x46c> |
4508: 88 ec ldi r24, 0xC8 ; 200 |
450a: 80 93 e8 08 sts 0x08E8, r24 |
450e: 81 e0 ldi r24, 0x01 ; 1 |
4510: 90 e0 ldi r25, 0x00 ; 0 |
4512: 90 93 e6 08 sts 0x08E6, r25 |
4516: 80 93 e5 08 sts 0x08E5, r24 |
451a: 81 e0 ldi r24, 0x01 ; 1 |
451c: 80 93 d6 08 sts 0x08D6, r24 |
4520: 10 92 f8 08 sts 0x08F8, r1 |
4524: 10 92 f9 08 sts 0x08F9, r1 |
4528: 10 92 fa 08 sts 0x08FA, r1 |
452c: 10 92 fb 08 sts 0x08FB, r1 |
4530: 10 92 a7 08 sts 0x08A7, r1 |
4534: 10 92 a8 08 sts 0x08A8, r1 |
4538: 10 92 a9 08 sts 0x08A9, r1 |
453c: 10 92 aa 08 sts 0x08AA, r1 |
4540: 10 92 ab 08 sts 0x08AB, r1 |
4544: 10 92 ac 08 sts 0x08AC, r1 |
4548: 10 92 ad 08 sts 0x08AD, r1 |
454c: 10 92 ae 08 sts 0x08AE, r1 |
4550: 10 92 97 08 sts 0x0897, r1 |
4554: 10 92 98 08 sts 0x0898, r1 |
4558: 10 92 99 08 sts 0x0899, r1 |
455c: 10 92 9a 08 sts 0x089A, r1 |
4560: 10 92 9f 08 sts 0x089F, r1 |
4564: 10 92 a0 08 sts 0x08A0, r1 |
4568: 10 92 a1 08 sts 0x08A1, r1 |
456c: 10 92 a2 08 sts 0x08A2, r1 |
4570: 80 91 83 08 lds r24, 0x0883 |
4574: 90 91 84 08 lds r25, 0x0884 |
4578: a0 91 85 08 lds r26, 0x0885 |
457c: b0 91 86 08 lds r27, 0x0886 |
4580: 80 93 9b 08 sts 0x089B, r24 |
4584: 90 93 9c 08 sts 0x089C, r25 |
4588: a0 93 9d 08 sts 0x089D, r26 |
458c: b0 93 9e 08 sts 0x089E, r27 |
4590: 80 91 8b 08 lds r24, 0x088B |
4594: 90 91 8c 08 lds r25, 0x088C |
4598: a0 91 8d 08 lds r26, 0x088D |
459c: b0 91 8e 08 lds r27, 0x088E |
45a0: 80 93 a3 08 sts 0x08A3, r24 |
45a4: 90 93 a4 08 sts 0x08A4, r25 |
45a8: a0 93 a5 08 sts 0x08A5, r26 |
45ac: b0 93 a6 08 sts 0x08A6, r27 |
45b0: 10 92 00 09 sts 0x0900, r1 |
45b4: 10 92 01 09 sts 0x0901, r1 |
45b8: 10 92 02 09 sts 0x0902, r1 |
45bc: 10 92 03 09 sts 0x0903, r1 |
45c0: 10 92 fc 08 sts 0x08FC, r1 |
45c4: 10 92 fd 08 sts 0x08FD, r1 |
45c8: 10 92 fe 08 sts 0x08FE, r1 |
45cc: 10 92 ff 08 sts 0x08FF, r1 |
45d0: 02 c0 rjmp .+4 ; 0x45d6 <MotorRegler+0x46c> |
45d2: 10 92 e8 08 sts 0x08E8, r1 |
45d6: 44 0f add r20, r20 |
45d8: 55 1f adc r21, r21 |
45da: 4c 5a subi r20, 0xAC ; 172 |
45dc: 53 4f sbci r21, 0xF3 ; 243 |
45de: fa 01 movw r30, r20 |
45e0: 80 81 ld r24, Z |
45e2: 91 81 ldd r25, Z+1 ; 0x01 |
45e4: 8c 34 cpi r24, 0x4C ; 76 |
45e6: 91 05 cpc r25, r1 |
45e8: 8c f0 brlt .+34 ; 0x460c <MotorRegler+0x4a2> |
45ea: 80 91 e7 08 lds r24, 0x08E7 |
45ee: 8f 5f subi r24, 0xFF ; 255 |
45f0: 80 93 e7 08 sts 0x08E7, r24 |
45f4: 89 3c cpi r24, 0xC9 ; 201 |
45f6: 60 f0 brcs .+24 ; 0x4610 <MotorRegler+0x4a6> |
45f8: 10 92 d6 08 sts 0x08D6, r1 |
45fc: 88 ec ldi r24, 0xC8 ; 200 |
45fe: 80 93 e7 08 sts 0x08E7, r24 |
4602: 10 92 e6 08 sts 0x08E6, r1 |
4606: 10 92 e5 08 sts 0x08E5, r1 |
460a: 02 c0 rjmp .+4 ; 0x4610 <MotorRegler+0x4a6> |
460c: 10 92 e7 08 sts 0x08E7, r1 |
4610: 80 91 67 01 lds r24, 0x0167 |
4614: 81 50 subi r24, 0x01 ; 1 |
4616: 80 93 67 01 sts 0x0167, r24 |
461a: 80 91 67 01 lds r24, 0x0167 |
461e: 8f 3f cpi r24, 0xFF ; 255 |
4620: 29 f0 breq .+10 ; 0x462c <MotorRegler+0x4c2> |
4622: 80 91 b9 08 lds r24, 0x08B9 |
4626: 88 23 and r24, r24 |
4628: 09 f4 brne .+2 ; 0x462c <MotorRegler+0x4c2> |
462a: 26 c1 rjmp .+588 ; 0x4878 <MotorRegler+0x70e> |
462c: 0e 94 50 1c call 0x38a0 ; 0x38a0 <ParameterZuordnung> |
4630: e0 91 90 0c lds r30, 0x0C90 |
4634: ff 27 eor r31, r31 |
4636: ee 0f add r30, r30 |
4638: ff 1f adc r31, r31 |
463a: df 01 movw r26, r30 |
463c: ac 5a subi r26, 0xAC ; 172 |
463e: b3 4f sbci r27, 0xF3 ; 243 |
4640: 8d 91 ld r24, X+ |
4642: 9c 91 ld r25, X |
4644: 60 91 9f 0c lds r22, 0x0C9F |
4648: 77 27 eor r23, r23 |
464a: ee 58 subi r30, 0x8E ; 142 |
464c: f3 4f sbci r31, 0xF3 ; 243 |
464e: 20 81 ld r18, Z |
4650: 31 81 ldd r19, Z+1 ; 0x01 |
4652: 40 91 a0 0c lds r20, 0x0CA0 |
4656: 55 27 eor r21, r21 |
4658: fc 01 movw r30, r24 |
465a: e6 9f mul r30, r22 |
465c: c0 01 movw r24, r0 |
465e: e7 9f mul r30, r23 |
4660: 90 0d add r25, r0 |
4662: f6 9f mul r31, r22 |
4664: 90 0d add r25, r0 |
4666: 11 24 eor r1, r1 |
4668: f9 01 movw r30, r18 |
466a: e4 9f mul r30, r20 |
466c: 90 01 movw r18, r0 |
466e: e5 9f mul r30, r21 |
4670: 30 0d add r19, r0 |
4672: f4 9f mul r31, r20 |
4674: 30 0d add r19, r0 |
4676: 11 24 eor r1, r1 |
4678: 82 0f add r24, r18 |
467a: 93 1f adc r25, r19 |
467c: 90 93 d1 08 sts 0x08D1, r25 |
4680: 80 93 d0 08 sts 0x08D0, r24 |
4684: e0 91 91 0c lds r30, 0x0C91 |
4688: ff 27 eor r31, r31 |
468a: ee 0f add r30, r30 |
468c: ff 1f adc r31, r31 |
468e: df 01 movw r26, r30 |
4690: ac 5a subi r26, 0xAC ; 172 |
4692: b3 4f sbci r27, 0xF3 ; 243 |
4694: 8d 91 ld r24, X+ |
4696: 9c 91 ld r25, X |
4698: ee 58 subi r30, 0x8E ; 142 |
469a: f3 4f sbci r31, 0xF3 ; 243 |
469c: 20 81 ld r18, Z |
469e: 31 81 ldd r19, Z+1 ; 0x01 |
46a0: fc 01 movw r30, r24 |
46a2: e6 9f mul r30, r22 |
46a4: c0 01 movw r24, r0 |
46a6: e7 9f mul r30, r23 |
46a8: 90 0d add r25, r0 |
46aa: f6 9f mul r31, r22 |
46ac: 90 0d add r25, r0 |
46ae: 11 24 eor r1, r1 |
46b0: b9 01 movw r22, r18 |
46b2: 64 9f mul r22, r20 |
46b4: 90 01 movw r18, r0 |
46b6: 65 9f mul r22, r21 |
46b8: 30 0d add r19, r0 |
46ba: 74 9f mul r23, r20 |
46bc: 30 0d add r19, r0 |
46be: 11 24 eor r1, r1 |
46c0: 82 0f add r24, r18 |
46c2: 93 1f adc r25, r19 |
46c4: 90 93 d3 08 sts 0x08D3, r25 |
46c8: 80 93 d2 08 sts 0x08D2, r24 |
46cc: e0 91 93 0c lds r30, 0x0C93 |
46d0: ff 27 eor r31, r31 |
46d2: ee 0f add r30, r30 |
46d4: ff 1f adc r31, r31 |
46d6: ec 5a subi r30, 0xAC ; 172 |
46d8: f3 4f sbci r31, 0xF3 ; 243 |
46da: 80 81 ld r24, Z |
46dc: 91 81 ldd r25, Z+1 ; 0x01 |
46de: 90 95 com r25 |
46e0: 81 95 neg r24 |
46e2: 9f 4f sbci r25, 0xFF ; 255 |
46e4: 90 93 d5 08 sts 0x08D5, r25 |
46e8: 80 93 d4 08 sts 0x08D4, r24 |
46ec: 10 91 85 01 lds r17, 0x0185 |
46f0: 61 2f mov r22, r17 |
46f2: 77 27 eor r23, r23 |
46f4: 67 fd sbrc r22, 7 |
46f6: 70 95 com r23 |
46f8: 87 2f mov r24, r23 |
46fa: 97 2f mov r25, r23 |
46fc: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
4700: 17 ff sbrs r17, 7 |
4702: 06 c0 rjmp .+12 ; 0x4710 <MotorRegler+0x5a6> |
4704: 20 e0 ldi r18, 0x00 ; 0 |
4706: 30 e0 ldi r19, 0x00 ; 0 |
4708: 40 e8 ldi r20, 0x80 ; 128 |
470a: 53 e4 ldi r21, 0x43 ; 67 |
470c: 0e 94 11 3d call 0x7a22 ; 0x7a22 <__addsf3> |
4710: 20 e0 ldi r18, 0x00 ; 0 |
4712: 30 e0 ldi r19, 0x00 ; 0 |
4714: 40 e2 ldi r20, 0x20 ; 32 |
4716: 51 e4 ldi r21, 0x41 ; 65 |
4718: 0e 94 11 3d call 0x7a22 ; 0x7a22 <__addsf3> |
471c: 20 e0 ldi r18, 0x00 ; 0 |
471e: 30 e0 ldi r19, 0x00 ; 0 |
4720: 40 e8 ldi r20, 0x80 ; 128 |
4722: 5b e3 ldi r21, 0x3B ; 59 |
4724: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
4728: 5b 01 movw r10, r22 |
472a: 6c 01 movw r12, r24 |
472c: 60 93 da 0c sts 0x0CDA, r22 |
4730: 70 93 db 0c sts 0x0CDB, r23 |
4734: 80 93 dc 0c sts 0x0CDC, r24 |
4738: 90 93 dd 0c sts 0x0CDD, r25 |
473c: 10 91 86 01 lds r17, 0x0186 |
4740: 61 2f mov r22, r17 |
4742: 77 27 eor r23, r23 |
4744: 67 fd sbrc r22, 7 |
4746: 70 95 com r23 |
4748: 87 2f mov r24, r23 |
474a: 97 2f mov r25, r23 |
474c: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
4750: 17 ff sbrs r17, 7 |
4752: 06 c0 rjmp .+12 ; 0x4760 <MotorRegler+0x5f6> |
4754: 20 e0 ldi r18, 0x00 ; 0 |
4756: 30 e0 ldi r19, 0x00 ; 0 |
4758: 40 e8 ldi r20, 0x80 ; 128 |
475a: 53 e4 ldi r21, 0x43 ; 67 |
475c: 0e 94 11 3d call 0x7a22 ; 0x7a22 <__addsf3> |
4760: 20 e0 ldi r18, 0x00 ; 0 |
4762: 30 ee ldi r19, 0xE0 ; 224 |
4764: 4b e2 ldi r20, 0x2B ; 43 |
4766: 57 e4 ldi r21, 0x47 ; 71 |
4768: 0e 94 53 3d call 0x7aa6 ; 0x7aa6 <__divsf3> |
476c: 60 93 d1 0c sts 0x0CD1, r22 |
4770: 70 93 d2 0c sts 0x0CD2, r23 |
4774: 80 93 d3 0c sts 0x0CD3, r24 |
4778: 90 93 d4 0c sts 0x0CD4, r25 |
477c: 80 91 98 0c lds r24, 0x0C98 |
4780: 82 ff sbrs r24, 2 |
4782: 0c c0 rjmp .+24 ; 0x479c <MotorRegler+0x632> |
4784: 80 e0 ldi r24, 0x00 ; 0 |
4786: 90 e0 ldi r25, 0x00 ; 0 |
4788: a0 e0 ldi r26, 0x00 ; 0 |
478a: b0 e0 ldi r27, 0x00 ; 0 |
478c: 80 93 d1 0c sts 0x0CD1, r24 |
4790: 90 93 d2 0c sts 0x0CD2, r25 |
4794: a0 93 d3 0c sts 0x0CD3, r26 |
4798: b0 93 d4 0c sts 0x0CD4, r27 |
479c: 20 e0 ldi r18, 0x00 ; 0 |
479e: 30 e0 ldi r19, 0x00 ; 0 |
47a0: 40 e0 ldi r20, 0x00 ; 0 |
47a2: 50 e0 ldi r21, 0x00 ; 0 |
47a4: c6 01 movw r24, r12 |
47a6: b5 01 movw r22, r10 |
47a8: 0e 94 c0 3d call 0x7b80 ; 0x7b80 <__eqsf2> |
47ac: 88 23 and r24, r24 |
47ae: 64 f4 brge .+24 ; 0x47c8 <MotorRegler+0x65e> |
47b0: 80 e0 ldi r24, 0x00 ; 0 |
47b2: 90 e0 ldi r25, 0x00 ; 0 |
47b4: a0 e0 ldi r26, 0x00 ; 0 |
47b6: b0 e0 ldi r27, 0x00 ; 0 |
47b8: 80 93 da 0c sts 0x0CDA, r24 |
47bc: 90 93 db 0c sts 0x0CDB, r25 |
47c0: a0 93 dc 0c sts 0x0CDC, r26 |
47c4: b0 93 dd 0c sts 0x0CDD, r27 |
47c8: 20 e0 ldi r18, 0x00 ; 0 |
47ca: 30 e0 ldi r19, 0x00 ; 0 |
47cc: 40 e0 ldi r20, 0x00 ; 0 |
47ce: 50 e0 ldi r21, 0x00 ; 0 |
47d0: 60 91 d1 0c lds r22, 0x0CD1 |
47d4: 70 91 d2 0c lds r23, 0x0CD2 |
47d8: 80 91 d3 0c lds r24, 0x0CD3 |
47dc: 90 91 d4 0c lds r25, 0x0CD4 |
47e0: 0e 94 c0 3d call 0x7b80 ; 0x7b80 <__eqsf2> |
47e4: 88 23 and r24, r24 |
47e6: 64 f4 brge .+24 ; 0x4800 <MotorRegler+0x696> |
47e8: 80 e0 ldi r24, 0x00 ; 0 |
47ea: 90 e0 ldi r25, 0x00 ; 0 |
47ec: a0 e0 ldi r26, 0x00 ; 0 |
47ee: b0 e0 ldi r27, 0x00 ; 0 |
47f0: 80 93 d1 0c sts 0x0CD1, r24 |
47f4: 90 93 d2 0c sts 0x0CD2, r25 |
47f8: a0 93 d3 0c sts 0x0CD3, r26 |
47fc: b0 93 d4 0c sts 0x0CD4, r27 |
4800: 42 98 cbi 0x08, 2 ; 8 |
4802: 90 91 de 08 lds r25, 0x08DE |
4806: 80 91 bb 08 lds r24, 0x08BB |
480a: 89 17 cp r24, r25 |
480c: 40 f0 brcs .+16 ; 0x481e <MotorRegler+0x6b4> |
480e: 99 23 and r25, r25 |
4810: 31 f0 breq .+12 ; 0x481e <MotorRegler+0x6b4> |
4812: 88 b1 in r24, 0x08 ; 8 |
4814: 94 e0 ldi r25, 0x04 ; 4 |
4816: 89 27 eor r24, r25 |
4818: 88 b9 out 0x08, r24 ; 8 |
481a: 10 92 bb 08 sts 0x08BB, r1 |
481e: 80 91 bb 08 lds r24, 0x08BB |
4822: 8f 5f subi r24, 0xFF ; 255 |
4824: 80 93 bb 08 sts 0x08BB, r24 |
4828: 80 91 b9 08 lds r24, 0x08B9 |
482c: 88 23 and r24, r24 |
482e: 21 f1 breq .+72 ; 0x4878 <MotorRegler+0x70e> |
4830: 10 92 d5 08 sts 0x08D5, r1 |
4834: 10 92 d4 08 sts 0x08D4, r1 |
4838: 10 92 d1 08 sts 0x08D1, r1 |
483c: 10 92 d0 08 sts 0x08D0, r1 |
4840: 10 92 d3 08 sts 0x08D3, r1 |
4844: 10 92 d2 08 sts 0x08D2, r1 |
4848: 8d ec ldi r24, 0xCD ; 205 |
484a: 9c ec ldi r25, 0xCC ; 204 |
484c: ac ec ldi r26, 0xCC ; 204 |
484e: bd e3 ldi r27, 0x3D ; 61 |
4850: 80 93 da 0c sts 0x0CDA, r24 |
4854: 90 93 db 0c sts 0x0CDB, r25 |
4858: a0 93 dc 0c sts 0x0CDC, r26 |
485c: b0 93 dd 0c sts 0x0CDD, r27 |
4860: 8a e0 ldi r24, 0x0A ; 10 |
4862: 97 ed ldi r25, 0xD7 ; 215 |
4864: a3 ea ldi r26, 0xA3 ; 163 |
4866: bb e3 ldi r27, 0x3B ; 59 |
4868: 80 93 d1 0c sts 0x0CD1, r24 |
486c: 90 93 d2 0c sts 0x0CD2, r25 |
4870: a0 93 d3 0c sts 0x0CD3, r26 |
4874: b0 93 d4 0c sts 0x0CD4, r27 |
4878: 80 91 62 08 lds r24, 0x0862 |
487c: 90 91 63 08 lds r25, 0x0863 |
4880: 8d 54 subi r24, 0x4D ; 77 |
4882: 91 40 sbci r25, 0x01 ; 1 |
4884: 08 f4 brcc .+2 ; 0x4888 <MotorRegler+0x71e> |
4886: bc c0 rjmp .+376 ; 0x4a00 <MotorRegler+0x896> |
4888: 20 91 87 08 lds r18, 0x0887 |
488c: 30 91 88 08 lds r19, 0x0888 |
4890: 40 91 89 08 lds r20, 0x0889 |
4894: 50 91 8a 08 lds r21, 0x088A |
4898: 80 91 83 08 lds r24, 0x0883 |
489c: 90 91 84 08 lds r25, 0x0884 |
48a0: a0 91 85 08 lds r26, 0x0885 |
48a4: b0 91 86 08 lds r27, 0x0886 |
48a8: b9 01 movw r22, r18 |
48aa: 68 1b sub r22, r24 |
48ac: 79 0b sbc r23, r25 |
48ae: 70 93 ef 08 sts 0x08EF, r23 |
48b2: 60 93 ee 08 sts 0x08EE, r22 |
48b6: 20 91 8f 08 lds r18, 0x088F |
48ba: 30 91 90 08 lds r19, 0x0890 |
48be: 40 91 91 08 lds r20, 0x0891 |
48c2: 50 91 92 08 lds r21, 0x0892 |
48c6: 80 91 8b 08 lds r24, 0x088B |
48ca: 90 91 8c 08 lds r25, 0x088C |
48ce: a0 91 8d 08 lds r26, 0x088D |
48d2: b0 91 8e 08 lds r27, 0x088E |
48d6: 28 1b sub r18, r24 |
48d8: 39 0b sbc r19, r25 |
48da: 30 93 ed 08 sts 0x08ED, r19 |
48de: 20 93 ec 08 sts 0x08EC, r18 |
48e2: 10 92 63 08 sts 0x0863, r1 |
48e6: 10 92 62 08 sts 0x0862, r1 |
48ea: 67 3a cpi r22, 0xA7 ; 167 |
48ec: 71 05 cpc r23, r1 |
48ee: 34 f0 brlt .+12 ; 0x48fc <MotorRegler+0x792> |
48f0: 80 91 73 08 lds r24, 0x0873 |
48f4: 90 91 74 08 lds r25, 0x0874 |
48f8: 01 96 adiw r24, 0x01 ; 1 |
48fa: 08 c0 rjmp .+16 ; 0x490c <MotorRegler+0x7a2> |
48fc: 6a 55 subi r22, 0x5A ; 90 |
48fe: 7f 4f sbci r23, 0xFF ; 255 |
4900: 4c f4 brge .+18 ; 0x4914 <MotorRegler+0x7aa> |
4902: 80 91 73 08 lds r24, 0x0873 |
4906: 90 91 74 08 lds r25, 0x0874 |
490a: 01 97 sbiw r24, 0x01 ; 1 |
490c: 90 93 74 08 sts 0x0874, r25 |
4910: 80 93 73 08 sts 0x0873, r24 |
4914: 27 3a cpi r18, 0xA7 ; 167 |
4916: 31 05 cpc r19, r1 |
4918: 34 f0 brlt .+12 ; 0x4926 <MotorRegler+0x7bc> |
491a: 80 91 75 08 lds r24, 0x0875 |
491e: 90 91 76 08 lds r25, 0x0876 |
4922: 01 96 adiw r24, 0x01 ; 1 |
4924: 08 c0 rjmp .+16 ; 0x4936 <MotorRegler+0x7cc> |
4926: 2a 55 subi r18, 0x5A ; 90 |
4928: 3f 4f sbci r19, 0xFF ; 255 |
492a: 4c f4 brge .+18 ; 0x493e <MotorRegler+0x7d4> |
492c: 80 91 75 08 lds r24, 0x0875 |
4930: 90 91 76 08 lds r25, 0x0876 |
4934: 01 97 sbiw r24, 0x01 ; 1 |
4936: 90 93 76 08 sts 0x0876, r25 |
493a: 80 93 75 08 sts 0x0875, r24 |
493e: 80 91 ab 08 lds r24, 0x08AB |
4942: 90 91 ac 08 lds r25, 0x08AC |
4946: a0 91 ad 08 lds r26, 0x08AD |
494a: b0 91 ae 08 lds r27, 0x08AE |
494e: 87 3a cpi r24, 0xA7 ; 167 |
4950: 91 05 cpc r25, r1 |
4952: a1 05 cpc r26, r1 |
4954: b1 05 cpc r27, r1 |
4956: 4c f0 brlt .+18 ; 0x496a <MotorRegler+0x800> |
4958: 80 91 77 08 lds r24, 0x0877 |
495c: 90 91 78 08 lds r25, 0x0878 |
4960: 01 97 sbiw r24, 0x01 ; 1 |
4962: 90 93 78 08 sts 0x0878, r25 |
4966: 80 93 77 08 sts 0x0877, r24 |
496a: 80 91 ab 08 lds r24, 0x08AB |
496e: 90 91 ac 08 lds r25, 0x08AC |
4972: a0 91 ad 08 lds r26, 0x08AD |
4976: b0 91 ae 08 lds r27, 0x08AE |
497a: 8a 55 subi r24, 0x5A ; 90 |
497c: 9f 4f sbci r25, 0xFF ; 255 |
497e: af 4f sbci r26, 0xFF ; 255 |
4980: bf 4f sbci r27, 0xFF ; 255 |
4982: 4c f4 brge .+18 ; 0x4996 <MotorRegler+0x82c> |
4984: 80 91 77 08 lds r24, 0x0877 |
4988: 90 91 78 08 lds r25, 0x0878 |
498c: 01 96 adiw r24, 0x01 ; 1 |
498e: 90 93 78 08 sts 0x0878, r25 |
4992: 80 93 77 08 sts 0x0877, r24 |
4996: 10 92 7a 00 sts 0x007A, r1 |
499a: 80 91 83 08 lds r24, 0x0883 |
499e: 90 91 84 08 lds r25, 0x0884 |
49a2: a0 91 85 08 lds r26, 0x0885 |
49a6: b0 91 86 08 lds r27, 0x0886 |
49aa: 80 93 9b 08 sts 0x089B, r24 |
49ae: 90 93 9c 08 sts 0x089C, r25 |
49b2: a0 93 9d 08 sts 0x089D, r26 |
49b6: b0 93 9e 08 sts 0x089E, r27 |
49ba: 80 91 8b 08 lds r24, 0x088B |
49be: 90 91 8c 08 lds r25, 0x088C |
49c2: a0 91 8d 08 lds r26, 0x088D |
49c6: b0 91 8e 08 lds r27, 0x088E |
49ca: 80 93 a3 08 sts 0x08A3, r24 |
49ce: 90 93 a4 08 sts 0x08A4, r25 |
49d2: a0 93 a5 08 sts 0x08A5, r26 |
49d6: b0 93 a6 08 sts 0x08A6, r27 |
49da: 80 91 93 08 lds r24, 0x0893 |
49de: 90 91 94 08 lds r25, 0x0894 |
49e2: a0 91 95 08 lds r26, 0x0895 |
49e6: b0 91 96 08 lds r27, 0x0896 |
49ea: 80 93 ab 08 sts 0x08AB, r24 |
49ee: 90 93 ac 08 sts 0x08AC, r25 |
49f2: a0 93 ad 08 sts 0x08AD, r26 |
49f6: b0 93 ae 08 sts 0x08AE, r27 |
49fa: 8f ee ldi r24, 0xEF ; 239 |
49fc: 80 93 7a 00 sts 0x007A, r24 |
4a00: 60 91 83 08 lds r22, 0x0883 |
4a04: 70 91 84 08 lds r23, 0x0884 |
4a08: 80 91 85 08 lds r24, 0x0885 |
4a0c: 90 91 86 08 lds r25, 0x0886 |
4a10: a0 90 a4 0c lds r10, 0x0CA4 |
4a14: bb 24 eor r11, r11 |
4a16: cc 24 eor r12, r12 |
4a18: dd 24 eor r13, r13 |
4a1a: e0 90 d5 0c lds r14, 0x0CD5 |
4a1e: f0 90 d6 0c lds r15, 0x0CD6 |
4a22: a6 01 movw r20, r12 |
4a24: 95 01 movw r18, r10 |
4a26: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
4a2a: 00 27 eor r16, r16 |
4a2c: f7 fc sbrc r15, 7 |
4a2e: 00 95 com r16 |
4a30: 10 2f mov r17, r16 |
4a32: 2e 19 sub r18, r14 |
4a34: 3f 09 sbc r19, r15 |
4a36: 40 0b sbc r20, r16 |
4a38: 51 0b sbc r21, r17 |
4a3a: ca 01 movw r24, r20 |
4a3c: b9 01 movw r22, r18 |
4a3e: 20 e1 ldi r18, 0x10 ; 16 |
4a40: 30 e0 ldi r19, 0x00 ; 0 |
4a42: 40 e0 ldi r20, 0x00 ; 0 |
4a44: 50 e0 ldi r21, 0x00 ; 0 |
4a46: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
4a4a: 39 01 movw r6, r18 |
4a4c: 4a 01 movw r8, r20 |
4a4e: 20 93 f4 08 sts 0x08F4, r18 |
4a52: 30 93 f5 08 sts 0x08F5, r19 |
4a56: 40 93 f6 08 sts 0x08F6, r20 |
4a5a: 50 93 f7 08 sts 0x08F7, r21 |
4a5e: 60 91 8b 08 lds r22, 0x088B |
4a62: 70 91 8c 08 lds r23, 0x088C |
4a66: 80 91 8d 08 lds r24, 0x088D |
4a6a: 90 91 8e 08 lds r25, 0x088E |
4a6e: e0 90 de 0c lds r14, 0x0CDE |
4a72: f0 90 df 0c lds r15, 0x0CDF |
4a76: a6 01 movw r20, r12 |
4a78: 95 01 movw r18, r10 |
4a7a: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
4a7e: 00 27 eor r16, r16 |
4a80: f7 fc sbrc r15, 7 |
4a82: 00 95 com r16 |
4a84: 10 2f mov r17, r16 |
4a86: 2e 19 sub r18, r14 |
4a88: 3f 09 sbc r19, r15 |
4a8a: 40 0b sbc r20, r16 |
4a8c: 51 0b sbc r21, r17 |
4a8e: ca 01 movw r24, r20 |
4a90: b9 01 movw r22, r18 |
4a92: 20 e1 ldi r18, 0x10 ; 16 |
4a94: 30 e0 ldi r19, 0x00 ; 0 |
4a96: 40 e0 ldi r20, 0x00 ; 0 |
4a98: 50 e0 ldi r21, 0x00 ; 0 |
4a9a: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
4a9e: 20 93 f0 08 sts 0x08F0, r18 |
4aa2: 30 93 f1 08 sts 0x08F1, r19 |
4aa6: 40 93 f2 08 sts 0x08F2, r20 |
4aaa: 50 93 f3 08 sts 0x08F3, r21 |
4aae: f5 ef ldi r31, 0xF5 ; 245 |
4ab0: 6f 16 cp r6, r31 |
4ab2: f1 e0 ldi r31, 0x01 ; 1 |
4ab4: 7f 06 cpc r7, r31 |
4ab6: f0 e0 ldi r31, 0x00 ; 0 |
4ab8: 8f 06 cpc r8, r31 |
4aba: f0 e0 ldi r31, 0x00 ; 0 |
4abc: 9f 06 cpc r9, r31 |
4abe: 2c f0 brlt .+10 ; 0x4aca <MotorRegler+0x960> |
4ac0: 84 ef ldi r24, 0xF4 ; 244 |
4ac2: 91 e0 ldi r25, 0x01 ; 1 |
4ac4: a0 e0 ldi r26, 0x00 ; 0 |
4ac6: b0 e0 ldi r27, 0x00 ; 0 |
4ac8: 0d c0 rjmp .+26 ; 0x4ae4 <MotorRegler+0x97a> |
4aca: 6c e0 ldi r22, 0x0C ; 12 |
4acc: 66 16 cp r6, r22 |
4ace: 6e ef ldi r22, 0xFE ; 254 |
4ad0: 76 06 cpc r7, r22 |
4ad2: 6f ef ldi r22, 0xFF ; 255 |
4ad4: 86 06 cpc r8, r22 |
4ad6: 6f ef ldi r22, 0xFF ; 255 |
4ad8: 96 06 cpc r9, r22 |
4ada: 64 f4 brge .+24 ; 0x4af4 <MotorRegler+0x98a> |
4adc: 8c e0 ldi r24, 0x0C ; 12 |
4ade: 9e ef ldi r25, 0xFE ; 254 |
4ae0: af ef ldi r26, 0xFF ; 255 |
4ae2: bf ef ldi r27, 0xFF ; 255 |
4ae4: 80 93 f4 08 sts 0x08F4, r24 |
4ae8: 90 93 f5 08 sts 0x08F5, r25 |
4aec: a0 93 f6 08 sts 0x08F6, r26 |
4af0: b0 93 f7 08 sts 0x08F7, r27 |
4af4: 25 3f cpi r18, 0xF5 ; 245 |
4af6: 71 e0 ldi r23, 0x01 ; 1 |
4af8: 37 07 cpc r19, r23 |
4afa: 70 e0 ldi r23, 0x00 ; 0 |
4afc: 47 07 cpc r20, r23 |
4afe: 70 e0 ldi r23, 0x00 ; 0 |
4b00: 57 07 cpc r21, r23 |
4b02: 2c f0 brlt .+10 ; 0x4b0e <MotorRegler+0x9a4> |
4b04: 84 ef ldi r24, 0xF4 ; 244 |
4b06: 91 e0 ldi r25, 0x01 ; 1 |
4b08: a0 e0 ldi r26, 0x00 ; 0 |
4b0a: b0 e0 ldi r27, 0x00 ; 0 |
4b0c: 09 c0 rjmp .+18 ; 0x4b20 <MotorRegler+0x9b6> |
4b0e: 2c 50 subi r18, 0x0C ; 12 |
4b10: 3e 4f sbci r19, 0xFE ; 254 |
4b12: 4f 4f sbci r20, 0xFF ; 255 |
4b14: 5f 4f sbci r21, 0xFF ; 255 |
4b16: 64 f4 brge .+24 ; 0x4b30 <MotorRegler+0x9c6> |
4b18: 8c e0 ldi r24, 0x0C ; 12 |
4b1a: 9e ef ldi r25, 0xFE ; 254 |
4b1c: af ef ldi r26, 0xFF ; 255 |
4b1e: bf ef ldi r27, 0xFF ; 255 |
4b20: 80 93 f0 08 sts 0x08F0, r24 |
4b24: 90 93 f1 08 sts 0x08F1, r25 |
4b28: a0 93 f2 08 sts 0x08F2, r26 |
4b2c: b0 93 f3 08 sts 0x08F3, r27 |
4b30: 10 92 7a 00 sts 0x007A, r1 |
4b34: 80 91 97 08 lds r24, 0x0897 |
4b38: 90 91 98 08 lds r25, 0x0898 |
4b3c: a0 91 99 08 lds r26, 0x0899 |
4b40: b0 91 9a 08 lds r27, 0x089A |
4b44: 20 91 f4 08 lds r18, 0x08F4 |
4b48: 30 91 f5 08 lds r19, 0x08F5 |
4b4c: 40 91 f6 08 lds r20, 0x08F6 |
4b50: 50 91 f7 08 lds r21, 0x08F7 |
4b54: 82 1b sub r24, r18 |
4b56: 93 0b sbc r25, r19 |
4b58: a4 0b sbc r26, r20 |
4b5a: b5 0b sbc r27, r21 |
4b5c: 80 93 97 08 sts 0x0897, r24 |
4b60: 90 93 98 08 sts 0x0898, r25 |
4b64: a0 93 99 08 sts 0x0899, r26 |
4b68: b0 93 9a 08 sts 0x089A, r27 |
4b6c: 80 91 9f 08 lds r24, 0x089F |
4b70: 90 91 a0 08 lds r25, 0x08A0 |
4b74: a0 91 a1 08 lds r26, 0x08A1 |
4b78: b0 91 a2 08 lds r27, 0x08A2 |
4b7c: 20 91 f0 08 lds r18, 0x08F0 |
4b80: 30 91 f1 08 lds r19, 0x08F1 |
4b84: 40 91 f2 08 lds r20, 0x08F2 |
4b88: 50 91 f3 08 lds r21, 0x08F3 |
4b8c: 82 1b sub r24, r18 |
4b8e: 93 0b sbc r25, r19 |
4b90: a4 0b sbc r26, r20 |
4b92: b5 0b sbc r27, r21 |
4b94: 80 93 9f 08 sts 0x089F, r24 |
4b98: 90 93 a0 08 sts 0x08A0, r25 |
4b9c: a0 93 a1 08 sts 0x08A1, r26 |
4ba0: b0 93 a2 08 sts 0x08A2, r27 |
4ba4: 80 91 d4 08 lds r24, 0x08D4 |
4ba8: 90 91 d5 08 lds r25, 0x08D5 |
4bac: 5c 01 movw r10, r24 |
4bae: cc 24 eor r12, r12 |
4bb0: b7 fc sbrc r11, 7 |
4bb2: c0 94 com r12 |
4bb4: dc 2c mov r13, r12 |
4bb6: a0 92 f8 08 sts 0x08F8, r10 |
4bba: b0 92 f9 08 sts 0x08F9, r11 |
4bbe: c0 92 fa 08 sts 0x08FA, r12 |
4bc2: d0 92 fb 08 sts 0x08FB, r13 |
4bc6: 97 ff sbrs r25, 7 |
4bc8: 03 c0 rjmp .+6 ; 0x4bd0 <MotorRegler+0xa66> |
4bca: 90 95 com r25 |
4bcc: 81 95 neg r24 |
4bce: 9f 4f sbci r25, 0xFF ; 255 |
4bd0: 84 97 sbiw r24, 0x24 ; 36 |
4bd2: 3c f0 brlt .+14 ; 0x4be2 <MotorRegler+0xa78> |
4bd4: 80 91 98 0c lds r24, 0x0C98 |
4bd8: 84 fd sbrc r24, 4 |
4bda: 03 c0 rjmp .+6 ; 0x4be2 <MotorRegler+0xa78> |
4bdc: 81 e0 ldi r24, 0x01 ; 1 |
4bde: 80 93 e1 08 sts 0x08E1, r24 |
4be2: 60 90 a7 08 lds r6, 0x08A7 |
4be6: 70 90 a8 08 lds r7, 0x08A8 |
4bea: 80 90 a9 08 lds r8, 0x08A9 |
4bee: 90 90 aa 08 lds r9, 0x08AA |
4bf2: c5 01 movw r24, r10 |
4bf4: b7 fe sbrs r11, 7 |
4bf6: 03 c0 rjmp .+6 ; 0x4bfe <MotorRegler+0xa94> |
4bf8: 90 95 com r25 |
4bfa: 81 95 neg r24 |
4bfc: 9f 4f sbci r25, 0xFF ; 255 |
4bfe: 7c 01 movw r14, r24 |
4c00: 00 27 eor r16, r16 |
4c02: f7 fc sbrc r15, 7 |
4c04: 00 95 com r16 |
4c06: 10 2f mov r17, r16 |
4c08: 20 91 a1 0c lds r18, 0x0CA1 |
4c0c: 33 27 eor r19, r19 |
4c0e: 44 27 eor r20, r20 |
4c10: 55 27 eor r21, r21 |
4c12: c6 01 movw r24, r12 |
4c14: b5 01 movw r22, r10 |
4c16: 0e 94 78 3e call 0x7cf0 ; 0x7cf0 <__mulsi3> |
4c1a: 9b 01 movw r18, r22 |
4c1c: ac 01 movw r20, r24 |
4c1e: c8 01 movw r24, r16 |
4c20: b7 01 movw r22, r14 |
4c22: 0e 94 78 3e call 0x7cf0 ; 0x7cf0 <__mulsi3> |
4c26: 20 e0 ldi r18, 0x00 ; 0 |
4c28: 31 e0 ldi r19, 0x01 ; 1 |
4c2a: 40 e0 ldi r20, 0x00 ; 0 |
4c2c: 50 e0 ldi r21, 0x00 ; 0 |
4c2e: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
4c32: 44 27 eor r20, r20 |
4c34: 37 fd sbrc r19, 7 |
4c36: 40 95 com r20 |
4c38: 54 2f mov r21, r20 |
4c3a: 62 1a sub r6, r18 |
4c3c: 73 0a sbc r7, r19 |
4c3e: 84 0a sbc r8, r20 |
4c40: 95 0a sbc r9, r21 |
4c42: 60 92 a7 08 sts 0x08A7, r6 |
4c46: 70 92 a8 08 sts 0x08A8, r7 |
4c4a: 80 92 a9 08 sts 0x08A9, r8 |
4c4e: 90 92 aa 08 sts 0x08AA, r9 |
4c52: 80 91 a7 08 lds r24, 0x08A7 |
4c56: 90 91 a8 08 lds r25, 0x08A8 |
4c5a: a0 91 a9 08 lds r26, 0x08A9 |
4c5e: b0 91 aa 08 lds r27, 0x08AA |
4c62: 81 53 subi r24, 0x31 ; 49 |
4c64: 95 47 sbci r25, 0x75 ; 117 |
4c66: a0 40 sbci r26, 0x00 ; 0 |
4c68: b0 40 sbci r27, 0x00 ; 0 |
4c6a: 64 f0 brlt .+24 ; 0x4c84 <MotorRegler+0xb1a> |
4c6c: 80 e3 ldi r24, 0x30 ; 48 |
4c6e: 95 e7 ldi r25, 0x75 ; 117 |
4c70: a0 e0 ldi r26, 0x00 ; 0 |
4c72: b0 e0 ldi r27, 0x00 ; 0 |
4c74: 80 93 a7 08 sts 0x08A7, r24 |
4c78: 90 93 a8 08 sts 0x08A8, r25 |
4c7c: a0 93 a9 08 sts 0x08A9, r26 |
4c80: b0 93 aa 08 sts 0x08AA, r27 |
4c84: 80 91 a7 08 lds r24, 0x08A7 |
4c88: 90 91 a8 08 lds r25, 0x08A8 |
4c8c: a0 91 a9 08 lds r26, 0x08A9 |
4c90: b0 91 aa 08 lds r27, 0x08AA |
4c94: 80 5d subi r24, 0xD0 ; 208 |
4c96: 9a 48 sbci r25, 0x8A ; 138 |
4c98: af 4f sbci r26, 0xFF ; 255 |
4c9a: bf 4f sbci r27, 0xFF ; 255 |
4c9c: 64 f4 brge .+24 ; 0x4cb6 <MotorRegler+0xb4c> |
4c9e: 80 ed ldi r24, 0xD0 ; 208 |
4ca0: 9a e8 ldi r25, 0x8A ; 138 |
4ca2: af ef ldi r26, 0xFF ; 255 |
4ca4: bf ef ldi r27, 0xFF ; 255 |
4ca6: 80 93 a7 08 sts 0x08A7, r24 |
4caa: 90 93 a8 08 sts 0x08A8, r25 |
4cae: a0 93 a9 08 sts 0x08A9, r26 |
4cb2: b0 93 aa 08 sts 0x08AA, r27 |
4cb6: 8f ee ldi r24, 0xEF ; 239 |
4cb8: 80 93 7a 00 sts 0x007A, r24 |
4cbc: 80 91 b3 08 lds r24, 0x08B3 |
4cc0: 90 91 b4 08 lds r25, 0x08B4 |
4cc4: 89 2b or r24, r25 |
4cc6: 09 f4 brne .+2 ; 0x4cca <MotorRegler+0xb60> |
4cc8: a1 c0 rjmp .+322 ; 0x4e0c <MotorRegler+0xca2> |
4cca: 80 91 98 0c lds r24, 0x0C98 |
4cce: 83 ff sbrs r24, 3 |
4cd0: 9d c0 rjmp .+314 ; 0x4e0c <MotorRegler+0xca2> |
4cd2: 60 91 83 08 lds r22, 0x0883 |
4cd6: 70 91 84 08 lds r23, 0x0884 |
4cda: 80 91 85 08 lds r24, 0x0885 |
4cde: 90 91 86 08 lds r25, 0x0886 |
4ce2: 20 e0 ldi r18, 0x00 ; 0 |
4ce4: 32 e0 ldi r19, 0x02 ; 2 |
4ce6: 40 e0 ldi r20, 0x00 ; 0 |
4ce8: 50 e0 ldi r21, 0x00 ; 0 |
4cea: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
4cee: 89 01 movw r16, r18 |
4cf0: 37 ff sbrs r19, 7 |
4cf2: 03 c0 rjmp .+6 ; 0x4cfa <MotorRegler+0xb90> |
4cf4: 10 95 com r17 |
4cf6: 01 95 neg r16 |
4cf8: 1f 4f sbci r17, 0xFF ; 255 |
4cfa: 60 91 8b 08 lds r22, 0x088B |
4cfe: 70 91 8c 08 lds r23, 0x088C |
4d02: 80 91 8d 08 lds r24, 0x088D |
4d06: 90 91 8e 08 lds r25, 0x088E |
4d0a: 20 e0 ldi r18, 0x00 ; 0 |
4d0c: 32 e0 ldi r19, 0x02 ; 2 |
4d0e: 40 e0 ldi r20, 0x00 ; 0 |
4d10: 50 e0 ldi r21, 0x00 ; 0 |
4d12: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
4d16: b9 01 movw r22, r18 |
4d18: 37 ff sbrs r19, 7 |
4d1a: 03 c0 rjmp .+6 ; 0x4d22 <MotorRegler+0xbb8> |
4d1c: 70 95 com r23 |
4d1e: 61 95 neg r22 |
4d20: 7f 4f sbci r23, 0xFF ; 255 |
4d22: 60 17 cp r22, r16 |
4d24: 71 07 cpc r23, r17 |
4d26: 0c f4 brge .+2 ; 0x4d2a <MotorRegler+0xbc0> |
4d28: b8 01 movw r22, r16 |
4d2a: 69 31 cpi r22, 0x19 ; 25 |
4d2c: 71 05 cpc r23, r1 |
4d2e: a4 f4 brge .+40 ; 0x4d58 <MotorRegler+0xbee> |
4d30: 80 91 e1 08 lds r24, 0x08E1 |
4d34: 88 23 and r24, r24 |
4d36: 81 f0 breq .+32 ; 0x4d58 <MotorRegler+0xbee> |
4d38: 80 91 df 08 lds r24, 0x08DF |
4d3c: 90 91 e0 08 lds r25, 0x08E0 |
4d40: 89 2b or r24, r25 |
4d42: 51 f4 brne .+20 ; 0x4d58 <MotorRegler+0xbee> |
4d44: 80 91 b3 08 lds r24, 0x08B3 |
4d48: 90 91 b4 08 lds r25, 0x08B4 |
4d4c: 90 93 b6 08 sts 0x08B6, r25 |
4d50: 80 93 b5 08 sts 0x08B5, r24 |
4d54: 10 92 e1 08 sts 0x08E1, r1 |
4d58: 20 91 84 01 lds r18, 0x0184 |
4d5c: 33 27 eor r19, r19 |
4d5e: 62 9f mul r22, r18 |
4d60: c0 01 movw r24, r0 |
4d62: 63 9f mul r22, r19 |
4d64: 90 0d add r25, r0 |
4d66: 72 9f mul r23, r18 |
4d68: 90 0d add r25, r0 |
4d6a: 11 24 eor r1, r1 |
4d6c: 60 e4 ldi r22, 0x40 ; 64 |
4d6e: 70 e0 ldi r23, 0x00 ; 0 |
4d70: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
4d74: a9 01 movw r20, r18 |
4d76: 46 1b sub r20, r22 |
4d78: 57 0b sbc r21, r23 |
4d7a: 14 16 cp r1, r20 |
4d7c: 15 06 cpc r1, r21 |
4d7e: 0c f0 brlt .+2 ; 0x4d82 <MotorRegler+0xc18> |
4d80: 3f c0 rjmp .+126 ; 0x4e00 <MotorRegler+0xc96> |
4d82: 10 92 7a 00 sts 0x007A, r1 |
4d86: 20 91 df 08 lds r18, 0x08DF |
4d8a: 30 91 e0 08 lds r19, 0x08E0 |
4d8e: 21 15 cp r18, r1 |
4d90: 31 05 cpc r19, r1 |
4d92: 61 f5 brne .+88 ; 0x4dec <MotorRegler+0xc82> |
4d94: 00 91 a7 08 lds r16, 0x08A7 |
4d98: 10 91 a8 08 lds r17, 0x08A8 |
4d9c: 20 91 a9 08 lds r18, 0x08A9 |
4da0: 30 91 aa 08 lds r19, 0x08AA |
4da4: 80 91 b7 08 lds r24, 0x08B7 |
4da8: 90 91 b8 08 lds r25, 0x08B8 |
4dac: bc 01 movw r22, r24 |
4dae: 64 9f mul r22, r20 |
4db0: c0 01 movw r24, r0 |
4db2: 65 9f mul r22, r21 |
4db4: 90 0d add r25, r0 |
4db6: 74 9f mul r23, r20 |
4db8: 90 0d add r25, r0 |
4dba: 11 24 eor r1, r1 |
4dbc: 60 e2 ldi r22, 0x20 ; 32 |
4dbe: 70 e0 ldi r23, 0x00 ; 0 |
4dc0: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
4dc4: 88 27 eor r24, r24 |
4dc6: 77 fd sbrc r23, 7 |
4dc8: 80 95 com r24 |
4dca: 98 2f mov r25, r24 |
4dcc: 06 0f add r16, r22 |
4dce: 17 1f adc r17, r23 |
4dd0: 28 1f adc r18, r24 |
4dd2: 39 1f adc r19, r25 |
4dd4: 00 93 a7 08 sts 0x08A7, r16 |
4dd8: 10 93 a8 08 sts 0x08A8, r17 |
4ddc: 20 93 a9 08 sts 0x08A9, r18 |
4de0: 30 93 aa 08 sts 0x08AA, r19 |
4de4: 8f ee ldi r24, 0xEF ; 239 |
4de6: 80 93 7a 00 sts 0x007A, r24 |
4dea: 10 c0 rjmp .+32 ; 0x4e0c <MotorRegler+0xca2> |
4dec: 8f ee ldi r24, 0xEF ; 239 |
4dee: 80 93 7a 00 sts 0x007A, r24 |
4df2: 21 50 subi r18, 0x01 ; 1 |
4df4: 30 40 sbci r19, 0x00 ; 0 |
4df6: 30 93 e0 08 sts 0x08E0, r19 |
4dfa: 20 93 df 08 sts 0x08DF, r18 |
4dfe: 06 c0 rjmp .+12 ; 0x4e0c <MotorRegler+0xca2> |
4e00: 84 ef ldi r24, 0xF4 ; 244 |
4e02: 91 e0 ldi r25, 0x01 ; 1 |
4e04: 90 93 e0 08 sts 0x08E0, r25 |
4e08: 80 93 df 08 sts 0x08DF, r24 |
4e0c: 80 91 98 0c lds r24, 0x0C98 |
4e10: 85 ff sbrs r24, 5 |
4e12: 15 c0 rjmp .+42 ; 0x4e3e <MotorRegler+0xcd4> |
4e14: 80 91 db 08 lds r24, 0x08DB |
4e18: 99 27 eor r25, r25 |
4e1a: 90 93 70 09 sts 0x0970, r25 |
4e1e: 80 93 6f 09 sts 0x096F, r24 |
4e22: 80 91 dc 08 lds r24, 0x08DC |
4e26: 99 27 eor r25, r25 |
4e28: 90 93 63 09 sts 0x0963, r25 |
4e2c: 80 93 62 09 sts 0x0962, r24 |
4e30: 80 91 dd 08 lds r24, 0x08DD |
4e34: 80 93 be 08 sts 0x08BE, r24 |
4e38: 0e 94 b8 2b call 0x5770 ; 0x5770 <gps_main> |
4e3c: 08 c0 rjmp .+16 ; 0x4e4e <MotorRegler+0xce4> |
4e3e: 10 92 31 09 sts 0x0931, r1 |
4e42: 10 92 30 09 sts 0x0930, r1 |
4e46: 10 92 33 09 sts 0x0933, r1 |
4e4a: 10 92 32 09 sts 0x0932, r1 |
4e4e: 80 91 c2 0b lds r24, 0x0BC2 |
4e52: 8f 5f subi r24, 0xFF ; 255 |
4e54: 80 93 c2 0b sts 0x0BC2, r24 |
4e58: 80 91 e2 08 lds r24, 0x08E2 |
4e5c: 81 50 subi r24, 0x01 ; 1 |
4e5e: 80 93 e2 08 sts 0x08E2, r24 |
4e62: 8f 3f cpi r24, 0xFF ; 255 |
4e64: 09 f0 breq .+2 ; 0x4e68 <MotorRegler+0xcfe> |
4e66: 81 c0 rjmp .+258 ; 0x4f6a <MotorRegler+0xe00> |
4e68: 81 e3 ldi r24, 0x31 ; 49 |
4e6a: 80 93 e2 08 sts 0x08E2, r24 |
4e6e: 80 91 32 09 lds r24, 0x0932 |
4e72: 90 91 33 09 lds r25, 0x0933 |
4e76: 90 93 c4 0b sts 0x0BC4, r25 |
4e7a: 80 93 c3 0b sts 0x0BC3, r24 |
4e7e: 80 91 30 09 lds r24, 0x0930 |
4e82: 90 91 31 09 lds r25, 0x0931 |
4e86: 90 93 c6 0b sts 0x0BC6, r25 |
4e8a: 80 93 c5 0b sts 0x0BC5, r24 |
4e8e: 80 91 0c 09 lds r24, 0x090C |
4e92: 90 91 0d 09 lds r25, 0x090D |
4e96: 90 93 c8 0b sts 0x0BC8, r25 |
4e9a: 80 93 c7 0b sts 0x0BC7, r24 |
4e9e: 80 91 10 09 lds r24, 0x0910 |
4ea2: 90 91 11 09 lds r25, 0x0911 |
4ea6: 90 93 ca 0b sts 0x0BCA, r25 |
4eaa: 80 93 c9 0b sts 0x0BC9, r24 |
4eae: 80 91 24 09 lds r24, 0x0924 |
4eb2: 90 91 25 09 lds r25, 0x0925 |
4eb6: 90 93 cc 0b sts 0x0BCC, r25 |
4eba: 80 93 cb 0b sts 0x0BCB, r24 |
4ebe: 80 91 28 09 lds r24, 0x0928 |
4ec2: 90 91 29 09 lds r25, 0x0929 |
4ec6: 90 93 ce 0b sts 0x0BCE, r25 |
4eca: 80 93 cd 0b sts 0x0BCD, r24 |
4ece: 80 91 1c 09 lds r24, 0x091C |
4ed2: 90 91 1d 09 lds r25, 0x091D |
4ed6: 90 93 d0 0b sts 0x0BD0, r25 |
4eda: 80 93 cf 0b sts 0x0BCF, r24 |
4ede: 80 91 20 09 lds r24, 0x0920 |
4ee2: 90 91 21 09 lds r25, 0x0921 |
4ee6: 90 93 d2 0b sts 0x0BD2, r25 |
4eea: 80 93 d1 0b sts 0x0BD1, r24 |
4eee: 80 91 14 09 lds r24, 0x0914 |
4ef2: 90 91 15 09 lds r25, 0x0915 |
4ef6: 90 93 d4 0b sts 0x0BD4, r25 |
4efa: 80 93 d3 0b sts 0x0BD3, r24 |
4efe: 80 91 18 09 lds r24, 0x0918 |
4f02: 90 91 19 09 lds r25, 0x0919 |
4f06: 90 93 d6 0b sts 0x0BD6, r25 |
4f0a: 80 93 d5 0b sts 0x0BD5, r24 |
4f0e: 80 91 db 08 lds r24, 0x08DB |
4f12: 99 27 eor r25, r25 |
4f14: 90 93 d8 0b sts 0x0BD8, r25 |
4f18: 80 93 d7 0b sts 0x0BD7, r24 |
4f1c: 80 91 dc 08 lds r24, 0x08DC |
4f20: 99 27 eor r25, r25 |
4f22: 90 93 da 0b sts 0x0BDA, r25 |
4f26: 80 93 d9 0b sts 0x0BD9, r24 |
4f2a: 80 91 04 09 lds r24, 0x0904 |
4f2e: 90 91 05 09 lds r25, 0x0905 |
4f32: 90 93 dc 0b sts 0x0BDC, r25 |
4f36: 80 93 db 0b sts 0x0BDB, r24 |
4f3a: 80 91 08 09 lds r24, 0x0908 |
4f3e: 90 91 09 09 lds r25, 0x0909 |
4f42: 90 93 de 0b sts 0x0BDE, r25 |
4f46: 80 93 dd 0b sts 0x0BDD, r24 |
4f4a: 80 91 c9 08 lds r24, 0x08C9 |
4f4e: 90 91 ca 08 lds r25, 0x08CA |
4f52: 90 93 e0 0b sts 0x0BE0, r25 |
4f56: 80 93 df 0b sts 0x0BDF, r24 |
4f5a: 80 91 b3 08 lds r24, 0x08B3 |
4f5e: 90 91 b4 08 lds r25, 0x08B4 |
4f62: 90 93 e2 0b sts 0x0BE2, r25 |
4f66: 80 93 e1 0b sts 0x0BE1, r24 |
4f6a: 60 91 83 08 lds r22, 0x0883 |
4f6e: 70 91 84 08 lds r23, 0x0884 |
4f72: 80 91 85 08 lds r24, 0x0885 |
4f76: 90 91 86 08 lds r25, 0x0886 |
4f7a: 20 90 d1 0c lds r2, 0x0CD1 |
4f7e: 30 90 d2 0c lds r3, 0x0CD2 |
4f82: 40 90 d3 0c lds r4, 0x0CD3 |
4f86: 50 90 d4 0c lds r5, 0x0CD4 |
4f8a: e0 90 cc 0c lds r14, 0x0CCC |
4f8e: f0 90 cd 0c lds r15, 0x0CCD |
4f92: 60 90 da 0c lds r6, 0x0CDA |
4f96: 70 90 db 0c lds r7, 0x0CDB |
4f9a: 80 90 dc 0c lds r8, 0x0CDC |
4f9e: 90 90 dd 0c lds r9, 0x0CDD |
4fa2: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
4fa6: a2 01 movw r20, r4 |
4fa8: 91 01 movw r18, r2 |
4faa: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
4fae: 5b 01 movw r10, r22 |
4fb0: 6c 01 movw r12, r24 |
4fb2: 00 27 eor r16, r16 |
4fb4: f7 fc sbrc r15, 7 |
4fb6: 00 95 com r16 |
4fb8: 10 2f mov r17, r16 |
4fba: c8 01 movw r24, r16 |
4fbc: b7 01 movw r22, r14 |
4fbe: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
4fc2: a4 01 movw r20, r8 |
4fc4: 93 01 movw r18, r6 |
4fc6: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
4fca: 9b 01 movw r18, r22 |
4fcc: ac 01 movw r20, r24 |
4fce: c6 01 movw r24, r12 |
4fd0: b5 01 movw r22, r10 |
4fd2: 0e 94 11 3d call 0x7a22 ; 0x7a22 <__addsf3> |
4fd6: 0e 94 99 3d call 0x7b32 ; 0x7b32 <__fixsfsi> |
4fda: 70 93 cd 0c sts 0x0CCD, r23 |
4fde: 60 93 cc 0c sts 0x0CCC, r22 |
4fe2: 60 91 8b 08 lds r22, 0x088B |
4fe6: 70 91 8c 08 lds r23, 0x088C |
4fea: 80 91 8d 08 lds r24, 0x088D |
4fee: 90 91 8e 08 lds r25, 0x088E |
4ff2: e0 90 ca 0c lds r14, 0x0CCA |
4ff6: f0 90 cb 0c lds r15, 0x0CCB |
4ffa: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
4ffe: a2 01 movw r20, r4 |
5000: 91 01 movw r18, r2 |
5002: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
5006: 5b 01 movw r10, r22 |
5008: 6c 01 movw r12, r24 |
500a: 00 27 eor r16, r16 |
500c: f7 fc sbrc r15, 7 |
500e: 00 95 com r16 |
5010: 10 2f mov r17, r16 |
5012: c8 01 movw r24, r16 |
5014: b7 01 movw r22, r14 |
5016: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
501a: a4 01 movw r20, r8 |
501c: 93 01 movw r18, r6 |
501e: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
5022: 9b 01 movw r18, r22 |
5024: ac 01 movw r20, r24 |
5026: c6 01 movw r24, r12 |
5028: b5 01 movw r22, r10 |
502a: 0e 94 11 3d call 0x7a22 ; 0x7a22 <__addsf3> |
502e: 0e 94 99 3d call 0x7b32 ; 0x7b32 <__fixsfsi> |
5032: 70 93 cb 0c sts 0x0CCB, r23 |
5036: 60 93 ca 0c sts 0x0CCA, r22 |
503a: 60 91 d8 0c lds r22, 0x0CD8 |
503e: 70 91 d9 0c lds r23, 0x0CD9 |
5042: a0 90 93 08 lds r10, 0x0893 |
5046: b0 90 94 08 lds r11, 0x0894 |
504a: c0 90 95 08 lds r12, 0x0895 |
504e: d0 90 96 08 lds r13, 0x0896 |
5052: 88 27 eor r24, r24 |
5054: 77 fd sbrc r23, 7 |
5056: 80 95 com r24 |
5058: 98 2f mov r25, r24 |
505a: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
505e: 7b 01 movw r14, r22 |
5060: 8c 01 movw r16, r24 |
5062: 20 e0 ldi r18, 0x00 ; 0 |
5064: 30 e0 ldi r19, 0x00 ; 0 |
5066: 40 e0 ldi r20, 0x00 ; 0 |
5068: 5f e3 ldi r21, 0x3F ; 63 |
506a: c4 01 movw r24, r8 |
506c: b3 01 movw r22, r6 |
506e: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
5072: 9b 01 movw r18, r22 |
5074: ac 01 movw r20, r24 |
5076: c8 01 movw r24, r16 |
5078: b7 01 movw r22, r14 |
507a: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
507e: 7b 01 movw r14, r22 |
5080: 8c 01 movw r16, r24 |
5082: c6 01 movw r24, r12 |
5084: b5 01 movw r22, r10 |
5086: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
508a: a2 01 movw r20, r4 |
508c: 91 01 movw r18, r2 |
508e: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
5092: 9b 01 movw r18, r22 |
5094: ac 01 movw r20, r24 |
5096: c8 01 movw r24, r16 |
5098: b7 01 movw r22, r14 |
509a: 0e 94 11 3d call 0x7a22 ; 0x7a22 <__addsf3> |
509e: 0e 94 99 3d call 0x7b32 ; 0x7b32 <__fixsfsi> |
50a2: 70 93 d9 0c sts 0x0CD9, r23 |
50a6: 60 93 d8 0c sts 0x0CD8, r22 |
50aa: 80 91 cc 0c lds r24, 0x0CCC |
50ae: 90 91 cd 0c lds r25, 0x0CCD |
50b2: 81 50 subi r24, 0x01 ; 1 |
50b4: 98 40 sbci r25, 0x08 ; 8 |
50b6: 34 f0 brlt .+12 ; 0x50c4 <MotorRegler+0xf5a> |
50b8: 80 e0 ldi r24, 0x00 ; 0 |
50ba: 98 e0 ldi r25, 0x08 ; 8 |
50bc: 90 93 cd 0c sts 0x0CCD, r25 |
50c0: 80 93 cc 0c sts 0x0CCC, r24 |
50c4: 80 91 cc 0c lds r24, 0x0CCC |
50c8: 90 91 cd 0c lds r25, 0x0CCD |
50cc: 80 50 subi r24, 0x00 ; 0 |
50ce: 98 4f sbci r25, 0xF8 ; 248 |
50d0: 34 f4 brge .+12 ; 0x50de <MotorRegler+0xf74> |
50d2: 80 e0 ldi r24, 0x00 ; 0 |
50d4: 98 ef ldi r25, 0xF8 ; 248 |
50d6: 90 93 cd 0c sts 0x0CCD, r25 |
50da: 80 93 cc 0c sts 0x0CCC, r24 |
50de: 80 91 ca 0c lds r24, 0x0CCA |
50e2: 90 91 cb 0c lds r25, 0x0CCB |
50e6: 81 50 subi r24, 0x01 ; 1 |
50e8: 98 40 sbci r25, 0x08 ; 8 |
50ea: 34 f0 brlt .+12 ; 0x50f8 <MotorRegler+0xf8e> |
50ec: 80 e0 ldi r24, 0x00 ; 0 |
50ee: 98 e0 ldi r25, 0x08 ; 8 |
50f0: 90 93 cb 0c sts 0x0CCB, r25 |
50f4: 80 93 ca 0c sts 0x0CCA, r24 |
50f8: 80 91 ca 0c lds r24, 0x0CCA |
50fc: 90 91 cb 0c lds r25, 0x0CCB |
5100: 80 50 subi r24, 0x00 ; 0 |
5102: 98 4f sbci r25, 0xF8 ; 248 |
5104: 34 f4 brge .+12 ; 0x5112 <MotorRegler+0xfa8> |
5106: 80 e0 ldi r24, 0x00 ; 0 |
5108: 98 ef ldi r25, 0xF8 ; 248 |
510a: 90 93 cb 0c sts 0x0CCB, r25 |
510e: 80 93 ca 0c sts 0x0CCA, r24 |
5112: 80 91 d8 0c lds r24, 0x0CD8 |
5116: 90 91 d9 0c lds r25, 0x0CD9 |
511a: 81 50 subi r24, 0x01 ; 1 |
511c: 98 40 sbci r25, 0x08 ; 8 |
511e: 34 f0 brlt .+12 ; 0x512c <MotorRegler+0xfc2> |
5120: 80 e0 ldi r24, 0x00 ; 0 |
5122: 98 e0 ldi r25, 0x08 ; 8 |
5124: 90 93 d9 0c sts 0x0CD9, r25 |
5128: 80 93 d8 0c sts 0x0CD8, r24 |
512c: 80 91 d8 0c lds r24, 0x0CD8 |
5130: 90 91 d9 0c lds r25, 0x0CD9 |
5134: 80 50 subi r24, 0x00 ; 0 |
5136: 98 4f sbci r25, 0xF8 ; 248 |
5138: 34 f4 brge .+12 ; 0x5146 <MotorRegler+0xfdc> |
513a: 80 e0 ldi r24, 0x00 ; 0 |
513c: 98 ef ldi r25, 0xF8 ; 248 |
513e: 90 93 d9 0c sts 0x0CD9, r25 |
5142: 80 93 d8 0c sts 0x0CD8, r24 |
5146: 80 91 98 0c lds r24, 0x0C98 |
514a: 99 27 eor r25, r25 |
514c: 80 ff sbrs r24, 0 |
514e: cd c0 rjmp .+410 ; 0x52ea <MotorRegler+0x1180> |
5150: 20 91 81 01 lds r18, 0x0181 |
5154: 81 ff sbrs r24, 1 |
5156: 0e c0 rjmp .+28 ; 0x5174 <MotorRegler+0x100a> |
5158: 22 33 cpi r18, 0x32 ; 50 |
515a: b0 f4 brcc .+44 ; 0x5188 <MotorRegler+0x101e> |
515c: 80 91 d7 08 lds r24, 0x08D7 |
5160: 90 91 d8 08 lds r25, 0x08D8 |
5164: 88 97 sbiw r24, 0x28 ; 40 |
5166: 90 93 da 08 sts 0x08DA, r25 |
516a: 80 93 d9 08 sts 0x08D9, r24 |
516e: 10 92 ba 08 sts 0x08BA, r1 |
5172: 0d c0 rjmp .+26 ; 0x518e <MotorRegler+0x1024> |
5174: 80 91 9d 0c lds r24, 0x0C9D |
5178: 28 9f mul r18, r24 |
517a: c0 01 movw r24, r0 |
517c: 11 24 eor r1, r1 |
517e: 88 97 sbiw r24, 0x28 ; 40 |
5180: 90 93 da 08 sts 0x08DA, r25 |
5184: 80 93 d9 08 sts 0x08D9, r24 |
5188: 81 e0 ldi r24, 0x01 ; 1 |
518a: 80 93 ba 08 sts 0x08BA, r24 |
518e: 80 91 b9 08 lds r24, 0x08B9 |
5192: 88 23 and r24, r24 |
5194: 21 f0 breq .+8 ; 0x519e <MotorRegler+0x1034> |
5196: 10 92 da 08 sts 0x08DA, r1 |
519a: 10 92 d9 08 sts 0x08D9, r1 |
519e: 20 91 d7 08 lds r18, 0x08D7 |
51a2: 30 91 d8 08 lds r19, 0x08D8 |
51a6: 40 91 d9 08 lds r20, 0x08D9 |
51aa: 50 91 da 08 lds r21, 0x08DA |
51ae: 42 17 cp r20, r18 |
51b0: 53 07 cpc r21, r19 |
51b2: 0c f0 brlt .+2 ; 0x51b6 <MotorRegler+0x104c> |
51b4: 9a c0 rjmp .+308 ; 0x52ea <MotorRegler+0x1180> |
51b6: 80 91 ba 08 lds r24, 0x08BA |
51ba: 88 23 and r24, r24 |
51bc: 09 f4 brne .+2 ; 0x51c0 <MotorRegler+0x1056> |
51be: 95 c0 rjmp .+298 ; 0x52ea <MotorRegler+0x1180> |
51c0: 24 1b sub r18, r20 |
51c2: 35 0b sbc r19, r21 |
51c4: 80 91 82 01 lds r24, 0x0182 |
51c8: 99 27 eor r25, r25 |
51ca: bc 01 movw r22, r24 |
51cc: 26 9f mul r18, r22 |
51ce: c0 01 movw r24, r0 |
51d0: 27 9f mul r18, r23 |
51d2: 90 0d add r25, r0 |
51d4: 36 9f mul r19, r22 |
51d6: 90 0d add r25, r0 |
51d8: 11 24 eor r1, r1 |
51da: 60 e1 ldi r22, 0x10 ; 16 |
51dc: 70 e0 ldi r23, 0x00 ; 0 |
51de: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
51e2: 09 81 ldd r16, Y+1 ; 0x01 |
51e4: 1a 81 ldd r17, Y+2 ; 0x02 |
51e6: 06 1b sub r16, r22 |
51e8: 17 0b sbc r17, r23 |
51ea: 20 91 60 08 lds r18, 0x0860 |
51ee: 30 91 61 08 lds r19, 0x0861 |
51f2: 80 91 80 01 lds r24, 0x0180 |
51f6: 99 27 eor r25, r25 |
51f8: fc 01 movw r30, r24 |
51fa: 2e 9f mul r18, r30 |
51fc: c0 01 movw r24, r0 |
51fe: 2f 9f mul r18, r31 |
5200: 90 0d add r25, r0 |
5202: 3e 9f mul r19, r30 |
5204: 90 0d add r25, r0 |
5206: 11 24 eor r1, r1 |
5208: 68 e0 ldi r22, 0x08 ; 8 |
520a: 70 e0 ldi r23, 0x00 ; 0 |
520c: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
5210: 06 1b sub r16, r22 |
5212: 17 0b sbc r17, r23 |
5214: 60 91 af 08 lds r22, 0x08AF |
5218: 70 91 b0 08 lds r23, 0x08B0 |
521c: 80 91 b1 08 lds r24, 0x08B1 |
5220: 90 91 b2 08 lds r25, 0x08B2 |
5224: 20 e0 ldi r18, 0x00 ; 0 |
5226: 32 e0 ldi r19, 0x02 ; 2 |
5228: 40 e0 ldi r20, 0x00 ; 0 |
522a: 50 e0 ldi r21, 0x00 ; 0 |
522c: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
5230: ca 01 movw r24, r20 |
5232: b9 01 movw r22, r18 |
5234: 20 91 83 01 lds r18, 0x0183 |
5238: 33 27 eor r19, r19 |
523a: 44 27 eor r20, r20 |
523c: 55 27 eor r21, r21 |
523e: 0e 94 78 3e call 0x7cf0 ; 0x7cf0 <__mulsi3> |
5242: 20 e2 ldi r18, 0x20 ; 32 |
5244: 30 e0 ldi r19, 0x00 ; 0 |
5246: 40 e0 ldi r20, 0x00 ; 0 |
5248: 50 e0 ldi r21, 0x00 ; 0 |
524a: 0e 94 e0 3e call 0x7dc0 ; 0x7dc0 <__divmodsi4> |
524e: ff ef ldi r31, 0xFF ; 255 |
5250: 2e 3c cpi r18, 0xCE ; 206 |
5252: 3f 07 cpc r19, r31 |
5254: 14 f4 brge .+4 ; 0x525a <MotorRegler+0x10f0> |
5256: 2e ec ldi r18, 0xCE ; 206 |
5258: 3f ef ldi r19, 0xFF ; 255 |
525a: 80 91 e3 08 lds r24, 0x08E3 |
525e: 90 91 e4 08 lds r25, 0x08E4 |
5262: ac 01 movw r20, r24 |
5264: 74 e0 ldi r23, 0x04 ; 4 |
5266: 44 0f add r20, r20 |
5268: 55 1f adc r21, r21 |
526a: 7a 95 dec r23 |
526c: e1 f7 brne .-8 ; 0x5266 <MotorRegler+0x10fc> |
526e: 48 1b sub r20, r24 |
5270: 59 0b sbc r21, r25 |
5272: 23 33 cpi r18, 0x33 ; 51 |
5274: 31 05 cpc r19, r1 |
5276: 14 f0 brlt .+4 ; 0x527c <MotorRegler+0x1112> |
5278: 22 e3 ldi r18, 0x32 ; 50 |
527a: 30 e0 ldi r19, 0x00 ; 0 |
527c: 02 1b sub r16, r18 |
527e: 13 0b sbc r17, r19 |
5280: ca 01 movw r24, r20 |
5282: 80 0f add r24, r16 |
5284: 91 1f adc r25, r17 |
5286: 60 e1 ldi r22, 0x10 ; 16 |
5288: 70 e0 ldi r23, 0x00 ; 0 |
528a: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
528e: 70 93 e4 08 sts 0x08E4, r23 |
5292: 60 93 e3 08 sts 0x08E3, r22 |
5296: 80 91 99 0c lds r24, 0x0C99 |
529a: 99 27 eor r25, r25 |
529c: 68 17 cp r22, r24 |
529e: 79 07 cpc r23, r25 |
52a0: 8c f4 brge .+34 ; 0x52c4 <MotorRegler+0x115a> |
52a2: 29 81 ldd r18, Y+1 ; 0x01 |
52a4: 3a 81 ldd r19, Y+2 ; 0x02 |
52a6: 28 17 cp r18, r24 |
52a8: 39 07 cpc r19, r25 |
52aa: 2c f0 brlt .+10 ; 0x52b6 <MotorRegler+0x114c> |
52ac: 90 93 e4 08 sts 0x08E4, r25 |
52b0: 80 93 e3 08 sts 0x08E3, r24 |
52b4: 07 c0 rjmp .+14 ; 0x52c4 <MotorRegler+0x115a> |
52b6: 49 81 ldd r20, Y+1 ; 0x01 |
52b8: 5a 81 ldd r21, Y+2 ; 0x02 |
52ba: 50 93 e4 08 sts 0x08E4, r21 |
52be: 40 93 e3 08 sts 0x08E3, r20 |
52c2: 0d c0 rjmp .+26 ; 0x52de <MotorRegler+0x1174> |
52c4: 80 91 e3 08 lds r24, 0x08E3 |
52c8: 90 91 e4 08 lds r25, 0x08E4 |
52cc: 69 81 ldd r22, Y+1 ; 0x01 |
52ce: 7a 81 ldd r23, Y+2 ; 0x02 |
52d0: 68 17 cp r22, r24 |
52d2: 79 07 cpc r23, r25 |
52d4: 24 f4 brge .+8 ; 0x52de <MotorRegler+0x1174> |
52d6: 70 93 e4 08 sts 0x08E4, r23 |
52da: 60 93 e3 08 sts 0x08E3, r22 |
52de: 80 91 e3 08 lds r24, 0x08E3 |
52e2: 90 91 e4 08 lds r25, 0x08E4 |
52e6: 9a 83 std Y+2, r25 ; 0x02 |
52e8: 89 83 std Y+1, r24 ; 0x01 |
52ea: c0 90 d8 0c lds r12, 0x0CD8 |
52ee: d0 90 d9 0c lds r13, 0x0CD9 |
52f2: 80 91 f8 08 lds r24, 0x08F8 |
52f6: 90 91 f9 08 lds r25, 0x08F9 |
52fa: c8 1a sub r12, r24 |
52fc: d9 0a sbc r13, r25 |
52fe: 95 e6 ldi r25, 0x65 ; 101 |
5300: c9 16 cp r12, r25 |
5302: d1 04 cpc r13, r1 |
5304: 24 f0 brlt .+8 ; 0x530e <MotorRegler+0x11a4> |
5306: 64 e6 ldi r22, 0x64 ; 100 |
5308: c6 2e mov r12, r22 |
530a: d1 2c mov r13, r1 |
530c: 09 c0 rjmp .+18 ; 0x5320 <MotorRegler+0x11b6> |
530e: ec e9 ldi r30, 0x9C ; 156 |
5310: ce 16 cp r12, r30 |
5312: ef ef ldi r30, 0xFF ; 255 |
5314: de 06 cpc r13, r30 |
5316: 24 f4 brge .+8 ; 0x5320 <MotorRegler+0x11b6> |
5318: 5c e9 ldi r21, 0x9C ; 156 |
531a: c5 2e mov r12, r21 |
531c: 5f ef ldi r21, 0xFF ; 255 |
531e: d5 2e mov r13, r21 |
5320: 40 90 78 01 lds r4, 0x0178 |
5324: 50 90 79 01 lds r5, 0x0179 |
5328: 60 90 7a 01 lds r6, 0x017A |
532c: 70 90 7b 01 lds r7, 0x017B |
5330: 60 91 cc 0c lds r22, 0x0CCC |
5334: 70 91 cd 0c lds r23, 0x0CCD |
5338: 20 91 d0 08 lds r18, 0x08D0 |
533c: 30 91 d1 08 lds r19, 0x08D1 |
5340: 40 91 30 09 lds r20, 0x0930 |
5344: 50 91 31 09 lds r21, 0x0931 |
5348: 24 1b sub r18, r20 |
534a: 35 0b sbc r19, r21 |
534c: 62 1b sub r22, r18 |
534e: 73 0b sbc r23, r19 |
5350: 88 27 eor r24, r24 |
5352: 77 fd sbrc r23, 7 |
5354: 80 95 com r24 |
5356: 98 2f mov r25, r24 |
5358: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
535c: 9b 01 movw r18, r22 |
535e: ac 01 movw r20, r24 |
5360: c3 01 movw r24, r6 |
5362: b2 01 movw r22, r4 |
5364: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
5368: 0e 94 99 3d call 0x7b32 ; 0x7b32 <__fixsfsi> |
536c: 70 93 65 09 sts 0x0965, r23 |
5370: 60 93 64 09 sts 0x0964, r22 |
5374: 80 91 64 09 lds r24, 0x0964 |
5378: 90 91 65 09 lds r25, 0x0965 |
537c: 8c 01 movw r16, r24 |
537e: 22 27 eor r18, r18 |
5380: 17 fd sbrc r17, 7 |
5382: 20 95 com r18 |
5384: 32 2f mov r19, r18 |
5386: 80 91 00 09 lds r24, 0x0900 |
538a: 90 91 01 09 lds r25, 0x0901 |
538e: a0 91 02 09 lds r26, 0x0902 |
5392: b0 91 03 09 lds r27, 0x0903 |
5396: 08 0f add r16, r24 |
5398: 19 1f adc r17, r25 |
539a: 2a 1f adc r18, r26 |
539c: 3b 1f adc r19, r27 |
539e: 00 93 00 09 sts 0x0900, r16 |
53a2: 10 93 01 09 sts 0x0901, r17 |
53a6: 20 93 02 09 sts 0x0902, r18 |
53aa: 30 93 03 09 sts 0x0903, r19 |
53ae: 10 16 cp r1, r16 |
53b0: 11 06 cpc r1, r17 |
53b2: 12 06 cpc r1, r18 |
53b4: 13 06 cpc r1, r19 |
53b6: ac f4 brge .+42 ; 0x53e2 <MotorRegler+0x1278> |
53b8: c8 01 movw r24, r16 |
53ba: 17 ff sbrs r17, 7 |
53bc: 03 c0 rjmp .+6 ; 0x53c4 <MotorRegler+0x125a> |
53be: 90 95 com r25 |
53c0: 81 95 neg r24 |
53c2: 9f 4f sbci r25, 0xFF ; 255 |
53c4: 60 e0 ldi r22, 0x00 ; 0 |
53c6: 71 e0 ldi r23, 0x01 ; 1 |
53c8: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
53cc: 6f 5f subi r22, 0xFF ; 255 |
53ce: 7f 4f sbci r23, 0xFF ; 255 |
53d0: 88 27 eor r24, r24 |
53d2: 77 fd sbrc r23, 7 |
53d4: 80 95 com r24 |
53d6: 98 2f mov r25, r24 |
53d8: 06 1b sub r16, r22 |
53da: 17 0b sbc r17, r23 |
53dc: 28 0b sbc r18, r24 |
53de: 39 0b sbc r19, r25 |
53e0: 14 c0 rjmp .+40 ; 0x540a <MotorRegler+0x12a0> |
53e2: c8 01 movw r24, r16 |
53e4: 17 ff sbrs r17, 7 |
53e6: 03 c0 rjmp .+6 ; 0x53ee <MotorRegler+0x1284> |
53e8: 90 95 com r25 |
53ea: 81 95 neg r24 |
53ec: 9f 4f sbci r25, 0xFF ; 255 |
53ee: 60 e0 ldi r22, 0x00 ; 0 |
53f0: 71 e0 ldi r23, 0x01 ; 1 |
53f2: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
53f6: 6f 5f subi r22, 0xFF ; 255 |
53f8: 7f 4f sbci r23, 0xFF ; 255 |
53fa: 88 27 eor r24, r24 |
53fc: 77 fd sbrc r23, 7 |
53fe: 80 95 com r24 |
5400: 98 2f mov r25, r24 |
5402: 06 0f add r16, r22 |
5404: 17 1f adc r17, r23 |
5406: 28 1f adc r18, r24 |
5408: 39 1f adc r19, r25 |
540a: 00 93 00 09 sts 0x0900, r16 |
540e: 10 93 01 09 sts 0x0901, r17 |
5412: 20 93 02 09 sts 0x0902, r18 |
5416: 30 93 03 09 sts 0x0903, r19 |
541a: 80 91 00 09 lds r24, 0x0900 |
541e: 90 91 01 09 lds r25, 0x0901 |
5422: a0 91 02 09 lds r26, 0x0902 |
5426: b0 91 03 09 lds r27, 0x0903 |
542a: 81 38 cpi r24, 0x81 ; 129 |
542c: fe e3 ldi r31, 0x3E ; 62 |
542e: 9f 07 cpc r25, r31 |
5430: f0 e0 ldi r31, 0x00 ; 0 |
5432: af 07 cpc r26, r31 |
5434: f0 e0 ldi r31, 0x00 ; 0 |
5436: bf 07 cpc r27, r31 |
5438: 2c f0 brlt .+10 ; 0x5444 <MotorRegler+0x12da> |
543a: 80 e8 ldi r24, 0x80 ; 128 |
543c: 9e e3 ldi r25, 0x3E ; 62 |
543e: a0 e0 ldi r26, 0x00 ; 0 |
5440: b0 e0 ldi r27, 0x00 ; 0 |
5442: 09 c0 rjmp .+18 ; 0x5456 <MotorRegler+0x12ec> |
5444: 80 58 subi r24, 0x80 ; 128 |
5446: 91 4c sbci r25, 0xC1 ; 193 |
5448: af 4f sbci r26, 0xFF ; 255 |
544a: bf 4f sbci r27, 0xFF ; 255 |
544c: 64 f4 brge .+24 ; 0x5466 <MotorRegler+0x12fc> |
544e: 80 e8 ldi r24, 0x80 ; 128 |
5450: 91 ec ldi r25, 0xC1 ; 193 |
5452: af ef ldi r26, 0xFF ; 255 |
5454: bf ef ldi r27, 0xFF ; 255 |
5456: 80 93 00 09 sts 0x0900, r24 |
545a: 90 93 01 09 sts 0x0901, r25 |
545e: a0 93 02 09 sts 0x0902, r26 |
5462: b0 93 03 09 sts 0x0903, r27 |
5466: 60 91 64 09 lds r22, 0x0964 |
546a: 70 91 65 09 lds r23, 0x0965 |
546e: 80 90 7c 01 lds r8, 0x017C |
5472: 90 90 7d 01 lds r9, 0x017D |
5476: a0 90 7e 01 lds r10, 0x017E |
547a: b0 90 7f 01 lds r11, 0x017F |
547e: 88 27 eor r24, r24 |
5480: 77 fd sbrc r23, 7 |
5482: 80 95 com r24 |
5484: 98 2f mov r25, r24 |
5486: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
548a: 7b 01 movw r14, r22 |
548c: 8c 01 movw r16, r24 |
548e: 60 91 00 09 lds r22, 0x0900 |
5492: 70 91 01 09 lds r23, 0x0901 |
5496: 80 91 02 09 lds r24, 0x0902 |
549a: 90 91 03 09 lds r25, 0x0903 |
549e: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
54a2: 9b 01 movw r18, r22 |
54a4: ac 01 movw r20, r24 |
54a6: c5 01 movw r24, r10 |
54a8: b4 01 movw r22, r8 |
54aa: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
54ae: 9b 01 movw r18, r22 |
54b0: ac 01 movw r20, r24 |
54b2: c8 01 movw r24, r16 |
54b4: b7 01 movw r22, r14 |
54b6: 0e 94 11 3d call 0x7a22 ; 0x7a22 <__addsf3> |
54ba: 0e 94 99 3d call 0x7b32 ; 0x7b32 <__fixsfsi> |
54be: 96 01 movw r18, r12 |
54c0: 26 0f add r18, r22 |
54c2: 37 1f adc r19, r23 |
54c4: 49 81 ldd r20, Y+1 ; 0x01 |
54c6: 5a 81 ldd r21, Y+2 ; 0x02 |
54c8: 24 0f add r18, r20 |
54ca: 35 1f adc r19, r21 |
54cc: 22 24 eor r2, r2 |
54ce: 4a 30 cpi r20, 0x0A ; 10 |
54d0: 51 05 cpc r21, r1 |
54d2: 14 f4 brge .+4 ; 0x54d8 <MotorRegler+0x136e> |
54d4: 41 e0 ldi r20, 0x01 ; 1 |
54d6: 24 2e mov r2, r20 |
54d8: 37 fd sbrc r19, 7 |
54da: 02 c0 rjmp .+4 ; 0x54e0 <MotorRegler+0x1376> |
54dc: 22 20 and r2, r2 |
54de: 19 f0 breq .+6 ; 0x54e6 <MotorRegler+0x137c> |
54e0: 40 e0 ldi r20, 0x00 ; 0 |
54e2: 50 e0 ldi r21, 0x00 ; 0 |
54e4: 08 c0 rjmp .+16 ; 0x54f6 <MotorRegler+0x138c> |
54e6: 80 91 d7 0c lds r24, 0x0CD7 |
54ea: 48 2f mov r20, r24 |
54ec: 55 27 eor r21, r21 |
54ee: 24 17 cp r18, r20 |
54f0: 35 07 cpc r19, r21 |
54f2: 0c f4 brge .+2 ; 0x54f6 <MotorRegler+0x138c> |
54f4: a9 01 movw r20, r18 |
54f6: 80 91 ce 0c lds r24, 0x0CCE |
54fa: e8 2f mov r30, r24 |
54fc: ff 27 eor r31, r31 |
54fe: fc 83 std Y+4, r31 ; 0x04 |
5500: eb 83 std Y+3, r30 ; 0x03 |
5502: 9f 01 movw r18, r30 |
5504: e4 17 cp r30, r20 |
5506: f5 07 cpc r31, r21 |
5508: 0c f4 brge .+2 ; 0x550c <MotorRegler+0x13a2> |
550a: 9a 01 movw r18, r20 |
550c: 20 93 60 09 sts 0x0960, r18 |
5510: 29 81 ldd r18, Y+1 ; 0x01 |
5512: 3a 81 ldd r19, Y+2 ; 0x02 |
5514: 26 1b sub r18, r22 |
5516: 37 0b sbc r19, r23 |
5518: b9 01 movw r22, r18 |
551a: 6c 0d add r22, r12 |
551c: 7d 1d adc r23, r13 |
551e: 77 fd sbrc r23, 7 |
5520: 02 c0 rjmp .+4 ; 0x5526 <MotorRegler+0x13bc> |
5522: 22 20 and r2, r2 |
5524: 19 f0 breq .+6 ; 0x552c <MotorRegler+0x13c2> |
5526: 80 e0 ldi r24, 0x00 ; 0 |
5528: 90 e0 ldi r25, 0x00 ; 0 |
552a: 07 c0 rjmp .+14 ; 0x553a <MotorRegler+0x13d0> |
552c: 80 91 d7 0c lds r24, 0x0CD7 |
5530: 99 27 eor r25, r25 |
5532: 68 17 cp r22, r24 |
5534: 79 07 cpc r23, r25 |
5536: 0c f4 brge .+2 ; 0x553a <MotorRegler+0x13d0> |
5538: cb 01 movw r24, r22 |
553a: 2b 81 ldd r18, Y+3 ; 0x03 |
553c: 3c 81 ldd r19, Y+4 ; 0x04 |
553e: 28 17 cp r18, r24 |
5540: 39 07 cpc r19, r25 |
5542: 0c f4 brge .+2 ; 0x5546 <MotorRegler+0x13dc> |
5544: 9c 01 movw r18, r24 |
5546: 20 93 61 09 sts 0x0961, r18 |
554a: 60 91 ca 0c lds r22, 0x0CCA |
554e: 70 91 cb 0c lds r23, 0x0CCB |
5552: 20 91 d2 08 lds r18, 0x08D2 |
5556: 30 91 d3 08 lds r19, 0x08D3 |
555a: 40 91 32 09 lds r20, 0x0932 |
555e: 50 91 33 09 lds r21, 0x0933 |
5562: 24 1b sub r18, r20 |
5564: 35 0b sbc r19, r21 |
5566: 62 1b sub r22, r18 |
5568: 73 0b sbc r23, r19 |
556a: 88 27 eor r24, r24 |
556c: 77 fd sbrc r23, 7 |
556e: 80 95 com r24 |
5570: 98 2f mov r25, r24 |
5572: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
5576: 9b 01 movw r18, r22 |
5578: ac 01 movw r20, r24 |
557a: c3 01 movw r24, r6 |
557c: b2 01 movw r22, r4 |
557e: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
5582: 0e 94 99 3d call 0x7b32 ; 0x7b32 <__fixsfsi> |
5586: 70 93 5f 09 sts 0x095F, r23 |
558a: 60 93 5e 09 sts 0x095E, r22 |
558e: 80 91 5e 09 lds r24, 0x095E |
5592: 90 91 5f 09 lds r25, 0x095F |
5596: 8c 01 movw r16, r24 |
5598: 22 27 eor r18, r18 |
559a: 17 fd sbrc r17, 7 |
559c: 20 95 com r18 |
559e: 32 2f mov r19, r18 |
55a0: 80 91 fc 08 lds r24, 0x08FC |
55a4: 90 91 fd 08 lds r25, 0x08FD |
55a8: a0 91 fe 08 lds r26, 0x08FE |
55ac: b0 91 ff 08 lds r27, 0x08FF |
55b0: 08 0f add r16, r24 |
55b2: 19 1f adc r17, r25 |
55b4: 2a 1f adc r18, r26 |
55b6: 3b 1f adc r19, r27 |
55b8: 00 93 fc 08 sts 0x08FC, r16 |
55bc: 10 93 fd 08 sts 0x08FD, r17 |
55c0: 20 93 fe 08 sts 0x08FE, r18 |
55c4: 30 93 ff 08 sts 0x08FF, r19 |
55c8: 10 16 cp r1, r16 |
55ca: 11 06 cpc r1, r17 |
55cc: 12 06 cpc r1, r18 |
55ce: 13 06 cpc r1, r19 |
55d0: ac f4 brge .+42 ; 0x55fc <MotorRegler+0x1492> |
55d2: c8 01 movw r24, r16 |
55d4: 17 ff sbrs r17, 7 |
55d6: 03 c0 rjmp .+6 ; 0x55de <MotorRegler+0x1474> |
55d8: 90 95 com r25 |
55da: 81 95 neg r24 |
55dc: 9f 4f sbci r25, 0xFF ; 255 |
55de: 60 e0 ldi r22, 0x00 ; 0 |
55e0: 71 e0 ldi r23, 0x01 ; 1 |
55e2: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
55e6: 6f 5f subi r22, 0xFF ; 255 |
55e8: 7f 4f sbci r23, 0xFF ; 255 |
55ea: 88 27 eor r24, r24 |
55ec: 77 fd sbrc r23, 7 |
55ee: 80 95 com r24 |
55f0: 98 2f mov r25, r24 |
55f2: 06 1b sub r16, r22 |
55f4: 17 0b sbc r17, r23 |
55f6: 28 0b sbc r18, r24 |
55f8: 39 0b sbc r19, r25 |
55fa: 14 c0 rjmp .+40 ; 0x5624 <MotorRegler+0x14ba> |
55fc: c8 01 movw r24, r16 |
55fe: 17 ff sbrs r17, 7 |
5600: 03 c0 rjmp .+6 ; 0x5608 <MotorRegler+0x149e> |
5602: 90 95 com r25 |
5604: 81 95 neg r24 |
5606: 9f 4f sbci r25, 0xFF ; 255 |
5608: 60 e0 ldi r22, 0x00 ; 0 |
560a: 71 e0 ldi r23, 0x01 ; 1 |
560c: 0e 94 ab 3e call 0x7d56 ; 0x7d56 <__divmodhi4> |
5610: 6f 5f subi r22, 0xFF ; 255 |
5612: 7f 4f sbci r23, 0xFF ; 255 |
5614: 88 27 eor r24, r24 |
5616: 77 fd sbrc r23, 7 |
5618: 80 95 com r24 |
561a: 98 2f mov r25, r24 |
561c: 06 0f add r16, r22 |
561e: 17 1f adc r17, r23 |
5620: 28 1f adc r18, r24 |
5622: 39 1f adc r19, r25 |
5624: 00 93 fc 08 sts 0x08FC, r16 |
5628: 10 93 fd 08 sts 0x08FD, r17 |
562c: 20 93 fe 08 sts 0x08FE, r18 |
5630: 30 93 ff 08 sts 0x08FF, r19 |
5634: 80 91 fc 08 lds r24, 0x08FC |
5638: 90 91 fd 08 lds r25, 0x08FD |
563c: a0 91 fe 08 lds r26, 0x08FE |
5640: b0 91 ff 08 lds r27, 0x08FF |
5644: 81 38 cpi r24, 0x81 ; 129 |
5646: 3e e3 ldi r19, 0x3E ; 62 |
5648: 93 07 cpc r25, r19 |
564a: 30 e0 ldi r19, 0x00 ; 0 |
564c: a3 07 cpc r26, r19 |
564e: 30 e0 ldi r19, 0x00 ; 0 |
5650: b3 07 cpc r27, r19 |
5652: 2c f0 brlt .+10 ; 0x565e <MotorRegler+0x14f4> |
5654: 80 e8 ldi r24, 0x80 ; 128 |
5656: 9e e3 ldi r25, 0x3E ; 62 |
5658: a0 e0 ldi r26, 0x00 ; 0 |
565a: b0 e0 ldi r27, 0x00 ; 0 |
565c: 09 c0 rjmp .+18 ; 0x5670 <MotorRegler+0x1506> |
565e: 80 58 subi r24, 0x80 ; 128 |
5660: 91 4c sbci r25, 0xC1 ; 193 |
5662: af 4f sbci r26, 0xFF ; 255 |
5664: bf 4f sbci r27, 0xFF ; 255 |
5666: 64 f4 brge .+24 ; 0x5680 <MotorRegler+0x1516> |
5668: 80 e8 ldi r24, 0x80 ; 128 |
566a: 91 ec ldi r25, 0xC1 ; 193 |
566c: af ef ldi r26, 0xFF ; 255 |
566e: bf ef ldi r27, 0xFF ; 255 |
5670: 80 93 fc 08 sts 0x08FC, r24 |
5674: 90 93 fd 08 sts 0x08FD, r25 |
5678: a0 93 fe 08 sts 0x08FE, r26 |
567c: b0 93 ff 08 sts 0x08FF, r27 |
5680: 60 91 5e 09 lds r22, 0x095E |
5684: 70 91 5f 09 lds r23, 0x095F |
5688: 88 27 eor r24, r24 |
568a: 77 fd sbrc r23, 7 |
568c: 80 95 com r24 |
568e: 98 2f mov r25, r24 |
5690: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
5694: 7b 01 movw r14, r22 |
5696: 8c 01 movw r16, r24 |
5698: 60 91 fc 08 lds r22, 0x08FC |
569c: 70 91 fd 08 lds r23, 0x08FD |
56a0: 80 91 fe 08 lds r24, 0x08FE |
56a4: 90 91 ff 08 lds r25, 0x08FF |
56a8: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
56ac: 9b 01 movw r18, r22 |
56ae: ac 01 movw r20, r24 |
56b0: c5 01 movw r24, r10 |
56b2: b4 01 movw r22, r8 |
56b4: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
56b8: 9b 01 movw r18, r22 |
56ba: ac 01 movw r20, r24 |
56bc: c8 01 movw r24, r16 |
56be: b7 01 movw r22, r14 |
56c0: 0e 94 11 3d call 0x7a22 ; 0x7a22 <__addsf3> |
56c4: 0e 94 99 3d call 0x7b32 ; 0x7b32 <__fixsfsi> |
56c8: 29 81 ldd r18, Y+1 ; 0x01 |
56ca: 3a 81 ldd r19, Y+2 ; 0x02 |
56cc: 26 0f add r18, r22 |
56ce: 37 1f adc r19, r23 |
56d0: 2c 19 sub r18, r12 |
56d2: 3d 09 sbc r19, r13 |
56d4: 37 fd sbrc r19, 7 |
56d6: 02 c0 rjmp .+4 ; 0x56dc <MotorRegler+0x1572> |
56d8: 22 20 and r2, r2 |
56da: 19 f0 breq .+6 ; 0x56e2 <MotorRegler+0x1578> |
56dc: 40 e0 ldi r20, 0x00 ; 0 |
56de: 50 e0 ldi r21, 0x00 ; 0 |
56e0: 08 c0 rjmp .+16 ; 0x56f2 <MotorRegler+0x1588> |
56e2: 80 91 d7 0c lds r24, 0x0CD7 |
56e6: 48 2f mov r20, r24 |
56e8: 55 27 eor r21, r21 |
56ea: 24 17 cp r18, r20 |
56ec: 35 07 cpc r19, r21 |
56ee: 0c f4 brge .+2 ; 0x56f2 <MotorRegler+0x1588> |
56f0: a9 01 movw r20, r18 |
56f2: 2b 81 ldd r18, Y+3 ; 0x03 |
56f4: 3c 81 ldd r19, Y+4 ; 0x04 |
56f6: 24 17 cp r18, r20 |
56f8: 35 07 cpc r19, r21 |
56fa: 0c f4 brge .+2 ; 0x56fe <MotorRegler+0x1594> |
56fc: 9a 01 movw r18, r20 |
56fe: 20 93 6c 09 sts 0x096C, r18 |
5702: 89 81 ldd r24, Y+1 ; 0x01 |
5704: 9a 81 ldd r25, Y+2 ; 0x02 |
5706: 86 1b sub r24, r22 |
5708: 97 0b sbc r25, r23 |
570a: bc 01 movw r22, r24 |
570c: 6c 19 sub r22, r12 |
570e: 7d 09 sbc r23, r13 |
5710: 77 fd sbrc r23, 7 |
5712: 02 c0 rjmp .+4 ; 0x5718 <MotorRegler+0x15ae> |
5714: 22 20 and r2, r2 |
5716: 19 f0 breq .+6 ; 0x571e <MotorRegler+0x15b4> |
5718: 20 e0 ldi r18, 0x00 ; 0 |
571a: 30 e0 ldi r19, 0x00 ; 0 |
571c: 08 c0 rjmp .+16 ; 0x572e <MotorRegler+0x15c4> |
571e: 80 91 d7 0c lds r24, 0x0CD7 |
5722: 28 2f mov r18, r24 |
5724: 33 27 eor r19, r19 |
5726: 62 17 cp r22, r18 |
5728: 73 07 cpc r23, r19 |
572a: 0c f4 brge .+2 ; 0x572e <MotorRegler+0x15c4> |
572c: 9b 01 movw r18, r22 |
572e: 8b 81 ldd r24, Y+3 ; 0x03 |
5730: 9c 81 ldd r25, Y+4 ; 0x04 |
5732: 82 17 cp r24, r18 |
5734: 93 07 cpc r25, r19 |
5736: 0c f4 brge .+2 ; 0x573a <MotorRegler+0x15d0> |
5738: c9 01 movw r24, r18 |
573a: 80 93 66 09 sts 0x0966, r24 |
573e: 24 96 adiw r28, 0x04 ; 4 |
5740: 0f b6 in r0, 0x3f ; 63 |
5742: f8 94 cli |
5744: de bf out 0x3e, r29 ; 62 |
5746: 0f be out 0x3f, r0 ; 63 |
5748: cd bf out 0x3d, r28 ; 61 |
574a: df 91 pop r29 |
574c: cf 91 pop r28 |
574e: 1f 91 pop r17 |
5750: 0f 91 pop r16 |
5752: ff 90 pop r15 |
5754: ef 90 pop r14 |
5756: df 90 pop r13 |
5758: cf 90 pop r12 |
575a: bf 90 pop r11 |
575c: af 90 pop r10 |
575e: 9f 90 pop r9 |
5760: 8f 90 pop r8 |
5762: 7f 90 pop r7 |
5764: 6f 90 pop r6 |
5766: 5f 90 pop r5 |
5768: 4f 90 pop r4 |
576a: 3f 90 pop r3 |
576c: 2f 90 pop r2 |
576e: 08 95 ret |
00005770 <gps_main>: |
5770: 2f 92 push r2 |
5772: 3f 92 push r3 |
5774: 4f 92 push r4 |
5776: 5f 92 push r5 |
5778: 6f 92 push r6 |
577a: 7f 92 push r7 |
577c: 8f 92 push r8 |
577e: 9f 92 push r9 |
5780: af 92 push r10 |
5782: bf 92 push r11 |
5784: cf 92 push r12 |
5786: df 92 push r13 |
5788: ef 92 push r14 |
578a: ff 92 push r15 |
578c: 0f 93 push r16 |
578e: 1f 93 push r17 |
5790: cf 93 push r28 |
5792: df 93 push r29 |
5794: cd b7 in r28, 0x3d ; 61 |
5796: de b7 in r29, 0x3e ; 62 |
5798: 6f 97 sbiw r28, 0x1f ; 31 |
579a: 0f b6 in r0, 0x3f ; 63 |
579c: f8 94 cli |
579e: de bf out 0x3e, r29 ; 62 |
57a0: 0f be out 0x3f, r0 ; 63 |
57a2: cd bf out 0x3d, r28 ; 61 |
57a4: 20 91 10 0c lds r18, 0x0C10 |
57a8: 2d 87 std Y+13, r18 ; 0x0d |
57aa: 23 30 cpi r18, 0x03 ; 3 |
57ac: 09 f0 breq .+2 ; 0x57b0 <gps_main+0x40> |
57ae: 58 c2 rjmp .+1200 ; 0x5c60 <gps_main+0x4f0> |
57b0: e0 91 3f 09 lds r30, 0x093F |
57b4: ff 27 eor r31, r31 |
57b6: ee 0f add r30, r30 |
57b8: ff 1f adc r31, r31 |
57ba: ee 0f add r30, r30 |
57bc: ff 1f adc r31, r31 |
57be: e0 52 subi r30, 0x20 ; 32 |
57c0: f3 4f sbci r31, 0xF3 ; 243 |
57c2: 80 91 fb 0b lds r24, 0x0BFB |
57c6: 90 91 fc 0b lds r25, 0x0BFC |
57ca: a0 91 fd 0b lds r26, 0x0BFD |
57ce: b0 91 fe 0b lds r27, 0x0BFE |
57d2: 80 83 st Z, r24 |
57d4: 91 83 std Z+1, r25 ; 0x01 |
57d6: a2 83 std Z+2, r26 ; 0x02 |
57d8: b3 83 std Z+3, r27 ; 0x03 |
57da: e0 91 3f 09 lds r30, 0x093F |
57de: ff 27 eor r31, r31 |
57e0: ee 0f add r30, r30 |
57e2: ff 1f adc r31, r31 |
57e4: ee 0f add r30, r30 |
57e6: ff 1f adc r31, r31 |
57e8: e0 50 subi r30, 0x00 ; 0 |
57ea: f3 4f sbci r31, 0xF3 ; 243 |
57ec: 80 91 ff 0b lds r24, 0x0BFF |
57f0: 90 91 00 0c lds r25, 0x0C00 |
57f4: a0 91 01 0c lds r26, 0x0C01 |
57f8: b0 91 02 0c lds r27, 0x0C02 |
57fc: 80 83 st Z, r24 |
57fe: 91 83 std Z+1, r25 ; 0x01 |
5800: a2 83 std Z+2, r26 ; 0x02 |
5802: b3 83 std Z+3, r27 ; 0x03 |
5804: 80 91 3f 09 lds r24, 0x093F |
5808: 8f 5f subi r24, 0xFF ; 255 |
580a: 80 93 3f 09 sts 0x093F, r24 |
580e: 80 91 3f 09 lds r24, 0x093F |
5812: 88 30 cpi r24, 0x08 ; 8 |
5814: 11 f4 brne .+4 ; 0x581a <gps_main+0xaa> |
5816: 10 92 3f 09 sts 0x093F, r1 |
581a: 80 91 58 09 lds r24, 0x0958 |
581e: 90 91 59 09 lds r25, 0x0959 |
5822: 08 97 sbiw r24, 0x08 ; 8 |
5824: 4c f4 brge .+18 ; 0x5838 <gps_main+0xc8> |
5826: 80 91 58 09 lds r24, 0x0958 |
582a: 90 91 59 09 lds r25, 0x0959 |
582e: 01 96 adiw r24, 0x01 ; 1 |
5830: 90 93 59 09 sts 0x0959, r25 |
5834: 80 93 58 09 sts 0x0958, r24 |
5838: 10 92 48 09 sts 0x0948, r1 |
583c: 10 92 49 09 sts 0x0949, r1 |
5840: 10 92 4a 09 sts 0x094A, r1 |
5844: 10 92 4b 09 sts 0x094B, r1 |
5848: 10 92 4c 09 sts 0x094C, r1 |
584c: 10 92 4d 09 sts 0x094D, r1 |
5850: 10 92 4e 09 sts 0x094E, r1 |
5854: 10 92 4f 09 sts 0x094F, r1 |
5858: 10 92 50 09 sts 0x0950, r1 |
585c: 10 92 51 09 sts 0x0951, r1 |
5860: 10 92 52 09 sts 0x0952, r1 |
5864: 10 92 53 09 sts 0x0953, r1 |
5868: 10 92 54 09 sts 0x0954, r1 |
586c: 10 92 55 09 sts 0x0955, r1 |
5870: 10 92 56 09 sts 0x0956, r1 |
5874: 10 92 57 09 sts 0x0957, r1 |
5878: 1c 82 std Y+4, r1 ; 0x04 |
587a: 1b 82 std Y+3, r1 ; 0x03 |
587c: 80 ee ldi r24, 0xE0 ; 224 |
587e: 9c e0 ldi r25, 0x0C ; 12 |
5880: 9a 83 std Y+2, r25 ; 0x02 |
5882: 89 83 std Y+1, r24 ; 0x01 |
5884: a0 e0 ldi r26, 0x00 ; 0 |
5886: bd e0 ldi r27, 0x0D ; 13 |
5888: bf 8f std Y+31, r27 ; 0x1f |
588a: ae 8f std Y+30, r26 ; 0x1e |
588c: 30 c1 rjmp .+608 ; 0x5aee <gps_main+0x37e> |
588e: 20 90 48 09 lds r2, 0x0948 |
5892: 30 90 49 09 lds r3, 0x0949 |
5896: 40 90 4a 09 lds r4, 0x094A |
589a: 50 90 4b 09 lds r5, 0x094B |
589e: 60 90 4c 09 lds r6, 0x094C |
58a2: 70 90 4d 09 lds r7, 0x094D |
58a6: 80 90 4e 09 lds r8, 0x094E |
58aa: 90 90 4f 09 lds r9, 0x094F |
58ae: e9 81 ldd r30, Y+1 ; 0x01 |
58b0: fa 81 ldd r31, Y+2 ; 0x02 |
58b2: 20 81 ld r18, Z |
58b4: 31 81 ldd r19, Z+1 ; 0x01 |
58b6: 42 81 ldd r20, Z+2 ; 0x02 |
58b8: 53 81 ldd r21, Z+3 ; 0x03 |
58ba: da 01 movw r26, r20 |
58bc: c9 01 movw r24, r18 |
58be: bb 0f add r27, r27 |
58c0: 88 0b sbc r24, r24 |
58c2: 98 2f mov r25, r24 |
58c4: dc 01 movw r26, r24 |
58c6: 2e 87 std Y+14, r18 ; 0x0e |
58c8: 3f 87 std Y+15, r19 ; 0x0f |
58ca: 48 8b std Y+16, r20 ; 0x10 |
58cc: 59 8b std Y+17, r21 ; 0x11 |
58ce: 8a 8b std Y+18, r24 ; 0x12 |
58d0: 8b 8b std Y+19, r24 ; 0x13 |
58d2: 8c 8b std Y+20, r24 ; 0x14 |
58d4: 8d 8b std Y+21, r24 ; 0x15 |
58d6: ae 84 ldd r10, Y+14 ; 0x0e |
58d8: a2 0c add r10, r2 |
58da: 81 e0 ldi r24, 0x01 ; 1 |
58dc: a2 14 cp r10, r2 |
58de: 08 f0 brcs .+2 ; 0x58e2 <gps_main+0x172> |
58e0: 80 e0 ldi r24, 0x00 ; 0 |
58e2: bf 84 ldd r11, Y+15 ; 0x0f |
58e4: b3 0c add r11, r3 |
58e6: 21 e0 ldi r18, 0x01 ; 1 |
58e8: b3 14 cp r11, r3 |
58ea: 08 f0 brcs .+2 ; 0x58ee <gps_main+0x17e> |
58ec: 20 e0 ldi r18, 0x00 ; 0 |
58ee: 8b 0d add r24, r11 |
58f0: 91 e0 ldi r25, 0x01 ; 1 |
58f2: 8b 15 cp r24, r11 |
58f4: 08 f0 brcs .+2 ; 0x58f8 <gps_main+0x188> |
58f6: 90 e0 ldi r25, 0x00 ; 0 |
58f8: 29 2b or r18, r25 |
58fa: b8 2e mov r11, r24 |
58fc: c8 88 ldd r12, Y+16 ; 0x10 |
58fe: c4 0c add r12, r4 |
5900: 31 e0 ldi r19, 0x01 ; 1 |
5902: c4 14 cp r12, r4 |
5904: 08 f0 brcs .+2 ; 0x5908 <gps_main+0x198> |
5906: 30 e0 ldi r19, 0x00 ; 0 |
5908: 82 2f mov r24, r18 |
590a: 8c 0d add r24, r12 |
590c: 91 e0 ldi r25, 0x01 ; 1 |
590e: 8c 15 cp r24, r12 |
5910: 08 f0 brcs .+2 ; 0x5914 <gps_main+0x1a4> |
5912: 90 e0 ldi r25, 0x00 ; 0 |
5914: 39 2b or r19, r25 |
5916: c8 2e mov r12, r24 |
5918: d9 88 ldd r13, Y+17 ; 0x11 |
591a: d5 0c add r13, r5 |
591c: 21 e0 ldi r18, 0x01 ; 1 |
591e: d5 14 cp r13, r5 |
5920: 08 f0 brcs .+2 ; 0x5924 <gps_main+0x1b4> |
5922: 20 e0 ldi r18, 0x00 ; 0 |
5924: 83 2f mov r24, r19 |
5926: 8d 0d add r24, r13 |
5928: 91 e0 ldi r25, 0x01 ; 1 |
592a: 8d 15 cp r24, r13 |
592c: 08 f0 brcs .+2 ; 0x5930 <gps_main+0x1c0> |
592e: 90 e0 ldi r25, 0x00 ; 0 |
5930: 29 2b or r18, r25 |
5932: d8 2e mov r13, r24 |
5934: ea 88 ldd r14, Y+18 ; 0x12 |
5936: e6 0c add r14, r6 |
5938: 31 e0 ldi r19, 0x01 ; 1 |
593a: e6 14 cp r14, r6 |
593c: 08 f0 brcs .+2 ; 0x5940 <gps_main+0x1d0> |
593e: 30 e0 ldi r19, 0x00 ; 0 |
5940: 82 2f mov r24, r18 |
5942: 8e 0d add r24, r14 |
5944: 91 e0 ldi r25, 0x01 ; 1 |
5946: 8e 15 cp r24, r14 |
5948: 08 f0 brcs .+2 ; 0x594c <gps_main+0x1dc> |
594a: 90 e0 ldi r25, 0x00 ; 0 |
594c: 39 2b or r19, r25 |
594e: e8 2e mov r14, r24 |
5950: fb 88 ldd r15, Y+19 ; 0x13 |
5952: f7 0c add r15, r7 |
5954: 21 e0 ldi r18, 0x01 ; 1 |
5956: f7 14 cp r15, r7 |
5958: 08 f0 brcs .+2 ; 0x595c <gps_main+0x1ec> |
595a: 20 e0 ldi r18, 0x00 ; 0 |
595c: 83 2f mov r24, r19 |
595e: 8f 0d add r24, r15 |
5960: 91 e0 ldi r25, 0x01 ; 1 |
5962: 8f 15 cp r24, r15 |
5964: 08 f0 brcs .+2 ; 0x5968 <gps_main+0x1f8> |
5966: 90 e0 ldi r25, 0x00 ; 0 |
5968: 29 2b or r18, r25 |
596a: f8 2e mov r15, r24 |
596c: 0c 89 ldd r16, Y+20 ; 0x14 |
596e: 08 0d add r16, r8 |
5970: 91 e0 ldi r25, 0x01 ; 1 |
5972: 08 15 cp r16, r8 |
5974: 08 f0 brcs .+2 ; 0x5978 <gps_main+0x208> |
5976: 90 e0 ldi r25, 0x00 ; 0 |
5978: 82 2f mov r24, r18 |
597a: 80 0f add r24, r16 |
597c: e1 e0 ldi r30, 0x01 ; 1 |
597e: 80 17 cp r24, r16 |
5980: 08 f0 brcs .+2 ; 0x5984 <gps_main+0x214> |
5982: e0 e0 ldi r30, 0x00 ; 0 |
5984: ae 2f mov r26, r30 |
5986: a9 2b or r26, r25 |
5988: 1d 89 ldd r17, Y+21 ; 0x15 |
598a: 19 0d add r17, r9 |
598c: a1 0f add r26, r17 |
598e: a0 92 48 09 sts 0x0948, r10 |
5992: b0 92 49 09 sts 0x0949, r11 |
5996: c0 92 4a 09 sts 0x094A, r12 |
599a: d0 92 4b 09 sts 0x094B, r13 |
599e: e0 92 4c 09 sts 0x094C, r14 |
59a2: f0 92 4d 09 sts 0x094D, r15 |
59a6: 80 93 4e 09 sts 0x094E, r24 |
59aa: a0 93 4f 09 sts 0x094F, r26 |
59ae: 20 90 50 09 lds r2, 0x0950 |
59b2: 30 90 51 09 lds r3, 0x0951 |
59b6: 40 90 52 09 lds r4, 0x0952 |
59ba: 50 90 53 09 lds r5, 0x0953 |
59be: 60 90 54 09 lds r6, 0x0954 |
59c2: 70 90 55 09 lds r7, 0x0955 |
59c6: 80 90 56 09 lds r8, 0x0956 |
59ca: 90 90 57 09 lds r9, 0x0957 |
59ce: ae 8d ldd r26, Y+30 ; 0x1e |
59d0: bf 8d ldd r27, Y+31 ; 0x1f |
59d2: 2d 91 ld r18, X+ |
59d4: 3d 91 ld r19, X+ |
59d6: 4d 91 ld r20, X+ |
59d8: 5c 91 ld r21, X |
59da: da 01 movw r26, r20 |
59dc: c9 01 movw r24, r18 |
59de: bb 0f add r27, r27 |
59e0: 88 0b sbc r24, r24 |
59e2: 98 2f mov r25, r24 |
59e4: dc 01 movw r26, r24 |
59e6: 2e 8b std Y+22, r18 ; 0x16 |
59e8: 3f 8b std Y+23, r19 ; 0x17 |
59ea: 48 8f std Y+24, r20 ; 0x18 |
59ec: 59 8f std Y+25, r21 ; 0x19 |
59ee: 8a 8f std Y+26, r24 ; 0x1a |
59f0: 8b 8f std Y+27, r24 ; 0x1b |
59f2: 8c 8f std Y+28, r24 ; 0x1c |
59f4: 8d 8f std Y+29, r24 ; 0x1d |
59f6: ae 88 ldd r10, Y+22 ; 0x16 |
59f8: a2 0c add r10, r2 |
59fa: 81 e0 ldi r24, 0x01 ; 1 |
59fc: a2 14 cp r10, r2 |
59fe: 08 f0 brcs .+2 ; 0x5a02 <gps_main+0x292> |
5a00: 80 e0 ldi r24, 0x00 ; 0 |
5a02: bf 88 ldd r11, Y+23 ; 0x17 |
5a04: b3 0c add r11, r3 |
5a06: 21 e0 ldi r18, 0x01 ; 1 |
5a08: b3 14 cp r11, r3 |
5a0a: 08 f0 brcs .+2 ; 0x5a0e <gps_main+0x29e> |
5a0c: 20 e0 ldi r18, 0x00 ; 0 |
5a0e: 8b 0d add r24, r11 |
5a10: 91 e0 ldi r25, 0x01 ; 1 |
5a12: 8b 15 cp r24, r11 |
5a14: 08 f0 brcs .+2 ; 0x5a18 <gps_main+0x2a8> |
5a16: 90 e0 ldi r25, 0x00 ; 0 |
5a18: 29 2b or r18, r25 |
5a1a: b8 2e mov r11, r24 |
5a1c: c8 8c ldd r12, Y+24 ; 0x18 |
5a1e: c4 0c add r12, r4 |
5a20: 31 e0 ldi r19, 0x01 ; 1 |
5a22: c4 14 cp r12, r4 |
5a24: 08 f0 brcs .+2 ; 0x5a28 <gps_main+0x2b8> |
5a26: 30 e0 ldi r19, 0x00 ; 0 |
5a28: 82 2f mov r24, r18 |
5a2a: 8c 0d add r24, r12 |
5a2c: 91 e0 ldi r25, 0x01 ; 1 |
5a2e: 8c 15 cp r24, r12 |
5a30: 08 f0 brcs .+2 ; 0x5a34 <gps_main+0x2c4> |
5a32: 90 e0 ldi r25, 0x00 ; 0 |
5a34: 39 2b or r19, r25 |
5a36: c8 2e mov r12, r24 |
5a38: d9 8c ldd r13, Y+25 ; 0x19 |
5a3a: d5 0c add r13, r5 |
5a3c: 21 e0 ldi r18, 0x01 ; 1 |
5a3e: d5 14 cp r13, r5 |
5a40: 08 f0 brcs .+2 ; 0x5a44 <gps_main+0x2d4> |
5a42: 20 e0 ldi r18, 0x00 ; 0 |
5a44: 83 2f mov r24, r19 |
5a46: 8d 0d add r24, r13 |
5a48: 91 e0 ldi r25, 0x01 ; 1 |
5a4a: 8d 15 cp r24, r13 |
5a4c: 08 f0 brcs .+2 ; 0x5a50 <gps_main+0x2e0> |
5a4e: 90 e0 ldi r25, 0x00 ; 0 |
5a50: 29 2b or r18, r25 |
5a52: d8 2e mov r13, r24 |
5a54: ea 8c ldd r14, Y+26 ; 0x1a |
5a56: e6 0c add r14, r6 |
5a58: 31 e0 ldi r19, 0x01 ; 1 |
5a5a: e6 14 cp r14, r6 |
5a5c: 08 f0 brcs .+2 ; 0x5a60 <gps_main+0x2f0> |
5a5e: 30 e0 ldi r19, 0x00 ; 0 |
5a60: 82 2f mov r24, r18 |
5a62: 8e 0d add r24, r14 |
5a64: 91 e0 ldi r25, 0x01 ; 1 |
5a66: 8e 15 cp r24, r14 |
5a68: 08 f0 brcs .+2 ; 0x5a6c <gps_main+0x2fc> |
5a6a: 90 e0 ldi r25, 0x00 ; 0 |
5a6c: 39 2b or r19, r25 |
5a6e: e8 2e mov r14, r24 |
5a70: fb 8c ldd r15, Y+27 ; 0x1b |
5a72: f7 0c add r15, r7 |
5a74: 21 e0 ldi r18, 0x01 ; 1 |
5a76: f7 14 cp r15, r7 |
5a78: 08 f0 brcs .+2 ; 0x5a7c <gps_main+0x30c> |
5a7a: 20 e0 ldi r18, 0x00 ; 0 |
5a7c: 83 2f mov r24, r19 |
5a7e: 8f 0d add r24, r15 |
5a80: 91 e0 ldi r25, 0x01 ; 1 |
5a82: 8f 15 cp r24, r15 |
5a84: 08 f0 brcs .+2 ; 0x5a88 <gps_main+0x318> |
5a86: 90 e0 ldi r25, 0x00 ; 0 |
5a88: 29 2b or r18, r25 |
5a8a: f8 2e mov r15, r24 |
5a8c: 0c 8d ldd r16, Y+28 ; 0x1c |
5a8e: 08 0d add r16, r8 |
5a90: 91 e0 ldi r25, 0x01 ; 1 |
5a92: 08 15 cp r16, r8 |
5a94: 08 f0 brcs .+2 ; 0x5a98 <gps_main+0x328> |
5a96: 90 e0 ldi r25, 0x00 ; 0 |
5a98: 82 2f mov r24, r18 |
5a9a: 80 0f add r24, r16 |
5a9c: e1 e0 ldi r30, 0x01 ; 1 |
5a9e: 80 17 cp r24, r16 |
5aa0: 08 f0 brcs .+2 ; 0x5aa4 <gps_main+0x334> |
5aa2: e0 e0 ldi r30, 0x00 ; 0 |
5aa4: ae 2f mov r26, r30 |
5aa6: a9 2b or r26, r25 |
5aa8: 1d 8d ldd r17, Y+29 ; 0x1d |
5aaa: 19 0d add r17, r9 |
5aac: a1 0f add r26, r17 |
5aae: a0 92 50 09 sts 0x0950, r10 |
5ab2: b0 92 51 09 sts 0x0951, r11 |
5ab6: c0 92 52 09 sts 0x0952, r12 |
5aba: d0 92 53 09 sts 0x0953, r13 |
5abe: e0 92 54 09 sts 0x0954, r14 |
5ac2: f0 92 55 09 sts 0x0955, r15 |
5ac6: 80 93 56 09 sts 0x0956, r24 |
5aca: a0 93 57 09 sts 0x0957, r26 |
5ace: eb 81 ldd r30, Y+3 ; 0x03 |
5ad0: fc 81 ldd r31, Y+4 ; 0x04 |
5ad2: 31 96 adiw r30, 0x01 ; 1 |
5ad4: fc 83 std Y+4, r31 ; 0x04 |
5ad6: eb 83 std Y+3, r30 ; 0x03 |
5ad8: 29 81 ldd r18, Y+1 ; 0x01 |
5ada: 3a 81 ldd r19, Y+2 ; 0x02 |
5adc: 2c 5f subi r18, 0xFC ; 252 |
5ade: 3f 4f sbci r19, 0xFF ; 255 |
5ae0: 3a 83 std Y+2, r19 ; 0x02 |
5ae2: 29 83 std Y+1, r18 ; 0x01 |
5ae4: 8e 8d ldd r24, Y+30 ; 0x1e |
5ae6: 9f 8d ldd r25, Y+31 ; 0x1f |
5ae8: 04 96 adiw r24, 0x04 ; 4 |
5aea: 9f 8f std Y+31, r25 ; 0x1f |
5aec: 8e 8f std Y+30, r24 ; 0x1e |
5aee: 80 91 58 09 lds r24, 0x0958 |
5af2: 90 91 59 09 lds r25, 0x0959 |
5af6: ab 81 ldd r26, Y+3 ; 0x03 |
5af8: bc 81 ldd r27, Y+4 ; 0x04 |
5afa: a8 17 cp r26, r24 |
5afc: b9 07 cpc r27, r25 |
5afe: 0c f4 brge .+2 ; 0x5b02 <gps_main+0x392> |
5b00: c6 ce rjmp .-628 ; 0x588e <gps_main+0x11e> |
5b02: 20 90 48 09 lds r2, 0x0948 |
5b06: 30 90 49 09 lds r3, 0x0949 |
5b0a: 40 90 4a 09 lds r4, 0x094A |
5b0e: 50 90 4b 09 lds r5, 0x094B |
5b12: 60 90 4c 09 lds r6, 0x094C |
5b16: 70 90 4d 09 lds r7, 0x094D |
5b1a: 80 90 4e 09 lds r8, 0x094E |
5b1e: 90 90 4f 09 lds r9, 0x094F |
5b22: a0 91 58 09 lds r26, 0x0958 |
5b26: b0 91 59 09 lds r27, 0x0959 |
5b2a: fd 01 movw r30, r26 |
5b2c: ff 0f add r31, r31 |
5b2e: ee 0b sbc r30, r30 |
5b30: fe 2f mov r31, r30 |
5b32: 9d 01 movw r18, r26 |
5b34: aa 2e mov r10, r26 |
5b36: b3 2e mov r11, r19 |
5b38: ce 2e mov r12, r30 |
5b3a: de 2e mov r13, r30 |
5b3c: ee 2e mov r14, r30 |
5b3e: fe 2e mov r15, r30 |
5b40: 0e 2f mov r16, r30 |
5b42: 1e 2f mov r17, r30 |
5b44: 22 2d mov r18, r2 |
5b46: 33 2d mov r19, r3 |
5b48: 44 2d mov r20, r4 |
5b4a: 55 2d mov r21, r5 |
5b4c: 66 2d mov r22, r6 |
5b4e: 77 2d mov r23, r7 |
5b50: 88 2d mov r24, r8 |
5b52: 99 2d mov r25, r9 |
5b54: 0e 94 8b 32 call 0x6516 ; 0x6516 <__divdi3> |
5b58: 20 93 48 09 sts 0x0948, r18 |
5b5c: 30 93 49 09 sts 0x0949, r19 |
5b60: 40 93 4a 09 sts 0x094A, r20 |
5b64: 50 93 4b 09 sts 0x094B, r21 |
5b68: 60 93 4c 09 sts 0x094C, r22 |
5b6c: 70 93 4d 09 sts 0x094D, r23 |
5b70: 80 93 4e 09 sts 0x094E, r24 |
5b74: 90 93 4f 09 sts 0x094F, r25 |
5b78: 20 90 50 09 lds r2, 0x0950 |
5b7c: 30 90 51 09 lds r3, 0x0951 |
5b80: 40 90 52 09 lds r4, 0x0952 |
5b84: 50 90 53 09 lds r5, 0x0953 |
5b88: 60 90 54 09 lds r6, 0x0954 |
5b8c: 70 90 55 09 lds r7, 0x0955 |
5b90: 80 90 56 09 lds r8, 0x0956 |
5b94: 90 90 57 09 lds r9, 0x0957 |
5b98: a0 91 58 09 lds r26, 0x0958 |
5b9c: b0 91 59 09 lds r27, 0x0959 |
5ba0: fd 01 movw r30, r26 |
5ba2: ff 0f add r31, r31 |
5ba4: ee 0b sbc r30, r30 |
5ba6: fe 2f mov r31, r30 |
5ba8: 9d 01 movw r18, r26 |
5baa: aa 2e mov r10, r26 |
5bac: b3 2e mov r11, r19 |
5bae: ce 2e mov r12, r30 |
5bb0: de 2e mov r13, r30 |
5bb2: ee 2e mov r14, r30 |
5bb4: fe 2e mov r15, r30 |
5bb6: 0e 2f mov r16, r30 |
5bb8: 1e 2f mov r17, r30 |
5bba: 22 2d mov r18, r2 |
5bbc: 33 2d mov r19, r3 |
5bbe: 44 2d mov r20, r4 |
5bc0: 55 2d mov r21, r5 |
5bc2: 66 2d mov r22, r6 |
5bc4: 77 2d mov r23, r7 |
5bc6: 88 2d mov r24, r8 |
5bc8: 99 2d mov r25, r9 |
5bca: 0e 94 8b 32 call 0x6516 ; 0x6516 <__divdi3> |
5bce: 20 93 50 09 sts 0x0950, r18 |
5bd2: 30 93 51 09 sts 0x0951, r19 |
5bd6: 40 93 52 09 sts 0x0952, r20 |
5bda: 50 93 53 09 sts 0x0953, r21 |
5bde: 60 93 54 09 sts 0x0954, r22 |
5be2: 70 93 55 09 sts 0x0955, r23 |
5be6: 80 93 56 09 sts 0x0956, r24 |
5bea: 90 93 57 09 sts 0x0957, r25 |
5bee: 20 91 48 09 lds r18, 0x0948 |
5bf2: 30 91 49 09 lds r19, 0x0949 |
5bf6: 40 91 4a 09 lds r20, 0x094A |
5bfa: 50 91 4b 09 lds r21, 0x094B |
5bfe: 60 91 4c 09 lds r22, 0x094C |
5c02: 70 91 4d 09 lds r23, 0x094D |
5c06: 80 91 4e 09 lds r24, 0x094E |
5c0a: 90 91 4f 09 lds r25, 0x094F |
5c0e: 20 93 40 09 sts 0x0940, r18 |
5c12: 30 93 41 09 sts 0x0941, r19 |
5c16: 40 93 42 09 sts 0x0942, r20 |
5c1a: 50 93 43 09 sts 0x0943, r21 |
5c1e: 20 91 50 09 lds r18, 0x0950 |
5c22: 30 91 51 09 lds r19, 0x0951 |
5c26: 40 91 52 09 lds r20, 0x0952 |
5c2a: 50 91 53 09 lds r21, 0x0953 |
5c2e: 60 91 54 09 lds r22, 0x0954 |
5c32: 70 91 55 09 lds r23, 0x0955 |
5c36: 80 91 56 09 lds r24, 0x0956 |
5c3a: 90 91 57 09 lds r25, 0x0957 |
5c3e: 20 93 44 09 sts 0x0944, r18 |
5c42: 30 93 45 09 sts 0x0945, r19 |
5c46: 40 93 46 09 sts 0x0946, r20 |
5c4a: 50 93 47 09 sts 0x0947, r21 |
5c4e: 81 e0 ldi r24, 0x01 ; 1 |
5c50: 80 93 3e 09 sts 0x093E, r24 |
5c54: 20 91 d6 08 lds r18, 0x08D6 |
5c58: 21 30 cpi r18, 0x01 ; 1 |
5c5a: 09 f0 breq .+2 ; 0x5c5e <gps_main+0x4ee> |
5c5c: 73 c0 rjmp .+230 ; 0x5d44 <gps_main+0x5d4> |
5c5e: 1c c0 rjmp .+56 ; 0x5c98 <gps_main+0x528> |
5c60: bd 85 ldd r27, Y+13 ; 0x0d |
5c62: b3 30 cpi r27, 0x03 ; 3 |
5c64: 08 f0 brcs .+2 ; 0x5c68 <gps_main+0x4f8> |
5c66: 6e c0 rjmp .+220 ; 0x5d44 <gps_main+0x5d4> |
5c68: 80 91 c3 08 lds r24, 0x08C3 |
5c6c: 90 91 c4 08 lds r25, 0x08C4 |
5c70: 87 34 cpi r24, 0x47 ; 71 |
5c72: 91 05 cpc r25, r1 |
5c74: 0c f4 brge .+2 ; 0x5c78 <gps_main+0x508> |
5c76: 66 c0 rjmp .+204 ; 0x5d44 <gps_main+0x5d4> |
5c78: 10 92 31 09 sts 0x0931, r1 |
5c7c: 10 92 30 09 sts 0x0930, r1 |
5c80: 10 92 33 09 sts 0x0933, r1 |
5c84: 10 92 32 09 sts 0x0932, r1 |
5c88: 43 98 cbi 0x08, 3 ; 8 |
5c8a: 82 e3 ldi r24, 0x32 ; 50 |
5c8c: 90 e0 ldi r25, 0x00 ; 0 |
5c8e: 90 93 48 08 sts 0x0848, r25 |
5c92: 80 93 47 08 sts 0x0847, r24 |
5c96: 56 c0 rjmp .+172 ; 0x5d44 <gps_main+0x5d4> |
5c98: 80 91 34 09 lds r24, 0x0934 |
5c9c: 88 23 and r24, r24 |
5c9e: 09 f0 breq .+2 ; 0x5ca2 <gps_main+0x532> |
5ca0: 6b c0 rjmp .+214 ; 0x5d78 <gps_main+0x608> |
5ca2: 80 91 bc 08 lds r24, 0x08BC |
5ca6: 90 91 bd 08 lds r25, 0x08BD |
5caa: 80 5d subi r24, 0xD0 ; 208 |
5cac: 97 40 sbci r25, 0x07 ; 7 |
5cae: 08 f0 brcs .+2 ; 0x5cb2 <gps_main+0x542> |
5cb0: 63 c0 rjmp .+198 ; 0x5d78 <gps_main+0x608> |
5cb2: 80 91 40 09 lds r24, 0x0940 |
5cb6: 90 91 41 09 lds r25, 0x0941 |
5cba: a0 91 42 09 lds r26, 0x0942 |
5cbe: b0 91 43 09 lds r27, 0x0943 |
5cc2: 80 93 35 09 sts 0x0935, r24 |
5cc6: 90 93 36 09 sts 0x0936, r25 |
5cca: a0 93 37 09 sts 0x0937, r26 |
5cce: b0 93 38 09 sts 0x0938, r27 |
5cd2: 80 91 44 09 lds r24, 0x0944 |
5cd6: 90 91 45 09 lds r25, 0x0945 |
5cda: a0 91 46 09 lds r26, 0x0946 |
5cde: b0 91 47 09 lds r27, 0x0947 |
5ce2: 80 93 39 09 sts 0x0939, r24 |
5ce6: 90 93 3a 09 sts 0x093A, r25 |
5cea: a0 93 3b 09 sts 0x093B, r26 |
5cee: b0 93 3c 09 sts 0x093C, r27 |
5cf2: 80 91 40 09 lds r24, 0x0940 |
5cf6: 90 91 41 09 lds r25, 0x0941 |
5cfa: a0 91 42 09 lds r26, 0x0942 |
5cfe: b0 91 43 09 lds r27, 0x0943 |
5d02: 80 93 04 09 sts 0x0904, r24 |
5d06: 90 93 05 09 sts 0x0905, r25 |
5d0a: a0 93 06 09 sts 0x0906, r26 |
5d0e: b0 93 07 09 sts 0x0907, r27 |
5d12: 80 91 44 09 lds r24, 0x0944 |
5d16: 90 91 45 09 lds r25, 0x0945 |
5d1a: a0 91 46 09 lds r26, 0x0946 |
5d1e: b0 91 47 09 lds r27, 0x0947 |
5d22: 80 93 08 09 sts 0x0908, r24 |
5d26: 90 93 09 09 sts 0x0909, r25 |
5d2a: a0 93 0a 09 sts 0x090A, r26 |
5d2e: b0 93 0b 09 sts 0x090B, r27 |
5d32: 82 e3 ldi r24, 0x32 ; 50 |
5d34: 90 e0 ldi r25, 0x00 ; 0 |
5d36: 90 93 48 08 sts 0x0848, r25 |
5d3a: 80 93 47 08 sts 0x0847, r24 |
5d3e: 20 93 34 09 sts 0x0934, r18 |
5d42: 1a c0 rjmp .+52 ; 0x5d78 <gps_main+0x608> |
5d44: 80 91 d6 08 lds r24, 0x08D6 |
5d48: 88 23 and r24, r24 |
5d4a: b1 f4 brne .+44 ; 0x5d78 <gps_main+0x608> |
5d4c: 10 92 35 09 sts 0x0935, r1 |
5d50: 10 92 36 09 sts 0x0936, r1 |
5d54: 10 92 37 09 sts 0x0937, r1 |
5d58: 10 92 38 09 sts 0x0938, r1 |
5d5c: 10 92 39 09 sts 0x0939, r1 |
5d60: 10 92 3a 09 sts 0x093A, r1 |
5d64: 10 92 3b 09 sts 0x093B, r1 |
5d68: 10 92 3c 09 sts 0x093C, r1 |
5d6c: 10 92 34 09 sts 0x0934, r1 |
5d70: 10 92 bd 08 sts 0x08BD, r1 |
5d74: 10 92 bc 08 sts 0x08BC, r1 |
5d78: 20 91 c3 08 lds r18, 0x08C3 |
5d7c: 30 91 c4 08 lds r19, 0x08C4 |
5d80: 3f 8f std Y+31, r19 ; 0x1f |
5d82: 2e 8f std Y+30, r18 ; 0x1e |
5d84: 26 34 cpi r18, 0x46 ; 70 |
5d86: 31 05 cpc r19, r1 |
5d88: 4c f5 brge .+82 ; 0x5ddc <gps_main+0x66c> |
5d8a: 80 91 40 09 lds r24, 0x0940 |
5d8e: 90 91 41 09 lds r25, 0x0941 |
5d92: a0 91 42 09 lds r26, 0x0942 |
5d96: b0 91 43 09 lds r27, 0x0943 |
5d9a: 80 93 04 09 sts 0x0904, r24 |
5d9e: 90 93 05 09 sts 0x0905, r25 |
5da2: a0 93 06 09 sts 0x0906, r26 |
5da6: b0 93 07 09 sts 0x0907, r27 |
5daa: 80 91 44 09 lds r24, 0x0944 |
5dae: 90 91 45 09 lds r25, 0x0945 |
5db2: a0 91 46 09 lds r26, 0x0946 |
5db6: b0 91 47 09 lds r27, 0x0947 |
5dba: 80 93 08 09 sts 0x0908, r24 |
5dbe: 90 93 09 09 sts 0x0909, r25 |
5dc2: a0 93 0a 09 sts 0x090A, r26 |
5dc6: b0 93 0b 09 sts 0x090B, r27 |
5dca: 10 92 31 09 sts 0x0931, r1 |
5dce: 10 92 30 09 sts 0x0930, r1 |
5dd2: 10 92 33 09 sts 0x0933, r1 |
5dd6: 10 92 32 09 sts 0x0932, r1 |
5dda: 43 98 cbi 0x08, 3 ; 8 |
5ddc: 3d 85 ldd r19, Y+13 ; 0x0d |
5dde: 33 30 cpi r19, 0x03 ; 3 |
5de0: 09 f0 breq .+2 ; 0x5de4 <gps_main+0x674> |
5de2: 80 c3 rjmp .+1792 ; 0x64e4 <gps_main+0xd74> |
5de4: 8e 8d ldd r24, Y+30 ; 0x1e |
5de6: 9f 8d ldd r25, Y+31 ; 0x1f |
5de8: 87 34 cpi r24, 0x47 ; 71 |
5dea: 91 05 cpc r25, r1 |
5dec: 0c f4 brge .+2 ; 0x5df0 <gps_main+0x680> |
5dee: 7a c3 rjmp .+1780 ; 0x64e4 <gps_main+0xd74> |
5df0: 86 39 cpi r24, 0x96 ; 150 |
5df2: 91 05 cpc r25, r1 |
5df4: 0c f0 brlt .+2 ; 0x5df8 <gps_main+0x688> |
5df6: 48 c0 rjmp .+144 ; 0x5e88 <gps_main+0x718> |
5df8: 80 91 d0 08 lds r24, 0x08D0 |
5dfc: 90 91 d1 08 lds r25, 0x08D1 |
5e00: 0c 96 adiw r24, 0x0c ; 12 |
5e02: 49 97 sbiw r24, 0x19 ; 25 |
5e04: 50 f4 brcc .+20 ; 0x5e1a <gps_main+0x6aa> |
5e06: 80 91 d2 08 lds r24, 0x08D2 |
5e0a: 90 91 d3 08 lds r25, 0x08D3 |
5e0e: 8d 30 cpi r24, 0x0D ; 13 |
5e10: 91 05 cpc r25, r1 |
5e12: 1c f4 brge .+6 ; 0x5e1a <gps_main+0x6aa> |
5e14: 84 5f subi r24, 0xF4 ; 244 |
5e16: 9f 4f sbci r25, 0xFF ; 255 |
5e18: bc f5 brge .+110 ; 0x5e88 <gps_main+0x718> |
5e1a: 10 92 31 09 sts 0x0931, r1 |
5e1e: 10 92 30 09 sts 0x0930, r1 |
5e22: 10 92 33 09 sts 0x0933, r1 |
5e26: 10 92 32 09 sts 0x0932, r1 |
5e2a: 80 91 40 09 lds r24, 0x0940 |
5e2e: 90 91 41 09 lds r25, 0x0941 |
5e32: a0 91 42 09 lds r26, 0x0942 |
5e36: b0 91 43 09 lds r27, 0x0943 |
5e3a: 80 93 04 09 sts 0x0904, r24 |
5e3e: 90 93 05 09 sts 0x0905, r25 |
5e42: a0 93 06 09 sts 0x0906, r26 |
5e46: b0 93 07 09 sts 0x0907, r27 |
5e4a: 80 91 44 09 lds r24, 0x0944 |
5e4e: 90 91 45 09 lds r25, 0x0945 |
5e52: a0 91 46 09 lds r26, 0x0946 |
5e56: b0 91 47 09 lds r27, 0x0947 |
5e5a: 80 93 08 09 sts 0x0908, r24 |
5e5e: 90 93 09 09 sts 0x0909, r25 |
5e62: a0 93 0a 09 sts 0x090A, r26 |
5e66: b0 93 0b 09 sts 0x090B, r27 |
5e6a: 80 91 3d 09 lds r24, 0x093D |
5e6e: 88 3c cpi r24, 0xC8 ; 200 |
5e70: 30 f0 brcs .+12 ; 0x5e7e <gps_main+0x70e> |
5e72: 88 b1 in r24, 0x08 ; 8 |
5e74: 98 e0 ldi r25, 0x08 ; 8 |
5e76: 89 27 eor r24, r25 |
5e78: 88 b9 out 0x08, r24 ; 8 |
5e7a: 10 92 3d 09 sts 0x093D, r1 |
5e7e: 80 91 3d 09 lds r24, 0x093D |
5e82: 8f 5f subi r24, 0xFF ; 255 |
5e84: 80 93 3d 09 sts 0x093D, r24 |
5e88: 80 91 3e 09 lds r24, 0x093E |
5e8c: 81 30 cpi r24, 0x01 ; 1 |
5e8e: 09 f0 breq .+2 ; 0x5e92 <gps_main+0x722> |
5e90: 29 c3 rjmp .+1618 ; 0x64e4 <gps_main+0xd74> |
5e92: e0 90 04 09 lds r14, 0x0904 |
5e96: f0 90 05 09 lds r15, 0x0905 |
5e9a: 00 91 06 09 lds r16, 0x0906 |
5e9e: 10 91 07 09 lds r17, 0x0907 |
5ea2: e1 14 cp r14, r1 |
5ea4: f1 04 cpc r15, r1 |
5ea6: 01 05 cpc r16, r1 |
5ea8: 11 05 cpc r17, r1 |
5eaa: 09 f4 brne .+2 ; 0x5eae <gps_main+0x73e> |
5eac: 1b c3 rjmp .+1590 ; 0x64e4 <gps_main+0xd74> |
5eae: a0 90 08 09 lds r10, 0x0908 |
5eb2: b0 90 09 09 lds r11, 0x0909 |
5eb6: c0 90 0a 09 lds r12, 0x090A |
5eba: d0 90 0b 09 lds r13, 0x090B |
5ebe: a1 14 cp r10, r1 |
5ec0: b1 04 cpc r11, r1 |
5ec2: c1 04 cpc r12, r1 |
5ec4: d1 04 cpc r13, r1 |
5ec6: 09 f4 brne .+2 ; 0x5eca <gps_main+0x75a> |
5ec8: 0d c3 rjmp .+1562 ; 0x64e4 <gps_main+0xd74> |
5eca: 80 91 d0 08 lds r24, 0x08D0 |
5ece: 90 91 d1 08 lds r25, 0x08D1 |
5ed2: 8d 30 cpi r24, 0x0D ; 13 |
5ed4: 91 05 cpc r25, r1 |
5ed6: 0c f0 brlt .+2 ; 0x5eda <gps_main+0x76a> |
5ed8: 05 c3 rjmp .+1546 ; 0x64e4 <gps_main+0xd74> |
5eda: 84 5f subi r24, 0xF4 ; 244 |
5edc: 9f 4f sbci r25, 0xFF ; 255 |
5ede: 0c f4 brge .+2 ; 0x5ee2 <gps_main+0x772> |
5ee0: 01 c3 rjmp .+1538 ; 0x64e4 <gps_main+0xd74> |
5ee2: 80 91 d2 08 lds r24, 0x08D2 |
5ee6: 90 91 d3 08 lds r25, 0x08D3 |
5eea: 8d 30 cpi r24, 0x0D ; 13 |
5eec: 91 05 cpc r25, r1 |
5eee: 0c f0 brlt .+2 ; 0x5ef2 <gps_main+0x782> |
5ef0: f9 c2 rjmp .+1522 ; 0x64e4 <gps_main+0xd74> |
5ef2: 84 5f subi r24, 0xF4 ; 244 |
5ef4: 9f 4f sbci r25, 0xFF ; 255 |
5ef6: 0c f4 brge .+2 ; 0x5efa <gps_main+0x78a> |
5ef8: f5 c2 rjmp .+1514 ; 0x64e4 <gps_main+0xd74> |
5efa: 2e 8d ldd r18, Y+30 ; 0x1e |
5efc: 3f 8d ldd r19, Y+31 ; 0x1f |
5efe: 26 39 cpi r18, 0x96 ; 150 |
5f00: 31 05 cpc r19, r1 |
5f02: 0c f0 brlt .+2 ; 0x5f06 <gps_main+0x796> |
5f04: e0 c2 rjmp .+1472 ; 0x64c6 <gps_main+0xd56> |
5f06: 80 91 40 09 lds r24, 0x0940 |
5f0a: 90 91 41 09 lds r25, 0x0941 |
5f0e: a0 91 42 09 lds r26, 0x0942 |
5f12: b0 91 43 09 lds r27, 0x0943 |
5f16: e8 1a sub r14, r24 |
5f18: f9 0a sbc r15, r25 |
5f1a: 0a 0b sbc r16, r26 |
5f1c: 1b 0b sbc r17, r27 |
5f1e: e0 92 0c 09 sts 0x090C, r14 |
5f22: f0 92 0d 09 sts 0x090D, r15 |
5f26: 00 93 0e 09 sts 0x090E, r16 |
5f2a: 10 93 0f 09 sts 0x090F, r17 |
5f2e: 80 91 44 09 lds r24, 0x0944 |
5f32: 90 91 45 09 lds r25, 0x0945 |
5f36: a0 91 46 09 lds r26, 0x0946 |
5f3a: b0 91 47 09 lds r27, 0x0947 |
5f3e: a8 1a sub r10, r24 |
5f40: b9 0a sbc r11, r25 |
5f42: ca 0a sbc r12, r26 |
5f44: db 0a sbc r13, r27 |
5f46: a0 92 10 09 sts 0x0910, r10 |
5f4a: b0 92 11 09 sts 0x0911, r11 |
5f4e: c0 92 12 09 sts 0x0912, r12 |
5f52: d0 92 13 09 sts 0x0913, r13 |
5f56: 56 c0 rjmp .+172 ; 0x6004 <gps_main+0x894> |
5f58: e0 90 39 09 lds r14, 0x0939 |
5f5c: f0 90 3a 09 lds r15, 0x093A |
5f60: 00 91 3b 09 lds r16, 0x093B |
5f64: 10 91 3c 09 lds r17, 0x093C |
5f68: e1 14 cp r14, r1 |
5f6a: f1 04 cpc r15, r1 |
5f6c: 01 05 cpc r16, r1 |
5f6e: 11 05 cpc r17, r1 |
5f70: 09 f4 brne .+2 ; 0x5f74 <gps_main+0x804> |
5f72: 85 c0 rjmp .+266 ; 0x607e <gps_main+0x90e> |
5f74: 80 91 40 09 lds r24, 0x0940 |
5f78: 90 91 41 09 lds r25, 0x0941 |
5f7c: a0 91 42 09 lds r26, 0x0942 |
5f80: b0 91 43 09 lds r27, 0x0943 |
5f84: 28 1b sub r18, r24 |
5f86: 39 0b sbc r19, r25 |
5f88: 4a 0b sbc r20, r26 |
5f8a: 5b 0b sbc r21, r27 |
5f8c: 20 93 0c 09 sts 0x090C, r18 |
5f90: 30 93 0d 09 sts 0x090D, r19 |
5f94: 40 93 0e 09 sts 0x090E, r20 |
5f98: 50 93 0f 09 sts 0x090F, r21 |
5f9c: 80 91 44 09 lds r24, 0x0944 |
5fa0: 90 91 45 09 lds r25, 0x0945 |
5fa4: a0 91 46 09 lds r26, 0x0946 |
5fa8: b0 91 47 09 lds r27, 0x0947 |
5fac: e8 1a sub r14, r24 |
5fae: f9 0a sbc r15, r25 |
5fb0: 0a 0b sbc r16, r26 |
5fb2: 1b 0b sbc r17, r27 |
5fb4: e0 92 10 09 sts 0x0910, r14 |
5fb8: f0 92 11 09 sts 0x0911, r15 |
5fbc: 00 93 12 09 sts 0x0912, r16 |
5fc0: 10 93 13 09 sts 0x0913, r17 |
5fc4: 80 91 40 09 lds r24, 0x0940 |
5fc8: 90 91 41 09 lds r25, 0x0941 |
5fcc: a0 91 42 09 lds r26, 0x0942 |
5fd0: b0 91 43 09 lds r27, 0x0943 |
5fd4: 80 93 04 09 sts 0x0904, r24 |
5fd8: 90 93 05 09 sts 0x0905, r25 |
5fdc: a0 93 06 09 sts 0x0906, r26 |
5fe0: b0 93 07 09 sts 0x0907, r27 |
5fe4: 80 91 44 09 lds r24, 0x0944 |
5fe8: 90 91 45 09 lds r25, 0x0945 |
5fec: a0 91 46 09 lds r26, 0x0946 |
5ff0: b0 91 47 09 lds r27, 0x0947 |
5ff4: 80 93 08 09 sts 0x0908, r24 |
5ff8: 90 93 09 09 sts 0x0909, r25 |
5ffc: a0 93 0a 09 sts 0x090A, r26 |
6000: b0 93 0b 09 sts 0x090B, r27 |
6004: 43 9a sbi 0x08, 3 ; 8 |
6006: 3b c0 rjmp .+118 ; 0x607e <gps_main+0x90e> |
6008: 80 91 39 09 lds r24, 0x0939 |
600c: 90 91 3a 09 lds r25, 0x093A |
6010: a0 91 3b 09 lds r26, 0x093B |
6014: b0 91 3c 09 lds r27, 0x093C |
6018: 00 97 sbiw r24, 0x00 ; 0 |
601a: a1 05 cpc r26, r1 |
601c: b1 05 cpc r27, r1 |
601e: 79 f5 brne .+94 ; 0x607e <gps_main+0x90e> |
6020: 80 91 40 09 lds r24, 0x0940 |
6024: 90 91 41 09 lds r25, 0x0941 |
6028: a0 91 42 09 lds r26, 0x0942 |
602c: b0 91 43 09 lds r27, 0x0943 |
6030: e8 1a sub r14, r24 |
6032: f9 0a sbc r15, r25 |
6034: 0a 0b sbc r16, r26 |
6036: 1b 0b sbc r17, r27 |
6038: e0 92 0c 09 sts 0x090C, r14 |
603c: f0 92 0d 09 sts 0x090D, r15 |
6040: 00 93 0e 09 sts 0x090E, r16 |
6044: 10 93 0f 09 sts 0x090F, r17 |
6048: 80 91 44 09 lds r24, 0x0944 |
604c: 90 91 45 09 lds r25, 0x0945 |
6050: a0 91 46 09 lds r26, 0x0946 |
6054: b0 91 47 09 lds r27, 0x0947 |
6058: a8 1a sub r10, r24 |
605a: b9 0a sbc r11, r25 |
605c: ca 0a sbc r12, r26 |
605e: db 0a sbc r13, r27 |
6060: a0 92 10 09 sts 0x0910, r10 |
6064: b0 92 11 09 sts 0x0911, r11 |
6068: c0 92 12 09 sts 0x0912, r12 |
606c: d0 92 13 09 sts 0x0913, r13 |
6070: 43 9a sbi 0x08, 3 ; 8 |
6072: 82 e3 ldi r24, 0x32 ; 50 |
6074: 90 e0 ldi r25, 0x00 ; 0 |
6076: 90 93 48 08 sts 0x0848, r25 |
607a: 80 93 47 08 sts 0x0847, r24 |
607e: e0 90 07 0c lds r14, 0x0C07 |
6082: f0 90 08 0c lds r15, 0x0C08 |
6086: 00 91 09 0c lds r16, 0x0C09 |
608a: 10 91 0a 0c lds r17, 0x0C0A |
608e: e0 92 14 09 sts 0x0914, r14 |
6092: f0 92 15 09 sts 0x0915, r15 |
6096: 00 93 16 09 sts 0x0916, r16 |
609a: 10 93 17 09 sts 0x0917, r17 |
609e: a0 90 0b 0c lds r10, 0x0C0B |
60a2: b0 90 0c 0c lds r11, 0x0C0C |
60a6: c0 90 0d 0c lds r12, 0x0C0D |
60aa: d0 90 0e 0c lds r13, 0x0C0E |
60ae: a0 92 18 09 sts 0x0918, r10 |
60b2: b0 92 19 09 sts 0x0919, r11 |
60b6: c0 92 1a 09 sts 0x091A, r12 |
60ba: d0 92 1b 09 sts 0x091B, r13 |
60be: 60 91 6f 09 lds r22, 0x096F |
60c2: 70 91 70 09 lds r23, 0x0970 |
60c6: 60 90 0c 09 lds r6, 0x090C |
60ca: 70 90 0d 09 lds r7, 0x090D |
60ce: 80 90 0e 09 lds r8, 0x090E |
60d2: 90 90 0f 09 lds r9, 0x090F |
60d6: 88 27 eor r24, r24 |
60d8: 77 fd sbrc r23, 7 |
60da: 80 95 com r24 |
60dc: 98 2f mov r25, r24 |
60de: a4 01 movw r20, r8 |
60e0: 93 01 movw r18, r6 |
60e2: 0e 94 78 3e call 0x7cf0 ; 0x7cf0 <__mulsi3> |
60e6: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
60ea: 2f e6 ldi r18, 0x6F ; 111 |
60ec: 32 e1 ldi r19, 0x12 ; 18 |
60ee: 43 e0 ldi r20, 0x03 ; 3 |
60f0: 5a e3 ldi r21, 0x3A ; 58 |
60f2: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
60f6: 0e 94 99 3d call 0x7b32 ; 0x7b32 <__fixsfsi> |
60fa: 69 87 std Y+9, r22 ; 0x09 |
60fc: 7a 87 std Y+10, r23 ; 0x0a |
60fe: 8b 87 std Y+11, r24 ; 0x0b |
6100: 9c 87 std Y+12, r25 ; 0x0c |
6102: 60 93 1c 09 sts 0x091C, r22 |
6106: 70 93 1d 09 sts 0x091D, r23 |
610a: 80 93 1e 09 sts 0x091E, r24 |
610e: 90 93 1f 09 sts 0x091F, r25 |
6112: 60 91 62 09 lds r22, 0x0962 |
6116: 70 91 63 09 lds r23, 0x0963 |
611a: 88 27 eor r24, r24 |
611c: 77 fd sbrc r23, 7 |
611e: 80 95 com r24 |
6120: 98 2f mov r25, r24 |
6122: a8 01 movw r20, r16 |
6124: 97 01 movw r18, r14 |
6126: 0e 94 78 3e call 0x7cf0 ; 0x7cf0 <__mulsi3> |
612a: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
612e: 21 e2 ldi r18, 0x21 ; 33 |
6130: 3c e3 ldi r19, 0x3C ; 60 |
6132: 4a e5 ldi r20, 0x5A ; 90 |
6134: 5b e3 ldi r21, 0x3B ; 59 |
6136: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
613a: 0e 94 99 3d call 0x7b32 ; 0x7b32 <__fixsfsi> |
613e: 1b 01 movw r2, r22 |
6140: 2c 01 movw r4, r24 |
6142: 60 93 20 09 sts 0x0920, r22 |
6146: 70 93 21 09 sts 0x0921, r23 |
614a: 80 93 22 09 sts 0x0922, r24 |
614e: 90 93 23 09 sts 0x0923, r25 |
6152: 60 91 6f 09 lds r22, 0x096F |
6156: 70 91 70 09 lds r23, 0x0970 |
615a: e0 90 10 09 lds r14, 0x0910 |
615e: f0 90 11 09 lds r15, 0x0911 |
6162: 00 91 12 09 lds r16, 0x0912 |
6166: 10 91 13 09 lds r17, 0x0913 |
616a: 88 27 eor r24, r24 |
616c: 77 fd sbrc r23, 7 |
616e: 80 95 com r24 |
6170: 98 2f mov r25, r24 |
6172: a8 01 movw r20, r16 |
6174: 97 01 movw r18, r14 |
6176: 0e 94 78 3e call 0x7cf0 ; 0x7cf0 <__mulsi3> |
617a: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
617e: 2f e6 ldi r18, 0x6F ; 111 |
6180: 32 e1 ldi r19, 0x12 ; 18 |
6182: 43 e0 ldi r20, 0x03 ; 3 |
6184: 5a e3 ldi r21, 0x3A ; 58 |
6186: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
618a: 0e 94 99 3d call 0x7b32 ; 0x7b32 <__fixsfsi> |
618e: 6d 83 std Y+5, r22 ; 0x05 |
6190: 7e 83 std Y+6, r23 ; 0x06 |
6192: 8f 83 std Y+7, r24 ; 0x07 |
6194: 98 87 std Y+8, r25 ; 0x08 |
6196: 60 93 24 09 sts 0x0924, r22 |
619a: 70 93 25 09 sts 0x0925, r23 |
619e: 80 93 26 09 sts 0x0926, r24 |
61a2: 90 93 27 09 sts 0x0927, r25 |
61a6: 60 91 62 09 lds r22, 0x0962 |
61aa: 70 91 63 09 lds r23, 0x0963 |
61ae: 88 27 eor r24, r24 |
61b0: 77 fd sbrc r23, 7 |
61b2: 80 95 com r24 |
61b4: 98 2f mov r25, r24 |
61b6: a6 01 movw r20, r12 |
61b8: 95 01 movw r18, r10 |
61ba: 0e 94 78 3e call 0x7cf0 ; 0x7cf0 <__mulsi3> |
61be: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
61c2: 21 e2 ldi r18, 0x21 ; 33 |
61c4: 3c e3 ldi r19, 0x3C ; 60 |
61c6: 4a e5 ldi r20, 0x5A ; 90 |
61c8: 5b e3 ldi r21, 0x3B ; 59 |
61ca: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
61ce: 0e 94 99 3d call 0x7b32 ; 0x7b32 <__fixsfsi> |
61d2: 5b 01 movw r10, r22 |
61d4: 6c 01 movw r12, r24 |
61d6: 60 93 28 09 sts 0x0928, r22 |
61da: 70 93 29 09 sts 0x0929, r23 |
61de: 80 93 2a 09 sts 0x092A, r24 |
61e2: 90 93 2b 09 sts 0x092B, r25 |
61e6: 8e 8d ldd r24, Y+30 ; 0x1e |
61e8: 9f 8d ldd r25, Y+31 ; 0x1f |
61ea: 86 39 cpi r24, 0x96 ; 150 |
61ec: 91 05 cpc r25, r1 |
61ee: 0c f4 brge .+2 ; 0x61f2 <gps_main+0xa82> |
61f0: 80 c0 rjmp .+256 ; 0x62f2 <gps_main+0xb82> |
61f2: 80 91 35 09 lds r24, 0x0935 |
61f6: 90 91 36 09 lds r25, 0x0936 |
61fa: a0 91 37 09 lds r26, 0x0937 |
61fe: b0 91 38 09 lds r27, 0x0938 |
6202: 00 97 sbiw r24, 0x00 ; 0 |
6204: a1 05 cpc r26, r1 |
6206: b1 05 cpc r27, r1 |
6208: 09 f4 brne .+2 ; 0x620c <gps_main+0xa9c> |
620a: 73 c0 rjmp .+230 ; 0x62f2 <gps_main+0xb82> |
620c: 80 91 39 09 lds r24, 0x0939 |
6210: 90 91 3a 09 lds r25, 0x093A |
6214: a0 91 3b 09 lds r26, 0x093B |
6218: b0 91 3c 09 lds r27, 0x093C |
621c: 00 97 sbiw r24, 0x00 ; 0 |
621e: a1 05 cpc r26, r1 |
6220: b1 05 cpc r27, r1 |
6222: 09 f4 brne .+2 ; 0x6226 <gps_main+0xab6> |
6224: 66 c0 rjmp .+204 ; 0x62f2 <gps_main+0xb82> |
6226: c3 01 movw r24, r6 |
6228: 77 fe sbrs r7, 7 |
622a: 03 c0 rjmp .+6 ; 0x6232 <gps_main+0xac2> |
622c: 90 95 com r25 |
622e: 81 95 neg r24 |
6230: 9f 4f sbci r25, 0xFF ; 255 |
6232: 8b 3f cpi r24, 0xFB ; 251 |
6234: 91 05 cpc r25, r1 |
6236: 54 f4 brge .+20 ; 0x624c <gps_main+0xadc> |
6238: c7 01 movw r24, r14 |
623a: f7 fe sbrs r15, 7 |
623c: 03 c0 rjmp .+6 ; 0x6244 <gps_main+0xad4> |
623e: 90 95 com r25 |
6240: 81 95 neg r24 |
6242: 9f 4f sbci r25, 0xFF ; 255 |
6244: 8b 3f cpi r24, 0xFB ; 251 |
6246: 91 05 cpc r25, r1 |
6248: 0c f4 brge .+2 ; 0x624c <gps_main+0xadc> |
624a: 53 c0 rjmp .+166 ; 0x62f2 <gps_main+0xb82> |
624c: 80 91 be 08 lds r24, 0x08BE |
6250: 28 2f mov r18, r24 |
6252: 33 27 eor r19, r19 |
6254: 44 27 eor r20, r20 |
6256: 55 27 eor r21, r21 |
6258: 22 15 cp r18, r2 |
625a: 33 05 cpc r19, r3 |
625c: 44 05 cpc r20, r4 |
625e: 55 05 cpc r21, r5 |
6260: 44 f4 brge .+16 ; 0x6272 <gps_main+0xb02> |
6262: 20 93 20 09 sts 0x0920, r18 |
6266: 30 93 21 09 sts 0x0921, r19 |
626a: 40 93 22 09 sts 0x0922, r20 |
626e: 50 93 23 09 sts 0x0923, r21 |
6272: 2a 15 cp r18, r10 |
6274: 3b 05 cpc r19, r11 |
6276: 4c 05 cpc r20, r12 |
6278: 5d 05 cpc r21, r13 |
627a: 44 f4 brge .+16 ; 0x628c <gps_main+0xb1c> |
627c: 20 93 28 09 sts 0x0928, r18 |
6280: 30 93 29 09 sts 0x0929, r19 |
6284: 40 93 2a 09 sts 0x092A, r20 |
6288: 50 93 2b 09 sts 0x092B, r21 |
628c: 99 27 eor r25, r25 |
628e: 90 95 com r25 |
6290: 81 95 neg r24 |
6292: 9f 4f sbci r25, 0xFF ; 255 |
6294: 9c 01 movw r18, r24 |
6296: 44 27 eor r20, r20 |
6298: 37 fd sbrc r19, 7 |
629a: 40 95 com r20 |
629c: 54 2f mov r21, r20 |
629e: 80 91 20 09 lds r24, 0x0920 |
62a2: 90 91 21 09 lds r25, 0x0921 |
62a6: a0 91 22 09 lds r26, 0x0922 |
62aa: b0 91 23 09 lds r27, 0x0923 |
62ae: 82 17 cp r24, r18 |
62b0: 93 07 cpc r25, r19 |
62b2: a4 07 cpc r26, r20 |
62b4: b5 07 cpc r27, r21 |
62b6: 44 f4 brge .+16 ; 0x62c8 <gps_main+0xb58> |
62b8: 20 93 20 09 sts 0x0920, r18 |
62bc: 30 93 21 09 sts 0x0921, r19 |
62c0: 40 93 22 09 sts 0x0922, r20 |
62c4: 50 93 23 09 sts 0x0923, r21 |
62c8: 80 91 28 09 lds r24, 0x0928 |
62cc: 90 91 29 09 lds r25, 0x0929 |
62d0: a0 91 2a 09 lds r26, 0x092A |
62d4: b0 91 2b 09 lds r27, 0x092B |
62d8: 82 17 cp r24, r18 |
62da: 93 07 cpc r25, r19 |
62dc: a4 07 cpc r26, r20 |
62de: b5 07 cpc r27, r21 |
62e0: 44 f4 brge .+16 ; 0x62f2 <gps_main+0xb82> |
62e2: 20 93 28 09 sts 0x0928, r18 |
62e6: 30 93 29 09 sts 0x0929, r19 |
62ea: 40 93 2a 09 sts 0x092A, r20 |
62ee: 50 93 2b 09 sts 0x092B, r21 |
62f2: e0 90 20 09 lds r14, 0x0920 |
62f6: f0 90 21 09 lds r15, 0x0921 |
62fa: a9 85 ldd r26, Y+9 ; 0x09 |
62fc: ba 85 ldd r27, Y+10 ; 0x0a |
62fe: ea 1a sub r14, r26 |
6300: fb 0a sbc r15, r27 |
6302: f0 92 2d 09 sts 0x092D, r15 |
6306: e0 92 2c 09 sts 0x092C, r14 |
630a: 80 91 28 09 lds r24, 0x0928 |
630e: 90 91 29 09 lds r25, 0x0929 |
6312: 6d 81 ldd r22, Y+5 ; 0x05 |
6314: 7e 81 ldd r23, Y+6 ; 0x06 |
6316: 68 1b sub r22, r24 |
6318: 79 0b sbc r23, r25 |
631a: 70 93 2f 09 sts 0x092F, r23 |
631e: 60 93 2e 09 sts 0x092E, r22 |
6322: c0 90 b3 08 lds r12, 0x08B3 |
6326: d0 90 b4 08 lds r13, 0x08B4 |
632a: 88 27 eor r24, r24 |
632c: 77 fd sbrc r23, 7 |
632e: 80 95 com r24 |
6330: 98 2f mov r25, r24 |
6332: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
6336: 3b 01 movw r6, r22 |
6338: 4c 01 movw r8, r24 |
633a: a0 90 b3 08 lds r10, 0x08B3 |
633e: b0 90 b4 08 lds r11, 0x08B4 |
6342: 00 27 eor r16, r16 |
6344: f7 fc sbrc r15, 7 |
6346: 00 95 com r16 |
6348: 10 2f mov r17, r16 |
634a: c8 01 movw r24, r16 |
634c: b7 01 movw r22, r14 |
634e: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
6352: 1b 01 movw r2, r22 |
6354: 2c 01 movw r4, r24 |
6356: cc 0c add r12, r12 |
6358: dd 1c adc r13, r13 |
635a: ea e8 ldi r30, 0x8A ; 138 |
635c: f1 e0 ldi r31, 0x01 ; 1 |
635e: ce 0e add r12, r30 |
6360: df 1e adc r13, r31 |
6362: d6 01 movw r26, r12 |
6364: 6d 91 ld r22, X+ |
6366: 7c 91 ld r23, X |
6368: 70 95 com r23 |
636a: 61 95 neg r22 |
636c: 7f 4f sbci r23, 0xFF ; 255 |
636e: 88 27 eor r24, r24 |
6370: 77 fd sbrc r23, 7 |
6372: 80 95 com r24 |
6374: 98 2f mov r25, r24 |
6376: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
637a: 2f e6 ldi r18, 0x6F ; 111 |
637c: 32 e1 ldi r19, 0x12 ; 18 |
637e: 43 e8 ldi r20, 0x83 ; 131 |
6380: 5a e3 ldi r21, 0x3A ; 58 |
6382: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
6386: a4 01 movw r20, r8 |
6388: 93 01 movw r18, r6 |
638a: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
638e: 7b 01 movw r14, r22 |
6390: 8c 01 movw r16, r24 |
6392: aa 0c add r10, r10 |
6394: bb 1c adc r11, r11 |
6396: ea e5 ldi r30, 0x5A ; 90 |
6398: f4 e0 ldi r31, 0x04 ; 4 |
639a: ae 0e add r10, r30 |
639c: bf 1e adc r11, r31 |
639e: d5 01 movw r26, r10 |
63a0: 6d 91 ld r22, X+ |
63a2: 7c 91 ld r23, X |
63a4: 88 27 eor r24, r24 |
63a6: 77 fd sbrc r23, 7 |
63a8: 80 95 com r24 |
63aa: 98 2f mov r25, r24 |
63ac: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
63b0: 2f e6 ldi r18, 0x6F ; 111 |
63b2: 32 e1 ldi r19, 0x12 ; 18 |
63b4: 43 e8 ldi r20, 0x83 ; 131 |
63b6: 5a e3 ldi r21, 0x3A ; 58 |
63b8: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
63bc: a2 01 movw r20, r4 |
63be: 91 01 movw r18, r2 |
63c0: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
63c4: 9b 01 movw r18, r22 |
63c6: ac 01 movw r20, r24 |
63c8: c8 01 movw r24, r16 |
63ca: b7 01 movw r22, r14 |
63cc: 0e 94 11 3d call 0x7a22 ; 0x7a22 <__addsf3> |
63d0: 0e 94 99 3d call 0x7b32 ; 0x7b32 <__fixsfsi> |
63d4: 5b 01 movw r10, r22 |
63d6: 70 93 31 09 sts 0x0931, r23 |
63da: 60 93 30 09 sts 0x0930, r22 |
63de: e0 91 b3 08 lds r30, 0x08B3 |
63e2: f0 91 b4 08 lds r31, 0x08B4 |
63e6: 00 91 b3 08 lds r16, 0x08B3 |
63ea: 10 91 b4 08 lds r17, 0x08B4 |
63ee: ee 0f add r30, r30 |
63f0: ff 1f adc r31, r31 |
63f2: e6 5a subi r30, 0xA6 ; 166 |
63f4: fb 4f sbci r31, 0xFB ; 251 |
63f6: 60 81 ld r22, Z |
63f8: 71 81 ldd r23, Z+1 ; 0x01 |
63fa: 88 27 eor r24, r24 |
63fc: 77 fd sbrc r23, 7 |
63fe: 80 95 com r24 |
6400: 98 2f mov r25, r24 |
6402: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
6406: 2f e6 ldi r18, 0x6F ; 111 |
6408: 32 e1 ldi r19, 0x12 ; 18 |
640a: 43 e8 ldi r20, 0x83 ; 131 |
640c: 5a e3 ldi r21, 0x3A ; 58 |
640e: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
6412: a4 01 movw r20, r8 |
6414: 93 01 movw r18, r6 |
6416: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
641a: 6b 01 movw r12, r22 |
641c: 7c 01 movw r14, r24 |
641e: 00 0f add r16, r16 |
6420: 11 1f adc r17, r17 |
6422: 06 57 subi r16, 0x76 ; 118 |
6424: 1e 4f sbci r17, 0xFE ; 254 |
6426: f8 01 movw r30, r16 |
6428: 60 81 ld r22, Z |
642a: 71 81 ldd r23, Z+1 ; 0x01 |
642c: 88 27 eor r24, r24 |
642e: 77 fd sbrc r23, 7 |
6430: 80 95 com r24 |
6432: 98 2f mov r25, r24 |
6434: 0e 94 b6 3d call 0x7b6c ; 0x7b6c <__floatsisf> |
6438: 2f e6 ldi r18, 0x6F ; 111 |
643a: 32 e1 ldi r19, 0x12 ; 18 |
643c: 43 e8 ldi r20, 0x83 ; 131 |
643e: 5a e3 ldi r21, 0x3A ; 58 |
6440: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
6444: a2 01 movw r20, r4 |
6446: 91 01 movw r18, r2 |
6448: 0e 94 30 3e call 0x7c60 ; 0x7c60 <__mulsf3> |
644c: 9b 01 movw r18, r22 |
644e: ac 01 movw r20, r24 |
6450: c7 01 movw r24, r14 |
6452: b6 01 movw r22, r12 |
6454: 0e 94 11 3d call 0x7a22 ; 0x7a22 <__addsf3> |
6458: 0e 94 99 3d call 0x7b32 ; 0x7b32 <__fixsfsi> |
645c: 9b 01 movw r18, r22 |
645e: 70 93 33 09 sts 0x0933, r23 |
6462: 60 93 32 09 sts 0x0932, r22 |
6466: f4 e2 ldi r31, 0x24 ; 36 |
6468: af 16 cp r10, r31 |
646a: b1 04 cpc r11, r1 |
646c: 34 f0 brlt .+12 ; 0x647a <gps_main+0xd0a> |
646e: 83 e2 ldi r24, 0x23 ; 35 |
6470: 90 e0 ldi r25, 0x00 ; 0 |
6472: 90 93 31 09 sts 0x0931, r25 |
6476: 80 93 30 09 sts 0x0930, r24 |
647a: 24 32 cpi r18, 0x24 ; 36 |
647c: 31 05 cpc r19, r1 |
647e: 34 f0 brlt .+12 ; 0x648c <gps_main+0xd1c> |
6480: 83 e2 ldi r24, 0x23 ; 35 |
6482: 90 e0 ldi r25, 0x00 ; 0 |
6484: 90 93 33 09 sts 0x0933, r25 |
6488: 80 93 32 09 sts 0x0932, r24 |
648c: 80 91 30 09 lds r24, 0x0930 |
6490: 90 91 31 09 lds r25, 0x0931 |
6494: 8d 5d subi r24, 0xDD ; 221 |
6496: 9f 4f sbci r25, 0xFF ; 255 |
6498: 34 f4 brge .+12 ; 0x64a6 <gps_main+0xd36> |
649a: 8d ed ldi r24, 0xDD ; 221 |
649c: 9f ef ldi r25, 0xFF ; 255 |
649e: 90 93 31 09 sts 0x0931, r25 |
64a2: 80 93 30 09 sts 0x0930, r24 |
64a6: 80 91 32 09 lds r24, 0x0932 |
64aa: 90 91 33 09 lds r25, 0x0933 |
64ae: 8d 5d subi r24, 0xDD ; 221 |
64b0: 9f 4f sbci r25, 0xFF ; 255 |
64b2: 34 f4 brge .+12 ; 0x64c0 <gps_main+0xd50> |
64b4: 8d ed ldi r24, 0xDD ; 221 |
64b6: 9f ef ldi r25, 0xFF ; 255 |
64b8: 90 93 33 09 sts 0x0933, r25 |
64bc: 80 93 32 09 sts 0x0932, r24 |
64c0: 10 92 3e 09 sts 0x093E, r1 |
64c4: 0f c0 rjmp .+30 ; 0x64e4 <gps_main+0xd74> |
64c6: 20 91 35 09 lds r18, 0x0935 |
64ca: 30 91 36 09 lds r19, 0x0936 |
64ce: 40 91 37 09 lds r20, 0x0937 |
64d2: 50 91 38 09 lds r21, 0x0938 |
64d6: 21 15 cp r18, r1 |
64d8: 31 05 cpc r19, r1 |
64da: 41 05 cpc r20, r1 |
64dc: 51 05 cpc r21, r1 |
64de: 09 f0 breq .+2 ; 0x64e2 <gps_main+0xd72> |
64e0: 3b cd rjmp .-1418 ; 0x5f58 <gps_main+0x7e8> |
64e2: 92 cd rjmp .-1244 ; 0x6008 <gps_main+0x898> |
64e4: 6f 96 adiw r28, 0x1f ; 31 |
64e6: 0f b6 in r0, 0x3f ; 63 |
64e8: f8 94 cli |
64ea: de bf out 0x3e, r29 ; 62 |
64ec: 0f be out 0x3f, r0 ; 63 |
64ee: cd bf out 0x3d, r28 ; 61 |
64f0: df 91 pop r29 |
64f2: cf 91 pop r28 |
64f4: 1f 91 pop r17 |
64f6: 0f 91 pop r16 |
64f8: ff 90 pop r15 |
64fa: ef 90 pop r14 |
64fc: df 90 pop r13 |
64fe: cf 90 pop r12 |
6500: bf 90 pop r11 |
6502: af 90 pop r10 |
6504: 9f 90 pop r9 |
6506: 8f 90 pop r8 |
6508: 7f 90 pop r7 |
650a: 6f 90 pop r6 |
650c: 5f 90 pop r5 |
650e: 4f 90 pop r4 |
6510: 3f 90 pop r3 |
6512: 2f 90 pop r2 |
6514: 08 95 ret |
00006516 <__divdi3>: |
6516: a9 e9 ldi r26, 0x99 ; 153 |
6518: b0 e0 ldi r27, 0x00 ; 0 |
651a: e1 e9 ldi r30, 0x91 ; 145 |
651c: f2 e3 ldi r31, 0x32 ; 50 |
651e: 0c 94 fb 3e jmp 0x7df6 ; 0x7df6 <__prologue_saves__> |
6522: 22 2e mov r2, r18 |
6524: 33 2e mov r3, r19 |
6526: 44 2e mov r4, r20 |
6528: 55 2e mov r5, r21 |
652a: 66 2e mov r6, r22 |
652c: 77 2e mov r7, r23 |
652e: 88 2e mov r8, r24 |
6530: 99 2e mov r9, r25 |
6532: 2a 2d mov r18, r10 |
6534: a8 e0 ldi r26, 0x08 ; 8 |
6536: fe 01 movw r30, r28 |
6538: b1 96 adiw r30, 0x21 ; 33 |
653a: aa 2e mov r10, r26 |
653c: 11 92 st Z+, r1 |
653e: aa 94 dec r10 |
6540: e9 f7 brne .-6 ; 0x653c <__divdi3+0x26> |
6542: 29 a2 std Y+33, r2 ; 0x21 |
6544: 3a a2 std Y+34, r3 ; 0x22 |
6546: 4b a2 std Y+35, r4 ; 0x23 |
6548: 5c a2 std Y+36, r5 ; 0x24 |
654a: 6d a2 std Y+37, r6 ; 0x25 |
654c: 7e a2 std Y+38, r7 ; 0x26 |
654e: 8f a2 std Y+39, r8 ; 0x27 |
6550: 98 a6 std Y+40, r9 ; 0x28 |
6552: fe 01 movw r30, r28 |
6554: 31 96 adiw r30, 0x01 ; 1 |
6556: 11 92 st Z+, r1 |
6558: aa 95 dec r26 |
655a: e9 f7 brne .-6 ; 0x6556 <__divdi3+0x40> |
655c: 29 83 std Y+1, r18 ; 0x01 |
655e: ba 82 std Y+2, r11 ; 0x02 |
6560: cb 82 std Y+3, r12 ; 0x03 |
6562: dc 82 std Y+4, r13 ; 0x04 |
6564: ed 82 std Y+5, r14 ; 0x05 |
6566: fe 82 std Y+6, r15 ; 0x06 |
6568: 0f 83 std Y+7, r16 ; 0x07 |
656a: 18 87 std Y+8, r17 ; 0x08 |
656c: 8d a1 ldd r24, Y+37 ; 0x25 |
656e: 9e a1 ldd r25, Y+38 ; 0x26 |
6570: af a1 ldd r26, Y+39 ; 0x27 |
6572: b8 a5 ldd r27, Y+40 ; 0x28 |
6574: b7 fd sbrc r27, 7 |
6576: ed c4 rjmp .+2522 ; 0x6f52 <__divdi3+0xa3c> |
6578: cf 57 subi r28, 0x7F ; 127 |
657a: df 4f sbci r29, 0xFF ; 255 |
657c: 18 82 st Y, r1 |
657e: c1 58 subi r28, 0x81 ; 129 |
6580: d0 40 sbci r29, 0x00 ; 0 |
6582: 8d 81 ldd r24, Y+5 ; 0x05 |
6584: 9e 81 ldd r25, Y+6 ; 0x06 |
6586: af 81 ldd r26, Y+7 ; 0x07 |
6588: b8 85 ldd r27, Y+8 ; 0x08 |
658a: b7 fd sbrc r27, 7 |
658c: 14 c4 rjmp .+2088 ; 0x6db6 <__divdi3+0x8a0> |
658e: a9 80 ldd r10, Y+1 ; 0x01 |
6590: ba 80 ldd r11, Y+2 ; 0x02 |
6592: cb 80 ldd r12, Y+3 ; 0x03 |
6594: dc 80 ldd r13, Y+4 ; 0x04 |
6596: ed 80 ldd r14, Y+5 ; 0x05 |
6598: fe 80 ldd r15, Y+6 ; 0x06 |
659a: 0f 81 ldd r16, Y+7 ; 0x07 |
659c: 18 85 ldd r17, Y+8 ; 0x08 |
659e: 29 a1 ldd r18, Y+33 ; 0x21 |
65a0: 3a a1 ldd r19, Y+34 ; 0x22 |
65a2: 4b a1 ldd r20, Y+35 ; 0x23 |
65a4: 5c a1 ldd r21, Y+36 ; 0x24 |
65a6: 6d a1 ldd r22, Y+37 ; 0x25 |
65a8: 7e a1 ldd r23, Y+38 ; 0x26 |
65aa: 8f a1 ldd r24, Y+39 ; 0x27 |
65ac: 98 a5 ldd r25, Y+40 ; 0x28 |
65ae: a8 e0 ldi r26, 0x08 ; 8 |
65b0: fe 01 movw r30, r28 |
65b2: 39 96 adiw r30, 0x09 ; 9 |
65b4: ba 2f mov r27, r26 |
65b6: 11 92 st Z+, r1 |
65b8: ba 95 dec r27 |
65ba: e9 f7 brne .-6 ; 0x65b6 <__divdi3+0xa0> |
65bc: 29 87 std Y+9, r18 ; 0x09 |
65be: 3a 87 std Y+10, r19 ; 0x0a |
65c0: 4b 87 std Y+11, r20 ; 0x0b |
65c2: 5c 87 std Y+12, r21 ; 0x0c |
65c4: 6d 87 std Y+13, r22 ; 0x0d |
65c6: 7e 87 std Y+14, r23 ; 0x0e |
65c8: 8f 87 std Y+15, r24 ; 0x0f |
65ca: 98 8b std Y+16, r25 ; 0x10 |
65cc: fe 01 movw r30, r28 |
65ce: 71 96 adiw r30, 0x11 ; 17 |
65d0: 11 92 st Z+, r1 |
65d2: aa 95 dec r26 |
65d4: e9 f7 brne .-6 ; 0x65d0 <__divdi3+0xba> |
65d6: a9 8a std Y+17, r10 ; 0x11 |
65d8: ba 8a std Y+18, r11 ; 0x12 |
65da: cb 8a std Y+19, r12 ; 0x13 |
65dc: dc 8a std Y+20, r13 ; 0x14 |
65de: ed 8a std Y+21, r14 ; 0x15 |
65e0: fe 8a std Y+22, r15 ; 0x16 |
65e2: 0f 8b std Y+23, r16 ; 0x17 |
65e4: 18 8f std Y+24, r17 ; 0x18 |
65e6: 29 88 ldd r2, Y+17 ; 0x11 |
65e8: 3a 88 ldd r3, Y+18 ; 0x12 |
65ea: 4b 88 ldd r4, Y+19 ; 0x13 |
65ec: 5c 88 ldd r5, Y+20 ; 0x14 |
65ee: ed 88 ldd r14, Y+21 ; 0x15 |
65f0: fe 88 ldd r15, Y+22 ; 0x16 |
65f2: 0f 89 ldd r16, Y+23 ; 0x17 |
65f4: 18 8d ldd r17, Y+24 ; 0x18 |
65f6: 69 84 ldd r6, Y+9 ; 0x09 |
65f8: 7a 84 ldd r7, Y+10 ; 0x0a |
65fa: 8b 84 ldd r8, Y+11 ; 0x0b |
65fc: 9c 84 ldd r9, Y+12 ; 0x0c |
65fe: 29 96 adiw r28, 0x09 ; 9 |
6600: 6c ae std Y+60, r6 ; 0x3c |
6602: 7d ae std Y+61, r7 ; 0x3d |
6604: 8e ae std Y+62, r8 ; 0x3e |
6606: 9f ae std Y+63, r9 ; 0x3f |
6608: 29 97 sbiw r28, 0x09 ; 9 |
660a: 8d 84 ldd r8, Y+13 ; 0x0d |
660c: 9e 84 ldd r9, Y+14 ; 0x0e |
660e: af 84 ldd r10, Y+15 ; 0x0f |
6610: b8 88 ldd r11, Y+16 ; 0x10 |
6612: 2d 96 adiw r28, 0x0d ; 13 |
6614: 8c ae std Y+60, r8 ; 0x3c |
6616: 9d ae std Y+61, r9 ; 0x3d |
6618: ae ae std Y+62, r10 ; 0x3e |
661a: bf ae std Y+63, r11 ; 0x3f |
661c: 2d 97 sbiw r28, 0x0d ; 13 |
661e: e1 14 cp r14, r1 |
6620: f1 04 cpc r15, r1 |
6622: 01 05 cpc r16, r1 |
6624: 11 05 cpc r17, r1 |
6626: 09 f0 breq .+2 ; 0x662a <__divdi3+0x114> |
6628: 2b c1 rjmp .+598 ; 0x6880 <__divdi3+0x36a> |
662a: 82 14 cp r8, r2 |
662c: 93 04 cpc r9, r3 |
662e: a4 04 cpc r10, r4 |
6630: b5 04 cpc r11, r5 |
6632: 08 f4 brcc .+2 ; 0x6636 <__divdi3+0x120> |
6634: 22 c2 rjmp .+1092 ; 0x6a7a <__divdi3+0x564> |
6636: 21 14 cp r2, r1 |
6638: 31 04 cpc r3, r1 |
663a: 41 04 cpc r4, r1 |
663c: 51 04 cpc r5, r1 |
663e: 09 f4 brne .+2 ; 0x6642 <__divdi3+0x12c> |
6640: 67 c5 rjmp .+2766 ; 0x7110 <__divdi3+0xbfa> |
6642: 00 e0 ldi r16, 0x00 ; 0 |
6644: 20 16 cp r2, r16 |
6646: 00 e0 ldi r16, 0x00 ; 0 |
6648: 30 06 cpc r3, r16 |
664a: 01 e0 ldi r16, 0x01 ; 1 |
664c: 40 06 cpc r4, r16 |
664e: 00 e0 ldi r16, 0x00 ; 0 |
6650: 50 06 cpc r5, r16 |
6652: 08 f0 brcs .+2 ; 0x6656 <__divdi3+0x140> |
6654: 4c c5 rjmp .+2712 ; 0x70ee <__divdi3+0xbd8> |
6656: 1f ef ldi r17, 0xFF ; 255 |
6658: 21 16 cp r2, r17 |
665a: 31 04 cpc r3, r1 |
665c: 41 04 cpc r4, r1 |
665e: 51 04 cpc r5, r1 |
6660: 19 f0 breq .+6 ; 0x6668 <__divdi3+0x152> |
6662: 10 f0 brcs .+4 ; 0x6668 <__divdi3+0x152> |
6664: 0c 94 72 3c jmp 0x78e4 ; 0x78e4 <__divdi3+0x13ce> |
6668: 20 e0 ldi r18, 0x00 ; 0 |
666a: 30 e0 ldi r19, 0x00 ; 0 |
666c: 40 e0 ldi r20, 0x00 ; 0 |
666e: 50 e0 ldi r21, 0x00 ; 0 |
6670: 80 e0 ldi r24, 0x00 ; 0 |
6672: 90 e0 ldi r25, 0x00 ; 0 |
6674: 42 01 movw r8, r4 |
6676: 31 01 movw r6, r2 |
6678: 04 c0 rjmp .+8 ; 0x6682 <__divdi3+0x16c> |
667a: 96 94 lsr r9 |
667c: 87 94 ror r8 |
667e: 77 94 ror r7 |
6680: 67 94 ror r6 |
6682: 8a 95 dec r24 |
6684: d2 f7 brpl .-12 ; 0x667a <__divdi3+0x164> |
6686: d4 01 movw r26, r8 |
6688: c3 01 movw r24, r6 |
668a: 86 5d subi r24, 0xD6 ; 214 |
668c: 98 4f sbci r25, 0xF8 ; 248 |
668e: dc 01 movw r26, r24 |
6690: 8c 91 ld r24, X |
6692: 28 0f add r18, r24 |
6694: 31 1d adc r19, r1 |
6696: 41 1d adc r20, r1 |
6698: 51 1d adc r21, r1 |
669a: da 01 movw r26, r20 |
669c: c9 01 movw r24, r18 |
669e: 20 e2 ldi r18, 0x20 ; 32 |
66a0: 30 e0 ldi r19, 0x00 ; 0 |
66a2: 40 e0 ldi r20, 0x00 ; 0 |
66a4: 50 e0 ldi r21, 0x00 ; 0 |
66a6: 39 01 movw r6, r18 |
66a8: 4a 01 movw r8, r20 |
66aa: 68 1a sub r6, r24 |
66ac: 79 0a sbc r7, r25 |
66ae: 8a 0a sbc r8, r26 |
66b0: 9b 0a sbc r9, r27 |
66b2: 09 f0 breq .+2 ; 0x66b6 <__divdi3+0x1a0> |
66b4: 90 c7 rjmp .+3872 ; 0x75d6 <__divdi3+0x10c0> |
66b6: 2d 96 adiw r28, 0x0d ; 13 |
66b8: ac ac ldd r10, Y+60 ; 0x3c |
66ba: bd ac ldd r11, Y+61 ; 0x3d |
66bc: ce ac ldd r12, Y+62 ; 0x3e |
66be: df ac ldd r13, Y+63 ; 0x3f |
66c0: 2d 97 sbiw r28, 0x0d ; 13 |
66c2: a2 18 sub r10, r2 |
66c4: b3 08 sbc r11, r3 |
66c6: c4 08 sbc r12, r4 |
66c8: d5 08 sbc r13, r5 |
66ca: 72 01 movw r14, r4 |
66cc: 00 27 eor r16, r16 |
66ce: 11 27 eor r17, r17 |
66d0: a1 96 adiw r28, 0x21 ; 33 |
66d2: ec ae std Y+60, r14 ; 0x3c |
66d4: fd ae std Y+61, r15 ; 0x3d |
66d6: 0e af std Y+62, r16 ; 0x3e |
66d8: 1f af std Y+63, r17 ; 0x3f |
66da: a1 97 sbiw r28, 0x21 ; 33 |
66dc: 92 01 movw r18, r4 |
66de: 81 01 movw r16, r2 |
66e0: 20 70 andi r18, 0x00 ; 0 |
66e2: 30 70 andi r19, 0x00 ; 0 |
66e4: a5 96 adiw r28, 0x25 ; 37 |
66e6: 0c af std Y+60, r16 ; 0x3c |
66e8: 1d af std Y+61, r17 ; 0x3d |
66ea: 2e af std Y+62, r18 ; 0x3e |
66ec: 3f af std Y+63, r19 ; 0x3f |
66ee: a5 97 sbiw r28, 0x25 ; 37 |
66f0: 21 e0 ldi r18, 0x01 ; 1 |
66f2: 30 e0 ldi r19, 0x00 ; 0 |
66f4: 40 e0 ldi r20, 0x00 ; 0 |
66f6: 50 e0 ldi r21, 0x00 ; 0 |
66f8: 65 96 adiw r28, 0x15 ; 21 |
66fa: 2c af std Y+60, r18 ; 0x3c |
66fc: 3d af std Y+61, r19 ; 0x3d |
66fe: 4e af std Y+62, r20 ; 0x3e |
6700: 5f af std Y+63, r21 ; 0x3f |
6702: 65 97 sbiw r28, 0x15 ; 21 |
6704: c6 01 movw r24, r12 |
6706: b5 01 movw r22, r10 |
6708: a1 96 adiw r28, 0x21 ; 33 |
670a: 2c ad ldd r18, Y+60 ; 0x3c |
670c: 3d ad ldd r19, Y+61 ; 0x3d |
670e: 4e ad ldd r20, Y+62 ; 0x3e |
6710: 5f ad ldd r21, Y+63 ; 0x3f |
6712: a1 97 sbiw r28, 0x21 ; 33 |
6714: 0e 94 be 3e call 0x7d7c ; 0x7d7c <__udivmodsi4> |
6718: e1 96 adiw r28, 0x31 ; 49 |
671a: 2c af std Y+60, r18 ; 0x3c |
671c: 3d af std Y+61, r19 ; 0x3d |
671e: 4e af std Y+62, r20 ; 0x3e |
6720: 5f af std Y+63, r21 ; 0x3f |
6722: e1 97 sbiw r28, 0x31 ; 49 |
6724: a5 96 adiw r28, 0x25 ; 37 |
6726: 6c ad ldd r22, Y+60 ; 0x3c |
6728: 7d ad ldd r23, Y+61 ; 0x3d |
672a: 8e ad ldd r24, Y+62 ; 0x3e |
672c: 9f ad ldd r25, Y+63 ; 0x3f |
672e: a5 97 sbiw r28, 0x25 ; 37 |
6730: 0e 94 78 3e call 0x7cf0 ; 0x7cf0 <__mulsi3> |
6734: 3b 01 movw r6, r22 |
6736: 4c 01 movw r8, r24 |
6738: c6 01 movw r24, r12 |
673a: b5 01 movw r22, r10 |
673c: a1 96 adiw r28, 0x21 ; 33 |
673e: 2c ad ldd r18, Y+60 ; 0x3c |
6740: 3d ad ldd r19, Y+61 ; 0x3d |
6742: 4e ad ldd r20, Y+62 ; 0x3e |
6744: 5f ad ldd r21, Y+63 ; 0x3f |
6746: a1 97 sbiw r28, 0x21 ; 33 |
6748: 0e 94 be 3e call 0x7d7c ; 0x7d7c <__udivmodsi4> |
674c: cb 01 movw r24, r22 |
674e: 77 27 eor r23, r23 |
6750: 66 27 eor r22, r22 |
6752: 29 96 adiw r28, 0x09 ; 9 |
6754: ac ac ldd r10, Y+60 ; 0x3c |
6756: bd ac ldd r11, Y+61 ; 0x3d |
6758: ce ac ldd r12, Y+62 ; 0x3e |
675a: df ac ldd r13, Y+63 ; 0x3f |
675c: 29 97 sbiw r28, 0x09 ; 9 |
675e: 96 01 movw r18, r12 |
6760: 44 27 eor r20, r20 |
6762: 55 27 eor r21, r21 |
6764: 7b 01 movw r14, r22 |
6766: 8c 01 movw r16, r24 |
6768: e2 2a or r14, r18 |
676a: f3 2a or r15, r19 |
676c: 04 2b or r16, r20 |
676e: 15 2b or r17, r21 |
6770: e6 14 cp r14, r6 |
6772: f7 04 cpc r15, r7 |
6774: 08 05 cpc r16, r8 |
6776: 19 05 cpc r17, r9 |
6778: 00 f5 brcc .+64 ; 0x67ba <__divdi3+0x2a4> |
677a: e1 96 adiw r28, 0x31 ; 49 |
677c: 2c ad ldd r18, Y+60 ; 0x3c |
677e: 3d ad ldd r19, Y+61 ; 0x3d |
6780: 4e ad ldd r20, Y+62 ; 0x3e |
6782: 5f ad ldd r21, Y+63 ; 0x3f |
6784: e1 97 sbiw r28, 0x31 ; 49 |
6786: 21 50 subi r18, 0x01 ; 1 |
6788: 30 40 sbci r19, 0x00 ; 0 |
678a: 40 40 sbci r20, 0x00 ; 0 |
678c: 50 40 sbci r21, 0x00 ; 0 |
678e: e1 96 adiw r28, 0x31 ; 49 |
6790: 2c af std Y+60, r18 ; 0x3c |
6792: 3d af std Y+61, r19 ; 0x3d |
6794: 4e af std Y+62, r20 ; 0x3e |
6796: 5f af std Y+63, r21 ; 0x3f |
6798: e1 97 sbiw r28, 0x31 ; 49 |
679a: e2 0c add r14, r2 |
679c: f3 1c adc r15, r3 |
679e: 04 1d adc r16, r4 |
67a0: 15 1d adc r17, r5 |
67a2: e2 14 cp r14, r2 |
67a4: f3 04 cpc r15, r3 |
67a6: 04 05 cpc r16, r4 |
67a8: 15 05 cpc r17, r5 |
67aa: 38 f0 brcs .+14 ; 0x67ba <__divdi3+0x2a4> |
67ac: e6 14 cp r14, r6 |
67ae: f7 04 cpc r15, r7 |
67b0: 08 05 cpc r16, r8 |
67b2: 19 05 cpc r17, r9 |
67b4: 10 f4 brcc .+4 ; 0x67ba <__divdi3+0x2a4> |
67b6: 0c 94 e6 3c jmp 0x79cc ; 0x79cc <__divdi3+0x14b6> |
67ba: e6 18 sub r14, r6 |
67bc: f7 08 sbc r15, r7 |
67be: 08 09 sbc r16, r8 |
67c0: 19 09 sbc r17, r9 |
67c2: c8 01 movw r24, r16 |
67c4: b7 01 movw r22, r14 |
67c6: a1 96 adiw r28, 0x21 ; 33 |
67c8: 2c ad ldd r18, Y+60 ; 0x3c |
67ca: 3d ad ldd r19, Y+61 ; 0x3d |
67cc: 4e ad ldd r20, Y+62 ; 0x3e |
67ce: 5f ad ldd r21, Y+63 ; 0x3f |
67d0: a1 97 sbiw r28, 0x21 ; 33 |
67d2: 0e 94 be 3e call 0x7d7c ; 0x7d7c <__udivmodsi4> |
67d6: 59 01 movw r10, r18 |
67d8: 6a 01 movw r12, r20 |
67da: a5 96 adiw r28, 0x25 ; 37 |
67dc: 6c ad ldd r22, Y+60 ; 0x3c |
67de: 7d ad ldd r23, Y+61 ; 0x3d |
67e0: 8e ad ldd r24, Y+62 ; 0x3e |
67e2: 9f ad ldd r25, Y+63 ; 0x3f |
67e4: a5 97 sbiw r28, 0x25 ; 37 |
67e6: 0e 94 78 3e call 0x7cf0 ; 0x7cf0 <__mulsi3> |
67ea: 3b 01 movw r6, r22 |
67ec: 4c 01 movw r8, r24 |
67ee: c8 01 movw r24, r16 |
67f0: b7 01 movw r22, r14 |
67f2: a1 96 adiw r28, 0x21 ; 33 |
67f4: 2c ad ldd r18, Y+60 ; 0x3c |
67f6: 3d ad ldd r19, Y+61 ; 0x3d |
67f8: 4e ad ldd r20, Y+62 ; 0x3e |
67fa: 5f ad ldd r21, Y+63 ; 0x3f |
67fc: a1 97 sbiw r28, 0x21 ; 33 |
67fe: 0e 94 be 3e call 0x7d7c ; 0x7d7c <__udivmodsi4> |
6802: cb 01 movw r24, r22 |
6804: 77 27 eor r23, r23 |
6806: 66 27 eor r22, r22 |
6808: 29 96 adiw r28, 0x09 ; 9 |
680a: 2c ad ldd r18, Y+60 ; 0x3c |
680c: 3d ad ldd r19, Y+61 ; 0x3d |
680e: 4e ad ldd r20, Y+62 ; 0x3e |
6810: 5f ad ldd r21, Y+63 ; 0x3f |
6812: 29 97 sbiw r28, 0x09 ; 9 |
6814: 40 70 andi r20, 0x00 ; 0 |
6816: 50 70 andi r21, 0x00 ; 0 |
6818: 26 2b or r18, r22 |
681a: 37 2b or r19, r23 |
681c: 48 2b or r20, r24 |
681e: 59 2b or r21, r25 |
6820: 26 15 cp r18, r6 |
6822: 37 05 cpc r19, r7 |
6824: 48 05 cpc r20, r8 |
6826: 59 05 cpc r21, r9 |
6828: a8 f4 brcc .+42 ; 0x6854 <__divdi3+0x33e> |
682a: 08 94 sec |
682c: a1 08 sbc r10, r1 |
682e: b1 08 sbc r11, r1 |
6830: c1 08 sbc r12, r1 |
6832: d1 08 sbc r13, r1 |
6834: 22 0d add r18, r2 |
6836: 33 1d adc r19, r3 |
6838: 44 1d adc r20, r4 |
683a: 55 1d adc r21, r5 |
683c: 22 15 cp r18, r2 |
683e: 33 05 cpc r19, r3 |
6840: 44 05 cpc r20, r4 |
6842: 55 05 cpc r21, r5 |
6844: 38 f0 brcs .+14 ; 0x6854 <__divdi3+0x33e> |
6846: 26 15 cp r18, r6 |
6848: 37 05 cpc r19, r7 |
684a: 48 05 cpc r20, r8 |
684c: 59 05 cpc r21, r9 |
684e: 10 f4 brcc .+4 ; 0x6854 <__divdi3+0x33e> |
6850: 0c 94 ca 3c jmp 0x7994 ; 0x7994 <__divdi3+0x147e> |
6854: e1 96 adiw r28, 0x31 ; 49 |
6856: 6c ac ldd r6, Y+60 ; 0x3c |
6858: 7d ac ldd r7, Y+61 ; 0x3d |
685a: 8e ac ldd r8, Y+62 ; 0x3e |
685c: 9f ac ldd r9, Y+63 ; 0x3f |
685e: e1 97 sbiw r28, 0x31 ; 49 |
6860: d3 01 movw r26, r6 |
6862: 99 27 eor r25, r25 |
6864: 88 27 eor r24, r24 |
6866: 15 01 movw r2, r10 |
6868: 26 01 movw r4, r12 |
686a: 28 2a or r2, r24 |
686c: 39 2a or r3, r25 |
686e: 4a 2a or r4, r26 |
6870: 5b 2a or r5, r27 |
6872: 65 96 adiw r28, 0x15 ; 21 |
6874: 2c ad ldd r18, Y+60 ; 0x3c |
6876: 3d ad ldd r19, Y+61 ; 0x3d |
6878: 4e ad ldd r20, Y+62 ; 0x3e |
687a: 5f ad ldd r21, Y+63 ; 0x3f |
687c: 65 97 sbiw r28, 0x15 ; 21 |
687e: 13 c0 rjmp .+38 ; 0x68a6 <__divdi3+0x390> |
6880: 2d 96 adiw r28, 0x0d ; 13 |
6882: 8c ac ldd r8, Y+60 ; 0x3c |
6884: 9d ac ldd r9, Y+61 ; 0x3d |
6886: ae ac ldd r10, Y+62 ; 0x3e |
6888: bf ac ldd r11, Y+63 ; 0x3f |
688a: 2d 97 sbiw r28, 0x0d ; 13 |
688c: 8e 14 cp r8, r14 |
688e: 9f 04 cpc r9, r15 |
6890: a0 06 cpc r10, r16 |
6892: b1 06 cpc r11, r17 |
6894: 08 f0 brcs .+2 ; 0x6898 <__divdi3+0x382> |
6896: 32 c2 rjmp .+1124 ; 0x6cfc <__divdi3+0x7e6> |
6898: 22 24 eor r2, r2 |
689a: 33 24 eor r3, r3 |
689c: 21 01 movw r4, r2 |
689e: 20 e0 ldi r18, 0x00 ; 0 |
68a0: 30 e0 ldi r19, 0x00 ; 0 |
68a2: 40 e0 ldi r20, 0x00 ; 0 |
68a4: 50 e0 ldi r21, 0x00 ; 0 |
68a6: 88 e0 ldi r24, 0x08 ; 8 |
68a8: fe 01 movw r30, r28 |
68aa: 79 96 adiw r30, 0x19 ; 25 |
68ac: 11 92 st Z+, r1 |
68ae: 8a 95 dec r24 |
68b0: e9 f7 brne .-6 ; 0x68ac <__divdi3+0x396> |
68b2: 29 8e std Y+25, r2 ; 0x19 |
68b4: 3a 8e std Y+26, r3 ; 0x1a |
68b6: 4b 8e std Y+27, r4 ; 0x1b |
68b8: 5c 8e std Y+28, r5 ; 0x1c |
68ba: 2d 8f std Y+29, r18 ; 0x1d |
68bc: 3e 8f std Y+30, r19 ; 0x1e |
68be: 4f 8f std Y+31, r20 ; 0x1f |
68c0: 58 a3 std Y+32, r21 ; 0x20 |
68c2: 29 8c ldd r2, Y+25 ; 0x19 |
68c4: 3a 8c ldd r3, Y+26 ; 0x1a |
68c6: 4b 8c ldd r4, Y+27 ; 0x1b |
68c8: 5c 8c ldd r5, Y+28 ; 0x1c |
68ca: 6d 8c ldd r6, Y+29 ; 0x1d |
68cc: 7e 8c ldd r7, Y+30 ; 0x1e |
68ce: 8f 8c ldd r8, Y+31 ; 0x1f |
68d0: 98 a0 ldd r9, Y+32 ; 0x20 |
68d2: cf 57 subi r28, 0x7F ; 127 |
68d4: df 4f sbci r29, 0xFF ; 255 |
68d6: b8 80 ld r11, Y |
68d8: c1 58 subi r28, 0x81 ; 129 |
68da: d0 40 sbci r29, 0x00 ; 0 |
68dc: bb 20 and r11, r11 |
68de: 11 f4 brne .+4 ; 0x68e4 <__divdi3+0x3ce> |
68e0: 0c 94 f6 3c jmp 0x79ec ; 0x79ec <__divdi3+0x14d6> |
68e4: ce 56 subi r28, 0x6E ; 110 |
68e6: df 4f sbci r29, 0xFF ; 255 |
68e8: 18 82 st Y, r1 |
68ea: c2 59 subi r28, 0x92 ; 146 |
68ec: d0 40 sbci r29, 0x00 ; 0 |
68ee: cd 56 subi r28, 0x6D ; 109 |
68f0: df 4f sbci r29, 0xFF ; 255 |
68f2: 18 82 st Y, r1 |
68f4: c3 59 subi r28, 0x93 ; 147 |
68f6: d0 40 sbci r29, 0x00 ; 0 |
68f8: cc 56 subi r28, 0x6C ; 108 |
68fa: df 4f sbci r29, 0xFF ; 255 |
68fc: 18 82 st Y, r1 |
68fe: c4 59 subi r28, 0x94 ; 148 |
6900: d0 40 sbci r29, 0x00 ; 0 |
6902: cb 56 subi r28, 0x6B ; 107 |
6904: df 4f sbci r29, 0xFF ; 255 |
6906: 18 82 st Y, r1 |
6908: c5 59 subi r28, 0x95 ; 149 |
690a: d0 40 sbci r29, 0x00 ; 0 |
690c: ca 56 subi r28, 0x6A ; 106 |
690e: df 4f sbci r29, 0xFF ; 255 |
6910: 18 82 st Y, r1 |
6912: c6 59 subi r28, 0x96 ; 150 |
6914: d0 40 sbci r29, 0x00 ; 0 |
6916: c9 56 subi r28, 0x69 ; 105 |
6918: df 4f sbci r29, 0xFF ; 255 |
691a: 18 82 st Y, r1 |
691c: c7 59 subi r28, 0x97 ; 151 |
691e: d0 40 sbci r29, 0x00 ; 0 |
6920: c8 56 subi r28, 0x68 ; 104 |
6922: df 4f sbci r29, 0xFF ; 255 |
6924: 18 82 st Y, r1 |
6926: c8 59 subi r28, 0x98 ; 152 |
6928: d0 40 sbci r29, 0x00 ; 0 |
692a: c7 56 subi r28, 0x67 ; 103 |
692c: df 4f sbci r29, 0xFF ; 255 |
692e: 18 82 st Y, r1 |
6930: c9 59 subi r28, 0x99 ; 153 |
6932: d0 40 sbci r29, 0x00 ; 0 |
6934: 00 e0 ldi r16, 0x00 ; 0 |
6936: 02 19 sub r16, r2 |
6938: 81 e0 ldi r24, 0x01 ; 1 |
693a: cc 24 eor r12, r12 |
693c: c0 16 cp r12, r16 |
693e: 08 f0 brcs .+2 ; 0x6942 <__divdi3+0x42c> |
6940: 80 e0 ldi r24, 0x00 ; 0 |
6942: cd 56 subi r28, 0x6D ; 109 |
6944: df 4f sbci r29, 0xFF ; 255 |
6946: 18 81 ld r17, Y |
6948: c3 59 subi r28, 0x93 ; 147 |
694a: d0 40 sbci r29, 0x00 ; 0 |
694c: 13 19 sub r17, r3 |
694e: 91 e0 ldi r25, 0x01 ; 1 |
6950: cd 56 subi r28, 0x6D ; 109 |
6952: df 4f sbci r29, 0xFF ; 255 |
6954: d8 80 ld r13, Y |
6956: c3 59 subi r28, 0x93 ; 147 |
6958: d0 40 sbci r29, 0x00 ; 0 |
695a: d1 16 cp r13, r17 |
695c: 08 f0 brcs .+2 ; 0x6960 <__divdi3+0x44a> |
695e: 90 e0 ldi r25, 0x00 ; 0 |
6960: e1 2e mov r14, r17 |
6962: e8 1a sub r14, r24 |
6964: 8e 2d mov r24, r14 |
6966: e1 e0 ldi r30, 0x01 ; 1 |
6968: 1e 15 cp r17, r14 |
696a: 08 f0 brcs .+2 ; 0x696e <__divdi3+0x458> |
696c: e0 e0 ldi r30, 0x00 ; 0 |
696e: 9e 2b or r25, r30 |
6970: 18 2f mov r17, r24 |
6972: cc 56 subi r28, 0x6C ; 108 |
6974: df 4f sbci r29, 0xFF ; 255 |
6976: 28 81 ld r18, Y |
6978: c4 59 subi r28, 0x94 ; 148 |
697a: d0 40 sbci r29, 0x00 ; 0 |
697c: 24 19 sub r18, r4 |
697e: e1 e0 ldi r30, 0x01 ; 1 |
6980: cc 56 subi r28, 0x6C ; 108 |
6982: df 4f sbci r29, 0xFF ; 255 |
6984: f8 80 ld r15, Y |
6986: c4 59 subi r28, 0x94 ; 148 |
6988: d0 40 sbci r29, 0x00 ; 0 |
698a: f2 16 cp r15, r18 |
698c: 08 f0 brcs .+2 ; 0x6990 <__divdi3+0x47a> |
698e: e0 e0 ldi r30, 0x00 ; 0 |
6990: 82 2f mov r24, r18 |
6992: 89 1b sub r24, r25 |
6994: 91 e0 ldi r25, 0x01 ; 1 |
6996: 28 17 cp r18, r24 |
6998: 08 f0 brcs .+2 ; 0x699c <__divdi3+0x486> |
699a: 90 e0 ldi r25, 0x00 ; 0 |
699c: e9 2b or r30, r25 |
699e: 28 2f mov r18, r24 |
69a0: cb 56 subi r28, 0x6B ; 107 |
69a2: df 4f sbci r29, 0xFF ; 255 |
69a4: 38 81 ld r19, Y |
69a6: c5 59 subi r28, 0x95 ; 149 |
69a8: d0 40 sbci r29, 0x00 ; 0 |
69aa: 35 19 sub r19, r5 |
69ac: 91 e0 ldi r25, 0x01 ; 1 |
69ae: cb 56 subi r28, 0x6B ; 107 |
69b0: df 4f sbci r29, 0xFF ; 255 |
69b2: 88 81 ld r24, Y |
69b4: c5 59 subi r28, 0x95 ; 149 |
69b6: d0 40 sbci r29, 0x00 ; 0 |
69b8: 83 17 cp r24, r19 |
69ba: 08 f0 brcs .+2 ; 0x69be <__divdi3+0x4a8> |
69bc: 90 e0 ldi r25, 0x00 ; 0 |
69be: 83 2f mov r24, r19 |
69c0: 8e 1b sub r24, r30 |
69c2: e1 e0 ldi r30, 0x01 ; 1 |
69c4: 38 17 cp r19, r24 |
69c6: 08 f0 brcs .+2 ; 0x69ca <__divdi3+0x4b4> |
69c8: e0 e0 ldi r30, 0x00 ; 0 |
69ca: 9e 2b or r25, r30 |
69cc: 38 2f mov r19, r24 |
69ce: ca 56 subi r28, 0x6A ; 106 |
69d0: df 4f sbci r29, 0xFF ; 255 |
69d2: 48 81 ld r20, Y |
69d4: c6 59 subi r28, 0x96 ; 150 |
69d6: d0 40 sbci r29, 0x00 ; 0 |
69d8: 46 19 sub r20, r6 |
69da: e1 e0 ldi r30, 0x01 ; 1 |
69dc: ca 56 subi r28, 0x6A ; 106 |
69de: df 4f sbci r29, 0xFF ; 255 |
69e0: a8 81 ld r26, Y |
69e2: c6 59 subi r28, 0x96 ; 150 |
69e4: d0 40 sbci r29, 0x00 ; 0 |
69e6: a4 17 cp r26, r20 |
69e8: 08 f0 brcs .+2 ; 0x69ec <__divdi3+0x4d6> |
69ea: e0 e0 ldi r30, 0x00 ; 0 |
69ec: 84 2f mov r24, r20 |
69ee: 89 1b sub r24, r25 |
69f0: 91 e0 ldi r25, 0x01 ; 1 |
69f2: 48 17 cp r20, r24 |
69f4: 08 f0 brcs .+2 ; 0x69f8 <__divdi3+0x4e2> |
69f6: 90 e0 ldi r25, 0x00 ; 0 |
69f8: e9 2b or r30, r25 |
69fa: 48 2f mov r20, r24 |
69fc: c9 56 subi r28, 0x69 ; 105 |
69fe: df 4f sbci r29, 0xFF ; 255 |
6a00: 58 81 ld r21, Y |
6a02: c7 59 subi r28, 0x97 ; 151 |
6a04: d0 40 sbci r29, 0x00 ; 0 |
6a06: 57 19 sub r21, r7 |
6a08: f1 e0 ldi r31, 0x01 ; 1 |
6a0a: c9 56 subi r28, 0x69 ; 105 |
6a0c: df 4f sbci r29, 0xFF ; 255 |
6a0e: b8 81 ld r27, Y |
6a10: c7 59 subi r28, 0x97 ; 151 |
6a12: d0 40 sbci r29, 0x00 ; 0 |
6a14: b5 17 cp r27, r21 |
6a16: 08 f0 brcs .+2 ; 0x6a1a <__divdi3+0x504> |
6a18: f0 e0 ldi r31, 0x00 ; 0 |
6a1a: 85 2f mov r24, r21 |
6a1c: 8e 1b sub r24, r30 |
6a1e: 91 e0 ldi r25, 0x01 ; 1 |
6a20: 58 17 cp r21, r24 |
6a22: 08 f0 brcs .+2 ; 0x6a26 <__divdi3+0x510> |
6a24: 90 e0 ldi r25, 0x00 ; 0 |
6a26: f9 2b or r31, r25 |
6a28: 58 2f mov r21, r24 |
6a2a: c8 56 subi r28, 0x68 ; 104 |
6a2c: df 4f sbci r29, 0xFF ; 255 |
6a2e: 68 81 ld r22, Y |
6a30: c8 59 subi r28, 0x98 ; 152 |
6a32: d0 40 sbci r29, 0x00 ; 0 |
6a34: 68 19 sub r22, r8 |
6a36: 91 e0 ldi r25, 0x01 ; 1 |
6a38: c8 56 subi r28, 0x68 ; 104 |
6a3a: df 4f sbci r29, 0xFF ; 255 |
6a3c: e8 81 ld r30, Y |
6a3e: c8 59 subi r28, 0x98 ; 152 |
6a40: d0 40 sbci r29, 0x00 ; 0 |
6a42: e6 17 cp r30, r22 |
6a44: 08 f0 brcs .+2 ; 0x6a48 <__divdi3+0x532> |
6a46: 90 e0 ldi r25, 0x00 ; 0 |
6a48: 86 2f mov r24, r22 |
6a4a: 8f 1b sub r24, r31 |
6a4c: e1 e0 ldi r30, 0x01 ; 1 |
6a4e: 68 17 cp r22, r24 |
6a50: 08 f0 brcs .+2 ; 0x6a54 <__divdi3+0x53e> |
6a52: e0 e0 ldi r30, 0x00 ; 0 |
6a54: 9e 2b or r25, r30 |
6a56: 68 2f mov r22, r24 |
6a58: c7 56 subi r28, 0x67 ; 103 |
6a5a: df 4f sbci r29, 0xFF ; 255 |
6a5c: 78 81 ld r23, Y |
6a5e: c9 59 subi r28, 0x99 ; 153 |
6a60: d0 40 sbci r29, 0x00 ; 0 |
6a62: 79 19 sub r23, r9 |
6a64: 87 2f mov r24, r23 |
6a66: 89 1b sub r24, r25 |
6a68: 20 2e mov r2, r16 |
6a6a: 31 2e mov r3, r17 |
6a6c: 42 2e mov r4, r18 |
6a6e: 53 2e mov r5, r19 |
6a70: 64 2e mov r6, r20 |
6a72: 75 2e mov r7, r21 |
6a74: 86 2e mov r8, r22 |
6a76: 98 2e mov r9, r24 |
6a78: b9 c7 rjmp .+3954 ; 0x79ec <__divdi3+0x14d6> |
6a7a: 00 e0 ldi r16, 0x00 ; 0 |
6a7c: 20 16 cp r2, r16 |
6a7e: 00 e0 ldi r16, 0x00 ; 0 |
6a80: 30 06 cpc r3, r16 |
6a82: 01 e0 ldi r16, 0x01 ; 1 |
6a84: 40 06 cpc r4, r16 |
6a86: 00 e0 ldi r16, 0x00 ; 0 |
6a88: 50 06 cpc r5, r16 |
6a8a: 08 f0 brcs .+2 ; 0x6a8e <__divdi3+0x578> |
6a8c: 4e c3 rjmp .+1692 ; 0x712a <__divdi3+0xc14> |
6a8e: 1f ef ldi r17, 0xFF ; 255 |
6a90: 21 16 cp r2, r17 |
6a92: 31 04 cpc r3, r1 |
6a94: 41 04 cpc r4, r1 |
6a96: 51 04 cpc r5, r1 |
6a98: 11 f0 breq .+4 ; 0x6a9e <__divdi3+0x588> |
6a9a: 08 f0 brcs .+2 ; 0x6a9e <__divdi3+0x588> |
6a9c: 1c c7 rjmp .+3640 ; 0x78d6 <__divdi3+0x13c0> |
6a9e: 20 e0 ldi r18, 0x00 ; 0 |
6aa0: 30 e0 ldi r19, 0x00 ; 0 |
6aa2: 40 e0 ldi r20, 0x00 ; 0 |
6aa4: 50 e0 ldi r21, 0x00 ; 0 |
6aa6: 80 e0 ldi r24, 0x00 ; 0 |
6aa8: 90 e0 ldi r25, 0x00 ; 0 |
6aaa: 42 01 movw r8, r4 |
6aac: 31 01 movw r6, r2 |
6aae: 04 c0 rjmp .+8 ; 0x6ab8 <__divdi3+0x5a2> |
6ab0: 96 94 lsr r9 |
6ab2: 87 94 ror r8 |
6ab4: 77 94 ror r7 |
6ab6: 67 94 ror r6 |
6ab8: 8a 95 dec r24 |
6aba: d2 f7 brpl .-12 ; 0x6ab0 <__divdi3+0x59a> |
6abc: d4 01 movw r26, r8 |
6abe: c3 01 movw r24, r6 |
6ac0: 86 5d subi r24, 0xD6 ; 214 |
6ac2: 98 4f sbci r25, 0xF8 ; 248 |
6ac4: dc 01 movw r26, r24 |
6ac6: 8c 91 ld r24, X |
6ac8: 28 0f add r18, r24 |
6aca: 31 1d adc r19, r1 |
6acc: 41 1d adc r20, r1 |
6ace: 51 1d adc r21, r1 |
6ad0: 80 e2 ldi r24, 0x20 ; 32 |
6ad2: 90 e0 ldi r25, 0x00 ; 0 |
6ad4: a0 e0 ldi r26, 0x00 ; 0 |
6ad6: b0 e0 ldi r27, 0x00 ; 0 |
6ad8: 3c 01 movw r6, r24 |
6ada: 4d 01 movw r8, r26 |
6adc: 62 1a sub r6, r18 |
6ade: 73 0a sbc r7, r19 |
6ae0: 84 0a sbc r8, r20 |
6ae2: 95 0a sbc r9, r21 |
6ae4: 09 f4 brne .+2 ; 0x6ae8 <__divdi3+0x5d2> |
6ae6: 45 c0 rjmp .+138 ; 0x6b72 <__divdi3+0x65c> |
6ae8: c3 01 movw r24, r6 |
6aea: 06 2c mov r0, r6 |
6aec: 04 c0 rjmp .+8 ; 0x6af6 <__divdi3+0x5e0> |
6aee: 22 0c add r2, r2 |
6af0: 33 1c adc r3, r3 |
6af2: 44 1c adc r4, r4 |
6af4: 55 1c adc r5, r5 |
6af6: 0a 94 dec r0 |
6af8: d2 f7 brpl .-12 ; 0x6aee <__divdi3+0x5d8> |
6afa: 2d 96 adiw r28, 0x0d ; 13 |
6afc: ec ac ldd r14, Y+60 ; 0x3c |
6afe: fd ac ldd r15, Y+61 ; 0x3d |
6b00: 0e ad ldd r16, Y+62 ; 0x3e |
6b02: 1f ad ldd r17, Y+63 ; 0x3f |
6b04: 2d 97 sbiw r28, 0x0d ; 13 |
6b06: 06 2c mov r0, r6 |
6b08: 04 c0 rjmp .+8 ; 0x6b12 <__divdi3+0x5fc> |
6b0a: ee 0c add r14, r14 |
6b0c: ff 1c adc r15, r15 |
6b0e: 00 1f adc r16, r16 |
6b10: 11 1f adc r17, r17 |
6b12: 0a 94 dec r0 |
6b14: d2 f7 brpl .-12 ; 0x6b0a <__divdi3+0x5f4> |
6b16: 20 e2 ldi r18, 0x20 ; 32 |
6b18: 30 e0 ldi r19, 0x00 ; 0 |
6b1a: 26 19 sub r18, r6 |
6b1c: 37 09 sbc r19, r7 |
6b1e: 29 96 adiw r28, 0x09 ; 9 |
6b20: 6c ac ldd r6, Y+60 ; 0x3c |
6b22: 7d ac ldd r7, Y+61 ; 0x3d |
6b24: 8e ac ldd r8, Y+62 ; 0x3e |
6b26: 9f ac ldd r9, Y+63 ; 0x3f |
6b28: 29 97 sbiw r28, 0x09 ; 9 |
6b2a: 04 c0 rjmp .+8 ; 0x6b34 <__divdi3+0x61e> |
6b2c: 96 94 lsr r9 |
6b2e: 87 94 ror r8 |
6b30: 77 94 ror r7 |
6b32: 67 94 ror r6 |
6b34: 2a 95 dec r18 |
6b36: d2 f7 brpl .-12 ; 0x6b2c <__divdi3+0x616> |
6b38: e6 28 or r14, r6 |
6b3a: f7 28 or r15, r7 |
6b3c: 08 29 or r16, r8 |
6b3e: 19 29 or r17, r9 |
6b40: 2d 96 adiw r28, 0x0d ; 13 |
6b42: ec ae std Y+60, r14 ; 0x3c |
6b44: fd ae std Y+61, r15 ; 0x3d |
6b46: 0e af std Y+62, r16 ; 0x3e |
6b48: 1f af std Y+63, r17 ; 0x3f |
6b4a: 2d 97 sbiw r28, 0x0d ; 13 |
6b4c: 29 96 adiw r28, 0x09 ; 9 |
6b4e: 8c ac ldd r8, Y+60 ; 0x3c |
6b50: 9d ac ldd r9, Y+61 ; 0x3d |
6b52: ae ac ldd r10, Y+62 ; 0x3e |
6b54: bf ac ldd r11, Y+63 ; 0x3f |
6b56: 29 97 sbiw r28, 0x09 ; 9 |
6b58: 04 c0 rjmp .+8 ; 0x6b62 <__divdi3+0x64c> |
6b5a: 88 0c add r8, r8 |
6b5c: 99 1c adc r9, r9 |
6b5e: aa 1c adc r10, r10 |
6b60: bb 1c adc r11, r11 |
6b62: 8a 95 dec r24 |
6b64: d2 f7 brpl .-12 ; 0x6b5a <__divdi3+0x644> |
6b66: 29 96 adiw r28, 0x09 ; 9 |
6b68: 8c ae std Y+60, r8 ; 0x3c |
6b6a: 9d ae std Y+61, r9 ; 0x3d |
6b6c: ae ae std Y+62, r10 ; 0x3e |
6b6e: bf ae std Y+63, r11 ; 0x3f |
6b70: 29 97 sbiw r28, 0x09 ; 9 |
6b72: 32 01 movw r6, r4 |
6b74: 88 24 eor r8, r8 |
6b76: 99 24 eor r9, r9 |
6b78: 92 01 movw r18, r4 |
6b7a: 81 01 movw r16, r2 |
6b7c: 20 70 andi r18, 0x00 ; 0 |
6b7e: 30 70 andi r19, 0x00 ; 0 |
6b80: 69 96 adiw r28, 0x19 ; 25 |
6b82: 0c af std Y+60, r16 ; 0x3c |
6b84: 1d af std Y+61, r17 ; 0x3d |
6b86: 2e af std Y+62, r18 ; 0x3e |
6b88: 3f af std Y+63, r19 ; 0x3f |
6b8a: 69 97 sbiw r28, 0x19 ; 25 |
6b8c: 2d 96 adiw r28, 0x0d ; 13 |
6b8e: 6c ad ldd r22, Y+60 ; 0x3c |
6b90: 7d ad ldd r23, Y+61 ; 0x3d |
6b92: 8e ad ldd r24, Y+62 ; 0x3e |
6b94: 9f ad ldd r25, Y+63 ; 0x3f |
6b96: 2d 97 sbiw r28, 0x0d ; 13 |
6b98: a4 01 movw r20, r8 |
6b9a: 93 01 movw r18, r6 |
6b9c: 0e 94 be 3e call 0x7d7c ; 0x7d7c <__udivmodsi4> |
6ba0: 6d 96 adiw r28, 0x1d ; 29 |
6ba2: 2c af std Y+60, r18 ; 0x3c |
6ba4: 3d af std Y+61, r19 ; 0x3d |
6ba6: 4e af std Y+62, r20 ; 0x3e |
6ba8: 5f af std Y+63, r21 ; 0x3f |
6baa: 6d 97 sbiw r28, 0x1d ; 29 |
6bac: 69 96 adiw r28, 0x19 ; 25 |
6bae: 6c ad ldd r22, Y+60 ; 0x3c |
6bb0: 7d ad ldd r23, Y+61 ; 0x3d |
6bb2: 8e ad ldd r24, Y+62 ; 0x3e |
6bb4: 9f ad ldd r25, Y+63 ; 0x3f |
6bb6: 69 97 sbiw r28, 0x19 ; 25 |
6bb8: 0e 94 78 3e call 0x7cf0 ; 0x7cf0 <__mulsi3> |
6bbc: 5b 01 movw r10, r22 |
6bbe: 6c 01 movw r12, r24 |
6bc0: 2d 96 adiw r28, 0x0d ; 13 |
6bc2: 6c ad ldd r22, Y+60 ; 0x3c |
6bc4: 7d ad ldd r23, Y+61 ; 0x3d |
6bc6: 8e ad ldd r24, Y+62 ; 0x3e |
6bc8: 9f ad ldd r25, Y+63 ; 0x3f |
6bca: 2d 97 sbiw r28, 0x0d ; 13 |
6bcc: a4 01 movw r20, r8 |
6bce: 93 01 movw r18, r6 |
6bd0: 0e 94 be 3e call 0x7d7c ; 0x7d7c <__udivmodsi4> |
6bd4: cb 01 movw r24, r22 |
6bd6: 77 27 eor r23, r23 |
6bd8: 66 27 eor r22, r22 |
6bda: 29 96 adiw r28, 0x09 ; 9 |
6bdc: ec ac ldd r14, Y+60 ; 0x3c |
6bde: fd ac ldd r15, Y+61 ; 0x3d |
6be0: 0e ad ldd r16, Y+62 ; 0x3e |
6be2: 1f ad ldd r17, Y+63 ; 0x3f |
6be4: 29 97 sbiw r28, 0x09 ; 9 |
6be6: 98 01 movw r18, r16 |
6be8: 44 27 eor r20, r20 |
6bea: 55 27 eor r21, r21 |
6bec: 7b 01 movw r14, r22 |
6bee: 8c 01 movw r16, r24 |
6bf0: e2 2a or r14, r18 |
6bf2: f3 2a or r15, r19 |
6bf4: 04 2b or r16, r20 |
6bf6: 15 2b or r17, r21 |
6bf8: ea 14 cp r14, r10 |
6bfa: fb 04 cpc r15, r11 |
6bfc: 0c 05 cpc r16, r12 |
6bfe: 1d 05 cpc r17, r13 |
6c00: f8 f4 brcc .+62 ; 0x6c40 <__divdi3+0x72a> |
6c02: 6d 96 adiw r28, 0x1d ; 29 |
6c04: 2c ad ldd r18, Y+60 ; 0x3c |
6c06: 3d ad ldd r19, Y+61 ; 0x3d |
6c08: 4e ad ldd r20, Y+62 ; 0x3e |
6c0a: 5f ad ldd r21, Y+63 ; 0x3f |
6c0c: 6d 97 sbiw r28, 0x1d ; 29 |
6c0e: 21 50 subi r18, 0x01 ; 1 |
6c10: 30 40 sbci r19, 0x00 ; 0 |
6c12: 40 40 sbci r20, 0x00 ; 0 |
6c14: 50 40 sbci r21, 0x00 ; 0 |
6c16: 6d 96 adiw r28, 0x1d ; 29 |
6c18: 2c af std Y+60, r18 ; 0x3c |
6c1a: 3d af std Y+61, r19 ; 0x3d |
6c1c: 4e af std Y+62, r20 ; 0x3e |
6c1e: 5f af std Y+63, r21 ; 0x3f |
6c20: 6d 97 sbiw r28, 0x1d ; 29 |
6c22: e2 0c add r14, r2 |
6c24: f3 1c adc r15, r3 |
6c26: 04 1d adc r16, r4 |
6c28: 15 1d adc r17, r5 |
6c2a: e2 14 cp r14, r2 |
6c2c: f3 04 cpc r15, r3 |
6c2e: 04 05 cpc r16, r4 |
6c30: 15 05 cpc r17, r5 |
6c32: 30 f0 brcs .+12 ; 0x6c40 <__divdi3+0x72a> |
6c34: ea 14 cp r14, r10 |
6c36: fb 04 cpc r15, r11 |
6c38: 0c 05 cpc r16, r12 |
6c3a: 1d 05 cpc r17, r13 |
6c3c: 08 f4 brcc .+2 ; 0x6c40 <__divdi3+0x72a> |
6c3e: b7 c6 rjmp .+3438 ; 0x79ae <__divdi3+0x1498> |
6c40: ea 18 sub r14, r10 |
6c42: fb 08 sbc r15, r11 |
6c44: 0c 09 sbc r16, r12 |
6c46: 1d 09 sbc r17, r13 |
6c48: c8 01 movw r24, r16 |
6c4a: b7 01 movw r22, r14 |
6c4c: a4 01 movw r20, r8 |
6c4e: 93 01 movw r18, r6 |
6c50: 0e 94 be 3e call 0x7d7c ; 0x7d7c <__udivmodsi4> |
6c54: 59 01 movw r10, r18 |
6c56: 6a 01 movw r12, r20 |
6c58: 69 96 adiw r28, 0x19 ; 25 |
6c5a: 6c ad ldd r22, Y+60 ; 0x3c |
6c5c: 7d ad ldd r23, Y+61 ; 0x3d |
6c5e: 8e ad ldd r24, Y+62 ; 0x3e |
6c60: 9f ad ldd r25, Y+63 ; 0x3f |
6c62: 69 97 sbiw r28, 0x19 ; 25 |
6c64: 0e 94 78 3e call 0x7cf0 ; 0x7cf0 <__mulsi3> |
6c68: 69 af std Y+57, r22 ; 0x39 |
6c6a: 7a af std Y+58, r23 ; 0x3a |
6c6c: 8b af std Y+59, r24 ; 0x3b |
6c6e: 9c af std Y+60, r25 ; 0x3c |
6c70: c8 01 movw r24, r16 |
6c72: b7 01 movw r22, r14 |
6c74: a4 01 movw r20, r8 |
6c76: 93 01 movw r18, r6 |
6c78: 0e 94 be 3e call 0x7d7c ; 0x7d7c <__udivmodsi4> |
6c7c: cb 01 movw r24, r22 |
6c7e: 77 27 eor r23, r23 |
6c80: 66 27 eor r22, r22 |
6c82: 29 96 adiw r28, 0x09 ; 9 |
6c84: 2c ad ldd r18, Y+60 ; 0x3c |
6c86: 3d ad ldd r19, Y+61 ; 0x3d |
6c88: 4e ad ldd r20, Y+62 ; 0x3e |
6c8a: 5f ad ldd r21, Y+63 ; 0x3f |
6c8c: 29 97 sbiw r28, 0x09 ; 9 |
6c8e: 40 70 andi r20, 0x00 ; 0 |
6c90: 50 70 andi r21, 0x00 ; 0 |
6c92: 26 2b or r18, r22 |
6c94: 37 2b or r19, r23 |
6c96: 48 2b or r20, r24 |
6c98: 59 2b or r21, r25 |
6c9a: 89 ad ldd r24, Y+57 ; 0x39 |
6c9c: 9a ad ldd r25, Y+58 ; 0x3a |
6c9e: ab ad ldd r26, Y+59 ; 0x3b |
6ca0: bc ad ldd r27, Y+60 ; 0x3c |
6ca2: 28 17 cp r18, r24 |
6ca4: 39 07 cpc r19, r25 |
6ca6: 4a 07 cpc r20, r26 |
6ca8: 5b 07 cpc r21, r27 |
6caa: a0 f4 brcc .+40 ; 0x6cd4 <__divdi3+0x7be> |
6cac: 08 94 sec |
6cae: a1 08 sbc r10, r1 |
6cb0: b1 08 sbc r11, r1 |
6cb2: c1 08 sbc r12, r1 |
6cb4: d1 08 sbc r13, r1 |
6cb6: 22 0d add r18, r2 |
6cb8: 33 1d adc r19, r3 |
6cba: 44 1d adc r20, r4 |
6cbc: 55 1d adc r21, r5 |
6cbe: 22 15 cp r18, r2 |
6cc0: 33 05 cpc r19, r3 |
6cc2: 44 05 cpc r20, r4 |
6cc4: 55 05 cpc r21, r5 |
6cc6: 30 f0 brcs .+12 ; 0x6cd4 <__divdi3+0x7be> |
6cc8: 28 17 cp r18, r24 |
6cca: 39 07 cpc r19, r25 |
6ccc: 4a 07 cpc r20, r26 |
6cce: 5b 07 cpc r21, r27 |
6cd0: 08 f4 brcc .+2 ; 0x6cd4 <__divdi3+0x7be> |
6cd2: 67 c6 rjmp .+3278 ; 0x79a2 <__divdi3+0x148c> |
6cd4: 6d 96 adiw r28, 0x1d ; 29 |
6cd6: 6c ac ldd r6, Y+60 ; 0x3c |
6cd8: 7d ac ldd r7, Y+61 ; 0x3d |
6cda: 8e ac ldd r8, Y+62 ; 0x3e |
6cdc: 9f ac ldd r9, Y+63 ; 0x3f |
6cde: 6d 97 sbiw r28, 0x1d ; 29 |
6ce0: d3 01 movw r26, r6 |
6ce2: 99 27 eor r25, r25 |
6ce4: 88 27 eor r24, r24 |
6ce6: 15 01 movw r2, r10 |
6ce8: 26 01 movw r4, r12 |
6cea: 28 2a or r2, r24 |
6cec: 39 2a or r3, r25 |
6cee: 4a 2a or r4, r26 |
6cf0: 5b 2a or r5, r27 |
6cf2: 20 e0 ldi r18, 0x00 ; 0 |
6cf4: 30 e0 ldi r19, 0x00 ; 0 |
6cf6: 40 e0 ldi r20, 0x00 ; 0 |
6cf8: 50 e0 ldi r21, 0x00 ; 0 |
6cfa: d5 cd rjmp .-1110 ; 0x68a6 <__divdi3+0x390> |
6cfc: 20 e0 ldi r18, 0x00 ; 0 |
6cfe: e2 16 cp r14, r18 |
6d00: 20 e0 ldi r18, 0x00 ; 0 |
6d02: f2 06 cpc r15, r18 |
6d04: 21 e0 ldi r18, 0x01 ; 1 |
6d06: 02 07 cpc r16, r18 |
6d08: 20 e0 ldi r18, 0x00 ; 0 |
6d0a: 12 07 cpc r17, r18 |
6d0c: 08 f4 brcc .+2 ; 0x6d10 <__divdi3+0x7fa> |
6d0e: 1e c2 rjmp .+1084 ; 0x714c <__divdi3+0xc36> |
6d10: 40 e0 ldi r20, 0x00 ; 0 |
6d12: e4 16 cp r14, r20 |
6d14: 40 e0 ldi r20, 0x00 ; 0 |
6d16: f4 06 cpc r15, r20 |
6d18: 40 e0 ldi r20, 0x00 ; 0 |
6d1a: 04 07 cpc r16, r20 |
6d1c: 41 e0 ldi r20, 0x01 ; 1 |
6d1e: 14 07 cpc r17, r20 |
6d20: 08 f0 brcs .+2 ; 0x6d24 <__divdi3+0x80e> |
6d22: e8 c5 rjmp .+3024 ; 0x78f4 <__divdi3+0x13de> |
6d24: 20 e1 ldi r18, 0x10 ; 16 |
6d26: 30 e0 ldi r19, 0x00 ; 0 |
6d28: 40 e0 ldi r20, 0x00 ; 0 |
6d2a: 50 e0 ldi r21, 0x00 ; 0 |
6d2c: 80 e1 ldi r24, 0x10 ; 16 |
6d2e: 90 e0 ldi r25, 0x00 ; 0 |
6d30: 37 01 movw r6, r14 |
6d32: 48 01 movw r8, r16 |
6d34: 04 c0 rjmp .+8 ; 0x6d3e <__divdi3+0x828> |
6d36: 96 94 lsr r9 |
6d38: 87 94 ror r8 |
6d3a: 77 94 ror r7 |
6d3c: 67 94 ror r6 |
6d3e: 8a 95 dec r24 |
6d40: d2 f7 brpl .-12 ; 0x6d36 <__divdi3+0x820> |
6d42: d4 01 movw r26, r8 |
6d44: c3 01 movw r24, r6 |
6d46: 86 5d subi r24, 0xD6 ; 214 |
6d48: 98 4f sbci r25, 0xF8 ; 248 |
6d4a: dc 01 movw r26, r24 |
6d4c: 8c 91 ld r24, X |
6d4e: 28 0f add r18, r24 |
6d50: 31 1d adc r19, r1 |
6d52: 41 1d adc r20, r1 |
6d54: 51 1d adc r21, r1 |
6d56: da 01 movw r26, r20 |
6d58: c9 01 movw r24, r18 |
6d5a: 20 e2 ldi r18, 0x20 ; 32 |
6d5c: a2 2e mov r10, r18 |
6d5e: b1 2c mov r11, r1 |
6d60: c1 2c mov r12, r1 |
6d62: d1 2c mov r13, r1 |
6d64: a6 01 movw r20, r12 |
6d66: 95 01 movw r18, r10 |
6d68: 28 1b sub r18, r24 |
6d6a: 39 0b sbc r19, r25 |
6d6c: 4a 0b sbc r20, r26 |
6d6e: 5b 0b sbc r21, r27 |
6d70: 09 f0 breq .+2 ; 0x6d74 <__divdi3+0x85e> |
6d72: 79 c2 rjmp .+1266 ; 0x7266 <__divdi3+0xd50> |
6d74: 2d 96 adiw r28, 0x0d ; 13 |
6d76: 6c ac ldd r6, Y+60 ; 0x3c |
6d78: 7d ac ldd r7, Y+61 ; 0x3d |
6d7a: 8e ac ldd r8, Y+62 ; 0x3e |
6d7c: 9f ac ldd r9, Y+63 ; 0x3f |
6d7e: 2d 97 sbiw r28, 0x0d ; 13 |
6d80: e6 14 cp r14, r6 |
6d82: f7 04 cpc r15, r7 |
6d84: 08 05 cpc r16, r8 |
6d86: 19 05 cpc r17, r9 |
6d88: 60 f0 brcs .+24 ; 0x6da2 <__divdi3+0x88c> |
6d8a: 29 96 adiw r28, 0x09 ; 9 |
6d8c: 8c ac ldd r8, Y+60 ; 0x3c |
6d8e: 9d ac ldd r9, Y+61 ; 0x3d |
6d90: ae ac ldd r10, Y+62 ; 0x3e |
6d92: bf ac ldd r11, Y+63 ; 0x3f |
6d94: 29 97 sbiw r28, 0x09 ; 9 |
6d96: 82 14 cp r8, r2 |
6d98: 93 04 cpc r9, r3 |
6d9a: a4 04 cpc r10, r4 |
6d9c: b5 04 cpc r11, r5 |
6d9e: 08 f4 brcc .+2 ; 0x6da2 <__divdi3+0x88c> |
6da0: 7b cd rjmp .-1290 ; 0x6898 <__divdi3+0x382> |
6da2: 81 e0 ldi r24, 0x01 ; 1 |
6da4: 28 2e mov r2, r24 |
6da6: 31 2c mov r3, r1 |
6da8: 41 2c mov r4, r1 |
6daa: 51 2c mov r5, r1 |
6dac: 20 e0 ldi r18, 0x00 ; 0 |
6dae: 30 e0 ldi r19, 0x00 ; 0 |
6db0: 40 e0 ldi r20, 0x00 ; 0 |
6db2: 50 e0 ldi r21, 0x00 ; 0 |
6db4: 78 cd rjmp .-1296 ; 0x68a6 <__divdi3+0x390> |
6db6: cf 57 subi r28, 0x7F ; 127 |
6db8: df 4f sbci r29, 0xFF ; 255 |
6dba: e8 81 ld r30, Y |
6dbc: c1 58 subi r28, 0x81 ; 129 |
6dbe: d0 40 sbci r29, 0x00 ; 0 |
6dc0: e0 95 com r30 |
6dc2: cf 57 subi r28, 0x7F ; 127 |
6dc4: df 4f sbci r29, 0xFF ; 255 |
6dc6: e8 83 st Y, r30 |
6dc8: c1 58 subi r28, 0x81 ; 129 |
6dca: d0 40 sbci r29, 0x00 ; 0 |
6dcc: 88 24 eor r8, r8 |
6dce: 99 24 eor r9, r9 |
6dd0: aa 24 eor r10, r10 |
6dd2: bb 24 eor r11, r11 |
6dd4: cc 24 eor r12, r12 |
6dd6: dd 24 eor r13, r13 |
6dd8: ee 24 eor r14, r14 |
6dda: ff 24 eor r15, r15 |
6ddc: f9 81 ldd r31, Y+1 ; 0x01 |
6dde: c6 57 subi r28, 0x76 ; 118 |
6de0: df 4f sbci r29, 0xFF ; 255 |
6de2: f8 83 st Y, r31 |
6de4: ca 58 subi r28, 0x8A ; 138 |
6de6: d0 40 sbci r29, 0x00 ; 0 |
6de8: 6a 80 ldd r6, Y+2 ; 0x02 |
6dea: c5 57 subi r28, 0x75 ; 117 |
6dec: df 4f sbci r29, 0xFF ; 255 |
6dee: 68 82 st Y, r6 |
6df0: cb 58 subi r28, 0x8B ; 139 |
6df2: d0 40 sbci r29, 0x00 ; 0 |
6df4: 7b 80 ldd r7, Y+3 ; 0x03 |
6df6: c4 57 subi r28, 0x74 ; 116 |
6df8: df 4f sbci r29, 0xFF ; 255 |
6dfa: 78 82 st Y, r7 |
6dfc: cc 58 subi r28, 0x8C ; 140 |
6dfe: d0 40 sbci r29, 0x00 ; 0 |
6e00: 0c 81 ldd r16, Y+4 ; 0x04 |
6e02: c3 57 subi r28, 0x73 ; 115 |
6e04: df 4f sbci r29, 0xFF ; 255 |
6e06: 08 83 st Y, r16 |
6e08: cd 58 subi r28, 0x8D ; 141 |
6e0a: d0 40 sbci r29, 0x00 ; 0 |
6e0c: 1d 81 ldd r17, Y+5 ; 0x05 |
6e0e: c2 57 subi r28, 0x72 ; 114 |
6e10: df 4f sbci r29, 0xFF ; 255 |
6e12: 18 83 st Y, r17 |
6e14: ce 58 subi r28, 0x8E ; 142 |
6e16: d0 40 sbci r29, 0x00 ; 0 |
6e18: 2e 81 ldd r18, Y+6 ; 0x06 |
6e1a: c1 57 subi r28, 0x71 ; 113 |
6e1c: df 4f sbci r29, 0xFF ; 255 |
6e1e: 28 83 st Y, r18 |
6e20: cf 58 subi r28, 0x8F ; 143 |
6e22: d0 40 sbci r29, 0x00 ; 0 |
6e24: 3f 81 ldd r19, Y+7 ; 0x07 |
6e26: c0 57 subi r28, 0x70 ; 112 |
6e28: df 4f sbci r29, 0xFF ; 255 |
6e2a: 38 83 st Y, r19 |
6e2c: c0 59 subi r28, 0x90 ; 144 |
6e2e: d0 40 sbci r29, 0x00 ; 0 |
6e30: 48 85 ldd r20, Y+8 ; 0x08 |
6e32: cf 56 subi r28, 0x6F ; 111 |
6e34: df 4f sbci r29, 0xFF ; 255 |
6e36: 48 83 st Y, r20 |
6e38: c1 59 subi r28, 0x91 ; 145 |
6e3a: d0 40 sbci r29, 0x00 ; 0 |
6e3c: 08 2d mov r16, r8 |
6e3e: 0f 1b sub r16, r31 |
6e40: 81 e0 ldi r24, 0x01 ; 1 |
6e42: 80 16 cp r8, r16 |
6e44: 08 f0 brcs .+2 ; 0x6e48 <__divdi3+0x932> |
6e46: e5 c1 rjmp .+970 ; 0x7212 <__divdi3+0xcfc> |
6e48: 19 2d mov r17, r9 |
6e4a: c5 57 subi r28, 0x75 ; 117 |
6e4c: df 4f sbci r29, 0xFF ; 255 |
6e4e: 98 81 ld r25, Y |
6e50: cb 58 subi r28, 0x8B ; 139 |
6e52: d0 40 sbci r29, 0x00 ; 0 |
6e54: 19 1b sub r17, r25 |
6e56: 91 e0 ldi r25, 0x01 ; 1 |
6e58: 91 16 cp r9, r17 |
6e5a: 08 f0 brcs .+2 ; 0x6e5e <__divdi3+0x948> |
6e5c: d1 c1 rjmp .+930 ; 0x7200 <__divdi3+0xcea> |
6e5e: a1 2f mov r26, r17 |
6e60: a8 1b sub r26, r24 |
6e62: 8a 2f mov r24, r26 |
6e64: e1 e0 ldi r30, 0x01 ; 1 |
6e66: 1a 17 cp r17, r26 |
6e68: 08 f0 brcs .+2 ; 0x6e6c <__divdi3+0x956> |
6e6a: c8 c1 rjmp .+912 ; 0x71fc <__divdi3+0xce6> |
6e6c: 9e 2b or r25, r30 |
6e6e: 18 2f mov r17, r24 |
6e70: 2a 2d mov r18, r10 |
6e72: c4 57 subi r28, 0x74 ; 116 |
6e74: df 4f sbci r29, 0xFF ; 255 |
6e76: b8 81 ld r27, Y |
6e78: cc 58 subi r28, 0x8C ; 140 |
6e7a: d0 40 sbci r29, 0x00 ; 0 |
6e7c: 2b 1b sub r18, r27 |
6e7e: e1 e0 ldi r30, 0x01 ; 1 |
6e80: a2 16 cp r10, r18 |
6e82: 08 f0 brcs .+2 ; 0x6e86 <__divdi3+0x970> |
6e84: b3 c1 rjmp .+870 ; 0x71ec <__divdi3+0xcd6> |
6e86: 82 2f mov r24, r18 |
6e88: 89 1b sub r24, r25 |
6e8a: 91 e0 ldi r25, 0x01 ; 1 |
6e8c: 28 17 cp r18, r24 |
6e8e: 08 f0 brcs .+2 ; 0x6e92 <__divdi3+0x97c> |
6e90: ab c1 rjmp .+854 ; 0x71e8 <__divdi3+0xcd2> |
6e92: e9 2b or r30, r25 |
6e94: 28 2f mov r18, r24 |
6e96: 3b 2d mov r19, r11 |
6e98: c3 57 subi r28, 0x73 ; 115 |
6e9a: df 4f sbci r29, 0xFF ; 255 |
6e9c: f8 81 ld r31, Y |
6e9e: cd 58 subi r28, 0x8D ; 141 |
6ea0: d0 40 sbci r29, 0x00 ; 0 |
6ea2: 3f 1b sub r19, r31 |
6ea4: 91 e0 ldi r25, 0x01 ; 1 |
6ea6: b3 16 cp r11, r19 |
6ea8: 08 f0 brcs .+2 ; 0x6eac <__divdi3+0x996> |
6eaa: 96 c1 rjmp .+812 ; 0x71d8 <__divdi3+0xcc2> |
6eac: 83 2f mov r24, r19 |
6eae: 8e 1b sub r24, r30 |
6eb0: e1 e0 ldi r30, 0x01 ; 1 |
6eb2: 38 17 cp r19, r24 |
6eb4: 08 f0 brcs .+2 ; 0x6eb8 <__divdi3+0x9a2> |
6eb6: 8e c1 rjmp .+796 ; 0x71d4 <__divdi3+0xcbe> |
6eb8: 9e 2b or r25, r30 |
6eba: 38 2f mov r19, r24 |
6ebc: 4c 2d mov r20, r12 |
6ebe: c2 57 subi r28, 0x72 ; 114 |
6ec0: df 4f sbci r29, 0xFF ; 255 |
6ec2: 68 80 ld r6, Y |
6ec4: ce 58 subi r28, 0x8E ; 142 |
6ec6: d0 40 sbci r29, 0x00 ; 0 |
6ec8: 46 19 sub r20, r6 |
6eca: e1 e0 ldi r30, 0x01 ; 1 |
6ecc: c4 16 cp r12, r20 |
6ece: 08 f0 brcs .+2 ; 0x6ed2 <__divdi3+0x9bc> |
6ed0: 79 c1 rjmp .+754 ; 0x71c4 <__divdi3+0xcae> |
6ed2: 84 2f mov r24, r20 |
6ed4: 89 1b sub r24, r25 |
6ed6: 91 e0 ldi r25, 0x01 ; 1 |
6ed8: 48 17 cp r20, r24 |
6eda: 08 f0 brcs .+2 ; 0x6ede <__divdi3+0x9c8> |
6edc: 71 c1 rjmp .+738 ; 0x71c0 <__divdi3+0xcaa> |
6ede: e9 2b or r30, r25 |
6ee0: 48 2f mov r20, r24 |
6ee2: 5d 2d mov r21, r13 |
6ee4: c1 57 subi r28, 0x71 ; 113 |
6ee6: df 4f sbci r29, 0xFF ; 255 |
6ee8: 78 80 ld r7, Y |
6eea: cf 58 subi r28, 0x8F ; 143 |
6eec: d0 40 sbci r29, 0x00 ; 0 |
6eee: 57 19 sub r21, r7 |
6ef0: f1 e0 ldi r31, 0x01 ; 1 |
6ef2: d5 16 cp r13, r21 |
6ef4: 08 f0 brcs .+2 ; 0x6ef8 <__divdi3+0x9e2> |
6ef6: 5c c1 rjmp .+696 ; 0x71b0 <__divdi3+0xc9a> |
6ef8: 85 2f mov r24, r21 |
6efa: 8e 1b sub r24, r30 |
6efc: 91 e0 ldi r25, 0x01 ; 1 |
6efe: 58 17 cp r21, r24 |
6f00: 08 f0 brcs .+2 ; 0x6f04 <__divdi3+0x9ee> |
6f02: 54 c1 rjmp .+680 ; 0x71ac <__divdi3+0xc96> |
6f04: f9 2b or r31, r25 |
6f06: 58 2f mov r21, r24 |
6f08: 6e 2d mov r22, r14 |
6f0a: c0 57 subi r28, 0x70 ; 112 |
6f0c: df 4f sbci r29, 0xFF ; 255 |
6f0e: 88 81 ld r24, Y |
6f10: c0 59 subi r28, 0x90 ; 144 |
6f12: d0 40 sbci r29, 0x00 ; 0 |
6f14: 68 1b sub r22, r24 |
6f16: 91 e0 ldi r25, 0x01 ; 1 |
6f18: e6 16 cp r14, r22 |
6f1a: 08 f0 brcs .+2 ; 0x6f1e <__divdi3+0xa08> |
6f1c: 3f c1 rjmp .+638 ; 0x719c <__divdi3+0xc86> |
6f1e: 86 2f mov r24, r22 |
6f20: 8f 1b sub r24, r31 |
6f22: e1 e0 ldi r30, 0x01 ; 1 |
6f24: 68 17 cp r22, r24 |
6f26: 08 f0 brcs .+2 ; 0x6f2a <__divdi3+0xa14> |
6f28: 37 c1 rjmp .+622 ; 0x7198 <__divdi3+0xc82> |
6f2a: 9e 2b or r25, r30 |
6f2c: 68 2f mov r22, r24 |
6f2e: 7f 2d mov r23, r15 |
6f30: cf 56 subi r28, 0x6F ; 111 |
6f32: df 4f sbci r29, 0xFF ; 255 |
6f34: a8 81 ld r26, Y |
6f36: c1 59 subi r28, 0x91 ; 145 |
6f38: d0 40 sbci r29, 0x00 ; 0 |
6f3a: 7a 1b sub r23, r26 |
6f3c: 87 2f mov r24, r23 |
6f3e: 89 1b sub r24, r25 |
6f40: 09 83 std Y+1, r16 ; 0x01 |
6f42: 1a 83 std Y+2, r17 ; 0x02 |
6f44: 2b 83 std Y+3, r18 ; 0x03 |
6f46: 3c 83 std Y+4, r19 ; 0x04 |
6f48: 4d 83 std Y+5, r20 ; 0x05 |
6f4a: 5e 83 std Y+6, r21 ; 0x06 |
6f4c: 6f 83 std Y+7, r22 ; 0x07 |
6f4e: 88 87 std Y+8, r24 ; 0x08 |
6f50: 1e cb rjmp .-2500 ; 0x658e <__divdi3+0x78> |
6f52: 88 24 eor r8, r8 |
6f54: 99 24 eor r9, r9 |
6f56: aa 24 eor r10, r10 |
6f58: bb 24 eor r11, r11 |
6f5a: cc 24 eor r12, r12 |
6f5c: dd 24 eor r13, r13 |
6f5e: ee 24 eor r14, r14 |
6f60: ff 24 eor r15, r15 |
6f62: 09 a1 ldd r16, Y+33 ; 0x21 |
6f64: ce 57 subi r28, 0x7E ; 126 |
6f66: df 4f sbci r29, 0xFF ; 255 |
6f68: 08 83 st Y, r16 |
6f6a: c2 58 subi r28, 0x82 ; 130 |
6f6c: d0 40 sbci r29, 0x00 ; 0 |
6f6e: 1a a1 ldd r17, Y+34 ; 0x22 |
6f70: cd 57 subi r28, 0x7D ; 125 |
6f72: df 4f sbci r29, 0xFF ; 255 |
6f74: 18 83 st Y, r17 |
6f76: c3 58 subi r28, 0x83 ; 131 |
6f78: d0 40 sbci r29, 0x00 ; 0 |
6f7a: 2b a1 ldd r18, Y+35 ; 0x23 |
6f7c: cc 57 subi r28, 0x7C ; 124 |
6f7e: df 4f sbci r29, 0xFF ; 255 |
6f80: 28 83 st Y, r18 |
6f82: c4 58 subi r28, 0x84 ; 132 |
6f84: d0 40 sbci r29, 0x00 ; 0 |
6f86: 3c a1 ldd r19, Y+36 ; 0x24 |
6f88: cb 57 subi r28, 0x7B ; 123 |
6f8a: df 4f sbci r29, 0xFF ; 255 |
6f8c: 38 83 st Y, r19 |
6f8e: c5 58 subi r28, 0x85 ; 133 |
6f90: d0 40 sbci r29, 0x00 ; 0 |
6f92: 4d a1 ldd r20, Y+37 ; 0x25 |
6f94: ca 57 subi r28, 0x7A ; 122 |
6f96: df 4f sbci r29, 0xFF ; 255 |
6f98: 48 83 st Y, r20 |
6f9a: c6 58 subi r28, 0x86 ; 134 |
6f9c: d0 40 sbci r29, 0x00 ; 0 |
6f9e: 5e a1 ldd r21, Y+38 ; 0x26 |
6fa0: c9 57 subi r28, 0x79 ; 121 |
6fa2: df 4f sbci r29, 0xFF ; 255 |
6fa4: 58 83 st Y, r21 |
6fa6: c7 58 subi r28, 0x87 ; 135 |
6fa8: d0 40 sbci r29, 0x00 ; 0 |
6faa: 8f a1 ldd r24, Y+39 ; 0x27 |
6fac: c8 57 subi r28, 0x78 ; 120 |
6fae: df 4f sbci r29, 0xFF ; 255 |
6fb0: 88 83 st Y, r24 |
6fb2: c8 58 subi r28, 0x88 ; 136 |
6fb4: d0 40 sbci r29, 0x00 ; 0 |
6fb6: 98 a5 ldd r25, Y+40 ; 0x28 |
6fb8: c7 57 subi r28, 0x77 ; 119 |
6fba: df 4f sbci r29, 0xFF ; 255 |
6fbc: 98 83 st Y, r25 |
6fbe: c9 58 subi r28, 0x89 ; 137 |
6fc0: d0 40 sbci r29, 0x00 ; 0 |
6fc2: 08 2d mov r16, r8 |
6fc4: ce 57 subi r28, 0x7E ; 126 |
6fc6: df 4f sbci r29, 0xFF ; 255 |
6fc8: a8 81 ld r26, Y |
6fca: c2 58 subi r28, 0x82 ; 130 |
6fcc: d0 40 sbci r29, 0x00 ; 0 |
6fce: 0a 1b sub r16, r26 |
6fd0: 81 e0 ldi r24, 0x01 ; 1 |
6fd2: 80 16 cp r8, r16 |
6fd4: 08 f0 brcs .+2 ; 0x6fd8 <__divdi3+0xac2> |
6fd6: de c0 rjmp .+444 ; 0x7194 <__divdi3+0xc7e> |
6fd8: 19 2d mov r17, r9 |
6fda: cd 57 subi r28, 0x7D ; 125 |
6fdc: df 4f sbci r29, 0xFF ; 255 |
6fde: b8 81 ld r27, Y |
6fe0: c3 58 subi r28, 0x83 ; 131 |
6fe2: d0 40 sbci r29, 0x00 ; 0 |
6fe4: 1b 1b sub r17, r27 |
6fe6: 91 e0 ldi r25, 0x01 ; 1 |
6fe8: 91 16 cp r9, r17 |
6fea: 08 f0 brcs .+2 ; 0x6fee <__divdi3+0xad8> |
6fec: ca c0 rjmp .+404 ; 0x7182 <__divdi3+0xc6c> |
6fee: e1 2f mov r30, r17 |
6ff0: e8 1b sub r30, r24 |
6ff2: 8e 2f mov r24, r30 |
6ff4: e1 e0 ldi r30, 0x01 ; 1 |
6ff6: 18 17 cp r17, r24 |
6ff8: 08 f0 brcs .+2 ; 0x6ffc <__divdi3+0xae6> |
6ffa: c1 c0 rjmp .+386 ; 0x717e <__divdi3+0xc68> |
6ffc: 9e 2b or r25, r30 |
6ffe: 18 2f mov r17, r24 |
7000: 2a 2d mov r18, r10 |
7002: cc 57 subi r28, 0x7C ; 124 |
7004: df 4f sbci r29, 0xFF ; 255 |
7006: f8 81 ld r31, Y |
7008: c4 58 subi r28, 0x84 ; 132 |
700a: d0 40 sbci r29, 0x00 ; 0 |
700c: 2f 1b sub r18, r31 |
700e: e1 e0 ldi r30, 0x01 ; 1 |
7010: a2 16 cp r10, r18 |
7012: 08 f0 brcs .+2 ; 0x7016 <__divdi3+0xb00> |
7014: 20 c1 rjmp .+576 ; 0x7256 <__divdi3+0xd40> |
7016: 82 2f mov r24, r18 |
7018: 89 1b sub r24, r25 |
701a: 91 e0 ldi r25, 0x01 ; 1 |
701c: 28 17 cp r18, r24 |
701e: 08 f0 brcs .+2 ; 0x7022 <__divdi3+0xb0c> |
7020: 18 c1 rjmp .+560 ; 0x7252 <__divdi3+0xd3c> |
7022: e9 2b or r30, r25 |
7024: 28 2f mov r18, r24 |
7026: 3b 2d mov r19, r11 |
7028: cb 57 subi r28, 0x7B ; 123 |
702a: df 4f sbci r29, 0xFF ; 255 |
702c: 68 80 ld r6, Y |
702e: c5 58 subi r28, 0x85 ; 133 |
7030: d0 40 sbci r29, 0x00 ; 0 |
7032: 36 19 sub r19, r6 |
7034: 91 e0 ldi r25, 0x01 ; 1 |
7036: b3 16 cp r11, r19 |
7038: 08 f0 brcs .+2 ; 0x703c <__divdi3+0xb26> |
703a: 03 c1 rjmp .+518 ; 0x7242 <__divdi3+0xd2c> |
703c: 83 2f mov r24, r19 |
703e: 8e 1b sub r24, r30 |
7040: e1 e0 ldi r30, 0x01 ; 1 |
7042: 38 17 cp r19, r24 |
7044: 08 f0 brcs .+2 ; 0x7048 <__divdi3+0xb32> |
7046: fb c0 rjmp .+502 ; 0x723e <__divdi3+0xd28> |
7048: 9e 2b or r25, r30 |
704a: 38 2f mov r19, r24 |
704c: 4c 2d mov r20, r12 |
704e: ca 57 subi r28, 0x7A ; 122 |
7050: df 4f sbci r29, 0xFF ; 255 |
7052: 78 80 ld r7, Y |
7054: c6 58 subi r28, 0x86 ; 134 |
7056: d0 40 sbci r29, 0x00 ; 0 |
7058: 47 19 sub r20, r7 |
705a: e1 e0 ldi r30, 0x01 ; 1 |
705c: c4 16 cp r12, r20 |
705e: 08 f0 brcs .+2 ; 0x7062 <__divdi3+0xb4c> |
7060: e6 c0 rjmp .+460 ; 0x722e <__divdi3+0xd18> |
7062: 84 2f mov r24, r20 |
7064: 89 1b sub r24, r25 |
7066: 91 e0 ldi r25, 0x01 ; 1 |
7068: 48 17 cp r20, r24 |
706a: 08 f0 brcs .+2 ; 0x706e <__divdi3+0xb58> |
706c: de c0 rjmp .+444 ; 0x722a <__divdi3+0xd14> |
706e: e9 2b or r30, r25 |
7070: 48 2f mov r20, r24 |
7072: 5d 2d mov r21, r13 |
7074: c9 57 subi r28, 0x79 ; 121 |
7076: df 4f sbci r29, 0xFF ; 255 |
7078: 88 81 ld r24, Y |
707a: c7 58 subi r28, 0x87 ; 135 |
707c: d0 40 sbci r29, 0x00 ; 0 |
707e: 58 1b sub r21, r24 |
7080: f1 e0 ldi r31, 0x01 ; 1 |
7082: d5 16 cp r13, r21 |
7084: 08 f0 brcs .+2 ; 0x7088 <__divdi3+0xb72> |
7086: c9 c0 rjmp .+402 ; 0x721a <__divdi3+0xd04> |
7088: 85 2f mov r24, r21 |
708a: 8e 1b sub r24, r30 |
708c: 91 e0 ldi r25, 0x01 ; 1 |
708e: 58 17 cp r21, r24 |
7090: 08 f0 brcs .+2 ; 0x7094 <__divdi3+0xb7e> |
7092: c1 c0 rjmp .+386 ; 0x7216 <__divdi3+0xd00> |
7094: f9 2b or r31, r25 |
7096: 58 2f mov r21, r24 |
7098: 6e 2d mov r22, r14 |
709a: c8 57 subi r28, 0x78 ; 120 |
709c: df 4f sbci r29, 0xFF ; 255 |
709e: 98 81 ld r25, Y |
70a0: c8 58 subi r28, 0x88 ; 136 |
70a2: d0 40 sbci r29, 0x00 ; 0 |
70a4: 69 1b sub r22, r25 |
70a6: 91 e0 ldi r25, 0x01 ; 1 |
70a8: e6 16 cp r14, r22 |
70aa: 08 f0 brcs .+2 ; 0x70ae <__divdi3+0xb98> |
70ac: 60 c0 rjmp .+192 ; 0x716e <__divdi3+0xc58> |
70ae: 86 2f mov r24, r22 |
70b0: 8f 1b sub r24, r31 |
70b2: e1 e0 ldi r30, 0x01 ; 1 |
70b4: 68 17 cp r22, r24 |
70b6: 08 f0 brcs .+2 ; 0x70ba <__divdi3+0xba4> |
70b8: 58 c0 rjmp .+176 ; 0x716a <__divdi3+0xc54> |
70ba: 9e 2b or r25, r30 |
70bc: 68 2f mov r22, r24 |
70be: 7f 2d mov r23, r15 |
70c0: c7 57 subi r28, 0x77 ; 119 |
70c2: df 4f sbci r29, 0xFF ; 255 |
70c4: a8 81 ld r26, Y |
70c6: c9 58 subi r28, 0x89 ; 137 |
70c8: d0 40 sbci r29, 0x00 ; 0 |
70ca: 7a 1b sub r23, r26 |
70cc: 87 2f mov r24, r23 |
70ce: 89 1b sub r24, r25 |
70d0: 09 a3 std Y+33, r16 ; 0x21 |
70d2: 1a a3 std Y+34, r17 ; 0x22 |
70d4: 2b a3 std Y+35, r18 ; 0x23 |
70d6: 3c a3 std Y+36, r19 ; 0x24 |
70d8: 4d a3 std Y+37, r20 ; 0x25 |
70da: 5e a3 std Y+38, r21 ; 0x26 |
70dc: 6f a3 std Y+39, r22 ; 0x27 |
70de: 88 a7 std Y+40, r24 ; 0x28 |
70e0: bf ef ldi r27, 0xFF ; 255 |
70e2: cf 57 subi r28, 0x7F ; 127 |
70e4: df 4f sbci r29, 0xFF ; 255 |
70e6: b8 83 st Y, r27 |
70e8: c1 58 subi r28, 0x81 ; 129 |
70ea: d0 40 sbci r29, 0x00 ; 0 |
70ec: 4a ca rjmp .-2924 ; 0x6582 <__divdi3+0x6c> |
70ee: 20 e0 ldi r18, 0x00 ; 0 |
70f0: 22 16 cp r2, r18 |
70f2: 20 e0 ldi r18, 0x00 ; 0 |
70f4: 32 06 cpc r3, r18 |
70f6: 20 e0 ldi r18, 0x00 ; 0 |
70f8: 42 06 cpc r4, r18 |
70fa: 21 e0 ldi r18, 0x01 ; 1 |
70fc: 52 06 cpc r5, r18 |
70fe: 08 f0 brcs .+2 ; 0x7102 <__divdi3+0xbec> |
7100: 07 c4 rjmp .+2062 ; 0x7910 <__divdi3+0x13fa> |
7102: 20 e1 ldi r18, 0x10 ; 16 |
7104: 30 e0 ldi r19, 0x00 ; 0 |
7106: 40 e0 ldi r20, 0x00 ; 0 |
7108: 50 e0 ldi r21, 0x00 ; 0 |
710a: 80 e1 ldi r24, 0x10 ; 16 |
710c: 90 e0 ldi r25, 0x00 ; 0 |
710e: b2 ca rjmp .-2716 ; 0x6674 <__divdi3+0x15e> |
7110: 61 e0 ldi r22, 0x01 ; 1 |
7112: 70 e0 ldi r23, 0x00 ; 0 |
7114: 80 e0 ldi r24, 0x00 ; 0 |
7116: 90 e0 ldi r25, 0x00 ; 0 |
7118: 20 e0 ldi r18, 0x00 ; 0 |
711a: 30 e0 ldi r19, 0x00 ; 0 |
711c: 40 e0 ldi r20, 0x00 ; 0 |
711e: 50 e0 ldi r21, 0x00 ; 0 |
7120: 0e 94 be 3e call 0x7d7c ; 0x7d7c <__udivmodsi4> |
7124: 19 01 movw r2, r18 |
7126: 2a 01 movw r4, r20 |
7128: 8c ca rjmp .-2792 ; 0x6642 <__divdi3+0x12c> |
712a: 20 e0 ldi r18, 0x00 ; 0 |
712c: 22 16 cp r2, r18 |
712e: 20 e0 ldi r18, 0x00 ; 0 |
7130: 32 06 cpc r3, r18 |
7132: 20 e0 ldi r18, 0x00 ; 0 |
7134: 42 06 cpc r4, r18 |
7136: 21 e0 ldi r18, 0x01 ; 1 |
7138: 52 06 cpc r5, r18 |
713a: 08 f0 brcs .+2 ; 0x713e <__divdi3+0xc28> |
713c: e2 c3 rjmp .+1988 ; 0x7902 <__divdi3+0x13ec> |
713e: 20 e1 ldi r18, 0x10 ; 16 |
7140: 30 e0 ldi r19, 0x00 ; 0 |
7142: 40 e0 ldi r20, 0x00 ; 0 |
7144: 50 e0 ldi r21, 0x00 ; 0 |
7146: 80 e1 ldi r24, 0x10 ; 16 |
7148: 90 e0 ldi r25, 0x00 ; 0 |
714a: af cc rjmp .-1698 ; 0x6aaa <__divdi3+0x594> |
714c: 3f ef ldi r19, 0xFF ; 255 |
714e: e3 16 cp r14, r19 |
7150: f1 04 cpc r15, r1 |
7152: 01 05 cpc r16, r1 |
7154: 11 05 cpc r17, r1 |
7156: 11 f0 breq .+4 ; 0x715c <__divdi3+0xc46> |
7158: 08 f0 brcs .+2 ; 0x715c <__divdi3+0xc46> |
715a: b6 c3 rjmp .+1900 ; 0x78c8 <__divdi3+0x13b2> |
715c: 20 e0 ldi r18, 0x00 ; 0 |
715e: 30 e0 ldi r19, 0x00 ; 0 |
7160: 40 e0 ldi r20, 0x00 ; 0 |
7162: 50 e0 ldi r21, 0x00 ; 0 |
7164: 80 e0 ldi r24, 0x00 ; 0 |
7166: 90 e0 ldi r25, 0x00 ; 0 |
7168: e3 cd rjmp .-1082 ; 0x6d30 <__divdi3+0x81a> |
716a: e0 e0 ldi r30, 0x00 ; 0 |
716c: a6 cf rjmp .-180 ; 0x70ba <__divdi3+0xba4> |
716e: 90 e0 ldi r25, 0x00 ; 0 |
7170: 86 2f mov r24, r22 |
7172: 8f 1b sub r24, r31 |
7174: e1 e0 ldi r30, 0x01 ; 1 |
7176: 68 17 cp r22, r24 |
7178: 08 f4 brcc .+2 ; 0x717c <__divdi3+0xc66> |
717a: 9f cf rjmp .-194 ; 0x70ba <__divdi3+0xba4> |
717c: f6 cf rjmp .-20 ; 0x716a <__divdi3+0xc54> |
717e: e0 e0 ldi r30, 0x00 ; 0 |
7180: 3d cf rjmp .-390 ; 0x6ffc <__divdi3+0xae6> |
7182: 90 e0 ldi r25, 0x00 ; 0 |
7184: e1 2f mov r30, r17 |
7186: e8 1b sub r30, r24 |
7188: 8e 2f mov r24, r30 |
718a: e1 e0 ldi r30, 0x01 ; 1 |
718c: 18 17 cp r17, r24 |
718e: 08 f4 brcc .+2 ; 0x7192 <__divdi3+0xc7c> |
7190: 35 cf rjmp .-406 ; 0x6ffc <__divdi3+0xae6> |
7192: f5 cf rjmp .-22 ; 0x717e <__divdi3+0xc68> |
7194: 80 e0 ldi r24, 0x00 ; 0 |
7196: 20 cf rjmp .-448 ; 0x6fd8 <__divdi3+0xac2> |
7198: e0 e0 ldi r30, 0x00 ; 0 |
719a: c7 ce rjmp .-626 ; 0x6f2a <__divdi3+0xa14> |
719c: 90 e0 ldi r25, 0x00 ; 0 |
719e: 86 2f mov r24, r22 |
71a0: 8f 1b sub r24, r31 |
71a2: e1 e0 ldi r30, 0x01 ; 1 |
71a4: 68 17 cp r22, r24 |
71a6: 08 f4 brcc .+2 ; 0x71aa <__divdi3+0xc94> |
71a8: c0 ce rjmp .-640 ; 0x6f2a <__divdi3+0xa14> |
71aa: f6 cf rjmp .-20 ; 0x7198 <__divdi3+0xc82> |
71ac: 90 e0 ldi r25, 0x00 ; 0 |
71ae: aa ce rjmp .-684 ; 0x6f04 <__divdi3+0x9ee> |
71b0: f0 e0 ldi r31, 0x00 ; 0 |
71b2: 85 2f mov r24, r21 |
71b4: 8e 1b sub r24, r30 |
71b6: 91 e0 ldi r25, 0x01 ; 1 |
71b8: 58 17 cp r21, r24 |
71ba: 08 f4 brcc .+2 ; 0x71be <__divdi3+0xca8> |
71bc: a3 ce rjmp .-698 ; 0x6f04 <__divdi3+0x9ee> |
71be: f6 cf rjmp .-20 ; 0x71ac <__divdi3+0xc96> |
71c0: 90 e0 ldi r25, 0x00 ; 0 |
71c2: 8d ce rjmp .-742 ; 0x6ede <__divdi3+0x9c8> |
71c4: e0 e0 ldi r30, 0x00 ; 0 |
71c6: 84 2f mov r24, r20 |
71c8: 89 1b sub r24, r25 |
71ca: 91 e0 ldi r25, 0x01 ; 1 |
71cc: 48 17 cp r20, r24 |
71ce: 08 f4 brcc .+2 ; 0x71d2 <__divdi3+0xcbc> |
71d0: 86 ce rjmp .-756 ; 0x6ede <__divdi3+0x9c8> |
71d2: f6 cf rjmp .-20 ; 0x71c0 <__divdi3+0xcaa> |
71d4: e0 e0 ldi r30, 0x00 ; 0 |
71d6: 70 ce rjmp .-800 ; 0x6eb8 <__divdi3+0x9a2> |
71d8: 90 e0 ldi r25, 0x00 ; 0 |
71da: 83 2f mov r24, r19 |
71dc: 8e 1b sub r24, r30 |
71de: e1 e0 ldi r30, 0x01 ; 1 |
71e0: 38 17 cp r19, r24 |
71e2: 08 f4 brcc .+2 ; 0x71e6 <__divdi3+0xcd0> |
71e4: 69 ce rjmp .-814 ; 0x6eb8 <__divdi3+0x9a2> |
71e6: f6 cf rjmp .-20 ; 0x71d4 <__divdi3+0xcbe> |
71e8: 90 e0 ldi r25, 0x00 ; 0 |
71ea: 53 ce rjmp .-858 ; 0x6e92 <__divdi3+0x97c> |
71ec: e0 e0 ldi r30, 0x00 ; 0 |
71ee: 82 2f mov r24, r18 |
71f0: 89 1b sub r24, r25 |
71f2: 91 e0 ldi r25, 0x01 ; 1 |
71f4: 28 17 cp r18, r24 |
71f6: 08 f4 brcc .+2 ; 0x71fa <__divdi3+0xce4> |
71f8: 4c ce rjmp .-872 ; 0x6e92 <__divdi3+0x97c> |
71fa: f6 cf rjmp .-20 ; 0x71e8 <__divdi3+0xcd2> |
71fc: e0 e0 ldi r30, 0x00 ; 0 |
71fe: 36 ce rjmp .-916 ; 0x6e6c <__divdi3+0x956> |
7200: 90 e0 ldi r25, 0x00 ; 0 |
7202: a1 2f mov r26, r17 |
7204: a8 1b sub r26, r24 |
7206: 8a 2f mov r24, r26 |
7208: e1 e0 ldi r30, 0x01 ; 1 |
720a: 1a 17 cp r17, r26 |
720c: 08 f4 brcc .+2 ; 0x7210 <__divdi3+0xcfa> |
720e: 2e ce rjmp .-932 ; 0x6e6c <__divdi3+0x956> |
7210: f5 cf rjmp .-22 ; 0x71fc <__divdi3+0xce6> |
7212: 80 e0 ldi r24, 0x00 ; 0 |
7214: 19 ce rjmp .-974 ; 0x6e48 <__divdi3+0x932> |
7216: 90 e0 ldi r25, 0x00 ; 0 |
7218: 3d cf rjmp .-390 ; 0x7094 <__divdi3+0xb7e> |
721a: f0 e0 ldi r31, 0x00 ; 0 |
721c: 85 2f mov r24, r21 |
721e: 8e 1b sub r24, r30 |
7220: 91 e0 ldi r25, 0x01 ; 1 |
7222: 58 17 cp r21, r24 |
7224: 08 f4 brcc .+2 ; 0x7228 <__divdi3+0xd12> |
7226: 36 cf rjmp .-404 ; 0x7094 <__divdi3+0xb7e> |
7228: f6 cf rjmp .-20 ; 0x7216 <__divdi3+0xd00> |
722a: 90 e0 ldi r25, 0x00 ; 0 |
722c: 20 cf rjmp .-448 ; 0x706e <__divdi3+0xb58> |
722e: e0 e0 ldi r30, 0x00 ; 0 |
7230: 84 2f mov r24, r20 |
7232: 89 1b sub r24, r25 |
7234: 91 e0 ldi r25, 0x01 ; 1 |
7236: 48 17 cp r20, r24 |
7238: 08 f4 brcc .+2 ; 0x723c <__divdi3+0xd26> |
723a: 19 cf rjmp .-462 ; 0x706e <__divdi3+0xb58> |
723c: f6 cf rjmp .-20 ; 0x722a <__divdi3+0xd14> |
723e: e0 e0 ldi r30, 0x00 ; 0 |
7240: 03 cf rjmp .-506 ; 0x7048 <__divdi3+0xb32> |
7242: 90 e0 ldi r25, 0x00 ; 0 |
7244: 83 2f mov r24, r19 |
7246: 8e 1b sub r24, r30 |
7248: e1 e0 ldi r30, 0x01 ; 1 |
724a: 38 17 cp r19, r24 |
724c: 08 f4 brcc .+2 ; 0x7250 <__divdi3+0xd3a> |
724e: fc ce rjmp .-520 ; 0x7048 <__divdi3+0xb32> |
7250: f6 cf rjmp .-20 ; 0x723e <__divdi3+0xd28> |
7252: 90 e0 ldi r25, 0x00 ; 0 |
7254: e6 ce rjmp .-564 ; 0x7022 <__divdi3+0xb0c> |
7256: e0 e0 ldi r30, 0x00 ; 0 |
7258: 82 2f mov r24, r18 |
725a: 89 1b sub r24, r25 |
725c: 91 e0 ldi r25, 0x01 ; 1 |
725e: 28 17 cp r18, r24 |
7260: 08 f4 brcc .+2 ; 0x7264 <__divdi3+0xd4e> |
7262: df ce rjmp .-578 ; 0x7022 <__divdi3+0xb0c> |
7264: f6 cf rjmp .-20 ; 0x7252 <__divdi3+0xd3c> |
7266: 21 96 adiw r28, 0x01 ; 1 |
7268: 3f af std Y+63, r19 ; 0x3f |
726a: 2e af std Y+62, r18 ; 0x3e |
726c: 21 97 sbiw r28, 0x01 ; 1 |
726e: a2 1a sub r10, r18 |
7270: b3 0a sbc r11, r19 |
7272: c4 0a sbc r12, r20 |
7274: d5 0a sbc r13, r21 |
7276: a6 01 movw r20, r12 |
7278: 95 01 movw r18, r10 |
727a: 0f ac ldd r0, Y+63 ; 0x3f |
727c: 04 c0 rjmp .+8 ; 0x7286 <__divdi3+0xd70> |
727e: ee 0c add r14, r14 |
7280: ff 1c adc r15, r15 |
7282: 00 1f adc r16, r16 |
7284: 11 1f adc r17, r17 |
7286: 0a 94 dec r0 |
7288: d2 f7 brpl .-12 ; 0x727e <__divdi3+0xd68> |
728a: d2 01 movw r26, r4 |
728c: c1 01 movw r24, r2 |
728e: 04 c0 rjmp .+8 ; 0x7298 <__divdi3+0xd82> |
7290: b6 95 lsr r27 |
7292: a7 95 ror r26 |
7294: 97 95 ror r25 |
7296: 87 95 ror r24 |
7298: aa 94 dec r10 |
729a: d2 f7 brpl .-12 ; 0x7290 <__divdi3+0xd7a> |
729c: e8 2a or r14, r24 |
729e: f9 2a or r15, r25 |
72a0: 0a 2b or r16, r26 |
72a2: 1b 2b or r17, r27 |
72a4: 25 96 adiw r28, 0x05 ; 5 |
72a6: ec ae std Y+60, r14 ; 0x3c |
72a8: fd ae std Y+61, r15 ; 0x3d |
72aa: 0e af std Y+62, r16 ; 0x3e |
72ac: 1f af std Y+63, r17 ; 0x3f |
72ae: 25 97 sbiw r28, 0x05 ; 5 |
72b0: 0f ac ldd r0, Y+63 ; 0x3f |
72b2: 04 c0 rjmp .+8 ; 0x72bc <__divdi3+0xda6> |
72b4: 22 0c add r2, r2 |
72b6: 33 1c adc r3, r3 |
72b8: 44 1c adc r4, r4 |
72ba: 55 1c adc r5, r5 |
72bc: 0a 94 dec r0 |
72be: d2 f7 brpl .-12 ; 0x72b4 <__divdi3+0xd9e> |
72c0: 29 a6 std Y+41, r2 ; 0x29 |
72c2: 3a a6 std Y+42, r3 ; 0x2a |
72c4: 4b a6 std Y+43, r4 ; 0x2b |
72c6: 5c a6 std Y+44, r5 ; 0x2c |
72c8: 2d 96 adiw r28, 0x0d ; 13 |
72ca: ac ac ldd r10, Y+60 ; 0x3c |
72cc: bd ac ldd r11, Y+61 ; 0x3d |
72ce: ce ac ldd r12, Y+62 ; 0x3e |
72d0: df ac ldd r13, Y+63 ; 0x3f |
72d2: 2d 97 sbiw r28, 0x0d ; 13 |
72d4: 02 2e mov r0, r18 |
72d6: 04 c0 rjmp .+8 ; 0x72e0 <__divdi3+0xdca> |
72d8: d6 94 lsr r13 |
72da: c7 94 ror r12 |
72dc: b7 94 ror r11 |
72de: a7 94 ror r10 |
72e0: 0a 94 dec r0 |
72e2: d2 f7 brpl .-12 ; 0x72d8 <__divdi3+0xdc2> |
72e4: 2d 96 adiw r28, 0x0d ; 13 |
72e6: ec ac ldd r14, Y+60 ; 0x3c |
72e8: fd ac ldd r15, Y+61 ; 0x3d |
72ea: 0e ad ldd r16, Y+62 ; 0x3e |
72ec: 1f ad ldd r17, Y+63 ; 0x3f |
72ee: 2d 97 sbiw r28, 0x0d ; 13 |
72f0: 0f ac ldd r0, Y+63 ; 0x3f |
72f2: 04 c0 rjmp .+8 ; 0x72fc <__divdi3+0xde6> |
72f4: ee 0c add r14, r14 |
72f6: ff 1c adc r15, r15 |
72f8: 00 1f adc r16, r16 |
72fa: 11 1f adc r17, r17 |
72fc: 0a 94 dec r0 |
72fe: d2 f7 brpl .-12 ; 0x72f4 <__divdi3+0xdde> |
7300: 29 96 adiw r28, 0x09 ; 9 |
7302: 8c ad ldd r24, Y+60 ; 0x3c |
7304: 9d ad ldd r25, Y+61 ; 0x3d |
7306: ae ad ldd r26, Y+62 ; 0x3e |
7308: bf ad ldd r27, Y+63 ; 0x3f |
730a: 29 97 sbiw r28, 0x09 ; 9 |
730c: 04 c0 rjmp .+8 ; 0x7316 <__divdi3+0xe00> |
730e: b6 95 lsr r27 |
7310: a7 95 ror r26 |
7312: 97 95 ror r25 |
7314: 87 95 ror r24 |
7316: 2a 95 dec r18 |
7318: d2 f7 brpl .-12 ; 0x730e <__divdi3+0xdf8> |
731a: e8 2a or r14, r24 |
731c: f9 2a or r15, r25 |
731e: 0a 2b or r16, r26 |
7320: 1b 2b or r17, r27 |
7322: ed aa std Y+53, r14 ; 0x35 |
7324: fe aa std Y+54, r15 ; 0x36 |
7326: 0f ab std Y+55, r16 ; 0x37 |
7328: 18 af std Y+56, r17 ; 0x38 |
732a: 25 96 adiw r28, 0x05 ; 5 |
732c: 0c ad ldd r16, Y+60 ; 0x3c |
732e: 1d ad ldd r17, Y+61 ; 0x3d |
7330: 2e ad ldd r18, Y+62 ; 0x3e |
7332: 3f ad ldd r19, Y+63 ; 0x3f |
7334: 25 97 sbiw r28, 0x05 ; 5 |
7336: 79 01 movw r14, r18 |
7338: 00 27 eor r16, r16 |
733a: 11 27 eor r17, r17 |
733c: e5 96 adiw r28, 0x35 ; 53 |
733e: ec ae std Y+60, r14 ; 0x3c |
7340: fd ae std Y+61, r15 ; 0x3d |
7342: 0e af std Y+62, r16 ; 0x3e |
7344: 1f af std Y+63, r17 ; 0x3f |
7346: e5 97 sbiw r28, 0x35 ; 53 |
7348: 25 96 adiw r28, 0x05 ; 5 |
734a: 2c ad ldd r18, Y+60 ; 0x3c |
734c: 3d ad ldd r19, Y+61 ; 0x3d |
734e: 4e ad ldd r20, Y+62 ; 0x3e |
7350: 5f ad ldd r21, Y+63 ; 0x3f |
7352: 25 97 sbiw r28, 0x05 ; 5 |
7354: 40 70 andi r20, 0x00 ; 0 |
7356: 50 70 andi r21, 0x00 ; 0 |
7358: e9 96 adiw r28, 0x39 ; 57 |
735a: 2c af std Y+60, r18 ; 0x3c |
735c: 3d af std Y+61, r19 ; 0x3d |
735e: 4e af std Y+62, r20 ; 0x3e |
7360: 5f af std Y+63, r21 ; 0x3f |
7362: e9 97 sbiw r28, 0x39 ; 57 |
7364: c6 01 movw r24, r12 |
7366: b5 01 movw r22, r10 |
7368: a8 01 movw r20, r16 |
736a: 97 01 movw r18, r14 |
736c: 0e 94 be 3e call 0x7d7c ; 0x7d7c <__udivmodsi4> |
7370: ed 96 adiw r28, 0x3d ; 61 |
7372: 2c af std Y+60, r18 ; 0x3c |
7374: 3d af std Y+61, r19 ; 0x3d |
7376: 4e af std Y+62, r20 ; 0x3e |
7378: 5f af std Y+63, r21 ; 0x3f |
737a: ed 97 sbiw r28, 0x3d ; 61 |
737c: e9 96 adiw r28, 0x39 ; 57 |
737e: 6c ad ldd r22, Y+60 ; 0x3c |
7380: 7d ad ldd r23, Y+61 ; 0x3d |
7382: 8e ad ldd r24, Y+62 ; 0x3e |
7384: 9f ad ldd r25, Y+63 ; 0x3f |
7386: e9 97 sbiw r28, 0x39 ; 57 |
7388: 0e 94 78 3e call 0x7cf0 ; 0x7cf0 <__mulsi3> |
738c: 3b 01 movw r6, r22 |
738e: 4c 01 movw r8, r24 |
7390: c6 01 movw r24, r12 |
7392: b5 01 movw r22, r10 |
7394: a8 01 movw r20, r16 |
7396: 97 01 movw r18, r14 |
7398: 0e 94 be 3e call 0x7d7c ; 0x7d7c <__udivmodsi4> |
739c: cb 01 movw r24, r22 |
739e: 77 27 eor r23, r23 |
73a0: 66 27 eor r22, r22 |
73a2: ad a8 ldd r10, Y+53 ; 0x35 |
73a4: be a8 ldd r11, Y+54 ; 0x36 |
73a6: cf a8 ldd r12, Y+55 ; 0x37 |
73a8: d8 ac ldd r13, Y+56 ; 0x38 |
73aa: 96 01 movw r18, r12 |
73ac: 44 27 eor r20, r20 |
73ae: 55 27 eor r21, r21 |
73b0: 7b 01 movw r14, r22 |
73b2: 8c 01 movw r16, r24 |
73b4: e2 2a or r14, r18 |
73b6: f3 2a or r15, r19 |
73b8: 04 2b or r16, r20 |
73ba: 15 2b or r17, r21 |
73bc: e6 14 cp r14, r6 |
73be: f7 04 cpc r15, r7 |
73c0: 08 05 cpc r16, r8 |
73c2: 19 05 cpc r17, r9 |
73c4: 00 f5 brcc .+64 ; 0x7406 <__divdi3+0xef0> |
73c6: ed 96 adiw r28, 0x3d ; 61 |
73c8: 2c ad ldd r18, Y+60 ; 0x3c |
73ca: 3d ad ldd r19, Y+61 ; 0x3d |
73cc: 4e ad ldd r20, Y+62 ; 0x3e |
73ce: 5f ad ldd r21, Y+63 ; 0x3f |
73d0: ed 97 sbiw r28, 0x3d ; 61 |
73d2: 21 50 subi r18, 0x01 ; 1 |
73d4: 30 40 sbci r19, 0x00 ; 0 |
73d6: 40 40 sbci r20, 0x00 ; 0 |
73d8: 50 40 sbci r21, 0x00 ; 0 |
73da: ed 96 adiw r28, 0x3d ; 61 |
73dc: 2c af std Y+60, r18 ; 0x3c |
73de: 3d af std Y+61, r19 ; 0x3d |
73e0: 4e af std Y+62, r20 ; 0x3e |
73e2: 5f af std Y+63, r21 ; 0x3f |
73e4: ed 97 sbiw r28, 0x3d ; 61 |
73e6: 25 96 adiw r28, 0x05 ; 5 |
73e8: 8c ad ldd r24, Y+60 ; 0x3c |
73ea: 9d ad ldd r25, Y+61 ; 0x3d |
73ec: ae ad ldd r26, Y+62 ; 0x3e |
73ee: bf ad ldd r27, Y+63 ; 0x3f |
73f0: 25 97 sbiw r28, 0x05 ; 5 |
73f2: e8 0e add r14, r24 |
73f4: f9 1e adc r15, r25 |
73f6: 0a 1f adc r16, r26 |
73f8: 1b 1f adc r17, r27 |
73fa: e8 16 cp r14, r24 |
73fc: f9 06 cpc r15, r25 |
73fe: 0a 07 cpc r16, r26 |
7400: 1b 07 cpc r17, r27 |
7402: 08 f0 brcs .+2 ; 0x7406 <__divdi3+0xef0> |
7404: b2 c2 rjmp .+1380 ; 0x796a <__divdi3+0x1454> |
7406: e6 18 sub r14, r6 |
7408: f7 08 sbc r15, r7 |
740a: 08 09 sbc r16, r8 |
740c: 19 09 sbc r17, r9 |
740e: c8 01 movw r24, r16 |
7410: b7 01 movw r22, r14 |
7412: e5 96 adiw r28, 0x35 ; 53 |
7414: 2c ad ldd r18, Y+60 ; 0x3c |
7416: 3d ad ldd r19, Y+61 ; 0x3d |
7418: 4e ad ldd r20, Y+62 ; 0x3e |
741a: 5f ad ldd r21, Y+63 ; 0x3f |
741c: e5 97 sbiw r28, 0x35 ; 53 |
741e: 0e 94 be 3e call 0x7d7c ; 0x7d7c <__udivmodsi4> |
7422: 19 01 movw r2, r18 |
7424: 2a 01 movw r4, r20 |
7426: e9 96 adiw r28, 0x39 ; 57 |
7428: 6c ad ldd r22, Y+60 ; 0x3c |
742a: 7d ad ldd r23, Y+61 ; 0x3d |
742c: 8e ad ldd r24, Y+62 ; 0x3e |
742e: 9f ad ldd r25, Y+63 ; 0x3f |
7430: e9 97 sbiw r28, 0x39 ; 57 |
7432: 0e 94 78 3e call 0x7cf0 ; 0x7cf0 <__mulsi3> |
7436: 3b 01 movw r6, r22 |
7438: 4c 01 movw r8, r24 |
743a: c8 01 movw r24, r16 |
743c: b7 01 movw r22, r14 |
743e: e5 96 adiw r28, 0x35 ; 53 |
7440: 2c ad ldd r18, Y+60 ; 0x3c |
7442: 3d ad ldd r19, Y+61 ; 0x3d |
7444: 4e ad ldd r20, Y+62 ; 0x3e |
7446: 5f ad ldd r21, Y+63 ; 0x3f |
7448: e5 97 sbiw r28, 0x35 ; 53 |
744a: 0e 94 be 3e call 0x7d7c ; 0x7d7c <__udivmodsi4> |
744e: cb 01 movw r24, r22 |
7450: 77 27 eor r23, r23 |
7452: 66 27 eor r22, r22 |
7454: 2d a9 ldd r18, Y+53 ; 0x35 |
7456: 3e a9 ldd r19, Y+54 ; 0x36 |
7458: 4f a9 ldd r20, Y+55 ; 0x37 |
745a: 58 ad ldd r21, Y+56 ; 0x38 |
745c: 40 70 andi r20, 0x00 ; 0 |
745e: 50 70 andi r21, 0x00 ; 0 |
7460: 5b 01 movw r10, r22 |
7462: 6c 01 movw r12, r24 |
7464: a2 2a or r10, r18 |
7466: b3 2a or r11, r19 |
7468: c4 2a or r12, r20 |
746a: d5 2a or r13, r21 |
746c: a6 14 cp r10, r6 |
746e: b7 04 cpc r11, r7 |
7470: c8 04 cpc r12, r8 |
7472: d9 04 cpc r13, r9 |
7474: a8 f4 brcc .+42 ; 0x74a0 <__divdi3+0xf8a> |
7476: 08 94 sec |
7478: 21 08 sbc r2, r1 |
747a: 31 08 sbc r3, r1 |
747c: 41 08 sbc r4, r1 |
747e: 51 08 sbc r5, r1 |
7480: 25 96 adiw r28, 0x05 ; 5 |
7482: ec ac ldd r14, Y+60 ; 0x3c |
7484: fd ac ldd r15, Y+61 ; 0x3d |
7486: 0e ad ldd r16, Y+62 ; 0x3e |
7488: 1f ad ldd r17, Y+63 ; 0x3f |
748a: 25 97 sbiw r28, 0x05 ; 5 |
748c: ae 0c add r10, r14 |
748e: bf 1c adc r11, r15 |
7490: c0 1e adc r12, r16 |
7492: d1 1e adc r13, r17 |
7494: ae 14 cp r10, r14 |
7496: bf 04 cpc r11, r15 |
7498: c0 06 cpc r12, r16 |
749a: d1 06 cpc r13, r17 |
749c: 08 f0 brcs .+2 ; 0x74a0 <__divdi3+0xf8a> |
749e: 55 c2 rjmp .+1194 ; 0x794a <__divdi3+0x1434> |
74a0: a6 18 sub r10, r6 |
74a2: b7 08 sbc r11, r7 |
74a4: c8 08 sbc r12, r8 |
74a6: d9 08 sbc r13, r9 |
74a8: a9 aa std Y+49, r10 ; 0x31 |
74aa: ba aa std Y+50, r11 ; 0x32 |
74ac: cb aa std Y+51, r12 ; 0x33 |
74ae: dc aa std Y+52, r13 ; 0x34 |
74b0: ed 96 adiw r28, 0x3d ; 61 |
74b2: 0c ad ldd r16, Y+60 ; 0x3c |
74b4: 1d ad ldd r17, Y+61 ; 0x3d |
74b6: 2e ad ldd r18, Y+62 ; 0x3e |
74b8: 3f ad ldd r19, Y+63 ; 0x3f |
74ba: ed 97 sbiw r28, 0x3d ; 61 |
74bc: d8 01 movw r26, r16 |
74be: 99 27 eor r25, r25 |
74c0: 88 27 eor r24, r24 |
74c2: 28 2a or r2, r24 |
74c4: 39 2a or r3, r25 |
74c6: 4a 2a or r4, r26 |
74c8: 5b 2a or r5, r27 |
74ca: 61 96 adiw r28, 0x11 ; 17 |
74cc: 2c ae std Y+60, r2 ; 0x3c |
74ce: 3d ae std Y+61, r3 ; 0x3d |
74d0: 4e ae std Y+62, r4 ; 0x3e |
74d2: 5f ae std Y+63, r5 ; 0x3f |
74d4: 61 97 sbiw r28, 0x11 ; 17 |
74d6: 82 01 movw r16, r4 |
74d8: 71 01 movw r14, r2 |
74da: 2f ef ldi r18, 0xFF ; 255 |
74dc: 3f ef ldi r19, 0xFF ; 255 |
74de: 40 e0 ldi r20, 0x00 ; 0 |
74e0: 50 e0 ldi r21, 0x00 ; 0 |
74e2: e2 22 and r14, r18 |
74e4: f3 22 and r15, r19 |
74e6: 04 23 and r16, r20 |
74e8: 15 23 and r17, r21 |
74ea: 12 01 movw r2, r4 |
74ec: 44 24 eor r4, r4 |
74ee: 55 24 eor r5, r5 |
74f0: a9 a4 ldd r10, Y+41 ; 0x29 |
74f2: ba a4 ldd r11, Y+42 ; 0x2a |
74f4: cb a4 ldd r12, Y+43 ; 0x2b |
74f6: dc a4 ldd r13, Y+44 ; 0x2c |
74f8: a2 22 and r10, r18 |
74fa: b3 22 and r11, r19 |
74fc: c4 22 and r12, r20 |
74fe: d5 22 and r13, r21 |
7500: 29 a5 ldd r18, Y+41 ; 0x29 |
7502: 3a a5 ldd r19, Y+42 ; 0x2a |
7504: 4b a5 ldd r20, Y+43 ; 0x2b |
7506: 5c a5 ldd r21, Y+44 ; 0x2c |
7508: 3a 01 movw r6, r20 |
750a: 88 24 eor r8, r8 |
750c: 99 24 eor r9, r9 |
750e: c8 01 movw r24, r16 |
7510: b7 01 movw r22, r14 |
7512: a6 01 movw r20, r12 |
7514: 95 01 movw r18, r10 |
7516: 0e 94 78 3e call 0x7cf0 ; 0x7cf0 <__mulsi3> |
751a: c3 58 subi r28, 0x83 ; 131 |
751c: df 4f sbci r29, 0xFF ; 255 |
751e: 68 83 st Y, r22 |
7520: 79 83 std Y+1, r23 ; 0x01 |
7522: 8a 83 std Y+2, r24 ; 0x02 |
7524: 9b 83 std Y+3, r25 ; 0x03 |
7526: cd 57 subi r28, 0x7D ; 125 |
7528: d0 40 sbci r29, 0x00 ; 0 |
752a: c8 01 movw r24, r16 |
752c: b7 01 movw r22, r14 |
752e: a4 01 movw r20, r8 |
7530: 93 01 movw r18, r6 |
7532: 0e 94 78 3e call 0x7cf0 ; 0x7cf0 <__mulsi3> |
7536: 7b 01 movw r14, r22 |
7538: 8c 01 movw r16, r24 |
753a: c2 01 movw r24, r4 |
753c: b1 01 movw r22, r2 |
753e: a6 01 movw r20, r12 |
7540: 95 01 movw r18, r10 |
7542: 0e 94 78 3e call 0x7cf0 ; 0x7cf0 <__mulsi3> |
7546: 5b 01 movw r10, r22 |
7548: 6c 01 movw r12, r24 |
754a: c2 01 movw r24, r4 |
754c: b1 01 movw r22, r2 |
754e: a4 01 movw r20, r8 |
7550: 93 01 movw r18, r6 |
7552: 0e 94 78 3e call 0x7cf0 ; 0x7cf0 <__mulsi3> |
7556: 9b 01 movw r18, r22 |
7558: ac 01 movw r20, r24 |
755a: ea 0c add r14, r10 |
755c: fb 1c adc r15, r11 |
755e: 0c 1d adc r16, r12 |
7560: 1d 1d adc r17, r13 |
7562: c3 58 subi r28, 0x83 ; 131 |
7564: df 4f sbci r29, 0xFF ; 255 |
7566: 68 80 ld r6, Y |
7568: 79 80 ldd r7, Y+1 ; 0x01 |
756a: 8a 80 ldd r8, Y+2 ; 0x02 |
756c: 9b 80 ldd r9, Y+3 ; 0x03 |
756e: cd 57 subi r28, 0x7D ; 125 |
7570: d0 40 sbci r29, 0x00 ; 0 |
7572: c4 01 movw r24, r8 |
7574: aa 27 eor r26, r26 |
7576: bb 27 eor r27, r27 |
7578: e8 0e add r14, r24 |
757a: f9 1e adc r15, r25 |
757c: 0a 1f adc r16, r26 |
757e: 1b 1f adc r17, r27 |
7580: ea 14 cp r14, r10 |
7582: fb 04 cpc r15, r11 |
7584: 0c 05 cpc r16, r12 |
7586: 1d 05 cpc r17, r13 |
7588: 20 f4 brcc .+8 ; 0x7592 <__divdi3+0x107c> |
758a: 20 50 subi r18, 0x00 ; 0 |
758c: 30 40 sbci r19, 0x00 ; 0 |
758e: 4f 4f sbci r20, 0xFF ; 255 |
7590: 5f 4f sbci r21, 0xFF ; 255 |
7592: c8 01 movw r24, r16 |
7594: aa 27 eor r26, r26 |
7596: bb 27 eor r27, r27 |
7598: 28 0f add r18, r24 |
759a: 39 1f adc r19, r25 |
759c: 4a 1f adc r20, r26 |
759e: 5b 1f adc r21, r27 |
75a0: 89 a8 ldd r8, Y+49 ; 0x31 |
75a2: 9a a8 ldd r9, Y+50 ; 0x32 |
75a4: ab a8 ldd r10, Y+51 ; 0x33 |
75a6: bc a8 ldd r11, Y+52 ; 0x34 |
75a8: 82 16 cp r8, r18 |
75aa: 93 06 cpc r9, r19 |
75ac: a4 06 cpc r10, r20 |
75ae: b5 06 cpc r11, r21 |
75b0: 08 f4 brcc .+2 ; 0x75b4 <__divdi3+0x109e> |
75b2: 79 c1 rjmp .+754 ; 0x78a6 <__divdi3+0x1390> |
75b4: 82 16 cp r8, r18 |
75b6: 93 06 cpc r9, r19 |
75b8: a4 06 cpc r10, r20 |
75ba: b5 06 cpc r11, r21 |
75bc: 09 f4 brne .+2 ; 0x75c0 <__divdi3+0x10aa> |
75be: 46 c1 rjmp .+652 ; 0x784c <__divdi3+0x1336> |
75c0: 61 96 adiw r28, 0x11 ; 17 |
75c2: 2c ac ldd r2, Y+60 ; 0x3c |
75c4: 3d ac ldd r3, Y+61 ; 0x3d |
75c6: 4e ac ldd r4, Y+62 ; 0x3e |
75c8: 5f ac ldd r5, Y+63 ; 0x3f |
75ca: 61 97 sbiw r28, 0x11 ; 17 |
75cc: 20 e0 ldi r18, 0x00 ; 0 |
75ce: 30 e0 ldi r19, 0x00 ; 0 |
75d0: 40 e0 ldi r20, 0x00 ; 0 |
75d2: 50 e0 ldi r21, 0x00 ; 0 |
75d4: 68 c9 rjmp .-3376 ; 0x68a6 <__divdi3+0x390> |
75d6: 7e ae std Y+62, r7 ; 0x3e |
75d8: 6d ae std Y+61, r6 ; 0x3d |
75da: 0d ac ldd r0, Y+61 ; 0x3d |
75dc: 04 c0 rjmp .+8 ; 0x75e6 <__divdi3+0x10d0> |
75de: 22 0c add r2, r2 |
75e0: 33 1c adc r3, r3 |
75e2: 44 1c adc r4, r4 |
75e4: 55 1c adc r5, r5 |
75e6: 0a 94 dec r0 |
75e8: d2 f7 brpl .-12 ; 0x75de <__divdi3+0x10c8> |
75ea: 26 19 sub r18, r6 |
75ec: 37 09 sbc r19, r7 |
75ee: 48 09 sbc r20, r8 |
75f0: 59 09 sbc r21, r9 |
75f2: da 01 movw r26, r20 |
75f4: c9 01 movw r24, r18 |
75f6: 2d 96 adiw r28, 0x0d ; 13 |
75f8: ec ac ldd r14, Y+60 ; 0x3c |
75fa: fd ac ldd r15, Y+61 ; 0x3d |
75fc: 0e ad ldd r16, Y+62 ; 0x3e |
75fe: 1f ad ldd r17, Y+63 ; 0x3f |
7600: 2d 97 sbiw r28, 0x0d ; 13 |
7602: 04 c0 rjmp .+8 ; 0x760c <__divdi3+0x10f6> |
7604: 16 95 lsr r17 |
7606: 07 95 ror r16 |
7608: f7 94 ror r15 |
760a: e7 94 ror r14 |
760c: 2a 95 dec r18 |
760e: d2 f7 brpl .-12 ; 0x7604 <__divdi3+0x10ee> |
7610: 2d 96 adiw r28, 0x0d ; 13 |
7612: 2c ad ldd r18, Y+60 ; 0x3c |
7614: 3d ad ldd r19, Y+61 ; 0x3d |
7616: 4e ad ldd r20, Y+62 ; 0x3e |
7618: 5f ad ldd r21, Y+63 ; 0x3f |
761a: 2d 97 sbiw r28, 0x0d ; 13 |
761c: 0d ac ldd r0, Y+61 ; 0x3d |
761e: 04 c0 rjmp .+8 ; 0x7628 <__divdi3+0x1112> |
7620: 22 0f add r18, r18 |
7622: 33 1f adc r19, r19 |
7624: 44 1f adc r20, r20 |
7626: 55 1f adc r21, r21 |
7628: 0a 94 dec r0 |
762a: d2 f7 brpl .-12 ; 0x7620 <__divdi3+0x110a> |
762c: 29 96 adiw r28, 0x09 ; 9 |
762e: 6c ac ldd r6, Y+60 ; 0x3c |
7630: 7d ac ldd r7, Y+61 ; 0x3d |
7632: 8e ac ldd r8, Y+62 ; 0x3e |
7634: 9f ac ldd r9, Y+63 ; 0x3f |
7636: 29 97 sbiw r28, 0x09 ; 9 |
7638: 04 c0 rjmp .+8 ; 0x7642 <__divdi3+0x112c> |
763a: 96 94 lsr r9 |
763c: 87 94 ror r8 |
763e: 77 94 ror r7 |
7640: 67 94 ror r6 |
7642: 8a 95 dec r24 |
7644: d2 f7 brpl .-12 ; 0x763a <__divdi3+0x1124> |
7646: 26 29 or r18, r6 |
7648: 37 29 or r19, r7 |
764a: 48 29 or r20, r8 |
764c: 59 29 or r21, r9 |
764e: 2d a7 std Y+45, r18 ; 0x2d |
7650: 3e a7 std Y+46, r19 ; 0x2e |
7652: 4f a7 std Y+47, r20 ; 0x2f |
7654: 58 ab std Y+48, r21 ; 0x30 |
7656: 42 01 movw r8, r4 |
7658: aa 24 eor r10, r10 |
765a: bb 24 eor r11, r11 |
765c: a1 96 adiw r28, 0x21 ; 33 |
765e: 8c ae std Y+60, r8 ; 0x3c |
7660: 9d ae std Y+61, r9 ; 0x3d |
7662: ae ae std Y+62, r10 ; 0x3e |
7664: bf ae std Y+63, r11 ; 0x3f |
7666: a1 97 sbiw r28, 0x21 ; 33 |
7668: a2 01 movw r20, r4 |
766a: 91 01 movw r18, r2 |
766c: 40 70 andi r20, 0x00 ; 0 |
766e: 50 70 andi r21, 0x00 ; 0 |
7670: a5 96 adiw r28, 0x25 ; 37 |
7672: 2c af std Y+60, r18 ; 0x3c |
7674: 3d af std Y+61, r19 ; 0x3d |
7676: 4e af std Y+62, r20 ; 0x3e |
7678: 5f af std Y+63, r21 ; 0x3f |
767a: a5 97 sbiw r28, 0x25 ; 37 |
767c: c8 01 movw r24, r16 |
767e: b7 01 movw r22, r14 |
7680: a5 01 movw r20, r10 |
7682: 94 01 movw r18, r8 |
7684: 0e 94 be 3e call 0x7d7c ; 0x7d7c <__udivmodsi4> |
7688: a9 96 adiw r28, 0x29 ; 41 |
768a: 2c af std Y+60, r18 ; 0x3c |
768c: 3d af std Y+61, r19 ; 0x3d |
768e: 4e af std Y+62, r20 ; 0x3e |
7690: 5f af std Y+63, r21 ; 0x3f |
7692: a9 97 sbiw r28, 0x29 ; 41 |
7694: a5 96 adiw r28, 0x25 ; 37 |
7696: 6c ad ldd r22, Y+60 ; 0x3c |
7698: 7d ad ldd r23, Y+61 ; 0x3d |
769a: 8e ad ldd r24, Y+62 ; 0x3e |
769c: 9f ad ldd r25, Y+63 ; 0x3f |
769e: a5 97 sbiw r28, 0x25 ; 37 |
76a0: 0e 94 78 3e call 0x7cf0 ; 0x7cf0 <__mulsi3> |
76a4: 5b 01 movw r10, r22 |
76a6: 6c 01 movw r12, r24 |
76a8: c8 01 movw r24, r16 |
76aa: b7 01 movw r22, r14 |
76ac: a1 96 adiw r28, 0x21 ; 33 |
76ae: 2c ad ldd r18, Y+60 ; 0x3c |
76b0: 3d ad ldd r19, Y+61 ; 0x3d |
76b2: 4e ad ldd r20, Y+62 ; 0x3e |
76b4: 5f ad ldd r21, Y+63 ; 0x3f |
76b6: a1 97 sbiw r28, 0x21 ; 33 |
76b8: 0e 94 be 3e call 0x7d7c ; 0x7d7c <__udivmodsi4> |
76bc: cb 01 movw r24, r22 |
76be: 77 27 eor r23, r23 |
76c0: 66 27 eor r22, r22 |
76c2: 6d a4 ldd r6, Y+45 ; 0x2d |
76c4: 7e a4 ldd r7, Y+46 ; 0x2e |
76c6: 8f a4 ldd r8, Y+47 ; 0x2f |
76c8: 98 a8 ldd r9, Y+48 ; 0x30 |
76ca: 94 01 movw r18, r8 |
76cc: 44 27 eor r20, r20 |
76ce: 55 27 eor r21, r21 |
76d0: 7b 01 movw r14, r22 |
76d2: 8c 01 movw r16, r24 |
76d4: e2 2a or r14, r18 |
76d6: f3 2a or r15, r19 |
76d8: 04 2b or r16, r20 |
76da: 15 2b or r17, r21 |
76dc: ea 14 cp r14, r10 |
76de: fb 04 cpc r15, r11 |
76e0: 0c 05 cpc r16, r12 |
76e2: 1d 05 cpc r17, r13 |
76e4: d0 f4 brcc .+52 ; 0x771a <__divdi3+0x1204> |
76e6: a9 96 adiw r28, 0x29 ; 41 |
76e8: 2c ad ldd r18, Y+60 ; 0x3c |
76ea: 3d ad ldd r19, Y+61 ; 0x3d |
76ec: 4e ad ldd r20, Y+62 ; 0x3e |
76ee: 5f ad ldd r21, Y+63 ; 0x3f |
76f0: a9 97 sbiw r28, 0x29 ; 41 |
76f2: 21 50 subi r18, 0x01 ; 1 |
76f4: 30 40 sbci r19, 0x00 ; 0 |
76f6: 40 40 sbci r20, 0x00 ; 0 |
76f8: 50 40 sbci r21, 0x00 ; 0 |
76fa: a9 96 adiw r28, 0x29 ; 41 |
76fc: 2c af std Y+60, r18 ; 0x3c |
76fe: 3d af std Y+61, r19 ; 0x3d |
7700: 4e af std Y+62, r20 ; 0x3e |
7702: 5f af std Y+63, r21 ; 0x3f |
7704: a9 97 sbiw r28, 0x29 ; 41 |
7706: e2 0c add r14, r2 |
7708: f3 1c adc r15, r3 |
770a: 04 1d adc r16, r4 |
770c: 15 1d adc r17, r5 |
770e: e2 14 cp r14, r2 |
7710: f3 04 cpc r15, r3 |
7712: 04 05 cpc r16, r4 |
7714: 15 05 cpc r17, r5 |
7716: 08 f0 brcs .+2 ; 0x771a <__divdi3+0x1204> |
7718: 03 c1 rjmp .+518 ; 0x7920 <__divdi3+0x140a> |
771a: ea 18 sub r14, r10 |
771c: fb 08 sbc r15, r11 |
771e: 0c 09 sbc r16, r12 |
7720: 1d 09 sbc r17, r13 |
7722: c8 01 movw r24, r16 |
7724: b7 01 movw r22, r14 |
7726: a1 96 adiw r28, 0x21 ; 33 |
7728: 2c ad ldd r18, Y+60 ; 0x3c |
772a: 3d ad ldd r19, Y+61 ; 0x3d |
772c: 4e ad ldd r20, Y+62 ; 0x3e |
772e: 5f ad ldd r21, Y+63 ; 0x3f |
7730: a1 97 sbiw r28, 0x21 ; 33 |
7732: 0e 94 be 3e call 0x7d7c ; 0x7d7c <__udivmodsi4> |
7736: ad 96 adiw r28, 0x2d ; 45 |
7738: 2c af std Y+60, r18 ; 0x3c |
773a: 3d af std Y+61, r19 ; 0x3d |
773c: 4e af std Y+62, r20 ; 0x3e |
773e: 5f af std Y+63, r21 ; 0x3f |
7740: ad 97 sbiw r28, 0x2d ; 45 |
7742: a5 96 adiw r28, 0x25 ; 37 |
7744: 6c ad ldd r22, Y+60 ; 0x3c |
7746: 7d ad ldd r23, Y+61 ; 0x3d |
7748: 8e ad ldd r24, Y+62 ; 0x3e |
774a: 9f ad ldd r25, Y+63 ; 0x3f |
774c: a5 97 sbiw r28, 0x25 ; 37 |
774e: 0e 94 78 3e call 0x7cf0 ; 0x7cf0 <__mulsi3> |
7752: 3b 01 movw r6, r22 |
7754: 4c 01 movw r8, r24 |
7756: c8 01 movw r24, r16 |
7758: b7 01 movw r22, r14 |
775a: a1 96 adiw r28, 0x21 ; 33 |
775c: 2c ad ldd r18, Y+60 ; 0x3c |
775e: 3d ad ldd r19, Y+61 ; 0x3d |
7760: 4e ad ldd r20, Y+62 ; 0x3e |
7762: 5f ad ldd r21, Y+63 ; 0x3f |
7764: a1 97 sbiw r28, 0x21 ; 33 |
7766: 0e 94 be 3e call 0x7d7c ; 0x7d7c <__udivmodsi4> |
776a: cb 01 movw r24, r22 |
776c: 77 27 eor r23, r23 |
776e: 66 27 eor r22, r22 |
7770: 2d a5 ldd r18, Y+45 ; 0x2d |
7772: 3e a5 ldd r19, Y+46 ; 0x2e |
7774: 4f a5 ldd r20, Y+47 ; 0x2f |
7776: 58 a9 ldd r21, Y+48 ; 0x30 |
7778: 40 70 andi r20, 0x00 ; 0 |
777a: 50 70 andi r21, 0x00 ; 0 |
777c: 5b 01 movw r10, r22 |
777e: 6c 01 movw r12, r24 |
7780: a2 2a or r10, r18 |
7782: b3 2a or r11, r19 |
7784: c4 2a or r12, r20 |
7786: d5 2a or r13, r21 |
7788: a6 14 cp r10, r6 |
778a: b7 04 cpc r11, r7 |
778c: c8 04 cpc r12, r8 |
778e: d9 04 cpc r13, r9 |
7790: 50 f5 brcc .+84 ; 0x77e6 <__divdi3+0x12d0> |
7792: ad 96 adiw r28, 0x2d ; 45 |
7794: 8c ad ldd r24, Y+60 ; 0x3c |
7796: 9d ad ldd r25, Y+61 ; 0x3d |
7798: ae ad ldd r26, Y+62 ; 0x3e |
779a: bf ad ldd r27, Y+63 ; 0x3f |
779c: ad 97 sbiw r28, 0x2d ; 45 |
779e: 01 97 sbiw r24, 0x01 ; 1 |
77a0: a1 09 sbc r26, r1 |
77a2: b1 09 sbc r27, r1 |
77a4: ad 96 adiw r28, 0x2d ; 45 |
77a6: 8c af std Y+60, r24 ; 0x3c |
77a8: 9d af std Y+61, r25 ; 0x3d |
77aa: ae af std Y+62, r26 ; 0x3e |
77ac: bf af std Y+63, r27 ; 0x3f |
77ae: ad 97 sbiw r28, 0x2d ; 45 |
77b0: a2 0c add r10, r2 |
77b2: b3 1c adc r11, r3 |
77b4: c4 1c adc r12, r4 |
77b6: d5 1c adc r13, r5 |
77b8: a2 14 cp r10, r2 |
77ba: b3 04 cpc r11, r3 |
77bc: c4 04 cpc r12, r4 |
77be: d5 04 cpc r13, r5 |
77c0: 90 f0 brcs .+36 ; 0x77e6 <__divdi3+0x12d0> |
77c2: a6 14 cp r10, r6 |
77c4: b7 04 cpc r11, r7 |
77c6: c8 04 cpc r12, r8 |
77c8: d9 04 cpc r13, r9 |
77ca: 68 f4 brcc .+26 ; 0x77e6 <__divdi3+0x12d0> |
77cc: 01 97 sbiw r24, 0x01 ; 1 |
77ce: a1 09 sbc r26, r1 |
77d0: b1 09 sbc r27, r1 |
77d2: ad 96 adiw r28, 0x2d ; 45 |
77d4: 8c af std Y+60, r24 ; 0x3c |
77d6: 9d af std Y+61, r25 ; 0x3d |
77d8: ae af std Y+62, r26 ; 0x3e |
77da: bf af std Y+63, r27 ; 0x3f |
77dc: ad 97 sbiw r28, 0x2d ; 45 |
77de: a2 0c add r10, r2 |
77e0: b3 1c adc r11, r3 |
77e2: c4 1c adc r12, r4 |
77e4: d5 1c adc r13, r5 |
77e6: 29 96 adiw r28, 0x09 ; 9 |
77e8: ec ac ldd r14, Y+60 ; 0x3c |
77ea: fd ac ldd r15, Y+61 ; 0x3d |
77ec: 0e ad ldd r16, Y+62 ; 0x3e |
77ee: 1f ad ldd r17, Y+63 ; 0x3f |
77f0: 29 97 sbiw r28, 0x09 ; 9 |
77f2: 0d ac ldd r0, Y+61 ; 0x3d |
77f4: 04 c0 rjmp .+8 ; 0x77fe <__divdi3+0x12e8> |
77f6: ee 0c add r14, r14 |
77f8: ff 1c adc r15, r15 |
77fa: 00 1f adc r16, r16 |
77fc: 11 1f adc r17, r17 |
77fe: 0a 94 dec r0 |
7800: d2 f7 brpl .-12 ; 0x77f6 <__divdi3+0x12e0> |
7802: 29 96 adiw r28, 0x09 ; 9 |
7804: ec ae std Y+60, r14 ; 0x3c |
7806: fd ae std Y+61, r15 ; 0x3d |
7808: 0e af std Y+62, r16 ; 0x3e |
780a: 1f af std Y+63, r17 ; 0x3f |
780c: 29 97 sbiw r28, 0x09 ; 9 |
780e: a6 18 sub r10, r6 |
7810: b7 08 sbc r11, r7 |
7812: c8 08 sbc r12, r8 |
7814: d9 08 sbc r13, r9 |
7816: a9 96 adiw r28, 0x29 ; 41 |
7818: 0c ad ldd r16, Y+60 ; 0x3c |
781a: 1d ad ldd r17, Y+61 ; 0x3d |
781c: 2e ad ldd r18, Y+62 ; 0x3e |
781e: 3f ad ldd r19, Y+63 ; 0x3f |
7820: a9 97 sbiw r28, 0x29 ; 41 |
7822: d8 01 movw r26, r16 |
7824: 99 27 eor r25, r25 |
7826: 88 27 eor r24, r24 |
7828: ad 96 adiw r28, 0x2d ; 45 |
782a: 2c ad ldd r18, Y+60 ; 0x3c |
782c: 3d ad ldd r19, Y+61 ; 0x3d |
782e: 4e ad ldd r20, Y+62 ; 0x3e |
7830: 5f ad ldd r21, Y+63 ; 0x3f |
7832: ad 97 sbiw r28, 0x2d ; 45 |
7834: 28 2b or r18, r24 |
7836: 39 2b or r19, r25 |
7838: 4a 2b or r20, r26 |
783a: 5b 2b or r21, r27 |
783c: 65 96 adiw r28, 0x15 ; 21 |
783e: 2c af std Y+60, r18 ; 0x3c |
7840: 3d af std Y+61, r19 ; 0x3d |
7842: 4e af std Y+62, r20 ; 0x3e |
7844: 5f af std Y+63, r21 ; 0x3f |
7846: 65 97 sbiw r28, 0x15 ; 21 |
7848: 0c 94 82 33 jmp 0x6704 ; 0x6704 <__divdi3+0x1ee> |
784c: 29 96 adiw r28, 0x09 ; 9 |
784e: 8c ad ldd r24, Y+60 ; 0x3c |
7850: 9d ad ldd r25, Y+61 ; 0x3d |
7852: ae ad ldd r26, Y+62 ; 0x3e |
7854: bf ad ldd r27, Y+63 ; 0x3f |
7856: 29 97 sbiw r28, 0x09 ; 9 |
7858: 0f ac ldd r0, Y+63 ; 0x3f |
785a: 04 c0 rjmp .+8 ; 0x7864 <__divdi3+0x134e> |
785c: 88 0f add r24, r24 |
785e: 99 1f adc r25, r25 |
7860: aa 1f adc r26, r26 |
7862: bb 1f adc r27, r27 |
7864: 0a 94 dec r0 |
7866: d2 f7 brpl .-12 ; 0x785c <__divdi3+0x1346> |
7868: a7 01 movw r20, r14 |
786a: 33 27 eor r19, r19 |
786c: 22 27 eor r18, r18 |
786e: c3 58 subi r28, 0x83 ; 131 |
7870: df 4f sbci r29, 0xFF ; 255 |
7872: e8 80 ld r14, Y |
7874: f9 80 ldd r15, Y+1 ; 0x01 |
7876: 0a 81 ldd r16, Y+2 ; 0x02 |
7878: 1b 81 ldd r17, Y+3 ; 0x03 |
787a: cd 57 subi r28, 0x7D ; 125 |
787c: d0 40 sbci r29, 0x00 ; 0 |
787e: 6f ef ldi r22, 0xFF ; 255 |
7880: a6 2e mov r10, r22 |
7882: 6f ef ldi r22, 0xFF ; 255 |
7884: b6 2e mov r11, r22 |
7886: c1 2c mov r12, r1 |
7888: d1 2c mov r13, r1 |
788a: ea 20 and r14, r10 |
788c: fb 20 and r15, r11 |
788e: 0c 21 and r16, r12 |
7890: 1d 21 and r17, r13 |
7892: 2e 0d add r18, r14 |
7894: 3f 1d adc r19, r15 |
7896: 40 1f adc r20, r16 |
7898: 51 1f adc r21, r17 |
789a: 82 17 cp r24, r18 |
789c: 93 07 cpc r25, r19 |
789e: a4 07 cpc r26, r20 |
78a0: b5 07 cpc r27, r21 |
78a2: 08 f0 brcs .+2 ; 0x78a6 <__divdi3+0x1390> |
78a4: 8d ce rjmp .-742 ; 0x75c0 <__divdi3+0x10aa> |
78a6: 61 96 adiw r28, 0x11 ; 17 |
78a8: 2c ac ldd r2, Y+60 ; 0x3c |
78aa: 3d ac ldd r3, Y+61 ; 0x3d |
78ac: 4e ac ldd r4, Y+62 ; 0x3e |
78ae: 5f ac ldd r5, Y+63 ; 0x3f |
78b0: 61 97 sbiw r28, 0x11 ; 17 |
78b2: 08 94 sec |
78b4: 21 08 sbc r2, r1 |
78b6: 31 08 sbc r3, r1 |
78b8: 41 08 sbc r4, r1 |
78ba: 51 08 sbc r5, r1 |
78bc: 20 e0 ldi r18, 0x00 ; 0 |
78be: 30 e0 ldi r19, 0x00 ; 0 |
78c0: 40 e0 ldi r20, 0x00 ; 0 |
78c2: 50 e0 ldi r21, 0x00 ; 0 |
78c4: 0c 94 53 34 jmp 0x68a6 ; 0x68a6 <__divdi3+0x390> |
78c8: 28 e0 ldi r18, 0x08 ; 8 |
78ca: 30 e0 ldi r19, 0x00 ; 0 |
78cc: 40 e0 ldi r20, 0x00 ; 0 |
78ce: 50 e0 ldi r21, 0x00 ; 0 |
78d0: 88 e0 ldi r24, 0x08 ; 8 |
78d2: 90 e0 ldi r25, 0x00 ; 0 |
78d4: 2d ca rjmp .-2982 ; 0x6d30 <__divdi3+0x81a> |
78d6: 28 e0 ldi r18, 0x08 ; 8 |
78d8: 30 e0 ldi r19, 0x00 ; 0 |
78da: 40 e0 ldi r20, 0x00 ; 0 |
78dc: 50 e0 ldi r21, 0x00 ; 0 |
78de: 88 e0 ldi r24, 0x08 ; 8 |
78e0: 90 e0 ldi r25, 0x00 ; 0 |
78e2: e3 c8 rjmp .-3642 ; 0x6aaa <__divdi3+0x594> |
78e4: 28 e0 ldi r18, 0x08 ; 8 |
78e6: 30 e0 ldi r19, 0x00 ; 0 |
78e8: 40 e0 ldi r20, 0x00 ; 0 |
78ea: 50 e0 ldi r21, 0x00 ; 0 |
78ec: 88 e0 ldi r24, 0x08 ; 8 |
78ee: 90 e0 ldi r25, 0x00 ; 0 |
78f0: 0c 94 3a 33 jmp 0x6674 ; 0x6674 <__divdi3+0x15e> |
78f4: 28 e1 ldi r18, 0x18 ; 24 |
78f6: 30 e0 ldi r19, 0x00 ; 0 |
78f8: 40 e0 ldi r20, 0x00 ; 0 |
78fa: 50 e0 ldi r21, 0x00 ; 0 |
78fc: 88 e1 ldi r24, 0x18 ; 24 |
78fe: 90 e0 ldi r25, 0x00 ; 0 |
7900: 17 ca rjmp .-3026 ; 0x6d30 <__divdi3+0x81a> |
7902: 28 e1 ldi r18, 0x18 ; 24 |
7904: 30 e0 ldi r19, 0x00 ; 0 |
7906: 40 e0 ldi r20, 0x00 ; 0 |
7908: 50 e0 ldi r21, 0x00 ; 0 |
790a: 88 e1 ldi r24, 0x18 ; 24 |
790c: 90 e0 ldi r25, 0x00 ; 0 |
790e: cd c8 rjmp .-3686 ; 0x6aaa <__divdi3+0x594> |
7910: 28 e1 ldi r18, 0x18 ; 24 |
7912: 30 e0 ldi r19, 0x00 ; 0 |
7914: 40 e0 ldi r20, 0x00 ; 0 |
7916: 50 e0 ldi r21, 0x00 ; 0 |
7918: 88 e1 ldi r24, 0x18 ; 24 |
791a: 90 e0 ldi r25, 0x00 ; 0 |
791c: 0c 94 3a 33 jmp 0x6674 ; 0x6674 <__divdi3+0x15e> |
7920: ea 14 cp r14, r10 |
7922: fb 04 cpc r15, r11 |
7924: 0c 05 cpc r16, r12 |
7926: 1d 05 cpc r17, r13 |
7928: 08 f0 brcs .+2 ; 0x792c <__divdi3+0x1416> |
792a: f7 ce rjmp .-530 ; 0x771a <__divdi3+0x1204> |
792c: 21 50 subi r18, 0x01 ; 1 |
792e: 30 40 sbci r19, 0x00 ; 0 |
7930: 40 40 sbci r20, 0x00 ; 0 |
7932: 50 40 sbci r21, 0x00 ; 0 |
7934: a9 96 adiw r28, 0x29 ; 41 |
7936: 2c af std Y+60, r18 ; 0x3c |
7938: 3d af std Y+61, r19 ; 0x3d |
793a: 4e af std Y+62, r20 ; 0x3e |
793c: 5f af std Y+63, r21 ; 0x3f |
793e: a9 97 sbiw r28, 0x29 ; 41 |
7940: e2 0c add r14, r2 |
7942: f3 1c adc r15, r3 |
7944: 04 1d adc r16, r4 |
7946: 15 1d adc r17, r5 |
7948: e8 ce rjmp .-560 ; 0x771a <__divdi3+0x1204> |
794a: a6 14 cp r10, r6 |
794c: b7 04 cpc r11, r7 |
794e: c8 04 cpc r12, r8 |
7950: d9 04 cpc r13, r9 |
7952: 08 f0 brcs .+2 ; 0x7956 <__divdi3+0x1440> |
7954: a5 cd rjmp .-1206 ; 0x74a0 <__divdi3+0xf8a> |
7956: 08 94 sec |
7958: 21 08 sbc r2, r1 |
795a: 31 08 sbc r3, r1 |
795c: 41 08 sbc r4, r1 |
795e: 51 08 sbc r5, r1 |
7960: ae 0c add r10, r14 |
7962: bf 1c adc r11, r15 |
7964: c0 1e adc r12, r16 |
7966: d1 1e adc r13, r17 |
7968: 9b cd rjmp .-1226 ; 0x74a0 <__divdi3+0xf8a> |
796a: e6 14 cp r14, r6 |
796c: f7 04 cpc r15, r7 |
796e: 08 05 cpc r16, r8 |
7970: 19 05 cpc r17, r9 |
7972: 08 f0 brcs .+2 ; 0x7976 <__divdi3+0x1460> |
7974: 48 cd rjmp .-1392 ; 0x7406 <__divdi3+0xef0> |
7976: 21 50 subi r18, 0x01 ; 1 |
7978: 30 40 sbci r19, 0x00 ; 0 |
797a: 40 40 sbci r20, 0x00 ; 0 |
797c: 50 40 sbci r21, 0x00 ; 0 |
797e: ed 96 adiw r28, 0x3d ; 61 |
7980: 2c af std Y+60, r18 ; 0x3c |
7982: 3d af std Y+61, r19 ; 0x3d |
7984: 4e af std Y+62, r20 ; 0x3e |
7986: 5f af std Y+63, r21 ; 0x3f |
7988: ed 97 sbiw r28, 0x3d ; 61 |
798a: e8 0e add r14, r24 |
798c: f9 1e adc r15, r25 |
798e: 0a 1f adc r16, r26 |
7990: 1b 1f adc r17, r27 |
7992: 39 cd rjmp .-1422 ; 0x7406 <__divdi3+0xef0> |
7994: 08 94 sec |
7996: a1 08 sbc r10, r1 |
7998: b1 08 sbc r11, r1 |
799a: c1 08 sbc r12, r1 |
799c: d1 08 sbc r13, r1 |
799e: 0c 94 2a 34 jmp 0x6854 ; 0x6854 <__divdi3+0x33e> |
79a2: 08 94 sec |
79a4: a1 08 sbc r10, r1 |
79a6: b1 08 sbc r11, r1 |
79a8: c1 08 sbc r12, r1 |
79aa: d1 08 sbc r13, r1 |
79ac: 93 c9 rjmp .-3290 ; 0x6cd4 <__divdi3+0x7be> |
79ae: 21 50 subi r18, 0x01 ; 1 |
79b0: 30 40 sbci r19, 0x00 ; 0 |
79b2: 40 40 sbci r20, 0x00 ; 0 |
79b4: 50 40 sbci r21, 0x00 ; 0 |
79b6: 6d 96 adiw r28, 0x1d ; 29 |
79b8: 2c af std Y+60, r18 ; 0x3c |
79ba: 3d af std Y+61, r19 ; 0x3d |
79bc: 4e af std Y+62, r20 ; 0x3e |
79be: 5f af std Y+63, r21 ; 0x3f |
79c0: 6d 97 sbiw r28, 0x1d ; 29 |
79c2: e2 0c add r14, r2 |
79c4: f3 1c adc r15, r3 |
79c6: 04 1d adc r16, r4 |
79c8: 15 1d adc r17, r5 |
79ca: 3a c9 rjmp .-3468 ; 0x6c40 <__divdi3+0x72a> |
79cc: 21 50 subi r18, 0x01 ; 1 |
79ce: 30 40 sbci r19, 0x00 ; 0 |
79d0: 40 40 sbci r20, 0x00 ; 0 |
79d2: 50 40 sbci r21, 0x00 ; 0 |
79d4: e1 96 adiw r28, 0x31 ; 49 |
79d6: 2c af std Y+60, r18 ; 0x3c |
79d8: 3d af std Y+61, r19 ; 0x3d |
79da: 4e af std Y+62, r20 ; 0x3e |
79dc: 5f af std Y+63, r21 ; 0x3f |
79de: e1 97 sbiw r28, 0x31 ; 49 |
79e0: e2 0c add r14, r2 |
79e2: f3 1c adc r15, r3 |
79e4: 04 1d adc r16, r4 |
79e6: 15 1d adc r17, r5 |
79e8: 0c 94 dd 33 jmp 0x67ba ; 0x67ba <__divdi3+0x2a4> |
79ec: 22 2d mov r18, r2 |
79ee: 33 2d mov r19, r3 |
79f0: 44 2d mov r20, r4 |
79f2: 55 2d mov r21, r5 |
79f4: 66 2d mov r22, r6 |
79f6: 77 2d mov r23, r7 |
79f8: 88 2d mov r24, r8 |
79fa: 99 2d mov r25, r9 |
79fc: e2 e1 ldi r30, 0x12 ; 18 |
79fe: c7 56 subi r28, 0x67 ; 103 |
7a00: df 4f sbci r29, 0xFF ; 255 |
7a02: 0c 94 17 3f jmp 0x7e2e ; 0x7e2e <__epilogue_restores__> |
00007a06 <memchr>: |
7a06: fc 01 movw r30, r24 |
7a08: 41 50 subi r20, 0x01 ; 1 |
7a0a: 50 40 sbci r21, 0x00 ; 0 |
7a0c: 30 f0 brcs .+12 ; 0x7a1a <memchr+0x14> |
7a0e: 01 90 ld r0, Z+ |
7a10: 06 16 cp r0, r22 |
7a12: d1 f7 brne .-12 ; 0x7a08 <memchr+0x2> |
7a14: 31 97 sbiw r30, 0x01 ; 1 |
7a16: cf 01 movw r24, r30 |
7a18: 08 95 ret |
7a1a: 88 27 eor r24, r24 |
7a1c: 99 27 eor r25, r25 |
7a1e: 08 95 ret |
00007a20 <__subsf3>: |
7a20: 50 58 subi r21, 0x80 ; 128 |
00007a22 <__addsf3>: |
7a22: 19 2e mov r1, r25 |
7a24: ef d0 rcall .+478 ; 0x7c04 <__fp_split3> |
7a26: 01 d0 rcall .+2 ; 0x7a2a <__addsf3x> |
7a28: d2 c0 rjmp .+420 ; 0x7bce <__fp_merge> |
00007a2a <__addsf3x>: |
7a2a: ba 17 cp r27, r26 |
7a2c: 62 07 cpc r22, r18 |
7a2e: 73 07 cpc r23, r19 |
7a30: 84 07 cpc r24, r20 |
7a32: 95 07 cpc r25, r21 |
7a34: b1 f1 breq .+108 ; 0x7aa2 <__addsf3x+0x78> |
7a36: 88 f4 brcc .+34 ; 0x7a5a <__addsf3x+0x30> |
7a38: 0e f4 brtc .+2 ; 0x7a3c <__addsf3x+0x12> |
7a3a: 10 94 com r1 |
7a3c: 0b 2e mov r0, r27 |
7a3e: ba 2f mov r27, r26 |
7a40: a0 2d mov r26, r0 |
7a42: 06 2e mov r0, r22 |
7a44: 62 2f mov r22, r18 |
7a46: 20 2d mov r18, r0 |
7a48: 07 2e mov r0, r23 |
7a4a: 73 2f mov r23, r19 |
7a4c: 30 2d mov r19, r0 |
7a4e: 08 2e mov r0, r24 |
7a50: 84 2f mov r24, r20 |
7a52: 40 2d mov r20, r0 |
7a54: 09 2e mov r0, r25 |
7a56: 95 2f mov r25, r21 |
7a58: 50 2d mov r21, r0 |
7a5a: ff 27 eor r31, r31 |
7a5c: 55 23 and r21, r21 |
7a5e: b9 f0 breq .+46 ; 0x7a8e <__addsf3x+0x64> |
7a60: 59 1b sub r21, r25 |
7a62: 49 f0 breq .+18 ; 0x7a76 <__addsf3x+0x4c> |
7a64: 57 3e cpi r21, 0xE7 ; 231 |
7a66: 98 f0 brcs .+38 ; 0x7a8e <__addsf3x+0x64> |
7a68: 46 95 lsr r20 |
7a6a: 37 95 ror r19 |
7a6c: 27 95 ror r18 |
7a6e: a7 95 ror r26 |
7a70: f0 40 sbci r31, 0x00 ; 0 |
7a72: 53 95 inc r21 |
7a74: c9 f7 brne .-14 ; 0x7a68 <__addsf3x+0x3e> |
7a76: 76 f0 brts .+28 ; 0x7a94 <__addsf3x+0x6a> |
7a78: ba 0f add r27, r26 |
7a7a: 62 1f adc r22, r18 |
7a7c: 73 1f adc r23, r19 |
7a7e: 84 1f adc r24, r20 |
7a80: 30 f4 brcc .+12 ; 0x7a8e <__addsf3x+0x64> |
7a82: 87 95 ror r24 |
7a84: 77 95 ror r23 |
7a86: 67 95 ror r22 |
7a88: b7 95 ror r27 |
7a8a: f0 40 sbci r31, 0x00 ; 0 |
7a8c: 93 95 inc r25 |
7a8e: 17 fa bst r1, 7 |
7a90: 0f 2e mov r0, r31 |
7a92: 08 95 ret |
7a94: bf 1b sub r27, r31 |
7a96: bb 27 eor r27, r27 |
7a98: ba 0b sbc r27, r26 |
7a9a: 62 0b sbc r22, r18 |
7a9c: 73 0b sbc r23, r19 |
7a9e: 84 0b sbc r24, r20 |
7aa0: f6 cf rjmp .-20 ; 0x7a8e <__addsf3x+0x64> |
7aa2: de f6 brtc .-74 ; 0x7a5a <__addsf3x+0x30> |
7aa4: db c0 rjmp .+438 ; 0x7c5c <__fp_zerox> |
00007aa6 <__divsf3>: |
7aa6: ae d0 rcall .+348 ; 0x7c04 <__fp_split3> |
7aa8: 01 d0 rcall .+2 ; 0x7aac <__divsf3x> |
7aaa: 91 c0 rjmp .+290 ; 0x7bce <__fp_merge> |
00007aac <__divsf3x>: |
7aac: 55 23 and r21, r21 |
7aae: 59 f0 breq .+22 ; 0x7ac6 <__divsf3x+0x1a> |
7ab0: 99 23 and r25, r25 |
7ab2: 69 f0 breq .+26 ; 0x7ace <__divsf3x+0x22> |
7ab4: 9f 57 subi r25, 0x7F ; 127 |
7ab6: 5f 57 subi r21, 0x7F ; 127 |
7ab8: 95 1b sub r25, r21 |
7aba: 33 f4 brvc .+12 ; 0x7ac8 <__divsf3x+0x1c> |
7abc: 42 f4 brpl .+16 ; 0x7ace <__divsf3x+0x22> |
7abe: 90 38 cpi r25, 0x80 ; 128 |
7ac0: 11 f4 brne .+4 ; 0x7ac6 <__divsf3x+0x1a> |
7ac2: 91 58 subi r25, 0x81 ; 129 |
7ac4: 05 c0 rjmp .+10 ; 0x7ad0 <__divsf3x+0x24> |
7ac6: 9b c0 rjmp .+310 ; 0x7bfe <__fp_nan> |
7ac8: 91 58 subi r25, 0x81 ; 129 |
7aca: 9f 3f cpi r25, 0xFF ; 255 |
7acc: 09 f4 brne .+2 ; 0x7ad0 <__divsf3x+0x24> |
7ace: c6 c0 rjmp .+396 ; 0x7c5c <__fp_zerox> |
7ad0: bb 27 eor r27, r27 |
7ad2: 11 24 eor r1, r1 |
7ad4: 62 17 cp r22, r18 |
7ad6: 73 07 cpc r23, r19 |
7ad8: 84 07 cpc r24, r20 |
7ada: 30 f4 brcc .+12 ; 0x7ae8 <__divsf3x+0x3c> |
7adc: 66 0f add r22, r22 |
7ade: 77 1f adc r23, r23 |
7ae0: 88 1f adc r24, r24 |
7ae2: bb 1f adc r27, r27 |
7ae4: 91 50 subi r25, 0x01 ; 1 |
7ae6: 98 f3 brcs .-26 ; 0x7ace <__divsf3x+0x22> |
7ae8: 11 d0 rcall .+34 ; 0x7b0c <__divsf3x+0x60> |
7aea: 0f 92 push r0 |
7aec: 0f d0 rcall .+30 ; 0x7b0c <__divsf3x+0x60> |
7aee: 0f 92 push r0 |
7af0: 0d d0 rcall .+26 ; 0x7b0c <__divsf3x+0x60> |
7af2: a0 e8 ldi r26, 0x80 ; 128 |
7af4: 26 17 cp r18, r22 |
7af6: 37 07 cpc r19, r23 |
7af8: 48 07 cpc r20, r24 |
7afa: 1b 06 cpc r1, r27 |
7afc: 09 f0 breq .+2 ; 0x7b00 <__divsf3x+0x54> |
7afe: a0 48 sbci r26, 0x80 ; 128 |
7b00: ba 2f mov r27, r26 |
7b02: 60 2d mov r22, r0 |
7b04: 7f 91 pop r23 |
7b06: 8f 91 pop r24 |
7b08: 00 24 eor r0, r0 |
7b0a: 08 95 ret |
7b0c: a0 e8 ldi r26, 0x80 ; 128 |
7b0e: 00 24 eor r0, r0 |
7b10: 62 17 cp r22, r18 |
7b12: 73 07 cpc r23, r19 |
7b14: 84 07 cpc r24, r20 |
7b16: b1 05 cpc r27, r1 |
7b18: 28 f0 brcs .+10 ; 0x7b24 <__divsf3x+0x78> |
7b1a: 62 1b sub r22, r18 |
7b1c: 73 0b sbc r23, r19 |
7b1e: 84 0b sbc r24, r20 |
7b20: b1 09 sbc r27, r1 |
7b22: 0a 2a or r0, r26 |
7b24: 66 0f add r22, r22 |
7b26: 77 1f adc r23, r23 |
7b28: 88 1f adc r24, r24 |
7b2a: bb 1f adc r27, r27 |
7b2c: a6 95 lsr r26 |
7b2e: 81 f7 brne .-32 ; 0x7b10 <__divsf3x+0x64> |
7b30: 08 95 ret |
00007b32 <__fixsfsi>: |
7b32: 97 fb bst r25, 7 |
7b34: 73 d0 rcall .+230 ; 0x7c1c <__fp_split1> |
7b36: 9f 37 cpi r25, 0x7F ; 127 |
7b38: 38 f0 brcs .+14 ; 0x7b48 <__fixsfsi+0x16> |
7b3a: fe e9 ldi r31, 0x9E ; 158 |
7b3c: f9 1b sub r31, r25 |
7b3e: 98 2f mov r25, r24 |
7b40: 87 2f mov r24, r23 |
7b42: 76 2f mov r23, r22 |
7b44: 6b 2f mov r22, r27 |
7b46: 05 c0 rjmp .+10 ; 0x7b52 <__fixsfsi+0x20> |
7b48: 86 c0 rjmp .+268 ; 0x7c56 <__fp_zero> |
7b4a: 96 95 lsr r25 |
7b4c: 87 95 ror r24 |
7b4e: 77 95 ror r23 |
7b50: 67 95 ror r22 |
7b52: f1 50 subi r31, 0x01 ; 1 |
7b54: d0 f7 brcc .-12 ; 0x7b4a <__fixsfsi+0x18> |
7b56: 3e f4 brtc .+14 ; 0x7b66 <__fp_lneg+0xe> |
00007b58 <__fp_lneg>: |
7b58: 90 95 com r25 |
7b5a: 80 95 com r24 |
7b5c: 70 95 com r23 |
7b5e: 61 95 neg r22 |
7b60: 7f 4f sbci r23, 0xFF ; 255 |
7b62: 8f 4f sbci r24, 0xFF ; 255 |
7b64: 9f 4f sbci r25, 0xFF ; 255 |
7b66: 08 95 ret |
00007b68 <__floatunssisf>: |
7b68: e8 94 clt |
7b6a: 03 c0 rjmp .+6 ; 0x7b72 <__floatsisf+0x6> |
00007b6c <__floatsisf>: |
7b6c: 97 fb bst r25, 7 |
7b6e: 0e f4 brtc .+2 ; 0x7b72 <__floatsisf+0x6> |
7b70: f3 df rcall .-26 ; 0x7b58 <__fp_lneg> |
7b72: b6 2f mov r27, r22 |
7b74: 67 2f mov r22, r23 |
7b76: 78 2f mov r23, r24 |
7b78: 89 2f mov r24, r25 |
7b7a: 9e e9 ldi r25, 0x9E ; 158 |
7b7c: 00 24 eor r0, r0 |
7b7e: 27 c0 rjmp .+78 ; 0x7bce <__fp_merge> |
00007b80 <__eqsf2>: |
7b80: 0e d0 rcall .+28 ; 0x7b9e <.fp_cmp> |
7b82: 5e f0 brts .+22 ; 0x7b9a <__cmpsf2+0xe> |
7b84: 04 c0 rjmp .+8 ; 0x7b8e <__cmpsf2+0x2> |
00007b86 <__gesf2>: |
7b86: 0b d0 rcall .+22 ; 0x7b9e <.fp_cmp> |
7b88: 26 f0 brts .+8 ; 0x7b92 <__cmpsf2+0x6> |
7b8a: 01 c0 rjmp .+2 ; 0x7b8e <__cmpsf2+0x2> |
00007b8c <__cmpsf2>: |
7b8c: 08 d0 rcall .+16 ; 0x7b9e <.fp_cmp> |
7b8e: 19 f0 breq .+6 ; 0x7b96 <__cmpsf2+0xa> |
7b90: 20 f4 brcc .+8 ; 0x7b9a <__cmpsf2+0xe> |
7b92: 8f ef ldi r24, 0xFF ; 255 |
7b94: 08 95 ret |
7b96: 80 e0 ldi r24, 0x00 ; 0 |
7b98: 08 95 ret |
7b9a: 81 e0 ldi r24, 0x01 ; 1 |
7b9c: 08 95 ret |
00007b9e <.fp_cmp>: |
7b9e: 97 fb bst r25, 7 |
7ba0: 09 2e mov r0, r25 |
7ba2: 05 26 eor r0, r21 |
7ba4: 00 f8 bld r0, 0 |
7ba6: 68 94 set |
7ba8: 30 d0 rcall .+96 ; 0x7c0a <__fp_split2> |
7baa: e8 94 clt |
7bac: 07 fc sbrc r0, 7 |
7bae: 07 c0 rjmp .+14 ; 0x7bbe <.fp_cmp+0x20> |
7bb0: 62 17 cp r22, r18 |
7bb2: 73 07 cpc r23, r19 |
7bb4: 84 07 cpc r24, r20 |
7bb6: 95 07 cpc r25, r21 |
7bb8: 21 f0 breq .+8 ; 0x7bc2 <.fp_cmp+0x24> |
7bba: 08 f4 brcc .+2 ; 0x7bbe <.fp_cmp+0x20> |
7bbc: 00 94 com r0 |
7bbe: 07 94 ror r0 |
7bc0: 98 94 clz |
7bc2: 08 95 ret |
7bc4: 9a 95 dec r25 |
7bc6: bb 0f add r27, r27 |
7bc8: 66 1f adc r22, r22 |
7bca: 77 1f adc r23, r23 |
7bcc: 88 1f adc r24, r24 |
00007bce <__fp_merge>: |
7bce: 11 24 eor r1, r1 |
7bd0: 99 23 and r25, r25 |
7bd2: a1 f0 breq .+40 ; 0x7bfc <__fp_merge+0x2e> |
7bd4: 88 23 and r24, r24 |
7bd6: b2 f7 brpl .-20 ; 0x7bc4 <.fp_cmp+0x26> |
7bd8: 9f 3f cpi r25, 0xFF ; 255 |
7bda: 59 f0 breq .+22 ; 0x7bf2 <__fp_merge+0x24> |
7bdc: bb 0f add r27, r27 |
7bde: 48 f4 brcc .+18 ; 0x7bf2 <__fp_merge+0x24> |
7be0: 21 f4 brne .+8 ; 0x7bea <__fp_merge+0x1c> |
7be2: 00 20 and r0, r0 |
7be4: 11 f4 brne .+4 ; 0x7bea <__fp_merge+0x1c> |
7be6: 60 ff sbrs r22, 0 |
7be8: 04 c0 rjmp .+8 ; 0x7bf2 <__fp_merge+0x24> |
7bea: 6f 5f subi r22, 0xFF ; 255 |
7bec: 7f 4f sbci r23, 0xFF ; 255 |
7bee: 8f 4f sbci r24, 0xFF ; 255 |
7bf0: 9f 4f sbci r25, 0xFF ; 255 |
7bf2: 88 1f adc r24, r24 |
7bf4: 97 95 ror r25 |
7bf6: 87 95 ror r24 |
7bf8: 97 f9 bld r25, 7 |
7bfa: 08 95 ret |
7bfc: 2c c0 rjmp .+88 ; 0x7c56 <__fp_zero> |
00007bfe <__fp_nan>: |
7bfe: 9f ef ldi r25, 0xFF ; 255 |
7c00: 80 ec ldi r24, 0xC0 ; 192 |
7c02: 08 95 ret |
00007c04 <__fp_split3>: |
7c04: 05 2e mov r0, r21 |
7c06: 09 26 eor r0, r25 |
7c08: 07 fa bst r0, 7 |
00007c0a <__fp_split2>: |
7c0a: 44 0f add r20, r20 |
7c0c: 55 1f adc r21, r21 |
7c0e: 5f 3f cpi r21, 0xFF ; 255 |
7c10: 79 f0 breq .+30 ; 0x7c30 <__fp_split1+0x14> |
7c12: aa 27 eor r26, r26 |
7c14: a5 17 cp r26, r21 |
7c16: 08 f0 brcs .+2 ; 0x7c1a <__fp_split2+0x10> |
7c18: 51 e0 ldi r21, 0x01 ; 1 |
7c1a: 47 95 ror r20 |
00007c1c <__fp_split1>: |
7c1c: 88 0f add r24, r24 |
7c1e: 99 1f adc r25, r25 |
7c20: 9f 3f cpi r25, 0xFF ; 255 |
7c22: 31 f0 breq .+12 ; 0x7c30 <__fp_split1+0x14> |
7c24: bb 27 eor r27, r27 |
7c26: b9 17 cp r27, r25 |
7c28: 08 f0 brcs .+2 ; 0x7c2c <__fp_split1+0x10> |
7c2a: 91 e0 ldi r25, 0x01 ; 1 |
7c2c: 87 95 ror r24 |
7c2e: 08 95 ret |
7c30: 9f 91 pop r25 |
7c32: 9f 91 pop r25 |
7c34: 11 24 eor r1, r1 |
7c36: e3 cf rjmp .-58 ; 0x7bfe <__fp_nan> |
00007c38 <__fp_split_a>: |
7c38: 97 fb bst r25, 7 |
7c3a: 88 0f add r24, r24 |
7c3c: 99 1f adc r25, r25 |
7c3e: 9f 3f cpi r25, 0xFF ; 255 |
7c40: 31 f0 breq .+12 ; 0x7c4e <__fp_split_a+0x16> |
7c42: bb 27 eor r27, r27 |
7c44: b9 17 cp r27, r25 |
7c46: 08 f0 brcs .+2 ; 0x7c4a <__fp_split_a+0x12> |
7c48: 91 e0 ldi r25, 0x01 ; 1 |
7c4a: 87 95 ror r24 |
7c4c: 08 95 ret |
7c4e: 9f 91 pop r25 |
7c50: 9f 91 pop r25 |
7c52: 11 24 eor r1, r1 |
7c54: d4 cf rjmp .-88 ; 0x7bfe <__fp_nan> |
00007c56 <__fp_zero>: |
7c56: 66 27 eor r22, r22 |
7c58: 77 27 eor r23, r23 |
7c5a: 88 27 eor r24, r24 |
00007c5c <__fp_zerox>: |
7c5c: 99 27 eor r25, r25 |
7c5e: 08 95 ret |
00007c60 <__mulsf3>: |
7c60: d1 df rcall .-94 ; 0x7c04 <__fp_split3> |
7c62: 01 d0 rcall .+2 ; 0x7c66 <__mulsf3x> |
7c64: b4 cf rjmp .-152 ; 0x7bce <__fp_merge> |
00007c66 <__mulsf3x>: |
7c66: 99 23 and r25, r25 |
7c68: 39 f0 breq .+14 ; 0x7c78 <__mulsf3x+0x12> |
7c6a: 55 23 and r21, r21 |
7c6c: 29 f0 breq .+10 ; 0x7c78 <__mulsf3x+0x12> |
7c6e: 9f 57 subi r25, 0x7F ; 127 |
7c70: 5f 57 subi r21, 0x7F ; 127 |
7c72: 95 0f add r25, r21 |
7c74: 13 f4 brvc .+4 ; 0x7c7a <__mulsf3x+0x14> |
7c76: 9a f1 brmi .+102 ; 0x7cde <__mulsf3x+0x78> |
7c78: f1 cf rjmp .-30 ; 0x7c5c <__fp_zerox> |
7c7a: 91 58 subi r25, 0x81 ; 129 |
7c7c: 9f 3f cpi r25, 0xFF ; 255 |
7c7e: e1 f3 breq .-8 ; 0x7c78 <__mulsf3x+0x12> |
7c80: 62 9f mul r22, r18 |
7c82: a1 2d mov r26, r1 |
7c84: 0f 92 push r0 |
7c86: bb 27 eor r27, r27 |
7c88: 63 9f mul r22, r19 |
7c8a: a0 0d add r26, r0 |
7c8c: b1 1d adc r27, r1 |
7c8e: ee 27 eor r30, r30 |
7c90: 72 9f mul r23, r18 |
7c92: a0 0d add r26, r0 |
7c94: b1 1d adc r27, r1 |
7c96: ee 1f adc r30, r30 |
7c98: af 93 push r26 |
7c9a: aa 27 eor r26, r26 |
7c9c: 64 9f mul r22, r20 |
7c9e: b0 0d add r27, r0 |
7ca0: e1 1d adc r30, r1 |
7ca2: 73 9f mul r23, r19 |
7ca4: b0 0d add r27, r0 |
7ca6: e1 1d adc r30, r1 |
7ca8: aa 1f adc r26, r26 |
7caa: 66 27 eor r22, r22 |
7cac: 82 9f mul r24, r18 |
7cae: b0 0d add r27, r0 |
7cb0: e1 1d adc r30, r1 |
7cb2: a6 1f adc r26, r22 |
7cb4: 55 27 eor r21, r21 |
7cb6: 74 9f mul r23, r20 |
7cb8: e0 0d add r30, r0 |
7cba: a1 1d adc r26, r1 |
7cbc: 55 1f adc r21, r21 |
7cbe: 83 9f mul r24, r19 |
7cc0: e0 0d add r30, r0 |
7cc2: a1 1d adc r26, r1 |
7cc4: 56 1f adc r21, r22 |
7cc6: 84 9f mul r24, r20 |
7cc8: a0 0d add r26, r0 |
7cca: 51 1d adc r21, r1 |
7ccc: 85 2f mov r24, r21 |
7cce: 7a 2f mov r23, r26 |
7cd0: 6e 2f mov r22, r30 |
7cd2: 1f 90 pop r1 |
7cd4: 0f 90 pop r0 |
7cd6: 88 23 and r24, r24 |
7cd8: 1a f4 brpl .+6 ; 0x7ce0 <__mulsf3x+0x7a> |
7cda: 93 95 inc r25 |
7cdc: 39 f4 brne .+14 ; 0x7cec <__mulsf3x+0x86> |
7cde: 8f cf rjmp .-226 ; 0x7bfe <__fp_nan> |
7ce0: 00 0c add r0, r0 |
7ce2: 11 1c adc r1, r1 |
7ce4: bb 1f adc r27, r27 |
7ce6: 66 1f adc r22, r22 |
7ce8: 77 1f adc r23, r23 |
7cea: 88 1f adc r24, r24 |
7cec: 01 28 or r0, r1 |
7cee: 08 95 ret |
00007cf0 <__mulsi3>: |
7cf0: 62 9f mul r22, r18 |
7cf2: d0 01 movw r26, r0 |
7cf4: 73 9f mul r23, r19 |
7cf6: f0 01 movw r30, r0 |
7cf8: 82 9f mul r24, r18 |
7cfa: e0 0d add r30, r0 |
7cfc: f1 1d adc r31, r1 |
7cfe: 64 9f mul r22, r20 |
7d00: e0 0d add r30, r0 |
7d02: f1 1d adc r31, r1 |
7d04: 92 9f mul r25, r18 |
7d06: f0 0d add r31, r0 |
7d08: 83 9f mul r24, r19 |
7d0a: f0 0d add r31, r0 |
7d0c: 74 9f mul r23, r20 |
7d0e: f0 0d add r31, r0 |
7d10: 65 9f mul r22, r21 |
7d12: f0 0d add r31, r0 |
7d14: 99 27 eor r25, r25 |
7d16: 72 9f mul r23, r18 |
7d18: b0 0d add r27, r0 |
7d1a: e1 1d adc r30, r1 |
7d1c: f9 1f adc r31, r25 |
7d1e: 63 9f mul r22, r19 |
7d20: b0 0d add r27, r0 |
7d22: e1 1d adc r30, r1 |
7d24: f9 1f adc r31, r25 |
7d26: bd 01 movw r22, r26 |
7d28: cf 01 movw r24, r30 |
7d2a: 11 24 eor r1, r1 |
7d2c: 08 95 ret |
00007d2e <__udivmodhi4>: |
7d2e: aa 1b sub r26, r26 |
7d30: bb 1b sub r27, r27 |
7d32: 51 e1 ldi r21, 0x11 ; 17 |
7d34: 07 c0 rjmp .+14 ; 0x7d44 <__udivmodhi4_ep> |
00007d36 <__udivmodhi4_loop>: |
7d36: aa 1f adc r26, r26 |
7d38: bb 1f adc r27, r27 |
7d3a: a6 17 cp r26, r22 |
7d3c: b7 07 cpc r27, r23 |
7d3e: 10 f0 brcs .+4 ; 0x7d44 <__udivmodhi4_ep> |
7d40: a6 1b sub r26, r22 |
7d42: b7 0b sbc r27, r23 |
00007d44 <__udivmodhi4_ep>: |
7d44: 88 1f adc r24, r24 |
7d46: 99 1f adc r25, r25 |
7d48: 5a 95 dec r21 |
7d4a: a9 f7 brne .-22 ; 0x7d36 <__udivmodhi4_loop> |
7d4c: 80 95 com r24 |
7d4e: 90 95 com r25 |
7d50: bc 01 movw r22, r24 |
7d52: cd 01 movw r24, r26 |
7d54: 08 95 ret |
00007d56 <__divmodhi4>: |
7d56: 97 fb bst r25, 7 |
7d58: 09 2e mov r0, r25 |
7d5a: 07 26 eor r0, r23 |
7d5c: 0a d0 rcall .+20 ; 0x7d72 <__divmodhi4_neg1> |
7d5e: 77 fd sbrc r23, 7 |
7d60: 04 d0 rcall .+8 ; 0x7d6a <__divmodhi4_neg2> |
7d62: e5 df rcall .-54 ; 0x7d2e <__udivmodhi4> |
7d64: 06 d0 rcall .+12 ; 0x7d72 <__divmodhi4_neg1> |
7d66: 00 20 and r0, r0 |
7d68: 1a f4 brpl .+6 ; 0x7d70 <__divmodhi4_exit> |
00007d6a <__divmodhi4_neg2>: |
7d6a: 70 95 com r23 |
7d6c: 61 95 neg r22 |
7d6e: 7f 4f sbci r23, 0xFF ; 255 |
00007d70 <__divmodhi4_exit>: |
7d70: 08 95 ret |
00007d72 <__divmodhi4_neg1>: |
7d72: f6 f7 brtc .-4 ; 0x7d70 <__divmodhi4_exit> |
7d74: 90 95 com r25 |
7d76: 81 95 neg r24 |
7d78: 9f 4f sbci r25, 0xFF ; 255 |
7d7a: 08 95 ret |
00007d7c <__udivmodsi4>: |
7d7c: a1 e2 ldi r26, 0x21 ; 33 |
7d7e: 1a 2e mov r1, r26 |
7d80: aa 1b sub r26, r26 |
7d82: bb 1b sub r27, r27 |
7d84: fd 01 movw r30, r26 |
7d86: 0d c0 rjmp .+26 ; 0x7da2 <__udivmodsi4_ep> |
00007d88 <__udivmodsi4_loop>: |
7d88: aa 1f adc r26, r26 |
7d8a: bb 1f adc r27, r27 |
7d8c: ee 1f adc r30, r30 |
7d8e: ff 1f adc r31, r31 |
7d90: a2 17 cp r26, r18 |
7d92: b3 07 cpc r27, r19 |
7d94: e4 07 cpc r30, r20 |
7d96: f5 07 cpc r31, r21 |
7d98: 20 f0 brcs .+8 ; 0x7da2 <__udivmodsi4_ep> |
7d9a: a2 1b sub r26, r18 |
7d9c: b3 0b sbc r27, r19 |
7d9e: e4 0b sbc r30, r20 |
7da0: f5 0b sbc r31, r21 |
00007da2 <__udivmodsi4_ep>: |
7da2: 66 1f adc r22, r22 |
7da4: 77 1f adc r23, r23 |
7da6: 88 1f adc r24, r24 |
7da8: 99 1f adc r25, r25 |
7daa: 1a 94 dec r1 |
7dac: 69 f7 brne .-38 ; 0x7d88 <__udivmodsi4_loop> |
7dae: 60 95 com r22 |
7db0: 70 95 com r23 |
7db2: 80 95 com r24 |
7db4: 90 95 com r25 |
7db6: 9b 01 movw r18, r22 |
7db8: ac 01 movw r20, r24 |
7dba: bd 01 movw r22, r26 |
7dbc: cf 01 movw r24, r30 |
7dbe: 08 95 ret |
00007dc0 <__divmodsi4>: |
7dc0: 97 fb bst r25, 7 |
7dc2: 09 2e mov r0, r25 |
7dc4: 05 26 eor r0, r21 |
7dc6: 0e d0 rcall .+28 ; 0x7de4 <__divmodsi4_neg1> |
7dc8: 57 fd sbrc r21, 7 |
7dca: 04 d0 rcall .+8 ; 0x7dd4 <__divmodsi4_neg2> |
7dcc: d7 df rcall .-82 ; 0x7d7c <__udivmodsi4> |
7dce: 0a d0 rcall .+20 ; 0x7de4 <__divmodsi4_neg1> |
7dd0: 00 1c adc r0, r0 |
7dd2: 38 f4 brcc .+14 ; 0x7de2 <__divmodsi4_exit> |
00007dd4 <__divmodsi4_neg2>: |
7dd4: 50 95 com r21 |
7dd6: 40 95 com r20 |
7dd8: 30 95 com r19 |
7dda: 21 95 neg r18 |
7ddc: 3f 4f sbci r19, 0xFF ; 255 |
7dde: 4f 4f sbci r20, 0xFF ; 255 |
7de0: 5f 4f sbci r21, 0xFF ; 255 |
00007de2 <__divmodsi4_exit>: |
7de2: 08 95 ret |
00007de4 <__divmodsi4_neg1>: |
7de4: f6 f7 brtc .-4 ; 0x7de2 <__divmodsi4_exit> |
7de6: 90 95 com r25 |
7de8: 80 95 com r24 |
7dea: 70 95 com r23 |
7dec: 61 95 neg r22 |
7dee: 7f 4f sbci r23, 0xFF ; 255 |
7df0: 8f 4f sbci r24, 0xFF ; 255 |
7df2: 9f 4f sbci r25, 0xFF ; 255 |
7df4: 08 95 ret |
00007df6 <__prologue_saves__>: |
7df6: 2f 92 push r2 |
7df8: 3f 92 push r3 |
7dfa: 4f 92 push r4 |
7dfc: 5f 92 push r5 |
7dfe: 6f 92 push r6 |
7e00: 7f 92 push r7 |
7e02: 8f 92 push r8 |
7e04: 9f 92 push r9 |
7e06: af 92 push r10 |
7e08: bf 92 push r11 |
7e0a: cf 92 push r12 |
7e0c: df 92 push r13 |
7e0e: ef 92 push r14 |
7e10: ff 92 push r15 |
7e12: 0f 93 push r16 |
7e14: 1f 93 push r17 |
7e16: cf 93 push r28 |
7e18: df 93 push r29 |
7e1a: cd b7 in r28, 0x3d ; 61 |
7e1c: de b7 in r29, 0x3e ; 62 |
7e1e: ca 1b sub r28, r26 |
7e20: db 0b sbc r29, r27 |
7e22: 0f b6 in r0, 0x3f ; 63 |
7e24: f8 94 cli |
7e26: de bf out 0x3e, r29 ; 62 |
7e28: 0f be out 0x3f, r0 ; 63 |
7e2a: cd bf out 0x3d, r28 ; 61 |
7e2c: 09 94 ijmp |
00007e2e <__epilogue_restores__>: |
7e2e: 2a 88 ldd r2, Y+18 ; 0x12 |
7e30: 39 88 ldd r3, Y+17 ; 0x11 |
7e32: 48 88 ldd r4, Y+16 ; 0x10 |
7e34: 5f 84 ldd r5, Y+15 ; 0x0f |
7e36: 6e 84 ldd r6, Y+14 ; 0x0e |
7e38: 7d 84 ldd r7, Y+13 ; 0x0d |
7e3a: 8c 84 ldd r8, Y+12 ; 0x0c |
7e3c: 9b 84 ldd r9, Y+11 ; 0x0b |
7e3e: aa 84 ldd r10, Y+10 ; 0x0a |
7e40: b9 84 ldd r11, Y+9 ; 0x09 |
7e42: c8 84 ldd r12, Y+8 ; 0x08 |
7e44: df 80 ldd r13, Y+7 ; 0x07 |
7e46: ee 80 ldd r14, Y+6 ; 0x06 |
7e48: fd 80 ldd r15, Y+5 ; 0x05 |
7e4a: 0c 81 ldd r16, Y+4 ; 0x04 |
7e4c: 1b 81 ldd r17, Y+3 ; 0x03 |
7e4e: aa 81 ldd r26, Y+2 ; 0x02 |
7e50: b9 81 ldd r27, Y+1 ; 0x01 |
7e52: ce 0f add r28, r30 |
7e54: d1 1d adc r29, r1 |
7e56: 0f b6 in r0, 0x3f ; 63 |
7e58: f8 94 cli |
7e5a: de bf out 0x3e, r29 ; 62 |
7e5c: 0f be out 0x3f, r0 ; 63 |
7e5e: cd bf out 0x3d, r28 ; 61 |
7e60: ed 01 movw r28, r26 |
7e62: 08 95 ret |
00007e64 <__eeprom_read_byte_1F2021>: |
7e64: f9 99 sbic 0x1f, 1 ; 31 |
7e66: fe cf rjmp .-4 ; 0x7e64 <__eeprom_read_byte_1F2021> |
7e68: b2 bd out 0x22, r27 ; 34 |
7e6a: a1 bd out 0x21, r26 ; 33 |
7e6c: f8 9a sbi 0x1f, 0 ; 31 |
7e6e: 11 96 adiw r26, 0x01 ; 1 |
7e70: 00 b4 in r0, 0x20 ; 32 |
7e72: 08 95 ret |
00007e74 <__eeprom_write_byte_1F2021>: |
7e74: f9 99 sbic 0x1f, 1 ; 31 |
7e76: fe cf rjmp .-4 ; 0x7e74 <__eeprom_write_byte_1F2021> |
7e78: b2 bd out 0x22, r27 ; 34 |
7e7a: a1 bd out 0x21, r26 ; 33 |
7e7c: 00 bc out 0x20, r0 ; 32 |
7e7e: 11 96 adiw r26, 0x01 ; 1 |
7e80: 0f b6 in r0, 0x3f ; 63 |
7e82: f8 94 cli |
7e84: fa 9a sbi 0x1f, 2 ; 31 |
7e86: f9 9a sbi 0x1f, 1 ; 31 |
7e88: 0f be out 0x3f, r0 ; 63 |
7e8a: 08 95 ret |
00007e8c <_exit>: |
7e8c: ff cf rjmp .-2 ; 0x7e8c <_exit> |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/Flight-Ctrl_MEGA644_V0_61.map |
---|
0,0 → 1,1751 |
Archive member included because of file (symbol) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(addsf3.o) |
analog.o (__subsf3) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(addsf3x.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(addsf3.o) (__addsf3x) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(divsf3.o) |
fc.o (__divsf3) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(divsf3x.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(divsf3.o) (__divsf3x) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fixsfsi.o) |
analog.o (__fixsfsi) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(floatsisf.o) |
analog.o (__floatsisf) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_cmp.o) |
analog.o (__ltsf2) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_merge.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(addsf3.o) (__fp_merge) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_nan.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(divsf3x.o) (__fp_nanx) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_split.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(addsf3.o) (__fp_split3) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_zero.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fixsfsi.o) (__fp_zero) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(mulsf3.o) |
fc.o (__mulsf3) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(mulsf3x.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(mulsf3.o) (__mulsf3x) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_mulsi3.o) |
timer0.o (__mulsi3) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_udivmodhi4.o) |
analog.o (__udivmodhi4) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divmodhi4.o) |
timer0.o (__divmodhi4) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_udivmodsi4.o) |
printf_P.o (__udivmodsi4) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divmodsi4.o) |
timer0.o (__divmodsi4) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_exit.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o (exit) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_copy_data.o) |
main.o (__do_copy_data) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_clear_bss.o) |
main.o (__do_clear_bss) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divdi3.o) |
GPS.o (__divdi3) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_prologue.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divdi3.o) (__prologue_saves__) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_epilogue.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divdi3.o) (__epilogue_restores__) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_clz.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divdi3.o) (__clz_tab) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libc.a(memchr.o) |
printf_P.o (memchr) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libc.a(ee_rb.1F2021.o) |
main.o (__eeprom_read_byte_1F2021) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libc.a(ee_wb.1F2021.o) |
main.o (__eeprom_write_byte_1F2021) |
Allocating common symbols |
Common symbol size file |
durchschnitt_easting |
0x4 main.o |
ubxEp 0x2 uart.o |
MeineSlaveAdresse 0x1 uart.o |
CK_A 0x1 uart.o |
EE_Parameter 0x3a fc.o |
DiffRoll 0x2 main.o |
MesswertRoll 0x2 fc.o |
Motor_Vorne 0x1 main.o |
Motor_Hinten 0x1 main.o |
D_GPS_Verstaerkung 0x2 main.o |
MesswertNick 0x2 fc.o |
Aktuell_ay 0x2 analog.o |
filter_north 0x20 GPS.o |
MIN_GAS 0x1 fc.o |
SendeBuffer 0x96 uart.o |
NMEABuffer 0x96 uart.o |
Mittelwert_AccHoch 0x2 fc.o |
Debug_Timer 0x2 uart.o |
CK_B 0x1 uart.o |
DiffNick 0x2 main.o |
navStatus 0x11 uart.o |
DebugIn 0xb uart.o |
VersionInfo 0xa uart.o |
rollOffset 0x4 uart.o |
filter_east 0x20 GPS.o |
motor_rx 0x8 twimaster.o |
PPM_in 0x1e rc.o |
IntegralFaktor 0x4 fc.o |
Motor_Rechts 0x1 main.o |
Count 0x1 main.o |
Aktuell_az 0x2 analog.o |
ubxP 0x2 uart.o |
StartLuftdruck 0x2 analog.o |
navVelECEF 0x15 uart.o |
RxdBuffer 0x96 uart.o |
durchschnitt_northing |
0x4 main.o |
navPosUtm 0x13 uart.o |
ubxSp 0x2 uart.o |
PrintZiel 0x1 printf_P.o |
Aktuell_Nick 0x2 analog.o |
messanzahl_Druck 0x1 analog.o |
Motor_Links 0x1 main.o |
Aktuell_Roll 0x2 analog.o |
msgLen 0x2 uart.o |
nickOffset 0x4 uart.o |
Aktuell_ax 0x2 analog.o |
navPosECEF 0x15 uart.o |
s 0x1 main.o |
h 0x1 main.o |
Mittelwert_AccNick 0x2 fc.o |
DebugOut 0x32 uart.o |
DruckOffsetSetting 0x1 analog.o |
actualPos 0x2f uart.o |
Aktuell_Gier 0x2 analog.o |
msgID 0x1 uart.o |
MAX_GAS 0x1 fc.o |
MesswertGier 0x2 fc.o |
P_GPS_Verstaerkung 0x2 main.o |
GyroFaktor 0x4 fc.o |
m 0x1 main.o |
Mittelwert_AccRoll 0x2 fc.o |
ignorePacket 0x1 uart.o |
MotorWert 0x5 main.o |
PPM_diff 0x1e rc.o |
navVelNed 0x25 uart.o |
tmpLuftdruck 0x2 analog.o |
Discarded input sections |
.stabstr 0x00000000 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
Memory Configuration |
Name Origin Length Attributes |
text 0x00000000 0x00020000 xr |
data 0x00800060 0x0000ffa0 rw !x |
eeprom 0x00810000 0x00010000 rw !x |
*default* 0x00000000 0xffffffff |
Linker script and memory map |
Address of section .data set to 0x800100 |
LOAD c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
LOAD main.o |
LOAD uart.o |
LOAD printf_P.o |
LOAD timer0.o |
LOAD analog.o |
LOAD menu.o |
LOAD twimaster.o |
LOAD rc.o |
LOAD fc.o |
LOAD GPS.o |
LOAD c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a |
LOAD c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a |
LOAD c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libc.a |
LOAD c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a |
.hash |
*(.hash) |
.dynsym |
*(.dynsym) |
.dynstr |
*(.dynstr) |
.gnu.version |
*(.gnu.version) |
.gnu.version_d |
*(.gnu.version_d) |
.gnu.version_r |
*(.gnu.version_r) |
.rel.init |
*(.rel.init) |
.rela.init |
*(.rela.init) |
.rel.text |
*(.rel.text) |
*(.rel.text.*) |
*(.rel.gnu.linkonce.t*) |
.rela.text |
*(.rela.text) |
*(.rela.text.*) |
*(.rela.gnu.linkonce.t*) |
.rel.fini |
*(.rel.fini) |
.rela.fini |
*(.rela.fini) |
.rel.rodata |
*(.rel.rodata) |
*(.rel.rodata.*) |
*(.rel.gnu.linkonce.r*) |
.rela.rodata |
*(.rela.rodata) |
*(.rela.rodata.*) |
*(.rela.gnu.linkonce.r*) |
.rel.data |
*(.rel.data) |
*(.rel.data.*) |
*(.rel.gnu.linkonce.d*) |
.rela.data |
*(.rela.data) |
*(.rela.data.*) |
*(.rela.gnu.linkonce.d*) |
.rel.ctors |
*(.rel.ctors) |
.rela.ctors |
*(.rela.ctors) |
.rel.dtors |
*(.rel.dtors) |
.rela.dtors |
*(.rela.dtors) |
.rel.got |
*(.rel.got) |
.rela.got |
*(.rela.got) |
.rel.bss |
*(.rel.bss) |
.rela.bss |
*(.rela.bss) |
.rel.plt |
*(.rel.plt) |
.rela.plt |
*(.rela.plt) |
.text 0x00000000 0x7e8e |
*(.vectors) |
.vectors 0x00000000 0x70 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
0x00000000 __vectors |
0x00000000 __vector_default |
*(.vectors) |
*(.progmem.gcc*) |
*(.progmem*) |
.progmem.data 0x00000070 0xcb main.o |
.progmem.data 0x0000013b 0x2 analog.o |
.progmem.data 0x0000013d 0x28c menu.o |
0x000003ca . = ALIGN (0x2) |
*fill* 0x000003c9 0x1 00 |
0x000003ca __trampolines_start = . |
*(.trampolines) |
.trampolines 0x000003ca 0x0 linker stubs |
*(.trampolines*) |
0x000003ca __trampolines_end = . |
*(.jumptables) |
*(.jumptables*) |
*(.lowtext) |
*(.lowtext*) |
0x000003ca __ctors_start = . |
*(.ctors) |
0x000003ca __ctors_end = . |
0x000003ca __dtors_start = . |
*(.dtors) |
0x000003ca __dtors_end = . |
SORT(*)(.ctors) |
SORT(*)(.dtors) |
*(.init0) |
.init0 0x000003ca 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
0x000003ca __init |
*(.init0) |
*(.init1) |
*(.init1) |
*(.init2) |
.init2 0x000003ca 0xc c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
*(.init2) |
*(.init3) |
*(.init3) |
*(.init4) |
.init4 0x000003d6 0x16 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_copy_data.o) |
0x000003d6 __do_copy_data |
.init4 0x000003ec 0x10 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_clear_bss.o) |
0x000003ec __do_clear_bss |
*(.init4) |
*(.init5) |
*(.init5) |
*(.init6) |
*(.init6) |
*(.init7) |
*(.init7) |
*(.init8) |
*(.init8) |
*(.init9) |
.init9 0x000003fc 0x8 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
*(.init9) |
*(.text) |
.text 0x00000404 0x4 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
0x00000404 __vector_1 |
0x00000404 __bad_interrupt |
0x00000404 __vector_6 |
0x00000404 __vector_3 |
0x00000404 __vector_23 |
0x00000404 __vector_25 |
0x00000404 __vector_11 |
0x00000404 __vector_13 |
0x00000404 __vector_17 |
0x00000404 __vector_19 |
0x00000404 __vector_7 |
0x00000404 __vector_27 |
0x00000404 __vector_5 |
0x00000404 __vector_4 |
0x00000404 __vector_2 |
0x00000404 __vector_21 |
0x00000404 __vector_15 |
0x00000404 __vector_8 |
0x00000404 __vector_14 |
0x00000404 __vector_10 |
0x00000404 __vector_16 |
.text 0x00000408 0x334 main.o |
0x00000416 WriteParameterSet |
0x00000446 ReadParameterSet |
0x00000472 main |
0x00000408 GetActiveParamSetNumber |
.text 0x0000073c 0xacc uart.o |
0x0000073c __vector_22 |
0x00000f8e WriteProgramData |
0x00000f90 UART_Init |
0x000007a8 GPSscanData |
0x000010a6 BearbeiteRxDaten |
0x00000d90 AddCRC |
0x00000fca DatenUebertragung |
0x00000ebc Decode64 |
0x00000dec SendOutData |
0x0000095a __vector_20 |
0x00000f6c uart_putchar |
.text 0x00001208 0x5f6 printf_P.o |
0x00001208 Putchar |
0x000012ba _printf_P |
0x0000123a PAD_0 |
0x00001266 PRINTP |
0x00001292 PRINT |
0x00001250 PAD_SP |
.text 0x000017fe 0x318 timer0.o |
0x0000192c SetDelay |
0x00001aa4 Timer_Init |
0x0000193e CheckDelay |
0x00001af2 Delay_ms |
0x00001956 __vector_9 |
0x000017fe __vector_18 |
.text 0x00001b16 0x6a2 analog.o |
0x00001b22 __vector_24 |
0x00001b16 ADC_Init |
0x0000216a SucheLuftruckOffset |
.text 0x000021b8 0x7e6 menu.o |
0x000021b8 LcdClear |
0x000021ca Menu |
.text 0x0000299e 0x170 twimaster.o |
0x000029aa i2c_start |
0x000029b6 i2c_stop |
0x0000299e i2c_init |
0x000029d2 __vector_26 |
0x000029be i2c_write_byte |
.text 0x00002b0e 0x168 rc.o |
0x00002b38 __vector_12 |
0x00002b0e rc_sum_init |
.text 0x00002c76 0x2afa fc.o |
0x00003e12 DefaultKonstanten1 |
0x00003ef2 SendMotorData |
0x00002c76 Mittelwert |
0x00004140 Piep |
0x000033b0 CalibrierMittelwert |
0x00003f48 SetNeutral |
0x00003d3a DefaultKonstanten2 |
0x000038a0 ParameterZuordnung |
0x0000416a MotorRegler |
.text 0x00005770 0xda6 GPS.o |
0x00005770 gps_main |
.text 0x00006516 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(addsf3.o) |
.text 0x00006516 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(addsf3x.o) |
.text 0x00006516 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(divsf3.o) |
.text 0x00006516 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(divsf3x.o) |
.text 0x00006516 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fixsfsi.o) |
.text 0x00006516 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(floatsisf.o) |
.text 0x00006516 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_cmp.o) |
.text 0x00006516 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_merge.o) |
.text 0x00006516 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_nan.o) |
.text 0x00006516 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_split.o) |
.text 0x00006516 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_zero.o) |
.text 0x00006516 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(mulsf3.o) |
.text 0x00006516 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(mulsf3x.o) |
.text 0x00006516 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_mulsi3.o) |
.text 0x00006516 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_udivmodhi4.o) |
.text 0x00006516 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divmodhi4.o) |
.text 0x00006516 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_udivmodsi4.o) |
.text 0x00006516 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divmodsi4.o) |
.text 0x00006516 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_exit.o) |
.text 0x00006516 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_copy_data.o) |
.text 0x00006516 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_clear_bss.o) |
.text 0x00006516 0x14f0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divdi3.o) |
0x00006516 __divdi3 |
.text 0x00007a06 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_prologue.o) |
.text 0x00007a06 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_epilogue.o) |
.text 0x00007a06 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_clz.o) |
.text 0x00007a06 0x1a c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libc.a(memchr.o) |
0x00007a06 memchr |
.text 0x00007a20 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libc.a(ee_rb.1F2021.o) |
.text 0x00007a20 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libc.a(ee_wb.1F2021.o) |
0x00007a20 . = ALIGN (0x2) |
*(.text.*) |
.text.fplib 0x00007a20 0xa c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(addsf3.o) |
0x00007a20 __subsf3 |
0x00007a22 __addsf3 |
.text.fplib 0x00007a2a 0x7c c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(addsf3x.o) |
0x00007a2a __addsf3x |
.text.fplib 0x00007aa6 0x6 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(divsf3.o) |
0x00007aa6 __divsf3 |
.text.fplib 0x00007aac 0x86 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(divsf3x.o) |
0x00007aac __divsf3x |
.text.fplib 0x00007b32 0x36 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fixsfsi.o) |
0x00007b32 __fixsfsi |
0x00007b58 __fp_lneg |
0x00007b32 __fixunssfsi |
.text.fplib 0x00007b68 0x18 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(floatsisf.o) |
0x00007b6c __floatsisf |
0x00007b68 __floatunssisf |
.text.fplib 0x00007b80 0x44 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_cmp.o) |
0x00007b80 __lesf2 |
0x00007b80 __nesf2 |
0x00007b86 __gtsf2 |
0x00007b80 __eqsf2 |
0x00007b8c __cmpsf2 |
0x00007b80 __ltsf2 |
0x00007b86 __gesf2 |
.text.fplib 0x00007bc4 0x3a c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_merge.o) |
0x00007bce __fp_merge |
.text.fplib 0x00007bfe 0x6 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_nan.o) |
0x00007bfe __fp_nanERANGE |
0x00007bfe __fp_nan |
0x00007bfe __fp_nanEDOM |
0x00007bfe __fp_nanx |
.text.fplib 0x00007c04 0x52 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_split.o) |
0x00007c04 __fp_split3 |
0x00007c0a __fp_split2 |
0x00007c1c __fp_split1 |
0x00007c38 __fp_split_a |
.text.fplib 0x00007c56 0xa c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_zero.o) |
0x00007c56 __fp_zero |
0x00007c5c __fp_zerox |
.text.fplib 0x00007c60 0x6 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(mulsf3.o) |
0x00007c60 __mulsf3 |
.text.fplib 0x00007c66 0x8a c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(mulsf3x.o) |
0x00007c66 __mulsf3x |
.text.libgcc 0x00007cf0 0x3e c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_mulsi3.o) |
0x00007cf0 __mulsi3 |
.text.libgcc 0x00007d2e 0x28 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_udivmodhi4.o) |
0x00007d2e __udivmodhi4 |
.text.libgcc 0x00007d56 0x26 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divmodhi4.o) |
0x00007d56 __divmodhi4 |
0x00007d56 _div |
.text.libgcc 0x00007d7c 0x44 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_udivmodsi4.o) |
0x00007d7c __udivmodsi4 |
.text.libgcc 0x00007dc0 0x36 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divmodsi4.o) |
0x00007dc0 __divmodsi4 |
.text.libgcc 0x00007df6 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_exit.o) |
.text.libgcc 0x00007df6 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_copy_data.o) |
.text.libgcc 0x00007df6 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_clear_bss.o) |
.text.libgcc 0x00007df6 0x38 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_prologue.o) |
0x00007df6 __prologue_saves__ |
.text.libgcc 0x00007e2e 0x36 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_epilogue.o) |
0x00007e2e __epilogue_restores__ |
.text.eeprom 0x00007e64 0x10 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libc.a(ee_rb.1F2021.o) |
0x00007e64 __eeprom_read_byte_1F2021 |
.text.eeprom 0x00007e74 0x18 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libc.a(ee_wb.1F2021.o) |
0x00007e74 __eeprom_write_byte_1F2021 |
0x00007e8c . = ALIGN (0x2) |
*(.fini9) |
.fini9 0x00007e8c 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_exit.o) |
0x00007e8c exit |
0x00007e8c _exit |
*(.fini9) |
*(.fini8) |
*(.fini8) |
*(.fini7) |
*(.fini7) |
*(.fini6) |
*(.fini6) |
*(.fini5) |
*(.fini5) |
*(.fini4) |
*(.fini4) |
*(.fini3) |
*(.fini3) |
*(.fini2) |
*(.fini2) |
*(.fini1) |
*(.fini1) |
*(.fini0) |
.fini0 0x00007e8c 0x2 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_exit.o) |
*(.fini0) |
0x00007e8e _etext = . |
.data 0x00800100 0x72a load address 0x00007e8e |
0x00800100 PROVIDE (__data_start, .) |
*(.data) |
.data 0x00800100 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
.data 0x00800100 0x0 main.o |
.data 0x00800100 0x2 uart.o |
0x00800101 PcZugriff |
0x00800100 UebertragungAbgeschlossen |
.data 0x00800102 0x0 printf_P.o |
.data 0x00800102 0x2 timer0.o |
.data 0x00800104 0x8 analog.o |
0x00800104 UBat |
0x0080010a MessLuftdruck |
0x00800106 Luftdruck |
.data 0x0080010c 0x5b menu.o |
0x0080010c Array |
0x00800116 DisplayBuff |
.data 0x00800167 0x0 twimaster.o |
.data 0x00800167 0x1 rc.o |
0x00800167 NewPpmData |
.data 0x00800168 0x22 fc.o |
0x0080017c Ki |
0x00800180 Parameter_Luftdruck_D |
0x00800184 Parameter_KompassWirkung |
0x00800189 Parameter_ServoNickControl |
0x00800185 Parameter_Gyro_P |
0x00800182 Parameter_Hoehe_P |
0x00800183 Parameter_Hoehe_ACC_Wirkung |
0x00800186 Parameter_Gyro_I |
0x00800181 Parameter_MaxHoehe |
0x00800188 Parameter_I_Faktor |
0x00800178 Kp |
0x00800187 Parameter_Gier_P |
.data 0x0080018a 0x5a0 GPS.o |
0x0080045a c_cos |
0x0080018a c_sin |
.data 0x0080072a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(addsf3.o) |
.data 0x0080072a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(addsf3x.o) |
.data 0x0080072a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(divsf3.o) |
.data 0x0080072a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(divsf3x.o) |
.data 0x0080072a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fixsfsi.o) |
.data 0x0080072a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(floatsisf.o) |
.data 0x0080072a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_cmp.o) |
.data 0x0080072a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_merge.o) |
.data 0x0080072a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_nan.o) |
.data 0x0080072a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_split.o) |
.data 0x0080072a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_zero.o) |
.data 0x0080072a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(mulsf3.o) |
.data 0x0080072a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(mulsf3x.o) |
.data 0x0080072a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_mulsi3.o) |
.data 0x0080072a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_udivmodhi4.o) |
.data 0x0080072a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divmodhi4.o) |
.data 0x0080072a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_udivmodsi4.o) |
.data 0x0080072a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divmodsi4.o) |
.data 0x0080072a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_exit.o) |
.data 0x0080072a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_copy_data.o) |
.data 0x0080072a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_clear_bss.o) |
.data 0x0080072a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divdi3.o) |
.data 0x0080072a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_prologue.o) |
.data 0x0080072a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_epilogue.o) |
.data 0x0080072a 0x100 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_clz.o) |
0x0080072a __clz_tab |
.data 0x0080082a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libc.a(memchr.o) |
.data 0x0080082a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libc.a(ee_rb.1F2021.o) |
.data 0x0080082a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libc.a(ee_wb.1F2021.o) |
*(.data*) |
*(.rodata) |
*(.rodata*) |
*(.gnu.linkonce.d*) |
0x0080082a . = ALIGN (0x2) |
0x0080082a _edata = . |
0x0080082a PROVIDE (__data_end, .) |
.bss 0x0080082a 0x4f6 |
0x0080082a PROVIDE (__bss_start, .) |
*(.bss) |
.bss 0x0080082a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
.bss 0x0080082a 0x0 main.o |
.bss 0x0080082a 0x18 uart.o |
0x0080082a DebugGetAnforderung |
0x0080082e SioTmp |
0x00800833 PC_DebugTimeout |
0x0080082d GetVersionAnforderung |
0x00800830 NeueKoordinateEmpfangen |
0x0080082c DebugDataAnforderung |
0x00800834 MotorTest |
0x0080082f NeuerDatensatzEmpfangen |
0x0080082b DebugDisplayAnforderung |
0x00800831 CntCrcError |
0x00800832 AnzahlEmpfangsBytes |
.bss 0x00800842 0x0 printf_P.o |
.bss 0x00800842 0xc timer0.o |
0x00800847 beeptime |
0x00800842 CountMilliseconds |
0x00800845 cntKompass |
0x00800844 UpdateMotor |
0x00800849 ServoValue |
.bss 0x0080084e 0x18 analog.o |
0x00800860 HoeheD |
0x00800852 AccumulateGier |
0x0080085d messanzahl_AccNick |
0x0080085f messanzahl_AccHoch |
0x00800850 AccumulateRoll |
0x00800862 ZaehlMessungen |
0x00800858 accumulate_AccHoch |
0x0080085e messanzahl_AccRoll |
0x00800854 accumulate_AccRoll |
0x0080085a MessanzahlNick |
0x0080085c MessanzahlGier |
0x00800856 accumulate_AccNick |
0x0080084e AccumulateNick |
0x0080085b MessanzahlRoll |
.bss 0x00800866 0x5 menu.o |
0x00800868 DispPtr |
0x00800869 RemoteTasten |
0x00800866 TestInt |
.bss 0x0080086b 0x3 twimaster.o |
0x0080086b twi_state |
0x0080086d motorread |
0x0080086c motor |
.bss 0x0080086e 0x4 rc.o |
.bss 0x00800872 0x92 fc.o |
0x008008ab Mess_Integral_Gier2 |
0x008008cb Poti7 |
0x008008d4 StickGier |
0x0080089b Mess_IntegralNick2 |
0x00800887 IntegralNick2 |
0x008008cf SenderOkay |
0x00800893 Integral_Gier |
0x008008d0 StickNick |
0x008008c1 Poti2 |
0x008008d6 MotorenEin |
0x00800881 CosinusNickWinkel |
0x008008d7 HoehenWert |
0x008008bc modell_fliegt_gps |
0x008008a3 Mess_IntegralRoll2 |
0x008008c3 Poti3 |
0x008008cd Poti8 |
0x008008db Parameter_UserParam1 |
0x00800875 AdNeutralRoll |
0x008008bb blinkcount_LED1 |
0x008008b9 Notlandung |
0x00800883 IntegralNick |
0x008008af Mess_Integral_Hoch |
0x008008c7 Poti5 |
0x00800879 NeutralAccX |
0x008008a7 Mess_Integral_Gier |
0x008008be Limit_D_Anteil |
0x008008de Parameter_UserParam4 |
0x008008b5 KompassStartwert |
0x008008dc Parameter_UserParam2 |
0x008008b3 KompassValue |
0x008008b7 KompassRichtung |
0x0080089f Mess_IntegralRoll |
0x008008d2 StickRoll |
0x00800873 AdNeutralNick |
0x0080087b NeutralAccY |
0x0080087d NeutralAccZ |
0x00800872 Timeout |
0x0080088f IntegralRoll2 |
0x008008bf Poti1 |
0x008008dd Parameter_UserParam3 |
0x00800877 AdNeutralGier |
0x00800882 CosinusRollWinkel |
0x008008ba HoehenReglerAktiv |
0x008008d9 SollHoehe |
0x008008c5 Poti4 |
0x00800897 Mess_IntegralNick |
0x008008c9 Poti6 |
0x0080088b IntegralRoll |
.bss 0x00800904 0x56 GPS.o |
0x00800910 GPS_Positionsabweichung_East |
0x00800918 GPS_Geschwindigkeit_East |
0x00800950 EAST_LONG_LONG |
0x00800940 NORTH_MITTEL |
0x00800924 P_Einfluss_East |
0x0080093e NeuerMittelwert |
0x00800939 GPS_Home_East |
0x00800948 NORTH_LONG_LONG |
0x0080093f FilterPos |
0x0080091c P_Einfluss_North |
0x0080092e GPS_East |
0x00800908 Soll_Position_East |
0x00800904 Soll_Position_North |
0x00800914 GPS_Geschwindigkeit_North |
0x00800934 gethome |
0x0080093d blinkcount_LED2 |
0x0080092c GPS_North |
0x00800935 GPS_Home_North |
0x00800930 GPS_Nick |
0x00800958 filterfilled |
0x00800928 D_Einfluss_East |
0x00800944 EAST_MITTEL |
0x00800932 GPS_Roll |
0x00800920 D_Einfluss_North |
0x0080090c GPS_Positionsabweichung_North |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(addsf3.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(addsf3x.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(divsf3.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(divsf3x.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fixsfsi.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(floatsisf.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_cmp.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_merge.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_nan.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_split.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_zero.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(mulsf3.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(mulsf3x.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_mulsi3.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_udivmodhi4.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divmodhi4.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_udivmodsi4.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divmodsi4.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_exit.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_copy_data.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_clear_bss.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divdi3.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_prologue.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_epilogue.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_clz.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libc.a(memchr.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libc.a(ee_rb.1F2021.o) |
.bss 0x0080095a 0x0 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libc.a(ee_wb.1F2021.o) |
*(.bss*) |
*(COMMON) |
COMMON 0x0080095a 0x1d main.o |
0x0080095a durchschnitt_easting |
0x0080095e DiffRoll |
0x00800960 Motor_Vorne |
0x00800961 Motor_Hinten |
0x00800962 D_GPS_Verstaerkung |
0x00800964 DiffNick |
0x00800966 Motor_Rechts |
0x00800967 Count |
0x00800968 durchschnitt_northing |
0x0080096c Motor_Links |
0x0080096d s |
0x0080096e h |
0x0080096f P_GPS_Verstaerkung |
0x00800971 m |
0x00800972 MotorWert |
COMMON 0x00800977 0x2c2 uart.o |
0x00800977 ubxEp |
0x00800979 MeineSlaveAdresse |
0x0080097a CK_A |
0x0080097b SendeBuffer |
0x00800a11 NMEABuffer |
0x00800aa7 Debug_Timer |
0x00800aa9 CK_B |
0x00800aaa navStatus |
0x00800abb DebugIn |
0x00800ac6 VersionInfo |
0x00800ad0 rollOffset |
0x00800ad4 ubxP |
0x00800ad6 navVelECEF |
0x00800aeb RxdBuffer |
0x00800b81 navPosUtm |
0x00800b94 ubxSp |
0x00800b96 msgLen |
0x00800b98 nickOffset |
0x00800b9c navPosECEF |
0x00800bb1 DebugOut |
0x00800be3 actualPos |
0x00800c12 msgID |
0x00800c13 ignorePacket |
0x00800c14 navVelNed |
COMMON 0x00800c39 0x1 printf_P.o |
0x00800c39 PrintZiel |
COMMON 0x00800c3a 0x12 analog.o |
0x00800c3a Aktuell_ay |
0x00800c3c Aktuell_az |
0x00800c3e StartLuftdruck |
0x00800c40 Aktuell_Nick |
0x00800c42 messanzahl_Druck |
0x00800c43 Aktuell_Roll |
0x00800c45 Aktuell_ax |
0x00800c47 DruckOffsetSetting |
0x00800c48 Aktuell_Gier |
0x00800c4a tmpLuftdruck |
COMMON 0x00800c4c 0x8 twimaster.o |
0x00800c4c motor_rx |
COMMON 0x00800c54 0x3c rc.o |
0x00800c54 PPM_in |
0x00800c72 PPM_diff |
COMMON 0x00800c90 0x50 fc.o |
0x00800c90 EE_Parameter |
0x00800cca MesswertRoll |
0x00800ccc MesswertNick |
0x00800cce MIN_GAS |
0x00800ccf Mittelwert_AccHoch |
0x00800cd1 IntegralFaktor |
0x00800cd5 Mittelwert_AccNick |
0x00800cd7 MAX_GAS |
0x00800cd8 MesswertGier |
0x00800cda GyroFaktor |
0x00800cde Mittelwert_AccRoll |
COMMON 0x00800ce0 0x40 GPS.o |
0x00800ce0 filter_north |
0x00800d00 filter_east |
0x00800d20 PROVIDE (__bss_end, .) |
0x00007e8e __data_load_start = LOADADDR (.data) |
0x000085b8 __data_load_end = (__data_load_start + SIZEOF (.data)) |
.noinit 0x00800d20 0x0 |
0x00800d20 PROVIDE (__noinit_start, .) |
*(.noinit*) |
0x00800d20 PROVIDE (__noinit_end, .) |
0x00800d20 _end = . |
0x00800d20 PROVIDE (__heap_start, .) |
.eeprom 0x00810000 0x800 |
*(.eeprom*) |
.eeprom 0x00810000 0x800 main.o |
0x00810000 EEPromArray |
0x00810800 __eeprom_end = . |
.stab 0x00000000 0x378 |
*(.stab) |
.stab 0x00000000 0x378 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
.stabstr 0x00000000 0x71 |
*(.stabstr) |
.stabstr 0x00000000 0x71 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
.stab.excl |
*(.stab.excl) |
.stab.exclstr |
*(.stab.exclstr) |
.stab.index |
*(.stab.index) |
.stab.indexstr |
*(.stab.indexstr) |
.comment |
*(.comment) |
.debug |
*(.debug) |
.line |
*(.line) |
.debug_srcinfo |
*(.debug_srcinfo) |
.debug_sfnames |
*(.debug_sfnames) |
.debug_aranges |
*(.debug_aranges) |
.debug_pubnames |
*(.debug_pubnames) |
.debug_info |
*(.debug_info) |
*(.gnu.linkonce.wi.*) |
.debug_abbrev |
*(.debug_abbrev) |
.debug_line |
*(.debug_line) |
.debug_frame |
*(.debug_frame) |
.debug_str |
*(.debug_str) |
.debug_loc |
*(.debug_loc) |
.debug_macinfo |
*(.debug_macinfo) |
OUTPUT(Flight-Ctrl_MEGA644_V0_61.elf elf32-avr) |
LOAD linker stubs |
Cross Reference Table |
Symbol File |
ADC_Init analog.o |
main.o |
AccumulateGier analog.o |
fc.o |
menu.o |
AccumulateNick analog.o |
fc.o |
menu.o |
AccumulateRoll analog.o |
fc.o |
menu.o |
AdNeutralGier fc.o |
rc.o |
menu.o |
analog.o |
AdNeutralNick fc.o |
rc.o |
menu.o |
analog.o |
AdNeutralRoll fc.o |
rc.o |
menu.o |
analog.o |
AddCRC uart.o |
Aktuell_Gier analog.o |
Aktuell_Nick analog.o |
Aktuell_Roll analog.o |
Aktuell_ax analog.o |
Aktuell_ay analog.o |
Aktuell_az fc.o |
menu.o |
analog.o |
AnzahlEmpfangsBytes uart.o |
Array menu.o |
BearbeiteRxDaten uart.o |
main.o |
CK_A uart.o |
CK_B uart.o |
CalibrierMittelwert fc.o |
CheckDelay timer0.o |
fc.o |
uart.o |
main.o |
CntCrcError uart.o |
CosinusNickWinkel fc.o |
GPS.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
CosinusRollWinkel fc.o |
GPS.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
Count GPS.o |
fc.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
CountMilliseconds timer0.o |
D_Einfluss_East GPS.o |
fc.o |
D_Einfluss_North GPS.o |
fc.o |
D_GPS_Verstaerkung GPS.o |
fc.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
DatenUebertragung uart.o |
main.o |
DebugDataAnforderung uart.o |
DebugDisplayAnforderung uart.o |
DebugGetAnforderung uart.o |
DebugIn uart.o |
main.o |
DebugOut fc.o |
uart.o |
Debug_Timer uart.o |
Decode64 uart.o |
DefaultKonstanten1 fc.o |
main.o |
DefaultKonstanten2 fc.o |
main.o |
Delay_ms timer0.o |
fc.o |
analog.o |
DiffNick GPS.o |
fc.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
DiffRoll GPS.o |
fc.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
DispPtr menu.o |
printf_P.o |
DisplayBuff menu.o |
printf_P.o |
uart.o |
DruckOffsetSetting menu.o |
analog.o |
EAST_LONG_LONG GPS.o |
EAST_MITTEL GPS.o |
EEPromArray main.o |
fc.o |
uart.o |
EE_Parameter fc.o |
menu.o |
timer0.o |
uart.o |
main.o |
FilterPos GPS.o |
GPS_East GPS.o |
GPS_Geschwindigkeit_East GPS.o |
fc.o |
GPS_Geschwindigkeit_North GPS.o |
fc.o |
GPS_Home_East GPS.o |
GPS_Home_North GPS.o |
GPS_Nick GPS.o |
fc.o |
GPS_North GPS.o |
GPS_Positionsabweichung_East GPS.o |
fc.o |
GPS_Positionsabweichung_North GPS.o |
fc.o |
GPS_Roll GPS.o |
fc.o |
GPSscanData uart.o |
GetActiveParamSetNumber main.o |
fc.o |
menu.o |
uart.o |
GetVersionAnforderung uart.o |
GyroFaktor fc.o |
HoeheD analog.o |
fc.o |
HoehenReglerAktiv fc.o |
HoehenWert fc.o |
menu.o |
analog.o |
IntegralFaktor fc.o |
IntegralNick fc.o |
GPS.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
IntegralNick2 fc.o |
GPS.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
IntegralRoll fc.o |
GPS.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
IntegralRoll2 fc.o |
GPS.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
Integral_Gier fc.o |
GPS.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
Ki fc.o |
KompassRichtung fc.o |
menu.o |
timer0.o |
KompassStartwert fc.o |
menu.o |
timer0.o |
KompassValue fc.o |
GPS.o |
menu.o |
timer0.o |
Kp fc.o |
LcdClear menu.o |
main.o |
Limit_D_Anteil fc.o |
GPS.o |
Luftdruck analog.o |
fc.o |
MAX_GAS fc.o |
MIN_GAS fc.o |
MeineSlaveAdresse uart.o |
Menu menu.o |
uart.o |
MessLuftdruck analog.o |
fc.o |
menu.o |
Mess_IntegralNick fc.o |
GPS.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
Mess_IntegralNick2 fc.o |
GPS.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
Mess_IntegralRoll fc.o |
GPS.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
Mess_IntegralRoll2 fc.o |
GPS.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
Mess_Integral_Gier fc.o |
GPS.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
Mess_Integral_Gier2 fc.o |
analog.o |
Mess_Integral_Hoch fc.o |
analog.o |
MessanzahlGier analog.o |
fc.o |
menu.o |
MessanzahlNick analog.o |
fc.o |
menu.o |
MessanzahlRoll analog.o |
fc.o |
menu.o |
MesswertGier fc.o |
MesswertNick fc.o |
MesswertRoll fc.o |
Mittelwert fc.o |
Mittelwert_AccHoch fc.o |
Mittelwert_AccNick fc.o |
Mittelwert_AccRoll fc.o |
MotorRegler fc.o |
main.o |
MotorTest uart.o |
fc.o |
MotorWert GPS.o |
fc.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
Motor_Hinten GPS.o |
fc.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
Motor_Links GPS.o |
fc.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
Motor_Rechts GPS.o |
fc.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
Motor_Vorne GPS.o |
fc.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
MotorenEin fc.o |
GPS.o |
main.o |
NMEABuffer uart.o |
NORTH_LONG_LONG GPS.o |
NORTH_MITTEL GPS.o |
NeueKoordinateEmpfangen uart.o |
NeuerDatensatzEmpfangen uart.o |
NeuerMittelwert GPS.o |
NeutralAccX fc.o |
menu.o |
analog.o |
NeutralAccY fc.o |
menu.o |
analog.o |
NeutralAccZ fc.o |
menu.o |
analog.o |
NewPpmData rc.o |
fc.o |
Notlandung fc.o |
PAD_0 printf_P.o |
PAD_SP printf_P.o |
PC_DebugTimeout uart.o |
PPM_diff fc.o |
rc.o |
PPM_in fc.o |
rc.o |
menu.o |
main.o |
PRINT printf_P.o |
PRINTP printf_P.o |
P_Einfluss_East GPS.o |
fc.o |
P_Einfluss_North GPS.o |
fc.o |
P_GPS_Verstaerkung GPS.o |
fc.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
ParameterZuordnung fc.o |
Parameter_Gier_P fc.o |
Parameter_Gyro_I fc.o |
Parameter_Gyro_P fc.o |
Parameter_Hoehe_ACC_Wirkung fc.o |
Parameter_Hoehe_P fc.o |
Parameter_I_Faktor fc.o |
Parameter_KompassWirkung fc.o |
Parameter_Luftdruck_D fc.o |
Parameter_MaxHoehe fc.o |
Parameter_ServoNickControl fc.o |
menu.o |
timer0.o |
Parameter_UserParam1 fc.o |
Parameter_UserParam2 fc.o |
Parameter_UserParam3 fc.o |
Parameter_UserParam4 fc.o |
PcZugriff uart.o |
fc.o |
main.o |
Piep fc.o |
uart.o |
Poti1 fc.o |
menu.o |
Poti2 fc.o |
menu.o |
Poti3 fc.o |
GPS.o |
menu.o |
Poti4 fc.o |
menu.o |
Poti5 fc.o |
menu.o |
Poti6 fc.o |
menu.o |
Poti7 fc.o |
menu.o |
Poti8 fc.o |
menu.o |
PrintZiel printf_P.o |
Putchar printf_P.o |
ReadParameterSet main.o |
fc.o |
uart.o |
RemoteTasten menu.o |
GPS.o |
fc.o |
rc.o |
twimaster.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
RxdBuffer uart.o |
SendMotorData fc.o |
main.o |
SendOutData uart.o |
SendeBuffer uart.o |
SenderOkay fc.o |
GPS.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
ServoValue timer0.o |
menu.o |
SetDelay timer0.o |
fc.o |
uart.o |
main.o |
SetNeutral fc.o |
main.o |
SioTmp uart.o |
SollHoehe fc.o |
menu.o |
Soll_Position_East GPS.o |
fc.o |
Soll_Position_North GPS.o |
fc.o |
StartLuftdruck fc.o |
analog.o |
StickGier fc.o |
main.o |
StickNick fc.o |
GPS.o |
main.o |
StickRoll fc.o |
GPS.o |
main.o |
SucheLuftruckOffset analog.o |
fc.o |
main.o |
TestInt menu.o |
Timeout fc.o |
GPS.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
Timer_Init timer0.o |
main.o |
UART_Init uart.o |
main.o |
UBat analog.o |
menu.o |
main.o |
UebertragungAbgeschlossen uart.o |
UpdateMotor timer0.o |
main.o |
VersionInfo uart.o |
main.o |
WriteParameterSet main.o |
uart.o |
WriteProgramData uart.o |
ZaehlMessungen analog.o |
fc.o |
__addsf3 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(addsf3.o) |
GPS.o |
fc.o |
analog.o |
__addsf3x c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(addsf3x.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(addsf3.o) |
__bad_interrupt c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__bss_end c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_clear_bss.o) |
__bss_start c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_clear_bss.o) |
__clz_tab c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_clz.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divdi3.o) |
__cmpsf2 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_cmp.o) |
__data_end c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_copy_data.o) |
__data_load_start c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_copy_data.o) |
__data_start c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_copy_data.o) |
__divdi3 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divdi3.o) |
GPS.o |
__divmodhi4 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divmodhi4.o) |
fc.o |
rc.o |
menu.o |
analog.o |
timer0.o |
__divmodsi4 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divmodsi4.o) |
fc.o |
menu.o |
analog.o |
timer0.o |
__divsf3 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(divsf3.o) |
fc.o |
__divsf3x c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(divsf3x.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(divsf3.o) |
__do_clear_bss c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_clear_bss.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_clz.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divdi3.o) |
GPS.o |
fc.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
__do_copy_data c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_copy_data.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_clz.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divdi3.o) |
GPS.o |
fc.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
__eeprom_read_byte_1F2021 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libc.a(ee_rb.1F2021.o) |
main.o |
__eeprom_write_byte_1F2021 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libc.a(ee_wb.1F2021.o) |
fc.o |
uart.o |
main.o |
__epilogue_restores__ c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_epilogue.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divdi3.o) |
__eqsf2 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_cmp.o) |
__fixsfsi c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fixsfsi.o) |
GPS.o |
fc.o |
menu.o |
analog.o |
__fixunssfsi c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fixsfsi.o) |
__floatsisf c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(floatsisf.o) |
GPS.o |
fc.o |
analog.o |
__floatunssisf c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(floatsisf.o) |
__fp_lneg c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fixsfsi.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(floatsisf.o) |
__fp_merge c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_merge.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(mulsf3.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(floatsisf.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(divsf3.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(addsf3.o) |
__fp_nan c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_nan.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_split.o) |
__fp_nanEDOM c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_nan.o) |
__fp_nanERANGE c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_nan.o) |
__fp_nanx c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_nan.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(mulsf3x.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(divsf3x.o) |
__fp_split1 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_split.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fixsfsi.o) |
__fp_split2 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_split.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_cmp.o) |
__fp_split3 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_split.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(mulsf3.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(divsf3.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(addsf3.o) |
__fp_split_a c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_split.o) |
__fp_zero c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_zero.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_merge.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fixsfsi.o) |
__fp_zerox c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_zero.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(mulsf3x.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(divsf3x.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(addsf3x.o) |
__gesf2 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_cmp.o) |
__gtsf2 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_cmp.o) |
analog.o |
__heap_end c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__init c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__lesf2 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_cmp.o) |
__ltsf2 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_cmp.o) |
fc.o |
analog.o |
__mulsf3 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(mulsf3.o) |
GPS.o |
fc.o |
__mulsf3x c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(mulsf3x.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(mulsf3.o) |
__mulsi3 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_mulsi3.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divdi3.o) |
GPS.o |
fc.o |
timer0.o |
__nesf2 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(fp_cmp.o) |
__prologue_saves__ c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_prologue.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divdi3.o) |
__stack c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__subsf3 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libm.a(addsf3.o) |
analog.o |
__udivmodhi4 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_udivmodhi4.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divmodhi4.o) |
analog.o |
__udivmodsi4 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_udivmodsi4.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divdi3.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divmodsi4.o) |
printf_P.o |
__vector_1 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_10 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_11 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_12 rc.o |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_13 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_14 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_15 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_16 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_17 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_18 timer0.o |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_19 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_2 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_20 uart.o |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_21 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_22 uart.o |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_23 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_24 analog.o |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_25 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_26 twimaster.o |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_27 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_3 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_4 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_5 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_6 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_7 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_8 c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_9 timer0.o |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vector_default c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
__vectors c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
_div c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_divmodhi4.o) |
_exit c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_exit.o) |
_printf_P printf_P.o |
menu.o |
analog.o |
main.o |
accumulate_AccHoch analog.o |
fc.o |
accumulate_AccNick analog.o |
fc.o |
menu.o |
accumulate_AccRoll analog.o |
fc.o |
menu.o |
actualPos GPS.o |
uart.o |
beeptime timer0.o |
GPS.o |
fc.o |
main.o |
blinkcount_LED1 fc.o |
blinkcount_LED2 GPS.o |
c_cos GPS.o |
c_sin GPS.o |
cntKompass timer0.o |
durchschnitt_easting GPS.o |
fc.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
durchschnitt_northing GPS.o |
fc.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
exit c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/avr5\libgcc.a(_exit.o) |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
filter_east GPS.o |
filter_north GPS.o |
filterfilled GPS.o |
gethome GPS.o |
gps_main GPS.o |
fc.o |
h GPS.o |
fc.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
i2c_init twimaster.o |
main.o |
i2c_start twimaster.o |
fc.o |
i2c_stop twimaster.o |
i2c_write_byte twimaster.o |
ignorePacket uart.o |
m GPS.o |
fc.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
main main.o |
c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5/crtm644.o |
memchr c:/winavr-20070525/bin/../lib/gcc/avr/4.1.2/../../../../avr/lib/avr5\libc.a(memchr.o) |
printf_P.o |
messanzahl_AccHoch analog.o |
fc.o |
messanzahl_AccNick analog.o |
fc.o |
menu.o |
messanzahl_AccRoll analog.o |
fc.o |
menu.o |
messanzahl_Druck analog.o |
modell_fliegt_gps fc.o |
GPS.o |
motor twimaster.o |
fc.o |
motor_rx twimaster.o |
motorread twimaster.o |
msgID uart.o |
msgLen uart.o |
navPosECEF uart.o |
navPosUtm uart.o |
navStatus uart.o |
navVelECEF uart.o |
navVelNed uart.o |
nickOffset uart.o |
rc_sum_init rc.o |
main.o |
rollOffset uart.o |
s GPS.o |
fc.o |
rc.o |
twimaster.o |
menu.o |
analog.o |
timer0.o |
printf_P.o |
uart.o |
main.o |
tmpLuftdruck analog.o |
twi_state twimaster.o |
fc.o |
uart_putchar uart.o |
printf_P.o |
ubxEp uart.o |
ubxP uart.o |
ubxSp uart.o |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/Flight-Ctrl_MEGA644_V0_61.sym |
---|
0,0 → 1,506 |
00000000 W __heap_end |
00000000 a __tmp_reg__ |
00000000 a __tmp_reg__ |
00000000 a __tmp_reg__ |
00000000 a __tmp_reg__ |
00000000 a __tmp_reg__ |
00000000 a __tmp_reg__ |
00000000 a __tmp_reg__ |
00000000 a __tmp_reg__ |
00000000 a __tmp_reg__ |
00000000 a __tmp_reg__ |
00000000 a __tmp_reg__ |
00000000 a __tmp_reg__ |
00000000 W __vector_default |
00000000 T __vectors |
00000001 a __zero_reg__ |
00000001 a __zero_reg__ |
00000001 a __zero_reg__ |
00000001 a __zero_reg__ |
00000001 a __zero_reg__ |
00000001 a __zero_reg__ |
00000001 a __zero_reg__ |
00000001 a __zero_reg__ |
00000001 a __zero_reg__ |
00000001 a __zero_reg__ |
00000001 a __zero_reg__ |
00000001 a __zero_reg__ |
0000003d a __SP_L__ |
0000003d a __SP_L__ |
0000003d a __SP_L__ |
0000003d a __SP_L__ |
0000003d a __SP_L__ |
0000003d a __SP_L__ |
0000003d a __SP_L__ |
0000003d a __SP_L__ |
0000003d a __SP_L__ |
0000003d a __SP_L__ |
0000003d a __SP_L__ |
0000003d a __SP_L__ |
0000003e a __SP_H__ |
0000003e a __SP_H__ |
0000003e a __SP_H__ |
0000003e a __SP_H__ |
0000003e a __SP_H__ |
0000003e a __SP_H__ |
0000003e a __SP_H__ |
0000003e a __SP_H__ |
0000003e a __SP_H__ |
0000003e a __SP_H__ |
0000003e a __SP_H__ |
0000003e a __SP_H__ |
0000003f a __SREG__ |
0000003f a __SREG__ |
0000003f a __SREG__ |
0000003f a __SREG__ |
0000003f a __SREG__ |
0000003f a __SREG__ |
0000003f a __SREG__ |
0000003f a __SREG__ |
0000003f a __SREG__ |
0000003f a __SREG__ |
0000003f a __SREG__ |
0000003f a __SREG__ |
00000070 t __c.2052 |
00000074 t __c.2050 |
0000007c t __c.2048 |
00000088 t __c.2046 |
00000096 t __c.2044 |
0000009b t __c.2039 |
000000b8 t __c.2037 |
000000d3 t __c.2031 |
00000102 t __c.2029 |
00000123 t __c.2027 |
0000013b t __c.2026 |
0000013d t __c.2108 |
0000014b t __c.2106 |
00000159 t __c.2104 |
00000167 t __c.2102 |
0000016f t __c.2099 |
00000181 t __c.2097 |
00000193 t __c.2095 |
000001a5 t __c.2093 |
000001b7 t __c.2090 |
000001c6 t __c.2088 |
000001d5 t __c.2086 |
000001e4 t __c.2084 |
000001f3 t __c.2081 |
00000202 t __c.2079 |
00000211 t __c.2076 |
00000220 t __c.2074 |
0000022f t __c.2072 |
0000023e t __c.2070 |
0000024b t __c.2067 |
0000025a t __c.2065 |
00000269 t __c.2063 |
00000278 t __c.2061 |
00000286 t __c.2058 |
00000296 t __c.2056 |
000002a6 t __c.2054 |
000002b6 t __c.2052 |
000002c6 t __c.2049 |
000002d6 t __c.2047 |
000002e6 t __c.2045 |
000002f6 t __c.2043 |
00000306 t __c.2040 |
00000315 t __c.2038 |
00000324 t __c.2036 |
00000333 t __c.2034 |
0000033d t __c.2031 |
0000034b t __c.2029 |
00000352 t __c.2027 |
00000361 t __c.2025 |
00000370 t __c.2023 |
0000037f t __c.2021 |
0000038e t __c.2017 |
0000039e t __c.2015 |
000003ab t __c.2013 |
000003b2 t __c.2011 |
000003c4 t __c.2008 |
000003ca T __ctors_end |
000003ca T __ctors_start |
000003ca T __dtors_end |
000003ca T __dtors_start |
000003ca W __init |
000003ca T __trampolines_end |
000003ca T __trampolines_start |
000003d6 T __do_copy_data |
000003e2 t .do_copy_data_loop |
000003e6 t .do_copy_data_start |
000003ec T __do_clear_bss |
000003f4 t .do_clear_bss_loop |
000003f6 t .do_clear_bss_start |
00000404 T __bad_interrupt |
00000404 W __vector_1 |
00000404 W __vector_10 |
00000404 W __vector_11 |
00000404 W __vector_13 |
00000404 W __vector_14 |
00000404 W __vector_15 |
00000404 W __vector_16 |
00000404 W __vector_17 |
00000404 W __vector_19 |
00000404 W __vector_2 |
00000404 W __vector_21 |
00000404 W __vector_23 |
00000404 W __vector_25 |
00000404 W __vector_27 |
00000404 W __vector_3 |
00000404 W __vector_4 |
00000404 W __vector_5 |
00000404 W __vector_6 |
00000404 W __vector_7 |
00000404 W __vector_8 |
00000408 T GetActiveParamSetNumber |
00000416 T WriteParameterSet |
0000042e t .26_start |
0000043a t .26_finished |
00000446 T ReadParameterSet |
00000460 t .44_start |
0000046c t .44_finished |
00000472 T main |
0000073c T __vector_22 |
000007a8 T GPSscanData |
0000095a T __vector_20 |
00000d90 T AddCRC |
00000dec T SendOutData |
00000ebc T Decode64 |
00000f6c T uart_putchar |
00000f8e T WriteProgramData |
00000f90 T UART_Init |
00000fca T DatenUebertragung |
000010a6 T BearbeiteRxDaten |
000010ff W __stack |
00001208 T Putchar |
0000123a T PAD_0 |
00001250 T PAD_SP |
00001266 T PRINTP |
00001292 T PRINT |
000012ba T _printf_P |
000017fe T __vector_18 |
0000192c T SetDelay |
0000193e T CheckDelay |
00001956 T __vector_9 |
00001aa4 T Timer_Init |
00001af2 T Delay_ms |
00001b16 T ADC_Init |
00001b22 T __vector_24 |
0000216a T SucheLuftruckOffset |
000021b8 T LcdClear |
000021ca T Menu |
0000299e T i2c_init |
000029aa T i2c_start |
000029b6 T i2c_stop |
000029be T i2c_write_byte |
000029d2 T __vector_26 |
00002b0e T rc_sum_init |
00002b38 T __vector_12 |
00002c76 T Mittelwert |
000033b0 T CalibrierMittelwert |
000038a0 T ParameterZuordnung |
00003d3a T DefaultKonstanten2 |
00003e12 T DefaultKonstanten1 |
00003ef2 T SendMotorData |
00003f48 T SetNeutral |
00004140 T Piep |
0000416a T MotorRegler |
00005770 T gps_main |
00006516 T __divdi3 |
00007a06 T memchr |
00007a20 T __subsf3 |
00007a22 T __addsf3 |
00007a2a T __addsf3x |
00007aa6 T __divsf3 |
00007aac T __divsf3x |
00007b32 T __fixsfsi |
00007b32 T __fixunssfsi |
00007b58 T __fp_lneg |
00007b68 T __floatunssisf |
00007b6c T __floatsisf |
00007b80 T __eqsf2 |
00007b80 T __lesf2 |
00007b80 T __ltsf2 |
00007b80 T __nesf2 |
00007b86 T __gesf2 |
00007b86 T __gtsf2 |
00007b8c T __cmpsf2 |
00007b9e t .fp_cmp |
00007bce T __fp_merge |
00007bfe T __fp_nan |
00007bfe T __fp_nanEDOM |
00007bfe T __fp_nanERANGE |
00007bfe T __fp_nanx |
00007c04 T __fp_split3 |
00007c0a T __fp_split2 |
00007c1c T __fp_split1 |
00007c38 T __fp_split_a |
00007c56 T __fp_zero |
00007c5c T __fp_zerox |
00007c60 T __mulsf3 |
00007c66 T __mulsf3x |
00007cf0 T __mulsi3 |
00007d2e T __udivmodhi4 |
00007d36 t __udivmodhi4_loop |
00007d44 t __udivmodhi4_ep |
00007d56 T __divmodhi4 |
00007d56 T _div |
00007d6a t __divmodhi4_neg2 |
00007d70 t __divmodhi4_exit |
00007d72 t __divmodhi4_neg1 |
00007d7c T __udivmodsi4 |
00007d88 t __udivmodsi4_loop |
00007da2 t __udivmodsi4_ep |
00007dc0 T __divmodsi4 |
00007dd4 t __divmodsi4_neg2 |
00007de2 t __divmodsi4_exit |
00007de4 t __divmodsi4_neg1 |
00007df6 T __prologue_saves__ |
00007e2e T __epilogue_restores__ |
00007e64 T __eeprom_read_byte_1F2021 |
00007e74 T __eeprom_write_byte_1F2021 |
00007e8c t __stop_program |
00007e8c T _exit |
00007e8c W exit |
00007e8e A __data_load_start |
00007e8e T _etext |
000085b8 A __data_load_end |
00800100 D __data_start |
00800100 D UebertragungAbgeschlossen |
00800101 D PcZugriff |
00800102 d timer.2100 |
00800103 d cnt_1ms.2010 |
00800104 D UBat |
00800106 D Luftdruck |
0080010a D MessLuftdruck |
0080010c D Array |
00800116 D DisplayBuff |
00800166 d MaxMenue.2006 |
00800167 D NewPpmData |
00800178 D Kp |
0080017c D Ki |
00800180 D Parameter_Luftdruck_D |
00800181 D Parameter_MaxHoehe |
00800182 D Parameter_Hoehe_P |
00800183 D Parameter_Hoehe_ACC_Wirkung |
00800184 D Parameter_KompassWirkung |
00800185 D Parameter_Gyro_P |
00800186 D Parameter_Gyro_I |
00800187 D Parameter_Gier_P |
00800188 D Parameter_I_Faktor |
00800189 D Parameter_ServoNickControl |
0080018a D c_sin |
0080045a D c_cos |
0080072a D __clz_tab |
0080082a B __bss_start |
0080082a D __data_end |
0080082a D _edata |
0080082a B DebugGetAnforderung |
0080082b B DebugDisplayAnforderung |
0080082c B DebugDataAnforderung |
0080082d B GetVersionAnforderung |
0080082e B SioTmp |
0080082f B NeuerDatensatzEmpfangen |
00800830 B NeueKoordinateEmpfangen |
00800831 B CntCrcError |
00800832 B AnzahlEmpfangsBytes |
00800833 B PC_DebugTimeout |
00800834 B MotorTest |
00800838 b dis_zeile.2453 |
00800839 b UartState.2131 |
0080083a b buf_ptr.2130 |
0080083b b crc2.2129 |
0080083c b crc1.2128 |
0080083d b crc.2127 |
0080083f b ptr.2090 |
00800841 b gpsState |
00800842 B CountMilliseconds |
00800844 B UpdateMotor |
00800845 B cntKompass |
00800847 B beeptime |
00800849 B ServoValue |
0080084b b cnt.2011 |
0080084c b tim_main |
0080084e B AccumulateNick |
00800850 B AccumulateRoll |
00800852 B AccumulateGier |
00800854 B accumulate_AccRoll |
00800856 B accumulate_AccNick |
00800858 B accumulate_AccHoch |
0080085a B MessanzahlNick |
0080085b B MessanzahlRoll |
0080085c B MessanzahlGier |
0080085d B messanzahl_AccNick |
0080085e B messanzahl_AccRoll |
0080085f B messanzahl_AccHoch |
00800860 B HoeheD |
00800862 B ZaehlMessungen |
00800864 b state.2041 |
00800865 b kanal.2040 |
00800866 B TestInt |
00800868 B DispPtr |
00800869 B RemoteTasten |
0080086a b MenuePunkt.2007 |
0080086b B twi_state |
0080086c B motor |
0080086d B motorread |
0080086e b index.2007 |
00800870 b AltICR.2005 |
00800872 B Timeout |
00800873 B AdNeutralNick |
00800875 B AdNeutralRoll |
00800877 B AdNeutralGier |
00800879 B NeutralAccX |
0080087b B NeutralAccY |
0080087d B NeutralAccZ |
00800881 B CosinusNickWinkel |
00800882 B CosinusRollWinkel |
00800883 B IntegralNick |
00800887 B IntegralNick2 |
0080088b B IntegralRoll |
0080088f B IntegralRoll2 |
00800893 B Integral_Gier |
00800897 B Mess_IntegralNick |
0080089b B Mess_IntegralNick2 |
0080089f B Mess_IntegralRoll |
008008a3 B Mess_IntegralRoll2 |
008008a7 B Mess_Integral_Gier |
008008ab B Mess_Integral_Gier2 |
008008af B Mess_Integral_Hoch |
008008b3 B KompassValue |
008008b5 B KompassStartwert |
008008b7 B KompassRichtung |
008008b9 B Notlandung |
008008ba B HoehenReglerAktiv |
008008bb B blinkcount_LED1 |
008008bc B modell_fliegt_gps |
008008be B Limit_D_Anteil |
008008bf B Poti1 |
008008c1 B Poti2 |
008008c3 B Poti3 |
008008c5 B Poti4 |
008008c7 B Poti5 |
008008c9 B Poti6 |
008008cb B Poti7 |
008008cd B Poti8 |
008008cf B SenderOkay |
008008d0 B StickNick |
008008d2 B StickRoll |
008008d4 B StickGier |
008008d6 B MotorenEin |
008008d7 B HoehenWert |
008008d9 B SollHoehe |
008008db B Parameter_UserParam1 |
008008dc B Parameter_UserParam2 |
008008dd B Parameter_UserParam3 |
008008de B Parameter_UserParam4 |
008008df b SignalSchlecht.2457 |
008008e1 b NeueKompassRichtungMerken.2453 |
008008e2 b TimerWerteausgabe.2452 |
008008e3 b hoehenregler.2451 |
008008e5 b modell_fliegt.2450 |
008008e7 b delay_ausschalten.2449 |
008008e8 b delay_einschalten.2448 |
008008e9 b delay_neutral.2447 |
008008ea b RcLostTimer.2446 |
008008ec b IntegralFehlerRoll.2445 |
008008ee b IntegralFehlerNick.2444 |
008008f0 b tmp_long2.2443 |
008008f4 b tmp_long.2442 |
008008f8 b sollGier.2441 |
008008fc b SummeRoll.2440 |
00800900 b SummeNick.2439 |
00800904 B Soll_Position_North |
00800908 B Soll_Position_East |
0080090c B GPS_Positionsabweichung_North |
00800910 B GPS_Positionsabweichung_East |
00800914 B GPS_Geschwindigkeit_North |
00800918 B GPS_Geschwindigkeit_East |
0080091c B P_Einfluss_North |
00800920 B D_Einfluss_North |
00800924 B P_Einfluss_East |
00800928 B D_Einfluss_East |
0080092c B GPS_North |
0080092e B GPS_East |
00800930 B GPS_Nick |
00800932 B GPS_Roll |
00800934 B gethome |
00800935 B GPS_Home_North |
00800939 B GPS_Home_East |
0080093d B blinkcount_LED2 |
0080093e B NeuerMittelwert |
0080093f B FilterPos |
00800940 B NORTH_MITTEL |
00800944 B EAST_MITTEL |
00800948 B NORTH_LONG_LONG |
00800950 B EAST_LONG_LONG |
00800958 B filterfilled |
0080095a B durchschnitt_easting |
0080095e B DiffRoll |
00800960 B Motor_Vorne |
00800961 B Motor_Hinten |
00800962 B D_GPS_Verstaerkung |
00800964 B DiffNick |
00800966 B Motor_Rechts |
00800967 B Count |
00800968 B durchschnitt_northing |
0080096c B Motor_Links |
0080096d B s |
0080096e B h |
0080096f B P_GPS_Verstaerkung |
00800971 B m |
00800972 B MotorWert |
00800977 B ubxEp |
00800979 B MeineSlaveAdresse |
0080097a B CK_A |
0080097b B SendeBuffer |
00800a11 B NMEABuffer |
00800aa7 B Debug_Timer |
00800aa9 B CK_B |
00800aaa B navStatus |
00800abb B DebugIn |
00800ac6 B VersionInfo |
00800ad0 B rollOffset |
00800ad4 B ubxP |
00800ad6 B navVelECEF |
00800aeb B RxdBuffer |
00800b81 B navPosUtm |
00800b94 B ubxSp |
00800b96 B msgLen |
00800b98 B nickOffset |
00800b9c B navPosECEF |
00800bb1 B DebugOut |
00800be3 B actualPos |
00800c12 B msgID |
00800c13 B ignorePacket |
00800c14 B navVelNed |
00800c39 B PrintZiel |
00800c3a B Aktuell_ay |
00800c3c B Aktuell_az |
00800c3e B StartLuftdruck |
00800c40 B Aktuell_Nick |
00800c42 B messanzahl_Druck |
00800c43 B Aktuell_Roll |
00800c45 B Aktuell_ax |
00800c47 B DruckOffsetSetting |
00800c48 B Aktuell_Gier |
00800c4a B tmpLuftdruck |
00800c4c B motor_rx |
00800c54 B PPM_in |
00800c72 B PPM_diff |
00800c90 B EE_Parameter |
00800cca B MesswertRoll |
00800ccc B MesswertNick |
00800cce B MIN_GAS |
00800ccf B Mittelwert_AccHoch |
00800cd1 B IntegralFaktor |
00800cd5 B Mittelwert_AccNick |
00800cd7 B MAX_GAS |
00800cd8 B MesswertGier |
00800cda B GyroFaktor |
00800cde B Mittelwert_AccRoll |
00800ce0 B filter_north |
00800d00 B filter_east |
00800d20 B __bss_end |
00800d20 A _end |
00810000 D EEPromArray |
00810800 D __eeprom_end |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/GPS.c |
---|
0,0 → 1,298 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 08.2007 by THE BOSCH TEAM |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
#include "math.h" |
//Sinusfunktion von 0° bis 359°. Ergebnis wurde mit 1000 multipliziert, damit als Definition platzsparend int |
//verwendet werden kann. d.h., es muss also in der späteren Berechnung noch mit 0,001 multipliziert werden //(090907Kr) |
const int c_sin[] = {0,17,34,52,69,87,104,121,139,156,173,190, |
207,224,241,258,275,292,309,325,342,358,374,390,406,422,438,453,469,484,500,515,529,544,559,573,587,601,615,629, |
642,656,669,682,694,707,719,731,743,754,766,777,788,798,809,819,829,838,848,857,866,874,882,891,898,906,913,920, |
927,933,939,945,951,956,961,965,970,974,978,981,984,987,990,992,994,996,997,998,999,999,1000,999,999,998,997,996, |
994,992,990,987,984,981,978,974,970,965,961,956,951,945,939,933,927,920,913,906,898,891,882,874,866,857,848,838, |
829,819,809,798,788,777,766,754,743,731,719,707,694,682,669,656,642,629,615,601,587,573,559,544,529,515,500,484, |
469,453,438,422,406,390,374,358,342,325,309,292,275,258,241,224,207,190,173,156,139,121,104,87,69,52,34,17,0,-17, |
-34,-52,-69,-87,-104,-121,-139,-156,-173,-190,-207,-224,-241,-258,-275,-292,-309,-325,-342,-358,-374,-390,-406, |
-422,-438,-453,-469,-484,-500,-515,-529,-544,-559,-573,-587,-601,-615,-629,-642,-656,-669,-682,-694,-707,-719, |
-731,-743,-754,-766,-777,-788,-798,-809,-819,-829,-838,-848,-857,-866,-874,-882,-891,-898,-906,-913,-920,-927, |
-933,-939,-945,-951,-956,-961,-965,-970,-974,-978,-981,-984,-987,-990,-992,-994,-996,-997,-998,-999,-999,-1000, |
-999,-999,-998,-997,-996,-994,-992,-990,-987,-984,-981,-978,-974,-970,-965,-961,-956,-951,-945,-939,-933,-927, |
-920,-913,-906,-898,-891,-882,-874,-866,-857,-848,-838,-829,-819,-809,-798,-788,-777,-766,-754,-743,-731,-719, |
-707,-694,-682,-669,-656,-642,-629,-615,-601,-587,-573,-559,-544,-529,-515,-500,-484,-469,-453,-438,-422,-406, |
-390,-374,-358,-342,-325,-309,-292,-275,-258,-241,-224,-207,-190,-173,-156,-139,-121,-104,-87,-69,-52,-34,-17}; |
//Cosinusfunktion von 0° bis 359°. Ergebnis wurde mit 1000 multipliziert, damit als Definition platzsparend int |
//verwendet werden kann. D.h., es muss also in der späteren Berechnung noch mit 0,001 multipliziert werden //(090907Kr) |
const int c_cos[] = {1000,999,999,998,997,996,994,992,990,987,984,981, |
978,974,970,965,961,956,951,945,939,933,927,920,913,906,898,891,882,874,866,857,848,838,829,819,809,798,788,777, |
766,754,743,731,719,707,694,682,669,656,642,629,615,601,587,573,559,544,529,515,500,484,469,453,438,422,406,390, |
374,358,342,325,309,292,275,258,241,224,207,190,173,156,139,121,104,87,69,52,34,17,0,-17,-34,-52,-69,-87,-104, |
-121,-139,-156,-173,-190,-207,-224,-241,-258,-275,-292,-309,-325,-342,-358,-374,-390,-406,-422,-438,-453,-469, |
-484,-500,-515,-529,-544,-559,-573,-587,-601,-615,-629,-642,-656,-669,-682,-694,-707,-719,-731,-743,-754,-766, |
-777,-788,-798,-809,-819,-829,-838,-848,-857,-866,-874,-882,-891,-898,-906,-913,-920,-927,-933,-939,-945,-951, |
-956,-961,-965,-970,-974,-978,-981,-984,-987,-990,-992,-994,-996,-997,-998,-999,-999,-1000,-999,-999,-998,-997, |
-996,-994,-992,-990,-987,-984,-981,-978,-974,-970,-965,-961,-956,-951,-945,-939,-933,-927,-920,-913,-906,-898, |
-891,-882,-874,-866,-857,-848,-838,-829,-819,-809,-798,-788,-777,-766,-754,-743,-731,-719,-707,-694,-682,-669, |
-656,-642,-629,-615,-601,-587,-573,-559,-544,-529,-515,-500,-484,-469,-453,-438,-422,-406,-390,-374,-358,-342, |
-325,-309,-292,-275,-258,-241,-224,-207,-190,-173,-156,-139,-121,-104,-87,-69,-52,-34,-17,0,17,34,52,69,87, |
104,121,139,156,173,190,207,224,241,258,275,292,309,325,342,358,374,390,406,422,438,453,469,484,500,515,529,544, |
559,573,587,601,615,629,642,656,669,682,694,707,719,731,743,754,766,777,788,798,809,819,829,838,848,857,866,874, |
882,891,898,906,913,920,927,933,939,945,951,956,961,965,970,974,978,981,984,987,990,992,994,996,997,998,999,999}; |
long Soll_Position_North = 0; |
long Soll_Position_East = 0; |
long GPS_Positionsabweichung_North = 0; |
long GPS_Positionsabweichung_East = 0; |
long GPS_Geschwindigkeit_North = 0; |
long GPS_Geschwindigkeit_East = 0; |
long P_Einfluss_North = 0; |
long D_Einfluss_North = 0; |
long P_Einfluss_East = 0; |
long D_Einfluss_East = 0; |
signed int GPS_North = 0; |
signed int GPS_East = 0; |
signed int GPS_Nick = 0; |
signed int GPS_Roll = 0; |
volatile char gethome = 0; //Flag ob GPS_Home_Position gelernt ist //(280807Kr) |
long GPS_Home_North = 0; |
long GPS_Home_East = 0; |
unsigned char blinkcount_LED2 = 0; //Hilfszähler für die blinkende LED (010907Kr) |
//**************************** MIRCOS DEFINITIONSANFANG FÜR DIE FILTERUNG |
// Filterung der GPS Messwerte vom Ublox-Empfänger. Es wird der gleitende Durchschnitt aus n Messwerten gebildet |
#define MITTELWERTZAHL 8 // Anzahl der Messwerte fuer gleitenden Mittelwert |
volatile char NeuerMittelwert = 0; //Flag ob ein neuer Mittelwert vorliegt, der mit 4 Hz berechnet wird, da nur dann neue Messwerte vom GPS vorliegen |
volatile unsigned char FilterPos = 0; |
volatile long NORTH_MITTEL = 0; |
volatile long EAST_MITTEL = 0; |
volatile long long NORTH_LONG_LONG = 0; |
volatile long long EAST_LONG_LONG = 0; |
volatile int filterfilled = 0; |
typedef struct { |
long NORTH[MITTELWERTZAHL]; |
} FILTER_NORTH; // Filterdefinition für die Positions-Nordwerte aus dem GPS-Empfänger |
typedef struct { |
long EAST[MITTELWERTZAHL]; |
} FILTER_EAST; // Filterdefinition für die Positions-Ostwerte aus dem GPS-Empfänger |
FILTER_NORTH filter_north; |
FILTER_EAST filter_east; |
//**************************** MIRCOS DEFINITIONSENDE FÜR DIE FILTERUNG |
void gps_main(void) |
{ |
//**************************** MIRCOS FILTERUNG ANFANG |
// if(actualPos.GPSFix == 3 && actualPos.newData == 1) //bilde neuen Positionsmittelwert, wenn 3D-Fix und neue GPS-Daten vorliegen |
if(actualPos.GPSFix == 3) // hier auskommentieren, wenn dauernd (also nicht nur alle 250ms) die GPS-Berechnung durchgeführt werden soll |
{ |
filter_north.NORTH[FilterPos] = actualPos.northing; |
filter_east.EAST[FilterPos] = actualPos.easting; |
FilterPos++; |
if (FilterPos==MITTELWERTZAHL) FilterPos=0; |
if (filterfilled<MITTELWERTZAHL) filterfilled++; |
NORTH_LONG_LONG = 0; |
EAST_LONG_LONG = 0; |
for (int i=0; i<filterfilled; i++) |
{ |
NORTH_LONG_LONG += filter_north.NORTH[i]; |
EAST_LONG_LONG += filter_east.EAST[i]; |
} |
NORTH_LONG_LONG /= filterfilled; |
EAST_LONG_LONG /= filterfilled; |
NORTH_MITTEL = NORTH_LONG_LONG; |
EAST_MITTEL = EAST_LONG_LONG; |
NeuerMittelwert = 1; |
//actualPos.newData = 0; // hier auskommentieren, wenn dauernd (also nicht nur alle 250ms) die GPS-Berechnung durchgeführt werden soll |
} |
//******************************* MIRCOS FILTERUNG ENDE |
//wenn kein 3D-Fix vorhanden, über das Poti jedoch irgendeine GPS Funktion aktiv ist, werden die GPS-Steuerbefehle |
//auf Null gesetzt, um unkontrolliertes Wegfliegen durch das GPS zu verhindern. Dadurch wird abgesichert |
//(auch im laufenden Flug), dass bei einem Verlust der GPS-Verbindung GPS deaktivert wird |
if (actualPos.GPSFix < 3 && Poti3 > 70) |
{ |
GPS_Nick = 0; |
GPS_Roll = 0; |
LED2_OFF; |
beeptime = 50; |
} |
// speichert die GPS_Home_Position beim 3D-Fix, MotorEINschalten und wenn noch nicht zu weit weggeflogen wurde |
// (modell_fliegt_gps < 2000) einmalig ab. Die Flugzeitabfrage sichert ab, dass bei einem Losfliegen ohne 3D-Fix die Home_Positinen |
// irgendwann später dort gelernt werden, wo dann zu ersten mal ein 3D-Fix vorhanden ist |
if (actualPos.GPSFix == 3 && MotorenEin == 1 && gethome == 0 && modell_fliegt_gps < 2000) |
{ |
GPS_Home_North = NORTH_MITTEL; |
GPS_Home_East = EAST_MITTEL; |
// Muss hier auch eingelernt werden, damit falls das Poti3 beim Motorenstarten in |
// Mittelstellung sein sollte, trotzdem schon eine Sollposition vorliegt. Andernfalls würde |
// GPS_Nick und _Roll maximal werden bis zum ersten Mal Stick_Nick und _Roll gesteuert würde |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
beeptime = 50; |
gethome = 1; |
} |
//löscht die GPS_Home_Position beim MotorAUSschalten wieder und resetet das Flag gethome //(280807Kr) |
if (MotorenEin == 0) |
{ |
GPS_Home_North = 0; |
GPS_Home_East = 0; |
gethome = 0; |
modell_fliegt_gps = 0; |
} |
// wenn Schalter ausgeschaltet, dann wird die LED2 ausgeschaltet und das GPS Steuerkommando gelöscht |
if(Poti3 < 70) |
{ |
// Sollpositionen müssen auch hier beschrieben werden, damit ausgeschlossen ist, dass falls gelandet wird und die GPS-Funktion |
// über Poti3 deaktivert und anschließend wieder aktiviert wird keine Soll-Positionen vorliegen. |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
GPS_Nick = 0; |
GPS_Roll = 0; |
LED2_OFF; |
} |
// wenn 3D-Fix, Schalter im mittleren Bereich und vom Pilot gesteuert wird, wird ständig neue GPS-Sollposition eingelernt |
if(actualPos.GPSFix == 3 && Poti3 > 70 && Poti3 < 150 && (StickNick > 12 || StickNick < -12 || StickRoll > 12 || StickRoll < -12)) |
{ |
GPS_Nick = 0; //wird genullt, damit das letzte GPS Kommando nicht ständig gegen den Piloten ansteuert |
GPS_Roll = 0; //wird genullt, damit das letzte GPS Kommando nicht ständig gegen den Piloten ansteuert |
Soll_Position_North = NORTH_MITTEL; // Soll-Position wird geschrieben |
Soll_Position_East = EAST_MITTEL; // Soll-Position wird geschrieben |
//++++++++++++++++++++++++++++++++++++ |
//Sorgt lediglich dafür, dass die LED2 langsam blinkt. Dauer ist durch die "> x" Abfrage festgelegt |
//++++++++++++++++++++++++++++++++++++ |
if(blinkcount_LED2 >= 200) // maximal erlaubt 255 wegen unsigned char |
{ |
LED2_FLASH; |
blinkcount_LED2 = 0; |
} |
blinkcount_LED2++; |
//++++++++++++++++++++++++++++++++++++ |
} |
// wenn 3D-Fix, Schalter im mittleren Bereich (oder höher), neuer Mittelwert vorhanden, wenigstens einmal Sollposition gelernt und der Pilot nicht selbst steuert wird eine GPS-Funktion aktiviert |
if (actualPos.GPSFix == 3 && Poti3 > 70 && NeuerMittelwert == 1 && Soll_Position_North != 0 && Soll_Position_East != 0 && StickNick <= 12 && StickNick >= -12 && StickRoll <= 12 && StickRoll >= -12) |
{ |
//Berechnung der GPS-Positionsabweichung je nach aktivierter GPS-Funktion (GPS_HOLD oder HOMING) |
//DYNAMISCHES GPS-HOLD, wenn Schalter noch in Mittelstellung ist wird die zuletzt gelernte Soll_Position angeflogen |
if(Poti3 < 150) |
{ |
GPS_Positionsabweichung_North = (Soll_Position_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (Soll_Position_East - EAST_MITTEL); |
LED2_ON; |
} |
//andernfalls, wenn Schalter in max. Stellung und zusätzlich die GPS_Home_Positionen beim Motorenstarten gelernt |
//werden konnten, wird zur GPS_Home_Position geflogen |
if (Poti3 >= 150 && GPS_Home_North != 0 && GPS_Home_East != 0) |
{ |
GPS_Positionsabweichung_North = (GPS_Home_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (GPS_Home_East - EAST_MITTEL); |
// durch das ständige Neulernen der Soll_Positionen während HOMING wird erreicht, dass der MK nach dem Umschalten |
// von HOMING zurück zu GPS-HOLD nicht wieder an die alte Soll_Position zurück fliegt |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
LED2_ON; |
} |
//verhindert, dass beim Umschalten von Mittelstellung (GPS_HOLD) auf Maximalstellung (HOMING) OHNE gelernte Homeposition |
//die GPS Funktion unkontrolliert steuert. Daher wird GPS_HOLD aktiv gehalten, die Sollpositon wird bei Stickbefehlen |
//jedoch nicht wie beim dynamischen GPS_HOLD überschrieben. Zusätzlich wird der Summer eingeschaltet. |
if (Poti3 >= 150 && GPS_Home_North == 0 && GPS_Home_East == 0) |
{ |
GPS_Positionsabweichung_North = (Soll_Position_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (Soll_Position_East - EAST_MITTEL); |
LED2_ON; |
beeptime = 50; |
} |
//GPS-Geschwindigkeiten |
GPS_Geschwindigkeit_North = actualPos.velNorth; //actualPos.velNorth ist die Geschwindigkeiten aus dem GPS Empfänger entlang der Nord-Süd Richtung |
GPS_Geschwindigkeit_East = actualPos.velEast; //actualPos.velEast ist die Geschwindigkeiten aus dem GPS Empfänger entlang der Ost-West Richtung |
//Berechnung der Einzelkomponenten des PD-Reglers |
P_Einfluss_North = (P_GPS_Verstaerkung * GPS_Positionsabweichung_North)*0.0005; //entspricht einer Skalierung von 1/2000 |
D_Einfluss_North = (D_GPS_Verstaerkung * GPS_Geschwindigkeit_North)*0.00333; //entspricht einer Skalierung von 1/300 |
P_Einfluss_East = (P_GPS_Verstaerkung * GPS_Positionsabweichung_East)*0.0005; //entspricht einer Skalierung von 1/2000 |
D_Einfluss_East = (D_GPS_Verstaerkung * GPS_Geschwindigkeit_East)*0.00333; //entspricht einer Skalierung von 1/300 |
// Begrenzung des maximalen D-Anteils für pos. und neg. Werte. Grenze muss so geählt werden, |
// dass das Limit im normalen Position-Hold nicht erreicht wird und somit keinen Einfluss hat. |
// Grund: Beim Zufliegen auf weiter entfernte Ziele bremst der D-Anteil kurz vor dem Ziel den Mikrokopter sehr stark ab. |
// Dieses Limit wirkt nur, wenn sich der MK im HOMING Modus befindet und sich noch weit (>2,5m) von der Home-Position weg befindet. |
if (Poti3 >= 150 && GPS_Home_North != 0 && GPS_Home_East != 0 && (abs(GPS_Positionsabweichung_North) > 250 || abs(GPS_Positionsabweichung_East) > 250)) |
{ |
if (D_Einfluss_North > Limit_D_Anteil) D_Einfluss_North = Limit_D_Anteil; |
if (D_Einfluss_East > Limit_D_Anteil) D_Einfluss_East = Limit_D_Anteil; |
if (D_Einfluss_North < -1 * Limit_D_Anteil) D_Einfluss_North = -1 * Limit_D_Anteil; |
if (D_Einfluss_East < -1 * Limit_D_Anteil) D_Einfluss_East = -1 * Limit_D_Anteil; |
} |
// PD-Regler |
GPS_North = (-P_Einfluss_North + D_Einfluss_North); |
GPS_East = (P_Einfluss_East - D_Einfluss_East); |
//Umrechnen vom globalen North- bzw. East- in das körperfeste X- bzw. Y- Koordinatensystem |
GPS_Nick = (-c_sin[KompassValue]*0.001*GPS_East + c_cos[KompassValue]*0.001*GPS_North); // die "0" kann später durch den Messwert des Kompasssensors (KompassValue/0.01745329251) ersetzt werden |
GPS_Roll = (c_cos[KompassValue]*0.001*GPS_East + c_sin[KompassValue]*0.001*GPS_North); // die "0" kann später durch den Messwert des Kompasssensors (KompassValue/180*3.1415926535) ersetzt werden |
// Begrenzung des maximalen GPS Einflusses für positive und negative Werte |
if (GPS_Nick > 35) GPS_Nick = 35; |
if (GPS_Roll > 35) GPS_Roll = 35; |
if (GPS_Nick < -35) GPS_Nick = -35; |
if (GPS_Roll < -35) GPS_Roll = -35; |
//Funktion wird dadurch nur alle 250 ms aufgerufen, wenn neue Mittelwerte aus den GPS-Daten vorliegen. |
//FUNKTIONIERT MOMENTAN NOCH NICHT, DA STÄNDIG OHNE UNTERBRECHUNG NEUE MITTELWERTE BERECHNET WERDEN. |
//GRUND: DIE ABFRAGE NACH NEUE GPS-DATEN ERFOLGT NOCH NICHT |
NeuerMittelwert = 0; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/GPS.d |
---|
0,0 → 1,2 |
GPS.o GPS.d : GPS.c main.h old_macros.h _Settings.h printf_P.h timer0.h uart.h \ |
analog.h twimaster.h menu.h rc.h fc.h gps.h |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/GPS.lst |
---|
0,0 → 1,2284 |
1 .file "GPS.c" |
2 .arch atmega644 |
3 __SREG__ = 0x3f |
4 __SP_H__ = 0x3e |
5 __SP_L__ = 0x3d |
6 __tmp_reg__ = 0 |
7 __zero_reg__ = 1 |
8 .global __do_copy_data |
9 .global __do_clear_bss |
10 .text |
11 .global gps_main |
13 gps_main: |
14 /* prologue: frame size=31 */ |
15 0000 2F92 push r2 |
16 0002 3F92 push r3 |
17 0004 4F92 push r4 |
18 0006 5F92 push r5 |
19 0008 6F92 push r6 |
20 000a 7F92 push r7 |
21 000c 8F92 push r8 |
22 000e 9F92 push r9 |
23 0010 AF92 push r10 |
24 0012 BF92 push r11 |
25 0014 CF92 push r12 |
26 0016 DF92 push r13 |
27 0018 EF92 push r14 |
28 001a FF92 push r15 |
29 001c 0F93 push r16 |
30 001e 1F93 push r17 |
31 0020 CF93 push r28 |
32 0022 DF93 push r29 |
33 0024 CDB7 in r28,__SP_L__ |
34 0026 DEB7 in r29,__SP_H__ |
35 0028 6F97 sbiw r28,31 |
36 002a 0FB6 in __tmp_reg__,__SREG__ |
37 002c F894 cli |
38 002e DEBF out __SP_H__,r29 |
39 0030 0FBE out __SREG__,__tmp_reg__ |
40 0032 CDBF out __SP_L__,r28 |
41 /* prologue end (size=26) */ |
42 0034 2091 0000 lds r18,actualPos+45 |
43 0038 2D87 std Y+13,r18 |
44 003a 2330 cpi r18,lo8(3) |
45 003c 01F0 breq .+2 |
46 003e 00C0 rjmp .L2 |
47 0040 E091 0000 lds r30,FilterPos |
48 0044 FF27 clr r31 |
49 0046 EE0F lsl r30 |
50 0048 FF1F rol r31 |
51 004a EE0F lsl r30 |
52 004c FF1F rol r31 |
53 004e E050 subi r30,lo8(-(filter_north)) |
54 0050 F040 sbci r31,hi8(-(filter_north)) |
55 0052 8091 0000 lds r24,actualPos+24 |
56 0056 9091 0000 lds r25,(actualPos+24)+1 |
57 005a A091 0000 lds r26,(actualPos+24)+2 |
58 005e B091 0000 lds r27,(actualPos+24)+3 |
59 0062 8083 st Z,r24 |
60 0064 9183 std Z+1,r25 |
61 0066 A283 std Z+2,r26 |
62 0068 B383 std Z+3,r27 |
63 006a E091 0000 lds r30,FilterPos |
64 006e FF27 clr r31 |
65 0070 EE0F lsl r30 |
66 0072 FF1F rol r31 |
67 0074 EE0F lsl r30 |
68 0076 FF1F rol r31 |
69 0078 E050 subi r30,lo8(-(filter_east)) |
70 007a F040 sbci r31,hi8(-(filter_east)) |
71 007c 8091 0000 lds r24,actualPos+28 |
72 0080 9091 0000 lds r25,(actualPos+28)+1 |
73 0084 A091 0000 lds r26,(actualPos+28)+2 |
74 0088 B091 0000 lds r27,(actualPos+28)+3 |
75 008c 8083 st Z,r24 |
76 008e 9183 std Z+1,r25 |
77 0090 A283 std Z+2,r26 |
78 0092 B383 std Z+3,r27 |
79 0094 8091 0000 lds r24,FilterPos |
80 0098 8F5F subi r24,lo8(-(1)) |
81 009a 8093 0000 sts FilterPos,r24 |
82 009e 8091 0000 lds r24,FilterPos |
83 00a2 8830 cpi r24,lo8(8) |
84 00a4 01F4 brne .L4 |
85 00a6 1092 0000 sts FilterPos,__zero_reg__ |
86 .L4: |
87 00aa 8091 0000 lds r24,filterfilled |
88 00ae 9091 0000 lds r25,(filterfilled)+1 |
89 00b2 0897 sbiw r24,8 |
90 00b4 04F4 brge .L6 |
91 00b6 8091 0000 lds r24,filterfilled |
92 00ba 9091 0000 lds r25,(filterfilled)+1 |
93 00be 0196 adiw r24,1 |
94 00c0 9093 0000 sts (filterfilled)+1,r25 |
95 00c4 8093 0000 sts filterfilled,r24 |
96 .L6: |
97 00c8 1092 0000 sts NORTH_LONG_LONG,__zero_reg__ |
98 00cc 1092 0000 sts NORTH_LONG_LONG+1,__zero_reg__ |
99 00d0 1092 0000 sts NORTH_LONG_LONG+2,__zero_reg__ |
100 00d4 1092 0000 sts NORTH_LONG_LONG+3,__zero_reg__ |
101 00d8 1092 0000 sts NORTH_LONG_LONG+4,__zero_reg__ |
102 00dc 1092 0000 sts NORTH_LONG_LONG+5,__zero_reg__ |
103 00e0 1092 0000 sts NORTH_LONG_LONG+6,__zero_reg__ |
104 00e4 1092 0000 sts NORTH_LONG_LONG+7,__zero_reg__ |
105 00e8 1092 0000 sts EAST_LONG_LONG,__zero_reg__ |
106 00ec 1092 0000 sts EAST_LONG_LONG+1,__zero_reg__ |
107 00f0 1092 0000 sts EAST_LONG_LONG+2,__zero_reg__ |
108 00f4 1092 0000 sts EAST_LONG_LONG+3,__zero_reg__ |
109 00f8 1092 0000 sts EAST_LONG_LONG+4,__zero_reg__ |
110 00fc 1092 0000 sts EAST_LONG_LONG+5,__zero_reg__ |
111 0100 1092 0000 sts EAST_LONG_LONG+6,__zero_reg__ |
112 0104 1092 0000 sts EAST_LONG_LONG+7,__zero_reg__ |
113 0108 1C82 std Y+4,__zero_reg__ |
114 010a 1B82 std Y+3,__zero_reg__ |
115 010c 80E0 ldi r24,lo8(filter_north) |
116 010e 90E0 ldi r25,hi8(filter_north) |
117 0110 9A83 std Y+2,r25 |
118 0112 8983 std Y+1,r24 |
119 0114 A0E0 ldi r26,lo8(filter_east) |
120 0116 B0E0 ldi r27,hi8(filter_east) |
121 0118 BF8F std Y+31,r27 |
122 011a AE8F std Y+30,r26 |
123 011c 00C0 rjmp .L8 |
124 .L9: |
125 011e 2090 0000 lds r2,NORTH_LONG_LONG |
126 0122 3090 0000 lds r3,NORTH_LONG_LONG+1 |
127 0126 4090 0000 lds r4,NORTH_LONG_LONG+2 |
128 012a 5090 0000 lds r5,NORTH_LONG_LONG+3 |
129 012e 6090 0000 lds r6,NORTH_LONG_LONG+4 |
130 0132 7090 0000 lds r7,NORTH_LONG_LONG+5 |
131 0136 8090 0000 lds r8,NORTH_LONG_LONG+6 |
132 013a 9090 0000 lds r9,NORTH_LONG_LONG+7 |
133 013e E981 ldd r30,Y+1 |
134 0140 FA81 ldd r31,Y+2 |
135 0142 2081 ld r18,Z |
136 0144 3181 ldd r19,Z+1 |
137 0146 4281 ldd r20,Z+2 |
138 0148 5381 ldd r21,Z+3 |
139 014a DA01 movw r26,r20 |
140 014c C901 movw r24,r18 |
141 014e BB0F lsl r27 |
142 0150 880B sbc r24,r24 |
143 0152 982F mov r25,r24 |
144 0154 DC01 movw r26,r24 |
145 0156 2E87 std Y+14,r18 |
146 0158 3F87 std Y+15,r19 |
147 015a 488B std Y+16,r20 |
148 015c 598B std Y+17,r21 |
149 015e 8A8B std Y+18,r24 |
150 0160 8B8B std Y+19,r24 |
151 0162 8C8B std Y+20,r24 |
152 0164 8D8B std Y+21,r24 |
153 0166 AE84 ldd r10,Y+14 |
154 0168 A20C add r10,r2 |
155 016a 81E0 ldi r24,lo8(1) |
156 016c A214 cp r10,r2 |
157 016e 00F0 brlo .L10 |
158 0170 80E0 ldi r24,lo8(0) |
159 .L10: |
160 0172 BF84 ldd r11,Y+15 |
161 0174 B30C add r11,r3 |
162 0176 21E0 ldi r18,lo8(1) |
163 0178 B314 cp r11,r3 |
164 017a 00F0 brlo .L11 |
165 017c 20E0 ldi r18,lo8(0) |
166 .L11: |
167 017e 8B0D add r24,r11 |
168 0180 91E0 ldi r25,lo8(1) |
169 0182 8B15 cp r24,r11 |
170 0184 00F0 brlo .L12 |
171 0186 90E0 ldi r25,lo8(0) |
172 .L12: |
173 0188 292B or r18,r25 |
174 018a B82E mov r11,r24 |
175 018c C888 ldd r12,Y+16 |
176 018e C40C add r12,r4 |
177 0190 31E0 ldi r19,lo8(1) |
178 0192 C414 cp r12,r4 |
179 0194 00F0 brlo .L13 |
180 0196 30E0 ldi r19,lo8(0) |
181 .L13: |
182 0198 822F mov r24,r18 |
183 019a 8C0D add r24,r12 |
184 019c 91E0 ldi r25,lo8(1) |
185 019e 8C15 cp r24,r12 |
186 01a0 00F0 brlo .L14 |
187 01a2 90E0 ldi r25,lo8(0) |
188 .L14: |
189 01a4 392B or r19,r25 |
190 01a6 C82E mov r12,r24 |
191 01a8 D988 ldd r13,Y+17 |
192 01aa D50C add r13,r5 |
193 01ac 21E0 ldi r18,lo8(1) |
194 01ae D514 cp r13,r5 |
195 01b0 00F0 brlo .L15 |
196 01b2 20E0 ldi r18,lo8(0) |
197 .L15: |
198 01b4 832F mov r24,r19 |
199 01b6 8D0D add r24,r13 |
200 01b8 91E0 ldi r25,lo8(1) |
201 01ba 8D15 cp r24,r13 |
202 01bc 00F0 brlo .L16 |
203 01be 90E0 ldi r25,lo8(0) |
204 .L16: |
205 01c0 292B or r18,r25 |
206 01c2 D82E mov r13,r24 |
207 01c4 EA88 ldd r14,Y+18 |
208 01c6 E60C add r14,r6 |
209 01c8 31E0 ldi r19,lo8(1) |
210 01ca E614 cp r14,r6 |
211 01cc 00F0 brlo .L17 |
212 01ce 30E0 ldi r19,lo8(0) |
213 .L17: |
214 01d0 822F mov r24,r18 |
215 01d2 8E0D add r24,r14 |
216 01d4 91E0 ldi r25,lo8(1) |
217 01d6 8E15 cp r24,r14 |
218 01d8 00F0 brlo .L18 |
219 01da 90E0 ldi r25,lo8(0) |
220 .L18: |
221 01dc 392B or r19,r25 |
222 01de E82E mov r14,r24 |
223 01e0 FB88 ldd r15,Y+19 |
224 01e2 F70C add r15,r7 |
225 01e4 21E0 ldi r18,lo8(1) |
226 01e6 F714 cp r15,r7 |
227 01e8 00F0 brlo .L19 |
228 01ea 20E0 ldi r18,lo8(0) |
229 .L19: |
230 01ec 832F mov r24,r19 |
231 01ee 8F0D add r24,r15 |
232 01f0 91E0 ldi r25,lo8(1) |
233 01f2 8F15 cp r24,r15 |
234 01f4 00F0 brlo .L20 |
235 01f6 90E0 ldi r25,lo8(0) |
236 .L20: |
237 01f8 292B or r18,r25 |
238 01fa F82E mov r15,r24 |
239 01fc 0C89 ldd r16,Y+20 |
240 01fe 080D add r16,r8 |
241 0200 91E0 ldi r25,lo8(1) |
242 0202 0815 cp r16,r8 |
243 0204 00F0 brlo .L21 |
244 0206 90E0 ldi r25,lo8(0) |
245 .L21: |
246 0208 822F mov r24,r18 |
247 020a 800F add r24,r16 |
248 020c E1E0 ldi r30,lo8(1) |
249 020e 8017 cp r24,r16 |
250 0210 00F0 brlo .L22 |
251 0212 E0E0 ldi r30,lo8(0) |
252 .L22: |
253 0214 AE2F mov r26,r30 |
254 0216 A92B or r26,r25 |
255 0218 1D89 ldd r17,Y+21 |
256 021a 190D add r17,r9 |
257 021c A10F add r26,r17 |
258 021e A092 0000 sts NORTH_LONG_LONG,r10 |
259 0222 B092 0000 sts NORTH_LONG_LONG+1,r11 |
260 0226 C092 0000 sts NORTH_LONG_LONG+2,r12 |
261 022a D092 0000 sts NORTH_LONG_LONG+3,r13 |
262 022e E092 0000 sts NORTH_LONG_LONG+4,r14 |
263 0232 F092 0000 sts NORTH_LONG_LONG+5,r15 |
264 0236 8093 0000 sts NORTH_LONG_LONG+6,r24 |
265 023a A093 0000 sts NORTH_LONG_LONG+7,r26 |
266 023e 2090 0000 lds r2,EAST_LONG_LONG |
267 0242 3090 0000 lds r3,EAST_LONG_LONG+1 |
268 0246 4090 0000 lds r4,EAST_LONG_LONG+2 |
269 024a 5090 0000 lds r5,EAST_LONG_LONG+3 |
270 024e 6090 0000 lds r6,EAST_LONG_LONG+4 |
271 0252 7090 0000 lds r7,EAST_LONG_LONG+5 |
272 0256 8090 0000 lds r8,EAST_LONG_LONG+6 |
273 025a 9090 0000 lds r9,EAST_LONG_LONG+7 |
274 025e AE8D ldd r26,Y+30 |
275 0260 BF8D ldd r27,Y+31 |
276 0262 2D91 ld r18,X+ |
277 0264 3D91 ld r19,X+ |
278 0266 4D91 ld r20,X+ |
279 0268 5C91 ld r21,X |
280 026a DA01 movw r26,r20 |
281 026c C901 movw r24,r18 |
282 026e BB0F lsl r27 |
283 0270 880B sbc r24,r24 |
284 0272 982F mov r25,r24 |
285 0274 DC01 movw r26,r24 |
286 0276 2E8B std Y+22,r18 |
287 0278 3F8B std Y+23,r19 |
288 027a 488F std Y+24,r20 |
289 027c 598F std Y+25,r21 |
290 027e 8A8F std Y+26,r24 |
291 0280 8B8F std Y+27,r24 |
292 0282 8C8F std Y+28,r24 |
293 0284 8D8F std Y+29,r24 |
294 0286 AE88 ldd r10,Y+22 |
295 0288 A20C add r10,r2 |
296 028a 81E0 ldi r24,lo8(1) |
297 028c A214 cp r10,r2 |
298 028e 00F0 brlo .L23 |
299 0290 80E0 ldi r24,lo8(0) |
300 .L23: |
301 0292 BF88 ldd r11,Y+23 |
302 0294 B30C add r11,r3 |
303 0296 21E0 ldi r18,lo8(1) |
304 0298 B314 cp r11,r3 |
305 029a 00F0 brlo .L24 |
306 029c 20E0 ldi r18,lo8(0) |
307 .L24: |
308 029e 8B0D add r24,r11 |
309 02a0 91E0 ldi r25,lo8(1) |
310 02a2 8B15 cp r24,r11 |
311 02a4 00F0 brlo .L25 |
312 02a6 90E0 ldi r25,lo8(0) |
313 .L25: |
314 02a8 292B or r18,r25 |
315 02aa B82E mov r11,r24 |
316 02ac C88C ldd r12,Y+24 |
317 02ae C40C add r12,r4 |
318 02b0 31E0 ldi r19,lo8(1) |
319 02b2 C414 cp r12,r4 |
320 02b4 00F0 brlo .L26 |
321 02b6 30E0 ldi r19,lo8(0) |
322 .L26: |
323 02b8 822F mov r24,r18 |
324 02ba 8C0D add r24,r12 |
325 02bc 91E0 ldi r25,lo8(1) |
326 02be 8C15 cp r24,r12 |
327 02c0 00F0 brlo .L27 |
328 02c2 90E0 ldi r25,lo8(0) |
329 .L27: |
330 02c4 392B or r19,r25 |
331 02c6 C82E mov r12,r24 |
332 02c8 D98C ldd r13,Y+25 |
333 02ca D50C add r13,r5 |
334 02cc 21E0 ldi r18,lo8(1) |
335 02ce D514 cp r13,r5 |
336 02d0 00F0 brlo .L28 |
337 02d2 20E0 ldi r18,lo8(0) |
338 .L28: |
339 02d4 832F mov r24,r19 |
340 02d6 8D0D add r24,r13 |
341 02d8 91E0 ldi r25,lo8(1) |
342 02da 8D15 cp r24,r13 |
343 02dc 00F0 brlo .L29 |
344 02de 90E0 ldi r25,lo8(0) |
345 .L29: |
346 02e0 292B or r18,r25 |
347 02e2 D82E mov r13,r24 |
348 02e4 EA8C ldd r14,Y+26 |
349 02e6 E60C add r14,r6 |
350 02e8 31E0 ldi r19,lo8(1) |
351 02ea E614 cp r14,r6 |
352 02ec 00F0 brlo .L30 |
353 02ee 30E0 ldi r19,lo8(0) |
354 .L30: |
355 02f0 822F mov r24,r18 |
356 02f2 8E0D add r24,r14 |
357 02f4 91E0 ldi r25,lo8(1) |
358 02f6 8E15 cp r24,r14 |
359 02f8 00F0 brlo .L31 |
360 02fa 90E0 ldi r25,lo8(0) |
361 .L31: |
362 02fc 392B or r19,r25 |
363 02fe E82E mov r14,r24 |
364 0300 FB8C ldd r15,Y+27 |
365 0302 F70C add r15,r7 |
366 0304 21E0 ldi r18,lo8(1) |
367 0306 F714 cp r15,r7 |
368 0308 00F0 brlo .L32 |
369 030a 20E0 ldi r18,lo8(0) |
370 .L32: |
371 030c 832F mov r24,r19 |
372 030e 8F0D add r24,r15 |
373 0310 91E0 ldi r25,lo8(1) |
374 0312 8F15 cp r24,r15 |
375 0314 00F0 brlo .L33 |
376 0316 90E0 ldi r25,lo8(0) |
377 .L33: |
378 0318 292B or r18,r25 |
379 031a F82E mov r15,r24 |
380 031c 0C8D ldd r16,Y+28 |
381 031e 080D add r16,r8 |
382 0320 91E0 ldi r25,lo8(1) |
383 0322 0815 cp r16,r8 |
384 0324 00F0 brlo .L34 |
385 0326 90E0 ldi r25,lo8(0) |
386 .L34: |
387 0328 822F mov r24,r18 |
388 032a 800F add r24,r16 |
389 032c E1E0 ldi r30,lo8(1) |
390 032e 8017 cp r24,r16 |
391 0330 00F0 brlo .L35 |
392 0332 E0E0 ldi r30,lo8(0) |
393 .L35: |
394 0334 AE2F mov r26,r30 |
395 0336 A92B or r26,r25 |
396 0338 1D8D ldd r17,Y+29 |
397 033a 190D add r17,r9 |
398 033c A10F add r26,r17 |
399 033e A092 0000 sts EAST_LONG_LONG,r10 |
400 0342 B092 0000 sts EAST_LONG_LONG+1,r11 |
401 0346 C092 0000 sts EAST_LONG_LONG+2,r12 |
402 034a D092 0000 sts EAST_LONG_LONG+3,r13 |
403 034e E092 0000 sts EAST_LONG_LONG+4,r14 |
404 0352 F092 0000 sts EAST_LONG_LONG+5,r15 |
405 0356 8093 0000 sts EAST_LONG_LONG+6,r24 |
406 035a A093 0000 sts EAST_LONG_LONG+7,r26 |
407 035e EB81 ldd r30,Y+3 |
408 0360 FC81 ldd r31,Y+4 |
409 0362 3196 adiw r30,1 |
410 0364 FC83 std Y+4,r31 |
411 0366 EB83 std Y+3,r30 |
412 0368 2981 ldd r18,Y+1 |
413 036a 3A81 ldd r19,Y+2 |
414 036c 2C5F subi r18,lo8(-(4)) |
415 036e 3F4F sbci r19,hi8(-(4)) |
416 0370 3A83 std Y+2,r19 |
417 0372 2983 std Y+1,r18 |
418 0374 8E8D ldd r24,Y+30 |
419 0376 9F8D ldd r25,Y+31 |
420 0378 0496 adiw r24,4 |
421 037a 9F8F std Y+31,r25 |
422 037c 8E8F std Y+30,r24 |
423 .L8: |
424 037e 8091 0000 lds r24,filterfilled |
425 0382 9091 0000 lds r25,(filterfilled)+1 |
426 0386 AB81 ldd r26,Y+3 |
427 0388 BC81 ldd r27,Y+4 |
428 038a A817 cp r26,r24 |
429 038c B907 cpc r27,r25 |
430 038e 04F4 brge .+2 |
431 0390 00C0 rjmp .L9 |
432 0392 2090 0000 lds r2,NORTH_LONG_LONG |
433 0396 3090 0000 lds r3,NORTH_LONG_LONG+1 |
434 039a 4090 0000 lds r4,NORTH_LONG_LONG+2 |
435 039e 5090 0000 lds r5,NORTH_LONG_LONG+3 |
436 03a2 6090 0000 lds r6,NORTH_LONG_LONG+4 |
437 03a6 7090 0000 lds r7,NORTH_LONG_LONG+5 |
438 03aa 8090 0000 lds r8,NORTH_LONG_LONG+6 |
439 03ae 9090 0000 lds r9,NORTH_LONG_LONG+7 |
440 03b2 A091 0000 lds r26,filterfilled |
441 03b6 B091 0000 lds r27,(filterfilled)+1 |
442 03ba FD01 movw r30,r26 |
443 03bc FF0F lsl r31 |
444 03be EE0B sbc r30,r30 |
445 03c0 FE2F mov r31,r30 |
446 03c2 9D01 movw r18,r26 |
447 03c4 AA2E mov r10,r26 |
448 03c6 B32E mov r11,r19 |
449 03c8 CE2E mov r12,r30 |
450 03ca DE2E mov r13,r30 |
451 03cc EE2E mov r14,r30 |
452 03ce FE2E mov r15,r30 |
453 03d0 0E2F mov r16,r30 |
454 03d2 1E2F mov r17,r30 |
455 03d4 222D mov r18,r2 |
456 03d6 332D mov r19,r3 |
457 03d8 442D mov r20,r4 |
458 03da 552D mov r21,r5 |
459 03dc 662D mov r22,r6 |
460 03de 772D mov r23,r7 |
461 03e0 882D mov r24,r8 |
462 03e2 992D mov r25,r9 |
463 03e4 0E94 0000 call __divdi3 |
464 03e8 2093 0000 sts NORTH_LONG_LONG,r18 |
465 03ec 3093 0000 sts NORTH_LONG_LONG+1,r19 |
466 03f0 4093 0000 sts NORTH_LONG_LONG+2,r20 |
467 03f4 5093 0000 sts NORTH_LONG_LONG+3,r21 |
468 03f8 6093 0000 sts NORTH_LONG_LONG+4,r22 |
469 03fc 7093 0000 sts NORTH_LONG_LONG+5,r23 |
470 0400 8093 0000 sts NORTH_LONG_LONG+6,r24 |
471 0404 9093 0000 sts NORTH_LONG_LONG+7,r25 |
472 0408 2090 0000 lds r2,EAST_LONG_LONG |
473 040c 3090 0000 lds r3,EAST_LONG_LONG+1 |
474 0410 4090 0000 lds r4,EAST_LONG_LONG+2 |
475 0414 5090 0000 lds r5,EAST_LONG_LONG+3 |
476 0418 6090 0000 lds r6,EAST_LONG_LONG+4 |
477 041c 7090 0000 lds r7,EAST_LONG_LONG+5 |
478 0420 8090 0000 lds r8,EAST_LONG_LONG+6 |
479 0424 9090 0000 lds r9,EAST_LONG_LONG+7 |
480 0428 A091 0000 lds r26,filterfilled |
481 042c B091 0000 lds r27,(filterfilled)+1 |
482 0430 FD01 movw r30,r26 |
483 0432 FF0F lsl r31 |
484 0434 EE0B sbc r30,r30 |
485 0436 FE2F mov r31,r30 |
486 0438 9D01 movw r18,r26 |
487 043a AA2E mov r10,r26 |
488 043c B32E mov r11,r19 |
489 043e CE2E mov r12,r30 |
490 0440 DE2E mov r13,r30 |
491 0442 EE2E mov r14,r30 |
492 0444 FE2E mov r15,r30 |
493 0446 0E2F mov r16,r30 |
494 0448 1E2F mov r17,r30 |
495 044a 222D mov r18,r2 |
496 044c 332D mov r19,r3 |
497 044e 442D mov r20,r4 |
498 0450 552D mov r21,r5 |
499 0452 662D mov r22,r6 |
500 0454 772D mov r23,r7 |
501 0456 882D mov r24,r8 |
502 0458 992D mov r25,r9 |
503 045a 0E94 0000 call __divdi3 |
504 045e 2093 0000 sts EAST_LONG_LONG,r18 |
505 0462 3093 0000 sts EAST_LONG_LONG+1,r19 |
506 0466 4093 0000 sts EAST_LONG_LONG+2,r20 |
507 046a 5093 0000 sts EAST_LONG_LONG+3,r21 |
508 046e 6093 0000 sts EAST_LONG_LONG+4,r22 |
509 0472 7093 0000 sts EAST_LONG_LONG+5,r23 |
510 0476 8093 0000 sts EAST_LONG_LONG+6,r24 |
511 047a 9093 0000 sts EAST_LONG_LONG+7,r25 |
512 047e 2091 0000 lds r18,NORTH_LONG_LONG |
513 0482 3091 0000 lds r19,NORTH_LONG_LONG+1 |
514 0486 4091 0000 lds r20,NORTH_LONG_LONG+2 |
515 048a 5091 0000 lds r21,NORTH_LONG_LONG+3 |
516 048e 6091 0000 lds r22,NORTH_LONG_LONG+4 |
517 0492 7091 0000 lds r23,NORTH_LONG_LONG+5 |
518 0496 8091 0000 lds r24,NORTH_LONG_LONG+6 |
519 049a 9091 0000 lds r25,NORTH_LONG_LONG+7 |
520 049e 2093 0000 sts NORTH_MITTEL,r18 |
521 04a2 3093 0000 sts (NORTH_MITTEL)+1,r19 |
522 04a6 4093 0000 sts (NORTH_MITTEL)+2,r20 |
523 04aa 5093 0000 sts (NORTH_MITTEL)+3,r21 |
524 04ae 2091 0000 lds r18,EAST_LONG_LONG |
525 04b2 3091 0000 lds r19,EAST_LONG_LONG+1 |
526 04b6 4091 0000 lds r20,EAST_LONG_LONG+2 |
527 04ba 5091 0000 lds r21,EAST_LONG_LONG+3 |
528 04be 6091 0000 lds r22,EAST_LONG_LONG+4 |
529 04c2 7091 0000 lds r23,EAST_LONG_LONG+5 |
530 04c6 8091 0000 lds r24,EAST_LONG_LONG+6 |
531 04ca 9091 0000 lds r25,EAST_LONG_LONG+7 |
532 04ce 2093 0000 sts EAST_MITTEL,r18 |
533 04d2 3093 0000 sts (EAST_MITTEL)+1,r19 |
534 04d6 4093 0000 sts (EAST_MITTEL)+2,r20 |
535 04da 5093 0000 sts (EAST_MITTEL)+3,r21 |
536 04de 81E0 ldi r24,lo8(1) |
537 04e0 8093 0000 sts NeuerMittelwert,r24 |
538 04e4 2091 0000 lds r18,MotorenEin |
539 04e8 2130 cpi r18,lo8(1) |
540 04ea 01F0 breq .+2 |
541 04ec 00C0 rjmp .L38 |
542 04ee 00C0 rjmp .L37 |
543 .L2: |
544 04f0 BD85 ldd r27,Y+13 |
545 04f2 B330 cpi r27,lo8(3) |
546 04f4 00F0 brlo .+2 |
547 04f6 00C0 rjmp .L38 |
548 04f8 8091 0000 lds r24,Poti3 |
549 04fc 9091 0000 lds r25,(Poti3)+1 |
550 0500 8734 cpi r24,71 |
551 0502 9105 cpc r25,__zero_reg__ |
552 0504 04F4 brge .+2 |
553 0506 00C0 rjmp .L38 |
554 0508 1092 0000 sts (GPS_Nick)+1,__zero_reg__ |
555 050c 1092 0000 sts GPS_Nick,__zero_reg__ |
556 0510 1092 0000 sts (GPS_Roll)+1,__zero_reg__ |
557 0514 1092 0000 sts GPS_Roll,__zero_reg__ |
558 0518 4398 cbi 40-0x20,3 |
559 051a 82E3 ldi r24,lo8(50) |
560 051c 90E0 ldi r25,hi8(50) |
561 051e 9093 0000 sts (beeptime)+1,r25 |
562 0522 8093 0000 sts beeptime,r24 |
563 0526 00C0 rjmp .L38 |
564 .L37: |
565 0528 8091 0000 lds r24,gethome |
566 052c 8823 tst r24 |
567 052e 01F0 breq .+2 |
568 0530 00C0 rjmp .L41 |
569 0532 8091 0000 lds r24,modell_fliegt_gps |
570 0536 9091 0000 lds r25,(modell_fliegt_gps)+1 |
571 053a 805D subi r24,lo8(2000) |
572 053c 9740 sbci r25,hi8(2000) |
573 053e 00F0 brlo .+2 |
574 0540 00C0 rjmp .L41 |
575 0542 8091 0000 lds r24,NORTH_MITTEL |
576 0546 9091 0000 lds r25,(NORTH_MITTEL)+1 |
577 054a A091 0000 lds r26,(NORTH_MITTEL)+2 |
578 054e B091 0000 lds r27,(NORTH_MITTEL)+3 |
579 0552 8093 0000 sts GPS_Home_North,r24 |
580 0556 9093 0000 sts (GPS_Home_North)+1,r25 |
581 055a A093 0000 sts (GPS_Home_North)+2,r26 |
582 055e B093 0000 sts (GPS_Home_North)+3,r27 |
583 0562 8091 0000 lds r24,EAST_MITTEL |
584 0566 9091 0000 lds r25,(EAST_MITTEL)+1 |
585 056a A091 0000 lds r26,(EAST_MITTEL)+2 |
586 056e B091 0000 lds r27,(EAST_MITTEL)+3 |
587 0572 8093 0000 sts GPS_Home_East,r24 |
588 0576 9093 0000 sts (GPS_Home_East)+1,r25 |
589 057a A093 0000 sts (GPS_Home_East)+2,r26 |
590 057e B093 0000 sts (GPS_Home_East)+3,r27 |
591 0582 8091 0000 lds r24,NORTH_MITTEL |
592 0586 9091 0000 lds r25,(NORTH_MITTEL)+1 |
593 058a A091 0000 lds r26,(NORTH_MITTEL)+2 |
594 058e B091 0000 lds r27,(NORTH_MITTEL)+3 |
595 0592 8093 0000 sts Soll_Position_North,r24 |
596 0596 9093 0000 sts (Soll_Position_North)+1,r25 |
597 059a A093 0000 sts (Soll_Position_North)+2,r26 |
598 059e B093 0000 sts (Soll_Position_North)+3,r27 |
599 05a2 8091 0000 lds r24,EAST_MITTEL |
600 05a6 9091 0000 lds r25,(EAST_MITTEL)+1 |
601 05aa A091 0000 lds r26,(EAST_MITTEL)+2 |
602 05ae B091 0000 lds r27,(EAST_MITTEL)+3 |
603 05b2 8093 0000 sts Soll_Position_East,r24 |
604 05b6 9093 0000 sts (Soll_Position_East)+1,r25 |
605 05ba A093 0000 sts (Soll_Position_East)+2,r26 |
606 05be B093 0000 sts (Soll_Position_East)+3,r27 |
607 05c2 82E3 ldi r24,lo8(50) |
608 05c4 90E0 ldi r25,hi8(50) |
609 05c6 9093 0000 sts (beeptime)+1,r25 |
610 05ca 8093 0000 sts beeptime,r24 |
611 05ce 2093 0000 sts gethome,r18 |
612 05d2 00C0 rjmp .L41 |
613 .L38: |
614 05d4 8091 0000 lds r24,MotorenEin |
615 05d8 8823 tst r24 |
616 05da 01F4 brne .L41 |
617 05dc 1092 0000 sts GPS_Home_North,__zero_reg__ |
618 05e0 1092 0000 sts (GPS_Home_North)+1,__zero_reg__ |
619 05e4 1092 0000 sts (GPS_Home_North)+2,__zero_reg__ |
620 05e8 1092 0000 sts (GPS_Home_North)+3,__zero_reg__ |
621 05ec 1092 0000 sts GPS_Home_East,__zero_reg__ |
622 05f0 1092 0000 sts (GPS_Home_East)+1,__zero_reg__ |
623 05f4 1092 0000 sts (GPS_Home_East)+2,__zero_reg__ |
624 05f8 1092 0000 sts (GPS_Home_East)+3,__zero_reg__ |
625 05fc 1092 0000 sts gethome,__zero_reg__ |
626 0600 1092 0000 sts (modell_fliegt_gps)+1,__zero_reg__ |
627 0604 1092 0000 sts modell_fliegt_gps,__zero_reg__ |
628 .L41: |
629 0608 2091 0000 lds r18,Poti3 |
630 060c 3091 0000 lds r19,(Poti3)+1 |
631 0610 3F8F std Y+31,r19 |
632 0612 2E8F std Y+30,r18 |
633 0614 2634 cpi r18,70 |
634 0616 3105 cpc r19,__zero_reg__ |
635 0618 04F4 brge .L45 |
636 061a 8091 0000 lds r24,NORTH_MITTEL |
637 061e 9091 0000 lds r25,(NORTH_MITTEL)+1 |
638 0622 A091 0000 lds r26,(NORTH_MITTEL)+2 |
639 0626 B091 0000 lds r27,(NORTH_MITTEL)+3 |
640 062a 8093 0000 sts Soll_Position_North,r24 |
641 062e 9093 0000 sts (Soll_Position_North)+1,r25 |
642 0632 A093 0000 sts (Soll_Position_North)+2,r26 |
643 0636 B093 0000 sts (Soll_Position_North)+3,r27 |
644 063a 8091 0000 lds r24,EAST_MITTEL |
645 063e 9091 0000 lds r25,(EAST_MITTEL)+1 |
646 0642 A091 0000 lds r26,(EAST_MITTEL)+2 |
647 0646 B091 0000 lds r27,(EAST_MITTEL)+3 |
648 064a 8093 0000 sts Soll_Position_East,r24 |
649 064e 9093 0000 sts (Soll_Position_East)+1,r25 |
650 0652 A093 0000 sts (Soll_Position_East)+2,r26 |
651 0656 B093 0000 sts (Soll_Position_East)+3,r27 |
652 065a 1092 0000 sts (GPS_Nick)+1,__zero_reg__ |
653 065e 1092 0000 sts GPS_Nick,__zero_reg__ |
654 0662 1092 0000 sts (GPS_Roll)+1,__zero_reg__ |
655 0666 1092 0000 sts GPS_Roll,__zero_reg__ |
656 066a 4398 cbi 40-0x20,3 |
657 .L45: |
658 066c 3D85 ldd r19,Y+13 |
659 066e 3330 cpi r19,lo8(3) |
660 0670 01F0 breq .+2 |
661 0672 00C0 rjmp .L94 |
662 0674 8E8D ldd r24,Y+30 |
663 0676 9F8D ldd r25,Y+31 |
664 0678 8734 cpi r24,71 |
665 067a 9105 cpc r25,__zero_reg__ |
666 067c 04F4 brge .+2 |
667 067e 00C0 rjmp .L94 |
668 0680 8639 cpi r24,150 |
669 0682 9105 cpc r25,__zero_reg__ |
670 0684 04F0 brlt .+2 |
671 0686 00C0 rjmp .L50 |
672 0688 8091 0000 lds r24,StickNick |
673 068c 9091 0000 lds r25,(StickNick)+1 |
674 0690 0C96 adiw r24,12 |
675 0692 4997 sbiw r24,25 |
676 0694 00F4 brsh .L52 |
677 0696 8091 0000 lds r24,StickRoll |
678 069a 9091 0000 lds r25,(StickRoll)+1 |
679 069e 8D30 cpi r24,13 |
680 06a0 9105 cpc r25,__zero_reg__ |
681 06a2 04F4 brge .L52 |
682 06a4 845F subi r24,lo8(-12) |
683 06a6 9F4F sbci r25,hi8(-12) |
684 06a8 04F4 brge .L50 |
685 .L52: |
686 06aa 1092 0000 sts (GPS_Nick)+1,__zero_reg__ |
687 06ae 1092 0000 sts GPS_Nick,__zero_reg__ |
688 06b2 1092 0000 sts (GPS_Roll)+1,__zero_reg__ |
689 06b6 1092 0000 sts GPS_Roll,__zero_reg__ |
690 06ba 8091 0000 lds r24,NORTH_MITTEL |
691 06be 9091 0000 lds r25,(NORTH_MITTEL)+1 |
692 06c2 A091 0000 lds r26,(NORTH_MITTEL)+2 |
693 06c6 B091 0000 lds r27,(NORTH_MITTEL)+3 |
694 06ca 8093 0000 sts Soll_Position_North,r24 |
695 06ce 9093 0000 sts (Soll_Position_North)+1,r25 |
696 06d2 A093 0000 sts (Soll_Position_North)+2,r26 |
697 06d6 B093 0000 sts (Soll_Position_North)+3,r27 |
698 06da 8091 0000 lds r24,EAST_MITTEL |
699 06de 9091 0000 lds r25,(EAST_MITTEL)+1 |
700 06e2 A091 0000 lds r26,(EAST_MITTEL)+2 |
701 06e6 B091 0000 lds r27,(EAST_MITTEL)+3 |
702 06ea 8093 0000 sts Soll_Position_East,r24 |
703 06ee 9093 0000 sts (Soll_Position_East)+1,r25 |
704 06f2 A093 0000 sts (Soll_Position_East)+2,r26 |
705 06f6 B093 0000 sts (Soll_Position_East)+3,r27 |
706 06fa 8091 0000 lds r24,blinkcount_LED2 |
707 06fe 883C cpi r24,lo8(-56) |
708 0700 00F0 brlo .L55 |
709 0702 88B1 in r24,40-0x20 |
710 0704 98E0 ldi r25,lo8(8) |
711 0706 8927 eor r24,r25 |
712 0708 88B9 out 40-0x20,r24 |
713 070a 1092 0000 sts blinkcount_LED2,__zero_reg__ |
714 .L55: |
715 070e 8091 0000 lds r24,blinkcount_LED2 |
716 0712 8F5F subi r24,lo8(-(1)) |
717 0714 8093 0000 sts blinkcount_LED2,r24 |
718 .L50: |
719 0718 8091 0000 lds r24,NeuerMittelwert |
720 071c 8130 cpi r24,lo8(1) |
721 071e 01F0 breq .+2 |
722 0720 00C0 rjmp .L94 |
723 0722 E090 0000 lds r14,Soll_Position_North |
724 0726 F090 0000 lds r15,(Soll_Position_North)+1 |
725 072a 0091 0000 lds r16,(Soll_Position_North)+2 |
726 072e 1091 0000 lds r17,(Soll_Position_North)+3 |
727 0732 E114 cp r14,__zero_reg__ |
728 0734 F104 cpc r15,__zero_reg__ |
729 0736 0105 cpc r16,__zero_reg__ |
730 0738 1105 cpc r17,__zero_reg__ |
731 073a 01F4 brne .+2 |
732 073c 00C0 rjmp .L94 |
733 073e A090 0000 lds r10,Soll_Position_East |
734 0742 B090 0000 lds r11,(Soll_Position_East)+1 |
735 0746 C090 0000 lds r12,(Soll_Position_East)+2 |
736 074a D090 0000 lds r13,(Soll_Position_East)+3 |
737 074e A114 cp r10,__zero_reg__ |
738 0750 B104 cpc r11,__zero_reg__ |
739 0752 C104 cpc r12,__zero_reg__ |
740 0754 D104 cpc r13,__zero_reg__ |
741 0756 01F4 brne .+2 |
742 0758 00C0 rjmp .L94 |
743 075a 8091 0000 lds r24,StickNick |
744 075e 9091 0000 lds r25,(StickNick)+1 |
745 0762 8D30 cpi r24,13 |
746 0764 9105 cpc r25,__zero_reg__ |
747 0766 04F0 brlt .+2 |
748 0768 00C0 rjmp .L94 |
749 076a 845F subi r24,lo8(-12) |
750 076c 9F4F sbci r25,hi8(-12) |
751 076e 04F4 brge .+2 |
752 0770 00C0 rjmp .L94 |
753 0772 8091 0000 lds r24,StickRoll |
754 0776 9091 0000 lds r25,(StickRoll)+1 |
755 077a 8D30 cpi r24,13 |
756 077c 9105 cpc r25,__zero_reg__ |
757 077e 04F0 brlt .+2 |
758 0780 00C0 rjmp .L94 |
759 0782 845F subi r24,lo8(-12) |
760 0784 9F4F sbci r25,hi8(-12) |
761 0786 04F4 brge .+2 |
762 0788 00C0 rjmp .L94 |
763 078a 2E8D ldd r18,Y+30 |
764 078c 3F8D ldd r19,Y+31 |
765 078e 2639 cpi r18,150 |
766 0790 3105 cpc r19,__zero_reg__ |
767 0792 04F0 brlt .+2 |
768 0794 00C0 rjmp .L64 |
769 0796 8091 0000 lds r24,NORTH_MITTEL |
770 079a 9091 0000 lds r25,(NORTH_MITTEL)+1 |
771 079e A091 0000 lds r26,(NORTH_MITTEL)+2 |
772 07a2 B091 0000 lds r27,(NORTH_MITTEL)+3 |
773 07a6 E81A sub r14,r24 |
774 07a8 F90A sbc r15,r25 |
775 07aa 0A0B sbc r16,r26 |
776 07ac 1B0B sbc r17,r27 |
777 07ae E092 0000 sts GPS_Positionsabweichung_North,r14 |
778 07b2 F092 0000 sts (GPS_Positionsabweichung_North)+1,r15 |
779 07b6 0093 0000 sts (GPS_Positionsabweichung_North)+2,r16 |
780 07ba 1093 0000 sts (GPS_Positionsabweichung_North)+3,r17 |
781 07be 8091 0000 lds r24,EAST_MITTEL |
782 07c2 9091 0000 lds r25,(EAST_MITTEL)+1 |
783 07c6 A091 0000 lds r26,(EAST_MITTEL)+2 |
784 07ca B091 0000 lds r27,(EAST_MITTEL)+3 |
785 07ce A81A sub r10,r24 |
786 07d0 B90A sbc r11,r25 |
787 07d2 CA0A sbc r12,r26 |
788 07d4 DB0A sbc r13,r27 |
789 07d6 A092 0000 sts GPS_Positionsabweichung_East,r10 |
790 07da B092 0000 sts (GPS_Positionsabweichung_East)+1,r11 |
791 07de C092 0000 sts (GPS_Positionsabweichung_East)+2,r12 |
792 07e2 D092 0000 sts (GPS_Positionsabweichung_East)+3,r13 |
793 07e6 00C0 rjmp .L96 |
794 .L67: |
795 07e8 E090 0000 lds r14,GPS_Home_East |
796 07ec F090 0000 lds r15,(GPS_Home_East)+1 |
797 07f0 0091 0000 lds r16,(GPS_Home_East)+2 |
798 07f4 1091 0000 lds r17,(GPS_Home_East)+3 |
799 07f8 E114 cp r14,__zero_reg__ |
800 07fa F104 cpc r15,__zero_reg__ |
801 07fc 0105 cpc r16,__zero_reg__ |
802 07fe 1105 cpc r17,__zero_reg__ |
803 0800 01F4 brne .+2 |
804 0802 00C0 rjmp .L66 |
805 0804 8091 0000 lds r24,NORTH_MITTEL |
806 0808 9091 0000 lds r25,(NORTH_MITTEL)+1 |
807 080c A091 0000 lds r26,(NORTH_MITTEL)+2 |
808 0810 B091 0000 lds r27,(NORTH_MITTEL)+3 |
809 0814 281B sub r18,r24 |
810 0816 390B sbc r19,r25 |
811 0818 4A0B sbc r20,r26 |
812 081a 5B0B sbc r21,r27 |
813 081c 2093 0000 sts GPS_Positionsabweichung_North,r18 |
814 0820 3093 0000 sts (GPS_Positionsabweichung_North)+1,r19 |
815 0824 4093 0000 sts (GPS_Positionsabweichung_North)+2,r20 |
816 0828 5093 0000 sts (GPS_Positionsabweichung_North)+3,r21 |
817 082c 8091 0000 lds r24,EAST_MITTEL |
818 0830 9091 0000 lds r25,(EAST_MITTEL)+1 |
819 0834 A091 0000 lds r26,(EAST_MITTEL)+2 |
820 0838 B091 0000 lds r27,(EAST_MITTEL)+3 |
821 083c E81A sub r14,r24 |
822 083e F90A sbc r15,r25 |
823 0840 0A0B sbc r16,r26 |
824 0842 1B0B sbc r17,r27 |
825 0844 E092 0000 sts GPS_Positionsabweichung_East,r14 |
826 0848 F092 0000 sts (GPS_Positionsabweichung_East)+1,r15 |
827 084c 0093 0000 sts (GPS_Positionsabweichung_East)+2,r16 |
828 0850 1093 0000 sts (GPS_Positionsabweichung_East)+3,r17 |
829 0854 8091 0000 lds r24,NORTH_MITTEL |
830 0858 9091 0000 lds r25,(NORTH_MITTEL)+1 |
831 085c A091 0000 lds r26,(NORTH_MITTEL)+2 |
832 0860 B091 0000 lds r27,(NORTH_MITTEL)+3 |
833 0864 8093 0000 sts Soll_Position_North,r24 |
834 0868 9093 0000 sts (Soll_Position_North)+1,r25 |
835 086c A093 0000 sts (Soll_Position_North)+2,r26 |
836 0870 B093 0000 sts (Soll_Position_North)+3,r27 |
837 0874 8091 0000 lds r24,EAST_MITTEL |
838 0878 9091 0000 lds r25,(EAST_MITTEL)+1 |
839 087c A091 0000 lds r26,(EAST_MITTEL)+2 |
840 0880 B091 0000 lds r27,(EAST_MITTEL)+3 |
841 0884 8093 0000 sts Soll_Position_East,r24 |
842 0888 9093 0000 sts (Soll_Position_East)+1,r25 |
843 088c A093 0000 sts (Soll_Position_East)+2,r26 |
844 0890 B093 0000 sts (Soll_Position_East)+3,r27 |
845 .L96: |
846 0894 439A sbi 40-0x20,3 |
847 0896 00C0 rjmp .L66 |
848 .L95: |
849 0898 8091 0000 lds r24,GPS_Home_East |
850 089c 9091 0000 lds r25,(GPS_Home_East)+1 |
851 08a0 A091 0000 lds r26,(GPS_Home_East)+2 |
852 08a4 B091 0000 lds r27,(GPS_Home_East)+3 |
853 08a8 0097 sbiw r24,0 |
854 08aa A105 cpc r26,__zero_reg__ |
855 08ac B105 cpc r27,__zero_reg__ |
856 08ae 01F4 brne .L66 |
857 08b0 8091 0000 lds r24,NORTH_MITTEL |
858 08b4 9091 0000 lds r25,(NORTH_MITTEL)+1 |
859 08b8 A091 0000 lds r26,(NORTH_MITTEL)+2 |
860 08bc B091 0000 lds r27,(NORTH_MITTEL)+3 |
861 08c0 E81A sub r14,r24 |
862 08c2 F90A sbc r15,r25 |
863 08c4 0A0B sbc r16,r26 |
864 08c6 1B0B sbc r17,r27 |
865 08c8 E092 0000 sts GPS_Positionsabweichung_North,r14 |
866 08cc F092 0000 sts (GPS_Positionsabweichung_North)+1,r15 |
867 08d0 0093 0000 sts (GPS_Positionsabweichung_North)+2,r16 |
868 08d4 1093 0000 sts (GPS_Positionsabweichung_North)+3,r17 |
869 08d8 8091 0000 lds r24,EAST_MITTEL |
870 08dc 9091 0000 lds r25,(EAST_MITTEL)+1 |
871 08e0 A091 0000 lds r26,(EAST_MITTEL)+2 |
872 08e4 B091 0000 lds r27,(EAST_MITTEL)+3 |
873 08e8 A81A sub r10,r24 |
874 08ea B90A sbc r11,r25 |
875 08ec CA0A sbc r12,r26 |
876 08ee DB0A sbc r13,r27 |
877 08f0 A092 0000 sts GPS_Positionsabweichung_East,r10 |
878 08f4 B092 0000 sts (GPS_Positionsabweichung_East)+1,r11 |
879 08f8 C092 0000 sts (GPS_Positionsabweichung_East)+2,r12 |
880 08fc D092 0000 sts (GPS_Positionsabweichung_East)+3,r13 |
881 0900 439A sbi 40-0x20,3 |
882 0902 82E3 ldi r24,lo8(50) |
883 0904 90E0 ldi r25,hi8(50) |
884 0906 9093 0000 sts (beeptime)+1,r25 |
885 090a 8093 0000 sts beeptime,r24 |
886 .L66: |
887 090e E090 0000 lds r14,actualPos+36 |
888 0912 F090 0000 lds r15,(actualPos+36)+1 |
889 0916 0091 0000 lds r16,(actualPos+36)+2 |
890 091a 1091 0000 lds r17,(actualPos+36)+3 |
891 091e E092 0000 sts GPS_Geschwindigkeit_North,r14 |
892 0922 F092 0000 sts (GPS_Geschwindigkeit_North)+1,r15 |
893 0926 0093 0000 sts (GPS_Geschwindigkeit_North)+2,r16 |
894 092a 1093 0000 sts (GPS_Geschwindigkeit_North)+3,r17 |
895 092e A090 0000 lds r10,actualPos+40 |
896 0932 B090 0000 lds r11,(actualPos+40)+1 |
897 0936 C090 0000 lds r12,(actualPos+40)+2 |
898 093a D090 0000 lds r13,(actualPos+40)+3 |
899 093e A092 0000 sts GPS_Geschwindigkeit_East,r10 |
900 0942 B092 0000 sts (GPS_Geschwindigkeit_East)+1,r11 |
901 0946 C092 0000 sts (GPS_Geschwindigkeit_East)+2,r12 |
902 094a D092 0000 sts (GPS_Geschwindigkeit_East)+3,r13 |
903 094e 6091 0000 lds r22,P_GPS_Verstaerkung |
904 0952 7091 0000 lds r23,(P_GPS_Verstaerkung)+1 |
905 0956 6090 0000 lds r6,GPS_Positionsabweichung_North |
906 095a 7090 0000 lds r7,(GPS_Positionsabweichung_North)+1 |
907 095e 8090 0000 lds r8,(GPS_Positionsabweichung_North)+2 |
908 0962 9090 0000 lds r9,(GPS_Positionsabweichung_North)+3 |
909 0966 8827 clr r24 |
910 0968 77FD sbrc r23,7 |
911 096a 8095 com r24 |
912 096c 982F mov r25,r24 |
913 096e A401 movw r20,r8 |
914 0970 9301 movw r18,r6 |
915 0972 0E94 0000 call __mulsi3 |
916 0976 0E94 0000 call __floatsisf |
917 097a 2FE6 ldi r18,lo8(0x3a03126f) |
918 097c 32E1 ldi r19,hi8(0x3a03126f) |
919 097e 43E0 ldi r20,hlo8(0x3a03126f) |
920 0980 5AE3 ldi r21,hhi8(0x3a03126f) |
921 0982 0E94 0000 call __mulsf3 |
922 0986 0E94 0000 call __fixsfsi |
923 098a 6987 std Y+9,r22 |
924 098c 7A87 std Y+10,r23 |
925 098e 8B87 std Y+11,r24 |
926 0990 9C87 std Y+12,r25 |
927 0992 6093 0000 sts P_Einfluss_North,r22 |
928 0996 7093 0000 sts (P_Einfluss_North)+1,r23 |
929 099a 8093 0000 sts (P_Einfluss_North)+2,r24 |
930 099e 9093 0000 sts (P_Einfluss_North)+3,r25 |
931 09a2 6091 0000 lds r22,D_GPS_Verstaerkung |
932 09a6 7091 0000 lds r23,(D_GPS_Verstaerkung)+1 |
933 09aa 8827 clr r24 |
934 09ac 77FD sbrc r23,7 |
935 09ae 8095 com r24 |
936 09b0 982F mov r25,r24 |
937 09b2 A801 movw r20,r16 |
938 09b4 9701 movw r18,r14 |
939 09b6 0E94 0000 call __mulsi3 |
940 09ba 0E94 0000 call __floatsisf |
941 09be 21E2 ldi r18,lo8(0x3b5a3c21) |
942 09c0 3CE3 ldi r19,hi8(0x3b5a3c21) |
943 09c2 4AE5 ldi r20,hlo8(0x3b5a3c21) |
944 09c4 5BE3 ldi r21,hhi8(0x3b5a3c21) |
945 09c6 0E94 0000 call __mulsf3 |
946 09ca 0E94 0000 call __fixsfsi |
947 09ce 1B01 movw r2,r22 |
948 09d0 2C01 movw r4,r24 |
949 09d2 6093 0000 sts D_Einfluss_North,r22 |
950 09d6 7093 0000 sts (D_Einfluss_North)+1,r23 |
951 09da 8093 0000 sts (D_Einfluss_North)+2,r24 |
952 09de 9093 0000 sts (D_Einfluss_North)+3,r25 |
953 09e2 6091 0000 lds r22,P_GPS_Verstaerkung |
954 09e6 7091 0000 lds r23,(P_GPS_Verstaerkung)+1 |
955 09ea E090 0000 lds r14,GPS_Positionsabweichung_East |
956 09ee F090 0000 lds r15,(GPS_Positionsabweichung_East)+1 |
957 09f2 0091 0000 lds r16,(GPS_Positionsabweichung_East)+2 |
958 09f6 1091 0000 lds r17,(GPS_Positionsabweichung_East)+3 |
959 09fa 8827 clr r24 |
960 09fc 77FD sbrc r23,7 |
961 09fe 8095 com r24 |
962 0a00 982F mov r25,r24 |
963 0a02 A801 movw r20,r16 |
964 0a04 9701 movw r18,r14 |
965 0a06 0E94 0000 call __mulsi3 |
966 0a0a 0E94 0000 call __floatsisf |
967 0a0e 2FE6 ldi r18,lo8(0x3a03126f) |
968 0a10 32E1 ldi r19,hi8(0x3a03126f) |
969 0a12 43E0 ldi r20,hlo8(0x3a03126f) |
970 0a14 5AE3 ldi r21,hhi8(0x3a03126f) |
971 0a16 0E94 0000 call __mulsf3 |
972 0a1a 0E94 0000 call __fixsfsi |
973 0a1e 6D83 std Y+5,r22 |
974 0a20 7E83 std Y+6,r23 |
975 0a22 8F83 std Y+7,r24 |
976 0a24 9887 std Y+8,r25 |
977 0a26 6093 0000 sts P_Einfluss_East,r22 |
978 0a2a 7093 0000 sts (P_Einfluss_East)+1,r23 |
979 0a2e 8093 0000 sts (P_Einfluss_East)+2,r24 |
980 0a32 9093 0000 sts (P_Einfluss_East)+3,r25 |
981 0a36 6091 0000 lds r22,D_GPS_Verstaerkung |
982 0a3a 7091 0000 lds r23,(D_GPS_Verstaerkung)+1 |
983 0a3e 8827 clr r24 |
984 0a40 77FD sbrc r23,7 |
985 0a42 8095 com r24 |
986 0a44 982F mov r25,r24 |
987 0a46 A601 movw r20,r12 |
988 0a48 9501 movw r18,r10 |
989 0a4a 0E94 0000 call __mulsi3 |
990 0a4e 0E94 0000 call __floatsisf |
991 0a52 21E2 ldi r18,lo8(0x3b5a3c21) |
992 0a54 3CE3 ldi r19,hi8(0x3b5a3c21) |
993 0a56 4AE5 ldi r20,hlo8(0x3b5a3c21) |
994 0a58 5BE3 ldi r21,hhi8(0x3b5a3c21) |
995 0a5a 0E94 0000 call __mulsf3 |
996 0a5e 0E94 0000 call __fixsfsi |
997 0a62 5B01 movw r10,r22 |
998 0a64 6C01 movw r12,r24 |
999 0a66 6093 0000 sts D_Einfluss_East,r22 |
1000 0a6a 7093 0000 sts (D_Einfluss_East)+1,r23 |
1001 0a6e 8093 0000 sts (D_Einfluss_East)+2,r24 |
1002 0a72 9093 0000 sts (D_Einfluss_East)+3,r25 |
1003 0a76 8E8D ldd r24,Y+30 |
1004 0a78 9F8D ldd r25,Y+31 |
1005 0a7a 8639 cpi r24,150 |
1006 0a7c 9105 cpc r25,__zero_reg__ |
1007 0a7e 04F4 brge .+2 |
1008 0a80 00C0 rjmp .L71 |
1009 0a82 8091 0000 lds r24,GPS_Home_North |
1010 0a86 9091 0000 lds r25,(GPS_Home_North)+1 |
1011 0a8a A091 0000 lds r26,(GPS_Home_North)+2 |
1012 0a8e B091 0000 lds r27,(GPS_Home_North)+3 |
1013 0a92 0097 sbiw r24,0 |
1014 0a94 A105 cpc r26,__zero_reg__ |
1015 0a96 B105 cpc r27,__zero_reg__ |
1016 0a98 01F4 brne .+2 |
1017 0a9a 00C0 rjmp .L71 |
1018 0a9c 8091 0000 lds r24,GPS_Home_East |
1019 0aa0 9091 0000 lds r25,(GPS_Home_East)+1 |
1020 0aa4 A091 0000 lds r26,(GPS_Home_East)+2 |
1021 0aa8 B091 0000 lds r27,(GPS_Home_East)+3 |
1022 0aac 0097 sbiw r24,0 |
1023 0aae A105 cpc r26,__zero_reg__ |
1024 0ab0 B105 cpc r27,__zero_reg__ |
1025 0ab2 01F4 brne .+2 |
1026 0ab4 00C0 rjmp .L71 |
1027 0ab6 C301 movw r24,r6 |
1028 0ab8 77FE sbrs r7,7 |
1029 0aba 00C0 rjmp .L76 |
1030 0abc 9095 com r25 |
1031 0abe 8195 neg r24 |
1032 0ac0 9F4F sbci r25,lo8(-1) |
1033 .L76: |
1034 0ac2 8B3F cpi r24,251 |
1035 0ac4 9105 cpc r25,__zero_reg__ |
1036 0ac6 04F4 brge .L75 |
1037 0ac8 C701 movw r24,r14 |
1038 0aca F7FE sbrs r15,7 |
1039 0acc 00C0 rjmp .L78 |
1040 0ace 9095 com r25 |
1041 0ad0 8195 neg r24 |
1042 0ad2 9F4F sbci r25,lo8(-1) |
1043 .L78: |
1044 0ad4 8B3F cpi r24,251 |
1045 0ad6 9105 cpc r25,__zero_reg__ |
1046 0ad8 04F4 brge .+2 |
1047 0ada 00C0 rjmp .L71 |
1048 .L75: |
1049 0adc 8091 0000 lds r24,Limit_D_Anteil |
1050 0ae0 282F mov r18,r24 |
1051 0ae2 3327 clr r19 |
1052 0ae4 4427 clr r20 |
1053 0ae6 5527 clr r21 |
1054 0ae8 2215 cp r18,r2 |
1055 0aea 3305 cpc r19,r3 |
1056 0aec 4405 cpc r20,r4 |
1057 0aee 5505 cpc r21,r5 |
1058 0af0 04F4 brge .L79 |
1059 0af2 2093 0000 sts D_Einfluss_North,r18 |
1060 0af6 3093 0000 sts (D_Einfluss_North)+1,r19 |
1061 0afa 4093 0000 sts (D_Einfluss_North)+2,r20 |
1062 0afe 5093 0000 sts (D_Einfluss_North)+3,r21 |
1063 .L79: |
1064 0b02 2A15 cp r18,r10 |
1065 0b04 3B05 cpc r19,r11 |
1066 0b06 4C05 cpc r20,r12 |
1067 0b08 5D05 cpc r21,r13 |
1068 0b0a 04F4 brge .L81 |
1069 0b0c 2093 0000 sts D_Einfluss_East,r18 |
1070 0b10 3093 0000 sts (D_Einfluss_East)+1,r19 |
1071 0b14 4093 0000 sts (D_Einfluss_East)+2,r20 |
1072 0b18 5093 0000 sts (D_Einfluss_East)+3,r21 |
1073 .L81: |
1074 0b1c 9927 clr r25 |
1075 0b1e 9095 com r25 |
1076 0b20 8195 neg r24 |
1077 0b22 9F4F sbci r25,lo8(-1) |
1078 0b24 9C01 movw r18,r24 |
1079 0b26 4427 clr r20 |
1080 0b28 37FD sbrc r19,7 |
1081 0b2a 4095 com r20 |
1082 0b2c 542F mov r21,r20 |
1083 0b2e 8091 0000 lds r24,D_Einfluss_North |
1084 0b32 9091 0000 lds r25,(D_Einfluss_North)+1 |
1085 0b36 A091 0000 lds r26,(D_Einfluss_North)+2 |
1086 0b3a B091 0000 lds r27,(D_Einfluss_North)+3 |
1087 0b3e 8217 cp r24,r18 |
1088 0b40 9307 cpc r25,r19 |
1089 0b42 A407 cpc r26,r20 |
1090 0b44 B507 cpc r27,r21 |
1091 0b46 04F4 brge .L83 |
1092 0b48 2093 0000 sts D_Einfluss_North,r18 |
1093 0b4c 3093 0000 sts (D_Einfluss_North)+1,r19 |
1094 0b50 4093 0000 sts (D_Einfluss_North)+2,r20 |
1095 0b54 5093 0000 sts (D_Einfluss_North)+3,r21 |
1096 .L83: |
1097 0b58 8091 0000 lds r24,D_Einfluss_East |
1098 0b5c 9091 0000 lds r25,(D_Einfluss_East)+1 |
1099 0b60 A091 0000 lds r26,(D_Einfluss_East)+2 |
1100 0b64 B091 0000 lds r27,(D_Einfluss_East)+3 |
1101 0b68 8217 cp r24,r18 |
1102 0b6a 9307 cpc r25,r19 |
1103 0b6c A407 cpc r26,r20 |
1104 0b6e B507 cpc r27,r21 |
1105 0b70 04F4 brge .L71 |
1106 0b72 2093 0000 sts D_Einfluss_East,r18 |
1107 0b76 3093 0000 sts (D_Einfluss_East)+1,r19 |
1108 0b7a 4093 0000 sts (D_Einfluss_East)+2,r20 |
1109 0b7e 5093 0000 sts (D_Einfluss_East)+3,r21 |
1110 .L71: |
1111 0b82 E090 0000 lds r14,D_Einfluss_North |
1112 0b86 F090 0000 lds r15,(D_Einfluss_North)+1 |
1113 0b8a A985 ldd r26,Y+9 |
1114 0b8c BA85 ldd r27,Y+10 |
1115 0b8e EA1A sub r14,r26 |
1116 0b90 FB0A sbc r15,r27 |
1117 0b92 F092 0000 sts (GPS_North)+1,r15 |
1118 0b96 E092 0000 sts GPS_North,r14 |
1119 0b9a 8091 0000 lds r24,D_Einfluss_East |
1120 0b9e 9091 0000 lds r25,(D_Einfluss_East)+1 |
1121 0ba2 6D81 ldd r22,Y+5 |
1122 0ba4 7E81 ldd r23,Y+6 |
1123 0ba6 681B sub r22,r24 |
1124 0ba8 790B sbc r23,r25 |
1125 0baa 7093 0000 sts (GPS_East)+1,r23 |
1126 0bae 6093 0000 sts GPS_East,r22 |
1127 0bb2 C090 0000 lds r12,KompassValue |
1128 0bb6 D090 0000 lds r13,(KompassValue)+1 |
1129 0bba 8827 clr r24 |
1130 0bbc 77FD sbrc r23,7 |
1131 0bbe 8095 com r24 |
1132 0bc0 982F mov r25,r24 |
1133 0bc2 0E94 0000 call __floatsisf |
1134 0bc6 3B01 movw r6,r22 |
1135 0bc8 4C01 movw r8,r24 |
1136 0bca A090 0000 lds r10,KompassValue |
1137 0bce B090 0000 lds r11,(KompassValue)+1 |
1138 0bd2 0027 clr r16 |
1139 0bd4 F7FC sbrc r15,7 |
1140 0bd6 0095 com r16 |
1141 0bd8 102F mov r17,r16 |
1142 0bda C801 movw r24,r16 |
1143 0bdc B701 movw r22,r14 |
1144 0bde 0E94 0000 call __floatsisf |
1145 0be2 1B01 movw r2,r22 |
1146 0be4 2C01 movw r4,r24 |
1147 0be6 CC0C lsl r12 |
1148 0be8 DD1C rol r13 |
1149 0bea E0E0 ldi r30,lo8(c_sin) |
1150 0bec F0E0 ldi r31,hi8(c_sin) |
1151 0bee CE0E add r12,r30 |
1152 0bf0 DF1E adc r13,r31 |
1153 0bf2 D601 movw r26,r12 |
1154 0bf4 6D91 ld r22,X+ |
1155 0bf6 7C91 ld r23,X |
1156 0bf8 7095 com r23 |
1157 0bfa 6195 neg r22 |
1158 0bfc 7F4F sbci r23,lo8(-1) |
1159 0bfe 8827 clr r24 |
1160 0c00 77FD sbrc r23,7 |
1161 0c02 8095 com r24 |
1162 0c04 982F mov r25,r24 |
1163 0c06 0E94 0000 call __floatsisf |
1164 0c0a 2FE6 ldi r18,lo8(0x3a83126f) |
1165 0c0c 32E1 ldi r19,hi8(0x3a83126f) |
1166 0c0e 43E8 ldi r20,hlo8(0x3a83126f) |
1167 0c10 5AE3 ldi r21,hhi8(0x3a83126f) |
1168 0c12 0E94 0000 call __mulsf3 |
1169 0c16 A401 movw r20,r8 |
1170 0c18 9301 movw r18,r6 |
1171 0c1a 0E94 0000 call __mulsf3 |
1172 0c1e 7B01 movw r14,r22 |
1173 0c20 8C01 movw r16,r24 |
1174 0c22 AA0C lsl r10 |
1175 0c24 BB1C rol r11 |
1176 0c26 E0E0 ldi r30,lo8(c_cos) |
1177 0c28 F0E0 ldi r31,hi8(c_cos) |
1178 0c2a AE0E add r10,r30 |
1179 0c2c BF1E adc r11,r31 |
1180 0c2e D501 movw r26,r10 |
1181 0c30 6D91 ld r22,X+ |
1182 0c32 7C91 ld r23,X |
1183 0c34 8827 clr r24 |
1184 0c36 77FD sbrc r23,7 |
1185 0c38 8095 com r24 |
1186 0c3a 982F mov r25,r24 |
1187 0c3c 0E94 0000 call __floatsisf |
1188 0c40 2FE6 ldi r18,lo8(0x3a83126f) |
1189 0c42 32E1 ldi r19,hi8(0x3a83126f) |
1190 0c44 43E8 ldi r20,hlo8(0x3a83126f) |
1191 0c46 5AE3 ldi r21,hhi8(0x3a83126f) |
1192 0c48 0E94 0000 call __mulsf3 |
1193 0c4c A201 movw r20,r4 |
1194 0c4e 9101 movw r18,r2 |
1195 0c50 0E94 0000 call __mulsf3 |
1196 0c54 9B01 movw r18,r22 |
1197 0c56 AC01 movw r20,r24 |
1198 0c58 C801 movw r24,r16 |
1199 0c5a B701 movw r22,r14 |
1200 0c5c 0E94 0000 call __addsf3 |
1201 0c60 0E94 0000 call __fixsfsi |
1202 0c64 5B01 movw r10,r22 |
1203 0c66 7093 0000 sts (GPS_Nick)+1,r23 |
1204 0c6a 6093 0000 sts GPS_Nick,r22 |
1205 0c6e E091 0000 lds r30,KompassValue |
1206 0c72 F091 0000 lds r31,(KompassValue)+1 |
1207 0c76 0091 0000 lds r16,KompassValue |
1208 0c7a 1091 0000 lds r17,(KompassValue)+1 |
1209 0c7e EE0F lsl r30 |
1210 0c80 FF1F rol r31 |
1211 0c82 E050 subi r30,lo8(-(c_cos)) |
1212 0c84 F040 sbci r31,hi8(-(c_cos)) |
1213 0c86 6081 ld r22,Z |
1214 0c88 7181 ldd r23,Z+1 |
1215 0c8a 8827 clr r24 |
1216 0c8c 77FD sbrc r23,7 |
1217 0c8e 8095 com r24 |
1218 0c90 982F mov r25,r24 |
1219 0c92 0E94 0000 call __floatsisf |
1220 0c96 2FE6 ldi r18,lo8(0x3a83126f) |
1221 0c98 32E1 ldi r19,hi8(0x3a83126f) |
1222 0c9a 43E8 ldi r20,hlo8(0x3a83126f) |
1223 0c9c 5AE3 ldi r21,hhi8(0x3a83126f) |
1224 0c9e 0E94 0000 call __mulsf3 |
1225 0ca2 A401 movw r20,r8 |
1226 0ca4 9301 movw r18,r6 |
1227 0ca6 0E94 0000 call __mulsf3 |
1228 0caa 6B01 movw r12,r22 |
1229 0cac 7C01 movw r14,r24 |
1230 0cae 000F lsl r16 |
1231 0cb0 111F rol r17 |
1232 0cb2 0050 subi r16,lo8(-(c_sin)) |
1233 0cb4 1040 sbci r17,hi8(-(c_sin)) |
1234 0cb6 F801 movw r30,r16 |
1235 0cb8 6081 ld r22,Z |
1236 0cba 7181 ldd r23,Z+1 |
1237 0cbc 8827 clr r24 |
1238 0cbe 77FD sbrc r23,7 |
1239 0cc0 8095 com r24 |
1240 0cc2 982F mov r25,r24 |
1241 0cc4 0E94 0000 call __floatsisf |
1242 0cc8 2FE6 ldi r18,lo8(0x3a83126f) |
1243 0cca 32E1 ldi r19,hi8(0x3a83126f) |
1244 0ccc 43E8 ldi r20,hlo8(0x3a83126f) |
1245 0cce 5AE3 ldi r21,hhi8(0x3a83126f) |
1246 0cd0 0E94 0000 call __mulsf3 |
1247 0cd4 A201 movw r20,r4 |
1248 0cd6 9101 movw r18,r2 |
1249 0cd8 0E94 0000 call __mulsf3 |
1250 0cdc 9B01 movw r18,r22 |
1251 0cde AC01 movw r20,r24 |
1252 0ce0 C701 movw r24,r14 |
1253 0ce2 B601 movw r22,r12 |
1254 0ce4 0E94 0000 call __addsf3 |
1255 0ce8 0E94 0000 call __fixsfsi |
1256 0cec 9B01 movw r18,r22 |
1257 0cee 7093 0000 sts (GPS_Roll)+1,r23 |
1258 0cf2 6093 0000 sts GPS_Roll,r22 |
1259 0cf6 F4E2 ldi r31,lo8(36) |
1260 0cf8 AF16 cp r10,r31 |
1261 0cfa B104 cpc r11,__zero_reg__ |
1262 0cfc 04F0 brlt .L86 |
1263 0cfe 83E2 ldi r24,lo8(35) |
1264 0d00 90E0 ldi r25,hi8(35) |
1265 0d02 9093 0000 sts (GPS_Nick)+1,r25 |
1266 0d06 8093 0000 sts GPS_Nick,r24 |
1267 .L86: |
1268 0d0a 2432 cpi r18,36 |
1269 0d0c 3105 cpc r19,__zero_reg__ |
1270 0d0e 04F0 brlt .L88 |
1271 0d10 83E2 ldi r24,lo8(35) |
1272 0d12 90E0 ldi r25,hi8(35) |
1273 0d14 9093 0000 sts (GPS_Roll)+1,r25 |
1274 0d18 8093 0000 sts GPS_Roll,r24 |
1275 .L88: |
1276 0d1c 8091 0000 lds r24,GPS_Nick |
1277 0d20 9091 0000 lds r25,(GPS_Nick)+1 |
1278 0d24 8D5D subi r24,lo8(-35) |
1279 0d26 9F4F sbci r25,hi8(-35) |
1280 0d28 04F4 brge .L90 |
1281 0d2a 8DED ldi r24,lo8(-35) |
1282 0d2c 9FEF ldi r25,hi8(-35) |
1283 0d2e 9093 0000 sts (GPS_Nick)+1,r25 |
1284 0d32 8093 0000 sts GPS_Nick,r24 |
1285 .L90: |
1286 0d36 8091 0000 lds r24,GPS_Roll |
1287 0d3a 9091 0000 lds r25,(GPS_Roll)+1 |
1288 0d3e 8D5D subi r24,lo8(-35) |
1289 0d40 9F4F sbci r25,hi8(-35) |
1290 0d42 04F4 brge .L92 |
1291 0d44 8DED ldi r24,lo8(-35) |
1292 0d46 9FEF ldi r25,hi8(-35) |
1293 0d48 9093 0000 sts (GPS_Roll)+1,r25 |
1294 0d4c 8093 0000 sts GPS_Roll,r24 |
1295 .L92: |
1296 0d50 1092 0000 sts NeuerMittelwert,__zero_reg__ |
1297 0d54 00C0 rjmp .L94 |
1298 .L64: |
1299 0d56 2091 0000 lds r18,GPS_Home_North |
1300 0d5a 3091 0000 lds r19,(GPS_Home_North)+1 |
1301 0d5e 4091 0000 lds r20,(GPS_Home_North)+2 |
1302 0d62 5091 0000 lds r21,(GPS_Home_North)+3 |
1303 0d66 2115 cp r18,__zero_reg__ |
1304 0d68 3105 cpc r19,__zero_reg__ |
1305 0d6a 4105 cpc r20,__zero_reg__ |
1306 0d6c 5105 cpc r21,__zero_reg__ |
1307 0d6e 01F0 breq .+2 |
1308 0d70 00C0 rjmp .L67 |
1309 0d72 00C0 rjmp .L95 |
1310 .L94: |
1311 /* epilogue: frame size=31 */ |
1312 0d74 6F96 adiw r28,31 |
1313 0d76 0FB6 in __tmp_reg__,__SREG__ |
1314 0d78 F894 cli |
1315 0d7a DEBF out __SP_H__,r29 |
1316 0d7c 0FBE out __SREG__,__tmp_reg__ |
1317 0d7e CDBF out __SP_L__,r28 |
1318 0d80 DF91 pop r29 |
1319 0d82 CF91 pop r28 |
1320 0d84 1F91 pop r17 |
1321 0d86 0F91 pop r16 |
1322 0d88 FF90 pop r15 |
1323 0d8a EF90 pop r14 |
1324 0d8c DF90 pop r13 |
1325 0d8e CF90 pop r12 |
1326 0d90 BF90 pop r11 |
1327 0d92 AF90 pop r10 |
1328 0d94 9F90 pop r9 |
1329 0d96 8F90 pop r8 |
1330 0d98 7F90 pop r7 |
1331 0d9a 6F90 pop r6 |
1332 0d9c 5F90 pop r5 |
1333 0d9e 4F90 pop r4 |
1334 0da0 3F90 pop r3 |
1335 0da2 2F90 pop r2 |
1336 0da4 0895 ret |
1337 /* epilogue end (size=25) */ |
1338 /* function gps_main size 1755 (1704) */ |
1340 .global c_sin |
1341 .data |
1344 c_sin: |
1345 0000 0000 .word 0 |
1346 0002 1100 .word 17 |
1347 0004 2200 .word 34 |
1348 0006 3400 .word 52 |
1349 0008 4500 .word 69 |
1350 000a 5700 .word 87 |
1351 000c 6800 .word 104 |
1352 000e 7900 .word 121 |
1353 0010 8B00 .word 139 |
1354 0012 9C00 .word 156 |
1355 0014 AD00 .word 173 |
1356 0016 BE00 .word 190 |
1357 0018 CF00 .word 207 |
1358 001a E000 .word 224 |
1359 001c F100 .word 241 |
1360 001e 0201 .word 258 |
1361 0020 1301 .word 275 |
1362 0022 2401 .word 292 |
1363 0024 3501 .word 309 |
1364 0026 4501 .word 325 |
1365 0028 5601 .word 342 |
1366 002a 6601 .word 358 |
1367 002c 7601 .word 374 |
1368 002e 8601 .word 390 |
1369 0030 9601 .word 406 |
1370 0032 A601 .word 422 |
1371 0034 B601 .word 438 |
1372 0036 C501 .word 453 |
1373 0038 D501 .word 469 |
1374 003a E401 .word 484 |
1375 003c F401 .word 500 |
1376 003e 0302 .word 515 |
1377 0040 1102 .word 529 |
1378 0042 2002 .word 544 |
1379 0044 2F02 .word 559 |
1380 0046 3D02 .word 573 |
1381 0048 4B02 .word 587 |
1382 004a 5902 .word 601 |
1383 004c 6702 .word 615 |
1384 004e 7502 .word 629 |
1385 0050 8202 .word 642 |
1386 0052 9002 .word 656 |
1387 0054 9D02 .word 669 |
1388 0056 AA02 .word 682 |
1389 0058 B602 .word 694 |
1390 005a C302 .word 707 |
1391 005c CF02 .word 719 |
1392 005e DB02 .word 731 |
1393 0060 E702 .word 743 |
1394 0062 F202 .word 754 |
1395 0064 FE02 .word 766 |
1396 0066 0903 .word 777 |
1397 0068 1403 .word 788 |
1398 006a 1E03 .word 798 |
1399 006c 2903 .word 809 |
1400 006e 3303 .word 819 |
1401 0070 3D03 .word 829 |
1402 0072 4603 .word 838 |
1403 0074 5003 .word 848 |
1404 0076 5903 .word 857 |
1405 0078 6203 .word 866 |
1406 007a 6A03 .word 874 |
1407 007c 7203 .word 882 |
1408 007e 7B03 .word 891 |
1409 0080 8203 .word 898 |
1410 0082 8A03 .word 906 |
1411 0084 9103 .word 913 |
1412 0086 9803 .word 920 |
1413 0088 9F03 .word 927 |
1414 008a A503 .word 933 |
1415 008c AB03 .word 939 |
1416 008e B103 .word 945 |
1417 0090 B703 .word 951 |
1418 0092 BC03 .word 956 |
1419 0094 C103 .word 961 |
1420 0096 C503 .word 965 |
1421 0098 CA03 .word 970 |
1422 009a CE03 .word 974 |
1423 009c D203 .word 978 |
1424 009e D503 .word 981 |
1425 00a0 D803 .word 984 |
1426 00a2 DB03 .word 987 |
1427 00a4 DE03 .word 990 |
1428 00a6 E003 .word 992 |
1429 00a8 E203 .word 994 |
1430 00aa E403 .word 996 |
1431 00ac E503 .word 997 |
1432 00ae E603 .word 998 |
1433 00b0 E703 .word 999 |
1434 00b2 E703 .word 999 |
1435 00b4 E803 .word 1000 |
1436 00b6 E703 .word 999 |
1437 00b8 E703 .word 999 |
1438 00ba E603 .word 998 |
1439 00bc E503 .word 997 |
1440 00be E403 .word 996 |
1441 00c0 E203 .word 994 |
1442 00c2 E003 .word 992 |
1443 00c4 DE03 .word 990 |
1444 00c6 DB03 .word 987 |
1445 00c8 D803 .word 984 |
1446 00ca D503 .word 981 |
1447 00cc D203 .word 978 |
1448 00ce CE03 .word 974 |
1449 00d0 CA03 .word 970 |
1450 00d2 C503 .word 965 |
1451 00d4 C103 .word 961 |
1452 00d6 BC03 .word 956 |
1453 00d8 B703 .word 951 |
1454 00da B103 .word 945 |
1455 00dc AB03 .word 939 |
1456 00de A503 .word 933 |
1457 00e0 9F03 .word 927 |
1458 00e2 9803 .word 920 |
1459 00e4 9103 .word 913 |
1460 00e6 8A03 .word 906 |
1461 00e8 8203 .word 898 |
1462 00ea 7B03 .word 891 |
1463 00ec 7203 .word 882 |
1464 00ee 6A03 .word 874 |
1465 00f0 6203 .word 866 |
1466 00f2 5903 .word 857 |
1467 00f4 5003 .word 848 |
1468 00f6 4603 .word 838 |
1469 00f8 3D03 .word 829 |
1470 00fa 3303 .word 819 |
1471 00fc 2903 .word 809 |
1472 00fe 1E03 .word 798 |
1473 0100 1403 .word 788 |
1474 0102 0903 .word 777 |
1475 0104 FE02 .word 766 |
1476 0106 F202 .word 754 |
1477 0108 E702 .word 743 |
1478 010a DB02 .word 731 |
1479 010c CF02 .word 719 |
1480 010e C302 .word 707 |
1481 0110 B602 .word 694 |
1482 0112 AA02 .word 682 |
1483 0114 9D02 .word 669 |
1484 0116 9002 .word 656 |
1485 0118 8202 .word 642 |
1486 011a 7502 .word 629 |
1487 011c 6702 .word 615 |
1488 011e 5902 .word 601 |
1489 0120 4B02 .word 587 |
1490 0122 3D02 .word 573 |
1491 0124 2F02 .word 559 |
1492 0126 2002 .word 544 |
1493 0128 1102 .word 529 |
1494 012a 0302 .word 515 |
1495 012c F401 .word 500 |
1496 012e E401 .word 484 |
1497 0130 D501 .word 469 |
1498 0132 C501 .word 453 |
1499 0134 B601 .word 438 |
1500 0136 A601 .word 422 |
1501 0138 9601 .word 406 |
1502 013a 8601 .word 390 |
1503 013c 7601 .word 374 |
1504 013e 6601 .word 358 |
1505 0140 5601 .word 342 |
1506 0142 4501 .word 325 |
1507 0144 3501 .word 309 |
1508 0146 2401 .word 292 |
1509 0148 1301 .word 275 |
1510 014a 0201 .word 258 |
1511 014c F100 .word 241 |
1512 014e E000 .word 224 |
1513 0150 CF00 .word 207 |
1514 0152 BE00 .word 190 |
1515 0154 AD00 .word 173 |
1516 0156 9C00 .word 156 |
1517 0158 8B00 .word 139 |
1518 015a 7900 .word 121 |
1519 015c 6800 .word 104 |
1520 015e 5700 .word 87 |
1521 0160 4500 .word 69 |
1522 0162 3400 .word 52 |
1523 0164 2200 .word 34 |
1524 0166 1100 .word 17 |
1525 0168 0000 .word 0 |
1526 016a EFFF .word -17 |
1527 016c DEFF .word -34 |
1528 016e CCFF .word -52 |
1529 0170 BBFF .word -69 |
1530 0172 A9FF .word -87 |
1531 0174 98FF .word -104 |
1532 0176 87FF .word -121 |
1533 0178 75FF .word -139 |
1534 017a 64FF .word -156 |
1535 017c 53FF .word -173 |
1536 017e 42FF .word -190 |
1537 0180 31FF .word -207 |
1538 0182 20FF .word -224 |
1539 0184 0FFF .word -241 |
1540 0186 FEFE .word -258 |
1541 0188 EDFE .word -275 |
1542 018a DCFE .word -292 |
1543 018c CBFE .word -309 |
1544 018e BBFE .word -325 |
1545 0190 AAFE .word -342 |
1546 0192 9AFE .word -358 |
1547 0194 8AFE .word -374 |
1548 0196 7AFE .word -390 |
1549 0198 6AFE .word -406 |
1550 019a 5AFE .word -422 |
1551 019c 4AFE .word -438 |
1552 019e 3BFE .word -453 |
1553 01a0 2BFE .word -469 |
1554 01a2 1CFE .word -484 |
1555 01a4 0CFE .word -500 |
1556 01a6 FDFD .word -515 |
1557 01a8 EFFD .word -529 |
1558 01aa E0FD .word -544 |
1559 01ac D1FD .word -559 |
1560 01ae C3FD .word -573 |
1561 01b0 B5FD .word -587 |
1562 01b2 A7FD .word -601 |
1563 01b4 99FD .word -615 |
1564 01b6 8BFD .word -629 |
1565 01b8 7EFD .word -642 |
1566 01ba 70FD .word -656 |
1567 01bc 63FD .word -669 |
1568 01be 56FD .word -682 |
1569 01c0 4AFD .word -694 |
1570 01c2 3DFD .word -707 |
1571 01c4 31FD .word -719 |
1572 01c6 25FD .word -731 |
1573 01c8 19FD .word -743 |
1574 01ca 0EFD .word -754 |
1575 01cc 02FD .word -766 |
1576 01ce F7FC .word -777 |
1577 01d0 ECFC .word -788 |
1578 01d2 E2FC .word -798 |
1579 01d4 D7FC .word -809 |
1580 01d6 CDFC .word -819 |
1581 01d8 C3FC .word -829 |
1582 01da BAFC .word -838 |
1583 01dc B0FC .word -848 |
1584 01de A7FC .word -857 |
1585 01e0 9EFC .word -866 |
1586 01e2 96FC .word -874 |
1587 01e4 8EFC .word -882 |
1588 01e6 85FC .word -891 |
1589 01e8 7EFC .word -898 |
1590 01ea 76FC .word -906 |
1591 01ec 6FFC .word -913 |
1592 01ee 68FC .word -920 |
1593 01f0 61FC .word -927 |
1594 01f2 5BFC .word -933 |
1595 01f4 55FC .word -939 |
1596 01f6 4FFC .word -945 |
1597 01f8 49FC .word -951 |
1598 01fa 44FC .word -956 |
1599 01fc 3FFC .word -961 |
1600 01fe 3BFC .word -965 |
1601 0200 36FC .word -970 |
1602 0202 32FC .word -974 |
1603 0204 2EFC .word -978 |
1604 0206 2BFC .word -981 |
1605 0208 28FC .word -984 |
1606 020a 25FC .word -987 |
1607 020c 22FC .word -990 |
1608 020e 20FC .word -992 |
1609 0210 1EFC .word -994 |
1610 0212 1CFC .word -996 |
1611 0214 1BFC .word -997 |
1612 0216 1AFC .word -998 |
1613 0218 19FC .word -999 |
1614 021a 19FC .word -999 |
1615 021c 18FC .word -1000 |
1616 021e 19FC .word -999 |
1617 0220 19FC .word -999 |
1618 0222 1AFC .word -998 |
1619 0224 1BFC .word -997 |
1620 0226 1CFC .word -996 |
1621 0228 1EFC .word -994 |
1622 022a 20FC .word -992 |
1623 022c 22FC .word -990 |
1624 022e 25FC .word -987 |
1625 0230 28FC .word -984 |
1626 0232 2BFC .word -981 |
1627 0234 2EFC .word -978 |
1628 0236 32FC .word -974 |
1629 0238 36FC .word -970 |
1630 023a 3BFC .word -965 |
1631 023c 3FFC .word -961 |
1632 023e 44FC .word -956 |
1633 0240 49FC .word -951 |
1634 0242 4FFC .word -945 |
1635 0244 55FC .word -939 |
1636 0246 5BFC .word -933 |
1637 0248 61FC .word -927 |
1638 024a 68FC .word -920 |
1639 024c 6FFC .word -913 |
1640 024e 76FC .word -906 |
1641 0250 7EFC .word -898 |
1642 0252 85FC .word -891 |
1643 0254 8EFC .word -882 |
1644 0256 96FC .word -874 |
1645 0258 9EFC .word -866 |
1646 025a A7FC .word -857 |
1647 025c B0FC .word -848 |
1648 025e BAFC .word -838 |
1649 0260 C3FC .word -829 |
1650 0262 CDFC .word -819 |
1651 0264 D7FC .word -809 |
1652 0266 E2FC .word -798 |
1653 0268 ECFC .word -788 |
1654 026a F7FC .word -777 |
1655 026c 02FD .word -766 |
1656 026e 0EFD .word -754 |
1657 0270 19FD .word -743 |
1658 0272 25FD .word -731 |
1659 0274 31FD .word -719 |
1660 0276 3DFD .word -707 |
1661 0278 4AFD .word -694 |
1662 027a 56FD .word -682 |
1663 027c 63FD .word -669 |
1664 027e 70FD .word -656 |
1665 0280 7EFD .word -642 |
1666 0282 8BFD .word -629 |
1667 0284 99FD .word -615 |
1668 0286 A7FD .word -601 |
1669 0288 B5FD .word -587 |
1670 028a C3FD .word -573 |
1671 028c D1FD .word -559 |
1672 028e E0FD .word -544 |
1673 0290 EFFD .word -529 |
1674 0292 FDFD .word -515 |
1675 0294 0CFE .word -500 |
1676 0296 1CFE .word -484 |
1677 0298 2BFE .word -469 |
1678 029a 3BFE .word -453 |
1679 029c 4AFE .word -438 |
1680 029e 5AFE .word -422 |
1681 02a0 6AFE .word -406 |
1682 02a2 7AFE .word -390 |
1683 02a4 8AFE .word -374 |
1684 02a6 9AFE .word -358 |
1685 02a8 AAFE .word -342 |
1686 02aa BBFE .word -325 |
1687 02ac CBFE .word -309 |
1688 02ae DCFE .word -292 |
1689 02b0 EDFE .word -275 |
1690 02b2 FEFE .word -258 |
1691 02b4 0FFF .word -241 |
1692 02b6 20FF .word -224 |
1693 02b8 31FF .word -207 |
1694 02ba 42FF .word -190 |
1695 02bc 53FF .word -173 |
1696 02be 64FF .word -156 |
1697 02c0 75FF .word -139 |
1698 02c2 87FF .word -121 |
1699 02c4 98FF .word -104 |
1700 02c6 A9FF .word -87 |
1701 02c8 BBFF .word -69 |
1702 02ca CCFF .word -52 |
1703 02cc DEFF .word -34 |
1704 02ce EFFF .word -17 |
1705 .global c_cos |
1708 c_cos: |
1709 02d0 E803 .word 1000 |
1710 02d2 E703 .word 999 |
1711 02d4 E703 .word 999 |
1712 02d6 E603 .word 998 |
1713 02d8 E503 .word 997 |
1714 02da E403 .word 996 |
1715 02dc E203 .word 994 |
1716 02de E003 .word 992 |
1717 02e0 DE03 .word 990 |
1718 02e2 DB03 .word 987 |
1719 02e4 D803 .word 984 |
1720 02e6 D503 .word 981 |
1721 02e8 D203 .word 978 |
1722 02ea CE03 .word 974 |
1723 02ec CA03 .word 970 |
1724 02ee C503 .word 965 |
1725 02f0 C103 .word 961 |
1726 02f2 BC03 .word 956 |
1727 02f4 B703 .word 951 |
1728 02f6 B103 .word 945 |
1729 02f8 AB03 .word 939 |
1730 02fa A503 .word 933 |
1731 02fc 9F03 .word 927 |
1732 02fe 9803 .word 920 |
1733 0300 9103 .word 913 |
1734 0302 8A03 .word 906 |
1735 0304 8203 .word 898 |
1736 0306 7B03 .word 891 |
1737 0308 7203 .word 882 |
1738 030a 6A03 .word 874 |
1739 030c 6203 .word 866 |
1740 030e 5903 .word 857 |
1741 0310 5003 .word 848 |
1742 0312 4603 .word 838 |
1743 0314 3D03 .word 829 |
1744 0316 3303 .word 819 |
1745 0318 2903 .word 809 |
1746 031a 1E03 .word 798 |
1747 031c 1403 .word 788 |
1748 031e 0903 .word 777 |
1749 0320 FE02 .word 766 |
1750 0322 F202 .word 754 |
1751 0324 E702 .word 743 |
1752 0326 DB02 .word 731 |
1753 0328 CF02 .word 719 |
1754 032a C302 .word 707 |
1755 032c B602 .word 694 |
1756 032e AA02 .word 682 |
1757 0330 9D02 .word 669 |
1758 0332 9002 .word 656 |
1759 0334 8202 .word 642 |
1760 0336 7502 .word 629 |
1761 0338 6702 .word 615 |
1762 033a 5902 .word 601 |
1763 033c 4B02 .word 587 |
1764 033e 3D02 .word 573 |
1765 0340 2F02 .word 559 |
1766 0342 2002 .word 544 |
1767 0344 1102 .word 529 |
1768 0346 0302 .word 515 |
1769 0348 F401 .word 500 |
1770 034a E401 .word 484 |
1771 034c D501 .word 469 |
1772 034e C501 .word 453 |
1773 0350 B601 .word 438 |
1774 0352 A601 .word 422 |
1775 0354 9601 .word 406 |
1776 0356 8601 .word 390 |
1777 0358 7601 .word 374 |
1778 035a 6601 .word 358 |
1779 035c 5601 .word 342 |
1780 035e 4501 .word 325 |
1781 0360 3501 .word 309 |
1782 0362 2401 .word 292 |
1783 0364 1301 .word 275 |
1784 0366 0201 .word 258 |
1785 0368 F100 .word 241 |
1786 036a E000 .word 224 |
1787 036c CF00 .word 207 |
1788 036e BE00 .word 190 |
1789 0370 AD00 .word 173 |
1790 0372 9C00 .word 156 |
1791 0374 8B00 .word 139 |
1792 0376 7900 .word 121 |
1793 0378 6800 .word 104 |
1794 037a 5700 .word 87 |
1795 037c 4500 .word 69 |
1796 037e 3400 .word 52 |
1797 0380 2200 .word 34 |
1798 0382 1100 .word 17 |
1799 0384 0000 .word 0 |
1800 0386 EFFF .word -17 |
1801 0388 DEFF .word -34 |
1802 038a CCFF .word -52 |
1803 038c BBFF .word -69 |
1804 038e A9FF .word -87 |
1805 0390 98FF .word -104 |
1806 0392 87FF .word -121 |
1807 0394 75FF .word -139 |
1808 0396 64FF .word -156 |
1809 0398 53FF .word -173 |
1810 039a 42FF .word -190 |
1811 039c 31FF .word -207 |
1812 039e 20FF .word -224 |
1813 03a0 0FFF .word -241 |
1814 03a2 FEFE .word -258 |
1815 03a4 EDFE .word -275 |
1816 03a6 DCFE .word -292 |
1817 03a8 CBFE .word -309 |
1818 03aa BBFE .word -325 |
1819 03ac AAFE .word -342 |
1820 03ae 9AFE .word -358 |
1821 03b0 8AFE .word -374 |
1822 03b2 7AFE .word -390 |
1823 03b4 6AFE .word -406 |
1824 03b6 5AFE .word -422 |
1825 03b8 4AFE .word -438 |
1826 03ba 3BFE .word -453 |
1827 03bc 2BFE .word -469 |
1828 03be 1CFE .word -484 |
1829 03c0 0CFE .word -500 |
1830 03c2 FDFD .word -515 |
1831 03c4 EFFD .word -529 |
1832 03c6 E0FD .word -544 |
1833 03c8 D1FD .word -559 |
1834 03ca C3FD .word -573 |
1835 03cc B5FD .word -587 |
1836 03ce A7FD .word -601 |
1837 03d0 99FD .word -615 |
1838 03d2 8BFD .word -629 |
1839 03d4 7EFD .word -642 |
1840 03d6 70FD .word -656 |
1841 03d8 63FD .word -669 |
1842 03da 56FD .word -682 |
1843 03dc 4AFD .word -694 |
1844 03de 3DFD .word -707 |
1845 03e0 31FD .word -719 |
1846 03e2 25FD .word -731 |
1847 03e4 19FD .word -743 |
1848 03e6 0EFD .word -754 |
1849 03e8 02FD .word -766 |
1850 03ea F7FC .word -777 |
1851 03ec ECFC .word -788 |
1852 03ee E2FC .word -798 |
1853 03f0 D7FC .word -809 |
1854 03f2 CDFC .word -819 |
1855 03f4 C3FC .word -829 |
1856 03f6 BAFC .word -838 |
1857 03f8 B0FC .word -848 |
1858 03fa A7FC .word -857 |
1859 03fc 9EFC .word -866 |
1860 03fe 96FC .word -874 |
1861 0400 8EFC .word -882 |
1862 0402 85FC .word -891 |
1863 0404 7EFC .word -898 |
1864 0406 76FC .word -906 |
1865 0408 6FFC .word -913 |
1866 040a 68FC .word -920 |
1867 040c 61FC .word -927 |
1868 040e 5BFC .word -933 |
1869 0410 55FC .word -939 |
1870 0412 4FFC .word -945 |
1871 0414 49FC .word -951 |
1872 0416 44FC .word -956 |
1873 0418 3FFC .word -961 |
1874 041a 3BFC .word -965 |
1875 041c 36FC .word -970 |
1876 041e 32FC .word -974 |
1877 0420 2EFC .word -978 |
1878 0422 2BFC .word -981 |
1879 0424 28FC .word -984 |
1880 0426 25FC .word -987 |
1881 0428 22FC .word -990 |
1882 042a 20FC .word -992 |
1883 042c 1EFC .word -994 |
1884 042e 1CFC .word -996 |
1885 0430 1BFC .word -997 |
1886 0432 1AFC .word -998 |
1887 0434 19FC .word -999 |
1888 0436 19FC .word -999 |
1889 0438 18FC .word -1000 |
1890 043a 19FC .word -999 |
1891 043c 19FC .word -999 |
1892 043e 1AFC .word -998 |
1893 0440 1BFC .word -997 |
1894 0442 1CFC .word -996 |
1895 0444 1EFC .word -994 |
1896 0446 20FC .word -992 |
1897 0448 22FC .word -990 |
1898 044a 25FC .word -987 |
1899 044c 28FC .word -984 |
1900 044e 2BFC .word -981 |
1901 0450 2EFC .word -978 |
1902 0452 32FC .word -974 |
1903 0454 36FC .word -970 |
1904 0456 3BFC .word -965 |
1905 0458 3FFC .word -961 |
1906 045a 44FC .word -956 |
1907 045c 49FC .word -951 |
1908 045e 4FFC .word -945 |
1909 0460 55FC .word -939 |
1910 0462 5BFC .word -933 |
1911 0464 61FC .word -927 |
1912 0466 68FC .word -920 |
1913 0468 6FFC .word -913 |
1914 046a 76FC .word -906 |
1915 046c 7EFC .word -898 |
1916 046e 85FC .word -891 |
1917 0470 8EFC .word -882 |
1918 0472 96FC .word -874 |
1919 0474 9EFC .word -866 |
1920 0476 A7FC .word -857 |
1921 0478 B0FC .word -848 |
1922 047a BAFC .word -838 |
1923 047c C3FC .word -829 |
1924 047e CDFC .word -819 |
1925 0480 D7FC .word -809 |
1926 0482 E2FC .word -798 |
1927 0484 ECFC .word -788 |
1928 0486 F7FC .word -777 |
1929 0488 02FD .word -766 |
1930 048a 0EFD .word -754 |
1931 048c 19FD .word -743 |
1932 048e 25FD .word -731 |
1933 0490 31FD .word -719 |
1934 0492 3DFD .word -707 |
1935 0494 4AFD .word -694 |
1936 0496 56FD .word -682 |
1937 0498 63FD .word -669 |
1938 049a 70FD .word -656 |
1939 049c 7EFD .word -642 |
1940 049e 8BFD .word -629 |
1941 04a0 99FD .word -615 |
1942 04a2 A7FD .word -601 |
1943 04a4 B5FD .word -587 |
1944 04a6 C3FD .word -573 |
1945 04a8 D1FD .word -559 |
1946 04aa E0FD .word -544 |
1947 04ac EFFD .word -529 |
1948 04ae FDFD .word -515 |
1949 04b0 0CFE .word -500 |
1950 04b2 1CFE .word -484 |
1951 04b4 2BFE .word -469 |
1952 04b6 3BFE .word -453 |
1953 04b8 4AFE .word -438 |
1954 04ba 5AFE .word -422 |
1955 04bc 6AFE .word -406 |
1956 04be 7AFE .word -390 |
1957 04c0 8AFE .word -374 |
1958 04c2 9AFE .word -358 |
1959 04c4 AAFE .word -342 |
1960 04c6 BBFE .word -325 |
1961 04c8 CBFE .word -309 |
1962 04ca DCFE .word -292 |
1963 04cc EDFE .word -275 |
1964 04ce FEFE .word -258 |
1965 04d0 0FFF .word -241 |
1966 04d2 20FF .word -224 |
1967 04d4 31FF .word -207 |
1968 04d6 42FF .word -190 |
1969 04d8 53FF .word -173 |
1970 04da 64FF .word -156 |
1971 04dc 75FF .word -139 |
1972 04de 87FF .word -121 |
1973 04e0 98FF .word -104 |
1974 04e2 A9FF .word -87 |
1975 04e4 BBFF .word -69 |
1976 04e6 CCFF .word -52 |
1977 04e8 DEFF .word -34 |
1978 04ea EFFF .word -17 |
1979 04ec 0000 .word 0 |
1980 04ee 1100 .word 17 |
1981 04f0 2200 .word 34 |
1982 04f2 3400 .word 52 |
1983 04f4 4500 .word 69 |
1984 04f6 5700 .word 87 |
1985 04f8 6800 .word 104 |
1986 04fa 7900 .word 121 |
1987 04fc 8B00 .word 139 |
1988 04fe 9C00 .word 156 |
1989 0500 AD00 .word 173 |
1990 0502 BE00 .word 190 |
1991 0504 CF00 .word 207 |
1992 0506 E000 .word 224 |
1993 0508 F100 .word 241 |
1994 050a 0201 .word 258 |
1995 050c 1301 .word 275 |
1996 050e 2401 .word 292 |
1997 0510 3501 .word 309 |
1998 0512 4501 .word 325 |
1999 0514 5601 .word 342 |
2000 0516 6601 .word 358 |
2001 0518 7601 .word 374 |
2002 051a 8601 .word 390 |
2003 051c 9601 .word 406 |
2004 051e A601 .word 422 |
2005 0520 B601 .word 438 |
2006 0522 C501 .word 453 |
2007 0524 D501 .word 469 |
2008 0526 E401 .word 484 |
2009 0528 F401 .word 500 |
2010 052a 0302 .word 515 |
2011 052c 1102 .word 529 |
2012 052e 2002 .word 544 |
2013 0530 2F02 .word 559 |
2014 0532 3D02 .word 573 |
2015 0534 4B02 .word 587 |
2016 0536 5902 .word 601 |
2017 0538 6702 .word 615 |
2018 053a 7502 .word 629 |
2019 053c 8202 .word 642 |
2020 053e 9002 .word 656 |
2021 0540 9D02 .word 669 |
2022 0542 AA02 .word 682 |
2023 0544 B602 .word 694 |
2024 0546 C302 .word 707 |
2025 0548 CF02 .word 719 |
2026 054a DB02 .word 731 |
2027 054c E702 .word 743 |
2028 054e F202 .word 754 |
2029 0550 FE02 .word 766 |
2030 0552 0903 .word 777 |
2031 0554 1403 .word 788 |
2032 0556 1E03 .word 798 |
2033 0558 2903 .word 809 |
2034 055a 3303 .word 819 |
2035 055c 3D03 .word 829 |
2036 055e 4603 .word 838 |
2037 0560 5003 .word 848 |
2038 0562 5903 .word 857 |
2039 0564 6203 .word 866 |
2040 0566 6A03 .word 874 |
2041 0568 7203 .word 882 |
2042 056a 7B03 .word 891 |
2043 056c 8203 .word 898 |
2044 056e 8A03 .word 906 |
2045 0570 9103 .word 913 |
2046 0572 9803 .word 920 |
2047 0574 9F03 .word 927 |
2048 0576 A503 .word 933 |
2049 0578 AB03 .word 939 |
2050 057a B103 .word 945 |
2051 057c B703 .word 951 |
2052 057e BC03 .word 956 |
2053 0580 C103 .word 961 |
2054 0582 C503 .word 965 |
2055 0584 CA03 .word 970 |
2056 0586 CE03 .word 974 |
2057 0588 D203 .word 978 |
2058 058a D503 .word 981 |
2059 058c D803 .word 984 |
2060 058e DB03 .word 987 |
2061 0590 DE03 .word 990 |
2062 0592 E003 .word 992 |
2063 0594 E203 .word 994 |
2064 0596 E403 .word 996 |
2065 0598 E503 .word 997 |
2066 059a E603 .word 998 |
2067 059c E703 .word 999 |
2068 059e E703 .word 999 |
2069 .global Soll_Position_North |
2070 .global Soll_Position_North |
2071 .section .bss |
2074 Soll_Position_North: |
2075 0000 0000 0000 .skip 4,0 |
2076 .global Soll_Position_East |
2077 .global Soll_Position_East |
2080 Soll_Position_East: |
2081 0004 0000 0000 .skip 4,0 |
2082 .global GPS_Positionsabweichung_North |
2083 .global GPS_Positionsabweichung_North |
2086 GPS_Positionsabweichung_North: |
2087 0008 0000 0000 .skip 4,0 |
2088 .global GPS_Positionsabweichung_East |
2089 .global GPS_Positionsabweichung_East |
2092 GPS_Positionsabweichung_East: |
2093 000c 0000 0000 .skip 4,0 |
2094 .global GPS_Geschwindigkeit_North |
2095 .global GPS_Geschwindigkeit_North |
2098 GPS_Geschwindigkeit_North: |
2099 0010 0000 0000 .skip 4,0 |
2100 .global GPS_Geschwindigkeit_East |
2101 .global GPS_Geschwindigkeit_East |
2104 GPS_Geschwindigkeit_East: |
2105 0014 0000 0000 .skip 4,0 |
2106 .global P_Einfluss_North |
2107 .global P_Einfluss_North |
2110 P_Einfluss_North: |
2111 0018 0000 0000 .skip 4,0 |
2112 .global D_Einfluss_North |
2113 .global D_Einfluss_North |
2116 D_Einfluss_North: |
2117 001c 0000 0000 .skip 4,0 |
2118 .global P_Einfluss_East |
2119 .global P_Einfluss_East |
2122 P_Einfluss_East: |
2123 0020 0000 0000 .skip 4,0 |
2124 .global D_Einfluss_East |
2125 .global D_Einfluss_East |
2128 D_Einfluss_East: |
2129 0024 0000 0000 .skip 4,0 |
2130 .global GPS_North |
2131 .global GPS_North |
2134 GPS_North: |
2135 0028 0000 .skip 2,0 |
2136 .global GPS_East |
2137 .global GPS_East |
2140 GPS_East: |
2141 002a 0000 .skip 2,0 |
2142 .global GPS_Nick |
2143 .global GPS_Nick |
2146 GPS_Nick: |
2147 002c 0000 .skip 2,0 |
2148 .global GPS_Roll |
2149 .global GPS_Roll |
2152 GPS_Roll: |
2153 002e 0000 .skip 2,0 |
2154 .global gethome |
2155 .global gethome |
2158 gethome: |
2159 0030 00 .skip 1,0 |
2160 .global GPS_Home_North |
2161 .global GPS_Home_North |
2164 GPS_Home_North: |
2165 0031 0000 0000 .skip 4,0 |
2166 .global GPS_Home_East |
2167 .global GPS_Home_East |
2170 GPS_Home_East: |
2171 0035 0000 0000 .skip 4,0 |
2172 .global blinkcount_LED2 |
2173 .global blinkcount_LED2 |
2176 blinkcount_LED2: |
2177 0039 00 .skip 1,0 |
2178 .global NeuerMittelwert |
2179 .global NeuerMittelwert |
2182 NeuerMittelwert: |
2183 003a 00 .skip 1,0 |
2184 .global FilterPos |
2185 .global FilterPos |
2188 FilterPos: |
2189 003b 00 .skip 1,0 |
2190 .global NORTH_MITTEL |
2191 .global NORTH_MITTEL |
2194 NORTH_MITTEL: |
2195 003c 0000 0000 .skip 4,0 |
2196 .global EAST_MITTEL |
2197 .global EAST_MITTEL |
2200 EAST_MITTEL: |
2201 0040 0000 0000 .skip 4,0 |
2202 .global NORTH_LONG_LONG |
2203 .global NORTH_LONG_LONG |
2206 NORTH_LONG_LONG: |
2207 0044 0000 0000 .skip 8,0 |
2207 0000 0000 |
2208 .global EAST_LONG_LONG |
2209 .global EAST_LONG_LONG |
2212 EAST_LONG_LONG: |
2213 004c 0000 0000 .skip 8,0 |
2213 0000 0000 |
2214 .global filterfilled |
2215 .global filterfilled |
2218 filterfilled: |
2219 0054 0000 .skip 2,0 |
2220 .comm DiffNick,2,1 |
2221 .comm DiffRoll,2,1 |
2222 .comm SenderOkay,1,1 |
2223 .comm CosinusNickWinkel,1,1 |
2224 .comm CosinusRollWinkel,1,1 |
2225 .comm durchschnitt_northing,4,1 |
2226 .comm durchschnitt_easting,4,1 |
2227 .comm P_GPS_Verstaerkung,2,1 |
2228 .comm D_GPS_Verstaerkung,2,1 |
2229 .comm RemoteTasten,1,1 |
2230 .comm Timeout,1,1 |
2231 .comm IntegralNick,4,1 |
2232 .comm IntegralNick2,4,1 |
2233 .comm IntegralRoll,4,1 |
2234 .comm IntegralRoll2,4,1 |
2235 .comm Mess_IntegralNick,4,1 |
2236 .comm Mess_IntegralNick2,4,1 |
2237 .comm Mess_IntegralRoll,4,1 |
2238 .comm Mess_IntegralRoll2,4,1 |
2239 .comm Integral_Gier,4,1 |
2240 .comm Mess_Integral_Gier,4,1 |
2241 .comm h,1,1 |
2242 .comm m,1,1 |
2243 .comm s,1,1 |
2244 .comm Motor_Vorne,1,1 |
2245 .comm Motor_Hinten,1,1 |
2246 .comm Motor_Rechts,1,1 |
2247 .comm Motor_Links,1,1 |
2248 .comm Count,1,1 |
2249 .comm MotorWert,5,1 |
2250 .comm filter_north,32,1 |
2251 .comm filter_east,32,1 |
2252 /* File "GPS.c": code 1755 = 0x06db (1704), prologues 26, epilogues 25 */ |
DEFINED SYMBOLS |
*ABS*:00000000 GPS.c |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:3 *ABS*:0000003f __SREG__ |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:4 *ABS*:0000003e __SP_H__ |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:5 *ABS*:0000003d __SP_L__ |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:6 *ABS*:00000000 __tmp_reg__ |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:7 *ABS*:00000001 __zero_reg__ |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:13 .text:00000000 gps_main |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2188 .bss:0000003b FilterPos |
*COM*:00000020 filter_north |
*COM*:00000020 filter_east |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2218 .bss:00000054 filterfilled |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2206 .bss:00000044 NORTH_LONG_LONG |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2212 .bss:0000004c EAST_LONG_LONG |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2194 .bss:0000003c NORTH_MITTEL |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2200 .bss:00000040 EAST_MITTEL |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2182 .bss:0000003a NeuerMittelwert |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2146 .bss:0000002c GPS_Nick |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2152 .bss:0000002e GPS_Roll |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2158 .bss:00000030 gethome |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2164 .bss:00000031 GPS_Home_North |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2170 .bss:00000035 GPS_Home_East |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2074 .bss:00000000 Soll_Position_North |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2080 .bss:00000004 Soll_Position_East |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2176 .bss:00000039 blinkcount_LED2 |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2086 .bss:00000008 GPS_Positionsabweichung_North |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2092 .bss:0000000c GPS_Positionsabweichung_East |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2098 .bss:00000010 GPS_Geschwindigkeit_North |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2104 .bss:00000014 GPS_Geschwindigkeit_East |
*COM*:00000002 P_GPS_Verstaerkung |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2110 .bss:00000018 P_Einfluss_North |
*COM*:00000002 D_GPS_Verstaerkung |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2116 .bss:0000001c D_Einfluss_North |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2122 .bss:00000020 P_Einfluss_East |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2128 .bss:00000024 D_Einfluss_East |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2134 .bss:00000028 GPS_North |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:2140 .bss:0000002a GPS_East |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:1344 .data:00000000 c_sin |
C:\DOKUME~1\none\LOKALE~1\Temp/cc7fUdHj.s:1708 .data:000002d0 c_cos |
*COM*:00000002 DiffNick |
*COM*:00000002 DiffRoll |
*COM*:00000001 SenderOkay |
*COM*:00000001 CosinusNickWinkel |
*COM*:00000001 CosinusRollWinkel |
*COM*:00000004 durchschnitt_northing |
*COM*:00000004 durchschnitt_easting |
*COM*:00000001 RemoteTasten |
*COM*:00000001 Timeout |
*COM*:00000004 IntegralNick |
*COM*:00000004 IntegralNick2 |
*COM*:00000004 IntegralRoll |
*COM*:00000004 IntegralRoll2 |
*COM*:00000004 Mess_IntegralNick |
*COM*:00000004 Mess_IntegralNick2 |
*COM*:00000004 Mess_IntegralRoll |
*COM*:00000004 Mess_IntegralRoll2 |
*COM*:00000004 Integral_Gier |
*COM*:00000004 Mess_Integral_Gier |
*COM*:00000001 h |
*COM*:00000001 m |
*COM*:00000001 s |
*COM*:00000001 Motor_Vorne |
*COM*:00000001 Motor_Hinten |
*COM*:00000001 Motor_Rechts |
*COM*:00000001 Motor_Links |
*COM*:00000001 Count |
*COM*:00000005 MotorWert |
UNDEFINED SYMBOLS |
__do_copy_data |
__do_clear_bss |
actualPos |
__divdi3 |
MotorenEin |
Poti3 |
beeptime |
modell_fliegt_gps |
StickNick |
StickRoll |
__mulsi3 |
__floatsisf |
__mulsf3 |
__fixsfsi |
Limit_D_Anteil |
KompassValue |
__addsf3 |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/License.txt |
---|
0,0 → 1,52 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + Nur für den privaten Gebrauch |
// + www.MikroKopter.com |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
// + dass eine Nutzung (auch auszugsweise) nur für den privaten und nichtkommerziellen Gebrauch zulässig ist. |
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
// + bzgl. der Nutzungsbedingungen aufzunehmen. |
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
// + Verkauf von Luftbildaufnahmen, usw. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
// + eindeutig als Ursprung verlinkt und genannt werden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
// + Benutzung auf eigene Gefahr |
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
// + mit unserer Zustimmung zulässig |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
// + this list of conditions and the following disclaimer. |
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
// + from this software without specific prior written permission. |
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
// + for non-profit use (directly or indirectly) |
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
// + with our written permission |
// + * If sources or documentations are redistributet, our webpage (http://www.MikroKopter.de) must be |
// + clearly linked and named as origin |
// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/Settings.h |
---|
--- alpha/v060JokoGPSpakoxdaMM3/_Settings.h (nonexistent) |
+++ alpha/v060JokoGPSpakoxdaMM3/_Settings.h (revision 2762) |
@@ -0,0 +1,50 @@ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Testmodi |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define MOTOR_OFF 0 |
+#define MOTOR_TEST 0 |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Abstimmung |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define ACC_AMPLIFY 16 |
+#define FAKTOR_P 1 |
+#define FAKTOR_I 0.0001 |
+ |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Debug-Interface |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define SIO_DEBUG 1 // Soll der Debugger aktiviert sein? |
+#define MIN_DEBUG_INTERVALL 250 // in diesem Intervall werden Degugdaten ohne Aufforderung gesendet |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Sender |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ #define K_NICK 0 |
+ #define K_ROLL 1 |
+ #define K_GAS 2 |
+ #define K_GIER 3 |
+ #define K_POTI1 4 |
+ #define K_POTI2 5 |
+ #define K_POTI3 6 |
+ #define K_POTI4 7 |
+// +++++++++++++++++++++++++++++++ |
+// + Getestete Settings: |
+// +++++++++++++++++++++++++++++++ |
+// Setting: Kamera |
+// Stick_P:3 |
+// Stick_D:0 |
+// Gyro_P: 175 |
+// Gyro_I: 175 |
+// Ki_Anteil: 10 |
+// +++++++++++++++++++++++++++++++ |
+// + Getestete Settings: |
+// +++++++++++++++++++++++++++++++ |
+// Setting: Normal |
+// Stick_P:2 |
+// Stick_D:8 |
+// Gyro_P: 80 |
+// Gyro_I: 150 |
+// Ki_Anteil: 5 |
+ |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/analog.c |
---|
0,0 → 1,155 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
volatile int Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az, UBat = 100; |
volatile int AccumulateNick = 0, AccumulateRoll = 0, AccumulateGier = 0; |
volatile int accumulate_AccRoll = 0,accumulate_AccNick = 0,accumulate_AccHoch = 0; |
volatile char MessanzahlNick = 0, MessanzahlRoll = 0, MessanzahlGier = 0; |
volatile char messanzahl_AccNick = 0, messanzahl_AccRoll = 0, messanzahl_AccHoch = 0; |
volatile long Luftdruck = 32000; |
volatile int StartLuftdruck; |
volatile unsigned int MessLuftdruck = 1023; |
unsigned char DruckOffsetSetting; |
volatile int HoeheD = 0; |
volatile char messanzahl_Druck; |
volatile int tmpLuftdruck; |
volatile unsigned int ZaehlMessungen = 0; |
//####################################################################################### |
// |
void ADC_Init(void) |
//####################################################################################### |
{ |
ADMUX = 0;//Referenz ist extern |
ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE); |
//Free Running Mode, Division Factor 128, Interrupt on |
} |
void SucheLuftruckOffset(void) |
{ |
unsigned int off; |
for(off=0; off < 250;off++) |
{ |
OCR0A = off; |
Delay_ms(50); |
printf("."); |
if(MessLuftdruck < 900) break; |
} |
DruckOffsetSetting = off; |
Delay_ms(200); |
} |
//####################################################################################### |
// |
SIGNAL(SIG_ADC) |
//####################################################################################### |
{ |
static unsigned char kanal=0,state = 0; |
signed int wert; |
ANALOG_OFF; |
switch(state++) |
{ |
case 0: |
wert = (signed int) AdNeutralGier - ADC; |
AccumulateGier += wert; // |
MessanzahlGier++; |
Mess_Integral_Gier += wert;// / 16; |
Mess_Integral_Gier2 += wert; |
kanal = 1; |
ZaehlMessungen++; |
break; |
case 1: |
wert = (signed int) ADC - AdNeutralRoll; |
Mess_IntegralRoll += wert; |
Mess_IntegralRoll2 += wert; |
if(ADC < 10) wert = -700; |
if(ADC > 1000) wert = +700; |
AccumulateRoll += wert; |
MessanzahlRoll++; |
kanal = 2; |
break; |
case 2: |
wert = (signed int) ADC - AdNeutralNick; |
Mess_IntegralNick += wert; |
Mess_IntegralNick2 += wert; |
if(ADC < 10) wert = -700; |
if(ADC > 1000) wert = +700; |
AccumulateNick += wert; |
MessanzahlNick++; |
kanal = 4; |
break; |
case 3: |
UBat = (3 * UBat + ADC / 3) / 4;//(UBat + ((ADC * 39) / 256) + 19) / 2; |
kanal = 6; |
break; |
case 4: |
Aktuell_ay = NeutralAccY - ADC; |
accumulate_AccRoll += Aktuell_ay; |
messanzahl_AccRoll++; |
kanal = 7; |
break; |
case 5: |
Aktuell_ax = ADC - NeutralAccX; |
accumulate_AccNick += Aktuell_ax; |
messanzahl_AccNick++; |
kanal = 5; |
state = 6; |
break; |
case 6: |
accumulate_AccHoch = (signed int) ADC - NeutralAccZ; |
accumulate_AccHoch += abs(Aktuell_ay) / 4 + abs(Aktuell_ax) / 4; |
if(accumulate_AccHoch > 1) |
{ |
if(NeutralAccZ < 800) NeutralAccZ+= 0.02; |
} |
else if(accumulate_AccHoch < -1) |
{ |
if(NeutralAccZ > 600) NeutralAccZ-= 0.02; |
} |
messanzahl_AccHoch = 1; |
Aktuell_az = ADC; |
Mess_Integral_Hoch += accumulate_AccHoch; // Integrieren |
Mess_Integral_Hoch -= Mess_Integral_Hoch / 1024; // dämfen |
// Mess_Integral_Hoch -= Mess_Integral_Hoch / 512; // dämfen |
/* if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
kanal = 3; |
state = 7; |
} |
else |
{ |
kanal = 0; |
state = 0; |
}*/ |
kanal = 3; |
state = 7; |
break; |
case 7: |
tmpLuftdruck += ADC; |
if(++messanzahl_Druck >= 5) |
{ |
MessLuftdruck = ADC; |
messanzahl_Druck = 0; |
HoeheD = (int)(StartLuftdruck - tmpLuftdruck - HoehenWert); // D-Anteil = neuerWert - AlterWert |
Luftdruck = (tmpLuftdruck + 3 * Luftdruck) / 4; |
HoehenWert = StartLuftdruck - Luftdruck; |
tmpLuftdruck = 0; |
} |
kanal = 0; |
state = 0; |
break; |
default: |
kanal = 0; |
state = 0; |
break; |
} |
ADMUX = kanal; |
ANALOG_ON; |
} |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/analog.d |
---|
0,0 → 1,2 |
analog.o analog.d : analog.c main.h old_macros.h _Settings.h printf_P.h timer0.h \ |
uart.h analog.h twimaster.h menu.h rc.h fc.h gps.h |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/analog.h |
---|
0,0 → 1,23 |
/*####################################################################################### |
#######################################################################################*/ |
extern volatile int UBat; |
extern volatile int AccumulateNick, AccumulateRoll, AccumulateGier,accumulate_AccRoll,accumulate_AccNick,accumulate_AccHoch; |
extern volatile char MessanzahlNick, MessanzahlRoll, MessanzahlGier,messanzahl_AccNick, messanzahl_AccRoll,messanzahl_AccHoch; |
extern volatile int Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az; |
extern volatile long Luftdruck; |
extern volatile char messanzahl_Druck; |
extern volatile unsigned int ZaehlMessungen; |
extern unsigned char DruckOffsetSetting; |
extern volatile int HoeheD; |
extern volatile unsigned int MessLuftdruck; |
extern volatile int StartLuftdruck; |
unsigned int ReadADC(unsigned char adc_input); |
void ADC_Init(void); |
void SucheLuftruckOffset(void); |
#define ANALOG_OFF ADCSRA=0 |
#define ANALOG_ON ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE) |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/analog.lst |
---|
0,0 → 1,850 |
1 .file "analog.c" |
2 .arch atmega644 |
3 __SREG__ = 0x3f |
4 __SP_H__ = 0x3e |
5 __SP_L__ = 0x3d |
6 __tmp_reg__ = 0 |
7 __zero_reg__ = 1 |
8 .global __do_copy_data |
9 .global __do_clear_bss |
10 .text |
11 .global ADC_Init |
13 ADC_Init: |
14 /* prologue: frame size=0 */ |
15 /* prologue end (size=0) */ |
16 0000 1092 7C00 sts 124,__zero_reg__ |
17 0004 8FEE ldi r24,lo8(-17) |
18 0006 8093 7A00 sts 122,r24 |
19 /* epilogue: frame size=0 */ |
20 000a 0895 ret |
21 /* epilogue end (size=1) */ |
22 /* function ADC_Init size 6 (5) */ |
24 .global __vector_24 |
26 __vector_24: |
27 /* prologue: frame size=0 */ |
28 000c 1F92 push __zero_reg__ |
29 000e 0F92 push __tmp_reg__ |
30 0010 0FB6 in __tmp_reg__,__SREG__ |
31 0012 0F92 push __tmp_reg__ |
32 0014 1124 clr __zero_reg__ |
33 0016 EF92 push r14 |
34 0018 FF92 push r15 |
35 001a 0F93 push r16 |
36 001c 1F93 push r17 |
37 001e 2F93 push r18 |
38 0020 3F93 push r19 |
39 0022 4F93 push r20 |
40 0024 5F93 push r21 |
41 0026 6F93 push r22 |
42 0028 7F93 push r23 |
43 002a 8F93 push r24 |
44 002c 9F93 push r25 |
45 002e AF93 push r26 |
46 0030 BF93 push r27 |
47 0032 CF93 push r28 |
48 0034 DF93 push r29 |
49 0036 EF93 push r30 |
50 0038 FF93 push r31 |
51 /* prologue end (size=23) */ |
52 003a 1092 7A00 sts 122,__zero_reg__ |
53 003e 4091 0000 lds r20,state.2041 |
54 0042 4F5F subi r20,lo8(-(1)) |
55 0044 4093 0000 sts state.2041,r20 |
56 0048 4150 subi r20,lo8(-(-1)) |
57 004a 4330 cpi r20,lo8(3) |
58 004c 01F4 brne .+2 |
59 004e 00C0 rjmp .L8 |
60 0050 4430 cpi r20,lo8(4) |
61 0052 00F4 brsh .L13 |
62 0054 4130 cpi r20,lo8(1) |
63 0056 01F4 brne .+2 |
64 0058 00C0 rjmp .L6 |
65 005a 4230 cpi r20,lo8(2) |
66 005c 00F0 brlo .+2 |
67 005e 00C0 rjmp .L7 |
68 0060 00C0 rjmp .L36 |
69 .L13: |
70 0062 4530 cpi r20,lo8(5) |
71 0064 01F4 brne .+2 |
72 0066 00C0 rjmp .L10 |
73 0068 4530 cpi r20,lo8(5) |
74 006a 00F4 brsh .+2 |
75 006c 00C0 rjmp .L9 |
76 006e 4630 cpi r20,lo8(6) |
77 0070 01F4 brne .+2 |
78 0072 00C0 rjmp .L11 |
79 0074 4730 cpi r20,lo8(7) |
80 0076 01F0 breq .+2 |
81 0078 00C0 rjmp .L37 |
82 007a 00C0 rjmp .L12 |
83 .L36: |
84 007c 2091 0000 lds r18,AdNeutralGier |
85 0080 3091 0000 lds r19,(AdNeutralGier)+1 |
86 0084 8091 7800 lds r24,120 |
87 0088 9091 7900 lds r25,(120)+1 |
88 008c 281B sub r18,r24 |
89 008e 390B sbc r19,r25 |
90 0090 8091 0000 lds r24,AccumulateGier |
91 0094 9091 0000 lds r25,(AccumulateGier)+1 |
92 0098 820F add r24,r18 |
93 009a 931F adc r25,r19 |
94 009c 9093 0000 sts (AccumulateGier)+1,r25 |
95 00a0 8093 0000 sts AccumulateGier,r24 |
96 00a4 8091 0000 lds r24,MessanzahlGier |
97 00a8 8F5F subi r24,lo8(-(1)) |
98 00aa 8093 0000 sts MessanzahlGier,r24 |
99 00ae 8091 0000 lds r24,Mess_Integral_Gier |
100 00b2 9091 0000 lds r25,(Mess_Integral_Gier)+1 |
101 00b6 A091 0000 lds r26,(Mess_Integral_Gier)+2 |
102 00ba B091 0000 lds r27,(Mess_Integral_Gier)+3 |
103 00be 4427 clr r20 |
104 00c0 37FD sbrc r19,7 |
105 00c2 4095 com r20 |
106 00c4 542F mov r21,r20 |
107 00c6 820F add r24,r18 |
108 00c8 931F adc r25,r19 |
109 00ca A41F adc r26,r20 |
110 00cc B51F adc r27,r21 |
111 00ce 8093 0000 sts Mess_Integral_Gier,r24 |
112 00d2 9093 0000 sts (Mess_Integral_Gier)+1,r25 |
113 00d6 A093 0000 sts (Mess_Integral_Gier)+2,r26 |
114 00da B093 0000 sts (Mess_Integral_Gier)+3,r27 |
115 00de 8091 0000 lds r24,Mess_Integral_Gier2 |
116 00e2 9091 0000 lds r25,(Mess_Integral_Gier2)+1 |
117 00e6 A091 0000 lds r26,(Mess_Integral_Gier2)+2 |
118 00ea B091 0000 lds r27,(Mess_Integral_Gier2)+3 |
119 00ee 820F add r24,r18 |
120 00f0 931F adc r25,r19 |
121 00f2 A41F adc r26,r20 |
122 00f4 B51F adc r27,r21 |
123 00f6 8093 0000 sts Mess_Integral_Gier2,r24 |
124 00fa 9093 0000 sts (Mess_Integral_Gier2)+1,r25 |
125 00fe A093 0000 sts (Mess_Integral_Gier2)+2,r26 |
126 0102 B093 0000 sts (Mess_Integral_Gier2)+3,r27 |
127 0106 81E0 ldi r24,lo8(1) |
128 0108 8093 0000 sts kanal.2040,r24 |
129 010c 8091 0000 lds r24,ZaehlMessungen |
130 0110 9091 0000 lds r25,(ZaehlMessungen)+1 |
131 0114 0196 adiw r24,1 |
132 0116 9093 0000 sts (ZaehlMessungen)+1,r25 |
133 011a 8093 0000 sts ZaehlMessungen,r24 |
134 011e 00C0 rjmp .L14 |
135 .L6: |
136 0120 6091 7800 lds r22,120 |
137 0124 7091 7900 lds r23,(120)+1 |
138 0128 8091 0000 lds r24,AdNeutralRoll |
139 012c 9091 0000 lds r25,(AdNeutralRoll)+1 |
140 0130 681B sub r22,r24 |
141 0132 790B sbc r23,r25 |
142 0134 8091 0000 lds r24,Mess_IntegralRoll |
143 0138 9091 0000 lds r25,(Mess_IntegralRoll)+1 |
144 013c A091 0000 lds r26,(Mess_IntegralRoll)+2 |
145 0140 B091 0000 lds r27,(Mess_IntegralRoll)+3 |
146 0144 9B01 movw r18,r22 |
147 0146 4427 clr r20 |
148 0148 37FD sbrc r19,7 |
149 014a 4095 com r20 |
150 014c 542F mov r21,r20 |
151 014e 820F add r24,r18 |
152 0150 931F adc r25,r19 |
153 0152 A41F adc r26,r20 |
154 0154 B51F adc r27,r21 |
155 0156 8093 0000 sts Mess_IntegralRoll,r24 |
156 015a 9093 0000 sts (Mess_IntegralRoll)+1,r25 |
157 015e A093 0000 sts (Mess_IntegralRoll)+2,r26 |
158 0162 B093 0000 sts (Mess_IntegralRoll)+3,r27 |
159 0166 8091 0000 lds r24,Mess_IntegralRoll2 |
160 016a 9091 0000 lds r25,(Mess_IntegralRoll2)+1 |
161 016e A091 0000 lds r26,(Mess_IntegralRoll2)+2 |
162 0172 B091 0000 lds r27,(Mess_IntegralRoll2)+3 |
163 0176 820F add r24,r18 |
164 0178 931F adc r25,r19 |
165 017a A41F adc r26,r20 |
166 017c B51F adc r27,r21 |
167 017e 8093 0000 sts Mess_IntegralRoll2,r24 |
168 0182 9093 0000 sts (Mess_IntegralRoll2)+1,r25 |
169 0186 A093 0000 sts (Mess_IntegralRoll2)+2,r26 |
170 018a B093 0000 sts (Mess_IntegralRoll2)+3,r27 |
171 018e 8091 7800 lds r24,120 |
172 0192 9091 7900 lds r25,(120)+1 |
173 0196 0A97 sbiw r24,10 |
174 0198 00F4 brsh .L15 |
175 019a 64E4 ldi r22,lo8(-700) |
176 019c 7DEF ldi r23,hi8(-700) |
177 .L15: |
178 019e 8091 7800 lds r24,120 |
179 01a2 9091 7900 lds r25,(120)+1 |
180 01a6 895E subi r24,lo8(1001) |
181 01a8 9340 sbci r25,hi8(1001) |
182 01aa 00F0 brlo .L17 |
183 01ac 6CEB ldi r22,lo8(700) |
184 01ae 72E0 ldi r23,hi8(700) |
185 .L17: |
186 01b0 8091 0000 lds r24,AccumulateRoll |
187 01b4 9091 0000 lds r25,(AccumulateRoll)+1 |
188 01b8 860F add r24,r22 |
189 01ba 971F adc r25,r23 |
190 01bc 9093 0000 sts (AccumulateRoll)+1,r25 |
191 01c0 8093 0000 sts AccumulateRoll,r24 |
192 01c4 8091 0000 lds r24,MessanzahlRoll |
193 01c8 8F5F subi r24,lo8(-(1)) |
194 01ca 8093 0000 sts MessanzahlRoll,r24 |
195 01ce 82E0 ldi r24,lo8(2) |
196 01d0 00C0 rjmp .L39 |
197 .L7: |
198 01d2 6091 7800 lds r22,120 |
199 01d6 7091 7900 lds r23,(120)+1 |
200 01da 8091 0000 lds r24,AdNeutralNick |
201 01de 9091 0000 lds r25,(AdNeutralNick)+1 |
202 01e2 681B sub r22,r24 |
203 01e4 790B sbc r23,r25 |
204 01e6 8091 0000 lds r24,Mess_IntegralNick |
205 01ea 9091 0000 lds r25,(Mess_IntegralNick)+1 |
206 01ee A091 0000 lds r26,(Mess_IntegralNick)+2 |
207 01f2 B091 0000 lds r27,(Mess_IntegralNick)+3 |
208 01f6 9B01 movw r18,r22 |
209 01f8 4427 clr r20 |
210 01fa 37FD sbrc r19,7 |
211 01fc 4095 com r20 |
212 01fe 542F mov r21,r20 |
213 0200 820F add r24,r18 |
214 0202 931F adc r25,r19 |
215 0204 A41F adc r26,r20 |
216 0206 B51F adc r27,r21 |
217 0208 8093 0000 sts Mess_IntegralNick,r24 |
218 020c 9093 0000 sts (Mess_IntegralNick)+1,r25 |
219 0210 A093 0000 sts (Mess_IntegralNick)+2,r26 |
220 0214 B093 0000 sts (Mess_IntegralNick)+3,r27 |
221 0218 8091 0000 lds r24,Mess_IntegralNick2 |
222 021c 9091 0000 lds r25,(Mess_IntegralNick2)+1 |
223 0220 A091 0000 lds r26,(Mess_IntegralNick2)+2 |
224 0224 B091 0000 lds r27,(Mess_IntegralNick2)+3 |
225 0228 820F add r24,r18 |
226 022a 931F adc r25,r19 |
227 022c A41F adc r26,r20 |
228 022e B51F adc r27,r21 |
229 0230 8093 0000 sts Mess_IntegralNick2,r24 |
230 0234 9093 0000 sts (Mess_IntegralNick2)+1,r25 |
231 0238 A093 0000 sts (Mess_IntegralNick2)+2,r26 |
232 023c B093 0000 sts (Mess_IntegralNick2)+3,r27 |
233 0240 8091 7800 lds r24,120 |
234 0244 9091 7900 lds r25,(120)+1 |
235 0248 0A97 sbiw r24,10 |
236 024a 00F4 brsh .L19 |
237 024c 64E4 ldi r22,lo8(-700) |
238 024e 7DEF ldi r23,hi8(-700) |
239 .L19: |
240 0250 8091 7800 lds r24,120 |
241 0254 9091 7900 lds r25,(120)+1 |
242 0258 895E subi r24,lo8(1001) |
243 025a 9340 sbci r25,hi8(1001) |
244 025c 00F0 brlo .L21 |
245 025e 6CEB ldi r22,lo8(700) |
246 0260 72E0 ldi r23,hi8(700) |
247 .L21: |
248 0262 8091 0000 lds r24,AccumulateNick |
249 0266 9091 0000 lds r25,(AccumulateNick)+1 |
250 026a 860F add r24,r22 |
251 026c 971F adc r25,r23 |
252 026e 9093 0000 sts (AccumulateNick)+1,r25 |
253 0272 8093 0000 sts AccumulateNick,r24 |
254 0276 8091 0000 lds r24,MessanzahlNick |
255 027a 8F5F subi r24,lo8(-(1)) |
256 027c 8093 0000 sts MessanzahlNick,r24 |
257 0280 84E0 ldi r24,lo8(4) |
258 .L39: |
259 0282 8093 0000 sts kanal.2040,r24 |
260 0286 00C0 rjmp .L14 |
261 .L8: |
262 0288 4091 0000 lds r20,UBat |
263 028c 5091 0000 lds r21,(UBat)+1 |
264 0290 8091 7800 lds r24,120 |
265 0294 9091 7900 lds r25,(120)+1 |
266 0298 9A01 movw r18,r20 |
267 029a 220F lsl r18 |
268 029c 331F rol r19 |
269 029e 240F add r18,r20 |
270 02a0 351F adc r19,r21 |
271 02a2 63E0 ldi r22,lo8(3) |
272 02a4 70E0 ldi r23,hi8(3) |
273 02a6 0E94 0000 call __udivmodhi4 |
274 02aa 260F add r18,r22 |
275 02ac 371F adc r19,r23 |
276 02ae 3695 lsr r19 |
277 02b0 2795 ror r18 |
278 02b2 3695 lsr r19 |
279 02b4 2795 ror r18 |
280 02b6 3093 0000 sts (UBat)+1,r19 |
281 02ba 2093 0000 sts UBat,r18 |
282 02be 86E0 ldi r24,lo8(6) |
283 02c0 00C0 rjmp .L39 |
284 .L9: |
285 02c2 8091 0000 lds r24,NeutralAccY |
286 02c6 9091 0000 lds r25,(NeutralAccY)+1 |
287 02ca 2091 7800 lds r18,120 |
288 02ce 3091 7900 lds r19,(120)+1 |
289 02d2 821B sub r24,r18 |
290 02d4 930B sbc r25,r19 |
291 02d6 9093 0000 sts (Aktuell_ay)+1,r25 |
292 02da 8093 0000 sts Aktuell_ay,r24 |
293 02de 8091 0000 lds r24,accumulate_AccRoll |
294 02e2 9091 0000 lds r25,(accumulate_AccRoll)+1 |
295 02e6 2091 0000 lds r18,Aktuell_ay |
296 02ea 3091 0000 lds r19,(Aktuell_ay)+1 |
297 02ee 820F add r24,r18 |
298 02f0 931F adc r25,r19 |
299 02f2 9093 0000 sts (accumulate_AccRoll)+1,r25 |
300 02f6 8093 0000 sts accumulate_AccRoll,r24 |
301 02fa 8091 0000 lds r24,messanzahl_AccRoll |
302 02fe 8F5F subi r24,lo8(-(1)) |
303 0300 8093 0000 sts messanzahl_AccRoll,r24 |
304 0304 87E0 ldi r24,lo8(7) |
305 0306 00C0 rjmp .L39 |
306 .L10: |
307 0308 8091 7800 lds r24,120 |
308 030c 9091 7900 lds r25,(120)+1 |
309 0310 2091 0000 lds r18,NeutralAccX |
310 0314 3091 0000 lds r19,(NeutralAccX)+1 |
311 0318 821B sub r24,r18 |
312 031a 930B sbc r25,r19 |
313 031c 9093 0000 sts (Aktuell_ax)+1,r25 |
314 0320 8093 0000 sts Aktuell_ax,r24 |
315 0324 8091 0000 lds r24,accumulate_AccNick |
316 0328 9091 0000 lds r25,(accumulate_AccNick)+1 |
317 032c 2091 0000 lds r18,Aktuell_ax |
318 0330 3091 0000 lds r19,(Aktuell_ax)+1 |
319 0334 820F add r24,r18 |
320 0336 931F adc r25,r19 |
321 0338 9093 0000 sts (accumulate_AccNick)+1,r25 |
322 033c 8093 0000 sts accumulate_AccNick,r24 |
323 0340 8091 0000 lds r24,messanzahl_AccNick |
324 0344 8F5F subi r24,lo8(-(1)) |
325 0346 8093 0000 sts messanzahl_AccNick,r24 |
326 034a 4093 0000 sts kanal.2040,r20 |
327 034e 86E0 ldi r24,lo8(6) |
328 0350 00C0 rjmp .L40 |
329 .L11: |
330 0352 6091 7800 lds r22,120 |
331 0356 7091 7900 lds r23,(120)+1 |
332 035a E090 0000 lds r14,NeutralAccZ |
333 035e F090 0000 lds r15,(NeutralAccZ)+1 |
334 0362 0091 0000 lds r16,(NeutralAccZ)+2 |
335 0366 1091 0000 lds r17,(NeutralAccZ)+3 |
336 036a 8827 clr r24 |
337 036c 77FD sbrc r23,7 |
338 036e 8095 com r24 |
339 0370 982F mov r25,r24 |
340 0372 0E94 0000 call __floatsisf |
341 0376 A801 movw r20,r16 |
342 0378 9701 movw r18,r14 |
343 037a 0E94 0000 call __subsf3 |
344 037e 0E94 0000 call __fixsfsi |
345 0382 7093 0000 sts (accumulate_AccHoch)+1,r23 |
346 0386 6093 0000 sts accumulate_AccHoch,r22 |
347 038a 2091 0000 lds r18,accumulate_AccHoch |
348 038e 3091 0000 lds r19,(accumulate_AccHoch)+1 |
349 0392 E091 0000 lds r30,Aktuell_ay |
350 0396 F091 0000 lds r31,(Aktuell_ay)+1 |
351 039a 8091 0000 lds r24,Aktuell_ax |
352 039e 9091 0000 lds r25,(Aktuell_ax)+1 |
353 03a2 97FF sbrs r25,7 |
354 03a4 00C0 rjmp .L23 |
355 03a6 9095 com r25 |
356 03a8 8195 neg r24 |
357 03aa 9F4F sbci r25,lo8(-1) |
358 .L23: |
359 03ac 64E0 ldi r22,lo8(4) |
360 03ae 70E0 ldi r23,hi8(4) |
361 03b0 0E94 0000 call __divmodhi4 |
362 03b4 EB01 movw r28,r22 |
363 03b6 CF01 movw r24,r30 |
364 03b8 F7FF sbrs r31,7 |
365 03ba 00C0 rjmp .L24 |
366 03bc 9095 com r25 |
367 03be 8195 neg r24 |
368 03c0 9F4F sbci r25,lo8(-1) |
369 .L24: |
370 03c2 64E0 ldi r22,lo8(4) |
371 03c4 70E0 ldi r23,hi8(4) |
372 03c6 0E94 0000 call __divmodhi4 |
373 03ca 260F add r18,r22 |
374 03cc 371F adc r19,r23 |
375 03ce 2C0F add r18,r28 |
376 03d0 3D1F adc r19,r29 |
377 03d2 3093 0000 sts (accumulate_AccHoch)+1,r19 |
378 03d6 2093 0000 sts accumulate_AccHoch,r18 |
379 03da 8091 0000 lds r24,accumulate_AccHoch |
380 03de 9091 0000 lds r25,(accumulate_AccHoch)+1 |
381 03e2 0297 sbiw r24,2 |
382 03e4 04F0 brlt .L25 |
383 03e6 6091 0000 lds r22,NeutralAccZ |
384 03ea 7091 0000 lds r23,(NeutralAccZ)+1 |
385 03ee 8091 0000 lds r24,(NeutralAccZ)+2 |
386 03f2 9091 0000 lds r25,(NeutralAccZ)+3 |
387 03f6 20E0 ldi r18,lo8(0x44480000) |
388 03f8 30E0 ldi r19,hi8(0x44480000) |
389 03fa 48E4 ldi r20,hlo8(0x44480000) |
390 03fc 54E4 ldi r21,hhi8(0x44480000) |
391 03fe 0E94 0000 call __ltsf2 |
392 0402 8823 tst r24 |
393 0404 04F0 brlt .+2 |
394 0406 00C0 rjmp .L27 |
395 0408 6091 0000 lds r22,NeutralAccZ |
396 040c 7091 0000 lds r23,(NeutralAccZ)+1 |
397 0410 8091 0000 lds r24,(NeutralAccZ)+2 |
398 0414 9091 0000 lds r25,(NeutralAccZ)+3 |
399 0418 2AE0 ldi r18,lo8(0x3ca3d70a) |
400 041a 37ED ldi r19,hi8(0x3ca3d70a) |
401 041c 43EA ldi r20,hlo8(0x3ca3d70a) |
402 041e 5CE3 ldi r21,hhi8(0x3ca3d70a) |
403 0420 0E94 0000 call __addsf3 |
404 0424 00C0 rjmp .L38 |
405 .L25: |
406 0426 8091 0000 lds r24,accumulate_AccHoch |
407 042a 9091 0000 lds r25,(accumulate_AccHoch)+1 |
408 042e 8F5F subi r24,lo8(-1) |
409 0430 9F4F sbci r25,hi8(-1) |
410 0432 04F4 brge .L27 |
411 0434 6091 0000 lds r22,NeutralAccZ |
412 0438 7091 0000 lds r23,(NeutralAccZ)+1 |
413 043c 8091 0000 lds r24,(NeutralAccZ)+2 |
414 0440 9091 0000 lds r25,(NeutralAccZ)+3 |
415 0444 20E0 ldi r18,lo8(0x44160000) |
416 0446 30E0 ldi r19,hi8(0x44160000) |
417 0448 46E1 ldi r20,hlo8(0x44160000) |
418 044a 54E4 ldi r21,hhi8(0x44160000) |
419 044c 0E94 0000 call __gtsf2 |
420 0450 1816 cp __zero_reg__,r24 |
421 0452 04F4 brge .L27 |
422 0454 6091 0000 lds r22,NeutralAccZ |
423 0458 7091 0000 lds r23,(NeutralAccZ)+1 |
424 045c 8091 0000 lds r24,(NeutralAccZ)+2 |
425 0460 9091 0000 lds r25,(NeutralAccZ)+3 |
426 0464 2AE0 ldi r18,lo8(0x3ca3d70a) |
427 0466 37ED ldi r19,hi8(0x3ca3d70a) |
428 0468 43EA ldi r20,hlo8(0x3ca3d70a) |
429 046a 5CE3 ldi r21,hhi8(0x3ca3d70a) |
430 046c 0E94 0000 call __subsf3 |
431 .L38: |
432 0470 6093 0000 sts NeutralAccZ,r22 |
433 0474 7093 0000 sts (NeutralAccZ)+1,r23 |
434 0478 8093 0000 sts (NeutralAccZ)+2,r24 |
435 047c 9093 0000 sts (NeutralAccZ)+3,r25 |
436 .L27: |
437 0480 81E0 ldi r24,lo8(1) |
438 0482 8093 0000 sts messanzahl_AccHoch,r24 |
439 0486 8091 7800 lds r24,120 |
440 048a 9091 7900 lds r25,(120)+1 |
441 048e 9093 0000 sts (Aktuell_az)+1,r25 |
442 0492 8093 0000 sts Aktuell_az,r24 |
443 0496 2091 0000 lds r18,Mess_Integral_Hoch |
444 049a 3091 0000 lds r19,(Mess_Integral_Hoch)+1 |
445 049e 4091 0000 lds r20,(Mess_Integral_Hoch)+2 |
446 04a2 5091 0000 lds r21,(Mess_Integral_Hoch)+3 |
447 04a6 8091 0000 lds r24,accumulate_AccHoch |
448 04aa 9091 0000 lds r25,(accumulate_AccHoch)+1 |
449 04ae AA27 clr r26 |
450 04b0 97FD sbrc r25,7 |
451 04b2 A095 com r26 |
452 04b4 BA2F mov r27,r26 |
453 04b6 280F add r18,r24 |
454 04b8 391F adc r19,r25 |
455 04ba 4A1F adc r20,r26 |
456 04bc 5B1F adc r21,r27 |
457 04be 2093 0000 sts Mess_Integral_Hoch,r18 |
458 04c2 3093 0000 sts (Mess_Integral_Hoch)+1,r19 |
459 04c6 4093 0000 sts (Mess_Integral_Hoch)+2,r20 |
460 04ca 5093 0000 sts (Mess_Integral_Hoch)+3,r21 |
461 04ce E090 0000 lds r14,Mess_Integral_Hoch |
462 04d2 F090 0000 lds r15,(Mess_Integral_Hoch)+1 |
463 04d6 0091 0000 lds r16,(Mess_Integral_Hoch)+2 |
464 04da 1091 0000 lds r17,(Mess_Integral_Hoch)+3 |
465 04de 6091 0000 lds r22,Mess_Integral_Hoch |
466 04e2 7091 0000 lds r23,(Mess_Integral_Hoch)+1 |
467 04e6 8091 0000 lds r24,(Mess_Integral_Hoch)+2 |
468 04ea 9091 0000 lds r25,(Mess_Integral_Hoch)+3 |
469 04ee 20E0 ldi r18,lo8(1024) |
470 04f0 34E0 ldi r19,hi8(1024) |
471 04f2 40E0 ldi r20,hlo8(1024) |
472 04f4 50E0 ldi r21,hhi8(1024) |
473 04f6 0E94 0000 call __divmodsi4 |
474 04fa E21A sub r14,r18 |
475 04fc F30A sbc r15,r19 |
476 04fe 040B sbc r16,r20 |
477 0500 150B sbc r17,r21 |
478 0502 E092 0000 sts Mess_Integral_Hoch,r14 |
479 0506 F092 0000 sts (Mess_Integral_Hoch)+1,r15 |
480 050a 0093 0000 sts (Mess_Integral_Hoch)+2,r16 |
481 050e 1093 0000 sts (Mess_Integral_Hoch)+3,r17 |
482 0512 83E0 ldi r24,lo8(3) |
483 0514 8093 0000 sts kanal.2040,r24 |
484 0518 87E0 ldi r24,lo8(7) |
485 .L40: |
486 051a 8093 0000 sts state.2041,r24 |
487 051e 00C0 rjmp .L14 |
488 .L12: |
489 0520 8091 0000 lds r24,tmpLuftdruck |
490 0524 9091 0000 lds r25,(tmpLuftdruck)+1 |
491 0528 2091 7800 lds r18,120 |
492 052c 3091 7900 lds r19,(120)+1 |
493 0530 820F add r24,r18 |
494 0532 931F adc r25,r19 |
495 0534 9093 0000 sts (tmpLuftdruck)+1,r25 |
496 0538 8093 0000 sts tmpLuftdruck,r24 |
497 053c 8091 0000 lds r24,messanzahl_Druck |
498 0540 8F5F subi r24,lo8(-(1)) |
499 0542 8093 0000 sts messanzahl_Druck,r24 |
500 0546 8091 0000 lds r24,messanzahl_Druck |
501 054a 8530 cpi r24,lo8(5) |
502 054c 00F4 brsh .+2 |
503 054e 00C0 rjmp .L37 |
504 0550 8091 7800 lds r24,120 |
505 0554 9091 7900 lds r25,(120)+1 |
506 0558 9093 0000 sts (MessLuftdruck)+1,r25 |
507 055c 8093 0000 sts MessLuftdruck,r24 |
508 0560 1092 0000 sts messanzahl_Druck,__zero_reg__ |
509 0564 8091 0000 lds r24,StartLuftdruck |
510 0568 9091 0000 lds r25,(StartLuftdruck)+1 |
511 056c 2091 0000 lds r18,tmpLuftdruck |
512 0570 3091 0000 lds r19,(tmpLuftdruck)+1 |
513 0574 821B sub r24,r18 |
514 0576 930B sbc r25,r19 |
515 0578 2091 0000 lds r18,HoehenWert |
516 057c 3091 0000 lds r19,(HoehenWert)+1 |
517 0580 821B sub r24,r18 |
518 0582 930B sbc r25,r19 |
519 0584 9093 0000 sts (HoeheD)+1,r25 |
520 0588 8093 0000 sts HoeheD,r24 |
521 058c 6091 0000 lds r22,tmpLuftdruck |
522 0590 7091 0000 lds r23,(tmpLuftdruck)+1 |
523 0594 E090 0000 lds r14,Luftdruck |
524 0598 F090 0000 lds r15,(Luftdruck)+1 |
525 059c 0091 0000 lds r16,(Luftdruck)+2 |
526 05a0 1091 0000 lds r17,(Luftdruck)+3 |
527 05a4 8827 clr r24 |
528 05a6 77FD sbrc r23,7 |
529 05a8 8095 com r24 |
530 05aa 982F mov r25,r24 |
531 05ac A801 movw r20,r16 |
532 05ae 9701 movw r18,r14 |
533 05b0 220F lsl r18 |
534 05b2 331F rol r19 |
535 05b4 441F rol r20 |
536 05b6 551F rol r21 |
537 05b8 2E0D add r18,r14 |
538 05ba 3F1D adc r19,r15 |
539 05bc 401F adc r20,r16 |
540 05be 511F adc r21,r17 |
541 05c0 620F add r22,r18 |
542 05c2 731F adc r23,r19 |
543 05c4 841F adc r24,r20 |
544 05c6 951F adc r25,r21 |
545 05c8 24E0 ldi r18,lo8(4) |
546 05ca 30E0 ldi r19,hi8(4) |
547 05cc 40E0 ldi r20,hlo8(4) |
548 05ce 50E0 ldi r21,hhi8(4) |
549 05d0 0E94 0000 call __divmodsi4 |
550 05d4 2093 0000 sts Luftdruck,r18 |
551 05d8 3093 0000 sts (Luftdruck)+1,r19 |
552 05dc 4093 0000 sts (Luftdruck)+2,r20 |
553 05e0 5093 0000 sts (Luftdruck)+3,r21 |
554 05e4 2091 0000 lds r18,StartLuftdruck |
555 05e8 3091 0000 lds r19,(StartLuftdruck)+1 |
556 05ec 8091 0000 lds r24,Luftdruck |
557 05f0 9091 0000 lds r25,(Luftdruck)+1 |
558 05f4 A091 0000 lds r26,(Luftdruck)+2 |
559 05f8 B091 0000 lds r27,(Luftdruck)+3 |
560 05fc 281B sub r18,r24 |
561 05fe 390B sbc r19,r25 |
562 0600 3093 0000 sts (HoehenWert)+1,r19 |
563 0604 2093 0000 sts HoehenWert,r18 |
564 0608 1092 0000 sts (tmpLuftdruck)+1,__zero_reg__ |
565 060c 1092 0000 sts tmpLuftdruck,__zero_reg__ |
566 .L37: |
567 0610 1092 0000 sts kanal.2040,__zero_reg__ |
568 0614 1092 0000 sts state.2041,__zero_reg__ |
569 .L14: |
570 0618 8091 0000 lds r24,kanal.2040 |
571 061c 8093 7C00 sts 124,r24 |
572 0620 8FEE ldi r24,lo8(-17) |
573 0622 8093 7A00 sts 122,r24 |
574 /* epilogue: frame size=0 */ |
575 0626 FF91 pop r31 |
576 0628 EF91 pop r30 |
577 062a DF91 pop r29 |
578 062c CF91 pop r28 |
579 062e BF91 pop r27 |
580 0630 AF91 pop r26 |
581 0632 9F91 pop r25 |
582 0634 8F91 pop r24 |
583 0636 7F91 pop r23 |
584 0638 6F91 pop r22 |
585 063a 5F91 pop r21 |
586 063c 4F91 pop r20 |
587 063e 3F91 pop r19 |
588 0640 2F91 pop r18 |
589 0642 1F91 pop r17 |
590 0644 0F91 pop r16 |
591 0646 FF90 pop r15 |
592 0648 EF90 pop r14 |
593 064a 0F90 pop __tmp_reg__ |
594 064c 0FBE out __SREG__,__tmp_reg__ |
595 064e 0F90 pop __tmp_reg__ |
596 0650 1F90 pop __zero_reg__ |
597 0652 1895 reti |
598 /* epilogue end (size=23) */ |
599 /* function __vector_24 size 811 (765) */ |
601 .global SucheLuftruckOffset |
603 SucheLuftruckOffset: |
604 /* prologue: frame size=0 */ |
605 0654 CF93 push r28 |
606 0656 DF93 push r29 |
607 /* prologue end (size=2) */ |
608 0658 C0E0 ldi r28,lo8(0) |
609 065a D0E0 ldi r29,hi8(0) |
610 .L42: |
611 065c C7BD out 71-0x20,r28 |
612 065e 82E3 ldi r24,lo8(50) |
613 0660 90E0 ldi r25,hi8(50) |
614 0662 0E94 0000 call Delay_ms |
615 0666 80E0 ldi r24,lo8(__c.2026) |
616 0668 90E0 ldi r25,hi8(__c.2026) |
617 066a 9F93 push r25 |
618 066c 8F93 push r24 |
619 066e 1F92 push __zero_reg__ |
620 0670 0E94 0000 call _printf_P |
621 0674 8091 0000 lds r24,MessLuftdruck |
622 0678 9091 0000 lds r25,(MessLuftdruck)+1 |
623 067c 0F90 pop __tmp_reg__ |
624 067e 0F90 pop __tmp_reg__ |
625 0680 0F90 pop __tmp_reg__ |
626 0682 8458 subi r24,lo8(900) |
627 0684 9340 sbci r25,hi8(900) |
628 0686 00F0 brlo .L43 |
629 0688 2196 adiw r28,1 |
630 068a CA3F cpi r28,250 |
631 068c D105 cpc r29,__zero_reg__ |
632 068e 01F4 brne .L42 |
633 .L43: |
634 0690 C093 0000 sts DruckOffsetSetting,r28 |
635 0694 88EC ldi r24,lo8(200) |
636 0696 90E0 ldi r25,hi8(200) |
637 0698 0E94 0000 call Delay_ms |
638 /* epilogue: frame size=0 */ |
639 069c DF91 pop r29 |
640 069e CF91 pop r28 |
641 06a0 0895 ret |
642 /* epilogue end (size=3) */ |
643 /* function SucheLuftruckOffset size 40 (35) */ |
645 .global UBat |
646 .data |
649 UBat: |
650 0000 6400 .word 100 |
651 .global AccumulateNick |
652 .global AccumulateNick |
653 .section .bss |
656 AccumulateNick: |
657 0000 0000 .skip 2,0 |
658 .global AccumulateRoll |
659 .global AccumulateRoll |
662 AccumulateRoll: |
663 0002 0000 .skip 2,0 |
664 .global AccumulateGier |
665 .global AccumulateGier |
668 AccumulateGier: |
669 0004 0000 .skip 2,0 |
670 .global accumulate_AccRoll |
671 .global accumulate_AccRoll |
674 accumulate_AccRoll: |
675 0006 0000 .skip 2,0 |
676 .global accumulate_AccNick |
677 .global accumulate_AccNick |
680 accumulate_AccNick: |
681 0008 0000 .skip 2,0 |
682 .global accumulate_AccHoch |
683 .global accumulate_AccHoch |
686 accumulate_AccHoch: |
687 000a 0000 .skip 2,0 |
688 .global MessanzahlNick |
689 .global MessanzahlNick |
692 MessanzahlNick: |
693 000c 00 .skip 1,0 |
694 .global MessanzahlRoll |
695 .global MessanzahlRoll |
698 MessanzahlRoll: |
699 000d 00 .skip 1,0 |
700 .global MessanzahlGier |
701 .global MessanzahlGier |
704 MessanzahlGier: |
705 000e 00 .skip 1,0 |
706 .global messanzahl_AccNick |
707 .global messanzahl_AccNick |
710 messanzahl_AccNick: |
711 000f 00 .skip 1,0 |
712 .global messanzahl_AccRoll |
713 .global messanzahl_AccRoll |
716 messanzahl_AccRoll: |
717 0010 00 .skip 1,0 |
718 .global messanzahl_AccHoch |
719 .global messanzahl_AccHoch |
722 messanzahl_AccHoch: |
723 0011 00 .skip 1,0 |
724 .global Luftdruck |
725 .data |
728 Luftdruck: |
729 0002 00 .byte 0 |
730 0003 7D .byte 125 |
731 0004 00 .byte 0 |
732 0005 00 .byte 0 |
733 .global MessLuftdruck |
736 MessLuftdruck: |
737 0006 FF03 .word 1023 |
738 .global HoeheD |
739 .global HoeheD |
740 .section .bss |
743 HoeheD: |
744 0012 0000 .skip 2,0 |
745 .global ZaehlMessungen |
746 .global ZaehlMessungen |
749 ZaehlMessungen: |
750 0014 0000 .skip 2,0 |
751 .lcomm state.2041,1 |
752 .lcomm kanal.2040,1 |
753 .section .progmem.data,"a",@progbits |
756 __c.2026: |
757 0000 2E00 .string "." |
758 .comm DiffNick,2,1 |
759 .comm DiffRoll,2,1 |
760 .comm SenderOkay,1,1 |
761 .comm CosinusNickWinkel,1,1 |
762 .comm CosinusRollWinkel,1,1 |
763 .comm durchschnitt_northing,4,1 |
764 .comm durchschnitt_easting,4,1 |
765 .comm P_GPS_Verstaerkung,2,1 |
766 .comm D_GPS_Verstaerkung,2,1 |
767 .comm Aktuell_Nick,2,1 |
768 .comm Aktuell_Roll,2,1 |
769 .comm Aktuell_Gier,2,1 |
770 .comm Aktuell_ax,2,1 |
771 .comm Aktuell_ay,2,1 |
772 .comm Aktuell_az,2,1 |
773 .comm messanzahl_Druck,1,1 |
774 .comm DruckOffsetSetting,1,1 |
775 .comm StartLuftdruck,2,1 |
776 .comm RemoteTasten,1,1 |
777 .comm Timeout,1,1 |
778 .comm IntegralNick,4,1 |
779 .comm IntegralNick2,4,1 |
780 .comm IntegralRoll,4,1 |
781 .comm IntegralRoll2,4,1 |
782 .comm Mess_IntegralNick,4,1 |
783 .comm Mess_IntegralNick2,4,1 |
784 .comm Mess_IntegralRoll,4,1 |
785 .comm Mess_IntegralRoll2,4,1 |
786 .comm Integral_Gier,4,1 |
787 .comm Mess_Integral_Gier,4,1 |
788 .comm h,1,1 |
789 .comm m,1,1 |
790 .comm s,1,1 |
791 .comm Motor_Vorne,1,1 |
792 .comm Motor_Hinten,1,1 |
793 .comm Motor_Rechts,1,1 |
794 .comm Motor_Links,1,1 |
795 .comm Count,1,1 |
796 .comm MotorWert,5,1 |
797 .comm tmpLuftdruck,2,1 |
798 /* File "analog.c": code 857 = 0x0359 ( 805), prologues 25, epilogues 27 */ |
DEFINED SYMBOLS |
*ABS*:00000000 analog.c |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:3 *ABS*:0000003f __SREG__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:4 *ABS*:0000003e __SP_H__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:5 *ABS*:0000003d __SP_L__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:6 *ABS*:00000000 __tmp_reg__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:7 *ABS*:00000001 __zero_reg__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:13 .text:00000000 ADC_Init |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:26 .text:0000000c __vector_24 |
.bss:00000016 state.2041 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:668 .bss:00000004 AccumulateGier |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:704 .bss:0000000e MessanzahlGier |
*COM*:00000004 Mess_Integral_Gier |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:751 .bss:00000017 kanal.2040 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:749 .bss:00000014 ZaehlMessungen |
*COM*:00000004 Mess_IntegralRoll |
*COM*:00000004 Mess_IntegralRoll2 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:662 .bss:00000002 AccumulateRoll |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:698 .bss:0000000d MessanzahlRoll |
*COM*:00000004 Mess_IntegralNick |
*COM*:00000004 Mess_IntegralNick2 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:656 .bss:00000000 AccumulateNick |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:692 .bss:0000000c MessanzahlNick |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:649 .data:00000000 UBat |
*COM*:00000002 Aktuell_ay |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:674 .bss:00000006 accumulate_AccRoll |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:716 .bss:00000010 messanzahl_AccRoll |
*COM*:00000002 Aktuell_ax |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:680 .bss:00000008 accumulate_AccNick |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:710 .bss:0000000f messanzahl_AccNick |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:686 .bss:0000000a accumulate_AccHoch |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:722 .bss:00000011 messanzahl_AccHoch |
*COM*:00000002 Aktuell_az |
*COM*:00000002 tmpLuftdruck |
*COM*:00000001 messanzahl_Druck |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:736 .data:00000006 MessLuftdruck |
*COM*:00000002 StartLuftdruck |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:743 .bss:00000012 HoeheD |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:728 .data:00000002 Luftdruck |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:603 .text:00000654 SucheLuftruckOffset |
C:\DOKUME~1\none\LOKALE~1\Temp/ccQFQ6lN.s:756 .progmem.data:00000000 __c.2026 |
*COM*:00000001 DruckOffsetSetting |
*COM*:00000002 DiffNick |
*COM*:00000002 DiffRoll |
*COM*:00000001 SenderOkay |
*COM*:00000001 CosinusNickWinkel |
*COM*:00000001 CosinusRollWinkel |
*COM*:00000004 durchschnitt_northing |
*COM*:00000004 durchschnitt_easting |
*COM*:00000002 P_GPS_Verstaerkung |
*COM*:00000002 D_GPS_Verstaerkung |
*COM*:00000002 Aktuell_Nick |
*COM*:00000002 Aktuell_Roll |
*COM*:00000002 Aktuell_Gier |
*COM*:00000001 RemoteTasten |
*COM*:00000001 Timeout |
*COM*:00000004 IntegralNick |
*COM*:00000004 IntegralNick2 |
*COM*:00000004 IntegralRoll |
*COM*:00000004 IntegralRoll2 |
*COM*:00000004 Integral_Gier |
*COM*:00000001 h |
*COM*:00000001 m |
*COM*:00000001 s |
*COM*:00000001 Motor_Vorne |
*COM*:00000001 Motor_Hinten |
*COM*:00000001 Motor_Rechts |
*COM*:00000001 Motor_Links |
*COM*:00000001 Count |
*COM*:00000005 MotorWert |
UNDEFINED SYMBOLS |
__do_copy_data |
__do_clear_bss |
AdNeutralGier |
Mess_Integral_Gier2 |
AdNeutralRoll |
AdNeutralNick |
__udivmodhi4 |
NeutralAccY |
NeutralAccX |
NeutralAccZ |
__floatsisf |
__subsf3 |
__fixsfsi |
__divmodhi4 |
__ltsf2 |
__addsf3 |
__gtsf2 |
Mess_Integral_Hoch |
__divmodsi4 |
HoehenWert |
Delay_ms |
_printf_P |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/eeprom.c |
---|
--- alpha/v060JokoGPSpakoxdaMM3/fc.c (nonexistent) |
+++ alpha/v060JokoGPSpakoxdaMM3/fc.c (revision 2762) |
@@ -0,0 +1,905 @@ |
+/*####################################################################################### |
+Flight Control |
+#######################################################################################*/ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Copyright (c) 04.2007 Holger Buss |
+// + Nur für den privaten Gebrauch |
+// + www.MikroKopter.com |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
+// + dass eine Nutzung (auch auszugsweise) nur für den privaten (nicht-kommerziellen) Gebrauch zulässig ist. |
+// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
+// + bzgl. der Nutzungsbedingungen aufzunehmen. |
+// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
+// + Verkauf von Luftbildaufnahmen, usw. |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
+// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
+// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
+// + eindeutig als Ursprung verlinkt werden |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
+// + Benutzung auf eigene Gefahr |
+// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
+// + mit unserer Zustimmung zulässig |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
+// + this list of conditions and the following disclaimer. |
+// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
+// + from this software without specific prior written permission. |
+// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
+// + for non-commercial use (directly or indirectly) |
+// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
+// + with our written permission |
+// + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
+// + clearly linked as origin |
+// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
+// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
+// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
+// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
+// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
+// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
+// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
+// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
+// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
+// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
+// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
+// + POSSIBILITY OF SUCH DAMAGE. |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+#include "main.h" |
+ |
+unsigned char h,m,s; |
+volatile unsigned char Timeout = 0; |
+volatile int MesswertNick,MesswertRoll,MesswertGier; |
+volatile int AdNeutralNick = 0,AdNeutralRoll = 0,AdNeutralGier = 0; |
+volatile int Mittelwert_AccNick, Mittelwert_AccRoll,Mittelwert_AccHoch, NeutralAccX=0, NeutralAccY=0; |
+volatile float NeutralAccZ = 0; |
+unsigned char CosinusNickWinkel = 0, CosinusRollWinkel = 0; |
+volatile long IntegralNick = 0,IntegralNick2 = 0; |
+volatile long IntegralRoll = 0,IntegralRoll2 = 0; |
+volatile long Integral_Gier = 0; |
+volatile long Mess_IntegralNick = 0,Mess_IntegralNick2 = 0; |
+volatile long Mess_IntegralRoll = 0,Mess_IntegralRoll2 = 0; |
+volatile long Mess_Integral_Gier = 0,Mess_Integral_Gier2 = 0; |
+volatile long Mess_Integral_Hoch = 0; |
+volatile int KompassValue = 0; |
+volatile int KompassStartwert = 0; |
+volatile int KompassRichtung = 0; |
+unsigned char MAX_GAS,MIN_GAS; |
+unsigned char Notlandung = 0; |
+unsigned char HoehenReglerAktiv = 0; |
+ |
+unsigned char blinkcount_LED1 = 0;//Hilfszähler für die blinkende LED (310807Kr) |
+unsigned int modell_fliegt_gps = 0;//(030907Kr) |
+unsigned char Limit_D_Anteil = 0;//(210907Kr) |
+ |
+float GyroFaktor; |
+float IntegralFaktor; |
+ |
+volatile int DiffNick,DiffRoll; |
+int Poti1 = 0, Poti2 = 0, Poti3 = 0, Poti4 = 0, Poti5 = 0, Poti6 = 0, Poti7 = 0, Poti8 = 0; |
+volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
+unsigned char MotorWert[5]; |
+volatile unsigned char SenderOkay = 0; |
+int StickNick = 0,StickRoll = 0,StickGier = 0; |
+char MotorenEin = 0; |
+int HoehenWert = 0; |
+int SollHoehe = 0; |
+ |
+float Kp = FAKTOR_P; |
+float Ki = FAKTOR_I; |
+ |
+unsigned char Parameter_Luftdruck_D = 48; // Wert : 0-250 |
+unsigned char Parameter_MaxHoehe = 251; // Wert : 0-250 |
+unsigned char Parameter_Hoehe_P = 16; // Wert : 0-32 |
+unsigned char Parameter_Hoehe_ACC_Wirkung = 58; // Wert : 0-250 |
+unsigned char Parameter_KompassWirkung = 64; // Wert : 0-250 |
+unsigned char Parameter_Gyro_P = 50; // Wert : 10-250 |
+unsigned char Parameter_Gyro_I = 150; // Wert : 0-250 |
+unsigned char Parameter_Gier_P = 2; // Wert : 1-20 |
+unsigned char Parameter_I_Faktor = 10; // Wert : 1-20 |
+unsigned char Parameter_UserParam1 = 0; |
+unsigned char Parameter_UserParam2 = 0; |
+unsigned char Parameter_UserParam3 = 0; |
+unsigned char Parameter_UserParam4 = 0; |
+unsigned char Parameter_ServoNickControl = 100; |
+struct mk_param_struct EE_Parameter; |
+ |
+void Piep(unsigned char Anzahl) |
+{ |
+ while(Anzahl--) |
+ { |
+ if(MotorenEin) return; //auf keinen Fall im Flug! |
+ beeptime = 100; |
+ Delay_ms(250); |
+ } |
+} |
+ |
+//############################################################################ |
+// Nullwerte ermitteln |
+void SetNeutral(void) |
+//############################################################################ |
+{ |
+ unsigned int timer; |
+ NeutralAccX = 0; |
+ NeutralAccY = 0; |
+ NeutralAccZ = 0; |
+ AdNeutralNick = 0; |
+ AdNeutralRoll = 0; |
+ AdNeutralGier = 0; |
+ CalibrierMittelwert(); |
+ timer = SetDelay(5); |
+ while (!CheckDelay(timer)); |
+ CalibrierMittelwert(); |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
+ { |
+ if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset(); |
+ } |
+ AdNeutralNick= abs(MesswertNick); |
+ AdNeutralRoll= abs(MesswertRoll); |
+ AdNeutralGier= abs(MesswertGier); |
+ NeutralAccY = abs(Mittelwert_AccRoll) / ACC_AMPLIFY; |
+ NeutralAccX = abs(Mittelwert_AccNick) / ACC_AMPLIFY; |
+ NeutralAccZ = Aktuell_az; |
+ |
+ Mess_IntegralNick = 0; |
+ Mess_IntegralNick2 = 0; |
+ Mess_IntegralRoll = 0; |
+ Mess_IntegralRoll2 = 0; |
+ Mess_Integral_Gier = 0; |
+ MesswertNick = 0; |
+ MesswertRoll = 0; |
+ MesswertGier = 0; |
+ StartLuftdruck = Luftdruck; |
+ HoeheD = 0; |
+ Mess_Integral_Hoch = 0; |
+ KompassStartwert = KompassValue; |
+ beeptime = 50; |
+} |
+ |
+//############################################################################ |
+// Bildet den Mittelwert aus den Messwerten |
+void Mittelwert(void) |
+//############################################################################ |
+{ |
+ // ADC auschalten, damit die Werte sich nicht während der Berechnung ändern |
+ ANALOG_OFF; |
+ if(MessanzahlNick) (MesswertNick = AccumulateNick / MessanzahlNick); |
+ if(MessanzahlRoll) (MesswertRoll = AccumulateRoll / MessanzahlRoll); |
+ if(MessanzahlGier) (MesswertGier = AccumulateGier / MessanzahlGier); |
+ if(messanzahl_AccNick) Mittelwert_AccNick = ((long)Mittelwert_AccNick * 7 + ((ACC_AMPLIFY * (long)accumulate_AccNick) / messanzahl_AccNick)) / 8L; |
+ if(messanzahl_AccRoll) Mittelwert_AccRoll = ((long)Mittelwert_AccRoll * 7 + ((ACC_AMPLIFY * (long)accumulate_AccRoll) / messanzahl_AccRoll)) / 8L; |
+ if(messanzahl_AccHoch) Mittelwert_AccHoch = ((long)Mittelwert_AccHoch * 7 + ((long)accumulate_AccHoch) / messanzahl_AccHoch) / 8L; |
+ AccumulateNick = 0; MessanzahlNick = 0; |
+ AccumulateRoll = 0; MessanzahlRoll = 0; |
+ AccumulateGier = 0; MessanzahlGier = 0; |
+ accumulate_AccRoll = 0;messanzahl_AccRoll = 0; |
+ accumulate_AccNick = 0;messanzahl_AccNick = 0; |
+ accumulate_AccHoch = 0;messanzahl_AccHoch = 0; |
+ Integral_Gier = Mess_Integral_Gier; |
+// Integral_Gier2 = Mess_Integral_Gier2; |
+ IntegralNick = Mess_IntegralNick; |
+ IntegralRoll = Mess_IntegralRoll; |
+ IntegralNick2 = Mess_IntegralNick2; |
+ IntegralRoll2 = Mess_IntegralRoll2; |
+ // ADC einschalten |
+ ANALOG_ON; |
+ |
+//------------------------------------------------------------------------------ |
+ if(MesswertNick > 200) MesswertNick += 4 * (MesswertNick - 200); |
+ else |
+ if(MesswertNick < -200) MesswertNick += 4 * (MesswertNick + 200); |
+ |
+ if(MesswertRoll > 200) MesswertRoll += 4 * (MesswertRoll - 200); |
+ else |
+ if(MesswertRoll < -200) MesswertRoll += 4 * (MesswertRoll + 200); |
+//------------------------------------------------------------------------------ |
+ if(Poti1 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110) Poti1++; else if(Poti1 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110 && Poti1) Poti1--; |
+ if(Poti2 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110) Poti2++; else if(Poti2 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110 && Poti2) Poti2--; |
+ if(Poti3 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110) Poti3++; else if(Poti3 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110 && Poti3) Poti3--; |
+ if(Poti4 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110) Poti4++; else if(Poti4 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110 && Poti4) Poti4--; |
+ if(Poti5 < PPM_in[9] + 110) Poti5++; else if(Poti5 > PPM_in[9] + 110 && Poti5) Poti5--; |
+ if(Poti6 < PPM_in[10] + 110) Poti6++; else if(Poti6 > PPM_in[10] + 110 && Poti6) Poti6--; |
+ if(Poti7 < PPM_in[11] + 110) Poti7++; else if(Poti7 > PPM_in[11] + 110 && Poti7) Poti7--; |
+ if(Poti8 < PPM_in[12] + 110) Poti8++; else if(Poti8 > PPM_in[12] + 110 && Poti8) Poti8--; |
+ |
+ |
+ if(Poti1 < 0) Poti1 = 0; else if(Poti1 > 255) Poti1 = 255; |
+ if(Poti2 < 0) Poti2 = 0; else if(Poti2 > 255) Poti2 = 255; |
+ if(Poti3 < 0) Poti3 = 0; else if(Poti3 > 255) Poti3 = 255; |
+ if(Poti4 < 0) Poti4 = 0; else if(Poti4 > 255) Poti4 = 255; |
+ if(Poti5 < 0) Poti5 = 0; else if(Poti5 > 255) Poti5 = 255; |
+ if(Poti6 < 0) Poti6 = 0; else if(Poti6 > 255) Poti6 = 255; |
+ if(Poti7 < 0) Poti7 = 0; else if(Poti7 > 255) Poti7 = 255; |
+ if(Poti8 < 0) Poti8 = 0; else if(Poti8 > 255) Poti8 = 255; |
+} |
+ |
+//############################################################################ |
+// Messwerte beim Ermitteln der Nullage |
+void CalibrierMittelwert(void) |
+//############################################################################ |
+{ |
+ // ADC auschalten, damit die Werte sich nicht während der Berechnung ändern |
+ ANALOG_OFF; |
+ if(MessanzahlNick) (MesswertNick = AccumulateNick / MessanzahlNick); |
+ if(MessanzahlRoll) (MesswertRoll = AccumulateRoll / MessanzahlRoll); |
+ if(MessanzahlGier) (MesswertGier = AccumulateGier / MessanzahlGier); |
+ if(messanzahl_AccNick) Mittelwert_AccNick = ((ACC_AMPLIFY * (long)accumulate_AccNick) / messanzahl_AccNick); |
+ if(messanzahl_AccRoll) Mittelwert_AccRoll = (ACC_AMPLIFY * (long)accumulate_AccRoll) / messanzahl_AccRoll; |
+ if(messanzahl_AccHoch) Mittelwert_AccHoch = ((long)accumulate_AccHoch) / messanzahl_AccHoch; |
+ AccumulateNick = 0; MessanzahlNick = 0; |
+ AccumulateRoll = 0; MessanzahlRoll = 0; |
+ AccumulateGier = 0; MessanzahlGier = 0; |
+ accumulate_AccRoll = 0;messanzahl_AccRoll = 0; |
+ accumulate_AccNick = 0;messanzahl_AccNick = 0; |
+ accumulate_AccHoch = 0;messanzahl_AccHoch = 0; |
+ // ADC einschalten |
+ ANALOG_ON; |
+ if(Poti1 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110) Poti1++; else if(Poti1 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110 && Poti1) Poti1--; |
+ if(Poti2 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110) Poti2++; else if(Poti2 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110 && Poti2) Poti2--; |
+ if(Poti3 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110) Poti3++; else if(Poti3 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110 && Poti3) Poti3--; |
+ if(Poti4 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110) Poti4++; else if(Poti4 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110 && Poti4) Poti4--; |
+ if(Poti5 < PPM_in[9] + 110) Poti5++; else if(Poti5 > PPM_in[9] + 110 && Poti5) Poti5--; |
+ if(Poti6 < PPM_in[10] + 110) Poti6++; else if(Poti6 > PPM_in[10] + 110 && Poti6) Poti6--; |
+ if(Poti7 < PPM_in[11] + 110) Poti7++; else if(Poti7 > PPM_in[11] + 110 && Poti7) Poti7--; |
+ if(Poti8 < PPM_in[12] + 110) Poti8++; else if(Poti8 > PPM_in[12] + 110 && Poti8) Poti8--; |
+ |
+ |
+ |
+ |
+ if(Poti1 < 0) Poti1 = 0; else if(Poti1 > 255) Poti1 = 255; |
+ if(Poti2 < 0) Poti2 = 0; else if(Poti2 > 255) Poti2 = 255; |
+ if(Poti3 < 0) Poti3 = 0; else if(Poti3 > 255) Poti3 = 255; |
+ if(Poti4 < 0) Poti4 = 0; else if(Poti4 > 255) Poti4 = 255; |
+ if(Poti5 < 0) Poti5 = 0; else if(Poti5 > 255) Poti5 = 255; |
+ if(Poti6 < 0) Poti6 = 0; else if(Poti6 > 255) Poti6 = 255; |
+ if(Poti7 < 0) Poti7 = 0; else if(Poti7 > 255) Poti7 = 255; |
+ if(Poti8 < 0) Poti8 = 0; else if(Poti8 > 255) Poti8 = 255; |
+} |
+ |
+//############################################################################ |
+// Senden der Motorwerte per I2C-Bus |
+void SendMotorData(void) |
+//############################################################################ |
+{ |
+ if(MOTOR_OFF || !MotorenEin) |
+ { |
+ Motor_Hinten = 0; |
+ Motor_Vorne = 0; |
+ Motor_Rechts = 0; |
+ Motor_Links = 0; |
+ if(MotorTest[0]) Motor_Vorne = MotorTest[0]; |
+ if(MotorTest[1]) Motor_Hinten = MotorTest[1]; |
+ if(MotorTest[2]) Motor_Links = MotorTest[2]; |
+ if(MotorTest[3]) Motor_Rechts = MotorTest[3]; |
+ } |
+ |
+ // DebugOut.Analog[12] = Motor_Vorne; |
+ // DebugOut.Analog[13] = Motor_Hinten; |
+ // DebugOut.Analog[14] = Motor_Links; |
+ // DebugOut.Analog[15] = Motor_Rechts; |
+ |
+ // DebugOut.Analog[12] = motor_rx[0]; //Motorstrom vorne |
+ // DebugOut.Analog[13] = motor_rx[1]; //Motorstrom hinten |
+ // DebugOut.Analog[14] = motor_rx[2]; //Motorstrom links |
+ // DebugOut.Analog[15] = motor_rx[3]; //Motorstrom rechts |
+ // DebugOut.Analog[14] = (motor_rx[0]+motor_rx[1]+motor_rx[2]+motor_rx[3])/4; //Mittelwert aller Motorenströme |
+ // DebugOut.Analog[15] = motor_rx[0]+motor_rx[1]+motor_rx[2]+motor_rx[3]; //Gesamtstrom aller Motoren |
+ |
+ //Start I2C Interrupt Mode |
+ twi_state = 0; |
+ motor = 0; |
+ i2c_start(); |
+} |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Konstanten |
+// + 0-250 -> normale Werte |
+// + 251 -> Poti1 |
+// + 252 -> Poti2 |
+// + 253 -> Poti3 |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+void DefaultKonstanten1(void) |
+{ |
+ EE_Parameter.Kanalbelegung[K_NICK] = 3; |
+ EE_Parameter.Kanalbelegung[K_ROLL] = 2; |
+ EE_Parameter.Kanalbelegung[K_GAS] = 1; |
+ EE_Parameter.Kanalbelegung[K_GIER] = 4; |
+ EE_Parameter.Kanalbelegung[K_POTI1] = 5; |
+ EE_Parameter.Kanalbelegung[K_POTI2] = 6; |
+ EE_Parameter.Kanalbelegung[K_POTI3] = 7; |
+ EE_Parameter.Kanalbelegung[K_POTI4] = 8; |
+ EE_Parameter.GlobalConfig = 0;//CFG_HOEHENREGELUNG | /*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV | CFG_KOMPASS_FIX;//0x01; |
+ EE_Parameter.Hoehe_MinGas = 30; |
+ EE_Parameter.MaxHoehe = 251; // Wert : 0-32 251 -> Poti1 |
+ EE_Parameter.Hoehe_P = 10; // Wert : 0-32 |
+ EE_Parameter.Luftdruck_D = 70; // Wert : 0-250 |
+ EE_Parameter.Hoehe_ACC_Wirkung = 30; // Wert : 0-250 |
+ EE_Parameter.Hoehe_Verstaerkung = 2; // Wert : 0-50 |
+ EE_Parameter.Stick_P = 4; //2 // Wert : 1-6 |
+ EE_Parameter.Stick_D = 0; //8 // Wert : 0-64 |
+ EE_Parameter.Gier_P = 16; // Wert : 1-20 |
+ EE_Parameter.Gas_Min = 5; // Wert : 0-32 // (160607Kr) |
+ EE_Parameter.Gas_Max = 250; // Wert : 33-250 |
+ EE_Parameter.GyroAccFaktor = 26; // Wert : 1-64 |
+ EE_Parameter.KompassWirkung = 128; // Wert : 0-250 |
+ EE_Parameter.Gyro_P = 120; //80 // Wert : 0-250 |
+ EE_Parameter.Gyro_I = 150; // Wert : 0-250 |
+ EE_Parameter.UnterspannungsWarnung = 90; // Wert : 0-250 |
+ EE_Parameter.NotGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
+ EE_Parameter.NotGasZeit = 20; // Wert : 0-250 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen |
+ EE_Parameter.UfoAusrichtung = 0; // X oder + Formation |
+ EE_Parameter.I_Faktor = 5; |
+ EE_Parameter.UserParam1 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam2 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam3 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam4 = 0; //zur freien Verwendung |
+ EE_Parameter.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
+ EE_Parameter.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickRefresh = 5; |
+ memcpy(EE_Parameter.Name, "Normal\0", 12); |
+} |
+ |
+void DefaultKonstanten2(void) |
+{ |
+ EE_Parameter.Kanalbelegung[K_NICK] = 3; |
+ EE_Parameter.Kanalbelegung[K_ROLL] = 2; |
+ EE_Parameter.Kanalbelegung[K_GAS] = 1; |
+ EE_Parameter.Kanalbelegung[K_GIER] = 4; |
+ EE_Parameter.Kanalbelegung[K_POTI1] = 5; |
+ EE_Parameter.Kanalbelegung[K_POTI2] = 6; |
+ EE_Parameter.Kanalbelegung[K_POTI3] = 7; |
+ EE_Parameter.GlobalConfig = 0;//CFG_HOEHENREGELUNG | /*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV;//0x01; |
+ EE_Parameter.Hoehe_MinGas = 30; |
+ EE_Parameter.MaxHoehe = 251; // Wert : 0-32 251 -> Poti1 |
+ EE_Parameter.Hoehe_P = 10; // Wert : 0-32 |
+ EE_Parameter.Luftdruck_D = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_ACC_Wirkung = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_Verstaerkung = 2; // Wert : 0-50 |
+ EE_Parameter.Stick_P = 4; //2 // Wert : 1-6 |
+ EE_Parameter.Stick_D = 0; //8 // Wert : 0-64 |
+ EE_Parameter.Gier_P = 16; // Wert : 1-20 |
+ EE_Parameter.Gas_Min = 5; // Wert : 0-32 // (160607Kr) |
+ EE_Parameter.Gas_Max = 250; // Wert : 33-250 |
+ EE_Parameter.GyroAccFaktor = 26; // Wert : 1-64 |
+ EE_Parameter.KompassWirkung = 128; // Wert : 0-250 |
+ EE_Parameter.Gyro_P = 175; //80 // Wert : 0-250 |
+ EE_Parameter.Gyro_I = 175; // Wert : 0-250 |
+ EE_Parameter.UnterspannungsWarnung = 90; // Wert : 0-250 |
+ EE_Parameter.NotGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
+ EE_Parameter.NotGasZeit = 20; // Wert : 0-250 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen |
+ EE_Parameter.UfoAusrichtung = 0; // X oder + Formation |
+ EE_Parameter.I_Faktor = 5; |
+ EE_Parameter.UserParam1 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam2 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam3 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam4 = 0; //zur freien Verwendung |
+ EE_Parameter.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
+ EE_Parameter.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickRefresh = 5; |
+ memcpy(EE_Parameter.Name, "Kamera\0", 12); |
+} |
+ |
+ |
+//############################################################################ |
+// Trägt ggf. das Poti als Parameter ein |
+void ParameterZuordnung(void) |
+//############################################################################ |
+{ |
+ |
+ #define CHK_POTI(b,a,min,max) { if(a > 250) { if(a == 251) b = Poti1; else if(a == 252) b = Poti2; else if(a == 253) b = Poti3; else if(a == 254) b = Poti4;} else b = a; if(b <= min) b = min; else if(b >= max) b = max;} |
+ CHK_POTI(Parameter_MaxHoehe,EE_Parameter.MaxHoehe,0,255); |
+ CHK_POTI(Parameter_Luftdruck_D,EE_Parameter.Luftdruck_D,0,100); |
+ CHK_POTI(Parameter_Hoehe_P,EE_Parameter.Hoehe_P,0,100); |
+ CHK_POTI(Parameter_Hoehe_ACC_Wirkung,EE_Parameter.Hoehe_ACC_Wirkung,0,255); |
+ CHK_POTI(Parameter_KompassWirkung,EE_Parameter.KompassWirkung,0,255); |
+ CHK_POTI(Parameter_Gyro_P,EE_Parameter.Gyro_P,10,255); |
+ CHK_POTI(Parameter_Gyro_I,EE_Parameter.Gyro_I,0,255); |
+ CHK_POTI(Parameter_I_Faktor,EE_Parameter.I_Faktor,0,255); |
+ CHK_POTI(Parameter_UserParam1,EE_Parameter.UserParam1,0,255); |
+ CHK_POTI(Parameter_UserParam2,EE_Parameter.UserParam2,0,255); |
+ CHK_POTI(Parameter_UserParam3,EE_Parameter.UserParam3,0,255); |
+ CHK_POTI(Parameter_UserParam4,EE_Parameter.UserParam4,0,255); |
+ |
+ unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo |
+ unsigned char ServoNickCompInvert; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
+ unsigned char ServoNickMin; // Wert : 0-250 // Anschlag |
+ unsigned char ServoNickMax; // Wert : 0-250 // Anschlag |
+ |
+ |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ |
+ Ki = (float) Parameter_I_Faktor * 0.0001; |
+ MAX_GAS = EE_Parameter.Gas_Max; |
+ MIN_GAS = EE_Parameter.Gas_Min; |
+} |
+ |
+ |
+//############################################################################ |
+// |
+void MotorRegler(void) |
+//############################################################################ |
+{ |
+ int motorwert,pd_ergebnis,h,tmp_int; |
+ int GierMischanteil,GasMischanteil; |
+ static long SummeNick=0,SummeRoll=0; |
+ static long sollGier = 0,tmp_long,tmp_long2; |
+ static int IntegralFehlerNick = 0; |
+ static int IntegralFehlerRoll = 0; |
+ static unsigned int RcLostTimer; |
+ static unsigned char delay_neutral = 0; |
+ static unsigned char delay_einschalten = 0,delay_ausschalten = 0; |
+ static unsigned int modell_fliegt = 0; |
+ static int hoehenregler = 0; |
+ static char TimerWerteausgabe = 0; |
+ static char NeueKompassRichtungMerken = 0; |
+ Mittelwert(); |
+ |
+ GRN_ON; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gaswert ermitteln |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ GasMischanteil = PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] + 120; |
+ if(GasMischanteil < 0) GasMischanteil = 0; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Emfang schlecht |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(SenderOkay < 100) |
+ { |
+ if(!PcZugriff) beeptime = 500; |
+ if(RcLostTimer) RcLostTimer--; |
+ else |
+ { |
+ MotorenEin = 0; |
+ Notlandung = 0; |
+ } |
+ ROT_ON; |
+ if(modell_fliegt > 2000) // wahrscheinlich in der Luft --> langsam absenken |
+ { |
+ GasMischanteil = EE_Parameter.NotGas; |
+ Notlandung = 1; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] = 0; |
+/* Poti1 = 65; |
+ Poti2 = 48; |
+ Poti3 = 0; |
+*/ } |
+ else MotorenEin = 0; |
+ } |
+ else |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Emfang gut |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(SenderOkay > 140) |
+ { |
+ Notlandung = 0; |
+ RcLostTimer = EE_Parameter.NotGasZeit * 50; |
+ if(GasMischanteil > 40) |
+ { |
+ if(modell_fliegt < 0xffff) modell_fliegt++; |
+ modell_fliegt_gps = modell_fliegt;// (030907Kr) |
+ } |
+ if((modell_fliegt < 200) || (GasMischanteil < 40)) |
+ { |
+ SummeNick = 0; |
+ SummeRoll = 0; |
+ Mess_Integral_Gier = 0; |
+ Mess_Integral_Gier2 = 0; |
+ } |
+ if((GasMischanteil > 200) && MotorenEin == 0) |
+ { |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// auf Nullwerte kalibrieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) // Neutralwerte |
+ { |
+ unsigned char setting; |
+ if(++delay_neutral > 200) // nicht sofort |
+ { |
+ GRN_OFF; |
+ SetNeutral(); |
+ MotorenEin = 0; |
+ delay_neutral = 0; |
+ modell_fliegt = 0; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70 || abs(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]) > 70) |
+ { |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < 70) setting = 1; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 2; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] < 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 3; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] <-70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 4; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] <-70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < 70) setting = 5; |
+ eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], setting); // aktiven Datensatz merken |
+ } |
+ ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
+ Piep(GetActiveParamSetNumber()); |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
+ { |
+ if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset(); |
+ } |
+ } |
+ } |
+ else delay_neutral = 0; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gas ist unten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(GasMischanteil < 35) |
+ { |
+ // Starten |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] < -75) |
+ { |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Einschalten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(++delay_einschalten > 200) |
+ { |
+ delay_einschalten = 200; |
+ modell_fliegt = 1; |
+ MotorenEin = 1; |
+ sollGier = 0; |
+ Mess_Integral_Gier = 0; |
+ Mess_Integral_Gier2 = 0; |
+ Mess_IntegralNick = 0; |
+ Mess_IntegralRoll = 0; |
+ Mess_IntegralNick2 = IntegralNick; |
+ Mess_IntegralRoll2 = IntegralRoll; |
+ SummeNick = 0; |
+ SummeRoll = 0; |
+ } |
+ } |
+ else delay_einschalten = 0; |
+ //Auf Neutralwerte setzen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Auschalten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) |
+ { |
+ if(++delay_ausschalten > 200) // nicht sofort |
+ { |
+ MotorenEin = 0; |
+ delay_ausschalten = 200; |
+ modell_fliegt = 0; |
+ } |
+ } |
+ else delay_ausschalten = 0; |
+ } |
+ } |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// neue Werte von der Funke |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(!NewPpmData-- || Notlandung) |
+ { |
+ ParameterZuordnung(); |
+ StickNick = PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_P; |
+ StickNick += PPM_diff[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_D; |
+ StickRoll = PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_P; |
+ StickRoll += PPM_diff[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_D; |
+ StickGier = -PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]; |
+ |
+ GyroFaktor = ((float)Parameter_Gyro_P + 10.0) / 256.0; |
+ IntegralFaktor = ((float) Parameter_Gyro_I) / 44000; |
+ |
+ if(EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) IntegralFaktor = 0; |
+ if(GyroFaktor < 0) GyroFaktor = 0; |
+ if(IntegralFaktor < 0) IntegralFaktor = 0; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// LED Stuff |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+LED1_OFF; |
+ |
+ if(blinkcount_LED1 >= Parameter_UserParam4 && Parameter_UserParam4 > 0) |
+ { |
+ LED1_FLASH; |
+ blinkcount_LED1 = 0; |
+ } |
+ |
+ blinkcount_LED1++; |
+ |
+ //if(PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] > 75) LED1_ON; else LED1_OFF; //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
+ //if(PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] > 75) LED2_ON; else LED2_OFF; //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Bei Empfangsausfall im Flug |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(Notlandung) |
+ { |
+ StickGier = 0; |
+ StickNick = 0; |
+ StickRoll = 0; |
+ GyroFaktor = 0.1; |
+ IntegralFaktor = 0.005; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gyro-Drift kompensieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define DRIFT_FAKTOR 3 |
+ if(ZaehlMessungen >= 1000 / DRIFT_FAKTOR) |
+ { |
+ IntegralFehlerNick = IntegralNick2 - IntegralNick; |
+ IntegralFehlerRoll = IntegralRoll2 - IntegralRoll; |
+ ZaehlMessungen = 0; |
+ if(IntegralFehlerNick > 500/DRIFT_FAKTOR) AdNeutralNick++; |
+ if(IntegralFehlerNick < -500/DRIFT_FAKTOR) AdNeutralNick--; |
+ if(IntegralFehlerRoll > 500/DRIFT_FAKTOR) AdNeutralRoll++; |
+ if(IntegralFehlerRoll < -500/DRIFT_FAKTOR) AdNeutralRoll--; |
+ if(Mess_Integral_Gier2 > 500/DRIFT_FAKTOR) AdNeutralGier--; |
+ if(Mess_Integral_Gier2 <-500/DRIFT_FAKTOR) AdNeutralGier++; |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_IntegralNick2 = IntegralNick; |
+ Mess_IntegralRoll2 = IntegralRoll; |
+ Mess_Integral_Gier2 = Integral_Gier; |
+ ANALOG_ON; // ADC einschalten |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Integrale auf ACC-Signal abgleichen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ tmp_long = (long)(IntegralNick / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccNick) / 16; |
+ tmp_long2 = (long)(IntegralRoll / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccRoll) / 16; |
+#define AUSGLEICH 500 |
+ if(tmp_long > AUSGLEICH) tmp_long = AUSGLEICH; |
+ if(tmp_long < -AUSGLEICH) tmp_long =-AUSGLEICH; |
+ if(tmp_long2 > AUSGLEICH) tmp_long2 = AUSGLEICH; |
+ if(tmp_long2 <-AUSGLEICH) tmp_long2 =-AUSGLEICH; |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_IntegralNick -= tmp_long; |
+ Mess_IntegralRoll -= tmp_long2; |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ sollGier = StickGier; |
+ if(abs(StickGier) > 35) |
+ { |
+ if(!(EE_Parameter.GlobalConfig & CFG_KOMPASS_FIX)) NeueKompassRichtungMerken = 1; |
+ } |
+ tmp_int = EE_Parameter.Gier_P * (sollGier * abs(sollGier)) / 256; // expo |
+ Mess_Integral_Gier -= tmp_int; |
+ if(Mess_Integral_Gier > 30000) Mess_Integral_Gier = 30000; // begrenzen |
+ if(Mess_Integral_Gier <-30000) Mess_Integral_Gier =-30000; |
+ |
+ ANALOG_ON; // ADC einschalten |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Kompass |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ //KompassValue = 12; |
+ if(KompassValue && (EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV)) |
+ { |
+ int w,v; |
+ static int SignalSchlecht = 0; |
+ w = abs(IntegralNick /512); // mit zunehmender Neigung den Einfluss drosseln |
+ v = abs(IntegralRoll /512); |
+ if(v > w) w = v; // grösste Neigung ermitteln |
+ if(w < 25 && NeueKompassRichtungMerken && !SignalSchlecht) |
+ { |
+ KompassStartwert = KompassValue; |
+ NeueKompassRichtungMerken = 0; |
+ } |
+ w = (w * Parameter_KompassWirkung) / 64; // auf die Wirkung normieren |
+ w = Parameter_KompassWirkung - w; // Wirkung ggf drosseln |
+ if(w > 0) |
+ { |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ if(!SignalSchlecht) Mess_Integral_Gier += (KompassRichtung * w) / 32; // nach Kompass ausrichten |
+ ANALOG_ON; // ADC einschalten |
+ if(SignalSchlecht) SignalSchlecht--; |
+ } |
+ else SignalSchlecht = 500; // so lange das Signal taub stellen --> ca. 1 sek |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// GPS |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+if(EE_Parameter.GlobalConfig & CFG_GPS_AKTIV) |
+{ |
+ P_GPS_Verstaerkung = Parameter_UserParam1; |
+ D_GPS_Verstaerkung = Parameter_UserParam2; |
+ Limit_D_Anteil = Parameter_UserParam3; |
+ gps_main(); |
+} |
+else |
+{ |
+ GPS_Nick = 0; |
+ GPS_Roll = 0; |
+} |
+ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Debugwerte zuordnen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+DebugOut.Sekunden++; |
+ if(!TimerWerteausgabe--) |
+ { |
+ TimerWerteausgabe = 49; |
+ |
+ //++++++++ANFANG_Legende++++++++ |
+/* |
+ DebugOut.Analog[0] = actualPos.GPSFix; |
+ DebugOut.Analog[1] = GPS_Nick; |
+ DebugOut.Analog[2] = GPS_Roll; |
+ DebugOut.Analog[3] = actualPos.northing; |
+ DebugOut.Analog[4] = actualPos.easting; |
+ DebugOut.Analog[5] = NORTH_MITTEL; |
+ DebugOut.Analog[6] = EAST_MITTEL; |
+ DebugOut.Analog[7] = Soll_Position_North; |
+ DebugOut.Analog[8] = Soll_Position_East; |
+ DebugOut.Analog[9] = GPS_Home_North; |
+ DebugOut.Analog[10] = GPS_Home_East; |
+ DebugOut.Analog[11] = GPS_Positionsabweichung_North; |
+ DebugOut.Analog[12] = GPS_Positionsabweichung_East; |
+ DebugOut.Analog[13] = Poti1; |
+ DebugOut.Analog[14] = Poti2; |
+ DebugOut.Analog[15] = KompassValue; |
+*/ |
+ //++++++++ENDE_Legende++++++++ |
+ |
+ |
+ //++++++++ANFANG_Legende_1++++++++ |
+ |
+ DebugOut.Analog[0] = GPS_Roll; |
+ DebugOut.Analog[1] = GPS_Nick; |
+ DebugOut.Analog[2] = GPS_Positionsabweichung_North; |
+ DebugOut.Analog[3] = GPS_Positionsabweichung_East; |
+ DebugOut.Analog[4] = P_Einfluss_East; |
+ DebugOut.Analog[5] = D_Einfluss_East; |
+ DebugOut.Analog[6] = P_Einfluss_North; |
+ DebugOut.Analog[7] = D_Einfluss_North; |
+ DebugOut.Analog[8] = GPS_Geschwindigkeit_North; |
+ DebugOut.Analog[9] = GPS_Geschwindigkeit_East; |
+ DebugOut.Analog[10] = Parameter_UserParam1; |
+ DebugOut.Analog[11] = Parameter_UserParam2; |
+ DebugOut.Analog[12] = Soll_Position_North; |
+ DebugOut.Analog[13] = Soll_Position_East; |
+ DebugOut.Analog[14] = Poti6; |
+ DebugOut.Analog[15] = KompassValue; |
+ |
+ //++++++++ENDE_Legende_1++++++++ |
+ |
+// DebugOut.Analog[xx] = actualPos.velNorth; |
+// DebugOut.Analog[xx] = actualPos.velEast; |
+// DebugOut.Analog[xx] = UBat; |
+// DebugOut.Analog[xx] = 0; |
+ |
+ } |
+ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Drehgeschwindigkeit und -winkel zu einem Istwert zusammenfassen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ MesswertNick = IntegralNick * IntegralFaktor + MesswertNick * GyroFaktor; |
+ MesswertRoll = IntegralRoll * IntegralFaktor + MesswertRoll * GyroFaktor; |
+ MesswertGier = MesswertGier * (GyroFaktor/2) + Integral_Gier * IntegralFaktor; |
+ |
+ // Maximalwerte abfangen |
+ #define MAX_SENSOR 2048 |
+ if(MesswertNick > MAX_SENSOR) MesswertNick = MAX_SENSOR; |
+ if(MesswertNick < -MAX_SENSOR) MesswertNick = -MAX_SENSOR; |
+ if(MesswertRoll > MAX_SENSOR) MesswertRoll = MAX_SENSOR; |
+ if(MesswertRoll < -MAX_SENSOR) MesswertRoll = -MAX_SENSOR; |
+ if(MesswertGier > MAX_SENSOR) MesswertGier = MAX_SENSOR; |
+ if(MesswertGier < -MAX_SENSOR) MesswertGier = -MAX_SENSOR; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Höhenregelung |
+// Die Höhenregelung schwächt lediglich das Gas ab, erhöht es allerdings nicht |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+//OCR0B = 180 - (Poti1 + 120) / 4; |
+//DruckOffsetSetting = OCR0B; |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung |
+ { |
+ int tmp_int; |
+ if(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER) // Regler wird über Schalter gesteuert |
+ { |
+ if(Parameter_MaxHoehe < 50) |
+ { |
+ SollHoehe = HoehenWert - 40; // Parameter_MaxHoehe ist der PPM-Wert des Schalters // (160607Kr) |
+ HoehenReglerAktiv = 0; |
+ } |
+ else |
+ HoehenReglerAktiv = 1; |
+ } |
+ else |
+ { |
+ SollHoehe = Parameter_MaxHoehe * EE_Parameter.Hoehe_Verstaerkung - 40; // (160607Kr) |
+ HoehenReglerAktiv = 1; |
+ } |
+ |
+ if(Notlandung) SollHoehe = 0; |
+ h = HoehenWert; |
+ if((h > SollHoehe) && HoehenReglerAktiv) // zu hoch --> drosseln |
+ { h = ((h - SollHoehe) * (int) Parameter_Hoehe_P) / 16; // Differenz bestimmen --> P-Anteil |
+ h = GasMischanteil - h; // vom Gas abziehen |
+ h -= (HoeheD * Parameter_Luftdruck_D)/8; // D-Anteil |
+ tmp_int = ((Mess_Integral_Hoch / 512) * (signed long) Parameter_Hoehe_ACC_Wirkung) / 32; |
+ if(tmp_int > 50) tmp_int = 50; |
+ else if(tmp_int < -50) tmp_int = -50; |
+ h -= tmp_int; |
+ hoehenregler = (hoehenregler*15 + h) / 16; |
+ if(hoehenregler < EE_Parameter.Hoehe_MinGas) // nicht unter MIN |
+ { |
+ if(GasMischanteil >= EE_Parameter.Hoehe_MinGas) hoehenregler = EE_Parameter.Hoehe_MinGas; |
+ if(GasMischanteil < EE_Parameter.Hoehe_MinGas) hoehenregler = GasMischanteil; |
+ } |
+ if(hoehenregler > GasMischanteil) hoehenregler = GasMischanteil; // nicht mehr als Gas |
+ GasMischanteil = hoehenregler; |
+ } |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Mischer und PI-Regler |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gier-Anteil |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ GierMischanteil = MesswertGier - sollGier; // Regler für Gier |
+ if(GierMischanteil > 100) GierMischanteil = 100; |
+ if(GierMischanteil < -100) GierMischanteil = -100; |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Nick-Achse |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ DiffNick = Kp * (MesswertNick - (StickNick - GPS_Nick)); // Differenz bestimmen |
+ SummeNick += DiffNick; // I-Anteil |
+ if(SummeNick > 0) SummeNick-= (abs(SummeNick)/256 + 1); else SummeNick += abs(SummeNick)/256 + 1; |
+ if(SummeNick > 16000) SummeNick = 16000; |
+ if(SummeNick < -16000) SummeNick = -16000; |
+ pd_ergebnis = DiffNick + Ki * SummeNick; // PI-Regler für Nick |
+ // Motor Vorn |
+ motorwert = GasMischanteil + pd_ergebnis + GierMischanteil; // Mischer |
+ if ((motorwert < 0) | (GasMischanteil < 10)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Vorne = motorwert; |
+ // Motor Heck |
+ motorwert = GasMischanteil - pd_ergebnis + GierMischanteil; |
+ if ((motorwert < 0) | (GasMischanteil < 10)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Hinten = motorwert; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Roll-Achse |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ DiffRoll = Kp * (MesswertRoll - (StickRoll - GPS_Roll)); // Differenz bestimmen |
+ SummeRoll += DiffRoll; // I-Anteil |
+ if(SummeRoll > 0) SummeRoll-= (abs(SummeRoll)/256 + 1); else SummeRoll += abs(SummeRoll)/256 + 1; |
+ if(SummeRoll > 16000) SummeRoll = 16000; |
+ if(SummeRoll < -16000) SummeRoll = -16000; |
+ pd_ergebnis = DiffRoll + Ki * SummeRoll; // PI-Regler für Roll |
+ // Motor Links |
+ motorwert = GasMischanteil + pd_ergebnis - GierMischanteil; |
+ if ((motorwert < 0) | (GasMischanteil < 10)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Links = motorwert; |
+ // Motor Rechts |
+ motorwert = GasMischanteil - pd_ergebnis - GierMischanteil; |
+ if ((motorwert < 0) | (GasMischanteil < 10)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Rechts = motorwert; |
+ // +++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+} |
+ |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/fc.c.bak |
---|
0,0 → 1,905 |
/*####################################################################################### |
Flight Control |
#######################################################################################*/ |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + Nur für den privaten Gebrauch |
// + www.MikroKopter.com |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
// + dass eine Nutzung (auch auszugsweise) nur für den privaten (nicht-kommerziellen) Gebrauch zulässig ist. |
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
// + bzgl. der Nutzungsbedingungen aufzunehmen. |
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
// + Verkauf von Luftbildaufnahmen, usw. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
// + eindeutig als Ursprung verlinkt werden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
// + Benutzung auf eigene Gefahr |
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
// + mit unserer Zustimmung zulässig |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
// + this list of conditions and the following disclaimer. |
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
// + from this software without specific prior written permission. |
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
// + for non-commercial use (directly or indirectly) |
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
// + with our written permission |
// + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
// + clearly linked as origin |
// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
unsigned char h,m,s; |
volatile unsigned char Timeout = 0; |
volatile int MesswertNick,MesswertRoll,MesswertGier; |
volatile int AdNeutralNick = 0,AdNeutralRoll = 0,AdNeutralGier = 0; |
volatile int Mittelwert_AccNick, Mittelwert_AccRoll,Mittelwert_AccHoch, NeutralAccX=0, NeutralAccY=0; |
volatile float NeutralAccZ = 0; |
unsigned char CosinusNickWinkel = 0, CosinusRollWinkel = 0; |
volatile long IntegralNick = 0,IntegralNick2 = 0; |
volatile long IntegralRoll = 0,IntegralRoll2 = 0; |
volatile long Integral_Gier = 0; |
volatile long Mess_IntegralNick = 0,Mess_IntegralNick2 = 0; |
volatile long Mess_IntegralRoll = 0,Mess_IntegralRoll2 = 0; |
volatile long Mess_Integral_Gier = 0,Mess_Integral_Gier2 = 0; |
volatile long Mess_Integral_Hoch = 0; |
volatile int KompassValue = 0; |
volatile int KompassStartwert = 0; |
volatile int KompassRichtung = 0; |
unsigned char MAX_GAS,MIN_GAS; |
unsigned char Notlandung = 0; |
unsigned char HoehenReglerAktiv = 0; |
unsigned char blinkcount_LED1 = 0;//Hilfszähler für die blinkende LED (310807Kr) |
unsigned int modell_fliegt_gps = 0;//(030907Kr) |
unsigned char Limit_D_Anteil = 0;//(210907Kr) |
float GyroFaktor; |
float IntegralFaktor; |
volatile int DiffNick,DiffRoll; |
int Poti1 = 0, Poti2 = 0, Poti3 = 0, Poti4 = 0, Poti5 = 0, Poti6 = 0, Poti7 = 0, Poti8 = 0; |
volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
unsigned char MotorWert[5]; |
volatile unsigned char SenderOkay = 0; |
int StickNick = 0,StickRoll = 0,StickGier = 0; |
char MotorenEin = 0; |
int HoehenWert = 0; |
int SollHoehe = 0; |
float Kp = FAKTOR_P; |
float Ki = FAKTOR_I; |
unsigned char Parameter_Luftdruck_D = 48; // Wert : 0-250 |
unsigned char Parameter_MaxHoehe = 251; // Wert : 0-250 |
unsigned char Parameter_Hoehe_P = 16; // Wert : 0-32 |
unsigned char Parameter_Hoehe_ACC_Wirkung = 58; // Wert : 0-250 |
unsigned char Parameter_KompassWirkung = 64; // Wert : 0-250 |
unsigned char Parameter_Gyro_P = 50; // Wert : 10-250 |
unsigned char Parameter_Gyro_I = 150; // Wert : 0-250 |
unsigned char Parameter_Gier_P = 2; // Wert : 1-20 |
unsigned char Parameter_I_Faktor = 10; // Wert : 1-20 |
unsigned char Parameter_UserParam1 = 0; |
unsigned char Parameter_UserParam2 = 0; |
unsigned char Parameter_UserParam3 = 0; |
unsigned char Parameter_UserParam4 = 0; |
unsigned char Parameter_ServoNickControl = 100; |
struct mk_param_struct EE_Parameter; |
void Piep(unsigned char Anzahl) |
{ |
while(Anzahl--) |
{ |
if(MotorenEin) return; //auf keinen Fall im Flug! |
beeptime = 100; |
Delay_ms(250); |
} |
} |
//############################################################################ |
// Nullwerte ermitteln |
void SetNeutral(void) |
//############################################################################ |
{ |
unsigned int timer; |
NeutralAccX = 0; |
NeutralAccY = 0; |
NeutralAccZ = 0; |
AdNeutralNick = 0; |
AdNeutralRoll = 0; |
AdNeutralGier = 0; |
CalibrierMittelwert(); |
timer = SetDelay(5); |
while (!CheckDelay(timer)); |
CalibrierMittelwert(); |
if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
{ |
if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset(); |
} |
AdNeutralNick= abs(MesswertNick); |
AdNeutralRoll= abs(MesswertRoll); |
AdNeutralGier= abs(MesswertGier); |
NeutralAccY = abs(Mittelwert_AccRoll) / ACC_AMPLIFY; |
NeutralAccX = abs(Mittelwert_AccNick) / ACC_AMPLIFY; |
NeutralAccZ = Aktuell_az; |
Mess_IntegralNick = 0; |
Mess_IntegralNick2 = 0; |
Mess_IntegralRoll = 0; |
Mess_IntegralRoll2 = 0; |
Mess_Integral_Gier = 0; |
MesswertNick = 0; |
MesswertRoll = 0; |
MesswertGier = 0; |
StartLuftdruck = Luftdruck; |
HoeheD = 0; |
Mess_Integral_Hoch = 0; |
KompassStartwert = KompassValue; |
beeptime = 50; |
} |
//############################################################################ |
// Bildet den Mittelwert aus den Messwerten |
void Mittelwert(void) |
//############################################################################ |
{ |
// ADC auschalten, damit die Werte sich nicht während der Berechnung ändern |
ANALOG_OFF; |
if(MessanzahlNick) (MesswertNick = AccumulateNick / MessanzahlNick); |
if(MessanzahlRoll) (MesswertRoll = AccumulateRoll / MessanzahlRoll); |
if(MessanzahlGier) (MesswertGier = AccumulateGier / MessanzahlGier); |
if(messanzahl_AccNick) Mittelwert_AccNick = ((long)Mittelwert_AccNick * 7 + ((ACC_AMPLIFY * (long)accumulate_AccNick) / messanzahl_AccNick)) / 8L; |
if(messanzahl_AccRoll) Mittelwert_AccRoll = ((long)Mittelwert_AccRoll * 7 + ((ACC_AMPLIFY * (long)accumulate_AccRoll) / messanzahl_AccRoll)) / 8L; |
if(messanzahl_AccHoch) Mittelwert_AccHoch = ((long)Mittelwert_AccHoch * 7 + ((long)accumulate_AccHoch) / messanzahl_AccHoch) / 8L; |
AccumulateNick = 0; MessanzahlNick = 0; |
AccumulateRoll = 0; MessanzahlRoll = 0; |
AccumulateGier = 0; MessanzahlGier = 0; |
accumulate_AccRoll = 0;messanzahl_AccRoll = 0; |
accumulate_AccNick = 0;messanzahl_AccNick = 0; |
accumulate_AccHoch = 0;messanzahl_AccHoch = 0; |
Integral_Gier = Mess_Integral_Gier; |
// Integral_Gier2 = Mess_Integral_Gier2; |
IntegralNick = Mess_IntegralNick; |
IntegralRoll = Mess_IntegralRoll; |
IntegralNick2 = Mess_IntegralNick2; |
IntegralRoll2 = Mess_IntegralRoll2; |
// ADC einschalten |
ANALOG_ON; |
//------------------------------------------------------------------------------ |
if(MesswertNick > 200) MesswertNick += 4 * (MesswertNick - 200); |
else |
if(MesswertNick < -200) MesswertNick += 4 * (MesswertNick + 200); |
if(MesswertRoll > 200) MesswertRoll += 4 * (MesswertRoll - 200); |
else |
if(MesswertRoll < -200) MesswertRoll += 4 * (MesswertRoll + 200); |
//------------------------------------------------------------------------------ |
if(Poti1 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110) Poti1++; else if(Poti1 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110 && Poti1) Poti1--; |
if(Poti2 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110) Poti2++; else if(Poti2 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110 && Poti2) Poti2--; |
if(Poti3 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110) Poti3++; else if(Poti3 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110 && Poti3) Poti3--; |
if(Poti4 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110) Poti4++; else if(Poti4 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110 && Poti4) Poti4--; |
if(Poti5 < PPM_in[9] + 110) Poti5++; else if(Poti5 > PPM_in[9] + 110 && Poti5) Poti5--; |
if(Poti6 < PPM_in[10] + 110) Poti6++; else if(Poti6 > PPM_in[10] + 110 && Poti6) Poti6--; |
if(Poti7 < PPM_in[11] + 110) Poti7++; else if(Poti7 > PPM_in[11] + 110 && Poti7) Poti7--; |
if(Poti8 < PPM_in[12] + 110) Poti8++; else if(Poti8 > PPM_in[12] + 110 && Poti8) Poti8--; |
if(Poti1 < 0) Poti1 = 0; else if(Poti1 > 255) Poti1 = 255; |
if(Poti2 < 0) Poti2 = 0; else if(Poti2 > 255) Poti2 = 255; |
if(Poti3 < 0) Poti3 = 0; else if(Poti3 > 255) Poti3 = 255; |
if(Poti4 < 0) Poti4 = 0; else if(Poti4 > 255) Poti4 = 255; |
if(Poti5 < 0) Poti5 = 0; else if(Poti5 > 255) Poti5 = 255; |
if(Poti6 < 0) Poti6 = 0; else if(Poti6 > 255) Poti6 = 255; |
if(Poti7 < 0) Poti7 = 0; else if(Poti7 > 255) Poti7 = 255; |
if(Poti8 < 0) Poti8 = 0; else if(Poti8 > 255) Poti8 = 255; |
} |
//############################################################################ |
// Messwerte beim Ermitteln der Nullage |
void CalibrierMittelwert(void) |
//############################################################################ |
{ |
// ADC auschalten, damit die Werte sich nicht während der Berechnung ändern |
ANALOG_OFF; |
if(MessanzahlNick) (MesswertNick = AccumulateNick / MessanzahlNick); |
if(MessanzahlRoll) (MesswertRoll = AccumulateRoll / MessanzahlRoll); |
if(MessanzahlGier) (MesswertGier = AccumulateGier / MessanzahlGier); |
if(messanzahl_AccNick) Mittelwert_AccNick = ((ACC_AMPLIFY * (long)accumulate_AccNick) / messanzahl_AccNick); |
if(messanzahl_AccRoll) Mittelwert_AccRoll = (ACC_AMPLIFY * (long)accumulate_AccRoll) / messanzahl_AccRoll; |
if(messanzahl_AccHoch) Mittelwert_AccHoch = ((long)accumulate_AccHoch) / messanzahl_AccHoch; |
AccumulateNick = 0; MessanzahlNick = 0; |
AccumulateRoll = 0; MessanzahlRoll = 0; |
AccumulateGier = 0; MessanzahlGier = 0; |
accumulate_AccRoll = 0;messanzahl_AccRoll = 0; |
accumulate_AccNick = 0;messanzahl_AccNick = 0; |
accumulate_AccHoch = 0;messanzahl_AccHoch = 0; |
// ADC einschalten |
ANALOG_ON; |
if(Poti1 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110) Poti1++; else if(Poti1 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110 && Poti1) Poti1--; |
if(Poti2 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110) Poti2++; else if(Poti2 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110 && Poti2) Poti2--; |
if(Poti3 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110) Poti3++; else if(Poti3 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110 && Poti3) Poti3--; |
if(Poti4 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110) Poti4++; else if(Poti4 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110 && Poti4) Poti4--; |
if(Poti5 < PPM_in[9] + 110) Poti5++; else if(Poti5 > PPM_in[9] + 110 && Poti5) Poti5--; |
if(Poti6 < PPM_in[10] + 110) Poti6++; else if(Poti6 > PPM_in[10] + 110 && Poti6) Poti6--; |
if(Poti7 < PPM_in[11] + 110) Poti7++; else if(Poti7 > PPM_in[11] + 110 && Poti7) Poti7--; |
if(Poti8 < PPM_in[12] + 110) Poti8++; else if(Poti8 > PPM_in[12] + 110 && Poti8) Poti8--; |
if(Poti1 < 0) Poti1 = 0; else if(Poti1 > 255) Poti1 = 255; |
if(Poti2 < 0) Poti2 = 0; else if(Poti2 > 255) Poti2 = 255; |
if(Poti3 < 0) Poti3 = 0; else if(Poti3 > 255) Poti3 = 255; |
if(Poti4 < 0) Poti4 = 0; else if(Poti4 > 255) Poti4 = 255; |
if(Poti5 < 0) Poti5 = 0; else if(Poti5 > 255) Poti5 = 255; |
if(Poti6 < 0) Poti6 = 0; else if(Poti6 > 255) Poti6 = 255; |
if(Poti7 < 0) Poti7 = 0; else if(Poti7 > 255) Poti7 = 255; |
if(Poti8 < 0) Poti8 = 0; else if(Poti8 > 255) Poti8 = 255; |
} |
//############################################################################ |
// Senden der Motorwerte per I2C-Bus |
void SendMotorData(void) |
//############################################################################ |
{ |
if(MOTOR_OFF || !MotorenEin) |
{ |
Motor_Hinten = 0; |
Motor_Vorne = 0; |
Motor_Rechts = 0; |
Motor_Links = 0; |
if(MotorTest[0]) Motor_Vorne = MotorTest[0]; |
if(MotorTest[1]) Motor_Hinten = MotorTest[1]; |
if(MotorTest[2]) Motor_Links = MotorTest[2]; |
if(MotorTest[3]) Motor_Rechts = MotorTest[3]; |
} |
// DebugOut.Analog[12] = Motor_Vorne; |
// DebugOut.Analog[13] = Motor_Hinten; |
// DebugOut.Analog[14] = Motor_Links; |
// DebugOut.Analog[15] = Motor_Rechts; |
// DebugOut.Analog[12] = motor_rx[0]; //Motorstrom vorne |
// DebugOut.Analog[13] = motor_rx[1]; //Motorstrom hinten |
// DebugOut.Analog[14] = motor_rx[2]; //Motorstrom links |
// DebugOut.Analog[15] = motor_rx[3]; //Motorstrom rechts |
// DebugOut.Analog[14] = (motor_rx[0]+motor_rx[1]+motor_rx[2]+motor_rx[3])/4; //Mittelwert aller Motorenströme |
// DebugOut.Analog[15] = motor_rx[0]+motor_rx[1]+motor_rx[2]+motor_rx[3]; //Gesamtstrom aller Motoren |
//Start I2C Interrupt Mode |
twi_state = 0; |
motor = 0; |
i2c_start(); |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Konstanten |
// + 0-250 -> normale Werte |
// + 251 -> Poti1 |
// + 252 -> Poti2 |
// + 253 -> Poti3 |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
void DefaultKonstanten1(void) |
{ |
EE_Parameter.Kanalbelegung[K_NICK] = 3; |
EE_Parameter.Kanalbelegung[K_ROLL] = 2; |
EE_Parameter.Kanalbelegung[K_GAS] = 1; |
EE_Parameter.Kanalbelegung[K_GIER] = 4; |
EE_Parameter.Kanalbelegung[K_POTI1] = 5; |
EE_Parameter.Kanalbelegung[K_POTI2] = 6; |
EE_Parameter.Kanalbelegung[K_POTI3] = 7; |
EE_Parameter.Kanalbelegung[K_POTI4] = 8; |
EE_Parameter.GlobalConfig = 0;//CFG_HOEHENREGELUNG | /*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV | CFG_KOMPASS_FIX;//0x01; |
EE_Parameter.Hoehe_MinGas = 30; |
EE_Parameter.MaxHoehe = 251; // Wert : 0-32 251 -> Poti1 |
EE_Parameter.Hoehe_P = 10; // Wert : 0-32 |
EE_Parameter.Luftdruck_D = 70; // Wert : 0-250 |
EE_Parameter.Hoehe_ACC_Wirkung = 30; // Wert : 0-250 |
EE_Parameter.Hoehe_Verstaerkung = 2; // Wert : 0-50 |
EE_Parameter.Stick_P = 4; //2 // Wert : 1-6 |
EE_Parameter.Stick_D = 0; //8 // Wert : 0-64 |
EE_Parameter.Gier_P = 16; // Wert : 1-20 |
EE_Parameter.Gas_Min = 5; // Wert : 0-32 // (160607Kr) |
EE_Parameter.Gas_Max = 250; // Wert : 33-250 |
EE_Parameter.GyroAccFaktor = 26; // Wert : 1-64 |
EE_Parameter.KompassWirkung = 128; // Wert : 0-250 |
EE_Parameter.Gyro_P = 120; //80 // Wert : 0-250 |
EE_Parameter.Gyro_I = 150; // Wert : 0-250 |
EE_Parameter.UnterspannungsWarnung = 90; // Wert : 0-250 |
EE_Parameter.NotGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
EE_Parameter.NotGasZeit = 20; // Wert : 0-250 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen |
EE_Parameter.UfoAusrichtung = 0; // X oder + Formation |
EE_Parameter.I_Faktor = 5; |
EE_Parameter.UserParam1 = 0; //zur freien Verwendung |
EE_Parameter.UserParam2 = 0; //zur freien Verwendung |
EE_Parameter.UserParam3 = 0; //zur freien Verwendung |
EE_Parameter.UserParam4 = 0; //zur freien Verwendung |
EE_Parameter.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
EE_Parameter.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
EE_Parameter.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
EE_Parameter.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
EE_Parameter.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
EE_Parameter.ServoNickRefresh = 5; |
memcpy(EE_Parameter.Name, "Normal\0", 12); |
} |
void DefaultKonstanten2(void) |
{ |
EE_Parameter.Kanalbelegung[K_NICK] = 3; |
EE_Parameter.Kanalbelegung[K_ROLL] = 2; |
EE_Parameter.Kanalbelegung[K_GAS] = 1; |
EE_Parameter.Kanalbelegung[K_GIER] = 4; |
EE_Parameter.Kanalbelegung[K_POTI1] = 5; |
EE_Parameter.Kanalbelegung[K_POTI2] = 6; |
EE_Parameter.Kanalbelegung[K_POTI3] = 7; |
EE_Parameter.GlobalConfig = 0;//CFG_HOEHENREGELUNG | /*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV;//0x01; |
EE_Parameter.Hoehe_MinGas = 30; |
EE_Parameter.MaxHoehe = 251; // Wert : 0-32 251 -> Poti1 |
EE_Parameter.Hoehe_P = 10; // Wert : 0-32 |
EE_Parameter.Luftdruck_D = 50; // Wert : 0-250 |
EE_Parameter.Hoehe_ACC_Wirkung = 50; // Wert : 0-250 |
EE_Parameter.Hoehe_Verstaerkung = 2; // Wert : 0-50 |
EE_Parameter.Stick_P = 4; //2 // Wert : 1-6 |
EE_Parameter.Stick_D = 0; //8 // Wert : 0-64 |
EE_Parameter.Gier_P = 16; // Wert : 1-20 |
EE_Parameter.Gas_Min = 5; // Wert : 0-32 // (160607Kr) |
EE_Parameter.Gas_Max = 250; // Wert : 33-250 |
EE_Parameter.GyroAccFaktor = 26; // Wert : 1-64 |
EE_Parameter.KompassWirkung = 128; // Wert : 0-250 |
EE_Parameter.Gyro_P = 175; //80 // Wert : 0-250 |
EE_Parameter.Gyro_I = 175; // Wert : 0-250 |
EE_Parameter.UnterspannungsWarnung = 90; // Wert : 0-250 |
EE_Parameter.NotGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
EE_Parameter.NotGasZeit = 20; // Wert : 0-250 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen |
EE_Parameter.UfoAusrichtung = 0; // X oder + Formation |
EE_Parameter.I_Faktor = 5; |
EE_Parameter.UserParam1 = 0; //zur freien Verwendung |
EE_Parameter.UserParam2 = 0; //zur freien Verwendung |
EE_Parameter.UserParam3 = 0; //zur freien Verwendung |
EE_Parameter.UserParam4 = 0; //zur freien Verwendung |
EE_Parameter.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
EE_Parameter.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
EE_Parameter.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
EE_Parameter.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
EE_Parameter.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
EE_Parameter.ServoNickRefresh = 5; |
memcpy(EE_Parameter.Name, "Kamera\0", 12); |
} |
//############################################################################ |
// Trägt ggf. das Poti als Parameter ein |
void ParameterZuordnung(void) |
//############################################################################ |
{ |
#define CHK_POTI(b,a,min,max) { if(a > 250) { if(a == 251) b = Poti1; else if(a == 252) b = Poti2; else if(a == 253) b = Poti3; else if(a == 254) b = Poti4;} else b = a; if(b <= min) b = min; else if(b >= max) b = max;} |
CHK_POTI(Parameter_MaxHoehe,EE_Parameter.MaxHoehe,0,255); |
CHK_POTI(Parameter_Luftdruck_D,EE_Parameter.Luftdruck_D,0,100); |
CHK_POTI(Parameter_Hoehe_P,EE_Parameter.Hoehe_P,0,100); |
CHK_POTI(Parameter_Hoehe_ACC_Wirkung,EE_Parameter.Hoehe_ACC_Wirkung,0,255); |
CHK_POTI(Parameter_KompassWirkung,EE_Parameter.KompassWirkung,0,255); |
CHK_POTI(Parameter_Gyro_P,EE_Parameter.Gyro_P,10,255); |
CHK_POTI(Parameter_Gyro_I,EE_Parameter.Gyro_I,0,255); |
CHK_POTI(Parameter_I_Faktor,EE_Parameter.I_Faktor,0,255); |
CHK_POTI(Parameter_UserParam1,EE_Parameter.UserParam1,0,255); |
CHK_POTI(Parameter_UserParam2,EE_Parameter.UserParam2,0,255); |
CHK_POTI(Parameter_UserParam3,EE_Parameter.UserParam3,0,255); |
CHK_POTI(Parameter_UserParam4,EE_Parameter.UserParam4,0,255); |
// unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo |
// unsigned char ServoNickCompInvert; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
// unsigned char ServoNickMin; // Wert : 0-250 // Anschlag |
// unsigned char ServoNickMax; // Wert : 0-250 // Anschlag |
// CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
// CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
Ki = (float) Parameter_I_Faktor * 0.0001; |
MAX_GAS = EE_Parameter.Gas_Max; |
MIN_GAS = EE_Parameter.Gas_Min; |
} |
//############################################################################ |
// |
void MotorRegler(void) |
//############################################################################ |
{ |
int motorwert,pd_ergebnis,h,tmp_int; |
int GierMischanteil,GasMischanteil; |
static long SummeNick=0,SummeRoll=0; |
static long sollGier = 0,tmp_long,tmp_long2; |
static int IntegralFehlerNick = 0; |
static int IntegralFehlerRoll = 0; |
static unsigned int RcLostTimer; |
static unsigned char delay_neutral = 0; |
static unsigned char delay_einschalten = 0,delay_ausschalten = 0; |
static unsigned int modell_fliegt = 0; |
static int hoehenregler = 0; |
static char TimerWerteausgabe = 0; |
static char NeueKompassRichtungMerken = 0; |
Mittelwert(); |
GRN_ON; |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Gaswert ermitteln |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
GasMischanteil = PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] + 120; |
if(GasMischanteil < 0) GasMischanteil = 0; |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Emfang schlecht |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
if(SenderOkay < 100) |
{ |
if(!PcZugriff) beeptime = 500; |
if(RcLostTimer) RcLostTimer--; |
else |
{ |
MotorenEin = 0; |
Notlandung = 0; |
} |
ROT_ON; |
if(modell_fliegt > 2000) // wahrscheinlich in der Luft --> langsam absenken |
{ |
GasMischanteil = EE_Parameter.NotGas; |
Notlandung = 1; |
PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] = 0; |
/* Poti1 = 65; |
Poti2 = 48; |
Poti3 = 0; |
*/ } |
else MotorenEin = 0; |
} |
else |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Emfang gut |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
if(SenderOkay > 140) |
{ |
Notlandung = 0; |
RcLostTimer = EE_Parameter.NotGasZeit * 50; |
if(GasMischanteil > 40) |
{ |
if(modell_fliegt < 0xffff) modell_fliegt++; |
modell_fliegt_gps = modell_fliegt;// (030907Kr) |
} |
if((modell_fliegt < 200) || (GasMischanteil < 40)) |
{ |
SummeNick = 0; |
SummeRoll = 0; |
Mess_Integral_Gier = 0; |
Mess_Integral_Gier2 = 0; |
} |
if((GasMischanteil > 200) && MotorenEin == 0) |
{ |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// auf Nullwerte kalibrieren |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) // Neutralwerte |
{ |
unsigned char setting; |
if(++delay_neutral > 200) // nicht sofort |
{ |
GRN_OFF; |
SetNeutral(); |
MotorenEin = 0; |
delay_neutral = 0; |
modell_fliegt = 0; |
if(PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70 || abs(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]) > 70) |
{ |
if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < 70) setting = 1; |
if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 2; |
if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] < 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 3; |
if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] <-70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 4; |
if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] <-70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < 70) setting = 5; |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], setting); // aktiven Datensatz merken |
} |
ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
Piep(GetActiveParamSetNumber()); |
if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
{ |
if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset(); |
} |
} |
} |
else delay_neutral = 0; |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Gas ist unten |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
if(GasMischanteil < 35) |
{ |
// Starten |
if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] < -75) |
{ |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Einschalten |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
if(++delay_einschalten > 200) |
{ |
delay_einschalten = 200; |
modell_fliegt = 1; |
MotorenEin = 1; |
sollGier = 0; |
Mess_Integral_Gier = 0; |
Mess_Integral_Gier2 = 0; |
Mess_IntegralNick = 0; |
Mess_IntegralRoll = 0; |
Mess_IntegralNick2 = IntegralNick; |
Mess_IntegralRoll2 = IntegralRoll; |
SummeNick = 0; |
SummeRoll = 0; |
} |
} |
else delay_einschalten = 0; |
//Auf Neutralwerte setzen |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Auschalten |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) |
{ |
if(++delay_ausschalten > 200) // nicht sofort |
{ |
MotorenEin = 0; |
delay_ausschalten = 200; |
modell_fliegt = 0; |
} |
} |
else delay_ausschalten = 0; |
} |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// neue Werte von der Funke |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
if(!NewPpmData-- || Notlandung) |
{ |
ParameterZuordnung(); |
StickNick = PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_P; |
StickNick += PPM_diff[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_D; |
StickRoll = PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_P; |
StickRoll += PPM_diff[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_D; |
StickGier = -PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]; |
GyroFaktor = ((float)Parameter_Gyro_P + 10.0) / 256.0; |
IntegralFaktor = ((float) Parameter_Gyro_I) / 44000; |
if(EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) IntegralFaktor = 0; |
if(GyroFaktor < 0) GyroFaktor = 0; |
if(IntegralFaktor < 0) IntegralFaktor = 0; |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// LED Stuff |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
LED1_OFF; |
if(blinkcount_LED1 >= Parameter_UserParam4 && Parameter_UserParam4 > 0) |
{ |
LED1_FLASH; |
blinkcount_LED1 = 0; |
} |
blinkcount_LED1++; |
//if(PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] > 75) LED1_ON; else LED1_OFF; //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
//if(PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] > 75) LED2_ON; else LED2_OFF; //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Bei Empfangsausfall im Flug |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
if(Notlandung) |
{ |
StickGier = 0; |
StickNick = 0; |
StickRoll = 0; |
GyroFaktor = 0.1; |
IntegralFaktor = 0.005; |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Gyro-Drift kompensieren |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#define DRIFT_FAKTOR 3 |
if(ZaehlMessungen >= 1000 / DRIFT_FAKTOR) |
{ |
IntegralFehlerNick = IntegralNick2 - IntegralNick; |
IntegralFehlerRoll = IntegralRoll2 - IntegralRoll; |
ZaehlMessungen = 0; |
if(IntegralFehlerNick > 500/DRIFT_FAKTOR) AdNeutralNick++; |
if(IntegralFehlerNick < -500/DRIFT_FAKTOR) AdNeutralNick--; |
if(IntegralFehlerRoll > 500/DRIFT_FAKTOR) AdNeutralRoll++; |
if(IntegralFehlerRoll < -500/DRIFT_FAKTOR) AdNeutralRoll--; |
if(Mess_Integral_Gier2 > 500/DRIFT_FAKTOR) AdNeutralGier--; |
if(Mess_Integral_Gier2 <-500/DRIFT_FAKTOR) AdNeutralGier++; |
ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
Mess_IntegralNick2 = IntegralNick; |
Mess_IntegralRoll2 = IntegralRoll; |
Mess_Integral_Gier2 = Integral_Gier; |
ANALOG_ON; // ADC einschalten |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Integrale auf ACC-Signal abgleichen |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
tmp_long = (long)(IntegralNick / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccNick) / 16; |
tmp_long2 = (long)(IntegralRoll / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccRoll) / 16; |
#define AUSGLEICH 500 |
if(tmp_long > AUSGLEICH) tmp_long = AUSGLEICH; |
if(tmp_long < -AUSGLEICH) tmp_long =-AUSGLEICH; |
if(tmp_long2 > AUSGLEICH) tmp_long2 = AUSGLEICH; |
if(tmp_long2 <-AUSGLEICH) tmp_long2 =-AUSGLEICH; |
ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
Mess_IntegralNick -= tmp_long; |
Mess_IntegralRoll -= tmp_long2; |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Gieren |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
sollGier = StickGier; |
if(abs(StickGier) > 35) |
{ |
if(!(EE_Parameter.GlobalConfig & CFG_KOMPASS_FIX)) NeueKompassRichtungMerken = 1; |
} |
tmp_int = EE_Parameter.Gier_P * (sollGier * abs(sollGier)) / 256; // expo |
Mess_Integral_Gier -= tmp_int; |
if(Mess_Integral_Gier > 30000) Mess_Integral_Gier = 30000; // begrenzen |
if(Mess_Integral_Gier <-30000) Mess_Integral_Gier =-30000; |
ANALOG_ON; // ADC einschalten |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Kompass |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//KompassValue = 12; |
if(KompassValue && (EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV)) |
{ |
int w,v; |
static int SignalSchlecht = 0; |
w = abs(IntegralNick /512); // mit zunehmender Neigung den Einfluss drosseln |
v = abs(IntegralRoll /512); |
if(v > w) w = v; // grösste Neigung ermitteln |
if(w < 25 && NeueKompassRichtungMerken && !SignalSchlecht) |
{ |
KompassStartwert = KompassValue; |
NeueKompassRichtungMerken = 0; |
} |
w = (w * Parameter_KompassWirkung) / 64; // auf die Wirkung normieren |
w = Parameter_KompassWirkung - w; // Wirkung ggf drosseln |
if(w > 0) |
{ |
ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
if(!SignalSchlecht) Mess_Integral_Gier += (KompassRichtung * w) / 32; // nach Kompass ausrichten |
ANALOG_ON; // ADC einschalten |
if(SignalSchlecht) SignalSchlecht--; |
} |
else SignalSchlecht = 500; // so lange das Signal taub stellen --> ca. 1 sek |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// GPS |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
if(EE_Parameter.GlobalConfig & CFG_GPS_AKTIV) |
{ |
P_GPS_Verstaerkung = Parameter_UserParam1; |
D_GPS_Verstaerkung = Parameter_UserParam2; |
Limit_D_Anteil = Parameter_UserParam3; |
gps_main(); |
} |
else |
{ |
GPS_Nick = 0; |
GPS_Roll = 0; |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Debugwerte zuordnen |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
DebugOut.Sekunden++; |
if(!TimerWerteausgabe--) |
{ |
TimerWerteausgabe = 49; |
//++++++++ANFANG_Legende++++++++ |
/* |
DebugOut.Analog[0] = actualPos.GPSFix; |
DebugOut.Analog[1] = GPS_Nick; |
DebugOut.Analog[2] = GPS_Roll; |
DebugOut.Analog[3] = actualPos.northing; |
DebugOut.Analog[4] = actualPos.easting; |
DebugOut.Analog[5] = NORTH_MITTEL; |
DebugOut.Analog[6] = EAST_MITTEL; |
DebugOut.Analog[7] = Soll_Position_North; |
DebugOut.Analog[8] = Soll_Position_East; |
DebugOut.Analog[9] = GPS_Home_North; |
DebugOut.Analog[10] = GPS_Home_East; |
DebugOut.Analog[11] = GPS_Positionsabweichung_North; |
DebugOut.Analog[12] = GPS_Positionsabweichung_East; |
DebugOut.Analog[13] = Poti1; |
DebugOut.Analog[14] = Poti2; |
DebugOut.Analog[15] = KompassValue; |
*/ |
//++++++++ENDE_Legende++++++++ |
//++++++++ANFANG_Legende_1++++++++ |
DebugOut.Analog[0] = GPS_Roll; |
DebugOut.Analog[1] = GPS_Nick; |
DebugOut.Analog[2] = GPS_Positionsabweichung_North; |
DebugOut.Analog[3] = GPS_Positionsabweichung_East; |
DebugOut.Analog[4] = P_Einfluss_East; |
DebugOut.Analog[5] = D_Einfluss_East; |
DebugOut.Analog[6] = P_Einfluss_North; |
DebugOut.Analog[7] = D_Einfluss_North; |
DebugOut.Analog[8] = GPS_Geschwindigkeit_North; |
DebugOut.Analog[9] = GPS_Geschwindigkeit_East; |
DebugOut.Analog[10] = Parameter_UserParam1; |
DebugOut.Analog[11] = Parameter_UserParam2; |
DebugOut.Analog[12] = Soll_Position_North; |
DebugOut.Analog[13] = Soll_Position_East; |
DebugOut.Analog[14] = Poti6; |
DebugOut.Analog[15] = KompassValue; |
//++++++++ENDE_Legende_1++++++++ |
// DebugOut.Analog[xx] = actualPos.velNorth; |
// DebugOut.Analog[xx] = actualPos.velEast; |
// DebugOut.Analog[xx] = UBat; |
// DebugOut.Analog[xx] = 0; |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Drehgeschwindigkeit und -winkel zu einem Istwert zusammenfassen |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
MesswertNick = IntegralNick * IntegralFaktor + MesswertNick * GyroFaktor; |
MesswertRoll = IntegralRoll * IntegralFaktor + MesswertRoll * GyroFaktor; |
MesswertGier = MesswertGier * (GyroFaktor/2) + Integral_Gier * IntegralFaktor; |
// Maximalwerte abfangen |
#define MAX_SENSOR 2048 |
if(MesswertNick > MAX_SENSOR) MesswertNick = MAX_SENSOR; |
if(MesswertNick < -MAX_SENSOR) MesswertNick = -MAX_SENSOR; |
if(MesswertRoll > MAX_SENSOR) MesswertRoll = MAX_SENSOR; |
if(MesswertRoll < -MAX_SENSOR) MesswertRoll = -MAX_SENSOR; |
if(MesswertGier > MAX_SENSOR) MesswertGier = MAX_SENSOR; |
if(MesswertGier < -MAX_SENSOR) MesswertGier = -MAX_SENSOR; |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Höhenregelung |
// Die Höhenregelung schwächt lediglich das Gas ab, erhöht es allerdings nicht |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//OCR0B = 180 - (Poti1 + 120) / 4; |
//DruckOffsetSetting = OCR0B; |
if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung |
{ |
int tmp_int; |
if(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER) // Regler wird über Schalter gesteuert |
{ |
if(Parameter_MaxHoehe < 50) |
{ |
SollHoehe = HoehenWert - 40; // Parameter_MaxHoehe ist der PPM-Wert des Schalters // (160607Kr) |
HoehenReglerAktiv = 0; |
} |
else |
HoehenReglerAktiv = 1; |
} |
else |
{ |
SollHoehe = Parameter_MaxHoehe * EE_Parameter.Hoehe_Verstaerkung - 40; // (160607Kr) |
HoehenReglerAktiv = 1; |
} |
if(Notlandung) SollHoehe = 0; |
h = HoehenWert; |
if((h > SollHoehe) && HoehenReglerAktiv) // zu hoch --> drosseln |
{ h = ((h - SollHoehe) * (int) Parameter_Hoehe_P) / 16; // Differenz bestimmen --> P-Anteil |
h = GasMischanteil - h; // vom Gas abziehen |
h -= (HoeheD * Parameter_Luftdruck_D)/8; // D-Anteil |
tmp_int = ((Mess_Integral_Hoch / 512) * (signed long) Parameter_Hoehe_ACC_Wirkung) / 32; |
if(tmp_int > 50) tmp_int = 50; |
else if(tmp_int < -50) tmp_int = -50; |
h -= tmp_int; |
hoehenregler = (hoehenregler*15 + h) / 16; |
if(hoehenregler < EE_Parameter.Hoehe_MinGas) // nicht unter MIN |
{ |
if(GasMischanteil >= EE_Parameter.Hoehe_MinGas) hoehenregler = EE_Parameter.Hoehe_MinGas; |
if(GasMischanteil < EE_Parameter.Hoehe_MinGas) hoehenregler = GasMischanteil; |
} |
if(hoehenregler > GasMischanteil) hoehenregler = GasMischanteil; // nicht mehr als Gas |
GasMischanteil = hoehenregler; |
} |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Mischer und PI-Regler |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Gier-Anteil |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
GierMischanteil = MesswertGier - sollGier; // Regler für Gier |
if(GierMischanteil > 100) GierMischanteil = 100; |
if(GierMischanteil < -100) GierMischanteil = -100; |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Nick-Achse |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
DiffNick = Kp * (MesswertNick - (StickNick - GPS_Nick)); // Differenz bestimmen |
SummeNick += DiffNick; // I-Anteil |
if(SummeNick > 0) SummeNick-= (abs(SummeNick)/256 + 1); else SummeNick += abs(SummeNick)/256 + 1; |
if(SummeNick > 16000) SummeNick = 16000; |
if(SummeNick < -16000) SummeNick = -16000; |
pd_ergebnis = DiffNick + Ki * SummeNick; // PI-Regler für Nick |
// Motor Vorn |
motorwert = GasMischanteil + pd_ergebnis + GierMischanteil; // Mischer |
if ((motorwert < 0) | (GasMischanteil < 10)) motorwert = 0; |
else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
Motor_Vorne = motorwert; |
// Motor Heck |
motorwert = GasMischanteil - pd_ergebnis + GierMischanteil; |
if ((motorwert < 0) | (GasMischanteil < 10)) motorwert = 0; |
else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
Motor_Hinten = motorwert; |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Roll-Achse |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
DiffRoll = Kp * (MesswertRoll - (StickRoll - GPS_Roll)); // Differenz bestimmen |
SummeRoll += DiffRoll; // I-Anteil |
if(SummeRoll > 0) SummeRoll-= (abs(SummeRoll)/256 + 1); else SummeRoll += abs(SummeRoll)/256 + 1; |
if(SummeRoll > 16000) SummeRoll = 16000; |
if(SummeRoll < -16000) SummeRoll = -16000; |
pd_ergebnis = DiffRoll + Ki * SummeRoll; // PI-Regler für Roll |
// Motor Links |
motorwert = GasMischanteil + pd_ergebnis - GierMischanteil; |
if ((motorwert < 0) | (GasMischanteil < 10)) motorwert = 0; |
else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
Motor_Links = motorwert; |
// Motor Rechts |
motorwert = GasMischanteil - pd_ergebnis - GierMischanteil; |
if ((motorwert < 0) | (GasMischanteil < 10)) motorwert = 0; |
else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
Motor_Rechts = motorwert; |
// +++++++++++++++++++++++++++++++++++++++++++++++ |
} |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/fc.d |
---|
0,0 → 1,2 |
fc.o fc.d : fc.c main.h old_macros.h _Settings.h printf_P.h timer0.h uart.h \ |
analog.h twimaster.h menu.h rc.h fc.h gps.h |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/fc.h |
---|
0,0 → 1,119 |
/*####################################################################################### |
Flight Control |
#######################################################################################*/ |
#ifndef _FC_H |
#define _FC_H |
extern volatile unsigned char Timeout; |
extern unsigned char Sekunde,Minute; |
extern volatile long IntegralNick,IntegralNick2; |
extern volatile long IntegralRoll,IntegralRoll2; |
extern volatile long Mess_IntegralNick,Mess_IntegralNick2; |
extern volatile long Mess_IntegralRoll,Mess_IntegralRoll2; |
extern volatile long Mess_Integral_Hoch; |
extern volatile long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2; |
extern volatile int KompassValue; |
extern volatile int KompassStartwert; |
extern volatile int KompassRichtung; |
extern int HoehenWert; |
extern int SollHoehe; |
extern volatile int MesswertNick,MesswertRoll,MesswertGier; |
extern volatile int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll; |
extern volatile int NeutralAccX, NeutralAccY,Mittelwert_AccHoch; |
extern volatile float NeutralAccZ; |
extern unsigned int modell_fliegt_gps;//(030907Kr) |
extern unsigned char Limit_D_Anteil;//(210907Kr) |
void MotorRegler(void); |
void SendMotorData(void); |
void CalibrierMittelwert(void); |
void Mittelwert(void); |
void SetNeutral(void); |
void Piep(unsigned char Anzahl); |
void DefaultKonstanten(void); |
void DefaultKonstanten1(void); |
void DefaultKonstanten2(void); |
extern int StickNick,StickRoll,StickGier; |
extern char MotorenEin; |
/* |
extern int Poti1, Poti2, Poti3, Poti4; |
extern volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
*/ |
unsigned char h,m,s; |
volatile unsigned char Timeout ; |
unsigned char CosinusNickWinkel, CosinusRollWinkel; |
volatile long IntegralNick,IntegralNick2; |
volatile long IntegralRoll,IntegralRoll2; |
volatile long Integral_Gier; |
volatile long Mess_IntegralNick,Mess_IntegralNick2; |
volatile long Mess_IntegralRoll,Mess_IntegralRoll2; |
volatile long Mess_Integral_Gier; |
volatile int DiffNick,DiffRoll; |
extern int Poti1, Poti2, Poti3, Poti4, Poti5, Poti6, Poti7, Poti8; |
volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
unsigned char MotorWert[5]; |
volatile unsigned char SenderOkay; |
#define STRUCT_PARAM_LAENGE 58 |
struct mk_param_struct |
{ |
unsigned char Kanalbelegung[8]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3 |
unsigned char GlobalConfig; // 0x01=Höhenregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv |
unsigned char Hoehe_MinGas; // Wert : 0-100 |
unsigned char Luftdruck_D; // Wert : 0-250 |
unsigned char MaxHoehe; // Wert : 0-32 |
unsigned char Hoehe_P; // Wert : 0-32 |
unsigned char Hoehe_Verstaerkung; // Wert : 0-50 |
unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250 |
unsigned char Stick_P; // Wert : 1-6 |
unsigned char Stick_D; // Wert : 0-64 |
unsigned char Gier_P; // Wert : 1-20 |
unsigned char Gas_Min; // Wert : 0-32 |
unsigned char Gas_Max; // Wert : 33-250 |
unsigned char GyroAccFaktor; // Wert : 1-64 |
unsigned char KompassWirkung; // Wert : 0-32 |
unsigned char Gyro_P; // Wert : 10-250 |
unsigned char Gyro_I; // Wert : 0-250 |
unsigned char UnterspannungsWarnung; // Wert : 0-250 |
unsigned char NotGas; // Wert : 0-250 //Gaswert bei Empängsverlust |
unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen |
unsigned char UfoAusrichtung; // X oder + Formation |
unsigned char I_Faktor; // Wert : 0-250 |
unsigned char UserParam1; // Wert : 0-250 |
unsigned char UserParam2; // Wert : 0-250 |
unsigned char UserParam3; // Wert : 0-250 |
unsigned char UserParam4; // Wert : 0-250 |
unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos |
unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo |
unsigned char ServoNickMin; // Wert : 0-250 // Anschlag |
unsigned char ServoNickMax; // Wert : 0-250 // Anschlag |
unsigned char ServoNickRefresh; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
unsigned char ServoNickCompInvert; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
unsigned char Reserved[7]; |
char Name[12]; |
}; |
extern struct mk_param_struct EE_Parameter; |
extern unsigned char Parameter_Luftdruck_D; |
extern unsigned char Parameter_MaxHoehe; |
extern unsigned char Parameter_Hoehe_P; |
extern unsigned char Parameter_Hoehe_ACC_Wirkung; |
extern unsigned char Parameter_KompassWirkung; |
extern unsigned char Parameter_Gyro_P; |
extern unsigned char Parameter_Gyro_I; |
extern unsigned char Parameter_Gier_P; |
extern unsigned char Parameter_ServoNickControl; |
#endif //_FC_H |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/fc.h.bak |
---|
0,0 → 1,117 |
/*####################################################################################### |
Flight Control |
#######################################################################################*/ |
#ifndef _FC_H |
#define _FC_H |
extern volatile unsigned char Timeout; |
extern unsigned char Sekunde,Minute; |
extern volatile long IntegralNick,IntegralNick2; |
extern volatile long IntegralRoll,IntegralRoll2; |
extern volatile long Mess_IntegralNick,Mess_IntegralNick2; |
extern volatile long Mess_IntegralRoll,Mess_IntegralRoll2; |
extern volatile long Mess_Integral_Hoch; |
extern volatile long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2; |
extern volatile int KompassValue; |
extern volatile int KompassStartwert; |
extern volatile int KompassRichtung; |
extern int HoehenWert; |
extern int SollHoehe; |
extern volatile int MesswertNick,MesswertRoll,MesswertGier; |
extern volatile int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll; |
extern volatile int NeutralAccX, NeutralAccY,Mittelwert_AccHoch; |
extern volatile float NeutralAccZ; |
extern unsigned int modell_fliegt_gps;//(030907Kr) |
extern unsigned char Limit_D_Anteil;//(210907Kr) |
void MotorRegler(void); |
void SendMotorData(void); |
void CalibrierMittelwert(void); |
void Mittelwert(void); |
void SetNeutral(void); |
void Piep(unsigned char Anzahl); |
void DefaultKonstanten(void); |
void DefaultKonstanten1(void); |
void DefaultKonstanten2(void); |
extern int StickNick,StickRoll,StickGier; |
extern char MotorenEin; |
extern int Poti1, Poti2, Poti3, Poti4; |
extern volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
/* |
unsigned char h,m,s; |
volatile unsigned char Timeout ; |
unsigned char CosinusNickWinkel, CosinusRollWinkel; |
volatile long IntegralNick,IntegralNick2; |
volatile long IntegralRoll,IntegralRoll2; |
volatile long Integral_Gier; |
volatile long Mess_IntegralNick,Mess_IntegralNick2; |
volatile long Mess_IntegralRoll,Mess_IntegralRoll2; |
volatile long Mess_Integral_Gier; |
volatile int DiffNick,DiffRoll; |
extern int Poti1, Poti2, Poti3, Poti4, Poti5, Poti6, Poti7, Poti8; |
volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
unsigned char MotorWert[5]; |
volatile unsigned char SenderOkay; |
*/ |
#define STRUCT_PARAM_LAENGE 58 |
struct mk_param_struct |
{ |
unsigned char Kanalbelegung[8]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3 |
unsigned char GlobalConfig; // 0x01=Höhenregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv |
unsigned char Hoehe_MinGas; // Wert : 0-100 |
unsigned char Luftdruck_D; // Wert : 0-250 |
unsigned char MaxHoehe; // Wert : 0-32 |
unsigned char Hoehe_P; // Wert : 0-32 |
unsigned char Hoehe_Verstaerkung; // Wert : 0-50 |
unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250 |
unsigned char Stick_P; // Wert : 1-6 |
unsigned char Stick_D; // Wert : 0-64 |
unsigned char Gier_P; // Wert : 1-20 |
unsigned char Gas_Min; // Wert : 0-32 |
unsigned char Gas_Max; // Wert : 33-250 |
unsigned char GyroAccFaktor; // Wert : 1-64 |
unsigned char KompassWirkung; // Wert : 0-32 |
unsigned char Gyro_P; // Wert : 10-250 |
unsigned char Gyro_I; // Wert : 0-250 |
unsigned char UnterspannungsWarnung; // Wert : 0-250 |
unsigned char NotGas; // Wert : 0-250 //Gaswert bei Empängsverlust |
unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen |
unsigned char UfoAusrichtung; // X oder + Formation |
unsigned char I_Faktor; // Wert : 0-250 |
unsigned char UserParam1; // Wert : 0-250 |
unsigned char UserParam2; // Wert : 0-250 |
unsigned char UserParam3; // Wert : 0-250 |
unsigned char UserParam4; // Wert : 0-250 |
unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos |
unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo |
unsigned char ServoNickMin; // Wert : 0-250 // Anschlag |
unsigned char ServoNickMax; // Wert : 0-250 // Anschlag |
unsigned char ServoNickRefresh; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
unsigned char ServoNickCompInvert; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
unsigned char Reserved[7]; |
char Name[12]; |
}; |
extern struct mk_param_struct EE_Parameter; |
extern unsigned char Parameter_Luftdruck_D; |
extern unsigned char Parameter_MaxHoehe; |
extern unsigned char Parameter_Hoehe_P; |
extern unsigned char Parameter_Hoehe_ACC_Wirkung; |
extern unsigned char Parameter_KompassWirkung; |
extern unsigned char Parameter_Gyro_P; |
extern unsigned char Parameter_Gyro_I; |
extern unsigned char Parameter_Gier_P; |
extern unsigned char Parameter_ServoNickControl; |
#endif //_FC_H |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/fc.lst |
---|
0,0 → 1,4908 |
1 .file "fc.c" |
2 .arch atmega644 |
3 __SREG__ = 0x3f |
4 __SP_H__ = 0x3e |
5 __SP_L__ = 0x3d |
6 __tmp_reg__ = 0 |
7 __zero_reg__ = 1 |
8 .global __do_copy_data |
9 .global __do_clear_bss |
10 .text |
11 .global Mittelwert |
13 Mittelwert: |
14 /* prologue: frame size=0 */ |
15 0000 AF92 push r10 |
16 0002 BF92 push r11 |
17 0004 CF92 push r12 |
18 0006 DF92 push r13 |
19 0008 EF92 push r14 |
20 000a FF92 push r15 |
21 000c 0F93 push r16 |
22 000e 1F93 push r17 |
23 /* prologue end (size=8) */ |
24 0010 1092 7A00 sts 122,__zero_reg__ |
25 0014 8091 0000 lds r24,MessanzahlNick |
26 0018 8823 tst r24 |
27 001a 01F0 breq .L2 |
28 001c 8091 0000 lds r24,AccumulateNick |
29 0020 9091 0000 lds r25,(AccumulateNick)+1 |
30 0024 6091 0000 lds r22,MessanzahlNick |
31 0028 7727 clr r23 |
32 002a 0E94 0000 call __divmodhi4 |
33 002e 7093 0000 sts (MesswertNick)+1,r23 |
34 0032 6093 0000 sts MesswertNick,r22 |
35 .L2: |
36 0036 8091 0000 lds r24,MessanzahlRoll |
37 003a 8823 tst r24 |
38 003c 01F0 breq .L4 |
39 003e 8091 0000 lds r24,AccumulateRoll |
40 0042 9091 0000 lds r25,(AccumulateRoll)+1 |
41 0046 6091 0000 lds r22,MessanzahlRoll |
42 004a 7727 clr r23 |
43 004c 0E94 0000 call __divmodhi4 |
44 0050 7093 0000 sts (MesswertRoll)+1,r23 |
45 0054 6093 0000 sts MesswertRoll,r22 |
46 .L4: |
47 0058 8091 0000 lds r24,MessanzahlGier |
48 005c 8823 tst r24 |
49 005e 01F0 breq .L6 |
50 0060 8091 0000 lds r24,AccumulateGier |
51 0064 9091 0000 lds r25,(AccumulateGier)+1 |
52 0068 6091 0000 lds r22,MessanzahlGier |
53 006c 7727 clr r23 |
54 006e 0E94 0000 call __divmodhi4 |
55 0072 7093 0000 sts (MesswertGier)+1,r23 |
56 0076 6093 0000 sts MesswertGier,r22 |
57 .L6: |
58 007a 8091 0000 lds r24,messanzahl_AccNick |
59 007e 8823 tst r24 |
60 0080 01F0 breq .L8 |
61 0082 E090 0000 lds r14,Mittelwert_AccNick |
62 0086 F090 0000 lds r15,(Mittelwert_AccNick)+1 |
63 008a 6091 0000 lds r22,accumulate_AccNick |
64 008e 7091 0000 lds r23,(accumulate_AccNick)+1 |
65 0092 2091 0000 lds r18,messanzahl_AccNick |
66 0096 0027 clr r16 |
67 0098 F7FC sbrc r15,7 |
68 009a 0095 com r16 |
69 009c 102F mov r17,r16 |
70 009e 5701 movw r10,r14 |
71 00a0 6801 movw r12,r16 |
72 00a2 43E0 ldi r20,3 |
73 00a4 AA0C 1: lsl r10 |
74 00a6 BB1C rol r11 |
75 00a8 CC1C rol r12 |
76 00aa DD1C rol r13 |
77 00ac 4A95 dec r20 |
78 00ae 01F4 brne 1b |
79 00b0 AE18 sub r10,r14 |
80 00b2 BF08 sbc r11,r15 |
81 00b4 C00A sbc r12,r16 |
82 00b6 D10A sbc r13,r17 |
83 00b8 8827 clr r24 |
84 00ba 77FD sbrc r23,7 |
85 00bc 8095 com r24 |
86 00be 982F mov r25,r24 |
87 00c0 34E0 ldi r19,4 |
88 00c2 660F 1: lsl r22 |
89 00c4 771F rol r23 |
90 00c6 881F rol r24 |
91 00c8 991F rol r25 |
92 00ca 3A95 dec r19 |
93 00cc 01F4 brne 1b |
94 00ce 3327 clr r19 |
95 00d0 4427 clr r20 |
96 00d2 5527 clr r21 |
97 00d4 0E94 0000 call __divmodsi4 |
98 00d8 A20E add r10,r18 |
99 00da B31E adc r11,r19 |
100 00dc C41E adc r12,r20 |
101 00de D51E adc r13,r21 |
102 00e0 C601 movw r24,r12 |
103 00e2 B501 movw r22,r10 |
104 00e4 28E0 ldi r18,lo8(8) |
105 00e6 30E0 ldi r19,hi8(8) |
106 00e8 40E0 ldi r20,hlo8(8) |
107 00ea 50E0 ldi r21,hhi8(8) |
108 00ec 0E94 0000 call __divmodsi4 |
109 00f0 3093 0000 sts (Mittelwert_AccNick)+1,r19 |
110 00f4 2093 0000 sts Mittelwert_AccNick,r18 |
111 .L8: |
112 00f8 8091 0000 lds r24,messanzahl_AccRoll |
113 00fc 8823 tst r24 |
114 00fe 01F0 breq .L10 |
115 0100 E090 0000 lds r14,Mittelwert_AccRoll |
116 0104 F090 0000 lds r15,(Mittelwert_AccRoll)+1 |
117 0108 6091 0000 lds r22,accumulate_AccRoll |
118 010c 7091 0000 lds r23,(accumulate_AccRoll)+1 |
119 0110 2091 0000 lds r18,messanzahl_AccRoll |
120 0114 0027 clr r16 |
121 0116 F7FC sbrc r15,7 |
122 0118 0095 com r16 |
123 011a 102F mov r17,r16 |
124 011c 5701 movw r10,r14 |
125 011e 6801 movw r12,r16 |
126 0120 83E0 ldi r24,3 |
127 0122 AA0C 1: lsl r10 |
128 0124 BB1C rol r11 |
129 0126 CC1C rol r12 |
130 0128 DD1C rol r13 |
131 012a 8A95 dec r24 |
132 012c 01F4 brne 1b |
133 012e AE18 sub r10,r14 |
134 0130 BF08 sbc r11,r15 |
135 0132 C00A sbc r12,r16 |
136 0134 D10A sbc r13,r17 |
137 0136 8827 clr r24 |
138 0138 77FD sbrc r23,7 |
139 013a 8095 com r24 |
140 013c 982F mov r25,r24 |
141 013e B4E0 ldi r27,4 |
142 0140 660F 1: lsl r22 |
143 0142 771F rol r23 |
144 0144 881F rol r24 |
145 0146 991F rol r25 |
146 0148 BA95 dec r27 |
147 014a 01F4 brne 1b |
148 014c 3327 clr r19 |
149 014e 4427 clr r20 |
150 0150 5527 clr r21 |
151 0152 0E94 0000 call __divmodsi4 |
152 0156 A20E add r10,r18 |
153 0158 B31E adc r11,r19 |
154 015a C41E adc r12,r20 |
155 015c D51E adc r13,r21 |
156 015e C601 movw r24,r12 |
157 0160 B501 movw r22,r10 |
158 0162 28E0 ldi r18,lo8(8) |
159 0164 30E0 ldi r19,hi8(8) |
160 0166 40E0 ldi r20,hlo8(8) |
161 0168 50E0 ldi r21,hhi8(8) |
162 016a 0E94 0000 call __divmodsi4 |
163 016e 3093 0000 sts (Mittelwert_AccRoll)+1,r19 |
164 0172 2093 0000 sts Mittelwert_AccRoll,r18 |
165 .L10: |
166 0176 8091 0000 lds r24,messanzahl_AccHoch |
167 017a 8823 tst r24 |
168 017c 01F0 breq .L12 |
169 017e E090 0000 lds r14,Mittelwert_AccHoch |
170 0182 F090 0000 lds r15,(Mittelwert_AccHoch)+1 |
171 0186 6091 0000 lds r22,accumulate_AccHoch |
172 018a 7091 0000 lds r23,(accumulate_AccHoch)+1 |
173 018e 2091 0000 lds r18,messanzahl_AccHoch |
174 0192 0027 clr r16 |
175 0194 F7FC sbrc r15,7 |
176 0196 0095 com r16 |
177 0198 102F mov r17,r16 |
178 019a 5701 movw r10,r14 |
179 019c 6801 movw r12,r16 |
180 019e A3E0 ldi r26,3 |
181 01a0 AA0C 1: lsl r10 |
182 01a2 BB1C rol r11 |
183 01a4 CC1C rol r12 |
184 01a6 DD1C rol r13 |
185 01a8 AA95 dec r26 |
186 01aa 01F4 brne 1b |
187 01ac AE18 sub r10,r14 |
188 01ae BF08 sbc r11,r15 |
189 01b0 C00A sbc r12,r16 |
190 01b2 D10A sbc r13,r17 |
191 01b4 8827 clr r24 |
192 01b6 77FD sbrc r23,7 |
193 01b8 8095 com r24 |
194 01ba 982F mov r25,r24 |
195 01bc 3327 clr r19 |
196 01be 4427 clr r20 |
197 01c0 5527 clr r21 |
198 01c2 0E94 0000 call __divmodsi4 |
199 01c6 A20E add r10,r18 |
200 01c8 B31E adc r11,r19 |
201 01ca C41E adc r12,r20 |
202 01cc D51E adc r13,r21 |
203 01ce C601 movw r24,r12 |
204 01d0 B501 movw r22,r10 |
205 01d2 28E0 ldi r18,lo8(8) |
206 01d4 30E0 ldi r19,hi8(8) |
207 01d6 40E0 ldi r20,hlo8(8) |
208 01d8 50E0 ldi r21,hhi8(8) |
209 01da 0E94 0000 call __divmodsi4 |
210 01de 3093 0000 sts (Mittelwert_AccHoch)+1,r19 |
211 01e2 2093 0000 sts Mittelwert_AccHoch,r18 |
212 .L12: |
213 01e6 1092 0000 sts (AccumulateNick)+1,__zero_reg__ |
214 01ea 1092 0000 sts AccumulateNick,__zero_reg__ |
215 01ee 1092 0000 sts MessanzahlNick,__zero_reg__ |
216 01f2 1092 0000 sts (AccumulateRoll)+1,__zero_reg__ |
217 01f6 1092 0000 sts AccumulateRoll,__zero_reg__ |
218 01fa 1092 0000 sts MessanzahlRoll,__zero_reg__ |
219 01fe 1092 0000 sts (AccumulateGier)+1,__zero_reg__ |
220 0202 1092 0000 sts AccumulateGier,__zero_reg__ |
221 0206 1092 0000 sts MessanzahlGier,__zero_reg__ |
222 020a 1092 0000 sts (accumulate_AccRoll)+1,__zero_reg__ |
223 020e 1092 0000 sts accumulate_AccRoll,__zero_reg__ |
224 0212 1092 0000 sts messanzahl_AccRoll,__zero_reg__ |
225 0216 1092 0000 sts (accumulate_AccNick)+1,__zero_reg__ |
226 021a 1092 0000 sts accumulate_AccNick,__zero_reg__ |
227 021e 1092 0000 sts messanzahl_AccNick,__zero_reg__ |
228 0222 1092 0000 sts (accumulate_AccHoch)+1,__zero_reg__ |
229 0226 1092 0000 sts accumulate_AccHoch,__zero_reg__ |
230 022a 1092 0000 sts messanzahl_AccHoch,__zero_reg__ |
231 022e 8091 0000 lds r24,Mess_Integral_Gier |
232 0232 9091 0000 lds r25,(Mess_Integral_Gier)+1 |
233 0236 A091 0000 lds r26,(Mess_Integral_Gier)+2 |
234 023a B091 0000 lds r27,(Mess_Integral_Gier)+3 |
235 023e 8093 0000 sts Integral_Gier,r24 |
236 0242 9093 0000 sts (Integral_Gier)+1,r25 |
237 0246 A093 0000 sts (Integral_Gier)+2,r26 |
238 024a B093 0000 sts (Integral_Gier)+3,r27 |
239 024e 8091 0000 lds r24,Mess_IntegralNick |
240 0252 9091 0000 lds r25,(Mess_IntegralNick)+1 |
241 0256 A091 0000 lds r26,(Mess_IntegralNick)+2 |
242 025a B091 0000 lds r27,(Mess_IntegralNick)+3 |
243 025e 8093 0000 sts IntegralNick,r24 |
244 0262 9093 0000 sts (IntegralNick)+1,r25 |
245 0266 A093 0000 sts (IntegralNick)+2,r26 |
246 026a B093 0000 sts (IntegralNick)+3,r27 |
247 026e 8091 0000 lds r24,Mess_IntegralRoll |
248 0272 9091 0000 lds r25,(Mess_IntegralRoll)+1 |
249 0276 A091 0000 lds r26,(Mess_IntegralRoll)+2 |
250 027a B091 0000 lds r27,(Mess_IntegralRoll)+3 |
251 027e 8093 0000 sts IntegralRoll,r24 |
252 0282 9093 0000 sts (IntegralRoll)+1,r25 |
253 0286 A093 0000 sts (IntegralRoll)+2,r26 |
254 028a B093 0000 sts (IntegralRoll)+3,r27 |
255 028e 8091 0000 lds r24,Mess_IntegralNick2 |
256 0292 9091 0000 lds r25,(Mess_IntegralNick2)+1 |
257 0296 A091 0000 lds r26,(Mess_IntegralNick2)+2 |
258 029a B091 0000 lds r27,(Mess_IntegralNick2)+3 |
259 029e 8093 0000 sts IntegralNick2,r24 |
260 02a2 9093 0000 sts (IntegralNick2)+1,r25 |
261 02a6 A093 0000 sts (IntegralNick2)+2,r26 |
262 02aa B093 0000 sts (IntegralNick2)+3,r27 |
263 02ae 8091 0000 lds r24,Mess_IntegralRoll2 |
264 02b2 9091 0000 lds r25,(Mess_IntegralRoll2)+1 |
265 02b6 A091 0000 lds r26,(Mess_IntegralRoll2)+2 |
266 02ba B091 0000 lds r27,(Mess_IntegralRoll2)+3 |
267 02be 8093 0000 sts IntegralRoll2,r24 |
268 02c2 9093 0000 sts (IntegralRoll2)+1,r25 |
269 02c6 A093 0000 sts (IntegralRoll2)+2,r26 |
270 02ca B093 0000 sts (IntegralRoll2)+3,r27 |
271 02ce 8FEE ldi r24,lo8(-17) |
272 02d0 8093 7A00 sts 122,r24 |
273 02d4 8091 0000 lds r24,MesswertNick |
274 02d8 9091 0000 lds r25,(MesswertNick)+1 |
275 02dc 893C cpi r24,201 |
276 02de 9105 cpc r25,__zero_reg__ |
277 02e0 04F0 brlt .L14 |
278 02e2 2091 0000 lds r18,MesswertNick |
279 02e6 3091 0000 lds r19,(MesswertNick)+1 |
280 02ea 8091 0000 lds r24,MesswertNick |
281 02ee 9091 0000 lds r25,(MesswertNick)+1 |
282 02f2 880F lsl r24 |
283 02f4 991F rol r25 |
284 02f6 880F lsl r24 |
285 02f8 991F rol r25 |
286 02fa 2052 subi r18,lo8(-(-800)) |
287 02fc 3340 sbci r19,hi8(-(-800)) |
288 02fe 00C0 rjmp .L95 |
289 .L14: |
290 0300 8091 0000 lds r24,MesswertNick |
291 0304 9091 0000 lds r25,(MesswertNick)+1 |
292 0308 8853 subi r24,lo8(-200) |
293 030a 9F4F sbci r25,hi8(-200) |
294 030c 04F4 brge .L16 |
295 030e 2091 0000 lds r18,MesswertNick |
296 0312 3091 0000 lds r19,(MesswertNick)+1 |
297 0316 8091 0000 lds r24,MesswertNick |
298 031a 9091 0000 lds r25,(MesswertNick)+1 |
299 031e 880F lsl r24 |
300 0320 991F rol r25 |
301 0322 880F lsl r24 |
302 0324 991F rol r25 |
303 0326 205E subi r18,lo8(-(800)) |
304 0328 3C4F sbci r19,hi8(-(800)) |
305 .L95: |
306 032a 820F add r24,r18 |
307 032c 931F adc r25,r19 |
308 032e 9093 0000 sts (MesswertNick)+1,r25 |
309 0332 8093 0000 sts MesswertNick,r24 |
310 .L16: |
311 0336 8091 0000 lds r24,MesswertRoll |
312 033a 9091 0000 lds r25,(MesswertRoll)+1 |
313 033e 893C cpi r24,201 |
314 0340 9105 cpc r25,__zero_reg__ |
315 0342 04F0 brlt .L18 |
316 0344 2091 0000 lds r18,MesswertRoll |
317 0348 3091 0000 lds r19,(MesswertRoll)+1 |
318 034c 8091 0000 lds r24,MesswertRoll |
319 0350 9091 0000 lds r25,(MesswertRoll)+1 |
320 0354 880F lsl r24 |
321 0356 991F rol r25 |
322 0358 880F lsl r24 |
323 035a 991F rol r25 |
324 035c 2052 subi r18,lo8(-(-800)) |
325 035e 3340 sbci r19,hi8(-(-800)) |
326 0360 00C0 rjmp .L96 |
327 .L18: |
328 0362 8091 0000 lds r24,MesswertRoll |
329 0366 9091 0000 lds r25,(MesswertRoll)+1 |
330 036a 8853 subi r24,lo8(-200) |
331 036c 9F4F sbci r25,hi8(-200) |
332 036e 04F4 brge .L20 |
333 0370 2091 0000 lds r18,MesswertRoll |
334 0374 3091 0000 lds r19,(MesswertRoll)+1 |
335 0378 8091 0000 lds r24,MesswertRoll |
336 037c 9091 0000 lds r25,(MesswertRoll)+1 |
337 0380 880F lsl r24 |
338 0382 991F rol r25 |
339 0384 880F lsl r24 |
340 0386 991F rol r25 |
341 0388 205E subi r18,lo8(-(800)) |
342 038a 3C4F sbci r19,hi8(-(800)) |
343 .L96: |
344 038c 820F add r24,r18 |
345 038e 931F adc r25,r19 |
346 0390 9093 0000 sts (MesswertRoll)+1,r25 |
347 0394 8093 0000 sts MesswertRoll,r24 |
348 .L20: |
349 0398 2091 0000 lds r18,Poti1 |
350 039c 3091 0000 lds r19,(Poti1)+1 |
351 03a0 8091 0000 lds r24,EE_Parameter+4 |
352 03a4 E82F mov r30,r24 |
353 03a6 FF27 clr r31 |
354 03a8 EE0F lsl r30 |
355 03aa FF1F rol r31 |
356 03ac E050 subi r30,lo8(-(PPM_in)) |
357 03ae F040 sbci r31,hi8(-(PPM_in)) |
358 03b0 8081 ld r24,Z |
359 03b2 9181 ldd r25,Z+1 |
360 03b4 8259 subi r24,lo8(-(110)) |
361 03b6 9F4F sbci r25,hi8(-(110)) |
362 03b8 2817 cp r18,r24 |
363 03ba 3907 cpc r19,r25 |
364 03bc 04F4 brge .L22 |
365 03be 2F5F subi r18,lo8(-(1)) |
366 03c0 3F4F sbci r19,hi8(-(1)) |
367 03c2 00C0 rjmp .L97 |
368 .L22: |
369 03c4 8081 ld r24,Z |
370 03c6 9181 ldd r25,Z+1 |
371 03c8 8259 subi r24,lo8(-(110)) |
372 03ca 9F4F sbci r25,hi8(-(110)) |
373 03cc 8217 cp r24,r18 |
374 03ce 9307 cpc r25,r19 |
375 03d0 04F4 brge .L24 |
376 03d2 2115 cp r18,__zero_reg__ |
377 03d4 3105 cpc r19,__zero_reg__ |
378 03d6 01F0 breq .L24 |
379 03d8 2150 subi r18,lo8(-(-1)) |
380 03da 3040 sbci r19,hi8(-(-1)) |
381 .L97: |
382 03dc 3093 0000 sts (Poti1)+1,r19 |
383 03e0 2093 0000 sts Poti1,r18 |
384 .L24: |
385 03e4 2091 0000 lds r18,Poti2 |
386 03e8 3091 0000 lds r19,(Poti2)+1 |
387 03ec 8091 0000 lds r24,EE_Parameter+5 |
388 03f0 E82F mov r30,r24 |
389 03f2 FF27 clr r31 |
390 03f4 EE0F lsl r30 |
391 03f6 FF1F rol r31 |
392 03f8 E050 subi r30,lo8(-(PPM_in)) |
393 03fa F040 sbci r31,hi8(-(PPM_in)) |
394 03fc 8081 ld r24,Z |
395 03fe 9181 ldd r25,Z+1 |
396 0400 8259 subi r24,lo8(-(110)) |
397 0402 9F4F sbci r25,hi8(-(110)) |
398 0404 2817 cp r18,r24 |
399 0406 3907 cpc r19,r25 |
400 0408 04F4 brge .L27 |
401 040a 2F5F subi r18,lo8(-(1)) |
402 040c 3F4F sbci r19,hi8(-(1)) |
403 040e 00C0 rjmp .L98 |
404 .L27: |
405 0410 8081 ld r24,Z |
406 0412 9181 ldd r25,Z+1 |
407 0414 8259 subi r24,lo8(-(110)) |
408 0416 9F4F sbci r25,hi8(-(110)) |
409 0418 8217 cp r24,r18 |
410 041a 9307 cpc r25,r19 |
411 041c 04F4 brge .L29 |
412 041e 2115 cp r18,__zero_reg__ |
413 0420 3105 cpc r19,__zero_reg__ |
414 0422 01F0 breq .L29 |
415 0424 2150 subi r18,lo8(-(-1)) |
416 0426 3040 sbci r19,hi8(-(-1)) |
417 .L98: |
418 0428 3093 0000 sts (Poti2)+1,r19 |
419 042c 2093 0000 sts Poti2,r18 |
420 .L29: |
421 0430 2091 0000 lds r18,Poti3 |
422 0434 3091 0000 lds r19,(Poti3)+1 |
423 0438 8091 0000 lds r24,EE_Parameter+6 |
424 043c E82F mov r30,r24 |
425 043e FF27 clr r31 |
426 0440 EE0F lsl r30 |
427 0442 FF1F rol r31 |
428 0444 E050 subi r30,lo8(-(PPM_in)) |
429 0446 F040 sbci r31,hi8(-(PPM_in)) |
430 0448 8081 ld r24,Z |
431 044a 9181 ldd r25,Z+1 |
432 044c 8259 subi r24,lo8(-(110)) |
433 044e 9F4F sbci r25,hi8(-(110)) |
434 0450 2817 cp r18,r24 |
435 0452 3907 cpc r19,r25 |
436 0454 04F4 brge .L32 |
437 0456 2F5F subi r18,lo8(-(1)) |
438 0458 3F4F sbci r19,hi8(-(1)) |
439 045a 00C0 rjmp .L99 |
440 .L32: |
441 045c 8081 ld r24,Z |
442 045e 9181 ldd r25,Z+1 |
443 0460 8259 subi r24,lo8(-(110)) |
444 0462 9F4F sbci r25,hi8(-(110)) |
445 0464 8217 cp r24,r18 |
446 0466 9307 cpc r25,r19 |
447 0468 04F4 brge .L34 |
448 046a 2115 cp r18,__zero_reg__ |
449 046c 3105 cpc r19,__zero_reg__ |
450 046e 01F0 breq .L34 |
451 0470 2150 subi r18,lo8(-(-1)) |
452 0472 3040 sbci r19,hi8(-(-1)) |
453 .L99: |
454 0474 3093 0000 sts (Poti3)+1,r19 |
455 0478 2093 0000 sts Poti3,r18 |
456 .L34: |
457 047c 2091 0000 lds r18,Poti4 |
458 0480 3091 0000 lds r19,(Poti4)+1 |
459 0484 8091 0000 lds r24,EE_Parameter+7 |
460 0488 E82F mov r30,r24 |
461 048a FF27 clr r31 |
462 048c EE0F lsl r30 |
463 048e FF1F rol r31 |
464 0490 E050 subi r30,lo8(-(PPM_in)) |
465 0492 F040 sbci r31,hi8(-(PPM_in)) |
466 0494 8081 ld r24,Z |
467 0496 9181 ldd r25,Z+1 |
468 0498 8259 subi r24,lo8(-(110)) |
469 049a 9F4F sbci r25,hi8(-(110)) |
470 049c 2817 cp r18,r24 |
471 049e 3907 cpc r19,r25 |
472 04a0 04F4 brge .L37 |
473 04a2 2F5F subi r18,lo8(-(1)) |
474 04a4 3F4F sbci r19,hi8(-(1)) |
475 04a6 00C0 rjmp .L100 |
476 .L37: |
477 04a8 8081 ld r24,Z |
478 04aa 9181 ldd r25,Z+1 |
479 04ac 8259 subi r24,lo8(-(110)) |
480 04ae 9F4F sbci r25,hi8(-(110)) |
481 04b0 8217 cp r24,r18 |
482 04b2 9307 cpc r25,r19 |
483 04b4 04F4 brge .L39 |
484 04b6 2115 cp r18,__zero_reg__ |
485 04b8 3105 cpc r19,__zero_reg__ |
486 04ba 01F0 breq .L39 |
487 04bc 2150 subi r18,lo8(-(-1)) |
488 04be 3040 sbci r19,hi8(-(-1)) |
489 .L100: |
490 04c0 3093 0000 sts (Poti4)+1,r19 |
491 04c4 2093 0000 sts Poti4,r18 |
492 .L39: |
493 04c8 2091 0000 lds r18,Poti5 |
494 04cc 3091 0000 lds r19,(Poti5)+1 |
495 04d0 8091 0000 lds r24,PPM_in+18 |
496 04d4 9091 0000 lds r25,(PPM_in+18)+1 |
497 04d8 8259 subi r24,lo8(-(110)) |
498 04da 9F4F sbci r25,hi8(-(110)) |
499 04dc 2817 cp r18,r24 |
500 04de 3907 cpc r19,r25 |
501 04e0 04F4 brge .L42 |
502 04e2 2F5F subi r18,lo8(-(1)) |
503 04e4 3F4F sbci r19,hi8(-(1)) |
504 04e6 00C0 rjmp .L101 |
505 .L42: |
506 04e8 8091 0000 lds r24,PPM_in+18 |
507 04ec 9091 0000 lds r25,(PPM_in+18)+1 |
508 04f0 8259 subi r24,lo8(-(110)) |
509 04f2 9F4F sbci r25,hi8(-(110)) |
510 04f4 8217 cp r24,r18 |
511 04f6 9307 cpc r25,r19 |
512 04f8 04F4 brge .L44 |
513 04fa 2115 cp r18,__zero_reg__ |
514 04fc 3105 cpc r19,__zero_reg__ |
515 04fe 01F0 breq .L44 |
516 0500 2150 subi r18,lo8(-(-1)) |
517 0502 3040 sbci r19,hi8(-(-1)) |
518 .L101: |
519 0504 3093 0000 sts (Poti5)+1,r19 |
520 0508 2093 0000 sts Poti5,r18 |
521 .L44: |
522 050c 2091 0000 lds r18,Poti6 |
523 0510 3091 0000 lds r19,(Poti6)+1 |
524 0514 8091 0000 lds r24,PPM_in+20 |
525 0518 9091 0000 lds r25,(PPM_in+20)+1 |
526 051c 8259 subi r24,lo8(-(110)) |
527 051e 9F4F sbci r25,hi8(-(110)) |
528 0520 2817 cp r18,r24 |
529 0522 3907 cpc r19,r25 |
530 0524 04F4 brge .L47 |
531 0526 2F5F subi r18,lo8(-(1)) |
532 0528 3F4F sbci r19,hi8(-(1)) |
533 052a 00C0 rjmp .L102 |
534 .L47: |
535 052c 8091 0000 lds r24,PPM_in+20 |
536 0530 9091 0000 lds r25,(PPM_in+20)+1 |
537 0534 8259 subi r24,lo8(-(110)) |
538 0536 9F4F sbci r25,hi8(-(110)) |
539 0538 8217 cp r24,r18 |
540 053a 9307 cpc r25,r19 |
541 053c 04F4 brge .L49 |
542 053e 2115 cp r18,__zero_reg__ |
543 0540 3105 cpc r19,__zero_reg__ |
544 0542 01F0 breq .L49 |
545 0544 2150 subi r18,lo8(-(-1)) |
546 0546 3040 sbci r19,hi8(-(-1)) |
547 .L102: |
548 0548 3093 0000 sts (Poti6)+1,r19 |
549 054c 2093 0000 sts Poti6,r18 |
550 .L49: |
551 0550 2091 0000 lds r18,Poti7 |
552 0554 3091 0000 lds r19,(Poti7)+1 |
553 0558 8091 0000 lds r24,PPM_in+22 |
554 055c 9091 0000 lds r25,(PPM_in+22)+1 |
555 0560 8259 subi r24,lo8(-(110)) |
556 0562 9F4F sbci r25,hi8(-(110)) |
557 0564 2817 cp r18,r24 |
558 0566 3907 cpc r19,r25 |
559 0568 04F4 brge .L52 |
560 056a 2F5F subi r18,lo8(-(1)) |
561 056c 3F4F sbci r19,hi8(-(1)) |
562 056e 00C0 rjmp .L103 |
563 .L52: |
564 0570 8091 0000 lds r24,PPM_in+22 |
565 0574 9091 0000 lds r25,(PPM_in+22)+1 |
566 0578 8259 subi r24,lo8(-(110)) |
567 057a 9F4F sbci r25,hi8(-(110)) |
568 057c 8217 cp r24,r18 |
569 057e 9307 cpc r25,r19 |
570 0580 04F4 brge .L54 |
571 0582 2115 cp r18,__zero_reg__ |
572 0584 3105 cpc r19,__zero_reg__ |
573 0586 01F0 breq .L54 |
574 0588 2150 subi r18,lo8(-(-1)) |
575 058a 3040 sbci r19,hi8(-(-1)) |
576 .L103: |
577 058c 3093 0000 sts (Poti7)+1,r19 |
578 0590 2093 0000 sts Poti7,r18 |
579 .L54: |
580 0594 2091 0000 lds r18,Poti8 |
581 0598 3091 0000 lds r19,(Poti8)+1 |
582 059c 8091 0000 lds r24,PPM_in+24 |
583 05a0 9091 0000 lds r25,(PPM_in+24)+1 |
584 05a4 8259 subi r24,lo8(-(110)) |
585 05a6 9F4F sbci r25,hi8(-(110)) |
586 05a8 2817 cp r18,r24 |
587 05aa 3907 cpc r19,r25 |
588 05ac 04F4 brge .L57 |
589 05ae 2F5F subi r18,lo8(-(1)) |
590 05b0 3F4F sbci r19,hi8(-(1)) |
591 05b2 00C0 rjmp .L104 |
592 .L57: |
593 05b4 8091 0000 lds r24,PPM_in+24 |
594 05b8 9091 0000 lds r25,(PPM_in+24)+1 |
595 05bc 8259 subi r24,lo8(-(110)) |
596 05be 9F4F sbci r25,hi8(-(110)) |
597 05c0 8217 cp r24,r18 |
598 05c2 9307 cpc r25,r19 |
599 05c4 04F4 brge .L59 |
600 05c6 2115 cp r18,__zero_reg__ |
601 05c8 3105 cpc r19,__zero_reg__ |
602 05ca 01F0 breq .L59 |
603 05cc 2150 subi r18,lo8(-(-1)) |
604 05ce 3040 sbci r19,hi8(-(-1)) |
605 .L104: |
606 05d0 3093 0000 sts (Poti8)+1,r19 |
607 05d4 2093 0000 sts Poti8,r18 |
608 .L59: |
609 05d8 8091 0000 lds r24,Poti1 |
610 05dc 9091 0000 lds r25,(Poti1)+1 |
611 05e0 97FF sbrs r25,7 |
612 05e2 00C0 rjmp .L62 |
613 05e4 1092 0000 sts (Poti1)+1,__zero_reg__ |
614 05e8 1092 0000 sts Poti1,__zero_reg__ |
615 05ec 00C0 rjmp .L64 |
616 .L62: |
617 05ee 8F3F cpi r24,255 |
618 05f0 9105 cpc r25,__zero_reg__ |
619 05f2 01F0 breq .L64 |
620 05f4 04F0 brlt .L64 |
621 05f6 8FEF ldi r24,lo8(255) |
622 05f8 90E0 ldi r25,hi8(255) |
623 05fa 9093 0000 sts (Poti1)+1,r25 |
624 05fe 8093 0000 sts Poti1,r24 |
625 .L64: |
626 0602 8091 0000 lds r24,Poti2 |
627 0606 9091 0000 lds r25,(Poti2)+1 |
628 060a 97FF sbrs r25,7 |
629 060c 00C0 rjmp .L66 |
630 060e 1092 0000 sts (Poti2)+1,__zero_reg__ |
631 0612 1092 0000 sts Poti2,__zero_reg__ |
632 0616 00C0 rjmp .L68 |
633 .L66: |
634 0618 8F3F cpi r24,255 |
635 061a 9105 cpc r25,__zero_reg__ |
636 061c 01F0 breq .L68 |
637 061e 04F0 brlt .L68 |
638 0620 8FEF ldi r24,lo8(255) |
639 0622 90E0 ldi r25,hi8(255) |
640 0624 9093 0000 sts (Poti2)+1,r25 |
641 0628 8093 0000 sts Poti2,r24 |
642 .L68: |
643 062c 8091 0000 lds r24,Poti3 |
644 0630 9091 0000 lds r25,(Poti3)+1 |
645 0634 97FF sbrs r25,7 |
646 0636 00C0 rjmp .L70 |
647 0638 1092 0000 sts (Poti3)+1,__zero_reg__ |
648 063c 1092 0000 sts Poti3,__zero_reg__ |
649 0640 00C0 rjmp .L72 |
650 .L70: |
651 0642 8F3F cpi r24,255 |
652 0644 9105 cpc r25,__zero_reg__ |
653 0646 01F0 breq .L72 |
654 0648 04F0 brlt .L72 |
655 064a 8FEF ldi r24,lo8(255) |
656 064c 90E0 ldi r25,hi8(255) |
657 064e 9093 0000 sts (Poti3)+1,r25 |
658 0652 8093 0000 sts Poti3,r24 |
659 .L72: |
660 0656 8091 0000 lds r24,Poti4 |
661 065a 9091 0000 lds r25,(Poti4)+1 |
662 065e 97FF sbrs r25,7 |
663 0660 00C0 rjmp .L74 |
664 0662 1092 0000 sts (Poti4)+1,__zero_reg__ |
665 0666 1092 0000 sts Poti4,__zero_reg__ |
666 066a 00C0 rjmp .L76 |
667 .L74: |
668 066c 8F3F cpi r24,255 |
669 066e 9105 cpc r25,__zero_reg__ |
670 0670 01F0 breq .L76 |
671 0672 04F0 brlt .L76 |
672 0674 8FEF ldi r24,lo8(255) |
673 0676 90E0 ldi r25,hi8(255) |
674 0678 9093 0000 sts (Poti4)+1,r25 |
675 067c 8093 0000 sts Poti4,r24 |
676 .L76: |
677 0680 8091 0000 lds r24,Poti5 |
678 0684 9091 0000 lds r25,(Poti5)+1 |
679 0688 97FF sbrs r25,7 |
680 068a 00C0 rjmp .L78 |
681 068c 1092 0000 sts (Poti5)+1,__zero_reg__ |
682 0690 1092 0000 sts Poti5,__zero_reg__ |
683 0694 00C0 rjmp .L80 |
684 .L78: |
685 0696 8F3F cpi r24,255 |
686 0698 9105 cpc r25,__zero_reg__ |
687 069a 01F0 breq .L80 |
688 069c 04F0 brlt .L80 |
689 069e 8FEF ldi r24,lo8(255) |
690 06a0 90E0 ldi r25,hi8(255) |
691 06a2 9093 0000 sts (Poti5)+1,r25 |
692 06a6 8093 0000 sts Poti5,r24 |
693 .L80: |
694 06aa 8091 0000 lds r24,Poti6 |
695 06ae 9091 0000 lds r25,(Poti6)+1 |
696 06b2 97FF sbrs r25,7 |
697 06b4 00C0 rjmp .L82 |
698 06b6 1092 0000 sts (Poti6)+1,__zero_reg__ |
699 06ba 1092 0000 sts Poti6,__zero_reg__ |
700 06be 00C0 rjmp .L84 |
701 .L82: |
702 06c0 8F3F cpi r24,255 |
703 06c2 9105 cpc r25,__zero_reg__ |
704 06c4 01F0 breq .L84 |
705 06c6 04F0 brlt .L84 |
706 06c8 8FEF ldi r24,lo8(255) |
707 06ca 90E0 ldi r25,hi8(255) |
708 06cc 9093 0000 sts (Poti6)+1,r25 |
709 06d0 8093 0000 sts Poti6,r24 |
710 .L84: |
711 06d4 8091 0000 lds r24,Poti7 |
712 06d8 9091 0000 lds r25,(Poti7)+1 |
713 06dc 97FF sbrs r25,7 |
714 06de 00C0 rjmp .L86 |
715 06e0 1092 0000 sts (Poti7)+1,__zero_reg__ |
716 06e4 1092 0000 sts Poti7,__zero_reg__ |
717 06e8 00C0 rjmp .L88 |
718 .L86: |
719 06ea 8F3F cpi r24,255 |
720 06ec 9105 cpc r25,__zero_reg__ |
721 06ee 01F0 breq .L88 |
722 06f0 04F0 brlt .L88 |
723 06f2 8FEF ldi r24,lo8(255) |
724 06f4 90E0 ldi r25,hi8(255) |
725 06f6 9093 0000 sts (Poti7)+1,r25 |
726 06fa 8093 0000 sts Poti7,r24 |
727 .L88: |
728 06fe 8091 0000 lds r24,Poti8 |
729 0702 9091 0000 lds r25,(Poti8)+1 |
730 0706 97FF sbrs r25,7 |
731 0708 00C0 rjmp .L90 |
732 070a 1092 0000 sts (Poti8)+1,__zero_reg__ |
733 070e 1092 0000 sts Poti8,__zero_reg__ |
734 0712 00C0 rjmp .L94 |
735 .L90: |
736 0714 8F3F cpi r24,255 |
737 0716 9105 cpc r25,__zero_reg__ |
738 0718 01F0 breq .L94 |
739 071a 04F0 brlt .L94 |
740 071c 8FEF ldi r24,lo8(255) |
741 071e 90E0 ldi r25,hi8(255) |
742 0720 9093 0000 sts (Poti8)+1,r25 |
743 0724 8093 0000 sts Poti8,r24 |
744 .L94: |
745 /* epilogue: frame size=0 */ |
746 0728 1F91 pop r17 |
747 072a 0F91 pop r16 |
748 072c FF90 pop r15 |
749 072e EF90 pop r14 |
750 0730 DF90 pop r13 |
751 0732 CF90 pop r12 |
752 0734 BF90 pop r11 |
753 0736 AF90 pop r10 |
754 0738 0895 ret |
755 /* epilogue end (size=9) */ |
756 /* function Mittelwert size 927 (910) */ |
758 .global CalibrierMittelwert |
760 CalibrierMittelwert: |
761 /* prologue: frame size=0 */ |
762 /* prologue end (size=0) */ |
763 073a 1092 7A00 sts 122,__zero_reg__ |
764 073e 8091 0000 lds r24,MessanzahlNick |
765 0742 8823 tst r24 |
766 0744 01F0 breq .L106 |
767 0746 8091 0000 lds r24,AccumulateNick |
768 074a 9091 0000 lds r25,(AccumulateNick)+1 |
769 074e 6091 0000 lds r22,MessanzahlNick |
770 0752 7727 clr r23 |
771 0754 0E94 0000 call __divmodhi4 |
772 0758 7093 0000 sts (MesswertNick)+1,r23 |
773 075c 6093 0000 sts MesswertNick,r22 |
774 .L106: |
775 0760 8091 0000 lds r24,MessanzahlRoll |
776 0764 8823 tst r24 |
777 0766 01F0 breq .L108 |
778 0768 8091 0000 lds r24,AccumulateRoll |
779 076c 9091 0000 lds r25,(AccumulateRoll)+1 |
780 0770 6091 0000 lds r22,MessanzahlRoll |
781 0774 7727 clr r23 |
782 0776 0E94 0000 call __divmodhi4 |
783 077a 7093 0000 sts (MesswertRoll)+1,r23 |
784 077e 6093 0000 sts MesswertRoll,r22 |
785 .L108: |
786 0782 8091 0000 lds r24,MessanzahlGier |
787 0786 8823 tst r24 |
788 0788 01F0 breq .L110 |
789 078a 8091 0000 lds r24,AccumulateGier |
790 078e 9091 0000 lds r25,(AccumulateGier)+1 |
791 0792 6091 0000 lds r22,MessanzahlGier |
792 0796 7727 clr r23 |
793 0798 0E94 0000 call __divmodhi4 |
794 079c 7093 0000 sts (MesswertGier)+1,r23 |
795 07a0 6093 0000 sts MesswertGier,r22 |
796 .L110: |
797 07a4 8091 0000 lds r24,messanzahl_AccNick |
798 07a8 8823 tst r24 |
799 07aa 01F0 breq .L112 |
800 07ac 6091 0000 lds r22,accumulate_AccNick |
801 07b0 7091 0000 lds r23,(accumulate_AccNick)+1 |
802 07b4 2091 0000 lds r18,messanzahl_AccNick |
803 07b8 8827 clr r24 |
804 07ba 77FD sbrc r23,7 |
805 07bc 8095 com r24 |
806 07be 982F mov r25,r24 |
807 07c0 34E0 ldi r19,4 |
808 07c2 660F 1: lsl r22 |
809 07c4 771F rol r23 |
810 07c6 881F rol r24 |
811 07c8 991F rol r25 |
812 07ca 3A95 dec r19 |
813 07cc 01F4 brne 1b |
814 07ce 3327 clr r19 |
815 07d0 4427 clr r20 |
816 07d2 5527 clr r21 |
817 07d4 0E94 0000 call __divmodsi4 |
818 07d8 3093 0000 sts (Mittelwert_AccNick)+1,r19 |
819 07dc 2093 0000 sts Mittelwert_AccNick,r18 |
820 .L112: |
821 07e0 8091 0000 lds r24,messanzahl_AccRoll |
822 07e4 8823 tst r24 |
823 07e6 01F0 breq .L114 |
824 07e8 6091 0000 lds r22,accumulate_AccRoll |
825 07ec 7091 0000 lds r23,(accumulate_AccRoll)+1 |
826 07f0 2091 0000 lds r18,messanzahl_AccRoll |
827 07f4 8827 clr r24 |
828 07f6 77FD sbrc r23,7 |
829 07f8 8095 com r24 |
830 07fa 982F mov r25,r24 |
831 07fc B4E0 ldi r27,4 |
832 07fe 660F 1: lsl r22 |
833 0800 771F rol r23 |
834 0802 881F rol r24 |
835 0804 991F rol r25 |
836 0806 BA95 dec r27 |
837 0808 01F4 brne 1b |
838 080a 3327 clr r19 |
839 080c 4427 clr r20 |
840 080e 5527 clr r21 |
841 0810 0E94 0000 call __divmodsi4 |
842 0814 3093 0000 sts (Mittelwert_AccRoll)+1,r19 |
843 0818 2093 0000 sts Mittelwert_AccRoll,r18 |
844 .L114: |
845 081c 8091 0000 lds r24,messanzahl_AccHoch |
846 0820 8823 tst r24 |
847 0822 01F0 breq .L116 |
848 0824 6091 0000 lds r22,accumulate_AccHoch |
849 0828 7091 0000 lds r23,(accumulate_AccHoch)+1 |
850 082c 2091 0000 lds r18,messanzahl_AccHoch |
851 0830 8827 clr r24 |
852 0832 77FD sbrc r23,7 |
853 0834 8095 com r24 |
854 0836 982F mov r25,r24 |
855 0838 3327 clr r19 |
856 083a 4427 clr r20 |
857 083c 5527 clr r21 |
858 083e 0E94 0000 call __divmodsi4 |
859 0842 3093 0000 sts (Mittelwert_AccHoch)+1,r19 |
860 0846 2093 0000 sts Mittelwert_AccHoch,r18 |
861 .L116: |
862 084a 1092 0000 sts (AccumulateNick)+1,__zero_reg__ |
863 084e 1092 0000 sts AccumulateNick,__zero_reg__ |
864 0852 1092 0000 sts MessanzahlNick,__zero_reg__ |
865 0856 1092 0000 sts (AccumulateRoll)+1,__zero_reg__ |
866 085a 1092 0000 sts AccumulateRoll,__zero_reg__ |
867 085e 1092 0000 sts MessanzahlRoll,__zero_reg__ |
868 0862 1092 0000 sts (AccumulateGier)+1,__zero_reg__ |
869 0866 1092 0000 sts AccumulateGier,__zero_reg__ |
870 086a 1092 0000 sts MessanzahlGier,__zero_reg__ |
871 086e 1092 0000 sts (accumulate_AccRoll)+1,__zero_reg__ |
872 0872 1092 0000 sts accumulate_AccRoll,__zero_reg__ |
873 0876 1092 0000 sts messanzahl_AccRoll,__zero_reg__ |
874 087a 1092 0000 sts (accumulate_AccNick)+1,__zero_reg__ |
875 087e 1092 0000 sts accumulate_AccNick,__zero_reg__ |
876 0882 1092 0000 sts messanzahl_AccNick,__zero_reg__ |
877 0886 1092 0000 sts (accumulate_AccHoch)+1,__zero_reg__ |
878 088a 1092 0000 sts accumulate_AccHoch,__zero_reg__ |
879 088e 1092 0000 sts messanzahl_AccHoch,__zero_reg__ |
880 0892 8FEE ldi r24,lo8(-17) |
881 0894 8093 7A00 sts 122,r24 |
882 0898 2091 0000 lds r18,Poti1 |
883 089c 3091 0000 lds r19,(Poti1)+1 |
884 08a0 8091 0000 lds r24,EE_Parameter+4 |
885 08a4 E82F mov r30,r24 |
886 08a6 FF27 clr r31 |
887 08a8 EE0F lsl r30 |
888 08aa FF1F rol r31 |
889 08ac E050 subi r30,lo8(-(PPM_in)) |
890 08ae F040 sbci r31,hi8(-(PPM_in)) |
891 08b0 8081 ld r24,Z |
892 08b2 9181 ldd r25,Z+1 |
893 08b4 8259 subi r24,lo8(-(110)) |
894 08b6 9F4F sbci r25,hi8(-(110)) |
895 08b8 2817 cp r18,r24 |
896 08ba 3907 cpc r19,r25 |
897 08bc 04F4 brge .L118 |
898 08be 2F5F subi r18,lo8(-(1)) |
899 08c0 3F4F sbci r19,hi8(-(1)) |
900 08c2 00C0 rjmp .L191 |
901 .L118: |
902 08c4 8081 ld r24,Z |
903 08c6 9181 ldd r25,Z+1 |
904 08c8 8259 subi r24,lo8(-(110)) |
905 08ca 9F4F sbci r25,hi8(-(110)) |
906 08cc 8217 cp r24,r18 |
907 08ce 9307 cpc r25,r19 |
908 08d0 04F4 brge .L120 |
909 08d2 2115 cp r18,__zero_reg__ |
910 08d4 3105 cpc r19,__zero_reg__ |
911 08d6 01F0 breq .L120 |
912 08d8 2150 subi r18,lo8(-(-1)) |
913 08da 3040 sbci r19,hi8(-(-1)) |
914 .L191: |
915 08dc 3093 0000 sts (Poti1)+1,r19 |
916 08e0 2093 0000 sts Poti1,r18 |
917 .L120: |
918 08e4 2091 0000 lds r18,Poti2 |
919 08e8 3091 0000 lds r19,(Poti2)+1 |
920 08ec 8091 0000 lds r24,EE_Parameter+5 |
921 08f0 E82F mov r30,r24 |
922 08f2 FF27 clr r31 |
923 08f4 EE0F lsl r30 |
924 08f6 FF1F rol r31 |
925 08f8 E050 subi r30,lo8(-(PPM_in)) |
926 08fa F040 sbci r31,hi8(-(PPM_in)) |
927 08fc 8081 ld r24,Z |
928 08fe 9181 ldd r25,Z+1 |
929 0900 8259 subi r24,lo8(-(110)) |
930 0902 9F4F sbci r25,hi8(-(110)) |
931 0904 2817 cp r18,r24 |
932 0906 3907 cpc r19,r25 |
933 0908 04F4 brge .L123 |
934 090a 2F5F subi r18,lo8(-(1)) |
935 090c 3F4F sbci r19,hi8(-(1)) |
936 090e 00C0 rjmp .L192 |
937 .L123: |
938 0910 8081 ld r24,Z |
939 0912 9181 ldd r25,Z+1 |
940 0914 8259 subi r24,lo8(-(110)) |
941 0916 9F4F sbci r25,hi8(-(110)) |
942 0918 8217 cp r24,r18 |
943 091a 9307 cpc r25,r19 |
944 091c 04F4 brge .L125 |
945 091e 2115 cp r18,__zero_reg__ |
946 0920 3105 cpc r19,__zero_reg__ |
947 0922 01F0 breq .L125 |
948 0924 2150 subi r18,lo8(-(-1)) |
949 0926 3040 sbci r19,hi8(-(-1)) |
950 .L192: |
951 0928 3093 0000 sts (Poti2)+1,r19 |
952 092c 2093 0000 sts Poti2,r18 |
953 .L125: |
954 0930 2091 0000 lds r18,Poti3 |
955 0934 3091 0000 lds r19,(Poti3)+1 |
956 0938 8091 0000 lds r24,EE_Parameter+6 |
957 093c E82F mov r30,r24 |
958 093e FF27 clr r31 |
959 0940 EE0F lsl r30 |
960 0942 FF1F rol r31 |
961 0944 E050 subi r30,lo8(-(PPM_in)) |
962 0946 F040 sbci r31,hi8(-(PPM_in)) |
963 0948 8081 ld r24,Z |
964 094a 9181 ldd r25,Z+1 |
965 094c 8259 subi r24,lo8(-(110)) |
966 094e 9F4F sbci r25,hi8(-(110)) |
967 0950 2817 cp r18,r24 |
968 0952 3907 cpc r19,r25 |
969 0954 04F4 brge .L128 |
970 0956 2F5F subi r18,lo8(-(1)) |
971 0958 3F4F sbci r19,hi8(-(1)) |
972 095a 00C0 rjmp .L193 |
973 .L128: |
974 095c 8081 ld r24,Z |
975 095e 9181 ldd r25,Z+1 |
976 0960 8259 subi r24,lo8(-(110)) |
977 0962 9F4F sbci r25,hi8(-(110)) |
978 0964 8217 cp r24,r18 |
979 0966 9307 cpc r25,r19 |
980 0968 04F4 brge .L130 |
981 096a 2115 cp r18,__zero_reg__ |
982 096c 3105 cpc r19,__zero_reg__ |
983 096e 01F0 breq .L130 |
984 0970 2150 subi r18,lo8(-(-1)) |
985 0972 3040 sbci r19,hi8(-(-1)) |
986 .L193: |
987 0974 3093 0000 sts (Poti3)+1,r19 |
988 0978 2093 0000 sts Poti3,r18 |
989 .L130: |
990 097c 2091 0000 lds r18,Poti4 |
991 0980 3091 0000 lds r19,(Poti4)+1 |
992 0984 8091 0000 lds r24,EE_Parameter+7 |
993 0988 E82F mov r30,r24 |
994 098a FF27 clr r31 |
995 098c EE0F lsl r30 |
996 098e FF1F rol r31 |
997 0990 E050 subi r30,lo8(-(PPM_in)) |
998 0992 F040 sbci r31,hi8(-(PPM_in)) |
999 0994 8081 ld r24,Z |
1000 0996 9181 ldd r25,Z+1 |
1001 0998 8259 subi r24,lo8(-(110)) |
1002 099a 9F4F sbci r25,hi8(-(110)) |
1003 099c 2817 cp r18,r24 |
1004 099e 3907 cpc r19,r25 |
1005 09a0 04F4 brge .L133 |
1006 09a2 2F5F subi r18,lo8(-(1)) |
1007 09a4 3F4F sbci r19,hi8(-(1)) |
1008 09a6 00C0 rjmp .L194 |
1009 .L133: |
1010 09a8 8081 ld r24,Z |
1011 09aa 9181 ldd r25,Z+1 |
1012 09ac 8259 subi r24,lo8(-(110)) |
1013 09ae 9F4F sbci r25,hi8(-(110)) |
1014 09b0 8217 cp r24,r18 |
1015 09b2 9307 cpc r25,r19 |
1016 09b4 04F4 brge .L135 |
1017 09b6 2115 cp r18,__zero_reg__ |
1018 09b8 3105 cpc r19,__zero_reg__ |
1019 09ba 01F0 breq .L135 |
1020 09bc 2150 subi r18,lo8(-(-1)) |
1021 09be 3040 sbci r19,hi8(-(-1)) |
1022 .L194: |
1023 09c0 3093 0000 sts (Poti4)+1,r19 |
1024 09c4 2093 0000 sts Poti4,r18 |
1025 .L135: |
1026 09c8 2091 0000 lds r18,Poti5 |
1027 09cc 3091 0000 lds r19,(Poti5)+1 |
1028 09d0 8091 0000 lds r24,PPM_in+18 |
1029 09d4 9091 0000 lds r25,(PPM_in+18)+1 |
1030 09d8 8259 subi r24,lo8(-(110)) |
1031 09da 9F4F sbci r25,hi8(-(110)) |
1032 09dc 2817 cp r18,r24 |
1033 09de 3907 cpc r19,r25 |
1034 09e0 04F4 brge .L138 |
1035 09e2 2F5F subi r18,lo8(-(1)) |
1036 09e4 3F4F sbci r19,hi8(-(1)) |
1037 09e6 00C0 rjmp .L195 |
1038 .L138: |
1039 09e8 8091 0000 lds r24,PPM_in+18 |
1040 09ec 9091 0000 lds r25,(PPM_in+18)+1 |
1041 09f0 8259 subi r24,lo8(-(110)) |
1042 09f2 9F4F sbci r25,hi8(-(110)) |
1043 09f4 8217 cp r24,r18 |
1044 09f6 9307 cpc r25,r19 |
1045 09f8 04F4 brge .L140 |
1046 09fa 2115 cp r18,__zero_reg__ |
1047 09fc 3105 cpc r19,__zero_reg__ |
1048 09fe 01F0 breq .L140 |
1049 0a00 2150 subi r18,lo8(-(-1)) |
1050 0a02 3040 sbci r19,hi8(-(-1)) |
1051 .L195: |
1052 0a04 3093 0000 sts (Poti5)+1,r19 |
1053 0a08 2093 0000 sts Poti5,r18 |
1054 .L140: |
1055 0a0c 2091 0000 lds r18,Poti6 |
1056 0a10 3091 0000 lds r19,(Poti6)+1 |
1057 0a14 8091 0000 lds r24,PPM_in+20 |
1058 0a18 9091 0000 lds r25,(PPM_in+20)+1 |
1059 0a1c 8259 subi r24,lo8(-(110)) |
1060 0a1e 9F4F sbci r25,hi8(-(110)) |
1061 0a20 2817 cp r18,r24 |
1062 0a22 3907 cpc r19,r25 |
1063 0a24 04F4 brge .L143 |
1064 0a26 2F5F subi r18,lo8(-(1)) |
1065 0a28 3F4F sbci r19,hi8(-(1)) |
1066 0a2a 00C0 rjmp .L196 |
1067 .L143: |
1068 0a2c 8091 0000 lds r24,PPM_in+20 |
1069 0a30 9091 0000 lds r25,(PPM_in+20)+1 |
1070 0a34 8259 subi r24,lo8(-(110)) |
1071 0a36 9F4F sbci r25,hi8(-(110)) |
1072 0a38 8217 cp r24,r18 |
1073 0a3a 9307 cpc r25,r19 |
1074 0a3c 04F4 brge .L145 |
1075 0a3e 2115 cp r18,__zero_reg__ |
1076 0a40 3105 cpc r19,__zero_reg__ |
1077 0a42 01F0 breq .L145 |
1078 0a44 2150 subi r18,lo8(-(-1)) |
1079 0a46 3040 sbci r19,hi8(-(-1)) |
1080 .L196: |
1081 0a48 3093 0000 sts (Poti6)+1,r19 |
1082 0a4c 2093 0000 sts Poti6,r18 |
1083 .L145: |
1084 0a50 2091 0000 lds r18,Poti7 |
1085 0a54 3091 0000 lds r19,(Poti7)+1 |
1086 0a58 8091 0000 lds r24,PPM_in+22 |
1087 0a5c 9091 0000 lds r25,(PPM_in+22)+1 |
1088 0a60 8259 subi r24,lo8(-(110)) |
1089 0a62 9F4F sbci r25,hi8(-(110)) |
1090 0a64 2817 cp r18,r24 |
1091 0a66 3907 cpc r19,r25 |
1092 0a68 04F4 brge .L148 |
1093 0a6a 2F5F subi r18,lo8(-(1)) |
1094 0a6c 3F4F sbci r19,hi8(-(1)) |
1095 0a6e 00C0 rjmp .L197 |
1096 .L148: |
1097 0a70 8091 0000 lds r24,PPM_in+22 |
1098 0a74 9091 0000 lds r25,(PPM_in+22)+1 |
1099 0a78 8259 subi r24,lo8(-(110)) |
1100 0a7a 9F4F sbci r25,hi8(-(110)) |
1101 0a7c 8217 cp r24,r18 |
1102 0a7e 9307 cpc r25,r19 |
1103 0a80 04F4 brge .L150 |
1104 0a82 2115 cp r18,__zero_reg__ |
1105 0a84 3105 cpc r19,__zero_reg__ |
1106 0a86 01F0 breq .L150 |
1107 0a88 2150 subi r18,lo8(-(-1)) |
1108 0a8a 3040 sbci r19,hi8(-(-1)) |
1109 .L197: |
1110 0a8c 3093 0000 sts (Poti7)+1,r19 |
1111 0a90 2093 0000 sts Poti7,r18 |
1112 .L150: |
1113 0a94 2091 0000 lds r18,Poti8 |
1114 0a98 3091 0000 lds r19,(Poti8)+1 |
1115 0a9c 8091 0000 lds r24,PPM_in+24 |
1116 0aa0 9091 0000 lds r25,(PPM_in+24)+1 |
1117 0aa4 8259 subi r24,lo8(-(110)) |
1118 0aa6 9F4F sbci r25,hi8(-(110)) |
1119 0aa8 2817 cp r18,r24 |
1120 0aaa 3907 cpc r19,r25 |
1121 0aac 04F4 brge .L153 |
1122 0aae 2F5F subi r18,lo8(-(1)) |
1123 0ab0 3F4F sbci r19,hi8(-(1)) |
1124 0ab2 00C0 rjmp .L198 |
1125 .L153: |
1126 0ab4 8091 0000 lds r24,PPM_in+24 |
1127 0ab8 9091 0000 lds r25,(PPM_in+24)+1 |
1128 0abc 8259 subi r24,lo8(-(110)) |
1129 0abe 9F4F sbci r25,hi8(-(110)) |
1130 0ac0 8217 cp r24,r18 |
1131 0ac2 9307 cpc r25,r19 |
1132 0ac4 04F4 brge .L155 |
1133 0ac6 2115 cp r18,__zero_reg__ |
1134 0ac8 3105 cpc r19,__zero_reg__ |
1135 0aca 01F0 breq .L155 |
1136 0acc 2150 subi r18,lo8(-(-1)) |
1137 0ace 3040 sbci r19,hi8(-(-1)) |
1138 .L198: |
1139 0ad0 3093 0000 sts (Poti8)+1,r19 |
1140 0ad4 2093 0000 sts Poti8,r18 |
1141 .L155: |
1142 0ad8 8091 0000 lds r24,Poti1 |
1143 0adc 9091 0000 lds r25,(Poti1)+1 |
1144 0ae0 97FF sbrs r25,7 |
1145 0ae2 00C0 rjmp .L158 |
1146 0ae4 1092 0000 sts (Poti1)+1,__zero_reg__ |
1147 0ae8 1092 0000 sts Poti1,__zero_reg__ |
1148 0aec 00C0 rjmp .L160 |
1149 .L158: |
1150 0aee 8F3F cpi r24,255 |
1151 0af0 9105 cpc r25,__zero_reg__ |
1152 0af2 01F0 breq .L160 |
1153 0af4 04F0 brlt .L160 |
1154 0af6 8FEF ldi r24,lo8(255) |
1155 0af8 90E0 ldi r25,hi8(255) |
1156 0afa 9093 0000 sts (Poti1)+1,r25 |
1157 0afe 8093 0000 sts Poti1,r24 |
1158 .L160: |
1159 0b02 8091 0000 lds r24,Poti2 |
1160 0b06 9091 0000 lds r25,(Poti2)+1 |
1161 0b0a 97FF sbrs r25,7 |
1162 0b0c 00C0 rjmp .L162 |
1163 0b0e 1092 0000 sts (Poti2)+1,__zero_reg__ |
1164 0b12 1092 0000 sts Poti2,__zero_reg__ |
1165 0b16 00C0 rjmp .L164 |
1166 .L162: |
1167 0b18 8F3F cpi r24,255 |
1168 0b1a 9105 cpc r25,__zero_reg__ |
1169 0b1c 01F0 breq .L164 |
1170 0b1e 04F0 brlt .L164 |
1171 0b20 8FEF ldi r24,lo8(255) |
1172 0b22 90E0 ldi r25,hi8(255) |
1173 0b24 9093 0000 sts (Poti2)+1,r25 |
1174 0b28 8093 0000 sts Poti2,r24 |
1175 .L164: |
1176 0b2c 8091 0000 lds r24,Poti3 |
1177 0b30 9091 0000 lds r25,(Poti3)+1 |
1178 0b34 97FF sbrs r25,7 |
1179 0b36 00C0 rjmp .L166 |
1180 0b38 1092 0000 sts (Poti3)+1,__zero_reg__ |
1181 0b3c 1092 0000 sts Poti3,__zero_reg__ |
1182 0b40 00C0 rjmp .L168 |
1183 .L166: |
1184 0b42 8F3F cpi r24,255 |
1185 0b44 9105 cpc r25,__zero_reg__ |
1186 0b46 01F0 breq .L168 |
1187 0b48 04F0 brlt .L168 |
1188 0b4a 8FEF ldi r24,lo8(255) |
1189 0b4c 90E0 ldi r25,hi8(255) |
1190 0b4e 9093 0000 sts (Poti3)+1,r25 |
1191 0b52 8093 0000 sts Poti3,r24 |
1192 .L168: |
1193 0b56 8091 0000 lds r24,Poti4 |
1194 0b5a 9091 0000 lds r25,(Poti4)+1 |
1195 0b5e 97FF sbrs r25,7 |
1196 0b60 00C0 rjmp .L170 |
1197 0b62 1092 0000 sts (Poti4)+1,__zero_reg__ |
1198 0b66 1092 0000 sts Poti4,__zero_reg__ |
1199 0b6a 00C0 rjmp .L172 |
1200 .L170: |
1201 0b6c 8F3F cpi r24,255 |
1202 0b6e 9105 cpc r25,__zero_reg__ |
1203 0b70 01F0 breq .L172 |
1204 0b72 04F0 brlt .L172 |
1205 0b74 8FEF ldi r24,lo8(255) |
1206 0b76 90E0 ldi r25,hi8(255) |
1207 0b78 9093 0000 sts (Poti4)+1,r25 |
1208 0b7c 8093 0000 sts Poti4,r24 |
1209 .L172: |
1210 0b80 8091 0000 lds r24,Poti5 |
1211 0b84 9091 0000 lds r25,(Poti5)+1 |
1212 0b88 97FF sbrs r25,7 |
1213 0b8a 00C0 rjmp .L174 |
1214 0b8c 1092 0000 sts (Poti5)+1,__zero_reg__ |
1215 0b90 1092 0000 sts Poti5,__zero_reg__ |
1216 0b94 00C0 rjmp .L176 |
1217 .L174: |
1218 0b96 8F3F cpi r24,255 |
1219 0b98 9105 cpc r25,__zero_reg__ |
1220 0b9a 01F0 breq .L176 |
1221 0b9c 04F0 brlt .L176 |
1222 0b9e 8FEF ldi r24,lo8(255) |
1223 0ba0 90E0 ldi r25,hi8(255) |
1224 0ba2 9093 0000 sts (Poti5)+1,r25 |
1225 0ba6 8093 0000 sts Poti5,r24 |
1226 .L176: |
1227 0baa 8091 0000 lds r24,Poti6 |
1228 0bae 9091 0000 lds r25,(Poti6)+1 |
1229 0bb2 97FF sbrs r25,7 |
1230 0bb4 00C0 rjmp .L178 |
1231 0bb6 1092 0000 sts (Poti6)+1,__zero_reg__ |
1232 0bba 1092 0000 sts Poti6,__zero_reg__ |
1233 0bbe 00C0 rjmp .L180 |
1234 .L178: |
1235 0bc0 8F3F cpi r24,255 |
1236 0bc2 9105 cpc r25,__zero_reg__ |
1237 0bc4 01F0 breq .L180 |
1238 0bc6 04F0 brlt .L180 |
1239 0bc8 8FEF ldi r24,lo8(255) |
1240 0bca 90E0 ldi r25,hi8(255) |
1241 0bcc 9093 0000 sts (Poti6)+1,r25 |
1242 0bd0 8093 0000 sts Poti6,r24 |
1243 .L180: |
1244 0bd4 8091 0000 lds r24,Poti7 |
1245 0bd8 9091 0000 lds r25,(Poti7)+1 |
1246 0bdc 97FF sbrs r25,7 |
1247 0bde 00C0 rjmp .L182 |
1248 0be0 1092 0000 sts (Poti7)+1,__zero_reg__ |
1249 0be4 1092 0000 sts Poti7,__zero_reg__ |
1250 0be8 00C0 rjmp .L184 |
1251 .L182: |
1252 0bea 8F3F cpi r24,255 |
1253 0bec 9105 cpc r25,__zero_reg__ |
1254 0bee 01F0 breq .L184 |
1255 0bf0 04F0 brlt .L184 |
1256 0bf2 8FEF ldi r24,lo8(255) |
1257 0bf4 90E0 ldi r25,hi8(255) |
1258 0bf6 9093 0000 sts (Poti7)+1,r25 |
1259 0bfa 8093 0000 sts Poti7,r24 |
1260 .L184: |
1261 0bfe 8091 0000 lds r24,Poti8 |
1262 0c02 9091 0000 lds r25,(Poti8)+1 |
1263 0c06 97FF sbrs r25,7 |
1264 0c08 00C0 rjmp .L186 |
1265 0c0a 1092 0000 sts (Poti8)+1,__zero_reg__ |
1266 0c0e 1092 0000 sts Poti8,__zero_reg__ |
1267 0c12 0895 ret |
1268 .L186: |
1269 0c14 8F3F cpi r24,255 |
1270 0c16 9105 cpc r25,__zero_reg__ |
1271 0c18 01F0 breq .L190 |
1272 0c1a 04F0 brlt .L190 |
1273 0c1c 8FEF ldi r24,lo8(255) |
1274 0c1e 90E0 ldi r25,hi8(255) |
1275 0c20 9093 0000 sts (Poti8)+1,r25 |
1276 0c24 8093 0000 sts Poti8,r24 |
1277 .L190: |
1278 0c28 0895 ret |
1279 /* epilogue: frame size=0 */ |
1280 /* epilogue: noreturn */ |
1281 /* epilogue end (size=0) */ |
1282 /* function CalibrierMittelwert size 632 (632) */ |
1284 .global ParameterZuordnung |
1286 ParameterZuordnung: |
1287 /* prologue: frame size=0 */ |
1288 0c2a 1F93 push r17 |
1289 /* prologue end (size=1) */ |
1290 0c2c 8091 0000 lds r24,EE_Parameter+11 |
1291 0c30 8B3F cpi r24,lo8(-5) |
1292 0c32 00F0 brlo .L200 |
1293 0c34 8B3F cpi r24,lo8(-5) |
1294 0c36 01F4 brne .L202 |
1295 0c38 8091 0000 lds r24,Poti1 |
1296 0c3c 00C0 rjmp .L200 |
1297 .L202: |
1298 0c3e 8C3F cpi r24,lo8(-4) |
1299 0c40 01F4 brne .L205 |
1300 0c42 8091 0000 lds r24,Poti2 |
1301 0c46 00C0 rjmp .L200 |
1302 .L205: |
1303 0c48 8D3F cpi r24,lo8(-3) |
1304 0c4a 01F4 brne .L207 |
1305 0c4c 8091 0000 lds r24,Poti3 |
1306 0c50 00C0 rjmp .L200 |
1307 .L207: |
1308 0c52 8E3F cpi r24,lo8(-2) |
1309 0c54 01F4 brne .L204 |
1310 0c56 8091 0000 lds r24,Poti4 |
1311 .L200: |
1312 0c5a 8093 0000 sts Parameter_MaxHoehe,r24 |
1313 .L204: |
1314 0c5e 8091 0000 lds r24,Parameter_MaxHoehe |
1315 0c62 8823 tst r24 |
1316 0c64 01F4 brne .L210 |
1317 0c66 1092 0000 sts Parameter_MaxHoehe,__zero_reg__ |
1318 0c6a 00C0 rjmp .L212 |
1319 .L210: |
1320 0c6c 8F3F cpi r24,lo8(-1) |
1321 0c6e 01F4 brne .L212 |
1322 0c70 8093 0000 sts Parameter_MaxHoehe,r24 |
1323 .L212: |
1324 0c74 8091 0000 lds r24,EE_Parameter+10 |
1325 0c78 8B3F cpi r24,lo8(-5) |
1326 0c7a 00F0 brlo .L214 |
1327 0c7c 8B3F cpi r24,lo8(-5) |
1328 0c7e 01F4 brne .L216 |
1329 0c80 8091 0000 lds r24,Poti1 |
1330 0c84 00C0 rjmp .L214 |
1331 .L216: |
1332 0c86 8C3F cpi r24,lo8(-4) |
1333 0c88 01F4 brne .L219 |
1334 0c8a 8091 0000 lds r24,Poti2 |
1335 0c8e 00C0 rjmp .L214 |
1336 .L219: |
1337 0c90 8D3F cpi r24,lo8(-3) |
1338 0c92 01F4 brne .L221 |
1339 0c94 8091 0000 lds r24,Poti3 |
1340 0c98 00C0 rjmp .L214 |
1341 .L221: |
1342 0c9a 8E3F cpi r24,lo8(-2) |
1343 0c9c 01F4 brne .L218 |
1344 0c9e 8091 0000 lds r24,Poti4 |
1345 .L214: |
1346 0ca2 8093 0000 sts Parameter_Luftdruck_D,r24 |
1347 .L218: |
1348 0ca6 8091 0000 lds r24,Parameter_Luftdruck_D |
1349 0caa 8823 tst r24 |
1350 0cac 01F4 brne .L224 |
1351 0cae 1092 0000 sts Parameter_Luftdruck_D,__zero_reg__ |
1352 0cb2 00C0 rjmp .L226 |
1353 .L224: |
1354 0cb4 8436 cpi r24,lo8(100) |
1355 0cb6 00F0 brlo .L226 |
1356 0cb8 84E6 ldi r24,lo8(100) |
1357 0cba 8093 0000 sts Parameter_Luftdruck_D,r24 |
1358 .L226: |
1359 0cbe 8091 0000 lds r24,EE_Parameter+12 |
1360 0cc2 8B3F cpi r24,lo8(-5) |
1361 0cc4 00F0 brlo .L228 |
1362 0cc6 8B3F cpi r24,lo8(-5) |
1363 0cc8 01F4 brne .L230 |
1364 0cca 8091 0000 lds r24,Poti1 |
1365 0cce 00C0 rjmp .L228 |
1366 .L230: |
1367 0cd0 8C3F cpi r24,lo8(-4) |
1368 0cd2 01F4 brne .L233 |
1369 0cd4 8091 0000 lds r24,Poti2 |
1370 0cd8 00C0 rjmp .L228 |
1371 .L233: |
1372 0cda 8D3F cpi r24,lo8(-3) |
1373 0cdc 01F4 brne .L235 |
1374 0cde 8091 0000 lds r24,Poti3 |
1375 0ce2 00C0 rjmp .L228 |
1376 .L235: |
1377 0ce4 8E3F cpi r24,lo8(-2) |
1378 0ce6 01F4 brne .L232 |
1379 0ce8 8091 0000 lds r24,Poti4 |
1380 .L228: |
1381 0cec 8093 0000 sts Parameter_Hoehe_P,r24 |
1382 .L232: |
1383 0cf0 8091 0000 lds r24,Parameter_Hoehe_P |
1384 0cf4 8823 tst r24 |
1385 0cf6 01F4 brne .L238 |
1386 0cf8 1092 0000 sts Parameter_Hoehe_P,__zero_reg__ |
1387 0cfc 00C0 rjmp .L240 |
1388 .L238: |
1389 0cfe 8436 cpi r24,lo8(100) |
1390 0d00 00F0 brlo .L240 |
1391 0d02 84E6 ldi r24,lo8(100) |
1392 0d04 8093 0000 sts Parameter_Hoehe_P,r24 |
1393 .L240: |
1394 0d08 8091 0000 lds r24,EE_Parameter+14 |
1395 0d0c 8B3F cpi r24,lo8(-5) |
1396 0d0e 00F0 brlo .L242 |
1397 0d10 8B3F cpi r24,lo8(-5) |
1398 0d12 01F4 brne .L244 |
1399 0d14 8091 0000 lds r24,Poti1 |
1400 0d18 00C0 rjmp .L242 |
1401 .L244: |
1402 0d1a 8C3F cpi r24,lo8(-4) |
1403 0d1c 01F4 brne .L247 |
1404 0d1e 8091 0000 lds r24,Poti2 |
1405 0d22 00C0 rjmp .L242 |
1406 .L247: |
1407 0d24 8D3F cpi r24,lo8(-3) |
1408 0d26 01F4 brne .L249 |
1409 0d28 8091 0000 lds r24,Poti3 |
1410 0d2c 00C0 rjmp .L242 |
1411 .L249: |
1412 0d2e 8E3F cpi r24,lo8(-2) |
1413 0d30 01F4 brne .L246 |
1414 0d32 8091 0000 lds r24,Poti4 |
1415 .L242: |
1416 0d36 8093 0000 sts Parameter_Hoehe_ACC_Wirkung,r24 |
1417 .L246: |
1418 0d3a 8091 0000 lds r24,Parameter_Hoehe_ACC_Wirkung |
1419 0d3e 8823 tst r24 |
1420 0d40 01F4 brne .L252 |
1421 0d42 1092 0000 sts Parameter_Hoehe_ACC_Wirkung,__zero_reg__ |
1422 0d46 00C0 rjmp .L254 |
1423 .L252: |
1424 0d48 8F3F cpi r24,lo8(-1) |
1425 0d4a 01F4 brne .L254 |
1426 0d4c 8093 0000 sts Parameter_Hoehe_ACC_Wirkung,r24 |
1427 .L254: |
1428 0d50 8091 0000 lds r24,EE_Parameter+21 |
1429 0d54 8B3F cpi r24,lo8(-5) |
1430 0d56 00F0 brlo .L256 |
1431 0d58 8B3F cpi r24,lo8(-5) |
1432 0d5a 01F4 brne .L258 |
1433 0d5c 8091 0000 lds r24,Poti1 |
1434 0d60 00C0 rjmp .L256 |
1435 .L258: |
1436 0d62 8C3F cpi r24,lo8(-4) |
1437 0d64 01F4 brne .L261 |
1438 0d66 8091 0000 lds r24,Poti2 |
1439 0d6a 00C0 rjmp .L256 |
1440 .L261: |
1441 0d6c 8D3F cpi r24,lo8(-3) |
1442 0d6e 01F4 brne .L263 |
1443 0d70 8091 0000 lds r24,Poti3 |
1444 0d74 00C0 rjmp .L256 |
1445 .L263: |
1446 0d76 8E3F cpi r24,lo8(-2) |
1447 0d78 01F4 brne .L260 |
1448 0d7a 8091 0000 lds r24,Poti4 |
1449 .L256: |
1450 0d7e 8093 0000 sts Parameter_KompassWirkung,r24 |
1451 .L260: |
1452 0d82 8091 0000 lds r24,Parameter_KompassWirkung |
1453 0d86 8823 tst r24 |
1454 0d88 01F4 brne .L266 |
1455 0d8a 1092 0000 sts Parameter_KompassWirkung,__zero_reg__ |
1456 0d8e 00C0 rjmp .L268 |
1457 .L266: |
1458 0d90 8F3F cpi r24,lo8(-1) |
1459 0d92 01F4 brne .L268 |
1460 0d94 8093 0000 sts Parameter_KompassWirkung,r24 |
1461 .L268: |
1462 0d98 8091 0000 lds r24,EE_Parameter+22 |
1463 0d9c 8B3F cpi r24,lo8(-5) |
1464 0d9e 00F0 brlo .L270 |
1465 0da0 8B3F cpi r24,lo8(-5) |
1466 0da2 01F4 brne .L272 |
1467 0da4 8091 0000 lds r24,Poti1 |
1468 0da8 00C0 rjmp .L270 |
1469 .L272: |
1470 0daa 8C3F cpi r24,lo8(-4) |
1471 0dac 01F4 brne .L275 |
1472 0dae 8091 0000 lds r24,Poti2 |
1473 0db2 00C0 rjmp .L270 |
1474 .L275: |
1475 0db4 8D3F cpi r24,lo8(-3) |
1476 0db6 01F4 brne .L277 |
1477 0db8 8091 0000 lds r24,Poti3 |
1478 0dbc 00C0 rjmp .L270 |
1479 .L277: |
1480 0dbe 8E3F cpi r24,lo8(-2) |
1481 0dc0 01F4 brne .L274 |
1482 0dc2 8091 0000 lds r24,Poti4 |
1483 .L270: |
1484 0dc6 8093 0000 sts Parameter_Gyro_P,r24 |
1485 .L274: |
1486 0dca 8091 0000 lds r24,Parameter_Gyro_P |
1487 0dce 8B30 cpi r24,lo8(11) |
1488 0dd0 00F4 brsh .L280 |
1489 0dd2 8AE0 ldi r24,lo8(10) |
1490 0dd4 00C0 rjmp .L412 |
1491 .L280: |
1492 0dd6 8F3F cpi r24,lo8(-1) |
1493 0dd8 01F4 brne .L282 |
1494 .L412: |
1495 0dda 8093 0000 sts Parameter_Gyro_P,r24 |
1496 .L282: |
1497 0dde 8091 0000 lds r24,EE_Parameter+23 |
1498 0de2 8B3F cpi r24,lo8(-5) |
1499 0de4 00F0 brlo .L284 |
1500 0de6 8B3F cpi r24,lo8(-5) |
1501 0de8 01F4 brne .L286 |
1502 0dea 8091 0000 lds r24,Poti1 |
1503 0dee 00C0 rjmp .L284 |
1504 .L286: |
1505 0df0 8C3F cpi r24,lo8(-4) |
1506 0df2 01F4 brne .L289 |
1507 0df4 8091 0000 lds r24,Poti2 |
1508 0df8 00C0 rjmp .L284 |
1509 .L289: |
1510 0dfa 8D3F cpi r24,lo8(-3) |
1511 0dfc 01F4 brne .L291 |
1512 0dfe 8091 0000 lds r24,Poti3 |
1513 0e02 00C0 rjmp .L284 |
1514 .L291: |
1515 0e04 8E3F cpi r24,lo8(-2) |
1516 0e06 01F4 brne .L288 |
1517 0e08 8091 0000 lds r24,Poti4 |
1518 .L284: |
1519 0e0c 8093 0000 sts Parameter_Gyro_I,r24 |
1520 .L288: |
1521 0e10 8091 0000 lds r24,Parameter_Gyro_I |
1522 0e14 8823 tst r24 |
1523 0e16 01F4 brne .L294 |
1524 0e18 1092 0000 sts Parameter_Gyro_I,__zero_reg__ |
1525 0e1c 00C0 rjmp .L296 |
1526 .L294: |
1527 0e1e 8F3F cpi r24,lo8(-1) |
1528 0e20 01F4 brne .L296 |
1529 0e22 8093 0000 sts Parameter_Gyro_I,r24 |
1530 .L296: |
1531 0e26 8091 0000 lds r24,EE_Parameter+28 |
1532 0e2a 8B3F cpi r24,lo8(-5) |
1533 0e2c 00F0 brlo .L298 |
1534 0e2e 8B3F cpi r24,lo8(-5) |
1535 0e30 01F4 brne .L300 |
1536 0e32 8091 0000 lds r24,Poti1 |
1537 0e36 00C0 rjmp .L298 |
1538 .L300: |
1539 0e38 8C3F cpi r24,lo8(-4) |
1540 0e3a 01F4 brne .L303 |
1541 0e3c 8091 0000 lds r24,Poti2 |
1542 0e40 00C0 rjmp .L298 |
1543 .L303: |
1544 0e42 8D3F cpi r24,lo8(-3) |
1545 0e44 01F4 brne .L305 |
1546 0e46 8091 0000 lds r24,Poti3 |
1547 0e4a 00C0 rjmp .L298 |
1548 .L305: |
1549 0e4c 8E3F cpi r24,lo8(-2) |
1550 0e4e 01F4 brne .L302 |
1551 0e50 8091 0000 lds r24,Poti4 |
1552 .L298: |
1553 0e54 8093 0000 sts Parameter_I_Faktor,r24 |
1554 .L302: |
1555 0e58 8091 0000 lds r24,Parameter_I_Faktor |
1556 0e5c 8823 tst r24 |
1557 0e5e 01F4 brne .L308 |
1558 0e60 1092 0000 sts Parameter_I_Faktor,__zero_reg__ |
1559 0e64 00C0 rjmp .L310 |
1560 .L308: |
1561 0e66 8F3F cpi r24,lo8(-1) |
1562 0e68 01F4 brne .L310 |
1563 0e6a 8093 0000 sts Parameter_I_Faktor,r24 |
1564 .L310: |
1565 0e6e 8091 0000 lds r24,EE_Parameter+29 |
1566 0e72 8B3F cpi r24,lo8(-5) |
1567 0e74 00F0 brlo .L312 |
1568 0e76 8B3F cpi r24,lo8(-5) |
1569 0e78 01F4 brne .L314 |
1570 0e7a 8091 0000 lds r24,Poti1 |
1571 0e7e 00C0 rjmp .L312 |
1572 .L314: |
1573 0e80 8C3F cpi r24,lo8(-4) |
1574 0e82 01F4 brne .L317 |
1575 0e84 8091 0000 lds r24,Poti2 |
1576 0e88 00C0 rjmp .L312 |
1577 .L317: |
1578 0e8a 8D3F cpi r24,lo8(-3) |
1579 0e8c 01F4 brne .L319 |
1580 0e8e 8091 0000 lds r24,Poti3 |
1581 0e92 00C0 rjmp .L312 |
1582 .L319: |
1583 0e94 8E3F cpi r24,lo8(-2) |
1584 0e96 01F4 brne .L316 |
1585 0e98 8091 0000 lds r24,Poti4 |
1586 .L312: |
1587 0e9c 8093 0000 sts Parameter_UserParam1,r24 |
1588 .L316: |
1589 0ea0 8091 0000 lds r24,Parameter_UserParam1 |
1590 0ea4 8823 tst r24 |
1591 0ea6 01F4 brne .L322 |
1592 0ea8 1092 0000 sts Parameter_UserParam1,__zero_reg__ |
1593 0eac 00C0 rjmp .L324 |
1594 .L322: |
1595 0eae 8F3F cpi r24,lo8(-1) |
1596 0eb0 01F4 brne .L324 |
1597 0eb2 8093 0000 sts Parameter_UserParam1,r24 |
1598 .L324: |
1599 0eb6 8091 0000 lds r24,EE_Parameter+30 |
1600 0eba 8B3F cpi r24,lo8(-5) |
1601 0ebc 00F0 brlo .L326 |
1602 0ebe 8B3F cpi r24,lo8(-5) |
1603 0ec0 01F4 brne .L328 |
1604 0ec2 8091 0000 lds r24,Poti1 |
1605 0ec6 00C0 rjmp .L326 |
1606 .L328: |
1607 0ec8 8C3F cpi r24,lo8(-4) |
1608 0eca 01F4 brne .L331 |
1609 0ecc 8091 0000 lds r24,Poti2 |
1610 0ed0 00C0 rjmp .L326 |
1611 .L331: |
1612 0ed2 8D3F cpi r24,lo8(-3) |
1613 0ed4 01F4 brne .L333 |
1614 0ed6 8091 0000 lds r24,Poti3 |
1615 0eda 00C0 rjmp .L326 |
1616 .L333: |
1617 0edc 8E3F cpi r24,lo8(-2) |
1618 0ede 01F4 brne .L330 |
1619 0ee0 8091 0000 lds r24,Poti4 |
1620 .L326: |
1621 0ee4 8093 0000 sts Parameter_UserParam2,r24 |
1622 .L330: |
1623 0ee8 8091 0000 lds r24,Parameter_UserParam2 |
1624 0eec 8823 tst r24 |
1625 0eee 01F4 brne .L336 |
1626 0ef0 1092 0000 sts Parameter_UserParam2,__zero_reg__ |
1627 0ef4 00C0 rjmp .L338 |
1628 .L336: |
1629 0ef6 8F3F cpi r24,lo8(-1) |
1630 0ef8 01F4 brne .L338 |
1631 0efa 8093 0000 sts Parameter_UserParam2,r24 |
1632 .L338: |
1633 0efe 8091 0000 lds r24,EE_Parameter+31 |
1634 0f02 8B3F cpi r24,lo8(-5) |
1635 0f04 00F0 brlo .L340 |
1636 0f06 8B3F cpi r24,lo8(-5) |
1637 0f08 01F4 brne .L342 |
1638 0f0a 8091 0000 lds r24,Poti1 |
1639 0f0e 00C0 rjmp .L340 |
1640 .L342: |
1641 0f10 8C3F cpi r24,lo8(-4) |
1642 0f12 01F4 brne .L345 |
1643 0f14 8091 0000 lds r24,Poti2 |
1644 0f18 00C0 rjmp .L340 |
1645 .L345: |
1646 0f1a 8D3F cpi r24,lo8(-3) |
1647 0f1c 01F4 brne .L347 |
1648 0f1e 8091 0000 lds r24,Poti3 |
1649 0f22 00C0 rjmp .L340 |
1650 .L347: |
1651 0f24 8E3F cpi r24,lo8(-2) |
1652 0f26 01F4 brne .L344 |
1653 0f28 8091 0000 lds r24,Poti4 |
1654 .L340: |
1655 0f2c 8093 0000 sts Parameter_UserParam3,r24 |
1656 .L344: |
1657 0f30 8091 0000 lds r24,Parameter_UserParam3 |
1658 0f34 8823 tst r24 |
1659 0f36 01F4 brne .L350 |
1660 0f38 1092 0000 sts Parameter_UserParam3,__zero_reg__ |
1661 0f3c 00C0 rjmp .L352 |
1662 .L350: |
1663 0f3e 8F3F cpi r24,lo8(-1) |
1664 0f40 01F4 brne .L352 |
1665 0f42 8093 0000 sts Parameter_UserParam3,r24 |
1666 .L352: |
1667 0f46 8091 0000 lds r24,EE_Parameter+32 |
1668 0f4a 8B3F cpi r24,lo8(-5) |
1669 0f4c 00F0 brlo .L354 |
1670 0f4e 8B3F cpi r24,lo8(-5) |
1671 0f50 01F4 brne .L356 |
1672 0f52 8091 0000 lds r24,Poti1 |
1673 0f56 00C0 rjmp .L354 |
1674 .L356: |
1675 0f58 8C3F cpi r24,lo8(-4) |
1676 0f5a 01F4 brne .L359 |
1677 0f5c 8091 0000 lds r24,Poti2 |
1678 0f60 00C0 rjmp .L354 |
1679 .L359: |
1680 0f62 8D3F cpi r24,lo8(-3) |
1681 0f64 01F4 brne .L361 |
1682 0f66 8091 0000 lds r24,Poti3 |
1683 0f6a 00C0 rjmp .L354 |
1684 .L361: |
1685 0f6c 8E3F cpi r24,lo8(-2) |
1686 0f6e 01F4 brne .L358 |
1687 0f70 8091 0000 lds r24,Poti4 |
1688 .L354: |
1689 0f74 8093 0000 sts Parameter_UserParam4,r24 |
1690 .L358: |
1691 0f78 8091 0000 lds r24,Parameter_UserParam4 |
1692 0f7c 8823 tst r24 |
1693 0f7e 01F4 brne .L364 |
1694 0f80 1092 0000 sts Parameter_UserParam4,__zero_reg__ |
1695 0f84 00C0 rjmp .L366 |
1696 .L364: |
1697 0f86 8F3F cpi r24,lo8(-1) |
1698 0f88 01F4 brne .L366 |
1699 0f8a 8093 0000 sts Parameter_UserParam4,r24 |
1700 .L366: |
1701 0f8e 9091 0000 lds r25,EE_Parameter+33 |
1702 0f92 9B3F cpi r25,lo8(-5) |
1703 0f94 00F0 brlo .L368 |
1704 0f96 9B3F cpi r25,lo8(-5) |
1705 0f98 01F4 brne .L370 |
1706 0f9a 8091 0000 lds r24,Poti1 |
1707 0f9e 00C0 rjmp .L413 |
1708 .L370: |
1709 0fa0 9C3F cpi r25,lo8(-4) |
1710 0fa2 01F4 brne .L373 |
1711 0fa4 8091 0000 lds r24,Poti2 |
1712 .L413: |
1713 0fa8 8093 0000 sts Parameter_ServoNickControl,r24 |
1714 0fac 00C0 rjmp .L372 |
1715 .L373: |
1716 0fae 9D3F cpi r25,lo8(-3) |
1717 0fb0 01F4 brne .L375 |
1718 0fb2 8091 0000 lds r24,Poti3 |
1719 0fb6 00C0 rjmp .L413 |
1720 .L375: |
1721 0fb8 9E3F cpi r25,lo8(-2) |
1722 0fba 01F4 brne .L372 |
1723 0fbc 8091 0000 lds r24,Poti4 |
1724 0fc0 00C0 rjmp .L413 |
1725 .L368: |
1726 0fc2 9093 0000 sts Parameter_ServoNickControl,r25 |
1727 .L372: |
1728 0fc6 8091 0000 lds r24,Parameter_ServoNickControl |
1729 0fca 8823 tst r24 |
1730 0fcc 01F4 brne .L378 |
1731 0fce 1092 0000 sts Parameter_ServoNickControl,__zero_reg__ |
1732 0fd2 00C0 rjmp .L380 |
1733 .L378: |
1734 0fd4 8F3F cpi r24,lo8(-1) |
1735 0fd6 01F4 brne .L380 |
1736 0fd8 8093 0000 sts Parameter_ServoNickControl,r24 |
1737 .L380: |
1738 0fdc 9B3F cpi r25,lo8(-5) |
1739 0fde 00F0 brlo .L382 |
1740 0fe0 9B3F cpi r25,lo8(-5) |
1741 0fe2 01F4 brne .L384 |
1742 0fe4 8091 0000 lds r24,Poti1 |
1743 0fe8 00C0 rjmp .L414 |
1744 .L384: |
1745 0fea 9C3F cpi r25,lo8(-4) |
1746 0fec 01F4 brne .L387 |
1747 0fee 8091 0000 lds r24,Poti2 |
1748 .L414: |
1749 0ff2 8093 0000 sts Parameter_ServoNickControl,r24 |
1750 0ff6 00C0 rjmp .L386 |
1751 .L387: |
1752 0ff8 9D3F cpi r25,lo8(-3) |
1753 0ffa 01F4 brne .L389 |
1754 0ffc 8091 0000 lds r24,Poti3 |
1755 1000 00C0 rjmp .L414 |
1756 .L389: |
1757 1002 9E3F cpi r25,lo8(-2) |
1758 1004 01F4 brne .L386 |
1759 1006 8091 0000 lds r24,Poti4 |
1760 100a 00C0 rjmp .L414 |
1761 .L382: |
1762 100c 9093 0000 sts Parameter_ServoNickControl,r25 |
1763 .L386: |
1764 1010 8091 0000 lds r24,Parameter_ServoNickControl |
1765 1014 8823 tst r24 |
1766 1016 01F4 brne .L392 |
1767 1018 1092 0000 sts Parameter_ServoNickControl,__zero_reg__ |
1768 101c 00C0 rjmp .L394 |
1769 .L392: |
1770 101e 8F3F cpi r24,lo8(-1) |
1771 1020 01F4 brne .L394 |
1772 1022 8093 0000 sts Parameter_ServoNickControl,r24 |
1773 .L394: |
1774 1026 9B3F cpi r25,lo8(-5) |
1775 1028 00F0 brlo .L396 |
1776 102a 9B3F cpi r25,lo8(-5) |
1777 102c 01F4 brne .L398 |
1778 102e 8091 0000 lds r24,Poti1 |
1779 1032 00C0 rjmp .L415 |
1780 .L398: |
1781 1034 9C3F cpi r25,lo8(-4) |
1782 1036 01F4 brne .L401 |
1783 1038 8091 0000 lds r24,Poti2 |
1784 .L415: |
1785 103c 8093 0000 sts Parameter_ServoNickControl,r24 |
1786 1040 00C0 rjmp .L400 |
1787 .L401: |
1788 1042 9D3F cpi r25,lo8(-3) |
1789 1044 01F4 brne .L403 |
1790 1046 8091 0000 lds r24,Poti3 |
1791 104a 00C0 rjmp .L415 |
1792 .L403: |
1793 104c 9E3F cpi r25,lo8(-2) |
1794 104e 01F4 brne .L400 |
1795 1050 8091 0000 lds r24,Poti4 |
1796 1054 00C0 rjmp .L415 |
1797 .L396: |
1798 1056 9093 0000 sts Parameter_ServoNickControl,r25 |
1799 .L400: |
1800 105a 8091 0000 lds r24,Parameter_ServoNickControl |
1801 105e 8823 tst r24 |
1802 1060 01F4 brne .L406 |
1803 1062 1092 0000 sts Parameter_ServoNickControl,__zero_reg__ |
1804 1066 00C0 rjmp .L408 |
1805 .L406: |
1806 1068 8F3F cpi r24,lo8(-1) |
1807 106a 01F4 brne .L408 |
1808 106c 8093 0000 sts Parameter_ServoNickControl,r24 |
1809 .L408: |
1810 1070 1091 0000 lds r17,Parameter_I_Faktor |
1811 1074 612F mov r22,r17 |
1812 1076 7727 clr r23 |
1813 1078 67FD sbrc r22,7 |
1814 107a 7095 com r23 |
1815 107c 872F mov r24,r23 |
1816 107e 972F mov r25,r23 |
1817 1080 0E94 0000 call __floatsisf |
1818 1084 17FF sbrs r17,7 |
1819 1086 00C0 rjmp .L410 |
1820 1088 20E0 ldi r18,lo8(0x43800000) |
1821 108a 30E0 ldi r19,hi8(0x43800000) |
1822 108c 40E8 ldi r20,hlo8(0x43800000) |
1823 108e 53E4 ldi r21,hhi8(0x43800000) |
1824 1090 0E94 0000 call __addsf3 |
1825 .L410: |
1826 1094 27E1 ldi r18,lo8(0x38d1b717) |
1827 1096 37EB ldi r19,hi8(0x38d1b717) |
1828 1098 41ED ldi r20,hlo8(0x38d1b717) |
1829 109a 58E3 ldi r21,hhi8(0x38d1b717) |
1830 109c 0E94 0000 call __mulsf3 |
1831 10a0 6093 0000 sts Ki,r22 |
1832 10a4 7093 0000 sts (Ki)+1,r23 |
1833 10a8 8093 0000 sts (Ki)+2,r24 |
1834 10ac 9093 0000 sts (Ki)+3,r25 |
1835 10b0 8091 0000 lds r24,EE_Parameter+19 |
1836 10b4 8093 0000 sts MAX_GAS,r24 |
1837 10b8 8091 0000 lds r24,EE_Parameter+18 |
1838 10bc 8093 0000 sts MIN_GAS,r24 |
1839 /* epilogue: frame size=0 */ |
1840 10c0 1F91 pop r17 |
1841 10c2 0895 ret |
1842 /* epilogue end (size=2) */ |
1843 /* function ParameterZuordnung size 589 (586) */ |
1845 .data |
1846 .LC0: |
1847 0000 4B61 6D65 .string "Kamera" |
1847 7261 00 |
1848 0007 00 .string "" |
1849 .text |
1850 .global DefaultKonstanten2 |
1852 DefaultKonstanten2: |
1853 /* prologue: frame size=0 */ |
1854 /* prologue end (size=0) */ |
1855 10c4 83E0 ldi r24,lo8(3) |
1856 10c6 8093 0000 sts EE_Parameter,r24 |
1857 10ca 42E0 ldi r20,lo8(2) |
1858 10cc 4093 0000 sts EE_Parameter+1,r20 |
1859 10d0 81E0 ldi r24,lo8(1) |
1860 10d2 8093 0000 sts EE_Parameter+2,r24 |
1861 10d6 34E0 ldi r19,lo8(4) |
1862 10d8 3093 0000 sts EE_Parameter+3,r19 |
1863 10dc 25E0 ldi r18,lo8(5) |
1864 10de 2093 0000 sts EE_Parameter+4,r18 |
1865 10e2 86E0 ldi r24,lo8(6) |
1866 10e4 8093 0000 sts EE_Parameter+5,r24 |
1867 10e8 87E0 ldi r24,lo8(7) |
1868 10ea 8093 0000 sts EE_Parameter+6,r24 |
1869 10ee 1092 0000 sts EE_Parameter+8,__zero_reg__ |
1870 10f2 8EE1 ldi r24,lo8(30) |
1871 10f4 8093 0000 sts EE_Parameter+9,r24 |
1872 10f8 8BEF ldi r24,lo8(-5) |
1873 10fa 8093 0000 sts EE_Parameter+11,r24 |
1874 10fe 8AE0 ldi r24,lo8(10) |
1875 1100 8093 0000 sts EE_Parameter+12,r24 |
1876 1104 92E3 ldi r25,lo8(50) |
1877 1106 9093 0000 sts EE_Parameter+10,r25 |
1878 110a 9093 0000 sts EE_Parameter+14,r25 |
1879 110e 4093 0000 sts EE_Parameter+13,r20 |
1880 1112 3093 0000 sts EE_Parameter+15,r19 |
1881 1116 1092 0000 sts EE_Parameter+16,__zero_reg__ |
1882 111a 80E1 ldi r24,lo8(16) |
1883 111c 8093 0000 sts EE_Parameter+17,r24 |
1884 1120 2093 0000 sts EE_Parameter+18,r18 |
1885 1124 8AEF ldi r24,lo8(-6) |
1886 1126 8093 0000 sts EE_Parameter+19,r24 |
1887 112a 8AE1 ldi r24,lo8(26) |
1888 112c 8093 0000 sts EE_Parameter+20,r24 |
1889 1130 80E8 ldi r24,lo8(-128) |
1890 1132 8093 0000 sts EE_Parameter+21,r24 |
1891 1136 8FEA ldi r24,lo8(-81) |
1892 1138 8093 0000 sts EE_Parameter+22,r24 |
1893 113c 8093 0000 sts EE_Parameter+23,r24 |
1894 1140 8AE5 ldi r24,lo8(90) |
1895 1142 8093 0000 sts EE_Parameter+24,r24 |
1896 1146 83E2 ldi r24,lo8(35) |
1897 1148 8093 0000 sts EE_Parameter+25,r24 |
1898 114c 84E1 ldi r24,lo8(20) |
1899 114e 8093 0000 sts EE_Parameter+26,r24 |
1900 1152 1092 0000 sts EE_Parameter+27,__zero_reg__ |
1901 1156 2093 0000 sts EE_Parameter+28,r18 |
1902 115a 1092 0000 sts EE_Parameter+29,__zero_reg__ |
1903 115e 1092 0000 sts EE_Parameter+30,__zero_reg__ |
1904 1162 1092 0000 sts EE_Parameter+31,__zero_reg__ |
1905 1166 1092 0000 sts EE_Parameter+32,__zero_reg__ |
1906 116a 84E6 ldi r24,lo8(100) |
1907 116c 8093 0000 sts EE_Parameter+33,r24 |
1908 1170 88E2 ldi r24,lo8(40) |
1909 1172 8093 0000 sts EE_Parameter+34,r24 |
1910 1176 1092 0000 sts EE_Parameter+38,__zero_reg__ |
1911 117a 9093 0000 sts EE_Parameter+35,r25 |
1912 117e 86E9 ldi r24,lo8(-106) |
1913 1180 8093 0000 sts EE_Parameter+36,r24 |
1914 1184 2093 0000 sts EE_Parameter+37,r18 |
1915 1188 A0E0 ldi r26,lo8(EE_Parameter+46) |
1916 118a B0E0 ldi r27,hi8(EE_Parameter+46) |
1917 118c E0E0 ldi r30,lo8(.LC0) |
1918 118e F0E0 ldi r31,hi8(.LC0) |
1919 1190 8CE0 ldi r24,lo8(12) |
1920 .L417: |
1921 1192 0190 ld r0,Z+ |
1922 1194 0D92 st X+,r0 |
1923 1196 8150 subi r24,lo8(-(-1)) |
1924 1198 01F4 brne .L417 |
1925 /* epilogue: frame size=0 */ |
1926 119a 0895 ret |
1927 /* epilogue end (size=1) */ |
1928 /* function DefaultKonstanten2 size 109 (108) */ |
1930 .data |
1931 .LC1: |
1932 0008 4E6F 726D .string "Normal" |
1932 616C 00 |
1933 000f 00 .string "" |
1934 .text |
1935 .global DefaultKonstanten1 |
1937 DefaultKonstanten1: |
1938 /* prologue: frame size=0 */ |
1939 /* prologue end (size=0) */ |
1940 119c 83E0 ldi r24,lo8(3) |
1941 119e 8093 0000 sts EE_Parameter,r24 |
1942 11a2 42E0 ldi r20,lo8(2) |
1943 11a4 4093 0000 sts EE_Parameter+1,r20 |
1944 11a8 81E0 ldi r24,lo8(1) |
1945 11aa 8093 0000 sts EE_Parameter+2,r24 |
1946 11ae 34E0 ldi r19,lo8(4) |
1947 11b0 3093 0000 sts EE_Parameter+3,r19 |
1948 11b4 25E0 ldi r18,lo8(5) |
1949 11b6 2093 0000 sts EE_Parameter+4,r18 |
1950 11ba 86E0 ldi r24,lo8(6) |
1951 11bc 8093 0000 sts EE_Parameter+5,r24 |
1952 11c0 87E0 ldi r24,lo8(7) |
1953 11c2 8093 0000 sts EE_Parameter+6,r24 |
1954 11c6 88E0 ldi r24,lo8(8) |
1955 11c8 8093 0000 sts EE_Parameter+7,r24 |
1956 11cc 1092 0000 sts EE_Parameter+8,__zero_reg__ |
1957 11d0 9EE1 ldi r25,lo8(30) |
1958 11d2 9093 0000 sts EE_Parameter+9,r25 |
1959 11d6 8BEF ldi r24,lo8(-5) |
1960 11d8 8093 0000 sts EE_Parameter+11,r24 |
1961 11dc 8AE0 ldi r24,lo8(10) |
1962 11de 8093 0000 sts EE_Parameter+12,r24 |
1963 11e2 86E4 ldi r24,lo8(70) |
1964 11e4 8093 0000 sts EE_Parameter+10,r24 |
1965 11e8 9093 0000 sts EE_Parameter+14,r25 |
1966 11ec 4093 0000 sts EE_Parameter+13,r20 |
1967 11f0 3093 0000 sts EE_Parameter+15,r19 |
1968 11f4 1092 0000 sts EE_Parameter+16,__zero_reg__ |
1969 11f8 80E1 ldi r24,lo8(16) |
1970 11fa 8093 0000 sts EE_Parameter+17,r24 |
1971 11fe 2093 0000 sts EE_Parameter+18,r18 |
1972 1202 8AEF ldi r24,lo8(-6) |
1973 1204 8093 0000 sts EE_Parameter+19,r24 |
1974 1208 8AE1 ldi r24,lo8(26) |
1975 120a 8093 0000 sts EE_Parameter+20,r24 |
1976 120e 80E8 ldi r24,lo8(-128) |
1977 1210 8093 0000 sts EE_Parameter+21,r24 |
1978 1214 88E7 ldi r24,lo8(120) |
1979 1216 8093 0000 sts EE_Parameter+22,r24 |
1980 121a 96E9 ldi r25,lo8(-106) |
1981 121c 9093 0000 sts EE_Parameter+23,r25 |
1982 1220 8AE5 ldi r24,lo8(90) |
1983 1222 8093 0000 sts EE_Parameter+24,r24 |
1984 1226 83E2 ldi r24,lo8(35) |
1985 1228 8093 0000 sts EE_Parameter+25,r24 |
1986 122c 84E1 ldi r24,lo8(20) |
1987 122e 8093 0000 sts EE_Parameter+26,r24 |
1988 1232 1092 0000 sts EE_Parameter+27,__zero_reg__ |
1989 1236 2093 0000 sts EE_Parameter+28,r18 |
1990 123a 1092 0000 sts EE_Parameter+29,__zero_reg__ |
1991 123e 1092 0000 sts EE_Parameter+30,__zero_reg__ |
1992 1242 1092 0000 sts EE_Parameter+31,__zero_reg__ |
1993 1246 1092 0000 sts EE_Parameter+32,__zero_reg__ |
1994 124a 84E6 ldi r24,lo8(100) |
1995 124c 8093 0000 sts EE_Parameter+33,r24 |
1996 1250 88E2 ldi r24,lo8(40) |
1997 1252 8093 0000 sts EE_Parameter+34,r24 |
1998 1256 1092 0000 sts EE_Parameter+38,__zero_reg__ |
1999 125a 82E3 ldi r24,lo8(50) |
2000 125c 8093 0000 sts EE_Parameter+35,r24 |
2001 1260 9093 0000 sts EE_Parameter+36,r25 |
2002 1264 2093 0000 sts EE_Parameter+37,r18 |
2003 1268 A0E0 ldi r26,lo8(EE_Parameter+46) |
2004 126a B0E0 ldi r27,hi8(EE_Parameter+46) |
2005 126c E0E0 ldi r30,lo8(.LC1) |
2006 126e F0E0 ldi r31,hi8(.LC1) |
2007 1270 8CE0 ldi r24,lo8(12) |
2008 .L422: |
2009 1272 0190 ld r0,Z+ |
2010 1274 0D92 st X+,r0 |
2011 1276 8150 subi r24,lo8(-(-1)) |
2012 1278 01F4 brne .L422 |
2013 /* epilogue: frame size=0 */ |
2014 127a 0895 ret |
2015 /* epilogue end (size=1) */ |
2016 /* function DefaultKonstanten1 size 113 (112) */ |
2018 .global SendMotorData |
2020 SendMotorData: |
2021 /* prologue: frame size=0 */ |
2022 /* prologue end (size=0) */ |
2023 127c 8091 0000 lds r24,MotorenEin |
2024 1280 8823 tst r24 |
2025 1282 01F4 brne .L427 |
2026 1284 1092 0000 sts Motor_Hinten,__zero_reg__ |
2027 1288 1092 0000 sts Motor_Vorne,__zero_reg__ |
2028 128c 1092 0000 sts Motor_Rechts,__zero_reg__ |
2029 1290 1092 0000 sts Motor_Links,__zero_reg__ |
2030 1294 8091 0000 lds r24,MotorTest |
2031 1298 8823 tst r24 |
2032 129a 01F0 breq .L429 |
2033 129c 8093 0000 sts Motor_Vorne,r24 |
2034 .L429: |
2035 12a0 8091 0000 lds r24,MotorTest+1 |
2036 12a4 8823 tst r24 |
2037 12a6 01F0 breq .L431 |
2038 12a8 8093 0000 sts Motor_Hinten,r24 |
2039 .L431: |
2040 12ac 8091 0000 lds r24,MotorTest+2 |
2041 12b0 8823 tst r24 |
2042 12b2 01F0 breq .L433 |
2043 12b4 8093 0000 sts Motor_Links,r24 |
2044 .L433: |
2045 12b8 8091 0000 lds r24,MotorTest+3 |
2046 12bc 8823 tst r24 |
2047 12be 01F0 breq .L427 |
2048 12c0 8093 0000 sts Motor_Rechts,r24 |
2049 .L427: |
2050 12c4 1092 0000 sts twi_state,__zero_reg__ |
2051 12c8 1092 0000 sts motor,__zero_reg__ |
2052 12cc 0E94 0000 call i2c_start |
2053 /* epilogue: frame size=0 */ |
2054 12d0 0895 ret |
2055 /* epilogue end (size=1) */ |
2056 /* function SendMotorData size 43 (42) */ |
2058 .global SetNeutral |
2060 SetNeutral: |
2061 /* prologue: frame size=0 */ |
2062 12d2 CF93 push r28 |
2063 12d4 DF93 push r29 |
2064 /* prologue end (size=2) */ |
2065 12d6 1092 0000 sts (NeutralAccX)+1,__zero_reg__ |
2066 12da 1092 0000 sts NeutralAccX,__zero_reg__ |
2067 12de 1092 0000 sts (NeutralAccY)+1,__zero_reg__ |
2068 12e2 1092 0000 sts NeutralAccY,__zero_reg__ |
2069 12e6 80E0 ldi r24,lo8(0x0) |
2070 12e8 90E0 ldi r25,hi8(0x0) |
2071 12ea A0E0 ldi r26,hlo8(0x0) |
2072 12ec B0E0 ldi r27,hhi8(0x0) |
2073 12ee 8093 0000 sts NeutralAccZ,r24 |
2074 12f2 9093 0000 sts (NeutralAccZ)+1,r25 |
2075 12f6 A093 0000 sts (NeutralAccZ)+2,r26 |
2076 12fa B093 0000 sts (NeutralAccZ)+3,r27 |
2077 12fe 1092 0000 sts (AdNeutralNick)+1,__zero_reg__ |
2078 1302 1092 0000 sts AdNeutralNick,__zero_reg__ |
2079 1306 1092 0000 sts (AdNeutralRoll)+1,__zero_reg__ |
2080 130a 1092 0000 sts AdNeutralRoll,__zero_reg__ |
2081 130e 1092 0000 sts (AdNeutralGier)+1,__zero_reg__ |
2082 1312 1092 0000 sts AdNeutralGier,__zero_reg__ |
2083 1316 0E94 0000 call CalibrierMittelwert |
2084 131a 85E0 ldi r24,lo8(5) |
2085 131c 90E0 ldi r25,hi8(5) |
2086 131e 0E94 0000 call SetDelay |
2087 1322 EC01 movw r28,r24 |
2088 .L438: |
2089 1324 CE01 movw r24,r28 |
2090 1326 0E94 0000 call CheckDelay |
2091 132a 8823 tst r24 |
2092 132c 01F0 breq .L438 |
2093 132e 0E94 0000 call CalibrierMittelwert |
2094 1332 8091 0000 lds r24,EE_Parameter+8 |
2095 1336 80FF sbrs r24,0 |
2096 1338 00C0 rjmp .L440 |
2097 133a 8091 0000 lds r24,MessLuftdruck |
2098 133e 9091 0000 lds r25,(MessLuftdruck)+1 |
2099 1342 875B subi r24,lo8(951) |
2100 1344 9340 sbci r25,hi8(951) |
2101 1346 00F4 brsh .L442 |
2102 1348 8091 0000 lds r24,MessLuftdruck |
2103 134c 9091 0000 lds r25,(MessLuftdruck)+1 |
2104 1350 8E5E subi r24,lo8(750) |
2105 1352 9240 sbci r25,hi8(750) |
2106 1354 00F4 brsh .L440 |
2107 .L442: |
2108 1356 0E94 0000 call SucheLuftruckOffset |
2109 .L440: |
2110 135a 8091 0000 lds r24,MesswertNick |
2111 135e 9091 0000 lds r25,(MesswertNick)+1 |
2112 1362 97FF sbrs r25,7 |
2113 1364 00C0 rjmp .L444 |
2114 1366 9095 com r25 |
2115 1368 8195 neg r24 |
2116 136a 9F4F sbci r25,lo8(-1) |
2117 .L444: |
2118 136c 9093 0000 sts (AdNeutralNick)+1,r25 |
2119 1370 8093 0000 sts AdNeutralNick,r24 |
2120 1374 8091 0000 lds r24,MesswertRoll |
2121 1378 9091 0000 lds r25,(MesswertRoll)+1 |
2122 137c 97FF sbrs r25,7 |
2123 137e 00C0 rjmp .L445 |
2124 1380 9095 com r25 |
2125 1382 8195 neg r24 |
2126 1384 9F4F sbci r25,lo8(-1) |
2127 .L445: |
2128 1386 9093 0000 sts (AdNeutralRoll)+1,r25 |
2129 138a 8093 0000 sts AdNeutralRoll,r24 |
2130 138e 8091 0000 lds r24,MesswertGier |
2131 1392 9091 0000 lds r25,(MesswertGier)+1 |
2132 1396 97FF sbrs r25,7 |
2133 1398 00C0 rjmp .L446 |
2134 139a 9095 com r25 |
2135 139c 8195 neg r24 |
2136 139e 9F4F sbci r25,lo8(-1) |
2137 .L446: |
2138 13a0 9093 0000 sts (AdNeutralGier)+1,r25 |
2139 13a4 8093 0000 sts AdNeutralGier,r24 |
2140 13a8 8091 0000 lds r24,Mittelwert_AccRoll |
2141 13ac 9091 0000 lds r25,(Mittelwert_AccRoll)+1 |
2142 13b0 97FF sbrs r25,7 |
2143 13b2 00C0 rjmp .L447 |
2144 13b4 9095 com r25 |
2145 13b6 8195 neg r24 |
2146 13b8 9F4F sbci r25,lo8(-1) |
2147 .L447: |
2148 13ba 60E1 ldi r22,lo8(16) |
2149 13bc 70E0 ldi r23,hi8(16) |
2150 13be 0E94 0000 call __divmodhi4 |
2151 13c2 7093 0000 sts (NeutralAccY)+1,r23 |
2152 13c6 6093 0000 sts NeutralAccY,r22 |
2153 13ca 8091 0000 lds r24,Mittelwert_AccNick |
2154 13ce 9091 0000 lds r25,(Mittelwert_AccNick)+1 |
2155 13d2 97FF sbrs r25,7 |
2156 13d4 00C0 rjmp .L448 |
2157 13d6 9095 com r25 |
2158 13d8 8195 neg r24 |
2159 13da 9F4F sbci r25,lo8(-1) |
2160 .L448: |
2161 13dc 60E1 ldi r22,lo8(16) |
2162 13de 70E0 ldi r23,hi8(16) |
2163 13e0 0E94 0000 call __divmodhi4 |
2164 13e4 7093 0000 sts (NeutralAccX)+1,r23 |
2165 13e8 6093 0000 sts NeutralAccX,r22 |
2166 13ec 6091 0000 lds r22,Aktuell_az |
2167 13f0 7091 0000 lds r23,(Aktuell_az)+1 |
2168 13f4 8827 clr r24 |
2169 13f6 77FD sbrc r23,7 |
2170 13f8 8095 com r24 |
2171 13fa 982F mov r25,r24 |
2172 13fc 0E94 0000 call __floatsisf |
2173 1400 6093 0000 sts NeutralAccZ,r22 |
2174 1404 7093 0000 sts (NeutralAccZ)+1,r23 |
2175 1408 8093 0000 sts (NeutralAccZ)+2,r24 |
2176 140c 9093 0000 sts (NeutralAccZ)+3,r25 |
2177 1410 1092 0000 sts Mess_IntegralNick,__zero_reg__ |
2178 1414 1092 0000 sts (Mess_IntegralNick)+1,__zero_reg__ |
2179 1418 1092 0000 sts (Mess_IntegralNick)+2,__zero_reg__ |
2180 141c 1092 0000 sts (Mess_IntegralNick)+3,__zero_reg__ |
2181 1420 1092 0000 sts Mess_IntegralNick2,__zero_reg__ |
2182 1424 1092 0000 sts (Mess_IntegralNick2)+1,__zero_reg__ |
2183 1428 1092 0000 sts (Mess_IntegralNick2)+2,__zero_reg__ |
2184 142c 1092 0000 sts (Mess_IntegralNick2)+3,__zero_reg__ |
2185 1430 1092 0000 sts Mess_IntegralRoll,__zero_reg__ |
2186 1434 1092 0000 sts (Mess_IntegralRoll)+1,__zero_reg__ |
2187 1438 1092 0000 sts (Mess_IntegralRoll)+2,__zero_reg__ |
2188 143c 1092 0000 sts (Mess_IntegralRoll)+3,__zero_reg__ |
2189 1440 1092 0000 sts Mess_IntegralRoll2,__zero_reg__ |
2190 1444 1092 0000 sts (Mess_IntegralRoll2)+1,__zero_reg__ |
2191 1448 1092 0000 sts (Mess_IntegralRoll2)+2,__zero_reg__ |
2192 144c 1092 0000 sts (Mess_IntegralRoll2)+3,__zero_reg__ |
2193 1450 1092 0000 sts Mess_Integral_Gier,__zero_reg__ |
2194 1454 1092 0000 sts (Mess_Integral_Gier)+1,__zero_reg__ |
2195 1458 1092 0000 sts (Mess_Integral_Gier)+2,__zero_reg__ |
2196 145c 1092 0000 sts (Mess_Integral_Gier)+3,__zero_reg__ |
2197 1460 1092 0000 sts (MesswertNick)+1,__zero_reg__ |
2198 1464 1092 0000 sts MesswertNick,__zero_reg__ |
2199 1468 1092 0000 sts (MesswertRoll)+1,__zero_reg__ |
2200 146c 1092 0000 sts MesswertRoll,__zero_reg__ |
2201 1470 1092 0000 sts (MesswertGier)+1,__zero_reg__ |
2202 1474 1092 0000 sts MesswertGier,__zero_reg__ |
2203 1478 8091 0000 lds r24,Luftdruck |
2204 147c 9091 0000 lds r25,(Luftdruck)+1 |
2205 1480 A091 0000 lds r26,(Luftdruck)+2 |
2206 1484 B091 0000 lds r27,(Luftdruck)+3 |
2207 1488 9093 0000 sts (StartLuftdruck)+1,r25 |
2208 148c 8093 0000 sts StartLuftdruck,r24 |
2209 1490 1092 0000 sts (HoeheD)+1,__zero_reg__ |
2210 1494 1092 0000 sts HoeheD,__zero_reg__ |
2211 1498 1092 0000 sts Mess_Integral_Hoch,__zero_reg__ |
2212 149c 1092 0000 sts (Mess_Integral_Hoch)+1,__zero_reg__ |
2213 14a0 1092 0000 sts (Mess_Integral_Hoch)+2,__zero_reg__ |
2214 14a4 1092 0000 sts (Mess_Integral_Hoch)+3,__zero_reg__ |
2215 14a8 8091 0000 lds r24,KompassValue |
2216 14ac 9091 0000 lds r25,(KompassValue)+1 |
2217 14b0 9093 0000 sts (KompassStartwert)+1,r25 |
2218 14b4 8093 0000 sts KompassStartwert,r24 |
2219 14b8 82E3 ldi r24,lo8(50) |
2220 14ba 90E0 ldi r25,hi8(50) |
2221 14bc 9093 0000 sts (beeptime)+1,r25 |
2222 14c0 8093 0000 sts beeptime,r24 |
2223 /* epilogue: frame size=0 */ |
2224 14c4 DF91 pop r29 |
2225 14c6 CF91 pop r28 |
2226 14c8 0895 ret |
2227 /* epilogue end (size=3) */ |
2228 /* function SetNeutral size 254 (249) */ |
2230 .global Piep |
2232 Piep: |
2233 /* prologue: frame size=0 */ |
2234 14ca 1F93 push r17 |
2235 /* prologue end (size=1) */ |
2236 14cc 182F mov r17,r24 |
2237 14ce 00C0 rjmp .L453 |
2238 .L454: |
2239 14d0 8091 0000 lds r24,MotorenEin |
2240 14d4 8823 tst r24 |
2241 14d6 01F4 brne .L457 |
2242 14d8 84E6 ldi r24,lo8(100) |
2243 14da 90E0 ldi r25,hi8(100) |
2244 14dc 9093 0000 sts (beeptime)+1,r25 |
2245 14e0 8093 0000 sts beeptime,r24 |
2246 14e4 8AEF ldi r24,lo8(250) |
2247 14e6 90E0 ldi r25,hi8(250) |
2248 14e8 0E94 0000 call Delay_ms |
2249 .L453: |
2250 14ec 1150 subi r17,1 |
2251 14ee 00F4 brcc .L454 |
2252 .L457: |
2253 /* epilogue: frame size=0 */ |
2254 14f0 1F91 pop r17 |
2255 14f2 0895 ret |
2256 /* epilogue end (size=2) */ |
2257 /* function Piep size 22 (19) */ |
2259 .global MotorRegler |
2261 MotorRegler: |
2262 /* prologue: frame size=4 */ |
2263 14f4 2F92 push r2 |
2264 14f6 3F92 push r3 |
2265 14f8 4F92 push r4 |
2266 14fa 5F92 push r5 |
2267 14fc 6F92 push r6 |
2268 14fe 7F92 push r7 |
2269 1500 8F92 push r8 |
2270 1502 9F92 push r9 |
2271 1504 AF92 push r10 |
2272 1506 BF92 push r11 |
2273 1508 CF92 push r12 |
2274 150a DF92 push r13 |
2275 150c EF92 push r14 |
2276 150e FF92 push r15 |
2277 1510 0F93 push r16 |
2278 1512 1F93 push r17 |
2279 1514 CF93 push r28 |
2280 1516 DF93 push r29 |
2281 1518 CDB7 in r28,__SP_L__ |
2282 151a DEB7 in r29,__SP_H__ |
2283 151c 2497 sbiw r28,4 |
2284 151e 0FB6 in __tmp_reg__,__SREG__ |
2285 1520 F894 cli |
2286 1522 DEBF out __SP_H__,r29 |
2287 1524 0FBE out __SREG__,__tmp_reg__ |
2288 1526 CDBF out __SP_L__,r28 |
2289 /* prologue end (size=26) */ |
2290 1528 0E94 0000 call Mittelwert |
2291 152c 299A sbi 37-0x20,1 |
2292 152e E091 0000 lds r30,EE_Parameter+2 |
2293 1532 AE2F mov r26,r30 |
2294 1534 BB27 clr r27 |
2295 1536 AA0F lsl r26 |
2296 1538 BB1F rol r27 |
2297 153a A050 subi r26,lo8(-(PPM_in)) |
2298 153c B040 sbci r27,hi8(-(PPM_in)) |
2299 153e 0D90 ld __tmp_reg__,X+ |
2300 1540 BC91 ld r27,X |
2301 1542 A02D mov r26,__tmp_reg__ |
2302 1544 9D01 movw r18,r26 |
2303 1546 2858 subi r18,lo8(-(120)) |
2304 1548 3F4F sbci r19,hi8(-(120)) |
2305 154a 3A83 std Y+2,r19 |
2306 154c 2983 std Y+1,r18 |
2307 154e 37FF sbrs r19,7 |
2308 1550 00C0 rjmp .L459 |
2309 1552 1A82 std Y+2,__zero_reg__ |
2310 1554 1982 std Y+1,__zero_reg__ |
2311 .L459: |
2312 1556 8091 0000 lds r24,SenderOkay |
2313 155a 8436 cpi r24,lo8(100) |
2314 155c 00F0 brlo .+2 |
2315 155e 00C0 rjmp .L460 |
2316 1560 8091 0000 lds r24,PcZugriff |
2317 1564 8823 tst r24 |
2318 1566 01F4 brne .L462 |
2319 1568 84EF ldi r24,lo8(500) |
2320 156a 91E0 ldi r25,hi8(500) |
2321 156c 9093 0000 sts (beeptime)+1,r25 |
2322 1570 8093 0000 sts beeptime,r24 |
2323 .L462: |
2324 1574 8091 0000 lds r24,RcLostTimer.2446 |
2325 1578 9091 0000 lds r25,(RcLostTimer.2446)+1 |
2326 157c 0097 sbiw r24,0 |
2327 157e 01F0 breq .L464 |
2328 1580 0197 sbiw r24,1 |
2329 1582 9093 0000 sts (RcLostTimer.2446)+1,r25 |
2330 1586 8093 0000 sts RcLostTimer.2446,r24 |
2331 158a 00C0 rjmp .L466 |
2332 .L464: |
2333 158c 1092 0000 sts MotorenEin,__zero_reg__ |
2334 1590 1092 0000 sts Notlandung,__zero_reg__ |
2335 .L466: |
2336 1594 289A sbi 37-0x20,0 |
2337 1596 8091 0000 lds r24,modell_fliegt.2450 |
2338 159a 9091 0000 lds r25,(modell_fliegt.2450)+1 |
2339 159e 815D subi r24,lo8(2001) |
2340 15a0 9740 sbci r25,hi8(2001) |
2341 15a2 00F0 brlo .L467 |
2342 15a4 8091 0000 lds r24,EE_Parameter+25 |
2343 15a8 482F mov r20,r24 |
2344 15aa 5527 clr r21 |
2345 15ac 5A83 std Y+2,r21 |
2346 15ae 4983 std Y+1,r20 |
2347 15b0 81E0 ldi r24,lo8(1) |
2348 15b2 8093 0000 sts Notlandung,r24 |
2349 15b6 E091 0000 lds r30,EE_Parameter |
2350 15ba FF27 clr r31 |
2351 15bc EE0F lsl r30 |
2352 15be FF1F rol r31 |
2353 15c0 E050 subi r30,lo8(-(PPM_in)) |
2354 15c2 F040 sbci r31,hi8(-(PPM_in)) |
2355 15c4 1182 std Z+1,__zero_reg__ |
2356 15c6 1082 st Z,__zero_reg__ |
2357 15c8 E091 0000 lds r30,EE_Parameter+1 |
2358 15cc FF27 clr r31 |
2359 15ce EE0F lsl r30 |
2360 15d0 FF1F rol r31 |
2361 15d2 E050 subi r30,lo8(-(PPM_in)) |
2362 15d4 F040 sbci r31,hi8(-(PPM_in)) |
2363 15d6 1182 std Z+1,__zero_reg__ |
2364 15d8 1082 st Z,__zero_reg__ |
2365 15da E091 0000 lds r30,EE_Parameter+3 |
2366 15de FF27 clr r31 |
2367 15e0 EE0F lsl r30 |
2368 15e2 FF1F rol r31 |
2369 15e4 E050 subi r30,lo8(-(PPM_in)) |
2370 15e6 F040 sbci r31,hi8(-(PPM_in)) |
2371 15e8 1182 std Z+1,__zero_reg__ |
2372 15ea 1082 st Z,__zero_reg__ |
2373 15ec 00C0 rjmp .L469 |
2374 .L467: |
2375 15ee 1092 0000 sts MotorenEin,__zero_reg__ |
2376 15f2 00C0 rjmp .L469 |
2377 .L460: |
2378 15f4 8091 0000 lds r24,SenderOkay |
2379 15f8 8D38 cpi r24,lo8(-115) |
2380 15fa 00F4 brsh .+2 |
2381 15fc 00C0 rjmp .L469 |
2382 15fe 1092 0000 sts Notlandung,__zero_reg__ |
2383 1602 8091 0000 lds r24,EE_Parameter+26 |
2384 1606 22E3 ldi r18,lo8(50) |
2385 1608 829F mul r24,r18 |
2386 160a C001 movw r24,r0 |
2387 160c 1124 clr r1 |
2388 160e 9093 0000 sts (RcLostTimer.2446)+1,r25 |
2389 1612 8093 0000 sts RcLostTimer.2446,r24 |
2390 1616 6981 ldd r22,Y+1 |
2391 1618 7A81 ldd r23,Y+2 |
2392 161a 6932 cpi r22,41 |
2393 161c 7105 cpc r23,__zero_reg__ |
2394 161e 04F0 brlt .L471 |
2395 1620 8091 0000 lds r24,modell_fliegt.2450 |
2396 1624 9091 0000 lds r25,(modell_fliegt.2450)+1 |
2397 1628 7FEF ldi r23,hi8(-1) |
2398 162a 8F3F cpi r24,lo8(-1) |
2399 162c 9707 cpc r25,r23 |
2400 162e 01F0 breq .L473 |
2401 1630 0196 adiw r24,1 |
2402 1632 9093 0000 sts (modell_fliegt.2450)+1,r25 |
2403 1636 8093 0000 sts modell_fliegt.2450,r24 |
2404 .L473: |
2405 163a 8091 0000 lds r24,modell_fliegt.2450 |
2406 163e 9091 0000 lds r25,(modell_fliegt.2450)+1 |
2407 1642 9093 0000 sts (modell_fliegt_gps)+1,r25 |
2408 1646 8093 0000 sts modell_fliegt_gps,r24 |
2409 .L471: |
2410 164a 8091 0000 lds r24,modell_fliegt.2450 |
2411 164e 9091 0000 lds r25,(modell_fliegt.2450)+1 |
2412 1652 883C cpi r24,200 |
2413 1654 9105 cpc r25,__zero_reg__ |
2414 1656 00F0 brlo .L475 |
2415 1658 8981 ldd r24,Y+1 |
2416 165a 9A81 ldd r25,Y+2 |
2417 165c 8897 sbiw r24,40 |
2418 165e 04F4 brge .L477 |
2419 .L475: |
2420 1660 1092 0000 sts SummeNick.2439,__zero_reg__ |
2421 1664 1092 0000 sts (SummeNick.2439)+1,__zero_reg__ |
2422 1668 1092 0000 sts (SummeNick.2439)+2,__zero_reg__ |
2423 166c 1092 0000 sts (SummeNick.2439)+3,__zero_reg__ |
2424 1670 1092 0000 sts SummeRoll.2440,__zero_reg__ |
2425 1674 1092 0000 sts (SummeRoll.2440)+1,__zero_reg__ |
2426 1678 1092 0000 sts (SummeRoll.2440)+2,__zero_reg__ |
2427 167c 1092 0000 sts (SummeRoll.2440)+3,__zero_reg__ |
2428 1680 1092 0000 sts Mess_Integral_Gier,__zero_reg__ |
2429 1684 1092 0000 sts (Mess_Integral_Gier)+1,__zero_reg__ |
2430 1688 1092 0000 sts (Mess_Integral_Gier)+2,__zero_reg__ |
2431 168c 1092 0000 sts (Mess_Integral_Gier)+3,__zero_reg__ |
2432 1690 1092 0000 sts Mess_Integral_Gier2,__zero_reg__ |
2433 1694 1092 0000 sts (Mess_Integral_Gier2)+1,__zero_reg__ |
2434 1698 1092 0000 sts (Mess_Integral_Gier2)+2,__zero_reg__ |
2435 169c 1092 0000 sts (Mess_Integral_Gier2)+3,__zero_reg__ |
2436 .L477: |
2437 16a0 E981 ldd r30,Y+1 |
2438 16a2 FA81 ldd r31,Y+2 |
2439 16a4 E93C cpi r30,201 |
2440 16a6 F105 cpc r31,__zero_reg__ |
2441 16a8 04F4 brge .+2 |
2442 16aa 00C0 rjmp .L478 |
2443 16ac 8091 0000 lds r24,MotorenEin |
2444 16b0 8823 tst r24 |
2445 16b2 01F0 breq .+2 |
2446 16b4 00C0 rjmp .L469 |
2447 16b6 E091 0000 lds r30,EE_Parameter+3 |
2448 16ba FF27 clr r31 |
2449 16bc EE0F lsl r30 |
2450 16be FF1F rol r31 |
2451 16c0 E050 subi r30,lo8(-(PPM_in)) |
2452 16c2 F040 sbci r31,hi8(-(PPM_in)) |
2453 16c4 8081 ld r24,Z |
2454 16c6 9181 ldd r25,Z+1 |
2455 16c8 8C34 cpi r24,76 |
2456 16ca 9105 cpc r25,__zero_reg__ |
2457 16cc 04F4 brge .+2 |
2458 16ce 00C0 rjmp .L481 |
2459 16d0 8091 0000 lds r24,delay_neutral.2447 |
2460 16d4 8F5F subi r24,lo8(-(1)) |
2461 16d6 8093 0000 sts delay_neutral.2447,r24 |
2462 16da 893C cpi r24,lo8(-55) |
2463 16dc 00F4 brsh .+2 |
2464 16de 00C0 rjmp .L469 |
2465 16e0 2998 cbi 37-0x20,1 |
2466 16e2 0E94 0000 call SetNeutral |
2467 16e6 1092 0000 sts MotorenEin,__zero_reg__ |
2468 16ea 1092 0000 sts delay_neutral.2447,__zero_reg__ |
2469 16ee 1092 0000 sts (modell_fliegt.2450)+1,__zero_reg__ |
2470 16f2 1092 0000 sts modell_fliegt.2450,__zero_reg__ |
2471 16f6 8091 0000 lds r24,EE_Parameter |
2472 16fa 282F mov r18,r24 |
2473 16fc 3327 clr r19 |
2474 16fe F901 movw r30,r18 |
2475 1700 EE0F lsl r30 |
2476 1702 FF1F rol r31 |
2477 1704 E050 subi r30,lo8(-(PPM_in)) |
2478 1706 F040 sbci r31,hi8(-(PPM_in)) |
2479 1708 8081 ld r24,Z |
2480 170a 9181 ldd r25,Z+1 |
2481 170c 8734 cpi r24,71 |
2482 170e 9105 cpc r25,__zero_reg__ |
2483 1710 04F4 brge .L484 |
2484 1712 E091 0000 lds r30,EE_Parameter+1 |
2485 1716 FF27 clr r31 |
2486 1718 EE0F lsl r30 |
2487 171a FF1F rol r31 |
2488 171c E050 subi r30,lo8(-(PPM_in)) |
2489 171e F040 sbci r31,hi8(-(PPM_in)) |
2490 1720 0190 ld __tmp_reg__,Z+ |
2491 1722 F081 ld r31,Z |
2492 1724 E02D mov r30,__tmp_reg__ |
2493 1726 F7FF sbrs r31,7 |
2494 1728 00C0 rjmp .L487 |
2495 172a F095 com r31 |
2496 172c E195 neg r30 |
2497 172e FF4F sbci r31,lo8(-1) |
2498 .L487: |
2499 1730 E734 cpi r30,71 |
2500 1732 F105 cpc r31,__zero_reg__ |
2501 1734 04F4 brge .+2 |
2502 1736 00C0 rjmp .L486 |
2503 .L484: |
2504 1738 8091 0000 lds r24,EE_Parameter+1 |
2505 173c 682F mov r22,r24 |
2506 173e 7727 clr r23 |
2507 1740 DB01 movw r26,r22 |
2508 1742 AA0F lsl r26 |
2509 1744 BB1F rol r27 |
2510 1746 A050 subi r26,lo8(-(PPM_in)) |
2511 1748 B040 sbci r27,hi8(-(PPM_in)) |
2512 174a 8D91 ld r24,X+ |
2513 174c 9C91 ld r25,X |
2514 174e 1197 sbiw r26,1 |
2515 1750 8734 cpi r24,71 |
2516 1752 9105 cpc r25,__zero_reg__ |
2517 1754 04F0 brlt .L488 |
2518 1756 F901 movw r30,r18 |
2519 1758 EE0F lsl r30 |
2520 175a FF1F rol r31 |
2521 175c E050 subi r30,lo8(-(PPM_in)) |
2522 175e F040 sbci r31,hi8(-(PPM_in)) |
2523 1760 8081 ld r24,Z |
2524 1762 9181 ldd r25,Z+1 |
2525 .L488: |
2526 1764 8D91 ld r24,X+ |
2527 1766 9C91 ld r25,X |
2528 1768 8734 cpi r24,71 |
2529 176a 9105 cpc r25,__zero_reg__ |
2530 176c 04F0 brlt .L490 |
2531 176e F901 movw r30,r18 |
2532 1770 EE0F lsl r30 |
2533 1772 FF1F rol r31 |
2534 1774 E050 subi r30,lo8(-(PPM_in)) |
2535 1776 F040 sbci r31,hi8(-(PPM_in)) |
2536 1778 8081 ld r24,Z |
2537 177a 9181 ldd r25,Z+1 |
2538 177c 8734 cpi r24,71 |
2539 177e 9105 cpc r25,__zero_reg__ |
2540 1780 04F0 brlt .L490 |
2541 1782 42E0 ldi r20,lo8(2) |
2542 1784 00C0 rjmp .L493 |
2543 .L490: |
2544 1786 41E0 ldi r20,lo8(1) |
2545 .L493: |
2546 1788 FB01 movw r30,r22 |
2547 178a EE0F lsl r30 |
2548 178c FF1F rol r31 |
2549 178e E050 subi r30,lo8(-(PPM_in)) |
2550 1790 F040 sbci r31,hi8(-(PPM_in)) |
2551 1792 8081 ld r24,Z |
2552 1794 9181 ldd r25,Z+1 |
2553 1796 8634 cpi r24,70 |
2554 1798 9105 cpc r25,__zero_reg__ |
2555 179a 04F4 brge .L494 |
2556 179c F901 movw r30,r18 |
2557 179e EE0F lsl r30 |
2558 17a0 FF1F rol r31 |
2559 17a2 E050 subi r30,lo8(-(PPM_in)) |
2560 17a4 F040 sbci r31,hi8(-(PPM_in)) |
2561 17a6 8081 ld r24,Z |
2562 17a8 9181 ldd r25,Z+1 |
2563 17aa 8734 cpi r24,71 |
2564 17ac 9105 cpc r25,__zero_reg__ |
2565 17ae 04F0 brlt .L494 |
2566 17b0 43E0 ldi r20,lo8(3) |
2567 .L494: |
2568 17b2 FB01 movw r30,r22 |
2569 17b4 EE0F lsl r30 |
2570 17b6 FF1F rol r31 |
2571 17b8 E050 subi r30,lo8(-(PPM_in)) |
2572 17ba F040 sbci r31,hi8(-(PPM_in)) |
2573 17bc 8081 ld r24,Z |
2574 17be 9181 ldd r25,Z+1 |
2575 17c0 8A5B subi r24,lo8(-70) |
2576 17c2 9F4F sbci r25,hi8(-70) |
2577 17c4 04F4 brge .L497 |
2578 17c6 F901 movw r30,r18 |
2579 17c8 EE0F lsl r30 |
2580 17ca FF1F rol r31 |
2581 17cc E050 subi r30,lo8(-(PPM_in)) |
2582 17ce F040 sbci r31,hi8(-(PPM_in)) |
2583 17d0 8081 ld r24,Z |
2584 17d2 9181 ldd r25,Z+1 |
2585 17d4 8734 cpi r24,71 |
2586 17d6 9105 cpc r25,__zero_reg__ |
2587 17d8 04F0 brlt .L497 |
2588 17da 44E0 ldi r20,lo8(4) |
2589 .L497: |
2590 17dc 660F lsl r22 |
2591 17de 771F rol r23 |
2592 17e0 6050 subi r22,lo8(-(PPM_in)) |
2593 17e2 7040 sbci r23,hi8(-(PPM_in)) |
2594 17e4 FB01 movw r30,r22 |
2595 17e6 8081 ld r24,Z |
2596 17e8 9181 ldd r25,Z+1 |
2597 17ea 8A5B subi r24,lo8(-70) |
2598 17ec 9F4F sbci r25,hi8(-70) |
2599 17ee 04F4 brge .L500 |
2600 17f0 220F lsl r18 |
2601 17f2 331F rol r19 |
2602 17f4 2050 subi r18,lo8(-(PPM_in)) |
2603 17f6 3040 sbci r19,hi8(-(PPM_in)) |
2604 17f8 F901 movw r30,r18 |
2605 17fa 8081 ld r24,Z |
2606 17fc 9181 ldd r25,Z+1 |
2607 17fe 8634 cpi r24,70 |
2608 1800 9105 cpc r25,__zero_reg__ |
2609 1802 04F4 brge .L500 |
2610 1804 45E0 ldi r20,lo8(5) |
2611 .L500: |
2612 1806 A0E0 ldi r26,lo8(EEPromArray+2) |
2613 1808 B0E0 ldi r27,hi8(EEPromArray+2) |
2614 /* #APP */ |
2615 180a 042E mov __tmp_reg__,r20 |
2616 180c 0E94 0000 call __eeprom_write_byte_1F2021 |
2617 /* #NOAPP */ |
2618 .L486: |
2619 1810 0E94 0000 call GetActiveParamSetNumber |
2620 1814 4AE3 ldi r20,lo8(58) |
2621 1816 60E0 ldi r22,lo8(EE_Parameter) |
2622 1818 70E0 ldi r23,hi8(EE_Parameter) |
2623 181a 0E94 0000 call ReadParameterSet |
2624 181e 0E94 0000 call GetActiveParamSetNumber |
2625 1822 0E94 0000 call Piep |
2626 1826 8091 0000 lds r24,EE_Parameter+8 |
2627 182a 80FF sbrs r24,0 |
2628 182c 00C0 rjmp .L469 |
2629 182e 8091 0000 lds r24,MessLuftdruck |
2630 1832 9091 0000 lds r25,(MessLuftdruck)+1 |
2631 1836 875B subi r24,lo8(951) |
2632 1838 9340 sbci r25,hi8(951) |
2633 183a 00F4 brsh .L504 |
2634 183c 8091 0000 lds r24,MessLuftdruck |
2635 1840 9091 0000 lds r25,(MessLuftdruck)+1 |
2636 1844 8E5E subi r24,lo8(750) |
2637 1846 9240 sbci r25,hi8(750) |
2638 1848 00F0 brlo .+2 |
2639 184a 00C0 rjmp .L469 |
2640 .L504: |
2641 184c 0E94 0000 call SucheLuftruckOffset |
2642 1850 00C0 rjmp .L469 |
2643 .L481: |
2644 1852 1092 0000 sts delay_neutral.2447,__zero_reg__ |
2645 1856 00C0 rjmp .L469 |
2646 .L478: |
2647 1858 4981 ldd r20,Y+1 |
2648 185a 5A81 ldd r21,Y+2 |
2649 185c 4332 cpi r20,35 |
2650 185e 5105 cpc r21,__zero_reg__ |
2651 1860 04F0 brlt .+2 |
2652 1862 00C0 rjmp .L469 |
2653 1864 8091 0000 lds r24,EE_Parameter+3 |
2654 1868 482F mov r20,r24 |
2655 186a 5527 clr r21 |
2656 186c FA01 movw r30,r20 |
2657 186e EE0F lsl r30 |
2658 1870 FF1F rol r31 |
2659 1872 E050 subi r30,lo8(-(PPM_in)) |
2660 1874 F040 sbci r31,hi8(-(PPM_in)) |
2661 1876 8081 ld r24,Z |
2662 1878 9181 ldd r25,Z+1 |
2663 187a 855B subi r24,lo8(-75) |
2664 187c 9F4F sbci r25,hi8(-75) |
2665 187e 04F0 brlt .+2 |
2666 1880 00C0 rjmp .L507 |
2667 1882 8091 0000 lds r24,delay_einschalten.2448 |
2668 1886 8F5F subi r24,lo8(-(1)) |
2669 1888 8093 0000 sts delay_einschalten.2448,r24 |
2670 188c 893C cpi r24,lo8(-55) |
2671 188e 00F4 brsh .+2 |
2672 1890 00C0 rjmp .L509 |
2673 1892 88EC ldi r24,lo8(-56) |
2674 1894 8093 0000 sts delay_einschalten.2448,r24 |
2675 1898 81E0 ldi r24,lo8(1) |
2676 189a 90E0 ldi r25,hi8(1) |
2677 189c 9093 0000 sts (modell_fliegt.2450)+1,r25 |
2678 18a0 8093 0000 sts modell_fliegt.2450,r24 |
2679 18a4 81E0 ldi r24,lo8(1) |
2680 18a6 8093 0000 sts MotorenEin,r24 |
2681 18aa 1092 0000 sts sollGier.2441,__zero_reg__ |
2682 18ae 1092 0000 sts (sollGier.2441)+1,__zero_reg__ |
2683 18b2 1092 0000 sts (sollGier.2441)+2,__zero_reg__ |
2684 18b6 1092 0000 sts (sollGier.2441)+3,__zero_reg__ |
2685 18ba 1092 0000 sts Mess_Integral_Gier,__zero_reg__ |
2686 18be 1092 0000 sts (Mess_Integral_Gier)+1,__zero_reg__ |
2687 18c2 1092 0000 sts (Mess_Integral_Gier)+2,__zero_reg__ |
2688 18c6 1092 0000 sts (Mess_Integral_Gier)+3,__zero_reg__ |
2689 18ca 1092 0000 sts Mess_Integral_Gier2,__zero_reg__ |
2690 18ce 1092 0000 sts (Mess_Integral_Gier2)+1,__zero_reg__ |
2691 18d2 1092 0000 sts (Mess_Integral_Gier2)+2,__zero_reg__ |
2692 18d6 1092 0000 sts (Mess_Integral_Gier2)+3,__zero_reg__ |
2693 18da 1092 0000 sts Mess_IntegralNick,__zero_reg__ |
2694 18de 1092 0000 sts (Mess_IntegralNick)+1,__zero_reg__ |
2695 18e2 1092 0000 sts (Mess_IntegralNick)+2,__zero_reg__ |
2696 18e6 1092 0000 sts (Mess_IntegralNick)+3,__zero_reg__ |
2697 18ea 1092 0000 sts Mess_IntegralRoll,__zero_reg__ |
2698 18ee 1092 0000 sts (Mess_IntegralRoll)+1,__zero_reg__ |
2699 18f2 1092 0000 sts (Mess_IntegralRoll)+2,__zero_reg__ |
2700 18f6 1092 0000 sts (Mess_IntegralRoll)+3,__zero_reg__ |
2701 18fa 8091 0000 lds r24,IntegralNick |
2702 18fe 9091 0000 lds r25,(IntegralNick)+1 |
2703 1902 A091 0000 lds r26,(IntegralNick)+2 |
2704 1906 B091 0000 lds r27,(IntegralNick)+3 |
2705 190a 8093 0000 sts Mess_IntegralNick2,r24 |
2706 190e 9093 0000 sts (Mess_IntegralNick2)+1,r25 |
2707 1912 A093 0000 sts (Mess_IntegralNick2)+2,r26 |
2708 1916 B093 0000 sts (Mess_IntegralNick2)+3,r27 |
2709 191a 8091 0000 lds r24,IntegralRoll |
2710 191e 9091 0000 lds r25,(IntegralRoll)+1 |
2711 1922 A091 0000 lds r26,(IntegralRoll)+2 |
2712 1926 B091 0000 lds r27,(IntegralRoll)+3 |
2713 192a 8093 0000 sts Mess_IntegralRoll2,r24 |
2714 192e 9093 0000 sts (Mess_IntegralRoll2)+1,r25 |
2715 1932 A093 0000 sts (Mess_IntegralRoll2)+2,r26 |
2716 1936 B093 0000 sts (Mess_IntegralRoll2)+3,r27 |
2717 193a 1092 0000 sts SummeNick.2439,__zero_reg__ |
2718 193e 1092 0000 sts (SummeNick.2439)+1,__zero_reg__ |
2719 1942 1092 0000 sts (SummeNick.2439)+2,__zero_reg__ |
2720 1946 1092 0000 sts (SummeNick.2439)+3,__zero_reg__ |
2721 194a 1092 0000 sts SummeRoll.2440,__zero_reg__ |
2722 194e 1092 0000 sts (SummeRoll.2440)+1,__zero_reg__ |
2723 1952 1092 0000 sts (SummeRoll.2440)+2,__zero_reg__ |
2724 1956 1092 0000 sts (SummeRoll.2440)+3,__zero_reg__ |
2725 195a 00C0 rjmp .L509 |
2726 .L507: |
2727 195c 1092 0000 sts delay_einschalten.2448,__zero_reg__ |
2728 .L509: |
2729 1960 440F lsl r20 |
2730 1962 551F rol r21 |
2731 1964 4050 subi r20,lo8(-(PPM_in)) |
2732 1966 5040 sbci r21,hi8(-(PPM_in)) |
2733 1968 FA01 movw r30,r20 |
2734 196a 8081 ld r24,Z |
2735 196c 9181 ldd r25,Z+1 |
2736 196e 8C34 cpi r24,76 |
2737 1970 9105 cpc r25,__zero_reg__ |
2738 1972 04F0 brlt .L511 |
2739 1974 8091 0000 lds r24,delay_ausschalten.2449 |
2740 1978 8F5F subi r24,lo8(-(1)) |
2741 197a 8093 0000 sts delay_ausschalten.2449,r24 |
2742 197e 893C cpi r24,lo8(-55) |
2743 1980 00F0 brlo .L469 |
2744 1982 1092 0000 sts MotorenEin,__zero_reg__ |
2745 1986 88EC ldi r24,lo8(-56) |
2746 1988 8093 0000 sts delay_ausschalten.2449,r24 |
2747 198c 1092 0000 sts (modell_fliegt.2450)+1,__zero_reg__ |
2748 1990 1092 0000 sts modell_fliegt.2450,__zero_reg__ |
2749 1994 00C0 rjmp .L469 |
2750 .L511: |
2751 1996 1092 0000 sts delay_ausschalten.2449,__zero_reg__ |
2752 .L469: |
2753 199a 8091 0000 lds r24,NewPpmData |
2754 199e 8150 subi r24,lo8(-(-1)) |
2755 19a0 8093 0000 sts NewPpmData,r24 |
2756 19a4 8091 0000 lds r24,NewPpmData |
2757 19a8 8F3F cpi r24,lo8(-1) |
2758 19aa 01F0 breq .L514 |
2759 19ac 8091 0000 lds r24,Notlandung |
2760 19b0 8823 tst r24 |
2761 19b2 01F4 brne .+2 |
2762 19b4 00C0 rjmp .L516 |
2763 .L514: |
2764 19b6 0E94 0000 call ParameterZuordnung |
2765 19ba E091 0000 lds r30,EE_Parameter |
2766 19be FF27 clr r31 |
2767 19c0 EE0F lsl r30 |
2768 19c2 FF1F rol r31 |
2769 19c4 DF01 movw r26,r30 |
2770 19c6 A050 subi r26,lo8(-(PPM_in)) |
2771 19c8 B040 sbci r27,hi8(-(PPM_in)) |
2772 19ca 8D91 ld r24,X+ |
2773 19cc 9C91 ld r25,X |
2774 19ce 6091 0000 lds r22,EE_Parameter+15 |
2775 19d2 7727 clr r23 |
2776 19d4 E050 subi r30,lo8(-(PPM_diff)) |
2777 19d6 F040 sbci r31,hi8(-(PPM_diff)) |
2778 19d8 2081 ld r18,Z |
2779 19da 3181 ldd r19,Z+1 |
2780 19dc 4091 0000 lds r20,EE_Parameter+16 |
2781 19e0 5527 clr r21 |
2782 19e2 FC01 movw r30,r24 |
2783 19e4 E69F mul r30,r22 |
2784 19e6 C001 movw r24,r0 |
2785 19e8 E79F mul r30,r23 |
2786 19ea 900D add r25,r0 |
2787 19ec F69F mul r31,r22 |
2788 19ee 900D add r25,r0 |
2789 19f0 1124 clr r1 |
2790 19f2 F901 movw r30,r18 |
2791 19f4 E49F mul r30,r20 |
2792 19f6 9001 movw r18,r0 |
2793 19f8 E59F mul r30,r21 |
2794 19fa 300D add r19,r0 |
2795 19fc F49F mul r31,r20 |
2796 19fe 300D add r19,r0 |
2797 1a00 1124 clr r1 |
2798 1a02 820F add r24,r18 |
2799 1a04 931F adc r25,r19 |
2800 1a06 9093 0000 sts (StickNick)+1,r25 |
2801 1a0a 8093 0000 sts StickNick,r24 |
2802 1a0e E091 0000 lds r30,EE_Parameter+1 |
2803 1a12 FF27 clr r31 |
2804 1a14 EE0F lsl r30 |
2805 1a16 FF1F rol r31 |
2806 1a18 DF01 movw r26,r30 |
2807 1a1a A050 subi r26,lo8(-(PPM_in)) |
2808 1a1c B040 sbci r27,hi8(-(PPM_in)) |
2809 1a1e 8D91 ld r24,X+ |
2810 1a20 9C91 ld r25,X |
2811 1a22 E050 subi r30,lo8(-(PPM_diff)) |
2812 1a24 F040 sbci r31,hi8(-(PPM_diff)) |
2813 1a26 2081 ld r18,Z |
2814 1a28 3181 ldd r19,Z+1 |
2815 1a2a FC01 movw r30,r24 |
2816 1a2c E69F mul r30,r22 |
2817 1a2e C001 movw r24,r0 |
2818 1a30 E79F mul r30,r23 |
2819 1a32 900D add r25,r0 |
2820 1a34 F69F mul r31,r22 |
2821 1a36 900D add r25,r0 |
2822 1a38 1124 clr r1 |
2823 1a3a B901 movw r22,r18 |
2824 1a3c 649F mul r22,r20 |
2825 1a3e 9001 movw r18,r0 |
2826 1a40 659F mul r22,r21 |
2827 1a42 300D add r19,r0 |
2828 1a44 749F mul r23,r20 |
2829 1a46 300D add r19,r0 |
2830 1a48 1124 clr r1 |
2831 1a4a 820F add r24,r18 |
2832 1a4c 931F adc r25,r19 |
2833 1a4e 9093 0000 sts (StickRoll)+1,r25 |
2834 1a52 8093 0000 sts StickRoll,r24 |
2835 1a56 E091 0000 lds r30,EE_Parameter+3 |
2836 1a5a FF27 clr r31 |
2837 1a5c EE0F lsl r30 |
2838 1a5e FF1F rol r31 |
2839 1a60 E050 subi r30,lo8(-(PPM_in)) |
2840 1a62 F040 sbci r31,hi8(-(PPM_in)) |
2841 1a64 8081 ld r24,Z |
2842 1a66 9181 ldd r25,Z+1 |
2843 1a68 9095 com r25 |
2844 1a6a 8195 neg r24 |
2845 1a6c 9F4F sbci r25,lo8(-1) |
2846 1a6e 9093 0000 sts (StickGier)+1,r25 |
2847 1a72 8093 0000 sts StickGier,r24 |
2848 1a76 1091 0000 lds r17,Parameter_Gyro_P |
2849 1a7a 612F mov r22,r17 |
2850 1a7c 7727 clr r23 |
2851 1a7e 67FD sbrc r22,7 |
2852 1a80 7095 com r23 |
2853 1a82 872F mov r24,r23 |
2854 1a84 972F mov r25,r23 |
2855 1a86 0E94 0000 call __floatsisf |
2856 1a8a 17FF sbrs r17,7 |
2857 1a8c 00C0 rjmp .L517 |
2858 1a8e 20E0 ldi r18,lo8(0x43800000) |
2859 1a90 30E0 ldi r19,hi8(0x43800000) |
2860 1a92 40E8 ldi r20,hlo8(0x43800000) |
2861 1a94 53E4 ldi r21,hhi8(0x43800000) |
2862 1a96 0E94 0000 call __addsf3 |
2863 .L517: |
2864 1a9a 20E0 ldi r18,lo8(0x41200000) |
2865 1a9c 30E0 ldi r19,hi8(0x41200000) |
2866 1a9e 40E2 ldi r20,hlo8(0x41200000) |
2867 1aa0 51E4 ldi r21,hhi8(0x41200000) |
2868 1aa2 0E94 0000 call __addsf3 |
2869 1aa6 20E0 ldi r18,lo8(0x3b800000) |
2870 1aa8 30E0 ldi r19,hi8(0x3b800000) |
2871 1aaa 40E8 ldi r20,hlo8(0x3b800000) |
2872 1aac 5BE3 ldi r21,hhi8(0x3b800000) |
2873 1aae 0E94 0000 call __mulsf3 |
2874 1ab2 5B01 movw r10,r22 |
2875 1ab4 6C01 movw r12,r24 |
2876 1ab6 6093 0000 sts GyroFaktor,r22 |
2877 1aba 7093 0000 sts (GyroFaktor)+1,r23 |
2878 1abe 8093 0000 sts (GyroFaktor)+2,r24 |
2879 1ac2 9093 0000 sts (GyroFaktor)+3,r25 |
2880 1ac6 1091 0000 lds r17,Parameter_Gyro_I |
2881 1aca 612F mov r22,r17 |
2882 1acc 7727 clr r23 |
2883 1ace 67FD sbrc r22,7 |
2884 1ad0 7095 com r23 |
2885 1ad2 872F mov r24,r23 |
2886 1ad4 972F mov r25,r23 |
2887 1ad6 0E94 0000 call __floatsisf |
2888 1ada 17FF sbrs r17,7 |
2889 1adc 00C0 rjmp .L518 |
2890 1ade 20E0 ldi r18,lo8(0x43800000) |
2891 1ae0 30E0 ldi r19,hi8(0x43800000) |
2892 1ae2 40E8 ldi r20,hlo8(0x43800000) |
2893 1ae4 53E4 ldi r21,hhi8(0x43800000) |
2894 1ae6 0E94 0000 call __addsf3 |
2895 .L518: |
2896 1aea 20E0 ldi r18,lo8(0x472be000) |
2897 1aec 30EE ldi r19,hi8(0x472be000) |
2898 1aee 4BE2 ldi r20,hlo8(0x472be000) |
2899 1af0 57E4 ldi r21,hhi8(0x472be000) |
2900 1af2 0E94 0000 call __divsf3 |
2901 1af6 6093 0000 sts IntegralFaktor,r22 |
2902 1afa 7093 0000 sts (IntegralFaktor)+1,r23 |
2903 1afe 8093 0000 sts (IntegralFaktor)+2,r24 |
2904 1b02 9093 0000 sts (IntegralFaktor)+3,r25 |
2905 1b06 8091 0000 lds r24,EE_Parameter+8 |
2906 1b0a 82FF sbrs r24,2 |
2907 1b0c 00C0 rjmp .L519 |
2908 1b0e 80E0 ldi r24,lo8(0x0) |
2909 1b10 90E0 ldi r25,hi8(0x0) |
2910 1b12 A0E0 ldi r26,hlo8(0x0) |
2911 1b14 B0E0 ldi r27,hhi8(0x0) |
2912 1b16 8093 0000 sts IntegralFaktor,r24 |
2913 1b1a 9093 0000 sts (IntegralFaktor)+1,r25 |
2914 1b1e A093 0000 sts (IntegralFaktor)+2,r26 |
2915 1b22 B093 0000 sts (IntegralFaktor)+3,r27 |
2916 .L519: |
2917 1b26 20E0 ldi r18,lo8(0x0) |
2918 1b28 30E0 ldi r19,hi8(0x0) |
2919 1b2a 40E0 ldi r20,hlo8(0x0) |
2920 1b2c 50E0 ldi r21,hhi8(0x0) |
2921 1b2e C601 movw r24,r12 |
2922 1b30 B501 movw r22,r10 |
2923 1b32 0E94 0000 call __ltsf2 |
2924 1b36 8823 tst r24 |
2925 1b38 04F4 brge .L521 |
2926 1b3a 80E0 ldi r24,lo8(0x0) |
2927 1b3c 90E0 ldi r25,hi8(0x0) |
2928 1b3e A0E0 ldi r26,hlo8(0x0) |
2929 1b40 B0E0 ldi r27,hhi8(0x0) |
2930 1b42 8093 0000 sts GyroFaktor,r24 |
2931 1b46 9093 0000 sts (GyroFaktor)+1,r25 |
2932 1b4a A093 0000 sts (GyroFaktor)+2,r26 |
2933 1b4e B093 0000 sts (GyroFaktor)+3,r27 |
2934 .L521: |
2935 1b52 20E0 ldi r18,lo8(0x0) |
2936 1b54 30E0 ldi r19,hi8(0x0) |
2937 1b56 40E0 ldi r20,hlo8(0x0) |
2938 1b58 50E0 ldi r21,hhi8(0x0) |
2939 1b5a 6091 0000 lds r22,IntegralFaktor |
2940 1b5e 7091 0000 lds r23,(IntegralFaktor)+1 |
2941 1b62 8091 0000 lds r24,(IntegralFaktor)+2 |
2942 1b66 9091 0000 lds r25,(IntegralFaktor)+3 |
2943 1b6a 0E94 0000 call __ltsf2 |
2944 1b6e 8823 tst r24 |
2945 1b70 04F4 brge .L524 |
2946 1b72 80E0 ldi r24,lo8(0x0) |
2947 1b74 90E0 ldi r25,hi8(0x0) |
2948 1b76 A0E0 ldi r26,hlo8(0x0) |
2949 1b78 B0E0 ldi r27,hhi8(0x0) |
2950 1b7a 8093 0000 sts IntegralFaktor,r24 |
2951 1b7e 9093 0000 sts (IntegralFaktor)+1,r25 |
2952 1b82 A093 0000 sts (IntegralFaktor)+2,r26 |
2953 1b86 B093 0000 sts (IntegralFaktor)+3,r27 |
2954 .L524: |
2955 1b8a 4298 cbi 40-0x20,2 |
2956 1b8c 9091 0000 lds r25,Parameter_UserParam4 |
2957 1b90 8091 0000 lds r24,blinkcount_LED1 |
2958 1b94 8917 cp r24,r25 |
2959 1b96 00F0 brlo .L527 |
2960 1b98 9923 tst r25 |
2961 1b9a 01F0 breq .L527 |
2962 1b9c 88B1 in r24,40-0x20 |
2963 1b9e 94E0 ldi r25,lo8(4) |
2964 1ba0 8927 eor r24,r25 |
2965 1ba2 88B9 out 40-0x20,r24 |
2966 1ba4 1092 0000 sts blinkcount_LED1,__zero_reg__ |
2967 .L527: |
2968 1ba8 8091 0000 lds r24,blinkcount_LED1 |
2969 1bac 8F5F subi r24,lo8(-(1)) |
2970 1bae 8093 0000 sts blinkcount_LED1,r24 |
2971 1bb2 8091 0000 lds r24,Notlandung |
2972 1bb6 8823 tst r24 |
2973 1bb8 01F0 breq .L516 |
2974 1bba 1092 0000 sts (StickGier)+1,__zero_reg__ |
2975 1bbe 1092 0000 sts StickGier,__zero_reg__ |
2976 1bc2 1092 0000 sts (StickNick)+1,__zero_reg__ |
2977 1bc6 1092 0000 sts StickNick,__zero_reg__ |
2978 1bca 1092 0000 sts (StickRoll)+1,__zero_reg__ |
2979 1bce 1092 0000 sts StickRoll,__zero_reg__ |
2980 1bd2 8DEC ldi r24,lo8(0x3dcccccd) |
2981 1bd4 9CEC ldi r25,hi8(0x3dcccccd) |
2982 1bd6 ACEC ldi r26,hlo8(0x3dcccccd) |
2983 1bd8 BDE3 ldi r27,hhi8(0x3dcccccd) |
2984 1bda 8093 0000 sts GyroFaktor,r24 |
2985 1bde 9093 0000 sts (GyroFaktor)+1,r25 |
2986 1be2 A093 0000 sts (GyroFaktor)+2,r26 |
2987 1be6 B093 0000 sts (GyroFaktor)+3,r27 |
2988 1bea 8AE0 ldi r24,lo8(0x3ba3d70a) |
2989 1bec 97ED ldi r25,hi8(0x3ba3d70a) |
2990 1bee A3EA ldi r26,hlo8(0x3ba3d70a) |
2991 1bf0 BBE3 ldi r27,hhi8(0x3ba3d70a) |
2992 1bf2 8093 0000 sts IntegralFaktor,r24 |
2993 1bf6 9093 0000 sts (IntegralFaktor)+1,r25 |
2994 1bfa A093 0000 sts (IntegralFaktor)+2,r26 |
2995 1bfe B093 0000 sts (IntegralFaktor)+3,r27 |
2996 .L516: |
2997 1c02 8091 0000 lds r24,ZaehlMessungen |
2998 1c06 9091 0000 lds r25,(ZaehlMessungen)+1 |
2999 1c0a 8D54 subi r24,lo8(333) |
3000 1c0c 9140 sbci r25,hi8(333) |
3001 1c0e 00F4 brsh .+2 |
3002 1c10 00C0 rjmp .L531 |
3003 1c12 2091 0000 lds r18,IntegralNick2 |
3004 1c16 3091 0000 lds r19,(IntegralNick2)+1 |
3005 1c1a 4091 0000 lds r20,(IntegralNick2)+2 |
3006 1c1e 5091 0000 lds r21,(IntegralNick2)+3 |
3007 1c22 8091 0000 lds r24,IntegralNick |
3008 1c26 9091 0000 lds r25,(IntegralNick)+1 |
3009 1c2a A091 0000 lds r26,(IntegralNick)+2 |
3010 1c2e B091 0000 lds r27,(IntegralNick)+3 |
3011 1c32 B901 movw r22,r18 |
3012 1c34 681B sub r22,r24 |
3013 1c36 790B sbc r23,r25 |
3014 1c38 7093 0000 sts (IntegralFehlerNick.2444)+1,r23 |
3015 1c3c 6093 0000 sts IntegralFehlerNick.2444,r22 |
3016 1c40 2091 0000 lds r18,IntegralRoll2 |
3017 1c44 3091 0000 lds r19,(IntegralRoll2)+1 |
3018 1c48 4091 0000 lds r20,(IntegralRoll2)+2 |
3019 1c4c 5091 0000 lds r21,(IntegralRoll2)+3 |
3020 1c50 8091 0000 lds r24,IntegralRoll |
3021 1c54 9091 0000 lds r25,(IntegralRoll)+1 |
3022 1c58 A091 0000 lds r26,(IntegralRoll)+2 |
3023 1c5c B091 0000 lds r27,(IntegralRoll)+3 |
3024 1c60 281B sub r18,r24 |
3025 1c62 390B sbc r19,r25 |
3026 1c64 3093 0000 sts (IntegralFehlerRoll.2445)+1,r19 |
3027 1c68 2093 0000 sts IntegralFehlerRoll.2445,r18 |
3028 1c6c 1092 0000 sts (ZaehlMessungen)+1,__zero_reg__ |
3029 1c70 1092 0000 sts ZaehlMessungen,__zero_reg__ |
3030 1c74 673A cpi r22,167 |
3031 1c76 7105 cpc r23,__zero_reg__ |
3032 1c78 04F0 brlt .L533 |
3033 1c7a 8091 0000 lds r24,AdNeutralNick |
3034 1c7e 9091 0000 lds r25,(AdNeutralNick)+1 |
3035 1c82 0196 adiw r24,1 |
3036 1c84 00C0 rjmp .L660 |
3037 .L533: |
3038 1c86 6A55 subi r22,lo8(-166) |
3039 1c88 7F4F sbci r23,hi8(-166) |
3040 1c8a 04F4 brge .L535 |
3041 1c8c 8091 0000 lds r24,AdNeutralNick |
3042 1c90 9091 0000 lds r25,(AdNeutralNick)+1 |
3043 1c94 0197 sbiw r24,1 |
3044 .L660: |
3045 1c96 9093 0000 sts (AdNeutralNick)+1,r25 |
3046 1c9a 8093 0000 sts AdNeutralNick,r24 |
3047 .L535: |
3048 1c9e 273A cpi r18,167 |
3049 1ca0 3105 cpc r19,__zero_reg__ |
3050 1ca2 04F0 brlt .L537 |
3051 1ca4 8091 0000 lds r24,AdNeutralRoll |
3052 1ca8 9091 0000 lds r25,(AdNeutralRoll)+1 |
3053 1cac 0196 adiw r24,1 |
3054 1cae 00C0 rjmp .L661 |
3055 .L537: |
3056 1cb0 2A55 subi r18,lo8(-166) |
3057 1cb2 3F4F sbci r19,hi8(-166) |
3058 1cb4 04F4 brge .L539 |
3059 1cb6 8091 0000 lds r24,AdNeutralRoll |
3060 1cba 9091 0000 lds r25,(AdNeutralRoll)+1 |
3061 1cbe 0197 sbiw r24,1 |
3062 .L661: |
3063 1cc0 9093 0000 sts (AdNeutralRoll)+1,r25 |
3064 1cc4 8093 0000 sts AdNeutralRoll,r24 |
3065 .L539: |
3066 1cc8 8091 0000 lds r24,Mess_Integral_Gier2 |
3067 1ccc 9091 0000 lds r25,(Mess_Integral_Gier2)+1 |
3068 1cd0 A091 0000 lds r26,(Mess_Integral_Gier2)+2 |
3069 1cd4 B091 0000 lds r27,(Mess_Integral_Gier2)+3 |
3070 1cd8 873A cpi r24,lo8(167) |
3071 1cda 9105 cpc r25,__zero_reg__ |
3072 1cdc A105 cpc r26,__zero_reg__ |
3073 1cde B105 cpc r27,__zero_reg__ |
3074 1ce0 04F0 brlt .L541 |
3075 1ce2 8091 0000 lds r24,AdNeutralGier |
3076 1ce6 9091 0000 lds r25,(AdNeutralGier)+1 |
3077 1cea 0197 sbiw r24,1 |
3078 1cec 9093 0000 sts (AdNeutralGier)+1,r25 |
3079 1cf0 8093 0000 sts AdNeutralGier,r24 |
3080 .L541: |
3081 1cf4 8091 0000 lds r24,Mess_Integral_Gier2 |
3082 1cf8 9091 0000 lds r25,(Mess_Integral_Gier2)+1 |
3083 1cfc A091 0000 lds r26,(Mess_Integral_Gier2)+2 |
3084 1d00 B091 0000 lds r27,(Mess_Integral_Gier2)+3 |
3085 1d04 8A55 subi r24,lo8(-166) |
3086 1d06 9F4F sbci r25,hi8(-166) |
3087 1d08 AF4F sbci r26,hlo8(-166) |
3088 1d0a BF4F sbci r27,hhi8(-166) |
3089 1d0c 04F4 brge .L543 |
3090 1d0e 8091 0000 lds r24,AdNeutralGier |
3091 1d12 9091 0000 lds r25,(AdNeutralGier)+1 |
3092 1d16 0196 adiw r24,1 |
3093 1d18 9093 0000 sts (AdNeutralGier)+1,r25 |
3094 1d1c 8093 0000 sts AdNeutralGier,r24 |
3095 .L543: |
3096 1d20 1092 7A00 sts 122,__zero_reg__ |
3097 1d24 8091 0000 lds r24,IntegralNick |
3098 1d28 9091 0000 lds r25,(IntegralNick)+1 |
3099 1d2c A091 0000 lds r26,(IntegralNick)+2 |
3100 1d30 B091 0000 lds r27,(IntegralNick)+3 |
3101 1d34 8093 0000 sts Mess_IntegralNick2,r24 |
3102 1d38 9093 0000 sts (Mess_IntegralNick2)+1,r25 |
3103 1d3c A093 0000 sts (Mess_IntegralNick2)+2,r26 |
3104 1d40 B093 0000 sts (Mess_IntegralNick2)+3,r27 |
3105 1d44 8091 0000 lds r24,IntegralRoll |
3106 1d48 9091 0000 lds r25,(IntegralRoll)+1 |
3107 1d4c A091 0000 lds r26,(IntegralRoll)+2 |
3108 1d50 B091 0000 lds r27,(IntegralRoll)+3 |
3109 1d54 8093 0000 sts Mess_IntegralRoll2,r24 |
3110 1d58 9093 0000 sts (Mess_IntegralRoll2)+1,r25 |
3111 1d5c A093 0000 sts (Mess_IntegralRoll2)+2,r26 |
3112 1d60 B093 0000 sts (Mess_IntegralRoll2)+3,r27 |
3113 1d64 8091 0000 lds r24,Integral_Gier |
3114 1d68 9091 0000 lds r25,(Integral_Gier)+1 |
3115 1d6c A091 0000 lds r26,(Integral_Gier)+2 |
3116 1d70 B091 0000 lds r27,(Integral_Gier)+3 |
3117 1d74 8093 0000 sts Mess_Integral_Gier2,r24 |
3118 1d78 9093 0000 sts (Mess_Integral_Gier2)+1,r25 |
3119 1d7c A093 0000 sts (Mess_Integral_Gier2)+2,r26 |
3120 1d80 B093 0000 sts (Mess_Integral_Gier2)+3,r27 |
3121 1d84 8FEE ldi r24,lo8(-17) |
3122 1d86 8093 7A00 sts 122,r24 |
3123 .L531: |
3124 1d8a 6091 0000 lds r22,IntegralNick |
3125 1d8e 7091 0000 lds r23,(IntegralNick)+1 |
3126 1d92 8091 0000 lds r24,(IntegralNick)+2 |
3127 1d96 9091 0000 lds r25,(IntegralNick)+3 |
3128 1d9a A090 0000 lds r10,EE_Parameter+20 |
3129 1d9e BB24 clr r11 |
3130 1da0 CC24 clr r12 |
3131 1da2 DD24 clr r13 |
3132 1da4 E090 0000 lds r14,Mittelwert_AccNick |
3133 1da8 F090 0000 lds r15,(Mittelwert_AccNick)+1 |
3134 1dac A601 movw r20,r12 |
3135 1dae 9501 movw r18,r10 |
3136 1db0 0E94 0000 call __divmodsi4 |
3137 1db4 0027 clr r16 |
3138 1db6 F7FC sbrc r15,7 |
3139 1db8 0095 com r16 |
3140 1dba 102F mov r17,r16 |
3141 1dbc 2E19 sub r18,r14 |
3142 1dbe 3F09 sbc r19,r15 |
3143 1dc0 400B sbc r20,r16 |
3144 1dc2 510B sbc r21,r17 |
3145 1dc4 CA01 movw r24,r20 |
3146 1dc6 B901 movw r22,r18 |
3147 1dc8 20E1 ldi r18,lo8(16) |
3148 1dca 30E0 ldi r19,hi8(16) |
3149 1dcc 40E0 ldi r20,hlo8(16) |
3150 1dce 50E0 ldi r21,hhi8(16) |
3151 1dd0 0E94 0000 call __divmodsi4 |
3152 1dd4 3901 movw r6,r18 |
3153 1dd6 4A01 movw r8,r20 |
3154 1dd8 2093 0000 sts tmp_long.2442,r18 |
3155 1ddc 3093 0000 sts (tmp_long.2442)+1,r19 |
3156 1de0 4093 0000 sts (tmp_long.2442)+2,r20 |
3157 1de4 5093 0000 sts (tmp_long.2442)+3,r21 |
3158 1de8 6091 0000 lds r22,IntegralRoll |
3159 1dec 7091 0000 lds r23,(IntegralRoll)+1 |
3160 1df0 8091 0000 lds r24,(IntegralRoll)+2 |
3161 1df4 9091 0000 lds r25,(IntegralRoll)+3 |
3162 1df8 E090 0000 lds r14,Mittelwert_AccRoll |
3163 1dfc F090 0000 lds r15,(Mittelwert_AccRoll)+1 |
3164 1e00 A601 movw r20,r12 |
3165 1e02 9501 movw r18,r10 |
3166 1e04 0E94 0000 call __divmodsi4 |
3167 1e08 0027 clr r16 |
3168 1e0a F7FC sbrc r15,7 |
3169 1e0c 0095 com r16 |
3170 1e0e 102F mov r17,r16 |
3171 1e10 2E19 sub r18,r14 |
3172 1e12 3F09 sbc r19,r15 |
3173 1e14 400B sbc r20,r16 |
3174 1e16 510B sbc r21,r17 |
3175 1e18 CA01 movw r24,r20 |
3176 1e1a B901 movw r22,r18 |
3177 1e1c 20E1 ldi r18,lo8(16) |
3178 1e1e 30E0 ldi r19,hi8(16) |
3179 1e20 40E0 ldi r20,hlo8(16) |
3180 1e22 50E0 ldi r21,hhi8(16) |
3181 1e24 0E94 0000 call __divmodsi4 |
3182 1e28 2093 0000 sts tmp_long2.2443,r18 |
3183 1e2c 3093 0000 sts (tmp_long2.2443)+1,r19 |
3184 1e30 4093 0000 sts (tmp_long2.2443)+2,r20 |
3185 1e34 5093 0000 sts (tmp_long2.2443)+3,r21 |
3186 1e38 F5EF ldi r31,lo8(501) |
3187 1e3a 6F16 cp r6,r31 |
3188 1e3c F1E0 ldi r31,hi8(501) |
3189 1e3e 7F06 cpc r7,r31 |
3190 1e40 F0E0 ldi r31,hlo8(501) |
3191 1e42 8F06 cpc r8,r31 |
3192 1e44 F0E0 ldi r31,hhi8(501) |
3193 1e46 9F06 cpc r9,r31 |
3194 1e48 04F0 brlt .L545 |
3195 1e4a 84EF ldi r24,lo8(500) |
3196 1e4c 91E0 ldi r25,hi8(500) |
3197 1e4e A0E0 ldi r26,hlo8(500) |
3198 1e50 B0E0 ldi r27,hhi8(500) |
3199 1e52 00C0 rjmp .L662 |
3200 .L545: |
3201 1e54 6CE0 ldi r22,lo8(-500) |
3202 1e56 6616 cp r6,r22 |
3203 1e58 6EEF ldi r22,hi8(-500) |
3204 1e5a 7606 cpc r7,r22 |
3205 1e5c 6FEF ldi r22,hlo8(-500) |
3206 1e5e 8606 cpc r8,r22 |
3207 1e60 6FEF ldi r22,hhi8(-500) |
3208 1e62 9606 cpc r9,r22 |
3209 1e64 04F4 brge .L547 |
3210 1e66 8CE0 ldi r24,lo8(-500) |
3211 1e68 9EEF ldi r25,hi8(-500) |
3212 1e6a AFEF ldi r26,hlo8(-500) |
3213 1e6c BFEF ldi r27,hhi8(-500) |
3214 .L662: |
3215 1e6e 8093 0000 sts tmp_long.2442,r24 |
3216 1e72 9093 0000 sts (tmp_long.2442)+1,r25 |
3217 1e76 A093 0000 sts (tmp_long.2442)+2,r26 |
3218 1e7a B093 0000 sts (tmp_long.2442)+3,r27 |
3219 .L547: |
3220 1e7e 253F cpi r18,lo8(501) |
3221 1e80 71E0 ldi r23,hi8(501) |
3222 1e82 3707 cpc r19,r23 |
3223 1e84 70E0 ldi r23,hlo8(501) |
3224 1e86 4707 cpc r20,r23 |
3225 1e88 70E0 ldi r23,hhi8(501) |
3226 1e8a 5707 cpc r21,r23 |
3227 1e8c 04F0 brlt .L549 |
3228 1e8e 84EF ldi r24,lo8(500) |
3229 1e90 91E0 ldi r25,hi8(500) |
3230 1e92 A0E0 ldi r26,hlo8(500) |
3231 1e94 B0E0 ldi r27,hhi8(500) |
3232 1e96 00C0 rjmp .L663 |
3233 .L549: |
3234 1e98 2C50 subi r18,lo8(-500) |
3235 1e9a 3E4F sbci r19,hi8(-500) |
3236 1e9c 4F4F sbci r20,hlo8(-500) |
3237 1e9e 5F4F sbci r21,hhi8(-500) |
3238 1ea0 04F4 brge .L551 |
3239 1ea2 8CE0 ldi r24,lo8(-500) |
3240 1ea4 9EEF ldi r25,hi8(-500) |
3241 1ea6 AFEF ldi r26,hlo8(-500) |
3242 1ea8 BFEF ldi r27,hhi8(-500) |
3243 .L663: |
3244 1eaa 8093 0000 sts tmp_long2.2443,r24 |
3245 1eae 9093 0000 sts (tmp_long2.2443)+1,r25 |
3246 1eb2 A093 0000 sts (tmp_long2.2443)+2,r26 |
3247 1eb6 B093 0000 sts (tmp_long2.2443)+3,r27 |
3248 .L551: |
3249 1eba 1092 7A00 sts 122,__zero_reg__ |
3250 1ebe 8091 0000 lds r24,Mess_IntegralNick |
3251 1ec2 9091 0000 lds r25,(Mess_IntegralNick)+1 |
3252 1ec6 A091 0000 lds r26,(Mess_IntegralNick)+2 |
3253 1eca B091 0000 lds r27,(Mess_IntegralNick)+3 |
3254 1ece 2091 0000 lds r18,tmp_long.2442 |
3255 1ed2 3091 0000 lds r19,(tmp_long.2442)+1 |
3256 1ed6 4091 0000 lds r20,(tmp_long.2442)+2 |
3257 1eda 5091 0000 lds r21,(tmp_long.2442)+3 |
3258 1ede 821B sub r24,r18 |
3259 1ee0 930B sbc r25,r19 |
3260 1ee2 A40B sbc r26,r20 |
3261 1ee4 B50B sbc r27,r21 |
3262 1ee6 8093 0000 sts Mess_IntegralNick,r24 |
3263 1eea 9093 0000 sts (Mess_IntegralNick)+1,r25 |
3264 1eee A093 0000 sts (Mess_IntegralNick)+2,r26 |
3265 1ef2 B093 0000 sts (Mess_IntegralNick)+3,r27 |
3266 1ef6 8091 0000 lds r24,Mess_IntegralRoll |
3267 1efa 9091 0000 lds r25,(Mess_IntegralRoll)+1 |
3268 1efe A091 0000 lds r26,(Mess_IntegralRoll)+2 |
3269 1f02 B091 0000 lds r27,(Mess_IntegralRoll)+3 |
3270 1f06 2091 0000 lds r18,tmp_long2.2443 |
3271 1f0a 3091 0000 lds r19,(tmp_long2.2443)+1 |
3272 1f0e 4091 0000 lds r20,(tmp_long2.2443)+2 |
3273 1f12 5091 0000 lds r21,(tmp_long2.2443)+3 |
3274 1f16 821B sub r24,r18 |
3275 1f18 930B sbc r25,r19 |
3276 1f1a A40B sbc r26,r20 |
3277 1f1c B50B sbc r27,r21 |
3278 1f1e 8093 0000 sts Mess_IntegralRoll,r24 |
3279 1f22 9093 0000 sts (Mess_IntegralRoll)+1,r25 |
3280 1f26 A093 0000 sts (Mess_IntegralRoll)+2,r26 |
3281 1f2a B093 0000 sts (Mess_IntegralRoll)+3,r27 |
3282 1f2e 8091 0000 lds r24,StickGier |
3283 1f32 9091 0000 lds r25,(StickGier)+1 |
3284 1f36 5C01 movw r10,r24 |
3285 1f38 CC24 clr r12 |
3286 1f3a B7FC sbrc r11,7 |
3287 1f3c C094 com r12 |
3288 1f3e DC2C mov r13,r12 |
3289 1f40 A092 0000 sts sollGier.2441,r10 |
3290 1f44 B092 0000 sts (sollGier.2441)+1,r11 |
3291 1f48 C092 0000 sts (sollGier.2441)+2,r12 |
3292 1f4c D092 0000 sts (sollGier.2441)+3,r13 |
3293 1f50 97FF sbrs r25,7 |
3294 1f52 00C0 rjmp .L554 |
3295 1f54 9095 com r25 |
3296 1f56 8195 neg r24 |
3297 1f58 9F4F sbci r25,lo8(-1) |
3298 .L554: |
3299 1f5a 8497 sbiw r24,36 |
3300 1f5c 04F0 brlt .L553 |
3301 1f5e 8091 0000 lds r24,EE_Parameter+8 |
3302 1f62 84FD sbrc r24,4 |
3303 1f64 00C0 rjmp .L553 |
3304 1f66 81E0 ldi r24,lo8(1) |
3305 1f68 8093 0000 sts NeueKompassRichtungMerken.2453,r24 |
3306 .L553: |
3307 1f6c 6090 0000 lds r6,Mess_Integral_Gier |
3308 1f70 7090 0000 lds r7,(Mess_Integral_Gier)+1 |
3309 1f74 8090 0000 lds r8,(Mess_Integral_Gier)+2 |
3310 1f78 9090 0000 lds r9,(Mess_Integral_Gier)+3 |
3311 1f7c C501 movw r24,r10 |
3312 1f7e B7FE sbrs r11,7 |
3313 1f80 00C0 rjmp .L557 |
3314 1f82 9095 com r25 |
3315 1f84 8195 neg r24 |
3316 1f86 9F4F sbci r25,lo8(-1) |
3317 .L557: |
3318 1f88 7C01 movw r14,r24 |
3319 1f8a 0027 clr r16 |
3320 1f8c F7FC sbrc r15,7 |
3321 1f8e 0095 com r16 |
3322 1f90 102F mov r17,r16 |
3323 1f92 2091 0000 lds r18,EE_Parameter+17 |
3324 1f96 3327 clr r19 |
3325 1f98 4427 clr r20 |
3326 1f9a 5527 clr r21 |
3327 1f9c C601 movw r24,r12 |
3328 1f9e B501 movw r22,r10 |
3329 1fa0 0E94 0000 call __mulsi3 |
3330 1fa4 9B01 movw r18,r22 |
3331 1fa6 AC01 movw r20,r24 |
3332 1fa8 C801 movw r24,r16 |
3333 1faa B701 movw r22,r14 |
3334 1fac 0E94 0000 call __mulsi3 |
3335 1fb0 20E0 ldi r18,lo8(256) |
3336 1fb2 31E0 ldi r19,hi8(256) |
3337 1fb4 40E0 ldi r20,hlo8(256) |
3338 1fb6 50E0 ldi r21,hhi8(256) |
3339 1fb8 0E94 0000 call __divmodsi4 |
3340 1fbc 4427 clr r20 |
3341 1fbe 37FD sbrc r19,7 |
3342 1fc0 4095 com r20 |
3343 1fc2 542F mov r21,r20 |
3344 1fc4 621A sub r6,r18 |
3345 1fc6 730A sbc r7,r19 |
3346 1fc8 840A sbc r8,r20 |
3347 1fca 950A sbc r9,r21 |
3348 1fcc 6092 0000 sts Mess_Integral_Gier,r6 |
3349 1fd0 7092 0000 sts (Mess_Integral_Gier)+1,r7 |
3350 1fd4 8092 0000 sts (Mess_Integral_Gier)+2,r8 |
3351 1fd8 9092 0000 sts (Mess_Integral_Gier)+3,r9 |
3352 1fdc 8091 0000 lds r24,Mess_Integral_Gier |
3353 1fe0 9091 0000 lds r25,(Mess_Integral_Gier)+1 |
3354 1fe4 A091 0000 lds r26,(Mess_Integral_Gier)+2 |
3355 1fe8 B091 0000 lds r27,(Mess_Integral_Gier)+3 |
3356 1fec 8153 subi r24,lo8(30001) |
3357 1fee 9547 sbci r25,hi8(30001) |
3358 1ff0 A040 sbci r26,hlo8(30001) |
3359 1ff2 B040 sbci r27,hhi8(30001) |
3360 1ff4 04F0 brlt .L558 |
3361 1ff6 80E3 ldi r24,lo8(30000) |
3362 1ff8 95E7 ldi r25,hi8(30000) |
3363 1ffa A0E0 ldi r26,hlo8(30000) |
3364 1ffc B0E0 ldi r27,hhi8(30000) |
3365 1ffe 8093 0000 sts Mess_Integral_Gier,r24 |
3366 2002 9093 0000 sts (Mess_Integral_Gier)+1,r25 |
3367 2006 A093 0000 sts (Mess_Integral_Gier)+2,r26 |
3368 200a B093 0000 sts (Mess_Integral_Gier)+3,r27 |
3369 .L558: |
3370 200e 8091 0000 lds r24,Mess_Integral_Gier |
3371 2012 9091 0000 lds r25,(Mess_Integral_Gier)+1 |
3372 2016 A091 0000 lds r26,(Mess_Integral_Gier)+2 |
3373 201a B091 0000 lds r27,(Mess_Integral_Gier)+3 |
3374 201e 805D subi r24,lo8(-30000) |
3375 2020 9A48 sbci r25,hi8(-30000) |
3376 2022 AF4F sbci r26,hlo8(-30000) |
3377 2024 BF4F sbci r27,hhi8(-30000) |
3378 2026 04F4 brge .L560 |
3379 2028 80ED ldi r24,lo8(-30000) |
3380 202a 9AE8 ldi r25,hi8(-30000) |
3381 202c AFEF ldi r26,hlo8(-30000) |
3382 202e BFEF ldi r27,hhi8(-30000) |
3383 2030 8093 0000 sts Mess_Integral_Gier,r24 |
3384 2034 9093 0000 sts (Mess_Integral_Gier)+1,r25 |
3385 2038 A093 0000 sts (Mess_Integral_Gier)+2,r26 |
3386 203c B093 0000 sts (Mess_Integral_Gier)+3,r27 |
3387 .L560: |
3388 2040 8FEE ldi r24,lo8(-17) |
3389 2042 8093 7A00 sts 122,r24 |
3390 2046 8091 0000 lds r24,KompassValue |
3391 204a 9091 0000 lds r25,(KompassValue)+1 |
3392 204e 892B or r24,r25 |
3393 2050 01F4 brne .+2 |
3394 2052 00C0 rjmp .L562 |
3395 2054 8091 0000 lds r24,EE_Parameter+8 |
3396 2058 83FF sbrs r24,3 |
3397 205a 00C0 rjmp .L562 |
3398 205c 6091 0000 lds r22,IntegralNick |
3399 2060 7091 0000 lds r23,(IntegralNick)+1 |
3400 2064 8091 0000 lds r24,(IntegralNick)+2 |
3401 2068 9091 0000 lds r25,(IntegralNick)+3 |
3402 206c 20E0 ldi r18,lo8(512) |
3403 206e 32E0 ldi r19,hi8(512) |
3404 2070 40E0 ldi r20,hlo8(512) |
3405 2072 50E0 ldi r21,hhi8(512) |
3406 2074 0E94 0000 call __divmodsi4 |
3407 2078 8901 movw r16,r18 |
3408 207a 37FF sbrs r19,7 |
3409 207c 00C0 rjmp .L565 |
3410 207e 1095 com r17 |
3411 2080 0195 neg r16 |
3412 2082 1F4F sbci r17,lo8(-1) |
3413 .L565: |
3414 2084 6091 0000 lds r22,IntegralRoll |
3415 2088 7091 0000 lds r23,(IntegralRoll)+1 |
3416 208c 8091 0000 lds r24,(IntegralRoll)+2 |
3417 2090 9091 0000 lds r25,(IntegralRoll)+3 |
3418 2094 20E0 ldi r18,lo8(512) |
3419 2096 32E0 ldi r19,hi8(512) |
3420 2098 40E0 ldi r20,hlo8(512) |
3421 209a 50E0 ldi r21,hhi8(512) |
3422 209c 0E94 0000 call __divmodsi4 |
3423 20a0 B901 movw r22,r18 |
3424 20a2 37FF sbrs r19,7 |
3425 20a4 00C0 rjmp .L566 |
3426 20a6 7095 com r23 |
3427 20a8 6195 neg r22 |
3428 20aa 7F4F sbci r23,lo8(-1) |
3429 .L566: |
3430 20ac 6017 cp r22,r16 |
3431 20ae 7107 cpc r23,r17 |
3432 20b0 04F4 brge .L567 |
3433 20b2 B801 movw r22,r16 |
3434 .L567: |
3435 20b4 6931 cpi r22,25 |
3436 20b6 7105 cpc r23,__zero_reg__ |
3437 20b8 04F4 brge .L568 |
3438 20ba 8091 0000 lds r24,NeueKompassRichtungMerken.2453 |
3439 20be 8823 tst r24 |
3440 20c0 01F0 breq .L568 |
3441 20c2 8091 0000 lds r24,SignalSchlecht.2457 |
3442 20c6 9091 0000 lds r25,(SignalSchlecht.2457)+1 |
3443 20ca 892B or r24,r25 |
3444 20cc 01F4 brne .L568 |
3445 20ce 8091 0000 lds r24,KompassValue |
3446 20d2 9091 0000 lds r25,(KompassValue)+1 |
3447 20d6 9093 0000 sts (KompassStartwert)+1,r25 |
3448 20da 8093 0000 sts KompassStartwert,r24 |
3449 20de 1092 0000 sts NeueKompassRichtungMerken.2453,__zero_reg__ |
3450 .L568: |
3451 20e2 2091 0000 lds r18,Parameter_KompassWirkung |
3452 20e6 3327 clr r19 |
3453 20e8 629F mul r22,r18 |
3454 20ea C001 movw r24,r0 |
3455 20ec 639F mul r22,r19 |
3456 20ee 900D add r25,r0 |
3457 20f0 729F mul r23,r18 |
3458 20f2 900D add r25,r0 |
3459 20f4 1124 clr r1 |
3460 20f6 60E4 ldi r22,lo8(64) |
3461 20f8 70E0 ldi r23,hi8(64) |
3462 20fa 0E94 0000 call __divmodhi4 |
3463 20fe A901 movw r20,r18 |
3464 2100 461B sub r20,r22 |
3465 2102 570B sbc r21,r23 |
3466 2104 1416 cp __zero_reg__,r20 |
3467 2106 1506 cpc __zero_reg__,r21 |
3468 2108 04F0 brlt .+2 |
3469 210a 00C0 rjmp .L572 |
3470 210c 1092 7A00 sts 122,__zero_reg__ |
3471 2110 2091 0000 lds r18,SignalSchlecht.2457 |
3472 2114 3091 0000 lds r19,(SignalSchlecht.2457)+1 |
3473 2118 2115 cp r18,__zero_reg__ |
3474 211a 3105 cpc r19,__zero_reg__ |
3475 211c 01F4 brne .L574 |
3476 211e 0091 0000 lds r16,Mess_Integral_Gier |
3477 2122 1091 0000 lds r17,(Mess_Integral_Gier)+1 |
3478 2126 2091 0000 lds r18,(Mess_Integral_Gier)+2 |
3479 212a 3091 0000 lds r19,(Mess_Integral_Gier)+3 |
3480 212e 8091 0000 lds r24,KompassRichtung |
3481 2132 9091 0000 lds r25,(KompassRichtung)+1 |
3482 2136 BC01 movw r22,r24 |
3483 2138 649F mul r22,r20 |
3484 213a C001 movw r24,r0 |
3485 213c 659F mul r22,r21 |
3486 213e 900D add r25,r0 |
3487 2140 749F mul r23,r20 |
3488 2142 900D add r25,r0 |
3489 2144 1124 clr r1 |
3490 2146 60E2 ldi r22,lo8(32) |
3491 2148 70E0 ldi r23,hi8(32) |
3492 214a 0E94 0000 call __divmodhi4 |
3493 214e 8827 clr r24 |
3494 2150 77FD sbrc r23,7 |
3495 2152 8095 com r24 |
3496 2154 982F mov r25,r24 |
3497 2156 060F add r16,r22 |
3498 2158 171F adc r17,r23 |
3499 215a 281F adc r18,r24 |
3500 215c 391F adc r19,r25 |
3501 215e 0093 0000 sts Mess_Integral_Gier,r16 |
3502 2162 1093 0000 sts (Mess_Integral_Gier)+1,r17 |
3503 2166 2093 0000 sts (Mess_Integral_Gier)+2,r18 |
3504 216a 3093 0000 sts (Mess_Integral_Gier)+3,r19 |
3505 216e 8FEE ldi r24,lo8(-17) |
3506 2170 8093 7A00 sts 122,r24 |
3507 2174 00C0 rjmp .L562 |
3508 .L574: |
3509 2176 8FEE ldi r24,lo8(-17) |
3510 2178 8093 7A00 sts 122,r24 |
3511 217c 2150 subi r18,lo8(-(-1)) |
3512 217e 3040 sbci r19,hi8(-(-1)) |
3513 2180 3093 0000 sts (SignalSchlecht.2457)+1,r19 |
3514 2184 2093 0000 sts SignalSchlecht.2457,r18 |
3515 2188 00C0 rjmp .L562 |
3516 .L572: |
3517 218a 84EF ldi r24,lo8(500) |
3518 218c 91E0 ldi r25,hi8(500) |
3519 218e 9093 0000 sts (SignalSchlecht.2457)+1,r25 |
3520 2192 8093 0000 sts SignalSchlecht.2457,r24 |
3521 .L562: |
3522 2196 8091 0000 lds r24,EE_Parameter+8 |
3523 219a 85FF sbrs r24,5 |
3524 219c 00C0 rjmp .L576 |
3525 219e 8091 0000 lds r24,Parameter_UserParam1 |
3526 21a2 9927 clr r25 |
3527 21a4 9093 0000 sts (P_GPS_Verstaerkung)+1,r25 |
3528 21a8 8093 0000 sts P_GPS_Verstaerkung,r24 |
3529 21ac 8091 0000 lds r24,Parameter_UserParam2 |
3530 21b0 9927 clr r25 |
3531 21b2 9093 0000 sts (D_GPS_Verstaerkung)+1,r25 |
3532 21b6 8093 0000 sts D_GPS_Verstaerkung,r24 |
3533 21ba 8091 0000 lds r24,Parameter_UserParam3 |
3534 21be 8093 0000 sts Limit_D_Anteil,r24 |
3535 21c2 0E94 0000 call gps_main |
3536 21c6 00C0 rjmp .L578 |
3537 .L576: |
3538 21c8 1092 0000 sts (GPS_Nick)+1,__zero_reg__ |
3539 21cc 1092 0000 sts GPS_Nick,__zero_reg__ |
3540 21d0 1092 0000 sts (GPS_Roll)+1,__zero_reg__ |
3541 21d4 1092 0000 sts GPS_Roll,__zero_reg__ |
3542 .L578: |
3543 21d8 8091 0000 lds r24,DebugOut+17 |
3544 21dc 8F5F subi r24,lo8(-(1)) |
3545 21de 8093 0000 sts DebugOut+17,r24 |
3546 21e2 8091 0000 lds r24,TimerWerteausgabe.2452 |
3547 21e6 8150 subi r24,lo8(-(-1)) |
3548 21e8 8093 0000 sts TimerWerteausgabe.2452,r24 |
3549 21ec 8F3F cpi r24,lo8(-1) |
3550 21ee 01F0 breq .+2 |
3551 21f0 00C0 rjmp .L579 |
3552 21f2 81E3 ldi r24,lo8(49) |
3553 21f4 8093 0000 sts TimerWerteausgabe.2452,r24 |
3554 21f8 8091 0000 lds r24,GPS_Roll |
3555 21fc 9091 0000 lds r25,(GPS_Roll)+1 |
3556 2200 9093 0000 sts (DebugOut+18)+1,r25 |
3557 2204 8093 0000 sts DebugOut+18,r24 |
3558 2208 8091 0000 lds r24,GPS_Nick |
3559 220c 9091 0000 lds r25,(GPS_Nick)+1 |
3560 2210 9093 0000 sts (DebugOut+20)+1,r25 |
3561 2214 8093 0000 sts DebugOut+20,r24 |
3562 2218 8091 0000 lds r24,GPS_Positionsabweichung_North |
3563 221c 9091 0000 lds r25,(GPS_Positionsabweichung_North)+1 |
3564 2220 9093 0000 sts (DebugOut+22)+1,r25 |
3565 2224 8093 0000 sts DebugOut+22,r24 |
3566 2228 8091 0000 lds r24,GPS_Positionsabweichung_East |
3567 222c 9091 0000 lds r25,(GPS_Positionsabweichung_East)+1 |
3568 2230 9093 0000 sts (DebugOut+24)+1,r25 |
3569 2234 8093 0000 sts DebugOut+24,r24 |
3570 2238 8091 0000 lds r24,P_Einfluss_East |
3571 223c 9091 0000 lds r25,(P_Einfluss_East)+1 |
3572 2240 9093 0000 sts (DebugOut+26)+1,r25 |
3573 2244 8093 0000 sts DebugOut+26,r24 |
3574 2248 8091 0000 lds r24,D_Einfluss_East |
3575 224c 9091 0000 lds r25,(D_Einfluss_East)+1 |
3576 2250 9093 0000 sts (DebugOut+28)+1,r25 |
3577 2254 8093 0000 sts DebugOut+28,r24 |
3578 2258 8091 0000 lds r24,P_Einfluss_North |
3579 225c 9091 0000 lds r25,(P_Einfluss_North)+1 |
3580 2260 9093 0000 sts (DebugOut+30)+1,r25 |
3581 2264 8093 0000 sts DebugOut+30,r24 |
3582 2268 8091 0000 lds r24,D_Einfluss_North |
3583 226c 9091 0000 lds r25,(D_Einfluss_North)+1 |
3584 2270 9093 0000 sts (DebugOut+32)+1,r25 |
3585 2274 8093 0000 sts DebugOut+32,r24 |
3586 2278 8091 0000 lds r24,GPS_Geschwindigkeit_North |
3587 227c 9091 0000 lds r25,(GPS_Geschwindigkeit_North)+1 |
3588 2280 9093 0000 sts (DebugOut+34)+1,r25 |
3589 2284 8093 0000 sts DebugOut+34,r24 |
3590 2288 8091 0000 lds r24,GPS_Geschwindigkeit_East |
3591 228c 9091 0000 lds r25,(GPS_Geschwindigkeit_East)+1 |
3592 2290 9093 0000 sts (DebugOut+36)+1,r25 |
3593 2294 8093 0000 sts DebugOut+36,r24 |
3594 2298 8091 0000 lds r24,Parameter_UserParam1 |
3595 229c 9927 clr r25 |
3596 229e 9093 0000 sts (DebugOut+38)+1,r25 |
3597 22a2 8093 0000 sts DebugOut+38,r24 |
3598 22a6 8091 0000 lds r24,Parameter_UserParam2 |
3599 22aa 9927 clr r25 |
3600 22ac 9093 0000 sts (DebugOut+40)+1,r25 |
3601 22b0 8093 0000 sts DebugOut+40,r24 |
3602 22b4 8091 0000 lds r24,Soll_Position_North |
3603 22b8 9091 0000 lds r25,(Soll_Position_North)+1 |
3604 22bc 9093 0000 sts (DebugOut+42)+1,r25 |
3605 22c0 8093 0000 sts DebugOut+42,r24 |
3606 22c4 8091 0000 lds r24,Soll_Position_East |
3607 22c8 9091 0000 lds r25,(Soll_Position_East)+1 |
3608 22cc 9093 0000 sts (DebugOut+44)+1,r25 |
3609 22d0 8093 0000 sts DebugOut+44,r24 |
3610 22d4 8091 0000 lds r24,Poti6 |
3611 22d8 9091 0000 lds r25,(Poti6)+1 |
3612 22dc 9093 0000 sts (DebugOut+46)+1,r25 |
3613 22e0 8093 0000 sts DebugOut+46,r24 |
3614 22e4 8091 0000 lds r24,KompassValue |
3615 22e8 9091 0000 lds r25,(KompassValue)+1 |
3616 22ec 9093 0000 sts (DebugOut+48)+1,r25 |
3617 22f0 8093 0000 sts DebugOut+48,r24 |
3618 .L579: |
3619 22f4 6091 0000 lds r22,IntegralNick |
3620 22f8 7091 0000 lds r23,(IntegralNick)+1 |
3621 22fc 8091 0000 lds r24,(IntegralNick)+2 |
3622 2300 9091 0000 lds r25,(IntegralNick)+3 |
3623 2304 2090 0000 lds r2,IntegralFaktor |
3624 2308 3090 0000 lds r3,(IntegralFaktor)+1 |
3625 230c 4090 0000 lds r4,(IntegralFaktor)+2 |
3626 2310 5090 0000 lds r5,(IntegralFaktor)+3 |
3627 2314 E090 0000 lds r14,MesswertNick |
3628 2318 F090 0000 lds r15,(MesswertNick)+1 |
3629 231c 6090 0000 lds r6,GyroFaktor |
3630 2320 7090 0000 lds r7,(GyroFaktor)+1 |
3631 2324 8090 0000 lds r8,(GyroFaktor)+2 |
3632 2328 9090 0000 lds r9,(GyroFaktor)+3 |
3633 232c 0E94 0000 call __floatsisf |
3634 2330 A201 movw r20,r4 |
3635 2332 9101 movw r18,r2 |
3636 2334 0E94 0000 call __mulsf3 |
3637 2338 5B01 movw r10,r22 |
3638 233a 6C01 movw r12,r24 |
3639 233c 0027 clr r16 |
3640 233e F7FC sbrc r15,7 |
3641 2340 0095 com r16 |
3642 2342 102F mov r17,r16 |
3643 2344 C801 movw r24,r16 |
3644 2346 B701 movw r22,r14 |
3645 2348 0E94 0000 call __floatsisf |
3646 234c A401 movw r20,r8 |
3647 234e 9301 movw r18,r6 |
3648 2350 0E94 0000 call __mulsf3 |
3649 2354 9B01 movw r18,r22 |
3650 2356 AC01 movw r20,r24 |
3651 2358 C601 movw r24,r12 |
3652 235a B501 movw r22,r10 |
3653 235c 0E94 0000 call __addsf3 |
3654 2360 0E94 0000 call __fixsfsi |
3655 2364 7093 0000 sts (MesswertNick)+1,r23 |
3656 2368 6093 0000 sts MesswertNick,r22 |
3657 236c 6091 0000 lds r22,IntegralRoll |
3658 2370 7091 0000 lds r23,(IntegralRoll)+1 |
3659 2374 8091 0000 lds r24,(IntegralRoll)+2 |
3660 2378 9091 0000 lds r25,(IntegralRoll)+3 |
3661 237c E090 0000 lds r14,MesswertRoll |
3662 2380 F090 0000 lds r15,(MesswertRoll)+1 |
3663 2384 0E94 0000 call __floatsisf |
3664 2388 A201 movw r20,r4 |
3665 238a 9101 movw r18,r2 |
3666 238c 0E94 0000 call __mulsf3 |
3667 2390 5B01 movw r10,r22 |
3668 2392 6C01 movw r12,r24 |
3669 2394 0027 clr r16 |
3670 2396 F7FC sbrc r15,7 |
3671 2398 0095 com r16 |
3672 239a 102F mov r17,r16 |
3673 239c C801 movw r24,r16 |
3674 239e B701 movw r22,r14 |
3675 23a0 0E94 0000 call __floatsisf |
3676 23a4 A401 movw r20,r8 |
3677 23a6 9301 movw r18,r6 |
3678 23a8 0E94 0000 call __mulsf3 |
3679 23ac 9B01 movw r18,r22 |
3680 23ae AC01 movw r20,r24 |
3681 23b0 C601 movw r24,r12 |
3682 23b2 B501 movw r22,r10 |
3683 23b4 0E94 0000 call __addsf3 |
3684 23b8 0E94 0000 call __fixsfsi |
3685 23bc 7093 0000 sts (MesswertRoll)+1,r23 |
3686 23c0 6093 0000 sts MesswertRoll,r22 |
3687 23c4 6091 0000 lds r22,MesswertGier |
3688 23c8 7091 0000 lds r23,(MesswertGier)+1 |
3689 23cc A090 0000 lds r10,Integral_Gier |
3690 23d0 B090 0000 lds r11,(Integral_Gier)+1 |
3691 23d4 C090 0000 lds r12,(Integral_Gier)+2 |
3692 23d8 D090 0000 lds r13,(Integral_Gier)+3 |
3693 23dc 8827 clr r24 |
3694 23de 77FD sbrc r23,7 |
3695 23e0 8095 com r24 |
3696 23e2 982F mov r25,r24 |
3697 23e4 0E94 0000 call __floatsisf |
3698 23e8 7B01 movw r14,r22 |
3699 23ea 8C01 movw r16,r24 |
3700 23ec 20E0 ldi r18,lo8(0x3f000000) |
3701 23ee 30E0 ldi r19,hi8(0x3f000000) |
3702 23f0 40E0 ldi r20,hlo8(0x3f000000) |
3703 23f2 5FE3 ldi r21,hhi8(0x3f000000) |
3704 23f4 C401 movw r24,r8 |
3705 23f6 B301 movw r22,r6 |
3706 23f8 0E94 0000 call __mulsf3 |
3707 23fc 9B01 movw r18,r22 |
3708 23fe AC01 movw r20,r24 |
3709 2400 C801 movw r24,r16 |
3710 2402 B701 movw r22,r14 |
3711 2404 0E94 0000 call __mulsf3 |
3712 2408 7B01 movw r14,r22 |
3713 240a 8C01 movw r16,r24 |
3714 240c C601 movw r24,r12 |
3715 240e B501 movw r22,r10 |
3716 2410 0E94 0000 call __floatsisf |
3717 2414 A201 movw r20,r4 |
3718 2416 9101 movw r18,r2 |
3719 2418 0E94 0000 call __mulsf3 |
3720 241c 9B01 movw r18,r22 |
3721 241e AC01 movw r20,r24 |
3722 2420 C801 movw r24,r16 |
3723 2422 B701 movw r22,r14 |
3724 2424 0E94 0000 call __addsf3 |
3725 2428 0E94 0000 call __fixsfsi |
3726 242c 7093 0000 sts (MesswertGier)+1,r23 |
3727 2430 6093 0000 sts MesswertGier,r22 |
3728 2434 8091 0000 lds r24,MesswertNick |
3729 2438 9091 0000 lds r25,(MesswertNick)+1 |
3730 243c 8150 subi r24,lo8(2049) |
3731 243e 9840 sbci r25,hi8(2049) |
3732 2440 04F0 brlt .L581 |
3733 2442 80E0 ldi r24,lo8(2048) |
3734 2444 98E0 ldi r25,hi8(2048) |
3735 2446 9093 0000 sts (MesswertNick)+1,r25 |
3736 244a 8093 0000 sts MesswertNick,r24 |
3737 .L581: |
3738 244e 8091 0000 lds r24,MesswertNick |
3739 2452 9091 0000 lds r25,(MesswertNick)+1 |
3740 2456 8050 subi r24,lo8(-2048) |
3741 2458 984F sbci r25,hi8(-2048) |
3742 245a 04F4 brge .L583 |
3743 245c 80E0 ldi r24,lo8(-2048) |
3744 245e 98EF ldi r25,hi8(-2048) |
3745 2460 9093 0000 sts (MesswertNick)+1,r25 |
3746 2464 8093 0000 sts MesswertNick,r24 |
3747 .L583: |
3748 2468 8091 0000 lds r24,MesswertRoll |
3749 246c 9091 0000 lds r25,(MesswertRoll)+1 |
3750 2470 8150 subi r24,lo8(2049) |
3751 2472 9840 sbci r25,hi8(2049) |
3752 2474 04F0 brlt .L585 |
3753 2476 80E0 ldi r24,lo8(2048) |
3754 2478 98E0 ldi r25,hi8(2048) |
3755 247a 9093 0000 sts (MesswertRoll)+1,r25 |
3756 247e 8093 0000 sts MesswertRoll,r24 |
3757 .L585: |
3758 2482 8091 0000 lds r24,MesswertRoll |
3759 2486 9091 0000 lds r25,(MesswertRoll)+1 |
3760 248a 8050 subi r24,lo8(-2048) |
3761 248c 984F sbci r25,hi8(-2048) |
3762 248e 04F4 brge .L587 |
3763 2490 80E0 ldi r24,lo8(-2048) |
3764 2492 98EF ldi r25,hi8(-2048) |
3765 2494 9093 0000 sts (MesswertRoll)+1,r25 |
3766 2498 8093 0000 sts MesswertRoll,r24 |
3767 .L587: |
3768 249c 8091 0000 lds r24,MesswertGier |
3769 24a0 9091 0000 lds r25,(MesswertGier)+1 |
3770 24a4 8150 subi r24,lo8(2049) |
3771 24a6 9840 sbci r25,hi8(2049) |
3772 24a8 04F0 brlt .L589 |
3773 24aa 80E0 ldi r24,lo8(2048) |
3774 24ac 98E0 ldi r25,hi8(2048) |
3775 24ae 9093 0000 sts (MesswertGier)+1,r25 |
3776 24b2 8093 0000 sts MesswertGier,r24 |
3777 .L589: |
3778 24b6 8091 0000 lds r24,MesswertGier |
3779 24ba 9091 0000 lds r25,(MesswertGier)+1 |
3780 24be 8050 subi r24,lo8(-2048) |
3781 24c0 984F sbci r25,hi8(-2048) |
3782 24c2 04F4 brge .L591 |
3783 24c4 80E0 ldi r24,lo8(-2048) |
3784 24c6 98EF ldi r25,hi8(-2048) |
3785 24c8 9093 0000 sts (MesswertGier)+1,r25 |
3786 24cc 8093 0000 sts MesswertGier,r24 |
3787 .L591: |
3788 24d0 8091 0000 lds r24,EE_Parameter+8 |
3789 24d4 9927 clr r25 |
3790 24d6 80FF sbrs r24,0 |
3791 24d8 00C0 rjmp .L593 |
3792 24da 2091 0000 lds r18,Parameter_MaxHoehe |
3793 24de 81FF sbrs r24,1 |
3794 24e0 00C0 rjmp .L595 |
3795 24e2 2233 cpi r18,lo8(50) |
3796 24e4 00F4 brsh .L664 |
3797 24e6 8091 0000 lds r24,HoehenWert |
3798 24ea 9091 0000 lds r25,(HoehenWert)+1 |
3799 24ee 8897 sbiw r24,40 |
3800 24f0 9093 0000 sts (SollHoehe)+1,r25 |
3801 24f4 8093 0000 sts SollHoehe,r24 |
3802 24f8 1092 0000 sts HoehenReglerAktiv,__zero_reg__ |
3803 24fc 00C0 rjmp .L599 |
3804 .L595: |
3805 24fe 8091 0000 lds r24,EE_Parameter+13 |
3806 2502 289F mul r18,r24 |
3807 2504 C001 movw r24,r0 |
3808 2506 1124 clr r1 |
3809 2508 8897 sbiw r24,40 |
3810 250a 9093 0000 sts (SollHoehe)+1,r25 |
3811 250e 8093 0000 sts SollHoehe,r24 |
3812 .L664: |
3813 2512 81E0 ldi r24,lo8(1) |
3814 2514 8093 0000 sts HoehenReglerAktiv,r24 |
3815 .L599: |
3816 2518 8091 0000 lds r24,Notlandung |
3817 251c 8823 tst r24 |
3818 251e 01F0 breq .L600 |
3819 2520 1092 0000 sts (SollHoehe)+1,__zero_reg__ |
3820 2524 1092 0000 sts SollHoehe,__zero_reg__ |
3821 .L600: |
3822 2528 2091 0000 lds r18,HoehenWert |
3823 252c 3091 0000 lds r19,(HoehenWert)+1 |
3824 2530 4091 0000 lds r20,SollHoehe |
3825 2534 5091 0000 lds r21,(SollHoehe)+1 |
3826 2538 4217 cp r20,r18 |
3827 253a 5307 cpc r21,r19 |
3828 253c 04F0 brlt .+2 |
3829 253e 00C0 rjmp .L593 |
3830 2540 8091 0000 lds r24,HoehenReglerAktiv |
3831 2544 8823 tst r24 |
3832 2546 01F4 brne .+2 |
3833 2548 00C0 rjmp .L593 |
3834 254a 241B sub r18,r20 |
3835 254c 350B sbc r19,r21 |
3836 254e 8091 0000 lds r24,Parameter_Hoehe_P |
3837 2552 9927 clr r25 |
3838 2554 BC01 movw r22,r24 |
3839 2556 269F mul r18,r22 |
3840 2558 C001 movw r24,r0 |
3841 255a 279F mul r18,r23 |
3842 255c 900D add r25,r0 |
3843 255e 369F mul r19,r22 |
3844 2560 900D add r25,r0 |
3845 2562 1124 clr r1 |
3846 2564 60E1 ldi r22,lo8(16) |
3847 2566 70E0 ldi r23,hi8(16) |
3848 2568 0E94 0000 call __divmodhi4 |
3849 256c 0981 ldd r16,Y+1 |
3850 256e 1A81 ldd r17,Y+2 |
3851 2570 061B sub r16,r22 |
3852 2572 170B sbc r17,r23 |
3853 2574 2091 0000 lds r18,HoeheD |
3854 2578 3091 0000 lds r19,(HoeheD)+1 |
3855 257c 8091 0000 lds r24,Parameter_Luftdruck_D |
3856 2580 9927 clr r25 |
3857 2582 FC01 movw r30,r24 |
3858 2584 2E9F mul r18,r30 |
3859 2586 C001 movw r24,r0 |
3860 2588 2F9F mul r18,r31 |
3861 258a 900D add r25,r0 |
3862 258c 3E9F mul r19,r30 |
3863 258e 900D add r25,r0 |
3864 2590 1124 clr r1 |
3865 2592 68E0 ldi r22,lo8(8) |
3866 2594 70E0 ldi r23,hi8(8) |
3867 2596 0E94 0000 call __divmodhi4 |
3868 259a 061B sub r16,r22 |
3869 259c 170B sbc r17,r23 |
3870 259e 6091 0000 lds r22,Mess_Integral_Hoch |
3871 25a2 7091 0000 lds r23,(Mess_Integral_Hoch)+1 |
3872 25a6 8091 0000 lds r24,(Mess_Integral_Hoch)+2 |
3873 25aa 9091 0000 lds r25,(Mess_Integral_Hoch)+3 |
3874 25ae 20E0 ldi r18,lo8(512) |
3875 25b0 32E0 ldi r19,hi8(512) |
3876 25b2 40E0 ldi r20,hlo8(512) |
3877 25b4 50E0 ldi r21,hhi8(512) |
3878 25b6 0E94 0000 call __divmodsi4 |
3879 25ba CA01 movw r24,r20 |
3880 25bc B901 movw r22,r18 |
3881 25be 2091 0000 lds r18,Parameter_Hoehe_ACC_Wirkung |
3882 25c2 3327 clr r19 |
3883 25c4 4427 clr r20 |
3884 25c6 5527 clr r21 |
3885 25c8 0E94 0000 call __mulsi3 |
3886 25cc 20E2 ldi r18,lo8(32) |
3887 25ce 30E0 ldi r19,hi8(32) |
3888 25d0 40E0 ldi r20,hlo8(32) |
3889 25d2 50E0 ldi r21,hhi8(32) |
3890 25d4 0E94 0000 call __divmodsi4 |
3891 25d8 FFEF ldi r31,hi8(-50) |
3892 25da 2E3C cpi r18,lo8(-50) |
3893 25dc 3F07 cpc r19,r31 |
3894 25de 04F4 brge .L604 |
3895 25e0 2EEC ldi r18,lo8(-50) |
3896 25e2 3FEF ldi r19,hi8(-50) |
3897 .L604: |
3898 25e4 8091 0000 lds r24,hoehenregler.2451 |
3899 25e8 9091 0000 lds r25,(hoehenregler.2451)+1 |
3900 25ec AC01 movw r20,r24 |
3901 25ee 74E0 ldi r23,4 |
3902 25f0 440F 1: lsl r20 |
3903 25f2 551F rol r21 |
3904 25f4 7A95 dec r23 |
3905 25f6 01F4 brne 1b |
3906 25f8 481B sub r20,r24 |
3907 25fa 590B sbc r21,r25 |
3908 25fc 2333 cpi r18,51 |
3909 25fe 3105 cpc r19,__zero_reg__ |
3910 2600 04F0 brlt .L605 |
3911 2602 22E3 ldi r18,lo8(50) |
3912 2604 30E0 ldi r19,hi8(50) |
3913 .L605: |
3914 2606 021B sub r16,r18 |
3915 2608 130B sbc r17,r19 |
3916 260a CA01 movw r24,r20 |
3917 260c 800F add r24,r16 |
3918 260e 911F adc r25,r17 |
3919 2610 60E1 ldi r22,lo8(16) |
3920 2612 70E0 ldi r23,hi8(16) |
3921 2614 0E94 0000 call __divmodhi4 |
3922 2618 7093 0000 sts (hoehenregler.2451)+1,r23 |
3923 261c 6093 0000 sts hoehenregler.2451,r22 |
3924 2620 8091 0000 lds r24,EE_Parameter+9 |
3925 2624 9927 clr r25 |
3926 2626 6817 cp r22,r24 |
3927 2628 7907 cpc r23,r25 |
3928 262a 04F4 brge .L606 |
3929 262c 2981 ldd r18,Y+1 |
3930 262e 3A81 ldd r19,Y+2 |
3931 2630 2817 cp r18,r24 |
3932 2632 3907 cpc r19,r25 |
3933 2634 04F0 brlt .L608 |
3934 2636 9093 0000 sts (hoehenregler.2451)+1,r25 |
3935 263a 8093 0000 sts hoehenregler.2451,r24 |
3936 263e 00C0 rjmp .L606 |
3937 .L608: |
3938 2640 4981 ldd r20,Y+1 |
3939 2642 5A81 ldd r21,Y+2 |
3940 2644 5093 0000 sts (hoehenregler.2451)+1,r21 |
3941 2648 4093 0000 sts hoehenregler.2451,r20 |
3942 264c 00C0 rjmp .L610 |
3943 .L606: |
3944 264e 8091 0000 lds r24,hoehenregler.2451 |
3945 2652 9091 0000 lds r25,(hoehenregler.2451)+1 |
3946 2656 6981 ldd r22,Y+1 |
3947 2658 7A81 ldd r23,Y+2 |
3948 265a 6817 cp r22,r24 |
3949 265c 7907 cpc r23,r25 |
3950 265e 04F4 brge .L610 |
3951 2660 7093 0000 sts (hoehenregler.2451)+1,r23 |
3952 2664 6093 0000 sts hoehenregler.2451,r22 |
3953 .L610: |
3954 2668 8091 0000 lds r24,hoehenregler.2451 |
3955 266c 9091 0000 lds r25,(hoehenregler.2451)+1 |
3956 2670 9A83 std Y+2,r25 |
3957 2672 8983 std Y+1,r24 |
3958 .L593: |
3959 2674 C090 0000 lds r12,MesswertGier |
3960 2678 D090 0000 lds r13,(MesswertGier)+1 |
3961 267c 8091 0000 lds r24,sollGier.2441 |
3962 2680 9091 0000 lds r25,(sollGier.2441)+1 |
3963 2684 C81A sub r12,r24 |
3964 2686 D90A sbc r13,r25 |
3965 2688 95E6 ldi r25,lo8(101) |
3966 268a C916 cp r12,r25 |
3967 268c D104 cpc r13,__zero_reg__ |
3968 268e 04F0 brlt .L612 |
3969 2690 64E6 ldi r22,lo8(100) |
3970 2692 C62E mov r12,r22 |
3971 2694 D12C mov r13,__zero_reg__ |
3972 2696 00C0 rjmp .L614 |
3973 .L612: |
3974 2698 ECE9 ldi r30,lo8(-100) |
3975 269a CE16 cp r12,r30 |
3976 269c EFEF ldi r30,hi8(-100) |
3977 269e DE06 cpc r13,r30 |
3978 26a0 04F4 brge .L614 |
3979 26a2 5CE9 ldi r21,lo8(-100) |
3980 26a4 C52E mov r12,r21 |
3981 26a6 5FEF ldi r21,hi8(-100) |
3982 26a8 D52E mov r13,r21 |
3983 .L614: |
3984 26aa 4090 0000 lds r4,Kp |
3985 26ae 5090 0000 lds r5,(Kp)+1 |
3986 26b2 6090 0000 lds r6,(Kp)+2 |
3987 26b6 7090 0000 lds r7,(Kp)+3 |
3988 26ba 6091 0000 lds r22,MesswertNick |
3989 26be 7091 0000 lds r23,(MesswertNick)+1 |
3990 26c2 2091 0000 lds r18,StickNick |
3991 26c6 3091 0000 lds r19,(StickNick)+1 |
3992 26ca 4091 0000 lds r20,GPS_Nick |
3993 26ce 5091 0000 lds r21,(GPS_Nick)+1 |
3994 26d2 241B sub r18,r20 |
3995 26d4 350B sbc r19,r21 |
3996 26d6 621B sub r22,r18 |
3997 26d8 730B sbc r23,r19 |
3998 26da 8827 clr r24 |
3999 26dc 77FD sbrc r23,7 |
4000 26de 8095 com r24 |
4001 26e0 982F mov r25,r24 |
4002 26e2 0E94 0000 call __floatsisf |
4003 26e6 9B01 movw r18,r22 |
4004 26e8 AC01 movw r20,r24 |
4005 26ea C301 movw r24,r6 |
4006 26ec B201 movw r22,r4 |
4007 26ee 0E94 0000 call __mulsf3 |
4008 26f2 0E94 0000 call __fixsfsi |
4009 26f6 7093 0000 sts (DiffNick)+1,r23 |
4010 26fa 6093 0000 sts DiffNick,r22 |
4011 26fe 8091 0000 lds r24,DiffNick |
4012 2702 9091 0000 lds r25,(DiffNick)+1 |
4013 2706 8C01 movw r16,r24 |
4014 2708 2227 clr r18 |
4015 270a 17FD sbrc r17,7 |
4016 270c 2095 com r18 |
4017 270e 322F mov r19,r18 |
4018 2710 8091 0000 lds r24,SummeNick.2439 |
4019 2714 9091 0000 lds r25,(SummeNick.2439)+1 |
4020 2718 A091 0000 lds r26,(SummeNick.2439)+2 |
4021 271c B091 0000 lds r27,(SummeNick.2439)+3 |
4022 2720 080F add r16,r24 |
4023 2722 191F adc r17,r25 |
4024 2724 2A1F adc r18,r26 |
4025 2726 3B1F adc r19,r27 |
4026 2728 0093 0000 sts SummeNick.2439,r16 |
4027 272c 1093 0000 sts (SummeNick.2439)+1,r17 |
4028 2730 2093 0000 sts (SummeNick.2439)+2,r18 |
4029 2734 3093 0000 sts (SummeNick.2439)+3,r19 |
4030 2738 1016 cp __zero_reg__,r16 |
4031 273a 1106 cpc __zero_reg__,r17 |
4032 273c 1206 cpc __zero_reg__,r18 |
4033 273e 1306 cpc __zero_reg__,r19 |
4034 2740 04F4 brge .L616 |
4035 2742 C801 movw r24,r16 |
4036 2744 17FF sbrs r17,7 |
4037 2746 00C0 rjmp .L618 |
4038 2748 9095 com r25 |
4039 274a 8195 neg r24 |
4040 274c 9F4F sbci r25,lo8(-1) |
4041 .L618: |
4042 274e 60E0 ldi r22,lo8(256) |
4043 2750 71E0 ldi r23,hi8(256) |
4044 2752 0E94 0000 call __divmodhi4 |
4045 2756 6F5F subi r22,lo8(-(1)) |
4046 2758 7F4F sbci r23,hi8(-(1)) |
4047 275a 8827 clr r24 |
4048 275c 77FD sbrc r23,7 |
4049 275e 8095 com r24 |
4050 2760 982F mov r25,r24 |
4051 2762 061B sub r16,r22 |
4052 2764 170B sbc r17,r23 |
4053 2766 280B sbc r18,r24 |
4054 2768 390B sbc r19,r25 |
4055 276a 00C0 rjmp .L665 |
4056 .L616: |
4057 276c C801 movw r24,r16 |
4058 276e 17FF sbrs r17,7 |
4059 2770 00C0 rjmp .L620 |
4060 2772 9095 com r25 |
4061 2774 8195 neg r24 |
4062 2776 9F4F sbci r25,lo8(-1) |
4063 .L620: |
4064 2778 60E0 ldi r22,lo8(256) |
4065 277a 71E0 ldi r23,hi8(256) |
4066 277c 0E94 0000 call __divmodhi4 |
4067 2780 6F5F subi r22,lo8(-(1)) |
4068 2782 7F4F sbci r23,hi8(-(1)) |
4069 2784 8827 clr r24 |
4070 2786 77FD sbrc r23,7 |
4071 2788 8095 com r24 |
4072 278a 982F mov r25,r24 |
4073 278c 060F add r16,r22 |
4074 278e 171F adc r17,r23 |
4075 2790 281F adc r18,r24 |
4076 2792 391F adc r19,r25 |
4077 .L665: |
4078 2794 0093 0000 sts SummeNick.2439,r16 |
4079 2798 1093 0000 sts (SummeNick.2439)+1,r17 |
4080 279c 2093 0000 sts (SummeNick.2439)+2,r18 |
4081 27a0 3093 0000 sts (SummeNick.2439)+3,r19 |
4082 27a4 8091 0000 lds r24,SummeNick.2439 |
4083 27a8 9091 0000 lds r25,(SummeNick.2439)+1 |
4084 27ac A091 0000 lds r26,(SummeNick.2439)+2 |
4085 27b0 B091 0000 lds r27,(SummeNick.2439)+3 |
4086 27b4 8138 cpi r24,lo8(16001) |
4087 27b6 FEE3 ldi r31,hi8(16001) |
4088 27b8 9F07 cpc r25,r31 |
4089 27ba F0E0 ldi r31,hlo8(16001) |
4090 27bc AF07 cpc r26,r31 |
4091 27be F0E0 ldi r31,hhi8(16001) |
4092 27c0 BF07 cpc r27,r31 |
4093 27c2 04F0 brlt .L621 |
4094 27c4 80E8 ldi r24,lo8(16000) |
4095 27c6 9EE3 ldi r25,hi8(16000) |
4096 27c8 A0E0 ldi r26,hlo8(16000) |
4097 27ca B0E0 ldi r27,hhi8(16000) |
4098 27cc 00C0 rjmp .L666 |
4099 .L621: |
4100 27ce 8058 subi r24,lo8(-16000) |
4101 27d0 914C sbci r25,hi8(-16000) |
4102 27d2 AF4F sbci r26,hlo8(-16000) |
4103 27d4 BF4F sbci r27,hhi8(-16000) |
4104 27d6 04F4 brge .L623 |
4105 27d8 80E8 ldi r24,lo8(-16000) |
4106 27da 91EC ldi r25,hi8(-16000) |
4107 27dc AFEF ldi r26,hlo8(-16000) |
4108 27de BFEF ldi r27,hhi8(-16000) |
4109 .L666: |
4110 27e0 8093 0000 sts SummeNick.2439,r24 |
4111 27e4 9093 0000 sts (SummeNick.2439)+1,r25 |
4112 27e8 A093 0000 sts (SummeNick.2439)+2,r26 |
4113 27ec B093 0000 sts (SummeNick.2439)+3,r27 |
4114 .L623: |
4115 27f0 6091 0000 lds r22,DiffNick |
4116 27f4 7091 0000 lds r23,(DiffNick)+1 |
4117 27f8 8090 0000 lds r8,Ki |
4118 27fc 9090 0000 lds r9,(Ki)+1 |
4119 2800 A090 0000 lds r10,(Ki)+2 |
4120 2804 B090 0000 lds r11,(Ki)+3 |
4121 2808 8827 clr r24 |
4122 280a 77FD sbrc r23,7 |
4123 280c 8095 com r24 |
4124 280e 982F mov r25,r24 |
4125 2810 0E94 0000 call __floatsisf |
4126 2814 7B01 movw r14,r22 |
4127 2816 8C01 movw r16,r24 |
4128 2818 6091 0000 lds r22,SummeNick.2439 |
4129 281c 7091 0000 lds r23,(SummeNick.2439)+1 |
4130 2820 8091 0000 lds r24,(SummeNick.2439)+2 |
4131 2824 9091 0000 lds r25,(SummeNick.2439)+3 |
4132 2828 0E94 0000 call __floatsisf |
4133 282c 9B01 movw r18,r22 |
4134 282e AC01 movw r20,r24 |
4135 2830 C501 movw r24,r10 |
4136 2832 B401 movw r22,r8 |
4137 2834 0E94 0000 call __mulsf3 |
4138 2838 9B01 movw r18,r22 |
4139 283a AC01 movw r20,r24 |
4140 283c C801 movw r24,r16 |
4141 283e B701 movw r22,r14 |
4142 2840 0E94 0000 call __addsf3 |
4143 2844 0E94 0000 call __fixsfsi |
4144 2848 9601 movw r18,r12 |
4145 284a 260F add r18,r22 |
4146 284c 371F adc r19,r23 |
4147 284e 4981 ldd r20,Y+1 |
4148 2850 5A81 ldd r21,Y+2 |
4149 2852 240F add r18,r20 |
4150 2854 351F adc r19,r21 |
4151 2856 2224 clr r2 |
4152 2858 4A30 cpi r20,10 |
4153 285a 5105 cpc r21,__zero_reg__ |
4154 285c 04F4 brge .L625 |
4155 285e 41E0 ldi r20,lo8(1) |
4156 2860 242E mov r2,r20 |
4157 .L625: |
4158 2862 37FD sbrc r19,7 |
4159 2864 00C0 rjmp .L628 |
4160 2866 2220 tst r2 |
4161 2868 01F0 breq .L626 |
4162 .L628: |
4163 286a 40E0 ldi r20,lo8(0) |
4164 286c 50E0 ldi r21,hi8(0) |
4165 286e 00C0 rjmp .L629 |
4166 .L626: |
4167 2870 8091 0000 lds r24,MAX_GAS |
4168 2874 482F mov r20,r24 |
4169 2876 5527 clr r21 |
4170 2878 2417 cp r18,r20 |
4171 287a 3507 cpc r19,r21 |
4172 287c 04F4 brge .L629 |
4173 287e A901 movw r20,r18 |
4174 .L629: |
4175 2880 8091 0000 lds r24,MIN_GAS |
4176 2884 E82F mov r30,r24 |
4177 2886 FF27 clr r31 |
4178 2888 FC83 std Y+4,r31 |
4179 288a EB83 std Y+3,r30 |
4180 288c 9F01 movw r18,r30 |
4181 288e E417 cp r30,r20 |
4182 2890 F507 cpc r31,r21 |
4183 2892 04F4 brge .L631 |
4184 2894 9A01 movw r18,r20 |
4185 .L631: |
4186 2896 2093 0000 sts Motor_Vorne,r18 |
4187 289a 2981 ldd r18,Y+1 |
4188 289c 3A81 ldd r19,Y+2 |
4189 289e 261B sub r18,r22 |
4190 28a0 370B sbc r19,r23 |
4191 28a2 B901 movw r22,r18 |
4192 28a4 6C0D add r22,r12 |
4193 28a6 7D1D adc r23,r13 |
4194 28a8 77FD sbrc r23,7 |
4195 28aa 00C0 rjmp .L634 |
4196 28ac 2220 tst r2 |
4197 28ae 01F0 breq .L632 |
4198 .L634: |
4199 28b0 80E0 ldi r24,lo8(0) |
4200 28b2 90E0 ldi r25,hi8(0) |
4201 28b4 00C0 rjmp .L635 |
4202 .L632: |
4203 28b6 8091 0000 lds r24,MAX_GAS |
4204 28ba 9927 clr r25 |
4205 28bc 6817 cp r22,r24 |
4206 28be 7907 cpc r23,r25 |
4207 28c0 04F4 brge .L635 |
4208 28c2 CB01 movw r24,r22 |
4209 .L635: |
4210 28c4 2B81 ldd r18,Y+3 |
4211 28c6 3C81 ldd r19,Y+4 |
4212 28c8 2817 cp r18,r24 |
4213 28ca 3907 cpc r19,r25 |
4214 28cc 04F4 brge .L637 |
4215 28ce 9C01 movw r18,r24 |
4216 .L637: |
4217 28d0 2093 0000 sts Motor_Hinten,r18 |
4218 28d4 6091 0000 lds r22,MesswertRoll |
4219 28d8 7091 0000 lds r23,(MesswertRoll)+1 |
4220 28dc 2091 0000 lds r18,StickRoll |
4221 28e0 3091 0000 lds r19,(StickRoll)+1 |
4222 28e4 4091 0000 lds r20,GPS_Roll |
4223 28e8 5091 0000 lds r21,(GPS_Roll)+1 |
4224 28ec 241B sub r18,r20 |
4225 28ee 350B sbc r19,r21 |
4226 28f0 621B sub r22,r18 |
4227 28f2 730B sbc r23,r19 |
4228 28f4 8827 clr r24 |
4229 28f6 77FD sbrc r23,7 |
4230 28f8 8095 com r24 |
4231 28fa 982F mov r25,r24 |
4232 28fc 0E94 0000 call __floatsisf |
4233 2900 9B01 movw r18,r22 |
4234 2902 AC01 movw r20,r24 |
4235 2904 C301 movw r24,r6 |
4236 2906 B201 movw r22,r4 |
4237 2908 0E94 0000 call __mulsf3 |
4238 290c 0E94 0000 call __fixsfsi |
4239 2910 7093 0000 sts (DiffRoll)+1,r23 |
4240 2914 6093 0000 sts DiffRoll,r22 |
4241 2918 8091 0000 lds r24,DiffRoll |
4242 291c 9091 0000 lds r25,(DiffRoll)+1 |
4243 2920 8C01 movw r16,r24 |
4244 2922 2227 clr r18 |
4245 2924 17FD sbrc r17,7 |
4246 2926 2095 com r18 |
4247 2928 322F mov r19,r18 |
4248 292a 8091 0000 lds r24,SummeRoll.2440 |
4249 292e 9091 0000 lds r25,(SummeRoll.2440)+1 |
4250 2932 A091 0000 lds r26,(SummeRoll.2440)+2 |
4251 2936 B091 0000 lds r27,(SummeRoll.2440)+3 |
4252 293a 080F add r16,r24 |
4253 293c 191F adc r17,r25 |
4254 293e 2A1F adc r18,r26 |
4255 2940 3B1F adc r19,r27 |
4256 2942 0093 0000 sts SummeRoll.2440,r16 |
4257 2946 1093 0000 sts (SummeRoll.2440)+1,r17 |
4258 294a 2093 0000 sts (SummeRoll.2440)+2,r18 |
4259 294e 3093 0000 sts (SummeRoll.2440)+3,r19 |
4260 2952 1016 cp __zero_reg__,r16 |
4261 2954 1106 cpc __zero_reg__,r17 |
4262 2956 1206 cpc __zero_reg__,r18 |
4263 2958 1306 cpc __zero_reg__,r19 |
4264 295a 04F4 brge .L638 |
4265 295c C801 movw r24,r16 |
4266 295e 17FF sbrs r17,7 |
4267 2960 00C0 rjmp .L640 |
4268 2962 9095 com r25 |
4269 2964 8195 neg r24 |
4270 2966 9F4F sbci r25,lo8(-1) |
4271 .L640: |
4272 2968 60E0 ldi r22,lo8(256) |
4273 296a 71E0 ldi r23,hi8(256) |
4274 296c 0E94 0000 call __divmodhi4 |
4275 2970 6F5F subi r22,lo8(-(1)) |
4276 2972 7F4F sbci r23,hi8(-(1)) |
4277 2974 8827 clr r24 |
4278 2976 77FD sbrc r23,7 |
4279 2978 8095 com r24 |
4280 297a 982F mov r25,r24 |
4281 297c 061B sub r16,r22 |
4282 297e 170B sbc r17,r23 |
4283 2980 280B sbc r18,r24 |
4284 2982 390B sbc r19,r25 |
4285 2984 00C0 rjmp .L667 |
4286 .L638: |
4287 2986 C801 movw r24,r16 |
4288 2988 17FF sbrs r17,7 |
4289 298a 00C0 rjmp .L642 |
4290 298c 9095 com r25 |
4291 298e 8195 neg r24 |
4292 2990 9F4F sbci r25,lo8(-1) |
4293 .L642: |
4294 2992 60E0 ldi r22,lo8(256) |
4295 2994 71E0 ldi r23,hi8(256) |
4296 2996 0E94 0000 call __divmodhi4 |
4297 299a 6F5F subi r22,lo8(-(1)) |
4298 299c 7F4F sbci r23,hi8(-(1)) |
4299 299e 8827 clr r24 |
4300 29a0 77FD sbrc r23,7 |
4301 29a2 8095 com r24 |
4302 29a4 982F mov r25,r24 |
4303 29a6 060F add r16,r22 |
4304 29a8 171F adc r17,r23 |
4305 29aa 281F adc r18,r24 |
4306 29ac 391F adc r19,r25 |
4307 .L667: |
4308 29ae 0093 0000 sts SummeRoll.2440,r16 |
4309 29b2 1093 0000 sts (SummeRoll.2440)+1,r17 |
4310 29b6 2093 0000 sts (SummeRoll.2440)+2,r18 |
4311 29ba 3093 0000 sts (SummeRoll.2440)+3,r19 |
4312 29be 8091 0000 lds r24,SummeRoll.2440 |
4313 29c2 9091 0000 lds r25,(SummeRoll.2440)+1 |
4314 29c6 A091 0000 lds r26,(SummeRoll.2440)+2 |
4315 29ca B091 0000 lds r27,(SummeRoll.2440)+3 |
4316 29ce 8138 cpi r24,lo8(16001) |
4317 29d0 3EE3 ldi r19,hi8(16001) |
4318 29d2 9307 cpc r25,r19 |
4319 29d4 30E0 ldi r19,hlo8(16001) |
4320 29d6 A307 cpc r26,r19 |
4321 29d8 30E0 ldi r19,hhi8(16001) |
4322 29da B307 cpc r27,r19 |
4323 29dc 04F0 brlt .L643 |
4324 29de 80E8 ldi r24,lo8(16000) |
4325 29e0 9EE3 ldi r25,hi8(16000) |
4326 29e2 A0E0 ldi r26,hlo8(16000) |
4327 29e4 B0E0 ldi r27,hhi8(16000) |
4328 29e6 00C0 rjmp .L668 |
4329 .L643: |
4330 29e8 8058 subi r24,lo8(-16000) |
4331 29ea 914C sbci r25,hi8(-16000) |
4332 29ec AF4F sbci r26,hlo8(-16000) |
4333 29ee BF4F sbci r27,hhi8(-16000) |
4334 29f0 04F4 brge .L645 |
4335 29f2 80E8 ldi r24,lo8(-16000) |
4336 29f4 91EC ldi r25,hi8(-16000) |
4337 29f6 AFEF ldi r26,hlo8(-16000) |
4338 29f8 BFEF ldi r27,hhi8(-16000) |
4339 .L668: |
4340 29fa 8093 0000 sts SummeRoll.2440,r24 |
4341 29fe 9093 0000 sts (SummeRoll.2440)+1,r25 |
4342 2a02 A093 0000 sts (SummeRoll.2440)+2,r26 |
4343 2a06 B093 0000 sts (SummeRoll.2440)+3,r27 |
4344 .L645: |
4345 2a0a 6091 0000 lds r22,DiffRoll |
4346 2a0e 7091 0000 lds r23,(DiffRoll)+1 |
4347 2a12 8827 clr r24 |
4348 2a14 77FD sbrc r23,7 |
4349 2a16 8095 com r24 |
4350 2a18 982F mov r25,r24 |
4351 2a1a 0E94 0000 call __floatsisf |
4352 2a1e 7B01 movw r14,r22 |
4353 2a20 8C01 movw r16,r24 |
4354 2a22 6091 0000 lds r22,SummeRoll.2440 |
4355 2a26 7091 0000 lds r23,(SummeRoll.2440)+1 |
4356 2a2a 8091 0000 lds r24,(SummeRoll.2440)+2 |
4357 2a2e 9091 0000 lds r25,(SummeRoll.2440)+3 |
4358 2a32 0E94 0000 call __floatsisf |
4359 2a36 9B01 movw r18,r22 |
4360 2a38 AC01 movw r20,r24 |
4361 2a3a C501 movw r24,r10 |
4362 2a3c B401 movw r22,r8 |
4363 2a3e 0E94 0000 call __mulsf3 |
4364 2a42 9B01 movw r18,r22 |
4365 2a44 AC01 movw r20,r24 |
4366 2a46 C801 movw r24,r16 |
4367 2a48 B701 movw r22,r14 |
4368 2a4a 0E94 0000 call __addsf3 |
4369 2a4e 0E94 0000 call __fixsfsi |
4370 2a52 2981 ldd r18,Y+1 |
4371 2a54 3A81 ldd r19,Y+2 |
4372 2a56 260F add r18,r22 |
4373 2a58 371F adc r19,r23 |
4374 2a5a 2C19 sub r18,r12 |
4375 2a5c 3D09 sbc r19,r13 |
4376 2a5e 37FD sbrc r19,7 |
4377 2a60 00C0 rjmp .L649 |
4378 2a62 2220 tst r2 |
4379 2a64 01F0 breq .L647 |
4380 .L649: |
4381 2a66 40E0 ldi r20,lo8(0) |
4382 2a68 50E0 ldi r21,hi8(0) |
4383 2a6a 00C0 rjmp .L650 |
4384 .L647: |
4385 2a6c 8091 0000 lds r24,MAX_GAS |
4386 2a70 482F mov r20,r24 |
4387 2a72 5527 clr r21 |
4388 2a74 2417 cp r18,r20 |
4389 2a76 3507 cpc r19,r21 |
4390 2a78 04F4 brge .L650 |
4391 2a7a A901 movw r20,r18 |
4392 .L650: |
4393 2a7c 2B81 ldd r18,Y+3 |
4394 2a7e 3C81 ldd r19,Y+4 |
4395 2a80 2417 cp r18,r20 |
4396 2a82 3507 cpc r19,r21 |
4397 2a84 04F4 brge .L652 |
4398 2a86 9A01 movw r18,r20 |
4399 .L652: |
4400 2a88 2093 0000 sts Motor_Links,r18 |
4401 2a8c 8981 ldd r24,Y+1 |
4402 2a8e 9A81 ldd r25,Y+2 |
4403 2a90 861B sub r24,r22 |
4404 2a92 970B sbc r25,r23 |
4405 2a94 BC01 movw r22,r24 |
4406 2a96 6C19 sub r22,r12 |
4407 2a98 7D09 sbc r23,r13 |
4408 2a9a 77FD sbrc r23,7 |
4409 2a9c 00C0 rjmp .L655 |
4410 2a9e 2220 tst r2 |
4411 2aa0 01F0 breq .L653 |
4412 .L655: |
4413 2aa2 20E0 ldi r18,lo8(0) |
4414 2aa4 30E0 ldi r19,hi8(0) |
4415 2aa6 00C0 rjmp .L656 |
4416 .L653: |
4417 2aa8 8091 0000 lds r24,MAX_GAS |
4418 2aac 282F mov r18,r24 |
4419 2aae 3327 clr r19 |
4420 2ab0 6217 cp r22,r18 |
4421 2ab2 7307 cpc r23,r19 |
4422 2ab4 04F4 brge .L656 |
4423 2ab6 9B01 movw r18,r22 |
4424 .L656: |
4425 2ab8 8B81 ldd r24,Y+3 |
4426 2aba 9C81 ldd r25,Y+4 |
4427 2abc 8217 cp r24,r18 |
4428 2abe 9307 cpc r25,r19 |
4429 2ac0 04F4 brge .L658 |
4430 2ac2 C901 movw r24,r18 |
4431 .L658: |
4432 2ac4 8093 0000 sts Motor_Rechts,r24 |
4433 /* epilogue: frame size=4 */ |
4434 2ac8 2496 adiw r28,4 |
4435 2aca 0FB6 in __tmp_reg__,__SREG__ |
4436 2acc F894 cli |
4437 2ace DEBF out __SP_H__,r29 |
4438 2ad0 0FBE out __SREG__,__tmp_reg__ |
4439 2ad2 CDBF out __SP_L__,r28 |
4440 2ad4 DF91 pop r29 |
4441 2ad6 CF91 pop r28 |
4442 2ad8 1F91 pop r17 |
4443 2ada 0F91 pop r16 |
4444 2adc FF90 pop r15 |
4445 2ade EF90 pop r14 |
4446 2ae0 DF90 pop r13 |
4447 2ae2 CF90 pop r12 |
4448 2ae4 BF90 pop r11 |
4449 2ae6 AF90 pop r10 |
4450 2ae8 9F90 pop r9 |
4451 2aea 8F90 pop r8 |
4452 2aec 7F90 pop r7 |
4453 2aee 6F90 pop r6 |
4454 2af0 5F90 pop r5 |
4455 2af2 4F90 pop r4 |
4456 2af4 3F90 pop r3 |
4457 2af6 2F90 pop r2 |
4458 2af8 0895 ret |
4459 /* epilogue end (size=25) */ |
4460 /* function MotorRegler size 2856 (2805) */ |
4462 .global Timeout |
4463 .global Timeout |
4464 .section .bss |
4467 Timeout: |
4468 0000 00 .skip 1,0 |
4469 .global AdNeutralNick |
4470 .global AdNeutralNick |
4473 AdNeutralNick: |
4474 0001 0000 .skip 2,0 |
4475 .global AdNeutralRoll |
4476 .global AdNeutralRoll |
4479 AdNeutralRoll: |
4480 0003 0000 .skip 2,0 |
4481 .global AdNeutralGier |
4482 .global AdNeutralGier |
4485 AdNeutralGier: |
4486 0005 0000 .skip 2,0 |
4487 .global NeutralAccX |
4488 .global NeutralAccX |
4491 NeutralAccX: |
4492 0007 0000 .skip 2,0 |
4493 .global NeutralAccY |
4494 .global NeutralAccY |
4497 NeutralAccY: |
4498 0009 0000 .skip 2,0 |
4499 .global NeutralAccZ |
4500 .global NeutralAccZ |
4503 NeutralAccZ: |
4504 000b 0000 0000 .skip 4,0 |
4505 .global CosinusNickWinkel |
4506 .global CosinusNickWinkel |
4509 CosinusNickWinkel: |
4510 000f 00 .skip 1,0 |
4511 .global CosinusRollWinkel |
4512 .global CosinusRollWinkel |
4515 CosinusRollWinkel: |
4516 0010 00 .skip 1,0 |
4517 .global IntegralNick |
4518 .global IntegralNick |
4521 IntegralNick: |
4522 0011 0000 0000 .skip 4,0 |
4523 .global IntegralNick2 |
4524 .global IntegralNick2 |
4527 IntegralNick2: |
4528 0015 0000 0000 .skip 4,0 |
4529 .global IntegralRoll |
4530 .global IntegralRoll |
4533 IntegralRoll: |
4534 0019 0000 0000 .skip 4,0 |
4535 .global IntegralRoll2 |
4536 .global IntegralRoll2 |
4539 IntegralRoll2: |
4540 001d 0000 0000 .skip 4,0 |
4541 .global Integral_Gier |
4542 .global Integral_Gier |
4545 Integral_Gier: |
4546 0021 0000 0000 .skip 4,0 |
4547 .global Mess_IntegralNick |
4548 .global Mess_IntegralNick |
4551 Mess_IntegralNick: |
4552 0025 0000 0000 .skip 4,0 |
4553 .global Mess_IntegralNick2 |
4554 .global Mess_IntegralNick2 |
4557 Mess_IntegralNick2: |
4558 0029 0000 0000 .skip 4,0 |
4559 .global Mess_IntegralRoll |
4560 .global Mess_IntegralRoll |
4563 Mess_IntegralRoll: |
4564 002d 0000 0000 .skip 4,0 |
4565 .global Mess_IntegralRoll2 |
4566 .global Mess_IntegralRoll2 |
4569 Mess_IntegralRoll2: |
4570 0031 0000 0000 .skip 4,0 |
4571 .global Mess_Integral_Gier |
4572 .global Mess_Integral_Gier |
4575 Mess_Integral_Gier: |
4576 0035 0000 0000 .skip 4,0 |
4577 .global Mess_Integral_Gier2 |
4578 .global Mess_Integral_Gier2 |
4581 Mess_Integral_Gier2: |
4582 0039 0000 0000 .skip 4,0 |
4583 .global Mess_Integral_Hoch |
4584 .global Mess_Integral_Hoch |
4587 Mess_Integral_Hoch: |
4588 003d 0000 0000 .skip 4,0 |
4589 .global KompassValue |
4590 .global KompassValue |
4593 KompassValue: |
4594 0041 0000 .skip 2,0 |
4595 .global KompassStartwert |
4596 .global KompassStartwert |
4599 KompassStartwert: |
4600 0043 0000 .skip 2,0 |
4601 .global KompassRichtung |
4602 .global KompassRichtung |
4605 KompassRichtung: |
4606 0045 0000 .skip 2,0 |
4607 .global Notlandung |
4608 .global Notlandung |
4611 Notlandung: |
4612 0047 00 .skip 1,0 |
4613 .global HoehenReglerAktiv |
4614 .global HoehenReglerAktiv |
4617 HoehenReglerAktiv: |
4618 0048 00 .skip 1,0 |
4619 .global blinkcount_LED1 |
4620 .global blinkcount_LED1 |
4623 blinkcount_LED1: |
4624 0049 00 .skip 1,0 |
4625 .global modell_fliegt_gps |
4626 .global modell_fliegt_gps |
4629 modell_fliegt_gps: |
4630 004a 0000 .skip 2,0 |
4631 .global Limit_D_Anteil |
4632 .global Limit_D_Anteil |
4635 Limit_D_Anteil: |
4636 004c 00 .skip 1,0 |
4637 .global Poti1 |
4638 .global Poti1 |
4641 Poti1: |
4642 004d 0000 .skip 2,0 |
4643 .global Poti2 |
4644 .global Poti2 |
4647 Poti2: |
4648 004f 0000 .skip 2,0 |
4649 .global Poti3 |
4650 .global Poti3 |
4653 Poti3: |
4654 0051 0000 .skip 2,0 |
4655 .global Poti4 |
4656 .global Poti4 |
4659 Poti4: |
4660 0053 0000 .skip 2,0 |
4661 .global Poti5 |
4662 .global Poti5 |
4665 Poti5: |
4666 0055 0000 .skip 2,0 |
4667 .global Poti6 |
4668 .global Poti6 |
4671 Poti6: |
4672 0057 0000 .skip 2,0 |
4673 .global Poti7 |
4674 .global Poti7 |
4677 Poti7: |
4678 0059 0000 .skip 2,0 |
4679 .global Poti8 |
4680 .global Poti8 |
4683 Poti8: |
4684 005b 0000 .skip 2,0 |
4685 .global SenderOkay |
4686 .global SenderOkay |
4689 SenderOkay: |
4690 005d 00 .skip 1,0 |
4691 .global StickNick |
4692 .global StickNick |
4695 StickNick: |
4696 005e 0000 .skip 2,0 |
4697 .global StickRoll |
4698 .global StickRoll |
4701 StickRoll: |
4702 0060 0000 .skip 2,0 |
4703 .global StickGier |
4704 .global StickGier |
4707 StickGier: |
4708 0062 0000 .skip 2,0 |
4709 .global MotorenEin |
4710 .global MotorenEin |
4713 MotorenEin: |
4714 0064 00 .skip 1,0 |
4715 .global HoehenWert |
4716 .global HoehenWert |
4719 HoehenWert: |
4720 0065 0000 .skip 2,0 |
4721 .global SollHoehe |
4722 .global SollHoehe |
4725 SollHoehe: |
4726 0067 0000 .skip 2,0 |
4727 .global Kp |
4728 .data |
4731 Kp: |
4732 0010 00 .byte 0 |
4733 0011 00 .byte 0 |
4734 0012 80 .byte -128 |
4735 0013 3F .byte 63 |
4736 .global Ki |
4739 Ki: |
4740 0014 17 .byte 23 |
4741 0015 B7 .byte -73 |
4742 0016 D1 .byte -47 |
4743 0017 38 .byte 56 |
4744 .global Parameter_Luftdruck_D |
4747 Parameter_Luftdruck_D: |
4748 0018 30 .byte 48 |
4749 .global Parameter_MaxHoehe |
4752 Parameter_MaxHoehe: |
4753 0019 FB .byte -5 |
4754 .global Parameter_Hoehe_P |
4757 Parameter_Hoehe_P: |
4758 001a 10 .byte 16 |
4759 .global Parameter_Hoehe_ACC_Wirkung |
4762 Parameter_Hoehe_ACC_Wirkung: |
4763 001b 3A .byte 58 |
4764 .global Parameter_KompassWirkung |
4767 Parameter_KompassWirkung: |
4768 001c 40 .byte 64 |
4769 .global Parameter_Gyro_P |
4772 Parameter_Gyro_P: |
4773 001d 32 .byte 50 |
4774 .global Parameter_Gyro_I |
4777 Parameter_Gyro_I: |
4778 001e 96 .byte -106 |
4779 .global Parameter_Gier_P |
4782 Parameter_Gier_P: |
4783 001f 02 .byte 2 |
4784 .global Parameter_I_Faktor |
4787 Parameter_I_Faktor: |
4788 0020 0A .byte 10 |
4789 .global Parameter_UserParam1 |
4790 .global Parameter_UserParam1 |
4791 .section .bss |
4794 Parameter_UserParam1: |
4795 0069 00 .skip 1,0 |
4796 .global Parameter_UserParam2 |
4797 .global Parameter_UserParam2 |
4800 Parameter_UserParam2: |
4801 006a 00 .skip 1,0 |
4802 .global Parameter_UserParam3 |
4803 .global Parameter_UserParam3 |
4806 Parameter_UserParam3: |
4807 006b 00 .skip 1,0 |
4808 .global Parameter_UserParam4 |
4809 .global Parameter_UserParam4 |
4812 Parameter_UserParam4: |
4813 006c 00 .skip 1,0 |
4814 .global Parameter_ServoNickControl |
4815 .data |
4818 Parameter_ServoNickControl: |
4819 0021 64 .byte 100 |
4820 .lcomm SignalSchlecht.2457,2 |
4821 .lcomm NeueKompassRichtungMerken.2453,1 |
4822 .lcomm TimerWerteausgabe.2452,1 |
4823 .lcomm hoehenregler.2451,2 |
4824 .lcomm modell_fliegt.2450,2 |
4825 .lcomm delay_ausschalten.2449,1 |
4826 .lcomm delay_einschalten.2448,1 |
4827 .lcomm delay_neutral.2447,1 |
4828 .lcomm RcLostTimer.2446,2 |
4829 .lcomm IntegralFehlerRoll.2445,2 |
4830 .lcomm IntegralFehlerNick.2444,2 |
4831 .lcomm tmp_long2.2443,4 |
4832 .lcomm tmp_long.2442,4 |
4833 .lcomm sollGier.2441,4 |
4834 .lcomm SummeRoll.2440,4 |
4835 .lcomm SummeNick.2439,4 |
4836 .comm DiffNick,2,1 |
4837 .comm DiffRoll,2,1 |
4838 .comm durchschnitt_northing,4,1 |
4839 .comm durchschnitt_easting,4,1 |
4840 .comm P_GPS_Verstaerkung,2,1 |
4841 .comm D_GPS_Verstaerkung,2,1 |
4842 .comm RemoteTasten,1,1 |
4843 .comm MesswertNick,2,1 |
4844 .comm MesswertRoll,2,1 |
4845 .comm MesswertGier,2,1 |
4846 .comm Mittelwert_AccNick,2,1 |
4847 .comm Mittelwert_AccRoll,2,1 |
4848 .comm Mittelwert_AccHoch,2,1 |
4849 .comm h,1,1 |
4850 .comm m,1,1 |
4851 .comm s,1,1 |
4852 .comm Motor_Vorne,1,1 |
4853 .comm Motor_Hinten,1,1 |
4854 .comm Motor_Rechts,1,1 |
4855 .comm Motor_Links,1,1 |
4856 .comm Count,1,1 |
4857 .comm MotorWert,5,1 |
4858 .comm EE_Parameter,58,1 |
4859 .comm MAX_GAS,1,1 |
4860 .comm MIN_GAS,1,1 |
4861 .comm GyroFaktor,4,1 |
4862 .comm IntegralFaktor,4,1 |
4863 /* File "fc.c": code 5545 = 0x15a9 (5463), prologues 38, epilogues 44 */ |
DEFINED SYMBOLS |
*ABS*:00000000 fc.c |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:3 *ABS*:0000003f __SREG__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4 *ABS*:0000003e __SP_H__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:5 *ABS*:0000003d __SP_L__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:6 *ABS*:00000000 __tmp_reg__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:7 *ABS*:00000001 __zero_reg__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:13 .text:00000000 Mittelwert |
*COM*:00000002 MesswertNick |
*COM*:00000002 MesswertRoll |
*COM*:00000002 MesswertGier |
*COM*:00000002 Mittelwert_AccNick |
*COM*:00000002 Mittelwert_AccRoll |
*COM*:00000002 Mittelwert_AccHoch |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4575 .bss:00000035 Mess_Integral_Gier |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4545 .bss:00000021 Integral_Gier |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4551 .bss:00000025 Mess_IntegralNick |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4521 .bss:00000011 IntegralNick |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4563 .bss:0000002d Mess_IntegralRoll |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4533 .bss:00000019 IntegralRoll |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4557 .bss:00000029 Mess_IntegralNick2 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4527 .bss:00000015 IntegralNick2 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4569 .bss:00000031 Mess_IntegralRoll2 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4539 .bss:0000001d IntegralRoll2 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4641 .bss:0000004d Poti1 |
*COM*:0000003a EE_Parameter |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4647 .bss:0000004f Poti2 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4653 .bss:00000051 Poti3 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4659 .bss:00000053 Poti4 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4665 .bss:00000055 Poti5 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4671 .bss:00000057 Poti6 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4677 .bss:00000059 Poti7 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4683 .bss:0000005b Poti8 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:760 .text:0000073a CalibrierMittelwert |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:1286 .text:00000c2a ParameterZuordnung |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4752 .data:00000019 Parameter_MaxHoehe |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4747 .data:00000018 Parameter_Luftdruck_D |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4757 .data:0000001a Parameter_Hoehe_P |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4762 .data:0000001b Parameter_Hoehe_ACC_Wirkung |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4767 .data:0000001c Parameter_KompassWirkung |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4772 .data:0000001d Parameter_Gyro_P |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4777 .data:0000001e Parameter_Gyro_I |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4787 .data:00000020 Parameter_I_Faktor |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4794 .bss:00000069 Parameter_UserParam1 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4800 .bss:0000006a Parameter_UserParam2 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4806 .bss:0000006b Parameter_UserParam3 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4812 .bss:0000006c Parameter_UserParam4 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4818 .data:00000021 Parameter_ServoNickControl |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4739 .data:00000014 Ki |
*COM*:00000001 MAX_GAS |
*COM*:00000001 MIN_GAS |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:1852 .text:000010c4 DefaultKonstanten2 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:1937 .text:0000119c DefaultKonstanten1 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:2020 .text:0000127c SendMotorData |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4713 .bss:00000064 MotorenEin |
*COM*:00000001 Motor_Hinten |
*COM*:00000001 Motor_Vorne |
*COM*:00000001 Motor_Rechts |
*COM*:00000001 Motor_Links |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:2060 .text:000012d2 SetNeutral |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4491 .bss:00000007 NeutralAccX |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4497 .bss:00000009 NeutralAccY |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4503 .bss:0000000b NeutralAccZ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4473 .bss:00000001 AdNeutralNick |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4479 .bss:00000003 AdNeutralRoll |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4485 .bss:00000005 AdNeutralGier |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4587 .bss:0000003d Mess_Integral_Hoch |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4593 .bss:00000041 KompassValue |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4599 .bss:00000043 KompassStartwert |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:2232 .text:000014ca Piep |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:2261 .text:000014f4 MotorRegler |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4689 .bss:0000005d SenderOkay |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4827 .bss:00000078 RcLostTimer.2446 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4611 .bss:00000047 Notlandung |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4823 .bss:00000073 modell_fliegt.2450 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4629 .bss:0000004a modell_fliegt_gps |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4834 .bss:0000008e SummeNick.2439 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4833 .bss:0000008a SummeRoll.2440 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4581 .bss:00000039 Mess_Integral_Gier2 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4826 .bss:00000077 delay_neutral.2447 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4825 .bss:00000076 delay_einschalten.2448 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4832 .bss:00000086 sollGier.2441 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4824 .bss:00000075 delay_ausschalten.2449 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4695 .bss:0000005e StickNick |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4701 .bss:00000060 StickRoll |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4707 .bss:00000062 StickGier |
*COM*:00000004 GyroFaktor |
*COM*:00000004 IntegralFaktor |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4623 .bss:00000049 blinkcount_LED1 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4829 .bss:0000007c IntegralFehlerNick.2444 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4828 .bss:0000007a IntegralFehlerRoll.2445 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4831 .bss:00000082 tmp_long.2442 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4830 .bss:0000007e tmp_long2.2443 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4820 .bss:0000006f NeueKompassRichtungMerken.2453 |
.bss:0000006d SignalSchlecht.2457 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4605 .bss:00000045 KompassRichtung |
*COM*:00000002 P_GPS_Verstaerkung |
*COM*:00000002 D_GPS_Verstaerkung |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4635 .bss:0000004c Limit_D_Anteil |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4821 .bss:00000070 TimerWerteausgabe.2452 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4719 .bss:00000065 HoehenWert |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4725 .bss:00000067 SollHoehe |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4617 .bss:00000048 HoehenReglerAktiv |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4822 .bss:00000071 hoehenregler.2451 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4731 .data:00000010 Kp |
*COM*:00000002 DiffNick |
*COM*:00000002 DiffRoll |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4467 .bss:00000000 Timeout |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4509 .bss:0000000f CosinusNickWinkel |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4515 .bss:00000010 CosinusRollWinkel |
C:\DOKUME~1\none\LOKALE~1\Temp/ccbSEVxo.s:4782 .data:0000001f Parameter_Gier_P |
*COM*:00000004 durchschnitt_northing |
*COM*:00000004 durchschnitt_easting |
*COM*:00000001 RemoteTasten |
*COM*:00000001 h |
*COM*:00000001 m |
*COM*:00000001 s |
*COM*:00000001 Count |
*COM*:00000005 MotorWert |
UNDEFINED SYMBOLS |
__do_copy_data |
__do_clear_bss |
MessanzahlNick |
AccumulateNick |
__divmodhi4 |
MessanzahlRoll |
AccumulateRoll |
MessanzahlGier |
AccumulateGier |
messanzahl_AccNick |
accumulate_AccNick |
__divmodsi4 |
messanzahl_AccRoll |
accumulate_AccRoll |
messanzahl_AccHoch |
accumulate_AccHoch |
PPM_in |
__floatsisf |
__addsf3 |
__mulsf3 |
MotorTest |
twi_state |
motor |
i2c_start |
SetDelay |
CheckDelay |
MessLuftdruck |
SucheLuftruckOffset |
Aktuell_az |
Luftdruck |
StartLuftdruck |
HoeheD |
beeptime |
Delay_ms |
PcZugriff |
EEPromArray |
__eeprom_write_byte_1F2021 |
GetActiveParamSetNumber |
ReadParameterSet |
NewPpmData |
PPM_diff |
__divsf3 |
__ltsf2 |
ZaehlMessungen |
__mulsi3 |
gps_main |
GPS_Nick |
GPS_Roll |
DebugOut |
GPS_Positionsabweichung_North |
GPS_Positionsabweichung_East |
P_Einfluss_East |
D_Einfluss_East |
P_Einfluss_North |
D_Einfluss_North |
GPS_Geschwindigkeit_North |
GPS_Geschwindigkeit_East |
Soll_Position_North |
Soll_Position_East |
__fixsfsi |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/flight.aps |
---|
0,0 → 1,0 |
<AVRStudio><MANAGEMENT><ProjectName>flight</ProjectName><Created>18-Aug-2007 15:51:07</Created><LastEdit>18-Oct-2007 18:43:58</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>18-Aug-2007 15:51:07</Created><Version>4</Version><Build>4, 13, 0, 528</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>default\Flight-Ctrl_MEGA644_V0_60.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v60pakoxda MM3\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>AVR Simulator</CURRENT_TARGET><CURRENT_PART>ATmega644.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>analog.c</SOURCEFILE><SOURCEFILE>eeprom.c</SOURCEFILE><SOURCEFILE>fc.c</SOURCEFILE><SOURCEFILE>GPS.c</SOURCEFILE><SOURCEFILE>main.c</SOURCEFILE><SOURCEFILE>menu.c</SOURCEFILE><SOURCEFILE>printf_P.c</SOURCEFILE><SOURCEFILE>rc.c</SOURCEFILE><SOURCEFILE>timer0.c</SOURCEFILE><SOURCEFILE>twimaster.c</SOURCEFILE><SOURCEFILE>uart.c</SOURCEFILE><SOURCEFILE>spi.c</SOURCEFILE><HEADERFILE>_Settings.h</HEADERFILE><HEADERFILE>analog.h</HEADERFILE><HEADERFILE>fc.h</HEADERFILE><HEADERFILE>gps.h</HEADERFILE><HEADERFILE>main.h</HEADERFILE><HEADERFILE>menu.h</HEADERFILE><HEADERFILE>old_macros.h</HEADERFILE><HEADERFILE>printf_P.h</HEADERFILE><HEADERFILE>rc.h</HEADERFILE><HEADERFILE>Settings.h</HEADERFILE><HEADERFILE>timer0.h</HEADERFILE><HEADERFILE>twimaster.h</HEADERFILE><HEADERFILE>uart.h</HEADERFILE><HEADERFILE>spi.h</HEADERFILE><OTHERFILE>version.txt</OTHERFILE><OTHERFILE>License.txt</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>NO</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE></EXTERNALMAKEFILE><PART>atmega644</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>Flight-Ctrl_MEGA644_V0_60.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS><OPTION><FILE>GPS.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>analog.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>eeprom.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>fc.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>main.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>menu.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>printf_P.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>rc.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>timer0.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>twimaster.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>uart.c</FILE><OPTIONLIST></OPTIONLIST></OPTION></OPTIONS><INCDIRS/><LIBDIRS/><LIBS><LIB>libc.a</LIB><LIB>libm.a</LIB></LIBS><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -Wstrict-prototypes -std=gnu99 -DVERSION_KOMPATIBEL=4 -DVERSION_HAUPTVERSION=0 -DVERSION_NEBENVERSION=60 -DF_CPU=20000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20070525\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20070525\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/></IOView><Files><File00000><FileId>00000</FileId><FileName>_Settings.h</FileName><Status>1</Status></File00000><File00001><FileId>00001</FileId><FileName>analog.h</FileName><Status>1</Status></File00001><File00002><FileId>00002</FileId><FileName>fc.h</FileName><Status>1</Status></File00002><File00003><FileId>00003</FileId><FileName>gps.h</FileName><Status>1</Status></File00003><File00004><FileId>00004</FileId><FileName>main.h</FileName><Status>1</Status></File00004><File00005><FileId>00005</FileId><FileName>menu.h</FileName><Status>1</Status></File00005><File00006><FileId>00006</FileId><FileName>old_macros.h</FileName><Status>1</Status></File00006><File00007><FileId>00007</FileId><FileName>printf_P.h</FileName><Status>1</Status></File00007><File00008><FileId>00008</FileId><FileName>rc.h</FileName><Status>1</Status></File00008><File00009><FileId>00009</FileId><FileName>Settings.h</FileName><Status>1</Status></File00009><File00010><FileId>00010</FileId><FileName>timer0.h</FileName><Status>1</Status></File00010><File00011><FileId>00011</FileId><FileName>twimaster.h</FileName><Status>1</Status></File00011><File00012><FileId>00012</FileId><FileName>uart.h</FileName><Status>1</Status></File00012></Files><Workspace><File00000><Position>340 94 1160 610</Position><LineCol>0 0</LineCol></File00000><File00001><Position>362 116 1174 602</Position><LineCol>0 0</LineCol></File00001><File00002><Position>384 138 1196 624</Position><LineCol>0 0</LineCol></File00002><File00003><Position>406 160 1218 646</Position><LineCol>0 0</LineCol></File00003><File00004><Position>428 182 1240 668</Position><LineCol>0 0</LineCol></File00004><File00005><Position>450 204 1262 690</Position><LineCol>0 0</LineCol></File00005><File00006><Position>472 226 1284 712</Position><LineCol>0 0</LineCol></File00006><File00007><Position>494 248 1306 734</Position><LineCol>0 0</LineCol></File00007><File00008><Position>516 270 1328 756</Position><LineCol>0 0</LineCol></File00008><File00009><Position>538 292 1350 778</Position><LineCol>0 0</LineCol></File00009><File00010><Position>560 314 1372 800</Position><LineCol>0 0</LineCol></File00010><File00011><Position>582 336 1394 822</Position><LineCol>0 0</LineCol></File00011><File00012><Position>336 71 1402 830</Position><LineCol>0 0</LineCol><State>Maximized</State></File00012></Workspace><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio> |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/flight.aws |
---|
0,0 → 1,0 |
<AVRWorkspace><IOSettings><CurrentRegisters/></IOSettings><part name="ATMEGA644"/><Files><File00000 Name="E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v60pakoxda MM3JokoGPS\_Settings.h" Position="342 96 942 612" LineCol="0 0"/><File00001 Name="E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v60pakoxda MM3JokoGPS\analog.h" Position="364 118 956 604" LineCol="0 0"/><File00002 Name="E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v60pakoxda MM3JokoGPS\fc.h" Position="386 140 978 626" LineCol="0 0"/><File00003 Name="E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v60pakoxda MM3JokoGPS\gps.h" Position="408 162 1000 648" LineCol="0 0"/><File00004 Name="E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v60pakoxda MM3JokoGPS\main.h" Position="430 184 1022 670" LineCol="0 0"/><File00005 Name="E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v60pakoxda MM3JokoGPS\menu.h" Position="452 206 1044 692" LineCol="0 0"/><File00006 Name="E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v60pakoxda MM3JokoGPS\old_macros.h" Position="474 228 1066 714" LineCol="0 0"/><File00007 Name="E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v60pakoxda MM3JokoGPS\printf_P.h" Position="496 250 1088 736" LineCol="0 0"/><File00008 Name="E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v60pakoxda MM3JokoGPS\rc.h" Position="518 272 1110 758" LineCol="0 0"/><File00009 Name="E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v60pakoxda MM3JokoGPS\Settings.h" Position="540 294 1132 780" LineCol="0 0"/><File00010 Name="E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v60pakoxda MM3JokoGPS\timer0.h" Position="562 316 1154 802" LineCol="0 0"/><File00011 Name="E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v60pakoxda MM3JokoGPS\twimaster.h" Position="584 338 1176 824" LineCol="0 0"/><File00012 Name="E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v60pakoxda MM3JokoGPS\uart.h" Position="342 96 934 582" LineCol="0 0"/></Files></AVRWorkspace> |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/flight.pnproj |
---|
0,0 → 1,0 |
<Project name="Flight-Ctrl"><File path="uart.h"></File><File path="main.c"></File><File path="main.h"></File><File path="makefile"></File><File path="uart.c"></File><File path="printf_P.h"></File><File path="printf_P.c"></File><File path="timer0.c"></File><File path="timer0.h"></File><File path="old_macros.h"></File><File path="twimaster.c"></File><File path="version.txt"></File><File path="twimaster.h"></File><File path="rc.c"></File><File path="rc.h"></File><File path="fc.h"></File><File path="fc.c"></File><File path="menu.h"></File><File path="menu.c"></File><File path="_Settings.h"></File><File path="analog.c"></File><File path="analog.h"></File><File path="GPS.c"></File><File path="gps.h"></File><File path="License.txt"></File></Project> |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/flight.pnps |
---|
0,0 → 1,0 |
<pd><ViewState><e p="Flight-Ctrl" x="true"></e></ViewState></pd> |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/gps.h |
---|
0,0 → 1,27 |
extern long P_Einfluss_North; |
extern long D_Einfluss_North; |
extern long P_Einfluss_East; |
extern long D_Einfluss_East; |
extern long GPS_Positionsabweichung_North; |
extern long GPS_Positionsabweichung_East; |
extern long GPS_Geschwindigkeit_North; |
extern long GPS_Geschwindigkeit_East; |
extern long GPS_Home_North; |
extern long GPS_Home_East; |
extern long Soll_Position_North; |
extern long Soll_Position_East; |
extern volatile long EAST_MITTEL; |
extern volatile long NORTH_MITTEL; |
extern signed int GPS_Nick; |
extern signed int GPS_Roll; |
extern void GPS_Neutral(void); |
extern void GPS_BerechneZielrichtung(void); |
extern void gps_main(void); |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/main.c |
---|
0,0 → 1,210 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + Nur für den privaten Gebrauch |
// + www.MikroKopter.com |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
// + dass eine Nutzung (auch auszugsweise) nur für den privaten und nicht-kommerziellen Gebrauch zulässig ist. |
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
// + bzgl. der Nutzungsbedingungen aufzunehmen. |
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
// + Verkauf von Luftbildaufnahmen, usw. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
// + auf anderen Webseiten oder Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
// + eindeutig als Ursprung verlinkt und genannt werden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
// + Benutzung auf eigene Gefahr |
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
// + mit unserer Zustimmung zulässig |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
// + this list of conditions and the following disclaimer. |
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
// + from this software without specific prior written permission. |
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
// + for non-commercial use (directly or indirectly) |
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
// + with our written permission |
// + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
// + clearly linked as origin |
// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
unsigned char EEPromArray[E2END+1] EEMEM; |
// -- Parametersatz aus EEPROM lesen --- |
// number [0..5] |
void ReadParameterSet(unsigned char number, unsigned char *buffer, unsigned char length) |
{ |
if (number > 5) number = 5; |
eeprom_read_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * number], length); |
} |
// -- Parametersatz ins EEPROM schreiben --- |
// number [0..5] |
void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length) |
{ |
if (number > 5) number = 5; |
eeprom_write_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * number], length); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], number); // diesen Parametersatz als aktuell merken |
} |
unsigned char GetActiveParamSetNumber(void) |
{ |
return(eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET])); |
} |
//############################################################################ |
//Hauptprogramm |
int main (void) |
//############################################################################ |
{ |
unsigned int timer; |
unsigned int timer2 = 0; |
DDRC = 0x01; // SCL |
PORTC = 0xff; // Pullup SDA |
DDRB = 0x1B; // LEDs und Druckoffset |
PORTB = 0x01; // LED_Rot |
DDRD = 0x3E; // Speaker & TXD & J3 J4 J5 |
DDRD |=0x80; // J7 |
PORTD = 0xF7; // LED |
MCUSR &=~(1<<WDRF); |
WDTCSR |= (1<<WDCE)|(1<<WDE); |
WDTCSR = 0; |
beeptime = 2000; |
StickGier = 0; PPM_in[K_GAS] = 0;StickRoll = 0; StickNick = 0; |
ROT_OFF; |
Timer_Init(); |
UART_Init(); |
rc_sum_init(); |
ADC_Init(); |
i2c_init(); |
sei(); |
VersionInfo.Hauptversion = VERSION_HAUPTVERSION; |
VersionInfo.Nebenversion = VERSION_NEBENVERSION; |
VersionInfo.PCKompatibel = VERSION_KOMPATIBEL; |
printf("\n\rFlightControl V%d.%d ", VERSION_HAUPTVERSION, VERSION_NEBENVERSION); |
printf("\n\r=============================="); |
GRN_ON; |
if(eeprom_read_byte(&EEPromArray[EEPROM_ADR_VALID]) != 59) // seit V 0.60 |
{ |
printf("\n\rInit. EEPROM: Generiere Default-Parameter..."); |
DefaultKonstanten1(); |
for (unsigned char i=0;i<6;i++) |
{ |
if(i==2) DefaultKonstanten2(); |
WriteParameterSet(i, (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
} |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], 1); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_VALID], 59); |
} |
ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
printf("\n\rBenutze Parametersatz %d", GetActiveParamSetNumber()); |
if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
printf("\n\rAbgleich Luftdrucksensor.."); |
timer = SetDelay(2500); |
SucheLuftruckOffset(); |
while (!CheckDelay(timer)); |
printf("OK\n\r"); |
} |
SetNeutral(); |
ROT_OFF; |
beeptime = 2000; |
DebugIn.Analog[1] = 1000; |
DebugIn.Digital[0] = 0x55; |
printf("\n\rSteuerung: "); |
if (EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) printf("HeadingHold"); |
else printf("Neutral"); |
printf("\n\n\r"); |
LcdClear(); |
while (1) |
{ |
if (UpdateMotor) // ReglerIntervall |
{ |
UpdateMotor=0; |
MotorRegler(); |
SendMotorData(); |
ROT_OFF; |
if(PcZugriff) PcZugriff--; |
if(SenderOkay) SenderOkay--; |
if (UBat < EE_Parameter.UnterspannungsWarnung) |
{ |
beeptime = 2000; |
} |
if(!Timeout) |
{ |
i2c_init(); |
} |
else |
{ |
ROT_OFF; |
} |
} |
if(SIO_DEBUG) |
{ |
DatenUebertragung(); |
BearbeiteRxDaten(); |
} |
else BearbeiteRxDaten(); |
if(CheckDelay(timer2)) |
{ |
if(MotorenEin) PORTC ^= 0x10; else PORTC &= ~0x10; |
timer = SetDelay(500); |
} |
} |
return (1); |
} |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/main.d |
---|
0,0 → 1,2 |
main.o main.d : main.c main.h old_macros.h _Settings.h printf_P.h timer0.h uart.h \ |
analog.h twimaster.h menu.h rc.h fc.h gps.h |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/main.h |
---|
0,0 → 1,98 |
#ifndef _MAIN_H |
#define _MAIN_H |
//Hier die Quarz Frequenz einstellen |
#if defined (__AVR_ATmega32__) |
#define SYSCLK 20000000L //Quarz Frequenz in Hz |
#endif |
#if defined (__AVR_ATmega644__) |
#define SYSCLK 20000000L //Quarz Frequenz in Hz |
//#define SYSCLK 16000000L //Quarz Frequenz in Hz |
#endif |
// neue Hardware |
#define ROT_OFF PORTB &=~0x01 |
#define ROT_ON PORTB |= 0x01 |
#define ROT_FLASH PORTB ^= 0x01 |
#define GRN_OFF PORTB &=~0x02 |
#define GRN_ON PORTB |= 0x02 |
#define GRN_FLASH PORTB ^= 0x02 //ACHTUNG: HIER SCHIEN NOCH EIN FEHLER IM AUSGEWÄHLTEN PORT ZU BESTEHEN. URSPRÜNGLICH WAR PORTD UND NICHT PORTB DEFINIERT // (280807Kr) |
#define LED1_OFF PORTC &=~0x04 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED1_ON PORTC |= 0x04 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED1_FLASH PORTC ^= 0x04 //Erweiterung by 4ndreas aus mikrosvn branches // (280807Kr) |
#define LED2_OFF PORTC &=~0x08 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED2_ON PORTC |= 0x08 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED2_FLASH PORTC ^= 0x08 //Erweiterung by 4ndreas aus mikrosvn branches // (280807Kr) |
//#ifndef F_CPU |
//#error ################## F_CPU nicht definiert oder ungültig ############# |
//#endif |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//#define ANZ_MITTELWERT 4 |
#define EEPROM_ADR_VALID 1 |
#define EEPROM_ADR_ACTIVE_SET 2 |
#define EEPROM_ADR_PARAM_BEGIN 100 |
#define CFG_HOEHENREGELUNG 0x01 |
#define CFG_HOEHEN_SCHALTER 0x02 |
#define CFG_HEADING_HOLD 0x04 |
#define CFG_KOMPASS_AKTIV 0x08 |
#define CFG_KOMPASS_FIX 0x10 |
#define CFG_GPS_AKTIV 0x20 |
//#define SYSCLK |
//extern unsigned long SYSCLK; |
extern volatile int i_Nick[20],i_Roll[20],DiffNick,DiffRoll; |
extern volatile unsigned char SenderOkay; |
extern unsigned char CosinusNickWinkel, CosinusRollWinkel; |
extern void ReadParameterSet (unsigned char number, unsigned char *buffer, unsigned char length); |
extern void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length); |
extern unsigned char GetActiveParamSetNumber(void); |
extern unsigned char EEPromArray[]; |
long durchschnitt_northing; |
long durchschnitt_easting; |
volatile int P_GPS_Verstaerkung; //P-Anteil (80-120) |
volatile int D_GPS_Verstaerkung; //D-Anteil (90) |
#include <stdlib.h> |
#include <string.h> |
#include <avr/io.h> |
#include <avr/pgmspace.h> |
#include <avr/interrupt.h> |
#include <avr/eeprom.h> |
#include <avr/boot.h> |
#include <avr/wdt.h> |
#include "old_macros.h" |
#include "_Settings.h" |
#include "printf_P.h" |
#include "timer0.h" |
#include "uart.h" |
#include "analog.h" |
#include "twimaster.h" |
#include "menu.h" |
#include "rc.h" |
#include "fc.h" |
#include "gps.h" |
#ifndef EEMEM |
#define EEMEM __attribute__ ((section (".eeprom"))) |
#endif |
#define DEBUG_DISPLAY_INTERVALL 123 // in ms |
#define DELAY_US(x) ((unsigned int)( (x) * 1e-6 * F_CPU )) |
#endif //_MAIN_H |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/main.lst |
---|
0,0 → 1,590 |
1 .file "main.c" |
2 .arch atmega644 |
3 __SREG__ = 0x3f |
4 __SP_H__ = 0x3e |
5 __SP_L__ = 0x3d |
6 __tmp_reg__ = 0 |
7 __zero_reg__ = 1 |
8 .global __do_copy_data |
9 .global __do_clear_bss |
10 .text |
11 .global GetActiveParamSetNumber |
13 GetActiveParamSetNumber: |
14 /* prologue: frame size=0 */ |
15 /* prologue end (size=0) */ |
16 0000 A0E0 ldi r26,lo8(EEPromArray+2) |
17 0002 B0E0 ldi r27,hi8(EEPromArray+2) |
18 /* #APP */ |
19 0004 0E94 0000 call __eeprom_read_byte_1F2021 |
20 0008 802D mov r24,__tmp_reg__ |
21 /* #NOAPP */ |
22 000a 9927 clr r25 |
23 /* epilogue: frame size=0 */ |
24 000c 0895 ret |
25 /* epilogue end (size=1) */ |
26 /* function GetActiveParamSetNumber size 8 (7) */ |
28 .global WriteParameterSet |
30 WriteParameterSet: |
31 /* prologue: frame size=0 */ |
32 /* prologue end (size=0) */ |
33 000e FB01 movw r30,r22 |
34 0010 282F mov r18,r24 |
35 0012 8630 cpi r24,lo8(6) |
36 0014 00F0 brlo .L4 |
37 0016 25E0 ldi r18,lo8(5) |
38 .L4: |
39 0018 842F mov r24,r20 |
40 001a 9927 clr r25 |
41 001c 429F mul r20,r18 |
42 001e D001 movw r26,r0 |
43 0020 1124 clr r1 |
44 0022 A050 subi r26,lo8(-(EEPromArray+100)) |
45 0024 B040 sbci r27,hi8(-(EEPromArray+100)) |
46 /* #APP */ |
47 .26_start: |
48 0026 0197 sbiw r24,1 |
49 0028 04F0 brlt .26_finished |
50 002a 0190 ld __tmp_reg__,z+ |
51 002c 0E94 0000 call __eeprom_write_byte_1F2021 |
52 0030 00C0 rjmp .26_start |
53 .26_finished: |
54 /* #NOAPP */ |
55 0032 A0E0 ldi r26,lo8(EEPromArray+2) |
56 0034 B0E0 ldi r27,hi8(EEPromArray+2) |
57 /* #APP */ |
58 0036 022E mov __tmp_reg__,r18 |
59 0038 0E94 0000 call __eeprom_write_byte_1F2021 |
60 /* #NOAPP */ |
61 /* epilogue: frame size=0 */ |
62 003c 0895 ret |
63 /* epilogue end (size=1) */ |
64 /* function WriteParameterSet size 33 (32) */ |
66 .global ReadParameterSet |
68 ReadParameterSet: |
69 /* prologue: frame size=0 */ |
70 003e CF93 push r28 |
71 0040 DF93 push r29 |
72 /* prologue end (size=2) */ |
73 0042 FB01 movw r30,r22 |
74 0044 C42F mov r28,r20 |
75 0046 DD27 clr r29 |
76 0048 8630 cpi r24,lo8(6) |
77 004a 00F0 brlo .L7 |
78 004c 85E0 ldi r24,lo8(5) |
79 .L7: |
80 004e 489F mul r20,r24 |
81 0050 D001 movw r26,r0 |
82 0052 1124 clr r1 |
83 0054 A050 subi r26,lo8(-(EEPromArray+100)) |
84 0056 B040 sbci r27,hi8(-(EEPromArray+100)) |
85 /* #APP */ |
86 .44_start: |
87 0058 2197 sbiw r28,1 |
88 005a 04F0 brlt .44_finished |
89 005c 0E94 0000 call __eeprom_read_byte_1F2021 |
90 0060 0192 st z+,__tmp_reg__ |
91 0062 00C0 rjmp .44_start |
92 .44_finished: |
93 /* #NOAPP */ |
94 /* epilogue: frame size=0 */ |
95 0064 DF91 pop r29 |
96 0066 CF91 pop r28 |
97 0068 0895 ret |
98 /* epilogue end (size=3) */ |
99 /* function ReadParameterSet size 30 (25) */ |
101 .global main |
103 main: |
104 /* prologue: frame size=0 */ |
105 006a 0F93 push r16 |
106 006c 1F93 push r17 |
107 006e CF93 push r28 |
108 0070 DF93 push r29 |
109 /* prologue end (size=4) */ |
110 0072 91E0 ldi r25,lo8(1) |
111 0074 97B9 out 39-0x20,r25 |
112 0076 8FEF ldi r24,lo8(-1) |
113 0078 88B9 out 40-0x20,r24 |
114 007a 8BE1 ldi r24,lo8(27) |
115 007c 84B9 out 36-0x20,r24 |
116 007e 95B9 out 37-0x20,r25 |
117 0080 8EE3 ldi r24,lo8(62) |
118 0082 8AB9 out 42-0x20,r24 |
119 0084 579A sbi 42-0x20,7 |
120 0086 87EF ldi r24,lo8(-9) |
121 0088 8BB9 out 43-0x20,r24 |
122 008a 84B7 in r24,84-0x20 |
123 008c 877F andi r24,lo8(-9) |
124 008e 84BF out 84-0x20,r24 |
125 0090 8091 6000 lds r24,96 |
126 0094 8861 ori r24,lo8(24) |
127 0096 8093 6000 sts 96,r24 |
128 009a 1092 6000 sts 96,__zero_reg__ |
129 009e 80ED ldi r24,lo8(2000) |
130 00a0 97E0 ldi r25,hi8(2000) |
131 00a2 9093 0000 sts (beeptime)+1,r25 |
132 00a6 8093 0000 sts beeptime,r24 |
133 00aa 1092 0000 sts (StickGier)+1,__zero_reg__ |
134 00ae 1092 0000 sts StickGier,__zero_reg__ |
135 00b2 1092 0000 sts (PPM_in+4)+1,__zero_reg__ |
136 00b6 1092 0000 sts PPM_in+4,__zero_reg__ |
137 00ba 1092 0000 sts (StickRoll)+1,__zero_reg__ |
138 00be 1092 0000 sts StickRoll,__zero_reg__ |
139 00c2 1092 0000 sts (StickNick)+1,__zero_reg__ |
140 00c6 1092 0000 sts StickNick,__zero_reg__ |
141 00ca 2898 cbi 37-0x20,0 |
142 00cc 0E94 0000 call Timer_Init |
143 00d0 0E94 0000 call UART_Init |
144 00d4 0E94 0000 call rc_sum_init |
145 00d8 0E94 0000 call ADC_Init |
146 00dc 0E94 0000 call i2c_init |
147 /* #APP */ |
148 00e0 7894 sei |
149 /* #NOAPP */ |
150 00e2 1092 0000 sts VersionInfo,__zero_reg__ |
151 00e6 8DE3 ldi r24,lo8(61) |
152 00e8 8093 0000 sts VersionInfo+1,r24 |
153 00ec 84E0 ldi r24,lo8(4) |
154 00ee 8093 0000 sts VersionInfo+2,r24 |
155 00f2 8DE3 ldi r24,lo8(61) |
156 00f4 90E0 ldi r25,hi8(61) |
157 00f6 9F93 push r25 |
158 00f8 8F93 push r24 |
159 00fa 1F92 push __zero_reg__ |
160 00fc 1F92 push __zero_reg__ |
161 00fe 80E0 ldi r24,lo8(__c.2027) |
162 0100 90E0 ldi r25,hi8(__c.2027) |
163 0102 9F93 push r25 |
164 0104 8F93 push r24 |
165 0106 1F92 push __zero_reg__ |
166 0108 0E94 0000 call _printf_P |
167 010c 80E0 ldi r24,lo8(__c.2029) |
168 010e 90E0 ldi r25,hi8(__c.2029) |
169 0110 9F93 push r25 |
170 0112 8F93 push r24 |
171 0114 1F92 push __zero_reg__ |
172 0116 0E94 0000 call _printf_P |
173 011a 299A sbi 37-0x20,1 |
174 011c A0E0 ldi r26,lo8(EEPromArray+1) |
175 011e B0E0 ldi r27,hi8(EEPromArray+1) |
176 /* #APP */ |
177 0120 0E94 0000 call __eeprom_read_byte_1F2021 |
178 0124 802D mov r24,__tmp_reg__ |
179 /* #NOAPP */ |
180 0126 2DB7 in r18,__SP_L__ |
181 0128 3EB7 in r19,__SP_H__ |
182 012a 265F subi r18,lo8(-(10)) |
183 012c 3F4F sbci r19,hi8(-(10)) |
184 012e 0FB6 in __tmp_reg__,__SREG__ |
185 0130 F894 cli |
186 0132 3EBF out __SP_H__,r19 |
187 0134 0FBE out __SREG__,__tmp_reg__ |
188 0136 2DBF out __SP_L__,r18 |
189 0138 8B33 cpi r24,lo8(59) |
190 013a 01F0 breq .L10 |
191 013c 80E0 ldi r24,lo8(__c.2031) |
192 013e 90E0 ldi r25,hi8(__c.2031) |
193 0140 9F93 push r25 |
194 0142 8F93 push r24 |
195 0144 1F92 push __zero_reg__ |
196 0146 0E94 0000 call _printf_P |
197 014a 0E94 0000 call DefaultKonstanten1 |
198 014e 4AE3 ldi r20,lo8(58) |
199 0150 60E0 ldi r22,lo8(EE_Parameter) |
200 0152 70E0 ldi r23,hi8(EE_Parameter) |
201 0154 80E0 ldi r24,lo8(0) |
202 0156 0E94 0000 call WriteParameterSet |
203 015a 01E0 ldi r16,lo8(1) |
204 015c 0F90 pop __tmp_reg__ |
205 015e 0F90 pop __tmp_reg__ |
206 0160 0F90 pop __tmp_reg__ |
207 .L12: |
208 0162 0230 cpi r16,lo8(2) |
209 0164 01F4 brne .L13 |
210 0166 0E94 0000 call DefaultKonstanten2 |
211 016a 4AE3 ldi r20,lo8(58) |
212 016c 60E0 ldi r22,lo8(EE_Parameter) |
213 016e 70E0 ldi r23,hi8(EE_Parameter) |
214 0170 82E0 ldi r24,lo8(2) |
215 0172 0E94 0000 call WriteParameterSet |
216 0176 03E0 ldi r16,lo8(3) |
217 .L13: |
218 0178 4AE3 ldi r20,lo8(58) |
219 017a 60E0 ldi r22,lo8(EE_Parameter) |
220 017c 70E0 ldi r23,hi8(EE_Parameter) |
221 017e 802F mov r24,r16 |
222 0180 0E94 0000 call WriteParameterSet |
223 0184 0F5F subi r16,lo8(-(1)) |
224 0186 0630 cpi r16,lo8(6) |
225 0188 00F0 brlo .L12 |
226 018a 81E0 ldi r24,lo8(1) |
227 018c 20E0 ldi r18,lo8(EEPromArray+2) |
228 018e 30E0 ldi r19,hi8(EEPromArray+2) |
229 0190 D901 movw r26,r18 |
230 /* #APP */ |
231 0192 082E mov __tmp_reg__,r24 |
232 0194 0E94 0000 call __eeprom_write_byte_1F2021 |
233 /* #NOAPP */ |
234 0198 8BE3 ldi r24,lo8(59) |
235 019a 2150 subi r18,lo8(-(-1)) |
236 019c 3040 sbci r19,hi8(-(-1)) |
237 019e D901 movw r26,r18 |
238 /* #APP */ |
239 01a0 082E mov __tmp_reg__,r24 |
240 01a2 0E94 0000 call __eeprom_write_byte_1F2021 |
241 /* #NOAPP */ |
242 .L10: |
243 01a6 00E0 ldi r16,lo8(EEPromArray+2) |
244 01a8 10E0 ldi r17,hi8(EEPromArray+2) |
245 01aa D801 movw r26,r16 |
246 /* #APP */ |
247 01ac 0E94 0000 call __eeprom_read_byte_1F2021 |
248 01b0 802D mov r24,__tmp_reg__ |
249 /* #NOAPP */ |
250 01b2 4AE3 ldi r20,lo8(58) |
251 01b4 60E0 ldi r22,lo8(EE_Parameter) |
252 01b6 70E0 ldi r23,hi8(EE_Parameter) |
253 01b8 0E94 0000 call ReadParameterSet |
254 01bc D801 movw r26,r16 |
255 /* #APP */ |
256 01be 0E94 0000 call __eeprom_read_byte_1F2021 |
257 01c2 802D mov r24,__tmp_reg__ |
258 /* #NOAPP */ |
259 01c4 9927 clr r25 |
260 01c6 9F93 push r25 |
261 01c8 8F93 push r24 |
262 01ca 80E0 ldi r24,lo8(__c.2037) |
263 01cc 90E0 ldi r25,hi8(__c.2037) |
264 01ce 9F93 push r25 |
265 01d0 8F93 push r24 |
266 01d2 1F92 push __zero_reg__ |
267 01d4 0E94 0000 call _printf_P |
268 01d8 8091 0000 lds r24,EE_Parameter+8 |
269 01dc 0F90 pop __tmp_reg__ |
270 01de 0F90 pop __tmp_reg__ |
271 01e0 0F90 pop __tmp_reg__ |
272 01e2 0F90 pop __tmp_reg__ |
273 01e4 0F90 pop __tmp_reg__ |
274 01e6 80FF sbrs r24,0 |
275 01e8 00C0 rjmp .L16 |
276 01ea 80E0 ldi r24,lo8(__c.2039) |
277 01ec 90E0 ldi r25,hi8(__c.2039) |
278 01ee 9F93 push r25 |
279 01f0 8F93 push r24 |
280 01f2 1F92 push __zero_reg__ |
281 01f4 0E94 0000 call _printf_P |
282 01f8 84EC ldi r24,lo8(2500) |
283 01fa 99E0 ldi r25,hi8(2500) |
284 01fc 0E94 0000 call SetDelay |
285 0200 EC01 movw r28,r24 |
286 0202 0E94 0000 call SucheLuftruckOffset |
287 0206 0F90 pop __tmp_reg__ |
288 0208 0F90 pop __tmp_reg__ |
289 020a 0F90 pop __tmp_reg__ |
290 .L18: |
291 020c CE01 movw r24,r28 |
292 020e 0E94 0000 call CheckDelay |
293 0212 8823 tst r24 |
294 0214 01F0 breq .L18 |
295 0216 80E0 ldi r24,lo8(__c.2044) |
296 0218 90E0 ldi r25,hi8(__c.2044) |
297 021a 9F93 push r25 |
298 021c 8F93 push r24 |
299 021e 1F92 push __zero_reg__ |
300 0220 0E94 0000 call _printf_P |
301 0224 0F90 pop __tmp_reg__ |
302 0226 0F90 pop __tmp_reg__ |
303 0228 0F90 pop __tmp_reg__ |
304 .L16: |
305 022a 0E94 0000 call SetNeutral |
306 022e 2898 cbi 37-0x20,0 |
307 0230 80ED ldi r24,lo8(2000) |
308 0232 97E0 ldi r25,hi8(2000) |
309 0234 9093 0000 sts (beeptime)+1,r25 |
310 0238 8093 0000 sts beeptime,r24 |
311 023c 88EE ldi r24,lo8(1000) |
312 023e 93E0 ldi r25,hi8(1000) |
313 0240 9093 0000 sts (DebugIn+5)+1,r25 |
314 0244 8093 0000 sts DebugIn+5,r24 |
315 0248 85E5 ldi r24,lo8(85) |
316 024a 8093 0000 sts DebugIn,r24 |
317 024e 80E0 ldi r24,lo8(__c.2046) |
318 0250 90E0 ldi r25,hi8(__c.2046) |
319 0252 9F93 push r25 |
320 0254 8F93 push r24 |
321 0256 1F92 push __zero_reg__ |
322 0258 0E94 0000 call _printf_P |
323 025c 8091 0000 lds r24,EE_Parameter+8 |
324 0260 0F90 pop __tmp_reg__ |
325 0262 0F90 pop __tmp_reg__ |
326 0264 0F90 pop __tmp_reg__ |
327 0266 82FF sbrs r24,2 |
328 0268 00C0 rjmp .L20 |
329 026a 80E0 ldi r24,lo8(__c.2048) |
330 026c 90E0 ldi r25,hi8(__c.2048) |
331 026e 00C0 rjmp .L48 |
332 .L20: |
333 0270 80E0 ldi r24,lo8(__c.2050) |
334 0272 90E0 ldi r25,hi8(__c.2050) |
335 .L48: |
336 0274 9F93 push r25 |
337 0276 8F93 push r24 |
338 0278 1F92 push __zero_reg__ |
339 027a 0E94 0000 call _printf_P |
340 027e 0F90 pop __tmp_reg__ |
341 0280 0F90 pop __tmp_reg__ |
342 0282 0F90 pop __tmp_reg__ |
343 0284 80E0 ldi r24,lo8(__c.2052) |
344 0286 90E0 ldi r25,hi8(__c.2052) |
345 0288 9F93 push r25 |
346 028a 8F93 push r24 |
347 028c 1F92 push __zero_reg__ |
348 028e 0E94 0000 call _printf_P |
349 0292 0E94 0000 call LcdClear |
350 0296 0F90 pop __tmp_reg__ |
351 0298 0F90 pop __tmp_reg__ |
352 029a 0F90 pop __tmp_reg__ |
353 .L49: |
354 029c 8091 0000 lds r24,UpdateMotor |
355 02a0 8823 tst r24 |
356 02a2 01F0 breq .L24 |
357 02a4 1092 0000 sts UpdateMotor,__zero_reg__ |
358 02a8 0E94 0000 call MotorRegler |
359 02ac 0E94 0000 call SendMotorData |
360 02b0 2898 cbi 37-0x20,0 |
361 02b2 8091 0000 lds r24,PcZugriff |
362 02b6 8823 tst r24 |
363 02b8 01F0 breq .L26 |
364 02ba 8150 subi r24,lo8(-(-1)) |
365 02bc 8093 0000 sts PcZugriff,r24 |
366 .L26: |
367 02c0 8091 0000 lds r24,SenderOkay |
368 02c4 8823 tst r24 |
369 02c6 01F0 breq .L28 |
370 02c8 8091 0000 lds r24,SenderOkay |
371 02cc 8150 subi r24,lo8(-(-1)) |
372 02ce 8093 0000 sts SenderOkay,r24 |
373 .L28: |
374 02d2 2091 0000 lds r18,UBat |
375 02d6 3091 0000 lds r19,(UBat)+1 |
376 02da 8091 0000 lds r24,EE_Parameter+24 |
377 02de 9927 clr r25 |
378 02e0 2817 cp r18,r24 |
379 02e2 3907 cpc r19,r25 |
380 02e4 04F4 brge .L30 |
381 02e6 80ED ldi r24,lo8(2000) |
382 02e8 97E0 ldi r25,hi8(2000) |
383 02ea 9093 0000 sts (beeptime)+1,r25 |
384 02ee 8093 0000 sts beeptime,r24 |
385 .L30: |
386 02f2 8091 0000 lds r24,Timeout |
387 02f6 8823 tst r24 |
388 02f8 01F4 brne .L32 |
389 02fa 0E94 0000 call i2c_init |
390 02fe 00C0 rjmp .L24 |
391 .L32: |
392 0300 2898 cbi 37-0x20,0 |
393 .L24: |
394 0302 0E94 0000 call DatenUebertragung |
395 0306 0E94 0000 call BearbeiteRxDaten |
396 030a 80E0 ldi r24,lo8(0) |
397 030c 90E0 ldi r25,hi8(0) |
398 030e 0E94 0000 call CheckDelay |
399 0312 8823 tst r24 |
400 0314 01F0 breq .L49 |
401 0316 8091 0000 lds r24,MotorenEin |
402 031a 8823 tst r24 |
403 031c 01F0 breq .L35 |
404 031e 88B1 in r24,40-0x20 |
405 0320 90E1 ldi r25,lo8(16) |
406 0322 8927 eor r24,r25 |
407 0324 88B9 out 40-0x20,r24 |
408 0326 00C0 rjmp .L37 |
409 .L35: |
410 0328 4498 cbi 40-0x20,4 |
411 .L37: |
412 032a 84EF ldi r24,lo8(500) |
413 032c 91E0 ldi r25,hi8(500) |
414 032e 0E94 0000 call SetDelay |
415 0332 00C0 rjmp .L49 |
416 /* epilogue: frame size=0 */ |
417 /* epilogue: noreturn */ |
418 /* epilogue end (size=0) */ |
419 /* function main size 363 (359) */ |
421 .section .progmem.data,"a",@progbits |
424 __c.2052: |
425 0000 0A0A 0D00 .string "\n\n\r" |
428 __c.2050: |
429 0004 4E65 7574 .string "Neutral" |
429 7261 6C00 |
432 __c.2048: |
433 000c 4865 6164 .string "HeadingHold" |
433 696E 6748 |
433 6F6C 6400 |
436 __c.2046: |
437 0018 0A0D 5374 .string "\n\rSteuerung: " |
437 6575 6572 |
437 756E 673A |
437 2000 |
440 __c.2044: |
441 0026 4F4B 0A0D .string "OK\n\r" |
441 00 |
444 __c.2039: |
445 002b 0A0D 4162 .string "\n\rAbgleich Luftdrucksensor.." |
445 676C 6569 |
445 6368 204C |
445 7566 7464 |
445 7275 636B |
448 __c.2037: |
449 0048 0A0D 4265 .string "\n\rBenutze Parametersatz %d" |
449 6E75 747A |
449 6520 5061 |
449 7261 6D65 |
449 7465 7273 |
452 __c.2031: |
453 0063 0A0D 496E .string "\n\rInit. EEPROM: Generiere Default-Parameter..." |
453 6974 2E20 |
453 4545 5052 |
453 4F4D 3A20 |
453 4765 6E65 |
456 __c.2029: |
457 0092 0A0D 3D3D .string "\n\r==============================" |
457 3D3D 3D3D |
457 3D3D 3D3D |
457 3D3D 3D3D |
457 3D3D 3D3D |
460 __c.2027: |
461 00b3 0A0D 466C .string "\n\rFlightControl V%d.%d " |
461 6967 6874 |
461 436F 6E74 |
461 726F 6C20 |
461 5625 642E |
462 .comm DiffNick,2,1 |
463 .comm DiffRoll,2,1 |
464 .comm SenderOkay,1,1 |
465 .comm CosinusNickWinkel,1,1 |
466 .comm CosinusRollWinkel,1,1 |
467 .global EEPromArray |
468 .section .eeprom,"aw",@progbits |
471 EEPromArray: |
472 0000 0000 0000 .skip 2048,0 |
472 0000 0000 |
472 0000 0000 |
472 0000 0000 |
472 0000 0000 |
473 .comm durchschnitt_northing,4,1 |
474 .comm durchschnitt_easting,4,1 |
475 .comm P_GPS_Verstaerkung,2,1 |
476 .comm D_GPS_Verstaerkung,2,1 |
477 .comm RemoteTasten,1,1 |
478 .comm Timeout,1,1 |
479 .comm IntegralNick,4,1 |
480 .comm IntegralNick2,4,1 |
481 .comm IntegralRoll,4,1 |
482 .comm IntegralRoll2,4,1 |
483 .comm Mess_IntegralNick,4,1 |
484 .comm Mess_IntegralNick2,4,1 |
485 .comm Mess_IntegralRoll,4,1 |
486 .comm Mess_IntegralRoll2,4,1 |
487 .comm Integral_Gier,4,1 |
488 .comm Mess_Integral_Gier,4,1 |
489 .comm h,1,1 |
490 .comm m,1,1 |
491 .comm s,1,1 |
492 .comm Motor_Vorne,1,1 |
493 .comm Motor_Hinten,1,1 |
494 .comm Motor_Rechts,1,1 |
495 .comm Motor_Links,1,1 |
496 .comm Count,1,1 |
497 .comm MotorWert,5,1 |
498 /* File "main.c": code 434 = 0x01b2 ( 423), prologues 6, epilogues 5 */ |
DEFINED SYMBOLS |
*ABS*:00000000 main.c |
C:\DOKUME~1\none\LOKALE~1\Temp/ccrfGXyQ.s:3 *ABS*:0000003f __SREG__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccrfGXyQ.s:4 *ABS*:0000003e __SP_H__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccrfGXyQ.s:5 *ABS*:0000003d __SP_L__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccrfGXyQ.s:6 *ABS*:00000000 __tmp_reg__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccrfGXyQ.s:7 *ABS*:00000001 __zero_reg__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccrfGXyQ.s:13 .text:00000000 GetActiveParamSetNumber |
C:\DOKUME~1\none\LOKALE~1\Temp/ccrfGXyQ.s:471 .eeprom:00000000 EEPromArray |
C:\DOKUME~1\none\LOKALE~1\Temp/ccrfGXyQ.s:30 .text:0000000e WriteParameterSet |
C:\DOKUME~1\none\LOKALE~1\Temp/ccrfGXyQ.s:47 .text:00000026 .26_start |
C:\DOKUME~1\none\LOKALE~1\Temp/ccrfGXyQ.s:53 .text:00000032 .26_finished |
C:\DOKUME~1\none\LOKALE~1\Temp/ccrfGXyQ.s:68 .text:0000003e ReadParameterSet |
C:\DOKUME~1\none\LOKALE~1\Temp/ccrfGXyQ.s:86 .text:00000058 .44_start |
C:\DOKUME~1\none\LOKALE~1\Temp/ccrfGXyQ.s:92 .text:00000064 .44_finished |
C:\DOKUME~1\none\LOKALE~1\Temp/ccrfGXyQ.s:103 .text:0000006a main |
C:\DOKUME~1\none\LOKALE~1\Temp/ccrfGXyQ.s:460 .progmem.data:000000b3 __c.2027 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccrfGXyQ.s:456 .progmem.data:00000092 __c.2029 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccrfGXyQ.s:452 .progmem.data:00000063 __c.2031 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccrfGXyQ.s:448 .progmem.data:00000048 __c.2037 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccrfGXyQ.s:444 .progmem.data:0000002b __c.2039 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccrfGXyQ.s:440 .progmem.data:00000026 __c.2044 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccrfGXyQ.s:436 .progmem.data:00000018 __c.2046 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccrfGXyQ.s:432 .progmem.data:0000000c __c.2048 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccrfGXyQ.s:428 .progmem.data:00000004 __c.2050 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccrfGXyQ.s:424 .progmem.data:00000000 __c.2052 |
*COM*:00000001 SenderOkay |
*COM*:00000001 Timeout |
*COM*:00000002 DiffNick |
*COM*:00000002 DiffRoll |
*COM*:00000001 CosinusNickWinkel |
*COM*:00000001 CosinusRollWinkel |
*COM*:00000004 durchschnitt_northing |
*COM*:00000004 durchschnitt_easting |
*COM*:00000002 P_GPS_Verstaerkung |
*COM*:00000002 D_GPS_Verstaerkung |
*COM*:00000001 RemoteTasten |
*COM*:00000004 IntegralNick |
*COM*:00000004 IntegralNick2 |
*COM*:00000004 IntegralRoll |
*COM*:00000004 IntegralRoll2 |
*COM*:00000004 Mess_IntegralNick |
*COM*:00000004 Mess_IntegralNick2 |
*COM*:00000004 Mess_IntegralRoll |
*COM*:00000004 Mess_IntegralRoll2 |
*COM*:00000004 Integral_Gier |
*COM*:00000004 Mess_Integral_Gier |
*COM*:00000001 h |
*COM*:00000001 m |
*COM*:00000001 s |
*COM*:00000001 Motor_Vorne |
*COM*:00000001 Motor_Hinten |
*COM*:00000001 Motor_Rechts |
*COM*:00000001 Motor_Links |
*COM*:00000001 Count |
*COM*:00000005 MotorWert |
UNDEFINED SYMBOLS |
__do_copy_data |
__do_clear_bss |
__eeprom_read_byte_1F2021 |
__eeprom_write_byte_1F2021 |
beeptime |
StickGier |
PPM_in |
StickRoll |
StickNick |
Timer_Init |
UART_Init |
rc_sum_init |
ADC_Init |
i2c_init |
VersionInfo |
_printf_P |
DefaultKonstanten1 |
EE_Parameter |
DefaultKonstanten2 |
SetDelay |
SucheLuftruckOffset |
CheckDelay |
SetNeutral |
DebugIn |
LcdClear |
UpdateMotor |
MotorRegler |
SendMotorData |
PcZugriff |
UBat |
DatenUebertragung |
BearbeiteRxDaten |
MotorenEin |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/makefile |
---|
0,0 → 1,391 |
#-------------------------------------------------------------------- |
# MCU name |
MCU = atmega644 |
F_CPU = 20000000 |
#------------------------------------------------------------------- |
HAUPT_VERSION = 0 |
NEBEN_VERSION = 61 |
VERSION_KOMPATIBEL = 4 # PC-Kompatibilität |
#------------------------------------------------------------------- |
ifeq ($(MCU), atmega32) |
# FUSE_SETTINGS= -u -U lfuse:w:0xff:m -U hfuse:w:0xcf:m |
HEX_NAME = MEGA32 |
endif |
ifeq ($(MCU), atmega644) |
FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
#FUSE_SETTINGS = -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
# -u bei neuen Controllern wieder einspielen |
HEX_NAME = MEGA644 |
endif |
ifeq ($(F_CPU), 16000000) |
QUARZ = 16MHZ |
endif |
ifeq ($(F_CPU), 20000000) |
QUARZ = 20MHZ |
endif |
# Output format. (can be srec, ihex, binary) |
FORMAT = ihex |
# Target file name (without extension). |
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION) |
# Optimization level, can be [0, 1, 2, 3, s]. 0 turns off optimization. |
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.) |
OPT = s |
########################################################################################################## |
# List C source files here. (C dependencies are automatically generated.) |
SRC = main.c uart.c printf_P.c timer0.c analog.c menu.c |
SRC += twimaster.c rc.c fc.c GPS.c |
########################################################################################################## |
# List Assembler source files here. |
# Make them always end in a capital .S. Files ending in a lowercase .s |
# will not be considered source files but generated files (assembler |
# output from the compiler), and will be deleted upon "make clean"! |
# Even though the DOS/Win* filesystem matches both .s and .S the same, |
# it will preserve the spelling of the filenames, and gcc itself does |
# care about how the name is spelled on its command-line. |
ASRC = |
# List any extra directories to look for include files here. |
# Each directory must be seperated by a space. |
EXTRAINCDIRS = |
# Optional compiler flags. |
# -g: generate debugging information (for GDB, or for COFF conversion) |
# -O*: optimization level |
# -f...: tuning, see gcc manual and avr-libc documentation |
# -Wall...: warning level |
# -Wa,...: tell GCC to pass this to the assembler. |
# -ahlms: create assembler listing |
CFLAGS = -O$(OPT) \ |
-funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums \ |
-Wall -Wstrict-prototypes \ |
-Wa,-adhlns=$(<:.c=.lst) \ |
$(patsubst %,-I%,$(EXTRAINCDIRS)) |
# Set a "language standard" compiler flag. |
# Unremark just one line below to set the language standard to use. |
# gnu99 = C99 + GNU extensions. See GCC manual for more information. |
#CFLAGS += -std=c89 |
#CFLAGS += -std=gnu89 |
#CFLAGS += -std=c99 |
CFLAGS += -std=gnu99 |
CFLAGS += -DVERSION_HAUPTVERSION=$(HAUPT_VERSION) -DVERSION_NEBENVERSION=$(NEBEN_VERSION) -DVERSION_KOMPATIBEL=$(VERSION_KOMPATIBEL) |
# Optional assembler flags. |
# -Wa,...: tell GCC to pass this to the assembler. |
# -ahlms: create listing |
# -gstabs: have the assembler create line number information; note that |
# for use in COFF files, additional information about filenames |
# and function names needs to be present in the assembler source |
# files -- see avr-libc docs [FIXME: not yet described there] |
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs |
# Optional linker flags. |
# -Wl,...: tell GCC to pass this to linker. |
# -Map: create map file |
# --cref: add cross reference to map file |
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref |
# Additional libraries |
# Minimalistic printf version |
#LDFLAGS += -Wl,-u,vfprintf -lprintf_min |
# Floating point printf version (requires -lm below) |
#LDFLAGS += -Wl,-u,vfprintf -lprintf_flt |
# -lm = math library |
LDFLAGS += -lm |
##LDFLAGS += -T./linkerfile/avr5.x |
# Programming support using avrdude. Settings and variables. |
# Programming hardware: alf avr910 avrisp bascom bsd |
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500 |
# |
# Type: avrdude -c ? |
# to get a full listing. |
# |
#AVRDUDE_PROGRAMMER = stk200 |
AVRDUDE_PROGRAMMER = dt006 |
#AVRDUDE_PROGRAMMER = ponyser |
#falls Ponyser ausgewählt wird, muss sich unsere avrdude-Configdatei im Bin-Verzeichnis des Compilers befinden |
#AVRDUDE_PORT = com1 # programmer connected to serial device |
AVRDUDE_PORT = lpt1 # programmer connected to parallel port |
#AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex |
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex $(FUSE_SETTINGS) |
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep |
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) |
# Uncomment the following if you want avrdude's erase cycle counter. |
# Note that this counter needs to be initialized first using -Yn, |
# see avrdude manual. |
#AVRDUDE_ERASE += -y |
# Uncomment the following if you do /not/ wish a verification to be |
# performed after programming the device. |
AVRDUDE_FLAGS += -V |
# Increase verbosity level. Please use this when submitting bug |
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> |
# to submit bug reports. |
#AVRDUDE_FLAGS += -v -v |
# --------------------------------------------------------------------------- |
# Define directories, if needed. |
DIRAVR = c:/winavr |
DIRAVRBIN = $(DIRAVR)/bin |
DIRAVRUTILS = $(DIRAVR)/utils/bin |
DIRINC = . |
DIRLIB = $(DIRAVR)/avr/lib |
# Define programs and commands. |
SHELL = sh |
CC = avr-gcc |
OBJCOPY = avr-objcopy |
OBJDUMP = avr-objdump |
SIZE = avr-size |
# Programming support using avrdude. |
AVRDUDE = avrdude |
REMOVE = rm -f |
COPY = cp |
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex |
ELFSIZE = $(SIZE) -A $(TARGET).elf |
# Define Messages |
# English |
MSG_ERRORS_NONE = Errors: none |
MSG_BEGIN = -------- begin -------- |
MSG_END = -------- end -------- |
MSG_SIZE_BEFORE = Size before: |
MSG_SIZE_AFTER = Size after: |
MSG_COFF = Converting to AVR COFF: |
MSG_EXTENDED_COFF = Converting to AVR Extended COFF: |
MSG_FLASH = Creating load file for Flash: |
MSG_EEPROM = Creating load file for EEPROM: |
MSG_EXTENDED_LISTING = Creating Extended Listing: |
MSG_SYMBOL_TABLE = Creating Symbol Table: |
MSG_LINKING = Linking: |
MSG_COMPILING = Compiling: |
MSG_ASSEMBLING = Assembling: |
MSG_CLEANING = Cleaning project: |
# Define all object files. |
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o) |
# Define all listing files. |
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst) |
# Combine all necessary flags and optional flags. |
# Add target processor to flags. |
#ALL_CFLAGS = -mmcu=$(MCU) -DF_CPU=$(F_CPU) -I. $(CFLAGS) |
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) |
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) |
# Default target. |
all: begin gccversion sizebefore $(TARGET).elf $(TARGET).hex $(TARGET).eep \ |
$(TARGET).lss $(TARGET).sym sizeafter finished end |
# Eye candy. |
# AVR Studio 3.x does not check make's exit code but relies on |
# the following magic strings to be generated by the compile job. |
begin: |
@echo |
@echo $(MSG_BEGIN) |
finished: |
@echo $(MSG_ERRORS_NONE) |
end: |
@echo $(MSG_END) |
@echo |
# Display size of file. |
sizebefore: |
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi |
sizeafter: |
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi |
# Display compiler version information. |
gccversion : |
@$(CC) --version |
# Convert ELF to COFF for use in debugging / simulating in |
# AVR Studio or VMLAB. |
COFFCONVERT=$(OBJCOPY) --debugging \ |
--change-section-address .data-0x800000 \ |
--change-section-address .bss-0x800000 \ |
--change-section-address .noinit-0x800000 \ |
--change-section-address .eeprom-0x810000 |
coff: $(TARGET).elf |
@echo |
@echo $(MSG_COFF) $(TARGET).cof |
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof |
extcoff: $(TARGET).elf |
@echo |
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof |
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof |
# Program the device. |
program: $(TARGET).hex $(TARGET).eep |
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) |
# Create final output files (.hex, .eep) from ELF output file. |
%.hex: %.elf |
@echo |
@echo $(MSG_FLASH) $@ |
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ |
%.eep: %.elf |
@echo |
@echo $(MSG_EEPROM) $@ |
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ |
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@ |
# Create extended listing file from ELF output file. |
%.lss: %.elf |
@echo |
@echo $(MSG_EXTENDED_LISTING) $@ |
$(OBJDUMP) -h -S $< > $@ |
# Create a symbol table from ELF output file. |
%.sym: %.elf |
@echo |
@echo $(MSG_SYMBOL_TABLE) $@ |
avr-nm -n $< > $@ |
# Link: create ELF output file from object files. |
.SECONDARY : $(TARGET).elf |
.PRECIOUS : $(OBJ) |
%.elf: $(OBJ) |
@echo |
@echo $(MSG_LINKING) $@ |
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS) |
# Compile: create object files from C source files. |
%.o : %.c |
@echo |
@echo $(MSG_COMPILING) $< |
$(CC) -c $(ALL_CFLAGS) $< -o $@ |
# Compile: create assembler files from C source files. |
%.s : %.c |
$(CC) -S $(ALL_CFLAGS) $< -o $@ |
# Assemble: create object files from assembler source files. |
%.o : %.S |
@echo |
@echo $(MSG_ASSEMBLING) $< |
$(CC) -c $(ALL_ASFLAGS) $< -o $@ |
# Target: clean project. |
clean: begin clean_list finished end |
clean_list : |
@echo |
@echo $(MSG_CLEANING) |
# $(REMOVE) $(TARGET).hex |
$(REMOVE) $(TARGET).eep |
$(REMOVE) $(TARGET).obj |
$(REMOVE) $(TARGET).cof |
$(REMOVE) $(TARGET).elf |
$(REMOVE) $(TARGET).map |
$(REMOVE) $(TARGET).obj |
$(REMOVE) $(TARGET).a90 |
$(REMOVE) $(TARGET).sym |
$(REMOVE) $(TARGET).lnk |
$(REMOVE) $(TARGET).lss |
$(REMOVE) $(OBJ) |
$(REMOVE) $(LST) |
$(REMOVE) $(SRC:.c=.s) |
$(REMOVE) $(SRC:.c=.d) |
# Automatically generate C source code dependencies. |
# (Code originally taken from the GNU make user manual and modified |
# (See README.txt Credits).) |
# |
# Note that this will work with sh (bash) and sed that is shipped with WinAVR |
# (see the SHELL variable defined above). |
# This may not work with other shells or other seds. |
# |
%.d: %.c |
set -e; $(CC) -MM $(ALL_CFLAGS) $< \ |
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > $@; \ |
[ -s $@ ] || rm -f $@ |
# Remove the '-' if you want to see the dependency files generated. |
-include $(SRC:.c=.d) |
# Listing of phony targets. |
.PHONY : all begin finish end sizebefore sizeafter gccversion coff extcoff \ |
clean clean_list program |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/menu.c |
---|
0,0 → 1,118 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
unsigned int TestInt = 0; |
#define ARRAYGROESSE 10 |
unsigned char Array[ARRAYGROESSE] = {1,2,3,4,5,6,7,8,9,10}; |
char DisplayBuff[80] = "Hallo Welt"; |
unsigned char DispPtr = 0; |
unsigned char RemoteTasten = 0; |
#define KEY1 0x01 |
#define KEY2 0x02 |
#define KEY3 0x04 |
#define KEY4 0x08 |
#define KEY5 0x10 |
void LcdClear(void) |
{ |
unsigned char i; |
for(i=0;i<80;i++) DisplayBuff[i] = ' '; |
} |
void Menu(void) |
{ |
static unsigned char MaxMenue = 10,MenuePunkt=0; |
if(RemoteTasten & KEY1) { if(MenuePunkt) MenuePunkt--; else MenuePunkt = MaxMenue; LcdClear(); } |
if(RemoteTasten & KEY2) { MenuePunkt++; LcdClear(); } |
if((RemoteTasten & KEY1) && (RemoteTasten & KEY2)) MenuePunkt = 0; |
LCD_printfxy(17,0,"[%i]",MenuePunkt); |
switch(MenuePunkt) |
{ |
case 0: |
LCD_printfxy(0,0,"++ MikroKopter ++"); |
LCD_printfxy(0,1,"V%d.%d",VERSION_HAUPTVERSION, VERSION_NEBENVERSION); |
LCD_printfxy(0,2,"Setting: %d ",GetActiveParamSetNumber()); |
LCD_printfxy(0,3,"(c) Holger Buss"); |
// if(RemoteTasten & KEY3) TestInt--; |
// if(RemoteTasten & KEY4) TestInt++; |
break; |
case 1: |
if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
LCD_printfxy(0,0,"Hoehe: %5i",HoehenWert); |
LCD_printfxy(0,1,"SollHoehe: %5i",SollHoehe); |
LCD_printfxy(0,2,"Luftdruck: %5i",MessLuftdruck); |
LCD_printfxy(0,3,"Off : %5i",DruckOffsetSetting); |
} |
else |
{ |
LCD_printfxy(0,1,"Keine "); |
LCD_printfxy(0,2,"Höhenregelung"); |
} |
break; |
case 2: |
LCD_printfxy(0,0,"akt. Lage"); |
LCD_printfxy(0,1,"Nick: %5i",IntegralNick/1024); |
LCD_printfxy(0,2,"Roll: %5i",IntegralRoll/1024); |
LCD_printfxy(0,3,"Kompass: %5i",KompassValue); |
break; |
case 3: |
LCD_printfxy(0,0,"K1:%4i K2:%4i ",PPM_in[1],PPM_in[2]); |
LCD_printfxy(0,1,"K3:%4i K4:%4i ",PPM_in[3],PPM_in[4]); |
LCD_printfxy(0,2,"K5:%4i K6:%4i ",PPM_in[5],PPM_in[6]); |
LCD_printfxy(0,3,"K7:%4i K8:%4i ",PPM_in[7],PPM_in[8]); |
break; |
case 4: |
LCD_printfxy(0,0,"Ni:%4i Ro:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_NICK]],PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]); |
LCD_printfxy(0,1,"Gs:%4i Gi:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_GAS]],PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]); |
LCD_printfxy(0,2,"P1:%4i P2:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]],PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]]); |
LCD_printfxy(0,3,"P3:%4i P4:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]],PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]]); |
break; |
case 5: |
LCD_printfxy(0,0,"Gyro - Sensor"); |
LCD_printfxy(0,1,"Nick %4i (%3i)",AccumulateNick / MessanzahlNick, AdNeutralNick); |
LCD_printfxy(0,2,"Roll %4i (%3i)",AccumulateRoll / MessanzahlRoll, AdNeutralRoll); |
LCD_printfxy(0,3,"Gier %4i (%3i)",AccumulateGier / MessanzahlGier, AdNeutralGier); |
break; |
case 6: |
LCD_printfxy(0,0,"ACC - Sensor"); |
LCD_printfxy(0,1,"Nick %4i (%3i)",accumulate_AccNick / messanzahl_AccNick,NeutralAccX); |
LCD_printfxy(0,2,"Roll %4i (%3i)",accumulate_AccRoll / messanzahl_AccRoll,NeutralAccY); |
LCD_printfxy(0,3,"Hoch %4i (%3i)",Aktuell_az/*accumulate_AccHoch / messanzahl_AccHoch*/,(int)NeutralAccZ); |
break; |
case 7: |
LCD_printfxy(0,1,"Spannung: %5i",UBat); |
LCD_printfxy(0,2,"Empf.Pegel:%5i",SenderOkay); |
break; |
case 8: |
LCD_printfxy(0,0,"Kompass "); |
LCD_printfxy(0,1,"Richtung: %5i",KompassRichtung); |
LCD_printfxy(0,2,"Messwert: %5i",KompassValue); |
LCD_printfxy(0,3,"Start: %5i",KompassStartwert); |
break; |
case 9: |
LCD_printfxy(0,0,"Po1: %3i Po5: %3i" ,Poti1,Poti5); |
LCD_printfxy(0,1,"Po2: %3i Po6: %3i" ,Poti2,Poti6); |
LCD_printfxy(0,2,"Po3: %3i Po7: %3i" ,Poti3,Poti7); |
LCD_printfxy(0,3,"Po4: %3i Po8: %3i" ,Poti4,Poti8); |
break; |
case 10: |
LCD_printfxy(0,0,"Servo " ); |
LCD_printfxy(0,1,"Setpoint %3i",Parameter_ServoNickControl); |
LCD_printfxy(0,2,"Stellung: %3i",ServoValue); |
LCD_printfxy(0,3,"Range:%3i-%3i",EE_Parameter.ServoNickMin,EE_Parameter.ServoNickMax); |
break; |
default: MaxMenue = MenuePunkt - 1; |
MenuePunkt = 0; |
break; |
} |
RemoteTasten = 0; |
} |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/menu.d |
---|
0,0 → 1,2 |
menu.o menu.d : menu.c main.h old_macros.h _Settings.h printf_P.h timer0.h uart.h \ |
analog.h twimaster.h menu.h rc.h fc.h gps.h |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/menu.h |
---|
0,0 → 1,7 |
void Menu(void); |
void LcdClear(void); |
extern char DisplayBuff[80]; |
extern unsigned char DispPtr; |
unsigned char RemoteTasten; |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/menu.lst |
---|
0,0 → 1,1283 |
1 .file "menu.c" |
2 .arch atmega644 |
3 __SREG__ = 0x3f |
4 __SP_H__ = 0x3e |
5 __SP_L__ = 0x3d |
6 __tmp_reg__ = 0 |
7 __zero_reg__ = 1 |
8 .global __do_copy_data |
9 .global __do_clear_bss |
10 .text |
11 .global LcdClear |
13 LcdClear: |
14 /* prologue: frame size=0 */ |
15 /* prologue end (size=0) */ |
16 0000 E0E0 ldi r30,lo8(DisplayBuff) |
17 0002 F0E0 ldi r31,hi8(DisplayBuff) |
18 0004 80E2 ldi r24,lo8(32) |
19 .L2: |
20 0006 8193 st Z+,r24 |
21 0008 90E0 ldi r25,hi8(DisplayBuff+80) |
22 000a E030 cpi r30,lo8(DisplayBuff+80) |
23 000c F907 cpc r31,r25 |
24 000e 01F4 brne .L2 |
25 /* epilogue: frame size=0 */ |
26 0010 0895 ret |
27 /* epilogue end (size=1) */ |
28 /* function LcdClear size 9 (8) */ |
30 .global Menu |
32 Menu: |
33 /* prologue: frame size=0 */ |
34 0012 FF92 push r15 |
35 0014 0F93 push r16 |
36 0016 1F93 push r17 |
37 /* prologue end (size=3) */ |
38 0018 8091 0000 lds r24,RemoteTasten |
39 001c 282F mov r18,r24 |
40 001e 3327 clr r19 |
41 0020 C901 movw r24,r18 |
42 0022 8170 andi r24,lo8(1) |
43 0024 9070 andi r25,hi8(1) |
44 0026 682F mov r22,r24 |
45 0028 8823 tst r24 |
46 002a 01F0 breq .L8 |
47 002c 8091 0000 lds r24,MenuePunkt.2007 |
48 0030 8823 tst r24 |
49 0032 01F0 breq .L10 |
50 0034 8150 subi r24,lo8(-(-1)) |
51 0036 00C0 rjmp .L41 |
52 .L10: |
53 0038 8091 0000 lds r24,MaxMenue.2006 |
54 .L41: |
55 003c 8093 0000 sts MenuePunkt.2007,r24 |
56 0040 E0E0 ldi r30,lo8(DisplayBuff) |
57 0042 F0E0 ldi r31,hi8(DisplayBuff) |
58 0044 80E2 ldi r24,lo8(32) |
59 .L13: |
60 0046 8193 st Z+,r24 |
61 0048 90E0 ldi r25,hi8(DisplayBuff+80) |
62 004a E030 cpi r30,lo8(DisplayBuff+80) |
63 004c F907 cpc r31,r25 |
64 004e 01F4 brne .L13 |
65 .L8: |
66 0050 A901 movw r20,r18 |
67 0052 4270 andi r20,lo8(2) |
68 0054 5070 andi r21,hi8(2) |
69 0056 21FF sbrs r18,1 |
70 0058 00C0 rjmp .L14 |
71 005a 8091 0000 lds r24,MenuePunkt.2007 |
72 005e 8F5F subi r24,lo8(-(1)) |
73 0060 8093 0000 sts MenuePunkt.2007,r24 |
74 0064 E0E0 ldi r30,lo8(DisplayBuff) |
75 0066 F0E0 ldi r31,hi8(DisplayBuff) |
76 0068 80E2 ldi r24,lo8(32) |
77 .L16: |
78 006a 8193 st Z+,r24 |
79 006c 90E0 ldi r25,hi8(DisplayBuff+80) |
80 006e E030 cpi r30,lo8(DisplayBuff+80) |
81 0070 F907 cpc r31,r25 |
82 0072 01F4 brne .L16 |
83 .L14: |
84 0074 6623 tst r22 |
85 0076 01F0 breq .L17 |
86 0078 452B or r20,r21 |
87 007a 01F0 breq .L17 |
88 007c 1092 0000 sts MenuePunkt.2007,__zero_reg__ |
89 .L17: |
90 0080 81E1 ldi r24,lo8(17) |
91 0082 8093 0000 sts DispPtr,r24 |
92 0086 8091 0000 lds r24,MenuePunkt.2007 |
93 008a 9927 clr r25 |
94 008c 9F93 push r25 |
95 008e 8F93 push r24 |
96 0090 80E0 ldi r24,lo8(__c.2008) |
97 0092 90E0 ldi r25,hi8(__c.2008) |
98 0094 9F93 push r25 |
99 0096 8F93 push r24 |
100 0098 11E0 ldi r17,lo8(1) |
101 009a F12E mov r15,r17 |
102 009c FF92 push r15 |
103 009e 0E94 0000 call _printf_P |
104 00a2 0091 0000 lds r16,MenuePunkt.2007 |
105 00a6 0F90 pop __tmp_reg__ |
106 00a8 0F90 pop __tmp_reg__ |
107 00aa 0F90 pop __tmp_reg__ |
108 00ac 0F90 pop __tmp_reg__ |
109 00ae 0F90 pop __tmp_reg__ |
110 00b0 0530 cpi r16,lo8(5) |
111 00b2 01F4 brne .+2 |
112 00b4 00C0 rjmp .L26 |
113 00b6 0630 cpi r16,lo8(6) |
114 00b8 00F4 brsh .L32 |
115 00ba 0230 cpi r16,lo8(2) |
116 00bc 01F4 brne .+2 |
117 00be 00C0 rjmp .L23 |
118 00c0 0330 cpi r16,lo8(3) |
119 00c2 00F4 brsh .L33 |
120 00c4 0023 tst r16 |
121 00c6 01F0 breq .L21 |
122 00c8 0130 cpi r16,lo8(1) |
123 00ca 01F0 breq .+2 |
124 00cc 00C0 rjmp .L20 |
125 00ce 00C0 rjmp .L22 |
126 .L33: |
127 00d0 0330 cpi r16,lo8(3) |
128 00d2 01F4 brne .+2 |
129 00d4 00C0 rjmp .L24 |
130 00d6 0430 cpi r16,lo8(4) |
131 00d8 01F0 breq .+2 |
132 00da 00C0 rjmp .L20 |
133 00dc 00C0 rjmp .L25 |
134 .L32: |
135 00de 0830 cpi r16,lo8(8) |
136 00e0 01F4 brne .+2 |
137 00e2 00C0 rjmp .L29 |
138 00e4 0930 cpi r16,lo8(9) |
139 00e6 00F4 brsh .L34 |
140 00e8 0630 cpi r16,lo8(6) |
141 00ea 01F4 brne .+2 |
142 00ec 00C0 rjmp .L27 |
143 00ee 0730 cpi r16,lo8(7) |
144 00f0 01F0 breq .+2 |
145 00f2 00C0 rjmp .L20 |
146 00f4 00C0 rjmp .L28 |
147 .L34: |
148 00f6 0930 cpi r16,lo8(9) |
149 00f8 01F4 brne .+2 |
150 00fa 00C0 rjmp .L30 |
151 00fc 0A30 cpi r16,lo8(10) |
152 00fe 01F0 breq .+2 |
153 0100 00C0 rjmp .L20 |
154 0102 00C0 rjmp .L31 |
155 .L21: |
156 0104 1092 0000 sts DispPtr,__zero_reg__ |
157 0108 80E0 ldi r24,lo8(__c.2011) |
158 010a 90E0 ldi r25,hi8(__c.2011) |
159 010c 9F93 push r25 |
160 010e 8F93 push r24 |
161 0110 FF92 push r15 |
162 0112 0E94 0000 call _printf_P |
163 0116 84E1 ldi r24,lo8(20) |
164 0118 8093 0000 sts DispPtr,r24 |
165 011c 8DE3 ldi r24,lo8(61) |
166 011e 90E0 ldi r25,hi8(61) |
167 0120 9F93 push r25 |
168 0122 8F93 push r24 |
169 0124 1F92 push __zero_reg__ |
170 0126 1F92 push __zero_reg__ |
171 0128 80E0 ldi r24,lo8(__c.2013) |
172 012a 90E0 ldi r25,hi8(__c.2013) |
173 012c 9F93 push r25 |
174 012e 8F93 push r24 |
175 0130 FF92 push r15 |
176 0132 0E94 0000 call _printf_P |
177 0136 88E2 ldi r24,lo8(40) |
178 0138 8093 0000 sts DispPtr,r24 |
179 013c 0E94 0000 call GetActiveParamSetNumber |
180 0140 9927 clr r25 |
181 0142 9F93 push r25 |
182 0144 8F93 push r24 |
183 0146 80E0 ldi r24,lo8(__c.2015) |
184 0148 90E0 ldi r25,hi8(__c.2015) |
185 014a 9F93 push r25 |
186 014c 8F93 push r24 |
187 014e FF92 push r15 |
188 0150 0E94 0000 call _printf_P |
189 0154 8CE3 ldi r24,lo8(60) |
190 0156 8093 0000 sts DispPtr,r24 |
191 015a 80E0 ldi r24,lo8(__c.2017) |
192 015c 90E0 ldi r25,hi8(__c.2017) |
193 015e 9F93 push r25 |
194 0160 8F93 push r24 |
195 0162 FF92 push r15 |
196 0164 0E94 0000 call _printf_P |
197 0168 00C0 rjmp .L43 |
198 .L22: |
199 016a 8091 0000 lds r24,EE_Parameter+8 |
200 016e 80FF sbrs r24,0 |
201 0170 00C0 rjmp .L36 |
202 0172 1092 0000 sts DispPtr,__zero_reg__ |
203 0176 8091 0000 lds r24,HoehenWert |
204 017a 9091 0000 lds r25,(HoehenWert)+1 |
205 017e 9F93 push r25 |
206 0180 8F93 push r24 |
207 0182 80E0 ldi r24,lo8(__c.2021) |
208 0184 90E0 ldi r25,hi8(__c.2021) |
209 0186 9F93 push r25 |
210 0188 8F93 push r24 |
211 018a 0F93 push r16 |
212 018c 0E94 0000 call _printf_P |
213 0190 84E1 ldi r24,lo8(20) |
214 0192 8093 0000 sts DispPtr,r24 |
215 0196 8091 0000 lds r24,SollHoehe |
216 019a 9091 0000 lds r25,(SollHoehe)+1 |
217 019e 9F93 push r25 |
218 01a0 8F93 push r24 |
219 01a2 80E0 ldi r24,lo8(__c.2023) |
220 01a4 90E0 ldi r25,hi8(__c.2023) |
221 01a6 9F93 push r25 |
222 01a8 8F93 push r24 |
223 01aa 0F93 push r16 |
224 01ac 0E94 0000 call _printf_P |
225 01b0 88E2 ldi r24,lo8(40) |
226 01b2 8093 0000 sts DispPtr,r24 |
227 01b6 8091 0000 lds r24,MessLuftdruck |
228 01ba 9091 0000 lds r25,(MessLuftdruck)+1 |
229 01be 9F93 push r25 |
230 01c0 8F93 push r24 |
231 01c2 80E0 ldi r24,lo8(__c.2025) |
232 01c4 90E0 ldi r25,hi8(__c.2025) |
233 01c6 9F93 push r25 |
234 01c8 8F93 push r24 |
235 01ca 0F93 push r16 |
236 01cc 0E94 0000 call _printf_P |
237 01d0 8CE3 ldi r24,lo8(60) |
238 01d2 8093 0000 sts DispPtr,r24 |
239 01d6 8091 0000 lds r24,DruckOffsetSetting |
240 01da 9927 clr r25 |
241 01dc 9F93 push r25 |
242 01de 8F93 push r24 |
243 01e0 80E0 ldi r24,lo8(__c.2027) |
244 01e2 90E0 ldi r25,hi8(__c.2027) |
245 01e4 9F93 push r25 |
246 01e6 8F93 push r24 |
247 01e8 0F93 push r16 |
248 01ea 0E94 0000 call _printf_P |
249 .L44: |
250 01ee 8DB7 in r24,__SP_L__ |
251 01f0 9EB7 in r25,__SP_H__ |
252 01f2 4496 adiw r24,20 |
253 .L42: |
254 01f4 0FB6 in __tmp_reg__,__SREG__ |
255 01f6 F894 cli |
256 01f8 9EBF out __SP_H__,r25 |
257 01fa 0FBE out __SREG__,__tmp_reg__ |
258 01fc 8DBF out __SP_L__,r24 |
259 01fe 00C0 rjmp .L35 |
260 .L36: |
261 0200 84E1 ldi r24,lo8(20) |
262 0202 8093 0000 sts DispPtr,r24 |
263 0206 80E0 ldi r24,lo8(__c.2029) |
264 0208 90E0 ldi r25,hi8(__c.2029) |
265 020a 9F93 push r25 |
266 020c 8F93 push r24 |
267 020e 0F93 push r16 |
268 0210 0E94 0000 call _printf_P |
269 0214 88E2 ldi r24,lo8(40) |
270 0216 8093 0000 sts DispPtr,r24 |
271 021a 80E0 ldi r24,lo8(__c.2031) |
272 021c 90E0 ldi r25,hi8(__c.2031) |
273 021e 9F93 push r25 |
274 0220 8F93 push r24 |
275 0222 0F93 push r16 |
276 0224 0E94 0000 call _printf_P |
277 0228 8DB7 in r24,__SP_L__ |
278 022a 9EB7 in r25,__SP_H__ |
279 022c 0696 adiw r24,6 |
280 022e 00C0 rjmp .L42 |
281 .L23: |
282 0230 1092 0000 sts DispPtr,__zero_reg__ |
283 0234 80E0 ldi r24,lo8(__c.2034) |
284 0236 90E0 ldi r25,hi8(__c.2034) |
285 0238 9F93 push r25 |
286 023a 8F93 push r24 |
287 023c FF92 push r15 |
288 023e 0E94 0000 call _printf_P |
289 0242 84E1 ldi r24,lo8(20) |
290 0244 8093 0000 sts DispPtr,r24 |
291 0248 6091 0000 lds r22,IntegralNick |
292 024c 7091 0000 lds r23,(IntegralNick)+1 |
293 0250 8091 0000 lds r24,(IntegralNick)+2 |
294 0254 9091 0000 lds r25,(IntegralNick)+3 |
295 0258 20E0 ldi r18,lo8(1024) |
296 025a 34E0 ldi r19,hi8(1024) |
297 025c 40E0 ldi r20,hlo8(1024) |
298 025e 50E0 ldi r21,hhi8(1024) |
299 0260 0E94 0000 call __divmodsi4 |
300 0264 5F93 push r21 |
301 0266 4F93 push r20 |
302 0268 3F93 push r19 |
303 026a 2F93 push r18 |
304 026c 80E0 ldi r24,lo8(__c.2036) |
305 026e 90E0 ldi r25,hi8(__c.2036) |
306 0270 9F93 push r25 |
307 0272 8F93 push r24 |
308 0274 FF92 push r15 |
309 0276 0E94 0000 call _printf_P |
310 027a 88E2 ldi r24,lo8(40) |
311 027c 8093 0000 sts DispPtr,r24 |
312 0280 6091 0000 lds r22,IntegralRoll |
313 0284 7091 0000 lds r23,(IntegralRoll)+1 |
314 0288 8091 0000 lds r24,(IntegralRoll)+2 |
315 028c 9091 0000 lds r25,(IntegralRoll)+3 |
316 0290 20E0 ldi r18,lo8(1024) |
317 0292 34E0 ldi r19,hi8(1024) |
318 0294 40E0 ldi r20,hlo8(1024) |
319 0296 50E0 ldi r21,hhi8(1024) |
320 0298 0E94 0000 call __divmodsi4 |
321 029c 5F93 push r21 |
322 029e 4F93 push r20 |
323 02a0 3F93 push r19 |
324 02a2 2F93 push r18 |
325 02a4 80E0 ldi r24,lo8(__c.2038) |
326 02a6 90E0 ldi r25,hi8(__c.2038) |
327 02a8 9F93 push r25 |
328 02aa 8F93 push r24 |
329 02ac FF92 push r15 |
330 02ae 0E94 0000 call _printf_P |
331 02b2 8CE3 ldi r24,lo8(60) |
332 02b4 8093 0000 sts DispPtr,r24 |
333 02b8 8091 0000 lds r24,KompassValue |
334 02bc 9091 0000 lds r25,(KompassValue)+1 |
335 02c0 9F93 push r25 |
336 02c2 8F93 push r24 |
337 02c4 80E0 ldi r24,lo8(__c.2040) |
338 02c6 90E0 ldi r25,hi8(__c.2040) |
339 02c8 9F93 push r25 |
340 02ca 8F93 push r24 |
341 02cc FF92 push r15 |
342 02ce 0E94 0000 call _printf_P |
343 02d2 8DB7 in r24,__SP_L__ |
344 02d4 9EB7 in r25,__SP_H__ |
345 02d6 4696 adiw r24,22 |
346 02d8 00C0 rjmp .L42 |
347 .L24: |
348 02da 1092 0000 sts DispPtr,__zero_reg__ |
349 02de 8091 0000 lds r24,PPM_in+4 |
350 02e2 9091 0000 lds r25,(PPM_in+4)+1 |
351 02e6 2091 0000 lds r18,PPM_in+2 |
352 02ea 3091 0000 lds r19,(PPM_in+2)+1 |
353 02ee 9F93 push r25 |
354 02f0 8F93 push r24 |
355 02f2 3F93 push r19 |
356 02f4 2F93 push r18 |
357 02f6 80E0 ldi r24,lo8(__c.2043) |
358 02f8 90E0 ldi r25,hi8(__c.2043) |
359 02fa 9F93 push r25 |
360 02fc 8F93 push r24 |
361 02fe FF92 push r15 |
362 0300 0E94 0000 call _printf_P |
363 0304 84E1 ldi r24,lo8(20) |
364 0306 8093 0000 sts DispPtr,r24 |
365 030a 8091 0000 lds r24,PPM_in+8 |
366 030e 9091 0000 lds r25,(PPM_in+8)+1 |
367 0312 2091 0000 lds r18,PPM_in+6 |
368 0316 3091 0000 lds r19,(PPM_in+6)+1 |
369 031a 9F93 push r25 |
370 031c 8F93 push r24 |
371 031e 3F93 push r19 |
372 0320 2F93 push r18 |
373 0322 80E0 ldi r24,lo8(__c.2045) |
374 0324 90E0 ldi r25,hi8(__c.2045) |
375 0326 9F93 push r25 |
376 0328 8F93 push r24 |
377 032a FF92 push r15 |
378 032c 0E94 0000 call _printf_P |
379 0330 88E2 ldi r24,lo8(40) |
380 0332 8093 0000 sts DispPtr,r24 |
381 0336 8091 0000 lds r24,PPM_in+12 |
382 033a 9091 0000 lds r25,(PPM_in+12)+1 |
383 033e 2091 0000 lds r18,PPM_in+10 |
384 0342 3091 0000 lds r19,(PPM_in+10)+1 |
385 0346 9F93 push r25 |
386 0348 8F93 push r24 |
387 034a 3F93 push r19 |
388 034c 2F93 push r18 |
389 034e 80E0 ldi r24,lo8(__c.2047) |
390 0350 90E0 ldi r25,hi8(__c.2047) |
391 0352 9F93 push r25 |
392 0354 8F93 push r24 |
393 0356 FF92 push r15 |
394 0358 0E94 0000 call _printf_P |
395 035c 8CE3 ldi r24,lo8(60) |
396 035e 8093 0000 sts DispPtr,r24 |
397 0362 8091 0000 lds r24,PPM_in+16 |
398 0366 9091 0000 lds r25,(PPM_in+16)+1 |
399 036a 2091 0000 lds r18,PPM_in+14 |
400 036e 3091 0000 lds r19,(PPM_in+14)+1 |
401 0372 9F93 push r25 |
402 0374 8F93 push r24 |
403 0376 3F93 push r19 |
404 0378 2F93 push r18 |
405 037a 80E0 ldi r24,lo8(__c.2049) |
406 037c 90E0 ldi r25,hi8(__c.2049) |
407 037e 00C0 rjmp .L46 |
408 .L25: |
409 0380 1092 0000 sts DispPtr,__zero_reg__ |
410 0384 E091 0000 lds r30,EE_Parameter+1 |
411 0388 FF27 clr r31 |
412 038a EE0F lsl r30 |
413 038c FF1F rol r31 |
414 038e E050 subi r30,lo8(-(PPM_in)) |
415 0390 F040 sbci r31,hi8(-(PPM_in)) |
416 0392 2081 ld r18,Z |
417 0394 3181 ldd r19,Z+1 |
418 0396 E091 0000 lds r30,EE_Parameter |
419 039a FF27 clr r31 |
420 039c EE0F lsl r30 |
421 039e FF1F rol r31 |
422 03a0 E050 subi r30,lo8(-(PPM_in)) |
423 03a2 F040 sbci r31,hi8(-(PPM_in)) |
424 03a4 8081 ld r24,Z |
425 03a6 9181 ldd r25,Z+1 |
426 03a8 3F93 push r19 |
427 03aa 2F93 push r18 |
428 03ac 9F93 push r25 |
429 03ae 8F93 push r24 |
430 03b0 80E0 ldi r24,lo8(__c.2052) |
431 03b2 90E0 ldi r25,hi8(__c.2052) |
432 03b4 9F93 push r25 |
433 03b6 8F93 push r24 |
434 03b8 FF92 push r15 |
435 03ba 0E94 0000 call _printf_P |
436 03be 84E1 ldi r24,lo8(20) |
437 03c0 8093 0000 sts DispPtr,r24 |
438 03c4 E091 0000 lds r30,EE_Parameter+3 |
439 03c8 FF27 clr r31 |
440 03ca EE0F lsl r30 |
441 03cc FF1F rol r31 |
442 03ce E050 subi r30,lo8(-(PPM_in)) |
443 03d0 F040 sbci r31,hi8(-(PPM_in)) |
444 03d2 2081 ld r18,Z |
445 03d4 3181 ldd r19,Z+1 |
446 03d6 E091 0000 lds r30,EE_Parameter+2 |
447 03da FF27 clr r31 |
448 03dc EE0F lsl r30 |
449 03de FF1F rol r31 |
450 03e0 E050 subi r30,lo8(-(PPM_in)) |
451 03e2 F040 sbci r31,hi8(-(PPM_in)) |
452 03e4 8081 ld r24,Z |
453 03e6 9181 ldd r25,Z+1 |
454 03e8 3F93 push r19 |
455 03ea 2F93 push r18 |
456 03ec 9F93 push r25 |
457 03ee 8F93 push r24 |
458 03f0 80E0 ldi r24,lo8(__c.2054) |
459 03f2 90E0 ldi r25,hi8(__c.2054) |
460 03f4 9F93 push r25 |
461 03f6 8F93 push r24 |
462 03f8 FF92 push r15 |
463 03fa 0E94 0000 call _printf_P |
464 03fe 88E2 ldi r24,lo8(40) |
465 0400 8093 0000 sts DispPtr,r24 |
466 0404 E091 0000 lds r30,EE_Parameter+5 |
467 0408 FF27 clr r31 |
468 040a EE0F lsl r30 |
469 040c FF1F rol r31 |
470 040e E050 subi r30,lo8(-(PPM_in)) |
471 0410 F040 sbci r31,hi8(-(PPM_in)) |
472 0412 2081 ld r18,Z |
473 0414 3181 ldd r19,Z+1 |
474 0416 E091 0000 lds r30,EE_Parameter+4 |
475 041a FF27 clr r31 |
476 041c EE0F lsl r30 |
477 041e FF1F rol r31 |
478 0420 E050 subi r30,lo8(-(PPM_in)) |
479 0422 F040 sbci r31,hi8(-(PPM_in)) |
480 0424 8081 ld r24,Z |
481 0426 9181 ldd r25,Z+1 |
482 0428 3F93 push r19 |
483 042a 2F93 push r18 |
484 042c 9F93 push r25 |
485 042e 8F93 push r24 |
486 0430 80E0 ldi r24,lo8(__c.2056) |
487 0432 90E0 ldi r25,hi8(__c.2056) |
488 0434 9F93 push r25 |
489 0436 8F93 push r24 |
490 0438 FF92 push r15 |
491 043a 0E94 0000 call _printf_P |
492 043e 8CE3 ldi r24,lo8(60) |
493 0440 8093 0000 sts DispPtr,r24 |
494 0444 E091 0000 lds r30,EE_Parameter+7 |
495 0448 FF27 clr r31 |
496 044a EE0F lsl r30 |
497 044c FF1F rol r31 |
498 044e E050 subi r30,lo8(-(PPM_in)) |
499 0450 F040 sbci r31,hi8(-(PPM_in)) |
500 0452 2081 ld r18,Z |
501 0454 3181 ldd r19,Z+1 |
502 0456 E091 0000 lds r30,EE_Parameter+6 |
503 045a FF27 clr r31 |
504 045c EE0F lsl r30 |
505 045e FF1F rol r31 |
506 0460 E050 subi r30,lo8(-(PPM_in)) |
507 0462 F040 sbci r31,hi8(-(PPM_in)) |
508 0464 8081 ld r24,Z |
509 0466 9181 ldd r25,Z+1 |
510 0468 3F93 push r19 |
511 046a 2F93 push r18 |
512 046c 9F93 push r25 |
513 046e 8F93 push r24 |
514 0470 80E0 ldi r24,lo8(__c.2058) |
515 0472 90E0 ldi r25,hi8(__c.2058) |
516 0474 00C0 rjmp .L46 |
517 .L26: |
518 0476 1092 0000 sts DispPtr,__zero_reg__ |
519 047a 80E0 ldi r24,lo8(__c.2061) |
520 047c 90E0 ldi r25,hi8(__c.2061) |
521 047e 9F93 push r25 |
522 0480 8F93 push r24 |
523 0482 FF92 push r15 |
524 0484 0E94 0000 call _printf_P |
525 0488 84E1 ldi r24,lo8(20) |
526 048a 8093 0000 sts DispPtr,r24 |
527 048e 2091 0000 lds r18,AdNeutralNick |
528 0492 3091 0000 lds r19,(AdNeutralNick)+1 |
529 0496 8091 0000 lds r24,AccumulateNick |
530 049a 9091 0000 lds r25,(AccumulateNick)+1 |
531 049e 6091 0000 lds r22,MessanzahlNick |
532 04a2 3F93 push r19 |
533 04a4 2F93 push r18 |
534 04a6 7727 clr r23 |
535 04a8 0E94 0000 call __divmodhi4 |
536 04ac 7F93 push r23 |
537 04ae 6F93 push r22 |
538 04b0 80E0 ldi r24,lo8(__c.2063) |
539 04b2 90E0 ldi r25,hi8(__c.2063) |
540 04b4 9F93 push r25 |
541 04b6 8F93 push r24 |
542 04b8 FF92 push r15 |
543 04ba 0E94 0000 call _printf_P |
544 04be 88E2 ldi r24,lo8(40) |
545 04c0 8093 0000 sts DispPtr,r24 |
546 04c4 2091 0000 lds r18,AdNeutralRoll |
547 04c8 3091 0000 lds r19,(AdNeutralRoll)+1 |
548 04cc 8091 0000 lds r24,AccumulateRoll |
549 04d0 9091 0000 lds r25,(AccumulateRoll)+1 |
550 04d4 6091 0000 lds r22,MessanzahlRoll |
551 04d8 3F93 push r19 |
552 04da 2F93 push r18 |
553 04dc 7727 clr r23 |
554 04de 0E94 0000 call __divmodhi4 |
555 04e2 7F93 push r23 |
556 04e4 6F93 push r22 |
557 04e6 80E0 ldi r24,lo8(__c.2065) |
558 04e8 90E0 ldi r25,hi8(__c.2065) |
559 04ea 9F93 push r25 |
560 04ec 8F93 push r24 |
561 04ee FF92 push r15 |
562 04f0 0E94 0000 call _printf_P |
563 04f4 8CE3 ldi r24,lo8(60) |
564 04f6 8093 0000 sts DispPtr,r24 |
565 04fa 2091 0000 lds r18,AdNeutralGier |
566 04fe 3091 0000 lds r19,(AdNeutralGier)+1 |
567 0502 8091 0000 lds r24,AccumulateGier |
568 0506 9091 0000 lds r25,(AccumulateGier)+1 |
569 050a 6091 0000 lds r22,MessanzahlGier |
570 050e 3F93 push r19 |
571 0510 2F93 push r18 |
572 0512 7727 clr r23 |
573 0514 0E94 0000 call __divmodhi4 |
574 0518 7F93 push r23 |
575 051a 6F93 push r22 |
576 051c 80E0 ldi r24,lo8(__c.2067) |
577 051e 90E0 ldi r25,hi8(__c.2067) |
578 0520 00C0 rjmp .L45 |
579 .L27: |
580 0522 1092 0000 sts DispPtr,__zero_reg__ |
581 0526 80E0 ldi r24,lo8(__c.2070) |
582 0528 90E0 ldi r25,hi8(__c.2070) |
583 052a 9F93 push r25 |
584 052c 8F93 push r24 |
585 052e FF92 push r15 |
586 0530 0E94 0000 call _printf_P |
587 0534 84E1 ldi r24,lo8(20) |
588 0536 8093 0000 sts DispPtr,r24 |
589 053a 2091 0000 lds r18,NeutralAccX |
590 053e 3091 0000 lds r19,(NeutralAccX)+1 |
591 0542 8091 0000 lds r24,accumulate_AccNick |
592 0546 9091 0000 lds r25,(accumulate_AccNick)+1 |
593 054a 6091 0000 lds r22,messanzahl_AccNick |
594 054e 3F93 push r19 |
595 0550 2F93 push r18 |
596 0552 7727 clr r23 |
597 0554 0E94 0000 call __divmodhi4 |
598 0558 7F93 push r23 |
599 055a 6F93 push r22 |
600 055c 80E0 ldi r24,lo8(__c.2072) |
601 055e 90E0 ldi r25,hi8(__c.2072) |
602 0560 9F93 push r25 |
603 0562 8F93 push r24 |
604 0564 FF92 push r15 |
605 0566 0E94 0000 call _printf_P |
606 056a 88E2 ldi r24,lo8(40) |
607 056c 8093 0000 sts DispPtr,r24 |
608 0570 2091 0000 lds r18,NeutralAccY |
609 0574 3091 0000 lds r19,(NeutralAccY)+1 |
610 0578 8091 0000 lds r24,accumulate_AccRoll |
611 057c 9091 0000 lds r25,(accumulate_AccRoll)+1 |
612 0580 6091 0000 lds r22,messanzahl_AccRoll |
613 0584 3F93 push r19 |
614 0586 2F93 push r18 |
615 0588 7727 clr r23 |
616 058a 0E94 0000 call __divmodhi4 |
617 058e 7F93 push r23 |
618 0590 6F93 push r22 |
619 0592 80E0 ldi r24,lo8(__c.2074) |
620 0594 90E0 ldi r25,hi8(__c.2074) |
621 0596 9F93 push r25 |
622 0598 8F93 push r24 |
623 059a FF92 push r15 |
624 059c 0E94 0000 call _printf_P |
625 05a0 8CE3 ldi r24,lo8(60) |
626 05a2 8093 0000 sts DispPtr,r24 |
627 05a6 6091 0000 lds r22,NeutralAccZ |
628 05aa 7091 0000 lds r23,(NeutralAccZ)+1 |
629 05ae 8091 0000 lds r24,(NeutralAccZ)+2 |
630 05b2 9091 0000 lds r25,(NeutralAccZ)+3 |
631 05b6 0091 0000 lds r16,Aktuell_az |
632 05ba 1091 0000 lds r17,(Aktuell_az)+1 |
633 05be 0E94 0000 call __fixsfsi |
634 05c2 7F93 push r23 |
635 05c4 6F93 push r22 |
636 05c6 1F93 push r17 |
637 05c8 0F93 push r16 |
638 05ca 80E0 ldi r24,lo8(__c.2076) |
639 05cc 90E0 ldi r25,hi8(__c.2076) |
640 .L45: |
641 05ce 9F93 push r25 |
642 05d0 8F93 push r24 |
643 05d2 FF92 push r15 |
644 05d4 0E94 0000 call _printf_P |
645 05d8 8DB7 in r24,__SP_L__ |
646 05da 9EB7 in r25,__SP_H__ |
647 05dc 4896 adiw r24,24 |
648 05de 00C0 rjmp .L42 |
649 .L28: |
650 05e0 84E1 ldi r24,lo8(20) |
651 05e2 8093 0000 sts DispPtr,r24 |
652 05e6 8091 0000 lds r24,UBat |
653 05ea 9091 0000 lds r25,(UBat)+1 |
654 05ee 9F93 push r25 |
655 05f0 8F93 push r24 |
656 05f2 80E0 ldi r24,lo8(__c.2079) |
657 05f4 90E0 ldi r25,hi8(__c.2079) |
658 05f6 9F93 push r25 |
659 05f8 8F93 push r24 |
660 05fa FF92 push r15 |
661 05fc 0E94 0000 call _printf_P |
662 0600 88E2 ldi r24,lo8(40) |
663 0602 8093 0000 sts DispPtr,r24 |
664 0606 8091 0000 lds r24,SenderOkay |
665 060a 9927 clr r25 |
666 060c 9F93 push r25 |
667 060e 8F93 push r24 |
668 0610 80E0 ldi r24,lo8(__c.2081) |
669 0612 90E0 ldi r25,hi8(__c.2081) |
670 0614 9F93 push r25 |
671 0616 8F93 push r24 |
672 0618 FF92 push r15 |
673 061a 0E94 0000 call _printf_P |
674 061e 8DB7 in r24,__SP_L__ |
675 0620 9EB7 in r25,__SP_H__ |
676 0622 0A96 adiw r24,10 |
677 0624 00C0 rjmp .L42 |
678 .L29: |
679 0626 1092 0000 sts DispPtr,__zero_reg__ |
680 062a 80E0 ldi r24,lo8(__c.2084) |
681 062c 90E0 ldi r25,hi8(__c.2084) |
682 062e 9F93 push r25 |
683 0630 8F93 push r24 |
684 0632 FF92 push r15 |
685 0634 0E94 0000 call _printf_P |
686 0638 84E1 ldi r24,lo8(20) |
687 063a 8093 0000 sts DispPtr,r24 |
688 063e 8091 0000 lds r24,KompassRichtung |
689 0642 9091 0000 lds r25,(KompassRichtung)+1 |
690 0646 9F93 push r25 |
691 0648 8F93 push r24 |
692 064a 80E0 ldi r24,lo8(__c.2086) |
693 064c 90E0 ldi r25,hi8(__c.2086) |
694 064e 9F93 push r25 |
695 0650 8F93 push r24 |
696 0652 FF92 push r15 |
697 0654 0E94 0000 call _printf_P |
698 0658 88E2 ldi r24,lo8(40) |
699 065a 8093 0000 sts DispPtr,r24 |
700 065e 8091 0000 lds r24,KompassValue |
701 0662 9091 0000 lds r25,(KompassValue)+1 |
702 0666 9F93 push r25 |
703 0668 8F93 push r24 |
704 066a 80E0 ldi r24,lo8(__c.2088) |
705 066c 90E0 ldi r25,hi8(__c.2088) |
706 066e 9F93 push r25 |
707 0670 8F93 push r24 |
708 0672 FF92 push r15 |
709 0674 0E94 0000 call _printf_P |
710 0678 8CE3 ldi r24,lo8(60) |
711 067a 8093 0000 sts DispPtr,r24 |
712 067e 8091 0000 lds r24,KompassStartwert |
713 0682 9091 0000 lds r25,(KompassStartwert)+1 |
714 0686 9F93 push r25 |
715 0688 8F93 push r24 |
716 068a 80E0 ldi r24,lo8(__c.2090) |
717 068c 90E0 ldi r25,hi8(__c.2090) |
718 068e 9F93 push r25 |
719 0690 8F93 push r24 |
720 0692 FF92 push r15 |
721 0694 0E94 0000 call _printf_P |
722 .L43: |
723 0698 8DB7 in r24,__SP_L__ |
724 069a 9EB7 in r25,__SP_H__ |
725 069c 4296 adiw r24,18 |
726 069e 00C0 rjmp .L42 |
727 .L30: |
728 06a0 1092 0000 sts DispPtr,__zero_reg__ |
729 06a4 8091 0000 lds r24,Poti5 |
730 06a8 9091 0000 lds r25,(Poti5)+1 |
731 06ac 9F93 push r25 |
732 06ae 8F93 push r24 |
733 06b0 8091 0000 lds r24,Poti1 |
734 06b4 9091 0000 lds r25,(Poti1)+1 |
735 06b8 9F93 push r25 |
736 06ba 8F93 push r24 |
737 06bc 80E0 ldi r24,lo8(__c.2093) |
738 06be 90E0 ldi r25,hi8(__c.2093) |
739 06c0 9F93 push r25 |
740 06c2 8F93 push r24 |
741 06c4 FF92 push r15 |
742 06c6 0E94 0000 call _printf_P |
743 06ca 84E1 ldi r24,lo8(20) |
744 06cc 8093 0000 sts DispPtr,r24 |
745 06d0 8091 0000 lds r24,Poti6 |
746 06d4 9091 0000 lds r25,(Poti6)+1 |
747 06d8 9F93 push r25 |
748 06da 8F93 push r24 |
749 06dc 8091 0000 lds r24,Poti2 |
750 06e0 9091 0000 lds r25,(Poti2)+1 |
751 06e4 9F93 push r25 |
752 06e6 8F93 push r24 |
753 06e8 80E0 ldi r24,lo8(__c.2095) |
754 06ea 90E0 ldi r25,hi8(__c.2095) |
755 06ec 9F93 push r25 |
756 06ee 8F93 push r24 |
757 06f0 FF92 push r15 |
758 06f2 0E94 0000 call _printf_P |
759 06f6 88E2 ldi r24,lo8(40) |
760 06f8 8093 0000 sts DispPtr,r24 |
761 06fc 8091 0000 lds r24,Poti7 |
762 0700 9091 0000 lds r25,(Poti7)+1 |
763 0704 9F93 push r25 |
764 0706 8F93 push r24 |
765 0708 8091 0000 lds r24,Poti3 |
766 070c 9091 0000 lds r25,(Poti3)+1 |
767 0710 9F93 push r25 |
768 0712 8F93 push r24 |
769 0714 80E0 ldi r24,lo8(__c.2097) |
770 0716 90E0 ldi r25,hi8(__c.2097) |
771 0718 9F93 push r25 |
772 071a 8F93 push r24 |
773 071c FF92 push r15 |
774 071e 0E94 0000 call _printf_P |
775 0722 8CE3 ldi r24,lo8(60) |
776 0724 8093 0000 sts DispPtr,r24 |
777 0728 8091 0000 lds r24,Poti8 |
778 072c 9091 0000 lds r25,(Poti8)+1 |
779 0730 9F93 push r25 |
780 0732 8F93 push r24 |
781 0734 8091 0000 lds r24,Poti4 |
782 0738 9091 0000 lds r25,(Poti4)+1 |
783 073c 9F93 push r25 |
784 073e 8F93 push r24 |
785 0740 80E0 ldi r24,lo8(__c.2099) |
786 0742 90E0 ldi r25,hi8(__c.2099) |
787 .L46: |
788 0744 9F93 push r25 |
789 0746 8F93 push r24 |
790 0748 FF92 push r15 |
791 074a 0E94 0000 call _printf_P |
792 074e 8DB7 in r24,__SP_L__ |
793 0750 9EB7 in r25,__SP_H__ |
794 0752 4C96 adiw r24,28 |
795 0754 00C0 rjmp .L42 |
796 .L31: |
797 0756 1092 0000 sts DispPtr,__zero_reg__ |
798 075a 80E0 ldi r24,lo8(__c.2102) |
799 075c 90E0 ldi r25,hi8(__c.2102) |
800 075e 9F93 push r25 |
801 0760 8F93 push r24 |
802 0762 FF92 push r15 |
803 0764 0E94 0000 call _printf_P |
804 0768 84E1 ldi r24,lo8(20) |
805 076a 8093 0000 sts DispPtr,r24 |
806 076e 8091 0000 lds r24,Parameter_ServoNickControl |
807 0772 9927 clr r25 |
808 0774 9F93 push r25 |
809 0776 8F93 push r24 |
810 0778 80E0 ldi r24,lo8(__c.2104) |
811 077a 90E0 ldi r25,hi8(__c.2104) |
812 077c 9F93 push r25 |
813 077e 8F93 push r24 |
814 0780 FF92 push r15 |
815 0782 0E94 0000 call _printf_P |
816 0786 88E2 ldi r24,lo8(40) |
817 0788 8093 0000 sts DispPtr,r24 |
818 078c 8091 0000 lds r24,ServoValue |
819 0790 9091 0000 lds r25,(ServoValue)+1 |
820 0794 9F93 push r25 |
821 0796 8F93 push r24 |
822 0798 80E0 ldi r24,lo8(__c.2106) |
823 079a 90E0 ldi r25,hi8(__c.2106) |
824 079c 9F93 push r25 |
825 079e 8F93 push r24 |
826 07a0 FF92 push r15 |
827 07a2 0E94 0000 call _printf_P |
828 07a6 8CE3 ldi r24,lo8(60) |
829 07a8 8093 0000 sts DispPtr,r24 |
830 07ac 8091 0000 lds r24,EE_Parameter+36 |
831 07b0 9927 clr r25 |
832 07b2 9F93 push r25 |
833 07b4 8F93 push r24 |
834 07b6 8091 0000 lds r24,EE_Parameter+35 |
835 07ba 9927 clr r25 |
836 07bc 9F93 push r25 |
837 07be 8F93 push r24 |
838 07c0 80E0 ldi r24,lo8(__c.2108) |
839 07c2 90E0 ldi r25,hi8(__c.2108) |
840 07c4 9F93 push r25 |
841 07c6 8F93 push r24 |
842 07c8 FF92 push r15 |
843 07ca 0E94 0000 call _printf_P |
844 07ce 00C0 rjmp .L44 |
845 .L20: |
846 07d0 0150 subi r16,lo8(-(-1)) |
847 07d2 0093 0000 sts MaxMenue.2006,r16 |
848 07d6 1092 0000 sts MenuePunkt.2007,__zero_reg__ |
849 .L35: |
850 07da 1092 0000 sts RemoteTasten,__zero_reg__ |
851 /* epilogue: frame size=0 */ |
852 07de 1F91 pop r17 |
853 07e0 0F91 pop r16 |
854 07e2 FF90 pop r15 |
855 07e4 0895 ret |
856 /* epilogue end (size=4) */ |
857 /* function Menu size 1002 (995) */ |
859 .global TestInt |
860 .global TestInt |
861 .section .bss |
864 TestInt: |
865 0000 0000 .skip 2,0 |
866 .global Array |
867 .data |
870 Array: |
871 0000 01 .byte 1 |
872 0001 02 .byte 2 |
873 0002 03 .byte 3 |
874 0003 04 .byte 4 |
875 0004 05 .byte 5 |
876 0005 06 .byte 6 |
877 0006 07 .byte 7 |
878 0007 08 .byte 8 |
879 0008 09 .byte 9 |
880 0009 0A .byte 10 |
881 .global DisplayBuff |
884 DisplayBuff: |
885 000a 4861 6C6C .string "Hallo Welt" |
885 6F20 5765 |
885 6C74 00 |
886 0015 0000 0000 .skip 69,0 |
886 0000 0000 |
886 0000 0000 |
886 0000 0000 |
886 0000 0000 |
887 .global DispPtr |
888 .global DispPtr |
889 .section .bss |
892 DispPtr: |
893 0002 00 .skip 1,0 |
894 .global RemoteTasten |
895 .global RemoteTasten |
898 RemoteTasten: |
899 0003 00 .skip 1,0 |
900 .section .progmem.data,"a",@progbits |
903 __c.2108: |
904 0000 5261 6E67 .string "Range:%3i-%3i" |
904 653A 2533 |
904 692D 2533 |
904 6900 |
907 __c.2106: |
908 000e 5374 656C .string "Stellung: %3i" |
908 6C75 6E67 |
908 3A20 2533 |
908 6900 |
911 __c.2104: |
912 001c 5365 7470 .string "Setpoint %3i" |
912 6F69 6E74 |
912 2020 2533 |
912 6900 |
915 __c.2102: |
916 002a 5365 7276 .string "Servo " |
916 6F20 2000 |
919 __c.2099: |
920 0032 506F 343A .string "Po4: %3i Po8: %3i" |
920 2025 3369 |
920 2050 6F38 |
920 3A20 2533 |
920 6900 |
923 __c.2097: |
924 0044 506F 333A .string "Po3: %3i Po7: %3i" |
924 2025 3369 |
924 2050 6F37 |
924 3A20 2533 |
924 6900 |
927 __c.2095: |
928 0056 506F 323A .string "Po2: %3i Po6: %3i" |
928 2025 3369 |
928 2050 6F36 |
928 3A20 2533 |
928 6900 |
931 __c.2093: |
932 0068 506F 313A .string "Po1: %3i Po5: %3i" |
932 2025 3369 |
932 2050 6F35 |
932 3A20 2533 |
932 6900 |
935 __c.2090: |
936 007a 5374 6172 .string "Start: %5i" |
936 743A 2020 |
936 2020 2025 |
936 3569 00 |
939 __c.2088: |
940 0089 4D65 7373 .string "Messwert: %5i" |
940 7765 7274 |
940 3A20 2025 |
940 3569 00 |
943 __c.2086: |
944 0098 5269 6368 .string "Richtung: %5i" |
944 7475 6E67 |
944 3A20 2025 |
944 3569 00 |
947 __c.2084: |
948 00a7 4B6F 6D70 .string "Kompass " |
948 6173 7320 |
948 2020 2020 |
948 2020 00 |
951 __c.2081: |
952 00b6 456D 7066 .string "Empf.Pegel:%5i" |
952 2E50 6567 |
952 656C 3A25 |
952 3569 00 |
955 __c.2079: |
956 00c5 5370 616E .string "Spannung: %5i" |
956 6E75 6E67 |
956 3A20 2025 |
956 3569 00 |
959 __c.2076: |
960 00d4 486F 6368 .string "Hoch %4i (%3i)" |
960 2025 3469 |
960 2028 2533 |
960 6929 00 |
963 __c.2074: |
964 00e3 526F 6C6C .string "Roll %4i (%3i)" |
964 2025 3469 |
964 2028 2533 |
964 6929 00 |
967 __c.2072: |
968 00f2 4E69 636B .string "Nick %4i (%3i)" |
968 2025 3469 |
968 2028 2533 |
968 6929 00 |
971 __c.2070: |
972 0101 4143 4320 .string "ACC - Sensor" |
972 2D20 5365 |
972 6E73 6F72 |
972 00 |
975 __c.2067: |
976 010e 4769 6572 .string "Gier %4i (%3i)" |
976 2025 3469 |
976 2028 2533 |
976 6929 00 |
979 __c.2065: |
980 011d 526F 6C6C .string "Roll %4i (%3i)" |
980 2025 3469 |
980 2028 2533 |
980 6929 00 |
983 __c.2063: |
984 012c 4E69 636B .string "Nick %4i (%3i)" |
984 2025 3469 |
984 2028 2533 |
984 6929 00 |
987 __c.2061: |
988 013b 4779 726F .string "Gyro - Sensor" |
988 202D 2053 |
988 656E 736F |
988 7200 |
991 __c.2058: |
992 0149 5033 3A25 .string "P3:%4i P4:%4i " |
992 3469 2020 |
992 5034 3A25 |
992 3469 2000 |
995 __c.2056: |
996 0159 5031 3A25 .string "P1:%4i P2:%4i " |
996 3469 2020 |
996 5032 3A25 |
996 3469 2000 |
999 __c.2054: |
1000 0169 4773 3A25 .string "Gs:%4i Gi:%4i " |
1000 3469 2020 |
1000 4769 3A25 |
1000 3469 2000 |
1003 __c.2052: |
1004 0179 4E69 3A25 .string "Ni:%4i Ro:%4i " |
1004 3469 2020 |
1004 526F 3A25 |
1004 3469 2000 |
1007 __c.2049: |
1008 0189 4B37 3A25 .string "K7:%4i K8:%4i " |
1008 3469 2020 |
1008 4B38 3A25 |
1008 3469 2000 |
1011 __c.2047: |
1012 0199 4B35 3A25 .string "K5:%4i K6:%4i " |
1012 3469 2020 |
1012 4B36 3A25 |
1012 3469 2000 |
1015 __c.2045: |
1016 01a9 4B33 3A25 .string "K3:%4i K4:%4i " |
1016 3469 2020 |
1016 4B34 3A25 |
1016 3469 2000 |
1019 __c.2043: |
1020 01b9 4B31 3A25 .string "K1:%4i K2:%4i " |
1020 3469 2020 |
1020 4B32 3A25 |
1020 3469 2000 |
1023 __c.2040: |
1024 01c9 4B6F 6D70 .string "Kompass: %5i" |
1024 6173 733A |
1024 2020 2025 |
1024 3569 00 |
1027 __c.2038: |
1028 01d8 526F 6C6C .string "Roll: %5i" |
1028 3A20 2020 |
1028 2020 2025 |
1028 3569 00 |
1031 __c.2036: |
1032 01e7 4E69 636B .string "Nick: %5i" |
1032 3A20 2020 |
1032 2020 2025 |
1032 3569 00 |
1035 __c.2034: |
1036 01f6 616B 742E .string "akt. Lage" |
1036 204C 6167 |
1036 6500 |
1039 __c.2031: |
1040 0200 48F6 6865 .string "H\366henregelung" |
1040 6E72 6567 |
1040 656C 756E |
1040 6700 |
1043 __c.2029: |
1044 020e 4B65 696E .string "Keine " |
1044 6520 00 |
1047 __c.2027: |
1048 0215 4F66 6620 .string "Off : %5i" |
1048 2020 2020 |
1048 203A 2025 |
1048 3569 00 |
1051 __c.2025: |
1052 0224 4C75 6674 .string "Luftdruck: %5i" |
1052 6472 7563 |
1052 6B3A 2025 |
1052 3569 00 |
1055 __c.2023: |
1056 0233 536F 6C6C .string "SollHoehe: %5i" |
1056 486F 6568 |
1056 653A 2025 |
1056 3569 00 |
1059 __c.2021: |
1060 0242 486F 6568 .string "Hoehe: %5i" |
1060 653A 2020 |
1060 2020 2025 |
1060 3569 00 |
1063 __c.2017: |
1064 0251 2863 2920 .string "(c) Holger Buss" |
1064 486F 6C67 |
1064 6572 2042 |
1064 7573 7300 |
1067 __c.2015: |
1068 0261 5365 7474 .string "Setting: %d " |
1068 696E 673A |
1068 2025 6420 |
1068 00 |
1071 __c.2013: |
1072 026e 5625 642E .string "V%d.%d" |
1072 2564 00 |
1075 __c.2011: |
1076 0275 2B2B 204D .string "++ MikroKopter ++" |
1076 696B 726F |
1076 4B6F 7074 |
1076 6572 202B |
1076 2B00 |
1079 __c.2008: |
1080 0287 5B25 695D .string "[%i]" |
1080 00 |
1081 .lcomm MenuePunkt.2007,1 |
1082 .data |
1085 MaxMenue.2006: |
1086 005a 0A .byte 10 |
1087 .comm DiffNick,2,1 |
1088 .comm DiffRoll,2,1 |
1089 .comm SenderOkay,1,1 |
1090 .comm CosinusNickWinkel,1,1 |
1091 .comm CosinusRollWinkel,1,1 |
1092 .comm durchschnitt_northing,4,1 |
1093 .comm durchschnitt_easting,4,1 |
1094 .comm P_GPS_Verstaerkung,2,1 |
1095 .comm D_GPS_Verstaerkung,2,1 |
1096 .comm Timeout,1,1 |
1097 .comm IntegralNick,4,1 |
1098 .comm IntegralNick2,4,1 |
1099 .comm IntegralRoll,4,1 |
1100 .comm IntegralRoll2,4,1 |
1101 .comm Mess_IntegralNick,4,1 |
1102 .comm Mess_IntegralNick2,4,1 |
1103 .comm Mess_IntegralRoll,4,1 |
1104 .comm Mess_IntegralRoll2,4,1 |
1105 .comm Integral_Gier,4,1 |
1106 .comm Mess_Integral_Gier,4,1 |
1107 .comm h,1,1 |
1108 .comm m,1,1 |
1109 .comm s,1,1 |
1110 .comm Motor_Vorne,1,1 |
1111 .comm Motor_Hinten,1,1 |
1112 .comm Motor_Rechts,1,1 |
1113 .comm Motor_Links,1,1 |
1114 .comm Count,1,1 |
1115 .comm MotorWert,5,1 |
1116 /* File "menu.c": code 1011 = 0x03f3 (1003), prologues 3, epilogues 5 */ |
DEFINED SYMBOLS |
*ABS*:00000000 menu.c |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:3 *ABS*:0000003f __SREG__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:4 *ABS*:0000003e __SP_H__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:5 *ABS*:0000003d __SP_L__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:6 *ABS*:00000000 __tmp_reg__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:7 *ABS*:00000001 __zero_reg__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:13 .text:00000000 LcdClear |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:884 .data:0000000a DisplayBuff |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:32 .text:00000012 Menu |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:898 .bss:00000003 RemoteTasten |
.bss:00000004 MenuePunkt.2007 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:1085 .data:0000005a MaxMenue.2006 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:892 .bss:00000002 DispPtr |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:1079 .progmem.data:00000287 __c.2008 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:1075 .progmem.data:00000275 __c.2011 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:1071 .progmem.data:0000026e __c.2013 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:1067 .progmem.data:00000261 __c.2015 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:1063 .progmem.data:00000251 __c.2017 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:1059 .progmem.data:00000242 __c.2021 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:1055 .progmem.data:00000233 __c.2023 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:1051 .progmem.data:00000224 __c.2025 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:1047 .progmem.data:00000215 __c.2027 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:1043 .progmem.data:0000020e __c.2029 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:1039 .progmem.data:00000200 __c.2031 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:1035 .progmem.data:000001f6 __c.2034 |
*COM*:00000004 IntegralNick |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:1031 .progmem.data:000001e7 __c.2036 |
*COM*:00000004 IntegralRoll |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:1027 .progmem.data:000001d8 __c.2038 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:1023 .progmem.data:000001c9 __c.2040 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:1019 .progmem.data:000001b9 __c.2043 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:1015 .progmem.data:000001a9 __c.2045 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:1011 .progmem.data:00000199 __c.2047 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:1007 .progmem.data:00000189 __c.2049 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:1003 .progmem.data:00000179 __c.2052 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:999 .progmem.data:00000169 __c.2054 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:995 .progmem.data:00000159 __c.2056 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:991 .progmem.data:00000149 __c.2058 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:987 .progmem.data:0000013b __c.2061 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:983 .progmem.data:0000012c __c.2063 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:979 .progmem.data:0000011d __c.2065 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:975 .progmem.data:0000010e __c.2067 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:971 .progmem.data:00000101 __c.2070 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:967 .progmem.data:000000f2 __c.2072 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:963 .progmem.data:000000e3 __c.2074 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:959 .progmem.data:000000d4 __c.2076 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:955 .progmem.data:000000c5 __c.2079 |
*COM*:00000001 SenderOkay |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:951 .progmem.data:000000b6 __c.2081 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:947 .progmem.data:000000a7 __c.2084 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:943 .progmem.data:00000098 __c.2086 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:939 .progmem.data:00000089 __c.2088 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:935 .progmem.data:0000007a __c.2090 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:931 .progmem.data:00000068 __c.2093 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:927 .progmem.data:00000056 __c.2095 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:923 .progmem.data:00000044 __c.2097 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:919 .progmem.data:00000032 __c.2099 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:915 .progmem.data:0000002a __c.2102 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:911 .progmem.data:0000001c __c.2104 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:907 .progmem.data:0000000e __c.2106 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:903 .progmem.data:00000000 __c.2108 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:864 .bss:00000000 TestInt |
C:\DOKUME~1\none\LOKALE~1\Temp/ccCgAEGZ.s:870 .data:00000000 Array |
*COM*:00000002 DiffNick |
*COM*:00000002 DiffRoll |
*COM*:00000001 CosinusNickWinkel |
*COM*:00000001 CosinusRollWinkel |
*COM*:00000004 durchschnitt_northing |
*COM*:00000004 durchschnitt_easting |
*COM*:00000002 P_GPS_Verstaerkung |
*COM*:00000002 D_GPS_Verstaerkung |
*COM*:00000001 Timeout |
*COM*:00000004 IntegralNick2 |
*COM*:00000004 IntegralRoll2 |
*COM*:00000004 Mess_IntegralNick |
*COM*:00000004 Mess_IntegralNick2 |
*COM*:00000004 Mess_IntegralRoll |
*COM*:00000004 Mess_IntegralRoll2 |
*COM*:00000004 Integral_Gier |
*COM*:00000004 Mess_Integral_Gier |
*COM*:00000001 h |
*COM*:00000001 m |
*COM*:00000001 s |
*COM*:00000001 Motor_Vorne |
*COM*:00000001 Motor_Hinten |
*COM*:00000001 Motor_Rechts |
*COM*:00000001 Motor_Links |
*COM*:00000001 Count |
*COM*:00000005 MotorWert |
UNDEFINED SYMBOLS |
__do_copy_data |
__do_clear_bss |
_printf_P |
GetActiveParamSetNumber |
EE_Parameter |
HoehenWert |
SollHoehe |
MessLuftdruck |
DruckOffsetSetting |
__divmodsi4 |
KompassValue |
PPM_in |
AdNeutralNick |
AccumulateNick |
MessanzahlNick |
__divmodhi4 |
AdNeutralRoll |
AccumulateRoll |
MessanzahlRoll |
AdNeutralGier |
AccumulateGier |
MessanzahlGier |
NeutralAccX |
accumulate_AccNick |
messanzahl_AccNick |
NeutralAccY |
accumulate_AccRoll |
messanzahl_AccRoll |
NeutralAccZ |
Aktuell_az |
__fixsfsi |
UBat |
KompassRichtung |
KompassStartwert |
Poti5 |
Poti1 |
Poti6 |
Poti2 |
Poti7 |
Poti3 |
Poti8 |
Poti4 |
Parameter_ServoNickControl |
ServoValue |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/old_macros.h |
---|
0,0 → 1,47 |
/* |
For backwards compatibility only. |
Ingo Busker ingo@mikrocontroller.com |
*/ |
#ifndef cbi |
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) |
#endif |
#ifndef sbi |
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit)) |
#endif |
#ifndef inb |
#define inb(sfr) _SFR_BYTE(sfr) |
#endif |
#ifndef outb |
#define outb(sfr, val) (_SFR_BYTE(sfr) = (val)) |
#endif |
#ifndef inw |
#define inw(sfr) _SFR_WORD(sfr) |
#endif |
#ifndef outw |
#define outw(sfr, val) (_SFR_WORD(sfr) = (val)) |
#endif |
#ifndef outp |
#define outp(val, sfr) outb(sfr, val) |
#endif |
#ifndef inp |
#define inp(sfr) inb(sfr) |
#endif |
#ifndef BV |
#define BV(bit) _BV(bit) |
#endif |
#ifndef PRG_RDB |
#define PRG_RDB pgm_read_byte |
#endif |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/printf_P.c |
---|
0,0 → 1,480 |
// Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist nicht von der Lizenz für den MikroKopter-Teil unterstellt |
/* |
Copyright (C) 1993 Free Software Foundation |
This file is part of the GNU IO Library. This library is free |
software; you can redistribute it and/or modify it under the |
terms of the GNU General Public License as published by the |
Free Software Foundation; either version 2, or (at your option) |
any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License for more details. |
You should have received a copy of the GNU General Public License |
along with this library; see the file COPYING. If not, write to the Free |
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
As a special exception, if you link this library with files |
compiled with a GNU compiler to produce an executable, this does not cause |
the resulting executable to be covered by the GNU General Public License. |
This exception does not however invalidate any other reasons why |
the executable file might be covered by the GNU General Public License. */ |
/* |
* Copyright (c) 1990 Regents of the University of California. |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* 1. Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* 2. Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* 3. [rescinded 22 July 1999] |
* 4. Neither the name of the University nor the names of its contributors |
* may be used to endorse or promote products derived from this software |
* without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
* SUCH DAMAGE. |
*/ |
/****************************************************************************** |
This file is a patched version of printf called _printf_P |
It is made to work with avr-gcc for Atmel AVR MCUs. |
There are some differences from standard printf: |
1. There is no floating point support (with fp the code is about 8K!) |
2. Return type is void |
3. Format string must be in program memory (by using macro printf this is |
done automaticaly) |
4. %n is not implemented (just remove the comment around it if you need it) |
5. If LIGHTPRINTF is defined, the code is about 550 bytes smaller and the |
folowing specifiers are disabled : |
space # * . - + p s o O |
6. A function void uart_sendchar(char c) is used for output. The UART must |
be initialized before using printf. |
Alexander Popov |
sasho@vip.orbitel.bg |
******************************************************************************/ |
/* |
* Actual printf innards. |
* |
* This code is large and complicated... |
*/ |
#include <string.h> |
#ifdef __STDC__ |
#include <stdarg.h> |
#else |
#include <varargs.h> |
#endif |
#include "main.h" |
//#define LIGHTPRINTF |
char PrintZiel; |
char Putchar(char zeichen) |
{ |
if(PrintZiel == OUT_LCD) { DisplayBuff[DispPtr++] = zeichen; return(1);} |
else return(uart_putchar(zeichen)); |
} |
void PRINT(const char * ptr, unsigned int len) |
{ |
for(;len;len--) Putchar(*ptr++); |
} |
void PRINTP(const char * ptr, unsigned int len) |
{ |
for(;len;len--) Putchar(pgm_read_byte(ptr++)); |
} |
void PAD_SP(signed char howmany) |
{ |
for(;howmany>0;howmany--) Putchar(' '); |
} |
void PAD_0(signed char howmany) |
{ |
for(;howmany>0;howmany--) Putchar('0'); |
} |
#define BUF 40 |
/* |
* Macros for converting digits to letters and vice versa |
*/ |
#define to_digit(c) ((c) - '0') |
#define is_digit(c) ((c)<='9' && (c)>='0') |
#define to_char(n) ((n) + '0') |
/* |
* Flags used during conversion. |
*/ |
#define LONGINT 0x01 /* long integer */ |
#define LONGDBL 0x02 /* long double; unimplemented */ |
#define SHORTINT 0x04 /* short integer */ |
#define ALT 0x08 /* alternate form */ |
#define LADJUST 0x10 /* left adjustment */ |
#define ZEROPAD 0x20 /* zero (as opposed to blank) pad */ |
#define HEXPREFIX 0x40 /* add 0x or 0X prefix */ |
void _printf_P (char ziel,char const *fmt0, ...) /* Works with string from FLASH */ |
{ |
va_list ap; |
register const char *fmt; /* format string */ |
register char ch; /* character from fmt */ |
register int n; /* handy integer (short term usage) */ |
register char *cp; /* handy char pointer (short term usage) */ |
const char *fmark; /* for remembering a place in fmt */ |
register unsigned char flags; /* flags as above */ |
signed char width; /* width from format (%8d), or 0 */ |
signed char prec; /* precision from format (%.3d), or -1 */ |
char sign; /* sign prefix (' ', '+', '-', or \0) */ |
unsigned long _ulong=0; /* integer arguments %[diouxX] */ |
#define OCT 8 |
#define DEC 10 |
#define HEX 16 |
unsigned char base; /* base for [diouxX] conversion */ |
signed char dprec; /* a copy of prec if [diouxX], 0 otherwise */ |
signed char dpad; /* extra 0 padding needed for integers */ |
signed char fieldsz; /* field size expanded by sign, dpad etc */ |
/* The initialization of 'size' is to suppress a warning that |
'size' might be used unitialized. It seems gcc can't |
quite grok this spaghetti code ... */ |
signed char size = 0; /* size of converted field or string */ |
char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */ |
char ox[2]; /* space for 0x hex-prefix */ |
PrintZiel = ziel; // bestimmt, LCD oder UART |
va_start(ap, fmt0); |
fmt = fmt0; |
/* |
* Scan the format for conversions (`%' character). |
*/ |
for (;;) { |
for (fmark = fmt; (ch = pgm_read_byte(fmt)) != '\0' && ch != '%'; fmt++) |
/* void */; |
if ((n = fmt - fmark) != 0) { |
PRINTP(fmark, n); |
} |
if (ch == '\0') |
goto done; |
fmt++; /* skip over '%' */ |
flags = 0; |
dprec = 0; |
width = 0; |
prec = -1; |
sign = '\0'; |
rflag: ch = PRG_RDB(fmt++); |
reswitch: |
#ifdef LIGHTPRINTF |
if (ch=='o' || ch=='u' || (ch|0x20)=='x') { |
#else |
if (ch=='u' || (ch|0x20)=='x') { |
#endif |
if (flags&LONGINT) { |
_ulong=va_arg(ap, unsigned long); |
} else { |
register unsigned int _d; |
_d=va_arg(ap, unsigned int); |
_ulong = flags&SHORTINT ? (unsigned long)(unsigned short)_d : (unsigned long)_d; |
} |
} |
#ifndef LIGHTPRINTF |
if(ch==' ') { |
/* |
* ``If the space and + flags both appear, the space |
* flag will be ignored.'' |
* -- ANSI X3J11 |
*/ |
if (!sign) |
sign = ' '; |
goto rflag; |
} else if (ch=='#') { |
flags |= ALT; |
goto rflag; |
} else if (ch=='*'||ch=='-') { |
if (ch=='*') { |
/* |
* ``A negative field width argument is taken as a |
* - flag followed by a positive field width.'' |
* -- ANSI X3J11 |
* They don't exclude field widths read from args. |
*/ |
if ((width = va_arg(ap, int)) >= 0) |
goto rflag; |
width = -width; |
} |
flags |= LADJUST; |
flags &= ~ZEROPAD; /* '-' disables '0' */ |
goto rflag; |
} else if (ch=='+') { |
sign = '+'; |
goto rflag; |
} else if (ch=='.') { |
if ((ch = PRG_RDB(fmt++)) == '*') { |
n = va_arg(ap, int); |
prec = n < 0 ? -1 : n; |
goto rflag; |
} |
n = 0; |
while (is_digit(ch)) { |
n = n*10 + to_digit(ch); |
ch = PRG_RDB(fmt++); |
} |
prec = n < 0 ? -1 : n; |
goto reswitch; |
} else |
#endif /* LIGHTPRINTF */ |
if (ch=='0') { |
/* |
* ``Note that 0 is taken as a flag, not as the |
* beginning of a field width.'' |
* -- ANSI X3J11 |
*/ |
if (!(flags & LADJUST)) |
flags |= ZEROPAD; /* '-' disables '0' */ |
goto rflag; |
} else if (ch>='1' && ch<='9') { |
n = 0; |
do { |
n = 10 * n + to_digit(ch); |
ch = PRG_RDB(fmt++); |
} while (is_digit(ch)); |
width = n; |
goto reswitch; |
} else if (ch=='h') { |
flags |= SHORTINT; |
goto rflag; |
} else if (ch=='l') { |
flags |= LONGINT; |
goto rflag; |
} else if (ch=='c') { |
*(cp = buf) = va_arg(ap, int); |
size = 1; |
sign = '\0'; |
} else if (ch=='D'||ch=='d'||ch=='i') { |
if(ch=='D') |
flags |= LONGINT; |
if (flags&LONGINT) { |
_ulong=va_arg(ap, long); |
} else { |
register int _d; |
_d=va_arg(ap, int); |
_ulong = flags&SHORTINT ? (long)(short)_d : (long)_d; |
} |
if ((long)_ulong < 0) { |
_ulong = -_ulong; |
sign = '-'; |
} |
base = DEC; |
goto number; |
} else |
/* |
if (ch=='n') { |
if (flags & LONGINT) |
*va_arg(ap, long *) = ret; |
else if (flags & SHORTINT) |
*va_arg(ap, short *) = ret; |
else |
*va_arg(ap, int *) = ret; |
continue; // no output |
} else |
*/ |
#ifndef LIGHTPRINTF |
if (ch=='O'||ch=='o') { |
if (ch=='O') |
flags |= LONGINT; |
base = OCT; |
goto nosign; |
} else if (ch=='p') { |
/* |
* ``The argument shall be a pointer to void. The |
* value of the pointer is converted to a sequence |
* of printable characters, in an implementation- |
* defined manner.'' |
* -- ANSI X3J11 |
*/ |
/* NOSTRICT */ |
_ulong = (unsigned int)va_arg(ap, void *); |
base = HEX; |
flags |= HEXPREFIX; |
ch = 'x'; |
goto nosign; |
} else if (ch=='s') { // print a string from RAM |
if ((cp = va_arg(ap, char *)) == NULL) { |
cp=buf; |
cp[0] = '('; |
cp[1] = 'n'; |
cp[2] = 'u'; |
cp[4] = cp[3] = 'l'; |
cp[5] = ')'; |
cp[6] = '\0'; |
} |
if (prec >= 0) { |
/* |
* can't use strlen; can only look for the |
* NUL in the first `prec' characters, and |
* strlen() will go further. |
*/ |
char *p = (char*)memchr(cp, 0, prec); |
if (p != NULL) { |
size = p - cp; |
if (size > prec) |
size = prec; |
} else |
size = prec; |
} else |
size = strlen(cp); |
sign = '\0'; |
} else |
#endif /* LIGHTPRINTF */ |
if(ch=='U'||ch=='u') { |
if (ch=='U') |
flags |= LONGINT; |
base = DEC; |
goto nosign; |
} else if (ch=='X'||ch=='x') { |
base = HEX; |
/* leading 0x/X only if non-zero */ |
if (flags & ALT && _ulong != 0) |
flags |= HEXPREFIX; |
/* unsigned conversions */ |
nosign: sign = '\0'; |
/* |
* ``... diouXx conversions ... if a precision is |
* specified, the 0 flag will be ignored.'' |
* -- ANSI X3J11 |
*/ |
number: if ((dprec = prec) >= 0) |
flags &= ~ZEROPAD; |
/* |
* ``The result of converting a zero value with an |
* explicit precision of zero is no characters.'' |
* -- ANSI X3J11 |
*/ |
cp = buf + BUF; |
if (_ulong != 0 || prec != 0) { |
register unsigned char _d,notlastdigit; |
do { |
notlastdigit=(_ulong>=base); |
_d = _ulong % base; |
if (_d<10) { |
_d+='0'; |
} else { |
_d+='a'-10; |
if (ch=='X') _d&=~0x20; |
} |
*--cp=_d; |
_ulong /= base; |
} while (notlastdigit); |
#ifndef LIGHTPRINTF |
// handle octal leading 0 |
if (base==OCT && flags & ALT && *cp != '0') |
*--cp = '0'; |
#endif |
} |
size = buf + BUF - cp; |
} else { //default |
/* "%?" prints ?, unless ? is NUL */ |
if (ch == '\0') |
goto done; |
/* pretend it was %c with argument ch */ |
cp = buf; |
*cp = ch; |
size = 1; |
sign = '\0'; |
} |
/* |
* All reasonable formats wind up here. At this point, |
* `cp' points to a string which (if not flags&LADJUST) |
* should be padded out to `width' places. If |
* flags&ZEROPAD, it should first be prefixed by any |
* sign or other prefix; otherwise, it should be blank |
* padded before the prefix is emitted. After any |
* left-hand padding and prefixing, emit zeroes |
* required by a decimal [diouxX] precision, then print |
* the string proper, then emit zeroes required by any |
* leftover floating precision; finally, if LADJUST, |
* pad with blanks. |
*/ |
/* |
* compute actual size, so we know how much to pad. |
*/ |
fieldsz = size; |
dpad = dprec - size; |
if (dpad < 0) |
dpad = 0; |
if (sign) |
fieldsz++; |
else if (flags & HEXPREFIX) |
fieldsz += 2; |
fieldsz += dpad; |
/* right-adjusting blank padding */ |
if ((flags & (LADJUST|ZEROPAD)) == 0) |
PAD_SP(width - fieldsz); |
/* prefix */ |
if (sign) { |
PRINT(&sign, 1); |
} else if (flags & HEXPREFIX) { |
ox[0] = '0'; |
ox[1] = ch; |
PRINT(ox, 2); |
} |
/* right-adjusting zero padding */ |
if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD) |
PAD_0(width - fieldsz); |
/* leading zeroes from decimal precision */ |
PAD_0(dpad); |
/* the string or number proper */ |
PRINT(cp, size); |
/* left-adjusting padding (always blank) */ |
if (flags & LADJUST) |
PAD_SP(width - fieldsz); |
} |
done: |
va_end(ap); |
} |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/printf_P.d |
---|
0,0 → 1,2 |
printf_P.o printf_P.d : printf_P.c main.h old_macros.h _Settings.h printf_P.h \ |
timer0.h uart.h analog.h twimaster.h menu.h rc.h fc.h gps.h |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/printf_P.h |
---|
0,0 → 1,19 |
#ifndef _PRINTF_P_H_ |
#define _PRINTF_P_H_ |
#include <avr/pgmspace.h> |
#define OUT_V24 0 |
#define OUT_LCD 1 |
extern void _printf_P (char, char const *fmt0, ...); |
extern char PrintZiel; |
#define printf_P(format, args...) _printf_P(OUT_V24,format , ## args) |
#define printf(format, args...) _printf_P(OUT_V24,PSTR(format) , ## args) |
#define LCD_printfxy(x,y,format, args...) { DispPtr = y * 20 + x; _printf_P(OUT_LCD,PSTR(format) , ## args);} |
#define LCD_printf(format, args...) { _printf_P(OUT_LCD,PSTR(format) , ## args);} |
#endif |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/printf_P.lst |
---|
0,0 → 1,984 |
1 .file "printf_P.c" |
2 .arch atmega644 |
3 __SREG__ = 0x3f |
4 __SP_H__ = 0x3e |
5 __SP_L__ = 0x3d |
6 __tmp_reg__ = 0 |
7 __zero_reg__ = 1 |
8 .global __do_copy_data |
9 .global __do_clear_bss |
10 .text |
11 .global Putchar |
13 Putchar: |
14 /* prologue: frame size=0 */ |
15 /* prologue end (size=0) */ |
16 0000 982F mov r25,r24 |
17 0002 8091 0000 lds r24,PrintZiel |
18 0006 8130 cpi r24,lo8(1) |
19 0008 01F4 brne .L2 |
20 000a 8091 0000 lds r24,DispPtr |
21 000e E82F mov r30,r24 |
22 0010 FF27 clr r31 |
23 0012 E050 subi r30,lo8(-(DisplayBuff)) |
24 0014 F040 sbci r31,hi8(-(DisplayBuff)) |
25 0016 9083 st Z,r25 |
26 0018 8F5F subi r24,lo8(-(1)) |
27 001a 8093 0000 sts DispPtr,r24 |
28 001e 21E0 ldi r18,lo8(1) |
29 0020 30E0 ldi r19,hi8(1) |
30 0022 00C0 rjmp .L4 |
31 .L2: |
32 0024 892F mov r24,r25 |
33 0026 0E94 0000 call uart_putchar |
34 002a 282F mov r18,r24 |
35 002c 3327 clr r19 |
36 .L4: |
37 002e C901 movw r24,r18 |
38 /* epilogue: frame size=0 */ |
39 0030 0895 ret |
40 /* epilogue end (size=1) */ |
41 /* function Putchar size 25 (24) */ |
43 .global PAD_0 |
45 PAD_0: |
46 /* prologue: frame size=0 */ |
47 0032 1F93 push r17 |
48 /* prologue end (size=1) */ |
49 0034 182F mov r17,r24 |
50 0036 00C0 rjmp .L7 |
51 .L8: |
52 0038 80E3 ldi r24,lo8(48) |
53 003a 0E94 0000 call Putchar |
54 003e 1150 subi r17,lo8(-(-1)) |
55 .L7: |
56 0040 1116 cp __zero_reg__,r17 |
57 0042 04F0 brlt .L8 |
58 /* epilogue: frame size=0 */ |
59 0044 1F91 pop r17 |
60 0046 0895 ret |
61 /* epilogue end (size=2) */ |
62 /* function PAD_0 size 11 (8) */ |
64 .global PAD_SP |
66 PAD_SP: |
67 /* prologue: frame size=0 */ |
68 0048 1F93 push r17 |
69 /* prologue end (size=1) */ |
70 004a 182F mov r17,r24 |
71 004c 00C0 rjmp .L12 |
72 .L13: |
73 004e 80E2 ldi r24,lo8(32) |
74 0050 0E94 0000 call Putchar |
75 0054 1150 subi r17,lo8(-(-1)) |
76 .L12: |
77 0056 1116 cp __zero_reg__,r17 |
78 0058 04F0 brlt .L13 |
79 /* epilogue: frame size=0 */ |
80 005a 1F91 pop r17 |
81 005c 0895 ret |
82 /* epilogue end (size=2) */ |
83 /* function PAD_SP size 11 (8) */ |
85 .global PRINTP |
87 PRINTP: |
88 /* prologue: frame size=0 */ |
89 005e 0F93 push r16 |
90 0060 1F93 push r17 |
91 0062 CF93 push r28 |
92 0064 DF93 push r29 |
93 /* prologue end (size=4) */ |
94 0066 8C01 movw r16,r24 |
95 0068 EB01 movw r28,r22 |
96 006a 00C0 rjmp .L17 |
97 .L18: |
98 006c F801 movw r30,r16 |
99 006e 0F5F subi r16,lo8(-(1)) |
100 0070 1F4F sbci r17,hi8(-(1)) |
101 /* #APP */ |
102 0072 E491 lpm r30, Z |
103 |
104 /* #NOAPP */ |
105 0074 8E2F mov r24,r30 |
106 0076 0E94 0000 call Putchar |
107 007a 2197 sbiw r28,1 |
108 .L17: |
109 007c 2097 sbiw r28,0 |
110 007e 01F4 brne .L18 |
111 /* epilogue: frame size=0 */ |
112 0080 DF91 pop r29 |
113 0082 CF91 pop r28 |
114 0084 1F91 pop r17 |
115 0086 0F91 pop r16 |
116 0088 0895 ret |
117 /* epilogue end (size=5) */ |
118 /* function PRINTP size 25 (16) */ |
120 .global PRINT |
122 PRINT: |
123 /* prologue: frame size=0 */ |
124 008a 0F93 push r16 |
125 008c 1F93 push r17 |
126 008e CF93 push r28 |
127 0090 DF93 push r29 |
128 /* prologue end (size=4) */ |
129 0092 8C01 movw r16,r24 |
130 0094 EB01 movw r28,r22 |
131 0096 00C0 rjmp .L22 |
132 .L23: |
133 0098 F801 movw r30,r16 |
134 009a 8191 ld r24,Z+ |
135 009c 8F01 movw r16,r30 |
136 009e 0E94 0000 call Putchar |
137 00a2 2197 sbiw r28,1 |
138 .L22: |
139 00a4 2097 sbiw r28,0 |
140 00a6 01F4 brne .L23 |
141 /* epilogue: frame size=0 */ |
142 00a8 DF91 pop r29 |
143 00aa CF91 pop r28 |
144 00ac 1F91 pop r17 |
145 00ae 0F91 pop r16 |
146 00b0 0895 ret |
147 /* epilogue end (size=5) */ |
148 /* function PRINT size 20 (11) */ |
150 .global _printf_P |
152 _printf_P: |
153 /* prologue: frame size=51 */ |
154 00b2 2F92 push r2 |
155 00b4 3F92 push r3 |
156 00b6 4F92 push r4 |
157 00b8 5F92 push r5 |
158 00ba 6F92 push r6 |
159 00bc 7F92 push r7 |
160 00be 8F92 push r8 |
161 00c0 9F92 push r9 |
162 00c2 AF92 push r10 |
163 00c4 BF92 push r11 |
164 00c6 CF92 push r12 |
165 00c8 DF92 push r13 |
166 00ca EF92 push r14 |
167 00cc FF92 push r15 |
168 00ce 0F93 push r16 |
169 00d0 1F93 push r17 |
170 00d2 CF93 push r28 |
171 00d4 DF93 push r29 |
172 00d6 CDB7 in r28,__SP_L__ |
173 00d8 DEB7 in r29,__SP_H__ |
174 00da E397 sbiw r28,51 |
175 00dc 0FB6 in __tmp_reg__,__SREG__ |
176 00de F894 cli |
177 00e0 DEBF out __SP_H__,r29 |
178 00e2 0FBE out __SREG__,__tmp_reg__ |
179 00e4 CDBF out __SP_L__,r28 |
180 /* prologue end (size=26) */ |
181 00e6 2996 adiw r28,72-63 |
182 00e8 8FAD ldd r24,Y+63 |
183 00ea 2997 sbiw r28,72-63 |
184 00ec 8093 0000 sts PrintZiel,r24 |
185 00f0 CE01 movw r24,r28 |
186 00f2 855B subi r24,lo8(-(75)) |
187 00f4 9F4F sbci r25,hi8(-(75)) |
188 00f6 9D83 std Y+5,r25 |
189 00f8 8C83 std Y+4,r24 |
190 00fa 2B96 adiw r28,73-62 |
191 00fc 8EAD ldd r24,Y+62 |
192 00fe 9FAD ldd r25,Y+63 |
193 0100 2B97 sbiw r28,73-62 |
194 0102 9FA7 std Y+47,r25 |
195 0104 8EA7 std Y+46,r24 |
196 0106 2224 clr r2 |
197 0108 3324 clr r3 |
198 010a 2101 movw r4,r2 |
199 010c 00C0 rjmp .L27 |
200 .L28: |
201 010e 1301 movw r2,r6 |
202 0110 2401 movw r4,r8 |
203 .L27: |
204 0112 0EA5 ldd r16,Y+46 |
205 0114 1FA5 ldd r17,Y+47 |
206 0116 00C0 rjmp .L29 |
207 .L30: |
208 0118 0F5F subi r16,lo8(-(1)) |
209 011a 1F4F sbci r17,hi8(-(1)) |
210 .L29: |
211 011c F801 movw r30,r16 |
212 /* #APP */ |
213 011e F490 lpm r15, Z |
214 |
215 /* #NOAPP */ |
216 0120 FF20 tst r15 |
217 0122 01F0 breq .L31 |
218 0124 F5E2 ldi r31,lo8(37) |
219 0126 FF16 cp r15,r31 |
220 0128 01F4 brne .L30 |
221 .L31: |
222 012a B801 movw r22,r16 |
223 012c 8EA5 ldd r24,Y+46 |
224 012e 9FA5 ldd r25,Y+47 |
225 0130 681B sub r22,r24 |
226 0132 790B sbc r23,r25 |
227 0134 01F0 breq .L33 |
228 0136 0E94 0000 call PRINTP |
229 .L33: |
230 013a FF20 tst r15 |
231 013c 01F4 brne .+2 |
232 013e 00C0 rjmp .L152 |
233 0140 0F5F subi r16,lo8(-(1)) |
234 0142 1F4F sbci r17,hi8(-(1)) |
235 0144 1FA7 std Y+47,r17 |
236 0146 0EA7 std Y+46,r16 |
237 0148 1982 std Y+1,__zero_reg__ |
238 014a AC81 ldd r26,Y+4 |
239 014c BD81 ldd r27,Y+5 |
240 014e 1BAA std Y+51,__zero_reg__ |
241 0150 1AAA std Y+50,__zero_reg__ |
242 0152 9FEF ldi r25,lo8(-1) |
243 0154 99AB std Y+49,r25 |
244 .L175: |
245 0156 EEA5 ldd r30,Y+46 |
246 0158 FFA5 ldd r31,Y+47 |
247 015a CF01 movw r24,r30 |
248 015c 0196 adiw r24,1 |
249 015e 9FA7 std Y+47,r25 |
250 0160 8EA7 std Y+46,r24 |
251 /* #APP */ |
252 0162 B490 lpm r11, Z |
253 |
254 /* #NOAPP */ |
255 .L176: |
256 0164 95E7 ldi r25,lo8(117) |
257 0166 B916 cp r11,r25 |
258 0168 01F0 breq .L39 |
259 016a 8B2D mov r24,r11 |
260 016c 8062 ori r24,lo8(32) |
261 016e 8837 cpi r24,lo8(120) |
262 0170 01F4 brne .L41 |
263 .L39: |
264 0172 EBA9 ldd r30,Y+51 |
265 0174 E0FF sbrs r30,0 |
266 0176 00C0 rjmp .L42 |
267 0178 2D90 ld r2,X+ |
268 017a 3D90 ld r3,X+ |
269 017c 4D90 ld r4,X+ |
270 017e 5C90 ld r5,X |
271 0180 1397 sbiw r26,3 |
272 0182 1496 adiw r26,4 |
273 0184 00C0 rjmp .L41 |
274 .L42: |
275 0186 8D91 ld r24,X+ |
276 0188 9C91 ld r25,X |
277 018a 1197 sbiw r26,1 |
278 018c 1C01 movw r2,r24 |
279 018e 4424 clr r4 |
280 0190 5524 clr r5 |
281 0192 1296 adiw r26,2 |
282 .L41: |
283 0194 F0E2 ldi r31,lo8(32) |
284 0196 BF16 cp r11,r31 |
285 0198 01F4 brne .L44 |
286 019a 8981 ldd r24,Y+1 |
287 019c 8823 tst r24 |
288 019e 01F4 brne .L175 |
289 01a0 00C0 rjmp .L156 |
290 .L44: |
291 01a2 83E2 ldi r24,lo8(35) |
292 01a4 B816 cp r11,r24 |
293 01a6 01F4 brne .+2 |
294 01a8 00C0 rjmp .L155 |
295 01aa 9AE2 ldi r25,lo8(42) |
296 01ac B916 cp r11,r25 |
297 01ae 01F0 breq .L49 |
298 01b0 EDE2 ldi r30,lo8(45) |
299 01b2 BE16 cp r11,r30 |
300 01b4 01F4 brne .L164 |
301 01b6 00C0 rjmp .L51 |
302 .L49: |
303 01b8 FD01 movw r30,r26 |
304 01ba 1296 adiw r26,2 |
305 01bc E081 ld r30,Z |
306 01be EAAB std Y+50,r30 |
307 01c0 E7FF sbrs r30,7 |
308 01c2 00C0 rjmp .L175 |
309 01c4 E195 neg r30 |
310 01c6 EAAB std Y+50,r30 |
311 .L51: |
312 01c8 FBA9 ldd r31,Y+51 |
313 01ca F061 ori r31,lo8(16) |
314 01cc FF7D andi r31,lo8(-33) |
315 01ce 00C0 rjmp .L169 |
316 .L164: |
317 01d0 8BE2 ldi r24,lo8(43) |
318 01d2 B816 cp r11,r24 |
319 01d4 01F4 brne .+2 |
320 01d6 00C0 rjmp .L156 |
321 01d8 9EE2 ldi r25,lo8(46) |
322 01da B916 cp r11,r25 |
323 01dc 01F4 brne .L56 |
324 01de 2EA5 ldd r18,Y+46 |
325 01e0 3FA5 ldd r19,Y+47 |
326 01e2 2F5F subi r18,lo8(-(1)) |
327 01e4 3F4F sbci r19,hi8(-(1)) |
328 01e6 EEA5 ldd r30,Y+46 |
329 01e8 FFA5 ldd r31,Y+47 |
330 /* #APP */ |
331 01ea 8491 lpm r24, Z |
332 |
333 /* #NOAPP */ |
334 01ec 8A32 cpi r24,lo8(42) |
335 01ee 01F0 breq .L58 |
336 01f0 B82E mov r11,r24 |
337 01f2 20E0 ldi r18,lo8(0) |
338 01f4 30E0 ldi r19,hi8(0) |
339 01f6 00C0 rjmp .L60 |
340 .L58: |
341 01f8 FD01 movw r30,r26 |
342 01fa 1296 adiw r26,2 |
343 01fc 4081 ld r20,Z |
344 01fe 5181 ldd r21,Z+1 |
345 0200 57FF sbrs r21,7 |
346 0202 00C0 rjmp .L61 |
347 0204 4FEF ldi r20,lo8(-1) |
348 0206 5FEF ldi r21,hi8(-1) |
349 .L61: |
350 0208 49AB std Y+49,r20 |
351 020a 3FA7 std Y+47,r19 |
352 020c 2EA7 std Y+46,r18 |
353 020e 00C0 rjmp .L175 |
354 .L62: |
355 0210 C901 movw r24,r18 |
356 0212 03E0 ldi r16,3 |
357 0214 880F 1: lsl r24 |
358 0216 991F rol r25 |
359 0218 0A95 dec r16 |
360 021a 01F4 brne 1b |
361 021c 220F lsl r18 |
362 021e 331F rol r19 |
363 0220 280F add r18,r24 |
364 0222 391F adc r19,r25 |
365 0224 2B0D add r18,r11 |
366 0226 311D adc r19,__zero_reg__ |
367 0228 2053 subi r18,lo8(-(-48)) |
368 022a 3040 sbci r19,hi8(-(-48)) |
369 /* #APP */ |
370 022c B490 lpm r11, Z |
371 |
372 /* #NOAPP */ |
373 .L60: |
374 022e 3196 adiw r30,1 |
375 0230 8B2D mov r24,r11 |
376 0232 8053 subi r24,lo8(-(-48)) |
377 0234 8A30 cpi r24,lo8(10) |
378 0236 00F0 brlo .L62 |
379 0238 FFA7 std Y+47,r31 |
380 023a EEA7 std Y+46,r30 |
381 023c A901 movw r20,r18 |
382 023e 37FF sbrs r19,7 |
383 0240 00C0 rjmp .L64 |
384 0242 4FEF ldi r20,lo8(-1) |
385 0244 5FEF ldi r21,hi8(-1) |
386 .L64: |
387 0246 49AB std Y+49,r20 |
388 0248 00C0 rjmp .L176 |
389 .L56: |
390 024a F0E3 ldi r31,lo8(48) |
391 024c BF16 cp r11,r31 |
392 024e 01F4 brne .L65 |
393 0250 8BA9 ldd r24,Y+51 |
394 0252 84FD sbrc r24,4 |
395 0254 00C0 rjmp .L175 |
396 0256 8062 ori r24,lo8(32) |
397 0258 8BAB std Y+51,r24 |
398 025a 00C0 rjmp .L175 |
399 .L65: |
400 025c 8B2D mov r24,r11 |
401 025e 8153 subi r24,lo8(-(-49)) |
402 0260 8930 cpi r24,lo8(9) |
403 0262 00F4 brsh .L68 |
404 0264 20E0 ldi r18,lo8(0) |
405 0266 30E0 ldi r19,hi8(0) |
406 .L70: |
407 0268 C901 movw r24,r18 |
408 026a F3E0 ldi r31,3 |
409 026c 880F 1: lsl r24 |
410 026e 991F rol r25 |
411 0270 FA95 dec r31 |
412 0272 01F4 brne 1b |
413 0274 220F lsl r18 |
414 0276 331F rol r19 |
415 0278 280F add r18,r24 |
416 027a 391F adc r19,r25 |
417 027c 2B0D add r18,r11 |
418 027e 311D adc r19,__zero_reg__ |
419 0280 2053 subi r18,lo8(-(-48)) |
420 0282 3040 sbci r19,hi8(-(-48)) |
421 0284 EEA5 ldd r30,Y+46 |
422 0286 FFA5 ldd r31,Y+47 |
423 0288 CF01 movw r24,r30 |
424 028a 0196 adiw r24,1 |
425 028c 9FA7 std Y+47,r25 |
426 028e 8EA7 std Y+46,r24 |
427 /* #APP */ |
428 0290 B490 lpm r11, Z |
429 |
430 /* #NOAPP */ |
431 0292 8B2D mov r24,r11 |
432 0294 8053 subi r24,lo8(-(-48)) |
433 0296 8A30 cpi r24,lo8(10) |
434 0298 00F0 brlo .L70 |
435 029a 2AAB std Y+50,r18 |
436 029c 00C0 rjmp .L176 |
437 .L68: |
438 029e 98E6 ldi r25,lo8(104) |
439 02a0 B916 cp r11,r25 |
440 02a2 01F4 brne .L72 |
441 02a4 EBA9 ldd r30,Y+51 |
442 02a6 E460 ori r30,lo8(4) |
443 02a8 EBAB std Y+51,r30 |
444 02aa 00C0 rjmp .L175 |
445 .L156: |
446 02ac B982 std Y+1,r11 |
447 02ae 00C0 rjmp .L175 |
448 .L155: |
449 02b0 FBA9 ldd r31,Y+51 |
450 02b2 F860 ori r31,lo8(8) |
451 .L169: |
452 02b4 FBAB std Y+51,r31 |
453 02b6 00C0 rjmp .L175 |
454 .L72: |
455 02b8 8CE6 ldi r24,lo8(108) |
456 02ba B816 cp r11,r24 |
457 02bc 01F4 brne .L74 |
458 02be 9BA9 ldd r25,Y+51 |
459 02c0 9160 ori r25,lo8(1) |
460 02c2 9BAB std Y+51,r25 |
461 02c4 00C0 rjmp .L175 |
462 .L74: |
463 02c6 BD83 std Y+5,r27 |
464 02c8 AC83 std Y+4,r26 |
465 02ca E3E6 ldi r30,lo8(99) |
466 02cc BE16 cp r11,r30 |
467 02ce 01F4 brne .L76 |
468 02d0 1296 adiw r26,2 |
469 02d2 BD83 std Y+5,r27 |
470 02d4 AC83 std Y+4,r26 |
471 02d6 1297 sbiw r26,2 |
472 02d8 8C91 ld r24,X |
473 02da 8E83 std Y+6,r24 |
474 02dc 00C0 rjmp .L174 |
475 .L76: |
476 02de F4E4 ldi r31,lo8(68) |
477 02e0 BF16 cp r11,r31 |
478 02e2 01F0 breq .L79 |
479 02e4 84E6 ldi r24,lo8(100) |
480 02e6 B816 cp r11,r24 |
481 02e8 01F0 breq .L81 |
482 02ea 99E6 ldi r25,lo8(105) |
483 02ec B916 cp r11,r25 |
484 02ee 01F4 brne .L166 |
485 02f0 00C0 rjmp .L81 |
486 .L79: |
487 02f2 EBA9 ldd r30,Y+51 |
488 02f4 E160 ori r30,lo8(1) |
489 02f6 EBAB std Y+51,r30 |
490 .L81: |
491 02f8 FBA9 ldd r31,Y+51 |
492 02fa F0FF sbrs r31,0 |
493 02fc 00C0 rjmp .L84 |
494 02fe 1496 adiw r26,4 |
495 0300 BD83 std Y+5,r27 |
496 0302 AC83 std Y+4,r26 |
497 0304 5E90 ld r5,-X |
498 0306 4E90 ld r4,-X |
499 0308 3E90 ld r3,-X |
500 030a 2E90 ld r2,-X |
501 030c 00C0 rjmp .L86 |
502 .L84: |
503 030e 1296 adiw r26,2 |
504 0310 BD83 std Y+5,r27 |
505 0312 AC83 std Y+4,r26 |
506 0314 9E91 ld r25,-X |
507 0316 8E91 ld r24,-X |
508 0318 1C01 movw r2,r24 |
509 031a 4424 clr r4 |
510 031c 37FC sbrc r3,7 |
511 031e 4094 com r4 |
512 0320 542C mov r5,r4 |
513 .L86: |
514 0322 57FC sbrc r5,7 |
515 0324 00C0 rjmp .L87 |
516 0326 8AE0 ldi r24,lo8(10) |
517 0328 88AB std Y+48,r24 |
518 032a 00C0 rjmp .L89 |
519 .L87: |
520 032c 5094 com r5 |
521 032e 4094 com r4 |
522 0330 3094 com r3 |
523 0332 2094 com r2 |
524 0334 211C adc r2,__zero_reg__ |
525 0336 311C adc r3,__zero_reg__ |
526 0338 411C adc r4,__zero_reg__ |
527 033a 511C adc r5,__zero_reg__ |
528 033c 8DE2 ldi r24,lo8(45) |
529 033e 8983 std Y+1,r24 |
530 0340 9AE0 ldi r25,lo8(10) |
531 0342 98AB std Y+48,r25 |
532 0344 00C0 rjmp .L89 |
533 .L166: |
534 0346 EFE4 ldi r30,lo8(79) |
535 0348 BE16 cp r11,r30 |
536 034a 01F0 breq .L90 |
537 034c FFE6 ldi r31,lo8(111) |
538 034e BF16 cp r11,r31 |
539 0350 01F4 brne .L92 |
540 0352 88E0 ldi r24,lo8(8) |
541 0354 00C0 rjmp .L170 |
542 .L90: |
543 0356 9BA9 ldd r25,Y+51 |
544 0358 9160 ori r25,lo8(1) |
545 035a 9BAB std Y+51,r25 |
546 035c E8E0 ldi r30,lo8(8) |
547 035e 00C0 rjmp .L171 |
548 .L92: |
549 0360 F0E7 ldi r31,lo8(112) |
550 0362 BF16 cp r11,r31 |
551 0364 01F4 brne .L95 |
552 0366 1296 adiw r26,2 |
553 0368 BD83 std Y+5,r27 |
554 036a AC83 std Y+4,r26 |
555 036c 9E91 ld r25,-X |
556 036e 8E91 ld r24,-X |
557 0370 1C01 movw r2,r24 |
558 0372 4424 clr r4 |
559 0374 5524 clr r5 |
560 0376 8BA9 ldd r24,Y+51 |
561 0378 8064 ori r24,lo8(64) |
562 037a 8BAB std Y+51,r24 |
563 037c 78E7 ldi r23,lo8(120) |
564 037e B72E mov r11,r23 |
565 0380 00C0 rjmp .L172 |
566 .L95: |
567 0382 E3E7 ldi r30,lo8(115) |
568 0384 BE16 cp r11,r30 |
569 0386 01F4 brne .L97 |
570 0388 1296 adiw r26,2 |
571 038a BD83 std Y+5,r27 |
572 038c AC83 std Y+4,r26 |
573 038e DE90 ld r13,-X |
574 0390 CE90 ld r12,-X |
575 0392 C114 cp r12,__zero_reg__ |
576 0394 D104 cpc r13,__zero_reg__ |
577 0396 01F4 brne .L99 |
578 0398 88E2 ldi r24,lo8(40) |
579 039a 8E83 std Y+6,r24 |
580 039c 8EE6 ldi r24,lo8(110) |
581 039e 8F83 std Y+7,r24 |
582 03a0 85E7 ldi r24,lo8(117) |
583 03a2 8887 std Y+8,r24 |
584 03a4 8CE6 ldi r24,lo8(108) |
585 03a6 8987 std Y+9,r24 |
586 03a8 8A87 std Y+10,r24 |
587 03aa 89E2 ldi r24,lo8(41) |
588 03ac 8B87 std Y+11,r24 |
589 03ae 1C86 std Y+12,__zero_reg__ |
590 03b0 66E0 ldi r22,lo8(6) |
591 03b2 C62E mov r12,r22 |
592 03b4 D12C mov r13,__zero_reg__ |
593 03b6 CC0E add r12,r28 |
594 03b8 DD1E adc r13,r29 |
595 .L99: |
596 03ba F9A9 ldd r31,Y+49 |
597 03bc F7FD sbrc r31,7 |
598 03be 00C0 rjmp .L101 |
599 03c0 4F2F mov r20,r31 |
600 03c2 5527 clr r21 |
601 03c4 47FD sbrc r20,7 |
602 03c6 5095 com r21 |
603 03c8 60E0 ldi r22,lo8(0) |
604 03ca 70E0 ldi r23,hi8(0) |
605 03cc C601 movw r24,r12 |
606 03ce 0E94 0000 call memchr |
607 03d2 0097 sbiw r24,0 |
608 03d4 01F4 brne .L103 |
609 03d6 19A9 ldd r17,Y+49 |
610 03d8 00C0 rjmp .L105 |
611 .L103: |
612 03da 8C19 sub r24,r12 |
613 03dc 19A9 ldd r17,Y+49 |
614 03de 8117 cp r24,r17 |
615 03e0 04F4 brge .L105 |
616 03e2 182F mov r17,r24 |
617 03e4 00C0 rjmp .L105 |
618 .L101: |
619 03e6 F601 movw r30,r12 |
620 03e8 0190 ld __tmp_reg__,Z+ |
621 03ea 0020 tst __tmp_reg__ |
622 03ec 01F4 brne .-6 |
623 03ee 3197 sbiw r30,1 |
624 03f0 1E2F mov r17,r30 |
625 03f2 1C19 sub r17,r12 |
626 .L105: |
627 03f4 1982 std Y+1,__zero_reg__ |
628 03f6 4201 movw r8,r4 |
629 03f8 3101 movw r6,r2 |
630 03fa 40E0 ldi r20,lo8(0) |
631 03fc 00C0 rjmp .L107 |
632 .L97: |
633 03fe 85E5 ldi r24,lo8(85) |
634 0400 B816 cp r11,r24 |
635 0402 01F0 breq .L108 |
636 0404 95E7 ldi r25,lo8(117) |
637 0406 B916 cp r11,r25 |
638 0408 01F4 brne .L110 |
639 040a EAE0 ldi r30,lo8(10) |
640 .L171: |
641 040c E8AB std Y+48,r30 |
642 040e 00C0 rjmp .L94 |
643 .L108: |
644 0410 FBA9 ldd r31,Y+51 |
645 0412 F160 ori r31,lo8(1) |
646 0414 FBAB std Y+51,r31 |
647 0416 8AE0 ldi r24,lo8(10) |
648 .L170: |
649 0418 88AB std Y+48,r24 |
650 041a 00C0 rjmp .L94 |
651 .L110: |
652 041c 98E5 ldi r25,lo8(88) |
653 041e B916 cp r11,r25 |
654 0420 01F0 breq .L112 |
655 0422 E8E7 ldi r30,lo8(120) |
656 0424 BE16 cp r11,r30 |
657 0426 01F0 breq .+2 |
658 0428 00C0 rjmp .L114 |
659 .L112: |
660 042a FBA9 ldd r31,Y+51 |
661 042c F3FD sbrc r31,3 |
662 042e 00C0 rjmp .L115 |
663 0430 80E1 ldi r24,lo8(16) |
664 0432 00C0 rjmp .L170 |
665 .L115: |
666 0434 2114 cp r2,__zero_reg__ |
667 0436 3104 cpc r3,__zero_reg__ |
668 0438 4104 cpc r4,__zero_reg__ |
669 043a 5104 cpc r5,__zero_reg__ |
670 043c 01F4 brne .L117 |
671 .L172: |
672 043e 90E1 ldi r25,lo8(16) |
673 0440 98AB std Y+48,r25 |
674 0442 00C0 rjmp .L94 |
675 .L117: |
676 0444 EBA9 ldd r30,Y+51 |
677 0446 E064 ori r30,lo8(64) |
678 0448 EBAB std Y+51,r30 |
679 044a F0E1 ldi r31,lo8(16) |
680 044c F8AB std Y+48,r31 |
681 .L94: |
682 044e 1982 std Y+1,__zero_reg__ |
683 .L89: |
684 0450 89A9 ldd r24,Y+49 |
685 0452 87FD sbrc r24,7 |
686 0454 00C0 rjmp .L119 |
687 0456 9BA9 ldd r25,Y+51 |
688 0458 9F7D andi r25,lo8(-33) |
689 045a 9BAB std Y+51,r25 |
690 .L119: |
691 045c 2114 cp r2,__zero_reg__ |
692 045e 3104 cpc r3,__zero_reg__ |
693 0460 4104 cpc r4,__zero_reg__ |
694 0462 5104 cpc r5,__zero_reg__ |
695 0464 01F4 brne .L121 |
696 0466 E9A9 ldd r30,Y+49 |
697 0468 EE23 tst r30 |
698 046a 01F4 brne .L121 |
699 046c 6624 clr r6 |
700 046e 7724 clr r7 |
701 0470 4301 movw r8,r6 |
702 0472 5EE2 ldi r21,lo8(46) |
703 0474 C52E mov r12,r21 |
704 0476 D12C mov r13,__zero_reg__ |
705 0478 CC0E add r12,r28 |
706 047a DD1E adc r13,r29 |
707 047c 00C0 rjmp .L124 |
708 .L121: |
709 047e 4EE2 ldi r20,lo8(46) |
710 0480 C42E mov r12,r20 |
711 0482 D12C mov r13,__zero_reg__ |
712 0484 CC0E add r12,r28 |
713 0486 DD1E adc r13,r29 |
714 0488 F8A9 ldd r31,Y+48 |
715 048a EF2E mov r14,r31 |
716 048c FF24 clr r15 |
717 048e 0027 clr r16 |
718 0490 1127 clr r17 |
719 .L125: |
720 0492 C201 movw r24,r4 |
721 0494 B101 movw r22,r2 |
722 0496 A801 movw r20,r16 |
723 0498 9701 movw r18,r14 |
724 049a 0E94 0000 call __udivmodsi4 |
725 049e 6A30 cpi r22,lo8(10) |
726 04a0 00F4 brsh .L126 |
727 04a2 30E3 ldi r19,lo8(48) |
728 04a4 A32E mov r10,r19 |
729 04a6 A60E add r10,r22 |
730 04a8 00C0 rjmp .L128 |
731 .L126: |
732 04aa 27E5 ldi r18,lo8(87) |
733 04ac A22E mov r10,r18 |
734 04ae A60E add r10,r22 |
735 04b0 88E5 ldi r24,lo8(88) |
736 04b2 B816 cp r11,r24 |
737 04b4 01F4 brne .L128 |
738 04b6 9FED ldi r25,lo8(-33) |
739 04b8 A922 and r10,r25 |
740 .L128: |
741 04ba F601 movw r30,r12 |
742 04bc A292 st -Z,r10 |
743 04be 6F01 movw r12,r30 |
744 04c0 C201 movw r24,r4 |
745 04c2 B101 movw r22,r2 |
746 04c4 A801 movw r20,r16 |
747 04c6 9701 movw r18,r14 |
748 04c8 0E94 0000 call __udivmodsi4 |
749 04cc 3901 movw r6,r18 |
750 04ce 4A01 movw r8,r20 |
751 04d0 2E14 cp r2,r14 |
752 04d2 3F04 cpc r3,r15 |
753 04d4 4006 cpc r4,r16 |
754 04d6 5106 cpc r5,r17 |
755 04d8 00F0 brlo .L130 |
756 04da 1901 movw r2,r18 |
757 04dc 2A01 movw r4,r20 |
758 04de 00C0 rjmp .L125 |
759 .L130: |
760 04e0 F8A9 ldd r31,Y+48 |
761 04e2 F830 cpi r31,lo8(8) |
762 04e4 01F4 brne .L124 |
763 04e6 8BA9 ldd r24,Y+51 |
764 04e8 83FF sbrs r24,3 |
765 04ea 00C0 rjmp .L124 |
766 04ec 90E3 ldi r25,lo8(48) |
767 04ee A916 cp r10,r25 |
768 04f0 01F0 breq .L124 |
769 04f2 80E3 ldi r24,lo8(48) |
770 04f4 F601 movw r30,r12 |
771 04f6 8293 st -Z,r24 |
772 04f8 6F01 movw r12,r30 |
773 .L124: |
774 04fa CE01 movw r24,r28 |
775 04fc 8C19 sub r24,r12 |
776 04fe 182F mov r17,r24 |
777 0500 125D subi r17,lo8(-(46)) |
778 0502 49A9 ldd r20,Y+49 |
779 0504 00C0 rjmp .L107 |
780 .L114: |
781 0506 BB20 tst r11 |
782 0508 01F4 brne .+2 |
783 050a 00C0 rjmp .L152 |
784 050c BE82 std Y+6,r11 |
785 .L174: |
786 050e 1982 std Y+1,__zero_reg__ |
787 0510 4201 movw r8,r4 |
788 0512 3101 movw r6,r2 |
789 0514 00E0 ldi r16,lo8(0) |
790 0516 96E0 ldi r25,lo8(6) |
791 0518 C92E mov r12,r25 |
792 051a D12C mov r13,__zero_reg__ |
793 051c CC0E add r12,r28 |
794 051e DD1E adc r13,r29 |
795 0520 11E0 ldi r17,lo8(1) |
796 0522 21E0 ldi r18,lo8(1) |
797 0524 00C0 rjmp .L136 |
798 .L107: |
799 0526 212F mov r18,r17 |
800 0528 042F mov r16,r20 |
801 052a 011B sub r16,r17 |
802 052c 07FD sbrc r16,7 |
803 052e 00E0 ldi r16,lo8(0) |
804 .L136: |
805 0530 8981 ldd r24,Y+1 |
806 0532 8823 tst r24 |
807 0534 01F0 breq .L138 |
808 0536 812F mov r24,r17 |
809 0538 8F5F subi r24,lo8(-(1)) |
810 053a 00C0 rjmp .L140 |
811 .L138: |
812 053c 9BA9 ldd r25,Y+51 |
813 053e 96FD sbrc r25,6 |
814 0540 00C0 rjmp .L141 |
815 0542 812F mov r24,r17 |
816 0544 00C0 rjmp .L140 |
817 .L141: |
818 0546 822F mov r24,r18 |
819 0548 8E5F subi r24,lo8(-(2)) |
820 .L140: |
821 054a A82E mov r10,r24 |
822 054c A00E add r10,r16 |
823 054e EBA9 ldd r30,Y+51 |
824 0550 EE2E mov r14,r30 |
825 0552 FF24 clr r15 |
826 0554 80E3 ldi r24,lo8(48) |
827 0556 482E mov r4,r24 |
828 0558 512C mov r5,__zero_reg__ |
829 055a 4E20 and r4,r14 |
830 055c 5F20 and r5,r15 |
831 055e 4114 cp r4,__zero_reg__ |
832 0560 5104 cpc r5,__zero_reg__ |
833 0562 01F4 brne .L143 |
834 0564 8AA9 ldd r24,Y+50 |
835 0566 8A19 sub r24,r10 |
836 0568 0E94 0000 call PAD_SP |
837 .L143: |
838 056c 8981 ldd r24,Y+1 |
839 056e 8823 tst r24 |
840 0570 01F0 breq .L145 |
841 0572 61E0 ldi r22,lo8(1) |
842 0574 70E0 ldi r23,hi8(1) |
843 0576 CE01 movw r24,r28 |
844 0578 0196 adiw r24,1 |
845 057a 00C0 rjmp .L173 |
846 .L145: |
847 057c E6FE sbrs r14,6 |
848 057e 00C0 rjmp .L147 |
849 0580 80E3 ldi r24,lo8(48) |
850 0582 8A83 std Y+2,r24 |
851 0584 BB82 std Y+3,r11 |
852 0586 62E0 ldi r22,lo8(2) |
853 0588 70E0 ldi r23,hi8(2) |
854 058a CE01 movw r24,r28 |
855 058c 0296 adiw r24,2 |
856 .L173: |
857 058e 0E94 0000 call PRINT |
858 .L147: |
859 0592 F0E2 ldi r31,lo8(32) |
860 0594 4F16 cp r4,r31 |
861 0596 5104 cpc r5,__zero_reg__ |
862 0598 01F4 brne .L149 |
863 059a 8AA9 ldd r24,Y+50 |
864 059c 8A19 sub r24,r10 |
865 059e 0E94 0000 call PAD_0 |
866 .L149: |
867 05a2 802F mov r24,r16 |
868 05a4 0E94 0000 call PAD_0 |
869 05a8 612F mov r22,r17 |
870 05aa 7727 clr r23 |
871 05ac 67FD sbrc r22,7 |
872 05ae 7095 com r23 |
873 05b0 C601 movw r24,r12 |
874 05b2 0E94 0000 call PRINT |
875 05b6 E4FE sbrs r14,4 |
876 05b8 00C0 rjmp .L28 |
877 05ba 8AA9 ldd r24,Y+50 |
878 05bc 8A19 sub r24,r10 |
879 05be 0E94 0000 call PAD_SP |
880 05c2 00C0 rjmp .L28 |
881 .L35: |
882 .L152: |
883 /* epilogue: frame size=51 */ |
884 05c4 E396 adiw r28,51 |
885 05c6 0FB6 in __tmp_reg__,__SREG__ |
886 05c8 F894 cli |
887 05ca DEBF out __SP_H__,r29 |
888 05cc 0FBE out __SREG__,__tmp_reg__ |
889 05ce CDBF out __SP_L__,r28 |
890 05d0 DF91 pop r29 |
891 05d2 CF91 pop r28 |
892 05d4 1F91 pop r17 |
893 05d6 0F91 pop r16 |
894 05d8 FF90 pop r15 |
895 05da EF90 pop r14 |
896 05dc DF90 pop r13 |
897 05de CF90 pop r12 |
898 05e0 BF90 pop r11 |
899 05e2 AF90 pop r10 |
900 05e4 9F90 pop r9 |
901 05e6 8F90 pop r8 |
902 05e8 7F90 pop r7 |
903 05ea 6F90 pop r6 |
904 05ec 5F90 pop r5 |
905 05ee 4F90 pop r4 |
906 05f0 3F90 pop r3 |
907 05f2 2F90 pop r2 |
908 05f4 0895 ret |
909 /* epilogue end (size=25) */ |
910 /* function _printf_P size 692 (641) */ |
912 .comm DiffNick,2,1 |
913 .comm DiffRoll,2,1 |
914 .comm SenderOkay,1,1 |
915 .comm CosinusNickWinkel,1,1 |
916 .comm CosinusRollWinkel,1,1 |
917 .comm durchschnitt_northing,4,1 |
918 .comm durchschnitt_easting,4,1 |
919 .comm P_GPS_Verstaerkung,2,1 |
920 .comm D_GPS_Verstaerkung,2,1 |
921 .comm PrintZiel,1,1 |
922 .comm RemoteTasten,1,1 |
923 .comm Timeout,1,1 |
924 .comm IntegralNick,4,1 |
925 .comm IntegralNick2,4,1 |
926 .comm IntegralRoll,4,1 |
927 .comm IntegralRoll2,4,1 |
928 .comm Mess_IntegralNick,4,1 |
929 .comm Mess_IntegralNick2,4,1 |
930 .comm Mess_IntegralRoll,4,1 |
931 .comm Mess_IntegralRoll2,4,1 |
932 .comm Integral_Gier,4,1 |
933 .comm Mess_Integral_Gier,4,1 |
934 .comm h,1,1 |
935 .comm m,1,1 |
936 .comm s,1,1 |
937 .comm Motor_Vorne,1,1 |
938 .comm Motor_Hinten,1,1 |
939 .comm Motor_Rechts,1,1 |
940 .comm Motor_Links,1,1 |
941 .comm Count,1,1 |
942 .comm MotorWert,5,1 |
943 /* File "printf_P.c": code 784 = 0x0310 ( 708), prologues 36, epilogues 40 */ |
DEFINED SYMBOLS |
*ABS*:00000000 printf_P.c |
C:\DOKUME~1\none\LOKALE~1\Temp/cckjUW3h.s:3 *ABS*:0000003f __SREG__ |
C:\DOKUME~1\none\LOKALE~1\Temp/cckjUW3h.s:4 *ABS*:0000003e __SP_H__ |
C:\DOKUME~1\none\LOKALE~1\Temp/cckjUW3h.s:5 *ABS*:0000003d __SP_L__ |
C:\DOKUME~1\none\LOKALE~1\Temp/cckjUW3h.s:6 *ABS*:00000000 __tmp_reg__ |
C:\DOKUME~1\none\LOKALE~1\Temp/cckjUW3h.s:7 *ABS*:00000001 __zero_reg__ |
C:\DOKUME~1\none\LOKALE~1\Temp/cckjUW3h.s:13 .text:00000000 Putchar |
*COM*:00000001 PrintZiel |
C:\DOKUME~1\none\LOKALE~1\Temp/cckjUW3h.s:45 .text:00000032 PAD_0 |
C:\DOKUME~1\none\LOKALE~1\Temp/cckjUW3h.s:66 .text:00000048 PAD_SP |
C:\DOKUME~1\none\LOKALE~1\Temp/cckjUW3h.s:87 .text:0000005e PRINTP |
C:\DOKUME~1\none\LOKALE~1\Temp/cckjUW3h.s:122 .text:0000008a PRINT |
C:\DOKUME~1\none\LOKALE~1\Temp/cckjUW3h.s:152 .text:000000b2 _printf_P |
*COM*:00000002 DiffNick |
*COM*:00000002 DiffRoll |
*COM*:00000001 SenderOkay |
*COM*:00000001 CosinusNickWinkel |
*COM*:00000001 CosinusRollWinkel |
*COM*:00000004 durchschnitt_northing |
*COM*:00000004 durchschnitt_easting |
*COM*:00000002 P_GPS_Verstaerkung |
*COM*:00000002 D_GPS_Verstaerkung |
*COM*:00000001 RemoteTasten |
*COM*:00000001 Timeout |
*COM*:00000004 IntegralNick |
*COM*:00000004 IntegralNick2 |
*COM*:00000004 IntegralRoll |
*COM*:00000004 IntegralRoll2 |
*COM*:00000004 Mess_IntegralNick |
*COM*:00000004 Mess_IntegralNick2 |
*COM*:00000004 Mess_IntegralRoll |
*COM*:00000004 Mess_IntegralRoll2 |
*COM*:00000004 Integral_Gier |
*COM*:00000004 Mess_Integral_Gier |
*COM*:00000001 h |
*COM*:00000001 m |
*COM*:00000001 s |
*COM*:00000001 Motor_Vorne |
*COM*:00000001 Motor_Hinten |
*COM*:00000001 Motor_Rechts |
*COM*:00000001 Motor_Links |
*COM*:00000001 Count |
*COM*:00000005 MotorWert |
UNDEFINED SYMBOLS |
__do_copy_data |
__do_clear_bss |
DispPtr |
DisplayBuff |
uart_putchar |
memchr |
__udivmodsi4 |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/rc.c |
---|
0,0 → 1,85 |
/*####################################################################################### |
Decodieren eines RC Summen Signals |
#######################################################################################*/ |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "rc.h" |
#include "main.h" |
volatile int PPM_in[15]; |
volatile int PPM_diff[15]; // das diffenzierte Stick-Signal |
volatile unsigned char NewPpmData = 1; |
//############################################################################ |
//zum decodieren des PPM-Signals wird Timer1 mit seiner Input |
//Capture Funktion benutzt: |
void rc_sum_init (void) |
//############################################################################ |
{ |
TCCR1B=(1<<CS11)|(1<<CS10)|(1<<ICES1)|(1<<ICNC1);//|(1 << WGM12); //timer1 prescale 64 |
// PWM |
//TCCR1A = (1 << COM1B1) | (1 << WGM11) | (1 << WGM10); |
//TCCR1B |= (1 << WGM12); |
//OCR1B = 55; |
TIMSK1 |= _BV(ICIE1); |
AdNeutralGier = 0; |
AdNeutralRoll = 0; |
AdNeutralNick = 0; |
return; |
} |
//############################################################################ |
//Diese Routine startet und inizialisiert den Timer für RC |
SIGNAL(SIG_INPUT_CAPTURE1) |
//############################################################################ |
{ |
static unsigned int AltICR=0; |
signed int signal = 0; |
static int index; |
signal = (unsigned int) ICR1 - AltICR; |
AltICR = ICR1; |
//Syncronisationspause? |
if ((signal > 1500) && (signal < 8000)) |
{ |
index = 1; |
NewPpmData = 0; // Null bedeutet: Neue Daten |
// OCR2A = Poti2/2 + 80; |
} |
else |
{ |
if(index < 14) |
{ |
if((signal > 250) && (signal < 687)) |
{ |
signal -= 466; |
// Stabiles Signal |
if(abs(signal - PPM_in[index]) < 6) { if(SenderOkay < 200) SenderOkay += 10;} |
signal = (3 * (PPM_in[index]) + signal) / 4; |
//373 entspricht ca. 1.5ms also Mittelstellung |
PPM_diff[index] = signal - PPM_in[index]; |
PPM_in[index] = signal; |
} |
index++; |
/* if(index == 5) PORTD |= 0x20; else PORTD &= ~0x20; // Servosignal an J3 anlegen |
if(index == 6) PORTD |= 0x10; else PORTD &= ~0x10; // Servosignal an J4 anlegen |
if(index == 7) PORTD |= 0x08; else PORTD &= ~0x08; // Servosignal an J5 anlegen */ |
} |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/rc.d |
---|
0,0 → 1,2 |
rc.o rc.d : rc.c rc.h main.h old_macros.h _Settings.h printf_P.h timer0.h \ |
uart.h analog.h twimaster.h menu.h fc.h gps.h |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/rc.h |
---|
0,0 → 1,29 |
/*####################################################################################### |
Derkodieren eines RC Summen Signals |
#######################################################################################*/ |
#ifndef _RC_H |
#define _RC_H |
#if defined (__AVR_ATmega32__) |
#define TIMER_TEILER CK64 |
#define TIMER_RELOAD_VALUE 250 |
#endif |
#if defined (__AVR_ATmega644__) |
//#define TIMER_TEILER CK64 |
#define TIMER_RELOAD_VALUE 250 |
//#define TIMER_TEILER CK256 // bei 20MHz |
//#define TIMER_RELOAD_VALUE -78 // bei 20MHz |
#endif |
#define GAS PPM_in[2] |
extern void rc_sum_init (void); |
extern volatile int PPM_in[15]; |
extern volatile int PPM_diff[15]; // das diffenzierte Stick-Signal |
extern volatile unsigned char NewPpmData; |
#endif //_RC_H |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/rc.lst |
---|
0,0 → 1,274 |
1 .file "rc.c" |
2 .arch atmega644 |
3 __SREG__ = 0x3f |
4 __SP_H__ = 0x3e |
5 __SP_L__ = 0x3d |
6 __tmp_reg__ = 0 |
7 __zero_reg__ = 1 |
8 .global __do_copy_data |
9 .global __do_clear_bss |
10 .text |
11 .global rc_sum_init |
13 rc_sum_init: |
14 /* prologue: frame size=0 */ |
15 /* prologue end (size=0) */ |
16 0000 83EC ldi r24,lo8(-61) |
17 0002 8093 8100 sts 129,r24 |
18 0006 EFE6 ldi r30,lo8(111) |
19 0008 F0E0 ldi r31,hi8(111) |
20 000a 8081 ld r24,Z |
21 000c 8062 ori r24,lo8(32) |
22 000e 8083 st Z,r24 |
23 0010 1092 0000 sts (AdNeutralGier)+1,__zero_reg__ |
24 0014 1092 0000 sts AdNeutralGier,__zero_reg__ |
25 0018 1092 0000 sts (AdNeutralRoll)+1,__zero_reg__ |
26 001c 1092 0000 sts AdNeutralRoll,__zero_reg__ |
27 0020 1092 0000 sts (AdNeutralNick)+1,__zero_reg__ |
28 0024 1092 0000 sts AdNeutralNick,__zero_reg__ |
29 /* epilogue: frame size=0 */ |
30 0028 0895 ret |
31 /* epilogue end (size=1) */ |
32 /* function rc_sum_init size 21 (20) */ |
34 .global __vector_12 |
36 __vector_12: |
37 /* prologue: frame size=0 */ |
38 002a 1F92 push __zero_reg__ |
39 002c 0F92 push __tmp_reg__ |
40 002e 0FB6 in __tmp_reg__,__SREG__ |
41 0030 0F92 push __tmp_reg__ |
42 0032 1124 clr __zero_reg__ |
43 0034 0F93 push r16 |
44 0036 1F93 push r17 |
45 0038 2F93 push r18 |
46 003a 3F93 push r19 |
47 003c 4F93 push r20 |
48 003e 5F93 push r21 |
49 0040 6F93 push r22 |
50 0042 7F93 push r23 |
51 0044 8F93 push r24 |
52 0046 9F93 push r25 |
53 0048 AF93 push r26 |
54 004a BF93 push r27 |
55 004c CF93 push r28 |
56 004e DF93 push r29 |
57 0050 EF93 push r30 |
58 0052 FF93 push r31 |
59 /* prologue end (size=21) */ |
60 0054 2091 8600 lds r18,134 |
61 0058 3091 8700 lds r19,(134)+1 |
62 005c 8091 0000 lds r24,AltICR.2005 |
63 0060 9091 0000 lds r25,(AltICR.2005)+1 |
64 0064 281B sub r18,r24 |
65 0066 390B sbc r19,r25 |
66 0068 8091 8600 lds r24,134 |
67 006c 9091 8700 lds r25,(134)+1 |
68 0070 9093 0000 sts (AltICR.2005)+1,r25 |
69 0074 8093 0000 sts AltICR.2005,r24 |
70 0078 C901 movw r24,r18 |
71 007a 8D5D subi r24,lo8(-(-1501)) |
72 007c 9540 sbci r25,hi8(-(-1501)) |
73 007e 8356 subi r24,lo8(6499) |
74 0080 9941 sbci r25,hi8(6499) |
75 0082 00F4 brsh .L4 |
76 0084 81E0 ldi r24,lo8(1) |
77 0086 90E0 ldi r25,hi8(1) |
78 0088 9093 0000 sts (index.2007)+1,r25 |
79 008c 8093 0000 sts index.2007,r24 |
80 0090 1092 0000 sts NewPpmData,__zero_reg__ |
81 0094 00C0 rjmp .L14 |
82 .L4: |
83 0096 C091 0000 lds r28,index.2007 |
84 009a D091 0000 lds r29,(index.2007)+1 |
85 009e CE30 cpi r28,14 |
86 00a0 D105 cpc r29,__zero_reg__ |
87 00a2 04F0 brlt .+2 |
88 00a4 00C0 rjmp .L14 |
89 00a6 C901 movw r24,r18 |
90 00a8 8B5F subi r24,lo8(-(-251)) |
91 00aa 9040 sbci r25,hi8(-(-251)) |
92 00ac 845B subi r24,lo8(436) |
93 00ae 9140 sbci r25,hi8(436) |
94 00b0 00F0 brlo .+2 |
95 00b2 00C0 rjmp .L8 |
96 00b4 A901 movw r20,r18 |
97 00b6 425D subi r20,lo8(-(-466)) |
98 00b8 5140 sbci r21,hi8(-(-466)) |
99 00ba FE01 movw r30,r28 |
100 00bc EE0F lsl r30 |
101 00be FF1F rol r31 |
102 00c0 E050 subi r30,lo8(-(PPM_in)) |
103 00c2 F040 sbci r31,hi8(-(PPM_in)) |
104 00c4 8081 ld r24,Z |
105 00c6 9181 ldd r25,Z+1 |
106 00c8 FA01 movw r30,r20 |
107 00ca E81B sub r30,r24 |
108 00cc F90B sbc r31,r25 |
109 00ce CF01 movw r24,r30 |
110 00d0 F7FF sbrs r31,7 |
111 00d2 00C0 rjmp .L11 |
112 00d4 9095 com r25 |
113 00d6 8195 neg r24 |
114 00d8 9F4F sbci r25,lo8(-1) |
115 .L11: |
116 00da 0697 sbiw r24,6 |
117 00dc 04F4 brge .L10 |
118 00de 8091 0000 lds r24,SenderOkay |
119 00e2 883C cpi r24,lo8(-56) |
120 00e4 00F4 brsh .L10 |
121 00e6 8091 0000 lds r24,SenderOkay |
122 00ea 865F subi r24,lo8(-(10)) |
123 00ec 8093 0000 sts SenderOkay,r24 |
124 .L10: |
125 00f0 FE01 movw r30,r28 |
126 00f2 EE0F lsl r30 |
127 00f4 FF1F rol r31 |
128 00f6 8F01 movw r16,r30 |
129 00f8 0050 subi r16,lo8(-(PPM_in)) |
130 00fa 1040 sbci r17,hi8(-(PPM_in)) |
131 00fc D801 movw r26,r16 |
132 00fe 2D91 ld r18,X+ |
133 0100 3C91 ld r19,X |
134 0102 C901 movw r24,r18 |
135 0104 880F lsl r24 |
136 0106 991F rol r25 |
137 0108 820F add r24,r18 |
138 010a 931F adc r25,r19 |
139 010c 840F add r24,r20 |
140 010e 951F adc r25,r21 |
141 0110 64E0 ldi r22,lo8(4) |
142 0112 70E0 ldi r23,hi8(4) |
143 0114 0E94 0000 call __divmodhi4 |
144 0118 D801 movw r26,r16 |
145 011a 8D91 ld r24,X+ |
146 011c 9C91 ld r25,X |
147 011e 1197 sbiw r26,1 |
148 0120 9B01 movw r18,r22 |
149 0122 281B sub r18,r24 |
150 0124 390B sbc r19,r25 |
151 0126 E050 subi r30,lo8(-(PPM_diff)) |
152 0128 F040 sbci r31,hi8(-(PPM_diff)) |
153 012a 3183 std Z+1,r19 |
154 012c 2083 st Z,r18 |
155 012e 1196 adiw r26,1 |
156 0130 7C93 st X,r23 |
157 0132 6E93 st -X,r22 |
158 .L8: |
159 0134 2196 adiw r28,1 |
160 0136 D093 0000 sts (index.2007)+1,r29 |
161 013a C093 0000 sts index.2007,r28 |
162 .L14: |
163 /* epilogue: frame size=0 */ |
164 013e FF91 pop r31 |
165 0140 EF91 pop r30 |
166 0142 DF91 pop r29 |
167 0144 CF91 pop r28 |
168 0146 BF91 pop r27 |
169 0148 AF91 pop r26 |
170 014a 9F91 pop r25 |
171 014c 8F91 pop r24 |
172 014e 7F91 pop r23 |
173 0150 6F91 pop r22 |
174 0152 5F91 pop r21 |
175 0154 4F91 pop r20 |
176 0156 3F91 pop r19 |
177 0158 2F91 pop r18 |
178 015a 1F91 pop r17 |
179 015c 0F91 pop r16 |
180 015e 0F90 pop __tmp_reg__ |
181 0160 0FBE out __SREG__,__tmp_reg__ |
182 0162 0F90 pop __tmp_reg__ |
183 0164 1F90 pop __zero_reg__ |
184 0166 1895 reti |
185 /* epilogue end (size=21) */ |
186 /* function __vector_12 size 162 (120) */ |
188 .global NewPpmData |
189 .data |
192 NewPpmData: |
193 0000 01 .byte 1 |
194 .lcomm index.2007,2 |
195 .lcomm AltICR.2005,2 |
196 .comm PPM_in,30,1 |
197 .comm PPM_diff,30,1 |
198 .comm DiffNick,2,1 |
199 .comm DiffRoll,2,1 |
200 .comm SenderOkay,1,1 |
201 .comm CosinusNickWinkel,1,1 |
202 .comm CosinusRollWinkel,1,1 |
203 .comm durchschnitt_northing,4,1 |
204 .comm durchschnitt_easting,4,1 |
205 .comm P_GPS_Verstaerkung,2,1 |
206 .comm D_GPS_Verstaerkung,2,1 |
207 .comm RemoteTasten,1,1 |
208 .comm Timeout,1,1 |
209 .comm IntegralNick,4,1 |
210 .comm IntegralNick2,4,1 |
211 .comm IntegralRoll,4,1 |
212 .comm IntegralRoll2,4,1 |
213 .comm Mess_IntegralNick,4,1 |
214 .comm Mess_IntegralNick2,4,1 |
215 .comm Mess_IntegralRoll,4,1 |
216 .comm Mess_IntegralRoll2,4,1 |
217 .comm Integral_Gier,4,1 |
218 .comm Mess_Integral_Gier,4,1 |
219 .comm h,1,1 |
220 .comm m,1,1 |
221 .comm s,1,1 |
222 .comm Motor_Vorne,1,1 |
223 .comm Motor_Hinten,1,1 |
224 .comm Motor_Rechts,1,1 |
225 .comm Motor_Links,1,1 |
226 .comm Count,1,1 |
227 .comm MotorWert,5,1 |
228 /* File "rc.c": code 183 = 0x00b7 ( 140), prologues 21, epilogues 22 */ |
DEFINED SYMBOLS |
*ABS*:00000000 rc.c |
C:\DOKUME~1\none\LOKALE~1\Temp/ccvMRwBf.s:3 *ABS*:0000003f __SREG__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccvMRwBf.s:4 *ABS*:0000003e __SP_H__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccvMRwBf.s:5 *ABS*:0000003d __SP_L__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccvMRwBf.s:6 *ABS*:00000000 __tmp_reg__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccvMRwBf.s:7 *ABS*:00000001 __zero_reg__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccvMRwBf.s:13 .text:00000000 rc_sum_init |
C:\DOKUME~1\none\LOKALE~1\Temp/ccvMRwBf.s:36 .text:0000002a __vector_12 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccvMRwBf.s:194 .bss:00000002 AltICR.2005 |
.bss:00000000 index.2007 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccvMRwBf.s:192 .data:00000000 NewPpmData |
*COM*:0000001e PPM_in |
*COM*:00000001 SenderOkay |
*COM*:0000001e PPM_diff |
*COM*:00000002 DiffNick |
*COM*:00000002 DiffRoll |
*COM*:00000001 CosinusNickWinkel |
*COM*:00000001 CosinusRollWinkel |
*COM*:00000004 durchschnitt_northing |
*COM*:00000004 durchschnitt_easting |
*COM*:00000002 P_GPS_Verstaerkung |
*COM*:00000002 D_GPS_Verstaerkung |
*COM*:00000001 RemoteTasten |
*COM*:00000001 Timeout |
*COM*:00000004 IntegralNick |
*COM*:00000004 IntegralNick2 |
*COM*:00000004 IntegralRoll |
*COM*:00000004 IntegralRoll2 |
*COM*:00000004 Mess_IntegralNick |
*COM*:00000004 Mess_IntegralNick2 |
*COM*:00000004 Mess_IntegralRoll |
*COM*:00000004 Mess_IntegralRoll2 |
*COM*:00000004 Integral_Gier |
*COM*:00000004 Mess_Integral_Gier |
*COM*:00000001 h |
*COM*:00000001 m |
*COM*:00000001 s |
*COM*:00000001 Motor_Vorne |
*COM*:00000001 Motor_Hinten |
*COM*:00000001 Motor_Rechts |
*COM*:00000001 Motor_Links |
*COM*:00000001 Count |
*COM*:00000005 MotorWert |
UNDEFINED SYMBOLS |
__do_copy_data |
__do_clear_bss |
AdNeutralGier |
AdNeutralRoll |
AdNeutralNick |
__divmodhi4 |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/spi.c |
---|
0,0 → 1,623 |
/* |
This program (files spi.c and spi.h) is free software; you can redistribute it and/or modify |
it under the terms of the GNU General Public License as published by the Free Software Foundation; |
either version 3 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License for more details. You should have received a copy of the GNU General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
Please note: All the other files for the project "Mikrokopter" by H.Buss are under the license (license_buss.txt) published by www.mikrokopter.de |
*/ |
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
Patrick Kögel |
Micromag3 Auswertung beta |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ |
//***************************************************************************** |
// |
// File Name : 'spi.c' |
// Title : SPI interface driver |
// Author : Pascal Stang - Copyright (C) 2000-2002 |
// Created : 11/22/2000 |
// Revised : 06/06/2002 |
// Version : 0.6 |
// Target MCU : Atmel AVR series |
// Editor Tabs : 4 |
// |
// NOTE: This code is currently below version 1.0, and therefore is considered |
// to be lacking in some functionality or documentation, or may not be fully |
// tested. Nonetheless, you can expect most functions to work. |
// |
// This code is distributed under the GNU Public License |
// which can be found at http://www.gnu.org/licenses/gpl.txt |
// |
//***************************************************************************** |
#include "main.h" |
// Define the SPI_USEINT key if you want SPI bus operation to be |
// interrupt-driven. The primary reason for not using SPI in |
// interrupt-driven mode is if the SPI send/transfer commands |
// will be used from within some other interrupt service routine |
// or if interrupts might be globally turned off due to of other |
// aspects of your program |
// |
// Comment-out or uncomment this line as necessary |
//#define SPI_USEINT |
// global variables |
volatile unsigned char spiTransferComplete,MessungFertig=0,KompassInUse =0,KompassInUseCal=0,NewX= 0,NewY= 0,NewZ= 0,EEPROMWrite=0; |
volatile signed char nickgrad=0,rollgrad=0,nickgradkomp=0,rollgradkomp=0; |
volatile double XE= 0,YE=0,nick=0,roll=0; |
volatile double richtungorgd=0,richtungorgr=0; |
volatile int iXsf=0,iYsf=0,iZsf=0; |
volatile int Xoffset=0, Yoffset=0, Zoffset=0; |
volatile signed int Xmax=-32768 , Xmin=32767, Ymax=-32768, Ymin=32767, Zmin=32767, Zmax=-32768; // where you store max and min X and Ys |
volatile int XrawOld=0, YrawOld=0, ZrawOld=0; // save values you get from the ASIC |
volatile int Xraw=0, Yraw=0, Zraw=0; // values you get from the ASIC |
volatile double XrawCal=0, YrawCal=0, ZrawCal=0; // values you get from the ASIC |
double XEx=0,XEy=0,XEz=0,YEy=0,YEz=0; |
int MagnetG=0; |
typedef struct |
{ |
int Xoffsetm; |
int Yoffsetm; |
int Zoffsetm; |
int iXsfm; |
int iYsfm; |
int iZsfm; |
int dummy; |
} CALPARAKOMPASS ; |
CALPARAKOMPASS CalParaKompass; |
volatile int azimuthgrad= 0,azimuthold = 0; |
// SPI interrupt service handler |
#ifdef SPI_USEINT |
SIGNAL(SIG_SPI) |
{ |
spiTransferComplete = 1; |
} |
#endif |
// access routines |
//------------------------------------------------------------------------------ |
// Name: |
// Function: |
// |
// Parameter: |
// Return: |
//------------------------------------------------------------------------------ |
void spiInit(void) |
{ |
// setup SPI I/O pins |
sbi(PORTB, 7); // set SCK hi |
sbi(DDRB, 7); // set SCK as output |
cbi(DDRB, 6); // set MISO as input |
sbi(DDRB, 5); // set MOSI as output |
sbi(DDRD, 5); // SS must be output for Master mode to work |
sbi(DDRD, 3); // Reset output |
cbi(DDRD, 4); // DataReady as input |
// setup SPI interface : |
// master mode |
sbi(SPCR, MSTR); |
// clock = f/32 -> 20 MHZ /32 |
sbi(SPCR, SPR0); |
sbi(SPCR, SPR1); |
cbi(SPSR,SPI2X); |
// select clock phase positive-going in middle of data |
cbi(SPCR, CPOL); |
// Data order MSB first |
cbi(SPCR,DORD); |
// enable SPI |
sbi(SPCR, SPE); |
// clear status |
inb(SPSR); |
sbi(SPSR,SPI2X); |
spiTransferComplete = 1; |
// enable SPI interrupt |
#ifdef SPI_USEINT |
sbi(SPCR, SPIE); |
#endif |
} |
//------------------------------------------------------------------------------ |
// Name: |
// Function: |
// |
// Parameter: |
// Return: |
//------------------------------------------------------------------------------ |
void spiSendByte(unsigned char data) |
{ |
// send a byte over SPI and ignore reply |
#ifdef SPI_USEINT |
while(!spiTransferComplete); |
spiTransferComplete = FALSE; |
#else |
while(!(inb(SPSR) & (1<<SPIF))); |
#endif |
outb(SPDR, data); |
} |
//------------------------------------------------------------------------------ |
// Name: |
// Function: |
// |
// Parameter: |
// Return: |
//------------------------------------------------------------------------------ |
unsigned char spiTransferByte(unsigned char data) |
{ |
#ifdef SPI_USEINT |
// send the given data |
spiTransferComplete = FALSE; |
outb(SPDR, data); |
// wait for transfer to complete |
while(!spiTransferComplete); |
#else |
// send the given data |
outb(SPDR, data); |
// wait for transfer to complete |
while(!(inb(SPSR) & (1<<SPIF))); |
#endif |
// return the received data |
return inb(SPDR); |
} |
//------------------------------------------------------------------------------ |
// Name: |
// Function: |
// |
// Parameter: |
// Return: |
//------------------------------------------------------------------------------ |
unsigned int spiTransferWord(unsigned int data) |
{ |
unsigned int rxData = 0; |
// send MS byte of given data |
rxData = (spiTransferByte((data>>8) & 0x00FF))<<8; |
// send LS byte of given data |
rxData |= (spiTransferByte(data & 0x00FF)); |
// return the received data |
return rxData; |
} |
//------------------------------------------------------------------------------ |
//---[ compassFilter ]---------------------------------------------------------- |
//------------------------------------------------------------------------------ |
/** Digital filter for the compass readings |
* \n Filter by Vadym Grygorenko |
* \n fn = (1/4)*(cn + 2*c_(n-1) + c_(n-2)) + (f_(n-1)) - (1/4)*f_(n-2) |
* |
* \param axiss The axis this measurement is for |
* \param reading The latest reading from the compass |
* \return The newest output from the filter |
* |
*/ |
int compassFilter(unsigned char axiss, int reading) |
{ |
static int input[3][3]={{0,0,0},{0,0,0},{0,0,0}}; //[n, n-1, n-2][axis] |
static int output[3][3]={{0,0,0},{0,0,0},{0,0,0}}; |
input[0][axiss] = reading; |
output[0][axiss] = ((input[0][axiss] + 2*input[1][axiss] + input[2][axiss]) / 4); |
input[2][axiss] = input[1][axiss]; |
input[1][axiss] = input[0][axiss]; |
output[2][axiss] = output[1][axiss]; |
output[1][axiss] = output[0][axiss]; |
return output[0][axiss]; |
} |
//------------------------------------------------------------------------------ |
// Name: |
// Function: |
// |
// Parameter: |
// Return: |
//------------------------------------------------------------------------------ |
int MAG_READ(char axis) |
{ |
int t; |
int Data; |
char dontCare; // For a reading we don't care about |
if (MessungFertig == 0) |
{ |
PORTD &= ~(1<<PB3); //SS auf low |
PORTD |= (1<<PB8); //Reset auf high |
for(t=0;t<5;t++); //5 Zyklen warten |
PORTD &= ~(1<<PB8); //Reset auf low |
dontCare = (int)spiTransferByte(0x40+axis); // Achse + Mess. Kommando /512 |
PORTD |= (1<<PB3); //SS auf high |
MessungFertig = 1; |
} |
if (bit_is_set(PIND,PINB4) && MessungFertig == 1) // Warten bis Messung fertig |
{ |
PORTD &= ~(1<<PB3); //SS auf low |
Data=spiTransferWord(0x00); |
PORTD |= (1<<PB3); //SS auf high |
MessungFertig = 0; |
return (Data); |
} |
else return -32000; |
} |
//------------------------------------------------------------------------------ |
// Name: |
// Function: |
// |
// Parameter: |
// Return: |
//------------------------------------------------------------------------------ |
int MAG_READ_CAL(char axis) |
{ |
int t; |
int Data=0; |
char dontCare; // For a reading we don't care about |
PORTD &= ~(1<<PB3); //SS auf low |
PORTD |= (1<<PB8); //Reset auf high |
for(t=0;t<5;t++); //5 Zyklen warten |
PORTD &= ~(1<<PB8); //Reset auf low |
dontCare = (int)spiTransferByte(0x40+axis); // Achse + Mess. Kommando /512 |
PORTD |= (1<<PB3); //SS auf high |
while(!bit_is_set(PIND,PINB4)) // Warten bis Messung fertig |
PORTD &= ~(1<<PB3); //SS auf low |
Data=spiTransferWord(0x00); |
PORTD |= (1<<PB5); //SS auf high |
return (Data); |
} |
//------------------------------------------------------------------------------ |
// Name: |
// Function: |
// |
// Parameter: |
// Return: |
//------------------------------------------------------------------------------ |
void ReadEepromKompassValues(void) |
{ |
eeprom_read_block(&CalParaKompass, &EEPromArray[4], sizeof(CALPARAKOMPASS)); |
Xoffset = CalParaKompass.Xoffsetm; |
Yoffset = CalParaKompass.Yoffsetm; |
Zoffset = CalParaKompass.Zoffsetm; |
iXsf = CalParaKompass.iXsfm; |
iYsf = CalParaKompass.iYsfm; |
iZsf = CalParaKompass.iZsfm; |
} |
//------------------------------------------------------------------------------ |
// Name: |
// Function: |
// |
// Parameter: |
// Return: |
//------------------------------------------------------------------------------ |
void KalibrierKompass(void) |
{ |
// The numbers here will be 16-bit signed values. |
// Positive = 0x0000 to 0x7FFF |
// Negative = 0x8000 to 0xFFFF |
int t = 0; |
int tempx=0,tempy=0,tempz=0; |
if(Poti4 > 70 && Poti4 < 100) |
{ |
LED1_OFF; |
LED2_OFF; |
EEPROMWrite = 0; |
/* |
Xmax = -32768; |
Ymax = -32768; // start with lowest possible value |
Zmax = -32768; |
Xmin = 32767; |
Ymin = 32767; // start with highest possible value |
Zmin = 32767; |
*/ |
} |
if(Poti4 > 70) // wenn Schalter ausgeschaltet, dann werden die LED ausgeschaltet und das GPS Steuerkommando gelöscht // (199797Kö) |
{ |
if(Poti4 > 100 && Poti4 < 150) // X-Y Achse Kalibrieren |
{ |
LED1_ON; |
Xraw=MAG_READ_CAL(1); //Kompass x-Achse auslesen |
Xraw = -Xraw; |
if(((Xraw > (XrawOld + 200)) || (Xraw < (XrawOld - 200)))) Xraw = XrawOld; //Filter gegen Spikes |
tempx = Xraw; |
Xraw = compassFilter(0,tempx); |
XrawOld = Xraw; |
Yraw=MAG_READ_CAL(2); //Kompass y-Achse auslesen |
Yraw =-Yraw; |
if(((Yraw > (YrawOld + 200)) || (Yraw < (YrawOld - 200)))) Yraw = YrawOld; //Filter gegen Spikes |
tempy = Yraw; |
Yraw = compassFilter(1,tempy); |
YrawOld = Yraw; |
if( Xraw > Xmax ) Xmax = Xraw; |
if( Xraw < Xmin ) Xmin = Xraw; |
if( Yraw > Ymax ) Ymax = Yraw; |
if( Yraw < Ymin ) Ymin = Yraw; |
Xoffset = ( abs(Xmax) - abs(Xmin) ) / 2; // calculate offsets |
Yoffset = ( abs(Ymax) - abs(Ymin) ) / 2; |
iXsf = ( abs(Xmax) + abs(Xmin)) / 2; // calculate the range |
iYsf = ( abs(Ymax) + abs(Ymin)) / 2; |
XrawCal = (double)(Xraw - Xoffset)/(double)iXsf; |
YrawCal = (double)(Yraw - Yoffset) /(double)iYsf; |
} |
if(Poti4 > 150) |
{ |
LED1_OFF; |
LED2_ON; |
Zraw=MAG_READ_CAL(3); //Kompass Z-Achse auslesen |
Zraw = -Zraw; |
if(((Zraw > (ZrawOld + 200)) || (Zraw < (ZrawOld - 200)))) Zraw = ZrawOld; //Filter gegen Spikes |
tempz = Zraw; |
Zraw = compassFilter(2,tempz); |
ZrawOld = Zraw; |
if( Zraw > Zmax ) Zmax = Zraw; |
if( Zraw < Zmin ) Zmin = Zraw; |
Zoffset = ( abs(Zmax) - abs(Zmin) ) / 2; |
iZsf = ( abs(Zmax) + abs(Zmin)) / 2; |
ZrawCal = (double)(Zraw- Zoffset) / (double)iZsf; |
} |
} |
if(Poti4 > 170) |
{ |
if (EEPROMWrite == 0) |
{ |
LED2_ON; |
LED1_ON; |
CalParaKompass.Xoffsetm = Xoffset; |
CalParaKompass.Yoffsetm = Yoffset; |
CalParaKompass.Zoffsetm = Zoffset; |
CalParaKompass.iXsfm = iXsf; |
CalParaKompass.iYsfm = iYsf; |
CalParaKompass.iZsfm = iZsf; |
eeprom_write_block(&CalParaKompass, &EEPromArray[4], sizeof(CALPARAKOMPASS)); |
Xmax = -32768; |
Ymax = -32768; // start with lowest possible value |
Zmax = -32768; |
Xmin = 32767; |
Ymin = 32767; // start with highest possible value |
Zmin = 32767; |
EEPROMWrite = 1; |
} |
} |
} |
//------------------------------------------------------------------------------ |
// Name: |
// Function: |
// |
// Parameter: |
// Return: |
//------------------------------------------------------------------------------ |
int KompassRead(void) |
{ |
/* |
Declination = 1,209° changing by 0,118 °/year |
Inclination = 64,779° changing by 0,004 °/year |
X component = 20.529,42 changing by 10,87 nT/year |
Y component = 433,23 changing by 42,54 nT/year |
Z component = 43.596,06 changing by 32,61 nT/year |
Horizontal Intensity = 20.533,99 changing by 11,8 nT/year |
Total Intensity = 48.189,85 changing by 34,53 nT/year |
*/ |
/* |
Messung Real Nick |
14 10 |
30 20 |
40 30 |
52 40 |
61 50 |
30 20 roll |
39 28 |
19 12 |
50 35 |
*/ |
double azimuthrad = 0; |
double magnet = 68 /180 * M_PI; |
//Look-Up Tabelle für Korrekturfaktoren |
//float winkelkorr[5]={0.5,0.6,0.65,0.65,0.7}; |
int lookup_nick =0,lookup_roll=0; |
int tempx=0,tempy=0,tempz=0; |
nickgrad = -(IntegralNick / 1430); //Teiler ermittelt durch Test bestätigung durch Holger |
rollgrad = -(IntegralRoll / 1430); //Teiler ermittelt durch Test bestätigung durch Holger |
/* if(nickgrad > 45) nickgradkomp = 45; |
else nickgradkomp = nickgrad; |
if(nickgrad < -45) nickgradkomp = -45; |
else nickgradkomp = nickgrad; |
if(rollgrad > 45) rollgradkomp = 45; |
else rollgradkomp = rollgrad; |
if(rollgrad < -45) rollgradkomp = -45; |
else rollgradkomp = rollgrad; |
if(abs(nickgrad) > 5 && abs(nickgrad) <= 15) lookup_nick = 0; |
if(abs(nickgrad) > 15 && abs(nickgrad) <= 25) lookup_nick = 1; |
if(abs(nickgrad) > 25 && abs(nickgrad) <= 35) lookup_nick = 2; |
if(abs(nickgrad) > 35 && abs(nickgrad) <= 45) lookup_nick = 3; |
if(abs(nickgrad) > 45) lookup_nick = 4; |
if(abs(rollgrad) > 5 && abs(rollgrad) <= 15) lookup_roll = 0; |
if(abs(rollgrad) > 15 && abs(rollgrad) <= 25) lookup_roll = 1; |
if(abs(rollgrad) > 25 && abs(rollgrad) <= 35) lookup_roll = 2; |
if(abs(rollgrad) > 35 && abs(rollgrad) <= 45) lookup_roll = 3; |
if(abs(rollgrad) > 45) lookup_roll = 4; |
*/ |
nick = (float)nickgrad/180 * M_PI;// * (float)winkelkorr[lookup_nick]*(float); |
roll = (float)rollgrad/180 * M_PI;// * (float)winkelkorr[lookup_roll]*(float); |
if(Poti4 > 70) // wenn Schalter ausgeschaltet, dann werden die LED ausgeschaltet und das GPS Steuerkommando gelöscht // (199797Kö) |
{ |
KalibrierKompass(); |
} |
else |
{ |
switch(KompassInUse) |
{ |
case 0: |
Xraw=MAG_READ(1); //Kompass x-Achse auslesen |
Xraw = -Xraw; |
if (Xraw == 32000) Xraw = XrawOld; |
else |
{ |
//if(((Xraw > (XrawOld + 200)) || (Xraw < (XrawOld - 200)))) Xraw = XrawOld; //Filter gegen Spikes |
XrawOld = Xraw; |
tempx = Xraw; |
Xraw = compassFilter(0, tempx); |
NewX = 1; |
KompassInUse = 1; |
} |
break; |
case 1: |
Yraw=MAG_READ(2); //Kompass y-Achse auslesen |
Yraw = -Yraw; |
if (Yraw == 32000) Yraw = YrawOld; |
else |
{ |
//if(((Yraw > (YrawOld + 200)) || (Yraw < (YrawOld - 200)))) Yraw = YrawOld; //Filter gegen Spikes |
YrawOld = Yraw; |
tempy = Yraw; |
Yraw = compassFilter(1, tempy); |
NewY = 1; |
KompassInUse = 2; |
} |
break; |
case 2: |
Zraw=MAG_READ(3); //Kompass z-Achse auslesen |
Zraw = -Zraw; |
if (Zraw == 32000) Zraw = ZrawOld; |
else |
{ |
//if(((Zraw > (ZrawOld + 200)) || (Zraw < (ZrawOld - 200)))) Zraw = ZrawOld; //Filter gegen Spikes |
ZrawOld = Zraw; |
tempz = Zraw; |
Zraw = compassFilter(2, tempz); |
NewZ = 1; |
KompassInUse = 0; |
} |
break; |
} |
/* Xoffset =-44; |
Yoffset =-36; |
Zoffset =35; |
iXsf =242; |
iYsf =256; |
iZsf =265; |
*/ |
if(NewX == 1 && NewY == 1 && NewZ == 1) |
{ |
// Kalibrierung |
XrawCal = (double)(Xraw - Xoffset)/ (double)iXsf; |
YrawCal = (double)(Yraw - Yoffset) / (double)iYsf; |
ZrawCal = (double)(Zraw- Zoffset) / (double)iZsf; |
// 1.2 Grad Missweisung durch Geographischer und Magnetischer Nordpol |
//MagnetG = (int)sqrt((long)(XrawCal * XrawCal) + (long)(YrawCal * YrawCal) + (long)(ZrawCal * ZrawCal)); |
//Kompensationsroutine |
XEx = XrawCal * (double)cos(nick); |
XEy = YrawCal * (double)sin(nick) * (double)sin(roll); |
XEz = ZrawCal * (double)sin(nick) * (double)cos(roll); |
YEy = YrawCal * (double)cos(roll); |
YEz = ZrawCal * (double)sin(roll); |
XE = XEx + XEy - XEz; |
YE = YEy + YEz; |
if(XE==0 && YE <0) azimuthgrad = 90; |
if(XE==0 && YE >0) azimuthgrad = 270; |
if(XE < 0) azimuthgrad = 180-(atan(YE/XE)*180/M_PI); |
if(XE > 0 && YE < 0) azimuthgrad = -(atan(YE/XE)*180/M_PI); |
if(XE > 0 && YE > 0) azimuthgrad = 360 - (atan(YE/XE)*180/M_PI); |
azimuthold = azimuthgrad; |
NewX = 0; |
NewY = 0; |
NewZ = 0; |
return azimuthgrad; |
} |
else return azimuthold; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/spi.h |
---|
0,0 → 1,66 |
/*! \file spi.h \brief SPI interface driver. */ |
//***************************************************************************** |
// |
// File Name : 'spi.h' |
// Title : SPI interface driver |
// Author : Pascal Stang - Copyright (C) 2000-2002 |
// Created : 11/22/2000 |
// Revised : 06/06/2002 |
// Version : 0.6 |
// Target MCU : Atmel AVR series |
// Editor Tabs : 4 |
// |
// NOTE: This code is currently below version 1.0, and therefore is considered |
// to be lacking in some functionality or documentation, or may not be fully |
// tested. Nonetheless, you can expect most functions to work. |
// |
/// \ingroup driver_avr |
/// \defgroup spi SPI (Serial Peripheral Interface) Function Library (spi.c) |
/// \code #include "spi.h" \endcode |
/// \par Overview |
/// Provides basic byte and word transmitting and receiving via the AVR |
/// SPI interface. Due to the nature of SPI, every SPI communication operation |
/// is both a transmit and simultaneous receive. |
/// |
/// \note Currently, only MASTER mode is supported. |
// |
// This code is distributed under the GNU Public License |
// which can be found at http://www.gnu.org/licenses/gpl.txt |
// |
//***************************************************************************** |
// function prototypes |
extern volatile double XE,YE; |
extern volatile signed char nickgrad,rollgrad,nickgradkomp,rollgradkomp; |
extern volatile double richtungorgr,richtungorgd,nick,roll; |
extern volatile int iXsf,iYsf,iZsf; |
extern volatile signed int Xmax, Xmin, Ymax, Ymin, Zmin, Zmax; |
extern volatile double XrawCal, YrawCal, ZrawCal; |
extern volatile int Xraw, Yraw, Zraw; // save values you get from the ASIC |
extern volatile int Xoffset, Yoffset, Zoffset; |
extern volatile int azimuthgrad; |
extern double XEx,XEy,XEz,YEy,YEz; |
int MagnetG; |
// SPI interface initializer |
void spiInit(void); |
// spiSendByte(u08 data) waits until the SPI interface is ready |
// and then sends a single byte over the SPI port. This command |
// does not receive anything. |
void spiSendByte(unsigned char data); |
// spiTransferByte(u08 data) waits until the SPI interface is ready |
// and then sends a single byte over the SPI port. The function also |
// returns the byte that was received during transmission. |
unsigned char spiTransferByte(unsigned char data); |
// spiTransferWord(u08 data) works just like spiTransferByte but |
// operates on a whole word (16-bits of data). |
unsigned int spiTransferWord(unsigned int data); |
extern int KompassRead(void); |
extern void ReadEepromKompassValues(void); |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/timer0.c |
---|
0,0 → 1,139 |
#include "main.h" |
volatile unsigned int CountMilliseconds = 0; |
volatile static unsigned int tim_main; |
volatile unsigned char UpdateMotor = 0; |
volatile unsigned int cntKompass = 0; |
volatile unsigned int beeptime = 0; |
int ServoValue = 0; |
enum { |
STOP = 0, |
CK = 1, |
CK8 = 2, |
CK64 = 3, |
CK256 = 4, |
CK1024 = 5, |
T0_FALLING_EDGE = 6, |
T0_RISING_EDGE = 7 |
}; |
SIGNAL (SIG_OVERFLOW0) // 8kHz |
{ |
static unsigned char cnt_1ms = 1,cnt = 0; |
// TCNT0 -= 250;//TIMER_RELOAD_VALUE; |
if(!cnt--) |
{ |
cnt = 9; |
cnt_1ms++; |
cnt_1ms %= 2; |
if(!cnt_1ms) UpdateMotor = 1; |
CountMilliseconds++; |
if(Timeout) Timeout--; |
} |
if(beeptime > 1) |
{ |
beeptime--; |
PORTD |= (1<<2); |
} |
else |
PORTD &= ~(1<<2); |
if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV || EE_Parameter.GlobalConfig & CFG_GPS_AKTIV) //Abfrage um GPS_AKTIV erweitert, damit auch bei nur eingeschaltetem GPS OHNE Kompass der benötigte Kompassvalue berechnet wird (200907Kr) |
{ |
if(PINC & 0x10) |
{ |
cntKompass++; |
} |
else |
{ |
if((cntKompass) && (cntKompass < 4000)) |
{ |
KompassValue = cntKompass; |
} |
// if(cntKompass < 10) cntKompass = 10; |
// KompassValue = (unsigned long)((unsigned long)(cntKompass-10)*720L + 1L) / 703L; |
KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180; |
cntKompass = 0; |
} |
} |
} |
void Timer_Init(void) |
{ |
tim_main = SetDelay(10); |
TCCR0B = CK8; |
TCCR0A = (1<<COM0A1)|(1<<COM0B1)|3;//fast PWM |
OCR0A = 0; |
OCR0B = 120; |
TCNT0 = (unsigned char)-TIMER_RELOAD_VALUE; // reload |
//OCR1 = 0x00; |
TCCR2A=(1<<COM2A1)|(1<<COM2A0)|3; |
TCCR2B=(0<<CS20)|(1<<CS21)|(1<<CS22); |
// TIMSK2 |= _BV(TOIE2); |
TIMSK2 |= _BV(OCIE2A); |
TIMSK0 |= _BV(TOIE0); |
OCR2A = 10; |
TCNT2 = 0; |
} |
// ----------------------------------------------------------------------- |
unsigned int SetDelay (unsigned int t) |
{ |
// TIMSK0 &= ~_BV(TOIE0); |
return(CountMilliseconds + t + 1); |
// TIMSK0 |= _BV(TOIE0); |
} |
// ----------------------------------------------------------------------- |
char CheckDelay(unsigned int t) |
{ |
// TIMSK0 &= ~_BV(TOIE0); |
return(((t - CountMilliseconds) & 0x8000) >> 9); |
// TIMSK0 |= _BV(TOIE0); |
} |
// ----------------------------------------------------------------------- |
void Delay_ms(unsigned int w) |
{ |
unsigned int akt; |
akt = SetDelay(w); |
while (!CheckDelay(akt)); |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Servo ansteuern |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(SIG_OUTPUT_COMPARE2A) |
{ |
static unsigned char timer = 10; |
if(!timer--) |
{ |
TCCR2A=(1<<COM2A1)|(0<<COM2A0)|3; |
ServoValue = Parameter_ServoNickControl; |
if(EE_Parameter.ServoNickCompInvert & 0x01) ServoValue += ((long) EE_Parameter.ServoNickComp * (IntegralNick / 128)) / 512; |
else ServoValue -= ((long) EE_Parameter.ServoNickComp * (IntegralNick / 128)) / 512; |
if(ServoValue < EE_Parameter.ServoNickMin) ServoValue = EE_Parameter.ServoNickMin; |
else if(ServoValue > EE_Parameter.ServoNickMax) ServoValue = EE_Parameter.ServoNickMax; |
// DebugOut.Analog[10] = ServoValue; |
OCR2A = ServoValue;// + 75; |
timer = EE_Parameter.ServoNickRefresh; |
} |
else |
{ |
TCCR2A =3; |
PORTD&=~0x80; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/timer0.d |
---|
0,0 → 1,2 |
timer0.o timer0.d : timer0.c main.h old_macros.h _Settings.h printf_P.h timer0.h \ |
uart.h analog.h twimaster.h menu.h rc.h fc.h gps.h |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/timer0.h |
---|
0,0 → 1,14 |
#define TIMER_TEILER CK8 |
#define TIMER_RELOAD_VALUE 250 |
void Timer_Init(void); |
void Delay_ms(unsigned int); |
unsigned int SetDelay (unsigned int t); |
char CheckDelay (unsigned int t); |
extern volatile unsigned int CountMilliseconds; |
extern volatile unsigned char UpdateMotor; |
extern volatile unsigned int beeptime; |
extern volatile unsigned int cntKompass; |
extern int ServoValue; |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/timer0.lst |
---|
0,0 → 1,494 |
1 .file "timer0.c" |
2 .arch atmega644 |
3 __SREG__ = 0x3f |
4 __SP_H__ = 0x3e |
5 __SP_L__ = 0x3d |
6 __tmp_reg__ = 0 |
7 __zero_reg__ = 1 |
8 .global __do_copy_data |
9 .global __do_clear_bss |
10 .text |
11 .global __vector_18 |
13 __vector_18: |
14 /* prologue: frame size=0 */ |
15 0000 1F92 push __zero_reg__ |
16 0002 0F92 push __tmp_reg__ |
17 0004 0FB6 in __tmp_reg__,__SREG__ |
18 0006 0F92 push __tmp_reg__ |
19 0008 1124 clr __zero_reg__ |
20 000a 2F93 push r18 |
21 000c 3F93 push r19 |
22 000e 5F93 push r21 |
23 0010 6F93 push r22 |
24 0012 7F93 push r23 |
25 0014 8F93 push r24 |
26 0016 9F93 push r25 |
27 0018 AF93 push r26 |
28 001a BF93 push r27 |
29 /* prologue end (size=14) */ |
30 001c 8091 0000 lds r24,cnt.2011 |
31 0020 8150 subi r24,lo8(-(-1)) |
32 0022 8093 0000 sts cnt.2011,r24 |
33 0026 8F3F cpi r24,lo8(-1) |
34 0028 01F4 brne .L2 |
35 002a 89E0 ldi r24,lo8(9) |
36 002c 8093 0000 sts cnt.2011,r24 |
37 0030 8091 0000 lds r24,cnt_1ms.2010 |
38 0034 8F5F subi r24,lo8(-(1)) |
39 0036 8170 andi r24,lo8(1) |
40 0038 8093 0000 sts cnt_1ms.2010,r24 |
41 003c 8823 tst r24 |
42 003e 01F4 brne .L4 |
43 0040 81E0 ldi r24,lo8(1) |
44 0042 8093 0000 sts UpdateMotor,r24 |
45 .L4: |
46 0046 8091 0000 lds r24,CountMilliseconds |
47 004a 9091 0000 lds r25,(CountMilliseconds)+1 |
48 004e 0196 adiw r24,1 |
49 0050 9093 0000 sts (CountMilliseconds)+1,r25 |
50 0054 8093 0000 sts CountMilliseconds,r24 |
51 0058 8091 0000 lds r24,Timeout |
52 005c 8823 tst r24 |
53 005e 01F0 breq .L2 |
54 0060 8091 0000 lds r24,Timeout |
55 0064 8150 subi r24,lo8(-(-1)) |
56 0066 8093 0000 sts Timeout,r24 |
57 .L2: |
58 006a 8091 0000 lds r24,beeptime |
59 006e 9091 0000 lds r25,(beeptime)+1 |
60 0072 0297 sbiw r24,2 |
61 0074 00F0 brlo .L7 |
62 0076 8091 0000 lds r24,beeptime |
63 007a 9091 0000 lds r25,(beeptime)+1 |
64 007e 0197 sbiw r24,1 |
65 0080 9093 0000 sts (beeptime)+1,r25 |
66 0084 8093 0000 sts beeptime,r24 |
67 0088 5A9A sbi 43-0x20,2 |
68 008a 00C0 rjmp .L9 |
69 .L7: |
70 008c 5A98 cbi 43-0x20,2 |
71 .L9: |
72 008e 8091 0000 lds r24,EE_Parameter+8 |
73 0092 9927 clr r25 |
74 0094 83FD sbrc r24,3 |
75 0096 00C0 rjmp .L10 |
76 0098 85FF sbrs r24,5 |
77 009a 00C0 rjmp .L18 |
78 .L10: |
79 009c 349B sbis 38-0x20,4 |
80 009e 00C0 rjmp .L13 |
81 00a0 8091 0000 lds r24,cntKompass |
82 00a4 9091 0000 lds r25,(cntKompass)+1 |
83 00a8 0196 adiw r24,1 |
84 00aa 9093 0000 sts (cntKompass)+1,r25 |
85 00ae 8093 0000 sts cntKompass,r24 |
86 00b2 00C0 rjmp .L18 |
87 .L13: |
88 00b4 8091 0000 lds r24,cntKompass |
89 00b8 9091 0000 lds r25,(cntKompass)+1 |
90 00bc 892B or r24,r25 |
91 00be 01F0 breq .L15 |
92 00c0 8091 0000 lds r24,cntKompass |
93 00c4 9091 0000 lds r25,(cntKompass)+1 |
94 00c8 805A subi r24,lo8(4000) |
95 00ca 9F40 sbci r25,hi8(4000) |
96 00cc 00F4 brsh .L15 |
97 00ce 8091 0000 lds r24,cntKompass |
98 00d2 9091 0000 lds r25,(cntKompass)+1 |
99 00d6 9093 0000 sts (KompassValue)+1,r25 |
100 00da 8093 0000 sts KompassValue,r24 |
101 .L15: |
102 00de 8091 0000 lds r24,KompassValue |
103 00e2 9091 0000 lds r25,(KompassValue)+1 |
104 00e6 2091 0000 lds r18,KompassStartwert |
105 00ea 3091 0000 lds r19,(KompassStartwert)+1 |
106 00ee 821B sub r24,r18 |
107 00f0 930B sbc r25,r19 |
108 00f2 845E subi r24,lo8(-(540)) |
109 00f4 9D4F sbci r25,hi8(-(540)) |
110 00f6 68E6 ldi r22,lo8(360) |
111 00f8 71E0 ldi r23,hi8(360) |
112 00fa 0E94 0000 call __divmodhi4 |
113 00fe 845B subi r24,lo8(-(-180)) |
114 0100 9040 sbci r25,hi8(-(-180)) |
115 0102 9093 0000 sts (KompassRichtung)+1,r25 |
116 0106 8093 0000 sts KompassRichtung,r24 |
117 010a 1092 0000 sts (cntKompass)+1,__zero_reg__ |
118 010e 1092 0000 sts cntKompass,__zero_reg__ |
119 .L18: |
120 /* epilogue: frame size=0 */ |
121 0112 BF91 pop r27 |
122 0114 AF91 pop r26 |
123 0116 9F91 pop r25 |
124 0118 8F91 pop r24 |
125 011a 7F91 pop r23 |
126 011c 6F91 pop r22 |
127 011e 5F91 pop r21 |
128 0120 3F91 pop r19 |
129 0122 2F91 pop r18 |
130 0124 0F90 pop __tmp_reg__ |
131 0126 0FBE out __SREG__,__tmp_reg__ |
132 0128 0F90 pop __tmp_reg__ |
133 012a 1F90 pop __zero_reg__ |
134 012c 1895 reti |
135 /* epilogue end (size=14) */ |
136 /* function __vector_18 size 153 (125) */ |
138 .global SetDelay |
140 SetDelay: |
141 /* prologue: frame size=0 */ |
142 /* prologue end (size=0) */ |
143 012e 2091 0000 lds r18,CountMilliseconds |
144 0132 3091 0000 lds r19,(CountMilliseconds)+1 |
145 0136 2F5F subi r18,lo8(-(1)) |
146 0138 3F4F sbci r19,hi8(-(1)) |
147 013a 820F add r24,r18 |
148 013c 931F adc r25,r19 |
149 /* epilogue: frame size=0 */ |
150 013e 0895 ret |
151 /* epilogue end (size=1) */ |
152 /* function SetDelay size 9 (8) */ |
154 .global CheckDelay |
156 CheckDelay: |
157 /* prologue: frame size=0 */ |
158 /* prologue end (size=0) */ |
159 0140 2091 0000 lds r18,CountMilliseconds |
160 0144 3091 0000 lds r19,(CountMilliseconds)+1 |
161 0148 821B sub r24,r18 |
162 014a 930B sbc r25,r19 |
163 014c 892F mov r24,r25 |
164 014e 9927 clr r25 |
165 0150 8695 lsr r24 |
166 0152 8074 andi r24,lo8(64) |
167 0154 9927 clr r25 |
168 /* epilogue: frame size=0 */ |
169 0156 0895 ret |
170 /* epilogue end (size=1) */ |
171 /* function CheckDelay size 12 (11) */ |
173 .global __vector_9 |
175 __vector_9: |
176 /* prologue: frame size=0 */ |
177 0158 1F92 push __zero_reg__ |
178 015a 0F92 push __tmp_reg__ |
179 015c 0FB6 in __tmp_reg__,__SREG__ |
180 015e 0F92 push __tmp_reg__ |
181 0160 1124 clr __zero_reg__ |
182 0162 EF92 push r14 |
183 0164 FF92 push r15 |
184 0166 0F93 push r16 |
185 0168 1F93 push r17 |
186 016a 2F93 push r18 |
187 016c 3F93 push r19 |
188 016e 4F93 push r20 |
189 0170 5F93 push r21 |
190 0172 6F93 push r22 |
191 0174 7F93 push r23 |
192 0176 8F93 push r24 |
193 0178 9F93 push r25 |
194 017a AF93 push r26 |
195 017c BF93 push r27 |
196 017e CF93 push r28 |
197 0180 DF93 push r29 |
198 0182 EF93 push r30 |
199 0184 FF93 push r31 |
200 /* prologue end (size=23) */ |
201 0186 8091 0000 lds r24,timer.2100 |
202 018a 8150 subi r24,lo8(-(-1)) |
203 018c 8093 0000 sts timer.2100,r24 |
204 0190 8F3F cpi r24,lo8(-1) |
205 0192 01F0 breq .+2 |
206 0194 00C0 rjmp .L24 |
207 0196 83E8 ldi r24,lo8(-125) |
208 0198 8093 B000 sts 176,r24 |
209 019c 8091 0000 lds r24,Parameter_ServoNickControl |
210 01a0 C82F mov r28,r24 |
211 01a2 DD27 clr r29 |
212 01a4 D093 0000 sts (ServoValue)+1,r29 |
213 01a8 C093 0000 sts ServoValue,r28 |
214 01ac 8091 0000 lds r24,EE_Parameter+38 |
215 01b0 E090 0000 lds r14,EE_Parameter+34 |
216 01b4 80FF sbrs r24,0 |
217 01b6 00C0 rjmp .L26 |
218 01b8 6091 0000 lds r22,IntegralNick |
219 01bc 7091 0000 lds r23,(IntegralNick)+1 |
220 01c0 8091 0000 lds r24,(IntegralNick)+2 |
221 01c4 9091 0000 lds r25,(IntegralNick)+3 |
222 01c8 FF24 clr r15 |
223 01ca 0027 clr r16 |
224 01cc 1127 clr r17 |
225 01ce 20E8 ldi r18,lo8(128) |
226 01d0 30E0 ldi r19,hi8(128) |
227 01d2 40E0 ldi r20,hlo8(128) |
228 01d4 50E0 ldi r21,hhi8(128) |
229 01d6 0E94 0000 call __divmodsi4 |
230 01da C801 movw r24,r16 |
231 01dc B701 movw r22,r14 |
232 01de 0E94 0000 call __mulsi3 |
233 01e2 20E0 ldi r18,lo8(512) |
234 01e4 32E0 ldi r19,hi8(512) |
235 01e6 40E0 ldi r20,hlo8(512) |
236 01e8 50E0 ldi r21,hhi8(512) |
237 01ea 0E94 0000 call __divmodsi4 |
238 01ee C20F add r28,r18 |
239 01f0 D31F adc r29,r19 |
240 01f2 00C0 rjmp .L35 |
241 .L26: |
242 01f4 6091 0000 lds r22,IntegralNick |
243 01f8 7091 0000 lds r23,(IntegralNick)+1 |
244 01fc 8091 0000 lds r24,(IntegralNick)+2 |
245 0200 9091 0000 lds r25,(IntegralNick)+3 |
246 0204 FF24 clr r15 |
247 0206 0027 clr r16 |
248 0208 1127 clr r17 |
249 020a 20E8 ldi r18,lo8(128) |
250 020c 30E0 ldi r19,hi8(128) |
251 020e 40E0 ldi r20,hlo8(128) |
252 0210 50E0 ldi r21,hhi8(128) |
253 0212 0E94 0000 call __divmodsi4 |
254 0216 C801 movw r24,r16 |
255 0218 B701 movw r22,r14 |
256 021a 0E94 0000 call __mulsi3 |
257 021e 20E0 ldi r18,lo8(512) |
258 0220 32E0 ldi r19,hi8(512) |
259 0222 40E0 ldi r20,hlo8(512) |
260 0224 50E0 ldi r21,hhi8(512) |
261 0226 0E94 0000 call __divmodsi4 |
262 022a C21B sub r28,r18 |
263 022c D30B sbc r29,r19 |
264 .L35: |
265 022e D093 0000 sts (ServoValue)+1,r29 |
266 0232 C093 0000 sts ServoValue,r28 |
267 0236 2091 0000 lds r18,ServoValue |
268 023a 3091 0000 lds r19,(ServoValue)+1 |
269 023e 8091 0000 lds r24,EE_Parameter+35 |
270 0242 9927 clr r25 |
271 0244 2817 cp r18,r24 |
272 0246 3907 cpc r19,r25 |
273 0248 04F0 brlt .L36 |
274 024a 8091 0000 lds r24,EE_Parameter+36 |
275 024e 9927 clr r25 |
276 0250 8217 cp r24,r18 |
277 0252 9307 cpc r25,r19 |
278 0254 04F4 brge .L31 |
279 .L36: |
280 0256 9093 0000 sts (ServoValue)+1,r25 |
281 025a 8093 0000 sts ServoValue,r24 |
282 .L31: |
283 025e 8091 0000 lds r24,ServoValue |
284 0262 8093 B300 sts 179,r24 |
285 0266 8091 0000 lds r24,EE_Parameter+37 |
286 026a 8093 0000 sts timer.2100,r24 |
287 026e 00C0 rjmp .L34 |
288 .L24: |
289 0270 83E0 ldi r24,lo8(3) |
290 0272 8093 B000 sts 176,r24 |
291 0276 5F98 cbi 43-0x20,7 |
292 .L34: |
293 /* epilogue: frame size=0 */ |
294 0278 FF91 pop r31 |
295 027a EF91 pop r30 |
296 027c DF91 pop r29 |
297 027e CF91 pop r28 |
298 0280 BF91 pop r27 |
299 0282 AF91 pop r26 |
300 0284 9F91 pop r25 |
301 0286 8F91 pop r24 |
302 0288 7F91 pop r23 |
303 028a 6F91 pop r22 |
304 028c 5F91 pop r21 |
305 028e 4F91 pop r20 |
306 0290 3F91 pop r19 |
307 0292 2F91 pop r18 |
308 0294 1F91 pop r17 |
309 0296 0F91 pop r16 |
310 0298 FF90 pop r15 |
311 029a EF90 pop r14 |
312 029c 0F90 pop __tmp_reg__ |
313 029e 0FBE out __SREG__,__tmp_reg__ |
314 02a0 0F90 pop __tmp_reg__ |
315 02a2 1F90 pop __zero_reg__ |
316 02a4 1895 reti |
317 /* epilogue end (size=23) */ |
318 /* function __vector_9 size 167 (121) */ |
320 .global Timer_Init |
322 Timer_Init: |
323 /* prologue: frame size=0 */ |
324 /* prologue end (size=0) */ |
325 02a6 8091 0000 lds r24,CountMilliseconds |
326 02aa 9091 0000 lds r25,(CountMilliseconds)+1 |
327 02ae 0B96 adiw r24,11 |
328 02b0 9093 0000 sts (tim_main)+1,r25 |
329 02b4 8093 0000 sts tim_main,r24 |
330 02b8 82E0 ldi r24,lo8(2) |
331 02ba 85BD out 69-0x20,r24 |
332 02bc 83EA ldi r24,lo8(-93) |
333 02be 84BD out 68-0x20,r24 |
334 02c0 17BC out 71-0x20,__zero_reg__ |
335 02c2 88E7 ldi r24,lo8(120) |
336 02c4 88BD out 72-0x20,r24 |
337 02c6 96E0 ldi r25,lo8(6) |
338 02c8 96BD out 70-0x20,r25 |
339 02ca 83EC ldi r24,lo8(-61) |
340 02cc 8093 B000 sts 176,r24 |
341 02d0 9093 B100 sts 177,r25 |
342 02d4 E0E7 ldi r30,lo8(112) |
343 02d6 F0E0 ldi r31,hi8(112) |
344 02d8 8081 ld r24,Z |
345 02da 8260 ori r24,lo8(2) |
346 02dc 8083 st Z,r24 |
347 02de EEE6 ldi r30,lo8(110) |
348 02e0 F0E0 ldi r31,hi8(110) |
349 02e2 8081 ld r24,Z |
350 02e4 8160 ori r24,lo8(1) |
351 02e6 8083 st Z,r24 |
352 02e8 8AE0 ldi r24,lo8(10) |
353 02ea 8093 B300 sts 179,r24 |
354 02ee 1092 B200 sts 178,__zero_reg__ |
355 /* epilogue: frame size=0 */ |
356 02f2 0895 ret |
357 /* epilogue end (size=1) */ |
358 /* function Timer_Init size 39 (38) */ |
360 .global Delay_ms |
362 Delay_ms: |
363 /* prologue: frame size=0 */ |
364 /* prologue end (size=0) */ |
365 02f4 2091 0000 lds r18,CountMilliseconds |
366 02f8 3091 0000 lds r19,(CountMilliseconds)+1 |
367 02fc 2F5F subi r18,lo8(-(1)) |
368 02fe 3F4F sbci r19,hi8(-(1)) |
369 0300 280F add r18,r24 |
370 0302 391F adc r19,r25 |
371 .L40: |
372 0304 8091 0000 lds r24,CountMilliseconds |
373 0308 9091 0000 lds r25,(CountMilliseconds)+1 |
374 030c A901 movw r20,r18 |
375 030e 481B sub r20,r24 |
376 0310 590B sbc r21,r25 |
377 0312 57FF sbrs r21,7 |
378 0314 00C0 rjmp .L40 |
379 /* epilogue: frame size=0 */ |
380 0316 0895 ret |
381 /* epilogue end (size=1) */ |
382 /* function Delay_ms size 18 (17) */ |
384 .global CountMilliseconds |
385 .global CountMilliseconds |
386 .section .bss |
389 CountMilliseconds: |
390 0000 0000 .skip 2,0 |
391 .global UpdateMotor |
392 .global UpdateMotor |
395 UpdateMotor: |
396 0002 00 .skip 1,0 |
397 .global cntKompass |
398 .global cntKompass |
401 cntKompass: |
402 0003 0000 .skip 2,0 |
403 .global beeptime |
404 .global beeptime |
407 beeptime: |
408 0005 0000 .skip 2,0 |
409 .global ServoValue |
410 .global ServoValue |
413 ServoValue: |
414 0007 0000 .skip 2,0 |
415 .data |
418 timer.2100: |
419 0000 0A .byte 10 |
420 .lcomm cnt.2011,1 |
423 cnt_1ms.2010: |
424 0001 01 .byte 1 |
425 .lcomm tim_main,2 |
426 .comm DiffNick,2,1 |
427 .comm DiffRoll,2,1 |
428 .comm SenderOkay,1,1 |
429 .comm CosinusNickWinkel,1,1 |
430 .comm CosinusRollWinkel,1,1 |
431 .comm durchschnitt_northing,4,1 |
432 .comm durchschnitt_easting,4,1 |
433 .comm P_GPS_Verstaerkung,2,1 |
434 .comm D_GPS_Verstaerkung,2,1 |
435 .comm RemoteTasten,1,1 |
436 .comm Timeout,1,1 |
437 .comm IntegralNick,4,1 |
438 .comm IntegralNick2,4,1 |
439 .comm IntegralRoll,4,1 |
440 .comm IntegralRoll2,4,1 |
441 .comm Mess_IntegralNick,4,1 |
442 .comm Mess_IntegralNick2,4,1 |
443 .comm Mess_IntegralRoll,4,1 |
444 .comm Mess_IntegralRoll2,4,1 |
445 .comm Integral_Gier,4,1 |
446 .comm Mess_Integral_Gier,4,1 |
447 .comm h,1,1 |
448 .comm m,1,1 |
449 .comm s,1,1 |
450 .comm Motor_Vorne,1,1 |
451 .comm Motor_Hinten,1,1 |
452 .comm Motor_Rechts,1,1 |
453 .comm Motor_Links,1,1 |
454 .comm Count,1,1 |
455 .comm MotorWert,5,1 |
456 /* File "timer0.c": code 398 = 0x018e ( 320), prologues 37, epilogues 41 */ |
DEFINED SYMBOLS |
*ABS*:00000000 timer0.c |
C:\DOKUME~1\none\LOKALE~1\Temp/cc6rkWhC.s:3 *ABS*:0000003f __SREG__ |
C:\DOKUME~1\none\LOKALE~1\Temp/cc6rkWhC.s:4 *ABS*:0000003e __SP_H__ |
C:\DOKUME~1\none\LOKALE~1\Temp/cc6rkWhC.s:5 *ABS*:0000003d __SP_L__ |
C:\DOKUME~1\none\LOKALE~1\Temp/cc6rkWhC.s:6 *ABS*:00000000 __tmp_reg__ |
C:\DOKUME~1\none\LOKALE~1\Temp/cc6rkWhC.s:7 *ABS*:00000001 __zero_reg__ |
C:\DOKUME~1\none\LOKALE~1\Temp/cc6rkWhC.s:13 .text:00000000 __vector_18 |
.bss:00000009 cnt.2011 |
C:\DOKUME~1\none\LOKALE~1\Temp/cc6rkWhC.s:423 .data:00000001 cnt_1ms.2010 |
C:\DOKUME~1\none\LOKALE~1\Temp/cc6rkWhC.s:395 .bss:00000002 UpdateMotor |
C:\DOKUME~1\none\LOKALE~1\Temp/cc6rkWhC.s:389 .bss:00000000 CountMilliseconds |
*COM*:00000001 Timeout |
C:\DOKUME~1\none\LOKALE~1\Temp/cc6rkWhC.s:407 .bss:00000005 beeptime |
C:\DOKUME~1\none\LOKALE~1\Temp/cc6rkWhC.s:401 .bss:00000003 cntKompass |
C:\DOKUME~1\none\LOKALE~1\Temp/cc6rkWhC.s:140 .text:0000012e SetDelay |
C:\DOKUME~1\none\LOKALE~1\Temp/cc6rkWhC.s:156 .text:00000140 CheckDelay |
C:\DOKUME~1\none\LOKALE~1\Temp/cc6rkWhC.s:175 .text:00000158 __vector_9 |
C:\DOKUME~1\none\LOKALE~1\Temp/cc6rkWhC.s:418 .data:00000000 timer.2100 |
C:\DOKUME~1\none\LOKALE~1\Temp/cc6rkWhC.s:413 .bss:00000007 ServoValue |
*COM*:00000004 IntegralNick |
C:\DOKUME~1\none\LOKALE~1\Temp/cc6rkWhC.s:322 .text:000002a6 Timer_Init |
C:\DOKUME~1\none\LOKALE~1\Temp/cc6rkWhC.s:420 .bss:0000000a tim_main |
C:\DOKUME~1\none\LOKALE~1\Temp/cc6rkWhC.s:362 .text:000002f4 Delay_ms |
*COM*:00000002 DiffNick |
*COM*:00000002 DiffRoll |
*COM*:00000001 SenderOkay |
*COM*:00000001 CosinusNickWinkel |
*COM*:00000001 CosinusRollWinkel |
*COM*:00000004 durchschnitt_northing |
*COM*:00000004 durchschnitt_easting |
*COM*:00000002 P_GPS_Verstaerkung |
*COM*:00000002 D_GPS_Verstaerkung |
*COM*:00000001 RemoteTasten |
*COM*:00000004 IntegralNick2 |
*COM*:00000004 IntegralRoll |
*COM*:00000004 IntegralRoll2 |
*COM*:00000004 Mess_IntegralNick |
*COM*:00000004 Mess_IntegralNick2 |
*COM*:00000004 Mess_IntegralRoll |
*COM*:00000004 Mess_IntegralRoll2 |
*COM*:00000004 Integral_Gier |
*COM*:00000004 Mess_Integral_Gier |
*COM*:00000001 h |
*COM*:00000001 m |
*COM*:00000001 s |
*COM*:00000001 Motor_Vorne |
*COM*:00000001 Motor_Hinten |
*COM*:00000001 Motor_Rechts |
*COM*:00000001 Motor_Links |
*COM*:00000001 Count |
*COM*:00000005 MotorWert |
UNDEFINED SYMBOLS |
__do_copy_data |
__do_clear_bss |
EE_Parameter |
KompassValue |
KompassStartwert |
__divmodhi4 |
KompassRichtung |
Parameter_ServoNickControl |
__divmodsi4 |
__mulsi3 |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/twimaster.c |
---|
0,0 → 1,131 |
/*############################################################################ |
############################################################################*/ |
#include "main.h" |
unsigned char twi_state = 0; |
unsigned char motor = 0; |
unsigned char motorread = 0; |
unsigned char motor_rx[8]; |
//############################################################################ |
//Initzialisieren der I2C (TWI) Schnittstelle |
void i2c_init(void) |
//############################################################################ |
{ |
TWSR = 0; |
TWBR = ((SYSCLK/SCL_CLOCK)-16)/2; |
} |
//############################################################################ |
//Start I2C |
char i2c_start(void) |
//############################################################################ |
{ |
TWCR = (1<<TWSTA) | (1<<TWEN) | (1<<TWINT) | (1<<TWIE); |
return(0); |
} |
//############################################################################ |
//Start I2C |
void i2c_stop(void) |
//############################################################################ |
{ |
TWCR = (1<<TWEN) | (1<<TWSTO) | (1<<TWINT); |
} |
//############################################################################ |
//Start I2C |
char i2c_write_byte(char byte) |
//############################################################################ |
{ |
TWSR = 0x00; |
TWDR = byte; |
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWIE); |
return(0); |
} |
//############################################################################ |
//Start I2C |
SIGNAL (TWI_vect) |
//############################################################################ |
{ |
switch (twi_state++) |
{ |
case 0: |
i2c_write_byte(0x52+(motor*2)); |
break; |
case 1: |
switch(motor++) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 2: |
i2c_stop(); |
if (motor<4) twi_state = 0; |
else motor = 0; |
i2c_start(); |
break; |
//Liest Daten von Motor |
case 3: |
i2c_write_byte(0x53+(motorread*2)); |
break; |
case 4: |
switch(motorread) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 5: //1 Byte vom Motor lesen |
motor_rx[motorread] = TWDR; |
case 6: |
switch(motorread) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 7: //2 Byte vom Motor lesen |
motor_rx[motorread+4] = TWDR; |
motorread++; |
if (motorread>3) motorread=0; |
i2c_stop(); |
twi_state = 0; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/twimaster.d |
---|
0,0 → 1,2 |
twimaster.o twimaster.d : twimaster.c main.h old_macros.h _Settings.h printf_P.h \ |
timer0.h uart.h analog.h twimaster.h menu.h rc.h fc.h gps.h |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/twimaster.h |
---|
0,0 → 1,32 |
/*############################################################################ |
############################################################################*/ |
#ifndef _I2C_MASTER_H |
#define _I2C_MASTER_H |
//############################################################################ |
// I2C Konstanten |
#define SCL_CLOCK 200000L |
#define I2C_TIMEOUT 30000 |
#define I2C_START 0x08 |
#define I2C_REPEATED_START 0x10 |
#define I2C_TX_SLA_ACK 0x18 |
#define I2C_TX_DATA_ACK 0x28 |
#define I2C_RX_SLA_ACK 0x40 |
#define I2C_RX_DATA_ACK 0x50 |
//############################################################################ |
extern unsigned char twi_state; |
extern unsigned char motor; |
extern unsigned char motorread; |
extern unsigned char motor_rx[8]; |
void i2c_init (void); // I2C initialisieren |
char i2c_start (void); // Start I2C |
void i2c_stop (void); // Stop I2C |
char i2c_write_byte (char byte); // 1 Byte schreiben |
#endif |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/twimaster.lst |
---|
0,0 → 1,309 |
1 .file "twimaster.c" |
2 .arch atmega644 |
3 __SREG__ = 0x3f |
4 __SP_H__ = 0x3e |
5 __SP_L__ = 0x3d |
6 __tmp_reg__ = 0 |
7 __zero_reg__ = 1 |
8 .global __do_copy_data |
9 .global __do_clear_bss |
10 .text |
11 .global i2c_init |
13 i2c_init: |
14 /* prologue: frame size=0 */ |
15 /* prologue end (size=0) */ |
16 0000 1092 B900 sts 185,__zero_reg__ |
17 0004 8AE2 ldi r24,lo8(42) |
18 0006 8093 B800 sts 184,r24 |
19 /* epilogue: frame size=0 */ |
20 000a 0895 ret |
21 /* epilogue end (size=1) */ |
22 /* function i2c_init size 6 (5) */ |
24 .global i2c_start |
26 i2c_start: |
27 /* prologue: frame size=0 */ |
28 /* prologue end (size=0) */ |
29 000c 85EA ldi r24,lo8(-91) |
30 000e 8093 BC00 sts 188,r24 |
31 0012 80E0 ldi r24,lo8(0) |
32 0014 90E0 ldi r25,hi8(0) |
33 /* epilogue: frame size=0 */ |
34 0016 0895 ret |
35 /* epilogue end (size=1) */ |
36 /* function i2c_start size 6 (5) */ |
38 .global i2c_stop |
40 i2c_stop: |
41 /* prologue: frame size=0 */ |
42 /* prologue end (size=0) */ |
43 0018 84E9 ldi r24,lo8(-108) |
44 001a 8093 BC00 sts 188,r24 |
45 /* epilogue: frame size=0 */ |
46 001e 0895 ret |
47 /* epilogue end (size=1) */ |
48 /* function i2c_stop size 4 (3) */ |
50 .global i2c_write_byte |
52 i2c_write_byte: |
53 /* prologue: frame size=0 */ |
54 /* prologue end (size=0) */ |
55 0020 1092 B900 sts 185,__zero_reg__ |
56 0024 8093 BB00 sts 187,r24 |
57 0028 85E8 ldi r24,lo8(-123) |
58 002a 8093 BC00 sts 188,r24 |
59 002e 80E0 ldi r24,lo8(0) |
60 0030 90E0 ldi r25,hi8(0) |
61 /* epilogue: frame size=0 */ |
62 0032 0895 ret |
63 /* epilogue end (size=1) */ |
64 /* function i2c_write_byte size 10 (9) */ |
66 .global __vector_26 |
68 __vector_26: |
69 /* prologue: frame size=0 */ |
70 0034 1F92 push __zero_reg__ |
71 0036 0F92 push __tmp_reg__ |
72 0038 0FB6 in __tmp_reg__,__SREG__ |
73 003a 0F92 push __tmp_reg__ |
74 003c 1124 clr __zero_reg__ |
75 003e 8F93 push r24 |
76 0040 9F93 push r25 |
77 0042 EF93 push r30 |
78 0044 FF93 push r31 |
79 /* prologue end (size=9) */ |
80 0046 8091 0000 lds r24,twi_state |
81 004a 8F5F subi r24,lo8(-(1)) |
82 004c 8093 0000 sts twi_state,r24 |
83 0050 8150 subi r24,lo8(-(-1)) |
84 0052 8330 cpi r24,lo8(3) |
85 0054 01F4 brne .+2 |
86 0056 00C0 rjmp .L14 |
87 0058 8430 cpi r24,lo8(4) |
88 005a 00F4 brsh .L19 |
89 005c 8130 cpi r24,lo8(1) |
90 005e 01F0 breq .L12 |
91 0060 8230 cpi r24,lo8(2) |
92 0062 00F4 brsh .L13 |
93 0064 00C0 rjmp .L38 |
94 .L19: |
95 0066 8530 cpi r24,lo8(5) |
96 0068 01F4 brne .+2 |
97 006a 00C0 rjmp .L16 |
98 006c 8530 cpi r24,lo8(5) |
99 006e 00F0 brlo .L15 |
100 0070 8630 cpi r24,lo8(6) |
101 0072 01F4 brne .+2 |
102 0074 00C0 rjmp .L17 |
103 0076 8730 cpi r24,lo8(7) |
104 0078 01F0 breq .+2 |
105 007a 00C0 rjmp .L37 |
106 007c 00C0 rjmp .L18 |
107 .L38: |
108 007e 8091 0000 lds r24,motor |
109 0082 880F lsl r24 |
110 0084 8E5A subi r24,lo8(-(82)) |
111 0086 00C0 rjmp .L39 |
112 .L12: |
113 0088 8091 0000 lds r24,motor |
114 008c 8F5F subi r24,lo8(-(1)) |
115 008e 8093 0000 sts motor,r24 |
116 0092 8150 subi r24,lo8(-(-1)) |
117 0094 8130 cpi r24,lo8(1) |
118 0096 01F4 brne .+2 |
119 0098 00C0 rjmp .L32 |
120 009a 8130 cpi r24,lo8(1) |
121 009c 00F0 brlo .L20 |
122 009e 8230 cpi r24,lo8(2) |
123 00a0 01F4 brne .+2 |
124 00a2 00C0 rjmp .L33 |
125 00a4 8330 cpi r24,lo8(3) |
126 00a6 01F0 breq .+2 |
127 00a8 00C0 rjmp .L37 |
128 00aa 00C0 rjmp .L34 |
129 .L20: |
130 00ac 8091 0000 lds r24,Motor_Vorne |
131 .L39: |
132 00b0 1092 B900 sts 185,__zero_reg__ |
133 00b4 8093 BB00 sts 187,r24 |
134 00b8 85E8 ldi r24,lo8(-123) |
135 .L40: |
136 00ba 8093 BC00 sts 188,r24 |
137 00be 00C0 rjmp .L37 |
138 .L13: |
139 00c0 84E9 ldi r24,lo8(-108) |
140 00c2 8093 BC00 sts 188,r24 |
141 00c6 8091 0000 lds r24,motor |
142 00ca 8430 cpi r24,lo8(4) |
143 00cc 00F4 brsh .L24 |
144 00ce 1092 0000 sts twi_state,__zero_reg__ |
145 00d2 00C0 rjmp .L26 |
146 .L24: |
147 00d4 1092 0000 sts motor,__zero_reg__ |
148 .L26: |
149 00d8 85EA ldi r24,lo8(-91) |
150 00da 00C0 rjmp .L40 |
151 .L14: |
152 00dc 8091 0000 lds r24,motorread |
153 00e0 880F lsl r24 |
154 00e2 8D5A subi r24,lo8(-(83)) |
155 00e4 00C0 rjmp .L39 |
156 .L15: |
157 00e6 8091 0000 lds r24,motorread |
158 00ea 8130 cpi r24,lo8(1) |
159 00ec 01F0 breq .L32 |
160 00ee 8130 cpi r24,lo8(1) |
161 00f0 00F0 brlo .L20 |
162 00f2 8230 cpi r24,lo8(2) |
163 00f4 01F0 breq .L33 |
164 00f6 8330 cpi r24,lo8(3) |
165 00f8 01F4 brne .L37 |
166 00fa 00C0 rjmp .L34 |
167 .L16: |
168 00fc 8091 BB00 lds r24,187 |
169 0100 E091 0000 lds r30,motorread |
170 0104 FF27 clr r31 |
171 0106 E050 subi r30,lo8(-(motor_rx)) |
172 0108 F040 sbci r31,hi8(-(motor_rx)) |
173 010a 8083 st Z,r24 |
174 .L17: |
175 010c 8091 0000 lds r24,motorread |
176 0110 8130 cpi r24,lo8(1) |
177 0112 01F0 breq .L32 |
178 0114 8130 cpi r24,lo8(1) |
179 0116 00F0 brlo .L20 |
180 0118 8230 cpi r24,lo8(2) |
181 011a 01F0 breq .L33 |
182 011c 8330 cpi r24,lo8(3) |
183 011e 01F4 brne .L37 |
184 0120 00C0 rjmp .L34 |
185 .L32: |
186 0122 8091 0000 lds r24,Motor_Hinten |
187 0126 00C0 rjmp .L39 |
188 .L33: |
189 0128 8091 0000 lds r24,Motor_Rechts |
190 012c 00C0 rjmp .L39 |
191 .L34: |
192 012e 8091 0000 lds r24,Motor_Links |
193 0132 00C0 rjmp .L39 |
194 .L18: |
195 0134 8091 0000 lds r24,motorread |
196 0138 9091 BB00 lds r25,187 |
197 013c E82F mov r30,r24 |
198 013e FF27 clr r31 |
199 0140 E050 subi r30,lo8(-(motor_rx)) |
200 0142 F040 sbci r31,hi8(-(motor_rx)) |
201 0144 9483 std Z+4,r25 |
202 0146 8F5F subi r24,lo8(-(1)) |
203 0148 8093 0000 sts motorread,r24 |
204 014c 8430 cpi r24,lo8(4) |
205 014e 00F0 brlo .L35 |
206 0150 1092 0000 sts motorread,__zero_reg__ |
207 .L35: |
208 0154 84E9 ldi r24,lo8(-108) |
209 0156 8093 BC00 sts 188,r24 |
210 015a 1092 0000 sts twi_state,__zero_reg__ |
211 .L37: |
212 /* epilogue: frame size=0 */ |
213 015e FF91 pop r31 |
214 0160 EF91 pop r30 |
215 0162 9F91 pop r25 |
216 0164 8F91 pop r24 |
217 0166 0F90 pop __tmp_reg__ |
218 0168 0FBE out __SREG__,__tmp_reg__ |
219 016a 0F90 pop __tmp_reg__ |
220 016c 1F90 pop __zero_reg__ |
221 016e 1895 reti |
222 /* epilogue end (size=9) */ |
223 /* function __vector_26 size 158 (140) */ |
225 .global twi_state |
226 .global twi_state |
227 .section .bss |
230 twi_state: |
231 0000 00 .skip 1,0 |
232 .global motor |
233 .global motor |
236 motor: |
237 0001 00 .skip 1,0 |
238 .global motorread |
239 .global motorread |
242 motorread: |
243 0002 00 .skip 1,0 |
244 .comm DiffNick,2,1 |
245 .comm DiffRoll,2,1 |
246 .comm SenderOkay,1,1 |
247 .comm CosinusNickWinkel,1,1 |
248 .comm CosinusRollWinkel,1,1 |
249 .comm durchschnitt_northing,4,1 |
250 .comm durchschnitt_easting,4,1 |
251 .comm P_GPS_Verstaerkung,2,1 |
252 .comm D_GPS_Verstaerkung,2,1 |
253 .comm motor_rx,8,1 |
254 .comm RemoteTasten,1,1 |
255 .comm Timeout,1,1 |
256 .comm IntegralNick,4,1 |
257 .comm IntegralNick2,4,1 |
258 .comm IntegralRoll,4,1 |
259 .comm IntegralRoll2,4,1 |
260 .comm Mess_IntegralNick,4,1 |
261 .comm Mess_IntegralNick2,4,1 |
262 .comm Mess_IntegralRoll,4,1 |
263 .comm Mess_IntegralRoll2,4,1 |
264 .comm Integral_Gier,4,1 |
265 .comm Mess_Integral_Gier,4,1 |
266 .comm h,1,1 |
267 .comm m,1,1 |
268 .comm s,1,1 |
269 .comm Motor_Vorne,1,1 |
270 .comm Motor_Hinten,1,1 |
271 .comm Motor_Rechts,1,1 |
272 .comm Motor_Links,1,1 |
273 .comm Count,1,1 |
274 .comm MotorWert,5,1 |
275 /* File "twimaster.c": code 184 = 0x00b8 ( 162), prologues 9, epilogues 13 */ |
DEFINED SYMBOLS |
*ABS*:00000000 twimaster.c |
C:\DOKUME~1\none\LOKALE~1\Temp/ccoxlKXd.s:3 *ABS*:0000003f __SREG__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccoxlKXd.s:4 *ABS*:0000003e __SP_H__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccoxlKXd.s:5 *ABS*:0000003d __SP_L__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccoxlKXd.s:6 *ABS*:00000000 __tmp_reg__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccoxlKXd.s:7 *ABS*:00000001 __zero_reg__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccoxlKXd.s:13 .text:00000000 i2c_init |
C:\DOKUME~1\none\LOKALE~1\Temp/ccoxlKXd.s:26 .text:0000000c i2c_start |
C:\DOKUME~1\none\LOKALE~1\Temp/ccoxlKXd.s:40 .text:00000018 i2c_stop |
C:\DOKUME~1\none\LOKALE~1\Temp/ccoxlKXd.s:52 .text:00000020 i2c_write_byte |
C:\DOKUME~1\none\LOKALE~1\Temp/ccoxlKXd.s:68 .text:00000034 __vector_26 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccoxlKXd.s:230 .bss:00000000 twi_state |
C:\DOKUME~1\none\LOKALE~1\Temp/ccoxlKXd.s:236 .bss:00000001 motor |
*COM*:00000001 Motor_Vorne |
C:\DOKUME~1\none\LOKALE~1\Temp/ccoxlKXd.s:242 .bss:00000002 motorread |
*COM*:00000008 motor_rx |
*COM*:00000001 Motor_Hinten |
*COM*:00000001 Motor_Rechts |
*COM*:00000001 Motor_Links |
*COM*:00000002 DiffNick |
*COM*:00000002 DiffRoll |
*COM*:00000001 SenderOkay |
*COM*:00000001 CosinusNickWinkel |
*COM*:00000001 CosinusRollWinkel |
*COM*:00000004 durchschnitt_northing |
*COM*:00000004 durchschnitt_easting |
*COM*:00000002 P_GPS_Verstaerkung |
*COM*:00000002 D_GPS_Verstaerkung |
*COM*:00000001 RemoteTasten |
*COM*:00000001 Timeout |
*COM*:00000004 IntegralNick |
*COM*:00000004 IntegralNick2 |
*COM*:00000004 IntegralRoll |
*COM*:00000004 IntegralRoll2 |
*COM*:00000004 Mess_IntegralNick |
*COM*:00000004 Mess_IntegralNick2 |
*COM*:00000004 Mess_IntegralRoll |
*COM*:00000004 Mess_IntegralRoll2 |
*COM*:00000004 Integral_Gier |
*COM*:00000004 Mess_Integral_Gier |
*COM*:00000001 h |
*COM*:00000001 m |
*COM*:00000001 s |
*COM*:00000001 Count |
*COM*:00000005 MotorWert |
UNDEFINED SYMBOLS |
__do_copy_data |
__do_clear_bss |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/uart.c |
---|
0,0 → 1,641 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// + |
// + GPS read out: |
// + modified Version of the Pitschu Brushless Ufo - (c) Peter Schulten, Mülheim, Germany |
// + only for non-profit use |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
#include "uart.h" |
unsigned char DebugGetAnforderung = 0,DebugDisplayAnforderung = 0,DebugDataAnforderung = 0,GetVersionAnforderung = 0; |
unsigned volatile char SioTmp = 0; |
unsigned volatile char SendeBuffer[MAX_SENDE_BUFF]; |
unsigned volatile char RxdBuffer[MAX_EMPFANGS_BUFF]; |
unsigned volatile char NMEABuffer[MAX_EMPFANGS_BUFF]; |
unsigned volatile char NeuerDatensatzEmpfangen = 0; |
unsigned volatile char NeueKoordinateEmpfangen = 0; |
unsigned volatile char UebertragungAbgeschlossen = 1; |
unsigned volatile char CntCrcError = 0; |
unsigned volatile char AnzahlEmpfangsBytes = 0; |
unsigned volatile char PC_DebugTimeout = 0; |
unsigned char PcZugriff = 100; |
unsigned char MotorTest[4] = {0,0,0,0}; |
unsigned char MeineSlaveAdresse; |
struct str_DebugOut DebugOut; |
struct str_Debug DebugIn; |
struct str_VersionInfo VersionInfo; |
int Debug_Timer; |
static uint8_t gpsState; |
#define GPS_EMPTY 0 |
#define GPS_SYNC1 1 |
#define GPS_SYNC2 2 |
#define GPS_CLASS 3 |
#define GPS_LEN1 4 |
#define GPS_LEN2 5 |
#define GPS_FILLING 6 |
#define GPS_CKA 7 |
#define GPS_CKB 8 |
//gpsInfo_t gpsPoints[5]; // stored position to fly to (currently only 1 target supported) |
//gpsInfo_t *gpsTarget; // points to one of the targets |
gpsInfo_t actualPos; // measured position (last gps record) |
#define SYNC_CHAR1 0xb5 |
#define SYNC_CHAR2 0x62 |
#define CLASS_NAV 0x01 |
#define MSGID_POSECEF 0x01 |
#define MSGID_STATUS 0x03 |
#define MSGID_VELECEF 0x11 |
#define MSGID_POSUTM 0x08 |
#define MSGID_VELNED 0x12 |
typedef struct { |
unsigned long ITOW; // time of week |
uint8_t GPSfix; // GPSfix Type, range 0..6 |
uint8_t Flags; // Navigation Status Flags |
uint8_t DiffS; // Differential Status |
uint8_t res; // reserved |
unsigned long TTFF; // Time to first fix (millisecond time tag) |
unsigned long MSSS; // Milliseconds since Startup / Reset |
uint8_t packetStatus; |
} NAV_STATUS_t; |
typedef struct { |
unsigned long ITOW; // time of week |
long LON; // longitude in 1e-07 deg |
long LAT; // lattitude |
long HEIGHT; // height in mm |
long HMSL; // height above mean sea level im mm |
unsigned long Hacc; // horizontal accuracy in mm |
unsigned long Vacc; // vertical accuracy in mm |
uint8_t packetStatus; |
} NAV_POSLLH_t; |
typedef struct { |
unsigned long ITOW; // time of week |
long EAST; // cm UTM Easting |
long NORTH; // cm UTM Nording |
long ALT; // cm altitude |
uint8_t ZONE; // UTM zone number |
uint8_t HEM; // Hemisphere Indicator (0=North, 1=South) |
uint8_t packetStatus; |
} NAV_POSUTM_t; |
typedef struct { |
unsigned long ITOW; // ms GPS Millisecond Time of Week |
long VEL_N; // cm/s NED north velocity |
long VEL_E; // cm/s NED east velocity |
long VEL_D; // cm/s NED down velocity |
unsigned long Speed; // cm/s Speed (3-D) |
unsigned long GSpeed; // cm/s Ground Speed (2-D) |
long Heading; // deg (1e-05) Heading 2-D |
unsigned long SAcc; // cm/s Speed Accuracy Estimate |
unsigned long CAcc; // deg Course / Heading Accuracy Estimate |
uint8_t packetStatus; |
} NAV_VELNED_t; |
typedef struct { |
unsigned long ITOW; // ms GPS Millisecond Time of Week |
long ECEF_X; // ecef x / cm |
long ECEF_Y; // ecef y / cm |
long ECEF_Z; // ecef z / cm |
unsigned long Pacc; // Abweichung |
uint8_t packetStatus; |
} NAV_POSECEF_t ; |
typedef struct { |
unsigned long ITOW; // ms GPS Millisecond Time of Week |
long ECEFVX; // ecef x velocity cm/s |
long ECEFVY; // ecef y velocity cm/s |
long ECEFVZ; // ecef z velocity cm/s |
unsigned long SAcc; // Abweichung |
uint8_t packetStatus; |
} NAV_VELECEF_t; |
NAV_STATUS_t navStatus; |
NAV_POSECEF_t navPosECEF; |
NAV_VELECEF_t navVelECEF; |
NAV_POSUTM_t navPosUtm; |
NAV_VELNED_t navVelNed; |
volatile char *ubxP, *ubxEp, *ubxSp; // pointers to packet currently transfered |
volatile uint8_t CK_A, CK_B; // UBX checksum bytes |
volatile unsigned short msgLen; |
volatile uint8_t msgID; |
volatile uint8_t ignorePacket; // true when previous packet was not processed |
// distance to target position |
long rollOffset; // in 10cm |
long nickOffset; |
#define GPS_INTCYCLES 100 |
#define GPS_I_LIMIT (long)(40 * MAINLOOPS_PER_SEC) |
#ifdef GPS_DEBUG // if set then the GPS data is transfered to display |
extern volatile uint8_t v24state; |
char buf[200]; |
char *bp; |
char *ep; |
#endif |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//++ Sende-Part der Datenübertragung |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(INT_VEC_TX) |
{ |
static unsigned int ptr = 0; |
unsigned char tmp_tx; |
if(!UebertragungAbgeschlossen) |
{ |
ptr++; // die [0] wurde schon gesendet |
tmp_tx = SendeBuffer[ptr]; |
if((tmp_tx == '\r') || (ptr == MAX_SENDE_BUFF)) |
{ |
ptr = 0; |
UebertragungAbgeschlossen = 1; |
} |
UDR = tmp_tx; |
} |
else ptr = 0; |
} |
void GPSscanData (void) |
{ |
if (navPosECEF.packetStatus == 1) // valid packet |
{ |
actualPos.x = navPosECEF.ECEF_X; //ECEF X in cm |
actualPos.y = navPosECEF.ECEF_Y; //ECEF Y in cm |
actualPos.z = navPosECEF.ECEF_Z; //ECEF Z in cm |
navPosECEF.packetStatus = 0; |
} |
if (navStatus.packetStatus == 1) // valid packet |
{ |
actualPos.GPSFix = navStatus.GPSfix; |
actualPos.newData = navStatus.packetStatus; |
navStatus.packetStatus = 0; |
} |
if (navVelECEF.packetStatus == 1) // valid packet |
{ |
actualPos.vx = navVelECEF.ECEFVX; //ECEF VEL X in cm/s |
actualPos.vy = navVelECEF.ECEFVY; //ECEF VEL Y in cm/s |
actualPos.vz = navVelECEF.ECEFVZ; //ECEF VEL Z in cm/s |
navVelECEF.packetStatus = 0; |
} |
if (navPosUtm.packetStatus == 1) // valid packet |
{ |
actualPos.northing = navPosUtm.NORTH; |
actualPos.easting = navPosUtm.EAST; |
actualPos.altitude = navPosUtm.ALT; |
navPosUtm.packetStatus = 0; |
} |
if (navVelNed.packetStatus == 1) |
{ |
actualPos.velNorth = navVelNed.VEL_N; |
actualPos.velEast = navVelNed.VEL_E; |
navVelNed.packetStatus = 0; |
} |
if (actualPos.newData != 0){ROT_ON;} //-> Rot blinkt mit 4Hz wenn Daten vom GPS Empfänger ankommen und brauchbar sind |
} |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//++ Empfangs-Part der Datenübertragung, incl. CRC-Auswertung |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(INT_VEC_RX) |
{ |
static unsigned int crc; |
static unsigned char crc1,crc2,buf_ptr; |
static unsigned char UartState = 0; |
unsigned char CrcOkay = 0; |
SioTmp = UDR; |
uint8_t c; |
uint8_t re; |
re = (UCSR0A & (_B1(FE0) | _B1(DOR0))); // any error occured ? |
c = SioTmp; |
#ifdef GPS_DEBUG |
*bp++ = c; |
if (bp >= (buf+200)) bp = buf; |
if (v24state == 0) |
{ |
v24state = 1; |
UDR0 = *ep++; |
if (ep >= buf+200) |
ep = buf; |
UCSR0B |= _B1(UDRIE0); //enable further irqs |
} |
#endif |
if (re == 0) |
{ |
switch (gpsState) |
{ |
case GPS_EMPTY: |
if (c == SYNC_CHAR1) |
gpsState = GPS_SYNC1; |
break; |
case GPS_SYNC1: |
if (c == SYNC_CHAR2) |
gpsState = GPS_SYNC2; |
else if (c != SYNC_CHAR1) |
gpsState = GPS_EMPTY; |
break; |
case GPS_SYNC2: |
if (c == CLASS_NAV) |
gpsState = GPS_CLASS; |
else |
gpsState = GPS_EMPTY; |
break; |
case GPS_CLASS: // msg ID seen: init packed receive |
msgID = c; |
CK_A = CLASS_NAV + c; |
CK_B = CLASS_NAV + CK_A; |
gpsState = GPS_LEN1; |
switch (msgID) |
{ |
case MSGID_STATUS: |
ubxP = (char*)&navStatus; |
ubxEp = (char*)(&navStatus + sizeof(NAV_STATUS_t)); |
ubxSp = (char*)&navStatus.packetStatus; |
ignorePacket = navStatus.packetStatus; |
break; |
case MSGID_POSECEF: |
ubxP = (char*)&navPosECEF; |
ubxEp = (char*)(&navPosECEF + sizeof(NAV_POSECEF_t)); |
ubxSp = (char*)&navPosECEF.packetStatus; |
ignorePacket = navPosECEF.packetStatus; |
break; |
case MSGID_VELECEF: |
ubxP = (char*)&navVelECEF; |
ubxEp = (char*)(&navVelECEF + sizeof(NAV_VELECEF_t)); |
ubxSp = (char*)&navVelECEF.packetStatus; |
ignorePacket = navVelECEF.packetStatus; |
break; |
case MSGID_POSUTM: |
ubxP = (char*)&navPosUtm; |
ubxEp = (char*)(&navPosUtm + sizeof(NAV_POSUTM_t)); |
ubxSp = (char*)&navPosUtm.packetStatus; |
ignorePacket = navPosUtm.packetStatus; |
break; |
case MSGID_VELNED: |
ubxP = (char*)&navVelNed; |
ubxEp = (char*)(&navVelNed + sizeof(NAV_VELNED_t)); |
ubxSp = (char*)&navVelNed.packetStatus; |
ignorePacket = navVelNed.packetStatus; |
break; |
default: |
ignorePacket = 1; |
ubxSp = (char*)0; |
} |
break; |
case GPS_LEN1: // first len byte |
msgLen = c; |
CK_A += c; |
CK_B += CK_A; |
gpsState = GPS_LEN2; |
break; |
case GPS_LEN2: // second len byte |
msgLen = msgLen + (c * 256); |
CK_A += c; |
CK_B += CK_A; |
gpsState = GPS_FILLING; // next data will be stored in packet struct |
break; |
case GPS_FILLING: |
CK_A += c; |
CK_B += CK_A; |
if ( !ignorePacket && ubxP < ubxEp) |
*ubxP++ = c; |
if (--msgLen == 0) |
gpsState = GPS_CKA; |
break; |
case GPS_CKA: |
if (c == CK_A) |
gpsState = GPS_CKB; |
else |
gpsState = GPS_EMPTY; |
break; |
case GPS_CKB: |
if (c == CK_B && ubxSp) // No error -> packet received successfully |
*ubxSp = 1; // set packetStatus in struct |
gpsState = GPS_EMPTY; // ready for next packet |
break; |
default: |
gpsState = GPS_EMPTY; // ready for next packet |
} |
} |
else // discard any data if error occured |
{ |
gpsState = GPS_EMPTY; |
GPSscanData (); //Test kann ggf. wieder gelöscht werden! |
} |
GPSscanData (); |
if(buf_ptr >= MAX_EMPFANGS_BUFF) UartState = 0; |
if(SioTmp == '\r' && UartState == 2) |
{ |
UartState = 0; |
crc -= RxdBuffer[buf_ptr-2]; |
crc -= RxdBuffer[buf_ptr-1]; |
crc %= 4096; |
crc1 = '=' + crc / 64; |
crc2 = '=' + crc % 64; |
CrcOkay = 0; |
if((crc1 == RxdBuffer[buf_ptr-2]) && (crc2 == RxdBuffer[buf_ptr-1])) CrcOkay = 1; else { CrcOkay = 0; CntCrcError++;}; |
if(!NeuerDatensatzEmpfangen && CrcOkay) // Datensatz schon verarbeitet |
{ |
NeuerDatensatzEmpfangen = 1; |
AnzahlEmpfangsBytes = buf_ptr; |
RxdBuffer[buf_ptr] = '\r'; |
if(/*(RxdBuffer[1] == MeineSlaveAdresse || (RxdBuffer[1] == 'a')) && */(RxdBuffer[2] == 'R')) wdt_enable(WDTO_250MS); // Reset-Commando |
} |
} |
else |
switch(UartState) |
{ |
case 0: |
if(SioTmp == '#' && !NeuerDatensatzEmpfangen) UartState = 1; // Startzeichen und Daten schon verarbeitet |
buf_ptr = 0; |
RxdBuffer[buf_ptr++] = SioTmp; |
crc = SioTmp; |
break; |
case 1: // Adresse auswerten |
UartState++; |
RxdBuffer[buf_ptr++] = SioTmp; |
crc += SioTmp; |
break; |
case 2: // Eingangsdaten sammeln |
RxdBuffer[buf_ptr] = SioTmp; |
if(buf_ptr < MAX_EMPFANGS_BUFF) buf_ptr++; |
else UartState = 0; |
crc += SioTmp; |
break; |
default: |
UartState = 0; |
break; |
} |
} |
// -------------------------------------------------------------------------- |
void AddCRC(unsigned int wieviele) |
{ |
unsigned int tmpCRC = 0,i; |
for(i = 0; i < wieviele;i++) |
{ |
tmpCRC += SendeBuffer[i]; |
} |
tmpCRC %= 4096; |
SendeBuffer[i++] = '=' + tmpCRC / 64; |
SendeBuffer[i++] = '=' + tmpCRC % 64; |
SendeBuffer[i++] = '\r'; |
UebertragungAbgeschlossen = 0; |
UDR = SendeBuffer[0]; |
} |
// -------------------------------------------------------------------------- |
void SendOutData(unsigned char cmd,unsigned char modul, unsigned char *snd, unsigned char len) |
{ |
unsigned int pt = 0; |
unsigned char a,b,c; |
unsigned char ptr = 0; |
SendeBuffer[pt++] = '#'; // Startzeichen |
SendeBuffer[pt++] = modul; // Adresse (a=0; b=1,...) |
SendeBuffer[pt++] = cmd; // Commando |
while(len) |
{ |
if(len) { a = snd[ptr++]; len--;} else a = 0; |
if(len) { b = snd[ptr++]; len--;} else b = 0; |
if(len) { c = snd[ptr++]; len--;} else c = 0; |
SendeBuffer[pt++] = '=' + (a >> 2); |
SendeBuffer[pt++] = '=' + (((a & 0x03) << 4) | ((b & 0xf0) >> 4)); |
SendeBuffer[pt++] = '=' + (((b & 0x0f) << 2) | ((c & 0xc0) >> 6)); |
SendeBuffer[pt++] = '=' + ( c & 0x3f); |
} |
AddCRC(pt); |
} |
// -------------------------------------------------------------------------- |
void Decode64(unsigned char *ptrOut, unsigned char len, unsigned char ptrIn,unsigned char max) // Wohin mit den Daten; Wie lang; Wo im RxdBuffer |
{ |
unsigned char a,b,c,d; |
unsigned char ptr = 0; |
unsigned char x,y,z; |
while(len) |
{ |
a = RxdBuffer[ptrIn++] - '='; |
b = RxdBuffer[ptrIn++] - '='; |
c = RxdBuffer[ptrIn++] - '='; |
d = RxdBuffer[ptrIn++] - '='; |
if(ptrIn > max - 2) break; // nicht mehr Daten verarbeiten, als empfangen wurden |
x = (a << 2) | (b >> 4); |
y = ((b & 0x0f) << 4) | (c >> 2); |
z = ((c & 0x03) << 6) | d; |
if(len--) ptrOut[ptr++] = x; else break; |
if(len--) ptrOut[ptr++] = y; else break; |
if(len--) ptrOut[ptr++] = z; else break; |
} |
} |
// -------------------------------------------------------------------------- |
void BearbeiteRxDaten(void) |
{ |
if(!NeuerDatensatzEmpfangen) return; |
// unsigned int tmp_int_arr1[1]; |
// unsigned int tmp_int_arr2[2]; |
// unsigned int tmp_int_arr3[3]; |
unsigned char tmp_char_arr2[2]; |
// unsigned char tmp_char_arr3[3]; |
// unsigned char tmp_char_arr4[4]; |
//if(!MotorenEin) |
PcZugriff = 255; |
switch(RxdBuffer[2]) |
{ |
case 'c':// Debugdaten incl. Externe IOs usw |
Decode64((unsigned char *) &DebugIn,sizeof(DebugIn),3,AnzahlEmpfangsBytes); |
/* for(unsigned char i=0; i<4;i++) |
{ |
EE_CheckAndWrite(&EE_Buffer[EE_DEBUGWERTE + i*2], DebugIn.Analog[i]); |
EE_CheckAndWrite(&EE_Buffer[EE_DEBUGWERTE + i*2 + 1], DebugIn.Analog[i] >> 8); |
}*/ |
RemoteTasten |= DebugIn.RemoteTasten; |
DebugDataAnforderung = 1; |
break; |
case 'h':// x-1 Displayzeilen |
Decode64((unsigned char *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes); |
RemoteTasten |= tmp_char_arr2[0]; |
DebugDisplayAnforderung = 1; |
break; |
case 't':// Motortest |
Decode64((unsigned char *) &MotorTest[0],sizeof(MotorTest),3,AnzahlEmpfangsBytes); |
break; |
case 'v': // Version-Anforderung und Ausbaustufe |
GetVersionAnforderung = 1; |
break; |
case 'g':// "Get"-Anforderung für Debug-Daten |
// Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
DebugGetAnforderung = 1; |
break; |
case 'q':// "Get"-Anforderung für Settings |
// Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
Decode64((unsigned char *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes); |
if(tmp_char_arr2[0] != 0xff) |
{ |
if(tmp_char_arr2[0] > 5) tmp_char_arr2[0] = 5; |
ReadParameterSet(tmp_char_arr2[0], (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
SendOutData('L' + tmp_char_arr2[0] -1,MeineSlaveAdresse,(unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE); |
} |
else |
SendOutData('L' + GetActiveParamSetNumber()-1,MeineSlaveAdresse,(unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE); |
break; |
case 'l': |
case 'm': |
case 'n': |
case 'o': |
case 'p': // Parametersatz speichern |
Decode64((unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE,3,AnzahlEmpfangsBytes); |
WriteParameterSet(RxdBuffer[2] - 'l' + 1, (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], RxdBuffer[2] - 'l' + 1); // aktiven Datensatz merken |
Piep(GetActiveParamSetNumber()); |
break; |
} |
// DebugOut.AnzahlZyklen = Debug_Timer_Intervall; |
NeuerDatensatzEmpfangen = 0; |
} |
//############################################################################ |
//Routine für die Serielle Ausgabe |
int uart_putchar (char c) |
//############################################################################ |
{ |
if (c == '\n') |
uart_putchar('\r'); |
//Warten solange bis Zeichen gesendet wurde |
loop_until_bit_is_set(USR, UDRE); |
//Ausgabe des Zeichens |
UDR = c; |
return (0); |
} |
// -------------------------------------------------------------------------- |
void WriteProgramData(unsigned int pos, unsigned char wert) |
{ |
//if (ProgramLocation == IN_RAM) Buffer[pos] = wert; |
// else eeprom_write_byte(&EE_Buffer[pos], wert); |
// Buffer[pos] = wert; |
} |
//############################################################################ |
//INstallation der Seriellen Schnittstelle |
void UART_Init (void) |
//############################################################################ |
{ |
//Enable TXEN im Register UCR TX-Data Enable & RX Enable |
UCR=(1 << TXEN) | (1 << RXEN); |
// UART Double Speed (U2X) |
USR |= (1<<U2X); |
// RX-Interrupt Freigabe |
UCSRB |= (1<<RXCIE); |
// TX-Interrupt Freigabe |
UCSRB |= (1<<TXCIE); |
//Teiler wird gesetzt |
UBRR=(SYSCLK / (BAUD_RATE * 8L) - 1); |
//UBRR = 33; |
//öffnet einen Kanal für printf (STDOUT) |
//fdevopen (uart_putchar, 0); |
//sbi(PORTD,4); |
Debug_Timer = SetDelay(200); |
gpsState = GPS_EMPTY; |
} |
//--------------------------------------------------------------------------------------------- |
void DatenUebertragung(void) |
{ |
static char dis_zeile = 0; |
if(!UebertragungAbgeschlossen) return; |
if(DebugGetAnforderung && UebertragungAbgeschlossen) // Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
{ |
SendOutData('G',MeineSlaveAdresse,(unsigned char *) &DebugIn,sizeof(DebugIn)); |
DebugGetAnforderung = 0; |
} |
if((CheckDelay(Debug_Timer) || DebugDataAnforderung) && UebertragungAbgeschlossen) |
{ |
SendOutData('D',MeineSlaveAdresse,(unsigned char *) &DebugOut,sizeof(DebugOut)); |
DebugDataAnforderung = 0; |
Debug_Timer = SetDelay(MIN_DEBUG_INTERVALL); |
} |
if(DebugDisplayAnforderung && UebertragungAbgeschlossen) |
{ |
Menu(); |
DebugDisplayAnforderung = 0; |
if(++dis_zeile == 4) dis_zeile = 0; |
SendOutData('0' + dis_zeile,0,(unsigned char *)&DisplayBuff[20 * dis_zeile],20); // DisplayZeile übertragen |
} |
if(GetVersionAnforderung && UebertragungAbgeschlossen) |
{ |
SendOutData('V',MeineSlaveAdresse,(unsigned char *) &VersionInfo,sizeof(VersionInfo)); |
GetVersionAnforderung = 0; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/uart.d |
---|
0,0 → 1,2 |
uart.o uart.d : uart.c main.h old_macros.h _Settings.h printf_P.h timer0.h uart.h \ |
analog.h twimaster.h menu.h rc.h fc.h gps.h |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/uart.h |
---|
0,0 → 1,124 |
#ifndef _UART_H |
#define _UART_H |
#define MAX_SENDE_BUFF 150 |
#define MAX_EMPFANGS_BUFF 150 |
void BearbeiteRxDaten(void); |
extern unsigned char DebugGetAnforderung; |
extern unsigned volatile char SendeBuffer[MAX_SENDE_BUFF]; |
extern unsigned volatile char RxdBuffer[MAX_EMPFANGS_BUFF]; |
extern unsigned volatile char UebertragungAbgeschlossen; |
extern unsigned volatile char PC_DebugTimeout; |
extern unsigned volatile char NeueKoordinateEmpfangen; |
extern unsigned char MeineSlaveAdresse; |
extern unsigned char PcZugriff; |
extern int Debug_Timer; |
extern void UART_Init (void); |
extern int uart_putchar (char c); |
extern void boot_program_page (uint32_t page, uint8_t *buf); |
extern void DatenUebertragung(void); |
extern void DecodeNMEA(void); |
extern unsigned char MotorTest[4]; |
struct str_DebugOut |
{ |
unsigned char Digital[13]; |
unsigned int AnzahlZyklen; |
unsigned int Zeit; |
unsigned char Sekunden; |
unsigned int Analog[16]; // Debugwerte |
}; |
extern struct str_DebugOut DebugOut; |
#define _B1(bit) (1 << (bit)) |
#define _B0(bit) (0 << (bit)) |
typedef struct |
{ |
long x; // in cm (+ = north) |
long y; // in cm (+ = east) |
long z; // in cm |
long vx; |
long vy; |
long vz; |
long northing; |
long easting; |
long altitude; |
long velNorth; |
long velEast; |
uint8_t newData; // status of data: 0 = invlid; 1 = valid |
uint8_t GPSFix; |
uint8_t noSV; // number of sats |
} gpsInfo_t; |
extern gpsInfo_t lockedPos; // stored position to fly to |
extern gpsInfo_t actualPos; // measured position (last gps record) |
extern void GPSscanData (void); |
extern void GPSupdate(void); |
extern void GPSsaveTarget (uint8_t mode); |
struct str_Debug |
{ |
unsigned char Digital[2]; |
unsigned char RemoteTasten; |
unsigned int Analog[4]; |
}; |
extern struct str_Debug DebugIn; |
struct str_VersionInfo |
{ |
unsigned char Hauptversion; |
unsigned char Nebenversion; |
unsigned char PCKompatibel; |
unsigned char Rserved[7]; |
}; |
extern struct str_VersionInfo VersionInfo; |
//Die Baud_Rate der Seriellen Schnittstelle ist 9600 Baud |
//#define BAUD_RATE 9600 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 14400 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 28800 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 38400 //Baud Rate für die Serielle Schnittstelle |
#define BAUD_RATE 57600 //Baud Rate für die Serielle Schnittstelle |
//Anpassen der seriellen Schnittstellen Register wenn ein ATMega128 benutzt wird |
#if defined (__AVR_ATmega128__) |
# define USR UCSR0A |
# define UCR UCSR0B |
# define UDR UDR0 |
# define UBRR UBRR0L |
# define EICR EICRB |
#endif |
#if defined (__AVR_ATmega32__) |
# define USR UCSRA |
# define UCR UCSRB |
# define UBRR UBRRL |
# define EICR EICRB |
# define INT_VEC_RX SIG_UART_RECV |
# define INT_VEC_TX SIG_UART_TRANS |
#endif |
#if defined (__AVR_ATmega644__) |
# define USR UCSR0A |
# define UCR UCSR0B |
# define UDR UDR0 |
# define UBRR UBRR0L |
# define EICR EICR0B |
# define TXEN TXEN0 |
# define RXEN RXEN0 |
# define RXCIE RXCIE0 |
# define TXCIE TXCIE0 |
# define U2X U2X0 |
# define UCSRB UCSR0B |
# define UDRE UDRE0 |
# define INT_VEC_RX SIG_USART_RECV |
# define INT_VEC_TX SIG_USART_TRANS |
#endif |
#endif //_UART_H |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/uart.lst |
---|
0,0 → 1,1454 |
1 .file "uart.c" |
2 .arch atmega644 |
3 __SREG__ = 0x3f |
4 __SP_H__ = 0x3e |
5 __SP_L__ = 0x3d |
6 __tmp_reg__ = 0 |
7 __zero_reg__ = 1 |
8 .global __do_copy_data |
9 .global __do_clear_bss |
10 .text |
11 .global __vector_22 |
13 __vector_22: |
14 /* prologue: frame size=0 */ |
15 0000 1F92 push __zero_reg__ |
16 0002 0F92 push __tmp_reg__ |
17 0004 0FB6 in __tmp_reg__,__SREG__ |
18 0006 0F92 push __tmp_reg__ |
19 0008 1124 clr __zero_reg__ |
20 000a 8F93 push r24 |
21 000c 9F93 push r25 |
22 000e EF93 push r30 |
23 0010 FF93 push r31 |
24 /* prologue end (size=9) */ |
25 0012 8091 0000 lds r24,UebertragungAbgeschlossen |
26 0016 8823 tst r24 |
27 0018 01F4 brne .L2 |
28 001a 8091 0000 lds r24,ptr.2090 |
29 001e 9091 0000 lds r25,(ptr.2090)+1 |
30 0022 0196 adiw r24,1 |
31 0024 9093 0000 sts (ptr.2090)+1,r25 |
32 0028 8093 0000 sts ptr.2090,r24 |
33 002c FC01 movw r30,r24 |
34 002e E050 subi r30,lo8(-(SendeBuffer)) |
35 0030 F040 sbci r31,hi8(-(SendeBuffer)) |
36 0032 E081 ld r30,Z |
37 0034 ED30 cpi r30,lo8(13) |
38 0036 01F0 breq .L4 |
39 0038 8639 cpi r24,150 |
40 003a 9105 cpc r25,__zero_reg__ |
41 003c 01F4 brne .L6 |
42 .L4: |
43 003e 1092 0000 sts (ptr.2090)+1,__zero_reg__ |
44 0042 1092 0000 sts ptr.2090,__zero_reg__ |
45 0046 81E0 ldi r24,lo8(1) |
46 0048 8093 0000 sts UebertragungAbgeschlossen,r24 |
47 .L6: |
48 004c E093 C600 sts 198,r30 |
49 0050 00C0 rjmp .L8 |
50 .L2: |
51 0052 1092 0000 sts (ptr.2090)+1,__zero_reg__ |
52 0056 1092 0000 sts ptr.2090,__zero_reg__ |
53 .L8: |
54 /* epilogue: frame size=0 */ |
55 005a FF91 pop r31 |
56 005c EF91 pop r30 |
57 005e 9F91 pop r25 |
58 0060 8F91 pop r24 |
59 0062 0F90 pop __tmp_reg__ |
60 0064 0FBE out __SREG__,__tmp_reg__ |
61 0066 0F90 pop __tmp_reg__ |
62 0068 1F90 pop __zero_reg__ |
63 006a 1895 reti |
64 /* epilogue end (size=9) */ |
65 /* function __vector_22 size 54 (36) */ |
67 .global GPSscanData |
69 GPSscanData: |
70 /* prologue: frame size=0 */ |
71 /* prologue end (size=0) */ |
72 006c 8091 0000 lds r24,navPosECEF+20 |
73 0070 8130 cpi r24,lo8(1) |
74 0072 01F4 brne .L10 |
75 0074 8091 0000 lds r24,navPosECEF+4 |
76 0078 9091 0000 lds r25,(navPosECEF+4)+1 |
77 007c A091 0000 lds r26,(navPosECEF+4)+2 |
78 0080 B091 0000 lds r27,(navPosECEF+4)+3 |
79 0084 8093 0000 sts actualPos,r24 |
80 0088 9093 0000 sts (actualPos)+1,r25 |
81 008c A093 0000 sts (actualPos)+2,r26 |
82 0090 B093 0000 sts (actualPos)+3,r27 |
83 0094 8091 0000 lds r24,navPosECEF+8 |
84 0098 9091 0000 lds r25,(navPosECEF+8)+1 |
85 009c A091 0000 lds r26,(navPosECEF+8)+2 |
86 00a0 B091 0000 lds r27,(navPosECEF+8)+3 |
87 00a4 8093 0000 sts actualPos+4,r24 |
88 00a8 9093 0000 sts (actualPos+4)+1,r25 |
89 00ac A093 0000 sts (actualPos+4)+2,r26 |
90 00b0 B093 0000 sts (actualPos+4)+3,r27 |
91 00b4 8091 0000 lds r24,navPosECEF+12 |
92 00b8 9091 0000 lds r25,(navPosECEF+12)+1 |
93 00bc A091 0000 lds r26,(navPosECEF+12)+2 |
94 00c0 B091 0000 lds r27,(navPosECEF+12)+3 |
95 00c4 8093 0000 sts actualPos+8,r24 |
96 00c8 9093 0000 sts (actualPos+8)+1,r25 |
97 00cc A093 0000 sts (actualPos+8)+2,r26 |
98 00d0 B093 0000 sts (actualPos+8)+3,r27 |
99 00d4 1092 0000 sts navPosECEF+20,__zero_reg__ |
100 .L10: |
101 00d8 9091 0000 lds r25,navStatus+16 |
102 00dc 9130 cpi r25,lo8(1) |
103 00de 01F4 brne .L12 |
104 00e0 8091 0000 lds r24,navStatus+4 |
105 00e4 8093 0000 sts actualPos+45,r24 |
106 00e8 9093 0000 sts actualPos+44,r25 |
107 00ec 1092 0000 sts navStatus+16,__zero_reg__ |
108 .L12: |
109 00f0 8091 0000 lds r24,navVelECEF+20 |
110 00f4 8130 cpi r24,lo8(1) |
111 00f6 01F4 brne .L14 |
112 00f8 8091 0000 lds r24,navVelECEF+4 |
113 00fc 9091 0000 lds r25,(navVelECEF+4)+1 |
114 0100 A091 0000 lds r26,(navVelECEF+4)+2 |
115 0104 B091 0000 lds r27,(navVelECEF+4)+3 |
116 0108 8093 0000 sts actualPos+12,r24 |
117 010c 9093 0000 sts (actualPos+12)+1,r25 |
118 0110 A093 0000 sts (actualPos+12)+2,r26 |
119 0114 B093 0000 sts (actualPos+12)+3,r27 |
120 0118 8091 0000 lds r24,navVelECEF+8 |
121 011c 9091 0000 lds r25,(navVelECEF+8)+1 |
122 0120 A091 0000 lds r26,(navVelECEF+8)+2 |
123 0124 B091 0000 lds r27,(navVelECEF+8)+3 |
124 0128 8093 0000 sts actualPos+16,r24 |
125 012c 9093 0000 sts (actualPos+16)+1,r25 |
126 0130 A093 0000 sts (actualPos+16)+2,r26 |
127 0134 B093 0000 sts (actualPos+16)+3,r27 |
128 0138 8091 0000 lds r24,navVelECEF+12 |
129 013c 9091 0000 lds r25,(navVelECEF+12)+1 |
130 0140 A091 0000 lds r26,(navVelECEF+12)+2 |
131 0144 B091 0000 lds r27,(navVelECEF+12)+3 |
132 0148 8093 0000 sts actualPos+20,r24 |
133 014c 9093 0000 sts (actualPos+20)+1,r25 |
134 0150 A093 0000 sts (actualPos+20)+2,r26 |
135 0154 B093 0000 sts (actualPos+20)+3,r27 |
136 0158 1092 0000 sts navVelECEF+20,__zero_reg__ |
137 .L14: |
138 015c 8091 0000 lds r24,navPosUtm+18 |
139 0160 8130 cpi r24,lo8(1) |
140 0162 01F4 brne .L16 |
141 0164 8091 0000 lds r24,navPosUtm+8 |
142 0168 9091 0000 lds r25,(navPosUtm+8)+1 |
143 016c A091 0000 lds r26,(navPosUtm+8)+2 |
144 0170 B091 0000 lds r27,(navPosUtm+8)+3 |
145 0174 8093 0000 sts actualPos+24,r24 |
146 0178 9093 0000 sts (actualPos+24)+1,r25 |
147 017c A093 0000 sts (actualPos+24)+2,r26 |
148 0180 B093 0000 sts (actualPos+24)+3,r27 |
149 0184 8091 0000 lds r24,navPosUtm+4 |
150 0188 9091 0000 lds r25,(navPosUtm+4)+1 |
151 018c A091 0000 lds r26,(navPosUtm+4)+2 |
152 0190 B091 0000 lds r27,(navPosUtm+4)+3 |
153 0194 8093 0000 sts actualPos+28,r24 |
154 0198 9093 0000 sts (actualPos+28)+1,r25 |
155 019c A093 0000 sts (actualPos+28)+2,r26 |
156 01a0 B093 0000 sts (actualPos+28)+3,r27 |
157 01a4 8091 0000 lds r24,navPosUtm+12 |
158 01a8 9091 0000 lds r25,(navPosUtm+12)+1 |
159 01ac A091 0000 lds r26,(navPosUtm+12)+2 |
160 01b0 B091 0000 lds r27,(navPosUtm+12)+3 |
161 01b4 8093 0000 sts actualPos+32,r24 |
162 01b8 9093 0000 sts (actualPos+32)+1,r25 |
163 01bc A093 0000 sts (actualPos+32)+2,r26 |
164 01c0 B093 0000 sts (actualPos+32)+3,r27 |
165 01c4 1092 0000 sts navPosUtm+18,__zero_reg__ |
166 .L16: |
167 01c8 8091 0000 lds r24,navVelNed+36 |
168 01cc 8130 cpi r24,lo8(1) |
169 01ce 01F4 brne .L18 |
170 01d0 8091 0000 lds r24,navVelNed+4 |
171 01d4 9091 0000 lds r25,(navVelNed+4)+1 |
172 01d8 A091 0000 lds r26,(navVelNed+4)+2 |
173 01dc B091 0000 lds r27,(navVelNed+4)+3 |
174 01e0 8093 0000 sts actualPos+36,r24 |
175 01e4 9093 0000 sts (actualPos+36)+1,r25 |
176 01e8 A093 0000 sts (actualPos+36)+2,r26 |
177 01ec B093 0000 sts (actualPos+36)+3,r27 |
178 01f0 8091 0000 lds r24,navVelNed+8 |
179 01f4 9091 0000 lds r25,(navVelNed+8)+1 |
180 01f8 A091 0000 lds r26,(navVelNed+8)+2 |
181 01fc B091 0000 lds r27,(navVelNed+8)+3 |
182 0200 8093 0000 sts actualPos+40,r24 |
183 0204 9093 0000 sts (actualPos+40)+1,r25 |
184 0208 A093 0000 sts (actualPos+40)+2,r26 |
185 020c B093 0000 sts (actualPos+40)+3,r27 |
186 0210 1092 0000 sts navVelNed+36,__zero_reg__ |
187 .L18: |
188 0214 8091 0000 lds r24,actualPos+44 |
189 0218 8111 cpse r24,__zero_reg__ |
190 021a 289A sbi 37-0x20,0 |
191 .L22: |
192 021c 0895 ret |
193 /* epilogue: frame size=0 */ |
194 /* epilogue: noreturn */ |
195 /* epilogue end (size=0) */ |
196 /* function GPSscanData size 218 (218) */ |
198 .global __vector_20 |
200 __vector_20: |
201 /* prologue: frame size=0 */ |
202 021e 1F92 push __zero_reg__ |
203 0220 0F92 push __tmp_reg__ |
204 0222 0FB6 in __tmp_reg__,__SREG__ |
205 0224 0F92 push __tmp_reg__ |
206 0226 1124 clr __zero_reg__ |
207 0228 2F93 push r18 |
208 022a 3F93 push r19 |
209 022c 4F93 push r20 |
210 022e 5F93 push r21 |
211 0230 6F93 push r22 |
212 0232 7F93 push r23 |
213 0234 8F93 push r24 |
214 0236 9F93 push r25 |
215 0238 AF93 push r26 |
216 023a BF93 push r27 |
217 023c CF93 push r28 |
218 023e DF93 push r29 |
219 0240 EF93 push r30 |
220 0242 FF93 push r31 |
221 /* prologue end (size=19) */ |
222 0244 8091 C600 lds r24,198 |
223 0248 8093 0000 sts SioTmp,r24 |
224 024c 8091 C000 lds r24,192 |
225 0250 4091 0000 lds r20,SioTmp |
226 0254 8871 andi r24,lo8(24) |
227 0256 01F0 breq .+2 |
228 0258 00C0 rjmp .L24 |
229 025a 8091 0000 lds r24,gpsState |
230 025e 8430 cpi r24,lo8(4) |
231 0260 01F4 brne .+2 |
232 0262 00C0 rjmp .L31 |
233 0264 8530 cpi r24,lo8(5) |
234 0266 00F4 brsh .L36 |
235 0268 8130 cpi r24,lo8(1) |
236 026a 01F0 breq .L28 |
237 026c 8130 cpi r24,lo8(1) |
238 026e 00F0 brlo .L27 |
239 0270 8230 cpi r24,lo8(2) |
240 0272 01F0 breq .L29 |
241 0274 8330 cpi r24,lo8(3) |
242 0276 01F0 breq .+2 |
243 0278 00C0 rjmp .L26 |
244 027a 00C0 rjmp .L30 |
245 .L36: |
246 027c 8630 cpi r24,lo8(6) |
247 027e 01F4 brne .+2 |
248 0280 00C0 rjmp .L33 |
249 0282 8630 cpi r24,lo8(6) |
250 0284 00F4 brsh .+2 |
251 0286 00C0 rjmp .L32 |
252 0288 8730 cpi r24,lo8(7) |
253 028a 01F4 brne .+2 |
254 028c 00C0 rjmp .L34 |
255 028e 8830 cpi r24,lo8(8) |
256 0290 01F0 breq .+2 |
257 0292 00C0 rjmp .L26 |
258 0294 00C0 rjmp .L35 |
259 .L27: |
260 0296 453B cpi r20,lo8(-75) |
261 0298 01F0 breq .+2 |
262 029a 00C0 rjmp .L37 |
263 029c 81E0 ldi r24,lo8(1) |
264 029e 00C0 rjmp .L85 |
265 .L28: |
266 02a0 4236 cpi r20,lo8(98) |
267 02a2 01F4 brne .L39 |
268 02a4 82E0 ldi r24,lo8(2) |
269 .L85: |
270 02a6 8093 0000 sts gpsState,r24 |
271 02aa 00C0 rjmp .L37 |
272 .L39: |
273 02ac 453B cpi r20,lo8(-75) |
274 02ae 01F4 brne .+2 |
275 02b0 00C0 rjmp .L37 |
276 02b2 00C0 rjmp .L26 |
277 .L29: |
278 02b4 4130 cpi r20,lo8(1) |
279 02b6 01F0 breq .+2 |
280 02b8 00C0 rjmp .L26 |
281 02ba 83E0 ldi r24,lo8(3) |
282 02bc 00C0 rjmp .L85 |
283 .L30: |
284 02be 4093 0000 sts msgID,r20 |
285 02c2 4F5F subi r20,lo8(-(1)) |
286 02c4 4093 0000 sts CK_A,r20 |
287 02c8 8091 0000 lds r24,CK_A |
288 02cc 8F5F subi r24,lo8(-(1)) |
289 02ce 8093 0000 sts CK_B,r24 |
290 02d2 84E0 ldi r24,lo8(4) |
291 02d4 8093 0000 sts gpsState,r24 |
292 02d8 8091 0000 lds r24,msgID |
293 02dc 8830 cpi r24,lo8(8) |
294 02de 01F4 brne .+2 |
295 02e0 00C0 rjmp .L47 |
296 02e2 8930 cpi r24,lo8(9) |
297 02e4 00F4 brsh .L50 |
298 02e6 8130 cpi r24,lo8(1) |
299 02e8 01F0 breq .L45 |
300 02ea 8330 cpi r24,lo8(3) |
301 02ec 01F0 breq .+2 |
302 02ee 00C0 rjmp .L44 |
303 02f0 00C0 rjmp .L46 |
304 .L50: |
305 02f2 8131 cpi r24,lo8(17) |
306 02f4 01F0 breq .L48 |
307 02f6 8231 cpi r24,lo8(18) |
308 02f8 01F0 breq .+2 |
309 02fa 00C0 rjmp .L44 |
310 02fc 00C0 rjmp .L49 |
311 .L46: |
312 02fe 80E0 ldi r24,lo8(navStatus) |
313 0300 90E0 ldi r25,hi8(navStatus) |
314 0302 9093 0000 sts (ubxP)+1,r25 |
315 0306 8093 0000 sts ubxP,r24 |
316 030a 20E0 ldi r18,lo8(navStatus+289) |
317 030c 30E0 ldi r19,hi8(navStatus+289) |
318 030e 3093 0000 sts (ubxEp)+1,r19 |
319 0312 2093 0000 sts ubxEp,r18 |
320 0316 4096 adiw r24,16 |
321 0318 9093 0000 sts (ubxSp)+1,r25 |
322 031c 8093 0000 sts ubxSp,r24 |
323 0320 8091 0000 lds r24,navStatus+16 |
324 0324 00C0 rjmp .L86 |
325 .L45: |
326 0326 80E0 ldi r24,lo8(navPosECEF) |
327 0328 90E0 ldi r25,hi8(navPosECEF) |
328 032a 9093 0000 sts (ubxP)+1,r25 |
329 032e 8093 0000 sts ubxP,r24 |
330 0332 20E0 ldi r18,lo8(navPosECEF+441) |
331 0334 30E0 ldi r19,hi8(navPosECEF+441) |
332 0336 3093 0000 sts (ubxEp)+1,r19 |
333 033a 2093 0000 sts ubxEp,r18 |
334 033e 4496 adiw r24,20 |
335 0340 9093 0000 sts (ubxSp)+1,r25 |
336 0344 8093 0000 sts ubxSp,r24 |
337 0348 8091 0000 lds r24,navPosECEF+20 |
338 034c 00C0 rjmp .L86 |
339 .L48: |
340 034e 80E0 ldi r24,lo8(navVelECEF) |
341 0350 90E0 ldi r25,hi8(navVelECEF) |
342 0352 9093 0000 sts (ubxP)+1,r25 |
343 0356 8093 0000 sts ubxP,r24 |
344 035a 20E0 ldi r18,lo8(navVelECEF+441) |
345 035c 30E0 ldi r19,hi8(navVelECEF+441) |
346 035e 3093 0000 sts (ubxEp)+1,r19 |
347 0362 2093 0000 sts ubxEp,r18 |
348 0366 4496 adiw r24,20 |
349 0368 9093 0000 sts (ubxSp)+1,r25 |
350 036c 8093 0000 sts ubxSp,r24 |
351 0370 8091 0000 lds r24,navVelECEF+20 |
352 0374 00C0 rjmp .L86 |
353 .L47: |
354 0376 80E0 ldi r24,lo8(navPosUtm) |
355 0378 90E0 ldi r25,hi8(navPosUtm) |
356 037a 9093 0000 sts (ubxP)+1,r25 |
357 037e 8093 0000 sts ubxP,r24 |
358 0382 20E0 ldi r18,lo8(navPosUtm+361) |
359 0384 30E0 ldi r19,hi8(navPosUtm+361) |
360 0386 3093 0000 sts (ubxEp)+1,r19 |
361 038a 2093 0000 sts ubxEp,r18 |
362 038e 4296 adiw r24,18 |
363 0390 9093 0000 sts (ubxSp)+1,r25 |
364 0394 8093 0000 sts ubxSp,r24 |
365 0398 8091 0000 lds r24,navPosUtm+18 |
366 039c 00C0 rjmp .L86 |
367 .L49: |
368 039e 80E0 ldi r24,lo8(navVelNed) |
369 03a0 90E0 ldi r25,hi8(navVelNed) |
370 03a2 9093 0000 sts (ubxP)+1,r25 |
371 03a6 8093 0000 sts ubxP,r24 |
372 03aa 20E0 ldi r18,lo8(navVelNed+1369) |
373 03ac 30E0 ldi r19,hi8(navVelNed+1369) |
374 03ae 3093 0000 sts (ubxEp)+1,r19 |
375 03b2 2093 0000 sts ubxEp,r18 |
376 03b6 8496 adiw r24,36 |
377 03b8 9093 0000 sts (ubxSp)+1,r25 |
378 03bc 8093 0000 sts ubxSp,r24 |
379 03c0 8091 0000 lds r24,navVelNed+36 |
380 .L86: |
381 03c4 8093 0000 sts ignorePacket,r24 |
382 03c8 00C0 rjmp .L37 |
383 .L44: |
384 03ca 81E0 ldi r24,lo8(1) |
385 03cc 8093 0000 sts ignorePacket,r24 |
386 03d0 1092 0000 sts (ubxSp)+1,__zero_reg__ |
387 03d4 1092 0000 sts ubxSp,__zero_reg__ |
388 03d8 00C0 rjmp .L37 |
389 .L31: |
390 03da 842F mov r24,r20 |
391 03dc 9927 clr r25 |
392 03de 9093 0000 sts (msgLen)+1,r25 |
393 03e2 8093 0000 sts msgLen,r24 |
394 03e6 8091 0000 lds r24,CK_A |
395 03ea 840F add r24,r20 |
396 03ec 8093 0000 sts CK_A,r24 |
397 03f0 8091 0000 lds r24,CK_B |
398 03f4 9091 0000 lds r25,CK_A |
399 03f8 890F add r24,r25 |
400 03fa 8093 0000 sts CK_B,r24 |
401 03fe 85E0 ldi r24,lo8(5) |
402 0400 00C0 rjmp .L85 |
403 .L32: |
404 0402 2091 0000 lds r18,msgLen |
405 0406 3091 0000 lds r19,(msgLen)+1 |
406 040a 842F mov r24,r20 |
407 040c 9927 clr r25 |
408 040e 982F mov r25,r24 |
409 0410 8827 clr r24 |
410 0412 280F add r18,r24 |
411 0414 391F adc r19,r25 |
412 0416 3093 0000 sts (msgLen)+1,r19 |
413 041a 2093 0000 sts msgLen,r18 |
414 041e 8091 0000 lds r24,CK_A |
415 0422 840F add r24,r20 |
416 0424 8093 0000 sts CK_A,r24 |
417 0428 8091 0000 lds r24,CK_B |
418 042c 9091 0000 lds r25,CK_A |
419 0430 890F add r24,r25 |
420 0432 8093 0000 sts CK_B,r24 |
421 0436 86E0 ldi r24,lo8(6) |
422 0438 00C0 rjmp .L85 |
423 .L33: |
424 043a 8091 0000 lds r24,CK_A |
425 043e 840F add r24,r20 |
426 0440 8093 0000 sts CK_A,r24 |
427 0444 8091 0000 lds r24,CK_B |
428 0448 9091 0000 lds r25,CK_A |
429 044c 890F add r24,r25 |
430 044e 8093 0000 sts CK_B,r24 |
431 0452 8091 0000 lds r24,ignorePacket |
432 0456 8823 tst r24 |
433 0458 01F4 brne .L51 |
434 045a E091 0000 lds r30,ubxP |
435 045e F091 0000 lds r31,(ubxP)+1 |
436 0462 8091 0000 lds r24,ubxEp |
437 0466 9091 0000 lds r25,(ubxEp)+1 |
438 046a E817 cp r30,r24 |
439 046c F907 cpc r31,r25 |
440 046e 00F4 brsh .L51 |
441 0470 4193 st Z+,r20 |
442 0472 F093 0000 sts (ubxP)+1,r31 |
443 0476 E093 0000 sts ubxP,r30 |
444 .L51: |
445 047a 8091 0000 lds r24,msgLen |
446 047e 9091 0000 lds r25,(msgLen)+1 |
447 0482 0197 sbiw r24,1 |
448 0484 9093 0000 sts (msgLen)+1,r25 |
449 0488 8093 0000 sts msgLen,r24 |
450 048c 8091 0000 lds r24,msgLen |
451 0490 9091 0000 lds r25,(msgLen)+1 |
452 0494 892B or r24,r25 |
453 0496 01F4 brne .L37 |
454 0498 87E0 ldi r24,lo8(7) |
455 049a 00C0 rjmp .L85 |
456 .L34: |
457 049c 8091 0000 lds r24,CK_A |
458 04a0 4817 cp r20,r24 |
459 04a2 01F4 brne .L26 |
460 04a4 88E0 ldi r24,lo8(8) |
461 04a6 00C0 rjmp .L85 |
462 .L35: |
463 04a8 8091 0000 lds r24,CK_B |
464 04ac 4817 cp r20,r24 |
465 04ae 01F4 brne .L26 |
466 04b0 E091 0000 lds r30,ubxSp |
467 04b4 F091 0000 lds r31,(ubxSp)+1 |
468 04b8 3097 sbiw r30,0 |
469 04ba 01F0 breq .L26 |
470 04bc 81E0 ldi r24,lo8(1) |
471 04be 8083 st Z,r24 |
472 .L26: |
473 04c0 1092 0000 sts gpsState,__zero_reg__ |
474 04c4 00C0 rjmp .L37 |
475 .L24: |
476 04c6 1092 0000 sts gpsState,__zero_reg__ |
477 04ca 0E94 0000 call GPSscanData |
478 .L37: |
479 04ce 0E94 0000 call GPSscanData |
480 04d2 4091 0000 lds r20,buf_ptr.2130 |
481 04d6 4639 cpi r20,lo8(-106) |
482 04d8 00F0 brlo .L60 |
483 04da 1092 0000 sts UartState.2131,__zero_reg__ |
484 .L60: |
485 04de 8091 0000 lds r24,SioTmp |
486 04e2 8D30 cpi r24,lo8(13) |
487 04e4 01F0 breq .+2 |
488 04e6 00C0 rjmp .L62 |
489 04e8 8091 0000 lds r24,UartState.2131 |
490 04ec 8230 cpi r24,lo8(2) |
491 04ee 01F0 breq .+2 |
492 04f0 00C0 rjmp .L62 |
493 04f2 1092 0000 sts UartState.2131,__zero_reg__ |
494 04f6 A42F mov r26,r20 |
495 04f8 BB27 clr r27 |
496 04fa FD01 movw r30,r26 |
497 04fc E050 subi r30,lo8(-(RxdBuffer-2)) |
498 04fe F040 sbci r31,hi8(-(RxdBuffer-2)) |
499 0500 3081 ld r19,Z |
500 0502 ED01 movw r28,r26 |
501 0504 C050 subi r28,lo8(-(RxdBuffer-1)) |
502 0506 D040 sbci r29,hi8(-(RxdBuffer-1)) |
503 0508 2881 ld r18,Y |
504 050a 8091 0000 lds r24,crc.2127 |
505 050e 9091 0000 lds r25,(crc.2127)+1 |
506 0512 831B sub r24,r19 |
507 0514 9109 sbc r25,__zero_reg__ |
508 0516 821B sub r24,r18 |
509 0518 9109 sbc r25,__zero_reg__ |
510 051a 9F70 andi r25,hi8(4095) |
511 051c 9093 0000 sts (crc.2127)+1,r25 |
512 0520 8093 0000 sts crc.2127,r24 |
513 0524 9C01 movw r18,r24 |
514 0526 96E0 ldi r25,6 |
515 0528 3695 1: lsr r19 |
516 052a 2795 ror r18 |
517 052c 9A95 dec r25 |
518 052e 01F4 brne 1b |
519 0530 235C subi r18,lo8(-(61)) |
520 0532 2093 0000 sts crc1.2128,r18 |
521 0536 982F mov r25,r24 |
522 0538 9F73 andi r25,lo8(63) |
523 053a 935C subi r25,lo8(-(61)) |
524 053c 9093 0000 sts crc2.2129,r25 |
525 0540 8081 ld r24,Z |
526 0542 2817 cp r18,r24 |
527 0544 01F4 brne .L65 |
528 0546 8881 ld r24,Y |
529 0548 9817 cp r25,r24 |
530 054a 01F4 brne .L65 |
531 054c 91E0 ldi r25,lo8(1) |
532 054e 00C0 rjmp .L68 |
533 .L65: |
534 0550 8091 0000 lds r24,CntCrcError |
535 0554 8F5F subi r24,lo8(-(1)) |
536 0556 8093 0000 sts CntCrcError,r24 |
537 055a 90E0 ldi r25,lo8(0) |
538 .L68: |
539 055c 8091 0000 lds r24,NeuerDatensatzEmpfangen |
540 0560 8823 tst r24 |
541 0562 01F0 breq .+2 |
542 0564 00C0 rjmp .L83 |
543 0566 9923 tst r25 |
544 0568 01F4 brne .+2 |
545 056a 00C0 rjmp .L83 |
546 056c 81E0 ldi r24,lo8(1) |
547 056e 8093 0000 sts NeuerDatensatzEmpfangen,r24 |
548 0572 4093 0000 sts AnzahlEmpfangsBytes,r20 |
549 0576 A050 subi r26,lo8(-(RxdBuffer)) |
550 0578 B040 sbci r27,hi8(-(RxdBuffer)) |
551 057a 8DE0 ldi r24,lo8(13) |
552 057c 8C93 st X,r24 |
553 057e 8091 0000 lds r24,RxdBuffer+2 |
554 0582 8235 cpi r24,lo8(82) |
555 0584 01F0 breq .+2 |
556 0586 00C0 rjmp .L83 |
557 0588 88E1 ldi r24,lo8(24) |
558 058a 90E0 ldi r25,hi8(24) |
559 058c 2CE0 ldi r18,lo8(12) |
560 /* #APP */ |
561 058e 0FB6 in __tmp_reg__,__SREG__ |
562 0590 F894 cli |
563 0592 A895 wdr |
564 0594 8093 6000 sts 96,r24 |
565 0598 0FBE out __SREG__,__tmp_reg__ |
566 059a 2093 6000 sts 96,r18 |
567 /* #NOAPP */ |
568 059e 00C0 rjmp .L83 |
569 .L62: |
570 05a0 8091 0000 lds r24,UartState.2131 |
571 05a4 8130 cpi r24,lo8(1) |
572 05a6 01F0 breq .L75 |
573 05a8 8130 cpi r24,lo8(1) |
574 05aa 00F0 brlo .L74 |
575 05ac 8230 cpi r24,lo8(2) |
576 05ae 01F4 brne .L84 |
577 05b0 00C0 rjmp .L76 |
578 .L74: |
579 05b2 8091 0000 lds r24,SioTmp |
580 05b6 8332 cpi r24,lo8(35) |
581 05b8 01F4 brne .L77 |
582 05ba 8091 0000 lds r24,NeuerDatensatzEmpfangen |
583 05be 8823 tst r24 |
584 05c0 01F4 brne .L77 |
585 05c2 81E0 ldi r24,lo8(1) |
586 05c4 8093 0000 sts UartState.2131,r24 |
587 .L77: |
588 05c8 8091 0000 lds r24,SioTmp |
589 05cc 8093 0000 sts RxdBuffer,r24 |
590 05d0 81E0 ldi r24,lo8(1) |
591 05d2 8093 0000 sts buf_ptr.2130,r24 |
592 05d6 8091 0000 lds r24,SioTmp |
593 05da 9927 clr r25 |
594 05dc 00C0 rjmp .L87 |
595 .L75: |
596 05de 82E0 ldi r24,lo8(2) |
597 05e0 8093 0000 sts UartState.2131,r24 |
598 05e4 E42F mov r30,r20 |
599 05e6 FF27 clr r31 |
600 05e8 8091 0000 lds r24,SioTmp |
601 05ec E050 subi r30,lo8(-(RxdBuffer)) |
602 05ee F040 sbci r31,hi8(-(RxdBuffer)) |
603 05f0 8083 st Z,r24 |
604 .L89: |
605 05f2 4F5F subi r20,lo8(-(1)) |
606 05f4 4093 0000 sts buf_ptr.2130,r20 |
607 .L88: |
608 05f8 2091 0000 lds r18,SioTmp |
609 05fc 8091 0000 lds r24,crc.2127 |
610 0600 9091 0000 lds r25,(crc.2127)+1 |
611 0604 820F add r24,r18 |
612 0606 911D adc r25,__zero_reg__ |
613 .L87: |
614 0608 9093 0000 sts (crc.2127)+1,r25 |
615 060c 8093 0000 sts crc.2127,r24 |
616 0610 00C0 rjmp .L83 |
617 .L76: |
618 0612 E42F mov r30,r20 |
619 0614 FF27 clr r31 |
620 0616 8091 0000 lds r24,SioTmp |
621 061a E050 subi r30,lo8(-(RxdBuffer)) |
622 061c F040 sbci r31,hi8(-(RxdBuffer)) |
623 061e 8083 st Z,r24 |
624 0620 4639 cpi r20,lo8(-106) |
625 0622 00F0 brlo .L89 |
626 0624 1092 0000 sts UartState.2131,__zero_reg__ |
627 0628 00C0 rjmp .L88 |
628 .L84: |
629 062a 1092 0000 sts UartState.2131,__zero_reg__ |
630 .L83: |
631 /* epilogue: frame size=0 */ |
632 062e FF91 pop r31 |
633 0630 EF91 pop r30 |
634 0632 DF91 pop r29 |
635 0634 CF91 pop r28 |
636 0636 BF91 pop r27 |
637 0638 AF91 pop r26 |
638 063a 9F91 pop r25 |
639 063c 8F91 pop r24 |
640 063e 7F91 pop r23 |
641 0640 6F91 pop r22 |
642 0642 5F91 pop r21 |
643 0644 4F91 pop r20 |
644 0646 3F91 pop r19 |
645 0648 2F91 pop r18 |
646 064a 0F90 pop __tmp_reg__ |
647 064c 0FBE out __SREG__,__tmp_reg__ |
648 064e 0F90 pop __tmp_reg__ |
649 0650 1F90 pop __zero_reg__ |
650 0652 1895 reti |
651 /* epilogue end (size=19) */ |
652 /* function __vector_20 size 545 (507) */ |
654 .global AddCRC |
656 AddCRC: |
657 /* prologue: frame size=0 */ |
658 /* prologue end (size=0) */ |
659 0654 DC01 movw r26,r24 |
660 0656 20E0 ldi r18,lo8(0) |
661 0658 30E0 ldi r19,hi8(0) |
662 065a 40E0 ldi r20,lo8(0) |
663 065c 50E0 ldi r21,hi8(0) |
664 065e E0E0 ldi r30,lo8(SendeBuffer) |
665 0660 F0E0 ldi r31,hi8(SendeBuffer) |
666 0662 00C0 rjmp .L91 |
667 .L92: |
668 0664 8191 ld r24,Z+ |
669 0666 280F add r18,r24 |
670 0668 311D adc r19,__zero_reg__ |
671 066a 4F5F subi r20,lo8(-(1)) |
672 066c 5F4F sbci r21,hi8(-(1)) |
673 .L91: |
674 066e 4A17 cp r20,r26 |
675 0670 5B07 cpc r21,r27 |
676 0672 01F4 brne .L92 |
677 0674 3F70 andi r19,hi8(4095) |
678 0676 C901 movw r24,r18 |
679 0678 66E0 ldi r22,6 |
680 067a 9695 1: lsr r25 |
681 067c 8795 ror r24 |
682 067e 6A95 dec r22 |
683 0680 01F4 brne 1b |
684 0682 835C subi r24,lo8(-(61)) |
685 0684 FD01 movw r30,r26 |
686 0686 E050 subi r30,lo8(-(SendeBuffer)) |
687 0688 F040 sbci r31,hi8(-(SendeBuffer)) |
688 068a 8083 st Z,r24 |
689 068c 1196 adiw r26,1 |
690 068e 2F73 andi r18,lo8(63) |
691 0690 235C subi r18,lo8(-(61)) |
692 0692 FD01 movw r30,r26 |
693 0694 E050 subi r30,lo8(-(SendeBuffer)) |
694 0696 F040 sbci r31,hi8(-(SendeBuffer)) |
695 0698 2083 st Z,r18 |
696 069a A050 subi r26,lo8(-(SendeBuffer+1)) |
697 069c B040 sbci r27,hi8(-(SendeBuffer+1)) |
698 069e 8DE0 ldi r24,lo8(13) |
699 06a0 8C93 st X,r24 |
700 06a2 1092 0000 sts UebertragungAbgeschlossen,__zero_reg__ |
701 06a6 8091 0000 lds r24,SendeBuffer |
702 06aa 8093 C600 sts 198,r24 |
703 /* epilogue: frame size=0 */ |
704 06ae 0895 ret |
705 /* epilogue end (size=1) */ |
706 /* function AddCRC size 47 (46) */ |
708 .global SendOutData |
710 SendOutData: |
711 /* prologue: frame size=0 */ |
712 06b0 EF92 push r14 |
713 06b2 FF92 push r15 |
714 06b4 0F93 push r16 |
715 06b6 1F93 push r17 |
716 06b8 CF93 push r28 |
717 06ba DF93 push r29 |
718 /* prologue end (size=6) */ |
719 06bc 7A01 movw r14,r20 |
720 06be 722F mov r23,r18 |
721 06c0 93E2 ldi r25,lo8(35) |
722 06c2 9093 0000 sts SendeBuffer,r25 |
723 06c6 6093 0000 sts SendeBuffer+1,r22 |
724 06ca 8093 0000 sts SendeBuffer+2,r24 |
725 06ce 03E0 ldi r16,lo8(3) |
726 06d0 10E0 ldi r17,hi8(3) |
727 06d2 60E0 ldi r22,lo8(0) |
728 06d4 A0E0 ldi r26,lo8(SendeBuffer+3) |
729 06d6 B0E0 ldi r27,hi8(SendeBuffer+3) |
730 06d8 00C0 rjmp .L96 |
731 .L97: |
732 06da F701 movw r30,r14 |
733 06dc E60F add r30,r22 |
734 06de F11D adc r31,__zero_reg__ |
735 06e0 9081 ld r25,Z |
736 06e2 6F5F subi r22,lo8(-(1)) |
737 06e4 7150 subi r23,lo8(-(-1)) |
738 06e6 01F4 brne .L98 |
739 06e8 E0E0 ldi r30,lo8(0) |
740 06ea 40E0 ldi r20,lo8(0) |
741 06ec 00C0 rjmp .L100 |
742 .L98: |
743 06ee F701 movw r30,r14 |
744 06f0 E60F add r30,r22 |
745 06f2 F11D adc r31,__zero_reg__ |
746 06f4 4081 ld r20,Z |
747 06f6 6F5F subi r22,lo8(-(1)) |
748 06f8 7150 subi r23,lo8(-(-1)) |
749 06fa 01F4 brne .L101 |
750 06fc E0E0 ldi r30,lo8(0) |
751 06fe 00C0 rjmp .L100 |
752 .L101: |
753 0700 F701 movw r30,r14 |
754 0702 E60F add r30,r22 |
755 0704 F11D adc r31,__zero_reg__ |
756 0706 E081 ld r30,Z |
757 0708 6F5F subi r22,lo8(-(1)) |
758 070a 7150 subi r23,lo8(-(-1)) |
759 .L100: |
760 070c 892F mov r24,r25 |
761 070e 8695 lsr r24 |
762 0710 8695 lsr r24 |
763 0712 835C subi r24,lo8(-(61)) |
764 0714 8C93 st X,r24 |
765 0716 5527 clr r21 |
766 0718 892F mov r24,r25 |
767 071a 9927 clr r25 |
768 071c 8370 andi r24,lo8(3) |
769 071e 9070 andi r25,hi8(3) |
770 0720 24E0 ldi r18,4 |
771 0722 880F 1: lsl r24 |
772 0724 991F rol r25 |
773 0726 2A95 dec r18 |
774 0728 01F4 brne 1b |
775 072a 9A01 movw r18,r20 |
776 072c 94E0 ldi r25,4 |
777 072e 3695 1: lsr r19 |
778 0730 2795 ror r18 |
779 0732 9A95 dec r25 |
780 0734 01F4 brne 1b |
781 0736 822B or r24,r18 |
782 0738 835C subi r24,lo8(-(61)) |
783 073a ED01 movw r28,r26 |
784 073c 8983 std Y+1,r24 |
785 073e 4F70 andi r20,lo8(15) |
786 0740 5070 andi r21,hi8(15) |
787 0742 440F lsl r20 |
788 0744 551F rol r21 |
789 0746 440F lsl r20 |
790 0748 551F rol r21 |
791 074a 8E2F mov r24,r30 |
792 074c 8295 swap r24 |
793 074e 8695 lsr r24 |
794 0750 8695 lsr r24 |
795 0752 8370 andi r24,0x3 |
796 0754 842B or r24,r20 |
797 0756 835C subi r24,lo8(-(61)) |
798 0758 8A83 std Y+2,r24 |
799 075a EF73 andi r30,lo8(63) |
800 075c E35C subi r30,lo8(-(61)) |
801 075e EB83 std Y+3,r30 |
802 0760 0C5F subi r16,lo8(-(4)) |
803 0762 1F4F sbci r17,hi8(-(4)) |
804 0764 1496 adiw r26,4 |
805 .L96: |
806 0766 7723 tst r23 |
807 0768 01F0 breq .+2 |
808 076a 00C0 rjmp .L97 |
809 076c C801 movw r24,r16 |
810 076e 0E94 0000 call AddCRC |
811 /* epilogue: frame size=0 */ |
812 0772 DF91 pop r29 |
813 0774 CF91 pop r28 |
814 0776 1F91 pop r17 |
815 0778 0F91 pop r16 |
816 077a FF90 pop r15 |
817 077c EF90 pop r14 |
818 077e 0895 ret |
819 /* epilogue end (size=7) */ |
820 /* function SendOutData size 106 (93) */ |
822 .global Decode64 |
824 Decode64: |
825 /* prologue: frame size=0 */ |
826 0780 1F93 push r17 |
827 0782 CF93 push r28 |
828 0784 DF93 push r29 |
829 /* prologue end (size=3) */ |
830 0786 EC01 movw r28,r24 |
831 0788 70E0 ldi r23,lo8(0) |
832 078a A22F mov r26,r18 |
833 078c BB27 clr r27 |
834 078e 1297 sbiw r26,2 |
835 0790 00C0 rjmp .L106 |
836 .L107: |
837 0792 E42F mov r30,r20 |
838 0794 FF27 clr r31 |
839 0796 E050 subi r30,lo8(-(RxdBuffer)) |
840 0798 F040 sbci r31,hi8(-(RxdBuffer)) |
841 079a 3081 ld r19,Z |
842 079c 4F5F subi r20,lo8(-(1)) |
843 079e E42F mov r30,r20 |
844 07a0 FF27 clr r31 |
845 07a2 E050 subi r30,lo8(-(RxdBuffer)) |
846 07a4 F040 sbci r31,hi8(-(RxdBuffer)) |
847 07a6 5081 ld r21,Z |
848 07a8 4F5F subi r20,lo8(-(1)) |
849 07aa E42F mov r30,r20 |
850 07ac FF27 clr r31 |
851 07ae E050 subi r30,lo8(-(RxdBuffer)) |
852 07b0 F040 sbci r31,hi8(-(RxdBuffer)) |
853 07b2 1081 ld r17,Z |
854 07b4 4F5F subi r20,lo8(-(1)) |
855 07b6 E42F mov r30,r20 |
856 07b8 FF27 clr r31 |
857 07ba E050 subi r30,lo8(-(RxdBuffer)) |
858 07bc F040 sbci r31,hi8(-(RxdBuffer)) |
859 07be 2081 ld r18,Z |
860 07c0 4F5F subi r20,lo8(-(1)) |
861 07c2 842F mov r24,r20 |
862 07c4 9927 clr r25 |
863 07c6 A817 cp r26,r24 |
864 07c8 B907 cpc r27,r25 |
865 07ca 04F0 brlt .L112 |
866 07cc 5D53 subi r21,lo8(-(-61)) |
867 07ce FE01 movw r30,r28 |
868 07d0 E70F add r30,r23 |
869 07d2 F11D adc r31,__zero_reg__ |
870 07d4 3D53 subi r19,lo8(-(-61)) |
871 07d6 330F lsl r19 |
872 07d8 330F lsl r19 |
873 07da 852F mov r24,r21 |
874 07dc 8295 swap r24 |
875 07de 8F70 andi r24,0x0f |
876 07e0 382B or r19,r24 |
877 07e2 3083 st Z,r19 |
878 07e4 6130 cpi r22,lo8(1) |
879 07e6 01F0 breq .L112 |
880 07e8 912F mov r25,r17 |
881 07ea 9D53 subi r25,lo8(-(-61)) |
882 07ec 7F5F subi r23,lo8(-(1)) |
883 07ee FE01 movw r30,r28 |
884 07f0 E70F add r30,r23 |
885 07f2 F11D adc r31,__zero_reg__ |
886 07f4 7150 subi r23,lo8(-(-1)) |
887 07f6 5295 swap r21 |
888 07f8 507F andi r21,0xf0 |
889 07fa 892F mov r24,r25 |
890 07fc 8695 lsr r24 |
891 07fe 8695 lsr r24 |
892 0800 582B or r21,r24 |
893 0802 5083 st Z,r21 |
894 0804 6350 subi r22,lo8(-(-3)) |
895 0806 6F3F cpi r22,lo8(-1) |
896 0808 01F0 breq .L112 |
897 080a 7E5F subi r23,lo8(-(2)) |
898 080c FE01 movw r30,r28 |
899 080e E70F add r30,r23 |
900 0810 F11D adc r31,__zero_reg__ |
901 0812 9295 swap r25 |
902 0814 990F lsl r25 |
903 0816 990F lsl r25 |
904 0818 907C andi r25,0xc0 |
905 081a 2D53 subi r18,lo8(-(-61)) |
906 081c 922B or r25,r18 |
907 081e 9083 st Z,r25 |
908 0820 7F5F subi r23,lo8(-(1)) |
909 .L106: |
910 0822 6623 tst r22 |
911 0824 01F0 breq .+2 |
912 0826 00C0 rjmp .L107 |
913 .L112: |
914 /* epilogue: frame size=0 */ |
915 0828 DF91 pop r29 |
916 082a CF91 pop r28 |
917 082c 1F91 pop r17 |
918 082e 0895 ret |
919 /* epilogue end (size=4) */ |
920 /* function Decode64 size 88 (81) */ |
922 .global uart_putchar |
924 uart_putchar: |
925 /* prologue: frame size=0 */ |
926 0830 1F93 push r17 |
927 /* prologue end (size=1) */ |
928 0832 182F mov r17,r24 |
929 0834 8A30 cpi r24,lo8(10) |
930 0836 01F4 brne .L118 |
931 0838 8DE0 ldi r24,lo8(13) |
932 083a 0E94 0000 call uart_putchar |
933 .L118: |
934 083e 8091 C000 lds r24,192 |
935 0842 85FF sbrs r24,5 |
936 0844 00C0 rjmp .L118 |
937 0846 1093 C600 sts 198,r17 |
938 084a 80E0 ldi r24,lo8(0) |
939 084c 90E0 ldi r25,hi8(0) |
940 /* epilogue: frame size=0 */ |
941 084e 1F91 pop r17 |
942 0850 0895 ret |
943 /* epilogue end (size=2) */ |
944 /* function uart_putchar size 17 (14) */ |
946 .global WriteProgramData |
948 WriteProgramData: |
949 /* prologue: frame size=0 */ |
950 /* prologue end (size=0) */ |
951 /* epilogue: frame size=0 */ |
952 0852 0895 ret |
953 /* epilogue end (size=1) */ |
954 /* function WriteProgramData size 1 (0) */ |
956 .global UART_Init |
958 UART_Init: |
959 /* prologue: frame size=0 */ |
960 /* prologue end (size=0) */ |
961 0854 E1EC ldi r30,lo8(193) |
962 0856 F0E0 ldi r31,hi8(193) |
963 0858 88E1 ldi r24,lo8(24) |
964 085a 8083 st Z,r24 |
965 085c A0EC ldi r26,lo8(192) |
966 085e B0E0 ldi r27,hi8(192) |
967 0860 8C91 ld r24,X |
968 0862 8260 ori r24,lo8(2) |
969 0864 8C93 st X,r24 |
970 0866 8081 ld r24,Z |
971 0868 8068 ori r24,lo8(-128) |
972 086a 8083 st Z,r24 |
973 086c 8081 ld r24,Z |
974 086e 8064 ori r24,lo8(64) |
975 0870 8083 st Z,r24 |
976 0872 8AE2 ldi r24,lo8(42) |
977 0874 8093 C400 sts 196,r24 |
978 0878 88EC ldi r24,lo8(200) |
979 087a 90E0 ldi r25,hi8(200) |
980 087c 0E94 0000 call SetDelay |
981 0880 9093 0000 sts (Debug_Timer)+1,r25 |
982 0884 8093 0000 sts Debug_Timer,r24 |
983 0888 1092 0000 sts gpsState,__zero_reg__ |
984 /* epilogue: frame size=0 */ |
985 088c 0895 ret |
986 /* epilogue end (size=1) */ |
987 /* function UART_Init size 29 (28) */ |
989 .global DatenUebertragung |
991 DatenUebertragung: |
992 /* prologue: frame size=0 */ |
993 /* prologue end (size=0) */ |
994 088e 8091 0000 lds r24,UebertragungAbgeschlossen |
995 0892 8823 tst r24 |
996 0894 01F4 brne .+2 |
997 0896 00C0 rjmp .L142 |
998 0898 8091 0000 lds r24,DebugGetAnforderung |
999 089c 8823 tst r24 |
1000 089e 01F0 breq .L128 |
1001 08a0 8091 0000 lds r24,UebertragungAbgeschlossen |
1002 08a4 8823 tst r24 |
1003 08a6 01F0 breq .L128 |
1004 08a8 2BE0 ldi r18,lo8(11) |
1005 08aa 40E0 ldi r20,lo8(DebugIn) |
1006 08ac 50E0 ldi r21,hi8(DebugIn) |
1007 08ae 6091 0000 lds r22,MeineSlaveAdresse |
1008 08b2 87E4 ldi r24,lo8(71) |
1009 08b4 0E94 0000 call SendOutData |
1010 08b8 1092 0000 sts DebugGetAnforderung,__zero_reg__ |
1011 .L128: |
1012 08bc 8091 0000 lds r24,Debug_Timer |
1013 08c0 9091 0000 lds r25,(Debug_Timer)+1 |
1014 08c4 0E94 0000 call CheckDelay |
1015 08c8 8823 tst r24 |
1016 08ca 01F4 brne .L131 |
1017 08cc 8091 0000 lds r24,DebugDataAnforderung |
1018 08d0 8823 tst r24 |
1019 08d2 01F0 breq .L133 |
1020 .L131: |
1021 08d4 8091 0000 lds r24,UebertragungAbgeschlossen |
1022 08d8 8823 tst r24 |
1023 08da 01F0 breq .L133 |
1024 08dc 22E3 ldi r18,lo8(50) |
1025 08de 40E0 ldi r20,lo8(DebugOut) |
1026 08e0 50E0 ldi r21,hi8(DebugOut) |
1027 08e2 6091 0000 lds r22,MeineSlaveAdresse |
1028 08e6 84E4 ldi r24,lo8(68) |
1029 08e8 0E94 0000 call SendOutData |
1030 08ec 1092 0000 sts DebugDataAnforderung,__zero_reg__ |
1031 08f0 8AEF ldi r24,lo8(250) |
1032 08f2 90E0 ldi r25,hi8(250) |
1033 08f4 0E94 0000 call SetDelay |
1034 08f8 9093 0000 sts (Debug_Timer)+1,r25 |
1035 08fc 8093 0000 sts Debug_Timer,r24 |
1036 .L133: |
1037 0900 8091 0000 lds r24,DebugDisplayAnforderung |
1038 0904 8823 tst r24 |
1039 0906 01F0 breq .L135 |
1040 0908 8091 0000 lds r24,UebertragungAbgeschlossen |
1041 090c 8823 tst r24 |
1042 090e 01F0 breq .L135 |
1043 0910 0E94 0000 call Menu |
1044 0914 1092 0000 sts DebugDisplayAnforderung,__zero_reg__ |
1045 0918 8091 0000 lds r24,dis_zeile.2453 |
1046 091c 8F5F subi r24,lo8(-(1)) |
1047 091e 8093 0000 sts dis_zeile.2453,r24 |
1048 0922 8430 cpi r24,lo8(4) |
1049 0924 01F4 brne .L138 |
1050 0926 1092 0000 sts dis_zeile.2453,__zero_reg__ |
1051 .L138: |
1052 092a 8091 0000 lds r24,dis_zeile.2453 |
1053 092e 44E1 ldi r20,lo8(20) |
1054 0930 849F mul r24,r20 |
1055 0932 A001 movw r20,r0 |
1056 0934 1124 clr r1 |
1057 0936 4050 subi r20,lo8(-(DisplayBuff)) |
1058 0938 5040 sbci r21,hi8(-(DisplayBuff)) |
1059 093a 24E1 ldi r18,lo8(20) |
1060 093c 60E0 ldi r22,lo8(0) |
1061 093e 805D subi r24,lo8(-(48)) |
1062 0940 0E94 0000 call SendOutData |
1063 .L135: |
1064 0944 8091 0000 lds r24,GetVersionAnforderung |
1065 0948 8823 tst r24 |
1066 094a 01F0 breq .L142 |
1067 094c 8091 0000 lds r24,UebertragungAbgeschlossen |
1068 0950 8823 tst r24 |
1069 0952 01F0 breq .L142 |
1070 0954 2AE0 ldi r18,lo8(10) |
1071 0956 40E0 ldi r20,lo8(VersionInfo) |
1072 0958 50E0 ldi r21,hi8(VersionInfo) |
1073 095a 6091 0000 lds r22,MeineSlaveAdresse |
1074 095e 86E5 ldi r24,lo8(86) |
1075 0960 0E94 0000 call SendOutData |
1076 0964 1092 0000 sts GetVersionAnforderung,__zero_reg__ |
1077 .L142: |
1078 0968 0895 ret |
1079 /* epilogue: frame size=0 */ |
1080 /* epilogue: noreturn */ |
1081 /* epilogue end (size=0) */ |
1082 /* function DatenUebertragung size 110 (110) */ |
1084 .global BearbeiteRxDaten |
1086 BearbeiteRxDaten: |
1087 /* prologue: frame size=2 */ |
1088 096a 1F93 push r17 |
1089 096c CF93 push r28 |
1090 096e DF93 push r29 |
1091 0970 CDB7 in r28,__SP_L__ |
1092 0972 DEB7 in r29,__SP_H__ |
1093 0974 2297 sbiw r28,2 |
1094 0976 0FB6 in __tmp_reg__,__SREG__ |
1095 0978 F894 cli |
1096 097a DEBF out __SP_H__,r29 |
1097 097c 0FBE out __SREG__,__tmp_reg__ |
1098 097e CDBF out __SP_L__,r28 |
1099 /* prologue end (size=11) */ |
1100 0980 8091 0000 lds r24,NeuerDatensatzEmpfangen |
1101 0984 8823 tst r24 |
1102 0986 01F4 brne .+2 |
1103 0988 00C0 rjmp .L159 |
1104 098a 8FEF ldi r24,lo8(-1) |
1105 098c 8093 0000 sts PcZugriff,r24 |
1106 0990 8091 0000 lds r24,RxdBuffer+2 |
1107 0994 8137 cpi r24,lo8(113) |
1108 0996 00F4 brsh .L154 |
1109 0998 8C36 cpi r24,lo8(108) |
1110 099a 00F0 brlo .+2 |
1111 099c 00C0 rjmp .L150 |
1112 099e 8736 cpi r24,lo8(103) |
1113 09a0 01F4 brne .+2 |
1114 09a2 00C0 rjmp .L148 |
1115 09a4 8836 cpi r24,lo8(104) |
1116 09a6 01F0 breq .L149 |
1117 09a8 8336 cpi r24,lo8(99) |
1118 09aa 01F0 breq .+2 |
1119 09ac 00C0 rjmp .L146 |
1120 09ae 00C0 rjmp .L147 |
1121 .L154: |
1122 09b0 8437 cpi r24,lo8(116) |
1123 09b2 01F0 breq .L152 |
1124 09b4 8637 cpi r24,lo8(118) |
1125 09b6 01F0 breq .L153 |
1126 09b8 8137 cpi r24,lo8(113) |
1127 09ba 01F0 breq .+2 |
1128 09bc 00C0 rjmp .L146 |
1129 09be 00C0 rjmp .L151 |
1130 .L147: |
1131 09c0 2091 0000 lds r18,AnzahlEmpfangsBytes |
1132 09c4 43E0 ldi r20,lo8(3) |
1133 09c6 6BE0 ldi r22,lo8(11) |
1134 09c8 80E0 ldi r24,lo8(DebugIn) |
1135 09ca 90E0 ldi r25,hi8(DebugIn) |
1136 09cc 0E94 0000 call Decode64 |
1137 09d0 8091 0000 lds r24,RemoteTasten |
1138 09d4 9091 0000 lds r25,DebugIn+2 |
1139 09d8 892B or r24,r25 |
1140 09da 8093 0000 sts RemoteTasten,r24 |
1141 09de 81E0 ldi r24,lo8(1) |
1142 09e0 8093 0000 sts DebugDataAnforderung,r24 |
1143 09e4 00C0 rjmp .L146 |
1144 .L149: |
1145 09e6 2091 0000 lds r18,AnzahlEmpfangsBytes |
1146 09ea 43E0 ldi r20,lo8(3) |
1147 09ec 62E0 ldi r22,lo8(2) |
1148 09ee CE01 movw r24,r28 |
1149 09f0 0196 adiw r24,1 |
1150 09f2 0E94 0000 call Decode64 |
1151 09f6 8091 0000 lds r24,RemoteTasten |
1152 09fa 9981 ldd r25,Y+1 |
1153 09fc 892B or r24,r25 |
1154 09fe 8093 0000 sts RemoteTasten,r24 |
1155 0a02 81E0 ldi r24,lo8(1) |
1156 0a04 8093 0000 sts DebugDisplayAnforderung,r24 |
1157 0a08 00C0 rjmp .L146 |
1158 .L152: |
1159 0a0a 2091 0000 lds r18,AnzahlEmpfangsBytes |
1160 0a0e 43E0 ldi r20,lo8(3) |
1161 0a10 64E0 ldi r22,lo8(4) |
1162 0a12 80E0 ldi r24,lo8(MotorTest) |
1163 0a14 90E0 ldi r25,hi8(MotorTest) |
1164 0a16 0E94 0000 call Decode64 |
1165 0a1a 00C0 rjmp .L146 |
1166 .L153: |
1167 0a1c 81E0 ldi r24,lo8(1) |
1168 0a1e 8093 0000 sts GetVersionAnforderung,r24 |
1169 0a22 00C0 rjmp .L146 |
1170 .L148: |
1171 0a24 81E0 ldi r24,lo8(1) |
1172 0a26 8093 0000 sts DebugGetAnforderung,r24 |
1173 0a2a 00C0 rjmp .L146 |
1174 .L151: |
1175 0a2c 2091 0000 lds r18,AnzahlEmpfangsBytes |
1176 0a30 43E0 ldi r20,lo8(3) |
1177 0a32 62E0 ldi r22,lo8(2) |
1178 0a34 CE01 movw r24,r28 |
1179 0a36 0196 adiw r24,1 |
1180 0a38 0E94 0000 call Decode64 |
1181 0a3c 8981 ldd r24,Y+1 |
1182 0a3e 8F3F cpi r24,lo8(-1) |
1183 0a40 01F0 breq .L155 |
1184 0a42 8630 cpi r24,lo8(6) |
1185 0a44 00F0 brlo .L157 |
1186 0a46 85E0 ldi r24,lo8(5) |
1187 0a48 8983 std Y+1,r24 |
1188 .L157: |
1189 0a4a 4AE3 ldi r20,lo8(58) |
1190 0a4c 60E0 ldi r22,lo8(EE_Parameter) |
1191 0a4e 70E0 ldi r23,hi8(EE_Parameter) |
1192 0a50 8981 ldd r24,Y+1 |
1193 0a52 0E94 0000 call ReadParameterSet |
1194 0a56 8981 ldd r24,Y+1 |
1195 0a58 2AE3 ldi r18,lo8(58) |
1196 0a5a 40E0 ldi r20,lo8(EE_Parameter) |
1197 0a5c 50E0 ldi r21,hi8(EE_Parameter) |
1198 0a5e 6091 0000 lds r22,MeineSlaveAdresse |
1199 0a62 00C0 rjmp .L160 |
1200 .L155: |
1201 0a64 1091 0000 lds r17,MeineSlaveAdresse |
1202 0a68 0E94 0000 call GetActiveParamSetNumber |
1203 0a6c 2AE3 ldi r18,lo8(58) |
1204 0a6e 40E0 ldi r20,lo8(EE_Parameter) |
1205 0a70 50E0 ldi r21,hi8(EE_Parameter) |
1206 0a72 612F mov r22,r17 |
1207 .L160: |
1208 0a74 855B subi r24,lo8(-(75)) |
1209 0a76 0E94 0000 call SendOutData |
1210 0a7a 00C0 rjmp .L146 |
1211 .L150: |
1212 0a7c 2091 0000 lds r18,AnzahlEmpfangsBytes |
1213 0a80 43E0 ldi r20,lo8(3) |
1214 0a82 6AE3 ldi r22,lo8(58) |
1215 0a84 80E0 ldi r24,lo8(EE_Parameter) |
1216 0a86 90E0 ldi r25,hi8(EE_Parameter) |
1217 0a88 0E94 0000 call Decode64 |
1218 0a8c 8091 0000 lds r24,RxdBuffer+2 |
1219 0a90 4AE3 ldi r20,lo8(58) |
1220 0a92 60E0 ldi r22,lo8(EE_Parameter) |
1221 0a94 70E0 ldi r23,hi8(EE_Parameter) |
1222 0a96 8B56 subi r24,lo8(-(-107)) |
1223 0a98 0E94 0000 call WriteParameterSet |
1224 0a9c 8091 0000 lds r24,RxdBuffer+2 |
1225 0aa0 8B56 subi r24,lo8(-(-107)) |
1226 0aa2 A0E0 ldi r26,lo8(EEPromArray+2) |
1227 0aa4 B0E0 ldi r27,hi8(EEPromArray+2) |
1228 /* #APP */ |
1229 0aa6 082E mov __tmp_reg__,r24 |
1230 0aa8 0E94 0000 call __eeprom_write_byte_1F2021 |
1231 /* #NOAPP */ |
1232 0aac 0E94 0000 call GetActiveParamSetNumber |
1233 0ab0 0E94 0000 call Piep |
1234 .L146: |
1235 0ab4 1092 0000 sts NeuerDatensatzEmpfangen,__zero_reg__ |
1236 .L159: |
1237 /* epilogue: frame size=2 */ |
1238 0ab8 2296 adiw r28,2 |
1239 0aba 0FB6 in __tmp_reg__,__SREG__ |
1240 0abc F894 cli |
1241 0abe DEBF out __SP_H__,r29 |
1242 0ac0 0FBE out __SREG__,__tmp_reg__ |
1243 0ac2 CDBF out __SP_L__,r28 |
1244 0ac4 DF91 pop r29 |
1245 0ac6 CF91 pop r28 |
1246 0ac8 1F91 pop r17 |
1247 0aca 0895 ret |
1248 /* epilogue end (size=10) */ |
1249 /* function BearbeiteRxDaten size 178 (157) */ |
1251 .global DebugGetAnforderung |
1252 .global DebugGetAnforderung |
1253 .section .bss |
1256 DebugGetAnforderung: |
1257 0000 00 .skip 1,0 |
1258 .global DebugDisplayAnforderung |
1259 .global DebugDisplayAnforderung |
1262 DebugDisplayAnforderung: |
1263 0001 00 .skip 1,0 |
1264 .global DebugDataAnforderung |
1265 .global DebugDataAnforderung |
1268 DebugDataAnforderung: |
1269 0002 00 .skip 1,0 |
1270 .global GetVersionAnforderung |
1271 .global GetVersionAnforderung |
1274 GetVersionAnforderung: |
1275 0003 00 .skip 1,0 |
1276 .global SioTmp |
1277 .global SioTmp |
1280 SioTmp: |
1281 0004 00 .skip 1,0 |
1282 .global NeuerDatensatzEmpfangen |
1283 .global NeuerDatensatzEmpfangen |
1286 NeuerDatensatzEmpfangen: |
1287 0005 00 .skip 1,0 |
1288 .global NeueKoordinateEmpfangen |
1289 .global NeueKoordinateEmpfangen |
1292 NeueKoordinateEmpfangen: |
1293 0006 00 .skip 1,0 |
1294 .global UebertragungAbgeschlossen |
1295 .data |
1298 UebertragungAbgeschlossen: |
1299 0000 01 .byte 1 |
1300 .global CntCrcError |
1301 .global CntCrcError |
1302 .section .bss |
1305 CntCrcError: |
1306 0007 00 .skip 1,0 |
1307 .global AnzahlEmpfangsBytes |
1308 .global AnzahlEmpfangsBytes |
1311 AnzahlEmpfangsBytes: |
1312 0008 00 .skip 1,0 |
1313 .global PC_DebugTimeout |
1314 .global PC_DebugTimeout |
1317 PC_DebugTimeout: |
1318 0009 00 .skip 1,0 |
1319 .global PcZugriff |
1320 .data |
1323 PcZugriff: |
1324 0001 64 .byte 100 |
1325 .global MotorTest |
1326 .global MotorTest |
1327 .section .bss |
1330 MotorTest: |
1331 000a 0000 0000 .skip 4,0 |
1332 .lcomm dis_zeile.2453,1 |
1333 .lcomm UartState.2131,1 |
1334 .lcomm buf_ptr.2130,1 |
1335 .lcomm crc2.2129,1 |
1336 .lcomm crc1.2128,1 |
1337 .lcomm crc.2127,2 |
1338 .lcomm ptr.2090,2 |
1339 .lcomm gpsState,1 |
1340 .comm DiffNick,2,1 |
1341 .comm DiffRoll,2,1 |
1342 .comm SenderOkay,1,1 |
1343 .comm CosinusNickWinkel,1,1 |
1344 .comm CosinusRollWinkel,1,1 |
1345 .comm durchschnitt_northing,4,1 |
1346 .comm durchschnitt_easting,4,1 |
1347 .comm P_GPS_Verstaerkung,2,1 |
1348 .comm D_GPS_Verstaerkung,2,1 |
1349 .comm SendeBuffer,150,1 |
1350 .comm RxdBuffer,150,1 |
1351 .comm MeineSlaveAdresse,1,1 |
1352 .comm Debug_Timer,2,1 |
1353 .comm DebugOut,50,1 |
1354 .comm actualPos,47,1 |
1355 .comm DebugIn,11,1 |
1356 .comm VersionInfo,10,1 |
1357 .comm RemoteTasten,1,1 |
1358 .comm Timeout,1,1 |
1359 .comm IntegralNick,4,1 |
1360 .comm IntegralNick2,4,1 |
1361 .comm IntegralRoll,4,1 |
1362 .comm IntegralRoll2,4,1 |
1363 .comm Mess_IntegralNick,4,1 |
1364 .comm Mess_IntegralNick2,4,1 |
1365 .comm Mess_IntegralRoll,4,1 |
1366 .comm Mess_IntegralRoll2,4,1 |
1367 .comm Integral_Gier,4,1 |
1368 .comm Mess_Integral_Gier,4,1 |
1369 .comm h,1,1 |
1370 .comm m,1,1 |
1371 .comm s,1,1 |
1372 .comm Motor_Vorne,1,1 |
1373 .comm Motor_Hinten,1,1 |
1374 .comm Motor_Rechts,1,1 |
1375 .comm Motor_Links,1,1 |
1376 .comm Count,1,1 |
1377 .comm MotorWert,5,1 |
1378 .comm NMEABuffer,150,1 |
1379 .comm navStatus,17,1 |
1380 .comm navPosECEF,21,1 |
1381 .comm navVelECEF,21,1 |
1382 .comm navPosUtm,19,1 |
1383 .comm navVelNed,37,1 |
1384 .comm ubxP,2,1 |
1385 .comm ubxEp,2,1 |
1386 .comm ubxSp,2,1 |
1387 .comm CK_A,1,1 |
1388 .comm CK_B,1,1 |
1389 .comm msgLen,2,1 |
1390 .comm msgID,1,1 |
1391 .comm ignorePacket,1,1 |
1392 .comm rollOffset,4,1 |
1393 .comm nickOffset,4,1 |
1394 /* File "uart.c": code 1393 = 0x0571 (1290), prologues 49, epilogues 54 */ |
DEFINED SYMBOLS |
*ABS*:00000000 uart.c |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:3 *ABS*:0000003f __SREG__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:4 *ABS*:0000003e __SP_H__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:5 *ABS*:0000003d __SP_L__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:6 *ABS*:00000000 __tmp_reg__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:7 *ABS*:00000001 __zero_reg__ |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:13 .text:00000000 __vector_22 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:1298 .data:00000000 UebertragungAbgeschlossen |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:1337 .bss:00000015 ptr.2090 |
*COM*:00000096 SendeBuffer |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:69 .text:0000006c GPSscanData |
*COM*:00000015 navPosECEF |
*COM*:0000002f actualPos |
*COM*:00000011 navStatus |
*COM*:00000015 navVelECEF |
*COM*:00000013 navPosUtm |
*COM*:00000025 navVelNed |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:200 .text:0000021e __vector_20 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:1280 .bss:00000004 SioTmp |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:1338 .bss:00000017 gpsState |
*COM*:00000001 msgID |
*COM*:00000001 CK_A |
*COM*:00000001 CK_B |
*COM*:00000002 ubxP |
*COM*:00000002 ubxEp |
*COM*:00000002 ubxSp |
*COM*:00000001 ignorePacket |
*COM*:00000002 msgLen |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:1333 .bss:00000010 buf_ptr.2130 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:1332 .bss:0000000f UartState.2131 |
*COM*:00000096 RxdBuffer |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:1336 .bss:00000013 crc.2127 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:1335 .bss:00000012 crc1.2128 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:1334 .bss:00000011 crc2.2129 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:1305 .bss:00000007 CntCrcError |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:1286 .bss:00000005 NeuerDatensatzEmpfangen |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:1311 .bss:00000008 AnzahlEmpfangsBytes |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:656 .text:00000654 AddCRC |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:710 .text:000006b0 SendOutData |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:824 .text:00000780 Decode64 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:924 .text:00000830 uart_putchar |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:948 .text:00000852 WriteProgramData |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:958 .text:00000854 UART_Init |
*COM*:00000002 Debug_Timer |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:991 .text:0000088e DatenUebertragung |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:1256 .bss:00000000 DebugGetAnforderung |
*COM*:0000000b DebugIn |
*COM*:00000001 MeineSlaveAdresse |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:1268 .bss:00000002 DebugDataAnforderung |
*COM*:00000032 DebugOut |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:1262 .bss:00000001 DebugDisplayAnforderung |
.bss:0000000e dis_zeile.2453 |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:1274 .bss:00000003 GetVersionAnforderung |
*COM*:0000000a VersionInfo |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:1086 .text:0000096a BearbeiteRxDaten |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:1323 .data:00000001 PcZugriff |
*COM*:00000001 RemoteTasten |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:1330 .bss:0000000a MotorTest |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:1292 .bss:00000006 NeueKoordinateEmpfangen |
C:\DOKUME~1\none\LOKALE~1\Temp/ccDJkC34.s:1317 .bss:00000009 PC_DebugTimeout |
*COM*:00000002 DiffNick |
*COM*:00000002 DiffRoll |
*COM*:00000001 SenderOkay |
*COM*:00000001 CosinusNickWinkel |
*COM*:00000001 CosinusRollWinkel |
*COM*:00000004 durchschnitt_northing |
*COM*:00000004 durchschnitt_easting |
*COM*:00000002 P_GPS_Verstaerkung |
*COM*:00000002 D_GPS_Verstaerkung |
*COM*:00000001 Timeout |
*COM*:00000004 IntegralNick |
*COM*:00000004 IntegralNick2 |
*COM*:00000004 IntegralRoll |
*COM*:00000004 IntegralRoll2 |
*COM*:00000004 Mess_IntegralNick |
*COM*:00000004 Mess_IntegralNick2 |
*COM*:00000004 Mess_IntegralRoll |
*COM*:00000004 Mess_IntegralRoll2 |
*COM*:00000004 Integral_Gier |
*COM*:00000004 Mess_Integral_Gier |
*COM*:00000001 h |
*COM*:00000001 m |
*COM*:00000001 s |
*COM*:00000001 Motor_Vorne |
*COM*:00000001 Motor_Hinten |
*COM*:00000001 Motor_Rechts |
*COM*:00000001 Motor_Links |
*COM*:00000001 Count |
*COM*:00000005 MotorWert |
*COM*:00000096 NMEABuffer |
*COM*:00000004 rollOffset |
*COM*:00000004 nickOffset |
UNDEFINED SYMBOLS |
__do_copy_data |
__do_clear_bss |
SetDelay |
CheckDelay |
Menu |
DisplayBuff |
EE_Parameter |
ReadParameterSet |
GetActiveParamSetNumber |
WriteParameterSet |
EEPromArray |
__eeprom_write_byte_1F2021 |
Piep |
/branches/MergedVersionsByOsiair/alpha/v060JokoGPSpakoxdaMM3/version.txt |
---|
0,0 → 1,79 |
------- |
V0.53 27.04.2007 H.Buss |
- erste öffentliche Version |
V0.53b 29.04.2007 H.Buss |
- der FAKTOR_I war versehentlich auf Null, dann liegt der MikroKopter nicht so hart in der Luft |
V0.53c 29.04.2007 H.Buss |
- es gib ein Menü, in dem die Werte der Kanäle nach Nick, Roll, Gas,... sortiert sind. |
Die angezeigten Werte waren nicht die Werte der Funke |
V0.54 01.05.2007 H.Buss |
- die Paramtersätze können jetzt vor dem Start ausgewählt werden |
Dazu wird beim Kalibrieren der Messwerte (Gashebel oben links) der Nick-Rollhebel abgefragt: |
2 3 4 |
1 x 5 |
- - - |
Bedeutet: Nick-Rollhebel Links Mitte = Setting:1 Links Oben = Setting:2 usw. |
- der Faktor_I für den Hauptregler ist hinzugekommen. Im Heading-Hold-Modus sollte er vergössert werden, was Stabilität bringt |
V0.55 14.05.2007 H.Buss |
- es können nun Servos an J3,J4,J5 mit den Kanälen 5-7 gesteuert werden |
V0.56 14.05.2007 H.Buss |
- es gab Probleme mit Funken, die mehr als 8 Kanäle haben, wenn mehrere Kanäle dann auf Null waren |
- Funken, die nicht bis +-120 aussteuern können, sollten jetzt auch gehen |
V0.57 24.05.2007 H.Buss |
- Der Höhenregler kann nun auch mittels Schalter bedient werden |
- Bug im Gier-Algorithmus behoben; Schnelles Gieren fürhrte dazu, dass der MK zu weit gedreht hat |
- Kompass-Einfluss dämpfen bei Neigung |
- Man kann zwischen Kompass FIX (Richtung beim Kalibrieren) und Variabel (einstellbar per Gier) wählen |
- Der Motortest vom Kopter-Tool geht jetzt |
- Man kann den Parametersätzen einen Namen geben |
- Das Kamerasetting ist unter Setting 2 defaultmässig integriert |
V0.58 30.05.2007 H.Buss |
- Der Höhenregler-Algorithmus wird nun umgangen, wenn der Höhenreglerschalter aus ist |
V0.60 17.08.2007 H.Buss |
- "Schwindel-Bug" behoben |
- Die Poti-Werte werden jetzt auf Unterlauf (<0) überprüft |
- Poti4 zugefügt |
- Es werden jetzt 8 Kanäle ausgewertet |
- Kamera-Servo (an J7) |
- Die Settings müssen überschrieben werden |
V0.61 (in Arbeit) |
- Poti 4 und Kanal 8 werden im Menü angezeigt |
- ein paar Kleinigkeiten bei den DefaultKonstanten2 bereinigt |
MODDS: |
- Höhenreglerabsenkung von -20 auf -40 (fc.c) |
- LED1 und LED2 Ansteuerung (fc.c) und (main.h) |
- geänderte Kanalbelegung K1-K8, Unterspannungsschwelle (9,5V) und StickD (fc.c) |
- P,D Anteil seperat in Variable geschrieben und auf das Analog Display Ausgegeben (Kopter Tool) |
- GPS_Nick und GPS_Roll werden nach Deaktivierung von Position-Hold auf Null gesetzt, um ein Einfrieren der GPS Steuerwerte auf den letzten Wert zu verhindern |
- Funktionsaufruf der GPS-Funktion von Chris/Hallo2 |
- UART.C für die GPS Signale im UTM Format auf Pitschu basierend |
- unsere GPS.c-Routine |
- Mircos variable Filterung (funktioniert nur wenn 250ms Aufruf aktiv ist) |
- GPS wird deaktiviert und Summer eingeschaltet, wenn kein 3D-Fix (mehr) vorhanden |
- Statusanzeige auf eine LED reduziert (aus, blinkend, an) |
- blinkender LED_1 Ausgang für Positionsleuchten (einstellbar über Userparam.4) |
- Homing-Fkt. eingebaut |
- Diverse Absicherungen gegen Fehlbedienungen (z.B. nicht gelernte Home-Position, ...) |
- Rotationsmatrix mit Kompass, damit die GPS-Fkt. nicht nur nach Norden ausgerichtet funktioniert |
- dyn. Position Hold -> normaler Rundflug möglich |
- Limit_D_Anteil = Userparam3 um im Homing- bzw. Waypointmodus die Sollposition gleichmäßiger anzufliegen |
- Die Berechnung von Kompassvalue wird jetzt auch über den GPS Haken im Koptertool aktiviert |
- 12 Kanal Erweiterung |
- Poti5 und Poti6 wird für die GPS-Funktion genutzt |
- ... |
(- Regelung wird nur noch alle 250 ms aufgerufen) |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/COPYING |
---|
0,0 → 1,674 |
GNU GENERAL PUBLIC LICENSE |
Version 3, 29 June 2007 |
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> |
Everyone is permitted to copy and distribute verbatim copies |
of this license document, but changing it is not allowed. |
Preamble |
The GNU General Public License is a free, copyleft license for |
software and other kinds of works. |
The licenses for most software and other practical works are designed |
to take away your freedom to share and change the works. By contrast, |
the GNU General Public License is intended to guarantee your freedom to |
share and change all versions of a program--to make sure it remains free |
software for all its users. We, the Free Software Foundation, use the |
GNU General Public License for most of our software; it applies also to |
any other work released this way by its authors. You can apply it to |
your programs, too. |
When we speak of free software, we are referring to freedom, not |
price. Our General Public Licenses are designed to make sure that you |
have the freedom to distribute copies of free software (and charge for |
them if you wish), that you receive source code or can get it if you |
want it, that you can change the software or use pieces of it in new |
free programs, and that you know you can do these things. |
To protect your rights, we need to prevent others from denying you |
these rights or asking you to surrender the rights. Therefore, you have |
certain responsibilities if you distribute copies of the software, or if |
you modify it: responsibilities to respect the freedom of others. |
For example, if you distribute copies of such a program, whether |
gratis or for a fee, you must pass on to the recipients the same |
freedoms that you received. You must make sure that they, too, receive |
or can get the source code. And you must show them these terms so they |
know their rights. |
Developers that use the GNU GPL protect your rights with two steps: |
(1) assert copyright on the software, and (2) offer you this License |
giving you legal permission to copy, distribute and/or modify it. |
For the developers' and authors' protection, the GPL clearly explains |
that there is no warranty for this free software. For both users' and |
authors' sake, the GPL requires that modified versions be marked as |
changed, so that their problems will not be attributed erroneously to |
authors of previous versions. |
Some devices are designed to deny users access to install or run |
modified versions of the software inside them, although the manufacturer |
can do so. This is fundamentally incompatible with the aim of |
protecting users' freedom to change the software. The systematic |
pattern of such abuse occurs in the area of products for individuals to |
use, which is precisely where it is most unacceptable. Therefore, we |
have designed this version of the GPL to prohibit the practice for those |
products. If such problems arise substantially in other domains, we |
stand ready to extend this provision to those domains in future versions |
of the GPL, as needed to protect the freedom of users. |
Finally, every program is threatened constantly by software patents. |
States should not allow patents to restrict development and use of |
software on general-purpose computers, but in those that do, we wish to |
avoid the special danger that patents applied to a free program could |
make it effectively proprietary. To prevent this, the GPL assures that |
patents cannot be used to render the program non-free. |
The precise terms and conditions for copying, distribution and |
modification follow. |
TERMS AND CONDITIONS |
0. Definitions. |
"This License" refers to version 3 of the GNU General Public License. |
"Copyright" also means copyright-like laws that apply to other kinds of |
works, such as semiconductor masks. |
"The Program" refers to any copyrightable work licensed under this |
License. Each licensee is addressed as "you". "Licensees" and |
"recipients" may be individuals or organizations. |
To "modify" a work means to copy from or adapt all or part of the work |
in a fashion requiring copyright permission, other than the making of an |
exact copy. The resulting work is called a "modified version" of the |
earlier work or a work "based on" the earlier work. |
A "covered work" means either the unmodified Program or a work based |
on the Program. |
To "propagate" a work means to do anything with it that, without |
permission, would make you directly or secondarily liable for |
infringement under applicable copyright law, except executing it on a |
computer or modifying a private copy. Propagation includes copying, |
distribution (with or without modification), making available to the |
public, and in some countries other activities as well. |
To "convey" a work means any kind of propagation that enables other |
parties to make or receive copies. Mere interaction with a user through |
a computer network, with no transfer of a copy, is not conveying. |
An interactive user interface displays "Appropriate Legal Notices" |
to the extent that it includes a convenient and prominently visible |
feature that (1) displays an appropriate copyright notice, and (2) |
tells the user that there is no warranty for the work (except to the |
extent that warranties are provided), that licensees may convey the |
work under this License, and how to view a copy of this License. If |
the interface presents a list of user commands or options, such as a |
menu, a prominent item in the list meets this criterion. |
1. Source Code. |
The "source code" for a work means the preferred form of the work |
for making modifications to it. "Object code" means any non-source |
form of a work. |
A "Standard Interface" means an interface that either is an official |
standard defined by a recognized standards body, or, in the case of |
interfaces specified for a particular programming language, one that |
is widely used among developers working in that language. |
The "System Libraries" of an executable work include anything, other |
than the work as a whole, that (a) is included in the normal form of |
packaging a Major Component, but which is not part of that Major |
Component, and (b) serves only to enable use of the work with that |
Major Component, or to implement a Standard Interface for which an |
implementation is available to the public in source code form. A |
"Major Component", in this context, means a major essential component |
(kernel, window system, and so on) of the specific operating system |
(if any) on which the executable work runs, or a compiler used to |
produce the work, or an object code interpreter used to run it. |
The "Corresponding Source" for a work in object code form means all |
the source code needed to generate, install, and (for an executable |
work) run the object code and to modify the work, including scripts to |
control those activities. However, it does not include the work's |
System Libraries, or general-purpose tools or generally available free |
programs which are used unmodified in performing those activities but |
which are not part of the work. For example, Corresponding Source |
includes interface definition files associated with source files for |
the work, and the source code for shared libraries and dynamically |
linked subprograms that the work is specifically designed to require, |
such as by intimate data communication or control flow between those |
subprograms and other parts of the work. |
The Corresponding Source need not include anything that users |
can regenerate automatically from other parts of the Corresponding |
Source. |
The Corresponding Source for a work in source code form is that |
same work. |
2. Basic Permissions. |
All rights granted under this License are granted for the term of |
copyright on the Program, and are irrevocable provided the stated |
conditions are met. This License explicitly affirms your unlimited |
permission to run the unmodified Program. The output from running a |
covered work is covered by this License only if the output, given its |
content, constitutes a covered work. This License acknowledges your |
rights of fair use or other equivalent, as provided by copyright law. |
You may make, run and propagate covered works that you do not |
convey, without conditions so long as your license otherwise remains |
in force. You may convey covered works to others for the sole purpose |
of having them make modifications exclusively for you, or provide you |
with facilities for running those works, provided that you comply with |
the terms of this License in conveying all material for which you do |
not control copyright. Those thus making or running the covered works |
for you must do so exclusively on your behalf, under your direction |
and control, on terms that prohibit them from making any copies of |
your copyrighted material outside their relationship with you. |
Conveying under any other circumstances is permitted solely under |
the conditions stated below. Sublicensing is not allowed; section 10 |
makes it unnecessary. |
3. Protecting Users' Legal Rights From Anti-Circumvention Law. |
No covered work shall be deemed part of an effective technological |
measure under any applicable law fulfilling obligations under article |
11 of the WIPO copyright treaty adopted on 20 December 1996, or |
similar laws prohibiting or restricting circumvention of such |
measures. |
When you convey a covered work, you waive any legal power to forbid |
circumvention of technological measures to the extent such circumvention |
is effected by exercising rights under this License with respect to |
the covered work, and you disclaim any intention to limit operation or |
modification of the work as a means of enforcing, against the work's |
users, your or third parties' legal rights to forbid circumvention of |
technological measures. |
4. Conveying Verbatim Copies. |
You may convey verbatim copies of the Program's source code as you |
receive it, in any medium, provided that you conspicuously and |
appropriately publish on each copy an appropriate copyright notice; |
keep intact all notices stating that this License and any |
non-permissive terms added in accord with section 7 apply to the code; |
keep intact all notices of the absence of any warranty; and give all |
recipients a copy of this License along with the Program. |
You may charge any price or no price for each copy that you convey, |
and you may offer support or warranty protection for a fee. |
5. Conveying Modified Source Versions. |
You may convey a work based on the Program, or the modifications to |
produce it from the Program, in the form of source code under the |
terms of section 4, provided that you also meet all of these conditions: |
a) The work must carry prominent notices stating that you modified |
it, and giving a relevant date. |
b) The work must carry prominent notices stating that it is |
released under this License and any conditions added under section |
7. This requirement modifies the requirement in section 4 to |
"keep intact all notices". |
c) You must license the entire work, as a whole, under this |
License to anyone who comes into possession of a copy. This |
License will therefore apply, along with any applicable section 7 |
additional terms, to the whole of the work, and all its parts, |
regardless of how they are packaged. This License gives no |
permission to license the work in any other way, but it does not |
invalidate such permission if you have separately received it. |
d) If the work has interactive user interfaces, each must display |
Appropriate Legal Notices; however, if the Program has interactive |
interfaces that do not display Appropriate Legal Notices, your |
work need not make them do so. |
A compilation of a covered work with other separate and independent |
works, which are not by their nature extensions of the covered work, |
and which are not combined with it such as to form a larger program, |
in or on a volume of a storage or distribution medium, is called an |
"aggregate" if the compilation and its resulting copyright are not |
used to limit the access or legal rights of the compilation's users |
beyond what the individual works permit. Inclusion of a covered work |
in an aggregate does not cause this License to apply to the other |
parts of the aggregate. |
6. Conveying Non-Source Forms. |
You may convey a covered work in object code form under the terms |
of sections 4 and 5, provided that you also convey the |
machine-readable Corresponding Source under the terms of this License, |
in one of these ways: |
a) Convey the object code in, or embodied in, a physical product |
(including a physical distribution medium), accompanied by the |
Corresponding Source fixed on a durable physical medium |
customarily used for software interchange. |
b) Convey the object code in, or embodied in, a physical product |
(including a physical distribution medium), accompanied by a |
written offer, valid for at least three years and valid for as |
long as you offer spare parts or customer support for that product |
model, to give anyone who possesses the object code either (1) a |
copy of the Corresponding Source for all the software in the |
product that is covered by this License, on a durable physical |
medium customarily used for software interchange, for a price no |
more than your reasonable cost of physically performing this |
conveying of source, or (2) access to copy the |
Corresponding Source from a network server at no charge. |
c) Convey individual copies of the object code with a copy of the |
written offer to provide the Corresponding Source. This |
alternative is allowed only occasionally and noncommercially, and |
only if you received the object code with such an offer, in accord |
with subsection 6b. |
d) Convey the object code by offering access from a designated |
place (gratis or for a charge), and offer equivalent access to the |
Corresponding Source in the same way through the same place at no |
further charge. You need not require recipients to copy the |
Corresponding Source along with the object code. If the place to |
copy the object code is a network server, the Corresponding Source |
may be on a different server (operated by you or a third party) |
that supports equivalent copying facilities, provided you maintain |
clear directions next to the object code saying where to find the |
Corresponding Source. Regardless of what server hosts the |
Corresponding Source, you remain obligated to ensure that it is |
available for as long as needed to satisfy these requirements. |
e) Convey the object code using peer-to-peer transmission, provided |
you inform other peers where the object code and Corresponding |
Source of the work are being offered to the general public at no |
charge under subsection 6d. |
A separable portion of the object code, whose source code is excluded |
from the Corresponding Source as a System Library, need not be |
included in conveying the object code work. |
A "User Product" is either (1) a "consumer product", which means any |
tangible personal property which is normally used for personal, family, |
or household purposes, or (2) anything designed or sold for incorporation |
into a dwelling. In determining whether a product is a consumer product, |
doubtful cases shall be resolved in favor of coverage. For a particular |
product received by a particular user, "normally used" refers to a |
typical or common use of that class of product, regardless of the status |
of the particular user or of the way in which the particular user |
actually uses, or expects or is expected to use, the product. A product |
is a consumer product regardless of whether the product has substantial |
commercial, industrial or non-consumer uses, unless such uses represent |
the only significant mode of use of the product. |
"Installation Information" for a User Product means any methods, |
procedures, authorization keys, or other information required to install |
and execute modified versions of a covered work in that User Product from |
a modified version of its Corresponding Source. The information must |
suffice to ensure that the continued functioning of the modified object |
code is in no case prevented or interfered with solely because |
modification has been made. |
If you convey an object code work under this section in, or with, or |
specifically for use in, a User Product, and the conveying occurs as |
part of a transaction in which the right of possession and use of the |
User Product is transferred to the recipient in perpetuity or for a |
fixed term (regardless of how the transaction is characterized), the |
Corresponding Source conveyed under this section must be accompanied |
by the Installation Information. But this requirement does not apply |
if neither you nor any third party retains the ability to install |
modified object code on the User Product (for example, the work has |
been installed in ROM). |
The requirement to provide Installation Information does not include a |
requirement to continue to provide support service, warranty, or updates |
for a work that has been modified or installed by the recipient, or for |
the User Product in which it has been modified or installed. Access to a |
network may be denied when the modification itself materially and |
adversely affects the operation of the network or violates the rules and |
protocols for communication across the network. |
Corresponding Source conveyed, and Installation Information provided, |
in accord with this section must be in a format that is publicly |
documented (and with an implementation available to the public in |
source code form), and must require no special password or key for |
unpacking, reading or copying. |
7. Additional Terms. |
"Additional permissions" are terms that supplement the terms of this |
License by making exceptions from one or more of its conditions. |
Additional permissions that are applicable to the entire Program shall |
be treated as though they were included in this License, to the extent |
that they are valid under applicable law. If additional permissions |
apply only to part of the Program, that part may be used separately |
under those permissions, but the entire Program remains governed by |
this License without regard to the additional permissions. |
When you convey a copy of a covered work, you may at your option |
remove any additional permissions from that copy, or from any part of |
it. (Additional permissions may be written to require their own |
removal in certain cases when you modify the work.) You may place |
additional permissions on material, added by you to a covered work, |
for which you have or can give appropriate copyright permission. |
Notwithstanding any other provision of this License, for material you |
add to a covered work, you may (if authorized by the copyright holders of |
that material) supplement the terms of this License with terms: |
a) Disclaiming warranty or limiting liability differently from the |
terms of sections 15 and 16 of this License; or |
b) Requiring preservation of specified reasonable legal notices or |
author attributions in that material or in the Appropriate Legal |
Notices displayed by works containing it; or |
c) Prohibiting misrepresentation of the origin of that material, or |
requiring that modified versions of such material be marked in |
reasonable ways as different from the original version; or |
d) Limiting the use for publicity purposes of names of licensors or |
authors of the material; or |
e) Declining to grant rights under trademark law for use of some |
trade names, trademarks, or service marks; or |
f) Requiring indemnification of licensors and authors of that |
material by anyone who conveys the material (or modified versions of |
it) with contractual assumptions of liability to the recipient, for |
any liability that these contractual assumptions directly impose on |
those licensors and authors. |
All other non-permissive additional terms are considered "further |
restrictions" within the meaning of section 10. If the Program as you |
received it, or any part of it, contains a notice stating that it is |
governed by this License along with a term that is a further |
restriction, you may remove that term. If a license document contains |
a further restriction but permits relicensing or conveying under this |
License, you may add to a covered work material governed by the terms |
of that license document, provided that the further restriction does |
not survive such relicensing or conveying. |
If you add terms to a covered work in accord with this section, you |
must place, in the relevant source files, a statement of the |
additional terms that apply to those files, or a notice indicating |
where to find the applicable terms. |
Additional terms, permissive or non-permissive, may be stated in the |
form of a separately written license, or stated as exceptions; |
the above requirements apply either way. |
8. Termination. |
You may not propagate or modify a covered work except as expressly |
provided under this License. Any attempt otherwise to propagate or |
modify it is void, and will automatically terminate your rights under |
this License (including any patent licenses granted under the third |
paragraph of section 11). |
However, if you cease all violation of this License, then your |
license from a particular copyright holder is reinstated (a) |
provisionally, unless and until the copyright holder explicitly and |
finally terminates your license, and (b) permanently, if the copyright |
holder fails to notify you of the violation by some reasonable means |
prior to 60 days after the cessation. |
Moreover, your license from a particular copyright holder is |
reinstated permanently if the copyright holder notifies you of the |
violation by some reasonable means, this is the first time you have |
received notice of violation of this License (for any work) from that |
copyright holder, and you cure the violation prior to 30 days after |
your receipt of the notice. |
Termination of your rights under this section does not terminate the |
licenses of parties who have received copies or rights from you under |
this License. If your rights have been terminated and not permanently |
reinstated, you do not qualify to receive new licenses for the same |
material under section 10. |
9. Acceptance Not Required for Having Copies. |
You are not required to accept this License in order to receive or |
run a copy of the Program. Ancillary propagation of a covered work |
occurring solely as a consequence of using peer-to-peer transmission |
to receive a copy likewise does not require acceptance. However, |
nothing other than this License grants you permission to propagate or |
modify any covered work. These actions infringe copyright if you do |
not accept this License. Therefore, by modifying or propagating a |
covered work, you indicate your acceptance of this License to do so. |
10. Automatic Licensing of Downstream Recipients. |
Each time you convey a covered work, the recipient automatically |
receives a license from the original licensors, to run, modify and |
propagate that work, subject to this License. You are not responsible |
for enforcing compliance by third parties with this License. |
An "entity transaction" is a transaction transferring control of an |
organization, or substantially all assets of one, or subdividing an |
organization, or merging organizations. If propagation of a covered |
work results from an entity transaction, each party to that |
transaction who receives a copy of the work also receives whatever |
licenses to the work the party's predecessor in interest had or could |
give under the previous paragraph, plus a right to possession of the |
Corresponding Source of the work from the predecessor in interest, if |
the predecessor has it or can get it with reasonable efforts. |
You may not impose any further restrictions on the exercise of the |
rights granted or affirmed under this License. For example, you may |
not impose a license fee, royalty, or other charge for exercise of |
rights granted under this License, and you may not initiate litigation |
(including a cross-claim or counterclaim in a lawsuit) alleging that |
any patent claim is infringed by making, using, selling, offering for |
sale, or importing the Program or any portion of it. |
11. Patents. |
A "contributor" is a copyright holder who authorizes use under this |
License of the Program or a work on which the Program is based. The |
work thus licensed is called the contributor's "contributor version". |
A contributor's "essential patent claims" are all patent claims |
owned or controlled by the contributor, whether already acquired or |
hereafter acquired, that would be infringed by some manner, permitted |
by this License, of making, using, or selling its contributor version, |
but do not include claims that would be infringed only as a |
consequence of further modification of the contributor version. For |
purposes of this definition, "control" includes the right to grant |
patent sublicenses in a manner consistent with the requirements of |
this License. |
Each contributor grants you a non-exclusive, worldwide, royalty-free |
patent license under the contributor's essential patent claims, to |
make, use, sell, offer for sale, import and otherwise run, modify and |
propagate the contents of its contributor version. |
In the following three paragraphs, a "patent license" is any express |
agreement or commitment, however denominated, not to enforce a patent |
(such as an express permission to practice a patent or covenant not to |
sue for patent infringement). To "grant" such a patent license to a |
party means to make such an agreement or commitment not to enforce a |
patent against the party. |
If you convey a covered work, knowingly relying on a patent license, |
and the Corresponding Source of the work is not available for anyone |
to copy, free of charge and under the terms of this License, through a |
publicly available network server or other readily accessible means, |
then you must either (1) cause the Corresponding Source to be so |
available, or (2) arrange to deprive yourself of the benefit of the |
patent license for this particular work, or (3) arrange, in a manner |
consistent with the requirements of this License, to extend the patent |
license to downstream recipients. "Knowingly relying" means you have |
actual knowledge that, but for the patent license, your conveying the |
covered work in a country, or your recipient's use of the covered work |
in a country, would infringe one or more identifiable patents in that |
country that you have reason to believe are valid. |
If, pursuant to or in connection with a single transaction or |
arrangement, you convey, or propagate by procuring conveyance of, a |
covered work, and grant a patent license to some of the parties |
receiving the covered work authorizing them to use, propagate, modify |
or convey a specific copy of the covered work, then the patent license |
you grant is automatically extended to all recipients of the covered |
work and works based on it. |
A patent license is "discriminatory" if it does not include within |
the scope of its coverage, prohibits the exercise of, or is |
conditioned on the non-exercise of one or more of the rights that are |
specifically granted under this License. You may not convey a covered |
work if you are a party to an arrangement with a third party that is |
in the business of distributing software, under which you make payment |
to the third party based on the extent of your activity of conveying |
the work, and under which the third party grants, to any of the |
parties who would receive the covered work from you, a discriminatory |
patent license (a) in connection with copies of the covered work |
conveyed by you (or copies made from those copies), or (b) primarily |
for and in connection with specific products or compilations that |
contain the covered work, unless you entered into that arrangement, |
or that patent license was granted, prior to 28 March 2007. |
Nothing in this License shall be construed as excluding or limiting |
any implied license or other defenses to infringement that may |
otherwise be available to you under applicable patent law. |
12. No Surrender of Others' Freedom. |
If conditions are imposed on you (whether by court order, agreement or |
otherwise) that contradict the conditions of this License, they do not |
excuse you from the conditions of this License. If you cannot convey a |
covered work so as to satisfy simultaneously your obligations under this |
License and any other pertinent obligations, then as a consequence you may |
not convey it at all. For example, if you agree to terms that obligate you |
to collect a royalty for further conveying from those to whom you convey |
the Program, the only way you could satisfy both those terms and this |
License would be to refrain entirely from conveying the Program. |
13. Use with the GNU Affero General Public License. |
Notwithstanding any other provision of this License, you have |
permission to link or combine any covered work with a work licensed |
under version 3 of the GNU Affero General Public License into a single |
combined work, and to convey the resulting work. The terms of this |
License will continue to apply to the part which is the covered work, |
but the special requirements of the GNU Affero General Public License, |
section 13, concerning interaction through a network will apply to the |
combination as such. |
14. Revised Versions of this License. |
The Free Software Foundation may publish revised and/or new versions of |
the GNU General Public License from time to time. Such new versions will |
be similar in spirit to the present version, but may differ in detail to |
address new problems or concerns. |
Each version is given a distinguishing version number. If the |
Program specifies that a certain numbered version of the GNU General |
Public License "or any later version" applies to it, you have the |
option of following the terms and conditions either of that numbered |
version or of any later version published by the Free Software |
Foundation. If the Program does not specify a version number of the |
GNU General Public License, you may choose any version ever published |
by the Free Software Foundation. |
If the Program specifies that a proxy can decide which future |
versions of the GNU General Public License can be used, that proxy's |
public statement of acceptance of a version permanently authorizes you |
to choose that version for the Program. |
Later license versions may give you additional or different |
permissions. However, no additional obligations are imposed on any |
author or copyright holder as a result of your choosing to follow a |
later version. |
15. Disclaimer of Warranty. |
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY |
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT |
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY |
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, |
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM |
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF |
ALL NECESSARY SERVICING, REPAIR OR CORRECTION. |
16. Limitation of Liability. |
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS |
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY |
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE |
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF |
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD |
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), |
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF |
SUCH DAMAGES. |
17. Interpretation of Sections 15 and 16. |
If the disclaimer of warranty and limitation of liability provided |
above cannot be given local legal effect according to their terms, |
reviewing courts shall apply local law that most closely approximates |
an absolute waiver of all civil liability in connection with the |
Program, unless a warranty or assumption of liability accompanies a |
copy of the Program in return for a fee. |
END OF TERMS AND CONDITIONS |
How to Apply These Terms to Your New Programs |
If you develop a new program, and you want it to be of the greatest |
possible use to the public, the best way to achieve this is to make it |
free software which everyone can redistribute and change under these terms. |
To do so, attach the following notices to the program. It is safest |
to attach them to the start of each source file to most effectively |
state the exclusion of warranty; and each file should have at least |
the "copyright" line and a pointer to where the full notice is found. |
<one line to give the program's name and a brief idea of what it does.> |
Copyright (C) <year> <name of author> |
This program is free software: you can redistribute it and/or modify |
it under the terms of the GNU General Public License as published by |
the Free Software Foundation, either version 3 of the License, or |
(at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License for more details. |
You should have received a copy of the GNU General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
Also add information on how to contact you by electronic and paper mail. |
If the program does terminal interaction, make it output a short |
notice like this when it starts in an interactive mode: |
<program> Copyright (C) <year> <name of author> |
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. |
This is free software, and you are welcome to redistribute it |
under certain conditions; type `show c' for details. |
The hypothetical commands `show w' and `show c' should show the appropriate |
parts of the General Public License. Of course, your program's commands |
might be different; for a GUI interface, you would use an "about box". |
You should also get your employer (if you work as a programmer) or school, |
if any, to sign a "copyright disclaimer" for the program, if necessary. |
For more information on this, and how to apply and follow the GNU GPL, see |
<http://www.gnu.org/licenses/>. |
The GNU General Public License does not permit incorporating your program |
into proprietary programs. If your program is a subroutine library, you |
may consider it more useful to permit linking proprietary applications with |
the library. If this is what you want to do, use the GNU Lesser General |
Public License instead of this License. But first, please read |
<http://www.gnu.org/philosophy/why-not-lgpl.html>. |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/COPYING.LESSER |
---|
0,0 → 1,165 |
GNU LESSER GENERAL PUBLIC LICENSE |
Version 3, 29 June 2007 |
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> |
Everyone is permitted to copy and distribute verbatim copies |
of this license document, but changing it is not allowed. |
This version of the GNU Lesser General Public License incorporates |
the terms and conditions of version 3 of the GNU General Public |
License, supplemented by the additional permissions listed below. |
0. Additional Definitions. |
As used herein, "this License" refers to version 3 of the GNU Lesser |
General Public License, and the "GNU GPL" refers to version 3 of the GNU |
General Public License. |
"The Library" refers to a covered work governed by this License, |
other than an Application or a Combined Work as defined below. |
An "Application" is any work that makes use of an interface provided |
by the Library, but which is not otherwise based on the Library. |
Defining a subclass of a class defined by the Library is deemed a mode |
of using an interface provided by the Library. |
A "Combined Work" is a work produced by combining or linking an |
Application with the Library. The particular version of the Library |
with which the Combined Work was made is also called the "Linked |
Version". |
The "Minimal Corresponding Source" for a Combined Work means the |
Corresponding Source for the Combined Work, excluding any source code |
for portions of the Combined Work that, considered in isolation, are |
based on the Application, and not on the Linked Version. |
The "Corresponding Application Code" for a Combined Work means the |
object code and/or source code for the Application, including any data |
and utility programs needed for reproducing the Combined Work from the |
Application, but excluding the System Libraries of the Combined Work. |
1. Exception to Section 3 of the GNU GPL. |
You may convey a covered work under sections 3 and 4 of this License |
without being bound by section 3 of the GNU GPL. |
2. Conveying Modified Versions. |
If you modify a copy of the Library, and, in your modifications, a |
facility refers to a function or data to be supplied by an Application |
that uses the facility (other than as an argument passed when the |
facility is invoked), then you may convey a copy of the modified |
version: |
a) under this License, provided that you make a good faith effort to |
ensure that, in the event an Application does not supply the |
function or data, the facility still operates, and performs |
whatever part of its purpose remains meaningful, or |
b) under the GNU GPL, with none of the additional permissions of |
this License applicable to that copy. |
3. Object Code Incorporating Material from Library Header Files. |
The object code form of an Application may incorporate material from |
a header file that is part of the Library. You may convey such object |
code under terms of your choice, provided that, if the incorporated |
material is not limited to numerical parameters, data structure |
layouts and accessors, or small macros, inline functions and templates |
(ten or fewer lines in length), you do both of the following: |
a) Give prominent notice with each copy of the object code that the |
Library is used in it and that the Library and its use are |
covered by this License. |
b) Accompany the object code with a copy of the GNU GPL and this license |
document. |
4. Combined Works. |
You may convey a Combined Work under terms of your choice that, |
taken together, effectively do not restrict modification of the |
portions of the Library contained in the Combined Work and reverse |
engineering for debugging such modifications, if you also do each of |
the following: |
a) Give prominent notice with each copy of the Combined Work that |
the Library is used in it and that the Library and its use are |
covered by this License. |
b) Accompany the Combined Work with a copy of the GNU GPL and this license |
document. |
c) For a Combined Work that displays copyright notices during |
execution, include the copyright notice for the Library among |
these notices, as well as a reference directing the user to the |
copies of the GNU GPL and this license document. |
d) Do one of the following: |
0) Convey the Minimal Corresponding Source under the terms of this |
License, and the Corresponding Application Code in a form |
suitable for, and under terms that permit, the user to |
recombine or relink the Application with a modified version of |
the Linked Version to produce a modified Combined Work, in the |
manner specified by section 6 of the GNU GPL for conveying |
Corresponding Source. |
1) Use a suitable shared library mechanism for linking with the |
Library. A suitable mechanism is one that (a) uses at run time |
a copy of the Library already present on the user's computer |
system, and (b) will operate properly with a modified version |
of the Library that is interface-compatible with the Linked |
Version. |
e) Provide Installation Information, but only if you would otherwise |
be required to provide such information under section 6 of the |
GNU GPL, and only to the extent that such information is |
necessary to install and execute a modified version of the |
Combined Work produced by recombining or relinking the |
Application with a modified version of the Linked Version. (If |
you use option 4d0, the Installation Information must accompany |
the Minimal Corresponding Source and Corresponding Application |
Code. If you use option 4d1, you must provide the Installation |
Information in the manner specified by section 6 of the GNU GPL |
for conveying Corresponding Source.) |
5. Combined Libraries. |
You may place library facilities that are a work based on the |
Library side by side in a single library together with other library |
facilities that are not Applications and are not covered by this |
License, and convey such a combined library under terms of your |
choice, if you do both of the following: |
a) Accompany the combined library with a copy of the same work based |
on the Library, uncombined with any other library facilities, |
conveyed under the terms of this License. |
b) Give prominent notice with the combined library that part of it |
is a work based on the Library, and explaining where to find the |
accompanying uncombined form of the same work. |
6. Revised Versions of the GNU Lesser General Public License. |
The Free Software Foundation may publish revised and/or new versions |
of the GNU Lesser General Public License from time to time. Such new |
versions will be similar in spirit to the present version, but may |
differ in detail to address new problems or concerns. |
Each version is given a distinguishing version number. If the |
Library as you received it specifies that a certain numbered version |
of the GNU Lesser General Public License "or any later version" |
applies to it, you have the option of following the terms and |
conditions either of that published version or of any later version |
published by the Free Software Foundation. If the Library as you |
received it does not specify a version number of the GNU Lesser |
General Public License, you may choose any version of the GNU Lesser |
General Public License ever published by the Free Software Foundation. |
If the Library as you received it specifies that a proxy can decide |
whether future versions of the GNU Lesser General Public License shall |
apply, that proxy's public statement of acceptance of any version is |
permanent authorization for you to choose that version for the |
Library. |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/Flight-Ctrl_MEGA644_V0_60.aps |
---|
0,0 → 1,0 |
<AVRStudio><MANAGEMENT><ProjectName>Flight-Ctrl_MEGA644_V0_60</ProjectName><Created>19-Aug-2007 14:38:13</Created><LastEdit>17-Oct-2007 19:07:35</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>19-Aug-2007 14:38:13</Created><Version>4</Version><Build>4, 13, 0, 528</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>Flight-Ctrl_MEGA644_V0_60.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v060JokoKompassAcc\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>AVR Simulator</CURRENT_TARGET><CURRENT_PART>ATmega644.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>main.c</SOURCEFILE><SOURCEFILE>analog.c</SOURCEFILE><SOURCEFILE>eeprom.c</SOURCEFILE><SOURCEFILE>fc.c</SOURCEFILE><SOURCEFILE>GPS.c</SOURCEFILE><SOURCEFILE>menu.c</SOURCEFILE><SOURCEFILE>printf_P.c</SOURCEFILE><SOURCEFILE>rc.c</SOURCEFILE><SOURCEFILE>timer0.c</SOURCEFILE><SOURCEFILE>twimaster.c</SOURCEFILE><SOURCEFILE>uart.c</SOURCEFILE><SOURCEFILE>compass.c</SOURCEFILE><SOURCEFILE>math.c</SOURCEFILE><HEADERFILE>_Settings.h</HEADERFILE><HEADERFILE>analog.h</HEADERFILE><HEADERFILE>fc.h</HEADERFILE><HEADERFILE>gps.h</HEADERFILE><HEADERFILE>main.h</HEADERFILE><HEADERFILE>menu.h</HEADERFILE><HEADERFILE>old_macros.h</HEADERFILE><HEADERFILE>printf_P.h</HEADERFILE><HEADERFILE>rc.h</HEADERFILE><HEADERFILE>Settings.h</HEADERFILE><HEADERFILE>timer0.h</HEADERFILE><HEADERFILE>twimaster.h</HEADERFILE><HEADERFILE>uart.h</HEADERFILE><HEADERFILE>compass.h</HEADERFILE><HEADERFILE>math.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega644</PART><HEX>1</HEX><LIST>0</LIST><MAP>0</MAP><OUTPUTFILENAME>Flight-Ctrl_MEGA644_V0_60.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -O0 -fsigned-char</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20070525\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20070525\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/></IOView><Files><File00000><FileId>00000</FileId><FileName>main.c</FileName><Status>1</Status></File00000><File00001><FileId>00001</FileId><FileName>compass.c</FileName><Status>1</Status></File00001><File00002><FileId>00002</FileId><FileName>makefile</FileName><Status>1</Status></File00002><File00003><FileId>00003</FileId><FileName>GPS.c</FileName><Status>1</Status></File00003><File00004><FileId>00004</FileId><FileName>gps.h</FileName><Status>1</Status></File00004><File00005><FileId>00005</FileId><FileName>compass.h</FileName><Status>1</Status></File00005><File00006><FileId>00006</FileId><FileName>math.c</FileName><Status>1</Status></File00006><File00007><FileId>00007</FileId><FileName>math.h</FileName><Status>1</Status></File00007><File00008><FileId>00008</FileId><FileName>main.h</FileName><Status>1</Status></File00008></Files><Workspace><File00000><Position>332 71 1044 624</Position><LineCol>17 0</LineCol></File00000><File00001><Position>330 67 1042 620</Position><LineCol>17 0</LineCol></File00001><File00002><Position>333 69 1045 622</Position><LineCol>6 0</LineCol></File00002><File00003><Position>406 160 956 532</Position><LineCol>282 40</LineCol></File00003><File00004><Position>428 182 978 554</Position><LineCol>21 22</LineCol></File00004><File00005><Position>450 204 1000 576</Position><LineCol>0 0</LineCol></File00005><File00006><Position>472 226 1022 598</Position><LineCol>0 0</LineCol></File00006><File00007><Position>336 71 1048 624</Position><LineCol>0 0</LineCol><State>Maximized</State></File00007><File00008><Position>340 94 890 466</Position><LineCol>0 0</LineCol></File00008></Workspace><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio> |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/GPS.c |
---|
0,0 → 1,263 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 08.2007 by THE BOSCH TEAM |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
#include "math.h" |
long Soll_Position_North = 0; |
long Soll_Position_East = 0; |
long GPS_Positionsabweichung_North = 0; |
long GPS_Positionsabweichung_East = 0; |
long GPS_Geschwindigkeit_North = 0; |
long GPS_Geschwindigkeit_East = 0; |
long P_Einfluss_North = 0; |
long D_Einfluss_North = 0; |
long P_Einfluss_East = 0; |
long D_Einfluss_East = 0; |
signed int GPS_North = 0; |
signed int GPS_East = 0; |
signed int GPS_Nick = 0; |
signed int GPS_Roll = 0; |
volatile char gethome = 0; //Flag ob GPS_Home_Position gelernt ist //(280807Kr) |
long GPS_Home_North = 0; |
long GPS_Home_East = 0; |
unsigned char blinkcount_LED2 = 0; //Hilfszähler für die blinkende LED (010907Kr) |
//**************************** MIRCOS DEFINITIONSANFANG FÜR DIE FILTERUNG |
// Filterung der GPS Messwerte vom Ublox-Empfänger. Es wird der gleitende Durchschnitt aus n Messwerten gebildet |
#define MITTELWERTZAHL 8 // Anzahl der Messwerte fuer gleitenden Mittelwert |
volatile char NeuerMittelwert = 0; //Flag ob ein neuer Mittelwert vorliegt, der mit 4 Hz berechnet wird, da nur dann neue Messwerte vom GPS vorliegen |
volatile unsigned char FilterPos = 0; |
volatile long NORTH_MITTEL = 0; |
volatile long EAST_MITTEL = 0; |
volatile long long NORTH_LONG_LONG = 0; |
volatile long long EAST_LONG_LONG = 0; |
volatile int filterfilled = 0; |
typedef struct { |
long NORTH[MITTELWERTZAHL]; |
} FILTER_NORTH; // Filterdefinition für die Positions-Nordwerte aus dem GPS-Empfänger |
typedef struct { |
long EAST[MITTELWERTZAHL]; |
} FILTER_EAST; // Filterdefinition für die Positions-Ostwerte aus dem GPS-Empfänger |
FILTER_NORTH filter_north; |
FILTER_EAST filter_east; |
//**************************** MIRCOS DEFINITIONSENDE FÜR DIE FILTERUNG |
void gps_main(void) |
{ |
//**************************** MIRCOS FILTERUNG ANFANG |
// if(actualPos.GPSFix == 3 && actualPos.newData == 1) //bilde neuen Positionsmittelwert, wenn 3D-Fix und neue GPS-Daten vorliegen |
if(actualPos.GPSFix == 3) // hier auskommentieren, wenn dauernd (also nicht nur alle 250ms) die GPS-Berechnung durchgeführt werden soll |
{ |
filter_north.NORTH[FilterPos] = actualPos.northing; |
filter_east.EAST[FilterPos] = actualPos.easting; |
FilterPos++; |
if (FilterPos==MITTELWERTZAHL) FilterPos=0; |
if (filterfilled<MITTELWERTZAHL) filterfilled++; |
NORTH_LONG_LONG = 0; |
EAST_LONG_LONG = 0; |
for (int i=0; i<filterfilled; i++) |
{ |
NORTH_LONG_LONG += filter_north.NORTH[i]; |
EAST_LONG_LONG += filter_east.EAST[i]; |
} |
NORTH_LONG_LONG /= filterfilled; |
EAST_LONG_LONG /= filterfilled; |
NORTH_MITTEL = NORTH_LONG_LONG; |
EAST_MITTEL = EAST_LONG_LONG; |
NeuerMittelwert = 1; |
//actualPos.newData = 0; // hier auskommentieren, wenn dauernd (also nicht nur alle 250ms) die GPS-Berechnung durchgeführt werden soll |
} |
//******************************* MIRCOS FILTERUNG ENDE |
//wenn kein 3D-Fix vorhanden, über das Poti jedoch irgendeine GPS Funktion aktiv ist, werden die GPS-Steuerbefehle |
//auf Null gesetzt, um unkontrolliertes Wegfliegen durch das GPS zu verhindern. Dadurch wird abgesichert |
//(auch im laufenden Flug), dass bei einem Verlust der GPS-Verbindung GPS deaktivert wird |
if (actualPos.GPSFix < 3 && Poti3 > 70) |
{ |
GPS_Nick = 0; |
GPS_Roll = 0; |
LED2_OFF; |
beeptime = 50; |
} |
// speichert die GPS_Home_Position beim 3D-Fix, MotorEINschalten und wenn noch nicht zu weit weggeflogen wurde |
// (modell_fliegt_gps < 2000) einmalig ab. Die Flugzeitabfrage sichert ab, dass bei einem Losfliegen ohne 3D-Fix die Home_Positinen |
// irgendwann später dort gelernt werden, wo dann zu ersten mal ein 3D-Fix vorhanden ist |
if (actualPos.GPSFix == 3 && MotorenEin == 1 && gethome == 0 && modell_fliegt_gps < 2000) |
{ |
GPS_Home_North = NORTH_MITTEL; |
GPS_Home_East = EAST_MITTEL; |
// Muss hier auch eingelernt werden, damit falls das Poti3 beim Motorenstarten in |
// Mittelstellung sein sollte, trotzdem schon eine Sollposition vorliegt. Andernfalls würde |
// GPS_Nick und _Roll maximal werden bis zum ersten Mal Stick_Nick und _Roll gesteuert würde |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
beeptime = 50; |
gethome = 1; |
} |
//löscht die GPS_Home_Position beim MotorAUSschalten wieder und resetet das Flag gethome //(280807Kr) |
if (MotorenEin == 0) |
{ |
GPS_Home_North = 0; |
GPS_Home_East = 0; |
gethome = 0; |
modell_fliegt_gps = 0; |
} |
// wenn Schalter ausgeschaltet, dann wird die LED2 ausgeschaltet und das GPS Steuerkommando gelöscht |
if(Poti3 < 70) |
{ |
// Sollpositionen müssen auch hier beschrieben werden, damit ausgeschlossen ist, dass falls gelandet wird und die GPS-Funktion |
// über Poti3 deaktivert und anschließend wieder aktiviert wird keine Soll-Positionen vorliegen. |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
GPS_Nick = 0; |
GPS_Roll = 0; |
LED2_OFF; |
} |
// wenn 3D-Fix, Schalter im mittleren Bereich und vom Pilot gesteuert wird, wird ständig neue GPS-Sollposition eingelernt |
if(actualPos.GPSFix == 3 && Poti3 > 70 && Poti3 < 150 && (StickNick > 12 || StickNick < -12 || StickRoll > 12 || StickRoll < -12)) |
{ |
GPS_Nick = 0; //wird genullt, damit das letzte GPS Kommando nicht ständig gegen den Piloten ansteuert |
GPS_Roll = 0; //wird genullt, damit das letzte GPS Kommando nicht ständig gegen den Piloten ansteuert |
Soll_Position_North = NORTH_MITTEL; // Soll-Position wird geschrieben |
Soll_Position_East = EAST_MITTEL; // Soll-Position wird geschrieben |
//++++++++++++++++++++++++++++++++++++ |
//Sorgt lediglich dafür, dass die LED2 langsam blinkt. Dauer ist durch die "> x" Abfrage festgelegt |
//++++++++++++++++++++++++++++++++++++ |
if(blinkcount_LED2 >= 200) // maximal erlaubt 255 wegen unsigned char |
{ |
LED2_FLASH; |
blinkcount_LED2 = 0; |
} |
blinkcount_LED2++; |
//++++++++++++++++++++++++++++++++++++ |
} |
// wenn 3D-Fix, Schalter im mittleren Bereich (oder höher), neuer Mittelwert vorhanden, wenigstens einmal Sollposition gelernt und der Pilot nicht selbst steuert wird eine GPS-Funktion aktiviert |
if (actualPos.GPSFix == 3 && Poti3 > 70 && NeuerMittelwert == 1 && Soll_Position_North != 0 && Soll_Position_East != 0 && StickNick <= 12 && StickNick >= -12 && StickRoll <= 12 && StickRoll >= -12) |
{ |
//Berechnung der GPS-Positionsabweichung je nach aktivierter GPS-Funktion (GPS_HOLD oder HOMING) |
//DYNAMISCHES GPS-HOLD, wenn Schalter noch in Mittelstellung ist wird die zuletzt gelernte Soll_Position angeflogen |
if(Poti3 < 150) |
{ |
GPS_Positionsabweichung_North = (Soll_Position_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (Soll_Position_East - EAST_MITTEL); |
LED2_ON; |
} |
//andernfalls, wenn Schalter in max. Stellung und zusätzlich die GPS_Home_Positionen beim Motorenstarten gelernt |
//werden konnten, wird zur GPS_Home_Position geflogen |
if (Poti3 >= 150 && GPS_Home_North != 0 && GPS_Home_East != 0) |
{ |
GPS_Positionsabweichung_North = (GPS_Home_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (GPS_Home_East - EAST_MITTEL); |
// durch das ständige Neulernen der Soll_Positionen während HOMING wird erreicht, dass der MK nach dem Umschalten |
// von HOMING zurück zu GPS-HOLD nicht wieder an die alte Soll_Position zurück fliegt |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
LED2_ON; |
} |
//verhindert, dass beim Umschalten von Mittelstellung (GPS_HOLD) auf Maximalstellung (HOMING) OHNE gelernte Homeposition |
//die GPS Funktion unkontrolliert steuert. Daher wird GPS_HOLD aktiv gehalten, die Sollpositon wird bei Stickbefehlen |
//jedoch nicht wie beim dynamischen GPS_HOLD überschrieben. Zusätzlich wird der Summer eingeschaltet. |
if (Poti3 >= 150 && GPS_Home_North == 0 && GPS_Home_East == 0) |
{ |
GPS_Positionsabweichung_North = (Soll_Position_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (Soll_Position_East - EAST_MITTEL); |
LED2_ON; |
beeptime = 50; |
} |
//GPS-Geschwindigkeiten |
GPS_Geschwindigkeit_North = actualPos.velNorth; //actualPos.velNorth ist die Geschwindigkeiten aus dem GPS Empfänger entlang der Nord-Süd Richtung |
GPS_Geschwindigkeit_East = actualPos.velEast; //actualPos.velEast ist die Geschwindigkeiten aus dem GPS Empfänger entlang der Ost-West Richtung |
//Berechnung der Einzelkomponenten des PD-Reglers |
P_Einfluss_North = (P_GPS_Verstaerkung * GPS_Positionsabweichung_North)*0.0005; //entspricht einer Skalierung von 1/2000 |
D_Einfluss_North = (D_GPS_Verstaerkung * GPS_Geschwindigkeit_North)*0.00333; //entspricht einer Skalierung von 1/300 |
P_Einfluss_East = (P_GPS_Verstaerkung * GPS_Positionsabweichung_East)*0.0005; //entspricht einer Skalierung von 1/2000 |
D_Einfluss_East = (D_GPS_Verstaerkung * GPS_Geschwindigkeit_East)*0.00333; //entspricht einer Skalierung von 1/300 |
// Begrenzung des maximalen D-Anteils für pos. und neg. Werte. Grenze muss so geählt werden, |
// dass das Limit im normalen Position-Hold nicht erreicht wird und somit keinen Einfluss hat. |
// Grund: Beim Zufliegen auf weiter entfernte Ziele bremst der D-Anteil kurz vor dem Ziel den Mikrokopter sehr stark ab. |
// Dieses Limit wirkt nur, wenn sich der MK im HOMING Modus befindet und sich noch weit (>2,5m) von der Home-Position weg befindet. |
if (Poti3 >= 150 && GPS_Home_North != 0 && GPS_Home_East != 0 && (abs(GPS_Positionsabweichung_North) > 250 || abs(GPS_Positionsabweichung_East) > 250)) |
{ |
if (D_Einfluss_North > Limit_D_Anteil) D_Einfluss_North = Limit_D_Anteil; |
if (D_Einfluss_East > Limit_D_Anteil) D_Einfluss_East = Limit_D_Anteil; |
if (D_Einfluss_North < -1 * Limit_D_Anteil) D_Einfluss_North = -1 * Limit_D_Anteil; |
if (D_Einfluss_East < -1 * Limit_D_Anteil) D_Einfluss_East = -1 * Limit_D_Anteil; |
} |
// PD-Regler |
GPS_North = (-P_Einfluss_North + D_Einfluss_North); |
GPS_East = (P_Einfluss_East - D_Einfluss_East); |
//Umrechnen vom globalen North- bzw. East- in das körperfeste X- bzw. Y- Koordinatensystem |
GPS_Nick = (-c_sin[KompassValue]*0.001*GPS_East + c_cos[KompassValue]*0.001*GPS_North); // die "0" kann später durch den Messwert des Kompasssensors (KompassValue/0.01745329251) ersetzt werden |
GPS_Roll = (c_cos[KompassValue]*0.001*GPS_East + c_sin[KompassValue]*0.001*GPS_North); // die "0" kann später durch den Messwert des Kompasssensors (KompassValue/180*3.1415926535) ersetzt werden |
// Begrenzung des maximalen GPS Einflusses für positive und negative Werte |
if (GPS_Nick > 35) GPS_Nick = 35; |
if (GPS_Roll > 35) GPS_Roll = 35; |
if (GPS_Nick < -35) GPS_Nick = -35; |
if (GPS_Roll < -35) GPS_Roll = -35; |
//Funktion wird dadurch nur alle 250 ms aufgerufen, wenn neue Mittelwerte aus den GPS-Daten vorliegen. |
//FUNKTIONIERT MOMENTAN NOCH NICHT, DA STÄNDIG OHNE UNTERBRECHUNG NEUE MITTELWERTE BERECHNET WERDEN. |
//GRUND: DIE ABFRAGE NACH NEUE GPS-DATEN ERFOLGT NOCH NICHT |
NeuerMittelwert = 0; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/GPS.c.bak |
---|
0,0 → 1,306 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 08.2007 by THE BOSCH TEAM |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
#include "math.h" |
//Sinusfunktion von 0° bis 359°. Ergebnis wurde mit 1000 multipliziert, damit als Definition platzsparend int |
//verwendet werden kann. d.h., es muss also in der späteren Berechnung noch mit 0,001 multipliziert werden //(090907Kr) |
const int c_sin[] = {0,17,34,52,69,87,104,121,139,156,173,190, |
207,224,241,258,275,292,309,325,342,358,374,390,406,422,438,453,469,484,500,515,529,544,559,573,587,601,615,629, |
642,656,669,682,694,707,719,731,743,754,766,777,788,798,809,819,829,838,848,857,866,874,882,891,898,906,913,920, |
927,933,939,945,951,956,961,965,970,974,978,981,984,987,990,992,994,996,997,998,999,999,1000,999,999,998,997,996, |
994,992,990,987,984,981,978,974,970,965,961,956,951,945,939,933,927,920,913,906,898,891,882,874,866,857,848,838, |
829,819,809,798,788,777,766,754,743,731,719,707,694,682,669,656,642,629,615,601,587,573,559,544,529,515,500,484, |
469,453,438,422,406,390,374,358,342,325,309,292,275,258,241,224,207,190,173,156,139,121,104,87,69,52,34,17,0,-17, |
-34,-52,-69,-87,-104,-121,-139,-156,-173,-190,-207,-224,-241,-258,-275,-292,-309,-325,-342,-358,-374,-390,-406, |
-422,-438,-453,-469,-484,-500,-515,-529,-544,-559,-573,-587,-601,-615,-629,-642,-656,-669,-682,-694,-707,-719, |
-731,-743,-754,-766,-777,-788,-798,-809,-819,-829,-838,-848,-857,-866,-874,-882,-891,-898,-906,-913,-920,-927, |
-933,-939,-945,-951,-956,-961,-965,-970,-974,-978,-981,-984,-987,-990,-992,-994,-996,-997,-998,-999,-999,-1000, |
-999,-999,-998,-997,-996,-994,-992,-990,-987,-984,-981,-978,-974,-970,-965,-961,-956,-951,-945,-939,-933,-927, |
-920,-913,-906,-898,-891,-882,-874,-866,-857,-848,-838,-829,-819,-809,-798,-788,-777,-766,-754,-743,-731,-719, |
-707,-694,-682,-669,-656,-642,-629,-615,-601,-587,-573,-559,-544,-529,-515,-500,-484,-469,-453,-438,-422,-406, |
-390,-374,-358,-342,-325,-309,-292,-275,-258,-241,-224,-207,-190,-173,-156,-139,-121,-104,-87,-69,-52,-34,-17}; |
//Cosinusfunktion von 0° bis 359°. Ergebnis wurde mit 1000 multipliziert, damit als Definition platzsparend int |
//verwendet werden kann. D.h., es muss also in der späteren Berechnung noch mit 0,001 multipliziert werden //(090907Kr) |
const int c_cos[] = {1000,999,999,998,997,996,994,992,990,987,984,981, |
978,974,970,965,961,956,951,945,939,933,927,920,913,906,898,891,882,874,866,857,848,838,829,819,809,798,788,777, |
766,754,743,731,719,707,694,682,669,656,642,629,615,601,587,573,559,544,529,515,500,484,469,453,438,422,406,390, |
374,358,342,325,309,292,275,258,241,224,207,190,173,156,139,121,104,87,69,52,34,17,0,-17,-34,-52,-69,-87,-104, |
-121,-139,-156,-173,-190,-207,-224,-241,-258,-275,-292,-309,-325,-342,-358,-374,-390,-406,-422,-438,-453,-469, |
-484,-500,-515,-529,-544,-559,-573,-587,-601,-615,-629,-642,-656,-669,-682,-694,-707,-719,-731,-743,-754,-766, |
-777,-788,-798,-809,-819,-829,-838,-848,-857,-866,-874,-882,-891,-898,-906,-913,-920,-927,-933,-939,-945,-951, |
-956,-961,-965,-970,-974,-978,-981,-984,-987,-990,-992,-994,-996,-997,-998,-999,-999,-1000,-999,-999,-998,-997, |
-996,-994,-992,-990,-987,-984,-981,-978,-974,-970,-965,-961,-956,-951,-945,-939,-933,-927,-920,-913,-906,-898, |
-891,-882,-874,-866,-857,-848,-838,-829,-819,-809,-798,-788,-777,-766,-754,-743,-731,-719,-707,-694,-682,-669, |
-656,-642,-629,-615,-601,-587,-573,-559,-544,-529,-515,-500,-484,-469,-453,-438,-422,-406,-390,-374,-358,-342, |
-325,-309,-292,-275,-258,-241,-224,-207,-190,-173,-156,-139,-121,-104,-87,-69,-52,-34,-17,0,17,34,52,69,87, |
104,121,139,156,173,190,207,224,241,258,275,292,309,325,342,358,374,390,406,422,438,453,469,484,500,515,529,544, |
559,573,587,601,615,629,642,656,669,682,694,707,719,731,743,754,766,777,788,798,809,819,829,838,848,857,866,874, |
882,891,898,906,913,920,927,933,939,945,951,956,961,965,970,974,978,981,984,987,990,992,994,996,997,998,999,999}; |
long Soll_Position_North = 0; |
long Soll_Position_East = 0; |
long GPS_Positionsabweichung_North = 0; |
long GPS_Positionsabweichung_East = 0; |
long GPS_Geschwindigkeit_North = 0; |
long GPS_Geschwindigkeit_East = 0; |
long P_Einfluss_North = 0; |
long D_Einfluss_North = 0; |
long P_Einfluss_East = 0; |
long D_Einfluss_East = 0; |
signed int GPS_North = 0; |
signed int GPS_East = 0; |
signed int GPS_Nick = 0; |
signed int GPS_Roll = 0; |
volatile char gethome = 0; //Flag ob GPS_Home_Position gelernt ist //(280807Kr) |
long GPS_Home_North = 0; |
long GPS_Home_East = 0; |
unsigned char blinkcount_LED2 = 0; //Hilfszähler für die blinkende LED (010907Kr) |
//**************************** MIRCOS DEFINITIONSANFANG FÜR DIE FILTERUNG |
// Filterung der GPS Messwerte vom Ublox-Empfänger. Es wird der gleitende Durchschnitt aus n Messwerten gebildet |
#define MITTELWERTZAHL 8 // Anzahl der Messwerte fuer gleitenden Mittelwert |
volatile char NeuerMittelwert = 0; //Flag ob ein neuer Mittelwert vorliegt, der mit 4 Hz berechnet wird, da nur dann neue Messwerte vom GPS vorliegen |
volatile unsigned char FilterPos = 0; |
volatile long NORTH_MITTEL = 0; |
volatile long EAST_MITTEL = 0; |
volatile long long NORTH_LONG_LONG = 0; |
volatile long long EAST_LONG_LONG = 0; |
volatile int filterfilled = 0; |
typedef struct { |
long NORTH[MITTELWERTZAHL]; |
} FILTER_NORTH; // Filterdefinition für die Positions-Nordwerte aus dem GPS-Empfänger |
typedef struct { |
long EAST[MITTELWERTZAHL]; |
} FILTER_EAST; // Filterdefinition für die Positions-Ostwerte aus dem GPS-Empfänger |
FILTER_NORTH filter_north; |
FILTER_EAST filter_east; |
//**************************** MIRCOS DEFINITIONSENDE FÜR DIE FILTERUNG |
void gps_main(void) |
{ |
<<<<<<< GPS.c |
//**************************** MIRCOS FILTERUNG ANFANG |
// if(actualPos.GPSFix == 3 && actualPos.newData == 1) //bilde neuen Positionsmittelwert, wenn 3D-Fix und neue GPS-Daten vorliegen |
if(actualPos.GPSFix == 3) // hier auskommentieren, wenn dauernd (also nicht nur alle 250ms) die GPS-Berechnung durchgeführt werden soll |
{ |
filter_north.NORTH[FilterPos] = actualPos.northing; |
filter_east.EAST[FilterPos] = actualPos.easting; |
FilterPos++; |
if (FilterPos==MITTELWERTZAHL) FilterPos=0; |
if (filterfilled<MITTELWERTZAHL) filterfilled++; |
NORTH_LONG_LONG = 0; |
EAST_LONG_LONG = 0; |
for (int i=0; i<filterfilled; i++) |
{ |
NORTH_LONG_LONG += filter_north.NORTH[i]; |
EAST_LONG_LONG += filter_east.EAST[i]; |
} |
NORTH_LONG_LONG /= filterfilled; |
EAST_LONG_LONG /= filterfilled; |
NORTH_MITTEL = NORTH_LONG_LONG; |
EAST_MITTEL = EAST_LONG_LONG; |
NeuerMittelwert = 1; |
//actualPos.newData = 0; // hier auskommentieren, wenn dauernd (also nicht nur alle 250ms) die GPS-Berechnung durchgeführt werden soll |
} |
//******************************* MIRCOS FILTERUNG ENDE |
//wenn kein 3D-Fix vorhanden, über das Poti jedoch irgendeine GPS Funktion aktiv ist, werden die GPS-Steuerbefehle |
//auf Null gesetzt, um unkontrolliertes Wegfliegen durch das GPS zu verhindern. Dadurch wird abgesichert |
//(auch im laufenden Flug), dass bei einem Verlust der GPS-Verbindung GPS deaktivert wird |
if (actualPos.GPSFix < 3 && Poti3 > 70) |
{ |
GPS_Nick = 0; |
GPS_Roll = 0; |
LED2_OFF; |
beeptime = 50; |
} |
// speichert die GPS_Home_Position beim 3D-Fix, MotorEINschalten und wenn noch nicht zu weit weggeflogen wurde |
// (modell_fliegt_gps < 2000) einmalig ab. Die Flugzeitabfrage sichert ab, dass bei einem Losfliegen ohne 3D-Fix die Home_Positinen |
// irgendwann später dort gelernt werden, wo dann zu ersten mal ein 3D-Fix vorhanden ist |
if (actualPos.GPSFix == 3 && MotorenEin == 1 && gethome == 0 && modell_fliegt_gps < 2000) |
{ |
GPS_Home_North = NORTH_MITTEL; |
GPS_Home_East = EAST_MITTEL; |
// Muss hier auch eingelernt werden, damit falls das Poti3 beim Motorenstarten in |
// Mittelstellung sein sollte, trotzdem schon eine Sollposition vorliegt. Andernfalls würde |
// GPS_Nick und _Roll maximal werden bis zum ersten Mal Stick_Nick und _Roll gesteuert würde |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
beeptime = 50; |
gethome = 1; |
} |
//löscht die GPS_Home_Position beim MotorAUSschalten wieder und resetet das Flag gethome //(280807Kr) |
if (MotorenEin == 0) |
{ |
GPS_Home_North = 0; |
GPS_Home_East = 0; |
gethome = 0; |
modell_fliegt_gps = 0; |
} |
// wenn Schalter ausgeschaltet, dann wird die LED2 ausgeschaltet und das GPS Steuerkommando gelöscht |
if(Poti3 < 70) |
{ |
// Sollpositionen müssen auch hier beschrieben werden, damit ausgeschlossen ist, dass falls gelandet wird und die GPS-Funktion |
// über Poti3 deaktivert und anschließend wieder aktiviert wird keine Soll-Positionen vorliegen. |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
GPS_Nick = 0; |
GPS_Roll = 0; |
LED2_OFF; |
} |
// wenn 3D-Fix, Schalter im mittleren Bereich und vom Pilot gesteuert wird, wird ständig neue GPS-Sollposition eingelernt |
if(actualPos.GPSFix == 3 && Poti3 > 70 && Poti3 < 150 && (StickNick > 12 || StickNick < -12 || StickRoll > 12 || StickRoll < -12)) |
{ |
GPS_Nick = 0; //wird genullt, damit das letzte GPS Kommando nicht ständig gegen den Piloten ansteuert |
GPS_Roll = 0; //wird genullt, damit das letzte GPS Kommando nicht ständig gegen den Piloten ansteuert |
Soll_Position_North = NORTH_MITTEL; // Soll-Position wird geschrieben |
Soll_Position_East = EAST_MITTEL; // Soll-Position wird geschrieben |
//++++++++++++++++++++++++++++++++++++ |
//Sorgt lediglich dafür, dass die LED2 langsam blinkt. Dauer ist durch die "> x" Abfrage festgelegt |
//++++++++++++++++++++++++++++++++++++ |
if(blinkcount_LED2 >= 200) // maximal erlaubt 255 wegen unsigned char |
{ |
LED2_FLASH; |
blinkcount_LED2 = 0; |
} |
blinkcount_LED2++; |
//++++++++++++++++++++++++++++++++++++ |
} |
// wenn 3D-Fix, Schalter im mittleren Bereich (oder höher), neuer Mittelwert vorhanden, wenigstens einmal Sollposition gelernt und der Pilot nicht selbst steuert wird eine GPS-Funktion aktiviert |
if (actualPos.GPSFix == 3 && Poti3 > 70 && NeuerMittelwert == 1 && Soll_Position_North != 0 && Soll_Position_East != 0 && StickNick <= 12 && StickNick >= -12 && StickRoll <= 12 && StickRoll >= -12) |
{ |
//Berechnung der GPS-Positionsabweichung je nach aktivierter GPS-Funktion (GPS_HOLD oder HOMING) |
//DYNAMISCHES GPS-HOLD, wenn Schalter noch in Mittelstellung ist wird die zuletzt gelernte Soll_Position angeflogen |
if(Poti3 < 150) |
{ |
GPS_Positionsabweichung_North = (Soll_Position_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (Soll_Position_East - EAST_MITTEL); |
LED2_ON; |
} |
//andernfalls, wenn Schalter in max. Stellung und zusätzlich die GPS_Home_Positionen beim Motorenstarten gelernt |
//werden konnten, wird zur GPS_Home_Position geflogen |
if (Poti3 >= 150 && GPS_Home_North != 0 && GPS_Home_East != 0) |
{ |
GPS_Positionsabweichung_North = (GPS_Home_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (GPS_Home_East - EAST_MITTEL); |
// durch das ständige Neulernen der Soll_Positionen während HOMING wird erreicht, dass der MK nach dem Umschalten |
// von HOMING zurück zu GPS-HOLD nicht wieder an die alte Soll_Position zurück fliegt |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
LED2_ON; |
} |
//verhindert, dass beim Umschalten von Mittelstellung (GPS_HOLD) auf Maximalstellung (HOMING) OHNE gelernte Homeposition |
//die GPS Funktion unkontrolliert steuert. Daher wird GPS_HOLD aktiv gehalten, die Sollpositon wird bei Stickbefehlen |
//jedoch nicht wie beim dynamischen GPS_HOLD überschrieben. Zusätzlich wird der Summer eingeschaltet. |
if (Poti3 >= 150 && GPS_Home_North == 0 && GPS_Home_East == 0) |
{ |
GPS_Positionsabweichung_North = (Soll_Position_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (Soll_Position_East - EAST_MITTEL); |
LED2_ON; |
beeptime = 50; |
} |
//GPS-Geschwindigkeiten |
GPS_Geschwindigkeit_North = actualPos.velNorth; //actualPos.velNorth ist die Geschwindigkeiten aus dem GPS Empfänger entlang der Nord-Süd Richtung |
GPS_Geschwindigkeit_East = actualPos.velEast; //actualPos.velEast ist die Geschwindigkeiten aus dem GPS Empfänger entlang der Ost-West Richtung |
//Berechnung der Einzelkomponenten des PD-Reglers |
P_Einfluss_North = (P_GPS_Verstaerkung * GPS_Positionsabweichung_North)*0.0005; //entspricht einer Skalierung von 1/2000 |
D_Einfluss_North = (D_GPS_Verstaerkung * GPS_Geschwindigkeit_North)*0.00333; //entspricht einer Skalierung von 1/300 |
P_Einfluss_East = (P_GPS_Verstaerkung * GPS_Positionsabweichung_East)*0.0005; //entspricht einer Skalierung von 1/2000 |
D_Einfluss_East = (D_GPS_Verstaerkung * GPS_Geschwindigkeit_East)*0.00333; //entspricht einer Skalierung von 1/300 |
// Begrenzung des maximalen D-Anteils für pos. und neg. Werte. Grenze muss so geählt werden, |
// dass das Limit im normalen Position-Hold nicht erreicht wird und somit keinen Einfluss hat. |
// Grund: Beim Zufliegen auf weiter entfernte Ziele bremst der D-Anteil kurz vor dem Ziel den Mikrokopter sehr stark ab. |
// Dieses Limit wirkt nur, wenn sich der MK im HOMING Modus befindet und sich noch weit (>2,5m) von der Home-Position weg befindet. |
if (Poti3 >= 150 && GPS_Home_North != 0 && GPS_Home_East != 0 && (abs(GPS_Positionsabweichung_North) > 250 || abs(GPS_Positionsabweichung_East) > 250)) |
{ |
if (D_Einfluss_North > Limit_D_Anteil) D_Einfluss_North = Limit_D_Anteil; |
if (D_Einfluss_East > Limit_D_Anteil) D_Einfluss_East = Limit_D_Anteil; |
if (D_Einfluss_North < -1 * Limit_D_Anteil) D_Einfluss_North = -1 * Limit_D_Anteil; |
if (D_Einfluss_East < -1 * Limit_D_Anteil) D_Einfluss_East = -1 * Limit_D_Anteil; |
} |
// PD-Regler |
GPS_North = (-P_Einfluss_North + D_Einfluss_North); |
GPS_East = (P_Einfluss_East - D_Einfluss_East); |
//Umrechnen vom globalen North- bzw. East- in das körperfeste X- bzw. Y- Koordinatensystem |
GPS_Nick = (-c_sin[KompassValue]*0.001*GPS_East + c_cos[KompassValue]*0.001*GPS_North); // die "0" kann später durch den Messwert des Kompasssensors (KompassValue/0.01745329251) ersetzt werden |
GPS_Roll = (c_cos[KompassValue]*0.001*GPS_East + c_sin[KompassValue]*0.001*GPS_North); // die "0" kann später durch den Messwert des Kompasssensors (KompassValue/180*3.1415926535) ersetzt werden |
// Begrenzung des maximalen GPS Einflusses für positive und negative Werte |
if (GPS_Nick > 35) GPS_Nick = 35; |
if (GPS_Roll > 35) GPS_Roll = 35; |
if (GPS_Nick < -35) GPS_Nick = -35; |
if (GPS_Roll < -35) GPS_Roll = -35; |
//Funktion wird dadurch nur alle 250 ms aufgerufen, wenn neue Mittelwerte aus den GPS-Daten vorliegen. |
//FUNKTIONIERT MOMENTAN NOCH NICHT, DA STÄNDIG OHNE UNTERBRECHUNG NEUE MITTELWERTE BERECHNET WERDEN. |
//GRUND: DIE ABFRAGE NACH NEUE GPS-DATEN ERFOLGT NOCH NICHT |
NeuerMittelwert = 0; |
} |
} |
======= |
void GPS_BerechneZielrichtung(void) |
{ |
GPS_Nick = 0; |
GPS_Roll = 0; |
} |
>>>>>>> 1.1.14.1 |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/GPS_WAYPOINTS.c |
---|
0,0 → 1,357 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 08.2007 by THE BOSCH TEAM |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
#include "math.h" |
//Sinusfunktion von 0° bis 359°. Ergebnis wurde mit 1000 multipliziert, damit als Definition platzsparend int |
//verwendet werden kann. d.h., es muss also in der späteren Berechnung noch mit 0,001 multipliziert werden //(090907Kr) |
const int c_sin[] = {0,17,34,52,69,87,104,121,139,156,173,190, |
207,224,241,258,275,292,309,325,342,358,374,390,406,422,438,453,469,484,500,515,529,544,559,573,587,601,615,629, |
642,656,669,682,694,707,719,731,743,754,766,777,788,798,809,819,829,838,848,857,866,874,882,891,898,906,913,920, |
927,933,939,945,951,956,961,965,970,974,978,981,984,987,990,992,994,996,997,998,999,999,1000,999,999,998,997,996, |
994,992,990,987,984,981,978,974,970,965,961,956,951,945,939,933,927,920,913,906,898,891,882,874,866,857,848,838, |
829,819,809,798,788,777,766,754,743,731,719,707,694,682,669,656,642,629,615,601,587,573,559,544,529,515,500,484, |
469,453,438,422,406,390,374,358,342,325,309,292,275,258,241,224,207,190,173,156,139,121,104,87,69,52,34,17,0,-17, |
-34,-52,-69,-87,-104,-121,-139,-156,-173,-190,-207,-224,-241,-258,-275,-292,-309,-325,-342,-358,-374,-390,-406, |
-422,-438,-453,-469,-484,-500,-515,-529,-544,-559,-573,-587,-601,-615,-629,-642,-656,-669,-682,-694,-707,-719, |
-731,-743,-754,-766,-777,-788,-798,-809,-819,-829,-838,-848,-857,-866,-874,-882,-891,-898,-906,-913,-920,-927, |
-933,-939,-945,-951,-956,-961,-965,-970,-974,-978,-981,-984,-987,-990,-992,-994,-996,-997,-998,-999,-999,-1000, |
-999,-999,-998,-997,-996,-994,-992,-990,-987,-984,-981,-978,-974,-970,-965,-961,-956,-951,-945,-939,-933,-927, |
-920,-913,-906,-898,-891,-882,-874,-866,-857,-848,-838,-829,-819,-809,-798,-788,-777,-766,-754,-743,-731,-719, |
-707,-694,-682,-669,-656,-642,-629,-615,-601,-587,-573,-559,-544,-529,-515,-500,-484,-469,-453,-438,-422,-406, |
-390,-374,-358,-342,-325,-309,-292,-275,-258,-241,-224,-207,-190,-173,-156,-139,-121,-104,-87,-69,-52,-34,-17}; |
//Cosinusfunktion von 0° bis 359°. Ergebnis wurde mit 1000 multipliziert, damit als Definition platzsparend int |
//verwendet werden kann. D.h., es muss also in der späteren Berechnung noch mit 0,001 multipliziert werden //(090907Kr) |
const int c_cos[] = {1000,999,999,998,997,996,994,992,990,987,984,981, |
978,974,970,965,961,956,951,945,939,933,927,920,913,906,898,891,882,874,866,857,848,838,829,819,809,798,788,777, |
766,754,743,731,719,707,694,682,669,656,642,629,615,601,587,573,559,544,529,515,500,484,469,453,438,422,406,390, |
374,358,342,325,309,292,275,258,241,224,207,190,173,156,139,121,104,87,69,52,34,17,0,-17,-34,-52,-69,-87,-104, |
-121,-139,-156,-173,-190,-207,-224,-241,-258,-275,-292,-309,-325,-342,-358,-374,-390,-406,-422,-438,-453,-469, |
-484,-500,-515,-529,-544,-559,-573,-587,-601,-615,-629,-642,-656,-669,-682,-694,-707,-719,-731,-743,-754,-766, |
-777,-788,-798,-809,-819,-829,-838,-848,-857,-866,-874,-882,-891,-898,-906,-913,-920,-927,-933,-939,-945,-951, |
-956,-961,-965,-970,-974,-978,-981,-984,-987,-990,-992,-994,-996,-997,-998,-999,-999,-1000,-999,-999,-998,-997, |
-996,-994,-992,-990,-987,-984,-981,-978,-974,-970,-965,-961,-956,-951,-945,-939,-933,-927,-920,-913,-906,-898, |
-891,-882,-874,-866,-857,-848,-838,-829,-819,-809,-798,-788,-777,-766,-754,-743,-731,-719,-707,-694,-682,-669, |
-656,-642,-629,-615,-601,-587,-573,-559,-544,-529,-515,-500,-484,-469,-453,-438,-422,-406,-390,-374,-358,-342, |
-325,-309,-292,-275,-258,-241,-224,-207,-190,-173,-156,-139,-121,-104,-87,-69,-52,-34,-17,0,17,34,52,69,87, |
104,121,139,156,173,190,207,224,241,258,275,292,309,325,342,358,374,390,406,422,438,453,469,484,500,515,529,544, |
559,573,587,601,615,629,642,656,669,682,694,707,719,731,743,754,766,777,788,798,809,819,829,838,848,857,866,874, |
882,891,898,906,913,920,927,933,939,945,951,956,961,965,970,974,978,981,984,987,990,992,994,996,997,998,999,999}; |
long Soll_Position_North = 0; |
long Soll_Position_East = 0; |
long GPS_Positionsabweichung_North = 0; |
long GPS_Positionsabweichung_East = 0; |
long GPS_Geschwindigkeit_North = 0; |
long GPS_Geschwindigkeit_East = 0; |
long P_Einfluss_North = 0; |
long D_Einfluss_North = 0; |
long P_Einfluss_East = 0; |
long D_Einfluss_East = 0; |
signed int GPS_North = 0; |
signed int GPS_East = 0; |
signed int GPS_Nick = 0; |
signed int GPS_Roll = 0; |
volatile char gethome = 0; //Flag ob GPS_Home_Position gelernt ist //(280807Kr) |
long GPS_Home_North = 0; |
long GPS_Home_East = 0; |
unsigned char blinkcount_LED2 = 0; //Hilfszähler für die blinkende LED (010907Kr) |
//*********************************************************************** |
// Waypoints |
volatile char gotwaypoint = 0; //Flag für das Einlernen eines neuen Waypoints //(120907Kr) |
unsigned char waypointindex = 0; //wird beim Lernen der Waypoints als Index zum Durchzählen verwendet |
unsigned char waypointnummer = 0; //zählt im "Waypoint-Abflug-Modus" durch die gespeicherten Waypoints durch |
#define waypointanzahl 5 // Maximal mögliche Anzahl der lernbaren Waypoints wird festgelegt |
long waypoints_north[waypointanzahl]; // Definition für die Waypoints in Nordrichtung |
long waypoints_east[waypointanzahl]; // Definition für die Waypoints in Ostrichtung |
//*********************************************************************** |
//**************************** MIRCOS DEFINITIONSANFANG FÜR DIE FILTERUNG |
// Filterung der GPS Messwerte vom Ublox-Empfänger. Es wird der gleitende Durchschnitt aus n Messwerten gebildet |
#define MITTELWERTZAHL 8 // Anzahl der Messwerte fuer gleitenden Mittelwert |
volatile char NeuerMittelwert = 0; //Flag ob ein neuer Mittelwert vorliegt, der mit 4 Hz berechnet wird, da nur dann neue Messwerte vom GPS vorliegen |
volatile unsigned char FilterPos = 0; |
volatile long NORTH_MITTEL = 0; |
volatile long EAST_MITTEL = 0; |
volatile long long NORTH_LONG_LONG = 0; |
volatile long long EAST_LONG_LONG = 0; |
volatile int filterfilled = 0; |
typedef struct { |
long NORTH[MITTELWERTZAHL]; |
} FILTER_NORTH; // Filterdefinition für die Positions-Nordwerte aus dem GPS-Empfänger |
typedef struct { |
long EAST[MITTELWERTZAHL]; |
} FILTER_EAST; // Filterdefinition für die Positions-Ostwerte aus dem GPS-Empfänger |
FILTER_NORTH filter_north; |
FILTER_EAST filter_east; |
//**************************** MIRCOS DEFINITIONSENDE FÜR DIE FILTERUNG |
void gps_main(void) |
{ |
//**************************** MIRCOS FILTERUNG ANFANG |
// if(actualPos.GPSFix == 3 && actualPos.newData == 1) //bilde neuen Positionsmittelwert, wenn 3D-Fix und neue GPS-Daten vorliegen |
if(actualPos.GPSFix == 3) // hier auskommentieren, wenn dauernd (also nicht nur alle 250ms) die GPS-Berechnung durchgeführt werden soll |
{ |
filter_north.NORTH[FilterPos] = actualPos.northing; |
filter_east.EAST[FilterPos] = actualPos.easting; |
FilterPos++; |
if (FilterPos==MITTELWERTZAHL) FilterPos=0; |
if (filterfilled<MITTELWERTZAHL) filterfilled++; |
NORTH_LONG_LONG = 0; |
EAST_LONG_LONG = 0; |
for (int i=0; i<filterfilled; i++) |
{ |
NORTH_LONG_LONG += filter_north.NORTH[i]; |
EAST_LONG_LONG += filter_east.EAST[i]; |
} |
NORTH_LONG_LONG /= filterfilled; |
EAST_LONG_LONG /= filterfilled; |
NORTH_MITTEL = NORTH_LONG_LONG; |
EAST_MITTEL = EAST_LONG_LONG; |
NeuerMittelwert = 1; |
//actualPos.newData = 0; // hier auskommentieren, wenn dauernd (also nicht nur alle 250ms) die GPS-Berechnung durchgeführt werden soll |
} |
//******************************* MIRCOS FILTERUNG ENDE |
//******************************* WAYPOINTS EINLERNEN ANFANG |
//einlernen der Waypoints wenn 3D-Fix und Poti5 in MIN-Stellung |
if(actualPos.GPSFix == 3 && Poti5 < 70 && gotwaypoint == 0) |
{ |
waypoints_north[waypointindex] = actualPos.northing; |
waypoints_east[waypointindex] = actualPos.easting; |
gotwaypoint = 1; |
beeptime = 50; // kurzes Piepen um das Waypointlernen zu quittieren |
if(waypointindex < 100) // verhindert ein Überlaufen von waypoints_north bzw. _east |
{ |
waypointindex++; |
} |
} |
if(Poti5 > 70 && Poti5 < 150) |
{ |
gotwaypoint = 0; //ermöglicht ein erneutes Lernen eines Waypoints für die nächste Minstellung von Poti5 |
} |
//******************************* WAYPOINTS EINLERNEN ENDE |
//wenn kein 3D-Fix vorhanden, über das Poti jedoch irgendeine GPS Funktion aktiv ist, werden die GPS-Steuerbefehle |
//auf Null gesetzt, um unkontrolliertes Wegfliegen durch das GPS zu verhindern. Dadurch wird abgesichert |
//(auch im laufenden Flug), dass bei einem Verlust der GPS-Verbindung GPS deaktivert wird |
if (actualPos.GPSFix < 3 && Poti6 > 70) |
{ |
GPS_Nick = 0; |
GPS_Roll = 0; |
LED2_OFF; |
beeptime = 50; |
} |
// speichert die GPS_Home_Position beim 3D-Fix, MotorEINschalten und wenn noch nicht zu weit weggeflogen wurde |
// (modell_fliegt_gps < 2000) einmalig ab. Die Flugzeitabfrage sichert ab, dass bei einem Losfliegen ohne 3D-Fix die Home_Positinen |
// irgendwann später dort gelernt werden, wo dann zu ersten mal ein 3D-Fix vorhanden ist |
if (actualPos.GPSFix == 3 && MotorenEin == 1 && gethome == 0 && modell_fliegt_gps < 2000) |
{ |
GPS_Home_North = NORTH_MITTEL; |
GPS_Home_East = EAST_MITTEL; |
// Muss hier auch eingelernt werden, damit falls das Poti6 beim Motorenstarten in |
// Mittelstellung sein sollte, trotzdem schon eine Sollposition vorliegt. Andernfalls würde |
// GPS_Nick und _Roll maximal werden bis zum ersten Mal Stick_Nick und _Roll gesteuert würde |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
beeptime = 50; |
gethome = 1; |
} |
//löscht die GPS_Home_Position beim MotorAUSschalten wieder und resetet das Flag gethome //(280807Kr) |
if (MotorenEin == 0) |
{ |
GPS_Home_North = 0; |
GPS_Home_East = 0; |
gethome = 0; |
modell_fliegt_gps = 0; |
waypointindex = 0; //Zähler für die Waypoints wird beim Motorausschalten zurück gesetzt |
waypointnummer = 0; // Zähler fürs Abfliegen der Waypoints muss auch zurückgesetzt werden |
for (int i=0; i<100; i++) //zusätzlich werden alle gelernten Waypoints hier gelöscht |
{ |
waypoints_north[i] = 0; |
waypoints_east[i] = 0; |
} |
} |
// wenn Schalter ausgeschaltet, dann wird die LED2 ausgeschaltet und das GPS Steuerkommando gelöscht |
if(Poti6 < 70) |
{ |
// Sollpositionen müssen auch hier beschrieben werden, damit ausgeschlossen ist, dass falls gelandet wird und die GPS-Funktion |
// über Poti6 deaktivert und anschließend wieder aktiviert wird keine Soll-Positionen vorliegen. |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
GPS_Nick = 0; |
GPS_Roll = 0; |
LED2_OFF; |
} |
// wenn 3D-Fix, Schalter im mittleren Bereich und vom Pilot gesteuert wird, wird ständig neue GPS-Sollposition eingelernt |
if(actualPos.GPSFix == 3 && Poti6 > 70 && Poti6 < 150 && (StickNick > 12 || StickNick < -12 || StickRoll > 12 || StickRoll < -12)) |
{ |
GPS_Nick = 0; //wird genullt, damit das letzte GPS Kommando nicht ständig gegen den Piloten ansteuert |
GPS_Roll = 0; //wird genullt, damit das letzte GPS Kommando nicht ständig gegen den Piloten ansteuert |
Soll_Position_North = NORTH_MITTEL; // Soll-Position wird geschrieben |
Soll_Position_East = EAST_MITTEL; // Soll-Position wird geschrieben |
//++++++++++++++++++++++++++++++++++++ |
//Sorgt lediglich dafür, dass die LED2 langsam blinkt. Dauer ist durch die "> x" Abfrage festgelegt |
//++++++++++++++++++++++++++++++++++++ |
if(blinkcount_LED2 >= 200) // maximal erlaubt 255 wegen unsigned char |
{ |
LED2_FLASH; |
blinkcount_LED2 = 0; |
} |
blinkcount_LED2++; |
//++++++++++++++++++++++++++++++++++++ |
} |
// wenn 3D-Fix, Schalter im mittleren Bereich (oder höher), neuer Mittelwert vorhanden, wenigstens einmal Sollposition gelernt und der Pilot nicht selbst steuert wird eine GPS-Funktion aktiviert |
if (actualPos.GPSFix == 3 && Poti6 > 70 && NeuerMittelwert == 1 && Soll_Position_North != 0 && Soll_Position_East != 0 && StickNick <= 12 && StickNick >= -12 && StickRoll <= 12 && StickRoll >= -12) |
{ |
//Berechnung der GPS-Positionsabweichung je nach aktivierter GPS-Funktion (GPS_HOLD, WAYPOINT oder HOMING) |
//DYNAMISCHES GPS-HOLD oder WAYPOINTS, je nach Kombination aus Poti6 (Mitte) und Poti5 |
if(Poti6 < 150) |
{ |
// wenn Poti5 in Mittel-Stellung ODER noch gar keine Waypoints gelernt wird GPS-HOLD aktiviert |
if(Poti5 < 150 || (waypoints_north[0] == 0 && waypoints_east[0] == 0)) |
{ |
GPS_Positionsabweichung_North = (Soll_Position_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (Soll_Position_East - EAST_MITTEL); |
LED2_ON; |
} |
// wenn Poti5 in Max-Stellung und mindestens ein Waypoint eingelernt wurde wird WAYPOINTS aktiviert |
if (Poti5 >= 150 && waypoints_north[0] != 0 && waypoints_east[0] != 0) |
{ |
GPS_Positionsabweichung_North = (waypoints_north[waypointnummer] - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (waypoints_east[waypointnummer] - EAST_MITTEL); |
// durch das ständige Neulernen der Soll_Positionen während WAYPOINTS wird erreicht, dass der MK nach dem Umschalten |
// von WAYPOINTS zurück zu GPS-HOLD nicht wieder an die alte Soll_Position zurück fliegt |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
LED2_ON; |
//wenn die Positionsabweichung kleiner als 150cm und noch ein weiterer eingelernter Waypoint vorhanden ist, wird dieser angeflogen |
if (GPS_Positionsabweichung_North < 150 && GPS_Positionsabweichung_East < 150 && waypointnummer <= waypointindex) |
{ |
waypointnummer++; |
beeptime = 50; |
} |
} |
} |
//andernfalls, wenn Schalter in max. Stellung und zusätzlich die GPS_Home_Positionen beim Motorenstarten gelernt |
//werden konnten, wird zur GPS_Home_Position geflogen |
if (Poti6 >= 150 && GPS_Home_North != 0 && GPS_Home_East != 0) |
{ |
GPS_Positionsabweichung_North = (GPS_Home_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (GPS_Home_East - EAST_MITTEL); |
// durch das ständige Neulernen der Soll_Positionen während HOMING wird erreicht, dass der MK nach dem Umschalten |
// von HOMING zurück zu GPS-HOLD nicht wieder an die alte Soll_Position zurück fliegt |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
LED2_ON; |
} |
//verhindert, dass beim Umschalten von Mittelstellung (GPS_HOLD) auf Maximalstellung (HOMING) OHNE gelernte Homeposition |
//die GPS Funktion unkontrolliert steuert. Daher wird GPS_HOLD aktiv gehalten, die Sollpositon wird bei Stickbefehlen |
//jedoch nicht wie beim dynamischen GPS_HOLD überschrieben. Zusätzlich wird der Summer eingeschaltet. |
if (Poti6 >= 150 && GPS_Home_North == 0 && GPS_Home_East == 0) |
{ |
GPS_Positionsabweichung_North = (Soll_Position_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (Soll_Position_East - EAST_MITTEL); |
LED2_ON; |
beeptime = 50; |
} |
//GPS-Geschwindigkeiten |
GPS_Geschwindigkeit_North = actualPos.velNorth; //actualPos.velNorth ist die Geschwindigkeiten aus dem GPS Empfänger entlang der Nord-Süd Richtung |
GPS_Geschwindigkeit_East = actualPos.velEast; //actualPos.velEast ist die Geschwindigkeiten aus dem GPS Empfänger entlang der Ost-West Richtung |
//Berechnung der Einzelkomponenten des PD-Reglers |
P_Einfluss_North = (P_GPS_Verstaerkung * GPS_Positionsabweichung_North)*0.0005; //entspricht einer Skalierung von 1/2000 |
D_Einfluss_North = (D_GPS_Verstaerkung * GPS_Geschwindigkeit_North)*0.00333; //entspricht einer Skalierung von 1/300 |
P_Einfluss_East = (P_GPS_Verstaerkung * GPS_Positionsabweichung_East)*0.0005; //entspricht einer Skalierung von 1/2000 |
D_Einfluss_East = (D_GPS_Verstaerkung * GPS_Geschwindigkeit_East)*0.00333; //entspricht einer Skalierung von 1/300 |
// Begrenzung des maximalen D-Einflusses für positive und negative Werte. Grenze muss so geählt werden, |
// dass das Limit im normalen Position-Hold nicht erreicht wird und somit keinen Einfluss hat. |
// Grund: Beim Zufliegen auf weiter entfernte Ziele bremst der D-Anteil kurz vor dem Ziel den Mikrokopter sehr stark ab. |
if (D_Einfluss_North > Limit_D_Anteil) D_Einfluss_North = Limit_D_Anteil; |
if (D_Einfluss_East > Limit_D_Anteil) D_Einfluss_East = Limit_D_Anteil; |
if (D_Einfluss_North < -1 * Limit_D_Anteil) D_Einfluss_North = -1 * Limit_D_Anteil; |
if (D_Einfluss_East < -1 * Limit_D_Anteil) D_Einfluss_East = -1 * Limit_D_Anteil; |
// PD-Regler |
GPS_North = (-P_Einfluss_North + D_Einfluss_North); |
GPS_East = (P_Einfluss_East - D_Einfluss_East); |
//Umrechnen vom globalen North- bzw. East- in das körperfeste X- bzw. Y- Koordinatensystem |
GPS_Nick = (-c_sin[KompassValue]*0.001*GPS_East + c_cos[KompassValue]*0.001*GPS_North); // die "0" kann später durch den Messwert des Kompasssensors (KompassValue/0.01745329251) ersetzt werden |
GPS_Roll = (c_cos[KompassValue]*0.001*GPS_East + c_sin[KompassValue]*0.001*GPS_North); // die "0" kann später durch den Messwert des Kompasssensors (KompassValue/180*3.1415926535) ersetzt werden |
// Begrenzung des maximalen GPS Einflusses für positive und negative Werte |
if (GPS_Nick > 35) GPS_Nick = 35; |
if (GPS_Roll > 35) GPS_Roll = 35; |
if (GPS_Nick < -35) GPS_Nick = -35; |
if (GPS_Roll < -35) GPS_Roll = -35; |
//Funktion wird dadurch nur alle 250 ms aufgerufen, wenn neue Mittelwerte aus den GPS-Daten vorliegen. |
//FUNKTIONIERT MOMENTAN NOCH NICHT, DA STÄNDIG OHNE UNTERBRECHUNG NEUE MITTELWERTE BERECHNET WERDEN. |
//GRUND: DIE ABFRAGE NACH NEUE GPS-DATEN ERFOLGT NOCH NICHT |
NeuerMittelwert = 0; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/License.txt |
---|
0,0 → 1,52 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + Nur für den privaten Gebrauch |
// + www.MikroKopter.com |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
// + dass eine Nutzung (auch auszugsweise) nur für den privaten und nichtkommerziellen Gebrauch zulässig ist. |
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
// + bzgl. der Nutzungsbedingungen aufzunehmen. |
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
// + Verkauf von Luftbildaufnahmen, usw. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
// + eindeutig als Ursprung verlinkt und genannt werden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
// + Benutzung auf eigene Gefahr |
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
// + mit unserer Zustimmung zulässig |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
// + this list of conditions and the following disclaimer. |
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
// + from this software without specific prior written permission. |
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
// + for non-profit use (directly or indirectly) |
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
// + with our written permission |
// + * If sources or documentations are redistributet, our webpage (http://www.MikroKopter.de) must be |
// + clearly linked and named as origin |
// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/MIKROKOPTER_TO_DO.txt |
---|
0,0 → 1,11 |
. Patricks neigungskompensierten Kompass |
. Aufruf der GPS.c innerhalb der fc.c nur wenn neue Daten vorliegen |
. innerhalb der GPS.c den PD-Regler nicht mit "NeuerMittelwert", sondern mit "actualpos.newdata" alle 250ms aufrufen |
. GPS-Empfänger auf 5Hz einstellen |
. Begrenzung von 35 auf 50 anheben, damit auch bei stärkerem Wind geflogen werden kann |
. Waypoints |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/P_ und D_Faktoren.txt |
---|
0,0 → 1,3 |
P: 120 |
D: 90 |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/Settings.h |
---|
--- alpha/v060JokoKompassNick666MM3Acc/_Settings.h (nonexistent) |
+++ alpha/v060JokoKompassNick666MM3Acc/_Settings.h (revision 2762) |
@@ -0,0 +1,50 @@ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Testmodi |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define MOTOR_OFF 0 |
+#define MOTOR_TEST 0 |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Abstimmung |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define ACC_AMPLIFY 16 |
+#define FAKTOR_P 1 |
+#define FAKTOR_I 0.0001 |
+ |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Debug-Interface |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define SIO_DEBUG 1 // Soll der Debugger aktiviert sein? |
+#define MIN_DEBUG_INTERVALL 250 // in diesem Intervall werden Degugdaten ohne Aufforderung gesendet |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Sender |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ #define K_NICK 0 |
+ #define K_ROLL 1 |
+ #define K_GAS 2 |
+ #define K_GIER 3 |
+ #define K_POTI1 4 |
+ #define K_POTI2 5 |
+ #define K_POTI3 6 |
+ #define K_POTI4 7 |
+// +++++++++++++++++++++++++++++++ |
+// + Getestete Settings: |
+// +++++++++++++++++++++++++++++++ |
+// Setting: Kamera |
+// Stick_P:3 |
+// Stick_D:0 |
+// Gyro_P: 175 |
+// Gyro_I: 175 |
+// Ki_Anteil: 10 |
+// +++++++++++++++++++++++++++++++ |
+// + Getestete Settings: |
+// +++++++++++++++++++++++++++++++ |
+// Setting: Normal |
+// Stick_P:2 |
+// Stick_D:8 |
+// Gyro_P: 80 |
+// Gyro_I: 150 |
+// Ki_Anteil: 5 |
+ |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/analog.c |
---|
0,0 → 1,155 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
volatile int Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az, UBat = 100; |
volatile int AccumulateNick = 0, AccumulateRoll = 0, AccumulateGier = 0; |
volatile int accumulate_AccRoll = 0,accumulate_AccNick = 0,accumulate_AccHoch = 0; |
volatile char MessanzahlNick = 0, MessanzahlRoll = 0, MessanzahlGier = 0; |
volatile char messanzahl_AccNick = 0, messanzahl_AccRoll = 0, messanzahl_AccHoch = 0; |
volatile long Luftdruck = 32000; |
volatile int StartLuftdruck; |
volatile unsigned int MessLuftdruck = 1023; |
unsigned char DruckOffsetSetting; |
volatile int HoeheD = 0; |
volatile char messanzahl_Druck; |
volatile int tmpLuftdruck; |
volatile unsigned int ZaehlMessungen = 0; |
//####################################################################################### |
// |
void ADC_Init(void) |
//####################################################################################### |
{ |
ADMUX = 0;//Referenz ist extern |
ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE); |
//Free Running Mode, Division Factor 128, Interrupt on |
} |
void SucheLuftruckOffset(void) |
{ |
unsigned int off; |
for(off=0; off < 250;off++) |
{ |
OCR0A = off; |
Delay_ms(50); |
printf("."); |
if(MessLuftdruck < 900) break; |
} |
DruckOffsetSetting = off; |
Delay_ms(200); |
} |
//####################################################################################### |
// |
SIGNAL(SIG_ADC) |
//####################################################################################### |
{ |
static unsigned char kanal=0,state = 0; |
signed int wert; |
ANALOG_OFF; |
switch(state++) |
{ |
case 0: |
wert = (signed int) AdNeutralGier - ADC; |
AccumulateGier += wert; // |
MessanzahlGier++; |
Mess_Integral_Gier += wert;// / 16; |
Mess_Integral_Gier2 += wert; |
kanal = 1; |
ZaehlMessungen++; |
break; |
case 1: |
wert = (signed int) ADC - AdNeutralRoll; |
Mess_IntegralRoll += wert; |
Mess_IntegralRoll2 += wert; |
if(ADC < 10) wert = -700; |
if(ADC > 1000) wert = +700; |
AccumulateRoll += wert; |
MessanzahlRoll++; |
kanal = 2; |
break; |
case 2: |
wert = (signed int) ADC - AdNeutralNick; |
Mess_IntegralNick += wert; |
Mess_IntegralNick2 += wert; |
if(ADC < 10) wert = -700; |
if(ADC > 1000) wert = +700; |
AccumulateNick += wert; |
MessanzahlNick++; |
kanal = 4; |
break; |
case 3: |
UBat = (3 * UBat + ADC / 3) / 4;//(UBat + ((ADC * 39) / 256) + 19) / 2; |
kanal = 6; |
break; |
case 4: |
Aktuell_ay = NeutralAccY - ADC; |
accumulate_AccRoll += Aktuell_ay; |
messanzahl_AccRoll++; |
kanal = 7; |
break; |
case 5: |
Aktuell_ax = ADC - NeutralAccX; |
accumulate_AccNick += Aktuell_ax; |
messanzahl_AccNick++; |
kanal = 5; |
state = 6; |
break; |
case 6: |
accumulate_AccHoch = (signed int) ADC - NeutralAccZ; |
accumulate_AccHoch += abs(Aktuell_ay) / 4 + abs(Aktuell_ax) / 4; |
if(accumulate_AccHoch > 1) |
{ |
if(NeutralAccZ < 800) NeutralAccZ+= 0.02; |
} |
else if(accumulate_AccHoch < -1) |
{ |
if(NeutralAccZ > 600) NeutralAccZ-= 0.02; |
} |
messanzahl_AccHoch = 1; |
Aktuell_az = ADC; |
Mess_Integral_Hoch += accumulate_AccHoch; // Integrieren |
Mess_Integral_Hoch -= Mess_Integral_Hoch / 1024; // dämfen |
// Mess_Integral_Hoch -= Mess_Integral_Hoch / 512; // dämfen |
/* if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
kanal = 3; |
state = 7; |
} |
else |
{ |
kanal = 0; |
state = 0; |
}*/ |
kanal = 3; |
state = 7; |
break; |
case 7: |
tmpLuftdruck += ADC; |
if(++messanzahl_Druck >= 5) |
{ |
MessLuftdruck = ADC; |
messanzahl_Druck = 0; |
HoeheD = (int)(StartLuftdruck - tmpLuftdruck - HoehenWert); // D-Anteil = neuerWert - AlterWert |
Luftdruck = (tmpLuftdruck + 3 * Luftdruck) / 4; |
HoehenWert = StartLuftdruck - Luftdruck; |
tmpLuftdruck = 0; |
} |
kanal = 0; |
state = 0; |
break; |
default: |
kanal = 0; |
state = 0; |
break; |
} |
ADMUX = kanal; |
ANALOG_ON; |
} |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/analog.h |
---|
0,0 → 1,23 |
/*####################################################################################### |
#######################################################################################*/ |
extern volatile int UBat; |
extern volatile int AccumulateNick, AccumulateRoll, AccumulateGier,accumulate_AccRoll,accumulate_AccNick,accumulate_AccHoch; |
extern volatile char MessanzahlNick, MessanzahlRoll, MessanzahlGier,messanzahl_AccNick, messanzahl_AccRoll,messanzahl_AccHoch; |
extern volatile int Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az; |
extern volatile long Luftdruck; |
extern volatile char messanzahl_Druck; |
extern volatile unsigned int ZaehlMessungen; |
extern unsigned char DruckOffsetSetting; |
extern volatile int HoeheD; |
extern volatile unsigned int MessLuftdruck; |
extern volatile int StartLuftdruck; |
extern unsigned int ReadADC(unsigned char adc_input); |
extern void ADC_Init(void); |
extern void SucheLuftruckOffset(void); |
#define ANALOG_OFF ADCSRA=0 |
#define ANALOG_ON ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE) |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/compass.c |
---|
0,0 → 1,150 |
/* |
Copyright 2007, Niklas Nold |
This program (files compass.c and compass.h) is free software; you can redistribute it and/or modify |
it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; |
either version 3 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
Please note: All the other files for the project "Mikrokopter" by H. Buss are under the license (license_buss.txt) published by www.mikrokopter.de |
*/ |
#include "main.h" |
MM3_struct MM3; |
//############################################################################ |
//Initialisierung der SPI-Schnittstelle |
void init_spi(void) |
//############################################################################ |
{ |
SPCR = (1<<SPIE)|(1<<SPE)|(1<<MSTR)|(1<<SPR1)|(1<<SPR0); //Interrupt an, Master, 156 kHz Oszillator |
//SPSR = (1<<SPI2X); |
DDRB |= (1<<PB7)|(1<<PB5)|(1<<PB2); // J8, MOSI, SCK Ausgang |
PORTD &= ~(1<<PD3); // J5 auf Low |
MM3.AXIS = MM3_X; |
MM3.STATE = MM3_RESET; |
} |
//############################################################################ |
//Wird in der SIGNAL (SIG_OVERFLOW0) aufgerufen |
void MM3_timer0(void) |
//############################################################################ |
{ |
switch (MM3.STATE) |
{ |
case MM3_RESET: |
PORTB |= (1<<PB2); // J8 auf High, MM3 Reset |
MM3.STATE = MM3_START_TRANSFER; |
return; |
case MM3_START_TRANSFER: |
PORTB &= ~(1<<PB2); // J8 auf Low (war ~125 µs auf High) |
if (MM3.AXIS == MM3_X) SPDR = 0x51; // Schreiben ins SPDR löst automatisch Übertragung (MOSI und MISO) aus |
else if (MM3.AXIS == MM3_Y) SPDR = 0x52; // Micromag Period Select ist auf 1024 (0x50) |
else if (MM3.AXIS == MM3_Z) SPDR = 0x53; // 1: x-Achse, 2: Y-Achse, 3: Z-Achse |
MM3.DRDY = SetDelay(15); // Laut Datenblatt max. Zeit bis Messung fertig (bei PS 1024) |
MM3.STATE = MM3_WAIT_DRDY; |
return; |
case MM3_WAIT_DRDY: |
if (CheckDelay(MM3.DRDY)) {SPDR = 0x00;MM3.STATE = MM3_DRDY;} // Irgendwas ins SPDR, damit Übertragung ausgelöst wird, wenn Wartezeit vorbei |
return; // Jetzt gehts weiter in SIGNAL (SIG_SPI) |
case MM3_TILT: // Zeitnahe Speicherung der aktuellen Neigung in ° |
MM3.NickGrad = asin_i((float)Aktuell_ax/220*200); |
MM3.RollGrad = asin_i((float)Aktuell_ay/220*200); |
MM3.AXIS = MM3_X; |
MM3.STATE = MM3_RESET; |
return; |
} |
} |
//############################################################################ |
//SPI byte ready |
SIGNAL (SIG_SPI) |
//############################################################################ |
{ |
switch (MM3.STATE) |
{ |
case MM3_DRDY: // 1. Byte ist da, abspeichern, an die MSB-Stelle rücken |
if (MM3.AXIS == MM3_X) |
{ |
MM3.x_axis = SPDR; |
MM3.x_axis <<= 8; |
} |
else if (MM3.AXIS == MM3_Y) |
{ |
MM3.y_axis = SPDR; |
MM3.y_axis <<= 8; |
} |
else // if (MM3.AXIS == MM3_Z) |
{ |
MM3.z_axis = SPDR; |
MM3.z_axis <<= 8; |
} |
SPDR=0x00; // Übertragung von 2. Byte auslösen |
MM3.STATE=MM3_BYTE2; |
return; |
case MM3_BYTE2: // 2. Byte der entsprechenden Achse ist da |
if (MM3.AXIS == MM3_X) |
{ |
MM3.x_axis |= SPDR; |
MM3.x_axis -= OFF_X; // Sofort Offset aus der Kalibrierung berücksichtigen |
MM3.AXIS = MM3_Y; |
MM3.STATE = MM3_RESET; |
} |
else if (MM3.AXIS == MM3_Y) |
{ |
MM3.y_axis |= SPDR; |
MM3.y_axis -= OFF_Y; |
MM3.AXIS = MM3_Z; |
MM3.STATE = MM3_RESET; |
} |
else // if (MM3.AXIS == MM3_Z) |
{ |
MM3.z_axis |= SPDR; |
MM3.z_axis -= OFF_Z; |
MM3.STATE = MM3_TILT; |
} |
return; |
} |
} |
signed int MM3_heading(void) |
{ |
float sin_nick, cos_nick, sin_roll, cos_roll; |
signed int x_corr, y_corr; |
signed int heading; |
// Berechung von sinus und cosinus |
sin_nick = sin_f(MM3.NickGrad); |
cos_nick = cos_f(MM3.NickGrad); |
sin_roll = sin_f(MM3.RollGrad); |
cos_roll = cos_f(MM3.RollGrad); |
// Neigungskompensation |
x_corr = (cos_nick * MM3.x_axis) - (((sin_roll * MM3.y_axis) - (cos_roll * MM3.z_axis)) * sin_nick); |
y_corr = ((cos_roll * MM3.y_axis) + (sin_roll * MM3.z_axis)); |
// Winkelberechnung |
heading = atan2_i(x_corr, y_corr); |
return (heading); |
} |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/compass.h |
---|
0,0 → 1,41 |
typedef struct |
{ |
uint8_t STATE; |
unsigned int DRDY; |
uint8_t AXIS; |
signed int x_axis; |
signed int y_axis; |
signed int z_axis; |
signed int NickGrad; |
signed int RollGrad; |
}MM3_struct; |
extern MM3_struct MM3; |
void init_spi(void); |
void MM3_timer0(void); |
signed int MM3_heading(void); |
#define Int2Grad_Faktor 1024 |
// Die Werte der Statemachine |
#define MM3_RESET 0 |
#define MM3_START_TRANSFER 1 |
#define MM3_WAIT_DRDY 2 |
#define MM3_DRDY 4 |
#define MM3_BYTE2 8 |
#define MM3_X 16 |
#define MM3_Y 32 |
#define MM3_Z 64 |
#define MM3_TILT 128 |
// Die Werte der Kompasskalibrierung |
// OFFSET: (Maximaler Wert + minimaler Wert) / 2 |
#define OFF_X -11 |
#define OFF_Y 30 |
#define OFF_Z 18 |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/eeprom.c |
---|
--- alpha/v060JokoKompassNick666MM3Acc/fc.c (nonexistent) |
+++ alpha/v060JokoKompassNick666MM3Acc/fc.c (revision 2762) |
@@ -0,0 +1,925 @@ |
+/*####################################################################################### |
+Flight Control |
+#######################################################################################*/ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Copyright (c) 04.2007 Holger Buss |
+// + Nur für den privaten Gebrauch |
+// + www.MikroKopter.com |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
+// + dass eine Nutzung (auch auszugsweise) nur für den privaten (nicht-kommerziellen) Gebrauch zulässig ist. |
+// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
+// + bzgl. der Nutzungsbedingungen aufzunehmen. |
+// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
+// + Verkauf von Luftbildaufnahmen, usw. |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
+// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
+// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
+// + eindeutig als Ursprung verlinkt werden |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
+// + Benutzung auf eigene Gefahr |
+// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
+// + mit unserer Zustimmung zulässig |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
+// + this list of conditions and the following disclaimer. |
+// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
+// + from this software without specific prior written permission. |
+// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
+// + for non-commercial use (directly or indirectly) |
+// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
+// + with our written permission |
+// + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
+// + clearly linked as origin |
+// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
+// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
+// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
+// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
+// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
+// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
+// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
+// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
+// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
+// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
+// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
+// + POSSIBILITY OF SUCH DAMAGE. |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+#include "main.h" |
+ |
+unsigned char h,m,s; |
+volatile unsigned char Timeout = 0; |
+volatile int MesswertNick,MesswertRoll,MesswertGier; |
+volatile int AdNeutralNick = 0,AdNeutralRoll = 0,AdNeutralGier = 0; |
+volatile int Mittelwert_AccNick, Mittelwert_AccRoll,Mittelwert_AccHoch, NeutralAccX=0, NeutralAccY=0; |
+volatile float NeutralAccZ = 0; |
+unsigned char CosinusNickWinkel = 0, CosinusRollWinkel = 0; |
+volatile long IntegralNick = 0,IntegralNick2 = 0; |
+volatile long IntegralRoll = 0,IntegralRoll2 = 0; |
+volatile long Integral_Gier = 0; |
+volatile long Mess_IntegralNick = 0,Mess_IntegralNick2 = 0; |
+volatile long Mess_IntegralRoll = 0,Mess_IntegralRoll2 = 0; |
+volatile long Mess_Integral_Gier = 0,Mess_Integral_Gier2 = 0; |
+volatile long Mess_Integral_Hoch = 0; |
+volatile int KompassValue = 0; |
+volatile int KompassStartwert = 0; |
+volatile int KompassRichtung = 0; |
+unsigned char MAX_GAS,MIN_GAS; |
+unsigned char Notlandung = 0; |
+unsigned char HoehenReglerAktiv = 0; |
+ |
+unsigned char blinkcount_LED1 = 0;//Hilfszähler für die blinkende LED (310807Kr) |
+unsigned int modell_fliegt_gps = 0;//(030907Kr) |
+unsigned char Limit_D_Anteil = 0;//(210907Kr) |
+ |
+float GyroFaktor; |
+float IntegralFaktor; |
+ |
+volatile int DiffNick,DiffRoll; |
+int Poti1 = 0, Poti2 = 0, Poti3 = 0, Poti4 = 0, Poti5 = 0, Poti6 = 0, Poti7 = 0, Poti8 = 0; |
+volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
+unsigned char MotorWert[5]; |
+volatile unsigned char SenderOkay = 0; |
+int StickNick = 0,StickRoll = 0,StickGier = 0; |
+char MotorenEin = 0; |
+int HoehenWert = 0; |
+int SollHoehe = 0; |
+ |
+float Kp = FAKTOR_P; |
+float Ki = FAKTOR_I; |
+ |
+unsigned char Parameter_Luftdruck_D = 48; // Wert : 0-250 |
+unsigned char Parameter_MaxHoehe = 251; // Wert : 0-250 |
+unsigned char Parameter_Hoehe_P = 16; // Wert : 0-32 |
+unsigned char Parameter_Hoehe_ACC_Wirkung = 58; // Wert : 0-250 |
+unsigned char Parameter_KompassWirkung = 64; // Wert : 0-250 |
+unsigned char Parameter_Gyro_P = 50; // Wert : 10-250 |
+unsigned char Parameter_Gyro_I = 150; // Wert : 0-250 |
+unsigned char Parameter_Gier_P = 2; // Wert : 1-20 |
+unsigned char Parameter_I_Faktor = 10; // Wert : 1-20 |
+unsigned char Parameter_UserParam1 = 0; |
+unsigned char Parameter_UserParam2 = 0; |
+unsigned char Parameter_UserParam3 = 0; |
+unsigned char Parameter_UserParam4 = 0; |
+unsigned char Parameter_ServoNickControl = 100; |
+struct mk_param_struct EE_Parameter; |
+ |
+void Piep(unsigned char Anzahl) |
+{ |
+ while(Anzahl--) |
+ { |
+ if(MotorenEin) return; //auf keinen Fall im Flug! |
+ beeptime = 100; |
+ Delay_ms(250); |
+ } |
+} |
+ |
+//############################################################################ |
+// Nullwerte ermitteln |
+void SetNeutral(void) |
+//############################################################################ |
+{ |
+ unsigned int timer; |
+ NeutralAccX = 0; |
+ NeutralAccY = 0; |
+ NeutralAccZ = 0; |
+ AdNeutralNick = 0; |
+ AdNeutralRoll = 0; |
+ AdNeutralGier = 0; |
+ CalibrierMittelwert(); |
+ timer = SetDelay(5); |
+ while (!CheckDelay(timer)); |
+ CalibrierMittelwert(); |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
+ { |
+ if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset(); |
+ } |
+ AdNeutralNick= abs(MesswertNick); |
+ AdNeutralRoll= abs(MesswertRoll); |
+ AdNeutralGier= abs(MesswertGier); |
+ NeutralAccY = abs(Mittelwert_AccRoll) / ACC_AMPLIFY; |
+ NeutralAccX = abs(Mittelwert_AccNick) / ACC_AMPLIFY; |
+ NeutralAccZ = Aktuell_az; |
+ |
+ Mess_IntegralNick = 0; |
+ Mess_IntegralNick2 = 0; |
+ Mess_IntegralRoll = 0; |
+ Mess_IntegralRoll2 = 0; |
+ Mess_Integral_Gier = 0; |
+ MesswertNick = 0; |
+ MesswertRoll = 0; |
+ MesswertGier = 0; |
+ StartLuftdruck = Luftdruck; |
+ HoeheD = 0; |
+ Mess_Integral_Hoch = 0; |
+ KompassStartwert = KompassValue; |
+ beeptime = 50; |
+} |
+ |
+//############################################################################ |
+// Bildet den Mittelwert aus den Messwerten |
+void Mittelwert(void) |
+//############################################################################ |
+{ |
+ // ADC auschalten, damit die Werte sich nicht während der Berechnung ändern |
+ ANALOG_OFF; |
+ if(MessanzahlNick) (MesswertNick = AccumulateNick / MessanzahlNick); |
+ if(MessanzahlRoll) (MesswertRoll = AccumulateRoll / MessanzahlRoll); |
+ if(MessanzahlGier) (MesswertGier = AccumulateGier / MessanzahlGier); |
+ if(messanzahl_AccNick) Mittelwert_AccNick = ((long)Mittelwert_AccNick * 7 + ((ACC_AMPLIFY * (long)accumulate_AccNick) / messanzahl_AccNick)) / 8L; |
+ if(messanzahl_AccRoll) Mittelwert_AccRoll = ((long)Mittelwert_AccRoll * 7 + ((ACC_AMPLIFY * (long)accumulate_AccRoll) / messanzahl_AccRoll)) / 8L; |
+ if(messanzahl_AccHoch) Mittelwert_AccHoch = ((long)Mittelwert_AccHoch * 7 + ((long)accumulate_AccHoch) / messanzahl_AccHoch) / 8L; |
+ AccumulateNick = 0; MessanzahlNick = 0; |
+ AccumulateRoll = 0; MessanzahlRoll = 0; |
+ AccumulateGier = 0; MessanzahlGier = 0; |
+ accumulate_AccRoll = 0;messanzahl_AccRoll = 0; |
+ accumulate_AccNick = 0;messanzahl_AccNick = 0; |
+ accumulate_AccHoch = 0;messanzahl_AccHoch = 0; |
+ Integral_Gier = Mess_Integral_Gier; |
+// Integral_Gier2 = Mess_Integral_Gier2; |
+ IntegralNick = Mess_IntegralNick; |
+ IntegralRoll = Mess_IntegralRoll; |
+ IntegralNick2 = Mess_IntegralNick2; |
+ IntegralRoll2 = Mess_IntegralRoll2; |
+ // ADC einschalten |
+ ANALOG_ON; |
+ |
+//------------------------------------------------------------------------------ |
+ if(MesswertNick > 200) MesswertNick += 4 * (MesswertNick - 200); |
+ else |
+ if(MesswertNick < -200) MesswertNick += 4 * (MesswertNick + 200); |
+ |
+ if(MesswertRoll > 200) MesswertRoll += 4 * (MesswertRoll - 200); |
+ else |
+ if(MesswertRoll < -200) MesswertRoll += 4 * (MesswertRoll + 200); |
+//------------------------------------------------------------------------------ |
+ if(Poti1 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110) Poti1++; else if(Poti1 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110 && Poti1) Poti1--; |
+ if(Poti2 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110) Poti2++; else if(Poti2 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110 && Poti2) Poti2--; |
+ if(Poti3 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110) Poti3++; else if(Poti3 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110 && Poti3) Poti3--; |
+ if(Poti4 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110) Poti4++; else if(Poti4 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110 && Poti4) Poti4--; |
+ if(Poti5 < PPM_in[9] + 110) Poti5++; else if(Poti5 > PPM_in[9] + 110 && Poti5) Poti5--; |
+ if(Poti6 < PPM_in[10] + 110) Poti6++; else if(Poti6 > PPM_in[10] + 110 && Poti6) Poti6--; |
+ if(Poti7 < PPM_in[11] + 110) Poti7++; else if(Poti7 > PPM_in[11] + 110 && Poti7) Poti7--; |
+ if(Poti8 < PPM_in[12] + 110) Poti8++; else if(Poti8 > PPM_in[12] + 110 && Poti8) Poti8--; |
+ |
+ |
+ if(Poti1 < 0) Poti1 = 0; else if(Poti1 > 255) Poti1 = 255; |
+ if(Poti2 < 0) Poti2 = 0; else if(Poti2 > 255) Poti2 = 255; |
+ if(Poti3 < 0) Poti3 = 0; else if(Poti3 > 255) Poti3 = 255; |
+ if(Poti4 < 0) Poti4 = 0; else if(Poti4 > 255) Poti4 = 255; |
+ if(Poti5 < 0) Poti5 = 0; else if(Poti5 > 255) Poti5 = 255; |
+ if(Poti6 < 0) Poti6 = 0; else if(Poti6 > 255) Poti6 = 255; |
+ if(Poti7 < 0) Poti7 = 0; else if(Poti7 > 255) Poti7 = 255; |
+ if(Poti8 < 0) Poti8 = 0; else if(Poti8 > 255) Poti8 = 255; |
+} |
+ |
+//############################################################################ |
+// Messwerte beim Ermitteln der Nullage |
+void CalibrierMittelwert(void) |
+//############################################################################ |
+{ |
+ // ADC auschalten, damit die Werte sich nicht während der Berechnung ändern |
+ ANALOG_OFF; |
+ if(MessanzahlNick) (MesswertNick = AccumulateNick / MessanzahlNick); |
+ if(MessanzahlRoll) (MesswertRoll = AccumulateRoll / MessanzahlRoll); |
+ if(MessanzahlGier) (MesswertGier = AccumulateGier / MessanzahlGier); |
+ if(messanzahl_AccNick) Mittelwert_AccNick = ((ACC_AMPLIFY * (long)accumulate_AccNick) / messanzahl_AccNick); |
+ if(messanzahl_AccRoll) Mittelwert_AccRoll = (ACC_AMPLIFY * (long)accumulate_AccRoll) / messanzahl_AccRoll; |
+ if(messanzahl_AccHoch) Mittelwert_AccHoch = ((long)accumulate_AccHoch) / messanzahl_AccHoch; |
+ AccumulateNick = 0; MessanzahlNick = 0; |
+ AccumulateRoll = 0; MessanzahlRoll = 0; |
+ AccumulateGier = 0; MessanzahlGier = 0; |
+ accumulate_AccRoll = 0;messanzahl_AccRoll = 0; |
+ accumulate_AccNick = 0;messanzahl_AccNick = 0; |
+ accumulate_AccHoch = 0;messanzahl_AccHoch = 0; |
+ // ADC einschalten |
+ ANALOG_ON; |
+ if(Poti1 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110) Poti1++; else if(Poti1 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110 && Poti1) Poti1--; |
+ if(Poti2 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110) Poti2++; else if(Poti2 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110 && Poti2) Poti2--; |
+ if(Poti3 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110) Poti3++; else if(Poti3 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110 && Poti3) Poti3--; |
+ if(Poti4 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110) Poti4++; else if(Poti4 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110 && Poti4) Poti4--; |
+ if(Poti5 < PPM_in[9] + 110) Poti5++; else if(Poti5 > PPM_in[9] + 110 && Poti5) Poti5--; |
+ if(Poti6 < PPM_in[10] + 110) Poti6++; else if(Poti6 > PPM_in[10] + 110 && Poti6) Poti6--; |
+ if(Poti7 < PPM_in[11] + 110) Poti7++; else if(Poti7 > PPM_in[11] + 110 && Poti7) Poti7--; |
+ if(Poti8 < PPM_in[12] + 110) Poti8++; else if(Poti8 > PPM_in[12] + 110 && Poti8) Poti8--; |
+ |
+ |
+ |
+ |
+ if(Poti1 < 0) Poti1 = 0; else if(Poti1 > 255) Poti1 = 255; |
+ if(Poti2 < 0) Poti2 = 0; else if(Poti2 > 255) Poti2 = 255; |
+ if(Poti3 < 0) Poti3 = 0; else if(Poti3 > 255) Poti3 = 255; |
+ if(Poti4 < 0) Poti4 = 0; else if(Poti4 > 255) Poti4 = 255; |
+ if(Poti5 < 0) Poti5 = 0; else if(Poti5 > 255) Poti5 = 255; |
+ if(Poti6 < 0) Poti6 = 0; else if(Poti6 > 255) Poti6 = 255; |
+ if(Poti7 < 0) Poti7 = 0; else if(Poti7 > 255) Poti7 = 255; |
+ if(Poti8 < 0) Poti8 = 0; else if(Poti8 > 255) Poti8 = 255; |
+} |
+ |
+//############################################################################ |
+// Senden der Motorwerte per I2C-Bus |
+void SendMotorData(void) |
+//############################################################################ |
+{ |
+ if(MOTOR_OFF || !MotorenEin) |
+ { |
+ Motor_Hinten = 0; |
+ Motor_Vorne = 0; |
+ Motor_Rechts = 0; |
+ Motor_Links = 0; |
+ if(MotorTest[0]) Motor_Vorne = MotorTest[0]; |
+ if(MotorTest[1]) Motor_Hinten = MotorTest[1]; |
+ if(MotorTest[2]) Motor_Links = MotorTest[2]; |
+ if(MotorTest[3]) Motor_Rechts = MotorTest[3]; |
+ } |
+ |
+ // DebugOut.Analog[12] = Motor_Vorne; |
+ // DebugOut.Analog[13] = Motor_Hinten; |
+ // DebugOut.Analog[14] = Motor_Links; |
+ // DebugOut.Analog[15] = Motor_Rechts; |
+ |
+ // DebugOut.Analog[12] = motor_rx[0]; //Motorstrom vorne |
+ // DebugOut.Analog[13] = motor_rx[1]; //Motorstrom hinten |
+ // DebugOut.Analog[14] = motor_rx[2]; //Motorstrom links |
+ // DebugOut.Analog[15] = motor_rx[3]; //Motorstrom rechts |
+ // DebugOut.Analog[14] = (motor_rx[0]+motor_rx[1]+motor_rx[2]+motor_rx[3])/4; //Mittelwert aller Motorenströme |
+ // DebugOut.Analog[15] = motor_rx[0]+motor_rx[1]+motor_rx[2]+motor_rx[3]; //Gesamtstrom aller Motoren |
+ |
+ //Start I2C Interrupt Mode |
+ twi_state = 0; |
+ motor = 0; |
+ i2c_start(); |
+} |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Konstanten |
+// + 0-250 -> normale Werte |
+// + 251 -> Poti1 |
+// + 252 -> Poti2 |
+// + 253 -> Poti3 |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+void DefaultKonstanten1(void) |
+{ |
+ EE_Parameter.Kanalbelegung[K_NICK] = 3; |
+ EE_Parameter.Kanalbelegung[K_ROLL] = 2; |
+ EE_Parameter.Kanalbelegung[K_GAS] = 1; |
+ EE_Parameter.Kanalbelegung[K_GIER] = 4; |
+ EE_Parameter.Kanalbelegung[K_POTI1] = 5; |
+ EE_Parameter.Kanalbelegung[K_POTI2] = 6; |
+ EE_Parameter.Kanalbelegung[K_POTI3] = 7; |
+ EE_Parameter.Kanalbelegung[K_POTI4] = 8; |
+ EE_Parameter.GlobalConfig = 0;//CFG_HOEHENREGELUNG | /*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV | CFG_KOMPASS_FIX;//0x01; |
+ EE_Parameter.Hoehe_MinGas = 30; |
+ EE_Parameter.MaxHoehe = 251; // Wert : 0-32 251 -> Poti1 |
+ EE_Parameter.Hoehe_P = 10; // Wert : 0-32 |
+ EE_Parameter.Luftdruck_D = 70; // Wert : 0-250 |
+ EE_Parameter.Hoehe_ACC_Wirkung = 30; // Wert : 0-250 |
+ EE_Parameter.Hoehe_Verstaerkung = 2; // Wert : 0-50 |
+ EE_Parameter.Stick_P = 4; //2 // Wert : 1-6 |
+ EE_Parameter.Stick_D = 0; //8 // Wert : 0-64 |
+ EE_Parameter.Gier_P = 16; // Wert : 1-20 |
+ EE_Parameter.Gas_Min = 5; // Wert : 0-32 // (160607Kr) |
+ EE_Parameter.Gas_Max = 250; // Wert : 33-250 |
+ EE_Parameter.GyroAccFaktor = 26; // Wert : 1-64 |
+ EE_Parameter.KompassWirkung = 128; // Wert : 0-250 |
+ EE_Parameter.Gyro_P = 120; //80 // Wert : 0-250 |
+ EE_Parameter.Gyro_I = 150; // Wert : 0-250 |
+ EE_Parameter.UnterspannungsWarnung = 90; // Wert : 0-250 // (160607Kr) |
+ EE_Parameter.NotGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
+ EE_Parameter.NotGasZeit = 20; // Wert : 0-250 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen |
+ EE_Parameter.UfoAusrichtung = 0; // X oder + Formation |
+ EE_Parameter.I_Faktor = 5; |
+ EE_Parameter.UserParam1 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam2 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam3 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam4 = 0; //zur freien Verwendung |
+ EE_Parameter.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
+ EE_Parameter.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickRefresh = 5; |
+ memcpy(EE_Parameter.Name, "Normal\0", 12); |
+} |
+ |
+void DefaultKonstanten2(void) |
+{ |
+ EE_Parameter.Kanalbelegung[K_NICK] = 3; |
+ EE_Parameter.Kanalbelegung[K_ROLL] = 2; |
+ EE_Parameter.Kanalbelegung[K_GAS] = 1; |
+ EE_Parameter.Kanalbelegung[K_GIER] = 4; |
+ EE_Parameter.Kanalbelegung[K_POTI1] = 5; |
+ EE_Parameter.Kanalbelegung[K_POTI2] = 6; |
+ EE_Parameter.Kanalbelegung[K_POTI3] = 7; |
+ EE_Parameter.GlobalConfig = 0;//CFG_HOEHENREGELUNG | /*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV;//0x01; |
+ EE_Parameter.Hoehe_MinGas = 30; |
+ EE_Parameter.MaxHoehe = 251; // Wert : 0-32 251 -> Poti1 |
+ EE_Parameter.Hoehe_P = 10; // Wert : 0-32 |
+ EE_Parameter.Luftdruck_D = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_ACC_Wirkung = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_Verstaerkung = 2; // Wert : 0-50 |
+ EE_Parameter.Stick_P = 4; //2 // Wert : 1-6 |
+ EE_Parameter.Stick_D = 0; //8 // Wert : 0-64 |
+ EE_Parameter.Gier_P = 16; // Wert : 1-20 |
+ EE_Parameter.Gas_Min = 5; // Wert : 0-32 // (160607Kr) |
+ EE_Parameter.Gas_Max = 250; // Wert : 33-250 |
+ EE_Parameter.GyroAccFaktor = 26; // Wert : 1-64 |
+ EE_Parameter.KompassWirkung = 128; // Wert : 0-250 |
+ EE_Parameter.Gyro_P = 175; //80 // Wert : 0-250 |
+ EE_Parameter.Gyro_I = 175; // Wert : 0-250 |
+ EE_Parameter.UnterspannungsWarnung = 90; // Wert : 0-250 // (160607Kr) |
+ EE_Parameter.NotGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
+ EE_Parameter.NotGasZeit = 20; // Wert : 0-250 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen |
+ EE_Parameter.UfoAusrichtung = 0; // X oder + Formation |
+ EE_Parameter.I_Faktor = 5; |
+ EE_Parameter.UserParam1 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam2 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam3 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam4 = 0; //zur freien Verwendung |
+ EE_Parameter.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
+ EE_Parameter.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickRefresh = 5; |
+ memcpy(EE_Parameter.Name, "Kamera\0", 12); |
+} |
+ |
+ |
+//############################################################################ |
+// Trägt ggf. das Poti als Parameter ein |
+void ParameterZuordnung(void) |
+//############################################################################ |
+{ |
+ |
+ #define CHK_POTI(b,a,min,max) { if(a > 250) { if(a == 251) b = Poti1; else if(a == 252) b = Poti2; else if(a == 253) b = Poti3; else if(a == 254) b = Poti4;} else b = a; if(b <= min) b = min; else if(b >= max) b = max;} |
+ CHK_POTI(Parameter_MaxHoehe,EE_Parameter.MaxHoehe,0,255); |
+ CHK_POTI(Parameter_Luftdruck_D,EE_Parameter.Luftdruck_D,0,100); |
+ CHK_POTI(Parameter_Hoehe_P,EE_Parameter.Hoehe_P,0,100); |
+ CHK_POTI(Parameter_Hoehe_ACC_Wirkung,EE_Parameter.Hoehe_ACC_Wirkung,0,255); |
+ CHK_POTI(Parameter_KompassWirkung,EE_Parameter.KompassWirkung,0,255); |
+ CHK_POTI(Parameter_Gyro_P,EE_Parameter.Gyro_P,10,255); |
+ CHK_POTI(Parameter_Gyro_I,EE_Parameter.Gyro_I,0,255); |
+ CHK_POTI(Parameter_I_Faktor,EE_Parameter.I_Faktor,0,255); |
+ CHK_POTI(Parameter_UserParam1,EE_Parameter.UserParam1,0,255); |
+ CHK_POTI(Parameter_UserParam2,EE_Parameter.UserParam2,0,255); |
+ CHK_POTI(Parameter_UserParam3,EE_Parameter.UserParam3,0,255); |
+ CHK_POTI(Parameter_UserParam4,EE_Parameter.UserParam4,0,255); |
+ |
+ unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo |
+ unsigned char ServoNickCompInvert; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
+ unsigned char ServoNickMin; // Wert : 0-250 // Anschlag |
+ unsigned char ServoNickMax; // Wert : 0-250 // Anschlag |
+ |
+ |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ |
+ Ki = (float) Parameter_I_Faktor * 0.0001; |
+ MAX_GAS = EE_Parameter.Gas_Max; |
+ MIN_GAS = EE_Parameter.Gas_Min; |
+} |
+ |
+ |
+//############################################################################ |
+// |
+void MotorRegler(void) |
+//############################################################################ |
+{ |
+ int motorwert,pd_ergebnis,h,tmp_int; |
+ int GierMischanteil,GasMischanteil; |
+ static long SummeNick=0,SummeRoll=0; |
+ static long sollGier = 0,tmp_long,tmp_long2; |
+ static int IntegralFehlerNick = 0; |
+ static int IntegralFehlerRoll = 0; |
+ static unsigned int RcLostTimer; |
+ static unsigned char delay_neutral = 0; |
+ static unsigned char delay_einschalten = 0,delay_ausschalten = 0; |
+ static unsigned int modell_fliegt = 0; |
+ static int hoehenregler = 0; |
+ static char TimerWerteausgabe = 0; |
+ static char NeueKompassRichtungMerken = 0; |
+ Mittelwert(); |
+ |
+ GRN_ON; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gaswert ermitteln |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ GasMischanteil = PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] + 120; |
+ if(GasMischanteil < 0) GasMischanteil = 0; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Emfang schlecht |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(SenderOkay < 100) |
+ { |
+ if(!PcZugriff) beeptime = 500; |
+ if(RcLostTimer) RcLostTimer--; |
+ else |
+ { |
+ MotorenEin = 0; |
+ Notlandung = 0; |
+ } |
+ ROT_ON; |
+ if(modell_fliegt > 2000) // wahrscheinlich in der Luft --> langsam absenken |
+ { |
+ GasMischanteil = EE_Parameter.NotGas; |
+ Notlandung = 1; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] = 0; |
+/* Poti1 = 65; |
+ Poti2 = 48; |
+ Poti3 = 0; |
+*/ } |
+ else MotorenEin = 0; |
+ } |
+ else |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Emfang gut |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(SenderOkay > 140) |
+ { |
+ Notlandung = 0; |
+ RcLostTimer = EE_Parameter.NotGasZeit * 50; |
+ if(GasMischanteil > 40) |
+ { |
+ if(modell_fliegt < 0xffff) modell_fliegt++; |
+ modell_fliegt_gps = modell_fliegt;// (030907Kr) |
+ } |
+ if((modell_fliegt < 200) || (GasMischanteil < 40)) |
+ { |
+ SummeNick = 0; |
+ SummeRoll = 0; |
+ Mess_Integral_Gier = 0; |
+ Mess_Integral_Gier2 = 0; |
+ } |
+ if((GasMischanteil > 200) && MotorenEin == 0) |
+ { |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// auf Nullwerte kalibrieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) // Neutralwerte |
+ { |
+ unsigned char setting; |
+ if(++delay_neutral > 200) // nicht sofort |
+ { |
+ GRN_OFF; |
+ SetNeutral(); |
+ MotorenEin = 0; |
+ delay_neutral = 0; |
+ modell_fliegt = 0; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70 || abs(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]) > 70) |
+ { |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < 70) setting = 1; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 2; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] < 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 3; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] <-70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 4; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] <-70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < 70) setting = 5; |
+ eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], setting); // aktiven Datensatz merken |
+ } |
+ ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
+ Piep(GetActiveParamSetNumber()); |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
+ { |
+ if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset(); |
+ } |
+ } |
+ } |
+ else delay_neutral = 0; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gas ist unten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(GasMischanteil < 35) |
+ { |
+ // Starten |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] < -75) |
+ { |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Einschalten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(++delay_einschalten > 200) |
+ { |
+ delay_einschalten = 200; |
+ modell_fliegt = 1; |
+ MotorenEin = 1; |
+ sollGier = 0; |
+ Mess_Integral_Gier = 0; |
+ Mess_Integral_Gier2 = 0; |
+ Mess_IntegralNick = 0; |
+ Mess_IntegralRoll = 0; |
+ Mess_IntegralNick2 = IntegralNick; |
+ Mess_IntegralRoll2 = IntegralRoll; |
+ SummeNick = 0; |
+ SummeRoll = 0; |
+ } |
+ } |
+ else delay_einschalten = 0; |
+ //Auf Neutralwerte setzen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Auschalten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) |
+ { |
+ if(++delay_ausschalten > 200) // nicht sofort |
+ { |
+ MotorenEin = 0; |
+ delay_ausschalten = 200; |
+ modell_fliegt = 0; |
+ } |
+ } |
+ else delay_ausschalten = 0; |
+ } |
+ } |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// neue Werte von der Funke |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(!NewPpmData-- || Notlandung) |
+ { |
+ ParameterZuordnung(); |
+ StickNick = PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_P; |
+ StickNick += PPM_diff[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_D; |
+ StickRoll = PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_P; |
+ StickRoll += PPM_diff[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_D; |
+ StickGier = -PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]; |
+ |
+ GyroFaktor = ((float)Parameter_Gyro_P + 10.0) / 256.0; |
+ IntegralFaktor = ((float) Parameter_Gyro_I) / 44000; |
+ |
+ if(EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) IntegralFaktor = 0; |
+ if(GyroFaktor < 0) GyroFaktor = 0; |
+ if(IntegralFaktor < 0) IntegralFaktor = 0; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// LED Stuff |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+LED1_OFF; |
+ |
+ if(blinkcount_LED1 >= Parameter_UserParam4 && Parameter_UserParam4 > 0) |
+ { |
+ LED1_FLASH; |
+ blinkcount_LED1 = 0; |
+ } |
+ |
+ blinkcount_LED1++; |
+ |
+ //if(PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] > 75) LED1_ON; else LED1_OFF; //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
+ //if(PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] > 75) LED2_ON; else LED2_OFF; //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Bei Empfangsausfall im Flug |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(Notlandung) |
+ { |
+ StickGier = 0; |
+ StickNick = 0; |
+ StickRoll = 0; |
+ GyroFaktor = 0.1; |
+ IntegralFaktor = 0.005; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gyro-Drift kompensieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define DRIFT_FAKTOR 3 |
+ if(ZaehlMessungen >= 1000 / DRIFT_FAKTOR) |
+ { |
+ IntegralFehlerNick = IntegralNick2 - IntegralNick; |
+ IntegralFehlerRoll = IntegralRoll2 - IntegralRoll; |
+ ZaehlMessungen = 0; |
+ if(IntegralFehlerNick > 500/DRIFT_FAKTOR) AdNeutralNick++; |
+ if(IntegralFehlerNick < -500/DRIFT_FAKTOR) AdNeutralNick--; |
+ if(IntegralFehlerRoll > 500/DRIFT_FAKTOR) AdNeutralRoll++; |
+ if(IntegralFehlerRoll < -500/DRIFT_FAKTOR) AdNeutralRoll--; |
+ if(Mess_Integral_Gier2 > 500/DRIFT_FAKTOR) AdNeutralGier--; |
+ if(Mess_Integral_Gier2 <-500/DRIFT_FAKTOR) AdNeutralGier++; |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_IntegralNick2 = IntegralNick; |
+ Mess_IntegralRoll2 = IntegralRoll; |
+ Mess_Integral_Gier2 = Integral_Gier; |
+ ANALOG_ON; // ADC einschalten |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Integrale auf ACC-Signal abgleichen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ tmp_long = (long)(IntegralNick / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccNick) / 16; |
+ tmp_long2 = (long)(IntegralRoll / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccRoll) / 16; |
+#define AUSGLEICH 500 |
+ if(tmp_long > AUSGLEICH) tmp_long = AUSGLEICH; |
+ if(tmp_long < -AUSGLEICH) tmp_long =-AUSGLEICH; |
+ if(tmp_long2 > AUSGLEICH) tmp_long2 = AUSGLEICH; |
+ if(tmp_long2 <-AUSGLEICH) tmp_long2 =-AUSGLEICH; |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_IntegralNick -= tmp_long; |
+ Mess_IntegralRoll -= tmp_long2; |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ sollGier = StickGier; |
+ if(abs(StickGier) > 35) |
+ { |
+ if(!(EE_Parameter.GlobalConfig & CFG_KOMPASS_FIX)) NeueKompassRichtungMerken = 1; |
+ } |
+ tmp_int = EE_Parameter.Gier_P * (sollGier * abs(sollGier)) / 256; // expo |
+ Mess_Integral_Gier -= tmp_int; |
+ if(Mess_Integral_Gier > 30000) Mess_Integral_Gier = 30000; // begrenzen |
+ if(Mess_Integral_Gier <-30000) Mess_Integral_Gier =-30000; |
+ |
+ ANALOG_ON; // ADC einschalten |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Kompass |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(KompassValue && (EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV)) |
+ { |
+ if(NeueKompassRichtungMerken) |
+ { |
+ KompassStartwert = KompassValue; |
+ NeueKompassRichtungMerken = 0; |
+ } |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_Integral_Gier -= (KompassRichtung * Parameter_KompassWirkung) / 32; // nach Kompass ausrichten |
+ ANALOG_ON; // ADC einschalten |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// GPS |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+if(EE_Parameter.GlobalConfig & CFG_GPS_AKTIV) |
+{ |
+ P_GPS_Verstaerkung = Parameter_UserParam1; |
+ D_GPS_Verstaerkung = Parameter_UserParam2; |
+ Limit_D_Anteil = Parameter_UserParam3; |
+ gps_main(); |
+} |
+else |
+{ |
+ GPS_Nick = 0; |
+ GPS_Roll = 0; |
+} |
+ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Debugwerte zuordnen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+DebugOut.Sekunden++; |
+ if(!TimerWerteausgabe--) |
+ { |
+ |
+ TimerWerteausgabe = 49; |
+ |
+ //++++++++ANFANG_Legende++++++++ |
+/* |
+ DebugOut.Analog[0] = actualPos.GPSFix; |
+ DebugOut.Analog[1] = GPS_Nick; |
+ DebugOut.Analog[2] = GPS_Roll; |
+ DebugOut.Analog[3] = actualPos.northing; |
+ DebugOut.Analog[4] = actualPos.easting; |
+ DebugOut.Analog[5] = NORTH_MITTEL; |
+ DebugOut.Analog[6] = EAST_MITTEL; |
+ DebugOut.Analog[7] = Soll_Position_North; |
+ DebugOut.Analog[8] = Soll_Position_East; |
+ DebugOut.Analog[9] = GPS_Home_North; |
+ DebugOut.Analog[10] = GPS_Home_East; |
+ DebugOut.Analog[11] = GPS_Positionsabweichung_North; |
+ DebugOut.Analog[12] = GPS_Positionsabweichung_East; |
+ DebugOut.Analog[13] = Poti1; |
+ DebugOut.Analog[14] = Poti2; |
+ DebugOut.Analog[15] = KompassValue; |
+ |
+ //++++++++ENDE_Legende++++++++ |
+ |
+ |
+ //++++++++ANFANG_Legende_1++++++++ |
+ |
+ DebugOut.Analog[0] = GPS_Roll; |
+ DebugOut.Analog[1] = GPS_Nick; |
+ DebugOut.Analog[2] = GPS_Positionsabweichung_North; |
+ DebugOut.Analog[3] = GPS_Positionsabweichung_East; |
+ DebugOut.Analog[4] = P_Einfluss_East; |
+ DebugOut.Analog[5] = D_Einfluss_East; |
+ DebugOut.Analog[6] = P_Einfluss_North; |
+ DebugOut.Analog[7] = D_Einfluss_North; |
+ DebugOut.Analog[8] = GPS_Geschwindigkeit_North; |
+ DebugOut.Analog[9] = GPS_Geschwindigkeit_East; |
+ DebugOut.Analog[10] = Parameter_UserParam1; |
+ DebugOut.Analog[11] = Parameter_UserParam2; |
+ DebugOut.Analog[12] = Soll_Position_North; |
+ DebugOut.Analog[13] = Soll_Position_East; |
+ DebugOut.Analog[14] = Poti6; |
+ DebugOut.Analog[15] = KompassValue; |
+*/ |
+ //++++++++ENDE_Legende_1++++++++ |
+ |
+// DebugOut.Analog[xx] = actualPos.velNorth; |
+// DebugOut.Analog[xx] = actualPos.velEast; |
+// DebugOut.Analog[xx] = UBat; |
+// DebugOut.Analog[xx] = 0; |
+ |
+ |
+ |
+// DebugOut.Analog[0] = MesswertNick; |
+// DebugOut.Analog[1] = MesswertRoll; |
+// DebugOut.Analog[2] = MesswertGier; |
+// DebugOut.Analog[0] = IntegralNick / EE_Parameter.GyroAccFaktor; |
+// DebugOut.Analog[1] = IntegralRoll / EE_Parameter.GyroAccFaktor; |
+ |
+ DebugOut.Analog[0] = MM3.NickGrad; |
+ DebugOut.Analog[1] = MM3.RollGrad; |
+ DebugOut.Analog[2] = Mittelwert_AccNick; |
+ DebugOut.Analog[3] = Mittelwert_AccRoll; |
+ DebugOut.Analog[4] = MesswertGier; |
+ DebugOut.Analog[5] = HoehenWert; |
+ DebugOut.Analog[6] = (Mess_Integral_Hoch / 512); |
+ DebugOut.Analog[7] = GasMischanteil; |
+ DebugOut.Analog[8] = KompassValue; |
+ |
+//DebugOut.Analog[8] = MM3_heading(); |
+DebugOut.Analog[9] = MM3.x_axis; |
+DebugOut.Analog[10] = MM3.y_axis; |
+DebugOut.Analog[11] = MM3.z_axis; |
+ |
+// DebugOut.Analog[9] = SollHoehe; |
+// DebugOut.Analog[10] = Mess_Integral_Gier / 128; |
+// DebugOut.Analog[11] = KompassStartwert; |
+// DebugOut.Analog[10] = Parameter_Gyro_I; |
+// DebugOut.Analog[10] = EE_Parameter.Gyro_I; |
+// DebugOut.Analog[9] = KompassRichtung; |
+// DebugOut.Analog[10] = GasMischanteil; |
+// DebugOut.Analog[3] = HoeheD * 32; |
+// DebugOut.Analog[4] = hoehenregler; |
+ |
+ } |
+ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Drehgeschwindigkeit und -winkel zu einem Istwert zusammenfassen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ MesswertNick = IntegralNick * IntegralFaktor + MesswertNick * GyroFaktor; |
+ MesswertRoll = IntegralRoll * IntegralFaktor + MesswertRoll * GyroFaktor; |
+ MesswertGier = MesswertGier * (GyroFaktor/2) + Integral_Gier * IntegralFaktor; |
+ // Maximalwerte abfangen |
+ #define MAX_SENSOR 2048 |
+ if(MesswertNick > MAX_SENSOR) MesswertNick = MAX_SENSOR; |
+ if(MesswertNick < -MAX_SENSOR) MesswertNick = -MAX_SENSOR; |
+ if(MesswertRoll > MAX_SENSOR) MesswertRoll = MAX_SENSOR; |
+ if(MesswertRoll < -MAX_SENSOR) MesswertRoll = -MAX_SENSOR; |
+ if(MesswertGier > MAX_SENSOR) MesswertGier = MAX_SENSOR; |
+ if(MesswertGier < -MAX_SENSOR) MesswertGier = -MAX_SENSOR; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Höhenregelung |
+// Die Höhenregelung schwächt lediglich das Gas ab, erhöht es allerdings nicht |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+//OCR0B = 180 - (Poti1 + 120) / 4; |
+//DruckOffsetSetting = OCR0B; |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung |
+ { |
+ int tmp_int; |
+ if(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER) // Regler wird über Schalter gesteuert |
+ { |
+ if(Parameter_MaxHoehe < 50) |
+ { |
+ SollHoehe = HoehenWert - 40; // Parameter_MaxHoehe ist der PPM-Wert des Schalters // (160607Kr) |
+ HoehenReglerAktiv = 0; |
+ } |
+ else |
+ HoehenReglerAktiv = 1; |
+ } |
+ else |
+ { |
+ SollHoehe = Parameter_MaxHoehe * EE_Parameter.Hoehe_Verstaerkung - 40; // (160607Kr) |
+ HoehenReglerAktiv = 1; |
+ } |
+ |
+ if(Notlandung) SollHoehe = 0; |
+ h = HoehenWert; |
+ if((h > SollHoehe) && HoehenReglerAktiv) // zu hoch --> drosseln |
+ { h = ((h - SollHoehe) * (int) Parameter_Hoehe_P) / 16; // Differenz bestimmen --> P-Anteil |
+ h = GasMischanteil - h; // vom Gas abziehen |
+ h -= (HoeheD * Parameter_Luftdruck_D)/8; // D-Anteil |
+ tmp_int = ((Mess_Integral_Hoch / 512) * (signed long) Parameter_Hoehe_ACC_Wirkung) / 32; |
+ if(tmp_int > 50) tmp_int = 50; |
+ else if(tmp_int < -50) tmp_int = -50; |
+ h -= tmp_int; |
+ hoehenregler = (hoehenregler*15 + h) / 16; |
+ if(hoehenregler < EE_Parameter.Hoehe_MinGas) // nicht unter MIN |
+ { |
+ if(GasMischanteil >= EE_Parameter.Hoehe_MinGas) hoehenregler = EE_Parameter.Hoehe_MinGas; |
+ if(GasMischanteil < EE_Parameter.Hoehe_MinGas) hoehenregler = GasMischanteil; |
+ } |
+ if(hoehenregler > GasMischanteil) hoehenregler = GasMischanteil; // nicht mehr als Gas |
+ GasMischanteil = hoehenregler; |
+ } |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Mischer und PI-Regler |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gier-Anteil |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ GierMischanteil = MesswertGier - sollGier; // Regler für Gier |
+ if(GierMischanteil > 100) GierMischanteil = 100; |
+ if(GierMischanteil < -100) GierMischanteil = -100; |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Nick-Achse |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ DiffNick = Kp * (MesswertNick - (StickNick - GPS_Nick)); // Differenz bestimmen |
+ SummeNick += DiffNick; // I-Anteil |
+ if(SummeNick > 0) SummeNick-= (abs(SummeNick)/256 + 1); else SummeNick += abs(SummeNick)/256 + 1; |
+ if(SummeNick > 16000) SummeNick = 16000; |
+ if(SummeNick < -16000) SummeNick = -16000; |
+ pd_ergebnis = DiffNick + Ki * SummeNick; // PI-Regler für Nick |
+ // Motor Vorn |
+ motorwert = GasMischanteil + pd_ergebnis + GierMischanteil; // Mischer |
+ if ((motorwert < 0) | (GasMischanteil < 10)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Vorne = motorwert; |
+ // Motor Heck |
+ motorwert = GasMischanteil - pd_ergebnis + GierMischanteil; |
+ if ((motorwert < 0) | (GasMischanteil < 10)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Hinten = motorwert; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Roll-Achse |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ DiffRoll = Kp * (MesswertRoll - (StickRoll - GPS_Roll)); // Differenz bestimmen |
+ SummeRoll += DiffRoll; // I-Anteil |
+ if(SummeRoll > 0) SummeRoll-= (abs(SummeRoll)/256 + 1); else SummeRoll += abs(SummeRoll)/256 + 1; |
+ if(SummeRoll > 16000) SummeRoll = 16000; |
+ if(SummeRoll < -16000) SummeRoll = -16000; |
+ pd_ergebnis = DiffRoll + Ki * SummeRoll; // PI-Regler für Roll |
+ // Motor Links |
+ motorwert = GasMischanteil + pd_ergebnis - GierMischanteil; |
+ if ((motorwert < 0) | (GasMischanteil < 10)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Links = motorwert; |
+ // Motor Rechts |
+ motorwert = GasMischanteil - pd_ergebnis - GierMischanteil; |
+ if ((motorwert < 0) | (GasMischanteil < 10)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Rechts = motorwert; |
+ // +++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+} |
+ |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/fc.c.bak |
---|
0,0 → 1,925 |
/*####################################################################################### |
Flight Control |
#######################################################################################*/ |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + Nur für den privaten Gebrauch |
// + www.MikroKopter.com |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
// + dass eine Nutzung (auch auszugsweise) nur für den privaten (nicht-kommerziellen) Gebrauch zulässig ist. |
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
// + bzgl. der Nutzungsbedingungen aufzunehmen. |
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
// + Verkauf von Luftbildaufnahmen, usw. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
// + eindeutig als Ursprung verlinkt werden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
// + Benutzung auf eigene Gefahr |
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
// + mit unserer Zustimmung zulässig |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
// + this list of conditions and the following disclaimer. |
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
// + from this software without specific prior written permission. |
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
// + for non-commercial use (directly or indirectly) |
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
// + with our written permission |
// + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
// + clearly linked as origin |
// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
unsigned char h,m,s; |
volatile unsigned char Timeout = 0; |
volatile int MesswertNick,MesswertRoll,MesswertGier; |
volatile int AdNeutralNick = 0,AdNeutralRoll = 0,AdNeutralGier = 0; |
volatile int Mittelwert_AccNick, Mittelwert_AccRoll,Mittelwert_AccHoch, NeutralAccX=0, NeutralAccY=0; |
volatile float NeutralAccZ = 0; |
unsigned char CosinusNickWinkel = 0, CosinusRollWinkel = 0; |
volatile long IntegralNick = 0,IntegralNick2 = 0; |
volatile long IntegralRoll = 0,IntegralRoll2 = 0; |
volatile long Integral_Gier = 0; |
volatile long Mess_IntegralNick = 0,Mess_IntegralNick2 = 0; |
volatile long Mess_IntegralRoll = 0,Mess_IntegralRoll2 = 0; |
volatile long Mess_Integral_Gier = 0,Mess_Integral_Gier2 = 0; |
volatile long Mess_Integral_Hoch = 0; |
volatile int KompassValue = 0; |
volatile int KompassStartwert = 0; |
volatile int KompassRichtung = 0; |
unsigned char MAX_GAS,MIN_GAS; |
unsigned char Notlandung = 0; |
unsigned char HoehenReglerAktiv = 0; |
unsigned char blinkcount_LED1 = 0;//Hilfszähler für die blinkende LED (310807Kr) |
unsigned int modell_fliegt_gps = 0;//(030907Kr) |
unsigned char Limit_D_Anteil = 0;//(210907Kr) |
float GyroFaktor; |
float IntegralFaktor; |
volatile int DiffNick,DiffRoll; |
int Poti1 = 0, Poti2 = 0, Poti3 = 0, Poti4 = 0, Poti5 = 0, Poti6 = 0, Poti7 = 0, Poti8 = 0; |
volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
unsigned char MotorWert[5]; |
volatile unsigned char SenderOkay = 0; |
int StickNick = 0,StickRoll = 0,StickGier = 0; |
char MotorenEin = 0; |
int HoehenWert = 0; |
int SollHoehe = 0; |
float Kp = FAKTOR_P; |
float Ki = FAKTOR_I; |
unsigned char Parameter_Luftdruck_D = 48; // Wert : 0-250 |
unsigned char Parameter_MaxHoehe = 251; // Wert : 0-250 |
unsigned char Parameter_Hoehe_P = 16; // Wert : 0-32 |
unsigned char Parameter_Hoehe_ACC_Wirkung = 58; // Wert : 0-250 |
unsigned char Parameter_KompassWirkung = 64; // Wert : 0-250 |
unsigned char Parameter_Gyro_P = 50; // Wert : 10-250 |
unsigned char Parameter_Gyro_I = 150; // Wert : 0-250 |
unsigned char Parameter_Gier_P = 2; // Wert : 1-20 |
unsigned char Parameter_I_Faktor = 10; // Wert : 1-20 |
unsigned char Parameter_UserParam1 = 0; |
unsigned char Parameter_UserParam2 = 0; |
unsigned char Parameter_UserParam3 = 0; |
unsigned char Parameter_UserParam4 = 0; |
unsigned char Parameter_ServoNickControl = 100; |
struct mk_param_struct EE_Parameter; |
void Piep(unsigned char Anzahl) |
{ |
while(Anzahl--) |
{ |
if(MotorenEin) return; //auf keinen Fall im Flug! |
beeptime = 100; |
Delay_ms(250); |
} |
} |
//############################################################################ |
// Nullwerte ermitteln |
void SetNeutral(void) |
//############################################################################ |
{ |
unsigned int timer; |
NeutralAccX = 0; |
NeutralAccY = 0; |
NeutralAccZ = 0; |
AdNeutralNick = 0; |
AdNeutralRoll = 0; |
AdNeutralGier = 0; |
CalibrierMittelwert(); |
timer = SetDelay(5); |
while (!CheckDelay(timer)); |
CalibrierMittelwert(); |
if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
{ |
if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset(); |
} |
AdNeutralNick= abs(MesswertNick); |
AdNeutralRoll= abs(MesswertRoll); |
AdNeutralGier= abs(MesswertGier); |
NeutralAccY = abs(Mittelwert_AccRoll) / ACC_AMPLIFY; |
NeutralAccX = abs(Mittelwert_AccNick) / ACC_AMPLIFY; |
NeutralAccZ = Aktuell_az; |
Mess_IntegralNick = 0; |
Mess_IntegralNick2 = 0; |
Mess_IntegralRoll = 0; |
Mess_IntegralRoll2 = 0; |
Mess_Integral_Gier = 0; |
MesswertNick = 0; |
MesswertRoll = 0; |
MesswertGier = 0; |
StartLuftdruck = Luftdruck; |
HoeheD = 0; |
Mess_Integral_Hoch = 0; |
KompassStartwert = KompassValue; |
beeptime = 50; |
} |
//############################################################################ |
// Bildet den Mittelwert aus den Messwerten |
void Mittelwert(void) |
//############################################################################ |
{ |
// ADC auschalten, damit die Werte sich nicht während der Berechnung ändern |
ANALOG_OFF; |
if(MessanzahlNick) (MesswertNick = AccumulateNick / MessanzahlNick); |
if(MessanzahlRoll) (MesswertRoll = AccumulateRoll / MessanzahlRoll); |
if(MessanzahlGier) (MesswertGier = AccumulateGier / MessanzahlGier); |
if(messanzahl_AccNick) Mittelwert_AccNick = ((long)Mittelwert_AccNick * 7 + ((ACC_AMPLIFY * (long)accumulate_AccNick) / messanzahl_AccNick)) / 8L; |
if(messanzahl_AccRoll) Mittelwert_AccRoll = ((long)Mittelwert_AccRoll * 7 + ((ACC_AMPLIFY * (long)accumulate_AccRoll) / messanzahl_AccRoll)) / 8L; |
if(messanzahl_AccHoch) Mittelwert_AccHoch = ((long)Mittelwert_AccHoch * 7 + ((long)accumulate_AccHoch) / messanzahl_AccHoch) / 8L; |
AccumulateNick = 0; MessanzahlNick = 0; |
AccumulateRoll = 0; MessanzahlRoll = 0; |
AccumulateGier = 0; MessanzahlGier = 0; |
accumulate_AccRoll = 0;messanzahl_AccRoll = 0; |
accumulate_AccNick = 0;messanzahl_AccNick = 0; |
accumulate_AccHoch = 0;messanzahl_AccHoch = 0; |
Integral_Gier = Mess_Integral_Gier; |
// Integral_Gier2 = Mess_Integral_Gier2; |
IntegralNick = Mess_IntegralNick; |
IntegralRoll = Mess_IntegralRoll; |
IntegralNick2 = Mess_IntegralNick2; |
IntegralRoll2 = Mess_IntegralRoll2; |
// ADC einschalten |
ANALOG_ON; |
//------------------------------------------------------------------------------ |
if(MesswertNick > 200) MesswertNick += 4 * (MesswertNick - 200); |
else |
if(MesswertNick < -200) MesswertNick += 4 * (MesswertNick + 200); |
if(MesswertRoll > 200) MesswertRoll += 4 * (MesswertRoll - 200); |
else |
if(MesswertRoll < -200) MesswertRoll += 4 * (MesswertRoll + 200); |
//------------------------------------------------------------------------------ |
if(Poti1 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110) Poti1++; else if(Poti1 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110 && Poti1) Poti1--; |
if(Poti2 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110) Poti2++; else if(Poti2 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110 && Poti2) Poti2--; |
if(Poti3 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110) Poti3++; else if(Poti3 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110 && Poti3) Poti3--; |
if(Poti4 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110) Poti4++; else if(Poti4 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110 && Poti4) Poti4--; |
if(Poti5 < PPM_in[9] + 110) Poti5++; else if(Poti5 > PPM_in[9] + 110 && Poti5) Poti5--; |
if(Poti6 < PPM_in[10] + 110) Poti6++; else if(Poti6 > PPM_in[10] + 110 && Poti6) Poti6--; |
if(Poti7 < PPM_in[11] + 110) Poti7++; else if(Poti7 > PPM_in[11] + 110 && Poti7) Poti7--; |
if(Poti8 < PPM_in[12] + 110) Poti8++; else if(Poti8 > PPM_in[12] + 110 && Poti8) Poti8--; |
if(Poti1 < 0) Poti1 = 0; else if(Poti1 > 255) Poti1 = 255; |
if(Poti2 < 0) Poti2 = 0; else if(Poti2 > 255) Poti2 = 255; |
if(Poti3 < 0) Poti3 = 0; else if(Poti3 > 255) Poti3 = 255; |
if(Poti4 < 0) Poti4 = 0; else if(Poti4 > 255) Poti4 = 255; |
if(Poti5 < 0) Poti5 = 0; else if(Poti5 > 255) Poti5 = 255; |
if(Poti6 < 0) Poti6 = 0; else if(Poti6 > 255) Poti6 = 255; |
if(Poti7 < 0) Poti7 = 0; else if(Poti7 > 255) Poti7 = 255; |
if(Poti8 < 0) Poti8 = 0; else if(Poti8 > 255) Poti8 = 255; |
} |
//############################################################################ |
// Messwerte beim Ermitteln der Nullage |
void CalibrierMittelwert(void) |
//############################################################################ |
{ |
// ADC auschalten, damit die Werte sich nicht während der Berechnung ändern |
ANALOG_OFF; |
if(MessanzahlNick) (MesswertNick = AccumulateNick / MessanzahlNick); |
if(MessanzahlRoll) (MesswertRoll = AccumulateRoll / MessanzahlRoll); |
if(MessanzahlGier) (MesswertGier = AccumulateGier / MessanzahlGier); |
if(messanzahl_AccNick) Mittelwert_AccNick = ((ACC_AMPLIFY * (long)accumulate_AccNick) / messanzahl_AccNick); |
if(messanzahl_AccRoll) Mittelwert_AccRoll = (ACC_AMPLIFY * (long)accumulate_AccRoll) / messanzahl_AccRoll; |
if(messanzahl_AccHoch) Mittelwert_AccHoch = ((long)accumulate_AccHoch) / messanzahl_AccHoch; |
AccumulateNick = 0; MessanzahlNick = 0; |
AccumulateRoll = 0; MessanzahlRoll = 0; |
AccumulateGier = 0; MessanzahlGier = 0; |
accumulate_AccRoll = 0;messanzahl_AccRoll = 0; |
accumulate_AccNick = 0;messanzahl_AccNick = 0; |
accumulate_AccHoch = 0;messanzahl_AccHoch = 0; |
// ADC einschalten |
ANALOG_ON; |
if(Poti1 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110) Poti1++; else if(Poti1 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110 && Poti1) Poti1--; |
if(Poti2 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110) Poti2++; else if(Poti2 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110 && Poti2) Poti2--; |
if(Poti3 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110) Poti3++; else if(Poti3 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110 && Poti3) Poti3--; |
if(Poti4 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110) Poti4++; else if(Poti4 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110 && Poti4) Poti4--; |
if(Poti5 < PPM_in[9] + 110) Poti5++; else if(Poti5 > PPM_in[9] + 110 && Poti5) Poti5--; |
if(Poti6 < PPM_in[10] + 110) Poti6++; else if(Poti6 > PPM_in[10] + 110 && Poti6) Poti6--; |
if(Poti7 < PPM_in[11] + 110) Poti7++; else if(Poti7 > PPM_in[11] + 110 && Poti7) Poti7--; |
if(Poti8 < PPM_in[12] + 110) Poti8++; else if(Poti8 > PPM_in[12] + 110 && Poti8) Poti8--; |
if(Poti1 < 0) Poti1 = 0; else if(Poti1 > 255) Poti1 = 255; |
if(Poti2 < 0) Poti2 = 0; else if(Poti2 > 255) Poti2 = 255; |
if(Poti3 < 0) Poti3 = 0; else if(Poti3 > 255) Poti3 = 255; |
if(Poti4 < 0) Poti4 = 0; else if(Poti4 > 255) Poti4 = 255; |
if(Poti5 < 0) Poti5 = 0; else if(Poti5 > 255) Poti5 = 255; |
if(Poti6 < 0) Poti6 = 0; else if(Poti6 > 255) Poti6 = 255; |
if(Poti7 < 0) Poti7 = 0; else if(Poti7 > 255) Poti7 = 255; |
if(Poti8 < 0) Poti8 = 0; else if(Poti8 > 255) Poti8 = 255; |
} |
//############################################################################ |
// Senden der Motorwerte per I2C-Bus |
void SendMotorData(void) |
//############################################################################ |
{ |
if(MOTOR_OFF || !MotorenEin) |
{ |
Motor_Hinten = 0; |
Motor_Vorne = 0; |
Motor_Rechts = 0; |
Motor_Links = 0; |
if(MotorTest[0]) Motor_Vorne = MotorTest[0]; |
if(MotorTest[1]) Motor_Hinten = MotorTest[1]; |
if(MotorTest[2]) Motor_Links = MotorTest[2]; |
if(MotorTest[3]) Motor_Rechts = MotorTest[3]; |
} |
// DebugOut.Analog[12] = Motor_Vorne; |
// DebugOut.Analog[13] = Motor_Hinten; |
// DebugOut.Analog[14] = Motor_Links; |
// DebugOut.Analog[15] = Motor_Rechts; |
// DebugOut.Analog[12] = motor_rx[0]; //Motorstrom vorne |
// DebugOut.Analog[13] = motor_rx[1]; //Motorstrom hinten |
// DebugOut.Analog[14] = motor_rx[2]; //Motorstrom links |
// DebugOut.Analog[15] = motor_rx[3]; //Motorstrom rechts |
// DebugOut.Analog[14] = (motor_rx[0]+motor_rx[1]+motor_rx[2]+motor_rx[3])/4; //Mittelwert aller Motorenströme |
// DebugOut.Analog[15] = motor_rx[0]+motor_rx[1]+motor_rx[2]+motor_rx[3]; //Gesamtstrom aller Motoren |
//Start I2C Interrupt Mode |
twi_state = 0; |
motor = 0; |
i2c_start(); |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Konstanten |
// + 0-250 -> normale Werte |
// + 251 -> Poti1 |
// + 252 -> Poti2 |
// + 253 -> Poti3 |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
void DefaultKonstanten1(void) |
{ |
EE_Parameter.Kanalbelegung[K_NICK] = 3; |
EE_Parameter.Kanalbelegung[K_ROLL] = 2; |
EE_Parameter.Kanalbelegung[K_GAS] = 1; |
EE_Parameter.Kanalbelegung[K_GIER] = 4; |
EE_Parameter.Kanalbelegung[K_POTI1] = 5; |
EE_Parameter.Kanalbelegung[K_POTI2] = 6; |
EE_Parameter.Kanalbelegung[K_POTI3] = 7; |
EE_Parameter.Kanalbelegung[K_POTI4] = 8; |
EE_Parameter.GlobalConfig = 0;//CFG_HOEHENREGELUNG | /*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV | CFG_KOMPASS_FIX;//0x01; |
EE_Parameter.Hoehe_MinGas = 30; |
EE_Parameter.MaxHoehe = 251; // Wert : 0-32 251 -> Poti1 |
EE_Parameter.Hoehe_P = 10; // Wert : 0-32 |
EE_Parameter.Luftdruck_D = 70; // Wert : 0-250 |
EE_Parameter.Hoehe_ACC_Wirkung = 30; // Wert : 0-250 |
EE_Parameter.Hoehe_Verstaerkung = 2; // Wert : 0-50 |
EE_Parameter.Stick_P = 4; //2 // Wert : 1-6 |
EE_Parameter.Stick_D = 0; //8 // Wert : 0-64 |
EE_Parameter.Gier_P = 16; // Wert : 1-20 |
EE_Parameter.Gas_Min = 5; // Wert : 0-32 // (160607Kr) |
EE_Parameter.Gas_Max = 250; // Wert : 33-250 |
EE_Parameter.GyroAccFaktor = 26; // Wert : 1-64 |
EE_Parameter.KompassWirkung = 128; // Wert : 0-250 |
EE_Parameter.Gyro_P = 120; //80 // Wert : 0-250 |
EE_Parameter.Gyro_I = 150; // Wert : 0-250 |
EE_Parameter.UnterspannungsWarnung = 90; // Wert : 0-250 // (160607Kr) |
EE_Parameter.NotGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
EE_Parameter.NotGasZeit = 20; // Wert : 0-250 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen |
EE_Parameter.UfoAusrichtung = 0; // X oder + Formation |
EE_Parameter.I_Faktor = 5; |
EE_Parameter.UserParam1 = 0; //zur freien Verwendung |
EE_Parameter.UserParam2 = 0; //zur freien Verwendung |
EE_Parameter.UserParam3 = 0; //zur freien Verwendung |
EE_Parameter.UserParam4 = 0; //zur freien Verwendung |
EE_Parameter.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
EE_Parameter.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
EE_Parameter.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
EE_Parameter.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
EE_Parameter.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
EE_Parameter.ServoNickRefresh = 5; |
memcpy(EE_Parameter.Name, "Normal\0", 12); |
} |
void DefaultKonstanten2(void) |
{ |
EE_Parameter.Kanalbelegung[K_NICK] = 3; |
EE_Parameter.Kanalbelegung[K_ROLL] = 2; |
EE_Parameter.Kanalbelegung[K_GAS] = 1; |
EE_Parameter.Kanalbelegung[K_GIER] = 4; |
EE_Parameter.Kanalbelegung[K_POTI1] = 5; |
EE_Parameter.Kanalbelegung[K_POTI2] = 6; |
EE_Parameter.Kanalbelegung[K_POTI3] = 7; |
EE_Parameter.GlobalConfig = 0;//CFG_HOEHENREGELUNG | /*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV;//0x01; |
EE_Parameter.Hoehe_MinGas = 30; |
EE_Parameter.MaxHoehe = 251; // Wert : 0-32 251 -> Poti1 |
EE_Parameter.Hoehe_P = 10; // Wert : 0-32 |
EE_Parameter.Luftdruck_D = 50; // Wert : 0-250 |
EE_Parameter.Hoehe_ACC_Wirkung = 50; // Wert : 0-250 |
EE_Parameter.Hoehe_Verstaerkung = 2; // Wert : 0-50 |
EE_Parameter.Stick_P = 4; //2 // Wert : 1-6 |
EE_Parameter.Stick_D = 0; //8 // Wert : 0-64 |
EE_Parameter.Gier_P = 16; // Wert : 1-20 |
EE_Parameter.Gas_Min = 5; // Wert : 0-32 // (160607Kr) |
EE_Parameter.Gas_Max = 250; // Wert : 33-250 |
EE_Parameter.GyroAccFaktor = 26; // Wert : 1-64 |
EE_Parameter.KompassWirkung = 128; // Wert : 0-250 |
EE_Parameter.Gyro_P = 175; //80 // Wert : 0-250 |
EE_Parameter.Gyro_I = 175; // Wert : 0-250 |
EE_Parameter.UnterspannungsWarnung = 95; // Wert : 0-250 // (160607Kr) |
EE_Parameter.NotGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
EE_Parameter.NotGasZeit = 20; // Wert : 0-250 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen |
EE_Parameter.UfoAusrichtung = 0; // X oder + Formation |
EE_Parameter.I_Faktor = 5; |
EE_Parameter.UserParam1 = 0; //zur freien Verwendung |
EE_Parameter.UserParam2 = 0; //zur freien Verwendung |
EE_Parameter.UserParam3 = 0; //zur freien Verwendung |
EE_Parameter.UserParam4 = 0; //zur freien Verwendung |
EE_Parameter.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
EE_Parameter.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
EE_Parameter.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
EE_Parameter.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
EE_Parameter.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
EE_Parameter.ServoNickRefresh = 5; |
memcpy(EE_Parameter.Name, "Kamera\0", 12); |
} |
//############################################################################ |
// Trägt ggf. das Poti als Parameter ein |
void ParameterZuordnung(void) |
//############################################################################ |
{ |
#define CHK_POTI(b,a,min,max) { if(a > 250) { if(a == 251) b = Poti1; else if(a == 252) b = Poti2; else if(a == 253) b = Poti3; else if(a == 254) b = Poti4;} else b = a; if(b <= min) b = min; else if(b >= max) b = max;} |
CHK_POTI(Parameter_MaxHoehe,EE_Parameter.MaxHoehe,0,255); |
CHK_POTI(Parameter_Luftdruck_D,EE_Parameter.Luftdruck_D,0,100); |
CHK_POTI(Parameter_Hoehe_P,EE_Parameter.Hoehe_P,0,100); |
CHK_POTI(Parameter_Hoehe_ACC_Wirkung,EE_Parameter.Hoehe_ACC_Wirkung,0,255); |
CHK_POTI(Parameter_KompassWirkung,EE_Parameter.KompassWirkung,0,255); |
CHK_POTI(Parameter_Gyro_P,EE_Parameter.Gyro_P,10,255); |
CHK_POTI(Parameter_Gyro_I,EE_Parameter.Gyro_I,0,255); |
CHK_POTI(Parameter_I_Faktor,EE_Parameter.I_Faktor,0,255); |
CHK_POTI(Parameter_UserParam1,EE_Parameter.UserParam1,0,255); |
CHK_POTI(Parameter_UserParam2,EE_Parameter.UserParam2,0,255); |
CHK_POTI(Parameter_UserParam3,EE_Parameter.UserParam3,0,255); |
CHK_POTI(Parameter_UserParam4,EE_Parameter.UserParam4,0,255); |
unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo |
unsigned char ServoNickCompInvert; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
unsigned char ServoNickMin; // Wert : 0-250 // Anschlag |
unsigned char ServoNickMax; // Wert : 0-250 // Anschlag |
CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
Ki = (float) Parameter_I_Faktor * 0.0001; |
MAX_GAS = EE_Parameter.Gas_Max; |
MIN_GAS = EE_Parameter.Gas_Min; |
} |
//############################################################################ |
// |
void MotorRegler(void) |
//############################################################################ |
{ |
int motorwert,pd_ergebnis,h,tmp_int; |
int GierMischanteil,GasMischanteil; |
static long SummeNick=0,SummeRoll=0; |
static long sollGier = 0,tmp_long,tmp_long2; |
static int IntegralFehlerNick = 0; |
static int IntegralFehlerRoll = 0; |
static unsigned int RcLostTimer; |
static unsigned char delay_neutral = 0; |
static unsigned char delay_einschalten = 0,delay_ausschalten = 0; |
static unsigned int modell_fliegt = 0; |
static int hoehenregler = 0; |
static char TimerWerteausgabe = 0; |
static char NeueKompassRichtungMerken = 0; |
Mittelwert(); |
GRN_ON; |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Gaswert ermitteln |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
GasMischanteil = PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] + 120; |
if(GasMischanteil < 0) GasMischanteil = 0; |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Emfang schlecht |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
if(SenderOkay < 100) |
{ |
if(!PcZugriff) beeptime = 500; |
if(RcLostTimer) RcLostTimer--; |
else |
{ |
MotorenEin = 0; |
Notlandung = 0; |
} |
ROT_ON; |
if(modell_fliegt > 2000) // wahrscheinlich in der Luft --> langsam absenken |
{ |
GasMischanteil = EE_Parameter.NotGas; |
Notlandung = 1; |
PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] = 0; |
/* Poti1 = 65; |
Poti2 = 48; |
Poti3 = 0; |
*/ } |
else MotorenEin = 0; |
} |
else |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Emfang gut |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
if(SenderOkay > 140) |
{ |
Notlandung = 0; |
RcLostTimer = EE_Parameter.NotGasZeit * 50; |
if(GasMischanteil > 40) |
{ |
if(modell_fliegt < 0xffff) modell_fliegt++; |
modell_fliegt_gps = modell_fliegt;// (030907Kr) |
} |
if((modell_fliegt < 200) || (GasMischanteil < 40)) |
{ |
SummeNick = 0; |
SummeRoll = 0; |
Mess_Integral_Gier = 0; |
Mess_Integral_Gier2 = 0; |
} |
if((GasMischanteil > 200) && MotorenEin == 0) |
{ |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// auf Nullwerte kalibrieren |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) // Neutralwerte |
{ |
unsigned char setting; |
if(++delay_neutral > 200) // nicht sofort |
{ |
GRN_OFF; |
SetNeutral(); |
MotorenEin = 0; |
delay_neutral = 0; |
modell_fliegt = 0; |
if(PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70 || abs(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]) > 70) |
{ |
if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < 70) setting = 1; |
if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 2; |
if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] < 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 3; |
if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] <-70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 4; |
if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] <-70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < 70) setting = 5; |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], setting); // aktiven Datensatz merken |
} |
ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
Piep(GetActiveParamSetNumber()); |
if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
{ |
if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset(); |
} |
} |
} |
else delay_neutral = 0; |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Gas ist unten |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
if(GasMischanteil < 35) |
{ |
// Starten |
if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] < -75) |
{ |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Einschalten |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
if(++delay_einschalten > 200) |
{ |
delay_einschalten = 200; |
modell_fliegt = 1; |
MotorenEin = 1; |
sollGier = 0; |
Mess_Integral_Gier = 0; |
Mess_Integral_Gier2 = 0; |
Mess_IntegralNick = 0; |
Mess_IntegralRoll = 0; |
Mess_IntegralNick2 = IntegralNick; |
Mess_IntegralRoll2 = IntegralRoll; |
SummeNick = 0; |
SummeRoll = 0; |
} |
} |
else delay_einschalten = 0; |
//Auf Neutralwerte setzen |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Auschalten |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) |
{ |
if(++delay_ausschalten > 200) // nicht sofort |
{ |
MotorenEin = 0; |
delay_ausschalten = 200; |
modell_fliegt = 0; |
} |
} |
else delay_ausschalten = 0; |
} |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// neue Werte von der Funke |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
if(!NewPpmData-- || Notlandung) |
{ |
ParameterZuordnung(); |
StickNick = PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_P; |
StickNick += PPM_diff[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_D; |
StickRoll = PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_P; |
StickRoll += PPM_diff[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_D; |
StickGier = -PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]; |
GyroFaktor = ((float)Parameter_Gyro_P + 10.0) / 256.0; |
IntegralFaktor = ((float) Parameter_Gyro_I) / 44000; |
if(EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) IntegralFaktor = 0; |
if(GyroFaktor < 0) GyroFaktor = 0; |
if(IntegralFaktor < 0) IntegralFaktor = 0; |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// LED Stuff |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
LED1_OFF; |
if(blinkcount_LED1 >= Parameter_UserParam4 && Parameter_UserParam4 > 0) |
{ |
LED1_FLASH; |
blinkcount_LED1 = 0; |
} |
blinkcount_LED1++; |
//if(PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] > 75) LED1_ON; else LED1_OFF; //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
//if(PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] > 75) LED2_ON; else LED2_OFF; //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Bei Empfangsausfall im Flug |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
if(Notlandung) |
{ |
StickGier = 0; |
StickNick = 0; |
StickRoll = 0; |
GyroFaktor = 0.1; |
IntegralFaktor = 0.005; |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Gyro-Drift kompensieren |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#define DRIFT_FAKTOR 3 |
if(ZaehlMessungen >= 1000 / DRIFT_FAKTOR) |
{ |
IntegralFehlerNick = IntegralNick2 - IntegralNick; |
IntegralFehlerRoll = IntegralRoll2 - IntegralRoll; |
ZaehlMessungen = 0; |
if(IntegralFehlerNick > 500/DRIFT_FAKTOR) AdNeutralNick++; |
if(IntegralFehlerNick < -500/DRIFT_FAKTOR) AdNeutralNick--; |
if(IntegralFehlerRoll > 500/DRIFT_FAKTOR) AdNeutralRoll++; |
if(IntegralFehlerRoll < -500/DRIFT_FAKTOR) AdNeutralRoll--; |
if(Mess_Integral_Gier2 > 500/DRIFT_FAKTOR) AdNeutralGier--; |
if(Mess_Integral_Gier2 <-500/DRIFT_FAKTOR) AdNeutralGier++; |
ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
Mess_IntegralNick2 = IntegralNick; |
Mess_IntegralRoll2 = IntegralRoll; |
Mess_Integral_Gier2 = Integral_Gier; |
ANALOG_ON; // ADC einschalten |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Integrale auf ACC-Signal abgleichen |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
tmp_long = (long)(IntegralNick / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccNick) / 16; |
tmp_long2 = (long)(IntegralRoll / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccRoll) / 16; |
#define AUSGLEICH 500 |
if(tmp_long > AUSGLEICH) tmp_long = AUSGLEICH; |
if(tmp_long < -AUSGLEICH) tmp_long =-AUSGLEICH; |
if(tmp_long2 > AUSGLEICH) tmp_long2 = AUSGLEICH; |
if(tmp_long2 <-AUSGLEICH) tmp_long2 =-AUSGLEICH; |
ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
Mess_IntegralNick -= tmp_long; |
Mess_IntegralRoll -= tmp_long2; |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Gieren |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
sollGier = StickGier; |
if(abs(StickGier) > 35) |
{ |
if(!(EE_Parameter.GlobalConfig & CFG_KOMPASS_FIX)) NeueKompassRichtungMerken = 1; |
} |
tmp_int = EE_Parameter.Gier_P * (sollGier * abs(sollGier)) / 256; // expo |
Mess_Integral_Gier -= tmp_int; |
if(Mess_Integral_Gier > 30000) Mess_Integral_Gier = 30000; // begrenzen |
if(Mess_Integral_Gier <-30000) Mess_Integral_Gier =-30000; |
ANALOG_ON; // ADC einschalten |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Kompass |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
if(KompassValue && (EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV)) |
{ |
if(NeueKompassRichtungMerken) |
{ |
KompassStartwert = KompassValue; |
NeueKompassRichtungMerken = 0; |
} |
ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
Mess_Integral_Gier -= (KompassRichtung * Parameter_KompassWirkung) / 32; // nach Kompass ausrichten |
ANALOG_ON; // ADC einschalten |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// GPS |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
if(EE_Parameter.GlobalConfig & CFG_GPS_AKTIV) |
{ |
P_GPS_Verstaerkung = Parameter_UserParam1; |
D_GPS_Verstaerkung = Parameter_UserParam2; |
Limit_D_Anteil = Parameter_UserParam3; |
gps_main(); |
} |
else |
{ |
GPS_Nick = 0; |
GPS_Roll = 0; |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Debugwerte zuordnen |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
DebugOut.Sekunden++; |
if(!TimerWerteausgabe--) |
{ |
<<<<<<< fc.c |
TimerWerteausgabe = 49; |
//++++++++ANFANG_Legende++++++++ |
/* |
DebugOut.Analog[0] = actualPos.GPSFix; |
DebugOut.Analog[1] = GPS_Nick; |
DebugOut.Analog[2] = GPS_Roll; |
DebugOut.Analog[3] = actualPos.northing; |
DebugOut.Analog[4] = actualPos.easting; |
DebugOut.Analog[5] = NORTH_MITTEL; |
DebugOut.Analog[6] = EAST_MITTEL; |
DebugOut.Analog[7] = Soll_Position_North; |
DebugOut.Analog[8] = Soll_Position_East; |
DebugOut.Analog[9] = GPS_Home_North; |
DebugOut.Analog[10] = GPS_Home_East; |
DebugOut.Analog[11] = GPS_Positionsabweichung_North; |
DebugOut.Analog[12] = GPS_Positionsabweichung_East; |
DebugOut.Analog[13] = Poti1; |
DebugOut.Analog[14] = Poti2; |
DebugOut.Analog[15] = KompassValue; |
*/ |
//++++++++ENDE_Legende++++++++ |
//++++++++ANFANG_Legende_1++++++++ |
DebugOut.Analog[0] = GPS_Roll; |
DebugOut.Analog[1] = GPS_Nick; |
DebugOut.Analog[2] = GPS_Positionsabweichung_North; |
DebugOut.Analog[3] = GPS_Positionsabweichung_East; |
DebugOut.Analog[4] = P_Einfluss_East; |
DebugOut.Analog[5] = D_Einfluss_East; |
DebugOut.Analog[6] = P_Einfluss_North; |
DebugOut.Analog[7] = D_Einfluss_North; |
DebugOut.Analog[8] = GPS_Geschwindigkeit_North; |
DebugOut.Analog[9] = GPS_Geschwindigkeit_East; |
DebugOut.Analog[10] = Parameter_UserParam1; |
DebugOut.Analog[11] = Parameter_UserParam2; |
DebugOut.Analog[12] = Soll_Position_North; |
DebugOut.Analog[13] = Soll_Position_East; |
DebugOut.Analog[14] = Poti6; |
DebugOut.Analog[15] = KompassValue; |
//++++++++ENDE_Legende_1++++++++ |
// DebugOut.Analog[xx] = actualPos.velNorth; |
// DebugOut.Analog[xx] = actualPos.velEast; |
// DebugOut.Analog[xx] = UBat; |
// DebugOut.Analog[xx] = 0; |
======= |
TimerWerteausgabe = 49; |
// DebugOut.Analog[0] = MesswertNick; |
// DebugOut.Analog[1] = MesswertRoll; |
// DebugOut.Analog[2] = MesswertGier; |
// DebugOut.Analog[0] = IntegralNick / EE_Parameter.GyroAccFaktor; |
// DebugOut.Analog[1] = IntegralRoll / EE_Parameter.GyroAccFaktor; |
DebugOut.Analog[0] = MM3.NickGrad; |
DebugOut.Analog[1] = MM3.RollGrad; |
DebugOut.Analog[2] = Mittelwert_AccNick; |
DebugOut.Analog[3] = Mittelwert_AccRoll; |
DebugOut.Analog[4] = MesswertGier; |
DebugOut.Analog[5] = HoehenWert; |
DebugOut.Analog[6] = (Mess_Integral_Hoch / 512); |
DebugOut.Analog[7] = GasMischanteil; |
DebugOut.Analog[8] = KompassValue; |
//DebugOut.Analog[8] = MM3_heading(); |
DebugOut.Analog[9] = MM3.x_axis; |
DebugOut.Analog[10] = MM3.y_axis; |
DebugOut.Analog[11] = MM3.z_axis; |
// DebugOut.Analog[9] = SollHoehe; |
// DebugOut.Analog[10] = Mess_Integral_Gier / 128; |
// DebugOut.Analog[11] = KompassStartwert; |
// DebugOut.Analog[10] = Parameter_Gyro_I; |
// DebugOut.Analog[10] = EE_Parameter.Gyro_I; |
// DebugOut.Analog[9] = KompassRichtung; |
// DebugOut.Analog[10] = GasMischanteil; |
// DebugOut.Analog[3] = HoeheD * 32; |
// DebugOut.Analog[4] = hoehenregler; |
>>>>>>> 1.1.14.1 |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Drehgeschwindigkeit und -winkel zu einem Istwert zusammenfassen |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
MesswertNick = IntegralNick * IntegralFaktor + MesswertNick * GyroFaktor; |
MesswertRoll = IntegralRoll * IntegralFaktor + MesswertRoll * GyroFaktor; |
MesswertGier = MesswertGier * (GyroFaktor/2) + Integral_Gier * IntegralFaktor; |
// Maximalwerte abfangen |
#define MAX_SENSOR 2048 |
if(MesswertNick > MAX_SENSOR) MesswertNick = MAX_SENSOR; |
if(MesswertNick < -MAX_SENSOR) MesswertNick = -MAX_SENSOR; |
if(MesswertRoll > MAX_SENSOR) MesswertRoll = MAX_SENSOR; |
if(MesswertRoll < -MAX_SENSOR) MesswertRoll = -MAX_SENSOR; |
if(MesswertGier > MAX_SENSOR) MesswertGier = MAX_SENSOR; |
if(MesswertGier < -MAX_SENSOR) MesswertGier = -MAX_SENSOR; |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Höhenregelung |
// Die Höhenregelung schwächt lediglich das Gas ab, erhöht es allerdings nicht |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//OCR0B = 180 - (Poti1 + 120) / 4; |
//DruckOffsetSetting = OCR0B; |
if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung |
{ |
int tmp_int; |
if(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER) // Regler wird über Schalter gesteuert |
{ |
if(Parameter_MaxHoehe < 50) |
{ |
SollHoehe = HoehenWert - 40; // Parameter_MaxHoehe ist der PPM-Wert des Schalters // (160607Kr) |
HoehenReglerAktiv = 0; |
} |
else |
HoehenReglerAktiv = 1; |
} |
else |
{ |
SollHoehe = Parameter_MaxHoehe * EE_Parameter.Hoehe_Verstaerkung - 40; // (160607Kr) |
HoehenReglerAktiv = 1; |
} |
if(Notlandung) SollHoehe = 0; |
h = HoehenWert; |
if((h > SollHoehe) && HoehenReglerAktiv) // zu hoch --> drosseln |
{ h = ((h - SollHoehe) * (int) Parameter_Hoehe_P) / 16; // Differenz bestimmen --> P-Anteil |
h = GasMischanteil - h; // vom Gas abziehen |
h -= (HoeheD * Parameter_Luftdruck_D)/8; // D-Anteil |
tmp_int = ((Mess_Integral_Hoch / 512) * (signed long) Parameter_Hoehe_ACC_Wirkung) / 32; |
if(tmp_int > 50) tmp_int = 50; |
else if(tmp_int < -50) tmp_int = -50; |
h -= tmp_int; |
hoehenregler = (hoehenregler*15 + h) / 16; |
if(hoehenregler < EE_Parameter.Hoehe_MinGas) // nicht unter MIN |
{ |
if(GasMischanteil >= EE_Parameter.Hoehe_MinGas) hoehenregler = EE_Parameter.Hoehe_MinGas; |
if(GasMischanteil < EE_Parameter.Hoehe_MinGas) hoehenregler = GasMischanteil; |
} |
if(hoehenregler > GasMischanteil) hoehenregler = GasMischanteil; // nicht mehr als Gas |
GasMischanteil = hoehenregler; |
} |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Mischer und PI-Regler |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Gier-Anteil |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
GierMischanteil = MesswertGier - sollGier; // Regler für Gier |
if(GierMischanteil > 100) GierMischanteil = 100; |
if(GierMischanteil < -100) GierMischanteil = -100; |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Nick-Achse |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
DiffNick = Kp * (MesswertNick - (StickNick - GPS_Nick)); // Differenz bestimmen |
SummeNick += DiffNick; // I-Anteil |
if(SummeNick > 0) SummeNick-= (abs(SummeNick)/256 + 1); else SummeNick += abs(SummeNick)/256 + 1; |
if(SummeNick > 16000) SummeNick = 16000; |
if(SummeNick < -16000) SummeNick = -16000; |
pd_ergebnis = DiffNick + Ki * SummeNick; // PI-Regler für Nick |
// Motor Vorn |
motorwert = GasMischanteil + pd_ergebnis + GierMischanteil; // Mischer |
if ((motorwert < 0) | (GasMischanteil < 10)) motorwert = 0; |
else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
Motor_Vorne = motorwert; |
// Motor Heck |
motorwert = GasMischanteil - pd_ergebnis + GierMischanteil; |
if ((motorwert < 0) | (GasMischanteil < 10)) motorwert = 0; |
else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
Motor_Hinten = motorwert; |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Roll-Achse |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
DiffRoll = Kp * (MesswertRoll - (StickRoll - GPS_Roll)); // Differenz bestimmen |
SummeRoll += DiffRoll; // I-Anteil |
if(SummeRoll > 0) SummeRoll-= (abs(SummeRoll)/256 + 1); else SummeRoll += abs(SummeRoll)/256 + 1; |
if(SummeRoll > 16000) SummeRoll = 16000; |
if(SummeRoll < -16000) SummeRoll = -16000; |
pd_ergebnis = DiffRoll + Ki * SummeRoll; // PI-Regler für Roll |
// Motor Links |
motorwert = GasMischanteil + pd_ergebnis - GierMischanteil; |
if ((motorwert < 0) | (GasMischanteil < 10)) motorwert = 0; |
else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
Motor_Links = motorwert; |
// Motor Rechts |
motorwert = GasMischanteil - pd_ergebnis - GierMischanteil; |
if ((motorwert < 0) | (GasMischanteil < 10)) motorwert = 0; |
else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
Motor_Rechts = motorwert; |
// +++++++++++++++++++++++++++++++++++++++++++++++ |
} |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/fc.h |
---|
0,0 → 1,111 |
/*####################################################################################### |
Flight Control |
#######################################################################################*/ |
#ifndef _FC_H |
#define _FC_H |
extern volatile unsigned char Timeout; |
extern unsigned char Sekunde,Minute; |
extern volatile long IntegralNick,IntegralNick2; |
extern volatile long IntegralRoll,IntegralRoll2; |
extern volatile long Mess_IntegralNick,Mess_IntegralNick2; |
extern volatile long Mess_IntegralRoll,Mess_IntegralRoll2; |
extern volatile long Mess_Integral_Hoch; |
extern volatile long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2; |
extern volatile int KompassValue; |
extern volatile int KompassStartwert; |
extern volatile int KompassRichtung; |
extern int HoehenWert; |
extern int SollHoehe; |
extern volatile int MesswertNick,MesswertRoll,MesswertGier; |
extern volatile int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll; |
extern volatile int NeutralAccX, NeutralAccY,Mittelwert_AccHoch; |
extern volatile float NeutralAccZ; |
extern unsigned int modell_fliegt_gps;//(030907Kr) |
extern unsigned char Limit_D_Anteil;//(210907Kr) |
void MotorRegler(void); |
void SendMotorData(void); |
void CalibrierMittelwert(void); |
void Mittelwert(void); |
void SetNeutral(void); |
void Piep(unsigned char Anzahl); |
void DefaultKonstanten1(void); |
void DefaultKonstanten2(void); |
unsigned char h,m,s; |
volatile unsigned char Timeout ; |
unsigned char CosinusNickWinkel, CosinusRollWinkel; |
volatile long IntegralNick,IntegralNick2; |
volatile long IntegralRoll,IntegralRoll2; |
volatile long Integral_Gier; |
volatile long Mess_IntegralNick,Mess_IntegralNick2; |
volatile long Mess_IntegralRoll,Mess_IntegralRoll2; |
volatile long Mess_Integral_Gier; |
volatile int DiffNick,DiffRoll; |
extern int Poti1, Poti2, Poti3, Poti4, Poti5, Poti6, Poti7, Poti8; |
volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
unsigned char MotorWert[5]; |
volatile unsigned char SenderOkay; |
int StickNick,StickRoll,StickGier; |
char MotorenEin; |
extern void DefaultKonstanten(void); |
#define STRUCT_PARAM_LAENGE 58 |
struct mk_param_struct |
{ |
unsigned char Kanalbelegung[8]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3 |
unsigned char GlobalConfig; // 0x01=Höhenregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv |
unsigned char Hoehe_MinGas; // Wert : 0-100 |
unsigned char Luftdruck_D; // Wert : 0-250 |
unsigned char MaxHoehe; // Wert : 0-32 |
unsigned char Hoehe_P; // Wert : 0-32 |
unsigned char Hoehe_Verstaerkung; // Wert : 0-50 |
unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250 |
unsigned char Stick_P; // Wert : 1-6 |
unsigned char Stick_D; // Wert : 0-64 |
unsigned char Gier_P; // Wert : 1-20 |
unsigned char Gas_Min; // Wert : 0-32 |
unsigned char Gas_Max; // Wert : 33-250 |
unsigned char GyroAccFaktor; // Wert : 1-64 |
unsigned char KompassWirkung; // Wert : 0-32 |
unsigned char Gyro_P; // Wert : 10-250 |
unsigned char Gyro_I; // Wert : 0-250 |
unsigned char UnterspannungsWarnung; // Wert : 0-250 |
unsigned char NotGas; // Wert : 0-250 //Gaswert bei Empängsverlust |
unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen |
unsigned char UfoAusrichtung; // X oder + Formation |
unsigned char I_Faktor; // Wert : 0-250 |
unsigned char UserParam1; // Wert : 0-250 |
unsigned char UserParam2; // Wert : 0-250 |
unsigned char UserParam3; // Wert : 0-250 |
unsigned char UserParam4; // Wert : 0-250 |
unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos |
unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo |
unsigned char ServoNickMin; // Wert : 0-250 // Anschlag |
unsigned char ServoNickMax; // Wert : 0-250 // Anschlag |
unsigned char ServoNickRefresh; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
unsigned char ServoNickCompInvert; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
unsigned char Reserved[7]; |
char Name[12]; |
}; |
extern struct mk_param_struct EE_Parameter; |
extern unsigned char Parameter_Luftdruck_D; |
extern unsigned char Parameter_MaxHoehe; |
extern unsigned char Parameter_Hoehe_P; |
extern unsigned char Parameter_Hoehe_ACC_Wirkung; |
extern unsigned char Parameter_KompassWirkung; |
extern unsigned char Parameter_Gyro_P; |
extern unsigned char Parameter_Gyro_I; |
extern unsigned char Parameter_Gier_P; |
extern unsigned char Parameter_ServoNickControl; |
#endif //_FC_H |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/flight-ctrl_mega644_v0_60.aws |
---|
0,0 → 1,0 |
<AVRWorkspace><IOSettings><CurrentRegisters/></IOSettings><part name="ATMEGA644"/><Files><File00000 Name="E:\hubi\ufo\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\alpha\v060JokoKompassAcc\main.c" Position="330 71 1042 624" LineCol="17 0" State="Maximized"/><File00001 Name="E:\hubi\ufo\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\alpha\v060JokoKompassAcc\compass.c" Position="324 63 1036 616" LineCol="17 0" State="Maximized"/><File00002 Name="E:\hubi\ufo\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\alpha\v060JokoKompassAcc\makefile" Position="327 65 1039 618" LineCol="6 0" State="Maximized"/><File00003 Name="E:\hubi\ufo\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\alpha\v060JokoKompassAcc\GPS.c" Position="400 156 950 528" LineCol="6 0" State="Maximized"/><File00004 Name="E:\hubi\ufo\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\alpha\v060JokoKompassAcc\gps.h" Position="422 178 972 550" LineCol="20 0" State="Maximized"/><File00005 Name="E:\hubi\ufo\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\alpha\v060JokoKompassAcc\compass.h" Position="444 200 994 572" LineCol="0 0" State="Maximized"/><File00006 Name="E:\hubi\ufo\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\alpha\v060JokoKompassAcc\math.c" Position="466 222 1016 594" LineCol="155 0" State="Maximized"/><File00007 Name="E:\hubi\ufo\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\alpha\v060JokoKompassAcc\math.h" Position="330 67 1042 620" LineCol="12 0" State="Maximized"/><File00008 Name="E:\hubi\ufo\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\alpha\v060JokoKompassAcc\main.h" Position="336 71 1182 830" LineCol="0 0" State="Maximized"/></Files></AVRWorkspace> |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/flight.pnproj |
---|
0,0 → 1,0 |
<Project name="Flight-Ctrl"><File path="uart.h"></File><File path="main.c"></File><File path="main.h"></File><File path="makefile"></File><File path="uart.c"></File><File path="printf_P.h"></File><File path="printf_P.c"></File><File path="timer0.c"></File><File path="timer0.h"></File><File path="old_macros.h"></File><File path="twimaster.c"></File><File path="version.txt"></File><File path="twimaster.h"></File><File path="rc.c"></File><File path="rc.h"></File><File path="fc.h"></File><File path="fc.c"></File><File path="menu.h"></File><File path="menu.c"></File><File path="_Settings.h"></File><File path="analog.c"></File><File path="analog.h"></File><File path="GPS.c"></File><File path="gps.h"></File><File path="License.txt"></File><File path="math.c"></File><File path="math.h"></File><File path="compass.c"></File><File path="compass.h"></File></Project> |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/flight.pnps |
---|
0,0 → 1,0 |
<pd><ViewState><e p="Flight-Ctrl" x="true"></e></ViewState></pd> |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/gps.h |
---|
0,0 → 1,29 |
extern long P_Einfluss_North; |
extern long D_Einfluss_North; |
extern long P_Einfluss_East; |
extern long D_Einfluss_East; |
extern long GPS_Positionsabweichung_North; |
extern long GPS_Positionsabweichung_East; |
extern long GPS_Geschwindigkeit_North; |
extern long GPS_Geschwindigkeit_East; |
extern long GPS_Home_North; |
extern long GPS_Home_East; |
extern long Soll_Position_North; |
extern long Soll_Position_East; |
extern volatile long EAST_MITTEL; |
extern volatile long NORTH_MITTEL; |
extern signed int GPS_Nick; |
extern signed int GPS_Roll; |
extern void GPS_Neutral(void); |
extern void GPS_BerechneZielrichtung(void); |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/license_buss.txt |
---|
0,0 → 1,52 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + Nur für den privaten Gebrauch |
// + www.MikroKopter.com |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
// + dass eine Nutzung (auch auszugsweise) nur für den privaten und nichtkommerziellen Gebrauch zulässig ist. |
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
// + bzgl. der Nutzungsbedingungen aufzunehmen. |
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
// + Verkauf von Luftbildaufnahmen, usw. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
// + eindeutig als Ursprung verlinkt und genannt werden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
// + Benutzung auf eigene Gefahr |
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
// + mit unserer Zustimmung zulässig |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
// + this list of conditions and the following disclaimer. |
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
// + from this software without specific prior written permission. |
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
// + for non-profit use (directly or indirectly) |
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
// + with our written permission |
// + * If sources or documentations are redistributet, our webpage (http://www.MikroKopter.de) must be |
// + clearly linked and named as origin |
// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/main.c |
---|
0,0 → 1,213 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + Nur für den privaten Gebrauch |
// + www.MikroKopter.com |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
// + dass eine Nutzung (auch auszugsweise) nur für den privaten und nicht-kommerziellen Gebrauch zulässig ist. |
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
// + bzgl. der Nutzungsbedingungen aufzunehmen. |
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
// + Verkauf von Luftbildaufnahmen, usw. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
// + auf anderen Webseiten oder Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
// + eindeutig als Ursprung verlinkt und genannt werden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
// + Benutzung auf eigene Gefahr |
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
// + mit unserer Zustimmung zulässig |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
// + this list of conditions and the following disclaimer. |
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
// + from this software without specific prior written permission. |
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
// + for non-commercial use (directly or indirectly) |
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
// + with our written permission |
// + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
// + clearly linked as origin |
// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
unsigned char EEPromArray[E2END+1] EEMEM; |
// -- Parametersatz aus EEPROM lesen --- |
// number [0..5] |
void ReadParameterSet(unsigned char number, unsigned char *buffer, unsigned char length) |
{ |
if (number > 5) number = 5; |
eeprom_read_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * number], length); |
} |
// -- Parametersatz ins EEPROM schreiben --- |
// number [0..5] |
void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length) |
{ |
if (number > 5) number = 5; |
eeprom_write_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * number], length); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], number); // diesen Parametersatz als aktuell merken |
} |
unsigned char GetActiveParamSetNumber(void) |
{ |
return(eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET])); |
} |
//############################################################################ |
//Hauptprogramm |
int main (void) |
//############################################################################ |
{ |
unsigned int timer; |
unsigned int timer2 = 0; |
DDRC = 0x01; // SCL |
PORTC = 0xff; // Pullup SDA |
DDRB = 0x1B; // LEDs und Druckoffset |
PORTB |= (1<<PB0); // LED_Rot |
DDRD = 0x3E; // Speaker & TXD & J3 J4 J5 |
DDRD |= (1<<PD7); // J7 |
PORTD = 0xF7; |
MCUSR &=~(1<<WDRF); |
WDTCSR |= (1<<WDCE)|(1<<WDE); |
WDTCSR = 0; |
beeptime = 2000; |
StickGier = 0; PPM_in[K_GAS] = 0;StickRoll = 0; StickNick = 0; |
ROT_OFF; |
Timer_Init(); |
UART_Init(); |
rc_sum_init(); |
ADC_Init(); |
i2c_init(); |
init_spi(); |
sei(); |
VersionInfo.Hauptversion = VERSION_HAUPTVERSION; |
VersionInfo.Nebenversion = VERSION_NEBENVERSION; |
VersionInfo.PCKompatibel = VERSION_KOMPATIBEL; |
printf("\n\rFlightControl V%d.%d ", VERSION_HAUPTVERSION, VERSION_NEBENVERSION); |
printf("\n\r=============================="); |
GRN_ON; |
if(eeprom_read_byte(&EEPromArray[EEPROM_ADR_VALID]) != 59) // seit V 0.60 |
{ |
printf("\n\rInit. EEPROM: Generiere Default-Parameter..."); |
DefaultKonstanten1(); |
for (unsigned char i=0;i<6;i++) |
{ |
if(i==2) DefaultKonstanten2(); |
WriteParameterSet(i, (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
} |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], 1); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_VALID], 59); |
} |
ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
printf("\n\rBenutze Parametersatz %d", GetActiveParamSetNumber()); |
if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
printf("\n\rAbgleich Luftdrucksensor.."); |
timer = SetDelay(2500); |
SucheLuftruckOffset(); |
while (!CheckDelay(timer)); |
printf("OK\n\r"); |
} |
SetNeutral(); |
ROT_OFF; |
beeptime = 2000; |
DebugIn.Analog[1] = 1000; |
DebugIn.Digital[0] = 0x55; |
printf("\n\rSteuerung: "); |
if (EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) printf("HeadingHold"); |
else printf("Neutral"); |
printf("\n\n\r"); |
LcdClear(); |
while (1) |
{ |
if (UpdateMotor) // ReglerIntervall |
{ |
UpdateMotor=0; |
MotorRegler(); |
SendMotorData(); |
ROT_OFF; |
if(PcZugriff) PcZugriff--; |
if(SenderOkay) SenderOkay--; |
if (UBat < EE_Parameter.UnterspannungsWarnung) |
{ |
beeptime = 2000; |
} |
if(!Timeout) |
{ |
i2c_init(); |
} |
else |
{ |
ROT_OFF; |
} |
} |
if(SIO_DEBUG) |
{ |
DatenUebertragung(); |
BearbeiteRxDaten(); |
} |
else BearbeiteRxDaten(); |
if(CheckDelay(timer2)) |
{ |
if(MotorenEin) PORTC ^= 0x10; else PORTC &= ~0x10; |
timer = SetDelay(500); |
} |
} |
return (1); |
} |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/main.h |
---|
0,0 → 1,100 |
#ifndef _MAIN_H |
#define _MAIN_H |
//Hier die Quarz Frequenz einstellen |
#if defined (__AVR_ATmega32__) |
#define SYSCLK 20000000L //Quarz Frequenz in Hz |
#endif |
#if defined (__AVR_ATmega644__) |
#define SYSCLK 20000000L //Quarz Frequenz in Hz |
//#define SYSCLK 16000000L //Quarz Frequenz in Hz |
#endif |
// neue Hardware |
#define ROT_OFF PORTB &=~0x01 |
#define ROT_ON PORTB |= 0x01 |
#define ROT_FLASH PORTB ^= 0x01 |
#define GRN_OFF PORTB &=~0x02 |
#define GRN_ON PORTB |= 0x02 |
#define GRN_FLASH PORTB ^= 0x02 //ACHTUNG: HIER SCHIEN NOCH EIN FEHLER IM AUSGEWÄHLTEN PORT ZU BESTEHEN. URSPRÜNGLICH WAR PORTD UND NICHT PORTB DEFINIERT // (280807Kr) |
#define LED1_OFF PORTC &=~0x04 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED1_ON PORTC |= 0x04 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED1_FLASH PORTC ^= 0x04 //Erweiterung by 4ndreas aus mikrosvn branches // (280807Kr) |
#define LED2_OFF PORTC &=~0x08 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED2_ON PORTC |= 0x08 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED2_FLASH PORTC ^= 0x08 //Erweiterung by 4ndreas aus mikrosvn branches // (280807Kr) |
//#ifndef F_CPU |
//#error ################## F_CPU nicht definiert oder ungültig ############# |
//#endif |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//#define ANZ_MITTELWERT 4 |
#define EEPROM_ADR_VALID 1 |
#define EEPROM_ADR_ACTIVE_SET 2 |
#define EEPROM_ADR_PARAM_BEGIN 100 |
#define CFG_HOEHENREGELUNG 0x01 |
#define CFG_HOEHEN_SCHALTER 0x02 |
#define CFG_HEADING_HOLD 0x04 |
#define CFG_KOMPASS_AKTIV 0x08 |
#define CFG_KOMPASS_FIX 0x10 |
#define CFG_GPS_AKTIV 0x20 |
//#define SYSCLK |
//extern unsigned long SYSCLK; |
extern volatile int i_Nick[20],i_Roll[20],DiffNick,DiffRoll; |
extern volatile unsigned char SenderOkay; |
extern unsigned char CosinusNickWinkel, CosinusRollWinkel; |
extern void ReadParameterSet (unsigned char number, unsigned char *buffer, unsigned char length); |
extern void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length); |
extern unsigned char GetActiveParamSetNumber(void); |
extern unsigned char EEPromArray[]; |
long durchschnitt_northing; |
long durchschnitt_easting; |
volatile int P_GPS_Verstaerkung; //P-Anteil (80-120) |
volatile int D_GPS_Verstaerkung; //D-Anteil (90) |
#include <stdlib.h> |
#include <string.h> |
#include <avr/io.h> |
#include <avr/pgmspace.h> |
#include <avr/interrupt.h> |
#include <avr/eeprom.h> |
#include <avr/boot.h> |
#include <avr/wdt.h> |
#include "old_macros.h" |
#include "_Settings.h" |
#include "printf_P.h" |
#include "compass.h" |
#include "timer0.h" |
#include "uart.h" |
#include "analog.h" |
#include "twimaster.h" |
#include "menu.h" |
#include "rc.h" |
#include "fc.h" |
#include "gps.h" |
#include "math.h" |
#ifndef EEMEM |
#define EEMEM __attribute__ ((section (".eeprom"))) |
#endif |
#define DEBUG_DISPLAY_INTERVALL 123 // in ms |
#define DELAY_US(x) ((unsigned int)( (x) * 1e-6 * F_CPU )) |
#endif //_MAIN_H |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/makefile |
---|
0,0 → 1,392 |
#-------------------------------------------------------------------- |
# MCU name |
MCU = atmega644 |
F_CPU = 20000000 |
#------------------------------------------------------------------- |
HAUPT_VERSION = 0 |
NEBEN_VERSION = 60 |
VERSION_KOMPATIBEL = 4 # PC-Kompatibilität |
#------------------------------------------------------------------- |
ifeq ($(MCU), atmega32) |
# FUSE_SETTINGS= -u -U lfuse:w:0xff:m -U hfuse:w:0xcf:m |
HEX_NAME = MEGA32 |
endif |
ifeq ($(MCU), atmega644) |
FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
#FUSE_SETTINGS = -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
# -u bei neuen Controllern wieder einspielen |
HEX_NAME = MEGA644 |
endif |
ifeq ($(F_CPU), 16000000) |
QUARZ = 16MHZ |
endif |
ifeq ($(F_CPU), 20000000) |
QUARZ = 20MHZ |
endif |
# Output format. (can be srec, ihex, binary) |
FORMAT = ihex |
# Target file name (without extension). |
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION) |
# Optimization level, can be [0, 1, 2, 3, s]. 0 turns off optimization. |
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.) |
OPT = s |
########################################################################################################## |
# List C source files here. (C dependencies are automatically generated.) |
SRC = main.c uart.c printf_P.c timer0.c analog.c menu.c compass.c math.c |
SRC += twimaster.c rc.c fc.c GPS.c |
########################################################################################################## |
# List Assembler source files here. |
# Make them always end in a capital .S. Files ending in a lowercase .s |
# will not be considered source files but generated files (assembler |
# output from the compiler), and will be deleted upon "make clean"! |
# Even though the DOS/Win* filesystem matches both .s and .S the same, |
# it will preserve the spelling of the filenames, and gcc itself does |
# care about how the name is spelled on its command-line. |
ASRC = |
# List any extra directories to look for include files here. |
# Each directory must be seperated by a space. |
EXTRAINCDIRS = |
# Optional compiler flags. |
# -g: generate debugging information (for GDB, or for COFF conversion) |
# -O*: optimization level |
# -f...: tuning, see gcc manual and avr-libc documentation |
# -Wall...: warning level |
# -Wa,...: tell GCC to pass this to the assembler. |
# -ahlms: create assembler listing |
CFLAGS = -O$(OPT) \ |
-funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums \ |
-Wall -Wstrict-prototypes \ |
-mtiny-stack -mcall-prologues \ |
-Wa,-adhlns=$(<:.c=.lst) \ |
$(patsubst %,-I%,$(EXTRAINCDIRS)) |
# Set a "language standard" compiler flag. |
# Unremark just one line below to set the language standard to use. |
# gnu99 = C99 + GNU extensions. See GCC manual for more information. |
#CFLAGS += -std=c89 |
#CFLAGS += -std=gnu89 |
#CFLAGS += -std=c99 |
CFLAGS += -std=gnu99 |
CFLAGS += -DVERSION_HAUPTVERSION=$(HAUPT_VERSION) -DVERSION_NEBENVERSION=$(NEBEN_VERSION) -DVERSION_KOMPATIBEL=$(VERSION_KOMPATIBEL) |
# Optional assembler flags. |
# -Wa,...: tell GCC to pass this to the assembler. |
# -ahlms: create listing |
# -gstabs: have the assembler create line number information; note that |
# for use in COFF files, additional information about filenames |
# and function names needs to be present in the assembler source |
# files -- see avr-libc docs [FIXME: not yet described there] |
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs |
# Optional linker flags. |
# -Wl,...: tell GCC to pass this to linker. |
# -Map: create map file |
# --cref: add cross reference to map file |
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref |
# Additional libraries |
# Minimalistic printf version |
#LDFLAGS += -Wl,-u,vfprintf -lprintf_min |
# Floating point printf version (requires -lm below) |
#LDFLAGS += -Wl,-u,vfprintf -lprintf_flt |
# -lm = math library |
LDFLAGS += -lm |
##LDFLAGS += -T./linkerfile/avr5.x |
# Programming support using avrdude. Settings and variables. |
# Programming hardware: alf avr910 avrisp bascom bsd |
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500 |
# |
# Type: avrdude -c ? |
# to get a full listing. |
# |
#AVRDUDE_PROGRAMMER = stk200 |
AVRDUDE_PROGRAMMER = dt006 |
#AVRDUDE_PROGRAMMER = ponyser |
#falls Ponyser ausgewählt wird, muss sich unsere avrdude-Configdatei im Bin-Verzeichnis des Compilers befinden |
#AVRDUDE_PORT = com1 # programmer connected to serial device |
AVRDUDE_PORT = lpt1 # programmer connected to parallel port |
#AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex |
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex $(FUSE_SETTINGS) |
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep |
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) |
# Uncomment the following if you want avrdude's erase cycle counter. |
# Note that this counter needs to be initialized first using -Yn, |
# see avrdude manual. |
#AVRDUDE_ERASE += -y |
# Uncomment the following if you do /not/ wish a verification to be |
# performed after programming the device. |
AVRDUDE_FLAGS += -V |
# Increase verbosity level. Please use this when submitting bug |
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> |
# to submit bug reports. |
#AVRDUDE_FLAGS += -v -v |
# --------------------------------------------------------------------------- |
# Define directories, if needed. |
DIRAVR = c:/winavr |
DIRAVRBIN = $(DIRAVR)/bin |
DIRAVRUTILS = $(DIRAVR)/utils/bin |
DIRINC = . |
DIRLIB = $(DIRAVR)/avr/lib |
# Define programs and commands. |
SHELL = sh |
CC = avr-gcc |
OBJCOPY = avr-objcopy |
OBJDUMP = avr-objdump |
SIZE = avr-size |
# Programming support using avrdude. |
AVRDUDE = avrdude |
REMOVE = rm -f |
COPY = cp |
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex |
ELFSIZE = $(SIZE) -A $(TARGET).elf |
# Define Messages |
# English |
MSG_ERRORS_NONE = Errors: none |
MSG_BEGIN = -------- begin -------- |
MSG_END = -------- end -------- |
MSG_SIZE_BEFORE = Size before: |
MSG_SIZE_AFTER = Size after: |
MSG_COFF = Converting to AVR COFF: |
MSG_EXTENDED_COFF = Converting to AVR Extended COFF: |
MSG_FLASH = Creating load file for Flash: |
MSG_EEPROM = Creating load file for EEPROM: |
MSG_EXTENDED_LISTING = Creating Extended Listing: |
MSG_SYMBOL_TABLE = Creating Symbol Table: |
MSG_LINKING = Linking: |
MSG_COMPILING = Compiling: |
MSG_ASSEMBLING = Assembling: |
MSG_CLEANING = Cleaning project: |
# Define all object files. |
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o) |
# Define all listing files. |
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst) |
# Combine all necessary flags and optional flags. |
# Add target processor to flags. |
#ALL_CFLAGS = -mmcu=$(MCU) -DF_CPU=$(F_CPU) -I. $(CFLAGS) |
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) |
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) |
# Default target. |
all: begin gccversion sizebefore $(TARGET).elf $(TARGET).hex $(TARGET).eep \ |
$(TARGET).lss $(TARGET).sym sizeafter finished end |
# Eye candy. |
# AVR Studio 3.x does not check make's exit code but relies on |
# the following magic strings to be generated by the compile job. |
begin: |
@echo |
@echo $(MSG_BEGIN) |
finished: |
@echo $(MSG_ERRORS_NONE) |
end: |
@echo $(MSG_END) |
@echo |
# Display size of file. |
sizebefore: |
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi |
sizeafter: |
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi |
# Display compiler version information. |
gccversion : |
@$(CC) --version |
# Convert ELF to COFF for use in debugging / simulating in |
# AVR Studio or VMLAB. |
COFFCONVERT=$(OBJCOPY) --debugging \ |
--change-section-address .data-0x800000 \ |
--change-section-address .bss-0x800000 \ |
--change-section-address .noinit-0x800000 \ |
--change-section-address .eeprom-0x810000 |
coff: $(TARGET).elf |
@echo |
@echo $(MSG_COFF) $(TARGET).cof |
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof |
extcoff: $(TARGET).elf |
@echo |
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof |
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof |
# Program the device. |
program: $(TARGET).hex $(TARGET).eep |
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) |
# Create final output files (.hex, .eep) from ELF output file. |
%.hex: %.elf |
@echo |
@echo $(MSG_FLASH) $@ |
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ |
%.eep: %.elf |
@echo |
@echo $(MSG_EEPROM) $@ |
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ |
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@ |
# Create extended listing file from ELF output file. |
%.lss: %.elf |
@echo |
@echo $(MSG_EXTENDED_LISTING) $@ |
$(OBJDUMP) -h -S $< > $@ |
# Create a symbol table from ELF output file. |
%.sym: %.elf |
@echo |
@echo $(MSG_SYMBOL_TABLE) $@ |
avr-nm -n $< > $@ |
# Link: create ELF output file from object files. |
.SECONDARY : $(TARGET).elf |
.PRECIOUS : $(OBJ) |
%.elf: $(OBJ) |
@echo |
@echo $(MSG_LINKING) $@ |
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS) |
# Compile: create object files from C source files. |
%.o : %.c |
@echo |
@echo $(MSG_COMPILING) $< |
$(CC) -c $(ALL_CFLAGS) $< -o $@ |
# Compile: create assembler files from C source files. |
%.s : %.c |
$(CC) -S $(ALL_CFLAGS) $< -o $@ |
# Assemble: create object files from assembler source files. |
%.o : %.S |
@echo |
@echo $(MSG_ASSEMBLING) $< |
$(CC) -c $(ALL_ASFLAGS) $< -o $@ |
# Target: clean project. |
clean: begin clean_list finished end |
clean_list : |
@echo |
@echo $(MSG_CLEANING) |
# $(REMOVE) $(TARGET).hex |
$(REMOVE) $(TARGET).eep |
$(REMOVE) $(TARGET).obj |
$(REMOVE) $(TARGET).cof |
$(REMOVE) $(TARGET).elf |
$(REMOVE) $(TARGET).map |
$(REMOVE) $(TARGET).obj |
$(REMOVE) $(TARGET).a90 |
$(REMOVE) $(TARGET).sym |
$(REMOVE) $(TARGET).lnk |
$(REMOVE) $(TARGET).lss |
$(REMOVE) $(OBJ) |
$(REMOVE) $(LST) |
$(REMOVE) $(SRC:.c=.s) |
$(REMOVE) $(SRC:.c=.d) |
# Automatically generate C source code dependencies. |
# (Code originally taken from the GNU make user manual and modified |
# (See README.txt Credits).) |
# |
# Note that this will work with sh (bash) and sed that is shipped with WinAVR |
# (see the SHELL variable defined above). |
# This may not work with other shells or other seds. |
# |
%.d: %.c |
set -e; $(CC) -MM $(ALL_CFLAGS) $< \ |
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > $@; \ |
[ -s $@ ] || rm -f $@ |
# Remove the '-' if you want to see the dependency files generated. |
-include $(SRC:.c=.d) |
# Listing of phony targets. |
.PHONY : all begin finish end sizebefore sizeafter gccversion coff extcoff \ |
clean clean_list program |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/math.c |
---|
0,0 → 1,182 |
/* |
Copyright 2007, Niklas Nold |
This program (files math.c and math.h) is free software; you can redistribute it and/or modify |
it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; |
either version 3 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
Please note: All the other files for the project "Mikrokopter" by H. Buss are under the license (license_buss.txt) published by www.mikrokopter.de |
*/ |
#include "main.h" |
const uint8_t pgm_atan[270] PROGMEM = {0,1,2,3,5,6,7,8,9,10,11,12,13,15,16,17,18, |
19,20,21,22,23,24,25,26,27,27,28,29,30,31,32,33,33,34,35,36,37,37,38,39,39,40,41, |
41,42,43,43,44,44,45,46,46,47,47,48,48,49,49,50,50,51,51,52,52,52,53,53,54,54,54, |
55,55,56,56,56,57,57,57,58,58,58,59,59,59,60,60,60,60,61,61,61,61,62,62,62,62,63, |
63,63,63,64,64,64,64,65,65,65,65,65,66,66,66,66,66,67,67,67,67,67,67,68,68,68,68, |
68,68,69,69,69,69,69,69,69,70,70,70,70,70,70,70,70,71,71,71,71,71,71,71,71,72,72, |
72,72,72,72,72,72,72,73,73,73,73,73,73,73,73,73,73,74,74,74,74,74,74,74,74,74,74, |
74,74,75,75,75,75,75,75,75,75,75,75,75,75,75,76,76,76,76,76,76,76,76,76,76,76,76, |
76,76,76,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,78,78,78,78,78,78,78, |
78,78,78,78,78,78,78,78,78,78,78,78,78,79,79,79,79,79,79,79,79,79,79,79,79,79,79, |
79,79,79,79,79,79,79,79,79,79}; |
// Arkustangens2 im Gradmaß |
signed int atan2_i(signed int x, signed int y) |
{ |
int i,angle; |
int8_t m; |
if (!x && !y) return 0; //atan2 = 0 für x und y = 0 |
if (y < 0) m=-1; |
else m=1; |
if (x==0) return (90*m); // atan2 = 90° für x = 0 |
i = abs(((float)y / x) * 50); // Berechne i für die Lookup table (Schrittweite atan(x) ist 0.02 -> *50) |
if (i<270) angle = pgm_read_byte(&pgm_atan[i]); // Lookup für 1° bis 79° |
else if (i>5750) angle = 90; // Grenzwert ist 90° |
else if (i>=1910) angle = 89; // 89° bis 80° über Wertebereiche |
else if (i>=1150) angle = 88; |
else if (i>=820) angle = 87; |
else if (i>=640) angle = 86; |
else if (i>=520) angle = 85; |
else if (i>=440) angle = 84; |
else if (i>=380) angle = 83; |
else if (i>=335) angle = 82; |
else if (i>=299) angle = 81; |
else angle = 80; // (i>=270) |
if (x > 0) return (angle*m); // Quadrant I und IV |
else if ((x < 0) && (y >= 0)) return ((angle*-1) + 180); // Quadrant II |
else return (angle - 180); // x < 0 && y < 0 Quadrant III |
} |
//Sinusfunktion von 0° bis 359°. Ergebnis wurde mit 1000 multipliziert, damit als Definition platzsparend int |
//verwendet werden kann. d.h., es muss also in der späteren Berechnung noch mit 0,001 multipliziert werden //(090907Kr) |
const int c_sin[] = {0,17,34,52,69,87,104,121,139,156,173,190, |
207,224,241,258,275,292,309,325,342,358,374,390,406,422,438,453,469,484,500,515,529,544,559,573,587,601,615,629, |
642,656,669,682,694,707,719,731,743,754,766,777,788,798,809,819,829,838,848,857,866,874,882,891,898,906,913,920, |
927,933,939,945,951,956,961,965,970,974,978,981,984,987,990,992,994,996,997,998,999,999,1000,999,999,998,997,996, |
994,992,990,987,984,981,978,974,970,965,961,956,951,945,939,933,927,920,913,906,898,891,882,874,866,857,848,838, |
829,819,809,798,788,777,766,754,743,731,719,707,694,682,669,656,642,629,615,601,587,573,559,544,529,515,500,484, |
469,453,438,422,406,390,374,358,342,325,309,292,275,258,241,224,207,190,173,156,139,121,104,87,69,52,34,17,0,-17, |
-34,-52,-69,-87,-104,-121,-139,-156,-173,-190,-207,-224,-241,-258,-275,-292,-309,-325,-342,-358,-374,-390,-406, |
-422,-438,-453,-469,-484,-500,-515,-529,-544,-559,-573,-587,-601,-615,-629,-642,-656,-669,-682,-694,-707,-719, |
-731,-743,-754,-766,-777,-788,-798,-809,-819,-829,-838,-848,-857,-866,-874,-882,-891,-898,-906,-913,-920,-927, |
-933,-939,-945,-951,-956,-961,-965,-970,-974,-978,-981,-984,-987,-990,-992,-994,-996,-997,-998,-999,-999,-1000, |
-999,-999,-998,-997,-996,-994,-992,-990,-987,-984,-981,-978,-974,-970,-965,-961,-956,-951,-945,-939,-933,-927, |
-920,-913,-906,-898,-891,-882,-874,-866,-857,-848,-838,-829,-819,-809,-798,-788,-777,-766,-754,-743,-731,-719, |
-707,-694,-682,-669,-656,-642,-629,-615,-601,-587,-573,-559,-544,-529,-515,-500,-484,-469,-453,-438,-422,-406, |
-390,-374,-358,-342,-325,-309,-292,-275,-258,-241,-224,-207,-190,-173,-156,-139,-121,-104,-87,-69,-52,-34,-17}; |
//Cosinusfunktion von 0° bis 359°. Ergebnis wurde mit 1000 multipliziert, damit als Definition platzsparend int |
//verwendet werden kann. D.h., es muss also in der späteren Berechnung noch mit 0,001 multipliziert werden //(090907Kr) |
const int c_cos[] = {1000,999,999,998,997,996,994,992,990,987,984,981, |
978,974,970,965,961,956,951,945,939,933,927,920,913,906,898,891,882,874,866,857,848,838,829,819,809,798,788,777, |
766,754,743,731,719,707,694,682,669,656,642,629,615,601,587,573,559,544,529,515,500,484,469,453,438,422,406,390, |
374,358,342,325,309,292,275,258,241,224,207,190,173,156,139,121,104,87,69,52,34,17,0,-17,-34,-52,-69,-87,-104, |
-121,-139,-156,-173,-190,-207,-224,-241,-258,-275,-292,-309,-325,-342,-358,-374,-390,-406,-422,-438,-453,-469, |
-484,-500,-515,-529,-544,-559,-573,-587,-601,-615,-629,-642,-656,-669,-682,-694,-707,-719,-731,-743,-754,-766, |
-777,-788,-798,-809,-819,-829,-838,-848,-857,-866,-874,-882,-891,-898,-906,-913,-920,-927,-933,-939,-945,-951, |
-956,-961,-965,-970,-974,-978,-981,-984,-987,-990,-992,-994,-996,-997,-998,-999,-999,-1000,-999,-999,-998,-997, |
-996,-994,-992,-990,-987,-984,-981,-978,-974,-970,-965,-961,-956,-951,-945,-939,-933,-927,-920,-913,-906,-898, |
-891,-882,-874,-866,-857,-848,-838,-829,-819,-809,-798,-788,-777,-766,-754,-743,-731,-719,-707,-694,-682,-669, |
-656,-642,-629,-615,-601,-587,-573,-559,-544,-529,-515,-500,-484,-469,-453,-438,-422,-406,-390,-374,-358,-342, |
-325,-309,-292,-275,-258,-241,-224,-207,-190,-173,-156,-139,-121,-104,-87,-69,-52,-34,-17,0,17,34,52,69,87, |
104,121,139,156,173,190,207,224,241,258,275,292,309,325,342,358,374,390,406,422,438,453,469,484,500,515,529,544, |
559,573,587,601,615,629,642,656,669,682,694,707,719,731,743,754,766,777,788,798,809,819,829,838,848,857,866,874, |
882,891,898,906,913,920,927,933,939,945,951,956,961,965,970,974,978,981,984,987,990,992,994,996,997,998,999,999}; |
const float pgm_sinus_f [91] PROGMEM = {0.000,0.017,0.035,0.052,0.070,0.087,0.105, |
0.122,0.139,0.156,0.174,0.191,0.208,0.225,0.242,0.259,0.276,0.292,0.309,0.326, |
0.342,0.358,0.375,0.391,0.407,0.423,0.438,0.454,0.469,0.485,0.500,0.515,0.530, |
0.545,0.559,0.574,0.588,0.602,0.616,0.629,0.643,0.656,0.669,0.682,0.695,0.707, |
0.719,0.731,0.743,0.755,0.766,0.777,0.788,0.799,0.809,0.819,0.829,0.839,0.848, |
0.857,0.866,0.875,0.883,0.891,0.899,0.906,0.914,0.921,0.927,0.934,0.940,0.946, |
0.951,0.956,0.961,0.966,0.970,0.974,0.978,0.982,0.985,0.988,0.990,0.993,0.995, |
0.996,0.998,0.999,0.999,1.000,1.000}; |
inline float pgm_read_float(const float *addr) |
{ |
union |
{ |
uint16_t i[2]; // 2 16-bit-Worte |
float f; |
} u; |
u.i[0]=pgm_read_word((PGM_P)addr); |
u.i[1]=pgm_read_word((PGM_P)addr+2); |
return u.f; |
} |
// Kosinusfunktion im Gradmaß |
float cos_f(signed int winkel) |
{ |
return (sin_f(90-winkel)); |
} |
// Sinusfunktion im Gradmaß |
float sin_f(signed int winkel) |
{ |
short int m,n; |
float sinus; |
//winkel = winkel % 360; |
if (winkel < 0) |
{ |
m = -1; |
winkel = abs(winkel); |
} |
else m = +1; |
// Quadranten auswerten |
if ((winkel > 90 ) && (winkel <= 180)) |
{winkel = 180 - winkel; n = 1;} |
else if ((winkel > 180 ) && (winkel <= 270)) |
{winkel = winkel - 180; n = -1;} |
else if ((winkel > 270) && (winkel <= 360)) |
{winkel = 360 - winkel; n = -1;} |
else |
n = 1; //0 - 90 Grad |
sinus = pgm_read_float(&pgm_sinus_f[winkel]); |
return (sinus*m*n); |
} |
const uint8_t pgm_asin[201] PROGMEM = {0,0,1,1,1,1,2,2,2,3,3,3,3,4,4,4,5,5,5,5,6, |
6,6,7,7,7,7,8,8,8,9,9,9,9,10,10,10,11,11,11,12,12,12,12,13,13,13,14,14,14,14,15, |
15,15,16,16,16,17,17,17,17,18,18,18,19,19,19,20,20,20,20,21,21,21,22,22,22,23,23, |
23,24,24,24,25,25,25,25,26,26,26,27,27,27,28,28,28,29,29,29,30,30,30,31,31,31,32, |
32,32,33,33,33,34,34,34,35,35,35,36,36,37,37,37,38,38,38,39,39,39,40,40,41,41,41, |
42,42,42,43,43,44,44,44,45,45,46,46,46,47,47,48,48,49,49,49,50,50,51,51,52,52,53, |
53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,62,62,63,64,64,65,66,66,67,68,68, |
69,70,71,72,73,74,75,76,77,79,80,82,84,90}; |
// Akurssinusfunktion im Gradmaß |
int8_t asin_i(signed int i) |
{ |
signed char m; |
if (i < 0) {m=-1;i=abs(i);} |
else m=1; |
return (pgm_read_byte(&pgm_asin[i]) * m); |
} |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/math.h |
---|
0,0 → 1,14 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Peter Muehlenbrock |
// Definitionen fuer Modul math |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
extern signed int atan2_i(signed int x, signed int y); |
extern float cos_f(signed int winkel); |
extern float sin_f(signed int winkel); |
extern int8_t asin_i(signed int i); |
extern const int c_sin[]; |
extern const int c_cos[]; |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/menu.c |
---|
0,0 → 1,118 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
unsigned int TestInt = 0; |
#define ARRAYGROESSE 10 |
unsigned char Array[ARRAYGROESSE] = {1,2,3,4,5,6,7,8,9,10}; |
char DisplayBuff[80] = "Hallo Welt"; |
unsigned char DispPtr = 0; |
unsigned char RemoteTasten = 0; |
#define KEY1 0x01 |
#define KEY2 0x02 |
#define KEY3 0x04 |
#define KEY4 0x08 |
#define KEY5 0x10 |
void LcdClear(void) |
{ |
unsigned char i; |
for(i=0;i<80;i++) DisplayBuff[i] = ' '; |
} |
void Menu(void) |
{ |
static unsigned char MaxMenue = 10,MenuePunkt=0; |
if(RemoteTasten & KEY1) { if(MenuePunkt) MenuePunkt--; else MenuePunkt = MaxMenue; LcdClear(); } |
if(RemoteTasten & KEY2) { MenuePunkt++; LcdClear(); } |
if((RemoteTasten & KEY1) && (RemoteTasten & KEY2)) MenuePunkt = 0; |
LCD_printfxy(17,0,"[%i]",MenuePunkt); |
switch(MenuePunkt) |
{ |
case 0: |
LCD_printfxy(0,0,"++ MikroKopter ++"); |
LCD_printfxy(0,1,"V%d.%d",VERSION_HAUPTVERSION, VERSION_NEBENVERSION); |
LCD_printfxy(0,2,"Setting: %d ",GetActiveParamSetNumber()); |
LCD_printfxy(0,3,"(c) Holger Buss"); |
// if(RemoteTasten & KEY3) TestInt--; |
// if(RemoteTasten & KEY4) TestInt++; |
break; |
case 1: |
if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
LCD_printfxy(0,0,"Hoehe: %5i",HoehenWert); |
LCD_printfxy(0,1,"SollHoehe: %5i",SollHoehe); |
LCD_printfxy(0,2,"Luftdruck: %5i",MessLuftdruck); |
LCD_printfxy(0,3,"Off : %5i",DruckOffsetSetting); |
} |
else |
{ |
LCD_printfxy(0,1,"Keine "); |
LCD_printfxy(0,2,"Höhenregelung"); |
} |
break; |
case 2: |
LCD_printfxy(0,0,"akt. Lage"); |
LCD_printfxy(0,1,"Nick: %5i",IntegralNick/1024); |
LCD_printfxy(0,2,"Roll: %5i",IntegralRoll/1024); |
LCD_printfxy(0,3,"Kompass: %5i",KompassValue); |
break; |
case 3: |
LCD_printfxy(0,0,"K1:%4i K2:%4i ",PPM_in[1],PPM_in[2]); |
LCD_printfxy(0,1,"K3:%4i K4:%4i ",PPM_in[3],PPM_in[4]); |
LCD_printfxy(0,2,"K5:%4i K6:%4i ",PPM_in[5],PPM_in[6]); |
LCD_printfxy(0,3,"K7:%4i K8:%4i ",PPM_in[7],PPM_in[8]); |
break; |
case 4: |
LCD_printfxy(0,0,"Ni:%4i Ro:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_NICK]],PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]); |
LCD_printfxy(0,1,"Gs:%4i Gi:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_GAS]],PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]); |
LCD_printfxy(0,2,"P1:%4i P2:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]],PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]]); |
LCD_printfxy(0,3,"P3:%4i P4:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]],PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]]); |
break; |
case 5: |
LCD_printfxy(0,0,"Gyro - Sensor"); |
LCD_printfxy(0,1,"Nick %4i (%3i)",AccumulateNick / MessanzahlNick, AdNeutralNick); |
LCD_printfxy(0,2,"Roll %4i (%3i)",AccumulateRoll / MessanzahlRoll, AdNeutralRoll); |
LCD_printfxy(0,3,"Gier %4i (%3i)",AccumulateGier / MessanzahlGier, AdNeutralGier); |
break; |
case 6: |
LCD_printfxy(0,0,"ACC - Sensor"); |
LCD_printfxy(0,1,"Nick %4i (%3i)",accumulate_AccNick / messanzahl_AccNick,NeutralAccX); |
LCD_printfxy(0,2,"Roll %4i (%3i)",accumulate_AccRoll / messanzahl_AccRoll,NeutralAccY); |
LCD_printfxy(0,3,"Hoch %4i (%3i)",Aktuell_az/*accumulate_AccHoch / messanzahl_AccHoch*/,(int)NeutralAccZ); |
break; |
case 7: |
LCD_printfxy(0,1,"Spannung: %5i",UBat); |
LCD_printfxy(0,2,"Empf.Pegel:%5i",SenderOkay); |
break; |
case 8: |
LCD_printfxy(0,0,"Kompass "); |
LCD_printfxy(0,1,"Richtung: %5i",KompassRichtung); |
LCD_printfxy(0,2,"Messwert: %5i",KompassValue); |
LCD_printfxy(0,3,"Start: %5i",KompassStartwert); |
break; |
case 9: |
LCD_printfxy(0,0,"Po1: %3i Po5: %3i" ,Poti1,Poti5); |
LCD_printfxy(0,1,"Po2: %3i Po6: %3i" ,Poti2,Poti6); |
LCD_printfxy(0,2,"Po3: %3i Po7: %3i" ,Poti3,Poti7); |
LCD_printfxy(0,3,"Po4: %3i Po8: %3i" ,Poti4,Poti8); |
break; |
case 10: |
LCD_printfxy(0,0,"Servo " ); |
LCD_printfxy(0,1,"Setpoint %3i",Parameter_ServoNickControl); |
LCD_printfxy(0,2,"Stellung: %3i",ServoValue); |
LCD_printfxy(0,3,"Range:%3i-%3i",EE_Parameter.ServoNickMin,EE_Parameter.ServoNickMax); |
break; |
default: MaxMenue = MenuePunkt - 1; |
MenuePunkt = 0; |
break; |
} |
RemoteTasten = 0; |
} |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/menu.h |
---|
0,0 → 1,7 |
void LcdClear(void); |
extern void Menu(void); |
extern char DisplayBuff[80]; |
extern unsigned char DispPtr; |
unsigned char RemoteTasten; |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/old_macros.h |
---|
0,0 → 1,47 |
/* |
For backwards compatibility only. |
Ingo Busker ingo@mikrocontroller.com |
*/ |
#ifndef cbi |
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) |
#endif |
#ifndef sbi |
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit)) |
#endif |
#ifndef inb |
#define inb(sfr) _SFR_BYTE(sfr) |
#endif |
#ifndef outb |
#define outb(sfr, val) (_SFR_BYTE(sfr) = (val)) |
#endif |
#ifndef inw |
#define inw(sfr) _SFR_WORD(sfr) |
#endif |
#ifndef outw |
#define outw(sfr, val) (_SFR_WORD(sfr) = (val)) |
#endif |
#ifndef outp |
#define outp(val, sfr) outb(sfr, val) |
#endif |
#ifndef inp |
#define inp(sfr) inb(sfr) |
#endif |
#ifndef BV |
#define BV(bit) _BV(bit) |
#endif |
#ifndef PRG_RDB |
#define PRG_RDB pgm_read_byte |
#endif |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/printf_P.c |
---|
0,0 → 1,480 |
// Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist nicht von der Lizenz für den MikroKopter-Teil unterstellt |
/* |
Copyright (C) 1993 Free Software Foundation |
This file is part of the GNU IO Library. This library is free |
software; you can redistribute it and/or modify it under the |
terms of the GNU General Public License as published by the |
Free Software Foundation; either version 2, or (at your option) |
any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License for more details. |
You should have received a copy of the GNU General Public License |
along with this library; see the file COPYING. If not, write to the Free |
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
As a special exception, if you link this library with files |
compiled with a GNU compiler to produce an executable, this does not cause |
the resulting executable to be covered by the GNU General Public License. |
This exception does not however invalidate any other reasons why |
the executable file might be covered by the GNU General Public License. */ |
/* |
* Copyright (c) 1990 Regents of the University of California. |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* 1. Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* 2. Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* 3. [rescinded 22 July 1999] |
* 4. Neither the name of the University nor the names of its contributors |
* may be used to endorse or promote products derived from this software |
* without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
* SUCH DAMAGE. |
*/ |
/****************************************************************************** |
This file is a patched version of printf called _printf_P |
It is made to work with avr-gcc for Atmel AVR MCUs. |
There are some differences from standard printf: |
1. There is no floating point support (with fp the code is about 8K!) |
2. Return type is void |
3. Format string must be in program memory (by using macro printf this is |
done automaticaly) |
4. %n is not implemented (just remove the comment around it if you need it) |
5. If LIGHTPRINTF is defined, the code is about 550 bytes smaller and the |
folowing specifiers are disabled : |
space # * . - + p s o O |
6. A function void uart_sendchar(char c) is used for output. The UART must |
be initialized before using printf. |
Alexander Popov |
sasho@vip.orbitel.bg |
******************************************************************************/ |
/* |
* Actual printf innards. |
* |
* This code is large and complicated... |
*/ |
#include <string.h> |
#ifdef __STDC__ |
#include <stdarg.h> |
#else |
#include <varargs.h> |
#endif |
#include "main.h" |
//#define LIGHTPRINTF |
char PrintZiel; |
char Putchar(char zeichen) |
{ |
if(PrintZiel == OUT_LCD) { DisplayBuff[DispPtr++] = zeichen; return(1);} |
else return(uart_putchar(zeichen)); |
} |
void PRINT(const char * ptr, unsigned int len) |
{ |
for(;len;len--) Putchar(*ptr++); |
} |
void PRINTP(const char * ptr, unsigned int len) |
{ |
for(;len;len--) Putchar(pgm_read_byte(ptr++)); |
} |
void PAD_SP(signed char howmany) |
{ |
for(;howmany>0;howmany--) Putchar(' '); |
} |
void PAD_0(signed char howmany) |
{ |
for(;howmany>0;howmany--) Putchar('0'); |
} |
#define BUF 40 |
/* |
* Macros for converting digits to letters and vice versa |
*/ |
#define to_digit(c) ((c) - '0') |
#define is_digit(c) ((c)<='9' && (c)>='0') |
#define to_char(n) ((n) + '0') |
/* |
* Flags used during conversion. |
*/ |
#define LONGINT 0x01 /* long integer */ |
#define LONGDBL 0x02 /* long double; unimplemented */ |
#define SHORTINT 0x04 /* short integer */ |
#define ALT 0x08 /* alternate form */ |
#define LADJUST 0x10 /* left adjustment */ |
#define ZEROPAD 0x20 /* zero (as opposed to blank) pad */ |
#define HEXPREFIX 0x40 /* add 0x or 0X prefix */ |
void _printf_P (char ziel,char const *fmt0, ...) /* Works with string from FLASH */ |
{ |
va_list ap; |
register const char *fmt; /* format string */ |
register char ch; /* character from fmt */ |
register int n; /* handy integer (short term usage) */ |
register char *cp; /* handy char pointer (short term usage) */ |
const char *fmark; /* for remembering a place in fmt */ |
register unsigned char flags; /* flags as above */ |
signed char width; /* width from format (%8d), or 0 */ |
signed char prec; /* precision from format (%.3d), or -1 */ |
char sign; /* sign prefix (' ', '+', '-', or \0) */ |
unsigned long _ulong=0; /* integer arguments %[diouxX] */ |
#define OCT 8 |
#define DEC 10 |
#define HEX 16 |
unsigned char base; /* base for [diouxX] conversion */ |
signed char dprec; /* a copy of prec if [diouxX], 0 otherwise */ |
signed char dpad; /* extra 0 padding needed for integers */ |
signed char fieldsz; /* field size expanded by sign, dpad etc */ |
/* The initialization of 'size' is to suppress a warning that |
'size' might be used unitialized. It seems gcc can't |
quite grok this spaghetti code ... */ |
signed char size = 0; /* size of converted field or string */ |
char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */ |
char ox[2]; /* space for 0x hex-prefix */ |
PrintZiel = ziel; // bestimmt, LCD oder UART |
va_start(ap, fmt0); |
fmt = fmt0; |
/* |
* Scan the format for conversions (`%' character). |
*/ |
for (;;) { |
for (fmark = fmt; (ch = pgm_read_byte(fmt)) != '\0' && ch != '%'; fmt++) |
/* void */; |
if ((n = fmt - fmark) != 0) { |
PRINTP(fmark, n); |
} |
if (ch == '\0') |
goto done; |
fmt++; /* skip over '%' */ |
flags = 0; |
dprec = 0; |
width = 0; |
prec = -1; |
sign = '\0'; |
rflag: ch = PRG_RDB(fmt++); |
reswitch: |
#ifdef LIGHTPRINTF |
if (ch=='o' || ch=='u' || (ch|0x20)=='x') { |
#else |
if (ch=='u' || (ch|0x20)=='x') { |
#endif |
if (flags&LONGINT) { |
_ulong=va_arg(ap, unsigned long); |
} else { |
register unsigned int _d; |
_d=va_arg(ap, unsigned int); |
_ulong = flags&SHORTINT ? (unsigned long)(unsigned short)_d : (unsigned long)_d; |
} |
} |
#ifndef LIGHTPRINTF |
if(ch==' ') { |
/* |
* ``If the space and + flags both appear, the space |
* flag will be ignored.'' |
* -- ANSI X3J11 |
*/ |
if (!sign) |
sign = ' '; |
goto rflag; |
} else if (ch=='#') { |
flags |= ALT; |
goto rflag; |
} else if (ch=='*'||ch=='-') { |
if (ch=='*') { |
/* |
* ``A negative field width argument is taken as a |
* - flag followed by a positive field width.'' |
* -- ANSI X3J11 |
* They don't exclude field widths read from args. |
*/ |
if ((width = va_arg(ap, int)) >= 0) |
goto rflag; |
width = -width; |
} |
flags |= LADJUST; |
flags &= ~ZEROPAD; /* '-' disables '0' */ |
goto rflag; |
} else if (ch=='+') { |
sign = '+'; |
goto rflag; |
} else if (ch=='.') { |
if ((ch = PRG_RDB(fmt++)) == '*') { |
n = va_arg(ap, int); |
prec = n < 0 ? -1 : n; |
goto rflag; |
} |
n = 0; |
while (is_digit(ch)) { |
n = n*10 + to_digit(ch); |
ch = PRG_RDB(fmt++); |
} |
prec = n < 0 ? -1 : n; |
goto reswitch; |
} else |
#endif /* LIGHTPRINTF */ |
if (ch=='0') { |
/* |
* ``Note that 0 is taken as a flag, not as the |
* beginning of a field width.'' |
* -- ANSI X3J11 |
*/ |
if (!(flags & LADJUST)) |
flags |= ZEROPAD; /* '-' disables '0' */ |
goto rflag; |
} else if (ch>='1' && ch<='9') { |
n = 0; |
do { |
n = 10 * n + to_digit(ch); |
ch = PRG_RDB(fmt++); |
} while (is_digit(ch)); |
width = n; |
goto reswitch; |
} else if (ch=='h') { |
flags |= SHORTINT; |
goto rflag; |
} else if (ch=='l') { |
flags |= LONGINT; |
goto rflag; |
} else if (ch=='c') { |
*(cp = buf) = va_arg(ap, int); |
size = 1; |
sign = '\0'; |
} else if (ch=='D'||ch=='d'||ch=='i') { |
if(ch=='D') |
flags |= LONGINT; |
if (flags&LONGINT) { |
_ulong=va_arg(ap, long); |
} else { |
register int _d; |
_d=va_arg(ap, int); |
_ulong = flags&SHORTINT ? (long)(short)_d : (long)_d; |
} |
if ((long)_ulong < 0) { |
_ulong = -_ulong; |
sign = '-'; |
} |
base = DEC; |
goto number; |
} else |
/* |
if (ch=='n') { |
if (flags & LONGINT) |
*va_arg(ap, long *) = ret; |
else if (flags & SHORTINT) |
*va_arg(ap, short *) = ret; |
else |
*va_arg(ap, int *) = ret; |
continue; // no output |
} else |
*/ |
#ifndef LIGHTPRINTF |
if (ch=='O'||ch=='o') { |
if (ch=='O') |
flags |= LONGINT; |
base = OCT; |
goto nosign; |
} else if (ch=='p') { |
/* |
* ``The argument shall be a pointer to void. The |
* value of the pointer is converted to a sequence |
* of printable characters, in an implementation- |
* defined manner.'' |
* -- ANSI X3J11 |
*/ |
/* NOSTRICT */ |
_ulong = (unsigned int)va_arg(ap, void *); |
base = HEX; |
flags |= HEXPREFIX; |
ch = 'x'; |
goto nosign; |
} else if (ch=='s') { // print a string from RAM |
if ((cp = va_arg(ap, char *)) == NULL) { |
cp=buf; |
cp[0] = '('; |
cp[1] = 'n'; |
cp[2] = 'u'; |
cp[4] = cp[3] = 'l'; |
cp[5] = ')'; |
cp[6] = '\0'; |
} |
if (prec >= 0) { |
/* |
* can't use strlen; can only look for the |
* NUL in the first `prec' characters, and |
* strlen() will go further. |
*/ |
char *p = (char*)memchr(cp, 0, prec); |
if (p != NULL) { |
size = p - cp; |
if (size > prec) |
size = prec; |
} else |
size = prec; |
} else |
size = strlen(cp); |
sign = '\0'; |
} else |
#endif /* LIGHTPRINTF */ |
if(ch=='U'||ch=='u') { |
if (ch=='U') |
flags |= LONGINT; |
base = DEC; |
goto nosign; |
} else if (ch=='X'||ch=='x') { |
base = HEX; |
/* leading 0x/X only if non-zero */ |
if (flags & ALT && _ulong != 0) |
flags |= HEXPREFIX; |
/* unsigned conversions */ |
nosign: sign = '\0'; |
/* |
* ``... diouXx conversions ... if a precision is |
* specified, the 0 flag will be ignored.'' |
* -- ANSI X3J11 |
*/ |
number: if ((dprec = prec) >= 0) |
flags &= ~ZEROPAD; |
/* |
* ``The result of converting a zero value with an |
* explicit precision of zero is no characters.'' |
* -- ANSI X3J11 |
*/ |
cp = buf + BUF; |
if (_ulong != 0 || prec != 0) { |
register unsigned char _d,notlastdigit; |
do { |
notlastdigit=(_ulong>=base); |
_d = _ulong % base; |
if (_d<10) { |
_d+='0'; |
} else { |
_d+='a'-10; |
if (ch=='X') _d&=~0x20; |
} |
*--cp=_d; |
_ulong /= base; |
} while (notlastdigit); |
#ifndef LIGHTPRINTF |
// handle octal leading 0 |
if (base==OCT && flags & ALT && *cp != '0') |
*--cp = '0'; |
#endif |
} |
size = buf + BUF - cp; |
} else { //default |
/* "%?" prints ?, unless ? is NUL */ |
if (ch == '\0') |
goto done; |
/* pretend it was %c with argument ch */ |
cp = buf; |
*cp = ch; |
size = 1; |
sign = '\0'; |
} |
/* |
* All reasonable formats wind up here. At this point, |
* `cp' points to a string which (if not flags&LADJUST) |
* should be padded out to `width' places. If |
* flags&ZEROPAD, it should first be prefixed by any |
* sign or other prefix; otherwise, it should be blank |
* padded before the prefix is emitted. After any |
* left-hand padding and prefixing, emit zeroes |
* required by a decimal [diouxX] precision, then print |
* the string proper, then emit zeroes required by any |
* leftover floating precision; finally, if LADJUST, |
* pad with blanks. |
*/ |
/* |
* compute actual size, so we know how much to pad. |
*/ |
fieldsz = size; |
dpad = dprec - size; |
if (dpad < 0) |
dpad = 0; |
if (sign) |
fieldsz++; |
else if (flags & HEXPREFIX) |
fieldsz += 2; |
fieldsz += dpad; |
/* right-adjusting blank padding */ |
if ((flags & (LADJUST|ZEROPAD)) == 0) |
PAD_SP(width - fieldsz); |
/* prefix */ |
if (sign) { |
PRINT(&sign, 1); |
} else if (flags & HEXPREFIX) { |
ox[0] = '0'; |
ox[1] = ch; |
PRINT(ox, 2); |
} |
/* right-adjusting zero padding */ |
if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD) |
PAD_0(width - fieldsz); |
/* leading zeroes from decimal precision */ |
PAD_0(dpad); |
/* the string or number proper */ |
PRINT(cp, size); |
/* left-adjusting padding (always blank) */ |
if (flags & LADJUST) |
PAD_SP(width - fieldsz); |
} |
done: |
va_end(ap); |
} |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/printf_P.h |
---|
0,0 → 1,19 |
#ifndef _PRINTF_P_H_ |
#define _PRINTF_P_H_ |
#include <avr/pgmspace.h> |
#define OUT_V24 0 |
#define OUT_LCD 1 |
extern void _printf_P (char, char const *fmt0, ...); |
extern char PrintZiel; |
#define printf_P(format, args...) _printf_P(OUT_V24,format , ## args) |
#define printf(format, args...) _printf_P(OUT_V24,PSTR(format) , ## args) |
#define LCD_printfxy(x,y,format, args...) { DispPtr = y * 20 + x; _printf_P(OUT_LCD,PSTR(format) , ## args);} |
#define LCD_printf(format, args...) { _printf_P(OUT_LCD,PSTR(format) , ## args);} |
#endif |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/rc.c |
---|
0,0 → 1,85 |
/*####################################################################################### |
Decodieren eines RC Summen Signals |
#######################################################################################*/ |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "rc.h" |
#include "main.h" |
volatile int PPM_in[15]; |
volatile int PPM_diff[15]; // das diffenzierte Stick-Signal |
volatile unsigned char NewPpmData = 1; |
//############################################################################ |
//zum decodieren des PPM-Signals wird Timer1 mit seiner Input |
//Capture Funktion benutzt: |
void rc_sum_init (void) |
//############################################################################ |
{ |
TCCR1B=(1<<CS11)|(1<<CS10)|(1<<ICES1)|(1<<ICNC1);//|(1 << WGM12); //timer1 prescale 64 |
// PWM |
//TCCR1A = (1 << COM1B1) | (1 << WGM11) | (1 << WGM10); |
//TCCR1B |= (1 << WGM12); |
//OCR1B = 55; |
TIMSK1 |= _BV(ICIE1); |
AdNeutralGier = 0; |
AdNeutralRoll = 0; |
AdNeutralNick = 0; |
return; |
} |
//############################################################################ |
//Diese Routine startet und inizialisiert den Timer für RC |
SIGNAL(SIG_INPUT_CAPTURE1) |
//############################################################################ |
{ |
static unsigned int AltICR=0; |
signed int signal = 0; |
static int index; |
signal = (unsigned int) ICR1 - AltICR; |
AltICR = ICR1; |
//Syncronisationspause? |
if ((signal > 1500) && (signal < 8000)) |
{ |
index = 1; |
NewPpmData = 0; // Null bedeutet: Neue Daten |
// OCR2A = Poti2/2 + 80; |
} |
else |
{ |
if(index < 14) |
{ |
if((signal > 250) && (signal < 687)) |
{ |
signal -= 466; |
// Stabiles Signal |
if(abs(signal - PPM_in[index]) < 6) { if(SenderOkay < 200) SenderOkay += 10;} |
signal = (3 * (PPM_in[index]) + signal) / 4; |
//373 entspricht ca. 1.5ms also Mittelstellung |
PPM_diff[index] = signal - PPM_in[index]; |
PPM_in[index] = signal; |
} |
index++; |
/* if(index == 5) PORTD |= 0x20; else PORTD &= ~0x20; // Servosignal an J3 anlegen |
if(index == 6) PORTD |= 0x10; else PORTD &= ~0x10; // Servosignal an J4 anlegen |
if(index == 7) PORTD |= 0x08; else PORTD &= ~0x08; // Servosignal an J5 anlegen */ |
} |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/rc.h |
---|
0,0 → 1,29 |
/*####################################################################################### |
Derkodieren eines RC Summen Signals |
#######################################################################################*/ |
#ifndef _RC_H |
#define _RC_H |
#if defined (__AVR_ATmega32__) |
#define TIMER_TEILER CK64 |
#define TIMER_RELOAD_VALUE 250 |
#endif |
#if defined (__AVR_ATmega644__) |
//#define TIMER_TEILER CK64 |
#define TIMER_RELOAD_VALUE 250 |
//#define TIMER_TEILER CK256 // bei 20MHz |
//#define TIMER_RELOAD_VALUE -78 // bei 20MHz |
#endif |
#define GAS PPM_in[2] |
extern void rc_sum_init (void); |
extern volatile int PPM_in[15]; |
extern volatile int PPM_diff[15]; // das diffenzierte Stick-Signal |
extern volatile unsigned char NewPpmData; |
#endif //_RC_H |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/timer0.c |
---|
0,0 → 1,136 |
#include "main.h" |
volatile unsigned int CountMilliseconds = 0; |
volatile static unsigned int tim_main; |
volatile unsigned char UpdateMotor = 0; |
volatile unsigned int beeptime = 0; |
volatile unsigned int cntKompass = 0; |
int ServoValue = 0; |
enum { |
STOP = 0, |
CK = 1, |
CK8 = 2, |
CK64 = 3, |
CK256 = 4, |
CK1024 = 5, |
T0_FALLING_EDGE = 6, |
T0_RISING_EDGE = 7 |
}; |
SIGNAL (SIG_OVERFLOW0) // 8kHz |
{ |
static unsigned char cnt_1ms = 1,cnt = 0; |
// TCNT0 -= 250;//TIMER_RELOAD_VALUE; |
if(!cnt--) |
{ |
cnt = 9; |
cnt_1ms++; |
cnt_1ms %= 2; |
if(!cnt_1ms) UpdateMotor = 1; |
CountMilliseconds++; |
if(Timeout) Timeout--; |
} |
if(beeptime > 1) |
{ |
beeptime--; |
PORTD |= (1<<PD2); |
} |
else |
PORTD &= ~(1<<PD2); |
if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV) |
{ |
MM3_timer0(); // Kompass auslesen |
if (!cntKompass--) // Aufruf mit 25 Hz |
{ |
if (MM3_heading() > 0) { KompassValue = 360-MM3_heading();} |
if (MM3_heading() < 0 ) { KompassValue = MM3_heading()*-1;} |
cntKompass = 640; |
} |
} |
} |
void Timer_Init(void) |
{ |
tim_main = SetDelay(10); |
TCCR0B = CK8; |
TCCR0A = (1<<COM0A1)|(1<<COM0B1)|3;//fast PWM |
OCR0A = 0; |
OCR0B = 120; |
TCNT0 = -TIMER_RELOAD_VALUE; // reload |
//OCR1 = 0x00; |
TCCR2A=(1<<COM2A1)|(1<<COM2A0)|3; |
TCCR2B=(0<<CS20)|(1<<CS21)|(1<<CS22); |
// TIMSK2 |= _BV(TOIE2); |
TIMSK2 |= _BV(OCIE2A); |
TIMSK0 |= _BV(TOIE0); |
OCR2A = 10; |
TCNT2 = 0; |
} |
// ----------------------------------------------------------------------- |
unsigned int SetDelay (unsigned int t) |
{ |
// TIMSK0 &= ~_BV(TOIE0); |
return(CountMilliseconds + t + 1); |
// TIMSK0 |= _BV(TOIE0); |
} |
// ----------------------------------------------------------------------- |
char CheckDelay(unsigned int t) |
{ |
// TIMSK0 &= ~_BV(TOIE0); |
return(((t - CountMilliseconds) & 0x8000) >> 9); |
// TIMSK0 |= _BV(TOIE0); |
} |
// ----------------------------------------------------------------------- |
void Delay_ms(unsigned int w) |
{ |
unsigned int akt; |
akt = SetDelay(w); |
while (!CheckDelay(akt)); |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Servo ansteuern |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(SIG_OUTPUT_COMPARE2A) |
{ |
static unsigned char timer = 10; |
if(!timer--) |
{ |
TCCR2A=(1<<COM2A1)|(0<<COM2A0)|3; |
ServoValue = Parameter_ServoNickControl; |
if(EE_Parameter.ServoNickCompInvert & 0x01) ServoValue += ((long) EE_Parameter.ServoNickComp * (IntegralNick / 128)) / 512; |
else ServoValue -= ((long) EE_Parameter.ServoNickComp * (IntegralNick / 128)) / 512; |
if(ServoValue < EE_Parameter.ServoNickMin) ServoValue = EE_Parameter.ServoNickMin; |
else if(ServoValue > EE_Parameter.ServoNickMax) ServoValue = EE_Parameter.ServoNickMax; |
//DebugOut.Analog[10] = ServoValue; |
OCR2A = ServoValue;// + 75; |
timer = EE_Parameter.ServoNickRefresh; |
} |
else |
{ |
TCCR2A =3; |
PORTD&=~0x80; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/timer0.h |
---|
0,0 → 1,14 |
#define TIMER_TEILER CK8 |
#define TIMER_RELOAD_VALUE 250 |
void Timer_Init(void); |
void Delay_ms(unsigned int); |
unsigned int SetDelay (unsigned int t); |
char CheckDelay (unsigned int t); |
extern volatile unsigned int CountMilliseconds; |
extern volatile unsigned char UpdateMotor; |
extern volatile unsigned int beeptime; |
extern volatile unsigned int cntKompass; |
extern int ServoValue; |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/twimaster.c |
---|
0,0 → 1,131 |
/*############################################################################ |
############################################################################*/ |
#include "main.h" |
unsigned char twi_state = 0; |
unsigned char motor = 0; |
unsigned char motorread = 0; |
unsigned char motor_rx[8]; |
//############################################################################ |
//Initzialisieren der I2C (TWI) Schnittstelle |
void i2c_init(void) |
//############################################################################ |
{ |
TWSR = 0; |
TWBR = ((SYSCLK/SCL_CLOCK)-16)/2; |
} |
//############################################################################ |
//Start I2C |
char i2c_start(void) |
//############################################################################ |
{ |
TWCR = (1<<TWSTA) | (1<<TWEN) | (1<<TWINT) | (1<<TWIE); |
return(0); |
} |
//############################################################################ |
//Start I2C |
void i2c_stop(void) |
//############################################################################ |
{ |
TWCR = (1<<TWEN) | (1<<TWSTO) | (1<<TWINT); |
} |
//############################################################################ |
//Start I2C |
char i2c_write_byte(char byte) |
//############################################################################ |
{ |
TWSR = 0x00; |
TWDR = byte; |
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWIE); |
return(0); |
} |
//############################################################################ |
//Start I2C |
SIGNAL (TWI_vect) |
//############################################################################ |
{ |
switch (twi_state++) |
{ |
case 0: |
i2c_write_byte(0x52+(motor*2)); |
break; |
case 1: |
switch(motor++) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 2: |
i2c_stop(); |
if (motor<4) twi_state = 0; |
else motor = 0; |
i2c_start(); |
break; |
//Liest Daten von Motor |
case 3: |
i2c_write_byte(0x53+(motorread*2)); |
break; |
case 4: |
switch(motorread) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 5: //1 Byte vom Motor lesen |
motor_rx[motorread] = TWDR; |
case 6: |
switch(motorread) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 7: //2 Byte vom Motor lesen |
motor_rx[motorread+4] = TWDR; |
motorread++; |
if (motorread>3) motorread=0; |
i2c_stop(); |
twi_state = 0; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/twimaster.h |
---|
0,0 → 1,32 |
/*############################################################################ |
############################################################################*/ |
#ifndef _I2C_MASTER_H |
#define _I2C_MASTER_H |
//############################################################################ |
// I2C Konstanten |
#define SCL_CLOCK 200000L |
#define I2C_TIMEOUT 30000 |
#define I2C_START 0x08 |
#define I2C_REPEATED_START 0x10 |
#define I2C_TX_SLA_ACK 0x18 |
#define I2C_TX_DATA_ACK 0x28 |
#define I2C_RX_SLA_ACK 0x40 |
#define I2C_RX_DATA_ACK 0x50 |
//############################################################################ |
extern unsigned char twi_state; |
extern unsigned char motor; |
extern unsigned char motorread; |
extern unsigned char motor_rx[8]; |
void i2c_init (void); // I2C initialisieren |
char i2c_start (void); // Start I2C |
void i2c_stop (void); // Stop I2C |
char i2c_write_byte (char byte); // 1 Byte schreiben |
#endif |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/uart.c |
---|
0,0 → 1,641 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// + |
// + GPS read out: |
// + modified Version of the Pitschu Brushless Ufo - (c) Peter Schulten, Mülheim, Germany |
// + only for non-profit use |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
#include "uart.h" |
unsigned char DebugGetAnforderung = 0,DebugDisplayAnforderung = 0,DebugDataAnforderung = 0,GetVersionAnforderung = 0; |
unsigned volatile char SioTmp = 0; |
unsigned volatile char SendeBuffer[MAX_SENDE_BUFF]; |
unsigned volatile char RxdBuffer[MAX_EMPFANGS_BUFF]; |
unsigned volatile char NMEABuffer[MAX_EMPFANGS_BUFF]; |
unsigned volatile char NeuerDatensatzEmpfangen = 0; |
unsigned volatile char NeueKoordinateEmpfangen = 0; |
unsigned volatile char UebertragungAbgeschlossen = 1; |
unsigned volatile char CntCrcError = 0; |
unsigned volatile char AnzahlEmpfangsBytes = 0; |
unsigned volatile char PC_DebugTimeout = 0; |
unsigned char PcZugriff = 100; |
unsigned char MotorTest[4] = {0,0,0,0}; |
unsigned char MeineSlaveAdresse; |
struct str_DebugOut DebugOut; |
struct str_Debug DebugIn; |
struct str_VersionInfo VersionInfo; |
int Debug_Timer; |
static uint8_t gpsState; |
#define GPS_EMPTY 0 |
#define GPS_SYNC1 1 |
#define GPS_SYNC2 2 |
#define GPS_CLASS 3 |
#define GPS_LEN1 4 |
#define GPS_LEN2 5 |
#define GPS_FILLING 6 |
#define GPS_CKA 7 |
#define GPS_CKB 8 |
//gpsInfo_t gpsPoints[5]; // stored position to fly to (currently only 1 target supported) |
//gpsInfo_t *gpsTarget; // points to one of the targets |
gpsInfo_t actualPos; // measured position (last gps record) |
#define SYNC_CHAR1 0xb5 |
#define SYNC_CHAR2 0x62 |
#define CLASS_NAV 0x01 |
#define MSGID_POSECEF 0x01 |
#define MSGID_STATUS 0x03 |
#define MSGID_VELECEF 0x11 |
#define MSGID_POSUTM 0x08 |
#define MSGID_VELNED 0x12 |
typedef struct { |
unsigned long ITOW; // time of week |
uint8_t GPSfix; // GPSfix Type, range 0..6 |
uint8_t Flags; // Navigation Status Flags |
uint8_t DiffS; // Differential Status |
uint8_t res; // reserved |
unsigned long TTFF; // Time to first fix (millisecond time tag) |
unsigned long MSSS; // Milliseconds since Startup / Reset |
uint8_t packetStatus; |
} NAV_STATUS_t; |
typedef struct { |
unsigned long ITOW; // time of week |
long LON; // longitude in 1e-07 deg |
long LAT; // lattitude |
long HEIGHT; // height in mm |
long HMSL; // height above mean sea level im mm |
unsigned long Hacc; // horizontal accuracy in mm |
unsigned long Vacc; // vertical accuracy in mm |
uint8_t packetStatus; |
} NAV_POSLLH_t; |
typedef struct { |
unsigned long ITOW; // time of week |
long EAST; // cm UTM Easting |
long NORTH; // cm UTM Nording |
long ALT; // cm altitude |
uint8_t ZONE; // UTM zone number |
uint8_t HEM; // Hemisphere Indicator (0=North, 1=South) |
uint8_t packetStatus; |
} NAV_POSUTM_t; |
typedef struct { |
unsigned long ITOW; // ms GPS Millisecond Time of Week |
long VEL_N; // cm/s NED north velocity |
long VEL_E; // cm/s NED east velocity |
long VEL_D; // cm/s NED down velocity |
unsigned long Speed; // cm/s Speed (3-D) |
unsigned long GSpeed; // cm/s Ground Speed (2-D) |
long Heading; // deg (1e-05) Heading 2-D |
unsigned long SAcc; // cm/s Speed Accuracy Estimate |
unsigned long CAcc; // deg Course / Heading Accuracy Estimate |
uint8_t packetStatus; |
} NAV_VELNED_t; |
typedef struct { |
unsigned long ITOW; // ms GPS Millisecond Time of Week |
long ECEF_X; // ecef x / cm |
long ECEF_Y; // ecef y / cm |
long ECEF_Z; // ecef z / cm |
unsigned long Pacc; // Abweichung |
uint8_t packetStatus; |
} NAV_POSECEF_t ; |
typedef struct { |
unsigned long ITOW; // ms GPS Millisecond Time of Week |
long ECEFVX; // ecef x velocity cm/s |
long ECEFVY; // ecef y velocity cm/s |
long ECEFVZ; // ecef z velocity cm/s |
unsigned long SAcc; // Abweichung |
uint8_t packetStatus; |
} NAV_VELECEF_t; |
NAV_STATUS_t navStatus; |
NAV_POSECEF_t navPosECEF; |
NAV_VELECEF_t navVelECEF; |
NAV_POSUTM_t navPosUtm; |
NAV_VELNED_t navVelNed; |
volatile char *ubxP, *ubxEp, *ubxSp; // pointers to packet currently transfered |
volatile uint8_t CK_A, CK_B; // UBX checksum bytes |
volatile unsigned short msgLen; |
volatile uint8_t msgID; |
volatile uint8_t ignorePacket; // true when previous packet was not processed |
// distance to target position |
long rollOffset; // in 10cm |
long nickOffset; |
#define GPS_INTCYCLES 100 |
#define GPS_I_LIMIT (long)(40 * MAINLOOPS_PER_SEC) |
#ifdef GPS_DEBUG // if set then the GPS data is transfered to display |
extern volatile uint8_t v24state; |
char buf[200]; |
char *bp; |
char *ep; |
#endif |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//++ Sende-Part der Datenübertragung |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(INT_VEC_TX) |
{ |
static unsigned int ptr = 0; |
unsigned char tmp_tx; |
if(!UebertragungAbgeschlossen) |
{ |
ptr++; // die [0] wurde schon gesendet |
tmp_tx = SendeBuffer[ptr]; |
if((tmp_tx == '\r') || (ptr == MAX_SENDE_BUFF)) |
{ |
ptr = 0; |
UebertragungAbgeschlossen = 1; |
} |
UDR = tmp_tx; |
} |
else ptr = 0; |
} |
void GPSscanData (void) |
{ |
if (navPosECEF.packetStatus == 1) // valid packet |
{ |
actualPos.x = navPosECEF.ECEF_X; //ECEF X in cm |
actualPos.y = navPosECEF.ECEF_Y; //ECEF Y in cm |
actualPos.z = navPosECEF.ECEF_Z; //ECEF Z in cm |
navPosECEF.packetStatus = 0; |
} |
if (navStatus.packetStatus == 1) // valid packet |
{ |
actualPos.GPSFix = navStatus.GPSfix; |
actualPos.newData = navStatus.packetStatus; |
navStatus.packetStatus = 0; |
} |
if (navVelECEF.packetStatus == 1) // valid packet |
{ |
actualPos.vx = navVelECEF.ECEFVX; //ECEF VEL X in cm/s |
actualPos.vy = navVelECEF.ECEFVY; //ECEF VEL Y in cm/s |
actualPos.vz = navVelECEF.ECEFVZ; //ECEF VEL Z in cm/s |
navVelECEF.packetStatus = 0; |
} |
if (navPosUtm.packetStatus == 1) // valid packet |
{ |
actualPos.northing = navPosUtm.NORTH; |
actualPos.easting = navPosUtm.EAST; |
actualPos.altitude = navPosUtm.ALT; |
navPosUtm.packetStatus = 0; |
} |
if (navVelNed.packetStatus == 1) |
{ |
actualPos.velNorth = navVelNed.VEL_N; |
actualPos.velEast = navVelNed.VEL_E; |
navVelNed.packetStatus = 0; |
} |
if (actualPos.newData != 0){ROT_ON;} //-> Rot blinkt mit 4Hz wenn Daten vom GPS Empfänger ankommen und brauchbar sind |
} |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//++ Empfangs-Part der Datenübertragung, incl. CRC-Auswertung |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(INT_VEC_RX) |
{ |
static unsigned int crc; |
static unsigned char crc1,crc2,buf_ptr; |
static unsigned char UartState = 0; |
unsigned char CrcOkay = 0; |
SioTmp = UDR; |
uint8_t c; |
uint8_t re; |
re = (UCSR0A & (_B1(FE0) | _B1(DOR0))); // any error occured ? |
c = SioTmp; |
#ifdef GPS_DEBUG |
*bp++ = c; |
if (bp >= (buf+200)) bp = buf; |
if (v24state == 0) |
{ |
v24state = 1; |
UDR0 = *ep++; |
if (ep >= buf+200) |
ep = buf; |
UCSR0B |= _B1(UDRIE0); //enable further irqs |
} |
#endif |
if (re == 0) |
{ |
switch (gpsState) |
{ |
case GPS_EMPTY: |
if (c == SYNC_CHAR1) |
gpsState = GPS_SYNC1; |
break; |
case GPS_SYNC1: |
if (c == SYNC_CHAR2) |
gpsState = GPS_SYNC2; |
else if (c != SYNC_CHAR1) |
gpsState = GPS_EMPTY; |
break; |
case GPS_SYNC2: |
if (c == CLASS_NAV) |
gpsState = GPS_CLASS; |
else |
gpsState = GPS_EMPTY; |
break; |
case GPS_CLASS: // msg ID seen: init packed receive |
msgID = c; |
CK_A = CLASS_NAV + c; |
CK_B = CLASS_NAV + CK_A; |
gpsState = GPS_LEN1; |
switch (msgID) |
{ |
case MSGID_STATUS: |
ubxP = (char*)&navStatus; |
ubxEp = (char*)(&navStatus + sizeof(NAV_STATUS_t)); |
ubxSp = (char*)&navStatus.packetStatus; |
ignorePacket = navStatus.packetStatus; |
break; |
case MSGID_POSECEF: |
ubxP = (char*)&navPosECEF; |
ubxEp = (char*)(&navPosECEF + sizeof(NAV_POSECEF_t)); |
ubxSp = (char*)&navPosECEF.packetStatus; |
ignorePacket = navPosECEF.packetStatus; |
break; |
case MSGID_VELECEF: |
ubxP = (char*)&navVelECEF; |
ubxEp = (char*)(&navVelECEF + sizeof(NAV_VELECEF_t)); |
ubxSp = (char*)&navVelECEF.packetStatus; |
ignorePacket = navVelECEF.packetStatus; |
break; |
case MSGID_POSUTM: |
ubxP = (char*)&navPosUtm; |
ubxEp = (char*)(&navPosUtm + sizeof(NAV_POSUTM_t)); |
ubxSp = (char*)&navPosUtm.packetStatus; |
ignorePacket = navPosUtm.packetStatus; |
break; |
case MSGID_VELNED: |
ubxP = (char*)&navVelNed; |
ubxEp = (char*)(&navVelNed + sizeof(NAV_VELNED_t)); |
ubxSp = (char*)&navVelNed.packetStatus; |
ignorePacket = navVelNed.packetStatus; |
break; |
default: |
ignorePacket = 1; |
ubxSp = (char*)0; |
} |
break; |
case GPS_LEN1: // first len byte |
msgLen = c; |
CK_A += c; |
CK_B += CK_A; |
gpsState = GPS_LEN2; |
break; |
case GPS_LEN2: // second len byte |
msgLen = msgLen + (c * 256); |
CK_A += c; |
CK_B += CK_A; |
gpsState = GPS_FILLING; // next data will be stored in packet struct |
break; |
case GPS_FILLING: |
CK_A += c; |
CK_B += CK_A; |
if ( !ignorePacket && ubxP < ubxEp) |
*ubxP++ = c; |
if (--msgLen == 0) |
gpsState = GPS_CKA; |
break; |
case GPS_CKA: |
if (c == CK_A) |
gpsState = GPS_CKB; |
else |
gpsState = GPS_EMPTY; |
break; |
case GPS_CKB: |
if (c == CK_B && ubxSp) // No error -> packet received successfully |
*ubxSp = 1; // set packetStatus in struct |
gpsState = GPS_EMPTY; // ready for next packet |
break; |
default: |
gpsState = GPS_EMPTY; // ready for next packet |
} |
} |
else // discard any data if error occured |
{ |
gpsState = GPS_EMPTY; |
GPSscanData (); //Test kann ggf. wieder gelöscht werden! |
} |
GPSscanData (); |
if(buf_ptr >= MAX_EMPFANGS_BUFF) UartState = 0; |
if(SioTmp == '\r' && UartState == 2) |
{ |
UartState = 0; |
crc -= RxdBuffer[buf_ptr-2]; |
crc -= RxdBuffer[buf_ptr-1]; |
crc %= 4096; |
crc1 = '=' + crc / 64; |
crc2 = '=' + crc % 64; |
CrcOkay = 0; |
if((crc1 == RxdBuffer[buf_ptr-2]) && (crc2 == RxdBuffer[buf_ptr-1])) CrcOkay = 1; else { CrcOkay = 0; CntCrcError++;}; |
if(!NeuerDatensatzEmpfangen && CrcOkay) // Datensatz schon verarbeitet |
{ |
NeuerDatensatzEmpfangen = 1; |
AnzahlEmpfangsBytes = buf_ptr; |
RxdBuffer[buf_ptr] = '\r'; |
if(/*(RxdBuffer[1] == MeineSlaveAdresse || (RxdBuffer[1] == 'a')) && */(RxdBuffer[2] == 'R')) wdt_enable(WDTO_250MS); // Reset-Commando |
} |
} |
else |
switch(UartState) |
{ |
case 0: |
if(SioTmp == '#' && !NeuerDatensatzEmpfangen) UartState = 1; // Startzeichen und Daten schon verarbeitet |
buf_ptr = 0; |
RxdBuffer[buf_ptr++] = SioTmp; |
crc = SioTmp; |
break; |
case 1: // Adresse auswerten |
UartState++; |
RxdBuffer[buf_ptr++] = SioTmp; |
crc += SioTmp; |
break; |
case 2: // Eingangsdaten sammeln |
RxdBuffer[buf_ptr] = SioTmp; |
if(buf_ptr < MAX_EMPFANGS_BUFF) buf_ptr++; |
else UartState = 0; |
crc += SioTmp; |
break; |
default: |
UartState = 0; |
break; |
} |
} |
// -------------------------------------------------------------------------- |
void AddCRC(unsigned int wieviele) |
{ |
unsigned int tmpCRC = 0,i; |
for(i = 0; i < wieviele;i++) |
{ |
tmpCRC += SendeBuffer[i]; |
} |
tmpCRC %= 4096; |
SendeBuffer[i++] = '=' + tmpCRC / 64; |
SendeBuffer[i++] = '=' + tmpCRC % 64; |
SendeBuffer[i++] = '\r'; |
UebertragungAbgeschlossen = 0; |
UDR = SendeBuffer[0]; |
} |
// -------------------------------------------------------------------------- |
void SendOutData(unsigned char cmd,unsigned char modul, unsigned char *snd, unsigned char len) |
{ |
unsigned int pt = 0; |
unsigned char a,b,c; |
unsigned char ptr = 0; |
SendeBuffer[pt++] = '#'; // Startzeichen |
SendeBuffer[pt++] = modul; // Adresse (a=0; b=1,...) |
SendeBuffer[pt++] = cmd; // Commando |
while(len) |
{ |
if(len) { a = snd[ptr++]; len--;} else a = 0; |
if(len) { b = snd[ptr++]; len--;} else b = 0; |
if(len) { c = snd[ptr++]; len--;} else c = 0; |
SendeBuffer[pt++] = '=' + (a >> 2); |
SendeBuffer[pt++] = '=' + (((a & 0x03) << 4) | ((b & 0xf0) >> 4)); |
SendeBuffer[pt++] = '=' + (((b & 0x0f) << 2) | ((c & 0xc0) >> 6)); |
SendeBuffer[pt++] = '=' + ( c & 0x3f); |
} |
AddCRC(pt); |
} |
// -------------------------------------------------------------------------- |
void Decode64(unsigned char *ptrOut, unsigned char len, unsigned char ptrIn,unsigned char max) // Wohin mit den Daten; Wie lang; Wo im RxdBuffer |
{ |
unsigned char a,b,c,d; |
unsigned char ptr = 0; |
unsigned char x,y,z; |
while(len) |
{ |
a = RxdBuffer[ptrIn++] - '='; |
b = RxdBuffer[ptrIn++] - '='; |
c = RxdBuffer[ptrIn++] - '='; |
d = RxdBuffer[ptrIn++] - '='; |
if(ptrIn > max - 2) break; // nicht mehr Daten verarbeiten, als empfangen wurden |
x = (a << 2) | (b >> 4); |
y = ((b & 0x0f) << 4) | (c >> 2); |
z = ((c & 0x03) << 6) | d; |
if(len--) ptrOut[ptr++] = x; else break; |
if(len--) ptrOut[ptr++] = y; else break; |
if(len--) ptrOut[ptr++] = z; else break; |
} |
} |
// -------------------------------------------------------------------------- |
void BearbeiteRxDaten(void) |
{ |
if(!NeuerDatensatzEmpfangen) return; |
//unsigned int tmp_int_arr1[1]; |
//unsigned int tmp_int_arr2[2]; |
//unsigned int tmp_int_arr3[3]; |
unsigned char tmp_char_arr2[2]; |
//unsigned char tmp_char_arr3[3]; |
//unsigned char tmp_char_arr4[4]; |
//if(!MotorenEin) |
PcZugriff = 255; |
switch(RxdBuffer[2]) |
{ |
case 'c':// Debugdaten incl. Externe IOs usw |
Decode64((unsigned char *) &DebugIn,sizeof(DebugIn),3,AnzahlEmpfangsBytes); |
/* for(unsigned char i=0; i<4;i++) |
{ |
EE_CheckAndWrite(&EE_Buffer[EE_DEBUGWERTE + i*2], DebugIn.Analog[i]); |
EE_CheckAndWrite(&EE_Buffer[EE_DEBUGWERTE + i*2 + 1], DebugIn.Analog[i] >> 8); |
}*/ |
RemoteTasten |= DebugIn.RemoteTasten; |
DebugDataAnforderung = 1; |
break; |
case 'h':// x-1 Displayzeilen |
Decode64((unsigned char *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes); |
RemoteTasten |= tmp_char_arr2[0]; |
DebugDisplayAnforderung = 1; |
break; |
case 't':// Motortest |
Decode64((unsigned char *) &MotorTest[0],sizeof(MotorTest),3,AnzahlEmpfangsBytes); |
break; |
case 'v': // Version-Anforderung und Ausbaustufe |
GetVersionAnforderung = 1; |
break; |
case 'g':// "Get"-Anforderung für Debug-Daten |
// Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
DebugGetAnforderung = 1; |
break; |
case 'q':// "Get"-Anforderung für Settings |
// Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
Decode64((unsigned char *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes); |
if(tmp_char_arr2[0] != 0xff) |
{ |
if(tmp_char_arr2[0] > 5) tmp_char_arr2[0] = 5; |
ReadParameterSet(tmp_char_arr2[0], (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
SendOutData('L' + tmp_char_arr2[0] -1,MeineSlaveAdresse,(unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE); |
} |
else |
SendOutData('L' + GetActiveParamSetNumber()-1,MeineSlaveAdresse,(unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE); |
break; |
case 'l': |
case 'm': |
case 'n': |
case 'o': |
case 'p': // Parametersatz speichern |
Decode64((unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE,3,AnzahlEmpfangsBytes); |
WriteParameterSet(RxdBuffer[2] - 'l' + 1, (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], RxdBuffer[2] - 'l' + 1); // aktiven Datensatz merken |
Piep(GetActiveParamSetNumber()); |
break; |
} |
// DebugOut.AnzahlZyklen = Debug_Timer_Intervall; |
NeuerDatensatzEmpfangen = 0; |
} |
//############################################################################ |
//Routine für die Serielle Ausgabe |
int uart_putchar (char c) |
//############################################################################ |
{ |
if (c == '\n') |
uart_putchar('\r'); |
//Warten solange bis Zeichen gesendet wurde |
loop_until_bit_is_set(USR, UDRE); |
//Ausgabe des Zeichens |
UDR = c; |
return (0); |
} |
// -------------------------------------------------------------------------- |
void WriteProgramData(unsigned int pos, unsigned char wert) |
{ |
//if (ProgramLocation == IN_RAM) Buffer[pos] = wert; |
// else eeprom_write_byte(&EE_Buffer[pos], wert); |
// Buffer[pos] = wert; |
} |
//############################################################################ |
//INstallation der Seriellen Schnittstelle |
void UART_Init (void) |
//############################################################################ |
{ |
//Enable TXEN im Register UCR TX-Data Enable & RX Enable |
UCR=(1 << TXEN) | (1 << RXEN); |
// UART Double Speed (U2X) |
USR |= (1<<U2X); |
// RX-Interrupt Freigabe |
UCSRB |= (1<<RXCIE); |
// TX-Interrupt Freigabe |
UCSRB |= (1<<TXCIE); |
//Teiler wird gesetzt |
UBRR=(SYSCLK / (BAUD_RATE * 8L) - 1); |
//UBRR = 33; |
//öffnet einen Kanal für printf (STDOUT) |
//fdevopen (uart_putchar, 0); |
//sbi(PORTD,4); |
Debug_Timer = SetDelay(200); |
gpsState = GPS_EMPTY; |
} |
//--------------------------------------------------------------------------------------------- |
void DatenUebertragung(void) |
{ |
static char dis_zeile = 0; |
if(!UebertragungAbgeschlossen) return; |
if(DebugGetAnforderung && UebertragungAbgeschlossen) // Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
{ |
SendOutData('G',MeineSlaveAdresse,(unsigned char *) &DebugIn,sizeof(DebugIn)); |
DebugGetAnforderung = 0; |
} |
if((CheckDelay(Debug_Timer) || DebugDataAnforderung) && UebertragungAbgeschlossen) |
{ |
SendOutData('D',MeineSlaveAdresse,(unsigned char *) &DebugOut,sizeof(DebugOut)); |
DebugDataAnforderung = 0; |
Debug_Timer = SetDelay(MIN_DEBUG_INTERVALL); |
} |
if(DebugDisplayAnforderung && UebertragungAbgeschlossen) |
{ |
Menu(); |
DebugDisplayAnforderung = 0; |
if(++dis_zeile == 4) dis_zeile = 0; |
SendOutData('0' + dis_zeile,0,&DisplayBuff[20 * dis_zeile],20); // DisplayZeile übertragen |
} |
if(GetVersionAnforderung && UebertragungAbgeschlossen) |
{ |
SendOutData('V',MeineSlaveAdresse,(unsigned char *) &VersionInfo,sizeof(VersionInfo)); |
GetVersionAnforderung = 0; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/uart.h |
---|
0,0 → 1,124 |
#ifndef _UART_H |
#define _UART_H |
#define MAX_SENDE_BUFF 150 |
#define MAX_EMPFANGS_BUFF 150 |
void BearbeiteRxDaten(void); |
extern unsigned char DebugGetAnforderung; |
extern unsigned volatile char SendeBuffer[MAX_SENDE_BUFF]; |
extern unsigned volatile char RxdBuffer[MAX_EMPFANGS_BUFF]; |
extern unsigned volatile char UebertragungAbgeschlossen; |
extern unsigned volatile char PC_DebugTimeout; |
extern unsigned volatile char NeueKoordinateEmpfangen; |
extern unsigned char MeineSlaveAdresse; |
extern unsigned char PcZugriff; |
extern int Debug_Timer; |
extern void UART_Init (void); |
extern int uart_putchar (char c); |
extern void boot_program_page (uint32_t page, uint8_t *buf); |
extern void DatenUebertragung(void); |
extern void DecodeNMEA(void); |
extern unsigned char MotorTest[4]; |
struct str_DebugOut |
{ |
unsigned char Digital[13]; |
unsigned int AnzahlZyklen; |
unsigned int Zeit; |
unsigned char Sekunden; |
unsigned int Analog[16]; // Debugwerte |
}; |
extern struct str_DebugOut DebugOut; |
#define _B1(bit) (1 << (bit)) |
#define _B0(bit) (0 << (bit)) |
typedef struct |
{ |
long x; // in cm (+ = north) |
long y; // in cm (+ = east) |
long z; // in cm |
long vx; |
long vy; |
long vz; |
long northing; |
long easting; |
long altitude; |
long velNorth; |
long velEast; |
uint8_t newData; // status of data: 0 = invlid; 1 = valid |
uint8_t GPSFix; |
uint8_t noSV; // number of sats |
} gpsInfo_t; |
extern gpsInfo_t lockedPos; // stored position to fly to |
extern gpsInfo_t actualPos; // measured position (last gps record) |
extern void GPSscanData (void); |
extern void GPSupdate(void); |
extern void GPSsaveTarget (uint8_t mode); |
struct str_Debug |
{ |
unsigned char Digital[2]; |
unsigned char RemoteTasten; |
unsigned int Analog[4]; |
}; |
extern struct str_Debug DebugIn; |
struct str_VersionInfo |
{ |
unsigned char Hauptversion; |
unsigned char Nebenversion; |
unsigned char PCKompatibel; |
unsigned char Rserved[7]; |
}; |
extern struct str_VersionInfo VersionInfo; |
//Die Baud_Rate der Seriellen Schnittstelle ist 9600 Baud |
//#define BAUD_RATE 9600 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 14400 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 28800 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 38400 //Baud Rate für die Serielle Schnittstelle |
#define BAUD_RATE 57600 //Baud Rate für die Serielle Schnittstelle |
//Anpassen der seriellen Schnittstellen Register wenn ein ATMega128 benutzt wird |
#if defined (__AVR_ATmega128__) |
# define USR UCSR0A |
# define UCR UCSR0B |
# define UDR UDR0 |
# define UBRR UBRR0L |
# define EICR EICRB |
#endif |
#if defined (__AVR_ATmega32__) |
# define USR UCSRA |
# define UCR UCSRB |
# define UBRR UBRRL |
# define EICR EICRB |
# define INT_VEC_RX SIG_UART_RECV |
# define INT_VEC_TX SIG_UART_TRANS |
#endif |
#if defined (__AVR_ATmega644__) |
# define USR UCSR0A |
# define UCR UCSR0B |
# define UDR UDR0 |
# define UBRR UBRR0L |
# define EICR EICR0B |
# define TXEN TXEN0 |
# define RXEN RXEN0 |
# define RXCIE RXCIE0 |
# define TXCIE TXCIE0 |
# define U2X U2X0 |
# define UCSRB UCSR0B |
# define UDRE UDRE0 |
# define INT_VEC_RX SIG_USART_RECV |
# define INT_VEC_TX SIG_USART_TRANS |
#endif |
#endif //_UART_H |
/branches/MergedVersionsByOsiair/alpha/v060JokoKompassNick666MM3Acc/version.txt |
---|
0,0 → 1,79 |
------- |
V0.53 27.04.2007 H.Buss |
- erste öffentliche Version |
V0.53b 29.04.2007 H.Buss |
- der FAKTOR_I war versehentlich auf Null, dann liegt der MikroKopter nicht so hart in der Luft |
V0.53c 29.04.2007 H.Buss |
- es gib ein Menü, in dem die Werte der Kanäle nach Nick, Roll, Gas,... sortiert sind. |
Die angezeigten Werte waren nicht die Werte der Funke |
V0.54 01.05.2007 H.Buss |
- die Paramtersätze können jetzt vor dem Start ausgewählt werden |
Dazu wird beim Kalibrieren der Messwerte (Gashebel oben links) der Nick-Rollhebel abgefragt: |
2 3 4 |
1 x 5 |
- - - |
Bedeutet: Nick-Rollhebel Links Mitte = Setting:1 Links Oben = Setting:2 usw. |
- der Faktor_I für den Hauptregler ist hinzugekommen. Im Heading-Hold-Modus sollte er vergössert werden, was Stabilität bringt |
V0.55 14.05.2007 H.Buss |
- es können nun Servos an J3,J4,J5 mit den Kanälen 5-7 gesteuert werden |
V0.56 14.05.2007 H.Buss |
- es gab Probleme mit Funken, die mehr als 8 Kanäle haben, wenn mehrere Kanäle dann auf Null waren |
- Funken, die nicht bis +-120 aussteuern können, sollten jetzt auch gehen |
V0.57 24.05.2007 H.Buss |
- Der Höhenregler kann nun auch mittels Schalter bedient werden |
- Bug im Gier-Algorithmus behoben; Schnelles Gieren fürhrte dazu, dass der MK zu weit gedreht hat |
- Kompass-Einfluss dämpfen bei Neigung |
- Man kann zwischen Kompass FIX (Richtung beim Kalibrieren) und Variabel (einstellbar per Gier) wählen |
- Der Motortest vom Kopter-Tool geht jetzt |
- Man kann den Parametersätzen einen Namen geben |
- Das Kamerasetting ist unter Setting 2 defaultmässig integriert |
V0.58 30.05.2007 H.Buss |
- Der Höhenregler-Algorithmus wird nun umgangen, wenn der Höhenreglerschalter aus ist |
V0.60 17.08.2007 H.Buss |
- "Schwindel-Bug" behoben |
- Die Poti-Werte werden jetzt auf Unterlauf (<0) überprüft |
- Poti4 zugefügt |
- Es werden jetzt 8 Kanäle ausgewertet |
- Kamera-Servo (an J7) |
- Die Settings müssen überschrieben werden |
V0.61 (in Arbeit) |
- Poti 4 und Kanal 8 werden im Menü angezeigt |
- ein paar Kleinigkeiten bei den DefaultKonstanten2 bereinigt |
MODDS: |
- Höhenreglerabsenkung von -20 auf -40 (fc.c) |
- LED1 und LED2 Ansteuerung (fc.c) und (main.h) |
- geänderte Kanalbelegung K1-K8, Unterspannungsschwelle (9,5V) und StickD (fc.c) |
- P,D Anteil seperat in Variable geschrieben und auf das Analog Display Ausgegeben (Kopter Tool) |
- GPS_Nick und GPS_Roll werden nach Deaktivierung von Position-Hold auf Null gesetzt, um ein Einfrieren der GPS Steuerwerte auf den letzten Wert zu verhindern |
- Funktionsaufruf der GPS-Funktion von Chris/Hallo2 |
- UART.C für die GPS Signale im UTM Format auf Pitschu basierend |
- unsere GPS.c-Routine |
- Mircos variable Filterung (funktioniert nur wenn 250ms Aufruf aktiv ist) |
- GPS wird deaktiviert und Summer eingeschaltet, wenn kein 3D-Fix (mehr) vorhanden |
- Statusanzeige auf eine LED reduziert (aus, blinkend, an) |
- blinkender LED_1 Ausgang für Positionsleuchten (einstellbar über Userparam.4) |
- Homing-Fkt. eingebaut |
- Diverse Absicherungen gegen Fehlbedienungen (z.B. nicht gelernte Home-Position, ...) |
- Rotationsmatrix mit Kompass, damit die GPS-Fkt. nicht nur nach Norden ausgerichtet funktioniert |
- dyn. Position Hold -> normaler Rundflug möglich |
- Limit_D_Anteil = Userparam3 um im Homing- bzw. Waypointmodus die Sollposition gleichmäßiger anzufliegen |
- Die Berechnung von Kompassvalue wird jetzt auch über den GPS Haken im Koptertool aktiviert |
- 12 Kanal Erweiterung |
- Poti5 und Poti6 wird für die GPS-Funktion genutzt |
- ... |
(- Regelung wird nur noch alle 250 ms aufgerufen) |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/COPYING |
---|
0,0 → 1,674 |
GNU GENERAL PUBLIC LICENSE |
Version 3, 29 June 2007 |
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> |
Everyone is permitted to copy and distribute verbatim copies |
of this license document, but changing it is not allowed. |
Preamble |
The GNU General Public License is a free, copyleft license for |
software and other kinds of works. |
The licenses for most software and other practical works are designed |
to take away your freedom to share and change the works. By contrast, |
the GNU General Public License is intended to guarantee your freedom to |
share and change all versions of a program--to make sure it remains free |
software for all its users. We, the Free Software Foundation, use the |
GNU General Public License for most of our software; it applies also to |
any other work released this way by its authors. You can apply it to |
your programs, too. |
When we speak of free software, we are referring to freedom, not |
price. Our General Public Licenses are designed to make sure that you |
have the freedom to distribute copies of free software (and charge for |
them if you wish), that you receive source code or can get it if you |
want it, that you can change the software or use pieces of it in new |
free programs, and that you know you can do these things. |
To protect your rights, we need to prevent others from denying you |
these rights or asking you to surrender the rights. Therefore, you have |
certain responsibilities if you distribute copies of the software, or if |
you modify it: responsibilities to respect the freedom of others. |
For example, if you distribute copies of such a program, whether |
gratis or for a fee, you must pass on to the recipients the same |
freedoms that you received. You must make sure that they, too, receive |
or can get the source code. And you must show them these terms so they |
know their rights. |
Developers that use the GNU GPL protect your rights with two steps: |
(1) assert copyright on the software, and (2) offer you this License |
giving you legal permission to copy, distribute and/or modify it. |
For the developers' and authors' protection, the GPL clearly explains |
that there is no warranty for this free software. For both users' and |
authors' sake, the GPL requires that modified versions be marked as |
changed, so that their problems will not be attributed erroneously to |
authors of previous versions. |
Some devices are designed to deny users access to install or run |
modified versions of the software inside them, although the manufacturer |
can do so. This is fundamentally incompatible with the aim of |
protecting users' freedom to change the software. The systematic |
pattern of such abuse occurs in the area of products for individuals to |
use, which is precisely where it is most unacceptable. Therefore, we |
have designed this version of the GPL to prohibit the practice for those |
products. If such problems arise substantially in other domains, we |
stand ready to extend this provision to those domains in future versions |
of the GPL, as needed to protect the freedom of users. |
Finally, every program is threatened constantly by software patents. |
States should not allow patents to restrict development and use of |
software on general-purpose computers, but in those that do, we wish to |
avoid the special danger that patents applied to a free program could |
make it effectively proprietary. To prevent this, the GPL assures that |
patents cannot be used to render the program non-free. |
The precise terms and conditions for copying, distribution and |
modification follow. |
TERMS AND CONDITIONS |
0. Definitions. |
"This License" refers to version 3 of the GNU General Public License. |
"Copyright" also means copyright-like laws that apply to other kinds of |
works, such as semiconductor masks. |
"The Program" refers to any copyrightable work licensed under this |
License. Each licensee is addressed as "you". "Licensees" and |
"recipients" may be individuals or organizations. |
To "modify" a work means to copy from or adapt all or part of the work |
in a fashion requiring copyright permission, other than the making of an |
exact copy. The resulting work is called a "modified version" of the |
earlier work or a work "based on" the earlier work. |
A "covered work" means either the unmodified Program or a work based |
on the Program. |
To "propagate" a work means to do anything with it that, without |
permission, would make you directly or secondarily liable for |
infringement under applicable copyright law, except executing it on a |
computer or modifying a private copy. Propagation includes copying, |
distribution (with or without modification), making available to the |
public, and in some countries other activities as well. |
To "convey" a work means any kind of propagation that enables other |
parties to make or receive copies. Mere interaction with a user through |
a computer network, with no transfer of a copy, is not conveying. |
An interactive user interface displays "Appropriate Legal Notices" |
to the extent that it includes a convenient and prominently visible |
feature that (1) displays an appropriate copyright notice, and (2) |
tells the user that there is no warranty for the work (except to the |
extent that warranties are provided), that licensees may convey the |
work under this License, and how to view a copy of this License. If |
the interface presents a list of user commands or options, such as a |
menu, a prominent item in the list meets this criterion. |
1. Source Code. |
The "source code" for a work means the preferred form of the work |
for making modifications to it. "Object code" means any non-source |
form of a work. |
A "Standard Interface" means an interface that either is an official |
standard defined by a recognized standards body, or, in the case of |
interfaces specified for a particular programming language, one that |
is widely used among developers working in that language. |
The "System Libraries" of an executable work include anything, other |
than the work as a whole, that (a) is included in the normal form of |
packaging a Major Component, but which is not part of that Major |
Component, and (b) serves only to enable use of the work with that |
Major Component, or to implement a Standard Interface for which an |
implementation is available to the public in source code form. A |
"Major Component", in this context, means a major essential component |
(kernel, window system, and so on) of the specific operating system |
(if any) on which the executable work runs, or a compiler used to |
produce the work, or an object code interpreter used to run it. |
The "Corresponding Source" for a work in object code form means all |
the source code needed to generate, install, and (for an executable |
work) run the object code and to modify the work, including scripts to |
control those activities. However, it does not include the work's |
System Libraries, or general-purpose tools or generally available free |
programs which are used unmodified in performing those activities but |
which are not part of the work. For example, Corresponding Source |
includes interface definition files associated with source files for |
the work, and the source code for shared libraries and dynamically |
linked subprograms that the work is specifically designed to require, |
such as by intimate data communication or control flow between those |
subprograms and other parts of the work. |
The Corresponding Source need not include anything that users |
can regenerate automatically from other parts of the Corresponding |
Source. |
The Corresponding Source for a work in source code form is that |
same work. |
2. Basic Permissions. |
All rights granted under this License are granted for the term of |
copyright on the Program, and are irrevocable provided the stated |
conditions are met. This License explicitly affirms your unlimited |
permission to run the unmodified Program. The output from running a |
covered work is covered by this License only if the output, given its |
content, constitutes a covered work. This License acknowledges your |
rights of fair use or other equivalent, as provided by copyright law. |
You may make, run and propagate covered works that you do not |
convey, without conditions so long as your license otherwise remains |
in force. You may convey covered works to others for the sole purpose |
of having them make modifications exclusively for you, or provide you |
with facilities for running those works, provided that you comply with |
the terms of this License in conveying all material for which you do |
not control copyright. Those thus making or running the covered works |
for you must do so exclusively on your behalf, under your direction |
and control, on terms that prohibit them from making any copies of |
your copyrighted material outside their relationship with you. |
Conveying under any other circumstances is permitted solely under |
the conditions stated below. Sublicensing is not allowed; section 10 |
makes it unnecessary. |
3. Protecting Users' Legal Rights From Anti-Circumvention Law. |
No covered work shall be deemed part of an effective technological |
measure under any applicable law fulfilling obligations under article |
11 of the WIPO copyright treaty adopted on 20 December 1996, or |
similar laws prohibiting or restricting circumvention of such |
measures. |
When you convey a covered work, you waive any legal power to forbid |
circumvention of technological measures to the extent such circumvention |
is effected by exercising rights under this License with respect to |
the covered work, and you disclaim any intention to limit operation or |
modification of the work as a means of enforcing, against the work's |
users, your or third parties' legal rights to forbid circumvention of |
technological measures. |
4. Conveying Verbatim Copies. |
You may convey verbatim copies of the Program's source code as you |
receive it, in any medium, provided that you conspicuously and |
appropriately publish on each copy an appropriate copyright notice; |
keep intact all notices stating that this License and any |
non-permissive terms added in accord with section 7 apply to the code; |
keep intact all notices of the absence of any warranty; and give all |
recipients a copy of this License along with the Program. |
You may charge any price or no price for each copy that you convey, |
and you may offer support or warranty protection for a fee. |
5. Conveying Modified Source Versions. |
You may convey a work based on the Program, or the modifications to |
produce it from the Program, in the form of source code under the |
terms of section 4, provided that you also meet all of these conditions: |
a) The work must carry prominent notices stating that you modified |
it, and giving a relevant date. |
b) The work must carry prominent notices stating that it is |
released under this License and any conditions added under section |
7. This requirement modifies the requirement in section 4 to |
"keep intact all notices". |
c) You must license the entire work, as a whole, under this |
License to anyone who comes into possession of a copy. This |
License will therefore apply, along with any applicable section 7 |
additional terms, to the whole of the work, and all its parts, |
regardless of how they are packaged. This License gives no |
permission to license the work in any other way, but it does not |
invalidate such permission if you have separately received it. |
d) If the work has interactive user interfaces, each must display |
Appropriate Legal Notices; however, if the Program has interactive |
interfaces that do not display Appropriate Legal Notices, your |
work need not make them do so. |
A compilation of a covered work with other separate and independent |
works, which are not by their nature extensions of the covered work, |
and which are not combined with it such as to form a larger program, |
in or on a volume of a storage or distribution medium, is called an |
"aggregate" if the compilation and its resulting copyright are not |
used to limit the access or legal rights of the compilation's users |
beyond what the individual works permit. Inclusion of a covered work |
in an aggregate does not cause this License to apply to the other |
parts of the aggregate. |
6. Conveying Non-Source Forms. |
You may convey a covered work in object code form under the terms |
of sections 4 and 5, provided that you also convey the |
machine-readable Corresponding Source under the terms of this License, |
in one of these ways: |
a) Convey the object code in, or embodied in, a physical product |
(including a physical distribution medium), accompanied by the |
Corresponding Source fixed on a durable physical medium |
customarily used for software interchange. |
b) Convey the object code in, or embodied in, a physical product |
(including a physical distribution medium), accompanied by a |
written offer, valid for at least three years and valid for as |
long as you offer spare parts or customer support for that product |
model, to give anyone who possesses the object code either (1) a |
copy of the Corresponding Source for all the software in the |
product that is covered by this License, on a durable physical |
medium customarily used for software interchange, for a price no |
more than your reasonable cost of physically performing this |
conveying of source, or (2) access to copy the |
Corresponding Source from a network server at no charge. |
c) Convey individual copies of the object code with a copy of the |
written offer to provide the Corresponding Source. This |
alternative is allowed only occasionally and noncommercially, and |
only if you received the object code with such an offer, in accord |
with subsection 6b. |
d) Convey the object code by offering access from a designated |
place (gratis or for a charge), and offer equivalent access to the |
Corresponding Source in the same way through the same place at no |
further charge. You need not require recipients to copy the |
Corresponding Source along with the object code. If the place to |
copy the object code is a network server, the Corresponding Source |
may be on a different server (operated by you or a third party) |
that supports equivalent copying facilities, provided you maintain |
clear directions next to the object code saying where to find the |
Corresponding Source. Regardless of what server hosts the |
Corresponding Source, you remain obligated to ensure that it is |
available for as long as needed to satisfy these requirements. |
e) Convey the object code using peer-to-peer transmission, provided |
you inform other peers where the object code and Corresponding |
Source of the work are being offered to the general public at no |
charge under subsection 6d. |
A separable portion of the object code, whose source code is excluded |
from the Corresponding Source as a System Library, need not be |
included in conveying the object code work. |
A "User Product" is either (1) a "consumer product", which means any |
tangible personal property which is normally used for personal, family, |
or household purposes, or (2) anything designed or sold for incorporation |
into a dwelling. In determining whether a product is a consumer product, |
doubtful cases shall be resolved in favor of coverage. For a particular |
product received by a particular user, "normally used" refers to a |
typical or common use of that class of product, regardless of the status |
of the particular user or of the way in which the particular user |
actually uses, or expects or is expected to use, the product. A product |
is a consumer product regardless of whether the product has substantial |
commercial, industrial or non-consumer uses, unless such uses represent |
the only significant mode of use of the product. |
"Installation Information" for a User Product means any methods, |
procedures, authorization keys, or other information required to install |
and execute modified versions of a covered work in that User Product from |
a modified version of its Corresponding Source. The information must |
suffice to ensure that the continued functioning of the modified object |
code is in no case prevented or interfered with solely because |
modification has been made. |
If you convey an object code work under this section in, or with, or |
specifically for use in, a User Product, and the conveying occurs as |
part of a transaction in which the right of possession and use of the |
User Product is transferred to the recipient in perpetuity or for a |
fixed term (regardless of how the transaction is characterized), the |
Corresponding Source conveyed under this section must be accompanied |
by the Installation Information. But this requirement does not apply |
if neither you nor any third party retains the ability to install |
modified object code on the User Product (for example, the work has |
been installed in ROM). |
The requirement to provide Installation Information does not include a |
requirement to continue to provide support service, warranty, or updates |
for a work that has been modified or installed by the recipient, or for |
the User Product in which it has been modified or installed. Access to a |
network may be denied when the modification itself materially and |
adversely affects the operation of the network or violates the rules and |
protocols for communication across the network. |
Corresponding Source conveyed, and Installation Information provided, |
in accord with this section must be in a format that is publicly |
documented (and with an implementation available to the public in |
source code form), and must require no special password or key for |
unpacking, reading or copying. |
7. Additional Terms. |
"Additional permissions" are terms that supplement the terms of this |
License by making exceptions from one or more of its conditions. |
Additional permissions that are applicable to the entire Program shall |
be treated as though they were included in this License, to the extent |
that they are valid under applicable law. If additional permissions |
apply only to part of the Program, that part may be used separately |
under those permissions, but the entire Program remains governed by |
this License without regard to the additional permissions. |
When you convey a copy of a covered work, you may at your option |
remove any additional permissions from that copy, or from any part of |
it. (Additional permissions may be written to require their own |
removal in certain cases when you modify the work.) You may place |
additional permissions on material, added by you to a covered work, |
for which you have or can give appropriate copyright permission. |
Notwithstanding any other provision of this License, for material you |
add to a covered work, you may (if authorized by the copyright holders of |
that material) supplement the terms of this License with terms: |
a) Disclaiming warranty or limiting liability differently from the |
terms of sections 15 and 16 of this License; or |
b) Requiring preservation of specified reasonable legal notices or |
author attributions in that material or in the Appropriate Legal |
Notices displayed by works containing it; or |
c) Prohibiting misrepresentation of the origin of that material, or |
requiring that modified versions of such material be marked in |
reasonable ways as different from the original version; or |
d) Limiting the use for publicity purposes of names of licensors or |
authors of the material; or |
e) Declining to grant rights under trademark law for use of some |
trade names, trademarks, or service marks; or |
f) Requiring indemnification of licensors and authors of that |
material by anyone who conveys the material (or modified versions of |
it) with contractual assumptions of liability to the recipient, for |
any liability that these contractual assumptions directly impose on |
those licensors and authors. |
All other non-permissive additional terms are considered "further |
restrictions" within the meaning of section 10. If the Program as you |
received it, or any part of it, contains a notice stating that it is |
governed by this License along with a term that is a further |
restriction, you may remove that term. If a license document contains |
a further restriction but permits relicensing or conveying under this |
License, you may add to a covered work material governed by the terms |
of that license document, provided that the further restriction does |
not survive such relicensing or conveying. |
If you add terms to a covered work in accord with this section, you |
must place, in the relevant source files, a statement of the |
additional terms that apply to those files, or a notice indicating |
where to find the applicable terms. |
Additional terms, permissive or non-permissive, may be stated in the |
form of a separately written license, or stated as exceptions; |
the above requirements apply either way. |
8. Termination. |
You may not propagate or modify a covered work except as expressly |
provided under this License. Any attempt otherwise to propagate or |
modify it is void, and will automatically terminate your rights under |
this License (including any patent licenses granted under the third |
paragraph of section 11). |
However, if you cease all violation of this License, then your |
license from a particular copyright holder is reinstated (a) |
provisionally, unless and until the copyright holder explicitly and |
finally terminates your license, and (b) permanently, if the copyright |
holder fails to notify you of the violation by some reasonable means |
prior to 60 days after the cessation. |
Moreover, your license from a particular copyright holder is |
reinstated permanently if the copyright holder notifies you of the |
violation by some reasonable means, this is the first time you have |
received notice of violation of this License (for any work) from that |
copyright holder, and you cure the violation prior to 30 days after |
your receipt of the notice. |
Termination of your rights under this section does not terminate the |
licenses of parties who have received copies or rights from you under |
this License. If your rights have been terminated and not permanently |
reinstated, you do not qualify to receive new licenses for the same |
material under section 10. |
9. Acceptance Not Required for Having Copies. |
You are not required to accept this License in order to receive or |
run a copy of the Program. Ancillary propagation of a covered work |
occurring solely as a consequence of using peer-to-peer transmission |
to receive a copy likewise does not require acceptance. However, |
nothing other than this License grants you permission to propagate or |
modify any covered work. These actions infringe copyright if you do |
not accept this License. Therefore, by modifying or propagating a |
covered work, you indicate your acceptance of this License to do so. |
10. Automatic Licensing of Downstream Recipients. |
Each time you convey a covered work, the recipient automatically |
receives a license from the original licensors, to run, modify and |
propagate that work, subject to this License. You are not responsible |
for enforcing compliance by third parties with this License. |
An "entity transaction" is a transaction transferring control of an |
organization, or substantially all assets of one, or subdividing an |
organization, or merging organizations. If propagation of a covered |
work results from an entity transaction, each party to that |
transaction who receives a copy of the work also receives whatever |
licenses to the work the party's predecessor in interest had or could |
give under the previous paragraph, plus a right to possession of the |
Corresponding Source of the work from the predecessor in interest, if |
the predecessor has it or can get it with reasonable efforts. |
You may not impose any further restrictions on the exercise of the |
rights granted or affirmed under this License. For example, you may |
not impose a license fee, royalty, or other charge for exercise of |
rights granted under this License, and you may not initiate litigation |
(including a cross-claim or counterclaim in a lawsuit) alleging that |
any patent claim is infringed by making, using, selling, offering for |
sale, or importing the Program or any portion of it. |
11. Patents. |
A "contributor" is a copyright holder who authorizes use under this |
License of the Program or a work on which the Program is based. The |
work thus licensed is called the contributor's "contributor version". |
A contributor's "essential patent claims" are all patent claims |
owned or controlled by the contributor, whether already acquired or |
hereafter acquired, that would be infringed by some manner, permitted |
by this License, of making, using, or selling its contributor version, |
but do not include claims that would be infringed only as a |
consequence of further modification of the contributor version. For |
purposes of this definition, "control" includes the right to grant |
patent sublicenses in a manner consistent with the requirements of |
this License. |
Each contributor grants you a non-exclusive, worldwide, royalty-free |
patent license under the contributor's essential patent claims, to |
make, use, sell, offer for sale, import and otherwise run, modify and |
propagate the contents of its contributor version. |
In the following three paragraphs, a "patent license" is any express |
agreement or commitment, however denominated, not to enforce a patent |
(such as an express permission to practice a patent or covenant not to |
sue for patent infringement). To "grant" such a patent license to a |
party means to make such an agreement or commitment not to enforce a |
patent against the party. |
If you convey a covered work, knowingly relying on a patent license, |
and the Corresponding Source of the work is not available for anyone |
to copy, free of charge and under the terms of this License, through a |
publicly available network server or other readily accessible means, |
then you must either (1) cause the Corresponding Source to be so |
available, or (2) arrange to deprive yourself of the benefit of the |
patent license for this particular work, or (3) arrange, in a manner |
consistent with the requirements of this License, to extend the patent |
license to downstream recipients. "Knowingly relying" means you have |
actual knowledge that, but for the patent license, your conveying the |
covered work in a country, or your recipient's use of the covered work |
in a country, would infringe one or more identifiable patents in that |
country that you have reason to believe are valid. |
If, pursuant to or in connection with a single transaction or |
arrangement, you convey, or propagate by procuring conveyance of, a |
covered work, and grant a patent license to some of the parties |
receiving the covered work authorizing them to use, propagate, modify |
or convey a specific copy of the covered work, then the patent license |
you grant is automatically extended to all recipients of the covered |
work and works based on it. |
A patent license is "discriminatory" if it does not include within |
the scope of its coverage, prohibits the exercise of, or is |
conditioned on the non-exercise of one or more of the rights that are |
specifically granted under this License. You may not convey a covered |
work if you are a party to an arrangement with a third party that is |
in the business of distributing software, under which you make payment |
to the third party based on the extent of your activity of conveying |
the work, and under which the third party grants, to any of the |
parties who would receive the covered work from you, a discriminatory |
patent license (a) in connection with copies of the covered work |
conveyed by you (or copies made from those copies), or (b) primarily |
for and in connection with specific products or compilations that |
contain the covered work, unless you entered into that arrangement, |
or that patent license was granted, prior to 28 March 2007. |
Nothing in this License shall be construed as excluding or limiting |
any implied license or other defenses to infringement that may |
otherwise be available to you under applicable patent law. |
12. No Surrender of Others' Freedom. |
If conditions are imposed on you (whether by court order, agreement or |
otherwise) that contradict the conditions of this License, they do not |
excuse you from the conditions of this License. If you cannot convey a |
covered work so as to satisfy simultaneously your obligations under this |
License and any other pertinent obligations, then as a consequence you may |
not convey it at all. For example, if you agree to terms that obligate you |
to collect a royalty for further conveying from those to whom you convey |
the Program, the only way you could satisfy both those terms and this |
License would be to refrain entirely from conveying the Program. |
13. Use with the GNU Affero General Public License. |
Notwithstanding any other provision of this License, you have |
permission to link or combine any covered work with a work licensed |
under version 3 of the GNU Affero General Public License into a single |
combined work, and to convey the resulting work. The terms of this |
License will continue to apply to the part which is the covered work, |
but the special requirements of the GNU Affero General Public License, |
section 13, concerning interaction through a network will apply to the |
combination as such. |
14. Revised Versions of this License. |
The Free Software Foundation may publish revised and/or new versions of |
the GNU General Public License from time to time. Such new versions will |
be similar in spirit to the present version, but may differ in detail to |
address new problems or concerns. |
Each version is given a distinguishing version number. If the |
Program specifies that a certain numbered version of the GNU General |
Public License "or any later version" applies to it, you have the |
option of following the terms and conditions either of that numbered |
version or of any later version published by the Free Software |
Foundation. If the Program does not specify a version number of the |
GNU General Public License, you may choose any version ever published |
by the Free Software Foundation. |
If the Program specifies that a proxy can decide which future |
versions of the GNU General Public License can be used, that proxy's |
public statement of acceptance of a version permanently authorizes you |
to choose that version for the Program. |
Later license versions may give you additional or different |
permissions. However, no additional obligations are imposed on any |
author or copyright holder as a result of your choosing to follow a |
later version. |
15. Disclaimer of Warranty. |
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY |
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT |
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY |
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, |
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM |
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF |
ALL NECESSARY SERVICING, REPAIR OR CORRECTION. |
16. Limitation of Liability. |
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS |
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY |
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE |
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF |
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD |
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), |
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF |
SUCH DAMAGES. |
17. Interpretation of Sections 15 and 16. |
If the disclaimer of warranty and limitation of liability provided |
above cannot be given local legal effect according to their terms, |
reviewing courts shall apply local law that most closely approximates |
an absolute waiver of all civil liability in connection with the |
Program, unless a warranty or assumption of liability accompanies a |
copy of the Program in return for a fee. |
END OF TERMS AND CONDITIONS |
How to Apply These Terms to Your New Programs |
If you develop a new program, and you want it to be of the greatest |
possible use to the public, the best way to achieve this is to make it |
free software which everyone can redistribute and change under these terms. |
To do so, attach the following notices to the program. It is safest |
to attach them to the start of each source file to most effectively |
state the exclusion of warranty; and each file should have at least |
the "copyright" line and a pointer to where the full notice is found. |
<one line to give the program's name and a brief idea of what it does.> |
Copyright (C) <year> <name of author> |
This program is free software: you can redistribute it and/or modify |
it under the terms of the GNU General Public License as published by |
the Free Software Foundation, either version 3 of the License, or |
(at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License for more details. |
You should have received a copy of the GNU General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
Also add information on how to contact you by electronic and paper mail. |
If the program does terminal interaction, make it output a short |
notice like this when it starts in an interactive mode: |
<program> Copyright (C) <year> <name of author> |
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. |
This is free software, and you are welcome to redistribute it |
under certain conditions; type `show c' for details. |
The hypothetical commands `show w' and `show c' should show the appropriate |
parts of the General Public License. Of course, your program's commands |
might be different; for a GUI interface, you would use an "about box". |
You should also get your employer (if you work as a programmer) or school, |
if any, to sign a "copyright disclaimer" for the program, if necessary. |
For more information on this, and how to apply and follow the GNU GPL, see |
<http://www.gnu.org/licenses/>. |
The GNU General Public License does not permit incorporating your program |
into proprietary programs. If your program is a subroutine library, you |
may consider it more useful to permit linking proprietary applications with |
the library. If this is what you want to do, use the GNU Lesser General |
Public License instead of this License. But first, please read |
<http://www.gnu.org/philosophy/why-not-lgpl.html>. |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/COPYING.LESSER |
---|
0,0 → 1,165 |
GNU LESSER GENERAL PUBLIC LICENSE |
Version 3, 29 June 2007 |
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> |
Everyone is permitted to copy and distribute verbatim copies |
of this license document, but changing it is not allowed. |
This version of the GNU Lesser General Public License incorporates |
the terms and conditions of version 3 of the GNU General Public |
License, supplemented by the additional permissions listed below. |
0. Additional Definitions. |
As used herein, "this License" refers to version 3 of the GNU Lesser |
General Public License, and the "GNU GPL" refers to version 3 of the GNU |
General Public License. |
"The Library" refers to a covered work governed by this License, |
other than an Application or a Combined Work as defined below. |
An "Application" is any work that makes use of an interface provided |
by the Library, but which is not otherwise based on the Library. |
Defining a subclass of a class defined by the Library is deemed a mode |
of using an interface provided by the Library. |
A "Combined Work" is a work produced by combining or linking an |
Application with the Library. The particular version of the Library |
with which the Combined Work was made is also called the "Linked |
Version". |
The "Minimal Corresponding Source" for a Combined Work means the |
Corresponding Source for the Combined Work, excluding any source code |
for portions of the Combined Work that, considered in isolation, are |
based on the Application, and not on the Linked Version. |
The "Corresponding Application Code" for a Combined Work means the |
object code and/or source code for the Application, including any data |
and utility programs needed for reproducing the Combined Work from the |
Application, but excluding the System Libraries of the Combined Work. |
1. Exception to Section 3 of the GNU GPL. |
You may convey a covered work under sections 3 and 4 of this License |
without being bound by section 3 of the GNU GPL. |
2. Conveying Modified Versions. |
If you modify a copy of the Library, and, in your modifications, a |
facility refers to a function or data to be supplied by an Application |
that uses the facility (other than as an argument passed when the |
facility is invoked), then you may convey a copy of the modified |
version: |
a) under this License, provided that you make a good faith effort to |
ensure that, in the event an Application does not supply the |
function or data, the facility still operates, and performs |
whatever part of its purpose remains meaningful, or |
b) under the GNU GPL, with none of the additional permissions of |
this License applicable to that copy. |
3. Object Code Incorporating Material from Library Header Files. |
The object code form of an Application may incorporate material from |
a header file that is part of the Library. You may convey such object |
code under terms of your choice, provided that, if the incorporated |
material is not limited to numerical parameters, data structure |
layouts and accessors, or small macros, inline functions and templates |
(ten or fewer lines in length), you do both of the following: |
a) Give prominent notice with each copy of the object code that the |
Library is used in it and that the Library and its use are |
covered by this License. |
b) Accompany the object code with a copy of the GNU GPL and this license |
document. |
4. Combined Works. |
You may convey a Combined Work under terms of your choice that, |
taken together, effectively do not restrict modification of the |
portions of the Library contained in the Combined Work and reverse |
engineering for debugging such modifications, if you also do each of |
the following: |
a) Give prominent notice with each copy of the Combined Work that |
the Library is used in it and that the Library and its use are |
covered by this License. |
b) Accompany the Combined Work with a copy of the GNU GPL and this license |
document. |
c) For a Combined Work that displays copyright notices during |
execution, include the copyright notice for the Library among |
these notices, as well as a reference directing the user to the |
copies of the GNU GPL and this license document. |
d) Do one of the following: |
0) Convey the Minimal Corresponding Source under the terms of this |
License, and the Corresponding Application Code in a form |
suitable for, and under terms that permit, the user to |
recombine or relink the Application with a modified version of |
the Linked Version to produce a modified Combined Work, in the |
manner specified by section 6 of the GNU GPL for conveying |
Corresponding Source. |
1) Use a suitable shared library mechanism for linking with the |
Library. A suitable mechanism is one that (a) uses at run time |
a copy of the Library already present on the user's computer |
system, and (b) will operate properly with a modified version |
of the Library that is interface-compatible with the Linked |
Version. |
e) Provide Installation Information, but only if you would otherwise |
be required to provide such information under section 6 of the |
GNU GPL, and only to the extent that such information is |
necessary to install and execute a modified version of the |
Combined Work produced by recombining or relinking the |
Application with a modified version of the Linked Version. (If |
you use option 4d0, the Installation Information must accompany |
the Minimal Corresponding Source and Corresponding Application |
Code. If you use option 4d1, you must provide the Installation |
Information in the manner specified by section 6 of the GNU GPL |
for conveying Corresponding Source.) |
5. Combined Libraries. |
You may place library facilities that are a work based on the |
Library side by side in a single library together with other library |
facilities that are not Applications and are not covered by this |
License, and convey such a combined library under terms of your |
choice, if you do both of the following: |
a) Accompany the combined library with a copy of the same work based |
on the Library, uncombined with any other library facilities, |
conveyed under the terms of this License. |
b) Give prominent notice with the combined library that part of it |
is a work based on the Library, and explaining where to find the |
accompanying uncombined form of the same work. |
6. Revised Versions of the GNU Lesser General Public License. |
The Free Software Foundation may publish revised and/or new versions |
of the GNU Lesser General Public License from time to time. Such new |
versions will be similar in spirit to the present version, but may |
differ in detail to address new problems or concerns. |
Each version is given a distinguishing version number. If the |
Library as you received it specifies that a certain numbered version |
of the GNU Lesser General Public License "or any later version" |
applies to it, you have the option of following the terms and |
conditions either of that published version or of any later version |
published by the Free Software Foundation. If the Library as you |
received it does not specify a version number of the GNU Lesser |
General Public License, you may choose any version of the GNU Lesser |
General Public License ever published by the Free Software Foundation. |
If the Library as you received it specifies that a proxy can decide |
whether future versions of the GNU Lesser General Public License shall |
apply, that proxy's public statement of acceptance of any version is |
permanent authorization for you to choose that version for the |
Library. |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/Flight-Ctrl_MEGA644_V0_60.aps |
---|
0,0 → 1,0 |
<AVRStudio><MANAGEMENT><ProjectName>Flight-Ctrl_MEGA644_V0_60</ProjectName><Created>19-Aug-2007 14:38:13</Created><LastEdit>19-Oct-2007 17:48:42</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>19-Aug-2007 14:38:13</Created><Version>4</Version><Build>4, 13, 0, 528</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>Flight-Ctrl_MEGA644_V0_60.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v60SalvoKompassACC\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>AVR Simulator</CURRENT_TARGET><CURRENT_PART>ATmega644.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>main.c</SOURCEFILE><SOURCEFILE>analog.c</SOURCEFILE><SOURCEFILE>eeprom.c</SOURCEFILE><SOURCEFILE>fc.c</SOURCEFILE><SOURCEFILE>GPS.c</SOURCEFILE><SOURCEFILE>menu.c</SOURCEFILE><SOURCEFILE>printf_P.c</SOURCEFILE><SOURCEFILE>rc.c</SOURCEFILE><SOURCEFILE>timer0.c</SOURCEFILE><SOURCEFILE>twimaster.c</SOURCEFILE><SOURCEFILE>uart.c</SOURCEFILE><SOURCEFILE>compass.c</SOURCEFILE><SOURCEFILE>math.c</SOURCEFILE><HEADERFILE>_Settings.h</HEADERFILE><HEADERFILE>analog.h</HEADERFILE><HEADERFILE>fc.h</HEADERFILE><HEADERFILE>gps.h</HEADERFILE><HEADERFILE>main.h</HEADERFILE><HEADERFILE>menu.h</HEADERFILE><HEADERFILE>old_macros.h</HEADERFILE><HEADERFILE>printf_P.h</HEADERFILE><HEADERFILE>rc.h</HEADERFILE><HEADERFILE>Settings.h</HEADERFILE><HEADERFILE>timer0.h</HEADERFILE><HEADERFILE>twimaster.h</HEADERFILE><HEADERFILE>uart.h</HEADERFILE><HEADERFILE>compass.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega644</PART><HEX>1</HEX><LIST>0</LIST><MAP>0</MAP><OUTPUTFILENAME>Flight-Ctrl_MEGA644_V0_60.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>0</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -O0 -fsigned-char</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20070525\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20070525\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/></IOView><Files><File00000><FileId>00000</FileId><FileName>main.c</FileName><Status>1</Status></File00000><File00001><FileId>00001</FileId><FileName>compass.c</FileName><Status>1</Status></File00001><File00002><FileId>00002</FileId><FileName>math.c</FileName><Status>1</Status></File00002><File00003><FileId>00003</FileId><FileName>analog.c</FileName><Status>1</Status></File00003><File00004><FileId>00004</FileId><FileName>rc.c</FileName><Status>1</Status></File00004><File00005><FileId>00005</FileId><FileName>timer0.c</FileName><Status>1</Status></File00005></Files><Workspace><File00000><Position>320 71 1032 624</Position><LineCol>116 0</LineCol></File00000><File00001><Position>330 67 1396 826</Position><LineCol>128 0</LineCol></File00001><File00002><Position>375 132 925 504</Position><LineCol>161 0</LineCol></File00002><File00003><Position>397 154 947 526</Position><LineCol>106 0</LineCol></File00003><File00004><Position>428 182 1024 672</Position><LineCol>0 0</LineCol></File00004><File00005><Position>336 71 1182 830</Position><LineCol>62 2</LineCol><State>Maximized</State></File00005></Workspace><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio> |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/GPS.c |
---|
0,0 → 1,638 |
/* |
This program (files gps.c and gps.h) is free software; you can redistribute it and/or modify |
it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; |
either version 3 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License and GNU Lesser General Public License for more details. |
You should have received a copy of GNU General Public License (License_GPL.txt) and |
GNU Lesser General Public License (License_LGPL.txt) along with this program. |
If not, see <http://www.gnu.org/licenses/>. |
Please note: All the other files for the project "Mikrokopter" by H.Buss are under the license (license_buss.txt) published by www.mikrokopter.de |
*/ |
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
Peter Muehlenbrock |
Auswertung der Daten vom GPS im ublox Format |
Hold Modus mit PID Regler |
Rückstuerz zur Basis Funktion |
Stand 13.10.2007 |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
*/ |
#include "main.h" |
//#include "gps.h" |
// Defines fuer ublox Messageformat um Auswertung zu steuern |
#define UBLOX_IDLE 0 |
#define UBLOX_SYNC1 1 |
#define UBLOX_SYNC2 2 |
#define UBLOX_CLASS 3 |
#define UBLOX_ID 4 |
#define UBLOX_LEN1 5 |
#define UBLOX_LEN2 6 |
#define UBLOX_CKA 7 |
#define UBLOX_CKB 8 |
#define UBLOX_PAYLOAD 9 |
// ublox Protokoll Identifier |
#define UBLOX_NAV_POSUTM 0x08 |
#define UBLOX_NAV_STATUS 0x03 |
#define UBLOX_NAV_VELED 0x12 |
#define UBLOX_NAV_CLASS 0x01 |
#define UBLOX_SYNCH1_CHAR 0xB5 |
#define UBLOX_SYNCH2_CHAR 0x62 |
signed int GPS_Nick = 0; |
signed int GPS_Roll = 0; |
short int ublox_msg_state = UBLOX_IDLE; |
static uint8_t chk_a =0; //Checksum |
static uint8_t chk_b =0; |
short int gps_state,gps_sub_state; //Zustaende der Statemachine |
short int gps_updte_flag; |
signed int GPS_hdng_abs_2trgt; //Winkel zum Ziel bezogen auf Nordpol |
signed int GPS_hdng_rel_2trgt; //Winkel zum Ziel bezogen auf Nordachse des Kopters |
signed int GPS_dist_2trgt; //vorzeichenlose Distanz zum Ziel |
signed int gps_int_x,gps_int_y,gps_reg_x,gps_reg_y; |
static unsigned int rx_len; |
static unsigned int ptr_payload_data_end; |
unsigned int gps_alive_cnt; // Wird bei jedem gueltigen GPS Telegramm hochgezaehlt |
signed int hdng_2home,dist_2home; //Richtung und Entfernung zur home Position |
static signed gps_tick; //wird bei jedem Update durch das GPS Modul hochgezaehlt |
static short int hold_fast,hold_reset_int; //Flags fuer Hold Regler |
static uint8_t *ptr_payload_data; |
static uint8_t *ptr_pac_status; |
long int dist_flown; |
short int Get_GPS_data(void); |
NAV_POSUTM_t actual_pos; // Aktuelle Nav Daten werden hier im ublox Format abgelegt |
NAV_STATUS_t actual_status; // Aktueller Nav Status |
NAV_VELNED_t actual_speed; // Aktueller Geschwindigkeits und Richtungsdaten |
GPS_ABS_POSITION_t gps_act_position; // Alle wichtigen Daten zusammengefasst |
GPS_ABS_POSITION_t gps_home_position; // Die Startposition, beim Kalibrieren ermittelt |
GPS_REL_POSITION_t gps_rel_act_position; // Die aktuelle relative Position bezogen auf Home Position |
GPS_REL_POSITION_t gps_rel_hold_position; // Die gespeicherte Sollposition fuer GPS_ Hold Mode |
GPS_REL_POSITION_t gps_rel_start_position; // Die gespeicherte Ausgangsposition fuer GPS_ Home Mode |
// Initialisierung |
void GPS_Neutral(void) |
{ |
ublox_msg_state = UBLOX_IDLE; |
gps_state = GPS_CRTL_IDLE; |
gps_sub_state = GPS_CRTL_IDLE; |
actual_pos.status = 0; |
actual_speed.status = 0; |
actual_status.status = 0; |
gps_home_position.status = 0; // Noch keine gueltige Home Position |
gps_act_position.status = 0; |
gps_rel_act_position.status = 0; |
GPS_Nick = 0; |
GPS_Roll = 0; |
gps_updte_flag = 0; |
gps_int_x = 0; |
gps_int_y = 0; |
gps_alive_cnt = 0; |
} |
// Home Position sichern falls Daten verfuegbar sind. |
void GPS_Save_Home(void) |
{ |
short int n; |
n = Get_GPS_data(); |
if (n == 0) // Gueltige und aktuelle Daten ? |
{ |
// Neue GPS Daten liegen vor |
gps_home_position.utm_east = gps_act_position.utm_east; |
gps_home_position.utm_north = gps_act_position.utm_north; |
gps_home_position.utm_alt = gps_act_position.utm_alt; |
gps_home_position.status = 1; // Home Position gueltig |
} |
} |
// Relative Position zur Home Position bestimmen |
// Rueckgabewert 0= Daten sind aktuell und gueltig. 1= Keine Aenderung. 2= Daten ungueltig |
short int Get_Rel_Position(void) |
{ |
short int n = 0; |
n = Get_GPS_data(); |
if (n >=1) return (n); // nix zu tun, weil keine neue Daten da sind |
if (gps_alive_cnt < 400) gps_alive_cnt += 300; // Timeoutzaehler. Wird in Motorregler Routine ueberwacht und dekrementiert |
if (gps_home_position.status > 0) //Nur wenn Home Position vorliegt |
{ |
gps_rel_act_position.utm_east = (int) (gps_act_position.utm_east - gps_home_position.utm_east); |
gps_rel_act_position.utm_north = (int) (gps_act_position.utm_north - gps_home_position.utm_north); |
gps_rel_act_position.status = 1; // gueltige Positionsdaten |
n = 0; |
gps_updte_flag = 1; // zeigt an, dass neue Daten vorliegen. |
} |
else |
{ |
n = 2; //keine gueltigen Daten vorhanden |
gps_rel_act_position.status = 0; //keine gueltige Position weil keine home Position da ist. |
} |
return (n); |
} |
// Daten aus aktuellen ublox Messages extrahieren |
// Rueckgabewert 0= Daten sind aktuell und gueltig. 1= Keine Aenderung. 2= Daten ungueltig |
short int Get_GPS_data(void) |
{ |
short int n = 1; |
if (actual_pos.status == 0) return (1); //damit es schnell geht, wenn nix zu tun ist |
if ((actual_pos.status > 0) && (actual_status.status > 0) && (actual_speed.status > 0)) |
{ |
if (((actual_status.gpsfix_type & 0x03) >=2) && ((actual_status.nav_status_flag & 0x01) >=1)) // nur wenn Daten aktuell und gueltig sind |
{ |
gps_act_position.utm_east = actual_pos.utm_east/10; |
gps_act_position.utm_north = actual_pos.utm_north/10; |
gps_act_position.utm_alt = actual_pos.utm_alt/10; |
gps_act_position.speed_gnd = actual_speed.speed_gnd/10; |
gps_act_position.speed_gnd = actual_speed.speed_gnd/10; |
gps_act_position.heading = actual_speed.heading/100000; |
gps_act_position.status = 1; |
n = 0; //Daten gueltig |
} |
else |
{ |
gps_act_position.status = 0; //Keine gueltigen Daten |
n = 2; |
} |
actual_pos.status = 0; //neue ublox Messages anfordern |
actual_status.status = 0; |
actual_speed.status = 0; |
} |
return (n); |
} |
/* |
Daten vom GPS im ublox MSG Format auswerten |
Die Routine wird bei jedem Empfang eines Zeichens vom GPS Modul durch den UART IRQ aufgerufen |
// Die UBX Messages NAV_POSUTM, NAV_STATUS und NAV_VALED muessen aktiviert sein |
*/ |
void Get_Ublox_Msg(uint8_t rx) |
{ |
switch (ublox_msg_state) |
{ |
case UBLOX_IDLE: // Zuerst Synchcharacters pruefen |
if ( rx == UBLOX_SYNCH1_CHAR ) ublox_msg_state = UBLOX_SYNC1; |
else ublox_msg_state = UBLOX_IDLE; |
break; |
case UBLOX_SYNC1: |
if (rx == UBLOX_SYNCH2_CHAR) ublox_msg_state = UBLOX_SYNC2; |
else ublox_msg_state = UBLOX_IDLE; |
chk_a = 0,chk_b = 0; |
break; |
case UBLOX_SYNC2: |
if (rx == UBLOX_NAV_CLASS) ublox_msg_state = UBLOX_CLASS; |
else ublox_msg_state = UBLOX_IDLE; |
break; |
case UBLOX_CLASS: // Nur NAV Meldungen auswerten |
switch (rx) |
{ |
case UBLOX_NAV_POSUTM: |
ptr_pac_status = &actual_pos.status; |
if (*ptr_pac_status > 0) ublox_msg_state = UBLOX_IDLE; //Abbruch weil Daten noch nicht verwendet wurden |
else |
{ |
ptr_payload_data = &actual_pos; |
ptr_payload_data_end = &actual_pos.status; |
ublox_msg_state = UBLOX_LEN1; |
} |
break; |
case UBLOX_NAV_STATUS: |
ptr_pac_status = &actual_status.status; |
if (*ptr_pac_status > 0) ublox_msg_state = UBLOX_IDLE; |
else |
{ |
ptr_payload_data = &actual_status; |
ptr_payload_data_end = &actual_status.status; |
ublox_msg_state = UBLOX_LEN1; |
} |
break; |
case UBLOX_NAV_VELED: |
ptr_pac_status = &actual_speed.status; |
if (*ptr_pac_status > 0) ublox_msg_state = UBLOX_IDLE; |
else |
{ |
ptr_payload_data = &actual_speed; |
ptr_payload_data_end = &actual_speed.status; |
ublox_msg_state = UBLOX_LEN1; |
} |
break; |
default: |
ublox_msg_state = UBLOX_IDLE; |
break; |
} |
chk_a = UBLOX_NAV_CLASS + rx; |
chk_b = UBLOX_NAV_CLASS + chk_a; |
break; |
case UBLOX_LEN1: // Laenge auswerten |
rx_len = rx; |
chk_a += rx; |
chk_b += chk_a; |
ublox_msg_state = UBLOX_LEN2; |
break; |
case UBLOX_LEN2: // Laenge auswerten |
rx_len = rx_len + (rx *256); // Laenge ermitteln |
chk_a += rx; |
chk_b += chk_a; |
ublox_msg_state = UBLOX_PAYLOAD; |
break; |
case UBLOX_PAYLOAD: // jetzt Nutzdaten einlesen |
if (rx_len > 0) |
{ |
*ptr_payload_data = rx; |
chk_a += rx; |
chk_b += chk_a; |
--rx_len; |
if ((rx_len > 0) && (ptr_payload_data <= ptr_payload_data_end)) |
{ |
ptr_payload_data++; |
ublox_msg_state = UBLOX_PAYLOAD; |
} |
else ublox_msg_state = UBLOX_CKA; |
} |
else ublox_msg_state = UBLOX_IDLE; // Abbruch wegen Fehler |
break; |
case UBLOX_CKA: // Checksum pruefen |
if (rx == chk_a) ublox_msg_state = UBLOX_CKB; |
else ublox_msg_state = UBLOX_IDLE; // Abbruch wegen Fehler |
break; |
case UBLOX_CKB: // Checksum pruefen |
if (rx == chk_b) *ptr_pac_status = 1; // Paket ok |
ublox_msg_state = UBLOX_IDLE; |
break; |
default: |
ublox_msg_state = UBLOX_IDLE; |
break; |
} |
} |
//Zentrale Statemachine fuer alle GPS relevanten Regelungsablauefe |
short int GPS_CRTL(short int cmd) |
{ |
static unsigned int cnt; //Zaehler fuer diverse Verzoegerungen |
static signed int int_east,int_north; //Integrierer |
static signed int dist_north,dist_east; |
static signed int diff_east,diff_north; // Differenzierer (Differenz zum vorhergehenden x bzw. y Wert) |
static signed int diff_east_f,diff_north_f; // Differenzierer, gefiltert |
signed int n,diff_v; |
static signed int gps_g2t_act_v; // Aktuelle Geschwindigkeitsvorgabe fuer Home Funktion |
long signed int dev,n_l; |
signed int dist_frm_start_east,dist_frm_start_north; |
switch (cmd) |
{ |
case GPS_CMD_REQ_HOME: // Es soll zum Startpunkt zurueckgeflogen werden. |
if ((gps_state != GPS_CRTL_HOLD_ACTIVE) && (gps_state != GPS_CRTL_HOME_ACTIVE)) |
{ |
cnt++; |
if (cnt > 500) // erst nach Verzoegerung |
{ |
// Erst mal initialisieren |
cnt = 0; |
gps_tick = 0; |
hold_fast = 0; |
hold_reset_int = 0; // Integrator enablen |
int_east = 0, int_north = 0; |
gps_reg_x = 0, gps_reg_y = 0; |
dist_east = 0, dist_north = 0; |
diff_east_f = 0, diff_north_f= 0; |
diff_east = 0, diff_north = 0; |
dist_flown = 0; |
gps_g2t_act_v = 0; |
gps_sub_state = GPS_CRTL_IDLE; |
// aktuelle positionsdaten abspeichern |
if (gps_rel_act_position.status > 0) |
{ |
gps_rel_start_position.utm_east = gps_rel_act_position.utm_east; |
gps_rel_start_position.utm_north= gps_rel_act_position.utm_north; |
gps_rel_start_position.status = 1; // gueltige Positionsdaten |
gps_rel_hold_position.utm_east = gps_rel_act_position.utm_east; |
gps_rel_hold_position.utm_north = gps_rel_act_position.utm_north; |
gps_rel_hold_position.status = 1; // gueltige Positionsdaten |
//Richtung zur Home Position bezogen auf Nordpol bestimmen |
hdng_2home = arctan_i(-gps_rel_start_position.utm_east,-gps_rel_start_position.utm_north); |
// in Winkel 0...360 Grad umrechnen |
if (( gps_rel_start_position.utm_east < 0)) hdng_2home = ( 90-hdng_2home); |
else hdng_2home = (270 - hdng_2home); |
dist_2home = (int) get_dist(gps_rel_start_position.utm_east,gps_rel_start_position.utm_north,hdng_2home); //Entfernung zur Home Position bestimmen |
gps_state = GPS_CRTL_HOME_ACTIVE; |
return (GPS_STST_OK); |
} |
else |
{ |
gps_rel_start_position.status = 0; //Keine Daten verfuegbar |
gps_state = GPS_CRTL_IDLE; |
return(GPS_STST_ERR); // Keine Daten da |
} |
} |
else return(GPS_STST_PEND); // noch warten |
} |
break; |
// ****************************** |
case GPS_CMD_REQ_HOLD: // Die Lageregelung soll aktiviert werden. |
if (gps_state != GPS_CRTL_HOLD_ACTIVE) |
{ |
cnt++; |
if (cnt > 500) // erst nach Verzoegerung |
{ |
cnt = 0; |
// aktuelle positionsdaten abspeichern |
if (gps_rel_act_position.status > 0) |
{ |
hold_fast = 0; |
hold_reset_int = 0; // Integrator enablen |
int_east = 0, int_north = 0; |
gps_reg_x = 0, gps_reg_y = 0; |
dist_east = 0, dist_north = 0; |
diff_east_f = 0, diff_north_f= 0; |
diff_east = 0, diff_north = 0; |
gps_rel_hold_position.utm_east = gps_rel_act_position.utm_east; |
gps_rel_hold_position.utm_north = gps_rel_act_position.utm_north; |
gps_rel_hold_position.status = 1; // gueltige Positionsdaten |
gps_state = GPS_CRTL_HOLD_ACTIVE; |
return (GPS_STST_OK); |
} |
else |
{ |
gps_rel_hold_position.status = 0; //Keine Daten verfuegbar |
gps_state = GPS_CRTL_IDLE; |
return(GPS_STST_ERR); // Keine Daten da |
} |
} |
else return(GPS_STST_PEND); // noch warten |
} |
break; |
case GPS_CMD_STOP: // Lageregelung beenden |
cnt = 0; |
GPS_Nick = 0; |
GPS_Roll = 0; |
gps_int_x = 0; |
gps_int_y = 0; |
gps_sub_state = GPS_CRTL_IDLE; |
gps_state = GPS_CRTL_IDLE; |
return (GPS_STST_OK); |
break; |
default: |
return (GPS_STST_ERR); |
break; |
} |
switch (gps_state) |
{ |
case GPS_CRTL_IDLE: |
cnt = 0; |
return (GPS_STST_OK); |
break; |
case GPS_CRTL_HOME_ACTIVE: // Rueckflug zur Basis |
//Der Sollwert des Lagereglers wird der Homeposition angenaehert |
if (gps_rel_start_position.status >0) |
{ |
if ((gps_updte_flag > 0) && (gps_sub_state !=GPS_HOME_FINISHED)) // nur wenn neue GPS Daten vorliegen und nicht schon alles fertig ist |
{ |
gps_tick++; |
int d1,d2,d3; |
d1 = abs (gps_rel_hold_position.utm_east - gps_rel_act_position.utm_east ); |
d2 = abs (gps_rel_hold_position.utm_north - gps_rel_act_position.utm_north ); |
d3 = (dist_2home - (int)dist_flown); // Restdistanz zum Ziel |
if (d3 > GPS_G2T_DIST_MAX_STOP) // Schneller Rueckflug, noch weit weg vom Ziel |
{ |
if ((d1 < GPS_G2T_FAST_TOL) && (d2 < GPS_G2T_FAST_TOL)) //nur weiter wenn Lage innerhalb der Toleranz |
{ |
if (gps_g2t_act_v < GPS_G2T_V_MAX) gps_g2t_act_v++; //Geschwindigkeit langsam erhoehen |
dist_flown +=(long)gps_g2t_act_v; // Vorgabe der Strecke anhand der Geschwindigkeit |
gps_sub_state = GPS_HOME_FAST_IN_TOL; |
} |
else //Den Lageregler in Ruhe arbeiten lassen weil ausserhalb der Toleranz |
{ |
if (gps_g2t_act_v > 1) gps_g2t_act_v--; // Geschwindigkeit reduzieren |
dist_flown++; //Auch ausserhalb der Toleranz langsam erhoehen |
gps_sub_state = GPS_HOME_FAST_OUTOF_TOL; |
} |
hold_fast = 1; // Regler fuer schnellen Flug |
hold_reset_int = 1; // Integrator ausschalten |
dist_frm_start_east = (int)((dist_flown * (long)sin_i(hdng_2home))/1000); |
dist_frm_start_north = (int)((dist_flown * (long)cos_i(hdng_2home))/1000); |
gps_rel_hold_position.utm_east = gps_rel_start_position.utm_east + dist_frm_start_east; //naechster Zielpunkt |
gps_rel_hold_position.utm_north = gps_rel_start_position.utm_north + dist_frm_start_north; //naechster Zielpunkt |
} |
else if (d3 > GPS_G2T_DIST_HOLD) //Das Ziel naehert sich, deswegen abbremsen |
{ |
if ((d1 < GPS_G2T_NRML_TOL) && (d2 < GPS_G2T_NRML_TOL)) |
{ |
dist_flown += GPS_G2T_V_RAMP_DWN; // Vorgabe der Strecke anhand der Geschwindigkeit |
gps_sub_state = GPS_HOME_RMPDWN_IN_TOL; |
} |
else |
{ |
dist_flown++; //Auch ausserhalb der Toleranz langsam erhoehen |
gps_sub_state = GPS_HOME_RMPDWN_OUTOF_TOL; |
} |
hold_fast = 0; // Wieder normal regeln |
hold_reset_int = 1; // Integrator ausschalten |
dist_frm_start_east = (int)((dist_flown * (long)sin_i(hdng_2home))/1000); |
dist_frm_start_north = (int)((dist_flown * (long)cos_i(hdng_2home))/1000); |
gps_rel_hold_position.utm_east = gps_rel_start_position.utm_east + dist_frm_start_east; //naechster Zielpunkt |
gps_rel_hold_position.utm_north = gps_rel_start_position.utm_north + dist_frm_start_north; //naechster Zielpunkt |
} |
else //Soll-Ziel fast erreicht, Jetzt noch Reste ausgleichen, weil Zielpunkt nicht exakt bestimmt werden konnte (Fehler in Winkelfkt) |
{ |
if ((d1 < GPS_G2T_NRML_TOL) && (d2 < GPS_G2T_NRML_TOL)) // Jetzt bis zum Zielpunkt regeln |
{ |
gps_sub_state = GPS_HOME_IN_TOL; |
hold_fast = 0; // Wieder normal regeln |
hold_reset_int = 0; // Integrator wieder aktivieren |
if (gps_rel_hold_position.utm_east >= GPS_G2T_V_MIN) gps_rel_hold_position.utm_east -= GPS_G2T_V_MIN; |
else if (gps_rel_hold_position.utm_east <= -GPS_G2T_V_MIN ) gps_rel_hold_position.utm_east += GPS_G2T_V_MIN; |
if (gps_rel_hold_position.utm_north >= GPS_G2T_V_MIN) gps_rel_hold_position.utm_north -= GPS_G2T_V_MIN; |
else if (gps_rel_hold_position.utm_north <= - GPS_G2T_V_MIN ) gps_rel_hold_position.utm_north += GPS_G2T_V_MIN; |
if ((abs(gps_rel_hold_position.utm_east) <= GPS_G2T_V_MIN) && (abs(gps_rel_hold_position.utm_north) <=GPS_G2T_V_MIN)) |
{ |
gps_rel_hold_position.utm_east = 0; |
gps_rel_hold_position.utm_north = 0; |
gps_sub_state = GPS_HOME_FINISHED; |
} |
} |
else gps_sub_state = GPS_HOME_OUTOF_TOL; |
} |
} |
gps_state = GPS_CRTL_HOLD_ACTIVE; //Zwischensprung |
return (GPS_STST_OK); |
} |
else // Keine GPS Daten verfuegbar, deswegen Abbruch |
{ |
gps_state = GPS_CRTL_IDLE; |
return (GPS_STST_ERR); |
} |
break; |
case GPS_CRTL_HOLD_ACTIVE: // Hier werden die Daten fuer Nick und Roll errechnet |
if (gps_updte_flag >0) // nur wenn neue GPS Daten vorliegen |
{ |
gps_updte_flag = 0; |
// ab hier wird geregelt |
diff_east = -dist_east; //Alten Wert fuer Differenzier schon mal abziehen |
diff_north = -dist_north; |
dist_east = gps_rel_hold_position.utm_east - gps_rel_act_position.utm_east; |
dist_north = gps_rel_hold_position.utm_north - gps_rel_act_position.utm_north; |
int_east += dist_east; |
int_north += dist_north; |
diff_east += dist_east; // Differenz zur vorhergehenden East Position |
diff_north += dist_north; // Differenz zur vorhergehenden North Position |
if (hold_fast > 0) // wegen Sollpositionsspruengen im Fast Mode Differenzierer daempfen |
{ |
diff_east_f = ((diff_east_f *2)/3) + (diff_east *1/3); //Differenzierer filtern |
diff_north_f = ((diff_north_f *2)/3) + (diff_north*1/3); //Differenzierer filtern |
} |
else // schwache Filterung |
{ |
diff_east_f = ((diff_east_f * 1)/4) + ((diff_east *3)/4); //Differenzierer filtern |
diff_north_f = ((diff_north_f * 1)/4) + ((diff_north*3)/4); //Differenzierer filtern |
} |
#define GPSINT_MAX 30000 //neuer Wert ab 7.10.2007 Begrenzung |
if ((abs(int_east) > GPSINT_MAX) || (abs(int_north)> GPSINT_MAX)) //Bei zu hohem Wert Integrator auf Wert halten |
{ |
int_east -= dist_east; |
int_north -= dist_north; |
} |
if (hold_reset_int > 0) //Im Schnellen Mode Integrator abschalten |
{ |
int_east = 0; |
int_north = 0; |
} |
// Variable Verstarkung fuer Differenzierer ermitteln. Je weiter vom Ziel wir entfernt sind |
// desto groesser wird der Faktor. Es gibt aber einen Maximalwert. Bei 0 ist die Verstaerkung immer 1 |
signed long dist,int_east1,int_north1; |
int phi; |
phi = arctan_i(abs(dist_north),abs(dist_east)); |
dist = get_dist(dist_east,dist_north,phi); //Zunaechst Entfernung zum Ziel ermitteln |
if (hold_fast == 0) // je Nach Modus andere Verstaerkungskurve fuer Differenzierer |
{ |
diff_v = (int)((dist * (GPS_DIFF_NRML_MAX_V - 10)) / GPS_DIFF_NRML_MAX_D) +10; //Verstaerkung * 10 |
if (diff_v > GPS_DIFF_NRML_MAX_V) diff_v = GPS_DIFF_NRML_MAX_V; //begrenzen |
} |
else |
{ |
diff_v = (int)((dist * (GPS_DIFF_FAST_MAX_V - 10)) / GPS_DIFF_FAST_MAX_D) +10; //Verstaerkung * 10 |
if (diff_v > GPS_DIFF_FAST_MAX_V) diff_v = GPS_DIFF_FAST_MAX_V; //begrenzen |
} |
int diff_p; //Vom Modus abhaengige zusaetzliche Verstaerkung |
if (hold_fast > 0) diff_p = GPS_PROP_FAST_V; |
else diff_p = GPS_PROP_NRML_V; |
//I Werte begrenzen |
#define INT1_MAX (20 * GPS_V) |
int_east1 = ((((long)int_east) * Parameter_UserParam2)/32); |
int_north = ((((long)int_north) * Parameter_UserParam2)/32); |
if (int_east1 > INT1_MAX) int_east1 = INT1_MAX; //begrenzen |
else if (int_east1 < -INT1_MAX) int_east1 = -INT1_MAX; |
if (int_north1 > INT1_MAX) int_north1 = INT1_MAX; //begrenzen |
else if (int_north1 < -INT1_MAX) int_north1 = -INT1_MAX; |
//PID Regler Werte aufsummieren |
gps_reg_x = ((int)int_east1 + ((dist_east * Parameter_UserParam1 * diff_p)/(8*2))+ ((diff_east_f * diff_v * Parameter_UserParam3)/10)); // I + P +D Anteil X Achse |
gps_reg_y = ((int)int_north1 + ((dist_north * Parameter_UserParam1 * diff_p)/(8*2))+ ((diff_north_f * diff_v * Parameter_UserParam3)/10)); // I + P +D Anteil Y Achse |
//Ziel-Richtung bezogen auf Nordpol bestimmen |
GPS_hdng_abs_2trgt = arctan_i(gps_reg_x,gps_reg_y); |
// in Winkel 0...360 Grad umrechnen |
if ((gps_reg_x >= 0)) GPS_hdng_abs_2trgt = ( 90-GPS_hdng_abs_2trgt); |
else GPS_hdng_abs_2trgt = (270 - GPS_hdng_abs_2trgt); |
// Relative Richtung in bezug auf Nordachse des Kopters errechen |
//n= GyroKomp_Int/GYROKOMP_INC_GRAD_DEFAULT; |
n= KompassValue; |
GPS_hdng_rel_2trgt = GPS_hdng_abs_2trgt - n; |
if ((GPS_hdng_rel_2trgt >180) && (GPS_hdng_abs_2trgt >=180)) GPS_hdng_rel_2trgt = GPS_hdng_rel_2trgt-360; |
else if (GPS_hdng_rel_2trgt >180) GPS_hdng_rel_2trgt = 360 - GPS_hdng_rel_2trgt; |
else if (GPS_hdng_rel_2trgt <-180) GPS_hdng_rel_2trgt = 360 + GPS_hdng_rel_2trgt; |
// Regelabweichung aus x,y zu Ziel in Distanz umrechnen |
if (abs(gps_reg_x) > abs(gps_reg_y) ) |
{ |
dev = (long)gps_reg_x; //Groesseren Wert wegen besserer Genauigkeit nehmen |
dev = abs((dev *1000) / (long) sin_i(GPS_hdng_abs_2trgt)); |
} |
else |
{ |
dev = (long)gps_reg_y; |
dev = abs((dev *1000) / (long) cos_i(GPS_hdng_abs_2trgt)); |
} |
GPS_dist_2trgt = (int) dev; |
// Winkel und Distanz in Nick und Rollgroessen umrechnen |
GPS_Roll = (int) +( (dev * (long) sin_i(GPS_hdng_rel_2trgt))/1000); |
GPS_Nick = (int) -( (dev * (long) cos_i(GPS_hdng_rel_2trgt))/1000); |
if (GPS_Roll > (GPS_NICKROLL_MAX * GPS_V)) GPS_Roll = (GPS_NICKROLL_MAX * GPS_V); |
else if (GPS_Roll < -(GPS_NICKROLL_MAX * GPS_V)) GPS_Roll = -(GPS_NICKROLL_MAX * GPS_V); |
if (GPS_Nick > (GPS_NICKROLL_MAX * GPS_V)) GPS_Nick = (GPS_NICKROLL_MAX * GPS_V); |
else if (GPS_Nick < -(GPS_NICKROLL_MAX * GPS_V)) GPS_Nick = -(GPS_NICKROLL_MAX * GPS_V); |
//Kleine Werte verstaerken, Grosse abschwaechen |
n = sin_i((GPS_Roll*90)/(GPS_NICKROLL_MAX * GPS_V)); |
n_l = ((long) GPS_NICKROLL_MAX * (long) n)/1000; |
GPS_Roll = (int) n_l; |
n = sin_i((GPS_Nick*90)/(GPS_NICKROLL_MAX * GPS_V)); |
n_l = ((long) GPS_NICKROLL_MAX * (long) n)/1000; |
GPS_Nick = (int) n_l; |
if ((abs(dist_east) > GPS_DIST_MAX) || (abs(dist_north) > GPS_DIST_MAX)) // bei zu grossem Abstand abbrechen |
{ |
GPS_Roll = 0; |
GPS_Nick = 0; |
gps_state = GPS_CRTL_IDLE; |
return (GPS_STST_ERR); |
break; |
} |
else |
{ |
if ( cmd == GPS_CMD_REQ_HOME ) gps_state = GPS_CRTL_HOME_ACTIVE; // State umsetzen |
return (GPS_STST_OK); |
} |
} |
else |
{ |
if ( cmd == GPS_CMD_REQ_HOME ) gps_state = GPS_CRTL_HOME_ACTIVE; // State umsetzen |
return (GPS_STST_OK); |
} |
break; |
default: |
gps_state = GPS_CRTL_IDLE; |
return (GPS_STST_ERR); |
break; |
} |
return (GPS_STST_ERR); |
} |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/License.txt |
---|
0,0 → 1,52 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + Nur für den privaten Gebrauch |
// + www.MikroKopter.com |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
// + dass eine Nutzung (auch auszugsweise) nur für den privaten und nichtkommerziellen Gebrauch zulässig ist. |
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
// + bzgl. der Nutzungsbedingungen aufzunehmen. |
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
// + Verkauf von Luftbildaufnahmen, usw. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
// + eindeutig als Ursprung verlinkt und genannt werden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
// + Benutzung auf eigene Gefahr |
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
// + mit unserer Zustimmung zulässig |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
// + this list of conditions and the following disclaimer. |
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
// + from this software without specific prior written permission. |
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
// + for non-profit use (directly or indirectly) |
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
// + with our written permission |
// + * If sources or documentations are redistributet, our webpage (http://www.MikroKopter.de) must be |
// + clearly linked and named as origin |
// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/License_GPL.txt |
---|
0,0 → 1,674 |
GNU GENERAL PUBLIC LICENSE |
Version 3, 29 June 2007 |
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> |
Everyone is permitted to copy and distribute verbatim copies |
of this license document, but changing it is not allowed. |
Preamble |
The GNU General Public License is a free, copyleft license for |
software and other kinds of works. |
The licenses for most software and other practical works are designed |
to take away your freedom to share and change the works. By contrast, |
the GNU General Public License is intended to guarantee your freedom to |
share and change all versions of a program--to make sure it remains free |
software for all its users. We, the Free Software Foundation, use the |
GNU General Public License for most of our software; it applies also to |
any other work released this way by its authors. You can apply it to |
your programs, too. |
When we speak of free software, we are referring to freedom, not |
price. Our General Public Licenses are designed to make sure that you |
have the freedom to distribute copies of free software (and charge for |
them if you wish), that you receive source code or can get it if you |
want it, that you can change the software or use pieces of it in new |
free programs, and that you know you can do these things. |
To protect your rights, we need to prevent others from denying you |
these rights or asking you to surrender the rights. Therefore, you have |
certain responsibilities if you distribute copies of the software, or if |
you modify it: responsibilities to respect the freedom of others. |
For example, if you distribute copies of such a program, whether |
gratis or for a fee, you must pass on to the recipients the same |
freedoms that you received. You must make sure that they, too, receive |
or can get the source code. And you must show them these terms so they |
know their rights. |
Developers that use the GNU GPL protect your rights with two steps: |
(1) assert copyright on the software, and (2) offer you this License |
giving you legal permission to copy, distribute and/or modify it. |
For the developers' and authors' protection, the GPL clearly explains |
that there is no warranty for this free software. For both users' and |
authors' sake, the GPL requires that modified versions be marked as |
changed, so that their problems will not be attributed erroneously to |
authors of previous versions. |
Some devices are designed to deny users access to install or run |
modified versions of the software inside them, although the manufacturer |
can do so. This is fundamentally incompatible with the aim of |
protecting users' freedom to change the software. The systematic |
pattern of such abuse occurs in the area of products for individuals to |
use, which is precisely where it is most unacceptable. Therefore, we |
have designed this version of the GPL to prohibit the practice for those |
products. If such problems arise substantially in other domains, we |
stand ready to extend this provision to those domains in future versions |
of the GPL, as needed to protect the freedom of users. |
Finally, every program is threatened constantly by software patents. |
States should not allow patents to restrict development and use of |
software on general-purpose computers, but in those that do, we wish to |
avoid the special danger that patents applied to a free program could |
make it effectively proprietary. To prevent this, the GPL assures that |
patents cannot be used to render the program non-free. |
The precise terms and conditions for copying, distribution and |
modification follow. |
TERMS AND CONDITIONS |
0. Definitions. |
"This License" refers to version 3 of the GNU General Public License. |
"Copyright" also means copyright-like laws that apply to other kinds of |
works, such as semiconductor masks. |
"The Program" refers to any copyrightable work licensed under this |
License. Each licensee is addressed as "you". "Licensees" and |
"recipients" may be individuals or organizations. |
To "modify" a work means to copy from or adapt all or part of the work |
in a fashion requiring copyright permission, other than the making of an |
exact copy. The resulting work is called a "modified version" of the |
earlier work or a work "based on" the earlier work. |
A "covered work" means either the unmodified Program or a work based |
on the Program. |
To "propagate" a work means to do anything with it that, without |
permission, would make you directly or secondarily liable for |
infringement under applicable copyright law, except executing it on a |
computer or modifying a private copy. Propagation includes copying, |
distribution (with or without modification), making available to the |
public, and in some countries other activities as well. |
To "convey" a work means any kind of propagation that enables other |
parties to make or receive copies. Mere interaction with a user through |
a computer network, with no transfer of a copy, is not conveying. |
An interactive user interface displays "Appropriate Legal Notices" |
to the extent that it includes a convenient and prominently visible |
feature that (1) displays an appropriate copyright notice, and (2) |
tells the user that there is no warranty for the work (except to the |
extent that warranties are provided), that licensees may convey the |
work under this License, and how to view a copy of this License. If |
the interface presents a list of user commands or options, such as a |
menu, a prominent item in the list meets this criterion. |
1. Source Code. |
The "source code" for a work means the preferred form of the work |
for making modifications to it. "Object code" means any non-source |
form of a work. |
A "Standard Interface" means an interface that either is an official |
standard defined by a recognized standards body, or, in the case of |
interfaces specified for a particular programming language, one that |
is widely used among developers working in that language. |
The "System Libraries" of an executable work include anything, other |
than the work as a whole, that (a) is included in the normal form of |
packaging a Major Component, but which is not part of that Major |
Component, and (b) serves only to enable use of the work with that |
Major Component, or to implement a Standard Interface for which an |
implementation is available to the public in source code form. A |
"Major Component", in this context, means a major essential component |
(kernel, window system, and so on) of the specific operating system |
(if any) on which the executable work runs, or a compiler used to |
produce the work, or an object code interpreter used to run it. |
The "Corresponding Source" for a work in object code form means all |
the source code needed to generate, install, and (for an executable |
work) run the object code and to modify the work, including scripts to |
control those activities. However, it does not include the work's |
System Libraries, or general-purpose tools or generally available free |
programs which are used unmodified in performing those activities but |
which are not part of the work. For example, Corresponding Source |
includes interface definition files associated with source files for |
the work, and the source code for shared libraries and dynamically |
linked subprograms that the work is specifically designed to require, |
such as by intimate data communication or control flow between those |
subprograms and other parts of the work. |
The Corresponding Source need not include anything that users |
can regenerate automatically from other parts of the Corresponding |
Source. |
The Corresponding Source for a work in source code form is that |
same work. |
2. Basic Permissions. |
All rights granted under this License are granted for the term of |
copyright on the Program, and are irrevocable provided the stated |
conditions are met. This License explicitly affirms your unlimited |
permission to run the unmodified Program. The output from running a |
covered work is covered by this License only if the output, given its |
content, constitutes a covered work. This License acknowledges your |
rights of fair use or other equivalent, as provided by copyright law. |
You may make, run and propagate covered works that you do not |
convey, without conditions so long as your license otherwise remains |
in force. You may convey covered works to others for the sole purpose |
of having them make modifications exclusively for you, or provide you |
with facilities for running those works, provided that you comply with |
the terms of this License in conveying all material for which you do |
not control copyright. Those thus making or running the covered works |
for you must do so exclusively on your behalf, under your direction |
and control, on terms that prohibit them from making any copies of |
your copyrighted material outside their relationship with you. |
Conveying under any other circumstances is permitted solely under |
the conditions stated below. Sublicensing is not allowed; section 10 |
makes it unnecessary. |
3. Protecting Users' Legal Rights From Anti-Circumvention Law. |
No covered work shall be deemed part of an effective technological |
measure under any applicable law fulfilling obligations under article |
11 of the WIPO copyright treaty adopted on 20 December 1996, or |
similar laws prohibiting or restricting circumvention of such |
measures. |
When you convey a covered work, you waive any legal power to forbid |
circumvention of technological measures to the extent such circumvention |
is effected by exercising rights under this License with respect to |
the covered work, and you disclaim any intention to limit operation or |
modification of the work as a means of enforcing, against the work's |
users, your or third parties' legal rights to forbid circumvention of |
technological measures. |
4. Conveying Verbatim Copies. |
You may convey verbatim copies of the Program's source code as you |
receive it, in any medium, provided that you conspicuously and |
appropriately publish on each copy an appropriate copyright notice; |
keep intact all notices stating that this License and any |
non-permissive terms added in accord with section 7 apply to the code; |
keep intact all notices of the absence of any warranty; and give all |
recipients a copy of this License along with the Program. |
You may charge any price or no price for each copy that you convey, |
and you may offer support or warranty protection for a fee. |
5. Conveying Modified Source Versions. |
You may convey a work based on the Program, or the modifications to |
produce it from the Program, in the form of source code under the |
terms of section 4, provided that you also meet all of these conditions: |
a) The work must carry prominent notices stating that you modified |
it, and giving a relevant date. |
b) The work must carry prominent notices stating that it is |
released under this License and any conditions added under section |
7. This requirement modifies the requirement in section 4 to |
"keep intact all notices". |
c) You must license the entire work, as a whole, under this |
License to anyone who comes into possession of a copy. This |
License will therefore apply, along with any applicable section 7 |
additional terms, to the whole of the work, and all its parts, |
regardless of how they are packaged. This License gives no |
permission to license the work in any other way, but it does not |
invalidate such permission if you have separately received it. |
d) If the work has interactive user interfaces, each must display |
Appropriate Legal Notices; however, if the Program has interactive |
interfaces that do not display Appropriate Legal Notices, your |
work need not make them do so. |
A compilation of a covered work with other separate and independent |
works, which are not by their nature extensions of the covered work, |
and which are not combined with it such as to form a larger program, |
in or on a volume of a storage or distribution medium, is called an |
"aggregate" if the compilation and its resulting copyright are not |
used to limit the access or legal rights of the compilation's users |
beyond what the individual works permit. Inclusion of a covered work |
in an aggregate does not cause this License to apply to the other |
parts of the aggregate. |
6. Conveying Non-Source Forms. |
You may convey a covered work in object code form under the terms |
of sections 4 and 5, provided that you also convey the |
machine-readable Corresponding Source under the terms of this License, |
in one of these ways: |
a) Convey the object code in, or embodied in, a physical product |
(including a physical distribution medium), accompanied by the |
Corresponding Source fixed on a durable physical medium |
customarily used for software interchange. |
b) Convey the object code in, or embodied in, a physical product |
(including a physical distribution medium), accompanied by a |
written offer, valid for at least three years and valid for as |
long as you offer spare parts or customer support for that product |
model, to give anyone who possesses the object code either (1) a |
copy of the Corresponding Source for all the software in the |
product that is covered by this License, on a durable physical |
medium customarily used for software interchange, for a price no |
more than your reasonable cost of physically performing this |
conveying of source, or (2) access to copy the |
Corresponding Source from a network server at no charge. |
c) Convey individual copies of the object code with a copy of the |
written offer to provide the Corresponding Source. This |
alternative is allowed only occasionally and noncommercially, and |
only if you received the object code with such an offer, in accord |
with subsection 6b. |
d) Convey the object code by offering access from a designated |
place (gratis or for a charge), and offer equivalent access to the |
Corresponding Source in the same way through the same place at no |
further charge. You need not require recipients to copy the |
Corresponding Source along with the object code. If the place to |
copy the object code is a network server, the Corresponding Source |
may be on a different server (operated by you or a third party) |
that supports equivalent copying facilities, provided you maintain |
clear directions next to the object code saying where to find the |
Corresponding Source. Regardless of what server hosts the |
Corresponding Source, you remain obligated to ensure that it is |
available for as long as needed to satisfy these requirements. |
e) Convey the object code using peer-to-peer transmission, provided |
you inform other peers where the object code and Corresponding |
Source of the work are being offered to the general public at no |
charge under subsection 6d. |
A separable portion of the object code, whose source code is excluded |
from the Corresponding Source as a System Library, need not be |
included in conveying the object code work. |
A "User Product" is either (1) a "consumer product", which means any |
tangible personal property which is normally used for personal, family, |
or household purposes, or (2) anything designed or sold for incorporation |
into a dwelling. In determining whether a product is a consumer product, |
doubtful cases shall be resolved in favor of coverage. For a particular |
product received by a particular user, "normally used" refers to a |
typical or common use of that class of product, regardless of the status |
of the particular user or of the way in which the particular user |
actually uses, or expects or is expected to use, the product. A product |
is a consumer product regardless of whether the product has substantial |
commercial, industrial or non-consumer uses, unless such uses represent |
the only significant mode of use of the product. |
"Installation Information" for a User Product means any methods, |
procedures, authorization keys, or other information required to install |
and execute modified versions of a covered work in that User Product from |
a modified version of its Corresponding Source. The information must |
suffice to ensure that the continued functioning of the modified object |
code is in no case prevented or interfered with solely because |
modification has been made. |
If you convey an object code work under this section in, or with, or |
specifically for use in, a User Product, and the conveying occurs as |
part of a transaction in which the right of possession and use of the |
User Product is transferred to the recipient in perpetuity or for a |
fixed term (regardless of how the transaction is characterized), the |
Corresponding Source conveyed under this section must be accompanied |
by the Installation Information. But this requirement does not apply |
if neither you nor any third party retains the ability to install |
modified object code on the User Product (for example, the work has |
been installed in ROM). |
The requirement to provide Installation Information does not include a |
requirement to continue to provide support service, warranty, or updates |
for a work that has been modified or installed by the recipient, or for |
the User Product in which it has been modified or installed. Access to a |
network may be denied when the modification itself materially and |
adversely affects the operation of the network or violates the rules and |
protocols for communication across the network. |
Corresponding Source conveyed, and Installation Information provided, |
in accord with this section must be in a format that is publicly |
documented (and with an implementation available to the public in |
source code form), and must require no special password or key for |
unpacking, reading or copying. |
7. Additional Terms. |
"Additional permissions" are terms that supplement the terms of this |
License by making exceptions from one or more of its conditions. |
Additional permissions that are applicable to the entire Program shall |
be treated as though they were included in this License, to the extent |
that they are valid under applicable law. If additional permissions |
apply only to part of the Program, that part may be used separately |
under those permissions, but the entire Program remains governed by |
this License without regard to the additional permissions. |
When you convey a copy of a covered work, you may at your option |
remove any additional permissions from that copy, or from any part of |
it. (Additional permissions may be written to require their own |
removal in certain cases when you modify the work.) You may place |
additional permissions on material, added by you to a covered work, |
for which you have or can give appropriate copyright permission. |
Notwithstanding any other provision of this License, for material you |
add to a covered work, you may (if authorized by the copyright holders of |
that material) supplement the terms of this License with terms: |
a) Disclaiming warranty or limiting liability differently from the |
terms of sections 15 and 16 of this License; or |
b) Requiring preservation of specified reasonable legal notices or |
author attributions in that material or in the Appropriate Legal |
Notices displayed by works containing it; or |
c) Prohibiting misrepresentation of the origin of that material, or |
requiring that modified versions of such material be marked in |
reasonable ways as different from the original version; or |
d) Limiting the use for publicity purposes of names of licensors or |
authors of the material; or |
e) Declining to grant rights under trademark law for use of some |
trade names, trademarks, or service marks; or |
f) Requiring indemnification of licensors and authors of that |
material by anyone who conveys the material (or modified versions of |
it) with contractual assumptions of liability to the recipient, for |
any liability that these contractual assumptions directly impose on |
those licensors and authors. |
All other non-permissive additional terms are considered "further |
restrictions" within the meaning of section 10. If the Program as you |
received it, or any part of it, contains a notice stating that it is |
governed by this License along with a term that is a further |
restriction, you may remove that term. If a license document contains |
a further restriction but permits relicensing or conveying under this |
License, you may add to a covered work material governed by the terms |
of that license document, provided that the further restriction does |
not survive such relicensing or conveying. |
If you add terms to a covered work in accord with this section, you |
must place, in the relevant source files, a statement of the |
additional terms that apply to those files, or a notice indicating |
where to find the applicable terms. |
Additional terms, permissive or non-permissive, may be stated in the |
form of a separately written license, or stated as exceptions; |
the above requirements apply either way. |
8. Termination. |
You may not propagate or modify a covered work except as expressly |
provided under this License. Any attempt otherwise to propagate or |
modify it is void, and will automatically terminate your rights under |
this License (including any patent licenses granted under the third |
paragraph of section 11). |
However, if you cease all violation of this License, then your |
license from a particular copyright holder is reinstated (a) |
provisionally, unless and until the copyright holder explicitly and |
finally terminates your license, and (b) permanently, if the copyright |
holder fails to notify you of the violation by some reasonable means |
prior to 60 days after the cessation. |
Moreover, your license from a particular copyright holder is |
reinstated permanently if the copyright holder notifies you of the |
violation by some reasonable means, this is the first time you have |
received notice of violation of this License (for any work) from that |
copyright holder, and you cure the violation prior to 30 days after |
your receipt of the notice. |
Termination of your rights under this section does not terminate the |
licenses of parties who have received copies or rights from you under |
this License. If your rights have been terminated and not permanently |
reinstated, you do not qualify to receive new licenses for the same |
material under section 10. |
9. Acceptance Not Required for Having Copies. |
You are not required to accept this License in order to receive or |
run a copy of the Program. Ancillary propagation of a covered work |
occurring solely as a consequence of using peer-to-peer transmission |
to receive a copy likewise does not require acceptance. However, |
nothing other than this License grants you permission to propagate or |
modify any covered work. These actions infringe copyright if you do |
not accept this License. Therefore, by modifying or propagating a |
covered work, you indicate your acceptance of this License to do so. |
10. Automatic Licensing of Downstream Recipients. |
Each time you convey a covered work, the recipient automatically |
receives a license from the original licensors, to run, modify and |
propagate that work, subject to this License. You are not responsible |
for enforcing compliance by third parties with this License. |
An "entity transaction" is a transaction transferring control of an |
organization, or substantially all assets of one, or subdividing an |
organization, or merging organizations. If propagation of a covered |
work results from an entity transaction, each party to that |
transaction who receives a copy of the work also receives whatever |
licenses to the work the party's predecessor in interest had or could |
give under the previous paragraph, plus a right to possession of the |
Corresponding Source of the work from the predecessor in interest, if |
the predecessor has it or can get it with reasonable efforts. |
You may not impose any further restrictions on the exercise of the |
rights granted or affirmed under this License. For example, you may |
not impose a license fee, royalty, or other charge for exercise of |
rights granted under this License, and you may not initiate litigation |
(including a cross-claim or counterclaim in a lawsuit) alleging that |
any patent claim is infringed by making, using, selling, offering for |
sale, or importing the Program or any portion of it. |
11. Patents. |
A "contributor" is a copyright holder who authorizes use under this |
License of the Program or a work on which the Program is based. The |
work thus licensed is called the contributor's "contributor version". |
A contributor's "essential patent claims" are all patent claims |
owned or controlled by the contributor, whether already acquired or |
hereafter acquired, that would be infringed by some manner, permitted |
by this License, of making, using, or selling its contributor version, |
but do not include claims that would be infringed only as a |
consequence of further modification of the contributor version. For |
purposes of this definition, "control" includes the right to grant |
patent sublicenses in a manner consistent with the requirements of |
this License. |
Each contributor grants you a non-exclusive, worldwide, royalty-free |
patent license under the contributor's essential patent claims, to |
make, use, sell, offer for sale, import and otherwise run, modify and |
propagate the contents of its contributor version. |
In the following three paragraphs, a "patent license" is any express |
agreement or commitment, however denominated, not to enforce a patent |
(such as an express permission to practice a patent or covenant not to |
sue for patent infringement). To "grant" such a patent license to a |
party means to make such an agreement or commitment not to enforce a |
patent against the party. |
If you convey a covered work, knowingly relying on a patent license, |
and the Corresponding Source of the work is not available for anyone |
to copy, free of charge and under the terms of this License, through a |
publicly available network server or other readily accessible means, |
then you must either (1) cause the Corresponding Source to be so |
available, or (2) arrange to deprive yourself of the benefit of the |
patent license for this particular work, or (3) arrange, in a manner |
consistent with the requirements of this License, to extend the patent |
license to downstream recipients. "Knowingly relying" means you have |
actual knowledge that, but for the patent license, your conveying the |
covered work in a country, or your recipient's use of the covered work |
in a country, would infringe one or more identifiable patents in that |
country that you have reason to believe are valid. |
If, pursuant to or in connection with a single transaction or |
arrangement, you convey, or propagate by procuring conveyance of, a |
covered work, and grant a patent license to some of the parties |
receiving the covered work authorizing them to use, propagate, modify |
or convey a specific copy of the covered work, then the patent license |
you grant is automatically extended to all recipients of the covered |
work and works based on it. |
A patent license is "discriminatory" if it does not include within |
the scope of its coverage, prohibits the exercise of, or is |
conditioned on the non-exercise of one or more of the rights that are |
specifically granted under this License. You may not convey a covered |
work if you are a party to an arrangement with a third party that is |
in the business of distributing software, under which you make payment |
to the third party based on the extent of your activity of conveying |
the work, and under which the third party grants, to any of the |
parties who would receive the covered work from you, a discriminatory |
patent license (a) in connection with copies of the covered work |
conveyed by you (or copies made from those copies), or (b) primarily |
for and in connection with specific products or compilations that |
contain the covered work, unless you entered into that arrangement, |
or that patent license was granted, prior to 28 March 2007. |
Nothing in this License shall be construed as excluding or limiting |
any implied license or other defenses to infringement that may |
otherwise be available to you under applicable patent law. |
12. No Surrender of Others' Freedom. |
If conditions are imposed on you (whether by court order, agreement or |
otherwise) that contradict the conditions of this License, they do not |
excuse you from the conditions of this License. If you cannot convey a |
covered work so as to satisfy simultaneously your obligations under this |
License and any other pertinent obligations, then as a consequence you may |
not convey it at all. For example, if you agree to terms that obligate you |
to collect a royalty for further conveying from those to whom you convey |
the Program, the only way you could satisfy both those terms and this |
License would be to refrain entirely from conveying the Program. |
13. Use with the GNU Affero General Public License. |
Notwithstanding any other provision of this License, you have |
permission to link or combine any covered work with a work licensed |
under version 3 of the GNU Affero General Public License into a single |
combined work, and to convey the resulting work. The terms of this |
License will continue to apply to the part which is the covered work, |
but the special requirements of the GNU Affero General Public License, |
section 13, concerning interaction through a network will apply to the |
combination as such. |
14. Revised Versions of this License. |
The Free Software Foundation may publish revised and/or new versions of |
the GNU General Public License from time to time. Such new versions will |
be similar in spirit to the present version, but may differ in detail to |
address new problems or concerns. |
Each version is given a distinguishing version number. If the |
Program specifies that a certain numbered version of the GNU General |
Public License "or any later version" applies to it, you have the |
option of following the terms and conditions either of that numbered |
version or of any later version published by the Free Software |
Foundation. If the Program does not specify a version number of the |
GNU General Public License, you may choose any version ever published |
by the Free Software Foundation. |
If the Program specifies that a proxy can decide which future |
versions of the GNU General Public License can be used, that proxy's |
public statement of acceptance of a version permanently authorizes you |
to choose that version for the Program. |
Later license versions may give you additional or different |
permissions. However, no additional obligations are imposed on any |
author or copyright holder as a result of your choosing to follow a |
later version. |
15. Disclaimer of Warranty. |
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY |
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT |
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY |
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, |
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM |
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF |
ALL NECESSARY SERVICING, REPAIR OR CORRECTION. |
16. Limitation of Liability. |
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS |
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY |
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE |
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF |
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD |
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), |
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF |
SUCH DAMAGES. |
17. Interpretation of Sections 15 and 16. |
If the disclaimer of warranty and limitation of liability provided |
above cannot be given local legal effect according to their terms, |
reviewing courts shall apply local law that most closely approximates |
an absolute waiver of all civil liability in connection with the |
Program, unless a warranty or assumption of liability accompanies a |
copy of the Program in return for a fee. |
END OF TERMS AND CONDITIONS |
How to Apply These Terms to Your New Programs |
If you develop a new program, and you want it to be of the greatest |
possible use to the public, the best way to achieve this is to make it |
free software which everyone can redistribute and change under these terms. |
To do so, attach the following notices to the program. It is safest |
to attach them to the start of each source file to most effectively |
state the exclusion of warranty; and each file should have at least |
the "copyright" line and a pointer to where the full notice is found. |
<one line to give the program's name and a brief idea of what it does.> |
Copyright (C) <year> <name of author> |
This program is free software: you can redistribute it and/or modify |
it under the terms of the GNU General Public License as published by |
the Free Software Foundation, either version 3 of the License, or |
(at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License for more details. |
You should have received a copy of the GNU General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
Also add information on how to contact you by electronic and paper mail. |
If the program does terminal interaction, make it output a short |
notice like this when it starts in an interactive mode: |
<program> Copyright (C) <year> <name of author> |
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. |
This is free software, and you are welcome to redistribute it |
under certain conditions; type `show c' for details. |
The hypothetical commands `show w' and `show c' should show the appropriate |
parts of the General Public License. Of course, your program's commands |
might be different; for a GUI interface, you would use an "about box". |
You should also get your employer (if you work as a programmer) or school, |
if any, to sign a "copyright disclaimer" for the program, if necessary. |
For more information on this, and how to apply and follow the GNU GPL, see |
<http://www.gnu.org/licenses/>. |
The GNU General Public License does not permit incorporating your program |
into proprietary programs. If your program is a subroutine library, you |
may consider it more useful to permit linking proprietary applications with |
the library. If this is what you want to do, use the GNU Lesser General |
Public License instead of this License. But first, please read |
<http://www.gnu.org/philosophy/why-not-lgpl.html>. |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/License_LPGL.txt |
---|
0,0 → 1,165 |
GNU LESSER GENERAL PUBLIC LICENSE |
Version 3, 29 June 2007 |
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> |
Everyone is permitted to copy and distribute verbatim copies |
of this license document, but changing it is not allowed. |
This version of the GNU Lesser General Public License incorporates |
the terms and conditions of version 3 of the GNU General Public |
License, supplemented by the additional permissions listed below. |
0. Additional Definitions. |
As used herein, "this License" refers to version 3 of the GNU Lesser |
General Public License, and the "GNU GPL" refers to version 3 of the GNU |
General Public License. |
"The Library" refers to a covered work governed by this License, |
other than an Application or a Combined Work as defined below. |
An "Application" is any work that makes use of an interface provided |
by the Library, but which is not otherwise based on the Library. |
Defining a subclass of a class defined by the Library is deemed a mode |
of using an interface provided by the Library. |
A "Combined Work" is a work produced by combining or linking an |
Application with the Library. The particular version of the Library |
with which the Combined Work was made is also called the "Linked |
Version". |
The "Minimal Corresponding Source" for a Combined Work means the |
Corresponding Source for the Combined Work, excluding any source code |
for portions of the Combined Work that, considered in isolation, are |
based on the Application, and not on the Linked Version. |
The "Corresponding Application Code" for a Combined Work means the |
object code and/or source code for the Application, including any data |
and utility programs needed for reproducing the Combined Work from the |
Application, but excluding the System Libraries of the Combined Work. |
1. Exception to Section 3 of the GNU GPL. |
You may convey a covered work under sections 3 and 4 of this License |
without being bound by section 3 of the GNU GPL. |
2. Conveying Modified Versions. |
If you modify a copy of the Library, and, in your modifications, a |
facility refers to a function or data to be supplied by an Application |
that uses the facility (other than as an argument passed when the |
facility is invoked), then you may convey a copy of the modified |
version: |
a) under this License, provided that you make a good faith effort to |
ensure that, in the event an Application does not supply the |
function or data, the facility still operates, and performs |
whatever part of its purpose remains meaningful, or |
b) under the GNU GPL, with none of the additional permissions of |
this License applicable to that copy. |
3. Object Code Incorporating Material from Library Header Files. |
The object code form of an Application may incorporate material from |
a header file that is part of the Library. You may convey such object |
code under terms of your choice, provided that, if the incorporated |
material is not limited to numerical parameters, data structure |
layouts and accessors, or small macros, inline functions and templates |
(ten or fewer lines in length), you do both of the following: |
a) Give prominent notice with each copy of the object code that the |
Library is used in it and that the Library and its use are |
covered by this License. |
b) Accompany the object code with a copy of the GNU GPL and this license |
document. |
4. Combined Works. |
You may convey a Combined Work under terms of your choice that, |
taken together, effectively do not restrict modification of the |
portions of the Library contained in the Combined Work and reverse |
engineering for debugging such modifications, if you also do each of |
the following: |
a) Give prominent notice with each copy of the Combined Work that |
the Library is used in it and that the Library and its use are |
covered by this License. |
b) Accompany the Combined Work with a copy of the GNU GPL and this license |
document. |
c) For a Combined Work that displays copyright notices during |
execution, include the copyright notice for the Library among |
these notices, as well as a reference directing the user to the |
copies of the GNU GPL and this license document. |
d) Do one of the following: |
0) Convey the Minimal Corresponding Source under the terms of this |
License, and the Corresponding Application Code in a form |
suitable for, and under terms that permit, the user to |
recombine or relink the Application with a modified version of |
the Linked Version to produce a modified Combined Work, in the |
manner specified by section 6 of the GNU GPL for conveying |
Corresponding Source. |
1) Use a suitable shared library mechanism for linking with the |
Library. A suitable mechanism is one that (a) uses at run time |
a copy of the Library already present on the user's computer |
system, and (b) will operate properly with a modified version |
of the Library that is interface-compatible with the Linked |
Version. |
e) Provide Installation Information, but only if you would otherwise |
be required to provide such information under section 6 of the |
GNU GPL, and only to the extent that such information is |
necessary to install and execute a modified version of the |
Combined Work produced by recombining or relinking the |
Application with a modified version of the Linked Version. (If |
you use option 4d0, the Installation Information must accompany |
the Minimal Corresponding Source and Corresponding Application |
Code. If you use option 4d1, you must provide the Installation |
Information in the manner specified by section 6 of the GNU GPL |
for conveying Corresponding Source.) |
5. Combined Libraries. |
You may place library facilities that are a work based on the |
Library side by side in a single library together with other library |
facilities that are not Applications and are not covered by this |
License, and convey such a combined library under terms of your |
choice, if you do both of the following: |
a) Accompany the combined library with a copy of the same work based |
on the Library, uncombined with any other library facilities, |
conveyed under the terms of this License. |
b) Give prominent notice with the combined library that part of it |
is a work based on the Library, and explaining where to find the |
accompanying uncombined form of the same work. |
6. Revised Versions of the GNU Lesser General Public License. |
The Free Software Foundation may publish revised and/or new versions |
of the GNU Lesser General Public License from time to time. Such new |
versions will be similar in spirit to the present version, but may |
differ in detail to address new problems or concerns. |
Each version is given a distinguishing version number. If the |
Library as you received it specifies that a certain numbered version |
of the GNU Lesser General Public License "or any later version" |
applies to it, you have the option of following the terms and |
conditions either of that published version or of any later version |
published by the Free Software Foundation. If the Library as you |
received it does not specify a version number of the GNU Lesser |
General Public License, you may choose any version of the GNU Lesser |
General Public License ever published by the Free Software Foundation. |
If the Library as you received it specifies that a proxy can decide |
whether future versions of the GNU Lesser General Public License shall |
apply, that proxy's public statement of acceptance of any version is |
permanent authorization for you to choose that version for the |
Library. |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/README_Gps.txt |
---|
0,0 → 1,82 |
********************************************************************* |
GPS Implementierung von Peter Muehlenbrock ("Salvo") für Mikrokopter/FlightCrtl |
Stand 14.10.2007 |
Verwendung der SW ohne Gewaehr. Siehe auch die Lizenzbedingungen in File Licensce_LPGL.txt und Licensce_GPL.txt |
********************************************************************* |
Hardware-Voraussetzungen: |
Kalibrierter Kompass vom Typ CMPS03, waagrecht eingebaut |
GPS Modul vom Typ ublox, Die Meldungungen "NAV_STATUS", "NAV_POSUTM" und "NAV_VELNED" |
mussen mit 4 HZ Updaterate aktiviert sein. Anschluss an RX Port der FlightCRtl. Baudrate ist 57600 wie beim Kopter Tool. |
Software-Voraussetzungen: |
in fc.h müsen die Neutralwerte ACC_NICK_NEUTRAL und ACC_ROLL_NEUTRAL |
eingetragen werden. Hierzu den Kopter waagrecht ausrichten (Wasserwaage) und mit dem Mikrokoptertool |
die Neutralwerte (Fenster ACC Sensor, jeweils die dargestellten Werte ohne Klammern) ermitteln. |
Alternativ kann die Variable ACC_NEUTRAL_FIXED auf 0 gesetzt werden, dann wird die Lage beim Kalibrieren als Neutrallage |
genommen (wie bei Holgers SW). |
In timer0.h muss die Ausrichtung des Kompasses bezogen auf die Nordachse des Kopters |
eingetragen sein. KOMPASS_OFFSET legt diesen Wert fest. |
Hexfiles: |
Ich habe bewußt keinen Hexfile generiert, da die Neutralwerte spezifisch je Kopter sind. |
Die SW muß also individuell compiliert werden und der Hexfile in die FlightCrtl eingebaut werden. |
Der Lohn für die Muehe ist eine sehr driftarme Fluglageregelung sowie eine von der Startausrichtung |
unabhängige waagrechte Lage in der Luft. |
Alle Einstellungen beziehen sich auf AVR Studio von Atmel und den WIN_AVR Compiler. |
Parametrierung: |
Der GPS Hold Regler ist ein PID Regler, der ueber die UserParameter1(P), 2(I) und D(3) gesteuert wird. |
UserParameter1 beschreibt den P-Anteil, UserParameter2 den I-Anteil und UserParameter3 den D-Anteil. |
Hier kann und muss gespielt werden.Alle Parameter koennen direkt im Mikrokoptertool in den Settings eingestellt werden. |
Standardwerte bei kaum Wind sind 8 für den P-Anteil, 1 für den I-Anteil und 12 für den D-Anteil. |
Standardwerte bei leichtem verhältnissen sind 12 für den P-Anteil, 2 für den I-Anteil und 18 für den D-Anteil. |
Standardwerte bei rauheren verhältnissen sind 16 für den P-Anteil, 2 für den I-Anteil und 20 für den D-Anteil. |
Je größer die Werte des "ruckeliger" reagiert die Regelung aber desto schneller und stärker greift sie auch. |
Wenn alle 0 sind, ist der Regler deaktiviert. |
Voraussetzungen für GPS_Hold: |
Neben den genannten HW und SW Voraussetzungen muß beim Kalibrieren das GPS MOdul bereits Positionsdaten liefern. |
Nur dann wird die Home Position abgespeichert und nur dann wird GPS_Hold aktiviert. |
Kenntlich gemacht wird dies durch einen etwas längeren Piepser nach dem Kalibrieren. |
Das GPS Aktiv Flag im Setting muss aktiviert sein. |
Eine Ausrichtung des Kopters nach Nord etc. ist nicht erforderlich. |
Aktivierung GPS_Hold im Flug: |
Wenn alle genannten Voraussetzungen erfüllt sind, wird GPS Hold im Flug automatisch aktiviert, sobald der Nick und Roll Stick |
fürca. 500msec in Neutrallage sind. Weicht einer der Sticks davon ab (Parameter GPS_STICK_HOLDOFF) oder liefert das GPS Modul oder fällt der |
Kompass aus wird GPS_Hold sofort deaktiviert. |
Damit kann jederzeit die manuelle Kontrolle wieder übernommen werden. |
GPS_Hold regelt nur horizontale Abweichungen, keine Hoehe. |
Der Magnetkompass wird nur in waagrechter Lage dazu benutzt einen internen aus dem Giergyro ermittelten "Ersatz"kompasswert |
nach zu kalibrieren. Daher funktioniert die Bstimmung der Kopterausrichtung in jeder Lebenslage, sofern nur ab und zu |
der Magnetkompass in die waagrechte Lage kommt. |
Ein 3D Kompass ist damit überflüssig. |
GPS Rücksturz zur Basis (GPS Home) Funktion |
Voraussetzungen wie bei GPS Hold. |
Die Funktion kann im Flug aktiviert werden durch Setzen des Hoehenreglerschalters. |
Holgers Code habe ich so abgeändert daß der Höhenregler mit "Parameter_MaxHoehe" ab 50 aktiviert wird. |
Mit einem Schalter mit Neutrallage können damit die Funktionen |
Alles aus - Hoehenregler ein, GPS Home Aus - Hoehenregler Ein UND GPS Home ein |
aktiviert werden. Ist noch nicht die beste Lösung und werde ich noch anpassen |
Weitere Änderungen: |
Bei Unterschreiten der eingestellten Warnschwelle für UBAT ertönt zunächst wie gewohnt der Piepser. Geht die Spannung weiter |
runter wird zwangsweise die Gaseinstellung langsam reduziert um den Kopter zum Landen zu bringen |
Bekannte Schwächen: |
Bei längerer Neigung weicht der Ersatzkompass ab, was zu Lageregelungsfehlern bis zum Ausbrechen führen kann. |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/Settings.h |
---|
--- alpha/v060SalvoKompassNick666MM3ACC/_Settings.h (nonexistent) |
+++ alpha/v060SalvoKompassNick666MM3ACC/_Settings.h (revision 2762) |
@@ -0,0 +1,50 @@ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Testmodi |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define MOTOR_OFF 0 |
+#define MOTOR_TEST 0 |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Abstimmung |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define ACC_AMPLIFY 16 |
+#define FAKTOR_P 1 |
+#define FAKTOR_I 0.0001 |
+ |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Debug-Interface |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define SIO_DEBUG 1 // Soll der Debugger aktiviert sein? |
+#define MIN_DEBUG_INTERVALL 250 // in diesem Intervall werden Degugdaten ohne Aufforderung gesendet |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Sender |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ #define K_NICK 0 |
+ #define K_ROLL 1 |
+ #define K_GAS 2 |
+ #define K_GIER 3 |
+ #define K_POTI1 4 |
+ #define K_POTI2 5 |
+ #define K_POTI3 6 |
+ #define K_POTI4 7 |
+// +++++++++++++++++++++++++++++++ |
+// + Getestete Settings: |
+// +++++++++++++++++++++++++++++++ |
+// Setting: Kamera |
+// Stick_P:3 |
+// Stick_D:0 |
+// Gyro_P: 175 |
+// Gyro_I: 175 |
+// Ki_Anteil: 10 |
+// +++++++++++++++++++++++++++++++ |
+// + Getestete Settings: |
+// +++++++++++++++++++++++++++++++ |
+// Setting: Normal |
+// Stick_P:2 |
+// Stick_D:8 |
+// Gyro_P: 80 |
+// Gyro_I: 150 |
+// Ki_Anteil: 5 |
+ |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/analog.c |
---|
0,0 → 1,156 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
volatile int Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az, UBat = 100; |
volatile int AccumulateNick = 0, AccumulateRoll = 0, AccumulateGier = 0; |
volatile int accumulate_AccRoll = 0,accumulate_AccNick = 0,accumulate_AccHoch = 0; |
volatile char MessanzahlNick = 0, MessanzahlRoll = 0, MessanzahlGier = 0; |
volatile char messanzahl_AccNick = 0, messanzahl_AccRoll = 0, messanzahl_AccHoch = 0; |
volatile long Luftdruck = 32000; |
volatile int StartLuftdruck; |
volatile unsigned int MessLuftdruck = 1023; |
unsigned char DruckOffsetSetting; |
volatile int HoeheD = 0; |
volatile char messanzahl_Druck; |
volatile int tmpLuftdruck; |
volatile unsigned int ZaehlMessungen = 0; |
//####################################################################################### |
// |
void ADC_Init(void) |
//####################################################################################### |
{ |
ADMUX = 0;//Referenz ist extern |
ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE); |
//Free Running Mode, Division Factor 128, Interrupt on |
} |
void SucheLuftruckOffset(void) |
{ |
unsigned int off; |
for(off=0; off < 250;off++) |
{ |
OCR0A = off; |
Delay_ms(50); |
printf("."); |
if(MessLuftdruck < 900) break; |
} |
DruckOffsetSetting = off; |
Delay_ms(200); |
} |
//####################################################################################### |
// |
SIGNAL(SIG_ADC) |
//####################################################################################### |
{ |
static unsigned char kanal=0,state = 0; |
signed int wert; |
ANALOG_OFF; |
switch(state++) |
{ |
case 0: |
wert = (signed int) AdNeutralGier - ADC; |
AccumulateGier += wert; // |
MessanzahlGier++; |
Mess_Integral_Gier += wert;// / 16; |
Mess_Integral_Gier2 += wert; |
// GyroKomp_Int += wert; |
kanal = 1; |
ZaehlMessungen++; |
break; |
case 1: |
wert = (signed int) ADC - AdNeutralRoll; |
Mess_IntegralRoll += wert; |
Mess_IntegralRoll2 += wert; |
if(ADC < 10) wert = -700; |
if(ADC > 1000) wert = +700; |
AccumulateRoll += wert; |
MessanzahlRoll++; |
kanal = 2; |
break; |
case 2: |
wert = (signed int) ADC - AdNeutralNick; |
Mess_IntegralNick += wert; |
Mess_IntegralNick2 += wert; |
if(ADC < 10) wert = -700; |
if(ADC > 1000) wert = +700; |
AccumulateNick += wert; |
MessanzahlNick++; |
kanal = 4; |
break; |
case 3: |
UBat = (3 * UBat + ADC / 3) / 4;//(UBat + ((ADC * 39) / 256) + 19) / 2; |
kanal = 6; |
break; |
case 4: |
Aktuell_ay = NeutralAccY - ADC; |
accumulate_AccRoll += Aktuell_ay; |
messanzahl_AccRoll++; |
kanal = 7; |
break; |
case 5: |
Aktuell_ax = ADC - NeutralAccX; |
accumulate_AccNick += Aktuell_ax; |
messanzahl_AccNick++; |
kanal = 5; |
state = 6; |
break; |
case 6: |
accumulate_AccHoch = (signed int) ADC - NeutralAccZ; |
accumulate_AccHoch += abs(Aktuell_ay) / 4 + abs(Aktuell_ax) / 4; |
if(accumulate_AccHoch > 1) |
{ |
if(NeutralAccZ < 800) NeutralAccZ+= 0.02; |
} |
else if(accumulate_AccHoch < -1) |
{ |
if(NeutralAccZ > 600) NeutralAccZ-= 0.02; |
} |
messanzahl_AccHoch = 1; |
Aktuell_az = ADC; |
Mess_Integral_Hoch += accumulate_AccHoch; // Integrieren |
Mess_Integral_Hoch -= Mess_Integral_Hoch / 1024; // dämfen |
// Mess_Integral_Hoch -= Mess_Integral_Hoch / 512; // dämfen |
/* if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
kanal = 3; |
state = 7; |
} |
else |
{ |
kanal = 0; |
state = 0; |
}*/ |
kanal = 3; |
state = 7; |
break; |
case 7: |
tmpLuftdruck += ADC; |
if(++messanzahl_Druck >= 5) |
{ |
MessLuftdruck = ADC; |
messanzahl_Druck = 0; |
HoeheD = (int)(StartLuftdruck - tmpLuftdruck - HoehenWert); // D-Anteil = neuerWert - AlterWert |
Luftdruck = (tmpLuftdruck + 3 * Luftdruck) / 4; |
HoehenWert = StartLuftdruck - Luftdruck; |
tmpLuftdruck = 0; |
} |
kanal = 0; |
state = 0; |
break; |
default: |
kanal = 0; |
state = 0; |
break; |
} |
ADMUX = kanal; |
ANALOG_ON; |
} |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/analog.h |
---|
0,0 → 1,23 |
/*####################################################################################### |
#######################################################################################*/ |
extern volatile int UBat; |
extern volatile int AccumulateNick, AccumulateRoll, AccumulateGier,accumulate_AccRoll,accumulate_AccNick,accumulate_AccHoch; |
extern volatile char MessanzahlNick, MessanzahlRoll, MessanzahlGier,messanzahl_AccNick, messanzahl_AccRoll,messanzahl_AccHoch; |
extern volatile int Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az; |
extern volatile long Luftdruck; |
extern volatile char messanzahl_Druck; |
extern volatile unsigned int ZaehlMessungen; |
extern unsigned char DruckOffsetSetting; |
extern volatile int HoeheD; |
extern volatile unsigned int MessLuftdruck; |
extern volatile int StartLuftdruck; |
extern unsigned int ReadADC(unsigned char adc_input); |
extern void ADC_Init(void); |
extern void SucheLuftruckOffset(void); |
#define ANALOG_OFF ADCSRA=0 |
#define ANALOG_ON ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE) |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/compass.c |
---|
0,0 → 1,152 |
/* |
Copyright 2007, Niklas Nold |
This program (files compass.c and compass.h) is free software; you can redistribute it and/or modify |
it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; |
either version 3 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
Please note: All the other files for the project "Mikrokopter" by H. Buss are under the license (license_buss.txt) published by www.mikrokopter.de |
*/ |
#include "main.h" |
MM3_struct MM3; |
//############################################################################ |
//Initialisierung der SPI-Schnittstelle |
void init_spi(void) |
//############################################################################ |
{ |
SPCR = (1<<SPIE)|(1<<SPE)|(1<<MSTR)|(1<<SPR1)|(1<<SPR0); //Interrupt an, Master, 156 kHz Oszillator |
//SPSR = (1<<SPI2X); |
DDRB |= (1<<PB7)|(1<<PB5)|(1<<PB2); // J8, MOSI, SCK Ausgang |
PORTD &= ~(1<<PD3); // J5 auf Low |
MM3.AXIS = MM3_X; |
MM3.STATE = MM3_RESET; |
} |
//############################################################################ |
//Wird in der SIGNAL (SIG_OVERFLOW0) aufgerufen |
void MM3_timer0(void) |
//############################################################################ |
{ |
switch (MM3.STATE) |
{ |
case MM3_RESET: |
PORTB |= (1<<PB2); // J8 auf High, MM3 Reset |
MM3.STATE = MM3_START_TRANSFER; |
return; |
case MM3_START_TRANSFER: |
PORTB &= ~(1<<PB2); // J8 auf Low (war ~125 µs auf High) |
if (MM3.AXIS == MM3_X) SPDR = 0x51; // Schreiben ins SPDR löst automatisch Übertragung (MOSI und MISO) aus |
else if (MM3.AXIS == MM3_Y) SPDR = 0x52; // Micromag Period Select ist auf 1024 (0x50) |
else if (MM3.AXIS == MM3_Z) SPDR = 0x53; // 1: x-Achse, 2: Y-Achse, 3: Z-Achse |
MM3.DRDY = SetDelay(15); // Laut Datenblatt max. Zeit bis Messung fertig (bei PS 1024) |
MM3.STATE = MM3_WAIT_DRDY; |
return; |
case MM3_WAIT_DRDY: |
if (CheckDelay(MM3.DRDY)) {SPDR = 0x00;MM3.STATE = MM3_DRDY;} // Irgendwas ins SPDR, damit Übertragung ausgelöst wird, wenn Wartezeit vorbei |
return; // Jetzt gehts weiter in SIGNAL (SIG_SPI) |
case MM3_TILT: // Zeitnahe Speicherung der aktuellen Neigung in ° |
MM3.NickGrad = asin_i((float)Aktuell_ax/220*200); |
MM3.RollGrad = asin_i((float)Aktuell_ay/220*200); |
MM3.AXIS = MM3_X; |
MM3.STATE = MM3_RESET; |
return; |
} |
} |
//############################################################################ |
//SPI byte ready |
SIGNAL (SIG_SPI) |
//############################################################################ |
{ |
switch (MM3.STATE) |
{ |
case MM3_DRDY: // 1. Byte ist da, abspeichern, an die MSB-Stelle rücken |
if (MM3.AXIS == MM3_X) |
{ |
MM3.x_axis = SPDR; |
MM3.x_axis <<= 8; |
} |
else if (MM3.AXIS == MM3_Y) |
{ |
MM3.y_axis = SPDR; |
MM3.y_axis <<= 8; |
} |
else // if (MM3.AXIS == MM3_Z) |
{ |
MM3.z_axis = SPDR; |
MM3.z_axis <<= 8; |
} |
SPDR=0x00; // Übertragung von 2. Byte auslösen |
MM3.STATE=MM3_BYTE2; |
return; |
case MM3_BYTE2: // 2. Byte der entsprechenden Achse ist da |
if (MM3.AXIS == MM3_X) |
{ |
MM3.x_axis |= SPDR; |
MM3.x_axis -= OFF_X; // Sofort Offset aus der Kalibrierung berücksichtigen |
MM3.AXIS = MM3_Y; |
MM3.STATE = MM3_RESET; |
} |
else if (MM3.AXIS == MM3_Y) |
{ |
MM3.y_axis |= SPDR; |
MM3.y_axis -= OFF_Y; |
MM3.AXIS = MM3_Z; |
MM3.STATE = MM3_RESET; |
} |
else // if (MM3.AXIS == MM3_Z) |
{ |
MM3.z_axis |= SPDR; |
MM3.z_axis -= OFF_Z; |
MM3.STATE = MM3_TILT; |
} |
return; |
} |
} |
signed int MM3_heading(void) |
{ |
float sin_nick, cos_nick, sin_roll, cos_roll; |
signed int x_corr, y_corr; |
signed int heading; |
// Berechung von sinus und cosinus |
sin_nick = sin_f(MM3.NickGrad); |
cos_nick = cos_f(MM3.NickGrad); |
sin_roll = sin_f(MM3.RollGrad); |
cos_roll = cos_f(MM3.RollGrad); |
// Neigungskompensation |
//x_corr = (cos_nick * MM3.x_axis) + (((sin_roll * MM3.y_axis) - (cos_roll * MM3.z_axis)) * sin_nick); |
x_corr = (cos_nick * MM3.x_axis) - (((sin_roll * MM3.y_axis) - (cos_roll * MM3.z_axis)) * sin_nick); |
y_corr = ((cos_roll * MM3.y_axis) + (sin_roll * MM3.z_axis)); |
// Winkelberechnung |
heading = atan2_i(x_corr, y_corr); |
return (heading); |
} |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/compass.h |
---|
0,0 → 1,41 |
typedef struct |
{ |
uint8_t STATE; |
unsigned int DRDY; |
uint8_t AXIS; |
signed int x_axis; |
signed int y_axis; |
signed int z_axis; |
signed int NickGrad; |
signed int RollGrad; |
}MM3_struct; |
extern MM3_struct MM3; |
void init_spi(void); |
void MM3_timer0(void); |
signed int MM3_heading(void); |
#define Int2Grad_Faktor 1024 |
// Die Werte der Statemachine |
#define MM3_RESET 0 |
#define MM3_START_TRANSFER 1 |
#define MM3_WAIT_DRDY 2 |
#define MM3_DRDY 4 |
#define MM3_BYTE2 8 |
#define MM3_X 16 |
#define MM3_Y 32 |
#define MM3_Z 64 |
#define MM3_TILT 128 |
// Die Werte der Kompasskalibrierung |
// OFFSET: (Maximaler Wert + minimaler Wert) / 2 |
#define OFF_X -11 |
#define OFF_Y 30 |
#define OFF_Z 18 |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/eeprom.c |
---|
--- alpha/v060SalvoKompassNick666MM3ACC/fc.c (nonexistent) |
+++ alpha/v060SalvoKompassNick666MM3ACC/fc.c (revision 2762) |
@@ -0,0 +1,838 @@ |
+/*####################################################################################### |
+Flight Control |
+#######################################################################################*/ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Copyright (c) 04.2007 Holger Buss |
+// + Nur für den privaten Gebrauch |
+// + www.MikroKopter.com |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
+// + dass eine Nutzung (auch auszugsweise) nur für den privaten (nicht-kommerziellen) Gebrauch zulässig ist. |
+// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
+// + bzgl. der Nutzungsbedingungen aufzunehmen. |
+// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
+// + Verkauf von Luftbildaufnahmen, usw. |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
+// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
+// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
+// + eindeutig als Ursprung verlinkt werden |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
+// + Benutzung auf eigene Gefahr |
+// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
+// + mit unserer Zustimmung zulässig |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
+// + this list of conditions and the following disclaimer. |
+// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
+// + from this software without specific prior written permission. |
+// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
+// + for non-commercial use (directly or indirectly) |
+// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
+// + with our written permission |
+// + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
+// + clearly linked as origin |
+// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
+// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
+// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
+// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
+// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
+// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
+// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
+// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
+// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
+// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
+// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
+// + POSSIBILITY OF SUCH DAMAGE. |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Aenderungen von Peter Muehlenbrock ("Salvo") Stand 6.10.2007 |
+/* |
+Driftkompensation fuer Gyros verbessert |
+Linearsensor mit fixem Neutralwert |
+Ersatzkompass abgeleitet aus Magnetkompass und Giergyro fuer nahezu neigungsunabhaengige Kompassfunktion |
+*/ |
+ |
+#include "main.h" |
+ |
+unsigned char h,m,s; |
+volatile unsigned char Timeout = 0; |
+volatile int MesswertNick,MesswertRoll,MesswertGier; |
+volatile int AdNeutralNick = 0,AdNeutralRoll = 0,AdNeutralGier = 0; |
+volatile int Mittelwert_AccNick, Mittelwert_AccRoll,Mittelwert_AccHoch, NeutralAccX=0, NeutralAccY=0; |
+volatile float NeutralAccZ = 0; |
+unsigned char CosinusNickWinkel = 0, CosinusRollWinkel = 0; |
+volatile long IntegralNick = 0,IntegralNick2 = 0; |
+volatile long IntegralRoll = 0,IntegralRoll2 = 0; |
+volatile long Integral_Gier = 0; |
+volatile long Mess_IntegralNick = 0,Mess_IntegralNick2 = 0; |
+volatile long Mess_IntegralRoll = 0,Mess_IntegralRoll2 = 0; |
+volatile long Mess_Integral_Gier = 0,Mess_Integral_Gier2 = 0; |
+volatile long Mess_Integral_Hoch = 0; |
+volatile int KompassValue = 0; |
+volatile int KompassStartwert = 0; |
+volatile int KompassRichtung = 0; |
+unsigned char MAX_GAS,MIN_GAS; |
+unsigned char Notlandung = 0; |
+unsigned char HoehenReglerAktiv = 0; |
+ |
+float GyroFaktor; |
+float IntegralFaktor; |
+ |
+uint8_t gps_cmd = GPS_CMD_STOP; |
+ |
+volatile int DiffNick,DiffRoll; |
+int Poti1 = 0, Poti2 = 0, Poti3 = 0, Poti4 = 0; |
+volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
+unsigned char MotorWert[5]; |
+volatile unsigned char SenderOkay = 0; |
+int StickNick = 0,StickRoll = 0,StickGier = 0; |
+char MotorenEin = 0; |
+int HoehenWert = 0; |
+int SollHoehe = 0; |
+int w,v; |
+ |
+float Kp = FAKTOR_P; |
+float Ki = FAKTOR_I; |
+ |
+unsigned char Parameter_Luftdruck_D = 48; // Wert : 0-250 |
+unsigned char Parameter_MaxHoehe = 251; // Wert : 0-250 |
+unsigned char Parameter_Hoehe_P = 16; // Wert : 0-32 |
+unsigned char Parameter_Hoehe_ACC_Wirkung = 58; // Wert : 0-250 |
+unsigned char Parameter_KompassWirkung = 64; // Wert : 0-250 |
+unsigned char Parameter_Gyro_P = 50; // Wert : 10-250 |
+unsigned char Parameter_Gyro_I = 150; // Wert : 0-250 |
+unsigned char Parameter_Gier_P = 2; // Wert : 1-20 |
+unsigned char Parameter_I_Faktor = 10; // Wert : 1-20 |
+unsigned char Parameter_UserParam1 = 0; |
+unsigned char Parameter_UserParam2 = 0; |
+unsigned char Parameter_UserParam3 = 0; |
+unsigned char Parameter_UserParam4 = 0; |
+unsigned char Parameter_ServoNickControl = 100; |
+struct mk_param_struct EE_Parameter; |
+ |
+void Piep(unsigned char Anzahl) |
+{ |
+ while(Anzahl--) |
+ { |
+ if(MotorenEin) return; //auf keinen Fall im Flug! |
+ beeptime = 100; |
+ Delay_ms(250); |
+ } |
+} |
+ |
+//############################################################################ |
+// Nullwerte ermitteln |
+void SetNeutral(void) |
+//############################################################################ |
+{ |
+ unsigned int timer; |
+ NeutralAccX = 0; |
+ NeutralAccY = 0; |
+ NeutralAccZ = 0; |
+ AdNeutralNick = 0; |
+ AdNeutralRoll = 0; |
+ AdNeutralGier = 0; |
+ GPS_Neutral(); |
+ CalibrierMittelwert(); |
+ timer = SetDelay(5); |
+ while (!CheckDelay(timer)); |
+ CalibrierMittelwert(); |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
+ { |
+ if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset(); |
+ } |
+ AdNeutralNick= abs(MesswertNick); |
+ AdNeutralRoll= abs(MesswertRoll); |
+ AdNeutralGier= abs(MesswertGier); |
+ NeutralAccY = abs(Mittelwert_AccRoll) / ACC_AMPLIFY; |
+ NeutralAccX = abs(Mittelwert_AccNick) / ACC_AMPLIFY; |
+ NeutralAccZ = Aktuell_az; |
+ |
+ Mess_IntegralNick = 0; |
+ Mess_IntegralNick2 = 0; |
+ Mess_IntegralRoll = 0; |
+ Mess_IntegralRoll2 = 0; |
+ Mess_Integral_Gier = 0; |
+ MesswertNick = 0; |
+ MesswertRoll = 0; |
+ MesswertGier = 0; |
+ StartLuftdruck = Luftdruck; |
+ HoeheD = 0; |
+ Mess_Integral_Hoch = 0; |
+ KompassStartwert = KompassValue; |
+ beeptime = 50; |
+} |
+ |
+//############################################################################ |
+// Bildet den Mittelwert aus den Messwerten |
+void Mittelwert(void) |
+//############################################################################ |
+{ |
+ // ADC auschalten, damit die Werte sich nicht während der Berechnung ändern |
+ ANALOG_OFF; |
+ if(MessanzahlNick) (MesswertNick = AccumulateNick / MessanzahlNick); |
+ if(MessanzahlRoll) (MesswertRoll = AccumulateRoll / MessanzahlRoll); |
+ if(MessanzahlGier) (MesswertGier = AccumulateGier / MessanzahlGier); |
+ if(messanzahl_AccNick) Mittelwert_AccNick = ((long)Mittelwert_AccNick * 7 + ((ACC_AMPLIFY * (long)accumulate_AccNick) / messanzahl_AccNick)) / 8L; |
+ if(messanzahl_AccRoll) Mittelwert_AccRoll = ((long)Mittelwert_AccRoll * 7 + ((ACC_AMPLIFY * (long)accumulate_AccRoll) / messanzahl_AccRoll)) / 8L; |
+ if(messanzahl_AccHoch) Mittelwert_AccHoch = ((long)Mittelwert_AccHoch * 7 + ((long)accumulate_AccHoch) / messanzahl_AccHoch) / 8L; |
+ AccumulateNick = 0; MessanzahlNick = 0; |
+ AccumulateRoll = 0; MessanzahlRoll = 0; |
+ AccumulateGier = 0; MessanzahlGier = 0; |
+ accumulate_AccRoll = 0;messanzahl_AccRoll = 0; |
+ accumulate_AccNick = 0;messanzahl_AccNick = 0; |
+ accumulate_AccHoch = 0;messanzahl_AccHoch = 0; |
+ Integral_Gier = Mess_Integral_Gier; |
+ IntegralNick = Mess_IntegralNick; |
+ IntegralRoll = Mess_IntegralRoll; |
+ IntegralNick2 = Mess_IntegralNick2; |
+ IntegralRoll2 = Mess_IntegralRoll2; |
+ // ADC einschalten |
+ ANALOG_ON; |
+ |
+//------------------------------------------------------------------------------ |
+ if(MesswertNick > 200) MesswertNick += 4 * (MesswertNick - 200); |
+ else |
+ if(MesswertNick < -200) MesswertNick += 4 * (MesswertNick + 200); |
+ |
+ if(MesswertRoll > 200) MesswertRoll += 4 * (MesswertRoll - 200); |
+ else |
+ if(MesswertRoll < -200) MesswertRoll += 4 * (MesswertRoll + 200); |
+//------------------------------------------------------------------------------ |
+ if(Poti1 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110) Poti1++; else if(Poti1 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110 && Poti1) Poti1--; |
+ if(Poti2 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110) Poti2++; else if(Poti2 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110 && Poti2) Poti2--; |
+ if(Poti3 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110) Poti3++; else if(Poti3 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110 && Poti3) Poti3--; |
+ if(Poti4 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110) Poti4++; else if(Poti4 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110 && Poti4) Poti4--; |
+ if(Poti1 < 0) Poti1 = 0; else if(Poti1 > 255) Poti1 = 255; |
+ if(Poti2 < 0) Poti2 = 0; else if(Poti2 > 255) Poti2 = 255; |
+ if(Poti3 < 0) Poti3 = 0; else if(Poti3 > 255) Poti3 = 255; |
+ if(Poti4 < 0) Poti4 = 0; else if(Poti4 > 255) Poti4 = 255; |
+} |
+ |
+//############################################################################ |
+// Messwerte beim Ermitteln der Nullage |
+void CalibrierMittelwert(void) |
+//############################################################################ |
+{ |
+ // ADC auschalten, damit die Werte sich nicht während der Berechnung ändern |
+ ANALOG_OFF; |
+ if(MessanzahlNick) (MesswertNick = AccumulateNick / MessanzahlNick); |
+ if(MessanzahlRoll) (MesswertRoll = AccumulateRoll / MessanzahlRoll); |
+ if(MessanzahlGier) (MesswertGier = AccumulateGier / MessanzahlGier); |
+ if(messanzahl_AccNick) Mittelwert_AccNick = ((ACC_AMPLIFY * (long)accumulate_AccNick) / messanzahl_AccNick); |
+ if(messanzahl_AccRoll) Mittelwert_AccRoll = (ACC_AMPLIFY * (long)accumulate_AccRoll) / messanzahl_AccRoll; |
+ if(messanzahl_AccHoch) Mittelwert_AccHoch = ((long)accumulate_AccHoch) / messanzahl_AccHoch; |
+ AccumulateNick = 0; MessanzahlNick = 0; |
+ AccumulateRoll = 0; MessanzahlRoll = 0; |
+ AccumulateGier = 0; MessanzahlGier = 0; |
+ accumulate_AccRoll = 0;messanzahl_AccRoll = 0; |
+ accumulate_AccNick = 0;messanzahl_AccNick = 0; |
+ accumulate_AccHoch = 0;messanzahl_AccHoch = 0; |
+ // ADC einschalten |
+ ANALOG_ON; |
+ if(Poti1 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110) Poti1++; else if(Poti1 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110 && Poti1) Poti1--; |
+ if(Poti2 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110) Poti2++; else if(Poti2 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110 && Poti2) Poti2--; |
+ if(Poti3 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110) Poti3++; else if(Poti3 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110 && Poti3) Poti3--; |
+ if(Poti4 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110) Poti4++; else if(Poti4 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110 && Poti4) Poti4--; |
+ if(Poti1 < 0) Poti1 = 0; else if(Poti1 > 255) Poti1 = 255; |
+ if(Poti2 < 0) Poti2 = 0; else if(Poti2 > 255) Poti2 = 255; |
+ if(Poti3 < 0) Poti3 = 0; else if(Poti3 > 255) Poti3 = 255; |
+ if(Poti4 < 0) Poti4 = 0; else if(Poti4 > 255) Poti4 = 255; |
+} |
+ |
+//############################################################################ |
+// Senden der Motorwerte per I2C-Bus |
+void SendMotorData(void) |
+//############################################################################ |
+{ |
+ if(MOTOR_OFF || !MotorenEin) |
+ { |
+ Motor_Hinten = 0; |
+ Motor_Vorne = 0; |
+ Motor_Rechts = 0; |
+ Motor_Links = 0; |
+ if(MotorTest[0]) Motor_Vorne = MotorTest[0]; |
+ if(MotorTest[1]) Motor_Hinten = MotorTest[1]; |
+ if(MotorTest[2]) Motor_Links = MotorTest[2]; |
+ if(MotorTest[3]) Motor_Rechts = MotorTest[3]; |
+ } |
+ |
+ DebugOut.Analog[12] = Motor_Vorne; |
+ DebugOut.Analog[13] = Motor_Hinten; |
+ DebugOut.Analog[14] = Motor_Links; |
+ DebugOut.Analog[15] = Motor_Rechts; |
+ |
+ //Start I2C Interrupt Mode |
+ twi_state = 0; |
+ motor = 0; |
+ i2c_start(); |
+} |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Konstanten |
+// + 0-250 -> normale Werte |
+// + 251 -> Poti1 |
+// + 252 -> Poti2 |
+// + 253 -> Poti3 |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+void DefaultKonstanten1(void) |
+{ |
+ EE_Parameter.Kanalbelegung[K_NICK] = 3; |
+ EE_Parameter.Kanalbelegung[K_ROLL] = 4; |
+ EE_Parameter.Kanalbelegung[K_GAS] = 1; |
+ EE_Parameter.Kanalbelegung[K_GIER] = 2; |
+ EE_Parameter.Kanalbelegung[K_POTI1] = 5; |
+ EE_Parameter.Kanalbelegung[K_POTI2] = 6; |
+ EE_Parameter.Kanalbelegung[K_POTI3] = 7; |
+ EE_Parameter.Kanalbelegung[K_POTI4] = 8; |
+ EE_Parameter.GlobalConfig = 0;//CFG_HOEHENREGELUNG | /*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV | CFG_KOMPASS_FIX;//0x01; |
+ EE_Parameter.Hoehe_MinGas = 30; |
+ EE_Parameter.MaxHoehe = 251; // Wert : 0-32 251 -> Poti1 |
+ EE_Parameter.Hoehe_P = 10; // Wert : 0-32 |
+ EE_Parameter.Luftdruck_D = 70; // Wert : 0-250 |
+ EE_Parameter.Hoehe_ACC_Wirkung = 30; // Wert : 0-250 |
+ EE_Parameter.Hoehe_Verstaerkung = 2; // Wert : 0-50 |
+ EE_Parameter.Stick_P = 2; //2 // Wert : 1-6 |
+ EE_Parameter.Stick_D = 4; //8 // Wert : 0-64 |
+ EE_Parameter.Gier_P = 16; // Wert : 1-20 |
+ EE_Parameter.Gas_Min = 15; // Wert : 0-32 |
+ EE_Parameter.Gas_Max = 250; // Wert : 33-250 |
+ EE_Parameter.GyroAccFaktor = 26; // Wert : 1-64 |
+ EE_Parameter.KompassWirkung = 16; // Wert : 0-250 |
+ EE_Parameter.Gyro_P = 120; //80 // Wert : 0-250 |
+ EE_Parameter.Gyro_I = 150; // Wert : 0-250 |
+ EE_Parameter.UnterspannungsWarnung = 90; // Wert : 0-250 |
+ EE_Parameter.NotGas = 100; // Wert : 0-250 // Gaswert bei Empangsverlust |
+ EE_Parameter.NotGasZeit = 60; // Wert : 0-250 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen |
+ EE_Parameter.UfoAusrichtung = 0; // X oder + Formation |
+ EE_Parameter.I_Faktor = 5; |
+ EE_Parameter.UserParam1 = 16; //zur freien Verwendung, derzeit P-Anteil GPS |
+ EE_Parameter.UserParam2 = 2; //zur freien Verwendung, derzeit I-Anteil GPS |
+ EE_Parameter.UserParam3 = 12; //zur freien Verwendung, derzeit D-Anteil GPS |
+ EE_Parameter.UserParam4 = 0; //zur freien Verwendung |
+ EE_Parameter.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
+ EE_Parameter.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickRefresh = 5; |
+ memcpy(EE_Parameter.Name, "Normal\0", 12); |
+} |
+ |
+void DefaultKonstanten2(void) |
+{ |
+ EE_Parameter.Kanalbelegung[K_NICK] = 3; |
+ EE_Parameter.Kanalbelegung[K_ROLL] = 4; |
+ EE_Parameter.Kanalbelegung[K_GAS] = 1; |
+ EE_Parameter.Kanalbelegung[K_GIER] = 2; |
+ EE_Parameter.Kanalbelegung[K_POTI1] = 5; |
+ EE_Parameter.Kanalbelegung[K_POTI2] = 6; |
+ EE_Parameter.Kanalbelegung[K_POTI3] = 7; |
+ EE_Parameter.GlobalConfig = 0;//CFG_HOEHENREGELUNG | /*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV;//0x01; |
+ EE_Parameter.Hoehe_MinGas = 30; |
+ EE_Parameter.MaxHoehe = 251; // Wert : 0-32 251 -> Poti1 |
+ EE_Parameter.Hoehe_P = 10; // Wert : 0-32 |
+ EE_Parameter.Luftdruck_D = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_ACC_Wirkung = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_Verstaerkung = 2; // Wert : 0-50 |
+ EE_Parameter.Stick_P = 2; //2 // Wert : 1-6 |
+ EE_Parameter.Stick_D = 0; //8 // Wert : 0-64 |
+ EE_Parameter.Gier_P = 16; // Wert : 1-20 |
+ EE_Parameter.Gas_Min = 15; // Wert : 0-32 |
+ EE_Parameter.Gas_Max = 250; // Wert : 33-250 |
+ EE_Parameter.GyroAccFaktor = 26; // Wert : 1-64 |
+ EE_Parameter.KompassWirkung = 16; // Wert : 0-250 |
+ EE_Parameter.Gyro_P = 175; //80 // Wert : 0-250 |
+ EE_Parameter.Gyro_I = 175; // Wert : 0-250 |
+ EE_Parameter.UnterspannungsWarnung = 90; // Wert : 0-250 |
+ EE_Parameter.NotGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
+ EE_Parameter.NotGasZeit = 20; // Wert : 0-250 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen |
+ EE_Parameter.UfoAusrichtung = 0; // X oder + Formation |
+ EE_Parameter.I_Faktor = 5; |
+ EE_Parameter.UserParam1 = 12; //zur freien Verwendung |
+ EE_Parameter.UserParam2 = 2; //zur freien Verwendung |
+ EE_Parameter.UserParam3 = 16; //zur freien Verwendung |
+ EE_Parameter.UserParam4 = 0; //zur freien Verwendung |
+ EE_Parameter.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
+ EE_Parameter.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickRefresh = 5; |
+ memcpy(EE_Parameter.Name, "Kamera\0", 12); |
+} |
+ |
+ |
+//############################################################################ |
+// Trägt ggf. das Poti als Parameter ein |
+void ParameterZuordnung(void) |
+//############################################################################ |
+{ |
+ |
+ #define CHK_POTI(b,a,min,max) { if(a > 250) { if(a == 251) b = Poti1; else if(a == 252) b = Poti2; else if(a == 253) b = Poti3; else if(a == 254) b = Poti4;} else b = a; if(b <= min) b = min; else if(b >= max) b = max;} |
+ CHK_POTI(Parameter_MaxHoehe,EE_Parameter.MaxHoehe,0,255); |
+ CHK_POTI(Parameter_Luftdruck_D,EE_Parameter.Luftdruck_D,0,100); |
+ CHK_POTI(Parameter_Hoehe_P,EE_Parameter.Hoehe_P,0,100); |
+ CHK_POTI(Parameter_Hoehe_ACC_Wirkung,EE_Parameter.Hoehe_ACC_Wirkung,0,255); |
+ CHK_POTI(Parameter_KompassWirkung,EE_Parameter.KompassWirkung,0,255); |
+ CHK_POTI(Parameter_Gyro_P,EE_Parameter.Gyro_P,10,255); |
+ CHK_POTI(Parameter_Gyro_I,EE_Parameter.Gyro_I,0,255); |
+ CHK_POTI(Parameter_I_Faktor,EE_Parameter.I_Faktor,0,255); |
+ CHK_POTI(Parameter_UserParam1,EE_Parameter.UserParam1,0,255); |
+ CHK_POTI(Parameter_UserParam2,EE_Parameter.UserParam2,0,255); |
+ CHK_POTI(Parameter_UserParam3,EE_Parameter.UserParam3,0,255); |
+ CHK_POTI(Parameter_UserParam4,EE_Parameter.UserParam4,0,255); |
+ |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ |
+ Ki = (float) Parameter_I_Faktor * 0.0001; |
+ MAX_GAS = EE_Parameter.Gas_Max; |
+ MIN_GAS = EE_Parameter.Gas_Min; |
+} |
+ |
+//############################################################################ |
+// |
+void MotorRegler(void) |
+//############################################################################ |
+{ |
+ int motorwert,pd_ergebnis,h,tmp_int; |
+ int GierMischanteil,GasMischanteil; |
+ static long SummeNick=0,SummeRoll=0; |
+ static long sollGier = 0,tmp_long,tmp_long2; |
+ static int IntegralFehlerNick = 0; |
+ static int IntegralFehlerRoll = 0; |
+ static unsigned int RcLostTimer; |
+ static unsigned char delay_neutral = 0; |
+ static unsigned char delay_einschalten = 0,delay_ausschalten = 0; |
+ static unsigned int modell_fliegt = 0; |
+ static int hoehenregler = 0; |
+ static char TimerWerteausgabe = 0; |
+ static char NeueKompassRichtungMerken = 0; |
+ Mittelwert(); |
+//****** GPS Daten holen *************** |
+ short int n; |
+ if (gps_alive_cnt > 0) gps_alive_cnt--; //Dekrementieren. Wenn 0 kommen keine ausreichenden GPS Meldungen (Timeout) |
+ n = Get_Rel_Position(); |
+ if (n == 0) |
+ { |
+ ROT_ON; //led blitzen lassen |
+ } |
+//******PROVISORISCH*************** |
+ GRN_ON; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gaswert ermitteln |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ GasMischanteil = PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] + 120; |
+ if(GasMischanteil < 0) GasMischanteil = 0; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Empfang schlecht |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(SenderOkay < 100) |
+ { |
+ if(!PcZugriff) beeptime = 500; |
+ if(RcLostTimer) RcLostTimer--; |
+ else |
+ { |
+ MotorenEin = 0; |
+ Notlandung = 0; |
+ } |
+ ROT_ON; |
+ if(modell_fliegt > 2000) // wahrscheinlich in der Luft --> langsam absenken |
+ { |
+ GasMischanteil = EE_Parameter.NotGas; |
+ Notlandung = 1; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] = 0; |
+/* Poti1 = 65; |
+ Poti2 = 48; |
+ Poti3 = 0; |
+*/ } |
+ else MotorenEin = 0; |
+ } |
+ else |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Empfang gut |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(SenderOkay > 140) |
+ { |
+ Notlandung = 0; |
+ RcLostTimer = EE_Parameter.NotGasZeit * 50; |
+ if(GasMischanteil > 40) |
+ { |
+ if(modell_fliegt < 0xffff) modell_fliegt++; |
+ } |
+ if((modell_fliegt < 200) || (GasMischanteil < 40)) |
+ { |
+ SummeNick = 0; |
+ SummeRoll = 0; |
+ Mess_Integral_Gier = 0; |
+ Mess_Integral_Gier2 = 0; |
+ } |
+ if((GasMischanteil > 200) && MotorenEin == 0) |
+ { |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// auf Nullwerte kalibrieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) // Neutralwerte |
+ { |
+ unsigned char setting; |
+ if(++delay_neutral > 200) // nicht sofort |
+ { |
+ GRN_OFF; |
+ SetNeutral(); |
+ MotorenEin = 0; |
+ delay_neutral = 0; |
+ modell_fliegt = 0; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70 || abs(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]) > 70) |
+ { |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < 70) setting = 1; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 2; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] < 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 3; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] <-70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 4; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] <-70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < 70) setting = 5; |
+ eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], setting); // aktiven Datensatz merken |
+ } |
+ ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
+ Piep(GetActiveParamSetNumber()); |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
+ { |
+ if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset(); |
+ } |
+ GPS_Save_Home(); //Daten sind jetzt hoffentlich verfuegbar |
+ if (gps_home_position.status > 0 ) |
+ { |
+ Delay_ms(1000); //akustisch verkuenden dass GPS Home Daten da sind |
+ beeptime = 2000; |
+ Delay_ms(500); |
+ } |
+ } |
+ } |
+ else delay_neutral = 0; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gas ist unten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(GasMischanteil < 35) |
+ { |
+ // Starten |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] < -75) |
+ { |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Einschalten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(++delay_einschalten > 200) |
+ { |
+ delay_einschalten = 200; |
+ modell_fliegt = 1; |
+ MotorenEin = 1; |
+ sollGier = 0; |
+ Mess_Integral_Gier = 0; |
+ Mess_Integral_Gier2 = 0; |
+ Mess_IntegralNick = 0; |
+ Mess_IntegralRoll = 0; |
+ Mess_IntegralNick2 = IntegralNick; |
+ Mess_IntegralRoll2 = IntegralRoll; |
+ SummeNick = 0; |
+ SummeRoll = 0; |
+ } |
+ } |
+ else delay_einschalten = 0; |
+ //Auf Neutralwerte setzen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Auschalten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) |
+ { |
+ if(++delay_ausschalten > 200) // nicht sofort |
+ { |
+ MotorenEin = 0; |
+ delay_ausschalten = 200; |
+ modell_fliegt = 0; |
+ } |
+ } |
+ else delay_ausschalten = 0; |
+ } |
+ } |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// neue Werte von der Funke |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(!NewPpmData-- || Notlandung) |
+ { |
+ ParameterZuordnung(); |
+ StickNick = PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_P; |
+ StickNick += PPM_diff[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_D; |
+ StickRoll = PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_P; |
+ StickRoll += PPM_diff[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_D; |
+ StickGier = -PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]; |
+ |
+ GyroFaktor = ((float)Parameter_Gyro_P + 10.0) / 256.0; |
+ IntegralFaktor = ((float) Parameter_Gyro_I) / 44000; |
+ |
+ if(EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) IntegralFaktor = 0; |
+ if(GyroFaktor < 0) GyroFaktor = 0; |
+ if(IntegralFaktor < 0) IntegralFaktor = 0; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Bei Empfangsausfall im Flug |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(Notlandung) |
+ { |
+ StickGier = 0; |
+ StickNick = 0; |
+ StickRoll = 0; |
+ GyroFaktor = 0.1; |
+ IntegralFaktor = 0.005; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gyro-Drift kompensieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define DRIFT_FAKTOR 3 |
+ if(ZaehlMessungen >= 1000 / DRIFT_FAKTOR) |
+ { |
+ IntegralFehlerNick = IntegralNick2 - IntegralNick; |
+ IntegralFehlerRoll = IntegralRoll2 - IntegralRoll; |
+ ZaehlMessungen = 0; |
+ if(IntegralFehlerNick > 500/DRIFT_FAKTOR) AdNeutralNick++; |
+ if(IntegralFehlerNick < -500/DRIFT_FAKTOR) AdNeutralNick--; |
+ if(IntegralFehlerRoll > 500/DRIFT_FAKTOR) AdNeutralRoll++; |
+ if(IntegralFehlerRoll < -500/DRIFT_FAKTOR) AdNeutralRoll--; |
+ //if(Mess_Integral_Gier2 > 500/DRIFT_FAKTOR) AdNeutralGier--; |
+ //if(Mess_Integral_Gier2 <-500/DRIFT_FAKTOR) AdNeutralGier++; |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_IntegralNick2 = IntegralNick; |
+ Mess_IntegralRoll2 = IntegralRoll; |
+ Mess_Integral_Gier2 = Integral_Gier; |
+ ANALOG_ON; // ADC einschalten |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Integrale auf ACC-Signal abgleichen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ tmp_long = (long)(IntegralNick / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccNick) / 16; |
+ tmp_long2 = (long)(IntegralRoll / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccRoll) / 16; |
+#define AUSGLEICH 500 |
+ if(tmp_long > AUSGLEICH) tmp_long = AUSGLEICH; |
+ if(tmp_long < -AUSGLEICH) tmp_long =-AUSGLEICH; |
+ if(tmp_long2 > AUSGLEICH) tmp_long2 = AUSGLEICH; |
+ if(tmp_long2 <-AUSGLEICH) tmp_long2 =-AUSGLEICH; |
+ |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_IntegralNick -= tmp_long; |
+ Mess_IntegralRoll -= tmp_long2; |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ sollGier = StickGier; |
+ if(abs(StickGier) > 30) |
+ { |
+ if(!(EE_Parameter.GlobalConfig & CFG_KOMPASS_FIX)) NeueKompassRichtungMerken = 1; |
+ } |
+ tmp_int = EE_Parameter.Gier_P * (sollGier * abs(sollGier)) / 256; // expo |
+ Mess_Integral_Gier -= tmp_int; |
+ if(Mess_Integral_Gier > 30000) Mess_Integral_Gier = 30000; // begrenzen |
+ if(Mess_Integral_Gier <-30000) Mess_Integral_Gier =-30000; |
+ |
+ ANALOG_ON; // ADC einschalten |
+ |
+ |
+ |
+// Salvo 6.10.2007 |
+ // GPS Home aktivieren wenn Knueppel in Ruhelage und Hoehenschalter aktiviert ist |
+ //GPS Hold Aktiveren wenn Knueppel in Ruhelage sind |
+ if ((EE_Parameter.GlobalConfig & CFG_GPS_AKTIV) && (abs(StickRoll) < GPS_STICK_HOLDOFF) && (abs(StickNick) < GPS_STICK_HOLDOFF) && (gps_alive_cnt > 0)) |
+ { |
+ if (Parameter_MaxHoehe > 200) |
+ { |
+ if ( gps_cmd == GPS_CMD_REQ_HOLD) gps_cmd = GPS_CMD_STOP; // erst mal stoppen, denn altes Kommando wurde noch nicht beendet |
+ else gps_cmd = GPS_CMD_REQ_HOME; |
+ n = GPS_CRTL(gps_cmd); |
+ } |
+ else |
+ { |
+ if ( gps_cmd == GPS_CMD_REQ_HOME) gps_cmd = GPS_CMD_STOP; // erst mal stoppen, denn altes Kommando wurde noch nicht beendet |
+ else gps_cmd = GPS_CMD_REQ_HOLD; |
+ n= GPS_CRTL(gps_cmd); |
+ } |
+ } |
+ else (n= GPS_CRTL(GPS_CMD_STOP)); //GPS Lageregelung beenden |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Kompass |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(KompassValue && (EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV)) |
+ { |
+ if(NeueKompassRichtungMerken) |
+ { |
+ KompassStartwert = KompassValue; |
+ NeueKompassRichtungMerken = 0; |
+ } |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_Integral_Gier -= (KompassRichtung * Parameter_KompassWirkung) / 32; // nach Kompass ausrichten |
+ ANALOG_ON; // ADC einschalten |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Debugwerte zuordnen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+DebugOut.Sekunden++; |
+ if(!TimerWerteausgabe--) |
+ { |
+ TimerWerteausgabe = 49; |
+ |
+ DebugOut.Analog[0] = MM3.NickGrad; |
+ DebugOut.Analog[1] = MM3.RollGrad; |
+ DebugOut.Analog[2] = Mittelwert_AccNick; |
+ DebugOut.Analog[3] = Mittelwert_AccRoll; |
+ DebugOut.Analog[4] = MesswertGier; |
+ DebugOut.Analog[5] = HoehenWert; |
+ DebugOut.Analog[6] = (Mess_Integral_Hoch / 512); |
+ DebugOut.Analog[7] = GasMischanteil; |
+ DebugOut.Analog[8] = KompassValue; |
+ DebugOut.Analog[9] = KompassRichtung; |
+ DebugOut.Analog[10] = MM3_heading(); |
+ |
+ |
+ |
+//DebugOut.Analog[9] = MM3.x_axis; |
+//DebugOut.Analog[10] = MM3.y_axis; |
+//DebugOut.Analog[11] = MM3.z_axis; |
+//DebugOut.Analog[13] = KompassRichtung; |
+ |
+ |
+ } |
+ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Drehgeschwindigkeit und -winkel zu einem Istwert zusammenfassen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ MesswertNick = IntegralNick * IntegralFaktor + MesswertNick * GyroFaktor; |
+ MesswertRoll = IntegralRoll * IntegralFaktor + MesswertRoll * GyroFaktor; |
+ MesswertGier = MesswertGier * (GyroFaktor/2) + Integral_Gier * IntegralFaktor; |
+ // Maximalwerte abfangen |
+ #define MAX_SENSOR 2048 |
+ if(MesswertNick > MAX_SENSOR) MesswertNick = MAX_SENSOR; |
+ if(MesswertNick < -MAX_SENSOR) MesswertNick = -MAX_SENSOR; |
+ if(MesswertRoll > MAX_SENSOR) MesswertRoll = MAX_SENSOR; |
+ if(MesswertRoll < -MAX_SENSOR) MesswertRoll = -MAX_SENSOR; |
+ if(MesswertGier > MAX_SENSOR) MesswertGier = MAX_SENSOR; |
+ if(MesswertGier < -MAX_SENSOR) MesswertGier = -MAX_SENSOR; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Höhenregelung |
+// Die Höhenregelung schwächt lediglich das Gas ab, erhöht es allerdings nicht |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+//OCR0B = 180 - (Poti1 + 120) / 4; |
+//DruckOffsetSetting = OCR0B; |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung |
+ { |
+ int tmp_int; |
+ if(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER) // Regler wird über Schalter gesteuert |
+ { |
+ if(Parameter_MaxHoehe < 50) |
+ { |
+//Salvo 10.10.2007 Um Absacken beim Einschalten zu verhindern |
+// SollHoehe = HoehenWert - 20; // Parameter_MaxHoehe ist der PPM-Wert des Schalters |
+ SollHoehe = HoehenWert - 0; // Parameter_MaxHoehe ist der PPM-Wert des Schalters |
+// Salvo End |
+ HoehenReglerAktiv = 0; |
+ } |
+ else |
+ HoehenReglerAktiv = 1; |
+ } |
+ else |
+ { |
+ SollHoehe = Parameter_MaxHoehe * EE_Parameter.Hoehe_Verstaerkung - 20; |
+ HoehenReglerAktiv = 1; |
+ } |
+ |
+ if(Notlandung) SollHoehe = 0; |
+ h = HoehenWert; |
+ if((h > SollHoehe) && HoehenReglerAktiv) // zu hoch --> drosseln |
+ { h = ((h - SollHoehe) * (int) Parameter_Hoehe_P) / 16; // Differenz bestimmen --> P-Anteil |
+ h = GasMischanteil - h; // vom Gas abziehen |
+ h -= (HoeheD * Parameter_Luftdruck_D)/8; // D-Anteil |
+ tmp_int = ((Mess_Integral_Hoch / 512) * (signed long) Parameter_Hoehe_ACC_Wirkung) / 32; |
+ if(tmp_int > 50) tmp_int = 50; |
+ else if(tmp_int < -50) tmp_int = -50; |
+ h -= tmp_int; |
+ hoehenregler = (hoehenregler*15 + h) / 16; |
+ if(hoehenregler < EE_Parameter.Hoehe_MinGas) // nicht unter MIN |
+ { |
+ if(GasMischanteil >= EE_Parameter.Hoehe_MinGas) hoehenregler = EE_Parameter.Hoehe_MinGas; |
+ if(GasMischanteil < EE_Parameter.Hoehe_MinGas) hoehenregler = GasMischanteil; |
+ } |
+ if(hoehenregler > GasMischanteil) hoehenregler = GasMischanteil; // nicht mehr als Gas |
+ GasMischanteil = hoehenregler; |
+ } |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Mischer und PI-Regler |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gier-Anteil |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ GierMischanteil = MesswertGier - sollGier; // Regler für Gier |
+ if(GierMischanteil > 100) GierMischanteil = 100; |
+ if(GierMischanteil < -100) GierMischanteil = -100; |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Nick-Achse |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ DiffNick = Kp * (MesswertNick - (StickNick - GPS_Nick)); // Differenz bestimmen |
+ SummeNick += DiffNick; // I-Anteil |
+ if(SummeNick > 0) SummeNick-= (abs(SummeNick)/256 + 1); else SummeNick += abs(SummeNick)/256 + 1; |
+ if(SummeNick > 16000) SummeNick = 16000; |
+ if(SummeNick < -16000) SummeNick = -16000; |
+ pd_ergebnis = DiffNick + Ki * SummeNick; // PI-Regler für Nick |
+ // Motor Vorn |
+ motorwert = GasMischanteil + pd_ergebnis + GierMischanteil; // Mischer |
+ if ((motorwert < 0) | (GasMischanteil < 10)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Vorne = motorwert; |
+ // Motor Heck |
+ motorwert = GasMischanteil - pd_ergebnis + GierMischanteil; |
+ if ((motorwert < 0) | (GasMischanteil < 10)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Hinten = motorwert; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Roll-Achse |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ DiffRoll = Kp * (MesswertRoll - (StickRoll - GPS_Roll)); // Differenz bestimmen |
+ SummeRoll += DiffRoll; // I-Anteil |
+ if(SummeRoll > 0) SummeRoll-= (abs(SummeRoll)/256 + 1); else SummeRoll += abs(SummeRoll)/256 + 1; |
+ if(SummeRoll > 16000) SummeRoll = 16000; |
+ if(SummeRoll < -16000) SummeRoll = -16000; |
+ pd_ergebnis = DiffRoll + Ki * SummeRoll; // PI-Regler für Roll |
+ // Motor Links |
+ motorwert = GasMischanteil + pd_ergebnis - GierMischanteil; |
+ if ((motorwert < 0) | (GasMischanteil < 10)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Links = motorwert; |
+ // Motor Rechts |
+ motorwert = GasMischanteil - pd_ergebnis - GierMischanteil; |
+ if ((motorwert < 0) | (GasMischanteil < 10)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Rechts = motorwert; |
+ // +++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+} |
+ |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/fc.h |
---|
0,0 → 1,119 |
/*####################################################################################### |
Flight Control |
#######################################################################################*/ |
#ifndef _FC_H |
#define _FC_H |
extern unsigned char Parameter_UserParam1 ; |
extern unsigned char Parameter_UserParam2 ; |
extern unsigned char Parameter_UserParam3 ; |
// Salvo End |
extern volatile unsigned char Timeout; |
extern unsigned char Sekunde,Minute; |
extern volatile long IntegralNick,IntegralNick2; |
extern volatile long IntegralRoll,IntegralRoll2; |
extern volatile long Mess_IntegralNick,Mess_IntegralNick2; |
extern volatile long Mess_IntegralRoll,Mess_IntegralRoll2; |
extern volatile long Mess_Integral_Hoch; |
extern volatile long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2; |
extern volatile int KompassValue; |
extern volatile int KompassStartwert; |
extern volatile int KompassRichtung; |
extern int HoehenWert; |
extern int SollHoehe; |
extern volatile int MesswertNick,MesswertRoll,MesswertGier; |
extern volatile int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll; |
extern volatile int NeutralAccX, NeutralAccY,Mittelwert_AccHoch; |
extern volatile float NeutralAccZ; |
/*Salvo 2.9.2007 Ersatzkompass |
extern volatile long GyroKomp_Int; |
extern volatile int GyroKomp_Inc_Grad; |
extern volatile int GyroKomp_Value; // Der ermittelte Kompasswert aus Gyro und Magnetkompass |
Salvo End*/ |
void MotorRegler(void); |
void SendMotorData(void); |
void CalibrierMittelwert(void); |
void Mittelwert(void); |
void SetNeutral(void); |
void Piep(unsigned char Anzahl); |
void DefaultKonstanten1(void); |
void DefaultKonstanten2(void); |
unsigned char h,m,s; |
volatile unsigned char Timeout ; |
unsigned char CosinusNickWinkel, CosinusRollWinkel; |
volatile long IntegralNick,IntegralNick2; |
volatile long IntegralRoll,IntegralRoll2; |
volatile long Integral_Gier; |
volatile long Mess_IntegralNick,Mess_IntegralNick2; |
volatile long Mess_IntegralRoll,Mess_IntegralRoll2; |
volatile long Mess_Integral_Gier; |
volatile int DiffNick,DiffRoll; |
extern int Poti1, Poti2, Poti3, Poti4; |
volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
unsigned char MotorWert[5]; |
volatile unsigned char SenderOkay; |
int StickNick,StickRoll,StickGier; |
char MotorenEin; |
extern void DefaultKonstanten(void); |
#define STRUCT_PARAM_LAENGE 58 |
struct mk_param_struct |
{ |
unsigned char Kanalbelegung[8]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3 |
unsigned char GlobalConfig; // 0x01=Höhenregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv |
unsigned char Hoehe_MinGas; // Wert : 0-100 |
unsigned char Luftdruck_D; // Wert : 0-250 |
unsigned char MaxHoehe; // Wert : 0-32 |
unsigned char Hoehe_P; // Wert : 0-32 |
unsigned char Hoehe_Verstaerkung; // Wert : 0-50 |
unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250 |
unsigned char Stick_P; // Wert : 1-6 |
unsigned char Stick_D; // Wert : 0-64 |
unsigned char Gier_P; // Wert : 1-20 |
unsigned char Gas_Min; // Wert : 0-32 |
unsigned char Gas_Max; // Wert : 33-250 |
unsigned char GyroAccFaktor; // Wert : 1-64 |
unsigned char KompassWirkung; // Wert : 0-32 |
unsigned char Gyro_P; // Wert : 10-250 |
unsigned char Gyro_I; // Wert : 0-250 |
unsigned char UnterspannungsWarnung; // Wert : 0-250 |
unsigned char NotGas; // Wert : 0-250 //Gaswert bei Empängsverlust |
unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen |
unsigned char UfoAusrichtung; // X oder + Formation |
unsigned char I_Faktor; // Wert : 0-250 |
unsigned char UserParam1; // Wert : 0-250 |
unsigned char UserParam2; // Wert : 0-250 |
unsigned char UserParam3; // Wert : 0-250 |
unsigned char UserParam4; // Wert : 0-250 |
unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos |
unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo |
unsigned char ServoNickMin; // Wert : 0-250 // Anschlag |
unsigned char ServoNickMax; // Wert : 0-250 // Anschlag |
unsigned char ServoNickRefresh; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
unsigned char ServoNickCompInvert; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
unsigned char Reserved[7]; |
char Name[12]; |
}; |
extern struct mk_param_struct EE_Parameter; |
extern unsigned char Parameter_Luftdruck_D; |
extern unsigned char Parameter_MaxHoehe; |
extern unsigned char Parameter_Hoehe_P; |
extern unsigned char Parameter_Hoehe_ACC_Wirkung; |
extern unsigned char Parameter_KompassWirkung; |
extern unsigned char Parameter_Gyro_P; |
extern unsigned char Parameter_Gyro_I; |
extern unsigned char Parameter_Gier_P; |
extern unsigned char Parameter_ServoNickControl; |
#endif //_FC_H |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/flight-ctrl_mega644_v0_60.aws |
---|
0,0 → 1,0 |
<AVRWorkspace><IOSettings><CurrentRegisters/></IOSettings><part name="ATMEGA644"/><Files><File00000 Name="E:\hubi\ufo\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\alpha\v60SalvoKompassACC\main.c" Position="321 71 1033 624" LineCol="116 0" State="Maximized"/><File00001 Name="E:\hubi\ufo\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\alpha\v60SalvoKompassACC\compass.c" Position="333 69 1399 828" LineCol="137 0" State="Maximized"/><File00002 Name="E:\hubi\ufo\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\alpha\v60SalvoKompassACC\math.c" Position="378 134 928 506" LineCol="182 0" State="Maximized"/><File00003 Name="E:\hubi\ufo\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\alpha\v60SalvoKompassACC\analog.c" Position="336 71 1182 830" LineCol="0 0" State="Maximized"/></Files></AVRWorkspace> |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/flight.pnproj |
---|
0,0 → 1,0 |
<Project name="Flight-Ctrl"><File path="uart.h"></File><File path="main.c"></File><File path="main.h"></File><File path="makefile"></File><File path="uart.c"></File><File path="printf_P.h"></File><File path="printf_P.c"></File><File path="timer0.c"></File><File path="timer0.h"></File><File path="old_macros.h"></File><File path="twimaster.c"></File><File path="version.txt"></File><File path="twimaster.h"></File><File path="rc.c"></File><File path="rc.h"></File><File path="fc.h"></File><File path="fc.c"></File><File path="menu.h"></File><File path="menu.c"></File><File path="_Settings.h"></File><File path="analog.c"></File><File path="analog.h"></File><File path="GPS.c"></File><File path="gps.h"></File><File path="License.txt"></File><File path="math.c"></File><File path="math.h"></File><File path="compass.c"></File><File path="compass.h"></File></Project> |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/flight.pnps |
---|
0,0 → 1,0 |
<pd><ViewState><e p="Flight-Ctrl" x="true"></e></ViewState></pd> |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/flight_ctrl.aps |
---|
0,0 → 1,0 |
<AVRStudio><MANAGEMENT><ProjectName>flight_ctrl</ProjectName><Created>28-Aug-2007 19:41:41</Created><LastEdit>04-Oct-2007 17:09:00</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>28-Aug-2007 19:41:41</Created><Version>4</Version><Build>4, 13, 0, 528</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>flight_ctrl.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>G:\Mikrokopter\Flight_Crtl\svn\work\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>AVR Simulator</CURRENT_TARGET><CURRENT_PART>ATmega644.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><modules><module></module></modules><Triggers><trigger clsid="{11A8571C-BF39-4FA7-8642-286DD19644B8}" enabled="1" variable="{"GPS.c", 44} ptr_position" condition="0" access="0" value1="0" value2="0" elements="1" hitcount="1" continue="0" customType="0" customScope="0"/></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>main.c</SOURCEFILE><SOURCEFILE>uart.c</SOURCEFILE><SOURCEFILE>analog.c</SOURCEFILE><SOURCEFILE>eeprom.c</SOURCEFILE><SOURCEFILE>fc.c</SOURCEFILE><SOURCEFILE>GPS.c</SOURCEFILE><SOURCEFILE>menu.c</SOURCEFILE><SOURCEFILE>printf_P.c</SOURCEFILE><SOURCEFILE>rc.c</SOURCEFILE><SOURCEFILE>timer0.c</SOURCEFILE><SOURCEFILE>twimaster.c</SOURCEFILE><SOURCEFILE>math.c</SOURCEFILE><HEADERFILE>uart.h</HEADERFILE><HEADERFILE>_Settings.h</HEADERFILE><HEADERFILE>analog.h</HEADERFILE><HEADERFILE>fc.h</HEADERFILE><HEADERFILE>gps.h</HEADERFILE><HEADERFILE>main.h</HEADERFILE><HEADERFILE>menu.h</HEADERFILE><HEADERFILE>old_macros.h</HEADERFILE><HEADERFILE>printf_P.h</HEADERFILE><HEADERFILE>rc.h</HEADERFILE><HEADERFILE>Settings.h</HEADERFILE><HEADERFILE>timer0.h</HEADERFILE><HEADERFILE>twimaster.h</HEADERFILE><HEADERFILE>math.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega644</PART><HEX>1</HEX><LIST>0</LIST><MAP>0</MAP><OUTPUTFILENAME>flight_ctrl.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>0</ISDIRTY><OPTIONS><OPTION><FILE>GPS.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>analog.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>eeprom.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>fc.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>main.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>math.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>menu.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>printf_P.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>rc.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>timer0.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>twimaster.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>uart.c</FILE><OPTIONLIST></OPTIONLIST></OPTION></OPTIONS><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -O0 -fsigned-char</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\Programme\WinAVR-20070525\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\Programme\WinAVR-20070525\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><ProjectFiles><Files><Name>G:\Mikrokopter\Flight_Crtl\svn\work\uart.h</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\_Settings.h</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\analog.h</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\fc.h</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\gps.h</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\main.h</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\menu.h</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\old_macros.h</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\printf_P.h</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\rc.h</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\Settings.h</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\timer0.h</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\twimaster.h</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\math.h</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\main.c</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\uart.c</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\analog.c</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\eeprom.c</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\fc.c</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\GPS.c</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\menu.c</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\printf_P.c</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\rc.c</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\timer0.c</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\twimaster.c</Name><Name>G:\Mikrokopter\Flight_Crtl\svn\work\math.c</Name></Files></ProjectFiles><IOView><usergroups/></IOView><Files><File00000><FileId>00000</FileId><FileName>gps.h</FileName><Status>1</Status></File00000><File00001><FileId>00001</FileId><FileName>fc.c</FileName><Status>1</Status></File00001><File00002><FileId>00002</FileId><FileName>GPS.c</FileName><Status>1</Status></File00002></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio> |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/gps.h |
---|
0,0 → 1,132 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Peter Muehlenbrock ("Salvo") |
// Definitionen fuer Modul GPS |
// Stand 12.10.007 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
extern signed int GPS_Nick; |
extern signed int GPS_Roll; |
extern void GPS_Neutral(void); |
extern void Get_Ublox_Msg(uint8_t rx) ; |
//extern short int Get_GPS_data(void); |
extern short int Get_Rel_Position(void); |
extern void GPS_Save_Home(void); |
extern short int GPS_CRTL(short int cmd); |
typedef struct { |
unsigned long utm_itow; // time of week |
long utm_east; // UTM Ost in cm |
long utm_north; // UTM Nord in cm |
long utm_alt; // hoehe in cm |
uint8_t utm_zone; // |
uint8_t utm_hem; // Hemisphere Indicator |
uint8_t status; // 0: kein gueltiges Paket 1: alles ok |
} NAV_POSUTM_t; |
typedef struct { |
unsigned long itow; // time of week |
uint8_t gpsfix_type;// 3=3D Fix |
uint8_t nav_status_flag; |
uint8_t nav_diff_status; |
uint8_t nav_resevd; |
long nav_tff; // Time to First Fix in ms |
long nav_msss; // ms since startup |
uint8_t status; // 0: kein gueltiges Paket 1: alles ok |
} NAV_STATUS_t; |
typedef struct { |
unsigned long itow; |
long speed_n; // in cm/s |
long speed_e; // in cm/s |
long speed_alt; // in cm/s |
unsigned long speed_3d; // in cm/s |
unsigned long speed_gnd; // V ueber Grund in cm/s |
long heading; // Richtung in deg/10000 |
unsigned long sacc; // Speed Genauigkeit in cm/s |
unsigned long cacc; // Richtungsgenauigkeit in deg |
uint8_t status; // 0: kein gueltiges Paket 1: alles ok |
} NAV_VELNED_t; |
typedef struct { |
long utm_east; // UTM Ost in 10 cm |
long utm_north; // UTM Nord in 10 cm |
long utm_alt; // hoehe in 10 cm |
unsigned long speed_gnd; // V ueber Grund in 10cm/s |
unsigned heading; // Richtung in Grad |
uint8_t status; // 0: keine gueltigen Daten 1: alles ok |
} GPS_ABS_POSITION_t; |
typedef struct { // Struktur fuer Relative GPS Daten (bezogen z.B. auf Home Position) |
int utm_east; // UTM Ost in m |
int utm_north; // UTM Nord in m |
uint8_t status; // 0: keine gueltigen Daten 1: alles ok |
} GPS_REL_POSITION_t; |
extern GPS_ABS_POSITION_t gps_act_position; |
extern GPS_ABS_POSITION_t gps_home_position; |
extern GPS_REL_POSITION_t gps_rel_act_position; |
extern GPS_REL_POSITION_t gps_rel_hold_position; |
extern short int gps_state,gps_sub_state; |
extern signed int GPS_hdng_abs_2trgt; |
extern signed int GPS_hdng_rel_2trgt; |
extern signed int GPS_dist_2trgt; |
extern signed int gps_reg_x,gps_reg_y; |
extern signed int GPS_dist_2trgt; |
extern unsigned int gps_alive_cnt; |
//nur provisorisch fuer Debugausgaben |
extern signed hdng_2home,dist_2home; //Richtung und Entfernung zur home Position |
extern long int dist_flown; |
// Zustaende der zentralen GPS statemachine |
#define GPS_CRTL_IDLE 0 // |
#define GPS_CRTL_HOLD_ACTIVE 1 // Lageregelung aktiv |
#define GPS_CRTL_HOME_ACTIVE 2 // Rueckflug zur Basis Aktiv |
#define GPS_HOME_FAST_IN_TOL 3 // Rueckflug: Aktuelle Position innerhalb der Toleranz |
#define GPS_HOME_FAST_OUTOF_TOL 4 // Rueckflug: Aktuelle Position ausserhalb der Toleranz |
#define GPS_HOME_RMPDWN_IN_TOL 5 // Rueckflug: beim Abbremsen Position innerhalb der Toleranz |
#define GPS_HOME_RMPDWN_OUTOF_TOL 6 // Rueckflug: beim Abbremsen Position ausserhalb der Toleranz |
#define GPS_HOME_IN_TOL 7 // Rueckflug: Nahe am Ziel innerhalb der Toleranz |
#define GPS_HOME_OUTOF_TOL 8 // Rueckflug: Nahe am Ziel ausserhalb der Toleranz |
#define GPS_HOME_FINISHED 9 // Rueckflug zur Basis abgeschlossen |
// Kommandokonstanten fuer die zentrale GPS Statemachine |
#define GPS_CMD_REQ_INIT 0 // Initialisierung |
#define GPS_CMD_STOP 1 // Lageregelung soll deaktiviert werden |
#define GPS_CMD_REQ_HOLD 3 // Lageregelung soll aktiviert werden |
#define GPS_CMD_REQ_HOME 4 // Das Heimfliegen soll aktiviert werden |
// Statusmeldungen der zentralen GPS statemachine |
#define GPS_STST_OK 0 // Kommando erfolgreich und abgeschlossen |
#define GPS_STST_PEND 1 // Kommando noch nicht komplett durchgefuehrt |
#define GPS_STST_ERR 2 // Fehler |
// GPS Lageregler |
#define GPS_NICKROLL_MAX 40 // Maximaler Einfluss des GPS Lagereglers auf Nick und Roll |
#define GPS_DIST_MAX 400 // Maximal zulaessige Distanz bevor Regelung gestoppt wird (in 10cm) |
#define GPS_STICK_HOLDOFF 25 // Wenn der Nick oder Roll Stickwerte groesser sind, wird GPS_HOLD deaktiviert |
#define GPS_V 8 // Teilerfaktor Regelabweichung zu Ausgabewert |
// Differenzierer Kennwerte fuer von Distanz abhaengige Verstaerkung, abhaengig vom Modus. |
#define GPS_DIFF_NRML_MAX_V 20 //maximale Verstaerkung * 10 |
#define GPS_DIFF_NRML_MAX_D 30 //Entfernung bei der maximale Verstaerkung erreicht wird in 10cm |
#define GPS_DIFF_FAST_MAX_V 15 //maximale Verstaerkung * 10 im Fast mode |
#define GPS_DIFF_FAST_MAX_D 50 //Entfernung bei der maximale Verstaerkung erreicht wird in 10cm im Fast mode |
// P-Regler Verstaerkung |
#define GPS_PROP_NRML_V 2 //maximale Verstaerkung * 2 |
#define GPS_PROP_FAST_V 2 //maximale Verstaerkung * 2 im Fast mode |
// GPS G2T /Go to Target Regler |
#define GPS_G2T_DIST_MAX_STOP 50 // Ab dieser Entfernung vom Zielpunkt soll die Geschwindigkeit runtergeregelt werden( in 10 cm) |
#define GPS_G2T_DIST_HOLD 30 // Ab dieser Entfernung vom Zielpunkt wird mit Minimaler Geschwindigkeit eingeregelt |
#define GPS_G2T_V_MAX 12 // Maximale Geschwindigkeit (in 10cm/0.25 Sekunden) mit der der Sollpunkt geaendert wird. |
#define GPS_G2T_V_RAMP_DWN 6 // Geschwindigkeit (in 10cm/0.25ekunden) in der Naehe der Home Position um abzubremsen |
#define GPS_G2T_V_MIN 3 // Minimale (in 10cm/0.25 Sekunden) ganz nahe an Homeposition. |
#define GPS_G2T_FAST_TOL 60 // Bei grosser Entfernung vom Ziel: Der Sollwert wird nur geaendert wenn die aktuelle Position nicht mehr als diesem Wert vom Sollwert abweicht |
#define GPS_G2T_NRML_TOL 40 // Bei kleiner Entfernung vom Ziel: Der Sollwert wird nur geaendert wenn die aktuelle Position nicht mehr als diesem Wert vom Sollwert abweicht |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/license_buss.txt |
---|
0,0 → 1,52 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + Nur für den privaten Gebrauch |
// + www.MikroKopter.com |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
// + dass eine Nutzung (auch auszugsweise) nur für den privaten und nichtkommerziellen Gebrauch zulässig ist. |
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
// + bzgl. der Nutzungsbedingungen aufzunehmen. |
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
// + Verkauf von Luftbildaufnahmen, usw. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
// + eindeutig als Ursprung verlinkt und genannt werden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
// + Benutzung auf eigene Gefahr |
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
// + mit unserer Zustimmung zulässig |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
// + this list of conditions and the following disclaimer. |
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
// + from this software without specific prior written permission. |
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
// + for non-profit use (directly or indirectly) |
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
// + with our written permission |
// + * If sources or documentations are redistributet, our webpage (http://www.MikroKopter.de) must be |
// + clearly linked and named as origin |
// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/main.c |
---|
0,0 → 1,215 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + Nur für den privaten Gebrauch |
// + www.MikroKopter.com |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
// + dass eine Nutzung (auch auszugsweise) nur für den privaten und nicht-kommerziellen Gebrauch zulässig ist. |
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
// + bzgl. der Nutzungsbedingungen aufzunehmen. |
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
// + Verkauf von Luftbildaufnahmen, usw. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
// + auf anderen Webseiten oder Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
// + eindeutig als Ursprung verlinkt und genannt werden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
// + Benutzung auf eigene Gefahr |
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
// + mit unserer Zustimmung zulässig |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
// + this list of conditions and the following disclaimer. |
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
// + from this software without specific prior written permission. |
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
// + for non-commercial use (directly or indirectly) |
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
// + with our written permission |
// + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
// + clearly linked as origin |
// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
unsigned char EEPromArray[E2END+1] EEMEM; |
// -- Parametersatz aus EEPROM lesen --- |
// number [0..5] |
void ReadParameterSet(unsigned char number, unsigned char *buffer, unsigned char length) |
{ |
if (number > 5) number = 5; |
eeprom_read_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * number], length); |
} |
// -- Parametersatz ins EEPROM schreiben --- |
// number [0..5] |
void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length) |
{ |
if (number > 5) number = 5; |
eeprom_write_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * number], length); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], number); // diesen Parametersatz als aktuell merken |
} |
unsigned char GetActiveParamSetNumber(void) |
{ |
return(eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET])); |
} |
//############################################################################ |
//Hauptprogramm |
int main (void) |
//############################################################################ |
{ |
unsigned int timer; |
unsigned int timer2 = 0; |
DDRC = 0x01; // SCL |
PORTC = 0xff; // Pullup SDA |
DDRB = 0x1B; // LEDs und Druckoffset |
PORTB |= (1<<PB0); // LED_Rot |
DDRD = 0x3E; // Speaker & TXD & J3 J4 J5 |
DDRD |= (1<<PD7); // J7 |
PORTD = 0xF7; |
MCUSR &=~(1<<WDRF); |
WDTCSR |= (1<<WDCE)|(1<<WDE); |
WDTCSR = 0; |
beeptime = 2000; |
StickGier = 0; PPM_in[K_GAS] = 0;StickRoll = 0; StickNick = 0; |
ROT_OFF; |
Timer_Init(); |
UART_Init(); |
rc_sum_init(); |
ADC_Init(); |
i2c_init(); |
init_spi(); |
sei(); |
VersionInfo.Hauptversion = VERSION_HAUPTVERSION; |
VersionInfo.Nebenversion = VERSION_NEBENVERSION; |
VersionInfo.PCKompatibel = VERSION_KOMPATIBEL; |
printf("\n\rFlightControl V%d.%d ", VERSION_HAUPTVERSION, VERSION_NEBENVERSION); |
printf("\n\r=============================="); |
GRN_ON; |
if(eeprom_read_byte(&EEPromArray[EEPROM_ADR_VALID]) != 59) // seit V 0.60 |
{ |
printf("\n\rInit. EEPROM: Generiere Default-Parameter..."); |
DefaultKonstanten1(); |
for (unsigned char i=0;i<6;i++) |
{ |
if(i==2) DefaultKonstanten2(); |
WriteParameterSet(i, (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
} |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], 1); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_VALID], 59); |
} |
ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
printf("\n\rBenutze Parametersatz %d", GetActiveParamSetNumber()); |
if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
printf("\n\rAbgleich Luftdrucksensor.."); |
timer = SetDelay(2500); |
SucheLuftruckOffset(); |
while (!CheckDelay(timer)); |
printf("OK\n\r"); |
} |
SetNeutral(); |
ROT_OFF; |
beeptime = 2000; |
DebugIn.Analog[1] = 1000; |
DebugIn.Digital[0] = 0x55; |
printf("\n\rSteuerung: "); |
if (EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) printf("HeadingHold"); |
else printf("Neutral"); |
printf("\n\n\r"); |
LcdClear(); |
while (1) |
{ |
if (UpdateMotor) // ReglerIntervall |
{ |
UpdateMotor=0; |
MotorRegler(); |
SendMotorData(); |
ROT_OFF; |
if(PcZugriff) PcZugriff--; |
if(SenderOkay) SenderOkay--; |
if (UBat < EE_Parameter.UnterspannungsWarnung) |
{ |
beeptime = 2000; |
} |
if(!Timeout) |
{ |
i2c_init(); |
} |
else |
{ |
ROT_OFF; |
} |
} |
if(SIO_DEBUG) |
{ |
DatenUebertragung(); |
BearbeiteRxDaten(); |
} |
else BearbeiteRxDaten(); |
if(CheckDelay(timer2)) |
{ |
if(MotorenEin) PORTC ^= 0x10; else PORTC &= ~0x10; |
timer = SetDelay(500); |
} |
} |
return (1); |
} |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/main.h |
---|
0,0 → 1,95 |
#ifndef _MAIN_H |
#define _MAIN_H |
//Hier die Quarz Frequenz einstellen |
#if defined (__AVR_ATmega32__) |
#define SYSCLK 20000000L //Quarz Frequenz in Hz |
#endif |
#if defined (__AVR_ATmega644__) |
#define SYSCLK 20000000L //Quarz Frequenz in Hz |
//#define SYSCLK 16000000L //Quarz Frequenz in Hz |
#endif |
// neue Hardware |
#define ROT_OFF PORTB &=~0x01 |
#define ROT_ON PORTB |= 0x01 |
#define ROT_FLASH PORTB ^= 0x01 |
#define GRN_OFF PORTB &=~0x02 |
#define GRN_ON PORTB |= 0x02 |
#define GRN_FLASH PORTD ^= 0x02 |
//#ifndef F_CPU |
//#error ################## F_CPU nicht definiert oder ungültig ############# |
//#endif |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//#define ANZ_MITTELWERT 4 |
#define EEPROM_ADR_VALID 1 |
#define EEPROM_ADR_ACTIVE_SET 2 |
#define EEPROM_ADR_PARAM_BEGIN 100 |
#define CFG_HOEHENREGELUNG 0x01 |
#define CFG_HOEHEN_SCHALTER 0x02 |
#define CFG_HEADING_HOLD 0x04 |
#define CFG_KOMPASS_AKTIV 0x08 |
#define CFG_KOMPASS_FIX 0x10 |
#define CFG_GPS_AKTIV 0x20 |
//#define SYSCLK |
//extern unsigned long SYSCLK; |
extern volatile int i_Nick[20],i_Roll[20],DiffNick,DiffRoll; |
extern volatile unsigned char SenderOkay; |
extern unsigned char CosinusNickWinkel, CosinusRollWinkel; |
extern void ReadParameterSet (unsigned char number, unsigned char *buffer, unsigned char length); |
extern void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length); |
extern unsigned char GetActiveParamSetNumber(void); |
extern unsigned char EEPromArray[]; |
#include <stdlib.h> |
#include <string.h> |
#include <avr/io.h> |
#include <avr/pgmspace.h> |
#include <avr/interrupt.h> |
#include <avr/eeprom.h> |
#include <avr/boot.h> |
#include <avr/wdt.h> |
#include "old_macros.h" |
#include "_Settings.h" |
#include "printf_P.h" |
#include "compass.h" |
#include "timer0.h" |
#include "uart.h" |
#include "analog.h" |
#include "twimaster.h" |
#include "menu.h" |
#include "rc.h" |
#include "fc.h" |
#include "math.h" |
#include "gps.h" |
#include "math.h" |
#ifndef EEMEM |
#define EEMEM __attribute__ ((section (".eeprom"))) |
#endif |
#define DEBUG_DISPLAY_INTERVALL 123 // in ms |
#define DELAY_US(x) ((unsigned int)( (x) * 1e-6 * F_CPU )) |
#endif //_MAIN_H |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/makefile |
---|
0,0 → 1,392 |
#-------------------------------------------------------------------- |
# MCU name |
MCU = atmega644 |
F_CPU = 20000000 |
#------------------------------------------------------------------- |
HAUPT_VERSION = 0 |
NEBEN_VERSION = 60 |
VERSION_KOMPATIBEL = 4 # PC-Kompatibilität |
#------------------------------------------------------------------- |
ifeq ($(MCU), atmega32) |
# FUSE_SETTINGS= -u -U lfuse:w:0xff:m -U hfuse:w:0xcf:m |
HEX_NAME = MEGA32 |
endif |
ifeq ($(MCU), atmega644) |
FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
#FUSE_SETTINGS = -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
# -u bei neuen Controllern wieder einspielen |
HEX_NAME = MEGA644 |
endif |
ifeq ($(F_CPU), 16000000) |
QUARZ = 16MHZ |
endif |
ifeq ($(F_CPU), 20000000) |
QUARZ = 20MHZ |
endif |
# Output format. (can be srec, ihex, binary) |
FORMAT = ihex |
# Target file name (without extension). |
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION) |
# Optimization level, can be [0, 1, 2, 3, s]. 0 turns off optimization. |
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.) |
OPT = s |
########################################################################################################## |
# List C source files here. (C dependencies are automatically generated.) |
SRC = main.c uart.c printf_P.c timer0.c analog.c menu.c compass.c math.c |
SRC += twimaster.c rc.c fc.c GPS.c |
########################################################################################################## |
# List Assembler source files here. |
# Make them always end in a capital .S. Files ending in a lowercase .s |
# will not be considered source files but generated files (assembler |
# output from the compiler), and will be deleted upon "make clean"! |
# Even though the DOS/Win* filesystem matches both .s and .S the same, |
# it will preserve the spelling of the filenames, and gcc itself does |
# care about how the name is spelled on its command-line. |
ASRC = |
# List any extra directories to look for include files here. |
# Each directory must be seperated by a space. |
EXTRAINCDIRS = |
# Optional compiler flags. |
# -g: generate debugging information (for GDB, or for COFF conversion) |
# -O*: optimization level |
# -f...: tuning, see gcc manual and avr-libc documentation |
# -Wall...: warning level |
# -Wa,...: tell GCC to pass this to the assembler. |
# -ahlms: create assembler listing |
CFLAGS = -O$(OPT) \ |
-funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums \ |
-Wall -Wstrict-prototypes \ |
-mtiny-stack -mcall-prologues \ |
-Wa,-adhlns=$(<:.c=.lst) \ |
$(patsubst %,-I%,$(EXTRAINCDIRS)) |
# Set a "language standard" compiler flag. |
# Unremark just one line below to set the language standard to use. |
# gnu99 = C99 + GNU extensions. See GCC manual for more information. |
#CFLAGS += -std=c89 |
#CFLAGS += -std=gnu89 |
#CFLAGS += -std=c99 |
CFLAGS += -std=gnu99 |
CFLAGS += -DVERSION_HAUPTVERSION=$(HAUPT_VERSION) -DVERSION_NEBENVERSION=$(NEBEN_VERSION) -DVERSION_KOMPATIBEL=$(VERSION_KOMPATIBEL) |
# Optional assembler flags. |
# -Wa,...: tell GCC to pass this to the assembler. |
# -ahlms: create listing |
# -gstabs: have the assembler create line number information; note that |
# for use in COFF files, additional information about filenames |
# and function names needs to be present in the assembler source |
# files -- see avr-libc docs [FIXME: not yet described there] |
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs |
# Optional linker flags. |
# -Wl,...: tell GCC to pass this to linker. |
# -Map: create map file |
# --cref: add cross reference to map file |
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref |
# Additional libraries |
# Minimalistic printf version |
#LDFLAGS += -Wl,-u,vfprintf -lprintf_min |
# Floating point printf version (requires -lm below) |
#LDFLAGS += -Wl,-u,vfprintf -lprintf_flt |
# -lm = math library |
LDFLAGS += -lm |
##LDFLAGS += -T./linkerfile/avr5.x |
# Programming support using avrdude. Settings and variables. |
# Programming hardware: alf avr910 avrisp bascom bsd |
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500 |
# |
# Type: avrdude -c ? |
# to get a full listing. |
# |
#AVRDUDE_PROGRAMMER = stk200 |
AVRDUDE_PROGRAMMER = dt006 |
#AVRDUDE_PROGRAMMER = ponyser |
#falls Ponyser ausgewählt wird, muss sich unsere avrdude-Configdatei im Bin-Verzeichnis des Compilers befinden |
#AVRDUDE_PORT = com1 # programmer connected to serial device |
AVRDUDE_PORT = lpt1 # programmer connected to parallel port |
#AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex |
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex $(FUSE_SETTINGS) |
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep |
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) |
# Uncomment the following if you want avrdude's erase cycle counter. |
# Note that this counter needs to be initialized first using -Yn, |
# see avrdude manual. |
#AVRDUDE_ERASE += -y |
# Uncomment the following if you do /not/ wish a verification to be |
# performed after programming the device. |
AVRDUDE_FLAGS += -V |
# Increase verbosity level. Please use this when submitting bug |
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> |
# to submit bug reports. |
#AVRDUDE_FLAGS += -v -v |
# --------------------------------------------------------------------------- |
# Define directories, if needed. |
DIRAVR = c:/winavr |
DIRAVRBIN = $(DIRAVR)/bin |
DIRAVRUTILS = $(DIRAVR)/utils/bin |
DIRINC = . |
DIRLIB = $(DIRAVR)/avr/lib |
# Define programs and commands. |
SHELL = sh |
CC = avr-gcc |
OBJCOPY = avr-objcopy |
OBJDUMP = avr-objdump |
SIZE = avr-size |
# Programming support using avrdude. |
AVRDUDE = avrdude |
REMOVE = rm -f |
COPY = cp |
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex |
ELFSIZE = $(SIZE) -A $(TARGET).elf |
# Define Messages |
# English |
MSG_ERRORS_NONE = Errors: none |
MSG_BEGIN = -------- begin -------- |
MSG_END = -------- end -------- |
MSG_SIZE_BEFORE = Size before: |
MSG_SIZE_AFTER = Size after: |
MSG_COFF = Converting to AVR COFF: |
MSG_EXTENDED_COFF = Converting to AVR Extended COFF: |
MSG_FLASH = Creating load file for Flash: |
MSG_EEPROM = Creating load file for EEPROM: |
MSG_EXTENDED_LISTING = Creating Extended Listing: |
MSG_SYMBOL_TABLE = Creating Symbol Table: |
MSG_LINKING = Linking: |
MSG_COMPILING = Compiling: |
MSG_ASSEMBLING = Assembling: |
MSG_CLEANING = Cleaning project: |
# Define all object files. |
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o) |
# Define all listing files. |
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst) |
# Combine all necessary flags and optional flags. |
# Add target processor to flags. |
#ALL_CFLAGS = -mmcu=$(MCU) -DF_CPU=$(F_CPU) -I. $(CFLAGS) |
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) |
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) |
# Default target. |
all: begin gccversion sizebefore $(TARGET).elf $(TARGET).hex $(TARGET).eep \ |
$(TARGET).lss $(TARGET).sym sizeafter finished end |
# Eye candy. |
# AVR Studio 3.x does not check make's exit code but relies on |
# the following magic strings to be generated by the compile job. |
begin: |
@echo |
@echo $(MSG_BEGIN) |
finished: |
@echo $(MSG_ERRORS_NONE) |
end: |
@echo $(MSG_END) |
@echo |
# Display size of file. |
sizebefore: |
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi |
sizeafter: |
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi |
# Display compiler version information. |
gccversion : |
@$(CC) --version |
# Convert ELF to COFF for use in debugging / simulating in |
# AVR Studio or VMLAB. |
COFFCONVERT=$(OBJCOPY) --debugging \ |
--change-section-address .data-0x800000 \ |
--change-section-address .bss-0x800000 \ |
--change-section-address .noinit-0x800000 \ |
--change-section-address .eeprom-0x810000 |
coff: $(TARGET).elf |
@echo |
@echo $(MSG_COFF) $(TARGET).cof |
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof |
extcoff: $(TARGET).elf |
@echo |
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof |
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof |
# Program the device. |
program: $(TARGET).hex $(TARGET).eep |
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) |
# Create final output files (.hex, .eep) from ELF output file. |
%.hex: %.elf |
@echo |
@echo $(MSG_FLASH) $@ |
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ |
%.eep: %.elf |
@echo |
@echo $(MSG_EEPROM) $@ |
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ |
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@ |
# Create extended listing file from ELF output file. |
%.lss: %.elf |
@echo |
@echo $(MSG_EXTENDED_LISTING) $@ |
$(OBJDUMP) -h -S $< > $@ |
# Create a symbol table from ELF output file. |
%.sym: %.elf |
@echo |
@echo $(MSG_SYMBOL_TABLE) $@ |
avr-nm -n $< > $@ |
# Link: create ELF output file from object files. |
.SECONDARY : $(TARGET).elf |
.PRECIOUS : $(OBJ) |
%.elf: $(OBJ) |
@echo |
@echo $(MSG_LINKING) $@ |
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS) |
# Compile: create object files from C source files. |
%.o : %.c |
@echo |
@echo $(MSG_COMPILING) $< |
$(CC) -c $(ALL_CFLAGS) $< -o $@ |
# Compile: create assembler files from C source files. |
%.s : %.c |
$(CC) -S $(ALL_CFLAGS) $< -o $@ |
# Assemble: create object files from assembler source files. |
%.o : %.S |
@echo |
@echo $(MSG_ASSEMBLING) $< |
$(CC) -c $(ALL_ASFLAGS) $< -o $@ |
# Target: clean project. |
clean: begin clean_list finished end |
clean_list : |
@echo |
@echo $(MSG_CLEANING) |
# $(REMOVE) $(TARGET).hex |
$(REMOVE) $(TARGET).eep |
$(REMOVE) $(TARGET).obj |
$(REMOVE) $(TARGET).cof |
$(REMOVE) $(TARGET).elf |
$(REMOVE) $(TARGET).map |
$(REMOVE) $(TARGET).obj |
$(REMOVE) $(TARGET).a90 |
$(REMOVE) $(TARGET).sym |
$(REMOVE) $(TARGET).lnk |
$(REMOVE) $(TARGET).lss |
$(REMOVE) $(OBJ) |
$(REMOVE) $(LST) |
$(REMOVE) $(SRC:.c=.s) |
$(REMOVE) $(SRC:.c=.d) |
# Automatically generate C source code dependencies. |
# (Code originally taken from the GNU make user manual and modified |
# (See README.txt Credits).) |
# |
# Note that this will work with sh (bash) and sed that is shipped with WinAVR |
# (see the SHELL variable defined above). |
# This may not work with other shells or other seds. |
# |
%.d: %.c |
set -e; $(CC) -MM $(ALL_CFLAGS) $< \ |
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > $@; \ |
[ -s $@ ] || rm -f $@ |
# Remove the '-' if you want to see the dependency files generated. |
-include $(SRC:.c=.d) |
# Listing of phony targets. |
.PHONY : all begin finish end sizebefore sizeafter gccversion coff extcoff \ |
clean clean_list program |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/math.c |
---|
0,0 → 1,229 |
/* |
This program (files math.c and math.h) is free software; you can redistribute it and/or modify |
it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; |
either version 3 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License and GNU Lesser General Public License for more details. |
You should have received a copy of GNU General Public License (License_GPL.txt) and |
GNU Lesser General Public License (License_LGPL.txt) along with this program. |
If not, see <http://www.gnu.org/licenses/>. |
Please note: All the other files for the project "Mikrokopter" by H.Buss are under the license (license_buss.txt) published by www.mikrokopter.de |
*/ |
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
Peter Muehlenbrock |
Winkelfunktionen sin, cos und arctan in |
brute-force Art: Sehr Schnell, nicht sonderlich genau, aber ausreichend |
get_dist Funktion fuer Entfernungsermittlung |
Stand 12.10.2007 |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
*/ |
#include "main.h" |
// arctan Funktion: Eingabewert x,y Rueckgabe =arctan(x,y) in grad |
int arctan_i( signed int x, signed int y) |
{ |
short int change_xy = 0; |
signed int i; |
long signed int wert; |
int return_value; |
if ((abs(x)) > (abs(y))) // x,y Werte vertauschen damit arctan <45 grad bleibt |
{ |
change_xy = 1; |
i = x; |
x = y; |
y = i; |
} |
// Quadranten ermitteln |
// Wert durch lineare Interpolation ermitteln |
if ((y == 0) && (x == 0)) wert =1; // Division durch 0 nicht erlaubt |
else wert= abs(((long)x*1000)/((long)y)); |
if (wert <=268) //0...0.0,268 entsprechend 0..15 Grad |
{ |
return_value = (signed int)((wert*100)/(268-0)*(15-0)/100) +0; |
} |
else if (wert <=578) //0,268...0.0,568 entsprechend 15..30 Grad |
{ |
return_value = (signed int)((((wert-268)*100)/(578-268)*(30-15))/100) +15; |
} |
else //0,568...1 entsprechend 30..45 Grad |
{ |
return_value = (signed int)((((wert-578)*50)/(1000-578)*(45-30))/50) +30; |
} |
if (change_xy == 0) return_value = 90-return_value; //Quadrant 45..90 Grad |
if ((x >= 0) && (y <0)) return_value = - return_value; |
else if ((x < 0) && (y >= 0)) return_value = - return_value; |
return return_value; |
} |
// cosinus Funktion: Eingabewert Winkel in Grad, Rueckgabe =cos(winkel)*1000 |
signed int cos_i(signed int winkel) |
{ |
winkel = sin_i(90-winkel); |
return winkel; |
} |
const unsigned int pgm_sinus[91] PROGMEM = {0,17,35,52,70,87,105,122,139,156,174,191,208,225,242,259,276,292,309,326,342,358,375,391,407,423,438,454,469,485,500,515,530,545,559,574,588,602,616,629,643,656,669,682,695,707,719,731,743,755,766,777,788,799,809,819,829,839,848,857,866,875,883,891,899,906,914,921,927,934,940,946,951,956,961,966,970,974,978,982,985,988,990,993,995,996,998,999,999,1000,1000}; |
//von Nick666, Stand 28.9.2007 |
// sinus Funktion: Eingabewert Winkel in Grad, Rueckgabe =sin(winkel)*1000 |
signed int sin_i(signed int winkel) |
{ |
short int m,n; |
if (abs(winkel) >=360) winkel = winkel % 360; |
if (winkel < 0) |
{ |
m = -1; |
winkel = abs(winkel); |
} |
else m = +1; |
n =1; |
// Quadranten auswerten |
if ((winkel > 90 ) && (winkel <= 180)) winkel = 180 - winkel; |
else if ((winkel > 180 ) && (winkel <= 270)) |
{ |
winkel = winkel -180; |
n = -1; |
} |
else if ((winkel > 270) && (winkel <= 360)) |
{ |
winkel = 360 - winkel; |
n = -1; |
} |
// else //0 - 90 Grad |
winkel = pgm_read_word(&pgm_sinus[winkel]); |
return (winkel*m*n); |
} |
// Aus x,y und Winkel Distanz ermitteln |
long get_dist(signed int x, signed int y, signed int phi) |
{ |
long dist; |
if (abs(x) > abs(y) ) |
{ |
dist = (long) x; //Groesseren Wert wegen besserer Genauigkeit nehmen |
dist = abs((dist *1000) / (long) sin_i(phi)); |
} |
else |
{ |
dist = (long) y; |
dist = abs((dist *1000) / (long) cos_i(phi)); |
} |
return dist; |
} |
// noch mehr von Nick666 |
const uint8_t pgm_atan[270] PROGMEM = {0,1,2,3,5,6,7,8,9,10,11,12,13,15,16,17,18,19,20,21,22,23,24,25,26,27,27,28,29,30,31,32,33,33,34,35,36,37,37,38,39,39,40,41,41,42,43,43,44,44,45,46,46,47,47,48,48,49,49,50,50,51,51,52,52,52,53,53,54,54,54,55,55,56,56,56,57,57,57,58,58,58,59,59,59,60,60,60,60,61,61,61,61,62,62,62,62,63,63,63,63,64,64,64,64,65,65,65,65,65,66,66,66,66,66,67,67,67,67,67,67,68,68,68,68,68,68,69,69,69,69,69,69,69,70,70,70,70,70,70,70,70,71,71,71,71,71,71,71,71,72,72,72,72,72,72,72,72,72,73,73,73,73,73,73,73,73,73,73,74,74,74,74,74,74,74,74,74,74,74,74,75,75,75,75,75,75,75,75,75,75,75,75,75,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79}; |
// Arkustangens2 im Gradmaß |
signed int atan2_i(signed int x, signed int y) |
{ |
int i,angle; |
int8_t m; |
if (!x && !y) return 0; //atan2 = 0 für x und y = 0 |
if (y < 0) m=-1; |
else m=1; |
if (x==0) return (90*m); // atan2 = 90° für x = 0 |
i = abs(((float)y / x) * 50); // Berechne i für die Lookup table (Schrittweite atan(x) ist 0.02 -> *50) |
if (i<270) angle = pgm_read_byte(&pgm_atan[i]); // Lookup für 1° bis 79° |
else if (i>5750) angle = 90; // Grenzwert ist 90° |
else if (i>=1910) angle = 89; // 89° bis 80° über Wertebereiche |
else if (i>=1150) angle = 88; |
else if (i>=820) angle = 87; |
else if (i>=640) angle = 86; |
else if (i>=520) angle = 85; |
else if (i>=440) angle = 84; |
else if (i>=380) angle = 83; |
else if (i>=335) angle = 82; |
else if (i>=299) angle = 81; |
else angle = 80; // (i>=270) |
if (x > 0) return (angle*m); // Quadrant I und IV |
else if ((x < 0) && (y >= 0)) return ((angle*-1) + 180); // Quadrant II |
else return (angle - 180); // x < 0 && y < 0 Quadrant III |
} |
const float pgm_sinus_f [91] PROGMEM = {0.000,0.017,0.035,0.052,0.070,0.087,0.105,0.122,0.139,0.156,0.174,0.191,0.208,0.225,0.242,0.259,0.276,0.292,0.309,0.326,0.342,0.358,0.375,0.391,0.407,0.423,0.438,0.454,0.469,0.485,0.500,0.515,0.530,0.545,0.559,0.574,0.588,0.602,0.616,0.629,0.643,0.656,0.669,0.682,0.695,0.707,0.719,0.731,0.743,0.755,0.766,0.777,0.788,0.799,0.809,0.819,0.829,0.839,0.848,0.857,0.866,0.875,0.883,0.891,0.899,0.906,0.914,0.921,0.927,0.934,0.940,0.946,0.951,0.956,0.961,0.966,0.970,0.974,0.978,0.982,0.985,0.988,0.990,0.993,0.995,0.996,0.998,0.999,0.999,1.000,1.000}; |
inline float pgm_read_float(const float *addr) |
{ |
union |
{ |
uint16_t i[2]; // 2 16-bit-Worte |
float f; |
} u; |
u.i[0]=pgm_read_word((PGM_P)addr); |
u.i[1]=pgm_read_word((PGM_P)addr+2); |
return u.f; |
} |
// Kosinusfunktion im Gradmaß |
float cos_f(signed int winkel) |
{ |
return (sin_f(90-winkel)); |
} |
// Sinusfunktion im Gradmaß |
float sin_f(signed int winkel) |
{ |
short int m,n; |
float sinus; |
//winkel = winkel % 360; |
if (winkel < 0) |
{ |
m = -1; |
winkel = abs(winkel); |
} |
else m = +1; |
// Quadranten auswerten |
if ((winkel > 90 ) && (winkel <= 180)) {winkel = 180 - winkel; n = 1;} |
else if ((winkel > 180 ) && (winkel <= 270)) {winkel = winkel - 180; n = -1;} |
else if ((winkel > 270) && (winkel <= 360)) {winkel = 360 - winkel; n = -1;} |
else n = 1; //0 - 90 Grad |
sinus = pgm_read_float(&pgm_sinus_f[winkel]); |
return (sinus*m*n); |
} |
const uint8_t pgm_asin[201] PROGMEM = {0,0,1,1,1,1,2,2,2,3,3,3,3,4,4,4,5,5,5,5,6,6,6,7,7,7,7,8,8,8,9,9,9,9,10,10,10,11,11,11,12,12,12,12,13,13,13,14,14,14,14,15,15,15,16,16,16,17,17,17,17,18,18,18,19,19,19,20,20,20,20,21,21,21,22,22,22,23,23,23,24,24,24,25,25,25,25,26,26,26,27,27,27,28,28,28,29,29,29,30,30,30,31,31,31,32,32,32,33,33,33,34,34,34,35,35,35,36,36,37,37,37,38,38,38,39,39,39,40,40,41,41,41,42,42,42,43,43,44,44,44,45,45,46,46,46,47,47,48,48,49,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,62,62,63,64,64,65,66,66,67,68,68,69,70,71,72,73,74,75,76,77,79,80,82,84,90}; |
// Akurssinusfunktion im Gradmaß |
int8_t asin_i(signed int i) |
{ |
signed char m; |
if (i < 0) {m=-1;i=abs(i);} |
else m=1; |
return (pgm_read_byte(&pgm_asin[i]) * m); |
} |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/math.h |
---|
0,0 → 1,15 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Peter Muehlenbrock |
// Definitionen fuer Modul math |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
extern signed int sin_i(signed int winkel); |
extern signed int cos_i(signed int winkel); |
extern signed int arctan_i(signed int x, signed int y); |
extern long get_dist(signed int x, signed int y, signed int phi); |
extern signed int atan2_i(signed int x, signed int y); |
extern float cos_f(signed int winkel); |
extern float sin_f(signed int winkel); |
extern int8_t asin_i(signed int i); |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/menu.c |
---|
0,0 → 1,118 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
unsigned int TestInt = 0; |
#define ARRAYGROESSE 10 |
unsigned char Array[ARRAYGROESSE] = {1,2,3,4,5,6,7,8,9,10}; |
char DisplayBuff[80] = "Hallo Welt"; |
unsigned char DispPtr = 0; |
unsigned char RemoteTasten = 0; |
#define KEY1 0x01 |
#define KEY2 0x02 |
#define KEY3 0x04 |
#define KEY4 0x08 |
#define KEY5 0x10 |
void LcdClear(void) |
{ |
unsigned char i; |
for(i=0;i<80;i++) DisplayBuff[i] = ' '; |
} |
void Menu(void) |
{ |
static unsigned char MaxMenue = 10,MenuePunkt=0; |
if(RemoteTasten & KEY1) { if(MenuePunkt) MenuePunkt--; else MenuePunkt = MaxMenue; LcdClear(); } |
if(RemoteTasten & KEY2) { MenuePunkt++; LcdClear(); } |
if((RemoteTasten & KEY1) && (RemoteTasten & KEY2)) MenuePunkt = 0; |
LCD_printfxy(17,0,"[%i]",MenuePunkt); |
switch(MenuePunkt) |
{ |
case 0: |
LCD_printfxy(0,0,"++ MikroKopter ++"); |
// LCD_printfxy(0,1,"V%d.%d",VERSION_HAUPTVERSION, VERSION_NEBENVERSION); |
LCD_printfxy(0,2,"Setting: %d ",GetActiveParamSetNumber()); |
LCD_printfxy(0,3,"(c) Holger Buss"); |
// if(RemoteTasten & KEY3) TestInt--; |
// if(RemoteTasten & KEY4) TestInt++; |
break; |
case 1: |
if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
LCD_printfxy(0,0,"Hoehe: %5i",HoehenWert); |
LCD_printfxy(0,1,"SollHoehe: %5i",SollHoehe); |
LCD_printfxy(0,2,"Luftdruck: %5i",MessLuftdruck); |
LCD_printfxy(0,3,"Off : %5i",DruckOffsetSetting); |
} |
else |
{ |
LCD_printfxy(0,1,"Keine "); |
LCD_printfxy(0,2,"Höhenregelung"); |
} |
break; |
case 2: |
LCD_printfxy(0,0,"akt. Lage"); |
LCD_printfxy(0,1,"Nick: %5i",IntegralNick/1024); |
LCD_printfxy(0,2,"Roll: %5i",IntegralRoll/1024); |
LCD_printfxy(0,3,"Kompass: %5i",KompassValue); |
break; |
case 3: |
LCD_printfxy(0,0,"K1:%4i K2:%4i ",PPM_in[1],PPM_in[2]); |
LCD_printfxy(0,1,"K3:%4i K4:%4i ",PPM_in[3],PPM_in[4]); |
LCD_printfxy(0,2,"K5:%4i K6:%4i ",PPM_in[5],PPM_in[6]); |
LCD_printfxy(0,3,"K7:%4i Kanäle ",PPM_in[7]); |
break; |
case 4: |
LCD_printfxy(0,0,"Ni:%4i Ro:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_NICK]],PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]); |
LCD_printfxy(0,1,"Gs:%4i Gi:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_GAS]],PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]); |
LCD_printfxy(0,2,"P1:%4i P2:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]],PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]]); |
LCD_printfxy(0,3,"P3:%4i Kanäle ",PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]]); |
break; |
case 5: |
LCD_printfxy(0,0,"Gyro - Sensor"); |
LCD_printfxy(0,1,"Nick %4i (%3i)",AccumulateNick / MessanzahlNick, AdNeutralNick); |
LCD_printfxy(0,2,"Roll %4i (%3i)",AccumulateRoll / MessanzahlRoll, AdNeutralRoll); |
LCD_printfxy(0,3,"Gier %4i (%3i)",AccumulateGier / MessanzahlGier, AdNeutralGier); |
break; |
case 6: |
LCD_printfxy(0,0,"ACC - Sensor"); |
LCD_printfxy(0,1,"Nick %4i (%3i)",accumulate_AccNick / messanzahl_AccNick,NeutralAccX); |
LCD_printfxy(0,2,"Roll %4i (%3i)",accumulate_AccRoll / messanzahl_AccRoll,NeutralAccY); |
LCD_printfxy(0,3,"Hoch %4i (%3i)",Aktuell_az/*accumulate_AccHoch / messanzahl_AccHoch*/,(int)NeutralAccZ); |
break; |
case 7: |
LCD_printfxy(0,1,"Spannung: %5i",UBat); |
LCD_printfxy(0,2,"Empf.Pegel:%5i",SenderOkay); |
break; |
case 8: |
LCD_printfxy(0,0,"Kompass "); |
LCD_printfxy(0,1,"Richtung: %5i",KompassRichtung); |
LCD_printfxy(0,2,"Messwert: %5i",KompassValue); |
LCD_printfxy(0,3,"Start: %5i",KompassStartwert); |
break; |
case 9: |
LCD_printfxy(0,0,"Poti1: %3i",Poti1); |
LCD_printfxy(0,1,"Poti2: %3i",Poti2); |
LCD_printfxy(0,2,"Poti3: %3i",Poti3); |
LCD_printfxy(0,3,"Poti4: %3i",Poti4); |
break; |
case 10: |
LCD_printfxy(0,0,"Servo " ); |
LCD_printfxy(0,1,"Setpoint %3i",Parameter_ServoNickControl); |
LCD_printfxy(0,2,"Stellung: %3i",ServoValue); |
LCD_printfxy(0,3,"Range:%3i-%3i",EE_Parameter.ServoNickMin,EE_Parameter.ServoNickMax); |
break; |
default: MaxMenue = MenuePunkt - 1; |
MenuePunkt = 0; |
break; |
} |
RemoteTasten = 0; |
} |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/menu.h |
---|
0,0 → 1,7 |
void LcdClear(void); |
extern void Menu(void); |
extern char DisplayBuff[80]; |
extern unsigned char DispPtr; |
unsigned char RemoteTasten; |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/old_macros.h |
---|
0,0 → 1,47 |
/* |
For backwards compatibility only. |
Ingo Busker ingo@mikrocontroller.com |
*/ |
#ifndef cbi |
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) |
#endif |
#ifndef sbi |
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit)) |
#endif |
#ifndef inb |
#define inb(sfr) _SFR_BYTE(sfr) |
#endif |
#ifndef outb |
#define outb(sfr, val) (_SFR_BYTE(sfr) = (val)) |
#endif |
#ifndef inw |
#define inw(sfr) _SFR_WORD(sfr) |
#endif |
#ifndef outw |
#define outw(sfr, val) (_SFR_WORD(sfr) = (val)) |
#endif |
#ifndef outp |
#define outp(val, sfr) outb(sfr, val) |
#endif |
#ifndef inp |
#define inp(sfr) inb(sfr) |
#endif |
#ifndef BV |
#define BV(bit) _BV(bit) |
#endif |
#ifndef PRG_RDB |
#define PRG_RDB pgm_read_byte |
#endif |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/printf_P.c |
---|
0,0 → 1,480 |
// Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist nicht von der Lizenz für den MikroKopter-Teil unterstellt |
/* |
Copyright (C) 1993 Free Software Foundation |
This file is part of the GNU IO Library. This library is free |
software; you can redistribute it and/or modify it under the |
terms of the GNU General Public License as published by the |
Free Software Foundation; either version 2, or (at your option) |
any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License for more details. |
You should have received a copy of the GNU General Public License |
along with this library; see the file COPYING. If not, write to the Free |
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
As a special exception, if you link this library with files |
compiled with a GNU compiler to produce an executable, this does not cause |
the resulting executable to be covered by the GNU General Public License. |
This exception does not however invalidate any other reasons why |
the executable file might be covered by the GNU General Public License. */ |
/* |
* Copyright (c) 1990 Regents of the University of California. |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* 1. Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* 2. Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* 3. [rescinded 22 July 1999] |
* 4. Neither the name of the University nor the names of its contributors |
* may be used to endorse or promote products derived from this software |
* without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
* SUCH DAMAGE. |
*/ |
/****************************************************************************** |
This file is a patched version of printf called _printf_P |
It is made to work with avr-gcc for Atmel AVR MCUs. |
There are some differences from standard printf: |
1. There is no floating point support (with fp the code is about 8K!) |
2. Return type is void |
3. Format string must be in program memory (by using macro printf this is |
done automaticaly) |
4. %n is not implemented (just remove the comment around it if you need it) |
5. If LIGHTPRINTF is defined, the code is about 550 bytes smaller and the |
folowing specifiers are disabled : |
space # * . - + p s o O |
6. A function void uart_sendchar(char c) is used for output. The UART must |
be initialized before using printf. |
Alexander Popov |
sasho@vip.orbitel.bg |
******************************************************************************/ |
/* |
* Actual printf innards. |
* |
* This code is large and complicated... |
*/ |
#include <string.h> |
#ifdef __STDC__ |
#include <stdarg.h> |
#else |
#include <varargs.h> |
#endif |
#include "main.h" |
//#define LIGHTPRINTF |
char PrintZiel; |
char Putchar(char zeichen) |
{ |
if(PrintZiel == OUT_LCD) { DisplayBuff[DispPtr++] = zeichen; return(1);} |
else return(uart_putchar(zeichen)); |
} |
void PRINT(const char * ptr, unsigned int len) |
{ |
for(;len;len--) Putchar(*ptr++); |
} |
void PRINTP(const char * ptr, unsigned int len) |
{ |
for(;len;len--) Putchar(pgm_read_byte(ptr++)); |
} |
void PAD_SP(signed char howmany) |
{ |
for(;howmany>0;howmany--) Putchar(' '); |
} |
void PAD_0(signed char howmany) |
{ |
for(;howmany>0;howmany--) Putchar('0'); |
} |
#define BUF 40 |
/* |
* Macros for converting digits to letters and vice versa |
*/ |
#define to_digit(c) ((c) - '0') |
#define is_digit(c) ((c)<='9' && (c)>='0') |
#define to_char(n) ((n) + '0') |
/* |
* Flags used during conversion. |
*/ |
#define LONGINT 0x01 /* long integer */ |
#define LONGDBL 0x02 /* long double; unimplemented */ |
#define SHORTINT 0x04 /* short integer */ |
#define ALT 0x08 /* alternate form */ |
#define LADJUST 0x10 /* left adjustment */ |
#define ZEROPAD 0x20 /* zero (as opposed to blank) pad */ |
#define HEXPREFIX 0x40 /* add 0x or 0X prefix */ |
void _printf_P (char ziel,char const *fmt0, ...) /* Works with string from FLASH */ |
{ |
va_list ap; |
register const char *fmt; /* format string */ |
register char ch; /* character from fmt */ |
register int n; /* handy integer (short term usage) */ |
register char *cp; /* handy char pointer (short term usage) */ |
const char *fmark; /* for remembering a place in fmt */ |
register unsigned char flags; /* flags as above */ |
signed char width; /* width from format (%8d), or 0 */ |
signed char prec; /* precision from format (%.3d), or -1 */ |
char sign; /* sign prefix (' ', '+', '-', or \0) */ |
unsigned long _ulong=0; /* integer arguments %[diouxX] */ |
#define OCT 8 |
#define DEC 10 |
#define HEX 16 |
unsigned char base; /* base for [diouxX] conversion */ |
signed char dprec; /* a copy of prec if [diouxX], 0 otherwise */ |
signed char dpad; /* extra 0 padding needed for integers */ |
signed char fieldsz; /* field size expanded by sign, dpad etc */ |
/* The initialization of 'size' is to suppress a warning that |
'size' might be used unitialized. It seems gcc can't |
quite grok this spaghetti code ... */ |
signed char size = 0; /* size of converted field or string */ |
char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */ |
char ox[2]; /* space for 0x hex-prefix */ |
PrintZiel = ziel; // bestimmt, LCD oder UART |
va_start(ap, fmt0); |
fmt = fmt0; |
/* |
* Scan the format for conversions (`%' character). |
*/ |
for (;;) { |
for (fmark = fmt; (ch = pgm_read_byte(fmt)) != '\0' && ch != '%'; fmt++) |
/* void */; |
if ((n = fmt - fmark) != 0) { |
PRINTP(fmark, n); |
} |
if (ch == '\0') |
goto done; |
fmt++; /* skip over '%' */ |
flags = 0; |
dprec = 0; |
width = 0; |
prec = -1; |
sign = '\0'; |
rflag: ch = PRG_RDB(fmt++); |
reswitch: |
#ifdef LIGHTPRINTF |
if (ch=='o' || ch=='u' || (ch|0x20)=='x') { |
#else |
if (ch=='u' || (ch|0x20)=='x') { |
#endif |
if (flags&LONGINT) { |
_ulong=va_arg(ap, unsigned long); |
} else { |
register unsigned int _d; |
_d=va_arg(ap, unsigned int); |
_ulong = flags&SHORTINT ? (unsigned long)(unsigned short)_d : (unsigned long)_d; |
} |
} |
#ifndef LIGHTPRINTF |
if(ch==' ') { |
/* |
* ``If the space and + flags both appear, the space |
* flag will be ignored.'' |
* -- ANSI X3J11 |
*/ |
if (!sign) |
sign = ' '; |
goto rflag; |
} else if (ch=='#') { |
flags |= ALT; |
goto rflag; |
} else if (ch=='*'||ch=='-') { |
if (ch=='*') { |
/* |
* ``A negative field width argument is taken as a |
* - flag followed by a positive field width.'' |
* -- ANSI X3J11 |
* They don't exclude field widths read from args. |
*/ |
if ((width = va_arg(ap, int)) >= 0) |
goto rflag; |
width = -width; |
} |
flags |= LADJUST; |
flags &= ~ZEROPAD; /* '-' disables '0' */ |
goto rflag; |
} else if (ch=='+') { |
sign = '+'; |
goto rflag; |
} else if (ch=='.') { |
if ((ch = PRG_RDB(fmt++)) == '*') { |
n = va_arg(ap, int); |
prec = n < 0 ? -1 : n; |
goto rflag; |
} |
n = 0; |
while (is_digit(ch)) { |
n = n*10 + to_digit(ch); |
ch = PRG_RDB(fmt++); |
} |
prec = n < 0 ? -1 : n; |
goto reswitch; |
} else |
#endif /* LIGHTPRINTF */ |
if (ch=='0') { |
/* |
* ``Note that 0 is taken as a flag, not as the |
* beginning of a field width.'' |
* -- ANSI X3J11 |
*/ |
if (!(flags & LADJUST)) |
flags |= ZEROPAD; /* '-' disables '0' */ |
goto rflag; |
} else if (ch>='1' && ch<='9') { |
n = 0; |
do { |
n = 10 * n + to_digit(ch); |
ch = PRG_RDB(fmt++); |
} while (is_digit(ch)); |
width = n; |
goto reswitch; |
} else if (ch=='h') { |
flags |= SHORTINT; |
goto rflag; |
} else if (ch=='l') { |
flags |= LONGINT; |
goto rflag; |
} else if (ch=='c') { |
*(cp = buf) = va_arg(ap, int); |
size = 1; |
sign = '\0'; |
} else if (ch=='D'||ch=='d'||ch=='i') { |
if(ch=='D') |
flags |= LONGINT; |
if (flags&LONGINT) { |
_ulong=va_arg(ap, long); |
} else { |
register int _d; |
_d=va_arg(ap, int); |
_ulong = flags&SHORTINT ? (long)(short)_d : (long)_d; |
} |
if ((long)_ulong < 0) { |
_ulong = -_ulong; |
sign = '-'; |
} |
base = DEC; |
goto number; |
} else |
/* |
if (ch=='n') { |
if (flags & LONGINT) |
*va_arg(ap, long *) = ret; |
else if (flags & SHORTINT) |
*va_arg(ap, short *) = ret; |
else |
*va_arg(ap, int *) = ret; |
continue; // no output |
} else |
*/ |
#ifndef LIGHTPRINTF |
if (ch=='O'||ch=='o') { |
if (ch=='O') |
flags |= LONGINT; |
base = OCT; |
goto nosign; |
} else if (ch=='p') { |
/* |
* ``The argument shall be a pointer to void. The |
* value of the pointer is converted to a sequence |
* of printable characters, in an implementation- |
* defined manner.'' |
* -- ANSI X3J11 |
*/ |
/* NOSTRICT */ |
_ulong = (unsigned int)va_arg(ap, void *); |
base = HEX; |
flags |= HEXPREFIX; |
ch = 'x'; |
goto nosign; |
} else if (ch=='s') { // print a string from RAM |
if ((cp = va_arg(ap, char *)) == NULL) { |
cp=buf; |
cp[0] = '('; |
cp[1] = 'n'; |
cp[2] = 'u'; |
cp[4] = cp[3] = 'l'; |
cp[5] = ')'; |
cp[6] = '\0'; |
} |
if (prec >= 0) { |
/* |
* can't use strlen; can only look for the |
* NUL in the first `prec' characters, and |
* strlen() will go further. |
*/ |
char *p = (char*)memchr(cp, 0, prec); |
if (p != NULL) { |
size = p - cp; |
if (size > prec) |
size = prec; |
} else |
size = prec; |
} else |
size = strlen(cp); |
sign = '\0'; |
} else |
#endif /* LIGHTPRINTF */ |
if(ch=='U'||ch=='u') { |
if (ch=='U') |
flags |= LONGINT; |
base = DEC; |
goto nosign; |
} else if (ch=='X'||ch=='x') { |
base = HEX; |
/* leading 0x/X only if non-zero */ |
if (flags & ALT && _ulong != 0) |
flags |= HEXPREFIX; |
/* unsigned conversions */ |
nosign: sign = '\0'; |
/* |
* ``... diouXx conversions ... if a precision is |
* specified, the 0 flag will be ignored.'' |
* -- ANSI X3J11 |
*/ |
number: if ((dprec = prec) >= 0) |
flags &= ~ZEROPAD; |
/* |
* ``The result of converting a zero value with an |
* explicit precision of zero is no characters.'' |
* -- ANSI X3J11 |
*/ |
cp = buf + BUF; |
if (_ulong != 0 || prec != 0) { |
register unsigned char _d,notlastdigit; |
do { |
notlastdigit=(_ulong>=base); |
_d = _ulong % base; |
if (_d<10) { |
_d+='0'; |
} else { |
_d+='a'-10; |
if (ch=='X') _d&=~0x20; |
} |
*--cp=_d; |
_ulong /= base; |
} while (notlastdigit); |
#ifndef LIGHTPRINTF |
// handle octal leading 0 |
if (base==OCT && flags & ALT && *cp != '0') |
*--cp = '0'; |
#endif |
} |
size = buf + BUF - cp; |
} else { //default |
/* "%?" prints ?, unless ? is NUL */ |
if (ch == '\0') |
goto done; |
/* pretend it was %c with argument ch */ |
cp = buf; |
*cp = ch; |
size = 1; |
sign = '\0'; |
} |
/* |
* All reasonable formats wind up here. At this point, |
* `cp' points to a string which (if not flags&LADJUST) |
* should be padded out to `width' places. If |
* flags&ZEROPAD, it should first be prefixed by any |
* sign or other prefix; otherwise, it should be blank |
* padded before the prefix is emitted. After any |
* left-hand padding and prefixing, emit zeroes |
* required by a decimal [diouxX] precision, then print |
* the string proper, then emit zeroes required by any |
* leftover floating precision; finally, if LADJUST, |
* pad with blanks. |
*/ |
/* |
* compute actual size, so we know how much to pad. |
*/ |
fieldsz = size; |
dpad = dprec - size; |
if (dpad < 0) |
dpad = 0; |
if (sign) |
fieldsz++; |
else if (flags & HEXPREFIX) |
fieldsz += 2; |
fieldsz += dpad; |
/* right-adjusting blank padding */ |
if ((flags & (LADJUST|ZEROPAD)) == 0) |
PAD_SP(width - fieldsz); |
/* prefix */ |
if (sign) { |
PRINT(&sign, 1); |
} else if (flags & HEXPREFIX) { |
ox[0] = '0'; |
ox[1] = ch; |
PRINT(ox, 2); |
} |
/* right-adjusting zero padding */ |
if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD) |
PAD_0(width - fieldsz); |
/* leading zeroes from decimal precision */ |
PAD_0(dpad); |
/* the string or number proper */ |
PRINT(cp, size); |
/* left-adjusting padding (always blank) */ |
if (flags & LADJUST) |
PAD_SP(width - fieldsz); |
} |
done: |
va_end(ap); |
} |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/printf_P.h |
---|
0,0 → 1,19 |
#ifndef _PRINTF_P_H_ |
#define _PRINTF_P_H_ |
#include <avr/pgmspace.h> |
#define OUT_V24 0 |
#define OUT_LCD 1 |
extern void _printf_P (char, char const *fmt0, ...); |
extern char PrintZiel; |
#define printf_P(format, args...) _printf_P(OUT_V24,format , ## args) |
#define printf(format, args...) _printf_P(OUT_V24,PSTR(format) , ## args) |
#define LCD_printfxy(x,y,format, args...) { DispPtr = y * 20 + x; _printf_P(OUT_LCD,PSTR(format) , ## args);} |
#define LCD_printf(format, args...) { _printf_P(OUT_LCD,PSTR(format) , ## args);} |
#endif |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/rc.c |
---|
0,0 → 1,85 |
/*####################################################################################### |
Decodieren eines RC Summen Signals |
#######################################################################################*/ |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "rc.h" |
#include "main.h" |
volatile int PPM_in[11]; |
volatile int PPM_diff[11]; // das diffenzierte Stick-Signal |
volatile unsigned char NewPpmData = 1; |
//############################################################################ |
//zum decodieren des PPM-Signals wird Timer1 mit seiner Input |
//Capture Funktion benutzt: |
void rc_sum_init (void) |
//############################################################################ |
{ |
TCCR1B=(1<<CS11)|(1<<CS10)|(1<<ICES1)|(1<<ICNC1);//|(1 << WGM12); //timer1 prescale 64 |
// PWM |
//TCCR1A = (1 << COM1B1) | (1 << WGM11) | (1 << WGM10); |
//TCCR1B |= (1 << WGM12); |
//OCR1B = 55; |
TIMSK1 |= _BV(ICIE1); |
AdNeutralGier = 0; |
AdNeutralRoll = 0; |
AdNeutralNick = 0; |
return; |
} |
//############################################################################ |
//Diese Routine startet und inizialisiert den Timer für RC |
SIGNAL(SIG_INPUT_CAPTURE1) |
//############################################################################ |
{ |
static unsigned int AltICR=0; |
signed int signal = 0; |
static int index; |
signal = (unsigned int) ICR1 - AltICR; |
AltICR = ICR1; |
//Syncronisationspause? |
if ((signal > 1500) && (signal < 8000)) |
{ |
index = 1; |
NewPpmData = 0; // Null bedeutet: Neue Daten |
// OCR2A = Poti2/2 + 80; |
} |
else |
{ |
if(index < 10) |
{ |
if((signal > 250) && (signal < 687)) |
{ |
signal -= 466; |
// Stabiles Signal |
if(abs(signal - PPM_in[index]) < 6) { if(SenderOkay < 200) SenderOkay += 10;} |
signal = (3 * (PPM_in[index]) + signal) / 4; |
//373 entspricht ca. 1.5ms also Mittelstellung |
PPM_diff[index] = signal - PPM_in[index]; |
PPM_in[index] = signal; |
} |
index++; |
/* if(index == 5) PORTD |= 0x20; else PORTD &= ~0x20; // Servosignal an J3 anlegen |
if(index == 6) PORTD |= 0x10; else PORTD &= ~0x10; // Servosignal an J4 anlegen |
if(index == 7) PORTD |= 0x08; else PORTD &= ~0x08; // Servosignal an J5 anlegen */ |
} |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/rc.h |
---|
0,0 → 1,29 |
/*####################################################################################### |
Derkodieren eines RC Summen Signals |
#######################################################################################*/ |
#ifndef _RC_H |
#define _RC_H |
#if defined (__AVR_ATmega32__) |
#define TIMER_TEILER CK64 |
#define TIMER_RELOAD_VALUE 250 |
#endif |
#if defined (__AVR_ATmega644__) |
//#define TIMER_TEILER CK64 |
#define TIMER_RELOAD_VALUE 250 |
//#define TIMER_TEILER CK256 // bei 20MHz |
//#define TIMER_RELOAD_VALUE -78 // bei 20MHz |
#endif |
#define GAS PPM_in[2] |
extern void rc_sum_init (void); |
extern volatile int PPM_in[11]; |
extern volatile int PPM_diff[11]; // das diffenzierte Stick-Signal |
extern volatile unsigned char NewPpmData; |
#endif //_RC_H |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/timer0.c |
---|
0,0 → 1,154 |
#include "main.h" |
volatile unsigned int CountMilliseconds = 0; |
volatile static unsigned int tim_main; |
volatile unsigned char UpdateMotor = 0; |
volatile unsigned int beeptime = 0; |
volatile unsigned int cntKompass = 0; |
int ServoValue = 0; |
/*Salvo 8.9.2007 |
volatile uint8_t Kompass_Neuer_Wert= 0; |
volatile unsigned int Kompass_Value_Old = 0; |
// Salvo End |
//Salvo 21.9.2007 |
short unsigned int Kompass_present= 0; //>0 bedeutet dass der Kompass vorhanden ist |
// Salvo End */ |
enum { |
STOP = 0, |
CK = 1, |
CK8 = 2, |
CK64 = 3, |
CK256 = 4, |
CK1024 = 5, |
T0_FALLING_EDGE = 6, |
T0_RISING_EDGE = 7 |
}; |
// Aenderungen von Peter Muehlenbrock ("Salvo") Stand 21.9.2007 |
/* |
Driftkompensation fuer Gyros verbessert |
Linearsensor mit fixem Neutralwert |
Ersatzkompass abgeleitet aus Magnetkompass und Giergyro fuer nahezu neigungsubhaengige Kompassfunktion |
*/ |
SIGNAL (SIG_OVERFLOW0) // 8kHz |
{ |
static unsigned char cnt_1ms = 1,cnt = 0; |
// TCNT0 -= 250;//TIMER_RELOAD_VALUE; |
if(!cnt--) |
{ |
// if (Kompass_present > 0) Kompass_present--; //Runterzaehlen. Wenn 0 ist der Kompass nicht vorhanden |
cnt = 9; |
cnt_1ms++; |
cnt_1ms %= 2; |
if(!cnt_1ms) UpdateMotor = 1; |
CountMilliseconds++; |
if(Timeout) Timeout--; |
} |
if(beeptime > 1) |
{ |
beeptime--; |
PORTD |= (1<<PD2); |
} |
else |
PORTD &= ~(1<<PD2); |
if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV) |
{ |
MM3_timer0(); // Kompass auslesen |
if (!cntKompass--) // Aufruf mit 25 Hz |
{ |
if (MM3_heading() > 0) { KompassValue = 360-MM3_heading();} |
if (MM3_heading() < 0 ) { KompassValue = MM3_heading()*-1;} |
KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360)- 180; |
cntKompass = 320; |
} |
} |
} |
void Timer_Init(void) |
{ |
tim_main = SetDelay(10); |
TCCR0B = CK8; |
TCCR0A = (1<<COM0A1)|(1<<COM0B1)|3;//fast PWM |
OCR0A = 0; |
OCR0B = 120; |
TCNT0 = -TIMER_RELOAD_VALUE; // reload |
//OCR1 = 0x00; |
TCCR2A=(1<<COM2A1)|(1<<COM2A0)|3; |
TCCR2B=(0<<CS20)|(1<<CS21)|(1<<CS22); |
// TIMSK2 |= _BV(TOIE2); |
TIMSK2 |= _BV(OCIE2A); |
TIMSK0 |= _BV(TOIE0); |
OCR2A = 10; |
TCNT2 = 0; |
} |
// ----------------------------------------------------------------------- |
unsigned int SetDelay (unsigned int t) |
{ |
// TIMSK0 &= ~_BV(TOIE0); |
return(CountMilliseconds + t + 1); |
// TIMSK0 |= _BV(TOIE0); |
} |
// ----------------------------------------------------------------------- |
char CheckDelay(unsigned int t) |
{ |
// TIMSK0 &= ~_BV(TOIE0); |
return(((t - CountMilliseconds) & 0x8000) >> 9); |
// TIMSK0 |= _BV(TOIE0); |
} |
// ----------------------------------------------------------------------- |
void Delay_ms(unsigned int w) |
{ |
unsigned int akt; |
akt = SetDelay(w); |
while (!CheckDelay(akt)); |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Servo ansteuern |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(SIG_OUTPUT_COMPARE2A) |
{ |
static unsigned char timer = 10; |
if(!timer--) |
{ |
TCCR2A=(1<<COM2A1)|(0<<COM2A0)|3; |
ServoValue = Parameter_ServoNickControl; |
if(EE_Parameter.ServoNickCompInvert & 0x01) ServoValue += ((long) EE_Parameter.ServoNickComp * (IntegralNick / 128)) / 512; |
else ServoValue -= ((long) EE_Parameter.ServoNickComp * (IntegralNick / 128)) / 512; |
if(ServoValue < EE_Parameter.ServoNickMin) ServoValue = EE_Parameter.ServoNickMin; |
else if(ServoValue > EE_Parameter.ServoNickMax) ServoValue = EE_Parameter.ServoNickMax; |
//DebugOut.Analog[10] = ServoValue; |
OCR2A = ServoValue;// + 75; |
timer = EE_Parameter.ServoNickRefresh; |
} |
else |
{ |
TCCR2A =3; |
PORTD&=~0x80; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/timer0.h |
---|
0,0 → 1,19 |
#define TIMER_TEILER CK8 |
#define TIMER_RELOAD_VALUE 250 |
// Salvo Kompassoffset 31.8.2007 *********** |
//#define KOMPASS_OFFSET 135 // Winkel zwischen Nordachse Kopter und Nordachse Kompass |
// Salvo End |
void Timer_Init(void); |
void Delay_ms(unsigned int); |
unsigned int SetDelay (unsigned int t); |
char CheckDelay (unsigned int t); |
extern volatile unsigned int CountMilliseconds; |
extern volatile unsigned char UpdateMotor; |
extern volatile unsigned int beeptime; |
extern volatile unsigned int cntKompass; |
extern int ServoValue; |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/twimaster.c |
---|
0,0 → 1,131 |
/*############################################################################ |
############################################################################*/ |
#include "main.h" |
unsigned char twi_state = 0; |
unsigned char motor = 0; |
unsigned char motorread = 0; |
unsigned char motor_rx[8]; |
//############################################################################ |
//Initzialisieren der I2C (TWI) Schnittstelle |
void i2c_init(void) |
//############################################################################ |
{ |
TWSR = 0; |
TWBR = ((SYSCLK/SCL_CLOCK)-16)/2; |
} |
//############################################################################ |
//Start I2C |
char i2c_start(void) |
//############################################################################ |
{ |
TWCR = (1<<TWSTA) | (1<<TWEN) | (1<<TWINT) | (1<<TWIE); |
return(0); |
} |
//############################################################################ |
//Start I2C |
void i2c_stop(void) |
//############################################################################ |
{ |
TWCR = (1<<TWEN) | (1<<TWSTO) | (1<<TWINT); |
} |
//############################################################################ |
//Start I2C |
char i2c_write_byte(char byte) |
//############################################################################ |
{ |
TWSR = 0x00; |
TWDR = byte; |
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWIE); |
return(0); |
} |
//############################################################################ |
//Start I2C |
SIGNAL (TWI_vect) |
//############################################################################ |
{ |
switch (twi_state++) |
{ |
case 0: |
i2c_write_byte(0x52+(motor*2)); |
break; |
case 1: |
switch(motor++) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 2: |
i2c_stop(); |
if (motor<4) twi_state = 0; |
else motor = 0; |
i2c_start(); |
break; |
//Liest Daten von Motor |
case 3: |
i2c_write_byte(0x53+(motorread*2)); |
break; |
case 4: |
switch(motorread) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 5: //1 Byte vom Motor lesen |
motor_rx[motorread] = TWDR; |
case 6: |
switch(motorread) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 7: //2 Byte vom Motor lesen |
motor_rx[motorread+4] = TWDR; |
motorread++; |
if (motorread>3) motorread=0; |
i2c_stop(); |
twi_state = 0; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/twimaster.h |
---|
0,0 → 1,32 |
/*############################################################################ |
############################################################################*/ |
#ifndef _I2C_MASTER_H |
#define _I2C_MASTER_H |
//############################################################################ |
// I2C Konstanten |
#define SCL_CLOCK 200000L |
#define I2C_TIMEOUT 30000 |
#define I2C_START 0x08 |
#define I2C_REPEATED_START 0x10 |
#define I2C_TX_SLA_ACK 0x18 |
#define I2C_TX_DATA_ACK 0x28 |
#define I2C_RX_SLA_ACK 0x40 |
#define I2C_RX_DATA_ACK 0x50 |
//############################################################################ |
extern unsigned char twi_state; |
extern unsigned char motor; |
extern unsigned char motorread; |
extern unsigned char motor_rx[8]; |
void i2c_init (void); // I2C initialisieren |
char i2c_start (void); // Start I2C |
void i2c_stop (void); // Stop I2C |
char i2c_write_byte (char byte); // 1 Byte schreiben |
#endif |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/uart.c |
---|
0,0 → 1,330 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
#include "uart.h" |
unsigned char DebugGetAnforderung = 0,DebugDisplayAnforderung = 0,DebugDataAnforderung = 0,GetVersionAnforderung = 0; |
unsigned volatile char SioTmp = 0; |
unsigned volatile char SendeBuffer[MAX_SENDE_BUFF]; |
unsigned volatile char RxdBuffer[MAX_EMPFANGS_BUFF]; |
unsigned volatile char NMEABuffer[MAX_EMPFANGS_BUFF]; |
unsigned volatile char NeuerDatensatzEmpfangen = 0; |
unsigned volatile char NeueKoordinateEmpfangen = 0; |
unsigned volatile char UebertragungAbgeschlossen = 1; |
unsigned volatile char CntCrcError = 0; |
unsigned volatile char AnzahlEmpfangsBytes = 0; |
unsigned volatile char PC_DebugTimeout = 0; |
unsigned char PcZugriff = 100; |
unsigned char MotorTest[4] = {0,0,0,0}; |
unsigned char MeineSlaveAdresse; |
struct str_DebugOut DebugOut; |
struct str_Debug DebugIn; |
struct str_VersionInfo VersionInfo; |
int Debug_Timer; |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//++ Sende-Part der Datenübertragung |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(INT_VEC_TX) |
{ |
static unsigned int ptr = 0; |
unsigned char tmp_tx; |
if(!UebertragungAbgeschlossen) |
{ |
ptr++; // die [0] wurde schon gesendet |
tmp_tx = SendeBuffer[ptr]; |
if((tmp_tx == '\r') || (ptr == MAX_SENDE_BUFF)) |
{ |
ptr = 0; |
UebertragungAbgeschlossen = 1; |
} |
UDR = tmp_tx; |
} |
else ptr = 0; |
} |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//++ Empfangs-Part der Datenübertragung, incl. CRC-Auswertung |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(INT_VEC_RX) |
{ |
static unsigned int crc; |
static unsigned char crc1,crc2,buf_ptr; |
static unsigned char UartState = 0; |
unsigned char CrcOkay = 0; |
SioTmp = UDR; |
//Salvo 11.9.2007 GPS Daten holen |
Get_Ublox_Msg(SioTmp); // Daten vom GPS Modul holen |
// Salvo End |
if(buf_ptr >= MAX_EMPFANGS_BUFF) UartState = 0; |
if(SioTmp == '\r' && UartState == 2) |
{ |
UartState = 0; |
crc -= RxdBuffer[buf_ptr-2]; |
crc -= RxdBuffer[buf_ptr-1]; |
crc %= 4096; |
crc1 = '=' + crc / 64; |
crc2 = '=' + crc % 64; |
CrcOkay = 0; |
if((crc1 == RxdBuffer[buf_ptr-2]) && (crc2 == RxdBuffer[buf_ptr-1])) CrcOkay = 1; else { CrcOkay = 0; CntCrcError++;}; |
if(!NeuerDatensatzEmpfangen && CrcOkay) // Datensatz schon verarbeitet |
{ |
NeuerDatensatzEmpfangen = 1; |
AnzahlEmpfangsBytes = buf_ptr; |
RxdBuffer[buf_ptr] = '\r'; |
if(/*(RxdBuffer[1] == MeineSlaveAdresse || (RxdBuffer[1] == 'a')) && */(RxdBuffer[2] == 'R')) wdt_enable(WDTO_250MS); // Reset-Commando |
} |
} |
else |
switch(UartState) |
{ |
case 0: |
if(SioTmp == '#' && !NeuerDatensatzEmpfangen) UartState = 1; // Startzeichen und Daten schon verarbeitet |
buf_ptr = 0; |
RxdBuffer[buf_ptr++] = SioTmp; |
crc = SioTmp; |
break; |
case 1: // Adresse auswerten |
UartState++; |
RxdBuffer[buf_ptr++] = SioTmp; |
crc += SioTmp; |
break; |
case 2: // Eingangsdaten sammeln |
RxdBuffer[buf_ptr] = SioTmp; |
if(buf_ptr < MAX_EMPFANGS_BUFF) buf_ptr++; |
else UartState = 0; |
crc += SioTmp; |
break; |
default: |
UartState = 0; |
break; |
} |
} |
// -------------------------------------------------------------------------- |
void AddCRC(unsigned int wieviele) |
{ |
unsigned int tmpCRC = 0,i; |
for(i = 0; i < wieviele;i++) |
{ |
tmpCRC += SendeBuffer[i]; |
} |
tmpCRC %= 4096; |
SendeBuffer[i++] = '=' + tmpCRC / 64; |
SendeBuffer[i++] = '=' + tmpCRC % 64; |
SendeBuffer[i++] = '\r'; |
UebertragungAbgeschlossen = 0; |
UDR = SendeBuffer[0]; |
} |
// -------------------------------------------------------------------------- |
void SendOutData(unsigned char cmd,unsigned char modul, unsigned char *snd, unsigned char len) |
{ |
unsigned int pt = 0; |
unsigned char a,b,c; |
unsigned char ptr = 0; |
SendeBuffer[pt++] = '#'; // Startzeichen |
SendeBuffer[pt++] = modul; // Adresse (a=0; b=1,...) |
SendeBuffer[pt++] = cmd; // Commando |
while(len) |
{ |
if(len) { a = snd[ptr++]; len--;} else a = 0; |
if(len) { b = snd[ptr++]; len--;} else b = 0; |
if(len) { c = snd[ptr++]; len--;} else c = 0; |
SendeBuffer[pt++] = '=' + (a >> 2); |
SendeBuffer[pt++] = '=' + (((a & 0x03) << 4) | ((b & 0xf0) >> 4)); |
SendeBuffer[pt++] = '=' + (((b & 0x0f) << 2) | ((c & 0xc0) >> 6)); |
SendeBuffer[pt++] = '=' + ( c & 0x3f); |
} |
AddCRC(pt); |
} |
// -------------------------------------------------------------------------- |
void Decode64(unsigned char *ptrOut, unsigned char len, unsigned char ptrIn,unsigned char max) // Wohin mit den Daten; Wie lang; Wo im RxdBuffer |
{ |
unsigned char a,b,c,d; |
unsigned char ptr = 0; |
unsigned char x,y,z; |
while(len) |
{ |
a = RxdBuffer[ptrIn++] - '='; |
b = RxdBuffer[ptrIn++] - '='; |
c = RxdBuffer[ptrIn++] - '='; |
d = RxdBuffer[ptrIn++] - '='; |
if(ptrIn > max - 2) break; // nicht mehr Daten verarbeiten, als empfangen wurden |
x = (a << 2) | (b >> 4); |
y = ((b & 0x0f) << 4) | (c >> 2); |
z = ((c & 0x03) << 6) | d; |
if(len--) ptrOut[ptr++] = x; else break; |
if(len--) ptrOut[ptr++] = y; else break; |
if(len--) ptrOut[ptr++] = z; else break; |
} |
} |
// -------------------------------------------------------------------------- |
void BearbeiteRxDaten(void) |
{ |
if(!NeuerDatensatzEmpfangen) return; |
//unsigned int tmp_int_arr1[1]; |
//unsigned int tmp_int_arr2[2]; |
//unsigned int tmp_int_arr3[3]; |
unsigned char tmp_char_arr2[2]; |
//unsigned char tmp_char_arr3[3]; |
//unsigned char tmp_char_arr4[4]; |
//if(!MotorenEin) |
PcZugriff = 255; |
switch(RxdBuffer[2]) |
{ |
case 'c':// Debugdaten incl. Externe IOs usw |
Decode64((unsigned char *) &DebugIn,sizeof(DebugIn),3,AnzahlEmpfangsBytes); |
/* for(unsigned char i=0; i<4;i++) |
{ |
EE_CheckAndWrite(&EE_Buffer[EE_DEBUGWERTE + i*2], DebugIn.Analog[i]); |
EE_CheckAndWrite(&EE_Buffer[EE_DEBUGWERTE + i*2 + 1], DebugIn.Analog[i] >> 8); |
}*/ |
RemoteTasten |= DebugIn.RemoteTasten; |
DebugDataAnforderung = 1; |
break; |
case 'h':// x-1 Displayzeilen |
Decode64((unsigned char *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes); |
RemoteTasten |= tmp_char_arr2[0]; |
DebugDisplayAnforderung = 1; |
break; |
case 't':// Motortest |
Decode64((unsigned char *) &MotorTest[0],sizeof(MotorTest),3,AnzahlEmpfangsBytes); |
break; |
case 'v': // Version-Anforderung und Ausbaustufe |
GetVersionAnforderung = 1; |
break; |
case 'g':// "Get"-Anforderung für Debug-Daten |
// Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
DebugGetAnforderung = 1; |
break; |
case 'q':// "Get"-Anforderung für Settings |
// Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
Decode64((unsigned char *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes); |
if(tmp_char_arr2[0] != 0xff) |
{ |
if(tmp_char_arr2[0] > 5) tmp_char_arr2[0] = 5; |
ReadParameterSet(tmp_char_arr2[0], (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
SendOutData('L' + tmp_char_arr2[0] -1,MeineSlaveAdresse,(unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE); |
} |
else |
SendOutData('L' + GetActiveParamSetNumber()-1,MeineSlaveAdresse,(unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE); |
break; |
case 'l': |
case 'm': |
case 'n': |
case 'o': |
case 'p': // Parametersatz speichern |
Decode64((unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE,3,AnzahlEmpfangsBytes); |
WriteParameterSet(RxdBuffer[2] - 'l' + 1, (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], RxdBuffer[2] - 'l' + 1); // aktiven Datensatz merken |
Piep(GetActiveParamSetNumber()); |
break; |
} |
// DebugOut.AnzahlZyklen = Debug_Timer_Intervall; |
NeuerDatensatzEmpfangen = 0; |
} |
//############################################################################ |
//Routine für die Serielle Ausgabe |
int uart_putchar (char c) |
//############################################################################ |
{ |
if (c == '\n') |
uart_putchar('\r'); |
//Warten solange bis Zeichen gesendet wurde |
loop_until_bit_is_set(USR, UDRE); |
//Ausgabe des Zeichens |
UDR = c; |
return (0); |
} |
// -------------------------------------------------------------------------- |
void WriteProgramData(unsigned int pos, unsigned char wert) |
{ |
//if (ProgramLocation == IN_RAM) Buffer[pos] = wert; |
// else eeprom_write_byte(&EE_Buffer[pos], wert); |
// Buffer[pos] = wert; |
} |
//############################################################################ |
//INstallation der Seriellen Schnittstelle |
void UART_Init (void) |
//############################################################################ |
{ |
//Enable TXEN im Register UCR TX-Data Enable & RX Enable |
UCR=(1 << TXEN) | (1 << RXEN); |
// UART Double Speed (U2X) |
USR |= (1<<U2X); |
// RX-Interrupt Freigabe |
UCSRB |= (1<<RXCIE); |
// TX-Interrupt Freigabe |
UCSRB |= (1<<TXCIE); |
//Teiler wird gesetzt |
UBRR=(SYSCLK / (BAUD_RATE * 8L) - 1); |
//UBRR = 33; |
//öffnet einen Kanal für printf (STDOUT) |
//fdevopen (uart_putchar, 0); |
//sbi(PORTD,4); |
Debug_Timer = SetDelay(200); |
} |
//--------------------------------------------------------------------------------------------- |
void DatenUebertragung(void) |
{ |
static char dis_zeile = 0; |
if(!UebertragungAbgeschlossen) return; |
if(DebugGetAnforderung && UebertragungAbgeschlossen) // Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
{ |
SendOutData('G',MeineSlaveAdresse,(unsigned char *) &DebugIn,sizeof(DebugIn)); |
DebugGetAnforderung = 0; |
} |
if((CheckDelay(Debug_Timer) || DebugDataAnforderung) && UebertragungAbgeschlossen) |
{ |
SendOutData('D',MeineSlaveAdresse,(unsigned char *) &DebugOut,sizeof(DebugOut)); |
DebugDataAnforderung = 0; |
Debug_Timer = SetDelay(MIN_DEBUG_INTERVALL); |
} |
if(DebugDisplayAnforderung && UebertragungAbgeschlossen) |
{ |
Menu(); |
DebugDisplayAnforderung = 0; |
if(++dis_zeile == 4) dis_zeile = 0; |
SendOutData('0' + dis_zeile,0,&DisplayBuff[20 * dis_zeile],20); // DisplayZeile übertragen |
} |
if(GetVersionAnforderung && UebertragungAbgeschlossen) |
{ |
SendOutData('V',MeineSlaveAdresse,(unsigned char *) &VersionInfo,sizeof(VersionInfo)); |
GetVersionAnforderung = 0; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/uart.h |
---|
0,0 → 1,95 |
#ifndef _UART_H |
#define _UART_H |
#define MAX_SENDE_BUFF 150 |
#define MAX_EMPFANGS_BUFF 150 |
void BearbeiteRxDaten(void); |
extern unsigned char DebugGetAnforderung; |
extern unsigned volatile char SendeBuffer[MAX_SENDE_BUFF]; |
extern unsigned volatile char RxdBuffer[MAX_EMPFANGS_BUFF]; |
extern unsigned volatile char UebertragungAbgeschlossen; |
extern unsigned volatile char PC_DebugTimeout; |
extern unsigned volatile char NeueKoordinateEmpfangen; |
extern unsigned char MeineSlaveAdresse; |
extern unsigned char PcZugriff; |
extern int Debug_Timer; |
extern void UART_Init (void); |
extern int uart_putchar (char c); |
extern void boot_program_page (uint32_t page, uint8_t *buf); |
extern void DatenUebertragung(void); |
extern void DecodeNMEA(void); |
extern unsigned char MotorTest[4]; |
struct str_DebugOut |
{ |
unsigned char Digital[13]; |
unsigned int AnzahlZyklen; |
unsigned int Zeit; |
unsigned char Sekunden; |
unsigned int Analog[16]; // Debugwerte |
}; |
extern struct str_DebugOut DebugOut; |
struct str_Debug |
{ |
unsigned char Digital[2]; |
unsigned char RemoteTasten; |
unsigned int Analog[4]; |
}; |
extern struct str_Debug DebugIn; |
struct str_VersionInfo |
{ |
unsigned char Hauptversion; |
unsigned char Nebenversion; |
unsigned char PCKompatibel; |
unsigned char Rserved[7]; |
}; |
extern struct str_VersionInfo VersionInfo; |
//Die Baud_Rate der Seriellen Schnittstelle ist 9600 Baud |
//#define BAUD_RATE 9600 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 14400 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 28800 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 38400 //Baud Rate für die Serielle Schnittstelle |
#define BAUD_RATE 57600 //Baud Rate für die Serielle Schnittstelle |
//Anpassen der seriellen Schnittstellen Register wenn ein ATMega128 benutzt wird |
#if defined (__AVR_ATmega128__) |
# define USR UCSR0A |
# define UCR UCSR0B |
# define UDR UDR0 |
# define UBRR UBRR0L |
# define EICR EICRB |
#endif |
#if defined (__AVR_ATmega32__) |
# define USR UCSRA |
# define UCR UCSRB |
# define UBRR UBRRL |
# define EICR EICRB |
# define INT_VEC_RX SIG_UART_RECV |
# define INT_VEC_TX SIG_UART_TRANS |
#endif |
#if defined (__AVR_ATmega644__) |
# define USR UCSR0A |
# define UCR UCSR0B |
# define UDR UDR0 |
# define UBRR UBRR0L |
# define EICR EICR0B |
# define TXEN TXEN0 |
# define RXEN RXEN0 |
# define RXCIE RXCIE0 |
# define TXCIE TXCIE0 |
# define U2X U2X0 |
# define UCSRB UCSR0B |
# define UDRE UDRE0 |
# define INT_VEC_RX SIG_USART_RECV |
# define INT_VEC_TX SIG_USART_TRANS |
#endif |
#endif //_UART_H |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3ACC/version.txt |
---|
0,0 → 1,49 |
------- |
V0.53 27.04.2007 H.Buss |
- erste öffentliche Version |
V0.53b 29.04.2007 H.Buss |
- der FAKTOR_I war versehentlich auf Null, dann liegt der MikroKopter nicht so hart in der Luft |
V0.53c 29.04.2007 H.Buss |
- es gib ein Menü, in dem die Werte der Kanäle nach Nick, Roll, Gas,... sortiert sind. |
Die angezeigten Werte waren nicht die Werte der Funke |
V0.54 01.05.2007 H.Buss |
- die Paramtersätze können jetzt vor dem Start ausgewählt werden |
Dazu wird beim Kalibrieren der Messwerte (Gashebel oben links) der Nick-Rollhebel abgefragt: |
2 3 4 |
1 x 5 |
- - - |
Bedeutet: Nick-Rollhebel Links Mitte = Setting:1 Links Oben = Setting:2 usw. |
- der Faktor_I für den Hauptregler ist hinzugekommen. Im Heading-Hold-Modus sollte er vergössert werden, was Stabilität bringt |
V0.55 14.05.2007 H.Buss |
- es können nun Servos an J3,J4,J5 mit den Kanälen 5-7 gesteuert werden |
V0.56 14.05.2007 H.Buss |
- es gab Probleme mit Funken, die mehr als 8 Kanäle haben, wenn mehrere Kanäle dann auf Null waren |
- Funken, die nicht bis +-120 aussteuern können, sollten jetzt auch gehen |
V0.57 24.05.2007 H.Buss |
- Der Höhenregler kann nun auch mittels Schalter bedient werden |
- Bug im Gier-Algorithmus behoben; Schnelles Gieren fürhrte dazu, dass der MK zu weit gedreht hat |
- Kompass-Einfluss dämpfen bei Neigung |
- Man kann zwischen Kompass FIX (Richtung beim Kalibrieren) und Variabel (einstellbar per Gier) wählen |
- Der Motortest vom Kopter-Tool geht jetzt |
- Man kann den Parametersätzen einen Namen geben |
- Das Kamerasetting ist unter Setting 2 defaultmässig integriert |
V0.58 30.05.2007 H.Buss |
- Der Höhenregler-Algorithmus wird nun umgangen, wenn der Höhenreglerschalter aus ist |
V0.60 17.08.2007 H.Buss |
- "Schwindel-Bug" behoben |
- Die Poti-Werte werden jetzt auf Unterlauf (<0) überprüft |
- Poti4 zugefügt |
- Es werden jetzt 8 Kanäle ausgewertet |
- Kamera-Servo (an J7) |
- Die Settings müssen überschrieben werden |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/COPYING |
---|
0,0 → 1,674 |
GNU GENERAL PUBLIC LICENSE |
Version 3, 29 June 2007 |
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> |
Everyone is permitted to copy and distribute verbatim copies |
of this license document, but changing it is not allowed. |
Preamble |
The GNU General Public License is a free, copyleft license for |
software and other kinds of works. |
The licenses for most software and other practical works are designed |
to take away your freedom to share and change the works. By contrast, |
the GNU General Public License is intended to guarantee your freedom to |
share and change all versions of a program--to make sure it remains free |
software for all its users. We, the Free Software Foundation, use the |
GNU General Public License for most of our software; it applies also to |
any other work released this way by its authors. You can apply it to |
your programs, too. |
When we speak of free software, we are referring to freedom, not |
price. Our General Public Licenses are designed to make sure that you |
have the freedom to distribute copies of free software (and charge for |
them if you wish), that you receive source code or can get it if you |
want it, that you can change the software or use pieces of it in new |
free programs, and that you know you can do these things. |
To protect your rights, we need to prevent others from denying you |
these rights or asking you to surrender the rights. Therefore, you have |
certain responsibilities if you distribute copies of the software, or if |
you modify it: responsibilities to respect the freedom of others. |
For example, if you distribute copies of such a program, whether |
gratis or for a fee, you must pass on to the recipients the same |
freedoms that you received. You must make sure that they, too, receive |
or can get the source code. And you must show them these terms so they |
know their rights. |
Developers that use the GNU GPL protect your rights with two steps: |
(1) assert copyright on the software, and (2) offer you this License |
giving you legal permission to copy, distribute and/or modify it. |
For the developers' and authors' protection, the GPL clearly explains |
that there is no warranty for this free software. For both users' and |
authors' sake, the GPL requires that modified versions be marked as |
changed, so that their problems will not be attributed erroneously to |
authors of previous versions. |
Some devices are designed to deny users access to install or run |
modified versions of the software inside them, although the manufacturer |
can do so. This is fundamentally incompatible with the aim of |
protecting users' freedom to change the software. The systematic |
pattern of such abuse occurs in the area of products for individuals to |
use, which is precisely where it is most unacceptable. Therefore, we |
have designed this version of the GPL to prohibit the practice for those |
products. If such problems arise substantially in other domains, we |
stand ready to extend this provision to those domains in future versions |
of the GPL, as needed to protect the freedom of users. |
Finally, every program is threatened constantly by software patents. |
States should not allow patents to restrict development and use of |
software on general-purpose computers, but in those that do, we wish to |
avoid the special danger that patents applied to a free program could |
make it effectively proprietary. To prevent this, the GPL assures that |
patents cannot be used to render the program non-free. |
The precise terms and conditions for copying, distribution and |
modification follow. |
TERMS AND CONDITIONS |
0. Definitions. |
"This License" refers to version 3 of the GNU General Public License. |
"Copyright" also means copyright-like laws that apply to other kinds of |
works, such as semiconductor masks. |
"The Program" refers to any copyrightable work licensed under this |
License. Each licensee is addressed as "you". "Licensees" and |
"recipients" may be individuals or organizations. |
To "modify" a work means to copy from or adapt all or part of the work |
in a fashion requiring copyright permission, other than the making of an |
exact copy. The resulting work is called a "modified version" of the |
earlier work or a work "based on" the earlier work. |
A "covered work" means either the unmodified Program or a work based |
on the Program. |
To "propagate" a work means to do anything with it that, without |
permission, would make you directly or secondarily liable for |
infringement under applicable copyright law, except executing it on a |
computer or modifying a private copy. Propagation includes copying, |
distribution (with or without modification), making available to the |
public, and in some countries other activities as well. |
To "convey" a work means any kind of propagation that enables other |
parties to make or receive copies. Mere interaction with a user through |
a computer network, with no transfer of a copy, is not conveying. |
An interactive user interface displays "Appropriate Legal Notices" |
to the extent that it includes a convenient and prominently visible |
feature that (1) displays an appropriate copyright notice, and (2) |
tells the user that there is no warranty for the work (except to the |
extent that warranties are provided), that licensees may convey the |
work under this License, and how to view a copy of this License. If |
the interface presents a list of user commands or options, such as a |
menu, a prominent item in the list meets this criterion. |
1. Source Code. |
The "source code" for a work means the preferred form of the work |
for making modifications to it. "Object code" means any non-source |
form of a work. |
A "Standard Interface" means an interface that either is an official |
standard defined by a recognized standards body, or, in the case of |
interfaces specified for a particular programming language, one that |
is widely used among developers working in that language. |
The "System Libraries" of an executable work include anything, other |
than the work as a whole, that (a) is included in the normal form of |
packaging a Major Component, but which is not part of that Major |
Component, and (b) serves only to enable use of the work with that |
Major Component, or to implement a Standard Interface for which an |
implementation is available to the public in source code form. A |
"Major Component", in this context, means a major essential component |
(kernel, window system, and so on) of the specific operating system |
(if any) on which the executable work runs, or a compiler used to |
produce the work, or an object code interpreter used to run it. |
The "Corresponding Source" for a work in object code form means all |
the source code needed to generate, install, and (for an executable |
work) run the object code and to modify the work, including scripts to |
control those activities. However, it does not include the work's |
System Libraries, or general-purpose tools or generally available free |
programs which are used unmodified in performing those activities but |
which are not part of the work. For example, Corresponding Source |
includes interface definition files associated with source files for |
the work, and the source code for shared libraries and dynamically |
linked subprograms that the work is specifically designed to require, |
such as by intimate data communication or control flow between those |
subprograms and other parts of the work. |
The Corresponding Source need not include anything that users |
can regenerate automatically from other parts of the Corresponding |
Source. |
The Corresponding Source for a work in source code form is that |
same work. |
2. Basic Permissions. |
All rights granted under this License are granted for the term of |
copyright on the Program, and are irrevocable provided the stated |
conditions are met. This License explicitly affirms your unlimited |
permission to run the unmodified Program. The output from running a |
covered work is covered by this License only if the output, given its |
content, constitutes a covered work. This License acknowledges your |
rights of fair use or other equivalent, as provided by copyright law. |
You may make, run and propagate covered works that you do not |
convey, without conditions so long as your license otherwise remains |
in force. You may convey covered works to others for the sole purpose |
of having them make modifications exclusively for you, or provide you |
with facilities for running those works, provided that you comply with |
the terms of this License in conveying all material for which you do |
not control copyright. Those thus making or running the covered works |
for you must do so exclusively on your behalf, under your direction |
and control, on terms that prohibit them from making any copies of |
your copyrighted material outside their relationship with you. |
Conveying under any other circumstances is permitted solely under |
the conditions stated below. Sublicensing is not allowed; section 10 |
makes it unnecessary. |
3. Protecting Users' Legal Rights From Anti-Circumvention Law. |
No covered work shall be deemed part of an effective technological |
measure under any applicable law fulfilling obligations under article |
11 of the WIPO copyright treaty adopted on 20 December 1996, or |
similar laws prohibiting or restricting circumvention of such |
measures. |
When you convey a covered work, you waive any legal power to forbid |
circumvention of technological measures to the extent such circumvention |
is effected by exercising rights under this License with respect to |
the covered work, and you disclaim any intention to limit operation or |
modification of the work as a means of enforcing, against the work's |
users, your or third parties' legal rights to forbid circumvention of |
technological measures. |
4. Conveying Verbatim Copies. |
You may convey verbatim copies of the Program's source code as you |
receive it, in any medium, provided that you conspicuously and |
appropriately publish on each copy an appropriate copyright notice; |
keep intact all notices stating that this License and any |
non-permissive terms added in accord with section 7 apply to the code; |
keep intact all notices of the absence of any warranty; and give all |
recipients a copy of this License along with the Program. |
You may charge any price or no price for each copy that you convey, |
and you may offer support or warranty protection for a fee. |
5. Conveying Modified Source Versions. |
You may convey a work based on the Program, or the modifications to |
produce it from the Program, in the form of source code under the |
terms of section 4, provided that you also meet all of these conditions: |
a) The work must carry prominent notices stating that you modified |
it, and giving a relevant date. |
b) The work must carry prominent notices stating that it is |
released under this License and any conditions added under section |
7. This requirement modifies the requirement in section 4 to |
"keep intact all notices". |
c) You must license the entire work, as a whole, under this |
License to anyone who comes into possession of a copy. This |
License will therefore apply, along with any applicable section 7 |
additional terms, to the whole of the work, and all its parts, |
regardless of how they are packaged. This License gives no |
permission to license the work in any other way, but it does not |
invalidate such permission if you have separately received it. |
d) If the work has interactive user interfaces, each must display |
Appropriate Legal Notices; however, if the Program has interactive |
interfaces that do not display Appropriate Legal Notices, your |
work need not make them do so. |
A compilation of a covered work with other separate and independent |
works, which are not by their nature extensions of the covered work, |
and which are not combined with it such as to form a larger program, |
in or on a volume of a storage or distribution medium, is called an |
"aggregate" if the compilation and its resulting copyright are not |
used to limit the access or legal rights of the compilation's users |
beyond what the individual works permit. Inclusion of a covered work |
in an aggregate does not cause this License to apply to the other |
parts of the aggregate. |
6. Conveying Non-Source Forms. |
You may convey a covered work in object code form under the terms |
of sections 4 and 5, provided that you also convey the |
machine-readable Corresponding Source under the terms of this License, |
in one of these ways: |
a) Convey the object code in, or embodied in, a physical product |
(including a physical distribution medium), accompanied by the |
Corresponding Source fixed on a durable physical medium |
customarily used for software interchange. |
b) Convey the object code in, or embodied in, a physical product |
(including a physical distribution medium), accompanied by a |
written offer, valid for at least three years and valid for as |
long as you offer spare parts or customer support for that product |
model, to give anyone who possesses the object code either (1) a |
copy of the Corresponding Source for all the software in the |
product that is covered by this License, on a durable physical |
medium customarily used for software interchange, for a price no |
more than your reasonable cost of physically performing this |
conveying of source, or (2) access to copy the |
Corresponding Source from a network server at no charge. |
c) Convey individual copies of the object code with a copy of the |
written offer to provide the Corresponding Source. This |
alternative is allowed only occasionally and noncommercially, and |
only if you received the object code with such an offer, in accord |
with subsection 6b. |
d) Convey the object code by offering access from a designated |
place (gratis or for a charge), and offer equivalent access to the |
Corresponding Source in the same way through the same place at no |
further charge. You need not require recipients to copy the |
Corresponding Source along with the object code. If the place to |
copy the object code is a network server, the Corresponding Source |
may be on a different server (operated by you or a third party) |
that supports equivalent copying facilities, provided you maintain |
clear directions next to the object code saying where to find the |
Corresponding Source. Regardless of what server hosts the |
Corresponding Source, you remain obligated to ensure that it is |
available for as long as needed to satisfy these requirements. |
e) Convey the object code using peer-to-peer transmission, provided |
you inform other peers where the object code and Corresponding |
Source of the work are being offered to the general public at no |
charge under subsection 6d. |
A separable portion of the object code, whose source code is excluded |
from the Corresponding Source as a System Library, need not be |
included in conveying the object code work. |
A "User Product" is either (1) a "consumer product", which means any |
tangible personal property which is normally used for personal, family, |
or household purposes, or (2) anything designed or sold for incorporation |
into a dwelling. In determining whether a product is a consumer product, |
doubtful cases shall be resolved in favor of coverage. For a particular |
product received by a particular user, "normally used" refers to a |
typical or common use of that class of product, regardless of the status |
of the particular user or of the way in which the particular user |
actually uses, or expects or is expected to use, the product. A product |
is a consumer product regardless of whether the product has substantial |
commercial, industrial or non-consumer uses, unless such uses represent |
the only significant mode of use of the product. |
"Installation Information" for a User Product means any methods, |
procedures, authorization keys, or other information required to install |
and execute modified versions of a covered work in that User Product from |
a modified version of its Corresponding Source. The information must |
suffice to ensure that the continued functioning of the modified object |
code is in no case prevented or interfered with solely because |
modification has been made. |
If you convey an object code work under this section in, or with, or |
specifically for use in, a User Product, and the conveying occurs as |
part of a transaction in which the right of possession and use of the |
User Product is transferred to the recipient in perpetuity or for a |
fixed term (regardless of how the transaction is characterized), the |
Corresponding Source conveyed under this section must be accompanied |
by the Installation Information. But this requirement does not apply |
if neither you nor any third party retains the ability to install |
modified object code on the User Product (for example, the work has |
been installed in ROM). |
The requirement to provide Installation Information does not include a |
requirement to continue to provide support service, warranty, or updates |
for a work that has been modified or installed by the recipient, or for |
the User Product in which it has been modified or installed. Access to a |
network may be denied when the modification itself materially and |
adversely affects the operation of the network or violates the rules and |
protocols for communication across the network. |
Corresponding Source conveyed, and Installation Information provided, |
in accord with this section must be in a format that is publicly |
documented (and with an implementation available to the public in |
source code form), and must require no special password or key for |
unpacking, reading or copying. |
7. Additional Terms. |
"Additional permissions" are terms that supplement the terms of this |
License by making exceptions from one or more of its conditions. |
Additional permissions that are applicable to the entire Program shall |
be treated as though they were included in this License, to the extent |
that they are valid under applicable law. If additional permissions |
apply only to part of the Program, that part may be used separately |
under those permissions, but the entire Program remains governed by |
this License without regard to the additional permissions. |
When you convey a copy of a covered work, you may at your option |
remove any additional permissions from that copy, or from any part of |
it. (Additional permissions may be written to require their own |
removal in certain cases when you modify the work.) You may place |
additional permissions on material, added by you to a covered work, |
for which you have or can give appropriate copyright permission. |
Notwithstanding any other provision of this License, for material you |
add to a covered work, you may (if authorized by the copyright holders of |
that material) supplement the terms of this License with terms: |
a) Disclaiming warranty or limiting liability differently from the |
terms of sections 15 and 16 of this License; or |
b) Requiring preservation of specified reasonable legal notices or |
author attributions in that material or in the Appropriate Legal |
Notices displayed by works containing it; or |
c) Prohibiting misrepresentation of the origin of that material, or |
requiring that modified versions of such material be marked in |
reasonable ways as different from the original version; or |
d) Limiting the use for publicity purposes of names of licensors or |
authors of the material; or |
e) Declining to grant rights under trademark law for use of some |
trade names, trademarks, or service marks; or |
f) Requiring indemnification of licensors and authors of that |
material by anyone who conveys the material (or modified versions of |
it) with contractual assumptions of liability to the recipient, for |
any liability that these contractual assumptions directly impose on |
those licensors and authors. |
All other non-permissive additional terms are considered "further |
restrictions" within the meaning of section 10. If the Program as you |
received it, or any part of it, contains a notice stating that it is |
governed by this License along with a term that is a further |
restriction, you may remove that term. If a license document contains |
a further restriction but permits relicensing or conveying under this |
License, you may add to a covered work material governed by the terms |
of that license document, provided that the further restriction does |
not survive such relicensing or conveying. |
If you add terms to a covered work in accord with this section, you |
must place, in the relevant source files, a statement of the |
additional terms that apply to those files, or a notice indicating |
where to find the applicable terms. |
Additional terms, permissive or non-permissive, may be stated in the |
form of a separately written license, or stated as exceptions; |
the above requirements apply either way. |
8. Termination. |
You may not propagate or modify a covered work except as expressly |
provided under this License. Any attempt otherwise to propagate or |
modify it is void, and will automatically terminate your rights under |
this License (including any patent licenses granted under the third |
paragraph of section 11). |
However, if you cease all violation of this License, then your |
license from a particular copyright holder is reinstated (a) |
provisionally, unless and until the copyright holder explicitly and |
finally terminates your license, and (b) permanently, if the copyright |
holder fails to notify you of the violation by some reasonable means |
prior to 60 days after the cessation. |
Moreover, your license from a particular copyright holder is |
reinstated permanently if the copyright holder notifies you of the |
violation by some reasonable means, this is the first time you have |
received notice of violation of this License (for any work) from that |
copyright holder, and you cure the violation prior to 30 days after |
your receipt of the notice. |
Termination of your rights under this section does not terminate the |
licenses of parties who have received copies or rights from you under |
this License. If your rights have been terminated and not permanently |
reinstated, you do not qualify to receive new licenses for the same |
material under section 10. |
9. Acceptance Not Required for Having Copies. |
You are not required to accept this License in order to receive or |
run a copy of the Program. Ancillary propagation of a covered work |
occurring solely as a consequence of using peer-to-peer transmission |
to receive a copy likewise does not require acceptance. However, |
nothing other than this License grants you permission to propagate or |
modify any covered work. These actions infringe copyright if you do |
not accept this License. Therefore, by modifying or propagating a |
covered work, you indicate your acceptance of this License to do so. |
10. Automatic Licensing of Downstream Recipients. |
Each time you convey a covered work, the recipient automatically |
receives a license from the original licensors, to run, modify and |
propagate that work, subject to this License. You are not responsible |
for enforcing compliance by third parties with this License. |
An "entity transaction" is a transaction transferring control of an |
organization, or substantially all assets of one, or subdividing an |
organization, or merging organizations. If propagation of a covered |
work results from an entity transaction, each party to that |
transaction who receives a copy of the work also receives whatever |
licenses to the work the party's predecessor in interest had or could |
give under the previous paragraph, plus a right to possession of the |
Corresponding Source of the work from the predecessor in interest, if |
the predecessor has it or can get it with reasonable efforts. |
You may not impose any further restrictions on the exercise of the |
rights granted or affirmed under this License. For example, you may |
not impose a license fee, royalty, or other charge for exercise of |
rights granted under this License, and you may not initiate litigation |
(including a cross-claim or counterclaim in a lawsuit) alleging that |
any patent claim is infringed by making, using, selling, offering for |
sale, or importing the Program or any portion of it. |
11. Patents. |
A "contributor" is a copyright holder who authorizes use under this |
License of the Program or a work on which the Program is based. The |
work thus licensed is called the contributor's "contributor version". |
A contributor's "essential patent claims" are all patent claims |
owned or controlled by the contributor, whether already acquired or |
hereafter acquired, that would be infringed by some manner, permitted |
by this License, of making, using, or selling its contributor version, |
but do not include claims that would be infringed only as a |
consequence of further modification of the contributor version. For |
purposes of this definition, "control" includes the right to grant |
patent sublicenses in a manner consistent with the requirements of |
this License. |
Each contributor grants you a non-exclusive, worldwide, royalty-free |
patent license under the contributor's essential patent claims, to |
make, use, sell, offer for sale, import and otherwise run, modify and |
propagate the contents of its contributor version. |
In the following three paragraphs, a "patent license" is any express |
agreement or commitment, however denominated, not to enforce a patent |
(such as an express permission to practice a patent or covenant not to |
sue for patent infringement). To "grant" such a patent license to a |
party means to make such an agreement or commitment not to enforce a |
patent against the party. |
If you convey a covered work, knowingly relying on a patent license, |
and the Corresponding Source of the work is not available for anyone |
to copy, free of charge and under the terms of this License, through a |
publicly available network server or other readily accessible means, |
then you must either (1) cause the Corresponding Source to be so |
available, or (2) arrange to deprive yourself of the benefit of the |
patent license for this particular work, or (3) arrange, in a manner |
consistent with the requirements of this License, to extend the patent |
license to downstream recipients. "Knowingly relying" means you have |
actual knowledge that, but for the patent license, your conveying the |
covered work in a country, or your recipient's use of the covered work |
in a country, would infringe one or more identifiable patents in that |
country that you have reason to believe are valid. |
If, pursuant to or in connection with a single transaction or |
arrangement, you convey, or propagate by procuring conveyance of, a |
covered work, and grant a patent license to some of the parties |
receiving the covered work authorizing them to use, propagate, modify |
or convey a specific copy of the covered work, then the patent license |
you grant is automatically extended to all recipients of the covered |
work and works based on it. |
A patent license is "discriminatory" if it does not include within |
the scope of its coverage, prohibits the exercise of, or is |
conditioned on the non-exercise of one or more of the rights that are |
specifically granted under this License. You may not convey a covered |
work if you are a party to an arrangement with a third party that is |
in the business of distributing software, under which you make payment |
to the third party based on the extent of your activity of conveying |
the work, and under which the third party grants, to any of the |
parties who would receive the covered work from you, a discriminatory |
patent license (a) in connection with copies of the covered work |
conveyed by you (or copies made from those copies), or (b) primarily |
for and in connection with specific products or compilations that |
contain the covered work, unless you entered into that arrangement, |
or that patent license was granted, prior to 28 March 2007. |
Nothing in this License shall be construed as excluding or limiting |
any implied license or other defenses to infringement that may |
otherwise be available to you under applicable patent law. |
12. No Surrender of Others' Freedom. |
If conditions are imposed on you (whether by court order, agreement or |
otherwise) that contradict the conditions of this License, they do not |
excuse you from the conditions of this License. If you cannot convey a |
covered work so as to satisfy simultaneously your obligations under this |
License and any other pertinent obligations, then as a consequence you may |
not convey it at all. For example, if you agree to terms that obligate you |
to collect a royalty for further conveying from those to whom you convey |
the Program, the only way you could satisfy both those terms and this |
License would be to refrain entirely from conveying the Program. |
13. Use with the GNU Affero General Public License. |
Notwithstanding any other provision of this License, you have |
permission to link or combine any covered work with a work licensed |
under version 3 of the GNU Affero General Public License into a single |
combined work, and to convey the resulting work. The terms of this |
License will continue to apply to the part which is the covered work, |
but the special requirements of the GNU Affero General Public License, |
section 13, concerning interaction through a network will apply to the |
combination as such. |
14. Revised Versions of this License. |
The Free Software Foundation may publish revised and/or new versions of |
the GNU General Public License from time to time. Such new versions will |
be similar in spirit to the present version, but may differ in detail to |
address new problems or concerns. |
Each version is given a distinguishing version number. If the |
Program specifies that a certain numbered version of the GNU General |
Public License "or any later version" applies to it, you have the |
option of following the terms and conditions either of that numbered |
version or of any later version published by the Free Software |
Foundation. If the Program does not specify a version number of the |
GNU General Public License, you may choose any version ever published |
by the Free Software Foundation. |
If the Program specifies that a proxy can decide which future |
versions of the GNU General Public License can be used, that proxy's |
public statement of acceptance of a version permanently authorizes you |
to choose that version for the Program. |
Later license versions may give you additional or different |
permissions. However, no additional obligations are imposed on any |
author or copyright holder as a result of your choosing to follow a |
later version. |
15. Disclaimer of Warranty. |
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY |
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT |
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY |
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, |
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM |
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF |
ALL NECESSARY SERVICING, REPAIR OR CORRECTION. |
16. Limitation of Liability. |
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS |
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY |
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE |
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF |
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD |
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), |
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF |
SUCH DAMAGES. |
17. Interpretation of Sections 15 and 16. |
If the disclaimer of warranty and limitation of liability provided |
above cannot be given local legal effect according to their terms, |
reviewing courts shall apply local law that most closely approximates |
an absolute waiver of all civil liability in connection with the |
Program, unless a warranty or assumption of liability accompanies a |
copy of the Program in return for a fee. |
END OF TERMS AND CONDITIONS |
How to Apply These Terms to Your New Programs |
If you develop a new program, and you want it to be of the greatest |
possible use to the public, the best way to achieve this is to make it |
free software which everyone can redistribute and change under these terms. |
To do so, attach the following notices to the program. It is safest |
to attach them to the start of each source file to most effectively |
state the exclusion of warranty; and each file should have at least |
the "copyright" line and a pointer to where the full notice is found. |
<one line to give the program's name and a brief idea of what it does.> |
Copyright (C) <year> <name of author> |
This program is free software: you can redistribute it and/or modify |
it under the terms of the GNU General Public License as published by |
the Free Software Foundation, either version 3 of the License, or |
(at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License for more details. |
You should have received a copy of the GNU General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
Also add information on how to contact you by electronic and paper mail. |
If the program does terminal interaction, make it output a short |
notice like this when it starts in an interactive mode: |
<program> Copyright (C) <year> <name of author> |
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. |
This is free software, and you are welcome to redistribute it |
under certain conditions; type `show c' for details. |
The hypothetical commands `show w' and `show c' should show the appropriate |
parts of the General Public License. Of course, your program's commands |
might be different; for a GUI interface, you would use an "about box". |
You should also get your employer (if you work as a programmer) or school, |
if any, to sign a "copyright disclaimer" for the program, if necessary. |
For more information on this, and how to apply and follow the GNU GPL, see |
<http://www.gnu.org/licenses/>. |
The GNU General Public License does not permit incorporating your program |
into proprietary programs. If your program is a subroutine library, you |
may consider it more useful to permit linking proprietary applications with |
the library. If this is what you want to do, use the GNU Lesser General |
Public License instead of this License. But first, please read |
<http://www.gnu.org/philosophy/why-not-lgpl.html>. |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/COPYING.LESSER |
---|
0,0 → 1,165 |
GNU LESSER GENERAL PUBLIC LICENSE |
Version 3, 29 June 2007 |
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> |
Everyone is permitted to copy and distribute verbatim copies |
of this license document, but changing it is not allowed. |
This version of the GNU Lesser General Public License incorporates |
the terms and conditions of version 3 of the GNU General Public |
License, supplemented by the additional permissions listed below. |
0. Additional Definitions. |
As used herein, "this License" refers to version 3 of the GNU Lesser |
General Public License, and the "GNU GPL" refers to version 3 of the GNU |
General Public License. |
"The Library" refers to a covered work governed by this License, |
other than an Application or a Combined Work as defined below. |
An "Application" is any work that makes use of an interface provided |
by the Library, but which is not otherwise based on the Library. |
Defining a subclass of a class defined by the Library is deemed a mode |
of using an interface provided by the Library. |
A "Combined Work" is a work produced by combining or linking an |
Application with the Library. The particular version of the Library |
with which the Combined Work was made is also called the "Linked |
Version". |
The "Minimal Corresponding Source" for a Combined Work means the |
Corresponding Source for the Combined Work, excluding any source code |
for portions of the Combined Work that, considered in isolation, are |
based on the Application, and not on the Linked Version. |
The "Corresponding Application Code" for a Combined Work means the |
object code and/or source code for the Application, including any data |
and utility programs needed for reproducing the Combined Work from the |
Application, but excluding the System Libraries of the Combined Work. |
1. Exception to Section 3 of the GNU GPL. |
You may convey a covered work under sections 3 and 4 of this License |
without being bound by section 3 of the GNU GPL. |
2. Conveying Modified Versions. |
If you modify a copy of the Library, and, in your modifications, a |
facility refers to a function or data to be supplied by an Application |
that uses the facility (other than as an argument passed when the |
facility is invoked), then you may convey a copy of the modified |
version: |
a) under this License, provided that you make a good faith effort to |
ensure that, in the event an Application does not supply the |
function or data, the facility still operates, and performs |
whatever part of its purpose remains meaningful, or |
b) under the GNU GPL, with none of the additional permissions of |
this License applicable to that copy. |
3. Object Code Incorporating Material from Library Header Files. |
The object code form of an Application may incorporate material from |
a header file that is part of the Library. You may convey such object |
code under terms of your choice, provided that, if the incorporated |
material is not limited to numerical parameters, data structure |
layouts and accessors, or small macros, inline functions and templates |
(ten or fewer lines in length), you do both of the following: |
a) Give prominent notice with each copy of the object code that the |
Library is used in it and that the Library and its use are |
covered by this License. |
b) Accompany the object code with a copy of the GNU GPL and this license |
document. |
4. Combined Works. |
You may convey a Combined Work under terms of your choice that, |
taken together, effectively do not restrict modification of the |
portions of the Library contained in the Combined Work and reverse |
engineering for debugging such modifications, if you also do each of |
the following: |
a) Give prominent notice with each copy of the Combined Work that |
the Library is used in it and that the Library and its use are |
covered by this License. |
b) Accompany the Combined Work with a copy of the GNU GPL and this license |
document. |
c) For a Combined Work that displays copyright notices during |
execution, include the copyright notice for the Library among |
these notices, as well as a reference directing the user to the |
copies of the GNU GPL and this license document. |
d) Do one of the following: |
0) Convey the Minimal Corresponding Source under the terms of this |
License, and the Corresponding Application Code in a form |
suitable for, and under terms that permit, the user to |
recombine or relink the Application with a modified version of |
the Linked Version to produce a modified Combined Work, in the |
manner specified by section 6 of the GNU GPL for conveying |
Corresponding Source. |
1) Use a suitable shared library mechanism for linking with the |
Library. A suitable mechanism is one that (a) uses at run time |
a copy of the Library already present on the user's computer |
system, and (b) will operate properly with a modified version |
of the Library that is interface-compatible with the Linked |
Version. |
e) Provide Installation Information, but only if you would otherwise |
be required to provide such information under section 6 of the |
GNU GPL, and only to the extent that such information is |
necessary to install and execute a modified version of the |
Combined Work produced by recombining or relinking the |
Application with a modified version of the Linked Version. (If |
you use option 4d0, the Installation Information must accompany |
the Minimal Corresponding Source and Corresponding Application |
Code. If you use option 4d1, you must provide the Installation |
Information in the manner specified by section 6 of the GNU GPL |
for conveying Corresponding Source.) |
5. Combined Libraries. |
You may place library facilities that are a work based on the |
Library side by side in a single library together with other library |
facilities that are not Applications and are not covered by this |
License, and convey such a combined library under terms of your |
choice, if you do both of the following: |
a) Accompany the combined library with a copy of the same work based |
on the Library, uncombined with any other library facilities, |
conveyed under the terms of this License. |
b) Give prominent notice with the combined library that part of it |
is a work based on the Library, and explaining where to find the |
accompanying uncombined form of the same work. |
6. Revised Versions of the GNU Lesser General Public License. |
The Free Software Foundation may publish revised and/or new versions |
of the GNU Lesser General Public License from time to time. Such new |
versions will be similar in spirit to the present version, but may |
differ in detail to address new problems or concerns. |
Each version is given a distinguishing version number. If the |
Library as you received it specifies that a certain numbered version |
of the GNU Lesser General Public License "or any later version" |
applies to it, you have the option of following the terms and |
conditions either of that published version or of any later version |
published by the Free Software Foundation. If the Library as you |
received it does not specify a version number of the GNU Lesser |
General Public License, you may choose any version of the GNU Lesser |
General Public License ever published by the Free Software Foundation. |
If the Library as you received it specifies that a proxy can decide |
whether future versions of the GNU Lesser General Public License shall |
apply, that proxy's public statement of acceptance of any version is |
permanent authorization for you to choose that version for the |
Library. |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/Flight-Ctrl_MEGA644_V0_60.aps |
---|
0,0 → 1,0 |
<AVRStudio><MANAGEMENT><ProjectName>Flight-Ctrl_MEGA644_V0_60</ProjectName><Created>19-Aug-2007 14:38:13</Created><LastEdit>17-Oct-2007 19:33:50</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>19-Aug-2007 14:38:13</Created><Version>4</Version><Build>4, 13, 0, 528</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>Flight-Ctrl_MEGA644_V0_60.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v60SalvoKompassACC\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>AVR Simulator</CURRENT_TARGET><CURRENT_PART>ATmega644.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>main.c</SOURCEFILE><SOURCEFILE>analog.c</SOURCEFILE><SOURCEFILE>eeprom.c</SOURCEFILE><SOURCEFILE>fc.c</SOURCEFILE><SOURCEFILE>GPS.c</SOURCEFILE><SOURCEFILE>menu.c</SOURCEFILE><SOURCEFILE>printf_P.c</SOURCEFILE><SOURCEFILE>rc.c</SOURCEFILE><SOURCEFILE>timer0.c</SOURCEFILE><SOURCEFILE>twimaster.c</SOURCEFILE><SOURCEFILE>uart.c</SOURCEFILE><SOURCEFILE>compass.c</SOURCEFILE><SOURCEFILE>math.c</SOURCEFILE><HEADERFILE>_Settings.h</HEADERFILE><HEADERFILE>analog.h</HEADERFILE><HEADERFILE>fc.h</HEADERFILE><HEADERFILE>gps.h</HEADERFILE><HEADERFILE>main.h</HEADERFILE><HEADERFILE>menu.h</HEADERFILE><HEADERFILE>old_macros.h</HEADERFILE><HEADERFILE>printf_P.h</HEADERFILE><HEADERFILE>rc.h</HEADERFILE><HEADERFILE>Settings.h</HEADERFILE><HEADERFILE>timer0.h</HEADERFILE><HEADERFILE>twimaster.h</HEADERFILE><HEADERFILE>uart.h</HEADERFILE><HEADERFILE>compass.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega644</PART><HEX>1</HEX><LIST>0</LIST><MAP>0</MAP><OUTPUTFILENAME>Flight-Ctrl_MEGA644_V0_60.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>0</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -O0 -fsigned-char</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20070525\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20070525\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/></IOView><Files><File00000><FileId>00000</FileId><FileName>main.c</FileName><Status>1</Status></File00000><File00001><FileId>00001</FileId><FileName>compass.c</FileName><Status>1</Status></File00001><File00002><FileId>00002</FileId><FileName>math.c</FileName><Status>1</Status></File00002><File00003><FileId>00003</FileId><FileName>analog.c</FileName><Status>1</Status></File00003></Files><Workspace><File00000><Position>323 71 1035 624</Position><LineCol>17 0</LineCol></File00000><File00001><Position>336 71 1048 624</Position><LineCol>51 31</LineCol><State>Maximized</State></File00001><File00002><Position>384 138 934 510</Position><LineCol>229 0</LineCol></File00002><File00003><Position>406 160 956 532</Position><LineCol>0 0</LineCol></File00003></Workspace><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio> |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/GPS.c |
---|
0,0 → 1,638 |
/* |
This program (files gps.c and gps.h) is free software; you can redistribute it and/or modify |
it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; |
either version 3 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License and GNU Lesser General Public License for more details. |
You should have received a copy of GNU General Public License (License_GPL.txt) and |
GNU Lesser General Public License (License_LGPL.txt) along with this program. |
If not, see <http://www.gnu.org/licenses/>. |
Please note: All the other files for the project "Mikrokopter" by H.Buss are under the license (license_buss.txt) published by www.mikrokopter.de |
*/ |
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
Peter Muehlenbrock |
Auswertung der Daten vom GPS im ublox Format |
Hold Modus mit PID Regler |
Rückstuerz zur Basis Funktion |
Stand 13.10.2007 |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
*/ |
#include "main.h" |
//#include "gps.h" |
// Defines fuer ublox Messageformat um Auswertung zu steuern |
#define UBLOX_IDLE 0 |
#define UBLOX_SYNC1 1 |
#define UBLOX_SYNC2 2 |
#define UBLOX_CLASS 3 |
#define UBLOX_ID 4 |
#define UBLOX_LEN1 5 |
#define UBLOX_LEN2 6 |
#define UBLOX_CKA 7 |
#define UBLOX_CKB 8 |
#define UBLOX_PAYLOAD 9 |
// ublox Protokoll Identifier |
#define UBLOX_NAV_POSUTM 0x08 |
#define UBLOX_NAV_STATUS 0x03 |
#define UBLOX_NAV_VELED 0x12 |
#define UBLOX_NAV_CLASS 0x01 |
#define UBLOX_SYNCH1_CHAR 0xB5 |
#define UBLOX_SYNCH2_CHAR 0x62 |
signed int GPS_Nick = 0; |
signed int GPS_Roll = 0; |
short int ublox_msg_state = UBLOX_IDLE; |
static uint8_t chk_a =0; //Checksum |
static uint8_t chk_b =0; |
short int gps_state,gps_sub_state; //Zustaende der Statemachine |
short int gps_updte_flag; |
signed int GPS_hdng_abs_2trgt; //Winkel zum Ziel bezogen auf Nordpol |
signed int GPS_hdng_rel_2trgt; //Winkel zum Ziel bezogen auf Nordachse des Kopters |
signed int GPS_dist_2trgt; //vorzeichenlose Distanz zum Ziel |
signed int gps_int_x,gps_int_y,gps_reg_x,gps_reg_y; |
static unsigned int rx_len; |
static unsigned int ptr_payload_data_end; |
unsigned int gps_alive_cnt; // Wird bei jedem gueltigen GPS Telegramm hochgezaehlt |
signed int hdng_2home,dist_2home; //Richtung und Entfernung zur home Position |
static signed gps_tick; //wird bei jedem Update durch das GPS Modul hochgezaehlt |
static short int hold_fast,hold_reset_int; //Flags fuer Hold Regler |
static uint8_t *ptr_payload_data; |
static uint8_t *ptr_pac_status; |
long int dist_flown; |
short int Get_GPS_data(void); |
NAV_POSUTM_t actual_pos; // Aktuelle Nav Daten werden hier im ublox Format abgelegt |
NAV_STATUS_t actual_status; // Aktueller Nav Status |
NAV_VELNED_t actual_speed; // Aktueller Geschwindigkeits und Richtungsdaten |
GPS_ABS_POSITION_t gps_act_position; // Alle wichtigen Daten zusammengefasst |
GPS_ABS_POSITION_t gps_home_position; // Die Startposition, beim Kalibrieren ermittelt |
GPS_REL_POSITION_t gps_rel_act_position; // Die aktuelle relative Position bezogen auf Home Position |
GPS_REL_POSITION_t gps_rel_hold_position; // Die gespeicherte Sollposition fuer GPS_ Hold Mode |
GPS_REL_POSITION_t gps_rel_start_position; // Die gespeicherte Ausgangsposition fuer GPS_ Home Mode |
// Initialisierung |
void GPS_Neutral(void) |
{ |
ublox_msg_state = UBLOX_IDLE; |
gps_state = GPS_CRTL_IDLE; |
gps_sub_state = GPS_CRTL_IDLE; |
actual_pos.status = 0; |
actual_speed.status = 0; |
actual_status.status = 0; |
gps_home_position.status = 0; // Noch keine gueltige Home Position |
gps_act_position.status = 0; |
gps_rel_act_position.status = 0; |
GPS_Nick = 0; |
GPS_Roll = 0; |
gps_updte_flag = 0; |
gps_int_x = 0; |
gps_int_y = 0; |
gps_alive_cnt = 0; |
} |
// Home Position sichern falls Daten verfuegbar sind. |
void GPS_Save_Home(void) |
{ |
short int n; |
n = Get_GPS_data(); |
if (n == 0) // Gueltige und aktuelle Daten ? |
{ |
// Neue GPS Daten liegen vor |
gps_home_position.utm_east = gps_act_position.utm_east; |
gps_home_position.utm_north = gps_act_position.utm_north; |
gps_home_position.utm_alt = gps_act_position.utm_alt; |
gps_home_position.status = 1; // Home Position gueltig |
} |
} |
// Relative Position zur Home Position bestimmen |
// Rueckgabewert 0= Daten sind aktuell und gueltig. 1= Keine Aenderung. 2= Daten ungueltig |
short int Get_Rel_Position(void) |
{ |
short int n = 0; |
n = Get_GPS_data(); |
if (n >=1) return (n); // nix zu tun, weil keine neue Daten da sind |
if (gps_alive_cnt < 400) gps_alive_cnt += 300; // Timeoutzaehler. Wird in Motorregler Routine ueberwacht und dekrementiert |
if (gps_home_position.status > 0) //Nur wenn Home Position vorliegt |
{ |
gps_rel_act_position.utm_east = (int) (gps_act_position.utm_east - gps_home_position.utm_east); |
gps_rel_act_position.utm_north = (int) (gps_act_position.utm_north - gps_home_position.utm_north); |
gps_rel_act_position.status = 1; // gueltige Positionsdaten |
n = 0; |
gps_updte_flag = 1; // zeigt an, dass neue Daten vorliegen. |
} |
else |
{ |
n = 2; //keine gueltigen Daten vorhanden |
gps_rel_act_position.status = 0; //keine gueltige Position weil keine home Position da ist. |
} |
return (n); |
} |
// Daten aus aktuellen ublox Messages extrahieren |
// Rueckgabewert 0= Daten sind aktuell und gueltig. 1= Keine Aenderung. 2= Daten ungueltig |
short int Get_GPS_data(void) |
{ |
short int n = 1; |
if (actual_pos.status == 0) return (1); //damit es schnell geht, wenn nix zu tun ist |
if ((actual_pos.status > 0) && (actual_status.status > 0) && (actual_speed.status > 0)) |
{ |
if (((actual_status.gpsfix_type & 0x03) >=2) && ((actual_status.nav_status_flag & 0x01) >=1)) // nur wenn Daten aktuell und gueltig sind |
{ |
gps_act_position.utm_east = actual_pos.utm_east/10; |
gps_act_position.utm_north = actual_pos.utm_north/10; |
gps_act_position.utm_alt = actual_pos.utm_alt/10; |
gps_act_position.speed_gnd = actual_speed.speed_gnd/10; |
gps_act_position.speed_gnd = actual_speed.speed_gnd/10; |
gps_act_position.heading = actual_speed.heading/100000; |
gps_act_position.status = 1; |
n = 0; //Daten gueltig |
} |
else |
{ |
gps_act_position.status = 0; //Keine gueltigen Daten |
n = 2; |
} |
actual_pos.status = 0; //neue ublox Messages anfordern |
actual_status.status = 0; |
actual_speed.status = 0; |
} |
return (n); |
} |
/* |
Daten vom GPS im ublox MSG Format auswerten |
Die Routine wird bei jedem Empfang eines Zeichens vom GPS Modul durch den UART IRQ aufgerufen |
// Die UBX Messages NAV_POSUTM, NAV_STATUS und NAV_VALED muessen aktiviert sein |
*/ |
void Get_Ublox_Msg(uint8_t rx) |
{ |
switch (ublox_msg_state) |
{ |
case UBLOX_IDLE: // Zuerst Synchcharacters pruefen |
if ( rx == UBLOX_SYNCH1_CHAR ) ublox_msg_state = UBLOX_SYNC1; |
else ublox_msg_state = UBLOX_IDLE; |
break; |
case UBLOX_SYNC1: |
if (rx == UBLOX_SYNCH2_CHAR) ublox_msg_state = UBLOX_SYNC2; |
else ublox_msg_state = UBLOX_IDLE; |
chk_a = 0,chk_b = 0; |
break; |
case UBLOX_SYNC2: |
if (rx == UBLOX_NAV_CLASS) ublox_msg_state = UBLOX_CLASS; |
else ublox_msg_state = UBLOX_IDLE; |
break; |
case UBLOX_CLASS: // Nur NAV Meldungen auswerten |
switch (rx) |
{ |
case UBLOX_NAV_POSUTM: |
ptr_pac_status = &actual_pos.status; |
if (*ptr_pac_status > 0) ublox_msg_state = UBLOX_IDLE; //Abbruch weil Daten noch nicht verwendet wurden |
else |
{ |
ptr_payload_data = &actual_pos; |
ptr_payload_data_end = &actual_pos.status; |
ublox_msg_state = UBLOX_LEN1; |
} |
break; |
case UBLOX_NAV_STATUS: |
ptr_pac_status = &actual_status.status; |
if (*ptr_pac_status > 0) ublox_msg_state = UBLOX_IDLE; |
else |
{ |
ptr_payload_data = &actual_status; |
ptr_payload_data_end = &actual_status.status; |
ublox_msg_state = UBLOX_LEN1; |
} |
break; |
case UBLOX_NAV_VELED: |
ptr_pac_status = &actual_speed.status; |
if (*ptr_pac_status > 0) ublox_msg_state = UBLOX_IDLE; |
else |
{ |
ptr_payload_data = &actual_speed; |
ptr_payload_data_end = &actual_speed.status; |
ublox_msg_state = UBLOX_LEN1; |
} |
break; |
default: |
ublox_msg_state = UBLOX_IDLE; |
break; |
} |
chk_a = UBLOX_NAV_CLASS + rx; |
chk_b = UBLOX_NAV_CLASS + chk_a; |
break; |
case UBLOX_LEN1: // Laenge auswerten |
rx_len = rx; |
chk_a += rx; |
chk_b += chk_a; |
ublox_msg_state = UBLOX_LEN2; |
break; |
case UBLOX_LEN2: // Laenge auswerten |
rx_len = rx_len + (rx *256); // Laenge ermitteln |
chk_a += rx; |
chk_b += chk_a; |
ublox_msg_state = UBLOX_PAYLOAD; |
break; |
case UBLOX_PAYLOAD: // jetzt Nutzdaten einlesen |
if (rx_len > 0) |
{ |
*ptr_payload_data = rx; |
chk_a += rx; |
chk_b += chk_a; |
--rx_len; |
if ((rx_len > 0) && (ptr_payload_data <= ptr_payload_data_end)) |
{ |
ptr_payload_data++; |
ublox_msg_state = UBLOX_PAYLOAD; |
} |
else ublox_msg_state = UBLOX_CKA; |
} |
else ublox_msg_state = UBLOX_IDLE; // Abbruch wegen Fehler |
break; |
case UBLOX_CKA: // Checksum pruefen |
if (rx == chk_a) ublox_msg_state = UBLOX_CKB; |
else ublox_msg_state = UBLOX_IDLE; // Abbruch wegen Fehler |
break; |
case UBLOX_CKB: // Checksum pruefen |
if (rx == chk_b) *ptr_pac_status = 1; // Paket ok |
ublox_msg_state = UBLOX_IDLE; |
break; |
default: |
ublox_msg_state = UBLOX_IDLE; |
break; |
} |
} |
//Zentrale Statemachine fuer alle GPS relevanten Regelungsablauefe |
short int GPS_CRTL(short int cmd) |
{ |
static unsigned int cnt; //Zaehler fuer diverse Verzoegerungen |
static signed int int_east,int_north; //Integrierer |
static signed int dist_north,dist_east; |
static signed int diff_east,diff_north; // Differenzierer (Differenz zum vorhergehenden x bzw. y Wert) |
static signed int diff_east_f,diff_north_f; // Differenzierer, gefiltert |
signed int n,diff_v; |
static signed int gps_g2t_act_v; // Aktuelle Geschwindigkeitsvorgabe fuer Home Funktion |
long signed int dev,n_l; |
signed int dist_frm_start_east,dist_frm_start_north; |
switch (cmd) |
{ |
case GPS_CMD_REQ_HOME: // Es soll zum Startpunkt zurueckgeflogen werden. |
if ((gps_state != GPS_CRTL_HOLD_ACTIVE) && (gps_state != GPS_CRTL_HOME_ACTIVE)) |
{ |
cnt++; |
if (cnt > 500) // erst nach Verzoegerung |
{ |
// Erst mal initialisieren |
cnt = 0; |
gps_tick = 0; |
hold_fast = 0; |
hold_reset_int = 0; // Integrator enablen |
int_east = 0, int_north = 0; |
gps_reg_x = 0, gps_reg_y = 0; |
dist_east = 0, dist_north = 0; |
diff_east_f = 0, diff_north_f= 0; |
diff_east = 0, diff_north = 0; |
dist_flown = 0; |
gps_g2t_act_v = 0; |
gps_sub_state = GPS_CRTL_IDLE; |
// aktuelle positionsdaten abspeichern |
if (gps_rel_act_position.status > 0) |
{ |
gps_rel_start_position.utm_east = gps_rel_act_position.utm_east; |
gps_rel_start_position.utm_north= gps_rel_act_position.utm_north; |
gps_rel_start_position.status = 1; // gueltige Positionsdaten |
gps_rel_hold_position.utm_east = gps_rel_act_position.utm_east; |
gps_rel_hold_position.utm_north = gps_rel_act_position.utm_north; |
gps_rel_hold_position.status = 1; // gueltige Positionsdaten |
//Richtung zur Home Position bezogen auf Nordpol bestimmen |
hdng_2home = arctan_i(-gps_rel_start_position.utm_east,-gps_rel_start_position.utm_north); |
// in Winkel 0...360 Grad umrechnen |
if (( gps_rel_start_position.utm_east < 0)) hdng_2home = ( 90-hdng_2home); |
else hdng_2home = (270 - hdng_2home); |
dist_2home = (int) get_dist(gps_rel_start_position.utm_east,gps_rel_start_position.utm_north,hdng_2home); //Entfernung zur Home Position bestimmen |
gps_state = GPS_CRTL_HOME_ACTIVE; |
return (GPS_STST_OK); |
} |
else |
{ |
gps_rel_start_position.status = 0; //Keine Daten verfuegbar |
gps_state = GPS_CRTL_IDLE; |
return(GPS_STST_ERR); // Keine Daten da |
} |
} |
else return(GPS_STST_PEND); // noch warten |
} |
break; |
// ****************************** |
case GPS_CMD_REQ_HOLD: // Die Lageregelung soll aktiviert werden. |
if (gps_state != GPS_CRTL_HOLD_ACTIVE) |
{ |
cnt++; |
if (cnt > 500) // erst nach Verzoegerung |
{ |
cnt = 0; |
// aktuelle positionsdaten abspeichern |
if (gps_rel_act_position.status > 0) |
{ |
hold_fast = 0; |
hold_reset_int = 0; // Integrator enablen |
int_east = 0, int_north = 0; |
gps_reg_x = 0, gps_reg_y = 0; |
dist_east = 0, dist_north = 0; |
diff_east_f = 0, diff_north_f= 0; |
diff_east = 0, diff_north = 0; |
gps_rel_hold_position.utm_east = gps_rel_act_position.utm_east; |
gps_rel_hold_position.utm_north = gps_rel_act_position.utm_north; |
gps_rel_hold_position.status = 1; // gueltige Positionsdaten |
gps_state = GPS_CRTL_HOLD_ACTIVE; |
return (GPS_STST_OK); |
} |
else |
{ |
gps_rel_hold_position.status = 0; //Keine Daten verfuegbar |
gps_state = GPS_CRTL_IDLE; |
return(GPS_STST_ERR); // Keine Daten da |
} |
} |
else return(GPS_STST_PEND); // noch warten |
} |
break; |
case GPS_CMD_STOP: // Lageregelung beenden |
cnt = 0; |
GPS_Nick = 0; |
GPS_Roll = 0; |
gps_int_x = 0; |
gps_int_y = 0; |
gps_sub_state = GPS_CRTL_IDLE; |
gps_state = GPS_CRTL_IDLE; |
return (GPS_STST_OK); |
break; |
default: |
return (GPS_STST_ERR); |
break; |
} |
switch (gps_state) |
{ |
case GPS_CRTL_IDLE: |
cnt = 0; |
return (GPS_STST_OK); |
break; |
case GPS_CRTL_HOME_ACTIVE: // Rueckflug zur Basis |
//Der Sollwert des Lagereglers wird der Homeposition angenaehert |
if (gps_rel_start_position.status >0) |
{ |
if ((gps_updte_flag > 0) && (gps_sub_state !=GPS_HOME_FINISHED)) // nur wenn neue GPS Daten vorliegen und nicht schon alles fertig ist |
{ |
gps_tick++; |
int d1,d2,d3; |
d1 = abs (gps_rel_hold_position.utm_east - gps_rel_act_position.utm_east ); |
d2 = abs (gps_rel_hold_position.utm_north - gps_rel_act_position.utm_north ); |
d3 = (dist_2home - (int)dist_flown); // Restdistanz zum Ziel |
if (d3 > GPS_G2T_DIST_MAX_STOP) // Schneller Rueckflug, noch weit weg vom Ziel |
{ |
if ((d1 < GPS_G2T_FAST_TOL) && (d2 < GPS_G2T_FAST_TOL)) //nur weiter wenn Lage innerhalb der Toleranz |
{ |
if (gps_g2t_act_v < GPS_G2T_V_MAX) gps_g2t_act_v++; //Geschwindigkeit langsam erhoehen |
dist_flown +=(long)gps_g2t_act_v; // Vorgabe der Strecke anhand der Geschwindigkeit |
gps_sub_state = GPS_HOME_FAST_IN_TOL; |
} |
else //Den Lageregler in Ruhe arbeiten lassen weil ausserhalb der Toleranz |
{ |
if (gps_g2t_act_v > 1) gps_g2t_act_v--; // Geschwindigkeit reduzieren |
dist_flown++; //Auch ausserhalb der Toleranz langsam erhoehen |
gps_sub_state = GPS_HOME_FAST_OUTOF_TOL; |
} |
hold_fast = 1; // Regler fuer schnellen Flug |
hold_reset_int = 1; // Integrator ausschalten |
dist_frm_start_east = (int)((dist_flown * (long)sin_i(hdng_2home))/1000); |
dist_frm_start_north = (int)((dist_flown * (long)cos_i(hdng_2home))/1000); |
gps_rel_hold_position.utm_east = gps_rel_start_position.utm_east + dist_frm_start_east; //naechster Zielpunkt |
gps_rel_hold_position.utm_north = gps_rel_start_position.utm_north + dist_frm_start_north; //naechster Zielpunkt |
} |
else if (d3 > GPS_G2T_DIST_HOLD) //Das Ziel naehert sich, deswegen abbremsen |
{ |
if ((d1 < GPS_G2T_NRML_TOL) && (d2 < GPS_G2T_NRML_TOL)) |
{ |
dist_flown += GPS_G2T_V_RAMP_DWN; // Vorgabe der Strecke anhand der Geschwindigkeit |
gps_sub_state = GPS_HOME_RMPDWN_IN_TOL; |
} |
else |
{ |
dist_flown++; //Auch ausserhalb der Toleranz langsam erhoehen |
gps_sub_state = GPS_HOME_RMPDWN_OUTOF_TOL; |
} |
hold_fast = 0; // Wieder normal regeln |
hold_reset_int = 1; // Integrator ausschalten |
dist_frm_start_east = (int)((dist_flown * (long)sin_i(hdng_2home))/1000); |
dist_frm_start_north = (int)((dist_flown * (long)cos_i(hdng_2home))/1000); |
gps_rel_hold_position.utm_east = gps_rel_start_position.utm_east + dist_frm_start_east; //naechster Zielpunkt |
gps_rel_hold_position.utm_north = gps_rel_start_position.utm_north + dist_frm_start_north; //naechster Zielpunkt |
} |
else //Soll-Ziel fast erreicht, Jetzt noch Reste ausgleichen, weil Zielpunkt nicht exakt bestimmt werden konnte (Fehler in Winkelfkt) |
{ |
if ((d1 < GPS_G2T_NRML_TOL) && (d2 < GPS_G2T_NRML_TOL)) // Jetzt bis zum Zielpunkt regeln |
{ |
gps_sub_state = GPS_HOME_IN_TOL; |
hold_fast = 0; // Wieder normal regeln |
hold_reset_int = 0; // Integrator wieder aktivieren |
if (gps_rel_hold_position.utm_east >= GPS_G2T_V_MIN) gps_rel_hold_position.utm_east -= GPS_G2T_V_MIN; |
else if (gps_rel_hold_position.utm_east <= -GPS_G2T_V_MIN ) gps_rel_hold_position.utm_east += GPS_G2T_V_MIN; |
if (gps_rel_hold_position.utm_north >= GPS_G2T_V_MIN) gps_rel_hold_position.utm_north -= GPS_G2T_V_MIN; |
else if (gps_rel_hold_position.utm_north <= - GPS_G2T_V_MIN ) gps_rel_hold_position.utm_north += GPS_G2T_V_MIN; |
if ((abs(gps_rel_hold_position.utm_east) <= GPS_G2T_V_MIN) && (abs(gps_rel_hold_position.utm_north) <=GPS_G2T_V_MIN)) |
{ |
gps_rel_hold_position.utm_east = 0; |
gps_rel_hold_position.utm_north = 0; |
gps_sub_state = GPS_HOME_FINISHED; |
} |
} |
else gps_sub_state = GPS_HOME_OUTOF_TOL; |
} |
} |
gps_state = GPS_CRTL_HOLD_ACTIVE; //Zwischensprung |
return (GPS_STST_OK); |
} |
else // Keine GPS Daten verfuegbar, deswegen Abbruch |
{ |
gps_state = GPS_CRTL_IDLE; |
return (GPS_STST_ERR); |
} |
break; |
case GPS_CRTL_HOLD_ACTIVE: // Hier werden die Daten fuer Nick und Roll errechnet |
if (gps_updte_flag >0) // nur wenn neue GPS Daten vorliegen |
{ |
gps_updte_flag = 0; |
// ab hier wird geregelt |
diff_east = -dist_east; //Alten Wert fuer Differenzier schon mal abziehen |
diff_north = -dist_north; |
dist_east = gps_rel_hold_position.utm_east - gps_rel_act_position.utm_east; |
dist_north = gps_rel_hold_position.utm_north - gps_rel_act_position.utm_north; |
int_east += dist_east; |
int_north += dist_north; |
diff_east += dist_east; // Differenz zur vorhergehenden East Position |
diff_north += dist_north; // Differenz zur vorhergehenden North Position |
if (hold_fast > 0) // wegen Sollpositionsspruengen im Fast Mode Differenzierer daempfen |
{ |
diff_east_f = ((diff_east_f *2)/3) + (diff_east *1/3); //Differenzierer filtern |
diff_north_f = ((diff_north_f *2)/3) + (diff_north*1/3); //Differenzierer filtern |
} |
else // schwache Filterung |
{ |
diff_east_f = ((diff_east_f * 1)/4) + ((diff_east *3)/4); //Differenzierer filtern |
diff_north_f = ((diff_north_f * 1)/4) + ((diff_north*3)/4); //Differenzierer filtern |
} |
#define GPSINT_MAX 30000 //neuer Wert ab 7.10.2007 Begrenzung |
if ((abs(int_east) > GPSINT_MAX) || (abs(int_north)> GPSINT_MAX)) //Bei zu hohem Wert Integrator auf Wert halten |
{ |
int_east -= dist_east; |
int_north -= dist_north; |
} |
if (hold_reset_int > 0) //Im Schnellen Mode Integrator abschalten |
{ |
int_east = 0; |
int_north = 0; |
} |
// Variable Verstarkung fuer Differenzierer ermitteln. Je weiter vom Ziel wir entfernt sind |
// desto groesser wird der Faktor. Es gibt aber einen Maximalwert. Bei 0 ist die Verstaerkung immer 1 |
signed long dist,int_east1,int_north1; |
int phi; |
phi = arctan_i(abs(dist_north),abs(dist_east)); |
dist = get_dist(dist_east,dist_north,phi); //Zunaechst Entfernung zum Ziel ermitteln |
if (hold_fast == 0) // je Nach Modus andere Verstaerkungskurve fuer Differenzierer |
{ |
diff_v = (int)((dist * (GPS_DIFF_NRML_MAX_V - 10)) / GPS_DIFF_NRML_MAX_D) +10; //Verstaerkung * 10 |
if (diff_v > GPS_DIFF_NRML_MAX_V) diff_v = GPS_DIFF_NRML_MAX_V; //begrenzen |
} |
else |
{ |
diff_v = (int)((dist * (GPS_DIFF_FAST_MAX_V - 10)) / GPS_DIFF_FAST_MAX_D) +10; //Verstaerkung * 10 |
if (diff_v > GPS_DIFF_FAST_MAX_V) diff_v = GPS_DIFF_FAST_MAX_V; //begrenzen |
} |
int diff_p; //Vom Modus abhaengige zusaetzliche Verstaerkung |
if (hold_fast > 0) diff_p = GPS_PROP_FAST_V; |
else diff_p = GPS_PROP_NRML_V; |
//I Werte begrenzen |
#define INT1_MAX (20 * GPS_V) |
int_east1 = ((((long)int_east) * Parameter_UserParam2)/32); |
int_north = ((((long)int_north) * Parameter_UserParam2)/32); |
if (int_east1 > INT1_MAX) int_east1 = INT1_MAX; //begrenzen |
else if (int_east1 < -INT1_MAX) int_east1 = -INT1_MAX; |
if (int_north1 > INT1_MAX) int_north1 = INT1_MAX; //begrenzen |
else if (int_north1 < -INT1_MAX) int_north1 = -INT1_MAX; |
//PID Regler Werte aufsummieren |
gps_reg_x = ((int)int_east1 + ((dist_east * Parameter_UserParam1 * diff_p)/(8*2))+ ((diff_east_f * diff_v * Parameter_UserParam3)/10)); // I + P +D Anteil X Achse |
gps_reg_y = ((int)int_north1 + ((dist_north * Parameter_UserParam1 * diff_p)/(8*2))+ ((diff_north_f * diff_v * Parameter_UserParam3)/10)); // I + P +D Anteil Y Achse |
//Ziel-Richtung bezogen auf Nordpol bestimmen |
GPS_hdng_abs_2trgt = arctan_i(gps_reg_x,gps_reg_y); |
// in Winkel 0...360 Grad umrechnen |
if ((gps_reg_x >= 0)) GPS_hdng_abs_2trgt = ( 90-GPS_hdng_abs_2trgt); |
else GPS_hdng_abs_2trgt = (270 - GPS_hdng_abs_2trgt); |
// Relative Richtung in bezug auf Nordachse des Kopters errechen |
//n= GyroKomp_Int/GYROKOMP_INC_GRAD_DEFAULT; |
n= KompassValue; |
GPS_hdng_rel_2trgt = GPS_hdng_abs_2trgt - n; |
if ((GPS_hdng_rel_2trgt >180) && (GPS_hdng_abs_2trgt >=180)) GPS_hdng_rel_2trgt = GPS_hdng_rel_2trgt-360; |
else if (GPS_hdng_rel_2trgt >180) GPS_hdng_rel_2trgt = 360 - GPS_hdng_rel_2trgt; |
else if (GPS_hdng_rel_2trgt <-180) GPS_hdng_rel_2trgt = 360 + GPS_hdng_rel_2trgt; |
// Regelabweichung aus x,y zu Ziel in Distanz umrechnen |
if (abs(gps_reg_x) > abs(gps_reg_y) ) |
{ |
dev = (long)gps_reg_x; //Groesseren Wert wegen besserer Genauigkeit nehmen |
dev = abs((dev *1000) / (long) sin_i(GPS_hdng_abs_2trgt)); |
} |
else |
{ |
dev = (long)gps_reg_y; |
dev = abs((dev *1000) / (long) cos_i(GPS_hdng_abs_2trgt)); |
} |
GPS_dist_2trgt = (int) dev; |
// Winkel und Distanz in Nick und Rollgroessen umrechnen |
GPS_Roll = (int) +( (dev * (long) sin_i(GPS_hdng_rel_2trgt))/1000); |
GPS_Nick = (int) -( (dev * (long) cos_i(GPS_hdng_rel_2trgt))/1000); |
if (GPS_Roll > (GPS_NICKROLL_MAX * GPS_V)) GPS_Roll = (GPS_NICKROLL_MAX * GPS_V); |
else if (GPS_Roll < -(GPS_NICKROLL_MAX * GPS_V)) GPS_Roll = -(GPS_NICKROLL_MAX * GPS_V); |
if (GPS_Nick > (GPS_NICKROLL_MAX * GPS_V)) GPS_Nick = (GPS_NICKROLL_MAX * GPS_V); |
else if (GPS_Nick < -(GPS_NICKROLL_MAX * GPS_V)) GPS_Nick = -(GPS_NICKROLL_MAX * GPS_V); |
//Kleine Werte verstaerken, Grosse abschwaechen |
n = sin_i((GPS_Roll*90)/(GPS_NICKROLL_MAX * GPS_V)); |
n_l = ((long) GPS_NICKROLL_MAX * (long) n)/1000; |
GPS_Roll = (int) n_l; |
n = sin_i((GPS_Nick*90)/(GPS_NICKROLL_MAX * GPS_V)); |
n_l = ((long) GPS_NICKROLL_MAX * (long) n)/1000; |
GPS_Nick = (int) n_l; |
if ((abs(dist_east) > GPS_DIST_MAX) || (abs(dist_north) > GPS_DIST_MAX)) // bei zu grossem Abstand abbrechen |
{ |
GPS_Roll = 0; |
GPS_Nick = 0; |
gps_state = GPS_CRTL_IDLE; |
return (GPS_STST_ERR); |
break; |
} |
else |
{ |
if ( cmd == GPS_CMD_REQ_HOME ) gps_state = GPS_CRTL_HOME_ACTIVE; // State umsetzen |
return (GPS_STST_OK); |
} |
} |
else |
{ |
if ( cmd == GPS_CMD_REQ_HOME ) gps_state = GPS_CRTL_HOME_ACTIVE; // State umsetzen |
return (GPS_STST_OK); |
} |
break; |
default: |
gps_state = GPS_CRTL_IDLE; |
return (GPS_STST_ERR); |
break; |
} |
return (GPS_STST_ERR); |
} |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/License.txt |
---|
0,0 → 1,52 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + Nur für den privaten Gebrauch |
// + www.MikroKopter.com |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
// + dass eine Nutzung (auch auszugsweise) nur für den privaten und nichtkommerziellen Gebrauch zulässig ist. |
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
// + bzgl. der Nutzungsbedingungen aufzunehmen. |
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
// + Verkauf von Luftbildaufnahmen, usw. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
// + eindeutig als Ursprung verlinkt und genannt werden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
// + Benutzung auf eigene Gefahr |
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
// + mit unserer Zustimmung zulässig |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
// + this list of conditions and the following disclaimer. |
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
// + from this software without specific prior written permission. |
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
// + for non-profit use (directly or indirectly) |
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
// + with our written permission |
// + * If sources or documentations are redistributet, our webpage (http://www.MikroKopter.de) must be |
// + clearly linked and named as origin |
// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/License_GPL.txt |
---|
0,0 → 1,674 |
GNU GENERAL PUBLIC LICENSE |
Version 3, 29 June 2007 |
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> |
Everyone is permitted to copy and distribute verbatim copies |
of this license document, but changing it is not allowed. |
Preamble |
The GNU General Public License is a free, copyleft license for |
software and other kinds of works. |
The licenses for most software and other practical works are designed |
to take away your freedom to share and change the works. By contrast, |
the GNU General Public License is intended to guarantee your freedom to |
share and change all versions of a program--to make sure it remains free |
software for all its users. We, the Free Software Foundation, use the |
GNU General Public License for most of our software; it applies also to |
any other work released this way by its authors. You can apply it to |
your programs, too. |
When we speak of free software, we are referring to freedom, not |
price. Our General Public Licenses are designed to make sure that you |
have the freedom to distribute copies of free software (and charge for |
them if you wish), that you receive source code or can get it if you |
want it, that you can change the software or use pieces of it in new |
free programs, and that you know you can do these things. |
To protect your rights, we need to prevent others from denying you |
these rights or asking you to surrender the rights. Therefore, you have |
certain responsibilities if you distribute copies of the software, or if |
you modify it: responsibilities to respect the freedom of others. |
For example, if you distribute copies of such a program, whether |
gratis or for a fee, you must pass on to the recipients the same |
freedoms that you received. You must make sure that they, too, receive |
or can get the source code. And you must show them these terms so they |
know their rights. |
Developers that use the GNU GPL protect your rights with two steps: |
(1) assert copyright on the software, and (2) offer you this License |
giving you legal permission to copy, distribute and/or modify it. |
For the developers' and authors' protection, the GPL clearly explains |
that there is no warranty for this free software. For both users' and |
authors' sake, the GPL requires that modified versions be marked as |
changed, so that their problems will not be attributed erroneously to |
authors of previous versions. |
Some devices are designed to deny users access to install or run |
modified versions of the software inside them, although the manufacturer |
can do so. This is fundamentally incompatible with the aim of |
protecting users' freedom to change the software. The systematic |
pattern of such abuse occurs in the area of products for individuals to |
use, which is precisely where it is most unacceptable. Therefore, we |
have designed this version of the GPL to prohibit the practice for those |
products. If such problems arise substantially in other domains, we |
stand ready to extend this provision to those domains in future versions |
of the GPL, as needed to protect the freedom of users. |
Finally, every program is threatened constantly by software patents. |
States should not allow patents to restrict development and use of |
software on general-purpose computers, but in those that do, we wish to |
avoid the special danger that patents applied to a free program could |
make it effectively proprietary. To prevent this, the GPL assures that |
patents cannot be used to render the program non-free. |
The precise terms and conditions for copying, distribution and |
modification follow. |
TERMS AND CONDITIONS |
0. Definitions. |
"This License" refers to version 3 of the GNU General Public License. |
"Copyright" also means copyright-like laws that apply to other kinds of |
works, such as semiconductor masks. |
"The Program" refers to any copyrightable work licensed under this |
License. Each licensee is addressed as "you". "Licensees" and |
"recipients" may be individuals or organizations. |
To "modify" a work means to copy from or adapt all or part of the work |
in a fashion requiring copyright permission, other than the making of an |
exact copy. The resulting work is called a "modified version" of the |
earlier work or a work "based on" the earlier work. |
A "covered work" means either the unmodified Program or a work based |
on the Program. |
To "propagate" a work means to do anything with it that, without |
permission, would make you directly or secondarily liable for |
infringement under applicable copyright law, except executing it on a |
computer or modifying a private copy. Propagation includes copying, |
distribution (with or without modification), making available to the |
public, and in some countries other activities as well. |
To "convey" a work means any kind of propagation that enables other |
parties to make or receive copies. Mere interaction with a user through |
a computer network, with no transfer of a copy, is not conveying. |
An interactive user interface displays "Appropriate Legal Notices" |
to the extent that it includes a convenient and prominently visible |
feature that (1) displays an appropriate copyright notice, and (2) |
tells the user that there is no warranty for the work (except to the |
extent that warranties are provided), that licensees may convey the |
work under this License, and how to view a copy of this License. If |
the interface presents a list of user commands or options, such as a |
menu, a prominent item in the list meets this criterion. |
1. Source Code. |
The "source code" for a work means the preferred form of the work |
for making modifications to it. "Object code" means any non-source |
form of a work. |
A "Standard Interface" means an interface that either is an official |
standard defined by a recognized standards body, or, in the case of |
interfaces specified for a particular programming language, one that |
is widely used among developers working in that language. |
The "System Libraries" of an executable work include anything, other |
than the work as a whole, that (a) is included in the normal form of |
packaging a Major Component, but which is not part of that Major |
Component, and (b) serves only to enable use of the work with that |
Major Component, or to implement a Standard Interface for which an |
implementation is available to the public in source code form. A |
"Major Component", in this context, means a major essential component |
(kernel, window system, and so on) of the specific operating system |
(if any) on which the executable work runs, or a compiler used to |
produce the work, or an object code interpreter used to run it. |
The "Corresponding Source" for a work in object code form means all |
the source code needed to generate, install, and (for an executable |
work) run the object code and to modify the work, including scripts to |
control those activities. However, it does not include the work's |
System Libraries, or general-purpose tools or generally available free |
programs which are used unmodified in performing those activities but |
which are not part of the work. For example, Corresponding Source |
includes interface definition files associated with source files for |
the work, and the source code for shared libraries and dynamically |
linked subprograms that the work is specifically designed to require, |
such as by intimate data communication or control flow between those |
subprograms and other parts of the work. |
The Corresponding Source need not include anything that users |
can regenerate automatically from other parts of the Corresponding |
Source. |
The Corresponding Source for a work in source code form is that |
same work. |
2. Basic Permissions. |
All rights granted under this License are granted for the term of |
copyright on the Program, and are irrevocable provided the stated |
conditions are met. This License explicitly affirms your unlimited |
permission to run the unmodified Program. The output from running a |
covered work is covered by this License only if the output, given its |
content, constitutes a covered work. This License acknowledges your |
rights of fair use or other equivalent, as provided by copyright law. |
You may make, run and propagate covered works that you do not |
convey, without conditions so long as your license otherwise remains |
in force. You may convey covered works to others for the sole purpose |
of having them make modifications exclusively for you, or provide you |
with facilities for running those works, provided that you comply with |
the terms of this License in conveying all material for which you do |
not control copyright. Those thus making or running the covered works |
for you must do so exclusively on your behalf, under your direction |
and control, on terms that prohibit them from making any copies of |
your copyrighted material outside their relationship with you. |
Conveying under any other circumstances is permitted solely under |
the conditions stated below. Sublicensing is not allowed; section 10 |
makes it unnecessary. |
3. Protecting Users' Legal Rights From Anti-Circumvention Law. |
No covered work shall be deemed part of an effective technological |
measure under any applicable law fulfilling obligations under article |
11 of the WIPO copyright treaty adopted on 20 December 1996, or |
similar laws prohibiting or restricting circumvention of such |
measures. |
When you convey a covered work, you waive any legal power to forbid |
circumvention of technological measures to the extent such circumvention |
is effected by exercising rights under this License with respect to |
the covered work, and you disclaim any intention to limit operation or |
modification of the work as a means of enforcing, against the work's |
users, your or third parties' legal rights to forbid circumvention of |
technological measures. |
4. Conveying Verbatim Copies. |
You may convey verbatim copies of the Program's source code as you |
receive it, in any medium, provided that you conspicuously and |
appropriately publish on each copy an appropriate copyright notice; |
keep intact all notices stating that this License and any |
non-permissive terms added in accord with section 7 apply to the code; |
keep intact all notices of the absence of any warranty; and give all |
recipients a copy of this License along with the Program. |
You may charge any price or no price for each copy that you convey, |
and you may offer support or warranty protection for a fee. |
5. Conveying Modified Source Versions. |
You may convey a work based on the Program, or the modifications to |
produce it from the Program, in the form of source code under the |
terms of section 4, provided that you also meet all of these conditions: |
a) The work must carry prominent notices stating that you modified |
it, and giving a relevant date. |
b) The work must carry prominent notices stating that it is |
released under this License and any conditions added under section |
7. This requirement modifies the requirement in section 4 to |
"keep intact all notices". |
c) You must license the entire work, as a whole, under this |
License to anyone who comes into possession of a copy. This |
License will therefore apply, along with any applicable section 7 |
additional terms, to the whole of the work, and all its parts, |
regardless of how they are packaged. This License gives no |
permission to license the work in any other way, but it does not |
invalidate such permission if you have separately received it. |
d) If the work has interactive user interfaces, each must display |
Appropriate Legal Notices; however, if the Program has interactive |
interfaces that do not display Appropriate Legal Notices, your |
work need not make them do so. |
A compilation of a covered work with other separate and independent |
works, which are not by their nature extensions of the covered work, |
and which are not combined with it such as to form a larger program, |
in or on a volume of a storage or distribution medium, is called an |
"aggregate" if the compilation and its resulting copyright are not |
used to limit the access or legal rights of the compilation's users |
beyond what the individual works permit. Inclusion of a covered work |
in an aggregate does not cause this License to apply to the other |
parts of the aggregate. |
6. Conveying Non-Source Forms. |
You may convey a covered work in object code form under the terms |
of sections 4 and 5, provided that you also convey the |
machine-readable Corresponding Source under the terms of this License, |
in one of these ways: |
a) Convey the object code in, or embodied in, a physical product |
(including a physical distribution medium), accompanied by the |
Corresponding Source fixed on a durable physical medium |
customarily used for software interchange. |
b) Convey the object code in, or embodied in, a physical product |
(including a physical distribution medium), accompanied by a |
written offer, valid for at least three years and valid for as |
long as you offer spare parts or customer support for that product |
model, to give anyone who possesses the object code either (1) a |
copy of the Corresponding Source for all the software in the |
product that is covered by this License, on a durable physical |
medium customarily used for software interchange, for a price no |
more than your reasonable cost of physically performing this |
conveying of source, or (2) access to copy the |
Corresponding Source from a network server at no charge. |
c) Convey individual copies of the object code with a copy of the |
written offer to provide the Corresponding Source. This |
alternative is allowed only occasionally and noncommercially, and |
only if you received the object code with such an offer, in accord |
with subsection 6b. |
d) Convey the object code by offering access from a designated |
place (gratis or for a charge), and offer equivalent access to the |
Corresponding Source in the same way through the same place at no |
further charge. You need not require recipients to copy the |
Corresponding Source along with the object code. If the place to |
copy the object code is a network server, the Corresponding Source |
may be on a different server (operated by you or a third party) |
that supports equivalent copying facilities, provided you maintain |
clear directions next to the object code saying where to find the |
Corresponding Source. Regardless of what server hosts the |
Corresponding Source, you remain obligated to ensure that it is |
available for as long as needed to satisfy these requirements. |
e) Convey the object code using peer-to-peer transmission, provided |
you inform other peers where the object code and Corresponding |
Source of the work are being offered to the general public at no |
charge under subsection 6d. |
A separable portion of the object code, whose source code is excluded |
from the Corresponding Source as a System Library, need not be |
included in conveying the object code work. |
A "User Product" is either (1) a "consumer product", which means any |
tangible personal property which is normally used for personal, family, |
or household purposes, or (2) anything designed or sold for incorporation |
into a dwelling. In determining whether a product is a consumer product, |
doubtful cases shall be resolved in favor of coverage. For a particular |
product received by a particular user, "normally used" refers to a |
typical or common use of that class of product, regardless of the status |
of the particular user or of the way in which the particular user |
actually uses, or expects or is expected to use, the product. A product |
is a consumer product regardless of whether the product has substantial |
commercial, industrial or non-consumer uses, unless such uses represent |
the only significant mode of use of the product. |
"Installation Information" for a User Product means any methods, |
procedures, authorization keys, or other information required to install |
and execute modified versions of a covered work in that User Product from |
a modified version of its Corresponding Source. The information must |
suffice to ensure that the continued functioning of the modified object |
code is in no case prevented or interfered with solely because |
modification has been made. |
If you convey an object code work under this section in, or with, or |
specifically for use in, a User Product, and the conveying occurs as |
part of a transaction in which the right of possession and use of the |
User Product is transferred to the recipient in perpetuity or for a |
fixed term (regardless of how the transaction is characterized), the |
Corresponding Source conveyed under this section must be accompanied |
by the Installation Information. But this requirement does not apply |
if neither you nor any third party retains the ability to install |
modified object code on the User Product (for example, the work has |
been installed in ROM). |
The requirement to provide Installation Information does not include a |
requirement to continue to provide support service, warranty, or updates |
for a work that has been modified or installed by the recipient, or for |
the User Product in which it has been modified or installed. Access to a |
network may be denied when the modification itself materially and |
adversely affects the operation of the network or violates the rules and |
protocols for communication across the network. |
Corresponding Source conveyed, and Installation Information provided, |
in accord with this section must be in a format that is publicly |
documented (and with an implementation available to the public in |
source code form), and must require no special password or key for |
unpacking, reading or copying. |
7. Additional Terms. |
"Additional permissions" are terms that supplement the terms of this |
License by making exceptions from one or more of its conditions. |
Additional permissions that are applicable to the entire Program shall |
be treated as though they were included in this License, to the extent |
that they are valid under applicable law. If additional permissions |
apply only to part of the Program, that part may be used separately |
under those permissions, but the entire Program remains governed by |
this License without regard to the additional permissions. |
When you convey a copy of a covered work, you may at your option |
remove any additional permissions from that copy, or from any part of |
it. (Additional permissions may be written to require their own |
removal in certain cases when you modify the work.) You may place |
additional permissions on material, added by you to a covered work, |
for which you have or can give appropriate copyright permission. |
Notwithstanding any other provision of this License, for material you |
add to a covered work, you may (if authorized by the copyright holders of |
that material) supplement the terms of this License with terms: |
a) Disclaiming warranty or limiting liability differently from the |
terms of sections 15 and 16 of this License; or |
b) Requiring preservation of specified reasonable legal notices or |
author attributions in that material or in the Appropriate Legal |
Notices displayed by works containing it; or |
c) Prohibiting misrepresentation of the origin of that material, or |
requiring that modified versions of such material be marked in |
reasonable ways as different from the original version; or |
d) Limiting the use for publicity purposes of names of licensors or |
authors of the material; or |
e) Declining to grant rights under trademark law for use of some |
trade names, trademarks, or service marks; or |
f) Requiring indemnification of licensors and authors of that |
material by anyone who conveys the material (or modified versions of |
it) with contractual assumptions of liability to the recipient, for |
any liability that these contractual assumptions directly impose on |
those licensors and authors. |
All other non-permissive additional terms are considered "further |
restrictions" within the meaning of section 10. If the Program as you |
received it, or any part of it, contains a notice stating that it is |
governed by this License along with a term that is a further |
restriction, you may remove that term. If a license document contains |
a further restriction but permits relicensing or conveying under this |
License, you may add to a covered work material governed by the terms |
of that license document, provided that the further restriction does |
not survive such relicensing or conveying. |
If you add terms to a covered work in accord with this section, you |
must place, in the relevant source files, a statement of the |
additional terms that apply to those files, or a notice indicating |
where to find the applicable terms. |
Additional terms, permissive or non-permissive, may be stated in the |
form of a separately written license, or stated as exceptions; |
the above requirements apply either way. |
8. Termination. |
You may not propagate or modify a covered work except as expressly |
provided under this License. Any attempt otherwise to propagate or |
modify it is void, and will automatically terminate your rights under |
this License (including any patent licenses granted under the third |
paragraph of section 11). |
However, if you cease all violation of this License, then your |
license from a particular copyright holder is reinstated (a) |
provisionally, unless and until the copyright holder explicitly and |
finally terminates your license, and (b) permanently, if the copyright |
holder fails to notify you of the violation by some reasonable means |
prior to 60 days after the cessation. |
Moreover, your license from a particular copyright holder is |
reinstated permanently if the copyright holder notifies you of the |
violation by some reasonable means, this is the first time you have |
received notice of violation of this License (for any work) from that |
copyright holder, and you cure the violation prior to 30 days after |
your receipt of the notice. |
Termination of your rights under this section does not terminate the |
licenses of parties who have received copies or rights from you under |
this License. If your rights have been terminated and not permanently |
reinstated, you do not qualify to receive new licenses for the same |
material under section 10. |
9. Acceptance Not Required for Having Copies. |
You are not required to accept this License in order to receive or |
run a copy of the Program. Ancillary propagation of a covered work |
occurring solely as a consequence of using peer-to-peer transmission |
to receive a copy likewise does not require acceptance. However, |
nothing other than this License grants you permission to propagate or |
modify any covered work. These actions infringe copyright if you do |
not accept this License. Therefore, by modifying or propagating a |
covered work, you indicate your acceptance of this License to do so. |
10. Automatic Licensing of Downstream Recipients. |
Each time you convey a covered work, the recipient automatically |
receives a license from the original licensors, to run, modify and |
propagate that work, subject to this License. You are not responsible |
for enforcing compliance by third parties with this License. |
An "entity transaction" is a transaction transferring control of an |
organization, or substantially all assets of one, or subdividing an |
organization, or merging organizations. If propagation of a covered |
work results from an entity transaction, each party to that |
transaction who receives a copy of the work also receives whatever |
licenses to the work the party's predecessor in interest had or could |
give under the previous paragraph, plus a right to possession of the |
Corresponding Source of the work from the predecessor in interest, if |
the predecessor has it or can get it with reasonable efforts. |
You may not impose any further restrictions on the exercise of the |
rights granted or affirmed under this License. For example, you may |
not impose a license fee, royalty, or other charge for exercise of |
rights granted under this License, and you may not initiate litigation |
(including a cross-claim or counterclaim in a lawsuit) alleging that |
any patent claim is infringed by making, using, selling, offering for |
sale, or importing the Program or any portion of it. |
11. Patents. |
A "contributor" is a copyright holder who authorizes use under this |
License of the Program or a work on which the Program is based. The |
work thus licensed is called the contributor's "contributor version". |
A contributor's "essential patent claims" are all patent claims |
owned or controlled by the contributor, whether already acquired or |
hereafter acquired, that would be infringed by some manner, permitted |
by this License, of making, using, or selling its contributor version, |
but do not include claims that would be infringed only as a |
consequence of further modification of the contributor version. For |
purposes of this definition, "control" includes the right to grant |
patent sublicenses in a manner consistent with the requirements of |
this License. |
Each contributor grants you a non-exclusive, worldwide, royalty-free |
patent license under the contributor's essential patent claims, to |
make, use, sell, offer for sale, import and otherwise run, modify and |
propagate the contents of its contributor version. |
In the following three paragraphs, a "patent license" is any express |
agreement or commitment, however denominated, not to enforce a patent |
(such as an express permission to practice a patent or covenant not to |
sue for patent infringement). To "grant" such a patent license to a |
party means to make such an agreement or commitment not to enforce a |
patent against the party. |
If you convey a covered work, knowingly relying on a patent license, |
and the Corresponding Source of the work is not available for anyone |
to copy, free of charge and under the terms of this License, through a |
publicly available network server or other readily accessible means, |
then you must either (1) cause the Corresponding Source to be so |
available, or (2) arrange to deprive yourself of the benefit of the |
patent license for this particular work, or (3) arrange, in a manner |
consistent with the requirements of this License, to extend the patent |
license to downstream recipients. "Knowingly relying" means you have |
actual knowledge that, but for the patent license, your conveying the |
covered work in a country, or your recipient's use of the covered work |
in a country, would infringe one or more identifiable patents in that |
country that you have reason to believe are valid. |
If, pursuant to or in connection with a single transaction or |
arrangement, you convey, or propagate by procuring conveyance of, a |
covered work, and grant a patent license to some of the parties |
receiving the covered work authorizing them to use, propagate, modify |
or convey a specific copy of the covered work, then the patent license |
you grant is automatically extended to all recipients of the covered |
work and works based on it. |
A patent license is "discriminatory" if it does not include within |
the scope of its coverage, prohibits the exercise of, or is |
conditioned on the non-exercise of one or more of the rights that are |
specifically granted under this License. You may not convey a covered |
work if you are a party to an arrangement with a third party that is |
in the business of distributing software, under which you make payment |
to the third party based on the extent of your activity of conveying |
the work, and under which the third party grants, to any of the |
parties who would receive the covered work from you, a discriminatory |
patent license (a) in connection with copies of the covered work |
conveyed by you (or copies made from those copies), or (b) primarily |
for and in connection with specific products or compilations that |
contain the covered work, unless you entered into that arrangement, |
or that patent license was granted, prior to 28 March 2007. |
Nothing in this License shall be construed as excluding or limiting |
any implied license or other defenses to infringement that may |
otherwise be available to you under applicable patent law. |
12. No Surrender of Others' Freedom. |
If conditions are imposed on you (whether by court order, agreement or |
otherwise) that contradict the conditions of this License, they do not |
excuse you from the conditions of this License. If you cannot convey a |
covered work so as to satisfy simultaneously your obligations under this |
License and any other pertinent obligations, then as a consequence you may |
not convey it at all. For example, if you agree to terms that obligate you |
to collect a royalty for further conveying from those to whom you convey |
the Program, the only way you could satisfy both those terms and this |
License would be to refrain entirely from conveying the Program. |
13. Use with the GNU Affero General Public License. |
Notwithstanding any other provision of this License, you have |
permission to link or combine any covered work with a work licensed |
under version 3 of the GNU Affero General Public License into a single |
combined work, and to convey the resulting work. The terms of this |
License will continue to apply to the part which is the covered work, |
but the special requirements of the GNU Affero General Public License, |
section 13, concerning interaction through a network will apply to the |
combination as such. |
14. Revised Versions of this License. |
The Free Software Foundation may publish revised and/or new versions of |
the GNU General Public License from time to time. Such new versions will |
be similar in spirit to the present version, but may differ in detail to |
address new problems or concerns. |
Each version is given a distinguishing version number. If the |
Program specifies that a certain numbered version of the GNU General |
Public License "or any later version" applies to it, you have the |
option of following the terms and conditions either of that numbered |
version or of any later version published by the Free Software |
Foundation. If the Program does not specify a version number of the |
GNU General Public License, you may choose any version ever published |
by the Free Software Foundation. |
If the Program specifies that a proxy can decide which future |
versions of the GNU General Public License can be used, that proxy's |
public statement of acceptance of a version permanently authorizes you |
to choose that version for the Program. |
Later license versions may give you additional or different |
permissions. However, no additional obligations are imposed on any |
author or copyright holder as a result of your choosing to follow a |
later version. |
15. Disclaimer of Warranty. |
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY |
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT |
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY |
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, |
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM |
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF |
ALL NECESSARY SERVICING, REPAIR OR CORRECTION. |
16. Limitation of Liability. |
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS |
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY |
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE |
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF |
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD |
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), |
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF |
SUCH DAMAGES. |
17. Interpretation of Sections 15 and 16. |
If the disclaimer of warranty and limitation of liability provided |
above cannot be given local legal effect according to their terms, |
reviewing courts shall apply local law that most closely approximates |
an absolute waiver of all civil liability in connection with the |
Program, unless a warranty or assumption of liability accompanies a |
copy of the Program in return for a fee. |
END OF TERMS AND CONDITIONS |
How to Apply These Terms to Your New Programs |
If you develop a new program, and you want it to be of the greatest |
possible use to the public, the best way to achieve this is to make it |
free software which everyone can redistribute and change under these terms. |
To do so, attach the following notices to the program. It is safest |
to attach them to the start of each source file to most effectively |
state the exclusion of warranty; and each file should have at least |
the "copyright" line and a pointer to where the full notice is found. |
<one line to give the program's name and a brief idea of what it does.> |
Copyright (C) <year> <name of author> |
This program is free software: you can redistribute it and/or modify |
it under the terms of the GNU General Public License as published by |
the Free Software Foundation, either version 3 of the License, or |
(at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License for more details. |
You should have received a copy of the GNU General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
Also add information on how to contact you by electronic and paper mail. |
If the program does terminal interaction, make it output a short |
notice like this when it starts in an interactive mode: |
<program> Copyright (C) <year> <name of author> |
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. |
This is free software, and you are welcome to redistribute it |
under certain conditions; type `show c' for details. |
The hypothetical commands `show w' and `show c' should show the appropriate |
parts of the General Public License. Of course, your program's commands |
might be different; for a GUI interface, you would use an "about box". |
You should also get your employer (if you work as a programmer) or school, |
if any, to sign a "copyright disclaimer" for the program, if necessary. |
For more information on this, and how to apply and follow the GNU GPL, see |
<http://www.gnu.org/licenses/>. |
The GNU General Public License does not permit incorporating your program |
into proprietary programs. If your program is a subroutine library, you |
may consider it more useful to permit linking proprietary applications with |
the library. If this is what you want to do, use the GNU Lesser General |
Public License instead of this License. But first, please read |
<http://www.gnu.org/philosophy/why-not-lgpl.html>. |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/License_LPGL.txt |
---|
0,0 → 1,165 |
GNU LESSER GENERAL PUBLIC LICENSE |
Version 3, 29 June 2007 |
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> |
Everyone is permitted to copy and distribute verbatim copies |
of this license document, but changing it is not allowed. |
This version of the GNU Lesser General Public License incorporates |
the terms and conditions of version 3 of the GNU General Public |
License, supplemented by the additional permissions listed below. |
0. Additional Definitions. |
As used herein, "this License" refers to version 3 of the GNU Lesser |
General Public License, and the "GNU GPL" refers to version 3 of the GNU |
General Public License. |
"The Library" refers to a covered work governed by this License, |
other than an Application or a Combined Work as defined below. |
An "Application" is any work that makes use of an interface provided |
by the Library, but which is not otherwise based on the Library. |
Defining a subclass of a class defined by the Library is deemed a mode |
of using an interface provided by the Library. |
A "Combined Work" is a work produced by combining or linking an |
Application with the Library. The particular version of the Library |
with which the Combined Work was made is also called the "Linked |
Version". |
The "Minimal Corresponding Source" for a Combined Work means the |
Corresponding Source for the Combined Work, excluding any source code |
for portions of the Combined Work that, considered in isolation, are |
based on the Application, and not on the Linked Version. |
The "Corresponding Application Code" for a Combined Work means the |
object code and/or source code for the Application, including any data |
and utility programs needed for reproducing the Combined Work from the |
Application, but excluding the System Libraries of the Combined Work. |
1. Exception to Section 3 of the GNU GPL. |
You may convey a covered work under sections 3 and 4 of this License |
without being bound by section 3 of the GNU GPL. |
2. Conveying Modified Versions. |
If you modify a copy of the Library, and, in your modifications, a |
facility refers to a function or data to be supplied by an Application |
that uses the facility (other than as an argument passed when the |
facility is invoked), then you may convey a copy of the modified |
version: |
a) under this License, provided that you make a good faith effort to |
ensure that, in the event an Application does not supply the |
function or data, the facility still operates, and performs |
whatever part of its purpose remains meaningful, or |
b) under the GNU GPL, with none of the additional permissions of |
this License applicable to that copy. |
3. Object Code Incorporating Material from Library Header Files. |
The object code form of an Application may incorporate material from |
a header file that is part of the Library. You may convey such object |
code under terms of your choice, provided that, if the incorporated |
material is not limited to numerical parameters, data structure |
layouts and accessors, or small macros, inline functions and templates |
(ten or fewer lines in length), you do both of the following: |
a) Give prominent notice with each copy of the object code that the |
Library is used in it and that the Library and its use are |
covered by this License. |
b) Accompany the object code with a copy of the GNU GPL and this license |
document. |
4. Combined Works. |
You may convey a Combined Work under terms of your choice that, |
taken together, effectively do not restrict modification of the |
portions of the Library contained in the Combined Work and reverse |
engineering for debugging such modifications, if you also do each of |
the following: |
a) Give prominent notice with each copy of the Combined Work that |
the Library is used in it and that the Library and its use are |
covered by this License. |
b) Accompany the Combined Work with a copy of the GNU GPL and this license |
document. |
c) For a Combined Work that displays copyright notices during |
execution, include the copyright notice for the Library among |
these notices, as well as a reference directing the user to the |
copies of the GNU GPL and this license document. |
d) Do one of the following: |
0) Convey the Minimal Corresponding Source under the terms of this |
License, and the Corresponding Application Code in a form |
suitable for, and under terms that permit, the user to |
recombine or relink the Application with a modified version of |
the Linked Version to produce a modified Combined Work, in the |
manner specified by section 6 of the GNU GPL for conveying |
Corresponding Source. |
1) Use a suitable shared library mechanism for linking with the |
Library. A suitable mechanism is one that (a) uses at run time |
a copy of the Library already present on the user's computer |
system, and (b) will operate properly with a modified version |
of the Library that is interface-compatible with the Linked |
Version. |
e) Provide Installation Information, but only if you would otherwise |
be required to provide such information under section 6 of the |
GNU GPL, and only to the extent that such information is |
necessary to install and execute a modified version of the |
Combined Work produced by recombining or relinking the |
Application with a modified version of the Linked Version. (If |
you use option 4d0, the Installation Information must accompany |
the Minimal Corresponding Source and Corresponding Application |
Code. If you use option 4d1, you must provide the Installation |
Information in the manner specified by section 6 of the GNU GPL |
for conveying Corresponding Source.) |
5. Combined Libraries. |
You may place library facilities that are a work based on the |
Library side by side in a single library together with other library |
facilities that are not Applications and are not covered by this |
License, and convey such a combined library under terms of your |
choice, if you do both of the following: |
a) Accompany the combined library with a copy of the same work based |
on the Library, uncombined with any other library facilities, |
conveyed under the terms of this License. |
b) Give prominent notice with the combined library that part of it |
is a work based on the Library, and explaining where to find the |
accompanying uncombined form of the same work. |
6. Revised Versions of the GNU Lesser General Public License. |
The Free Software Foundation may publish revised and/or new versions |
of the GNU Lesser General Public License from time to time. Such new |
versions will be similar in spirit to the present version, but may |
differ in detail to address new problems or concerns. |
Each version is given a distinguishing version number. If the |
Library as you received it specifies that a certain numbered version |
of the GNU Lesser General Public License "or any later version" |
applies to it, you have the option of following the terms and |
conditions either of that published version or of any later version |
published by the Free Software Foundation. If the Library as you |
received it does not specify a version number of the GNU Lesser |
General Public License, you may choose any version of the GNU Lesser |
General Public License ever published by the Free Software Foundation. |
If the Library as you received it specifies that a proxy can decide |
whether future versions of the GNU Lesser General Public License shall |
apply, that proxy's public statement of acceptance of any version is |
permanent authorization for you to choose that version for the |
Library. |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/README_Gps.txt |
---|
0,0 → 1,82 |
********************************************************************* |
GPS Implementierung von Peter Muehlenbrock ("Salvo") für Mikrokopter/FlightCrtl |
Stand 14.10.2007 |
Verwendung der SW ohne Gewaehr. Siehe auch die Lizenzbedingungen in File Licensce_LPGL.txt und Licensce_GPL.txt |
********************************************************************* |
Hardware-Voraussetzungen: |
Kalibrierter Kompass vom Typ CMPS03, waagrecht eingebaut |
GPS Modul vom Typ ublox, Die Meldungungen "NAV_STATUS", "NAV_POSUTM" und "NAV_VELNED" |
mussen mit 4 HZ Updaterate aktiviert sein. Anschluss an RX Port der FlightCRtl. Baudrate ist 57600 wie beim Kopter Tool. |
Software-Voraussetzungen: |
in fc.h müsen die Neutralwerte ACC_NICK_NEUTRAL und ACC_ROLL_NEUTRAL |
eingetragen werden. Hierzu den Kopter waagrecht ausrichten (Wasserwaage) und mit dem Mikrokoptertool |
die Neutralwerte (Fenster ACC Sensor, jeweils die dargestellten Werte ohne Klammern) ermitteln. |
Alternativ kann die Variable ACC_NEUTRAL_FIXED auf 0 gesetzt werden, dann wird die Lage beim Kalibrieren als Neutrallage |
genommen (wie bei Holgers SW). |
In timer0.h muss die Ausrichtung des Kompasses bezogen auf die Nordachse des Kopters |
eingetragen sein. KOMPASS_OFFSET legt diesen Wert fest. |
Hexfiles: |
Ich habe bewußt keinen Hexfile generiert, da die Neutralwerte spezifisch je Kopter sind. |
Die SW muß also individuell compiliert werden und der Hexfile in die FlightCrtl eingebaut werden. |
Der Lohn für die Muehe ist eine sehr driftarme Fluglageregelung sowie eine von der Startausrichtung |
unabhängige waagrechte Lage in der Luft. |
Alle Einstellungen beziehen sich auf AVR Studio von Atmel und den WIN_AVR Compiler. |
Parametrierung: |
Der GPS Hold Regler ist ein PID Regler, der ueber die UserParameter1(P), 2(I) und D(3) gesteuert wird. |
UserParameter1 beschreibt den P-Anteil, UserParameter2 den I-Anteil und UserParameter3 den D-Anteil. |
Hier kann und muss gespielt werden.Alle Parameter koennen direkt im Mikrokoptertool in den Settings eingestellt werden. |
Standardwerte bei kaum Wind sind 8 für den P-Anteil, 1 für den I-Anteil und 12 für den D-Anteil. |
Standardwerte bei leichtem verhältnissen sind 12 für den P-Anteil, 2 für den I-Anteil und 18 für den D-Anteil. |
Standardwerte bei rauheren verhältnissen sind 16 für den P-Anteil, 2 für den I-Anteil und 20 für den D-Anteil. |
Je größer die Werte des "ruckeliger" reagiert die Regelung aber desto schneller und stärker greift sie auch. |
Wenn alle 0 sind, ist der Regler deaktiviert. |
Voraussetzungen für GPS_Hold: |
Neben den genannten HW und SW Voraussetzungen muß beim Kalibrieren das GPS MOdul bereits Positionsdaten liefern. |
Nur dann wird die Home Position abgespeichert und nur dann wird GPS_Hold aktiviert. |
Kenntlich gemacht wird dies durch einen etwas längeren Piepser nach dem Kalibrieren. |
Das GPS Aktiv Flag im Setting muss aktiviert sein. |
Eine Ausrichtung des Kopters nach Nord etc. ist nicht erforderlich. |
Aktivierung GPS_Hold im Flug: |
Wenn alle genannten Voraussetzungen erfüllt sind, wird GPS Hold im Flug automatisch aktiviert, sobald der Nick und Roll Stick |
fürca. 500msec in Neutrallage sind. Weicht einer der Sticks davon ab (Parameter GPS_STICK_HOLDOFF) oder liefert das GPS Modul oder fällt der |
Kompass aus wird GPS_Hold sofort deaktiviert. |
Damit kann jederzeit die manuelle Kontrolle wieder übernommen werden. |
GPS_Hold regelt nur horizontale Abweichungen, keine Hoehe. |
Der Magnetkompass wird nur in waagrechter Lage dazu benutzt einen internen aus dem Giergyro ermittelten "Ersatz"kompasswert |
nach zu kalibrieren. Daher funktioniert die Bstimmung der Kopterausrichtung in jeder Lebenslage, sofern nur ab und zu |
der Magnetkompass in die waagrechte Lage kommt. |
Ein 3D Kompass ist damit überflüssig. |
GPS Rücksturz zur Basis (GPS Home) Funktion |
Voraussetzungen wie bei GPS Hold. |
Die Funktion kann im Flug aktiviert werden durch Setzen des Hoehenreglerschalters. |
Holgers Code habe ich so abgeändert daß der Höhenregler mit "Parameter_MaxHoehe" ab 50 aktiviert wird. |
Mit einem Schalter mit Neutrallage können damit die Funktionen |
Alles aus - Hoehenregler ein, GPS Home Aus - Hoehenregler Ein UND GPS Home ein |
aktiviert werden. Ist noch nicht die beste Lösung und werde ich noch anpassen |
Weitere Änderungen: |
Bei Unterschreiten der eingestellten Warnschwelle für UBAT ertönt zunächst wie gewohnt der Piepser. Geht die Spannung weiter |
runter wird zwangsweise die Gaseinstellung langsam reduziert um den Kopter zum Landen zu bringen |
Bekannte Schwächen: |
Bei längerer Neigung weicht der Ersatzkompass ab, was zu Lageregelungsfehlern bis zum Ausbrechen führen kann. |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/Settings.h |
---|
--- alpha/v060SalvoKompassNick666MM3Gyro/_Settings.h (nonexistent) |
+++ alpha/v060SalvoKompassNick666MM3Gyro/_Settings.h (revision 2762) |
@@ -0,0 +1,50 @@ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Testmodi |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define MOTOR_OFF 0 |
+#define MOTOR_TEST 0 |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Abstimmung |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define ACC_AMPLIFY 16 |
+#define FAKTOR_P 1 |
+#define FAKTOR_I 0.0001 |
+ |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Debug-Interface |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define SIO_DEBUG 1 // Soll der Debugger aktiviert sein? |
+#define MIN_DEBUG_INTERVALL 250 // in diesem Intervall werden Degugdaten ohne Aufforderung gesendet |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Sender |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ #define K_NICK 0 |
+ #define K_ROLL 1 |
+ #define K_GAS 2 |
+ #define K_GIER 3 |
+ #define K_POTI1 4 |
+ #define K_POTI2 5 |
+ #define K_POTI3 6 |
+ #define K_POTI4 7 |
+// +++++++++++++++++++++++++++++++ |
+// + Getestete Settings: |
+// +++++++++++++++++++++++++++++++ |
+// Setting: Kamera |
+// Stick_P:3 |
+// Stick_D:0 |
+// Gyro_P: 175 |
+// Gyro_I: 175 |
+// Ki_Anteil: 10 |
+// +++++++++++++++++++++++++++++++ |
+// + Getestete Settings: |
+// +++++++++++++++++++++++++++++++ |
+// Setting: Normal |
+// Stick_P:2 |
+// Stick_D:8 |
+// Gyro_P: 80 |
+// Gyro_I: 150 |
+// Ki_Anteil: 5 |
+ |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/analog.c |
---|
0,0 → 1,156 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
volatile int Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az, UBat = 100; |
volatile int AccumulateNick = 0, AccumulateRoll = 0, AccumulateGier = 0; |
volatile int accumulate_AccRoll = 0,accumulate_AccNick = 0,accumulate_AccHoch = 0; |
volatile char MessanzahlNick = 0, MessanzahlRoll = 0, MessanzahlGier = 0; |
volatile char messanzahl_AccNick = 0, messanzahl_AccRoll = 0, messanzahl_AccHoch = 0; |
volatile long Luftdruck = 32000; |
volatile int StartLuftdruck; |
volatile unsigned int MessLuftdruck = 1023; |
unsigned char DruckOffsetSetting; |
volatile int HoeheD = 0; |
volatile char messanzahl_Druck; |
volatile int tmpLuftdruck; |
volatile unsigned int ZaehlMessungen = 0; |
//####################################################################################### |
// |
void ADC_Init(void) |
//####################################################################################### |
{ |
ADMUX = 0;//Referenz ist extern |
ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE); |
//Free Running Mode, Division Factor 128, Interrupt on |
} |
void SucheLuftruckOffset(void) |
{ |
unsigned int off; |
for(off=0; off < 250;off++) |
{ |
OCR0A = off; |
Delay_ms(50); |
printf("."); |
if(MessLuftdruck < 900) break; |
} |
DruckOffsetSetting = off; |
Delay_ms(200); |
} |
//####################################################################################### |
// |
SIGNAL(SIG_ADC) |
//####################################################################################### |
{ |
static unsigned char kanal=0,state = 0; |
signed int wert; |
ANALOG_OFF; |
switch(state++) |
{ |
case 0: |
wert = (signed int) AdNeutralGier - ADC; |
AccumulateGier += wert; // |
MessanzahlGier++; |
Mess_Integral_Gier += wert;// / 16; |
Mess_Integral_Gier2 += wert; |
// GyroKomp_Int += wert; |
kanal = 1; |
ZaehlMessungen++; |
break; |
case 1: |
wert = (signed int) ADC - AdNeutralRoll; |
Mess_IntegralRoll += wert; |
Mess_IntegralRoll2 += wert; |
if(ADC < 10) wert = -700; |
if(ADC > 1000) wert = +700; |
AccumulateRoll += wert; |
MessanzahlRoll++; |
kanal = 2; |
break; |
case 2: |
wert = (signed int) ADC - AdNeutralNick; |
Mess_IntegralNick += wert; |
Mess_IntegralNick2 += wert; |
if(ADC < 10) wert = -700; |
if(ADC > 1000) wert = +700; |
AccumulateNick += wert; |
MessanzahlNick++; |
kanal = 4; |
break; |
case 3: |
UBat = (3 * UBat + ADC / 3) / 4;//(UBat + ((ADC * 39) / 256) + 19) / 2; |
kanal = 6; |
break; |
case 4: |
Aktuell_ay = NeutralAccY - ADC; |
accumulate_AccRoll += Aktuell_ay; |
messanzahl_AccRoll++; |
kanal = 7; |
break; |
case 5: |
Aktuell_ax = ADC - NeutralAccX; |
accumulate_AccNick += Aktuell_ax; |
messanzahl_AccNick++; |
kanal = 5; |
state = 6; |
break; |
case 6: |
accumulate_AccHoch = (signed int) ADC - NeutralAccZ; |
accumulate_AccHoch += abs(Aktuell_ay) / 4 + abs(Aktuell_ax) / 4; |
if(accumulate_AccHoch > 1) |
{ |
if(NeutralAccZ < 800) NeutralAccZ+= 0.02; |
} |
else if(accumulate_AccHoch < -1) |
{ |
if(NeutralAccZ > 600) NeutralAccZ-= 0.02; |
} |
messanzahl_AccHoch = 1; |
Aktuell_az = ADC; |
Mess_Integral_Hoch += accumulate_AccHoch; // Integrieren |
Mess_Integral_Hoch -= Mess_Integral_Hoch / 1024; // dämfen |
// Mess_Integral_Hoch -= Mess_Integral_Hoch / 512; // dämfen |
/* if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
kanal = 3; |
state = 7; |
} |
else |
{ |
kanal = 0; |
state = 0; |
}*/ |
kanal = 3; |
state = 7; |
break; |
case 7: |
tmpLuftdruck += ADC; |
if(++messanzahl_Druck >= 5) |
{ |
MessLuftdruck = ADC; |
messanzahl_Druck = 0; |
HoeheD = (int)(StartLuftdruck - tmpLuftdruck - HoehenWert); // D-Anteil = neuerWert - AlterWert |
Luftdruck = (tmpLuftdruck + 3 * Luftdruck) / 4; |
HoehenWert = StartLuftdruck - Luftdruck; |
tmpLuftdruck = 0; |
} |
kanal = 0; |
state = 0; |
break; |
default: |
kanal = 0; |
state = 0; |
break; |
} |
ADMUX = kanal; |
ANALOG_ON; |
} |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/analog.h |
---|
0,0 → 1,23 |
/*####################################################################################### |
#######################################################################################*/ |
extern volatile int UBat; |
extern volatile int AccumulateNick, AccumulateRoll, AccumulateGier,accumulate_AccRoll,accumulate_AccNick,accumulate_AccHoch; |
extern volatile char MessanzahlNick, MessanzahlRoll, MessanzahlGier,messanzahl_AccNick, messanzahl_AccRoll,messanzahl_AccHoch; |
extern volatile int Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az; |
extern volatile long Luftdruck; |
extern volatile char messanzahl_Druck; |
extern volatile unsigned int ZaehlMessungen; |
extern unsigned char DruckOffsetSetting; |
extern volatile int HoeheD; |
extern volatile unsigned int MessLuftdruck; |
extern volatile int StartLuftdruck; |
extern unsigned int ReadADC(unsigned char adc_input); |
extern void ADC_Init(void); |
extern void SucheLuftruckOffset(void); |
#define ANALOG_OFF ADCSRA=0 |
#define ANALOG_ON ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE) |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/compass.c |
---|
0,0 → 1,151 |
/* |
Copyright 2007, Niklas Nold |
This program (files compass.c and compass.h) is free software; you can redistribute it and/or modify |
it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; |
either version 3 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
Please note: All the other files for the project "Mikrokopter" by H. Buss are under the license (license_buss.txt) published by www.mikrokopter.de |
*/ |
#include "main.h" |
#include "math.h" |
MM3_struct MM3; |
//############################################################################ |
//Initialisierung der SPI-Schnittstelle |
void init_spi(void) |
//############################################################################ |
{ |
SPCR = (1<<SPIE)|(1<<SPE)|(1<<MSTR)|(1<<SPR1)|(1<<SPR0); //Interrupt an, Master, 156 kHz Oszillator |
//SPSR = (1<<SPI2X); |
DDRB |= (1<<PB7)|(1<<PB5)|(1<<PB2); // J8, MOSI, SCK Ausgang |
PORTD &= ~(1<<PD3); // J5 auf Low |
MM3.AXIS = MM3_X; |
MM3.STATE = MM3_RESET; |
} |
//############################################################################ |
//Wird in der SIGNAL (SIG_OVERFLOW0) aufgerufen |
void MM3_timer0(void) |
//############################################################################ |
{ |
switch (MM3.STATE) |
{ |
case MM3_RESET: |
PORTB |= (1<<PB2); // J8 auf High, MM3 Reset |
MM3.STATE = MM3_START_TRANSFER; |
return; |
case MM3_START_TRANSFER: |
PORTB &= ~(1<<PB2); // J8 auf Low (war ~125 µs auf High) |
if (MM3.AXIS == MM3_X) SPDR = 0x51; // Schreiben ins SPDR löst automatisch Übertragung (MOSI und MISO) aus |
else if (MM3.AXIS == MM3_Y) SPDR = 0x52; // Micromag Period Select ist auf 1024 (0x50) |
else if (MM3.AXIS == MM3_Z) SPDR = 0x53; // 1: x-Achse, 2: Y-Achse, 3: Z-Achse |
MM3.DRDY = SetDelay(15); // Laut Datenblatt max. Zeit bis Messung fertig (bei PS 1024) |
MM3.STATE = MM3_WAIT_DRDY; |
return; |
case MM3_WAIT_DRDY: |
if (CheckDelay(MM3.DRDY)) {SPDR = 0x00;MM3.STATE = MM3_DRDY;} // Irgendwas ins SPDR, damit Übertragung ausgelöst wird, wenn Wartezeit vorbei |
return; // Jetzt gehts weiter in SIGNAL (SIG_SPI) |
case MM3_TILT: // Zeitnahe Speicherung der aktuellen Neigung in ° |
MM3.NickGrad = IntegralNick/(120*8); |
MM3.RollGrad = IntegralRoll/(120*8); |
MM3.AXIS = MM3_X; |
MM3.STATE = MM3_RESET; |
return; |
} |
} |
//############################################################################ |
//SPI byte ready |
SIGNAL (SIG_SPI) |
//############################################################################ |
{ |
switch (MM3.STATE) |
{ |
case MM3_DRDY: // 1. Byte ist da, abspeichern, an die MSB-Stelle rücken |
if (MM3.AXIS == MM3_X) |
{ |
MM3.x_axis = SPDR; |
MM3.x_axis <<= 8; |
} |
else if (MM3.AXIS == MM3_Y) |
{ |
MM3.y_axis = SPDR; |
MM3.y_axis <<= 8; |
} |
else // if (MM3.AXIS == MM3_Z) |
{ |
MM3.z_axis = SPDR; |
MM3.z_axis <<= 8; |
} |
SPDR=0x00; // Übertragung von 2. Byte auslösen |
MM3.STATE=MM3_BYTE2; |
return; |
case MM3_BYTE2: // 2. Byte der entsprechenden Achse ist da |
if (MM3.AXIS == MM3_X) |
{ |
MM3.x_axis |= SPDR; |
MM3.x_axis -= OFF_X; // Sofort Offset aus der Kalibrierung berücksichtigen |
MM3.AXIS = MM3_Y; |
MM3.STATE = MM3_RESET; |
} |
else if (MM3.AXIS == MM3_Y) |
{ |
MM3.y_axis |= SPDR; |
MM3.y_axis -= OFF_Y; |
MM3.AXIS = MM3_Z; |
MM3.STATE = MM3_RESET; |
} |
else // if (MM3.AXIS == MM3_Z) |
{ |
MM3.z_axis |= SPDR; |
MM3.z_axis -= OFF_Z; |
MM3.STATE = MM3_TILT; |
} |
return; |
} |
} |
signed int MM3_heading(void) |
{ |
float sin_nick, cos_nick, sin_roll, cos_roll; |
signed int x_corr, y_corr; |
signed int heading; |
// Berechung von sinus und cosinus |
sin_nick = sin_f(MM3.NickGrad); |
cos_nick = cos_f(MM3.NickGrad); |
sin_roll = sin_f(MM3.RollGrad); |
cos_roll = cos_f(MM3.RollGrad); |
// Neigungskompensation |
x_corr = (cos_nick * MM3.x_axis) + (((sin_roll * MM3.y_axis) - (cos_roll * MM3.z_axis)) * sin_nick); |
y_corr = ((cos_roll * MM3.y_axis) + (sin_roll * MM3.z_axis)); |
// Winkelberechnung |
heading = atan2_i(x_corr, y_corr); |
return (heading); |
} |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/compass.h |
---|
0,0 → 1,41 |
typedef struct |
{ |
uint8_t STATE; |
unsigned int DRDY; |
uint8_t AXIS; |
signed int x_axis; |
signed int y_axis; |
signed int z_axis; |
signed int NickGrad; |
signed int RollGrad; |
}MM3_struct; |
extern MM3_struct MM3; |
void init_spi(void); |
void MM3_timer0(void); |
signed int MM3_heading(void); |
#define Int2Grad_Faktor 1024 |
// Die Werte der Statemachine |
#define MM3_RESET 0 |
#define MM3_START_TRANSFER 1 |
#define MM3_WAIT_DRDY 2 |
#define MM3_DRDY 4 |
#define MM3_BYTE2 8 |
#define MM3_X 16 |
#define MM3_Y 32 |
#define MM3_Z 64 |
#define MM3_TILT 128 |
// Die Werte der Kompasskalibrierung |
// OFFSET: (Maximaler Wert + minimaler Wert) / 2 |
#define OFF_X -11 |
#define OFF_Y 30 |
#define OFF_Z 18 |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/eeprom.c |
---|
--- alpha/v060SalvoKompassNick666MM3Gyro/fc.c (nonexistent) |
+++ alpha/v060SalvoKompassNick666MM3Gyro/fc.c (revision 2762) |
@@ -0,0 +1,838 @@ |
+/*####################################################################################### |
+Flight Control |
+#######################################################################################*/ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Copyright (c) 04.2007 Holger Buss |
+// + Nur für den privaten Gebrauch |
+// + www.MikroKopter.com |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
+// + dass eine Nutzung (auch auszugsweise) nur für den privaten (nicht-kommerziellen) Gebrauch zulässig ist. |
+// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
+// + bzgl. der Nutzungsbedingungen aufzunehmen. |
+// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
+// + Verkauf von Luftbildaufnahmen, usw. |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
+// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
+// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
+// + eindeutig als Ursprung verlinkt werden |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
+// + Benutzung auf eigene Gefahr |
+// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
+// + mit unserer Zustimmung zulässig |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
+// + this list of conditions and the following disclaimer. |
+// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
+// + from this software without specific prior written permission. |
+// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
+// + for non-commercial use (directly or indirectly) |
+// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
+// + with our written permission |
+// + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
+// + clearly linked as origin |
+// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
+// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
+// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
+// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
+// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
+// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
+// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
+// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
+// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
+// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
+// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
+// + POSSIBILITY OF SUCH DAMAGE. |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Aenderungen von Peter Muehlenbrock ("Salvo") Stand 6.10.2007 |
+/* |
+Driftkompensation fuer Gyros verbessert |
+Linearsensor mit fixem Neutralwert |
+Ersatzkompass abgeleitet aus Magnetkompass und Giergyro fuer nahezu neigungsunabhaengige Kompassfunktion |
+*/ |
+ |
+#include "main.h" |
+ |
+unsigned char h,m,s; |
+volatile unsigned char Timeout = 0; |
+volatile int MesswertNick,MesswertRoll,MesswertGier; |
+volatile int AdNeutralNick = 0,AdNeutralRoll = 0,AdNeutralGier = 0; |
+volatile int Mittelwert_AccNick, Mittelwert_AccRoll,Mittelwert_AccHoch, NeutralAccX=0, NeutralAccY=0; |
+volatile float NeutralAccZ = 0; |
+unsigned char CosinusNickWinkel = 0, CosinusRollWinkel = 0; |
+volatile long IntegralNick = 0,IntegralNick2 = 0; |
+volatile long IntegralRoll = 0,IntegralRoll2 = 0; |
+volatile long Integral_Gier = 0; |
+volatile long Mess_IntegralNick = 0,Mess_IntegralNick2 = 0; |
+volatile long Mess_IntegralRoll = 0,Mess_IntegralRoll2 = 0; |
+volatile long Mess_Integral_Gier = 0,Mess_Integral_Gier2 = 0; |
+volatile long Mess_Integral_Hoch = 0; |
+volatile int KompassValue = 0; |
+volatile int KompassStartwert = 0; |
+volatile int KompassRichtung = 0; |
+unsigned char MAX_GAS,MIN_GAS; |
+unsigned char Notlandung = 0; |
+unsigned char HoehenReglerAktiv = 0; |
+ |
+float GyroFaktor; |
+float IntegralFaktor; |
+ |
+uint8_t gps_cmd = GPS_CMD_STOP; |
+ |
+volatile int DiffNick,DiffRoll; |
+int Poti1 = 0, Poti2 = 0, Poti3 = 0, Poti4 = 0; |
+volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
+unsigned char MotorWert[5]; |
+volatile unsigned char SenderOkay = 0; |
+int StickNick = 0,StickRoll = 0,StickGier = 0; |
+char MotorenEin = 0; |
+int HoehenWert = 0; |
+int SollHoehe = 0; |
+int w,v; |
+ |
+float Kp = FAKTOR_P; |
+float Ki = FAKTOR_I; |
+ |
+unsigned char Parameter_Luftdruck_D = 48; // Wert : 0-250 |
+unsigned char Parameter_MaxHoehe = 251; // Wert : 0-250 |
+unsigned char Parameter_Hoehe_P = 16; // Wert : 0-32 |
+unsigned char Parameter_Hoehe_ACC_Wirkung = 58; // Wert : 0-250 |
+unsigned char Parameter_KompassWirkung = 64; // Wert : 0-250 |
+unsigned char Parameter_Gyro_P = 50; // Wert : 10-250 |
+unsigned char Parameter_Gyro_I = 150; // Wert : 0-250 |
+unsigned char Parameter_Gier_P = 2; // Wert : 1-20 |
+unsigned char Parameter_I_Faktor = 10; // Wert : 1-20 |
+unsigned char Parameter_UserParam1 = 0; |
+unsigned char Parameter_UserParam2 = 0; |
+unsigned char Parameter_UserParam3 = 0; |
+unsigned char Parameter_UserParam4 = 0; |
+unsigned char Parameter_ServoNickControl = 100; |
+struct mk_param_struct EE_Parameter; |
+ |
+void Piep(unsigned char Anzahl) |
+{ |
+ while(Anzahl--) |
+ { |
+ if(MotorenEin) return; //auf keinen Fall im Flug! |
+ beeptime = 100; |
+ Delay_ms(250); |
+ } |
+} |
+ |
+//############################################################################ |
+// Nullwerte ermitteln |
+void SetNeutral(void) |
+//############################################################################ |
+{ |
+ unsigned int timer; |
+ NeutralAccX = 0; |
+ NeutralAccY = 0; |
+ NeutralAccZ = 0; |
+ AdNeutralNick = 0; |
+ AdNeutralRoll = 0; |
+ AdNeutralGier = 0; |
+ GPS_Neutral(); |
+ CalibrierMittelwert(); |
+ timer = SetDelay(5); |
+ while (!CheckDelay(timer)); |
+ CalibrierMittelwert(); |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
+ { |
+ if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset(); |
+ } |
+ AdNeutralNick= abs(MesswertNick); |
+ AdNeutralRoll= abs(MesswertRoll); |
+ AdNeutralGier= abs(MesswertGier); |
+ NeutralAccY = abs(Mittelwert_AccRoll) / ACC_AMPLIFY; |
+ NeutralAccX = abs(Mittelwert_AccNick) / ACC_AMPLIFY; |
+ NeutralAccZ = Aktuell_az; |
+ |
+ Mess_IntegralNick = 0; |
+ Mess_IntegralNick2 = 0; |
+ Mess_IntegralRoll = 0; |
+ Mess_IntegralRoll2 = 0; |
+ Mess_Integral_Gier = 0; |
+ MesswertNick = 0; |
+ MesswertRoll = 0; |
+ MesswertGier = 0; |
+ StartLuftdruck = Luftdruck; |
+ HoeheD = 0; |
+ Mess_Integral_Hoch = 0; |
+ KompassStartwert = KompassValue; |
+ beeptime = 50; |
+} |
+ |
+//############################################################################ |
+// Bildet den Mittelwert aus den Messwerten |
+void Mittelwert(void) |
+//############################################################################ |
+{ |
+ // ADC auschalten, damit die Werte sich nicht während der Berechnung ändern |
+ ANALOG_OFF; |
+ if(MessanzahlNick) (MesswertNick = AccumulateNick / MessanzahlNick); |
+ if(MessanzahlRoll) (MesswertRoll = AccumulateRoll / MessanzahlRoll); |
+ if(MessanzahlGier) (MesswertGier = AccumulateGier / MessanzahlGier); |
+ if(messanzahl_AccNick) Mittelwert_AccNick = ((long)Mittelwert_AccNick * 7 + ((ACC_AMPLIFY * (long)accumulate_AccNick) / messanzahl_AccNick)) / 8L; |
+ if(messanzahl_AccRoll) Mittelwert_AccRoll = ((long)Mittelwert_AccRoll * 7 + ((ACC_AMPLIFY * (long)accumulate_AccRoll) / messanzahl_AccRoll)) / 8L; |
+ if(messanzahl_AccHoch) Mittelwert_AccHoch = ((long)Mittelwert_AccHoch * 7 + ((long)accumulate_AccHoch) / messanzahl_AccHoch) / 8L; |
+ AccumulateNick = 0; MessanzahlNick = 0; |
+ AccumulateRoll = 0; MessanzahlRoll = 0; |
+ AccumulateGier = 0; MessanzahlGier = 0; |
+ accumulate_AccRoll = 0;messanzahl_AccRoll = 0; |
+ accumulate_AccNick = 0;messanzahl_AccNick = 0; |
+ accumulate_AccHoch = 0;messanzahl_AccHoch = 0; |
+ Integral_Gier = Mess_Integral_Gier; |
+ IntegralNick = Mess_IntegralNick; |
+ IntegralRoll = Mess_IntegralRoll; |
+ IntegralNick2 = Mess_IntegralNick2; |
+ IntegralRoll2 = Mess_IntegralRoll2; |
+ // ADC einschalten |
+ ANALOG_ON; |
+ |
+//------------------------------------------------------------------------------ |
+ if(MesswertNick > 200) MesswertNick += 4 * (MesswertNick - 200); |
+ else |
+ if(MesswertNick < -200) MesswertNick += 4 * (MesswertNick + 200); |
+ |
+ if(MesswertRoll > 200) MesswertRoll += 4 * (MesswertRoll - 200); |
+ else |
+ if(MesswertRoll < -200) MesswertRoll += 4 * (MesswertRoll + 200); |
+//------------------------------------------------------------------------------ |
+ if(Poti1 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110) Poti1++; else if(Poti1 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110 && Poti1) Poti1--; |
+ if(Poti2 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110) Poti2++; else if(Poti2 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110 && Poti2) Poti2--; |
+ if(Poti3 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110) Poti3++; else if(Poti3 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110 && Poti3) Poti3--; |
+ if(Poti4 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110) Poti4++; else if(Poti4 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110 && Poti4) Poti4--; |
+ if(Poti1 < 0) Poti1 = 0; else if(Poti1 > 255) Poti1 = 255; |
+ if(Poti2 < 0) Poti2 = 0; else if(Poti2 > 255) Poti2 = 255; |
+ if(Poti3 < 0) Poti3 = 0; else if(Poti3 > 255) Poti3 = 255; |
+ if(Poti4 < 0) Poti4 = 0; else if(Poti4 > 255) Poti4 = 255; |
+} |
+ |
+//############################################################################ |
+// Messwerte beim Ermitteln der Nullage |
+void CalibrierMittelwert(void) |
+//############################################################################ |
+{ |
+ // ADC auschalten, damit die Werte sich nicht während der Berechnung ändern |
+ ANALOG_OFF; |
+ if(MessanzahlNick) (MesswertNick = AccumulateNick / MessanzahlNick); |
+ if(MessanzahlRoll) (MesswertRoll = AccumulateRoll / MessanzahlRoll); |
+ if(MessanzahlGier) (MesswertGier = AccumulateGier / MessanzahlGier); |
+ if(messanzahl_AccNick) Mittelwert_AccNick = ((ACC_AMPLIFY * (long)accumulate_AccNick) / messanzahl_AccNick); |
+ if(messanzahl_AccRoll) Mittelwert_AccRoll = (ACC_AMPLIFY * (long)accumulate_AccRoll) / messanzahl_AccRoll; |
+ if(messanzahl_AccHoch) Mittelwert_AccHoch = ((long)accumulate_AccHoch) / messanzahl_AccHoch; |
+ AccumulateNick = 0; MessanzahlNick = 0; |
+ AccumulateRoll = 0; MessanzahlRoll = 0; |
+ AccumulateGier = 0; MessanzahlGier = 0; |
+ accumulate_AccRoll = 0;messanzahl_AccRoll = 0; |
+ accumulate_AccNick = 0;messanzahl_AccNick = 0; |
+ accumulate_AccHoch = 0;messanzahl_AccHoch = 0; |
+ // ADC einschalten |
+ ANALOG_ON; |
+ if(Poti1 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110) Poti1++; else if(Poti1 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110 && Poti1) Poti1--; |
+ if(Poti2 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110) Poti2++; else if(Poti2 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110 && Poti2) Poti2--; |
+ if(Poti3 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110) Poti3++; else if(Poti3 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110 && Poti3) Poti3--; |
+ if(Poti4 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110) Poti4++; else if(Poti4 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110 && Poti4) Poti4--; |
+ if(Poti1 < 0) Poti1 = 0; else if(Poti1 > 255) Poti1 = 255; |
+ if(Poti2 < 0) Poti2 = 0; else if(Poti2 > 255) Poti2 = 255; |
+ if(Poti3 < 0) Poti3 = 0; else if(Poti3 > 255) Poti3 = 255; |
+ if(Poti4 < 0) Poti4 = 0; else if(Poti4 > 255) Poti4 = 255; |
+} |
+ |
+//############################################################################ |
+// Senden der Motorwerte per I2C-Bus |
+void SendMotorData(void) |
+//############################################################################ |
+{ |
+ if(MOTOR_OFF || !MotorenEin) |
+ { |
+ Motor_Hinten = 0; |
+ Motor_Vorne = 0; |
+ Motor_Rechts = 0; |
+ Motor_Links = 0; |
+ if(MotorTest[0]) Motor_Vorne = MotorTest[0]; |
+ if(MotorTest[1]) Motor_Hinten = MotorTest[1]; |
+ if(MotorTest[2]) Motor_Links = MotorTest[2]; |
+ if(MotorTest[3]) Motor_Rechts = MotorTest[3]; |
+ } |
+ |
+ DebugOut.Analog[12] = Motor_Vorne; |
+ DebugOut.Analog[13] = Motor_Hinten; |
+ DebugOut.Analog[14] = Motor_Links; |
+ DebugOut.Analog[15] = Motor_Rechts; |
+ |
+ //Start I2C Interrupt Mode |
+ twi_state = 0; |
+ motor = 0; |
+ i2c_start(); |
+} |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Konstanten |
+// + 0-250 -> normale Werte |
+// + 251 -> Poti1 |
+// + 252 -> Poti2 |
+// + 253 -> Poti3 |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+void DefaultKonstanten1(void) |
+{ |
+ EE_Parameter.Kanalbelegung[K_NICK] = 3; |
+ EE_Parameter.Kanalbelegung[K_ROLL] = 2; |
+ EE_Parameter.Kanalbelegung[K_GAS] = 1; |
+ EE_Parameter.Kanalbelegung[K_GIER] = 4; |
+ EE_Parameter.Kanalbelegung[K_POTI1] = 5; |
+ EE_Parameter.Kanalbelegung[K_POTI2] = 6; |
+ EE_Parameter.Kanalbelegung[K_POTI3] = 7; |
+ EE_Parameter.Kanalbelegung[K_POTI4] = 8; |
+ EE_Parameter.GlobalConfig = 0;//CFG_HOEHENREGELUNG | /*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV | CFG_KOMPASS_FIX;//0x01; |
+ EE_Parameter.Hoehe_MinGas = 30; |
+ EE_Parameter.MaxHoehe = 251; // Wert : 0-32 251 -> Poti1 |
+ EE_Parameter.Hoehe_P = 10; // Wert : 0-32 |
+ EE_Parameter.Luftdruck_D = 70; // Wert : 0-250 |
+ EE_Parameter.Hoehe_ACC_Wirkung = 30; // Wert : 0-250 |
+ EE_Parameter.Hoehe_Verstaerkung = 2; // Wert : 0-50 |
+ EE_Parameter.Stick_P = 2; //2 // Wert : 1-6 |
+ EE_Parameter.Stick_D = 4; //8 // Wert : 0-64 |
+ EE_Parameter.Gier_P = 16; // Wert : 1-20 |
+ EE_Parameter.Gas_Min = 15; // Wert : 0-32 |
+ EE_Parameter.Gas_Max = 250; // Wert : 33-250 |
+ EE_Parameter.GyroAccFaktor = 26; // Wert : 1-64 |
+ EE_Parameter.KompassWirkung = 16; // Wert : 0-250 |
+ EE_Parameter.Gyro_P = 120; //80 // Wert : 0-250 |
+ EE_Parameter.Gyro_I = 150; // Wert : 0-250 |
+ EE_Parameter.UnterspannungsWarnung = 90; // Wert : 0-250 |
+ EE_Parameter.NotGas = 100; // Wert : 0-250 // Gaswert bei Empangsverlust |
+ EE_Parameter.NotGasZeit = 60; // Wert : 0-250 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen |
+ EE_Parameter.UfoAusrichtung = 0; // X oder + Formation |
+ EE_Parameter.I_Faktor = 5; |
+ EE_Parameter.UserParam1 = 16; //zur freien Verwendung, derzeit P-Anteil GPS |
+ EE_Parameter.UserParam2 = 2; //zur freien Verwendung, derzeit I-Anteil GPS |
+ EE_Parameter.UserParam3 = 12; //zur freien Verwendung, derzeit D-Anteil GPS |
+ EE_Parameter.UserParam4 = 0; //zur freien Verwendung |
+ EE_Parameter.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
+ EE_Parameter.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickRefresh = 5; |
+ memcpy(EE_Parameter.Name, "Normal\0", 12); |
+} |
+ |
+void DefaultKonstanten2(void) |
+{ |
+ EE_Parameter.Kanalbelegung[K_NICK] = 3; |
+ EE_Parameter.Kanalbelegung[K_ROLL] = 2; |
+ EE_Parameter.Kanalbelegung[K_GAS] = 1; |
+ EE_Parameter.Kanalbelegung[K_GIER] = 4; |
+ EE_Parameter.Kanalbelegung[K_POTI1] = 5; |
+ EE_Parameter.Kanalbelegung[K_POTI2] = 6; |
+ EE_Parameter.Kanalbelegung[K_POTI3] = 7; |
+ EE_Parameter.GlobalConfig = 0;//CFG_HOEHENREGELUNG | /*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV;//0x01; |
+ EE_Parameter.Hoehe_MinGas = 30; |
+ EE_Parameter.MaxHoehe = 251; // Wert : 0-32 251 -> Poti1 |
+ EE_Parameter.Hoehe_P = 10; // Wert : 0-32 |
+ EE_Parameter.Luftdruck_D = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_ACC_Wirkung = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_Verstaerkung = 2; // Wert : 0-50 |
+ EE_Parameter.Stick_P = 2; //2 // Wert : 1-6 |
+ EE_Parameter.Stick_D = 0; //8 // Wert : 0-64 |
+ EE_Parameter.Gier_P = 16; // Wert : 1-20 |
+ EE_Parameter.Gas_Min = 15; // Wert : 0-32 |
+ EE_Parameter.Gas_Max = 250; // Wert : 33-250 |
+ EE_Parameter.GyroAccFaktor = 26; // Wert : 1-64 |
+ EE_Parameter.KompassWirkung = 64; // Wert : 0-250 |
+ EE_Parameter.Gyro_P = 175; //80 // Wert : 0-250 |
+ EE_Parameter.Gyro_I = 175; // Wert : 0-250 |
+ EE_Parameter.UnterspannungsWarnung = 90; // Wert : 0-250 |
+ EE_Parameter.NotGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
+ EE_Parameter.NotGasZeit = 20; // Wert : 0-250 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen |
+ EE_Parameter.UfoAusrichtung = 0; // X oder + Formation |
+ EE_Parameter.I_Faktor = 5; |
+ EE_Parameter.UserParam1 = 12; //zur freien Verwendung |
+ EE_Parameter.UserParam2 = 2; //zur freien Verwendung |
+ EE_Parameter.UserParam3 = 16; //zur freien Verwendung |
+ EE_Parameter.UserParam4 = 0; //zur freien Verwendung |
+ EE_Parameter.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
+ EE_Parameter.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickRefresh = 5; |
+ memcpy(EE_Parameter.Name, "Kamera\0", 12); |
+} |
+ |
+ |
+//############################################################################ |
+// Trägt ggf. das Poti als Parameter ein |
+void ParameterZuordnung(void) |
+//############################################################################ |
+{ |
+ |
+ #define CHK_POTI(b,a,min,max) { if(a > 250) { if(a == 251) b = Poti1; else if(a == 252) b = Poti2; else if(a == 253) b = Poti3; else if(a == 254) b = Poti4;} else b = a; if(b <= min) b = min; else if(b >= max) b = max;} |
+ CHK_POTI(Parameter_MaxHoehe,EE_Parameter.MaxHoehe,0,255); |
+ CHK_POTI(Parameter_Luftdruck_D,EE_Parameter.Luftdruck_D,0,100); |
+ CHK_POTI(Parameter_Hoehe_P,EE_Parameter.Hoehe_P,0,100); |
+ CHK_POTI(Parameter_Hoehe_ACC_Wirkung,EE_Parameter.Hoehe_ACC_Wirkung,0,255); |
+ CHK_POTI(Parameter_KompassWirkung,EE_Parameter.KompassWirkung,0,255); |
+ CHK_POTI(Parameter_Gyro_P,EE_Parameter.Gyro_P,10,255); |
+ CHK_POTI(Parameter_Gyro_I,EE_Parameter.Gyro_I,0,255); |
+ CHK_POTI(Parameter_I_Faktor,EE_Parameter.I_Faktor,0,255); |
+ CHK_POTI(Parameter_UserParam1,EE_Parameter.UserParam1,0,255); |
+ CHK_POTI(Parameter_UserParam2,EE_Parameter.UserParam2,0,255); |
+ CHK_POTI(Parameter_UserParam3,EE_Parameter.UserParam3,0,255); |
+ CHK_POTI(Parameter_UserParam4,EE_Parameter.UserParam4,0,255); |
+ |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ |
+ Ki = (float) Parameter_I_Faktor * 0.0001; |
+ MAX_GAS = EE_Parameter.Gas_Max; |
+ MIN_GAS = EE_Parameter.Gas_Min; |
+} |
+ |
+//############################################################################ |
+// |
+void MotorRegler(void) |
+//############################################################################ |
+{ |
+ int motorwert,pd_ergebnis,h,tmp_int; |
+ int GierMischanteil,GasMischanteil; |
+ static long SummeNick=0,SummeRoll=0; |
+ static long sollGier = 0,tmp_long,tmp_long2; |
+ static int IntegralFehlerNick = 0; |
+ static int IntegralFehlerRoll = 0; |
+ static unsigned int RcLostTimer; |
+ static unsigned char delay_neutral = 0; |
+ static unsigned char delay_einschalten = 0,delay_ausschalten = 0; |
+ static unsigned int modell_fliegt = 0; |
+ static int hoehenregler = 0; |
+ static char TimerWerteausgabe = 0; |
+ static char NeueKompassRichtungMerken = 0; |
+ Mittelwert(); |
+//****** GPS Daten holen *************** |
+ short int n; |
+ if (gps_alive_cnt > 0) gps_alive_cnt--; //Dekrementieren. Wenn 0 kommen keine ausreichenden GPS Meldungen (Timeout) |
+ n = Get_Rel_Position(); |
+ if (n == 0) |
+ { |
+ ROT_ON; //led blitzen lassen |
+ } |
+//******PROVISORISCH*************** |
+ GRN_ON; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gaswert ermitteln |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ GasMischanteil = PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] + 120; |
+ if(GasMischanteil < 0) GasMischanteil = 0; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Empfang schlecht |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(SenderOkay < 100) |
+ { |
+ if(!PcZugriff) beeptime = 500; |
+ if(RcLostTimer) RcLostTimer--; |
+ else |
+ { |
+ MotorenEin = 0; |
+ Notlandung = 0; |
+ } |
+ ROT_ON; |
+ if(modell_fliegt > 2000) // wahrscheinlich in der Luft --> langsam absenken |
+ { |
+ GasMischanteil = EE_Parameter.NotGas; |
+ Notlandung = 1; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] = 0; |
+/* Poti1 = 65; |
+ Poti2 = 48; |
+ Poti3 = 0; |
+*/ } |
+ else MotorenEin = 0; |
+ } |
+ else |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Emfang gut |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(SenderOkay > 140) |
+ { |
+ Notlandung = 0; |
+ RcLostTimer = EE_Parameter.NotGasZeit * 50; |
+ if(GasMischanteil > 40) |
+ { |
+ if(modell_fliegt < 0xffff) modell_fliegt++; |
+ } |
+ if((modell_fliegt < 200) || (GasMischanteil < 40)) |
+ { |
+ SummeNick = 0; |
+ SummeRoll = 0; |
+ Mess_Integral_Gier = 0; |
+ Mess_Integral_Gier2 = 0; |
+ } |
+ if((GasMischanteil > 200) && MotorenEin == 0) |
+ { |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// auf Nullwerte kalibrieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) // Neutralwerte |
+ { |
+ unsigned char setting; |
+ if(++delay_neutral > 200) // nicht sofort |
+ { |
+ GRN_OFF; |
+ SetNeutral(); |
+ MotorenEin = 0; |
+ delay_neutral = 0; |
+ modell_fliegt = 0; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70 || abs(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]) > 70) |
+ { |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < 70) setting = 1; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 2; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] < 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 3; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] <-70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 4; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] <-70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < 70) setting = 5; |
+ eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], setting); // aktiven Datensatz merken |
+ } |
+ ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
+ Piep(GetActiveParamSetNumber()); |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
+ { |
+ if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset(); |
+ } |
+ GPS_Save_Home(); //Daten sind jetzt hoffentlich verfuegbar |
+ if (gps_home_position.status > 0 ) |
+ { |
+ Delay_ms(1000); //akustisch verkuenden dass GPS Home Daten da sind |
+ beeptime = 2000; |
+ Delay_ms(500); |
+ } |
+ } |
+ } |
+ else delay_neutral = 0; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gas ist unten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(GasMischanteil < 35) |
+ { |
+ // Starten |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] < -75) |
+ { |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Einschalten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(++delay_einschalten > 200) |
+ { |
+ delay_einschalten = 200; |
+ modell_fliegt = 1; |
+ MotorenEin = 1; |
+ sollGier = 0; |
+ Mess_Integral_Gier = 0; |
+ Mess_Integral_Gier2 = 0; |
+ Mess_IntegralNick = 0; |
+ Mess_IntegralRoll = 0; |
+ Mess_IntegralNick2 = IntegralNick; |
+ Mess_IntegralRoll2 = IntegralRoll; |
+ SummeNick = 0; |
+ SummeRoll = 0; |
+ } |
+ } |
+ else delay_einschalten = 0; |
+ //Auf Neutralwerte setzen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Auschalten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) |
+ { |
+ if(++delay_ausschalten > 200) // nicht sofort |
+ { |
+ MotorenEin = 0; |
+ delay_ausschalten = 200; |
+ modell_fliegt = 0; |
+ } |
+ } |
+ else delay_ausschalten = 0; |
+ } |
+ } |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// neue Werte von der Funke |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(!NewPpmData-- || Notlandung) |
+ { |
+ ParameterZuordnung(); |
+ StickNick = PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_P; |
+ StickNick += PPM_diff[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_D; |
+ StickRoll = PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_P; |
+ StickRoll += PPM_diff[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_D; |
+ StickGier = -PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]; |
+ |
+ GyroFaktor = ((float)Parameter_Gyro_P + 10.0) / 256.0; |
+ IntegralFaktor = ((float) Parameter_Gyro_I) / 44000; |
+ |
+ if(EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) IntegralFaktor = 0; |
+ if(GyroFaktor < 0) GyroFaktor = 0; |
+ if(IntegralFaktor < 0) IntegralFaktor = 0; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Bei Empfangsausfall im Flug |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(Notlandung) |
+ { |
+ StickGier = 0; |
+ StickNick = 0; |
+ StickRoll = 0; |
+ GyroFaktor = 0.1; |
+ IntegralFaktor = 0.005; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gyro-Drift kompensieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define DRIFT_FAKTOR 3 |
+ if(ZaehlMessungen >= 1000 / DRIFT_FAKTOR) |
+ { |
+ IntegralFehlerNick = IntegralNick2 - IntegralNick; |
+ IntegralFehlerRoll = IntegralRoll2 - IntegralRoll; |
+ ZaehlMessungen = 0; |
+ if(IntegralFehlerNick > 500/DRIFT_FAKTOR) AdNeutralNick++; |
+ if(IntegralFehlerNick < -500/DRIFT_FAKTOR) AdNeutralNick--; |
+ if(IntegralFehlerRoll > 500/DRIFT_FAKTOR) AdNeutralRoll++; |
+ if(IntegralFehlerRoll < -500/DRIFT_FAKTOR) AdNeutralRoll--; |
+ //if(Mess_Integral_Gier2 > 500/DRIFT_FAKTOR) AdNeutralGier--; |
+ //if(Mess_Integral_Gier2 <-500/DRIFT_FAKTOR) AdNeutralGier++; |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_IntegralNick2 = IntegralNick; |
+ Mess_IntegralRoll2 = IntegralRoll; |
+ Mess_Integral_Gier2 = Integral_Gier; |
+ ANALOG_ON; // ADC einschalten |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Integrale auf ACC-Signal abgleichen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ tmp_long = (long)(IntegralNick / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccNick) / 16; |
+ tmp_long2 = (long)(IntegralRoll / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccRoll) / 16; |
+#define AUSGLEICH 500 |
+ if(tmp_long > AUSGLEICH) tmp_long = AUSGLEICH; |
+ if(tmp_long < -AUSGLEICH) tmp_long =-AUSGLEICH; |
+ if(tmp_long2 > AUSGLEICH) tmp_long2 = AUSGLEICH; |
+ if(tmp_long2 <-AUSGLEICH) tmp_long2 =-AUSGLEICH; |
+ |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_IntegralNick -= tmp_long; |
+ Mess_IntegralRoll -= tmp_long2; |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ sollGier = StickGier; |
+ if(abs(StickGier) > 30) |
+ { |
+ if(!(EE_Parameter.GlobalConfig & CFG_KOMPASS_FIX)) NeueKompassRichtungMerken = 1; |
+ } |
+ tmp_int = EE_Parameter.Gier_P * (sollGier * abs(sollGier)) / 256; // expo |
+ Mess_Integral_Gier -= tmp_int; |
+ if(Mess_Integral_Gier > 30000) Mess_Integral_Gier = 30000; // begrenzen |
+ if(Mess_Integral_Gier <-30000) Mess_Integral_Gier =-30000; |
+ |
+ ANALOG_ON; // ADC einschalten |
+ |
+ |
+ |
+// Salvo 6.10.2007 |
+ // GPS Home aktivieren wenn Knueppel in Ruhelage und Hoehenschalter aktiviert ist |
+ //GPS Hold Aktiveren wenn Knueppel in Ruhelage sind |
+ if ((EE_Parameter.GlobalConfig & CFG_GPS_AKTIV) && (abs(StickRoll) < GPS_STICK_HOLDOFF) && (abs(StickNick) < GPS_STICK_HOLDOFF) && (gps_alive_cnt > 0)) |
+ { |
+ if (Parameter_MaxHoehe > 200) |
+ { |
+ if ( gps_cmd == GPS_CMD_REQ_HOLD) gps_cmd = GPS_CMD_STOP; // erst mal stoppen, denn altes Kommando wurde noch nicht beendet |
+ else gps_cmd = GPS_CMD_REQ_HOME; |
+ n = GPS_CRTL(gps_cmd); |
+ } |
+ else |
+ { |
+ if ( gps_cmd == GPS_CMD_REQ_HOME) gps_cmd = GPS_CMD_STOP; // erst mal stoppen, denn altes Kommando wurde noch nicht beendet |
+ else gps_cmd = GPS_CMD_REQ_HOLD; |
+ n= GPS_CRTL(gps_cmd); |
+ } |
+ } |
+ else (n= GPS_CRTL(GPS_CMD_STOP)); //GPS Lageregelung beenden |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Kompass |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(KompassValue && (EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV)) |
+ { |
+ if(NeueKompassRichtungMerken) |
+ { |
+ KompassStartwert = KompassValue; |
+ NeueKompassRichtungMerken = 0; |
+ } |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_Integral_Gier -= (KompassRichtung * Parameter_KompassWirkung) / 32; // nach Kompass ausrichten |
+ ANALOG_ON; // ADC einschalten |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Debugwerte zuordnen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+DebugOut.Sekunden++; |
+ if(!TimerWerteausgabe--) |
+ { |
+ TimerWerteausgabe = 49; |
+ |
+ DebugOut.Analog[0] = MM3.NickGrad; |
+ DebugOut.Analog[1] = MM3.RollGrad; |
+ DebugOut.Analog[2] = Mittelwert_AccNick; |
+ DebugOut.Analog[3] = Mittelwert_AccRoll; |
+ DebugOut.Analog[4] = MesswertGier; |
+ DebugOut.Analog[5] = HoehenWert; |
+ DebugOut.Analog[6] = (Mess_Integral_Hoch / 512); |
+ DebugOut.Analog[7] = GasMischanteil; |
+ DebugOut.Analog[8] = KompassValue; |
+ DebugOut.Analog[9] = KompassRichtung; |
+ DebugOut.Analog[10] = MM3_heading(); |
+ |
+ |
+ |
+//DebugOut.Analog[9] = MM3.x_axis; |
+//DebugOut.Analog[10] = MM3.y_axis; |
+//DebugOut.Analog[11] = MM3.z_axis; |
+//DebugOut.Analog[13] = KompassRichtung; |
+ |
+ |
+ } |
+ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Drehgeschwindigkeit und -winkel zu einem Istwert zusammenfassen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ MesswertNick = IntegralNick * IntegralFaktor + MesswertNick * GyroFaktor; |
+ MesswertRoll = IntegralRoll * IntegralFaktor + MesswertRoll * GyroFaktor; |
+ MesswertGier = MesswertGier * (GyroFaktor/2) + Integral_Gier * IntegralFaktor; |
+ // Maximalwerte abfangen |
+ #define MAX_SENSOR 2048 |
+ if(MesswertNick > MAX_SENSOR) MesswertNick = MAX_SENSOR; |
+ if(MesswertNick < -MAX_SENSOR) MesswertNick = -MAX_SENSOR; |
+ if(MesswertRoll > MAX_SENSOR) MesswertRoll = MAX_SENSOR; |
+ if(MesswertRoll < -MAX_SENSOR) MesswertRoll = -MAX_SENSOR; |
+ if(MesswertGier > MAX_SENSOR) MesswertGier = MAX_SENSOR; |
+ if(MesswertGier < -MAX_SENSOR) MesswertGier = -MAX_SENSOR; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Höhenregelung |
+// Die Höhenregelung schwächt lediglich das Gas ab, erhöht es allerdings nicht |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+//OCR0B = 180 - (Poti1 + 120) / 4; |
+//DruckOffsetSetting = OCR0B; |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung |
+ { |
+ int tmp_int; |
+ if(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER) // Regler wird über Schalter gesteuert |
+ { |
+ if(Parameter_MaxHoehe < 50) |
+ { |
+//Salvo 10.10.2007 Um Absacken beim Einschalten zu verhindern |
+// SollHoehe = HoehenWert - 20; // Parameter_MaxHoehe ist der PPM-Wert des Schalters |
+ SollHoehe = HoehenWert - 0; // Parameter_MaxHoehe ist der PPM-Wert des Schalters |
+// Salvo End |
+ HoehenReglerAktiv = 0; |
+ } |
+ else |
+ HoehenReglerAktiv = 1; |
+ } |
+ else |
+ { |
+ SollHoehe = Parameter_MaxHoehe * EE_Parameter.Hoehe_Verstaerkung - 20; |
+ HoehenReglerAktiv = 1; |
+ } |
+ |
+ if(Notlandung) SollHoehe = 0; |
+ h = HoehenWert; |
+ if((h > SollHoehe) && HoehenReglerAktiv) // zu hoch --> drosseln |
+ { h = ((h - SollHoehe) * (int) Parameter_Hoehe_P) / 16; // Differenz bestimmen --> P-Anteil |
+ h = GasMischanteil - h; // vom Gas abziehen |
+ h -= (HoeheD * Parameter_Luftdruck_D)/8; // D-Anteil |
+ tmp_int = ((Mess_Integral_Hoch / 512) * (signed long) Parameter_Hoehe_ACC_Wirkung) / 32; |
+ if(tmp_int > 50) tmp_int = 50; |
+ else if(tmp_int < -50) tmp_int = -50; |
+ h -= tmp_int; |
+ hoehenregler = (hoehenregler*15 + h) / 16; |
+ if(hoehenregler < EE_Parameter.Hoehe_MinGas) // nicht unter MIN |
+ { |
+ if(GasMischanteil >= EE_Parameter.Hoehe_MinGas) hoehenregler = EE_Parameter.Hoehe_MinGas; |
+ if(GasMischanteil < EE_Parameter.Hoehe_MinGas) hoehenregler = GasMischanteil; |
+ } |
+ if(hoehenregler > GasMischanteil) hoehenregler = GasMischanteil; // nicht mehr als Gas |
+ GasMischanteil = hoehenregler; |
+ } |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Mischer und PI-Regler |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gier-Anteil |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ GierMischanteil = MesswertGier - sollGier; // Regler für Gier |
+ if(GierMischanteil > 100) GierMischanteil = 100; |
+ if(GierMischanteil < -100) GierMischanteil = -100; |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Nick-Achse |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ DiffNick = Kp * (MesswertNick - (StickNick - GPS_Nick)); // Differenz bestimmen |
+ SummeNick += DiffNick; // I-Anteil |
+ if(SummeNick > 0) SummeNick-= (abs(SummeNick)/256 + 1); else SummeNick += abs(SummeNick)/256 + 1; |
+ if(SummeNick > 16000) SummeNick = 16000; |
+ if(SummeNick < -16000) SummeNick = -16000; |
+ pd_ergebnis = DiffNick + Ki * SummeNick; // PI-Regler für Nick |
+ // Motor Vorn |
+ motorwert = GasMischanteil + pd_ergebnis + GierMischanteil; // Mischer |
+ if ((motorwert < 0) | (GasMischanteil < 10)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Vorne = motorwert; |
+ // Motor Heck |
+ motorwert = GasMischanteil - pd_ergebnis + GierMischanteil; |
+ if ((motorwert < 0) | (GasMischanteil < 10)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Hinten = motorwert; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Roll-Achse |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ DiffRoll = Kp * (MesswertRoll - (StickRoll - GPS_Roll)); // Differenz bestimmen |
+ SummeRoll += DiffRoll; // I-Anteil |
+ if(SummeRoll > 0) SummeRoll-= (abs(SummeRoll)/256 + 1); else SummeRoll += abs(SummeRoll)/256 + 1; |
+ if(SummeRoll > 16000) SummeRoll = 16000; |
+ if(SummeRoll < -16000) SummeRoll = -16000; |
+ pd_ergebnis = DiffRoll + Ki * SummeRoll; // PI-Regler für Roll |
+ // Motor Links |
+ motorwert = GasMischanteil + pd_ergebnis - GierMischanteil; |
+ if ((motorwert < 0) | (GasMischanteil < 10)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Links = motorwert; |
+ // Motor Rechts |
+ motorwert = GasMischanteil - pd_ergebnis - GierMischanteil; |
+ if ((motorwert < 0) | (GasMischanteil < 10)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Rechts = motorwert; |
+ // +++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+} |
+ |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/fc.h |
---|
0,0 → 1,119 |
/*####################################################################################### |
Flight Control |
#######################################################################################*/ |
#ifndef _FC_H |
#define _FC_H |
extern unsigned char Parameter_UserParam1 ; |
extern unsigned char Parameter_UserParam2 ; |
extern unsigned char Parameter_UserParam3 ; |
// Salvo End |
extern volatile unsigned char Timeout; |
extern unsigned char Sekunde,Minute; |
extern volatile long IntegralNick,IntegralNick2; |
extern volatile long IntegralRoll,IntegralRoll2; |
extern volatile long Mess_IntegralNick,Mess_IntegralNick2; |
extern volatile long Mess_IntegralRoll,Mess_IntegralRoll2; |
extern volatile long Mess_Integral_Hoch; |
extern volatile long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2; |
extern volatile int KompassValue; |
extern volatile int KompassStartwert; |
extern volatile int KompassRichtung; |
extern int HoehenWert; |
extern int SollHoehe; |
extern volatile int MesswertNick,MesswertRoll,MesswertGier; |
extern volatile int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll; |
extern volatile int NeutralAccX, NeutralAccY,Mittelwert_AccHoch; |
extern volatile float NeutralAccZ; |
/*Salvo 2.9.2007 Ersatzkompass |
extern volatile long GyroKomp_Int; |
extern volatile int GyroKomp_Inc_Grad; |
extern volatile int GyroKomp_Value; // Der ermittelte Kompasswert aus Gyro und Magnetkompass |
Salvo End*/ |
void MotorRegler(void); |
void SendMotorData(void); |
void CalibrierMittelwert(void); |
void Mittelwert(void); |
void SetNeutral(void); |
void Piep(unsigned char Anzahl); |
void DefaultKonstanten1(void); |
void DefaultKonstanten2(void); |
unsigned char h,m,s; |
volatile unsigned char Timeout ; |
unsigned char CosinusNickWinkel, CosinusRollWinkel; |
volatile long IntegralNick,IntegralNick2; |
volatile long IntegralRoll,IntegralRoll2; |
volatile long Integral_Gier; |
volatile long Mess_IntegralNick,Mess_IntegralNick2; |
volatile long Mess_IntegralRoll,Mess_IntegralRoll2; |
volatile long Mess_Integral_Gier; |
volatile int DiffNick,DiffRoll; |
extern int Poti1, Poti2, Poti3, Poti4; |
volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
unsigned char MotorWert[5]; |
volatile unsigned char SenderOkay; |
int StickNick,StickRoll,StickGier; |
char MotorenEin; |
extern void DefaultKonstanten(void); |
#define STRUCT_PARAM_LAENGE 58 |
struct mk_param_struct |
{ |
unsigned char Kanalbelegung[8]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3 |
unsigned char GlobalConfig; // 0x01=Höhenregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv |
unsigned char Hoehe_MinGas; // Wert : 0-100 |
unsigned char Luftdruck_D; // Wert : 0-250 |
unsigned char MaxHoehe; // Wert : 0-32 |
unsigned char Hoehe_P; // Wert : 0-32 |
unsigned char Hoehe_Verstaerkung; // Wert : 0-50 |
unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250 |
unsigned char Stick_P; // Wert : 1-6 |
unsigned char Stick_D; // Wert : 0-64 |
unsigned char Gier_P; // Wert : 1-20 |
unsigned char Gas_Min; // Wert : 0-32 |
unsigned char Gas_Max; // Wert : 33-250 |
unsigned char GyroAccFaktor; // Wert : 1-64 |
unsigned char KompassWirkung; // Wert : 0-32 |
unsigned char Gyro_P; // Wert : 10-250 |
unsigned char Gyro_I; // Wert : 0-250 |
unsigned char UnterspannungsWarnung; // Wert : 0-250 |
unsigned char NotGas; // Wert : 0-250 //Gaswert bei Empängsverlust |
unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen |
unsigned char UfoAusrichtung; // X oder + Formation |
unsigned char I_Faktor; // Wert : 0-250 |
unsigned char UserParam1; // Wert : 0-250 |
unsigned char UserParam2; // Wert : 0-250 |
unsigned char UserParam3; // Wert : 0-250 |
unsigned char UserParam4; // Wert : 0-250 |
unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos |
unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo |
unsigned char ServoNickMin; // Wert : 0-250 // Anschlag |
unsigned char ServoNickMax; // Wert : 0-250 // Anschlag |
unsigned char ServoNickRefresh; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
unsigned char ServoNickCompInvert; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
unsigned char Reserved[7]; |
char Name[12]; |
}; |
extern struct mk_param_struct EE_Parameter; |
extern unsigned char Parameter_Luftdruck_D; |
extern unsigned char Parameter_MaxHoehe; |
extern unsigned char Parameter_Hoehe_P; |
extern unsigned char Parameter_Hoehe_ACC_Wirkung; |
extern unsigned char Parameter_KompassWirkung; |
extern unsigned char Parameter_Gyro_P; |
extern unsigned char Parameter_Gyro_I; |
extern unsigned char Parameter_Gier_P; |
extern unsigned char Parameter_ServoNickControl; |
#endif //_FC_H |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/flight-ctrl_mega644_v0_60.aws |
---|
0,0 → 1,0 |
<AVRWorkspace><IOSettings><CurrentRegisters/></IOSettings><part name="ATMEGA644"/><Files><File00000 Name="E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v60SalvoKompassGyro\main.c" Position="320 71 1032 624" LineCol="116 0" State="Maximized"/><File00001 Name="E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v60SalvoKompassGyro\compass.c" Position="330 67 1396 826" LineCol="128 0" State="Maximized"/><File00002 Name="E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v60SalvoKompassGyro\math.c" Position="375 132 925 504" LineCol="161 0" State="Maximized"/><File00003 Name="E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v60SalvoKompassGyro\analog.c" Position="336 71 1182 830" LineCol="106 0" State="Maximized"/></Files></AVRWorkspace> |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/flight.pnproj |
---|
0,0 → 1,0 |
<Project name="Flight-Ctrl"><File path="uart.h"></File><File path="main.c"></File><File path="main.h"></File><File path="makefile"></File><File path="uart.c"></File><File path="printf_P.h"></File><File path="printf_P.c"></File><File path="timer0.c"></File><File path="timer0.h"></File><File path="old_macros.h"></File><File path="twimaster.c"></File><File path="version.txt"></File><File path="twimaster.h"></File><File path="rc.c"></File><File path="rc.h"></File><File path="fc.h"></File><File path="fc.c"></File><File path="menu.h"></File><File path="menu.c"></File><File path="_Settings.h"></File><File path="analog.c"></File><File path="analog.h"></File><File path="GPS.c"></File><File path="gps.h"></File><File path="License.txt"></File><File path="math.c"></File><File path="math.h"></File><File path="compass.c"></File><File path="compass.h"></File></Project> |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/flight.pnps |
---|
0,0 → 1,0 |
<pd><ViewState><e p="Flight-Ctrl" x="true"></e></ViewState></pd> |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/gps.h |
---|
0,0 → 1,132 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Peter Muehlenbrock ("Salvo") |
// Definitionen fuer Modul GPS |
// Stand 12.10.007 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
extern signed int GPS_Nick; |
extern signed int GPS_Roll; |
extern void GPS_Neutral(void); |
extern void Get_Ublox_Msg(uint8_t rx) ; |
//extern short int Get_GPS_data(void); |
extern short int Get_Rel_Position(void); |
extern void GPS_Save_Home(void); |
extern short int GPS_CRTL(short int cmd); |
typedef struct { |
unsigned long utm_itow; // time of week |
long utm_east; // UTM Ost in cm |
long utm_north; // UTM Nord in cm |
long utm_alt; // hoehe in cm |
uint8_t utm_zone; // |
uint8_t utm_hem; // Hemisphere Indicator |
uint8_t status; // 0: kein gueltiges Paket 1: alles ok |
} NAV_POSUTM_t; |
typedef struct { |
unsigned long itow; // time of week |
uint8_t gpsfix_type;// 3=3D Fix |
uint8_t nav_status_flag; |
uint8_t nav_diff_status; |
uint8_t nav_resevd; |
long nav_tff; // Time to First Fix in ms |
long nav_msss; // ms since startup |
uint8_t status; // 0: kein gueltiges Paket 1: alles ok |
} NAV_STATUS_t; |
typedef struct { |
unsigned long itow; |
long speed_n; // in cm/s |
long speed_e; // in cm/s |
long speed_alt; // in cm/s |
unsigned long speed_3d; // in cm/s |
unsigned long speed_gnd; // V ueber Grund in cm/s |
long heading; // Richtung in deg/10000 |
unsigned long sacc; // Speed Genauigkeit in cm/s |
unsigned long cacc; // Richtungsgenauigkeit in deg |
uint8_t status; // 0: kein gueltiges Paket 1: alles ok |
} NAV_VELNED_t; |
typedef struct { |
long utm_east; // UTM Ost in 10 cm |
long utm_north; // UTM Nord in 10 cm |
long utm_alt; // hoehe in 10 cm |
unsigned long speed_gnd; // V ueber Grund in 10cm/s |
unsigned heading; // Richtung in Grad |
uint8_t status; // 0: keine gueltigen Daten 1: alles ok |
} GPS_ABS_POSITION_t; |
typedef struct { // Struktur fuer Relative GPS Daten (bezogen z.B. auf Home Position) |
int utm_east; // UTM Ost in m |
int utm_north; // UTM Nord in m |
uint8_t status; // 0: keine gueltigen Daten 1: alles ok |
} GPS_REL_POSITION_t; |
extern GPS_ABS_POSITION_t gps_act_position; |
extern GPS_ABS_POSITION_t gps_home_position; |
extern GPS_REL_POSITION_t gps_rel_act_position; |
extern GPS_REL_POSITION_t gps_rel_hold_position; |
extern short int gps_state,gps_sub_state; |
extern signed int GPS_hdng_abs_2trgt; |
extern signed int GPS_hdng_rel_2trgt; |
extern signed int GPS_dist_2trgt; |
extern signed int gps_reg_x,gps_reg_y; |
extern signed int GPS_dist_2trgt; |
extern unsigned int gps_alive_cnt; |
//nur provisorisch fuer Debugausgaben |
extern signed hdng_2home,dist_2home; //Richtung und Entfernung zur home Position |
extern long int dist_flown; |
// Zustaende der zentralen GPS statemachine |
#define GPS_CRTL_IDLE 0 // |
#define GPS_CRTL_HOLD_ACTIVE 1 // Lageregelung aktiv |
#define GPS_CRTL_HOME_ACTIVE 2 // Rueckflug zur Basis Aktiv |
#define GPS_HOME_FAST_IN_TOL 3 // Rueckflug: Aktuelle Position innerhalb der Toleranz |
#define GPS_HOME_FAST_OUTOF_TOL 4 // Rueckflug: Aktuelle Position ausserhalb der Toleranz |
#define GPS_HOME_RMPDWN_IN_TOL 5 // Rueckflug: beim Abbremsen Position innerhalb der Toleranz |
#define GPS_HOME_RMPDWN_OUTOF_TOL 6 // Rueckflug: beim Abbremsen Position ausserhalb der Toleranz |
#define GPS_HOME_IN_TOL 7 // Rueckflug: Nahe am Ziel innerhalb der Toleranz |
#define GPS_HOME_OUTOF_TOL 8 // Rueckflug: Nahe am Ziel ausserhalb der Toleranz |
#define GPS_HOME_FINISHED 9 // Rueckflug zur Basis abgeschlossen |
// Kommandokonstanten fuer die zentrale GPS Statemachine |
#define GPS_CMD_REQ_INIT 0 // Initialisierung |
#define GPS_CMD_STOP 1 // Lageregelung soll deaktiviert werden |
#define GPS_CMD_REQ_HOLD 3 // Lageregelung soll aktiviert werden |
#define GPS_CMD_REQ_HOME 4 // Das Heimfliegen soll aktiviert werden |
// Statusmeldungen der zentralen GPS statemachine |
#define GPS_STST_OK 0 // Kommando erfolgreich und abgeschlossen |
#define GPS_STST_PEND 1 // Kommando noch nicht komplett durchgefuehrt |
#define GPS_STST_ERR 2 // Fehler |
// GPS Lageregler |
#define GPS_NICKROLL_MAX 40 // Maximaler Einfluss des GPS Lagereglers auf Nick und Roll |
#define GPS_DIST_MAX 400 // Maximal zulaessige Distanz bevor Regelung gestoppt wird (in 10cm) |
#define GPS_STICK_HOLDOFF 25 // Wenn der Nick oder Roll Stickwerte groesser sind, wird GPS_HOLD deaktiviert |
#define GPS_V 8 // Teilerfaktor Regelabweichung zu Ausgabewert |
// Differenzierer Kennwerte fuer von Distanz abhaengige Verstaerkung, abhaengig vom Modus. |
#define GPS_DIFF_NRML_MAX_V 20 //maximale Verstaerkung * 10 |
#define GPS_DIFF_NRML_MAX_D 30 //Entfernung bei der maximale Verstaerkung erreicht wird in 10cm |
#define GPS_DIFF_FAST_MAX_V 15 //maximale Verstaerkung * 10 im Fast mode |
#define GPS_DIFF_FAST_MAX_D 50 //Entfernung bei der maximale Verstaerkung erreicht wird in 10cm im Fast mode |
// P-Regler Verstaerkung |
#define GPS_PROP_NRML_V 2 //maximale Verstaerkung * 2 |
#define GPS_PROP_FAST_V 2 //maximale Verstaerkung * 2 im Fast mode |
// GPS G2T /Go to Target Regler |
#define GPS_G2T_DIST_MAX_STOP 50 // Ab dieser Entfernung vom Zielpunkt soll die Geschwindigkeit runtergeregelt werden( in 10 cm) |
#define GPS_G2T_DIST_HOLD 30 // Ab dieser Entfernung vom Zielpunkt wird mit Minimaler Geschwindigkeit eingeregelt |
#define GPS_G2T_V_MAX 12 // Maximale Geschwindigkeit (in 10cm/0.25 Sekunden) mit der der Sollpunkt geaendert wird. |
#define GPS_G2T_V_RAMP_DWN 6 // Geschwindigkeit (in 10cm/0.25ekunden) in der Naehe der Home Position um abzubremsen |
#define GPS_G2T_V_MIN 3 // Minimale (in 10cm/0.25 Sekunden) ganz nahe an Homeposition. |
#define GPS_G2T_FAST_TOL 60 // Bei grosser Entfernung vom Ziel: Der Sollwert wird nur geaendert wenn die aktuelle Position nicht mehr als diesem Wert vom Sollwert abweicht |
#define GPS_G2T_NRML_TOL 40 // Bei kleiner Entfernung vom Ziel: Der Sollwert wird nur geaendert wenn die aktuelle Position nicht mehr als diesem Wert vom Sollwert abweicht |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/license_buss.txt |
---|
0,0 → 1,52 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + Nur für den privaten Gebrauch |
// + www.MikroKopter.com |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
// + dass eine Nutzung (auch auszugsweise) nur für den privaten und nichtkommerziellen Gebrauch zulässig ist. |
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
// + bzgl. der Nutzungsbedingungen aufzunehmen. |
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
// + Verkauf von Luftbildaufnahmen, usw. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
// + eindeutig als Ursprung verlinkt und genannt werden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
// + Benutzung auf eigene Gefahr |
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
// + mit unserer Zustimmung zulässig |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
// + this list of conditions and the following disclaimer. |
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
// + from this software without specific prior written permission. |
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
// + for non-profit use (directly or indirectly) |
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
// + with our written permission |
// + * If sources or documentations are redistributet, our webpage (http://www.MikroKopter.de) must be |
// + clearly linked and named as origin |
// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/main.c |
---|
0,0 → 1,215 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + Nur für den privaten Gebrauch |
// + www.MikroKopter.com |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
// + dass eine Nutzung (auch auszugsweise) nur für den privaten und nicht-kommerziellen Gebrauch zulässig ist. |
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
// + bzgl. der Nutzungsbedingungen aufzunehmen. |
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
// + Verkauf von Luftbildaufnahmen, usw. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
// + auf anderen Webseiten oder Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
// + eindeutig als Ursprung verlinkt und genannt werden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
// + Benutzung auf eigene Gefahr |
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
// + mit unserer Zustimmung zulässig |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
// + this list of conditions and the following disclaimer. |
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
// + from this software without specific prior written permission. |
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
// + for non-commercial use (directly or indirectly) |
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
// + with our written permission |
// + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
// + clearly linked as origin |
// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
unsigned char EEPromArray[E2END+1] EEMEM; |
// -- Parametersatz aus EEPROM lesen --- |
// number [0..5] |
void ReadParameterSet(unsigned char number, unsigned char *buffer, unsigned char length) |
{ |
if (number > 5) number = 5; |
eeprom_read_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * number], length); |
} |
// -- Parametersatz ins EEPROM schreiben --- |
// number [0..5] |
void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length) |
{ |
if (number > 5) number = 5; |
eeprom_write_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * number], length); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], number); // diesen Parametersatz als aktuell merken |
} |
unsigned char GetActiveParamSetNumber(void) |
{ |
return(eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET])); |
} |
//############################################################################ |
//Hauptprogramm |
int main (void) |
//############################################################################ |
{ |
unsigned int timer; |
unsigned int timer2 = 0; |
DDRC = 0x01; // SCL |
PORTC = 0xff; // Pullup SDA |
DDRB = 0x1B; // LEDs und Druckoffset |
PORTB |= (1<<PB0); // LED_Rot |
DDRD = 0x3E; // Speaker & TXD & J3 J4 J5 |
DDRD |= (1<<PD7); // J7 |
PORTD = 0xF7; |
MCUSR &=~(1<<WDRF); |
WDTCSR |= (1<<WDCE)|(1<<WDE); |
WDTCSR = 0; |
beeptime = 2000; |
StickGier = 0; PPM_in[K_GAS] = 0;StickRoll = 0; StickNick = 0; |
ROT_OFF; |
Timer_Init(); |
UART_Init(); |
rc_sum_init(); |
ADC_Init(); |
i2c_init(); |
init_spi(); |
sei(); |
VersionInfo.Hauptversion = VERSION_HAUPTVERSION; |
VersionInfo.Nebenversion = VERSION_NEBENVERSION; |
VersionInfo.PCKompatibel = VERSION_KOMPATIBEL; |
printf("\n\rFlightControl V%d.%d ", VERSION_HAUPTVERSION, VERSION_NEBENVERSION); |
printf("\n\r=============================="); |
GRN_ON; |
if(eeprom_read_byte(&EEPromArray[EEPROM_ADR_VALID]) != 59) // seit V 0.60 |
{ |
printf("\n\rInit. EEPROM: Generiere Default-Parameter..."); |
DefaultKonstanten1(); |
for (unsigned char i=0;i<6;i++) |
{ |
if(i==2) DefaultKonstanten2(); |
WriteParameterSet(i, (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
} |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], 1); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_VALID], 59); |
} |
ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
printf("\n\rBenutze Parametersatz %d", GetActiveParamSetNumber()); |
if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
printf("\n\rAbgleich Luftdrucksensor.."); |
timer = SetDelay(2500); |
SucheLuftruckOffset(); |
while (!CheckDelay(timer)); |
printf("OK\n\r"); |
} |
SetNeutral(); |
ROT_OFF; |
beeptime = 2000; |
DebugIn.Analog[1] = 1000; |
DebugIn.Digital[0] = 0x55; |
printf("\n\rSteuerung: "); |
if (EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) printf("HeadingHold"); |
else printf("Neutral"); |
printf("\n\n\r"); |
LcdClear(); |
while (1) |
{ |
if (UpdateMotor) // ReglerIntervall |
{ |
UpdateMotor=0; |
MotorRegler(); |
SendMotorData(); |
ROT_OFF; |
if(PcZugriff) PcZugriff--; |
if(SenderOkay) SenderOkay--; |
if (UBat < EE_Parameter.UnterspannungsWarnung) |
{ |
beeptime = 2000; |
} |
if(!Timeout) |
{ |
i2c_init(); |
} |
else |
{ |
ROT_OFF; |
} |
} |
if(SIO_DEBUG) |
{ |
DatenUebertragung(); |
BearbeiteRxDaten(); |
} |
else BearbeiteRxDaten(); |
if(CheckDelay(timer2)) |
{ |
if(MotorenEin) PORTC ^= 0x10; else PORTC &= ~0x10; |
timer = SetDelay(500); |
} |
} |
return (1); |
} |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/main.h |
---|
0,0 → 1,95 |
#ifndef _MAIN_H |
#define _MAIN_H |
//Hier die Quarz Frequenz einstellen |
#if defined (__AVR_ATmega32__) |
#define SYSCLK 20000000L //Quarz Frequenz in Hz |
#endif |
#if defined (__AVR_ATmega644__) |
#define SYSCLK 20000000L //Quarz Frequenz in Hz |
//#define SYSCLK 16000000L //Quarz Frequenz in Hz |
#endif |
// neue Hardware |
#define ROT_OFF PORTB &=~0x01 |
#define ROT_ON PORTB |= 0x01 |
#define ROT_FLASH PORTB ^= 0x01 |
#define GRN_OFF PORTB &=~0x02 |
#define GRN_ON PORTB |= 0x02 |
#define GRN_FLASH PORTD ^= 0x02 |
//#ifndef F_CPU |
//#error ################## F_CPU nicht definiert oder ungültig ############# |
//#endif |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//#define ANZ_MITTELWERT 4 |
#define EEPROM_ADR_VALID 1 |
#define EEPROM_ADR_ACTIVE_SET 2 |
#define EEPROM_ADR_PARAM_BEGIN 100 |
#define CFG_HOEHENREGELUNG 0x01 |
#define CFG_HOEHEN_SCHALTER 0x02 |
#define CFG_HEADING_HOLD 0x04 |
#define CFG_KOMPASS_AKTIV 0x08 |
#define CFG_KOMPASS_FIX 0x10 |
#define CFG_GPS_AKTIV 0x20 |
//#define SYSCLK |
//extern unsigned long SYSCLK; |
extern volatile int i_Nick[20],i_Roll[20],DiffNick,DiffRoll; |
extern volatile unsigned char SenderOkay; |
extern unsigned char CosinusNickWinkel, CosinusRollWinkel; |
extern void ReadParameterSet (unsigned char number, unsigned char *buffer, unsigned char length); |
extern void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length); |
extern unsigned char GetActiveParamSetNumber(void); |
extern unsigned char EEPromArray[]; |
#include <stdlib.h> |
#include <string.h> |
#include <avr/io.h> |
#include <avr/pgmspace.h> |
#include <avr/interrupt.h> |
#include <avr/eeprom.h> |
#include <avr/boot.h> |
#include <avr/wdt.h> |
#include "old_macros.h" |
#include "_Settings.h" |
#include "printf_P.h" |
#include "compass.h" |
#include "timer0.h" |
#include "uart.h" |
#include "analog.h" |
#include "twimaster.h" |
#include "menu.h" |
#include "rc.h" |
#include "fc.h" |
#include "math.h" |
#include "gps.h" |
#include "math.h" |
#ifndef EEMEM |
#define EEMEM __attribute__ ((section (".eeprom"))) |
#endif |
#define DEBUG_DISPLAY_INTERVALL 123 // in ms |
#define DELAY_US(x) ((unsigned int)( (x) * 1e-6 * F_CPU )) |
#endif //_MAIN_H |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/makefile |
---|
0,0 → 1,392 |
#-------------------------------------------------------------------- |
# MCU name |
MCU = atmega644 |
F_CPU = 20000000 |
#------------------------------------------------------------------- |
HAUPT_VERSION = 0 |
NEBEN_VERSION = 60 |
VERSION_KOMPATIBEL = 4 # PC-Kompatibilität |
#------------------------------------------------------------------- |
ifeq ($(MCU), atmega32) |
# FUSE_SETTINGS= -u -U lfuse:w:0xff:m -U hfuse:w:0xcf:m |
HEX_NAME = MEGA32 |
endif |
ifeq ($(MCU), atmega644) |
FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
#FUSE_SETTINGS = -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
# -u bei neuen Controllern wieder einspielen |
HEX_NAME = MEGA644 |
endif |
ifeq ($(F_CPU), 16000000) |
QUARZ = 16MHZ |
endif |
ifeq ($(F_CPU), 20000000) |
QUARZ = 20MHZ |
endif |
# Output format. (can be srec, ihex, binary) |
FORMAT = ihex |
# Target file name (without extension). |
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION) |
# Optimization level, can be [0, 1, 2, 3, s]. 0 turns off optimization. |
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.) |
OPT = s |
########################################################################################################## |
# List C source files here. (C dependencies are automatically generated.) |
SRC = main.c uart.c printf_P.c timer0.c analog.c menu.c compass.c math.c |
SRC += twimaster.c rc.c fc.c GPS.c |
########################################################################################################## |
# List Assembler source files here. |
# Make them always end in a capital .S. Files ending in a lowercase .s |
# will not be considered source files but generated files (assembler |
# output from the compiler), and will be deleted upon "make clean"! |
# Even though the DOS/Win* filesystem matches both .s and .S the same, |
# it will preserve the spelling of the filenames, and gcc itself does |
# care about how the name is spelled on its command-line. |
ASRC = |
# List any extra directories to look for include files here. |
# Each directory must be seperated by a space. |
EXTRAINCDIRS = |
# Optional compiler flags. |
# -g: generate debugging information (for GDB, or for COFF conversion) |
# -O*: optimization level |
# -f...: tuning, see gcc manual and avr-libc documentation |
# -Wall...: warning level |
# -Wa,...: tell GCC to pass this to the assembler. |
# -ahlms: create assembler listing |
CFLAGS = -O$(OPT) \ |
-funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums \ |
-Wall -Wstrict-prototypes \ |
-mtiny-stack -mcall-prologues \ |
-Wa,-adhlns=$(<:.c=.lst) \ |
$(patsubst %,-I%,$(EXTRAINCDIRS)) |
# Set a "language standard" compiler flag. |
# Unremark just one line below to set the language standard to use. |
# gnu99 = C99 + GNU extensions. See GCC manual for more information. |
#CFLAGS += -std=c89 |
#CFLAGS += -std=gnu89 |
#CFLAGS += -std=c99 |
CFLAGS += -std=gnu99 |
CFLAGS += -DVERSION_HAUPTVERSION=$(HAUPT_VERSION) -DVERSION_NEBENVERSION=$(NEBEN_VERSION) -DVERSION_KOMPATIBEL=$(VERSION_KOMPATIBEL) |
# Optional assembler flags. |
# -Wa,...: tell GCC to pass this to the assembler. |
# -ahlms: create listing |
# -gstabs: have the assembler create line number information; note that |
# for use in COFF files, additional information about filenames |
# and function names needs to be present in the assembler source |
# files -- see avr-libc docs [FIXME: not yet described there] |
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs |
# Optional linker flags. |
# -Wl,...: tell GCC to pass this to linker. |
# -Map: create map file |
# --cref: add cross reference to map file |
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref |
# Additional libraries |
# Minimalistic printf version |
#LDFLAGS += -Wl,-u,vfprintf -lprintf_min |
# Floating point printf version (requires -lm below) |
#LDFLAGS += -Wl,-u,vfprintf -lprintf_flt |
# -lm = math library |
LDFLAGS += -lm |
##LDFLAGS += -T./linkerfile/avr5.x |
# Programming support using avrdude. Settings and variables. |
# Programming hardware: alf avr910 avrisp bascom bsd |
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500 |
# |
# Type: avrdude -c ? |
# to get a full listing. |
# |
#AVRDUDE_PROGRAMMER = stk200 |
AVRDUDE_PROGRAMMER = dt006 |
#AVRDUDE_PROGRAMMER = ponyser |
#falls Ponyser ausgewählt wird, muss sich unsere avrdude-Configdatei im Bin-Verzeichnis des Compilers befinden |
#AVRDUDE_PORT = com1 # programmer connected to serial device |
AVRDUDE_PORT = lpt1 # programmer connected to parallel port |
#AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex |
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex $(FUSE_SETTINGS) |
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep |
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) |
# Uncomment the following if you want avrdude's erase cycle counter. |
# Note that this counter needs to be initialized first using -Yn, |
# see avrdude manual. |
#AVRDUDE_ERASE += -y |
# Uncomment the following if you do /not/ wish a verification to be |
# performed after programming the device. |
AVRDUDE_FLAGS += -V |
# Increase verbosity level. Please use this when submitting bug |
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> |
# to submit bug reports. |
#AVRDUDE_FLAGS += -v -v |
# --------------------------------------------------------------------------- |
# Define directories, if needed. |
DIRAVR = c:/winavr |
DIRAVRBIN = $(DIRAVR)/bin |
DIRAVRUTILS = $(DIRAVR)/utils/bin |
DIRINC = . |
DIRLIB = $(DIRAVR)/avr/lib |
# Define programs and commands. |
SHELL = sh |
CC = avr-gcc |
OBJCOPY = avr-objcopy |
OBJDUMP = avr-objdump |
SIZE = avr-size |
# Programming support using avrdude. |
AVRDUDE = avrdude |
REMOVE = rm -f |
COPY = cp |
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex |
ELFSIZE = $(SIZE) -A $(TARGET).elf |
# Define Messages |
# English |
MSG_ERRORS_NONE = Errors: none |
MSG_BEGIN = -------- begin -------- |
MSG_END = -------- end -------- |
MSG_SIZE_BEFORE = Size before: |
MSG_SIZE_AFTER = Size after: |
MSG_COFF = Converting to AVR COFF: |
MSG_EXTENDED_COFF = Converting to AVR Extended COFF: |
MSG_FLASH = Creating load file for Flash: |
MSG_EEPROM = Creating load file for EEPROM: |
MSG_EXTENDED_LISTING = Creating Extended Listing: |
MSG_SYMBOL_TABLE = Creating Symbol Table: |
MSG_LINKING = Linking: |
MSG_COMPILING = Compiling: |
MSG_ASSEMBLING = Assembling: |
MSG_CLEANING = Cleaning project: |
# Define all object files. |
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o) |
# Define all listing files. |
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst) |
# Combine all necessary flags and optional flags. |
# Add target processor to flags. |
#ALL_CFLAGS = -mmcu=$(MCU) -DF_CPU=$(F_CPU) -I. $(CFLAGS) |
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) |
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) |
# Default target. |
all: begin gccversion sizebefore $(TARGET).elf $(TARGET).hex $(TARGET).eep \ |
$(TARGET).lss $(TARGET).sym sizeafter finished end |
# Eye candy. |
# AVR Studio 3.x does not check make's exit code but relies on |
# the following magic strings to be generated by the compile job. |
begin: |
@echo |
@echo $(MSG_BEGIN) |
finished: |
@echo $(MSG_ERRORS_NONE) |
end: |
@echo $(MSG_END) |
@echo |
# Display size of file. |
sizebefore: |
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi |
sizeafter: |
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi |
# Display compiler version information. |
gccversion : |
@$(CC) --version |
# Convert ELF to COFF for use in debugging / simulating in |
# AVR Studio or VMLAB. |
COFFCONVERT=$(OBJCOPY) --debugging \ |
--change-section-address .data-0x800000 \ |
--change-section-address .bss-0x800000 \ |
--change-section-address .noinit-0x800000 \ |
--change-section-address .eeprom-0x810000 |
coff: $(TARGET).elf |
@echo |
@echo $(MSG_COFF) $(TARGET).cof |
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof |
extcoff: $(TARGET).elf |
@echo |
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof |
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof |
# Program the device. |
program: $(TARGET).hex $(TARGET).eep |
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) |
# Create final output files (.hex, .eep) from ELF output file. |
%.hex: %.elf |
@echo |
@echo $(MSG_FLASH) $@ |
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ |
%.eep: %.elf |
@echo |
@echo $(MSG_EEPROM) $@ |
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ |
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@ |
# Create extended listing file from ELF output file. |
%.lss: %.elf |
@echo |
@echo $(MSG_EXTENDED_LISTING) $@ |
$(OBJDUMP) -h -S $< > $@ |
# Create a symbol table from ELF output file. |
%.sym: %.elf |
@echo |
@echo $(MSG_SYMBOL_TABLE) $@ |
avr-nm -n $< > $@ |
# Link: create ELF output file from object files. |
.SECONDARY : $(TARGET).elf |
.PRECIOUS : $(OBJ) |
%.elf: $(OBJ) |
@echo |
@echo $(MSG_LINKING) $@ |
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS) |
# Compile: create object files from C source files. |
%.o : %.c |
@echo |
@echo $(MSG_COMPILING) $< |
$(CC) -c $(ALL_CFLAGS) $< -o $@ |
# Compile: create assembler files from C source files. |
%.s : %.c |
$(CC) -S $(ALL_CFLAGS) $< -o $@ |
# Assemble: create object files from assembler source files. |
%.o : %.S |
@echo |
@echo $(MSG_ASSEMBLING) $< |
$(CC) -c $(ALL_ASFLAGS) $< -o $@ |
# Target: clean project. |
clean: begin clean_list finished end |
clean_list : |
@echo |
@echo $(MSG_CLEANING) |
# $(REMOVE) $(TARGET).hex |
$(REMOVE) $(TARGET).eep |
$(REMOVE) $(TARGET).obj |
$(REMOVE) $(TARGET).cof |
$(REMOVE) $(TARGET).elf |
$(REMOVE) $(TARGET).map |
$(REMOVE) $(TARGET).obj |
$(REMOVE) $(TARGET).a90 |
$(REMOVE) $(TARGET).sym |
$(REMOVE) $(TARGET).lnk |
$(REMOVE) $(TARGET).lss |
$(REMOVE) $(OBJ) |
$(REMOVE) $(LST) |
$(REMOVE) $(SRC:.c=.s) |
$(REMOVE) $(SRC:.c=.d) |
# Automatically generate C source code dependencies. |
# (Code originally taken from the GNU make user manual and modified |
# (See README.txt Credits).) |
# |
# Note that this will work with sh (bash) and sed that is shipped with WinAVR |
# (see the SHELL variable defined above). |
# This may not work with other shells or other seds. |
# |
%.d: %.c |
set -e; $(CC) -MM $(ALL_CFLAGS) $< \ |
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > $@; \ |
[ -s $@ ] || rm -f $@ |
# Remove the '-' if you want to see the dependency files generated. |
-include $(SRC:.c=.d) |
# Listing of phony targets. |
.PHONY : all begin finish end sizebefore sizeafter gccversion coff extcoff \ |
clean clean_list program |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/math.c |
---|
0,0 → 1,229 |
/* |
This program (files math.c and math.h) is free software; you can redistribute it and/or modify |
it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; |
either version 3 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License and GNU Lesser General Public License for more details. |
You should have received a copy of GNU General Public License (License_GPL.txt) and |
GNU Lesser General Public License (License_LGPL.txt) along with this program. |
If not, see <http://www.gnu.org/licenses/>. |
Please note: All the other files for the project "Mikrokopter" by H.Buss are under the license (license_buss.txt) published by www.mikrokopter.de |
*/ |
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
Peter Muehlenbrock |
Winkelfunktionen sin, cos und arctan in |
brute-force Art: Sehr Schnell, nicht sonderlich genau, aber ausreichend |
get_dist Funktion fuer Entfernungsermittlung |
Stand 12.10.2007 |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
*/ |
#include "main.h" |
// arctan Funktion: Eingabewert x,y Rueckgabe =arctan(x,y) in grad |
int arctan_i( signed int x, signed int y) |
{ |
short int change_xy = 0; |
signed int i; |
long signed int wert; |
int return_value; |
if ((abs(x)) > (abs(y))) // x,y Werte vertauschen damit arctan <45 grad bleibt |
{ |
change_xy = 1; |
i = x; |
x = y; |
y = i; |
} |
// Quadranten ermitteln |
// Wert durch lineare Interpolation ermitteln |
if ((y == 0) && (x == 0)) wert =1; // Division durch 0 nicht erlaubt |
else wert= abs(((long)x*1000)/((long)y)); |
if (wert <=268) //0...0.0,268 entsprechend 0..15 Grad |
{ |
return_value = (signed int)((wert*100)/(268-0)*(15-0)/100) +0; |
} |
else if (wert <=578) //0,268...0.0,568 entsprechend 15..30 Grad |
{ |
return_value = (signed int)((((wert-268)*100)/(578-268)*(30-15))/100) +15; |
} |
else //0,568...1 entsprechend 30..45 Grad |
{ |
return_value = (signed int)((((wert-578)*50)/(1000-578)*(45-30))/50) +30; |
} |
if (change_xy == 0) return_value = 90-return_value; //Quadrant 45..90 Grad |
if ((x >= 0) && (y <0)) return_value = - return_value; |
else if ((x < 0) && (y >= 0)) return_value = - return_value; |
return return_value; |
} |
// cosinus Funktion: Eingabewert Winkel in Grad, Rueckgabe =cos(winkel)*1000 |
signed int cos_i(signed int winkel) |
{ |
winkel = sin_i(90-winkel); |
return winkel; |
} |
const unsigned int pgm_sinus[91] PROGMEM = {0,17,35,52,70,87,105,122,139,156,174,191,208,225,242,259,276,292,309,326,342,358,375,391,407,423,438,454,469,485,500,515,530,545,559,574,588,602,616,629,643,656,669,682,695,707,719,731,743,755,766,777,788,799,809,819,829,839,848,857,866,875,883,891,899,906,914,921,927,934,940,946,951,956,961,966,970,974,978,982,985,988,990,993,995,996,998,999,999,1000,1000}; |
//von Nick666, Stand 28.9.2007 |
// sinus Funktion: Eingabewert Winkel in Grad, Rueckgabe =sin(winkel)*1000 |
signed int sin_i(signed int winkel) |
{ |
short int m,n; |
if (abs(winkel) >=360) winkel = winkel % 360; |
if (winkel < 0) |
{ |
m = -1; |
winkel = abs(winkel); |
} |
else m = +1; |
n =1; |
// Quadranten auswerten |
if ((winkel > 90 ) && (winkel <= 180)) winkel = 180 - winkel; |
else if ((winkel > 180 ) && (winkel <= 270)) |
{ |
winkel = winkel -180; |
n = -1; |
} |
else if ((winkel > 270) && (winkel <= 360)) |
{ |
winkel = 360 - winkel; |
n = -1; |
} |
// else //0 - 90 Grad |
winkel = pgm_read_word(&pgm_sinus[winkel]); |
return (winkel*m*n); |
} |
// Aus x,y und Winkel Distanz ermitteln |
long get_dist(signed int x, signed int y, signed int phi) |
{ |
long dist; |
if (abs(x) > abs(y) ) |
{ |
dist = (long) x; //Groesseren Wert wegen besserer Genauigkeit nehmen |
dist = abs((dist *1000) / (long) sin_i(phi)); |
} |
else |
{ |
dist = (long) y; |
dist = abs((dist *1000) / (long) cos_i(phi)); |
} |
return dist; |
} |
// noch mehr von Nick666 |
const uint8_t pgm_atan[270] PROGMEM = {0,1,2,3,5,6,7,8,9,10,11,12,13,15,16,17,18,19,20,21,22,23,24,25,26,27,27,28,29,30,31,32,33,33,34,35,36,37,37,38,39,39,40,41,41,42,43,43,44,44,45,46,46,47,47,48,48,49,49,50,50,51,51,52,52,52,53,53,54,54,54,55,55,56,56,56,57,57,57,58,58,58,59,59,59,60,60,60,60,61,61,61,61,62,62,62,62,63,63,63,63,64,64,64,64,65,65,65,65,65,66,66,66,66,66,67,67,67,67,67,67,68,68,68,68,68,68,69,69,69,69,69,69,69,70,70,70,70,70,70,70,70,71,71,71,71,71,71,71,71,72,72,72,72,72,72,72,72,72,73,73,73,73,73,73,73,73,73,73,74,74,74,74,74,74,74,74,74,74,74,74,75,75,75,75,75,75,75,75,75,75,75,75,75,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79}; |
// Arkustangens2 im Gradmaß |
signed int atan2_i(signed int x, signed int y) |
{ |
int i,angle; |
int8_t m; |
if (!x && !y) return 0; //atan2 = 0 für x und y = 0 |
if (y < 0) m=-1; |
else m=1; |
if (x==0) return (90*m); // atan2 = 90° für x = 0 |
i = abs(((float)y / x) * 50); // Berechne i für die Lookup table (Schrittweite atan(x) ist 0.02 -> *50) |
if (i<270) angle = pgm_read_byte(&pgm_atan[i]); // Lookup für 1° bis 79° |
else if (i>5750) angle = 90; // Grenzwert ist 90° |
else if (i>=1910) angle = 89; // 89° bis 80° über Wertebereiche |
else if (i>=1150) angle = 88; |
else if (i>=820) angle = 87; |
else if (i>=640) angle = 86; |
else if (i>=520) angle = 85; |
else if (i>=440) angle = 84; |
else if (i>=380) angle = 83; |
else if (i>=335) angle = 82; |
else if (i>=299) angle = 81; |
else angle = 80; // (i>=270) |
if (x > 0) return (angle*m); // Quadrant I und IV |
else if ((x < 0) && (y >= 0)) return ((angle*-1) + 180); // Quadrant II |
else return (angle - 180); // x < 0 && y < 0 Quadrant III |
} |
const float pgm_sinus_f [91] PROGMEM = {0.000,0.017,0.035,0.052,0.070,0.087,0.105,0.122,0.139,0.156,0.174,0.191,0.208,0.225,0.242,0.259,0.276,0.292,0.309,0.326,0.342,0.358,0.375,0.391,0.407,0.423,0.438,0.454,0.469,0.485,0.500,0.515,0.530,0.545,0.559,0.574,0.588,0.602,0.616,0.629,0.643,0.656,0.669,0.682,0.695,0.707,0.719,0.731,0.743,0.755,0.766,0.777,0.788,0.799,0.809,0.819,0.829,0.839,0.848,0.857,0.866,0.875,0.883,0.891,0.899,0.906,0.914,0.921,0.927,0.934,0.940,0.946,0.951,0.956,0.961,0.966,0.970,0.974,0.978,0.982,0.985,0.988,0.990,0.993,0.995,0.996,0.998,0.999,0.999,1.000,1.000}; |
inline float pgm_read_float(const float *addr) |
{ |
union |
{ |
uint16_t i[2]; // 2 16-bit-Worte |
float f; |
} u; |
u.i[0]=pgm_read_word((PGM_P)addr); |
u.i[1]=pgm_read_word((PGM_P)addr+2); |
return u.f; |
} |
// Kosinusfunktion im Gradmaß |
float cos_f(signed int winkel) |
{ |
return (sin_f(90-winkel)); |
} |
// Sinusfunktion im Gradmaß |
float sin_f(signed int winkel) |
{ |
short int m,n; |
float sinus; |
//winkel = winkel % 360; |
if (winkel < 0) |
{ |
m = -1; |
winkel = abs(winkel); |
} |
else m = +1; |
// Quadranten auswerten |
if ((winkel > 90 ) && (winkel <= 180)) {winkel = 180 - winkel; n = 1;} |
else if ((winkel > 180 ) && (winkel <= 270)) {winkel = winkel - 180; n = -1;} |
else if ((winkel > 270) && (winkel <= 360)) {winkel = 360 - winkel; n = -1;} |
else n = 1; //0 - 90 Grad |
sinus = pgm_read_float(&pgm_sinus_f[winkel]); |
return (sinus*m*n); |
} |
const uint8_t pgm_asin[201] PROGMEM = {0,0,1,1,1,1,2,2,2,3,3,3,3,4,4,4,5,5,5,5,6,6,6,7,7,7,7,8,8,8,9,9,9,9,10,10,10,11,11,11,12,12,12,12,13,13,13,14,14,14,14,15,15,15,16,16,16,17,17,17,17,18,18,18,19,19,19,20,20,20,20,21,21,21,22,22,22,23,23,23,24,24,24,25,25,25,25,26,26,26,27,27,27,28,28,28,29,29,29,30,30,30,31,31,31,32,32,32,33,33,33,34,34,34,35,35,35,36,36,37,37,37,38,38,38,39,39,39,40,40,41,41,41,42,42,42,43,43,44,44,44,45,45,46,46,46,47,47,48,48,49,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,62,62,63,64,64,65,66,66,67,68,68,69,70,71,72,73,74,75,76,77,79,80,82,84,90}; |
// Akurssinusfunktion im Gradmaß |
int8_t asin_i(signed int i) |
{ |
signed char m; |
if (i < 0) {m=-1;i=abs(i);} |
else m=1; |
return (pgm_read_byte(&pgm_asin[i]) * m); |
} |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/math.h |
---|
0,0 → 1,15 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Peter Muehlenbrock |
// Definitionen fuer Modul math |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
extern signed int sin_i(signed int winkel); |
extern signed int cos_i(signed int winkel); |
extern signed int arctan_i(signed int x, signed int y); |
extern long get_dist(signed int x, signed int y, signed int phi); |
extern signed int atan2_i(signed int x, signed int y); |
extern float cos_f(signed int winkel); |
extern float sin_f(signed int winkel); |
extern int8_t asin_i(signed int i); |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/menu.c |
---|
0,0 → 1,118 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
unsigned int TestInt = 0; |
#define ARRAYGROESSE 10 |
unsigned char Array[ARRAYGROESSE] = {1,2,3,4,5,6,7,8,9,10}; |
char DisplayBuff[80] = "Hallo Welt"; |
unsigned char DispPtr = 0; |
unsigned char RemoteTasten = 0; |
#define KEY1 0x01 |
#define KEY2 0x02 |
#define KEY3 0x04 |
#define KEY4 0x08 |
#define KEY5 0x10 |
void LcdClear(void) |
{ |
unsigned char i; |
for(i=0;i<80;i++) DisplayBuff[i] = ' '; |
} |
void Menu(void) |
{ |
static unsigned char MaxMenue = 10,MenuePunkt=0; |
if(RemoteTasten & KEY1) { if(MenuePunkt) MenuePunkt--; else MenuePunkt = MaxMenue; LcdClear(); } |
if(RemoteTasten & KEY2) { MenuePunkt++; LcdClear(); } |
if((RemoteTasten & KEY1) && (RemoteTasten & KEY2)) MenuePunkt = 0; |
LCD_printfxy(17,0,"[%i]",MenuePunkt); |
switch(MenuePunkt) |
{ |
case 0: |
LCD_printfxy(0,0,"++ MikroKopter ++"); |
// LCD_printfxy(0,1,"V%d.%d",VERSION_HAUPTVERSION, VERSION_NEBENVERSION); |
LCD_printfxy(0,2,"Setting: %d ",GetActiveParamSetNumber()); |
LCD_printfxy(0,3,"(c) Holger Buss"); |
// if(RemoteTasten & KEY3) TestInt--; |
// if(RemoteTasten & KEY4) TestInt++; |
break; |
case 1: |
if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
LCD_printfxy(0,0,"Hoehe: %5i",HoehenWert); |
LCD_printfxy(0,1,"SollHoehe: %5i",SollHoehe); |
LCD_printfxy(0,2,"Luftdruck: %5i",MessLuftdruck); |
LCD_printfxy(0,3,"Off : %5i",DruckOffsetSetting); |
} |
else |
{ |
LCD_printfxy(0,1,"Keine "); |
LCD_printfxy(0,2,"Höhenregelung"); |
} |
break; |
case 2: |
LCD_printfxy(0,0,"akt. Lage"); |
LCD_printfxy(0,1,"Nick: %5i",IntegralNick/1024); |
LCD_printfxy(0,2,"Roll: %5i",IntegralRoll/1024); |
LCD_printfxy(0,3,"Kompass: %5i",KompassValue); |
break; |
case 3: |
LCD_printfxy(0,0,"K1:%4i K2:%4i ",PPM_in[1],PPM_in[2]); |
LCD_printfxy(0,1,"K3:%4i K4:%4i ",PPM_in[3],PPM_in[4]); |
LCD_printfxy(0,2,"K5:%4i K6:%4i ",PPM_in[5],PPM_in[6]); |
LCD_printfxy(0,3,"K7:%4i Kanäle ",PPM_in[7]); |
break; |
case 4: |
LCD_printfxy(0,0,"Ni:%4i Ro:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_NICK]],PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]); |
LCD_printfxy(0,1,"Gs:%4i Gi:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_GAS]],PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]); |
LCD_printfxy(0,2,"P1:%4i P2:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]],PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]]); |
LCD_printfxy(0,3,"P3:%4i Kanäle ",PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]]); |
break; |
case 5: |
LCD_printfxy(0,0,"Gyro - Sensor"); |
LCD_printfxy(0,1,"Nick %4i (%3i)",AccumulateNick / MessanzahlNick, AdNeutralNick); |
LCD_printfxy(0,2,"Roll %4i (%3i)",AccumulateRoll / MessanzahlRoll, AdNeutralRoll); |
LCD_printfxy(0,3,"Gier %4i (%3i)",AccumulateGier / MessanzahlGier, AdNeutralGier); |
break; |
case 6: |
LCD_printfxy(0,0,"ACC - Sensor"); |
LCD_printfxy(0,1,"Nick %4i (%3i)",accumulate_AccNick / messanzahl_AccNick,NeutralAccX); |
LCD_printfxy(0,2,"Roll %4i (%3i)",accumulate_AccRoll / messanzahl_AccRoll,NeutralAccY); |
LCD_printfxy(0,3,"Hoch %4i (%3i)",Aktuell_az/*accumulate_AccHoch / messanzahl_AccHoch*/,(int)NeutralAccZ); |
break; |
case 7: |
LCD_printfxy(0,1,"Spannung: %5i",UBat); |
LCD_printfxy(0,2,"Empf.Pegel:%5i",SenderOkay); |
break; |
case 8: |
LCD_printfxy(0,0,"Kompass "); |
LCD_printfxy(0,1,"Richtung: %5i",KompassRichtung); |
LCD_printfxy(0,2,"Messwert: %5i",KompassValue); |
LCD_printfxy(0,3,"Start: %5i",KompassStartwert); |
break; |
case 9: |
LCD_printfxy(0,0,"Poti1: %3i",Poti1); |
LCD_printfxy(0,1,"Poti2: %3i",Poti2); |
LCD_printfxy(0,2,"Poti3: %3i",Poti3); |
LCD_printfxy(0,3,"Poti4: %3i",Poti4); |
break; |
case 10: |
LCD_printfxy(0,0,"Servo " ); |
LCD_printfxy(0,1,"Setpoint %3i",Parameter_ServoNickControl); |
LCD_printfxy(0,2,"Stellung: %3i",ServoValue); |
LCD_printfxy(0,3,"Range:%3i-%3i",EE_Parameter.ServoNickMin,EE_Parameter.ServoNickMax); |
break; |
default: MaxMenue = MenuePunkt - 1; |
MenuePunkt = 0; |
break; |
} |
RemoteTasten = 0; |
} |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/menu.h |
---|
0,0 → 1,7 |
void LcdClear(void); |
extern void Menu(void); |
extern char DisplayBuff[80]; |
extern unsigned char DispPtr; |
unsigned char RemoteTasten; |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/old_macros.h |
---|
0,0 → 1,47 |
/* |
For backwards compatibility only. |
Ingo Busker ingo@mikrocontroller.com |
*/ |
#ifndef cbi |
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) |
#endif |
#ifndef sbi |
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit)) |
#endif |
#ifndef inb |
#define inb(sfr) _SFR_BYTE(sfr) |
#endif |
#ifndef outb |
#define outb(sfr, val) (_SFR_BYTE(sfr) = (val)) |
#endif |
#ifndef inw |
#define inw(sfr) _SFR_WORD(sfr) |
#endif |
#ifndef outw |
#define outw(sfr, val) (_SFR_WORD(sfr) = (val)) |
#endif |
#ifndef outp |
#define outp(val, sfr) outb(sfr, val) |
#endif |
#ifndef inp |
#define inp(sfr) inb(sfr) |
#endif |
#ifndef BV |
#define BV(bit) _BV(bit) |
#endif |
#ifndef PRG_RDB |
#define PRG_RDB pgm_read_byte |
#endif |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/printf_P.c |
---|
0,0 → 1,480 |
// Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist nicht von der Lizenz für den MikroKopter-Teil unterstellt |
/* |
Copyright (C) 1993 Free Software Foundation |
This file is part of the GNU IO Library. This library is free |
software; you can redistribute it and/or modify it under the |
terms of the GNU General Public License as published by the |
Free Software Foundation; either version 2, or (at your option) |
any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License for more details. |
You should have received a copy of the GNU General Public License |
along with this library; see the file COPYING. If not, write to the Free |
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
As a special exception, if you link this library with files |
compiled with a GNU compiler to produce an executable, this does not cause |
the resulting executable to be covered by the GNU General Public License. |
This exception does not however invalidate any other reasons why |
the executable file might be covered by the GNU General Public License. */ |
/* |
* Copyright (c) 1990 Regents of the University of California. |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* 1. Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* 2. Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* 3. [rescinded 22 July 1999] |
* 4. Neither the name of the University nor the names of its contributors |
* may be used to endorse or promote products derived from this software |
* without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
* SUCH DAMAGE. |
*/ |
/****************************************************************************** |
This file is a patched version of printf called _printf_P |
It is made to work with avr-gcc for Atmel AVR MCUs. |
There are some differences from standard printf: |
1. There is no floating point support (with fp the code is about 8K!) |
2. Return type is void |
3. Format string must be in program memory (by using macro printf this is |
done automaticaly) |
4. %n is not implemented (just remove the comment around it if you need it) |
5. If LIGHTPRINTF is defined, the code is about 550 bytes smaller and the |
folowing specifiers are disabled : |
space # * . - + p s o O |
6. A function void uart_sendchar(char c) is used for output. The UART must |
be initialized before using printf. |
Alexander Popov |
sasho@vip.orbitel.bg |
******************************************************************************/ |
/* |
* Actual printf innards. |
* |
* This code is large and complicated... |
*/ |
#include <string.h> |
#ifdef __STDC__ |
#include <stdarg.h> |
#else |
#include <varargs.h> |
#endif |
#include "main.h" |
//#define LIGHTPRINTF |
char PrintZiel; |
char Putchar(char zeichen) |
{ |
if(PrintZiel == OUT_LCD) { DisplayBuff[DispPtr++] = zeichen; return(1);} |
else return(uart_putchar(zeichen)); |
} |
void PRINT(const char * ptr, unsigned int len) |
{ |
for(;len;len--) Putchar(*ptr++); |
} |
void PRINTP(const char * ptr, unsigned int len) |
{ |
for(;len;len--) Putchar(pgm_read_byte(ptr++)); |
} |
void PAD_SP(signed char howmany) |
{ |
for(;howmany>0;howmany--) Putchar(' '); |
} |
void PAD_0(signed char howmany) |
{ |
for(;howmany>0;howmany--) Putchar('0'); |
} |
#define BUF 40 |
/* |
* Macros for converting digits to letters and vice versa |
*/ |
#define to_digit(c) ((c) - '0') |
#define is_digit(c) ((c)<='9' && (c)>='0') |
#define to_char(n) ((n) + '0') |
/* |
* Flags used during conversion. |
*/ |
#define LONGINT 0x01 /* long integer */ |
#define LONGDBL 0x02 /* long double; unimplemented */ |
#define SHORTINT 0x04 /* short integer */ |
#define ALT 0x08 /* alternate form */ |
#define LADJUST 0x10 /* left adjustment */ |
#define ZEROPAD 0x20 /* zero (as opposed to blank) pad */ |
#define HEXPREFIX 0x40 /* add 0x or 0X prefix */ |
void _printf_P (char ziel,char const *fmt0, ...) /* Works with string from FLASH */ |
{ |
va_list ap; |
register const char *fmt; /* format string */ |
register char ch; /* character from fmt */ |
register int n; /* handy integer (short term usage) */ |
register char *cp; /* handy char pointer (short term usage) */ |
const char *fmark; /* for remembering a place in fmt */ |
register unsigned char flags; /* flags as above */ |
signed char width; /* width from format (%8d), or 0 */ |
signed char prec; /* precision from format (%.3d), or -1 */ |
char sign; /* sign prefix (' ', '+', '-', or \0) */ |
unsigned long _ulong=0; /* integer arguments %[diouxX] */ |
#define OCT 8 |
#define DEC 10 |
#define HEX 16 |
unsigned char base; /* base for [diouxX] conversion */ |
signed char dprec; /* a copy of prec if [diouxX], 0 otherwise */ |
signed char dpad; /* extra 0 padding needed for integers */ |
signed char fieldsz; /* field size expanded by sign, dpad etc */ |
/* The initialization of 'size' is to suppress a warning that |
'size' might be used unitialized. It seems gcc can't |
quite grok this spaghetti code ... */ |
signed char size = 0; /* size of converted field or string */ |
char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */ |
char ox[2]; /* space for 0x hex-prefix */ |
PrintZiel = ziel; // bestimmt, LCD oder UART |
va_start(ap, fmt0); |
fmt = fmt0; |
/* |
* Scan the format for conversions (`%' character). |
*/ |
for (;;) { |
for (fmark = fmt; (ch = pgm_read_byte(fmt)) != '\0' && ch != '%'; fmt++) |
/* void */; |
if ((n = fmt - fmark) != 0) { |
PRINTP(fmark, n); |
} |
if (ch == '\0') |
goto done; |
fmt++; /* skip over '%' */ |
flags = 0; |
dprec = 0; |
width = 0; |
prec = -1; |
sign = '\0'; |
rflag: ch = PRG_RDB(fmt++); |
reswitch: |
#ifdef LIGHTPRINTF |
if (ch=='o' || ch=='u' || (ch|0x20)=='x') { |
#else |
if (ch=='u' || (ch|0x20)=='x') { |
#endif |
if (flags&LONGINT) { |
_ulong=va_arg(ap, unsigned long); |
} else { |
register unsigned int _d; |
_d=va_arg(ap, unsigned int); |
_ulong = flags&SHORTINT ? (unsigned long)(unsigned short)_d : (unsigned long)_d; |
} |
} |
#ifndef LIGHTPRINTF |
if(ch==' ') { |
/* |
* ``If the space and + flags both appear, the space |
* flag will be ignored.'' |
* -- ANSI X3J11 |
*/ |
if (!sign) |
sign = ' '; |
goto rflag; |
} else if (ch=='#') { |
flags |= ALT; |
goto rflag; |
} else if (ch=='*'||ch=='-') { |
if (ch=='*') { |
/* |
* ``A negative field width argument is taken as a |
* - flag followed by a positive field width.'' |
* -- ANSI X3J11 |
* They don't exclude field widths read from args. |
*/ |
if ((width = va_arg(ap, int)) >= 0) |
goto rflag; |
width = -width; |
} |
flags |= LADJUST; |
flags &= ~ZEROPAD; /* '-' disables '0' */ |
goto rflag; |
} else if (ch=='+') { |
sign = '+'; |
goto rflag; |
} else if (ch=='.') { |
if ((ch = PRG_RDB(fmt++)) == '*') { |
n = va_arg(ap, int); |
prec = n < 0 ? -1 : n; |
goto rflag; |
} |
n = 0; |
while (is_digit(ch)) { |
n = n*10 + to_digit(ch); |
ch = PRG_RDB(fmt++); |
} |
prec = n < 0 ? -1 : n; |
goto reswitch; |
} else |
#endif /* LIGHTPRINTF */ |
if (ch=='0') { |
/* |
* ``Note that 0 is taken as a flag, not as the |
* beginning of a field width.'' |
* -- ANSI X3J11 |
*/ |
if (!(flags & LADJUST)) |
flags |= ZEROPAD; /* '-' disables '0' */ |
goto rflag; |
} else if (ch>='1' && ch<='9') { |
n = 0; |
do { |
n = 10 * n + to_digit(ch); |
ch = PRG_RDB(fmt++); |
} while (is_digit(ch)); |
width = n; |
goto reswitch; |
} else if (ch=='h') { |
flags |= SHORTINT; |
goto rflag; |
} else if (ch=='l') { |
flags |= LONGINT; |
goto rflag; |
} else if (ch=='c') { |
*(cp = buf) = va_arg(ap, int); |
size = 1; |
sign = '\0'; |
} else if (ch=='D'||ch=='d'||ch=='i') { |
if(ch=='D') |
flags |= LONGINT; |
if (flags&LONGINT) { |
_ulong=va_arg(ap, long); |
} else { |
register int _d; |
_d=va_arg(ap, int); |
_ulong = flags&SHORTINT ? (long)(short)_d : (long)_d; |
} |
if ((long)_ulong < 0) { |
_ulong = -_ulong; |
sign = '-'; |
} |
base = DEC; |
goto number; |
} else |
/* |
if (ch=='n') { |
if (flags & LONGINT) |
*va_arg(ap, long *) = ret; |
else if (flags & SHORTINT) |
*va_arg(ap, short *) = ret; |
else |
*va_arg(ap, int *) = ret; |
continue; // no output |
} else |
*/ |
#ifndef LIGHTPRINTF |
if (ch=='O'||ch=='o') { |
if (ch=='O') |
flags |= LONGINT; |
base = OCT; |
goto nosign; |
} else if (ch=='p') { |
/* |
* ``The argument shall be a pointer to void. The |
* value of the pointer is converted to a sequence |
* of printable characters, in an implementation- |
* defined manner.'' |
* -- ANSI X3J11 |
*/ |
/* NOSTRICT */ |
_ulong = (unsigned int)va_arg(ap, void *); |
base = HEX; |
flags |= HEXPREFIX; |
ch = 'x'; |
goto nosign; |
} else if (ch=='s') { // print a string from RAM |
if ((cp = va_arg(ap, char *)) == NULL) { |
cp=buf; |
cp[0] = '('; |
cp[1] = 'n'; |
cp[2] = 'u'; |
cp[4] = cp[3] = 'l'; |
cp[5] = ')'; |
cp[6] = '\0'; |
} |
if (prec >= 0) { |
/* |
* can't use strlen; can only look for the |
* NUL in the first `prec' characters, and |
* strlen() will go further. |
*/ |
char *p = (char*)memchr(cp, 0, prec); |
if (p != NULL) { |
size = p - cp; |
if (size > prec) |
size = prec; |
} else |
size = prec; |
} else |
size = strlen(cp); |
sign = '\0'; |
} else |
#endif /* LIGHTPRINTF */ |
if(ch=='U'||ch=='u') { |
if (ch=='U') |
flags |= LONGINT; |
base = DEC; |
goto nosign; |
} else if (ch=='X'||ch=='x') { |
base = HEX; |
/* leading 0x/X only if non-zero */ |
if (flags & ALT && _ulong != 0) |
flags |= HEXPREFIX; |
/* unsigned conversions */ |
nosign: sign = '\0'; |
/* |
* ``... diouXx conversions ... if a precision is |
* specified, the 0 flag will be ignored.'' |
* -- ANSI X3J11 |
*/ |
number: if ((dprec = prec) >= 0) |
flags &= ~ZEROPAD; |
/* |
* ``The result of converting a zero value with an |
* explicit precision of zero is no characters.'' |
* -- ANSI X3J11 |
*/ |
cp = buf + BUF; |
if (_ulong != 0 || prec != 0) { |
register unsigned char _d,notlastdigit; |
do { |
notlastdigit=(_ulong>=base); |
_d = _ulong % base; |
if (_d<10) { |
_d+='0'; |
} else { |
_d+='a'-10; |
if (ch=='X') _d&=~0x20; |
} |
*--cp=_d; |
_ulong /= base; |
} while (notlastdigit); |
#ifndef LIGHTPRINTF |
// handle octal leading 0 |
if (base==OCT && flags & ALT && *cp != '0') |
*--cp = '0'; |
#endif |
} |
size = buf + BUF - cp; |
} else { //default |
/* "%?" prints ?, unless ? is NUL */ |
if (ch == '\0') |
goto done; |
/* pretend it was %c with argument ch */ |
cp = buf; |
*cp = ch; |
size = 1; |
sign = '\0'; |
} |
/* |
* All reasonable formats wind up here. At this point, |
* `cp' points to a string which (if not flags&LADJUST) |
* should be padded out to `width' places. If |
* flags&ZEROPAD, it should first be prefixed by any |
* sign or other prefix; otherwise, it should be blank |
* padded before the prefix is emitted. After any |
* left-hand padding and prefixing, emit zeroes |
* required by a decimal [diouxX] precision, then print |
* the string proper, then emit zeroes required by any |
* leftover floating precision; finally, if LADJUST, |
* pad with blanks. |
*/ |
/* |
* compute actual size, so we know how much to pad. |
*/ |
fieldsz = size; |
dpad = dprec - size; |
if (dpad < 0) |
dpad = 0; |
if (sign) |
fieldsz++; |
else if (flags & HEXPREFIX) |
fieldsz += 2; |
fieldsz += dpad; |
/* right-adjusting blank padding */ |
if ((flags & (LADJUST|ZEROPAD)) == 0) |
PAD_SP(width - fieldsz); |
/* prefix */ |
if (sign) { |
PRINT(&sign, 1); |
} else if (flags & HEXPREFIX) { |
ox[0] = '0'; |
ox[1] = ch; |
PRINT(ox, 2); |
} |
/* right-adjusting zero padding */ |
if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD) |
PAD_0(width - fieldsz); |
/* leading zeroes from decimal precision */ |
PAD_0(dpad); |
/* the string or number proper */ |
PRINT(cp, size); |
/* left-adjusting padding (always blank) */ |
if (flags & LADJUST) |
PAD_SP(width - fieldsz); |
} |
done: |
va_end(ap); |
} |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/printf_P.h |
---|
0,0 → 1,19 |
#ifndef _PRINTF_P_H_ |
#define _PRINTF_P_H_ |
#include <avr/pgmspace.h> |
#define OUT_V24 0 |
#define OUT_LCD 1 |
extern void _printf_P (char, char const *fmt0, ...); |
extern char PrintZiel; |
#define printf_P(format, args...) _printf_P(OUT_V24,format , ## args) |
#define printf(format, args...) _printf_P(OUT_V24,PSTR(format) , ## args) |
#define LCD_printfxy(x,y,format, args...) { DispPtr = y * 20 + x; _printf_P(OUT_LCD,PSTR(format) , ## args);} |
#define LCD_printf(format, args...) { _printf_P(OUT_LCD,PSTR(format) , ## args);} |
#endif |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/rc.c |
---|
0,0 → 1,85 |
/*####################################################################################### |
Decodieren eines RC Summen Signals |
#######################################################################################*/ |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "rc.h" |
#include "main.h" |
volatile int PPM_in[11]; |
volatile int PPM_diff[11]; // das diffenzierte Stick-Signal |
volatile unsigned char NewPpmData = 1; |
//############################################################################ |
//zum decodieren des PPM-Signals wird Timer1 mit seiner Input |
//Capture Funktion benutzt: |
void rc_sum_init (void) |
//############################################################################ |
{ |
TCCR1B=(1<<CS11)|(1<<CS10)|(1<<ICES1)|(1<<ICNC1);//|(1 << WGM12); //timer1 prescale 64 |
// PWM |
//TCCR1A = (1 << COM1B1) | (1 << WGM11) | (1 << WGM10); |
//TCCR1B |= (1 << WGM12); |
//OCR1B = 55; |
TIMSK1 |= _BV(ICIE1); |
AdNeutralGier = 0; |
AdNeutralRoll = 0; |
AdNeutralNick = 0; |
return; |
} |
//############################################################################ |
//Diese Routine startet und inizialisiert den Timer für RC |
SIGNAL(SIG_INPUT_CAPTURE1) |
//############################################################################ |
{ |
static unsigned int AltICR=0; |
signed int signal = 0; |
static int index; |
signal = (unsigned int) ICR1 - AltICR; |
AltICR = ICR1; |
//Syncronisationspause? |
if ((signal > 1500) && (signal < 8000)) |
{ |
index = 1; |
NewPpmData = 0; // Null bedeutet: Neue Daten |
// OCR2A = Poti2/2 + 80; |
} |
else |
{ |
if(index < 10) |
{ |
if((signal > 250) && (signal < 687)) |
{ |
signal -= 466; |
// Stabiles Signal |
if(abs(signal - PPM_in[index]) < 6) { if(SenderOkay < 200) SenderOkay += 10;} |
signal = (3 * (PPM_in[index]) + signal) / 4; |
//373 entspricht ca. 1.5ms also Mittelstellung |
PPM_diff[index] = signal - PPM_in[index]; |
PPM_in[index] = signal; |
} |
index++; |
/* if(index == 5) PORTD |= 0x20; else PORTD &= ~0x20; // Servosignal an J3 anlegen |
if(index == 6) PORTD |= 0x10; else PORTD &= ~0x10; // Servosignal an J4 anlegen |
if(index == 7) PORTD |= 0x08; else PORTD &= ~0x08; // Servosignal an J5 anlegen */ |
} |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/rc.h |
---|
0,0 → 1,29 |
/*####################################################################################### |
Derkodieren eines RC Summen Signals |
#######################################################################################*/ |
#ifndef _RC_H |
#define _RC_H |
#if defined (__AVR_ATmega32__) |
#define TIMER_TEILER CK64 |
#define TIMER_RELOAD_VALUE 250 |
#endif |
#if defined (__AVR_ATmega644__) |
//#define TIMER_TEILER CK64 |
#define TIMER_RELOAD_VALUE 250 |
//#define TIMER_TEILER CK256 // bei 20MHz |
//#define TIMER_RELOAD_VALUE -78 // bei 20MHz |
#endif |
#define GAS PPM_in[2] |
extern void rc_sum_init (void); |
extern volatile int PPM_in[11]; |
extern volatile int PPM_diff[11]; // das diffenzierte Stick-Signal |
extern volatile unsigned char NewPpmData; |
#endif //_RC_H |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/timer0.c |
---|
0,0 → 1,151 |
#include "main.h" |
volatile unsigned int CountMilliseconds = 0; |
volatile static unsigned int tim_main; |
volatile unsigned char UpdateMotor = 0; |
volatile unsigned int beeptime = 0; |
volatile unsigned int cntKompass = 0; |
int ServoValue = 0; |
/*Salvo 8.9.2007 |
volatile uint8_t Kompass_Neuer_Wert= 0; |
volatile unsigned int Kompass_Value_Old = 0; |
// Salvo End |
//Salvo 21.9.2007 |
short unsigned int Kompass_present= 0; //>0 bedeutet dass der Kompass vorhanden ist |
// Salvo End */ |
enum { |
STOP = 0, |
CK = 1, |
CK8 = 2, |
CK64 = 3, |
CK256 = 4, |
CK1024 = 5, |
T0_FALLING_EDGE = 6, |
T0_RISING_EDGE = 7 |
}; |
// Aenderungen von Peter Muehlenbrock ("Salvo") Stand 21.9.2007 |
/* |
Driftkompensation fuer Gyros verbessert |
Linearsensor mit fixem Neutralwert |
Ersatzkompass abgeleitet aus Magnetkompass und Giergyro fuer nahezu neigungsubhaengige Kompassfunktion |
*/ |
SIGNAL (SIG_OVERFLOW0) // 8kHz |
{ |
static unsigned char cnt_1ms = 1,cnt = 0; |
// TCNT0 -= 250;//TIMER_RELOAD_VALUE; |
if(!cnt--) |
{ |
// if (Kompass_present > 0) Kompass_present--; //Runterzaehlen. Wenn 0 ist der Kompass nicht vorhanden |
cnt = 9; |
cnt_1ms++; |
cnt_1ms %= 2; |
if(!cnt_1ms) UpdateMotor = 1; |
CountMilliseconds++; |
if(Timeout) Timeout--; |
} |
if(beeptime > 1) |
{ |
beeptime--; |
PORTD |= (1<<PD2); |
} |
else |
PORTD &= ~(1<<PD2); |
if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV) |
{ |
MM3_timer0(); // Kompass auslesen |
if (!cntKompass--) // Aufruf mit 25 Hz |
{ |
if (MM3_heading() > 0) { KompassValue = 360-MM3_heading();} |
if (MM3_heading() < 0 ) { KompassValue = MM3_heading()*-1;} |
KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360)- 180; |
cntKompass = 320; |
} |
} |
} |
void Timer_Init(void) |
{ |
tim_main = SetDelay(10); |
TCCR0B = CK8; |
TCCR0A = (1<<COM0A1)|(1<<COM0B1)|3;//fast PWM |
OCR0A = 0; |
OCR0B = 120; |
TCNT0 = -TIMER_RELOAD_VALUE; // reload |
//OCR1 = 0x00; |
TCCR2A=(1<<COM2A1)|(1<<COM2A0)|3; |
TCCR2B=(0<<CS20)|(1<<CS21)|(1<<CS22); |
// TIMSK2 |= _BV(TOIE2); |
TIMSK2 |= _BV(OCIE2A); |
TIMSK0 |= _BV(TOIE0); |
OCR2A = 10; |
TCNT2 = 0; |
} |
// ----------------------------------------------------------------------- |
unsigned int SetDelay (unsigned int t) |
{ |
// TIMSK0 &= ~_BV(TOIE0); |
return(CountMilliseconds + t + 1); |
// TIMSK0 |= _BV(TOIE0); |
} |
// ----------------------------------------------------------------------- |
char CheckDelay(unsigned int t) |
{ |
// TIMSK0 &= ~_BV(TOIE0); |
return(((t - CountMilliseconds) & 0x8000) >> 9); |
// TIMSK0 |= _BV(TOIE0); |
} |
// ----------------------------------------------------------------------- |
void Delay_ms(unsigned int w) |
{ |
unsigned int akt; |
akt = SetDelay(w); |
while (!CheckDelay(akt)); |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Servo ansteuern |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(SIG_OUTPUT_COMPARE2A) |
{ |
static unsigned char timer = 10; |
if(!timer--) |
{ |
TCCR2A=(1<<COM2A1)|(0<<COM2A0)|3; |
ServoValue = Parameter_ServoNickControl; |
if(EE_Parameter.ServoNickCompInvert & 0x01) ServoValue += ((long) EE_Parameter.ServoNickComp * (IntegralNick / 128)) / 512; |
else ServoValue -= ((long) EE_Parameter.ServoNickComp * (IntegralNick / 128)) / 512; |
if(ServoValue < EE_Parameter.ServoNickMin) ServoValue = EE_Parameter.ServoNickMin; |
else if(ServoValue > EE_Parameter.ServoNickMax) ServoValue = EE_Parameter.ServoNickMax; |
//DebugOut.Analog[10] = ServoValue; |
OCR2A = ServoValue;// + 75; |
timer = EE_Parameter.ServoNickRefresh; |
} |
else |
{ |
TCCR2A =3; |
PORTD&=~0x80; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/timer0.h |
---|
0,0 → 1,19 |
#define TIMER_TEILER CK8 |
#define TIMER_RELOAD_VALUE 250 |
// Salvo Kompassoffset 31.8.2007 *********** |
//#define KOMPASS_OFFSET 135 // Winkel zwischen Nordachse Kopter und Nordachse Kompass |
// Salvo End |
void Timer_Init(void); |
void Delay_ms(unsigned int); |
unsigned int SetDelay (unsigned int t); |
char CheckDelay (unsigned int t); |
extern volatile unsigned int CountMilliseconds; |
extern volatile unsigned char UpdateMotor; |
extern volatile unsigned int beeptime; |
extern volatile unsigned int cntKompass; |
extern int ServoValue; |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/twimaster.c |
---|
0,0 → 1,131 |
/*############################################################################ |
############################################################################*/ |
#include "main.h" |
unsigned char twi_state = 0; |
unsigned char motor = 0; |
unsigned char motorread = 0; |
unsigned char motor_rx[8]; |
//############################################################################ |
//Initzialisieren der I2C (TWI) Schnittstelle |
void i2c_init(void) |
//############################################################################ |
{ |
TWSR = 0; |
TWBR = ((SYSCLK/SCL_CLOCK)-16)/2; |
} |
//############################################################################ |
//Start I2C |
char i2c_start(void) |
//############################################################################ |
{ |
TWCR = (1<<TWSTA) | (1<<TWEN) | (1<<TWINT) | (1<<TWIE); |
return(0); |
} |
//############################################################################ |
//Start I2C |
void i2c_stop(void) |
//############################################################################ |
{ |
TWCR = (1<<TWEN) | (1<<TWSTO) | (1<<TWINT); |
} |
//############################################################################ |
//Start I2C |
char i2c_write_byte(char byte) |
//############################################################################ |
{ |
TWSR = 0x00; |
TWDR = byte; |
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWIE); |
return(0); |
} |
//############################################################################ |
//Start I2C |
SIGNAL (TWI_vect) |
//############################################################################ |
{ |
switch (twi_state++) |
{ |
case 0: |
i2c_write_byte(0x52+(motor*2)); |
break; |
case 1: |
switch(motor++) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 2: |
i2c_stop(); |
if (motor<4) twi_state = 0; |
else motor = 0; |
i2c_start(); |
break; |
//Liest Daten von Motor |
case 3: |
i2c_write_byte(0x53+(motorread*2)); |
break; |
case 4: |
switch(motorread) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 5: //1 Byte vom Motor lesen |
motor_rx[motorread] = TWDR; |
case 6: |
switch(motorread) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 7: //2 Byte vom Motor lesen |
motor_rx[motorread+4] = TWDR; |
motorread++; |
if (motorread>3) motorread=0; |
i2c_stop(); |
twi_state = 0; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/twimaster.h |
---|
0,0 → 1,32 |
/*############################################################################ |
############################################################################*/ |
#ifndef _I2C_MASTER_H |
#define _I2C_MASTER_H |
//############################################################################ |
// I2C Konstanten |
#define SCL_CLOCK 200000L |
#define I2C_TIMEOUT 30000 |
#define I2C_START 0x08 |
#define I2C_REPEATED_START 0x10 |
#define I2C_TX_SLA_ACK 0x18 |
#define I2C_TX_DATA_ACK 0x28 |
#define I2C_RX_SLA_ACK 0x40 |
#define I2C_RX_DATA_ACK 0x50 |
//############################################################################ |
extern unsigned char twi_state; |
extern unsigned char motor; |
extern unsigned char motorread; |
extern unsigned char motor_rx[8]; |
void i2c_init (void); // I2C initialisieren |
char i2c_start (void); // Start I2C |
void i2c_stop (void); // Stop I2C |
char i2c_write_byte (char byte); // 1 Byte schreiben |
#endif |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/uart.c |
---|
0,0 → 1,330 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
#include "uart.h" |
unsigned char DebugGetAnforderung = 0,DebugDisplayAnforderung = 0,DebugDataAnforderung = 0,GetVersionAnforderung = 0; |
unsigned volatile char SioTmp = 0; |
unsigned volatile char SendeBuffer[MAX_SENDE_BUFF]; |
unsigned volatile char RxdBuffer[MAX_EMPFANGS_BUFF]; |
unsigned volatile char NMEABuffer[MAX_EMPFANGS_BUFF]; |
unsigned volatile char NeuerDatensatzEmpfangen = 0; |
unsigned volatile char NeueKoordinateEmpfangen = 0; |
unsigned volatile char UebertragungAbgeschlossen = 1; |
unsigned volatile char CntCrcError = 0; |
unsigned volatile char AnzahlEmpfangsBytes = 0; |
unsigned volatile char PC_DebugTimeout = 0; |
unsigned char PcZugriff = 100; |
unsigned char MotorTest[4] = {0,0,0,0}; |
unsigned char MeineSlaveAdresse; |
struct str_DebugOut DebugOut; |
struct str_Debug DebugIn; |
struct str_VersionInfo VersionInfo; |
int Debug_Timer; |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//++ Sende-Part der Datenübertragung |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(INT_VEC_TX) |
{ |
static unsigned int ptr = 0; |
unsigned char tmp_tx; |
if(!UebertragungAbgeschlossen) |
{ |
ptr++; // die [0] wurde schon gesendet |
tmp_tx = SendeBuffer[ptr]; |
if((tmp_tx == '\r') || (ptr == MAX_SENDE_BUFF)) |
{ |
ptr = 0; |
UebertragungAbgeschlossen = 1; |
} |
UDR = tmp_tx; |
} |
else ptr = 0; |
} |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//++ Empfangs-Part der Datenübertragung, incl. CRC-Auswertung |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(INT_VEC_RX) |
{ |
static unsigned int crc; |
static unsigned char crc1,crc2,buf_ptr; |
static unsigned char UartState = 0; |
unsigned char CrcOkay = 0; |
SioTmp = UDR; |
//Salvo 11.9.2007 GPS Daten holen |
Get_Ublox_Msg(SioTmp); // Daten vom GPS Modul holen |
// Salvo End |
if(buf_ptr >= MAX_EMPFANGS_BUFF) UartState = 0; |
if(SioTmp == '\r' && UartState == 2) |
{ |
UartState = 0; |
crc -= RxdBuffer[buf_ptr-2]; |
crc -= RxdBuffer[buf_ptr-1]; |
crc %= 4096; |
crc1 = '=' + crc / 64; |
crc2 = '=' + crc % 64; |
CrcOkay = 0; |
if((crc1 == RxdBuffer[buf_ptr-2]) && (crc2 == RxdBuffer[buf_ptr-1])) CrcOkay = 1; else { CrcOkay = 0; CntCrcError++;}; |
if(!NeuerDatensatzEmpfangen && CrcOkay) // Datensatz schon verarbeitet |
{ |
NeuerDatensatzEmpfangen = 1; |
AnzahlEmpfangsBytes = buf_ptr; |
RxdBuffer[buf_ptr] = '\r'; |
if(/*(RxdBuffer[1] == MeineSlaveAdresse || (RxdBuffer[1] == 'a')) && */(RxdBuffer[2] == 'R')) wdt_enable(WDTO_250MS); // Reset-Commando |
} |
} |
else |
switch(UartState) |
{ |
case 0: |
if(SioTmp == '#' && !NeuerDatensatzEmpfangen) UartState = 1; // Startzeichen und Daten schon verarbeitet |
buf_ptr = 0; |
RxdBuffer[buf_ptr++] = SioTmp; |
crc = SioTmp; |
break; |
case 1: // Adresse auswerten |
UartState++; |
RxdBuffer[buf_ptr++] = SioTmp; |
crc += SioTmp; |
break; |
case 2: // Eingangsdaten sammeln |
RxdBuffer[buf_ptr] = SioTmp; |
if(buf_ptr < MAX_EMPFANGS_BUFF) buf_ptr++; |
else UartState = 0; |
crc += SioTmp; |
break; |
default: |
UartState = 0; |
break; |
} |
} |
// -------------------------------------------------------------------------- |
void AddCRC(unsigned int wieviele) |
{ |
unsigned int tmpCRC = 0,i; |
for(i = 0; i < wieviele;i++) |
{ |
tmpCRC += SendeBuffer[i]; |
} |
tmpCRC %= 4096; |
SendeBuffer[i++] = '=' + tmpCRC / 64; |
SendeBuffer[i++] = '=' + tmpCRC % 64; |
SendeBuffer[i++] = '\r'; |
UebertragungAbgeschlossen = 0; |
UDR = SendeBuffer[0]; |
} |
// -------------------------------------------------------------------------- |
void SendOutData(unsigned char cmd,unsigned char modul, unsigned char *snd, unsigned char len) |
{ |
unsigned int pt = 0; |
unsigned char a,b,c; |
unsigned char ptr = 0; |
SendeBuffer[pt++] = '#'; // Startzeichen |
SendeBuffer[pt++] = modul; // Adresse (a=0; b=1,...) |
SendeBuffer[pt++] = cmd; // Commando |
while(len) |
{ |
if(len) { a = snd[ptr++]; len--;} else a = 0; |
if(len) { b = snd[ptr++]; len--;} else b = 0; |
if(len) { c = snd[ptr++]; len--;} else c = 0; |
SendeBuffer[pt++] = '=' + (a >> 2); |
SendeBuffer[pt++] = '=' + (((a & 0x03) << 4) | ((b & 0xf0) >> 4)); |
SendeBuffer[pt++] = '=' + (((b & 0x0f) << 2) | ((c & 0xc0) >> 6)); |
SendeBuffer[pt++] = '=' + ( c & 0x3f); |
} |
AddCRC(pt); |
} |
// -------------------------------------------------------------------------- |
void Decode64(unsigned char *ptrOut, unsigned char len, unsigned char ptrIn,unsigned char max) // Wohin mit den Daten; Wie lang; Wo im RxdBuffer |
{ |
unsigned char a,b,c,d; |
unsigned char ptr = 0; |
unsigned char x,y,z; |
while(len) |
{ |
a = RxdBuffer[ptrIn++] - '='; |
b = RxdBuffer[ptrIn++] - '='; |
c = RxdBuffer[ptrIn++] - '='; |
d = RxdBuffer[ptrIn++] - '='; |
if(ptrIn > max - 2) break; // nicht mehr Daten verarbeiten, als empfangen wurden |
x = (a << 2) | (b >> 4); |
y = ((b & 0x0f) << 4) | (c >> 2); |
z = ((c & 0x03) << 6) | d; |
if(len--) ptrOut[ptr++] = x; else break; |
if(len--) ptrOut[ptr++] = y; else break; |
if(len--) ptrOut[ptr++] = z; else break; |
} |
} |
// -------------------------------------------------------------------------- |
void BearbeiteRxDaten(void) |
{ |
if(!NeuerDatensatzEmpfangen) return; |
//unsigned int tmp_int_arr1[1]; |
//unsigned int tmp_int_arr2[2]; |
//unsigned int tmp_int_arr3[3]; |
unsigned char tmp_char_arr2[2]; |
//unsigned char tmp_char_arr3[3]; |
//unsigned char tmp_char_arr4[4]; |
//if(!MotorenEin) |
PcZugriff = 255; |
switch(RxdBuffer[2]) |
{ |
case 'c':// Debugdaten incl. Externe IOs usw |
Decode64((unsigned char *) &DebugIn,sizeof(DebugIn),3,AnzahlEmpfangsBytes); |
/* for(unsigned char i=0; i<4;i++) |
{ |
EE_CheckAndWrite(&EE_Buffer[EE_DEBUGWERTE + i*2], DebugIn.Analog[i]); |
EE_CheckAndWrite(&EE_Buffer[EE_DEBUGWERTE + i*2 + 1], DebugIn.Analog[i] >> 8); |
}*/ |
RemoteTasten |= DebugIn.RemoteTasten; |
DebugDataAnforderung = 1; |
break; |
case 'h':// x-1 Displayzeilen |
Decode64((unsigned char *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes); |
RemoteTasten |= tmp_char_arr2[0]; |
DebugDisplayAnforderung = 1; |
break; |
case 't':// Motortest |
Decode64((unsigned char *) &MotorTest[0],sizeof(MotorTest),3,AnzahlEmpfangsBytes); |
break; |
case 'v': // Version-Anforderung und Ausbaustufe |
GetVersionAnforderung = 1; |
break; |
case 'g':// "Get"-Anforderung für Debug-Daten |
// Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
DebugGetAnforderung = 1; |
break; |
case 'q':// "Get"-Anforderung für Settings |
// Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
Decode64((unsigned char *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes); |
if(tmp_char_arr2[0] != 0xff) |
{ |
if(tmp_char_arr2[0] > 5) tmp_char_arr2[0] = 5; |
ReadParameterSet(tmp_char_arr2[0], (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
SendOutData('L' + tmp_char_arr2[0] -1,MeineSlaveAdresse,(unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE); |
} |
else |
SendOutData('L' + GetActiveParamSetNumber()-1,MeineSlaveAdresse,(unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE); |
break; |
case 'l': |
case 'm': |
case 'n': |
case 'o': |
case 'p': // Parametersatz speichern |
Decode64((unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE,3,AnzahlEmpfangsBytes); |
WriteParameterSet(RxdBuffer[2] - 'l' + 1, (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], RxdBuffer[2] - 'l' + 1); // aktiven Datensatz merken |
Piep(GetActiveParamSetNumber()); |
break; |
} |
// DebugOut.AnzahlZyklen = Debug_Timer_Intervall; |
NeuerDatensatzEmpfangen = 0; |
} |
//############################################################################ |
//Routine für die Serielle Ausgabe |
int uart_putchar (char c) |
//############################################################################ |
{ |
if (c == '\n') |
uart_putchar('\r'); |
//Warten solange bis Zeichen gesendet wurde |
loop_until_bit_is_set(USR, UDRE); |
//Ausgabe des Zeichens |
UDR = c; |
return (0); |
} |
// -------------------------------------------------------------------------- |
void WriteProgramData(unsigned int pos, unsigned char wert) |
{ |
//if (ProgramLocation == IN_RAM) Buffer[pos] = wert; |
// else eeprom_write_byte(&EE_Buffer[pos], wert); |
// Buffer[pos] = wert; |
} |
//############################################################################ |
//INstallation der Seriellen Schnittstelle |
void UART_Init (void) |
//############################################################################ |
{ |
//Enable TXEN im Register UCR TX-Data Enable & RX Enable |
UCR=(1 << TXEN) | (1 << RXEN); |
// UART Double Speed (U2X) |
USR |= (1<<U2X); |
// RX-Interrupt Freigabe |
UCSRB |= (1<<RXCIE); |
// TX-Interrupt Freigabe |
UCSRB |= (1<<TXCIE); |
//Teiler wird gesetzt |
UBRR=(SYSCLK / (BAUD_RATE * 8L) - 1); |
//UBRR = 33; |
//öffnet einen Kanal für printf (STDOUT) |
//fdevopen (uart_putchar, 0); |
//sbi(PORTD,4); |
Debug_Timer = SetDelay(200); |
} |
//--------------------------------------------------------------------------------------------- |
void DatenUebertragung(void) |
{ |
static char dis_zeile = 0; |
if(!UebertragungAbgeschlossen) return; |
if(DebugGetAnforderung && UebertragungAbgeschlossen) // Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
{ |
SendOutData('G',MeineSlaveAdresse,(unsigned char *) &DebugIn,sizeof(DebugIn)); |
DebugGetAnforderung = 0; |
} |
if((CheckDelay(Debug_Timer) || DebugDataAnforderung) && UebertragungAbgeschlossen) |
{ |
SendOutData('D',MeineSlaveAdresse,(unsigned char *) &DebugOut,sizeof(DebugOut)); |
DebugDataAnforderung = 0; |
Debug_Timer = SetDelay(MIN_DEBUG_INTERVALL); |
} |
if(DebugDisplayAnforderung && UebertragungAbgeschlossen) |
{ |
Menu(); |
DebugDisplayAnforderung = 0; |
if(++dis_zeile == 4) dis_zeile = 0; |
SendOutData('0' + dis_zeile,0,&DisplayBuff[20 * dis_zeile],20); // DisplayZeile übertragen |
} |
if(GetVersionAnforderung && UebertragungAbgeschlossen) |
{ |
SendOutData('V',MeineSlaveAdresse,(unsigned char *) &VersionInfo,sizeof(VersionInfo)); |
GetVersionAnforderung = 0; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/uart.h |
---|
0,0 → 1,95 |
#ifndef _UART_H |
#define _UART_H |
#define MAX_SENDE_BUFF 150 |
#define MAX_EMPFANGS_BUFF 150 |
void BearbeiteRxDaten(void); |
extern unsigned char DebugGetAnforderung; |
extern unsigned volatile char SendeBuffer[MAX_SENDE_BUFF]; |
extern unsigned volatile char RxdBuffer[MAX_EMPFANGS_BUFF]; |
extern unsigned volatile char UebertragungAbgeschlossen; |
extern unsigned volatile char PC_DebugTimeout; |
extern unsigned volatile char NeueKoordinateEmpfangen; |
extern unsigned char MeineSlaveAdresse; |
extern unsigned char PcZugriff; |
extern int Debug_Timer; |
extern void UART_Init (void); |
extern int uart_putchar (char c); |
extern void boot_program_page (uint32_t page, uint8_t *buf); |
extern void DatenUebertragung(void); |
extern void DecodeNMEA(void); |
extern unsigned char MotorTest[4]; |
struct str_DebugOut |
{ |
unsigned char Digital[13]; |
unsigned int AnzahlZyklen; |
unsigned int Zeit; |
unsigned char Sekunden; |
unsigned int Analog[16]; // Debugwerte |
}; |
extern struct str_DebugOut DebugOut; |
struct str_Debug |
{ |
unsigned char Digital[2]; |
unsigned char RemoteTasten; |
unsigned int Analog[4]; |
}; |
extern struct str_Debug DebugIn; |
struct str_VersionInfo |
{ |
unsigned char Hauptversion; |
unsigned char Nebenversion; |
unsigned char PCKompatibel; |
unsigned char Rserved[7]; |
}; |
extern struct str_VersionInfo VersionInfo; |
//Die Baud_Rate der Seriellen Schnittstelle ist 9600 Baud |
//#define BAUD_RATE 9600 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 14400 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 28800 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 38400 //Baud Rate für die Serielle Schnittstelle |
#define BAUD_RATE 57600 //Baud Rate für die Serielle Schnittstelle |
//Anpassen der seriellen Schnittstellen Register wenn ein ATMega128 benutzt wird |
#if defined (__AVR_ATmega128__) |
# define USR UCSR0A |
# define UCR UCSR0B |
# define UDR UDR0 |
# define UBRR UBRR0L |
# define EICR EICRB |
#endif |
#if defined (__AVR_ATmega32__) |
# define USR UCSRA |
# define UCR UCSRB |
# define UBRR UBRRL |
# define EICR EICRB |
# define INT_VEC_RX SIG_UART_RECV |
# define INT_VEC_TX SIG_UART_TRANS |
#endif |
#if defined (__AVR_ATmega644__) |
# define USR UCSR0A |
# define UCR UCSR0B |
# define UDR UDR0 |
# define UBRR UBRR0L |
# define EICR EICR0B |
# define TXEN TXEN0 |
# define RXEN RXEN0 |
# define RXCIE RXCIE0 |
# define TXCIE TXCIE0 |
# define U2X U2X0 |
# define UCSRB UCSR0B |
# define UDRE UDRE0 |
# define INT_VEC_RX SIG_USART_RECV |
# define INT_VEC_TX SIG_USART_TRANS |
#endif |
#endif //_UART_H |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro/version.txt |
---|
0,0 → 1,49 |
------- |
V0.53 27.04.2007 H.Buss |
- erste öffentliche Version |
V0.53b 29.04.2007 H.Buss |
- der FAKTOR_I war versehentlich auf Null, dann liegt der MikroKopter nicht so hart in der Luft |
V0.53c 29.04.2007 H.Buss |
- es gib ein Menü, in dem die Werte der Kanäle nach Nick, Roll, Gas,... sortiert sind. |
Die angezeigten Werte waren nicht die Werte der Funke |
V0.54 01.05.2007 H.Buss |
- die Paramtersätze können jetzt vor dem Start ausgewählt werden |
Dazu wird beim Kalibrieren der Messwerte (Gashebel oben links) der Nick-Rollhebel abgefragt: |
2 3 4 |
1 x 5 |
- - - |
Bedeutet: Nick-Rollhebel Links Mitte = Setting:1 Links Oben = Setting:2 usw. |
- der Faktor_I für den Hauptregler ist hinzugekommen. Im Heading-Hold-Modus sollte er vergössert werden, was Stabilität bringt |
V0.55 14.05.2007 H.Buss |
- es können nun Servos an J3,J4,J5 mit den Kanälen 5-7 gesteuert werden |
V0.56 14.05.2007 H.Buss |
- es gab Probleme mit Funken, die mehr als 8 Kanäle haben, wenn mehrere Kanäle dann auf Null waren |
- Funken, die nicht bis +-120 aussteuern können, sollten jetzt auch gehen |
V0.57 24.05.2007 H.Buss |
- Der Höhenregler kann nun auch mittels Schalter bedient werden |
- Bug im Gier-Algorithmus behoben; Schnelles Gieren fürhrte dazu, dass der MK zu weit gedreht hat |
- Kompass-Einfluss dämpfen bei Neigung |
- Man kann zwischen Kompass FIX (Richtung beim Kalibrieren) und Variabel (einstellbar per Gier) wählen |
- Der Motortest vom Kopter-Tool geht jetzt |
- Man kann den Parametersätzen einen Namen geben |
- Das Kamerasetting ist unter Setting 2 defaultmässig integriert |
V0.58 30.05.2007 H.Buss |
- Der Höhenregler-Algorithmus wird nun umgangen, wenn der Höhenreglerschalter aus ist |
V0.60 17.08.2007 H.Buss |
- "Schwindel-Bug" behoben |
- Die Poti-Werte werden jetzt auf Unterlauf (<0) überprüft |
- Poti4 zugefügt |
- Es werden jetzt 8 Kanäle ausgewertet |
- Kamera-Servo (an J7) |
- Die Settings müssen überschrieben werden |
/branches/MergedVersionsByOsiair/alpha/v060SalvoKompassNick666MM3Gyro |
---|
Property changes: |
Added: svn:ignore |
+flight_ctrl.aps |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/Flight-Ctrl_MEGA644_V0_64.aps |
---|
0,0 → 1,0 |
<AVRStudio><MANAGEMENT><ProjectName>Flight-Ctrl_MEGA644_V0_64</ProjectName><Created>19-Aug-2007 14:38:13</Created><LastEdit>15-Oct-2007 19:44:55</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>19-Aug-2007 14:38:13</Created><Version>4</Version><Build>4, 13, 0, 528</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>Flight-Ctrl_MEGA644_V0_64.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>E:\hubi\ufo\mickrokopter\eigene versionen\Kompass + GPS\Flight-Ctrl_V0_64_3_GPS_work_Jochenaccvonhand\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>AVR Simulator</CURRENT_TARGET><CURRENT_PART>ATmega644.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>main.c</SOURCEFILE><SOURCEFILE>analog.c</SOURCEFILE><SOURCEFILE>eeprom.c</SOURCEFILE><SOURCEFILE>fc.c</SOURCEFILE><SOURCEFILE>GPS.c</SOURCEFILE><SOURCEFILE>menu.c</SOURCEFILE><SOURCEFILE>printf_P.c</SOURCEFILE><SOURCEFILE>rc.c</SOURCEFILE><SOURCEFILE>timer0.c</SOURCEFILE><SOURCEFILE>twimaster.c</SOURCEFILE><SOURCEFILE>uart.c</SOURCEFILE><SOURCEFILE>compass.c</SOURCEFILE><HEADERFILE>_Settings.h</HEADERFILE><HEADERFILE>analog.h</HEADERFILE><HEADERFILE>fc.h</HEADERFILE><HEADERFILE>gps.h</HEADERFILE><HEADERFILE>main.h</HEADERFILE><HEADERFILE>menu.h</HEADERFILE><HEADERFILE>old_macros.h</HEADERFILE><HEADERFILE>printf_P.h</HEADERFILE><HEADERFILE>rc.h</HEADERFILE><HEADERFILE>Settings.h</HEADERFILE><HEADERFILE>timer0.h</HEADERFILE><HEADERFILE>twimaster.h</HEADERFILE><HEADERFILE>uart.h</HEADERFILE><HEADERFILE>compass.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega644</PART><HEX>1</HEX><LIST>0</LIST><MAP>0</MAP><OUTPUTFILENAME>Flight-Ctrl_MEGA644_V0_60.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -O0 -fsigned-char</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20070525\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20070525\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/></IOView><Files><File00000><FileId>00000</FileId><FileName>main.c</FileName><Status>1</Status></File00000><File00001><FileId>00001</FileId><FileName>compass.c</FileName><Status>1</Status></File00001><File00002><FileId>00002</FileId><FileName>compass.h</FileName><Status>1</Status></File00002><File00003><FileId>00003</FileId><FileName>fc.c</FileName><Status>1</Status></File00003></Files><Workspace><File00000><Position>346 108 878 484</Position><LineCol>155 3</LineCol></File00000><File00001><Position>355 114 901 482</Position><LineCol>0 0</LineCol></File00001><File00002><Position>377 136 923 504</Position><LineCol>0 0</LineCol></File00002><File00003><Position>336 71 1048 624</Position><LineCol>834 19</LineCol><State>Maximized</State></File00003></Workspace><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio> |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/GPS.c |
---|
0,0 → 1,301 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 10.2007 by Jochen Kromayer |
// + es handelt sich um eine Beta-Software, die zu nichtkommerziellen Zwecken frei veröffentlich und weitergegeben werden darf. Für evtl. |
// + Personen- und/der Sachschäden ist jegliche Haftung ausgeschlossen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
#include "math.h" |
//Sinusfunktion von 0° bis 359°. Ergebnis wurde mit 1000 multipliziert, damit als Definition platzsparend int |
//verwendet werden kann. d.h., es muss also in der späteren Berechnung noch mit 0,001 multipliziert werden //(090907Kr) |
const int c_sin[] = {0,17,34,52,69,87,104,121,139,156,173,190, |
207,224,241,258,275,292,309,325,342,358,374,390,406,422,438,453,469,484,500,515,529,544,559,573,587,601,615,629, |
642,656,669,682,694,707,719,731,743,754,766,777,788,798,809,819,829,838,848,857,866,874,882,891,898,906,913,920, |
927,933,939,945,951,956,961,965,970,974,978,981,984,987,990,992,994,996,997,998,999,999,1000,999,999,998,997,996, |
994,992,990,987,984,981,978,974,970,965,961,956,951,945,939,933,927,920,913,906,898,891,882,874,866,857,848,838, |
829,819,809,798,788,777,766,754,743,731,719,707,694,682,669,656,642,629,615,601,587,573,559,544,529,515,500,484, |
469,453,438,422,406,390,374,358,342,325,309,292,275,258,241,224,207,190,173,156,139,121,104,87,69,52,34,17,0,-17, |
-34,-52,-69,-87,-104,-121,-139,-156,-173,-190,-207,-224,-241,-258,-275,-292,-309,-325,-342,-358,-374,-390,-406, |
-422,-438,-453,-469,-484,-500,-515,-529,-544,-559,-573,-587,-601,-615,-629,-642,-656,-669,-682,-694,-707,-719, |
-731,-743,-754,-766,-777,-788,-798,-809,-819,-829,-838,-848,-857,-866,-874,-882,-891,-898,-906,-913,-920,-927, |
-933,-939,-945,-951,-956,-961,-965,-970,-974,-978,-981,-984,-987,-990,-992,-994,-996,-997,-998,-999,-999,-1000, |
-999,-999,-998,-997,-996,-994,-992,-990,-987,-984,-981,-978,-974,-970,-965,-961,-956,-951,-945,-939,-933,-927, |
-920,-913,-906,-898,-891,-882,-874,-866,-857,-848,-838,-829,-819,-809,-798,-788,-777,-766,-754,-743,-731,-719, |
-707,-694,-682,-669,-656,-642,-629,-615,-601,-587,-573,-559,-544,-529,-515,-500,-484,-469,-453,-438,-422,-406, |
-390,-374,-358,-342,-325,-309,-292,-275,-258,-241,-224,-207,-190,-173,-156,-139,-121,-104,-87,-69,-52,-34,-17}; |
//Cosinusfunktion von 0° bis 359°. Ergebnis wurde mit 1000 multipliziert, damit als Definition platzsparend int |
//verwendet werden kann. D.h., es muss also in der späteren Berechnung noch mit 0,001 multipliziert werden //(090907Kr) |
const int c_cos[] = {1000,999,999,998,997,996,994,992,990,987,984,981, |
978,974,970,965,961,956,951,945,939,933,927,920,913,906,898,891,882,874,866,857,848,838,829,819,809,798,788,777, |
766,754,743,731,719,707,694,682,669,656,642,629,615,601,587,573,559,544,529,515,500,484,469,453,438,422,406,390, |
374,358,342,325,309,292,275,258,241,224,207,190,173,156,139,121,104,87,69,52,34,17,0,-17,-34,-52,-69,-87,-104, |
-121,-139,-156,-173,-190,-207,-224,-241,-258,-275,-292,-309,-325,-342,-358,-374,-390,-406,-422,-438,-453,-469, |
-484,-500,-515,-529,-544,-559,-573,-587,-601,-615,-629,-642,-656,-669,-682,-694,-707,-719,-731,-743,-754,-766, |
-777,-788,-798,-809,-819,-829,-838,-848,-857,-866,-874,-882,-891,-898,-906,-913,-920,-927,-933,-939,-945,-951, |
-956,-961,-965,-970,-974,-978,-981,-984,-987,-990,-992,-994,-996,-997,-998,-999,-999,-1000,-999,-999,-998,-997, |
-996,-994,-992,-990,-987,-984,-981,-978,-974,-970,-965,-961,-956,-951,-945,-939,-933,-927,-920,-913,-906,-898, |
-891,-882,-874,-866,-857,-848,-838,-829,-819,-809,-798,-788,-777,-766,-754,-743,-731,-719,-707,-694,-682,-669, |
-656,-642,-629,-615,-601,-587,-573,-559,-544,-529,-515,-500,-484,-469,-453,-438,-422,-406,-390,-374,-358,-342, |
-325,-309,-292,-275,-258,-241,-224,-207,-190,-173,-156,-139,-121,-104,-87,-69,-52,-34,-17,0,17,34,52,69,87, |
104,121,139,156,173,190,207,224,241,258,275,292,309,325,342,358,374,390,406,422,438,453,469,484,500,515,529,544, |
559,573,587,601,615,629,642,656,669,682,694,707,719,731,743,754,766,777,788,798,809,819,829,838,848,857,866,874, |
882,891,898,906,913,920,927,933,939,945,951,956,961,965,970,974,978,981,984,987,990,992,994,996,997,998,999,999}; |
long Soll_Position_North = 0; |
long Soll_Position_East = 0; |
long GPS_Positionsabweichung_North = 0; |
long GPS_Positionsabweichung_East = 0; |
long GPS_Geschwindigkeit_North = 0; |
long GPS_Geschwindigkeit_East = 0; |
signed int GPS_StickSense = 12; |
long P_Einfluss_North = 0; |
long D_Einfluss_North = 0; |
long P_Einfluss_East = 0; |
long D_Einfluss_East = 0; |
signed int GPS_North = 0; |
signed int GPS_East = 0; |
signed int GPS_Nick = 0; |
signed int GPS_Roll = 0; |
volatile char gethome = 0; //Flag ob GPS_Home_Position gelernt ist //(280807Kr) |
long GPS_Home_North = 0; |
long GPS_Home_East = 0; |
unsigned char blinkcount_LED2 = 0; //Hilfszähler für die blinkende LED (010907Kr) |
//**************************** MIRCOS DEFINITIONSANFANG FÜR DIE FILTERUNG |
// Filterung der GPS Messwerte vom Ublox-Empfänger. Es wird der gleitende Durchschnitt aus n Messwerten gebildet |
#define MITTELWERTZAHL 8 // Anzahl der Messwerte fuer gleitenden Mittelwert |
volatile char NeuerMittelwert = 0; //Flag ob ein neuer Mittelwert vorliegt, der mit 4 Hz berechnet wird, da nur dann neue Messwerte vom GPS vorliegen |
volatile unsigned char FilterPos = 0; |
volatile long NORTH_MITTEL = 0; |
volatile long EAST_MITTEL = 0; |
volatile long long NORTH_LONG_LONG = 0; |
volatile long long EAST_LONG_LONG = 0; |
volatile int filterfilled = 0; |
typedef struct { |
long NORTH[MITTELWERTZAHL]; |
} FILTER_NORTH; // Filterdefinition für die Positions-Nordwerte aus dem GPS-Empfänger |
typedef struct { |
long EAST[MITTELWERTZAHL]; |
} FILTER_EAST; // Filterdefinition für die Positions-Ostwerte aus dem GPS-Empfänger |
FILTER_NORTH filter_north; |
FILTER_EAST filter_east; |
//**************************** MIRCOS DEFINITIONSENDE FÜR DIE FILTERUNG |
void gps_main(void) |
{ |
//**************************** MIRCOS FILTERUNG ANFANG |
if(actualPos.GPSFix == 3 && actualPos.newData == 1) //bilde neuen Positionsmittelwert, wenn 3D-Fix und neue GPS-Daten vorliegen |
//if(actualPos.GPSFix == 3) // hier auskommentieren, wenn dauernd (also nicht nur alle 250ms) die GPS-Berechnung durchgeführt werden soll |
{ |
filter_north.NORTH[FilterPos] = actualPos.northing; |
filter_east.EAST[FilterPos] = actualPos.easting; |
FilterPos++; |
if (FilterPos==MITTELWERTZAHL) FilterPos=0; |
if (filterfilled<MITTELWERTZAHL) filterfilled++; |
NORTH_LONG_LONG = 0; |
EAST_LONG_LONG = 0; |
for (int i=0; i<filterfilled; i++) |
{ |
NORTH_LONG_LONG += filter_north.NORTH[i]; |
EAST_LONG_LONG += filter_east.EAST[i]; |
} |
NORTH_LONG_LONG /= filterfilled; |
EAST_LONG_LONG /= filterfilled; |
NORTH_MITTEL = NORTH_LONG_LONG; |
EAST_MITTEL = EAST_LONG_LONG; |
NeuerMittelwert = 1; |
actualPos.newData = 0; // hier auskommentieren, wenn dauernd (also nicht nur alle 250ms) die GPS-Berechnung durchgeführt werden soll |
} |
//******************************* MIRCOS FILTERUNG ENDE |
//wenn kein 3D-Fix vorhanden, über das Poti jedoch irgendeine GPS Funktion aktiv ist, werden die GPS-Steuerbefehle |
//auf Null gesetzt, um unkontrolliertes Wegfliegen durch das GPS zu verhindern. Dadurch wird abgesichert |
//(auch im laufenden Flug), dass bei einem Verlust der GPS-Verbindung GPS deaktivert wird |
if (actualPos.GPSFix < 3 && Poti3 > 70) |
{ |
GPS_Nick = 0; |
GPS_Roll = 0; |
LED2_OFF; |
beeptime = 50; |
} |
// speichert die GPS_Home_Position beim 3D-Fix, MotorEINschalten und wenn noch nicht zu weit weggeflogen wurde |
// (modell_fliegt_gps < 2000) einmalig ab. Die Flugzeitabfrage sichert ab, dass bei einem Losfliegen ohne 3D-Fix die Home_Positinen |
// irgendwann später dort gelernt werden, wo dann zu ersten mal ein 3D-Fix vorhanden ist |
if (actualPos.GPSFix == 3 && MotorenEin == 1 && gethome == 0 && modell_fliegt_gps < 2000) |
{ |
GPS_Home_North = NORTH_MITTEL; |
GPS_Home_East = EAST_MITTEL; |
// Muss hier auch eingelernt werden, damit falls das Poti3 beim Motorenstarten in |
// Mittelstellung sein sollte, trotzdem schon eine Sollposition vorliegt. Andernfalls würde |
// GPS_Nick und _Roll maximal werden bis zum ersten Mal Stick_Nick und _Roll gesteuert würde |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
beeptime = 50; |
gethome = 1; |
} |
//löscht die GPS_Home_Position beim MotorAUSschalten wieder und resetet das Flag gethome //(280807Kr) |
if (MotorenEin == 0) |
{ |
GPS_Home_North = 0; |
GPS_Home_East = 0; |
gethome = 0; |
modell_fliegt_gps = 0; |
} |
// wenn Schalter ausgeschaltet, dann wird die LED2 ausgeschaltet und das GPS Steuerkommando gelöscht |
if(Poti3 < 70) |
{ |
// Sollpositionen müssen auch hier beschrieben werden, damit ausgeschlossen ist, dass falls gelandet wird und die GPS-Funktion |
// über Poti3 deaktivert und anschließend wieder aktiviert wird keine Soll-Positionen vorliegen. |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
GPS_Nick = 0; |
GPS_Roll = 0; |
LED2_OFF; |
} |
// wenn 3D-Fix, Schalter im mittleren Bereich und vom Pilot gesteuert wird, wird ständig neue GPS-Sollposition eingelernt |
if(actualPos.GPSFix == 3 && Poti3 > 70 && Poti3 < 150 && (StickNick > GPS_StickSense || StickNick < -GPS_StickSense || StickRoll > GPS_StickSense || StickRoll < -GPS_StickSense)) |
{ |
GPS_Nick = 0; //wird genullt, damit das letzte GPS Kommando nicht ständig gegen den Piloten ansteuert |
GPS_Roll = 0; //wird genullt, damit das letzte GPS Kommando nicht ständig gegen den Piloten ansteuert |
Soll_Position_North = NORTH_MITTEL; // Soll-Position wird geschrieben |
Soll_Position_East = EAST_MITTEL; // Soll-Position wird geschrieben |
//++++++++++++++++++++++++++++++++++++ |
//Sorgt lediglich dafür, dass die LED2 langsam blinkt. Dauer ist durch die "> x" Abfrage festgelegt |
//++++++++++++++++++++++++++++++++++++ |
if(blinkcount_LED2 >= 200) // maximal erlaubt 255 wegen unsigned char |
{ |
LED2_FLASH; |
blinkcount_LED2 = 0; |
} |
blinkcount_LED2++; |
//++++++++++++++++++++++++++++++++++++ |
} |
// wenn 3D-Fix, Schalter im mittleren Bereich (oder höher), neuer Mittelwert vorhanden, wenigstens einmal Sollposition gelernt und der Pilot nicht selbst steuert wird eine GPS-Funktion aktiviert |
if (actualPos.GPSFix == 3 && Poti3 > 70 && NeuerMittelwert == 1 && Soll_Position_North != 0 && Soll_Position_East != 0 && StickNick <= GPS_StickSense && StickNick >= -GPS_StickSense && StickRoll <= GPS_StickSense && StickRoll >= -GPS_StickSense) |
{ |
//Berechnung der GPS-Positionsabweichung je nach aktivierter GPS-Funktion (GPS_HOLD oder HOMING) |
//DYNAMISCHES GPS-HOLD, wenn Schalter noch in Mittelstellung ist wird die zuletzt gelernte Soll_Position angeflogen |
if(Poti3 < 150) |
{ |
GPS_Positionsabweichung_North = (Soll_Position_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (Soll_Position_East - EAST_MITTEL); |
LED2_ON; |
} |
//andernfalls, wenn Schalter in max. Stellung und zusätzlich die GPS_Home_Positionen beim Motorenstarten gelernt |
//werden konnten, wird zur GPS_Home_Position geflogen |
if (Poti3 >= 150 && GPS_Home_North != 0 && GPS_Home_East != 0) |
{ |
GPS_Positionsabweichung_North = (GPS_Home_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (GPS_Home_East - EAST_MITTEL); |
// durch das ständige Neulernen der Soll_Positionen während HOMING wird erreicht, dass der MK nach dem Umschalten |
// von HOMING zurück zu GPS-HOLD nicht wieder an die alte Soll_Position zurück fliegt |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
LED2_ON; |
} |
//verhindert, dass beim Umschalten von Mittelstellung (GPS_HOLD) auf Maximalstellung (HOMING) OHNE gelernte Homeposition |
//die GPS Funktion unkontrolliert steuert. Daher wird GPS_HOLD aktiv gehalten, die Sollpositon wird bei Stickbefehlen |
//jedoch nicht wie beim dynamischen GPS_HOLD überschrieben. Zusätzlich wird der Summer eingeschaltet. |
if (Poti3 >= 150 && GPS_Home_North == 0 && GPS_Home_East == 0) |
{ |
GPS_Positionsabweichung_North = (Soll_Position_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (Soll_Position_East - EAST_MITTEL); |
LED2_ON; |
beeptime = 50; |
} |
//GPS-Geschwindigkeiten |
GPS_Geschwindigkeit_North = actualPos.velNorth; //actualPos.velNorth ist die Geschwindigkeiten aus dem GPS Empfänger entlang der Nord-Süd Richtung |
GPS_Geschwindigkeit_East = actualPos.velEast; //actualPos.velEast ist die Geschwindigkeiten aus dem GPS Empfänger entlang der Ost-West Richtung |
//Berechnung der Einzelkomponenten des PD-Reglers |
P_Einfluss_North = (P_GPS_Verstaerkung * GPS_Positionsabweichung_North)*0.0005; //entspricht einer Skalierung von 1/2000 |
D_Einfluss_North = (D_GPS_Verstaerkung * GPS_Geschwindigkeit_North)*0.00333; //entspricht einer Skalierung von 1/300 |
P_Einfluss_East = (P_GPS_Verstaerkung * GPS_Positionsabweichung_East)*0.0005; //entspricht einer Skalierung von 1/2000 |
D_Einfluss_East = (D_GPS_Verstaerkung * GPS_Geschwindigkeit_East)*0.00333; //entspricht einer Skalierung von 1/300 |
// Begrenzung des maximalen D-Anteils für pos. und neg. Werte. Grenze muss so geählt werden, |
// dass das Limit im normalen Position-Hold nicht erreicht wird und somit keinen Einfluss hat. |
// Grund: Beim Zufliegen auf weiter entfernte Ziele bremst der D-Anteil kurz vor dem Ziel den Mikrokopter sehr stark ab. |
// Dieses Limit wirkt nur, wenn sich der MK im HOMING Modus befindet und sich noch weit (>2,5m) von der Home-Position weg befindet. |
if (Poti3 >= 150 && GPS_Home_North != 0 && GPS_Home_East != 0 && (abs(GPS_Positionsabweichung_North) > 250 || abs(GPS_Positionsabweichung_East) > 250)) |
{ |
if (D_Einfluss_North > Limit_D_Anteil) D_Einfluss_North = Limit_D_Anteil; |
if (D_Einfluss_East > Limit_D_Anteil) D_Einfluss_East = Limit_D_Anteil; |
if (D_Einfluss_North < -1 * Limit_D_Anteil) D_Einfluss_North = -1 * Limit_D_Anteil; |
if (D_Einfluss_East < -1 * Limit_D_Anteil) D_Einfluss_East = -1 * Limit_D_Anteil; |
} |
// PD-Regler |
GPS_North = (-P_Einfluss_North + D_Einfluss_North); |
GPS_East = (P_Einfluss_East - D_Einfluss_East); |
//Umrechnen vom globalen North- bzw. East- in das körperfeste X- bzw. Y- Koordinatensystem |
GPS_Nick = (-c_sin[KompassValue]*0.001*GPS_East + c_cos[KompassValue]*0.001*GPS_North); // die "0" kann später durch den Messwert des Kompasssensors (KompassValue/0.01745329251) ersetzt werden |
GPS_Roll = (c_cos[KompassValue]*0.001*GPS_East + c_sin[KompassValue]*0.001*GPS_North); // die "0" kann später durch den Messwert des Kompasssensors (KompassValue/180*3.1415926535) ersetzt werden |
// Begrenzung des maximalen GPS Einflusses für positive und negative Werte |
if (GPS_Nick > 35) GPS_Nick = 35; |
if (GPS_Roll > 35) GPS_Roll = 35; |
if (GPS_Nick < -35) GPS_Nick = -35; |
if (GPS_Roll < -35) GPS_Roll = -35; |
//Funktion wird dadurch nur alle 250 ms aufgerufen, wenn neue Mittelwerte aus den GPS-Daten vorliegen. |
//FUNKTIONIERT MOMENTAN NOCH NICHT, DA STÄNDIG OHNE UNTERBRECHUNG NEUE MITTELWERTE BERECHNET WERDEN. |
//GRUND: DIE ABFRAGE NACH NEUE GPS-DATEN ERFOLGT NOCH NICHT |
NeuerMittelwert = 0; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/License.txt |
---|
0,0 → 1,52 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + Nur für den privaten Gebrauch |
// + www.MikroKopter.com |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
// + dass eine Nutzung (auch auszugsweise) nur für den privaten und nichtkommerziellen Gebrauch zulässig ist. |
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
// + bzgl. der Nutzungsbedingungen aufzunehmen. |
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
// + Verkauf von Luftbildaufnahmen, usw. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
// + eindeutig als Ursprung verlinkt und genannt werden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
// + Benutzung auf eigene Gefahr |
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
// + mit unserer Zustimmung zulässig |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
// + this list of conditions and the following disclaimer. |
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
// + from this software without specific prior written permission. |
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
// + for non-profit use (directly or indirectly) |
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
// + with our written permission |
// + * If sources or documentations are redistributet, our webpage (http://www.MikroKopter.de) must be |
// + clearly linked and named as origin |
// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/MIKROKOPTER_TO_DO.txt |
---|
0,0 → 1,11 |
. Patricks neigungskompensierten Kompass |
. Aufruf der GPS.c innerhalb der fc.c nur wenn neue Daten vorliegen |
. innerhalb der GPS.c den PD-Regler nicht mit "NeuerMittelwert", sondern mit "actualpos.newdata" alle 250ms aufrufen |
. GPS-Empfänger auf 5Hz einstellen |
. Begrenzung von 35 auf 50 anheben, damit auch bei stärkerem Wind geflogen werden kann |
. Waypoints |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/Parameter.txt |
---|
0,0 → 1,15 |
bei leichtem, konstantem Wind |
P-Faktor(Userparam_1): 120 |
D-Faktor(Userparam_2): 90 |
D-Anteil_Limit(Userparam_3): 45 |
bei stärkerem, böhigem Wind: |
P-Faktor(Userparam_1): 150 |
D-Faktor(Userparam_2): 95 |
D-Anteil_Limit(Userparam_3): 45 |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/Setting_1.mkp |
---|
0,0 → 1,51 |
[Setup] |
Name=GPS |
GlobalConfig=43 |
[Channels] |
Gas=7 |
Gier=6 |
Nick=5 |
Roll=8 |
Poti_1=1 |
Poti_2=2 |
Poti_3=3 |
Poti_4=4 |
[Stick] |
Nick_Roll-P=4 |
Nick_Roll-D=0 |
Gier-P=16 |
[Altitude] |
Setpoint=254 |
MinGas=30 |
P=10 |
Barometric-D=50 |
Z-ACC-Effect=50 |
Gain=2 |
[Gyro] |
P=120 |
I=150 |
ACC_Gyro-Factor=26 |
Main-I=0 |
[Others] |
MinGas=5 |
MaxGas=250 |
Compass-Effect=64 |
UnderVoltage=95 |
NotGas=66 |
NotGasTime=60 |
[User] |
Parameter_1=251 |
Parameter_2=252 |
Parameter_3=35 |
Parameter_4=60 |
[Camera] |
ServoNickControl=100 |
ServoNickCompensation=40 |
ServoNickInvert=0 |
ServoNickMin=50 |
ServoNickMax=150 |
ServoNickRefreshRate=5 |
[Loop] |
Config=0 |
GasLimit=50 |
StickThreshold=90 |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/Settings.h |
---|
--- alpha/v064JokoGPSNick666Acc250/_Settings.h (nonexistent) |
+++ alpha/v064JokoGPSNick666Acc250/_Settings.h (revision 2762) |
@@ -0,0 +1,50 @@ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Testmodi |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define MOTOR_OFF 0 |
+#define MOTOR_TEST 0 |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Abstimmung |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define ACC_AMPLIFY 16 |
+#define FAKTOR_P 1 |
+#define FAKTOR_I 0.0001 |
+ |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Debug-Interface |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define SIO_DEBUG 1 // Soll der Debugger aktiviert sein? |
+#define MIN_DEBUG_INTERVALL 500 // in diesem Intervall werden Degugdaten ohne Aufforderung gesendet |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Sender |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ #define K_NICK 0 |
+ #define K_ROLL 1 |
+ #define K_GAS 2 |
+ #define K_GIER 3 |
+ #define K_POTI1 4 |
+ #define K_POTI2 5 |
+ #define K_POTI3 6 |
+ #define K_POTI4 7 |
+// +++++++++++++++++++++++++++++++ |
+// + Getestete Settings: |
+// +++++++++++++++++++++++++++++++ |
+// Setting: Kamera |
+// Stick_P:3 |
+// Stick_D:0 |
+// Gyro_P: 175 |
+// Gyro_I: 175 |
+// Ki_Anteil: 10 |
+// +++++++++++++++++++++++++++++++ |
+// + Getestete Settings: |
+// +++++++++++++++++++++++++++++++ |
+// Setting: Normal |
+// Stick_P:2 |
+// Stick_D:8 |
+// Gyro_P: 80 |
+// Gyro_I: 150 |
+// Ki_Anteil: 5 |
+ |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/analog.c |
---|
0,0 → 1,172 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
volatile int Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az, UBat = 100; |
volatile int AccumulateNick = 0, AccumulateRoll = 0, AccumulateGier = 0; |
volatile int accumulate_AccRoll = 0,accumulate_AccNick = 0,accumulate_AccHoch = 0; |
volatile char MessanzahlNick = 0, MessanzahlRoll = 0, MessanzahlGier = 0; |
volatile char messanzahl_AccNick = 0, messanzahl_AccRoll = 0, messanzahl_AccHoch = 0; |
volatile long Luftdruck = 32000; |
volatile int StartLuftdruck; |
volatile unsigned int MessLuftdruck = 1023; |
unsigned char DruckOffsetSetting; |
volatile int HoeheD = 0; |
volatile char messanzahl_Druck; |
volatile int tmpLuftdruck; |
volatile unsigned int ZaehlMessungen = 0; |
//####################################################################################### |
// |
void ADC_Init(void) |
//####################################################################################### |
{ |
ADMUX = 0;//Referenz ist extern |
ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE); |
//Free Running Mode, Division Factor 128, Interrupt on |
} |
void SucheLuftruckOffset(void) |
{ |
unsigned int off; |
off = eeprom_read_byte(&EEPromArray[EEPROM_ADR_LAST_OFFSET]); |
if(off > 20) off -= 10; |
OCR0A = off; |
Delay_ms(100); |
if(MessLuftdruck < 850) off = 0; |
for(; off < 250;off++) |
{ |
OCR0A = off; |
Delay_ms(50); |
printf("."); |
if(MessLuftdruck < 900) break; |
} |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_LAST_OFFSET], off); |
DruckOffsetSetting = off; |
Delay_ms(300); |
} |
//####################################################################################### |
// |
SIGNAL(SIG_ADC) |
//####################################################################################### |
{ |
static unsigned char kanal=0,state = 0; |
signed int wert; |
ANALOG_OFF; |
switch(state++) |
{ |
case 0: |
wert = (signed int) AdNeutralGier - ADC; |
if(PlatinenVersion != 10) wert *= 2; |
AccumulateGier += wert; // |
MessanzahlGier++; |
Mess_Integral_Gier += wert;// / 16; |
Mess_Integral_Gier2 += wert; |
kanal = 1; |
ZaehlMessungen++; |
break; |
case 1: |
wert = (signed int) ADC - AdNeutralRoll; |
if(PlatinenVersion != 10) wert *= 2; |
Mess_IntegralRoll += wert; |
Mess_IntegralRoll2 += wert; |
if(Mess_IntegralRoll > 310000L) Mess_IntegralRoll = -290000L; |
if(Mess_IntegralRoll <-310000L) Mess_IntegralRoll = 290000L; |
if(ADC < 15) wert = -1000; |
if(ADC < 7) wert = -2000; |
if(ADC > 1010) wert = +1000; |
if(ADC > 1017) wert = +2000; |
AccumulateRoll += wert; |
MessanzahlRoll++; |
kanal = 2; |
break; |
case 2: |
wert = (signed int) ADC - AdNeutralNick; |
if(PlatinenVersion != 10) wert *= 2; |
Mess_IntegralNick += wert; |
Mess_IntegralNick2 += wert; |
if(Mess_IntegralNick > 310000L) Mess_IntegralNick = -290000L; |
if(Mess_IntegralNick <-310000L) Mess_IntegralNick = 290000L; |
if(ADC < 15) wert = -1000; |
if(ADC < 7) wert = -2000; |
if(ADC > 1010) wert = +1000; |
if(ADC > 1017) wert = +2000; |
AccumulateNick += wert; |
MessanzahlNick++; |
kanal = 4; |
break; |
case 3: |
UBat = (3 * UBat + ADC / 3) / 4;//(UBat + ((ADC * 39) / 256) + 19) / 2; |
kanal = 6; |
break; |
case 4: |
Aktuell_ay = NeutralAccY - ADC; |
accumulate_AccRoll += Aktuell_ay; |
messanzahl_AccRoll++; |
kanal = 7; |
break; |
case 5: |
Aktuell_ax = ADC - NeutralAccX; |
accumulate_AccNick += Aktuell_ax; |
messanzahl_AccNick++; |
kanal = 5; |
state = 6; |
break; |
case 6: |
accumulate_AccHoch = (signed int) ADC - NeutralAccZ; |
accumulate_AccHoch += abs(Aktuell_ay) / 4 + abs(Aktuell_ax) / 4; |
if(accumulate_AccHoch > 1) |
{ |
if(NeutralAccZ < 800) NeutralAccZ+= 0.02; |
} |
else if(accumulate_AccHoch < -1) |
{ |
if(NeutralAccZ > 600) NeutralAccZ-= 0.02; |
} |
messanzahl_AccHoch = 1; |
Aktuell_az = ADC; |
Mess_Integral_Hoch += accumulate_AccHoch; // Integrieren |
Mess_Integral_Hoch -= Mess_Integral_Hoch / 1024; // dämfen |
// Mess_Integral_Hoch -= Mess_Integral_Hoch / 512; // dämfen |
/* if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
kanal = 3; |
state = 7; |
} |
else |
{ |
kanal = 0; |
state = 0; |
}*/ |
kanal = 3; |
state = 7; |
break; |
case 7: |
tmpLuftdruck += ADC; |
if(++messanzahl_Druck >= 5) |
{ |
MessLuftdruck = ADC; |
messanzahl_Druck = 0; |
HoeheD = (int)(StartLuftdruck - tmpLuftdruck - HoehenWert); // D-Anteil = neuerWert - AlterWert |
Luftdruck = (tmpLuftdruck + 3 * Luftdruck) / 4; |
HoehenWert = StartLuftdruck - Luftdruck; |
tmpLuftdruck = 0; |
} |
kanal = 0; |
state = 0; |
break; |
default: |
kanal = 0; |
state = 0; |
break; |
} |
ADMUX = kanal; |
ANALOG_ON; |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/analog.h |
---|
0,0 → 1,23 |
/*####################################################################################### |
#######################################################################################*/ |
extern volatile int UBat; |
extern volatile int AccumulateNick, AccumulateRoll, AccumulateGier,accumulate_AccRoll,accumulate_AccNick,accumulate_AccHoch; |
extern volatile char MessanzahlNick, MessanzahlRoll, MessanzahlGier,messanzahl_AccNick, messanzahl_AccRoll,messanzahl_AccHoch; |
extern volatile int Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az; |
extern volatile long Luftdruck; |
extern volatile char messanzahl_Druck; |
extern volatile unsigned int ZaehlMessungen; |
extern unsigned char DruckOffsetSetting; |
extern volatile int HoeheD; |
extern volatile unsigned int MessLuftdruck; |
extern volatile int StartLuftdruck; |
extern unsigned int ReadADC(unsigned char adc_input); |
extern void ADC_Init(void); |
extern void SucheLuftruckOffset(void); |
#define ANALOG_OFF ADCSRA=0 |
#define ANALOG_ON ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE) |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/compass.c |
---|
0,0 → 1,152 |
/* |
Copyright 2007, Niklas Nold |
This program (files compass.c and compass.h) is free software; you can redistribute it and/or modify |
it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; |
either version 3 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
Please note: All the other files for the project "Mikrokopter" by H. Buss are under the license (license_buss.txt) published by www.mikrokopter.de |
*/ |
#include "main.h" |
MM3_struct MM3; |
//############################################################################ |
//Initialisierung der SPI-Schnittstelle |
void init_spi(void) |
//############################################################################ |
{ |
SPCR = (1<<SPIE)|(1<<SPE)|(1<<MSTR)|(1<<SPR1)|(1<<SPR0); //Interrupt an, Master, 156 kHz Oszillator |
//SPSR = (1<<SPI2X); |
DDRB |= (1<<PB7)|(1<<PB5)|(1<<PB2); // J8, MOSI, SCK Ausgang |
PORTD &= ~(1<<PD3); // J5 auf Low |
MM3.AXIS = MM3_X; |
MM3.STATE = MM3_RESET; |
} |
//############################################################################ |
//Wird in der SIGNAL (SIG_OVERFLOW0) aufgerufen |
void MM3_timer0(void) |
//############################################################################ |
{ |
switch (MM3.STATE) |
{ |
case MM3_RESET: |
PORTB |= (1<<PB2); // J8 auf High, MM3 Reset |
MM3.STATE = MM3_START_TRANSFER; |
return; |
case MM3_START_TRANSFER: |
PORTB &= ~(1<<PB2); // J8 auf Low (war ~125 µs auf High) |
if (MM3.AXIS == MM3_X) SPDR = 0x51; // Schreiben ins SPDR löst automatisch Übertragung (MOSI und MISO) aus |
else if (MM3.AXIS == MM3_Y) SPDR = 0x52; // Micromag Period Select ist auf 1024 (0x50) |
else if (MM3.AXIS == MM3_Z) SPDR = 0x53; // 1: x-Achse, 2: Y-Achse, 3: Z-Achse |
MM3.DRDY = SetDelay(15); // Laut Datenblatt max. Zeit bis Messung fertig (bei PS 1024) |
MM3.STATE = MM3_WAIT_DRDY; |
return; |
case MM3_WAIT_DRDY: |
if (CheckDelay(MM3.DRDY)) {SPDR = 0x00;MM3.STATE = MM3_DRDY;} // Irgendwas ins SPDR, damit Übertragung ausgelöst wird, wenn Wartezeit vorbei |
return; // Jetzt gehts weiter in SIGNAL (SIG_SPI) |
case MM3_TILT: // Zeitnahe Speicherung der aktuellen Neigung in ° |
MM3.NickGrad = asin_i((float)Aktuell_ax/220*200); |
MM3.RollGrad = asin_i((float)Aktuell_ay/220*200); |
MM3.AXIS = MM3_X; |
MM3.STATE = MM3_RESET; |
return; |
} |
} |
//############################################################################ |
//SPI byte ready |
SIGNAL (SIG_SPI) |
//############################################################################ |
{ |
switch (MM3.STATE) |
{ |
case MM3_DRDY: // 1. Byte ist da, abspeichern, an die MSB-Stelle rücken |
if (MM3.AXIS == MM3_X) |
{ |
MM3.x_axis = SPDR; |
MM3.x_axis <<= 8; |
} |
else if (MM3.AXIS == MM3_Y) |
{ |
MM3.y_axis = SPDR; |
MM3.y_axis <<= 8; |
} |
else // if (MM3.AXIS == MM3_Z) |
{ |
MM3.z_axis = SPDR; |
MM3.z_axis <<= 8; |
} |
SPDR=0x00; // Übertragung von 2. Byte auslösen |
MM3.STATE=MM3_BYTE2; |
return; |
case MM3_BYTE2: // 2. Byte der entsprechenden Achse ist da |
if (MM3.AXIS == MM3_X) |
{ |
MM3.x_axis |= SPDR; |
MM3.x_axis -= OFF_X; // Sofort Offset aus der Kalibrierung berücksichtigen |
MM3.AXIS = MM3_Y; |
MM3.STATE = MM3_RESET; |
} |
else if (MM3.AXIS == MM3_Y) |
{ |
MM3.y_axis |= SPDR; |
MM3.y_axis -= OFF_Y; |
MM3.AXIS = MM3_Z; |
MM3.STATE = MM3_RESET; |
} |
else // if (MM3.AXIS == MM3_Z) |
{ |
MM3.z_axis |= SPDR; |
MM3.z_axis -= OFF_Z; |
MM3.STATE = MM3_TILT; |
} |
return; |
} |
} |
signed int MM3_heading(void) |
{ |
float sin_nick, cos_nick, sin_roll, cos_roll; |
signed int x_corr, y_corr; |
signed int heading; |
// Berechung von sinus und cosinus |
sin_nick = sin_f(MM3.NickGrad); |
cos_nick = cos_f(MM3.NickGrad); |
sin_roll = sin_f(MM3.RollGrad); |
cos_roll = cos_f(MM3.RollGrad); |
// Neigungskompensation |
//x_corr = (cos_nick * MM3.x_axis) + (((sin_roll * MM3.y_axis) - (cos_roll * MM3.z_axis)) * sin_nick); |
x_corr = (cos_nick * MM3.x_axis) - (((sin_roll * MM3.y_axis) - (cos_roll * MM3.z_axis)) * sin_nick); |
y_corr = ((cos_roll * MM3.y_axis) + (sin_roll * MM3.z_axis)); |
// Winkelberechnung |
heading = atan2_i(x_corr, y_corr); |
return (heading); |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/compass.h |
---|
0,0 → 1,40 |
typedef struct |
{ |
uint8_t STATE; |
unsigned int DRDY; |
uint8_t AXIS; |
signed int x_axis; |
signed int y_axis; |
signed int z_axis; |
signed int NickGrad; |
signed int RollGrad; |
}MM3_struct; |
extern MM3_struct MM3; |
void init_spi(void); |
void MM3_timer0(void); |
signed int MM3_heading(void); |
#define Int2Grad_Faktor 1024 |
// Die Werte der Statemachine |
#define MM3_RESET 0 |
#define MM3_START_TRANSFER 1 |
#define MM3_WAIT_DRDY 2 |
#define MM3_DRDY 4 |
#define MM3_BYTE2 8 |
#define MM3_X 16 |
#define MM3_Y 32 |
#define MM3_Z 64 |
#define MM3_TILT 128 |
// Die Werte der Kompasskalibrierung |
// OFFSET: (Maximaler Wert + minimaler Wert) / 2 |
#define OFF_X -11 |
#define OFF_Y 30 |
#define OFF_Z 18 |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/eeprom.c |
---|
--- alpha/v064JokoGPSNick666Acc250/fc.c (nonexistent) |
+++ alpha/v064JokoGPSNick666Acc250/fc.c (revision 2762) |
@@ -0,0 +1,1034 @@ |
+/*####################################################################################### |
+Flight Control |
+#######################################################################################*/ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Copyright (c) 04.2007 Holger Buss |
+// + Nur für den privaten Gebrauch |
+// + www.MikroKopter.com |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
+// + dass eine Nutzung (auch auszugsweise) nur für den privaten (nicht-kommerziellen) Gebrauch zulässig ist. |
+// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
+// + bzgl. der Nutzungsbedingungen aufzunehmen. |
+// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
+// + Verkauf von Luftbildaufnahmen, usw. |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
+// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
+// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
+// + eindeutig als Ursprung verlinkt werden |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
+// + Benutzung auf eigene Gefahr |
+// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
+// + mit unserer Zustimmung zulässig |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
+// + this list of conditions and the following disclaimer. |
+// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
+// + from this software without specific prior written permission. |
+// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
+// + for non-commercial use (directly or indirectly) |
+// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
+// + with our written permission |
+// + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
+// + clearly linked as origin |
+// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
+// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
+// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
+// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
+// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
+// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
+// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
+// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
+// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
+// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
+// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
+// + POSSIBILITY OF SUCH DAMAGE. |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+#include "main.h" |
+ |
+unsigned char h,m,s; |
+volatile unsigned int I2CTimeout = 100; |
+volatile int MesswertNick,MesswertRoll,MesswertGier; |
+volatile int AdNeutralNick = 0,AdNeutralRoll = 0,AdNeutralGier = 0; |
+volatile int Mittelwert_AccNick, Mittelwert_AccRoll,Mittelwert_AccHoch, NeutralAccX=0, NeutralAccY=0; |
+volatile float NeutralAccZ = 0; |
+unsigned char CosinusNickWinkel = 0, CosinusRollWinkel = 0; |
+volatile long IntegralNick = 0,IntegralNick2 = 0; |
+volatile long IntegralRoll = 0,IntegralRoll2 = 0; |
+volatile long Integral_Gier = 0; |
+volatile long Mess_IntegralNick = 0,Mess_IntegralNick2 = 0; |
+volatile long Mess_IntegralRoll = 0,Mess_IntegralRoll2 = 0; |
+volatile long Mess_Integral_Gier = 0,Mess_Integral_Gier2 = 0; |
+volatile long Mess_Integral_Hoch = 0; |
+volatile int KompassValue = 0; |
+volatile int KompassStartwert = 0; |
+volatile int KompassRichtung = 0; |
+unsigned char MAX_GAS,MIN_GAS; |
+unsigned char Notlandung = 0; |
+unsigned char HoehenReglerAktiv = 0; |
+ |
+unsigned char blinkcount_LED1 = 0;//Hilfszähler für die blinkende LED (310807Kr) |
+unsigned int modell_fliegt_gps = 0;//(030907Kr) |
+unsigned char Limit_D_Anteil = 0;//(210907Kr) |
+ |
+float GyroFaktor; |
+float IntegralFaktor; |
+ |
+volatile int DiffNick,DiffRoll; |
+int Poti1 = 0, Poti2 = 0, Poti3 = 0, Poti4 = 0, Poti5 = 0, Poti6 = 0, Poti7 = 0, Poti8 = 0; //PPM24-Erweiterung (121007Kr) |
+volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
+unsigned char MotorWert[5]; |
+volatile unsigned char SenderOkay = 0; |
+int StickNick = 0,StickRoll = 0,StickGier = 0; |
+char MotorenEin = 0; |
+int HoehenWert = 0; |
+int SollHoehe = 0; |
+unsigned char Looping_Nick = 0,Looping_Roll = 0; |
+ |
+float Kp = FAKTOR_P; |
+float Ki = FAKTOR_I; |
+ |
+unsigned char Parameter_Luftdruck_D = 48; // Wert : 0-250 |
+unsigned char Parameter_MaxHoehe = 251; // Wert : 0-250 |
+unsigned char Parameter_Hoehe_P = 16; // Wert : 0-32 |
+unsigned char Parameter_Hoehe_ACC_Wirkung = 58; // Wert : 0-250 |
+unsigned char Parameter_KompassWirkung = 64; // Wert : 0-250 |
+unsigned char Parameter_Gyro_P = 150; // Wert : 10-250 |
+unsigned char Parameter_Gyro_I = 150; // Wert : 0-250 |
+unsigned char Parameter_Gier_P = 2; // Wert : 1-20 |
+unsigned char Parameter_I_Faktor = 10; // Wert : 1-20 |
+unsigned char Parameter_UserParam1 = 0; |
+unsigned char Parameter_UserParam2 = 0; |
+unsigned char Parameter_UserParam3 = 0; |
+unsigned char Parameter_UserParam4 = 0; |
+unsigned char Parameter_ServoNickControl = 100; |
+unsigned char Parameter_LoopGasLimit = 70; |
+struct mk_param_struct EE_Parameter; |
+ |
+void Piep(unsigned char Anzahl) |
+{ |
+ while(Anzahl--) |
+ { |
+ if(MotorenEin) return; //auf keinen Fall im Flug! |
+ beeptime = 100; |
+ Delay_ms(250); |
+ } |
+} |
+ |
+//############################################################################ |
+// Nullwerte ermitteln |
+void SetNeutral(void) |
+//############################################################################ |
+{ |
+ unsigned int timer; |
+ NeutralAccX = 0; |
+ NeutralAccY = 0; |
+ NeutralAccZ = 0; |
+ AdNeutralNick = 0; |
+ AdNeutralRoll = 0; |
+ AdNeutralGier = 0; |
+ CalibrierMittelwert(); |
+ timer = SetDelay(5); |
+ while (!CheckDelay(timer)); |
+ CalibrierMittelwert(); |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
+ { |
+ if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset(); |
+ } |
+ |
+ if(PlatinenVersion == 10) |
+ { |
+ AdNeutralNick= abs(MesswertNick); |
+ AdNeutralRoll= abs(MesswertRoll); |
+ AdNeutralGier= abs(MesswertGier); |
+ } |
+ else |
+ { |
+ AdNeutralNick= abs(MesswertNick) / 2; |
+ AdNeutralRoll= abs(MesswertRoll) / 2; |
+ AdNeutralGier= abs(MesswertGier) / 2; |
+ } |
+ NeutralAccY = abs(Mittelwert_AccRoll) / ACC_AMPLIFY; |
+ NeutralAccX = abs(Mittelwert_AccNick) / ACC_AMPLIFY; |
+ NeutralAccZ = Aktuell_az; |
+ |
+ Mess_IntegralNick = 0; |
+ Mess_IntegralNick2 = 0; |
+ Mess_IntegralRoll = 0; |
+ Mess_IntegralRoll2 = 0; |
+ Mess_Integral_Gier = 0; |
+ MesswertNick = 0; |
+ MesswertRoll = 0; |
+ MesswertGier = 0; |
+ StartLuftdruck = Luftdruck; |
+ HoeheD = 0; |
+ Mess_Integral_Hoch = 0; |
+ KompassStartwert = KompassValue; |
+ beeptime = 50; |
+} |
+ |
+//############################################################################ |
+// Bildet den Mittelwert aus den Messwerten |
+void Mittelwert(void) |
+//############################################################################ |
+{ |
+ // ADC auschalten, damit die Werte sich nicht während der Berechnung ändern |
+ ANALOG_OFF; |
+ if(MessanzahlNick) (MesswertNick = AccumulateNick / MessanzahlNick); |
+ if(MessanzahlRoll) (MesswertRoll = AccumulateRoll / MessanzahlRoll); |
+ if(MessanzahlGier) (MesswertGier = AccumulateGier / MessanzahlGier); |
+ if(messanzahl_AccNick) Mittelwert_AccNick = ((long)Mittelwert_AccNick * 7 + ((ACC_AMPLIFY * (long)accumulate_AccNick) / messanzahl_AccNick)) / 8L; |
+ if(messanzahl_AccRoll) Mittelwert_AccRoll = ((long)Mittelwert_AccRoll * 7 + ((ACC_AMPLIFY * (long)accumulate_AccRoll) / messanzahl_AccRoll)) / 8L; |
+ if(messanzahl_AccHoch) Mittelwert_AccHoch = ((long)Mittelwert_AccHoch * 7 + ((long)accumulate_AccHoch) / messanzahl_AccHoch) / 8L; |
+ AccumulateNick = 0; MessanzahlNick = 0; |
+ AccumulateRoll = 0; MessanzahlRoll = 0; |
+ AccumulateGier = 0; MessanzahlGier = 0; |
+ accumulate_AccRoll = 0;messanzahl_AccRoll = 0; |
+ accumulate_AccNick = 0;messanzahl_AccNick = 0; |
+ accumulate_AccHoch = 0;messanzahl_AccHoch = 0; |
+ Integral_Gier = Mess_Integral_Gier; |
+ // Integral_Gier2 = Mess_Integral_Gier2; |
+ IntegralNick = Mess_IntegralNick; |
+ IntegralRoll = Mess_IntegralRoll; |
+ IntegralNick2 = Mess_IntegralNick2; |
+ IntegralRoll2 = Mess_IntegralRoll2; |
+ // ADC einschalten |
+ ANALOG_ON; |
+ |
+/* |
+//------------------------------------------------------------------------------ |
+ if(MesswertNick > 200) MesswertNick += 4 * (MesswertNick - 200); |
+ else |
+ if(MesswertNick < -200) MesswertNick += 4 * (MesswertNick + 200); |
+ if(MesswertRoll > 200) MesswertRoll += 4 * (MesswertRoll - 200); |
+ else |
+ if(MesswertRoll < -200) MesswertRoll += 4 * (MesswertRoll + 200); |
+//------------------------------------------------------------------------------ |
+*/ |
+ if(Poti1 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110) Poti1++; else if(Poti1 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110 && Poti1) Poti1--; |
+ if(Poti2 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110) Poti2++; else if(Poti2 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110 && Poti2) Poti2--; |
+ if(Poti3 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110) Poti3++; else if(Poti3 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110 && Poti3) Poti3--; |
+ if(Poti4 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110) Poti4++; else if(Poti4 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110 && Poti4) Poti4--; |
+ //PPM24-Erweiterung (121007Kr) |
+ if(Poti5 < PPM_in[9] + 110) Poti5++; else if(Poti5 > PPM_in[9] + 110 && Poti5) Poti5--; |
+ if(Poti6 < PPM_in[10] + 110) Poti6++; else if(Poti6 > PPM_in[10] + 110 && Poti6) Poti6--; |
+ if(Poti7 < PPM_in[11] + 110) Poti7++; else if(Poti7 > PPM_in[11] + 110 && Poti7) Poti7--; |
+ if(Poti8 < PPM_in[12] + 110) Poti8++; else if(Poti8 > PPM_in[12] + 110 && Poti8) Poti8--; |
+ |
+ |
+ if(Poti1 < 0) Poti1 = 0; else if(Poti1 > 255) Poti1 = 255; |
+ if(Poti2 < 0) Poti2 = 0; else if(Poti2 > 255) Poti2 = 255; |
+ if(Poti3 < 0) Poti3 = 0; else if(Poti3 > 255) Poti3 = 255; |
+ if(Poti4 < 0) Poti4 = 0; else if(Poti4 > 255) Poti4 = 255; |
+ //PPM24-Erweiterung (121007Kr) |
+ if(Poti5 < 0) Poti5 = 0; else if(Poti5 > 255) Poti5 = 255; |
+ if(Poti6 < 0) Poti6 = 0; else if(Poti6 > 255) Poti6 = 255; |
+ if(Poti7 < 0) Poti7 = 0; else if(Poti7 > 255) Poti7 = 255; |
+ if(Poti8 < 0) Poti8 = 0; else if(Poti8 > 255) Poti8 = 255; |
+} |
+ |
+//############################################################################ |
+// Messwerte beim Ermitteln der Nullage |
+void CalibrierMittelwert(void) |
+//############################################################################ |
+{ |
+ // ADC auschalten, damit die Werte sich nicht während der Berechnung ändern |
+ ANALOG_OFF; |
+ if(MessanzahlNick) (MesswertNick = AccumulateNick / MessanzahlNick); |
+ if(MessanzahlRoll) (MesswertRoll = AccumulateRoll / MessanzahlRoll); |
+ if(MessanzahlGier) (MesswertGier = AccumulateGier / MessanzahlGier); |
+ if(messanzahl_AccNick) Mittelwert_AccNick = ((ACC_AMPLIFY * (long)accumulate_AccNick) / messanzahl_AccNick); |
+ if(messanzahl_AccRoll) Mittelwert_AccRoll = (ACC_AMPLIFY * (long)accumulate_AccRoll) / messanzahl_AccRoll; |
+ if(messanzahl_AccHoch) Mittelwert_AccHoch = ((long)accumulate_AccHoch) / messanzahl_AccHoch; |
+ AccumulateNick = 0; MessanzahlNick = 0; |
+ AccumulateRoll = 0; MessanzahlRoll = 0; |
+ AccumulateGier = 0; MessanzahlGier = 0; |
+ accumulate_AccRoll = 0;messanzahl_AccRoll = 0; |
+ accumulate_AccNick = 0;messanzahl_AccNick = 0; |
+ accumulate_AccHoch = 0;messanzahl_AccHoch = 0; |
+ // ADC einschalten |
+ ANALOG_ON; |
+ if(Poti1 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110) Poti1++; else if(Poti1 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110 && Poti1) Poti1--; |
+ if(Poti2 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110) Poti2++; else if(Poti2 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110 && Poti2) Poti2--; |
+ if(Poti3 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110) Poti3++; else if(Poti3 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110 && Poti3) Poti3--; |
+ if(Poti4 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110) Poti4++; else if(Poti4 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110 && Poti4) Poti4--; |
+ //PPM24-Erweiterung (121007Kr) |
+ if(Poti5 < PPM_in[9] + 110) Poti5++; else if(Poti5 > PPM_in[9] + 110 && Poti5) Poti5--; |
+ if(Poti6 < PPM_in[10] + 110) Poti6++; else if(Poti6 > PPM_in[10] + 110 && Poti6) Poti6--; |
+ if(Poti7 < PPM_in[11] + 110) Poti7++; else if(Poti7 > PPM_in[11] + 110 && Poti7) Poti7--; |
+ if(Poti8 < PPM_in[12] + 110) Poti8++; else if(Poti8 > PPM_in[12] + 110 && Poti8) Poti8--; |
+ |
+ |
+ |
+ |
+ if(Poti1 < 0) Poti1 = 0; else if(Poti1 > 255) Poti1 = 255; |
+ if(Poti2 < 0) Poti2 = 0; else if(Poti2 > 255) Poti2 = 255; |
+ if(Poti3 < 0) Poti3 = 0; else if(Poti3 > 255) Poti3 = 255; |
+ if(Poti4 < 0) Poti4 = 0; else if(Poti4 > 255) Poti4 = 255; |
+ //PPM24-Erweiterung (121007Kr) |
+ if(Poti5 < 0) Poti5 = 0; else if(Poti5 > 255) Poti5 = 255; |
+ if(Poti6 < 0) Poti6 = 0; else if(Poti6 > 255) Poti6 = 255; |
+ if(Poti7 < 0) Poti7 = 0; else if(Poti7 > 255) Poti7 = 255; |
+ if(Poti8 < 0) Poti8 = 0; else if(Poti8 > 255) Poti8 = 255; |
+} |
+ |
+//############################################################################ |
+// Senden der Motorwerte per I2C-Bus |
+void SendMotorData(void) |
+//############################################################################ |
+{ |
+ if(MOTOR_OFF || !MotorenEin) |
+ { |
+ Motor_Hinten = 0; |
+ Motor_Vorne = 0; |
+ Motor_Rechts = 0; |
+ Motor_Links = 0; |
+ if(MotorTest[0]) Motor_Vorne = MotorTest[0]; |
+ if(MotorTest[1]) Motor_Hinten = MotorTest[1]; |
+ if(MotorTest[2]) Motor_Links = MotorTest[2]; |
+ if(MotorTest[3]) Motor_Rechts = MotorTest[3]; |
+ } |
+ |
+ // DebugOut.Analog[12] = Motor_Vorne; |
+ // DebugOut.Analog[13] = Motor_Hinten; |
+ // DebugOut.Analog[14] = Motor_Links; |
+ // DebugOut.Analog[15] = Motor_Rechts; |
+ |
+ // DebugOut.Analog[12] = motor_rx[0]; //Motorstrom vorne |
+ // DebugOut.Analog[13] = motor_rx[1]; //Motorstrom hinten |
+ // DebugOut.Analog[14] = motor_rx[2]; //Motorstrom links |
+ // DebugOut.Analog[15] = motor_rx[3]; //Motorstrom rechts |
+ |
+ |
+ //Start I2C Interrupt Mode |
+ twi_state = 0; |
+ motor = 0; |
+ i2c_start(); |
+} |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Konstanten |
+// + 0-250 -> normale Werte |
+// + 251 -> Poti1 |
+// + 252 -> Poti2 |
+// + 253 -> Poti3 |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+void DefaultKonstanten1(void) |
+{ |
+ EE_Parameter.Kanalbelegung[K_NICK] = 3; |
+ EE_Parameter.Kanalbelegung[K_ROLL] = 2; |
+ EE_Parameter.Kanalbelegung[K_GAS] = 1; |
+ EE_Parameter.Kanalbelegung[K_GIER] = 4; |
+ EE_Parameter.Kanalbelegung[K_POTI1] = 5; |
+ EE_Parameter.Kanalbelegung[K_POTI2] = 6; |
+ EE_Parameter.Kanalbelegung[K_POTI3] = 7; |
+ EE_Parameter.Kanalbelegung[K_POTI4] = 8; |
+ EE_Parameter.GlobalConfig = 0;//CFG_HOEHENREGELUNG | /*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV | CFG_KOMPASS_FIX;//0x01; |
+ EE_Parameter.Hoehe_MinGas = 30; |
+ EE_Parameter.MaxHoehe = 251; // Wert : 0-32 251 -> Poti1 |
+ EE_Parameter.Hoehe_P = 10; // Wert : 0-32 |
+ EE_Parameter.Luftdruck_D = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_ACC_Wirkung = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_Verstaerkung = 4; // Wert : 0-50 |
+ EE_Parameter.Stick_P = 4; //2 // Wert : 1-6 |
+ EE_Parameter.Stick_D = 8; //8 // Wert : 0-64 |
+ EE_Parameter.Gier_P = 16; // Wert : 1-20 |
+ EE_Parameter.Gas_Min = 5; // Wert : 0-32 // (160607Kr) |
+ EE_Parameter.Gas_Max = 250; // Wert : 33-250 |
+ EE_Parameter.GyroAccFaktor = 26; // Wert : 1-64 |
+ EE_Parameter.KompassWirkung = 128; // Wert : 0-250 |
+ EE_Parameter.Gyro_P = 120; //80 // Wert : 0-250 |
+ EE_Parameter.Gyro_I = 150; // Wert : 0-250 |
+ EE_Parameter.UnterspannungsWarnung = 95; // Wert : 0-250 // (160607Kr) |
+ EE_Parameter.NotGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
+ EE_Parameter.NotGasZeit = 20; // Wert : 0-250 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen |
+ EE_Parameter.UfoAusrichtung = 0; // X oder + Formation |
+ EE_Parameter.I_Faktor = 0; |
+ EE_Parameter.UserParam1 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam2 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam3 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam4 = 0; //zur freien Verwendung |
+ EE_Parameter.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
+ EE_Parameter.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickRefresh = 5; |
+ EE_Parameter.LoopGasLimit = 50; |
+ EE_Parameter.LoopThreshold = 90; // Wert: 0-250 Schwelle für Stickausschlag |
+ EE_Parameter.LoopConfig = 0; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
+ memcpy(EE_Parameter.Name, "Sport\0", 12); |
+} |
+ |
+void DefaultKonstanten2(void) |
+{ |
+ EE_Parameter.Kanalbelegung[K_NICK] = 3; |
+ EE_Parameter.Kanalbelegung[K_ROLL] = 2; |
+ EE_Parameter.Kanalbelegung[K_GAS] = 1; |
+ EE_Parameter.Kanalbelegung[K_GIER] = 4; |
+ EE_Parameter.Kanalbelegung[K_POTI1] = 5; |
+ EE_Parameter.Kanalbelegung[K_POTI2] = 6; |
+ EE_Parameter.Kanalbelegung[K_POTI3] = 7; |
+ EE_Parameter.Kanalbelegung[K_POTI4] = 8; |
+ EE_Parameter.GlobalConfig = 0;//CFG_HOEHENREGELUNG | /*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV;//0x01; |
+ EE_Parameter.Hoehe_MinGas = 30; |
+ EE_Parameter.MaxHoehe = 251; // Wert : 0-32 251 -> Poti1 |
+ EE_Parameter.Hoehe_P = 10; // Wert : 0-32 |
+ EE_Parameter.Luftdruck_D = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_ACC_Wirkung = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_Verstaerkung = 2; // Wert : 0-50 |
+ EE_Parameter.Stick_P = 4; //2 // Wert : 1-6 |
+ EE_Parameter.Stick_D = 0; //8 // Wert : 0-64 |
+ EE_Parameter.Gier_P = 16; // Wert : 1-20 |
+ EE_Parameter.Gas_Min = 5; // Wert : 0-32 // (160607Kr) |
+ EE_Parameter.Gas_Max = 250; // Wert : 33-250 |
+ EE_Parameter.GyroAccFaktor = 26; // Wert : 1-64 |
+ EE_Parameter.KompassWirkung = 128; // Wert : 0-250 |
+ EE_Parameter.Gyro_P = 175; //80 // Wert : 0-250 |
+ EE_Parameter.Gyro_I = 175; // Wert : 0-250 |
+ EE_Parameter.UnterspannungsWarnung = 95; // Wert : 0-250 // (160607Kr) |
+ EE_Parameter.NotGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
+ EE_Parameter.NotGasZeit = 20; // Wert : 0-250 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen |
+ EE_Parameter.UfoAusrichtung = 0; // X oder + Formation |
+ EE_Parameter.I_Faktor = 0; |
+ EE_Parameter.UserParam1 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam2 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam3 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam4 = 0; //zur freien Verwendung |
+ EE_Parameter.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
+ EE_Parameter.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickRefresh = 5; |
+ EE_Parameter.LoopGasLimit = 50; |
+ EE_Parameter.LoopThreshold = 90; // Wert: 0-250 Schwelle für Stickausschlag |
+ EE_Parameter.LoopConfig = 0; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts |
+ memcpy(EE_Parameter.Name, "Kamera\0", 12); |
+} |
+ |
+ |
+//############################################################################ |
+// Trägt ggf. das Poti als Parameter ein |
+void ParameterZuordnung(void) |
+//############################################################################ |
+{ |
+ |
+ #define CHK_POTI(b,a,min,max) { if(a > 250) { if(a == 251) b = Poti1; else if(a == 252) b = Poti2; else if(a == 253) b = Poti3; else if(a == 254) b = Poti4;} else b = a; if(b <= min) b = min; else if(b >= max) b = max;} |
+ CHK_POTI(Parameter_MaxHoehe,EE_Parameter.MaxHoehe,0,255); |
+ CHK_POTI(Parameter_Luftdruck_D,EE_Parameter.Luftdruck_D,0,100); |
+ CHK_POTI(Parameter_Hoehe_P,EE_Parameter.Hoehe_P,0,100); |
+ CHK_POTI(Parameter_Hoehe_ACC_Wirkung,EE_Parameter.Hoehe_ACC_Wirkung,0,255); |
+ CHK_POTI(Parameter_KompassWirkung,EE_Parameter.KompassWirkung,0,255); |
+ CHK_POTI(Parameter_Gyro_P,EE_Parameter.Gyro_P,10,255); |
+ CHK_POTI(Parameter_Gyro_I,EE_Parameter.Gyro_I,0,255); |
+ CHK_POTI(Parameter_I_Faktor,EE_Parameter.I_Faktor,0,255); |
+ CHK_POTI(Parameter_UserParam1,EE_Parameter.UserParam1,0,255); |
+ CHK_POTI(Parameter_UserParam2,EE_Parameter.UserParam2,0,255); |
+ CHK_POTI(Parameter_UserParam3,EE_Parameter.UserParam3,0,255); |
+ CHK_POTI(Parameter_UserParam4,EE_Parameter.UserParam4,0,255); |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ CHK_POTI(Parameter_LoopGasLimit,EE_Parameter.LoopGasLimit,0,255); |
+ |
+ Ki = (float) Parameter_I_Faktor * 0.0001; |
+ MAX_GAS = EE_Parameter.Gas_Max; |
+ MIN_GAS = EE_Parameter.Gas_Min; |
+} |
+ |
+ |
+//############################################################################ |
+// |
+void MotorRegler(void) |
+//############################################################################ |
+{ |
+ int motorwert,pd_ergebnis,h,tmp_int; |
+ int GierMischanteil,GasMischanteil; |
+ static long SummeNick=0,SummeRoll=0; |
+ static long sollGier = 0,tmp_long,tmp_long2; |
+ long IntegralFehlerNick = 0; |
+ long IntegralFehlerRoll = 0; |
+ static unsigned int RcLostTimer; |
+ static unsigned char delay_neutral = 0; |
+ static unsigned char delay_einschalten = 0,delay_ausschalten = 0; |
+ static unsigned int modell_fliegt = 0; |
+ static int hoehenregler = 0; |
+ static char TimerWerteausgabe = 0; |
+ static char NeueKompassRichtungMerken = 0; |
+ Mittelwert(); |
+ |
+ GRN_ON; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gaswert ermitteln |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ GasMischanteil = PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] + 120; |
+ if(GasMischanteil < 0) GasMischanteil = 0; |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Emfang schlecht |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(SenderOkay < 100) |
+ { |
+ if(!PcZugriff) |
+ { |
+ if(BeepMuster == 0xffff) |
+ { |
+ beeptime = 15000; |
+ BeepMuster = 0x0c00; |
+ } |
+ } |
+ if(RcLostTimer) RcLostTimer--; |
+ else |
+ { |
+ MotorenEin = 0; |
+ Notlandung = 0; |
+ } |
+ ROT_ON; |
+ if(modell_fliegt > 2000) // wahrscheinlich in der Luft --> langsam absenken |
+ { |
+ GasMischanteil = EE_Parameter.NotGas; |
+ Notlandung = 1; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] = 0; |
+ } |
+ else MotorenEin = 0; |
+ } |
+ else |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Emfang gut |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(SenderOkay > 140) |
+ { |
+ Notlandung = 0; |
+ RcLostTimer = EE_Parameter.NotGasZeit * 50; |
+ if(GasMischanteil > 40) |
+ { |
+ if(modell_fliegt < 0xffff) modell_fliegt++; |
+ modell_fliegt_gps = modell_fliegt;// (030907Kr) |
+ } |
+ if((modell_fliegt < 200) || (GasMischanteil < 40)) |
+ { |
+ SummeNick = 0; |
+ SummeRoll = 0; |
+ Mess_Integral_Gier = 0; |
+ Mess_Integral_Gier2 = 0; |
+ } |
+ if((GasMischanteil > 200) && MotorenEin == 0) |
+ { |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// auf Nullwerte kalibrieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) // Neutralwerte |
+ { |
+ unsigned char setting; |
+ if(++delay_neutral > 200) // nicht sofort |
+ { |
+ GRN_OFF; |
+ MotorenEin = 0; |
+ delay_neutral = 0; |
+ modell_fliegt = 0; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70 || abs(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]) > 70) |
+ { |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < 70) setting = 1; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 2; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] < 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 3; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] <-70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 4; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] <-70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < 70) setting = 5; |
+ eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], setting); // aktiven Datensatz merken |
+ } |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
+ { |
+ if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset(); |
+ } |
+ ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
+ SetNeutral(); |
+ Piep(GetActiveParamSetNumber()); |
+ } |
+ } |
+ else delay_neutral = 0; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gas ist unten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(GasMischanteil < 35) |
+ { |
+ // Starten |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] < -75) |
+ { |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Einschalten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(++delay_einschalten > 200) |
+ { |
+ delay_einschalten = 200; |
+ modell_fliegt = 1; |
+ MotorenEin = 1; |
+ sollGier = 0; |
+ Mess_Integral_Gier = 0; |
+ Mess_Integral_Gier2 = 0; |
+ Mess_IntegralNick = 0; |
+ Mess_IntegralRoll = 0; |
+ Mess_IntegralNick2 = IntegralNick; |
+ Mess_IntegralRoll2 = IntegralRoll; |
+ SummeNick = 0; |
+ SummeRoll = 0; |
+ } |
+ } |
+ else delay_einschalten = 0; |
+ //Auf Neutralwerte setzen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Auschalten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) |
+ { |
+ if(++delay_ausschalten > 200) // nicht sofort |
+ { |
+ MotorenEin = 0; |
+ delay_ausschalten = 200; |
+ modell_fliegt = 0; |
+ } |
+ } |
+ else delay_ausschalten = 0; |
+ } |
+ } |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// neue Werte von der Funke |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(!NewPpmData-- || Notlandung) |
+ { |
+ ParameterZuordnung(); |
+ StickNick = PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_P; |
+ StickNick += PPM_diff[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_D; |
+ StickRoll = PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_P; |
+ StickRoll += PPM_diff[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_D; |
+ StickGier = -PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]; |
+ GyroFaktor = ((float)Parameter_Gyro_P + 10.0) / 256.0; |
+ IntegralFaktor = ((float) Parameter_Gyro_I) / 44000; |
+ |
+ if(EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) IntegralFaktor = 0; |
+ if(GyroFaktor < 0) GyroFaktor = 0; |
+ if(IntegralFaktor < 0) IntegralFaktor = 0; |
+ // greift in den Stick ein, um ungewolltes überschlagen zu verhindern |
+ if(!(EE_Parameter.LoopConfig & CFG_LOOP_LINKS) && !(EE_Parameter.LoopConfig & CFG_LOOP_RECHTS)) |
+ { |
+ if(IntegralNick > 60000) |
+ { |
+ StickNick -= 8 * EE_Parameter.Stick_P; |
+ if(IntegralNick > 80000) StickNick -= 16 * EE_Parameter.Stick_P; |
+ } |
+ else |
+ if(IntegralNick < -60000) |
+ { |
+ StickNick += 8 * EE_Parameter.Stick_P; |
+ if(IntegralNick > 80000) StickNick -= 16 * EE_Parameter.Stick_P; |
+ } |
+ if(IntegralRoll > 60000) |
+ { |
+ StickRoll -= 8 * EE_Parameter.Stick_P; |
+ if(IntegralRoll > 80000) StickRoll -= 16 * EE_Parameter.Stick_P; |
+ } |
+ else |
+ if(IntegralRoll < -60000) |
+ { |
+ StickRoll += 8 * EE_Parameter.Stick_P; |
+ if(IntegralRoll > 80000) StickRoll -= 16 * EE_Parameter.Stick_P; |
+ } |
+ } |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// LED Stuff |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+LED1_OFF; |
+ |
+ if(blinkcount_LED1 >= Parameter_UserParam4 && Parameter_UserParam4 > 0) |
+ { |
+ LED1_FLASH; |
+ blinkcount_LED1 = 0; |
+ } |
+ |
+ blinkcount_LED1++; |
+ |
+ //if(PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] > 75) LED1_ON; else LED1_OFF; //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
+ //if(PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] > 75) LED2_ON; else LED2_OFF; //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
+ } |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Looping? |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(((PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > EE_Parameter.LoopThreshold) && EE_Parameter.LoopConfig & CFG_LOOP_LINKS) || |
+ ((PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] < -EE_Parameter.LoopThreshold) && EE_Parameter.LoopConfig & CFG_LOOP_RECHTS)) |
+ { |
+ Looping_Roll = 1; |
+ if(GasMischanteil > EE_Parameter.LoopGasLimit) GasMischanteil = EE_Parameter.LoopGasLimit; |
+ } |
+ else Looping_Roll = 0; |
+ |
+ if(((PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > EE_Parameter.LoopThreshold) && EE_Parameter.LoopConfig & CFG_LOOP_OBEN) || |
+ ((PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < -EE_Parameter.LoopThreshold) && EE_Parameter.LoopConfig & CFG_LOOP_UNTEN)) |
+ { |
+ Looping_Nick = 1; |
+ Looping_Roll = 0; |
+ if(GasMischanteil > EE_Parameter.LoopGasLimit) GasMischanteil = EE_Parameter.LoopGasLimit; |
+ } |
+ else Looping_Nick = 0; |
+ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Bei Empfangsausfall im Flug |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(Notlandung) |
+ { |
+ StickGier = 0; |
+ StickNick = 0; |
+ StickRoll = 0; |
+ GyroFaktor = 0.1; |
+ IntegralFaktor = 0.005; |
+ Looping_Roll = 0; |
+ Looping_Nick = 0; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gyro-Drift kompensieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define DRIFT_FAKTOR 3 |
+ if(ZaehlMessungen >= 1000 / DRIFT_FAKTOR) |
+ { |
+ IntegralFehlerNick = IntegralNick2 - IntegralNick; |
+ IntegralFehlerRoll = IntegralRoll2 - IntegralRoll; |
+ ZaehlMessungen = 0; |
+ if(IntegralFehlerNick > 500/DRIFT_FAKTOR) AdNeutralNick++; |
+ if(IntegralFehlerNick < -500/DRIFT_FAKTOR) AdNeutralNick--; |
+ if(IntegralFehlerRoll > 500/DRIFT_FAKTOR) AdNeutralRoll++; |
+ if(IntegralFehlerRoll < -500/DRIFT_FAKTOR) AdNeutralRoll--; |
+// if(Mess_Integral_Gier2 > 500/DRIFT_FAKTOR) AdNeutralGier--; // macht nur mit Referenz (Kompass Sinn) |
+// if(Mess_Integral_Gier2 <-500/DRIFT_FAKTOR) AdNeutralGier++; // macht nur mit Referenz (Kompass Sinn) |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_IntegralNick2 = IntegralNick; |
+ Mess_IntegralRoll2 = IntegralRoll; |
+ Mess_Integral_Gier2 = Integral_Gier; |
+ ANALOG_ON; // ADC einschalten |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Integrale auf ACC-Signal abgleichen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+ |
+ if(EE_Parameter.GlobalConfig & CFG_GPS_AKTIV) |
+ { |
+ tmp_long = (long)(IntegralNick / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccNick) / 16; |
+ tmp_long2 = (long)(IntegralRoll / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccRoll) / 16; |
+ #define AUSGLEICH 500 |
+ if(tmp_long > AUSGLEICH) tmp_long = AUSGLEICH; |
+ if(tmp_long < -AUSGLEICH) tmp_long =-AUSGLEICH; |
+ if(tmp_long2 > AUSGLEICH) tmp_long2 = AUSGLEICH; |
+ if(tmp_long2 <-AUSGLEICH) tmp_long2 =-AUSGLEICH; |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_IntegralNick -= tmp_long; |
+ Mess_IntegralRoll -= tmp_long2; |
+ } |
+ |
+ else |
+ { |
+ if(IntegralFaktor && !Looping_Nick && !Looping_Roll) |
+ { |
+ tmp_long = (long)(IntegralNick / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccNick); |
+ if(labs(Mittelwert_AccNick) < 200) tmp_long /= 8; |
+ else tmp_long /= 16; |
+ tmp_long2 = (long)(IntegralRoll / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccRoll); |
+ if(labs(Mittelwert_AccRoll) < 200) tmp_long2 /= 8; |
+ else tmp_long2 /= 16; |
+ |
+ #define AUSGLEICH 500 |
+ if(tmp_long > AUSGLEICH) tmp_long = AUSGLEICH; |
+ if(tmp_long < -AUSGLEICH) tmp_long =-AUSGLEICH; |
+ if(tmp_long2 > AUSGLEICH) tmp_long2 = AUSGLEICH; |
+ if(tmp_long2 <-AUSGLEICH) tmp_long2 =-AUSGLEICH; |
+ } |
+ |
+ else |
+ { |
+ tmp_long = 0; |
+ tmp_long2 = 0; |
+ } |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_IntegralNick -= tmp_long; |
+ Mess_IntegralRoll -= tmp_long2; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(abs(StickGier) > 20) // war 35 |
+ { |
+ if(!(EE_Parameter.GlobalConfig & CFG_KOMPASS_FIX)) NeueKompassRichtungMerken = 1; |
+ } |
+ tmp_int = EE_Parameter.Gier_P * (StickGier * abs(StickGier)) / 512; // expo y = ax + bx² |
+ tmp_int += (EE_Parameter.Gier_P * StickGier) / 4; |
+ sollGier = tmp_int; |
+ Mess_Integral_Gier -= tmp_int; |
+ if(Mess_Integral_Gier > 25000) Mess_Integral_Gier = 25000; // begrenzen |
+ if(Mess_Integral_Gier <-25000) Mess_Integral_Gier =-25000; |
+ |
+ ANALOG_ON; // ADC einschalten |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Kompass |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+ if(KompassValue && (EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV)) |
+ { |
+ if(NeueKompassRichtungMerken) |
+ { |
+ KompassStartwert = KompassValue; |
+ NeueKompassRichtungMerken = 0; |
+ } |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_Integral_Gier -= (KompassRichtung * Parameter_KompassWirkung) / 32; // nach Kompass ausrichten |
+ ANALOG_ON; // ADC einschalten |
+ } |
+ |
+ |
+// if(KompassValue && (EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV)) |
+// { |
+// int w,v; |
+// static int SignalSchlecht = 0; |
+// w = abs(IntegralNick /512); // mit zunehmender Neigung den Einfluss drosseln |
+// v = abs(IntegralRoll /512); |
+// if(v > w) w = v; // grösste Neigung ermitteln |
+// if(w < 25 && NeueKompassRichtungMerken && !SignalSchlecht) |
+// { |
+// KompassStartwert = KompassValue; |
+// NeueKompassRichtungMerken = 0; |
+// } |
+// w = (w * Parameter_KompassWirkung) / 64; // auf die Wirkung normieren |
+// w = Parameter_KompassWirkung - w; // Wirkung ggf drosseln |
+// if(w > 0) |
+// { |
+// ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+// if(!SignalSchlecht) Mess_Integral_Gier += (KompassRichtung * w) / 32; // nach Kompass ausrichten |
+// ANALOG_ON; // ADC einschalten |
+// if(SignalSchlecht) SignalSchlecht--; |
+// } |
+// else SignalSchlecht = 500; // so lange das Signal taub stellen --> ca. 1 sek |
+// } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// GPS |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+if(EE_Parameter.GlobalConfig & CFG_GPS_AKTIV) |
+{ |
+ P_GPS_Verstaerkung = Parameter_UserParam1; |
+ D_GPS_Verstaerkung = Parameter_UserParam2; |
+ Limit_D_Anteil = Parameter_UserParam3; |
+ gps_main(); |
+} |
+else |
+{ |
+ GPS_Nick = 0; |
+ GPS_Roll = 0; |
+} |
+ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Debugwerte zuordnen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(!TimerWerteausgabe--) |
+ { |
+ TimerWerteausgabe = 49; |
+ DebugOut.Analog[0] = MM3.NickGrad; |
+ DebugOut.Analog[1] = MM3.RollGrad; |
+ DebugOut.Analog[2] = Mittelwert_AccNick; |
+ DebugOut.Analog[3] = Mittelwert_AccRoll; |
+ DebugOut.Analog[4] = MesswertGier; |
+ DebugOut.Analog[5] = HoehenWert; |
+ DebugOut.Analog[6] = (Mess_Integral_Hoch / 512); |
+ DebugOut.Analog[7] = actualPos.newData; |
+ DebugOut.Analog[8] = KompassValue; |
+ |
+//DebugOut.Analog[8] = MM3_heading(); |
+DebugOut.Analog[9] = MM3.x_axis; |
+DebugOut.Analog[10] = MM3.y_axis; |
+DebugOut.Analog[11] = MM3.z_axis; |
+ |
+ |
+// DebugOut.Analog[0] = actualPos.GPSFix; |
+// DebugOut.Analog[1] = GPS_Roll; |
+// DebugOut.Analog[2] = GPS_Nick; |
+// DebugOut.Analog[3] = GPS_Positionsabweichung_North; |
+// DebugOut.Analog[4] = GPS_Positionsabweichung_East; |
+// DebugOut.Analog[5] = P_Einfluss_East; |
+// DebugOut.Analog[6] = D_Einfluss_East; |
+// DebugOut.Analog[7] = P_Einfluss_North; |
+// DebugOut.Analog[8] = D_Einfluss_North; |
+// DebugOut.Analog[9] = Soll_Position_North; |
+// DebugOut.Analog[10] = Soll_Position_East; |
+// DebugOut.Analog[11] = Parameter_UserParam1; |
+ DebugOut.Analog[12] = GPS_Roll; |
+ DebugOut.Analog[13] = GPS_Nick; |
+ DebugOut.Analog[14] = KompassValue; |
+ DebugOut.Analog[15] = GPS_Home_North; |
+ DebugOut.Analog[16] = GPS_Home_East; |
+ DebugOut.Analog[17] = NORTH_MITTEL; |
+ DebugOut.Analog[18] = EAST_MITTEL; |
+ DebugOut.Analog[19] = actualPos.northing; |
+ DebugOut.Analog[20] = actualPos.easting; |
+ DebugOut.Analog[21] = actualPos.velNorth; |
+ DebugOut.Analog[22] = actualPos.velEast; |
+ DebugOut.Analog[23] = UBat; |
+ DebugOut.Analog[24] = (motor_rx[0]+motor_rx[1]+motor_rx[2]+motor_rx[3]); //Gesamtstrom |
+ DebugOut.Analog[25] = StickRoll; |
+ DebugOut.Analog[26] = HoehenWert; |
+ DebugOut.Analog[27] = IntegralNick / EE_Parameter.GyroAccFaktor; |
+ DebugOut.Analog[28] = IntegralRoll / EE_Parameter.GyroAccFaktor; |
+ DebugOut.Analog[29] = Mittelwert_AccNick; |
+ DebugOut.Analog[30] = Mittelwert_AccRoll; |
+ DebugOut.Analog[31] = StickNick; |
+ } |
+ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Drehgeschwindigkeit und -winkel zu einem Istwert zusammenfassen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(Looping_Nick) MesswertNick = MesswertNick * GyroFaktor; |
+ else MesswertNick = IntegralNick * IntegralFaktor + MesswertNick * GyroFaktor; |
+ if(Looping_Roll) MesswertRoll = MesswertRoll * GyroFaktor; |
+ else MesswertRoll = IntegralRoll * IntegralFaktor + MesswertRoll * GyroFaktor; |
+// MesswertGier = MesswertGier * (GyroFaktor/2) + Integral_Gier * IntegralFaktor; |
+ MesswertGier = MesswertGier * (GyroFaktor) + Integral_Gier * IntegralFaktor/2; |
+ |
+ // Maximalwerte abfangen |
+ #define MAX_SENSOR 2048 |
+ if(MesswertNick > MAX_SENSOR) MesswertNick = MAX_SENSOR; |
+ if(MesswertNick < -MAX_SENSOR) MesswertNick = -MAX_SENSOR; |
+ if(MesswertRoll > MAX_SENSOR) MesswertRoll = MAX_SENSOR; |
+ if(MesswertRoll < -MAX_SENSOR) MesswertRoll = -MAX_SENSOR; |
+ if(MesswertGier > MAX_SENSOR) MesswertGier = MAX_SENSOR; |
+ if(MesswertGier < -MAX_SENSOR) MesswertGier = -MAX_SENSOR; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Höhenregelung |
+// Die Höhenregelung schwächt lediglich das Gas ab, erhöht es allerdings nicht |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+//OCR0B = 180 - (Poti1 + 120) / 4; |
+//DruckOffsetSetting = OCR0B; |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung |
+ { |
+ int tmp_int; |
+ if(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER) // Regler wird über Schalter gesteuert |
+ { |
+ if(Parameter_MaxHoehe < 50) |
+ { |
+ SollHoehe = HoehenWert - 40; // Parameter_MaxHoehe ist der PPM-Wert des Schalters // (160607Kr) |
+ HoehenReglerAktiv = 0; |
+ } |
+ else |
+ HoehenReglerAktiv = 1; |
+ } |
+ else |
+ { |
+ SollHoehe = Parameter_MaxHoehe * EE_Parameter.Hoehe_Verstaerkung - 40; // (160607Kr) |
+ HoehenReglerAktiv = 1; |
+ } |
+ |
+ if(Notlandung) SollHoehe = 0; |
+ h = HoehenWert; |
+ if((h > SollHoehe) && HoehenReglerAktiv) // zu hoch --> drosseln |
+ { h = ((h - SollHoehe) * (int) Parameter_Hoehe_P) / 16; // Differenz bestimmen --> P-Anteil |
+ h = GasMischanteil - h; // vom Gas abziehen |
+ h -= (HoeheD * Parameter_Luftdruck_D)/8; // D-Anteil |
+ tmp_int = ((Mess_Integral_Hoch / 512) * (signed long) Parameter_Hoehe_ACC_Wirkung) / 32; |
+ if(tmp_int > 50) tmp_int = 50; |
+ else if(tmp_int < -50) tmp_int = -50; |
+ h -= tmp_int; |
+ hoehenregler = (hoehenregler*15 + h) / 16; |
+ if(hoehenregler < EE_Parameter.Hoehe_MinGas) // nicht unter MIN |
+ { |
+ if(GasMischanteil >= EE_Parameter.Hoehe_MinGas) hoehenregler = EE_Parameter.Hoehe_MinGas; |
+ if(GasMischanteil < EE_Parameter.Hoehe_MinGas) hoehenregler = GasMischanteil; |
+ } |
+ if(hoehenregler > GasMischanteil) hoehenregler = GasMischanteil; // nicht mehr als Gas |
+ GasMischanteil = hoehenregler; |
+ } |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Mischer und PI-Regler |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ // DebugOut.Analog[7] = GasMischanteil; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gier-Anteil |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define MUL_G 1.0 |
+ GierMischanteil = MesswertGier - sollGier; // Regler für Gier |
+//GierMischanteil = 0; |
+ if(GierMischanteil > (MUL_G * GasMischanteil)) GierMischanteil = MUL_G * GasMischanteil; |
+ if(GierMischanteil < -(MUL_G * GasMischanteil)) GierMischanteil = -(MUL_G * GasMischanteil); |
+ if(GierMischanteil > 100) GierMischanteil = 100; |
+ if(GierMischanteil < -100) GierMischanteil = -100; |
+ |
+ if(GasMischanteil < 20) GierMischanteil = 0; |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Nick-Achse |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+ DiffNick = Kp * (MesswertNick - (StickNick - GPS_Nick)); // Differenz bestimmen |
+ SummeNick += DiffNick; // I-Anteil |
+ if(SummeNick > 0) SummeNick-= (abs(SummeNick)/256 + 1); else SummeNick += abs(SummeNick)/256 + 1; |
+ if(SummeNick > 16000) SummeNick = 16000; |
+ if(SummeNick < -16000) SummeNick = -16000; |
+ pd_ergebnis = DiffNick;// + Ki * SummeNick; // PI-Regler für Nick |
+ // Motor Vorn |
+#define MUL 2 |
+ if(pd_ergebnis > MUL * (GasMischanteil + abs(GierMischanteil))) pd_ergebnis = MUL * (GasMischanteil + abs(GierMischanteil)); |
+ if(pd_ergebnis < -MUL * (GasMischanteil + abs(GierMischanteil))) pd_ergebnis = -MUL * (GasMischanteil + abs(GierMischanteil)); |
+ |
+ motorwert = GasMischanteil + pd_ergebnis + GierMischanteil; // Mischer |
+ if ((motorwert < 0)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Vorne = motorwert; |
+ // Motor Heck |
+ motorwert = GasMischanteil - pd_ergebnis + GierMischanteil; |
+ if ((motorwert < 0)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Hinten = motorwert; |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Roll-Achse |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ DiffRoll = Kp * (MesswertRoll - (StickRoll - GPS_Roll)); // Differenz bestimmen |
+ SummeRoll += DiffRoll; // I-Anteil |
+ if(SummeRoll > 0) SummeRoll-= (abs(SummeRoll)/256 + 1); else SummeRoll += abs(SummeRoll)/256 + 1; |
+ if(SummeRoll > 16000) SummeRoll = 16000; |
+ if(SummeRoll < -16000) SummeRoll = -16000; |
+ pd_ergebnis = DiffRoll;// + Ki * SummeRoll; // PI-Regler für Roll |
+ if(pd_ergebnis > MUL * (GasMischanteil + abs(GierMischanteil))) pd_ergebnis = MUL * (GasMischanteil + abs(GierMischanteil)); |
+ if(pd_ergebnis < -MUL * (GasMischanteil + abs(GierMischanteil))) pd_ergebnis = -MUL * (GasMischanteil + abs(GierMischanteil)); |
+ // Motor Links |
+ motorwert = GasMischanteil + pd_ergebnis - GierMischanteil; |
+ if ((motorwert < 0)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Links = motorwert; |
+ // Motor Rechts |
+ motorwert = GasMischanteil - pd_ergebnis - GierMischanteil; |
+ if ((motorwert < 0)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Rechts = motorwert; |
+ // +++++++++++++++++++++++++++++++++++++++++++++++ |
+} |
+ |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/fc.h |
---|
0,0 → 1,121 |
/*####################################################################################### |
Flight Control |
#######################################################################################*/ |
#ifndef _FC_H |
#define _FC_H |
extern volatile unsigned int I2CTimeout; |
extern unsigned char Sekunde,Minute; |
extern volatile long IntegralNick,IntegralNick2; |
extern volatile long IntegralRoll,IntegralRoll2; |
extern volatile long Mess_IntegralNick,Mess_IntegralNick2; |
extern volatile long Mess_IntegralRoll,Mess_IntegralRoll2; |
extern volatile long Mess_Integral_Hoch; |
extern volatile long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2; |
extern volatile int KompassValue; |
extern volatile int KompassStartwert; |
extern volatile int KompassRichtung; |
extern int HoehenWert; |
extern int SollHoehe; |
extern volatile int MesswertNick,MesswertRoll,MesswertGier; |
extern volatile int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll; |
extern volatile int NeutralAccX, NeutralAccY,Mittelwert_AccHoch; |
extern volatile float NeutralAccZ; |
extern unsigned int modell_fliegt_gps;//(030907Kr) |
extern unsigned char Limit_D_Anteil;//(210907Kr) |
void MotorRegler(void); |
void SendMotorData(void); |
void CalibrierMittelwert(void); |
void Mittelwert(void); |
void SetNeutral(void); |
unsigned char h,m,s; |
volatile unsigned char Timeout ; |
unsigned char CosinusNickWinkel, CosinusRollWinkel; |
volatile long IntegralNick,IntegralNick2; |
volatile long IntegralRoll,IntegralRoll2; |
volatile long Integral_Gier; |
volatile long Mess_IntegralNick,Mess_IntegralNick2; |
volatile long Mess_IntegralRoll,Mess_IntegralRoll2; |
volatile long Mess_Integral_Gier; |
volatile int DiffNick,DiffRoll; |
extern int Poti1, Poti2, Poti3, Poti4, Poti5, Poti6, Poti7, Poti8; //PPM24-Erweiterung (121007Kr) |
volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
unsigned char MotorWert[5]; |
volatile unsigned char SenderOkay; |
int StickNick,StickRoll,StickGier; |
char MotorenEin; |
extern void DefaultKonstanten(void); |
#define STRUCT_PARAM_LAENGE 58 |
struct mk_param_struct |
{ |
unsigned char Kanalbelegung[8]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3 |
unsigned char GlobalConfig; // 0x01=Höhenregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv |
unsigned char Hoehe_MinGas; // Wert : 0-100 |
unsigned char Luftdruck_D; // Wert : 0-250 |
unsigned char MaxHoehe; // Wert : 0-32 |
unsigned char Hoehe_P; // Wert : 0-32 |
unsigned char Hoehe_Verstaerkung; // Wert : 0-50 |
unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250 |
unsigned char Stick_P; // Wert : 1-6 |
unsigned char Stick_D; // Wert : 0-64 |
unsigned char Gier_P; // Wert : 1-20 |
unsigned char Gas_Min; // Wert : 0-32 |
unsigned char Gas_Max; // Wert : 33-250 |
unsigned char GyroAccFaktor; // Wert : 1-64 |
unsigned char KompassWirkung; // Wert : 0-32 |
unsigned char Gyro_P; // Wert : 10-250 |
unsigned char Gyro_I; // Wert : 0-250 |
unsigned char UnterspannungsWarnung; // Wert : 0-250 |
unsigned char NotGas; // Wert : 0-250 //Gaswert bei Empängsverlust |
unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen |
unsigned char UfoAusrichtung; // X oder + Formation |
unsigned char I_Faktor; // Wert : 0-250 |
unsigned char UserParam1; // Wert : 0-250 |
unsigned char UserParam2; // Wert : 0-250 |
unsigned char UserParam3; // Wert : 0-250 |
unsigned char UserParam4; // Wert : 0-250 |
unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos |
unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo |
unsigned char ServoNickMin; // Wert : 0-250 // Anschlag |
unsigned char ServoNickMax; // Wert : 0-250 // Anschlag |
unsigned char ServoNickRefresh; // |
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping |
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag |
//------------------------------------------------ |
unsigned char LoopConfig; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen |
unsigned char Reserved[4]; |
char Name[12]; |
}; |
/* |
unsigned char ServoNickMax; // Wert : 0-250 |
unsigned char ServoNickRefresh; // |
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping |
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag |
//------------------------------------------------ |
unsigned char LoopConfig; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen |
unsigned char Reserved[4]; |
char Name[12]; |
*/ |
extern struct mk_param_struct EE_Parameter; |
extern unsigned char Parameter_Luftdruck_D; |
extern unsigned char Parameter_MaxHoehe; |
extern unsigned char Parameter_Hoehe_P; |
extern unsigned char Parameter_Hoehe_ACC_Wirkung; |
extern unsigned char Parameter_KompassWirkung; |
extern unsigned char Parameter_Gyro_P; |
extern unsigned char Parameter_Gyro_I; |
extern unsigned char Parameter_Gier_P; |
extern unsigned char Parameter_ServoNickControl; |
#endif //_FC_H |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/flight-ctrl_mega644_v0_64.aws |
---|
0,0 → 1,0 |
<AVRWorkspace><IOSettings><CurrentRegisters/></IOSettings><part name="ATMEGA644"/><Files><File00000 Name="E:\hubi\ufo\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\alpha\v064JokoGPSNick666Acc250\main.c" Position="336 108 868 484" LineCol="155 0" State="Maximized"/><File00001 Name="E:\hubi\ufo\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\alpha\v064JokoGPSNick666Acc250\compass.c" Position="333 69 1179 567" LineCol="48 0" State="Maximized"/><File00002 Name="E:\hubi\ufo\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\alpha\v064JokoGPSNick666Acc250\compass.h" Position="347 116 893 484" LineCol="0 0" State="Maximized"/><File00003 Name="E:\hubi\ufo\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\alpha\v064JokoGPSNick666Acc250\fc.c" Position="336 71 1182 569" LineCol="879 0" State="Maximized"/></Files></AVRWorkspace> |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/flight.pnproj |
---|
0,0 → 1,0 |
<Project name="Flight-Ctrl"><File path="uart.h"></File><File path="main.c"></File><File path="main.h"></File><File path="makefile"></File><File path="uart.c"></File><File path="printf_P.h"></File><File path="printf_P.c"></File><File path="timer0.c"></File><File path="timer0.h"></File><File path="old_macros.h"></File><File path="twimaster.c"></File><File path="version.txt"></File><File path="twimaster.h"></File><File path="rc.c"></File><File path="rc.h"></File><File path="fc.h"></File><File path="fc.c"></File><File path="menu.h"></File><File path="menu.c"></File><File path="_Settings.h"></File><File path="analog.c"></File><File path="analog.h"></File><File path="GPS.c"></File><File path="gps.h"></File><File path="License.txt"></File></Project> |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/flight.pnps |
---|
0,0 → 1,0 |
<pd><ViewState><e p="Flight-Ctrl" x="true"></e></ViewState></pd> |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/gps.h |
---|
0,0 → 1,26 |
extern long P_Einfluss_North; |
extern long D_Einfluss_North; |
extern long P_Einfluss_East; |
extern long D_Einfluss_East; |
extern long GPS_Positionsabweichung_North; |
extern long GPS_Positionsabweichung_East; |
extern long GPS_Geschwindigkeit_North; |
extern long GPS_Geschwindigkeit_East; |
extern long GPS_Home_North; |
extern long GPS_Home_East; |
extern long Soll_Position_North; |
extern long Soll_Position_East; |
extern volatile long EAST_MITTEL; |
extern volatile long NORTH_MITTEL; |
extern signed int GPS_Nick; |
extern signed int GPS_Roll; |
extern void GPS_Neutral(void); |
extern void GPS_BerechneZielrichtung(void); |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/main.c |
---|
0,0 → 1,229 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + Nur für den privaten Gebrauch |
// + www.MikroKopter.com |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
// + dass eine Nutzung (auch auszugsweise) nur für den privaten und nicht-kommerziellen Gebrauch zulässig ist. |
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
// + bzgl. der Nutzungsbedingungen aufzunehmen. |
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
// + Verkauf von Luftbildaufnahmen, usw. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
// + auf anderen Webseiten oder Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
// + eindeutig als Ursprung verlinkt und genannt werden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
// + Benutzung auf eigene Gefahr |
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
// + mit unserer Zustimmung zulässig |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
// + this list of conditions and the following disclaimer. |
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
// + from this software without specific prior written permission. |
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
// + for non-commercial use (directly or indirectly) |
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
// + with our written permission |
// + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
// + clearly linked as origin |
// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
unsigned char EEPromArray[E2END+1] EEMEM; |
unsigned char PlatinenVersion = 10; |
// -- Parametersatz aus EEPROM lesen --- |
// number [0..5] |
void ReadParameterSet(unsigned char number, unsigned char *buffer, unsigned char length) |
{ |
if (number > 5) number = 5; |
eeprom_read_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * number], length); |
} |
// -- Parametersatz ins EEPROM schreiben --- |
// number [0..5] |
void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length) |
{ |
if(number > 5) number = 5; |
eeprom_write_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * number], length); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], number); // diesen Parametersatz als aktuell merken |
} |
unsigned char GetActiveParamSetNumber(void) |
{ |
unsigned char set; |
set = eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET]); |
if(set > 5) |
{ |
set = 2; |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], set); // diesen Parametersatz als aktuell merken |
} |
return(set); |
} |
//############################################################################ |
//Hauptprogramm |
int main (void) |
//############################################################################ |
{ |
unsigned int timer; |
unsigned int timer2 = 0; |
DDRB = 0x00; |
PORTB = 0x00; |
for(timer = 0; timer < 1000; timer++); // verzögern |
if(PINB & 0x01) PlatinenVersion = 11; else PlatinenVersion = 10; |
DDRC = 0x81; // SCL |
PORTC = 0xff; // Pullup SDA |
DDRB = 0x1B; // LEDs und Druckoffset |
PORTB = 0x01; // LED_Rot |
DDRD = 0x3E; // Speaker & TXD & J3 J4 J5 |
DDRD |=0x80; // J7 |
PORTD = 0xF7; // LED |
MCUSR &=~(1<<WDRF); |
WDTCSR |= (1<<WDCE)|(1<<WDE); |
WDTCSR = 0; |
beeptime = 2000; |
StickGier = 0; PPM_in[K_GAS] = 0;StickRoll = 0; StickNick = 0; |
ROT_OFF; |
Timer_Init(); |
UART_Init(); |
rc_sum_init(); |
ADC_Init(); |
i2c_init(); |
init_spi(); |
sei(); |
VersionInfo.Hauptversion = VERSION_HAUPTVERSION; |
VersionInfo.Nebenversion = VERSION_NEBENVERSION; |
VersionInfo.PCKompatibel = VERSION_KOMPATIBEL; |
printf("\n\rFlightControl\n\rHardware:%d.%d\n\rSoftware:V%d.%d ",PlatinenVersion/10,PlatinenVersion%10, VERSION_HAUPTVERSION, VERSION_NEBENVERSION); |
printf("\n\r=============================="); |
GRN_ON; |
#define EE_DATENREVISION 62 // wird angepasst, wenn sich die EEPROM-Daten geändert haben |
if(eeprom_read_byte(&EEPromArray[EEPROM_ADR_VALID]) != EE_DATENREVISION) |
{ |
printf("\n\rInit. EEPROM: Generiere Default-Parameter..."); |
DefaultKonstanten1(); |
for (unsigned char i=0;i<6;i++) |
{ |
if(i==2) DefaultKonstanten2(); |
WriteParameterSet(i, (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
} |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], 2); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_VALID], EE_DATENREVISION); |
} |
ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
printf("\n\rBenutze Parametersatz %d", GetActiveParamSetNumber()); |
if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
printf("\n\rAbgleich Luftdrucksensor.."); |
timer = SetDelay(1000); |
SucheLuftruckOffset(); |
while (!CheckDelay(timer)); |
printf("OK\n\r"); |
} |
SetNeutral(); |
ROT_OFF; |
beeptime = 2000; |
DebugIn.Analog[1] = 1000; |
DebugIn.Digital[0] = 0x55; |
printf("\n\rSteuerung: "); |
if (EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) printf("HeadingHold"); |
else printf("Neutral"); |
printf("\n\n\r"); |
LcdClear(); |
I2CTimeout = 5000; |
while (1) |
{ |
if (UpdateMotor) // ReglerIntervall |
{ |
UpdateMotor=0; |
MotorRegler(); |
SendMotorData(); |
ROT_OFF; |
if(PcZugriff) PcZugriff--; |
if(SenderOkay) SenderOkay--; |
if(!I2CTimeout) |
{ |
I2CTimeout = 5; |
i2c_reset(); |
if((BeepMuster == 0xffff) && MotorenEin) |
{ |
beeptime = 10000; |
BeepMuster = 0x0080; |
} |
} |
else |
{ |
I2CTimeout--; |
ROT_OFF; |
} |
} |
if(SIO_DEBUG) |
{ |
DatenUebertragung(); |
BearbeiteRxDaten(); |
} |
else BearbeiteRxDaten(); |
if(CheckDelay(timer)) |
{ |
if(UBat < EE_Parameter.UnterspannungsWarnung) |
{ |
if(BeepMuster == 0xffff) |
{ |
beeptime = 6000; |
BeepMuster = 0x0300; |
} |
} |
timer = SetDelay(100); |
} |
} |
return (1); |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/main.h |
---|
0,0 → 1,111 |
#ifndef _MAIN_H |
#define _MAIN_H |
//Hier die Quarz Frequenz einstellen |
#if defined (__AVR_ATmega32__) |
#define SYSCLK 20000000L //Quarz Frequenz in Hz |
#endif |
#if defined (__AVR_ATmega644__) |
#define SYSCLK 20000000L //Quarz Frequenz in Hz |
//#define SYSCLK 16000000L //Quarz Frequenz in Hz |
#endif |
// neue Hardware |
#define ROT_OFF {if(PlatinenVersion == 10) PORTB &=~0x01; else PORTB |= 0x01;} |
#define ROT_ON {if(PlatinenVersion == 10) PORTB |= 0x01; else PORTB &=~0x01;} |
#define ROT_FLASH PORTB ^= 0x01 |
#define GRN_OFF PORTB &=~0x02 |
#define GRN_ON PORTB |= 0x02 |
#define GRN_FLASH PORTB ^= 0x02 |
#define LED1_OFF PORTC &=~0x04 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED1_ON PORTC |= 0x04 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED1_FLASH PORTC ^= 0x04 //Erweiterung by 4ndreas aus mikrosvn branches // (280807Kr) |
#define LED2_OFF PORTC &=~0x08 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED2_ON PORTC |= 0x08 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED2_FLASH PORTC ^= 0x08 //Erweiterung by 4ndreas aus mikrosvn branches // (280807Kr) |
//#ifndef F_CPU |
//#error ################## F_CPU nicht definiert oder ungültig ############# |
//#endif |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//#define ANZ_MITTELWERT 4 |
#define EEPROM_ADR_VALID 1 |
#define EEPROM_ADR_ACTIVE_SET 2 |
#define EEPROM_ADR_LAST_OFFSET 3 |
#define EEPROM_ADR_PARAM_BEGIN 100 |
#define CFG_HOEHENREGELUNG 0x01 |
#define CFG_HOEHEN_SCHALTER 0x02 |
#define CFG_HEADING_HOLD 0x04 |
#define CFG_KOMPASS_AKTIV 0x08 |
#define CFG_KOMPASS_FIX 0x10 |
#define CFG_GPS_AKTIV 0x20 |
#define CFG_LOOP_OBEN 0x01 |
#define CFG_LOOP_UNTEN 0x02 |
#define CFG_LOOP_LINKS 0x04 |
#define CFG_LOOP_RECHTS 0x08 |
//#define SYSCLK |
//extern unsigned long SYSCLK; |
extern volatile int i_Nick[20],i_Roll[20],DiffNick,DiffRoll; |
extern volatile unsigned char SenderOkay; |
extern unsigned char CosinusNickWinkel, CosinusRollWinkel; |
extern unsigned char PlatinenVersion; |
extern void ReadParameterSet (unsigned char number, unsigned char *buffer, unsigned char length); |
extern void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length); |
extern unsigned char GetActiveParamSetNumber(void); |
extern unsigned char EEPromArray[]; |
long durchschnitt_northing; |
long durchschnitt_easting; |
volatile int P_GPS_Verstaerkung; //P-Anteil (80-120) |
volatile int D_GPS_Verstaerkung; //D-Anteil (90) |
#include <stdlib.h> |
#include <string.h> |
#include <avr/io.h> |
#include <avr/pgmspace.h> |
#include <avr/interrupt.h> |
#include <avr/eeprom.h> |
#include <avr/boot.h> |
#include <avr/wdt.h> |
#include "old_macros.h" |
#include "_settings.h" |
#include "printf_P.h" |
#include "timer0.h" |
#include "uart.h" |
#include "analog.h" |
#include "twimaster.h" |
#include "menu.h" |
#include "rc.h" |
#include "fc.h" |
#include "gps.h" |
#include "compass.h" |
#include "math.h" |
#ifndef EEMEM |
#define EEMEM __attribute__ ((section (".eeprom"))) |
#endif |
#define DEBUG_DISPLAY_INTERVALL 123 // in ms |
#define DELAY_US(x) ((unsigned int)( (x) * 1e-6 * F_CPU )) |
#endif //_MAIN_H |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/makefile |
---|
0,0 → 1,391 |
#-------------------------------------------------------------------- |
# MCU name |
MCU = atmega644 |
F_CPU = 20000000 |
#------------------------------------------------------------------- |
HAUPT_VERSION = 0 |
NEBEN_VERSION = 64 |
VERSION_KOMPATIBEL = 5 # PC-Kompatibilität |
#------------------------------------------------------------------- |
ifeq ($(MCU), atmega32) |
# FUSE_SETTINGS= -u -U lfuse:w:0xff:m -U hfuse:w:0xcf:m |
HEX_NAME = MEGA32 |
endif |
ifeq ($(MCU), atmega644) |
FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
#FUSE_SETTINGS = -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
# -u bei neuen Controllern wieder einspielen |
HEX_NAME = MEGA644 |
endif |
ifeq ($(F_CPU), 16000000) |
QUARZ = 16MHZ |
endif |
ifeq ($(F_CPU), 20000000) |
QUARZ = 20MHZ |
endif |
# Output format. (can be srec, ihex, binary) |
FORMAT = ihex |
# Target file name (without extension). |
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION) |
# Optimization level, can be [0, 1, 2, 3, s]. 0 turns off optimization. |
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.) |
OPT = s |
########################################################################################################## |
# List C source files here. (C dependencies are automatically generated.) |
SRC = main.c uart.c printf_P.c timer0.c analog.c menu.c |
SRC += twimaster.c rc.c fc.c GPS.c compass.c math.c |
########################################################################################################## |
# List Assembler source files here. |
# Make them always end in a capital .S. Files ending in a lowercase .s |
# will not be considered source files but generated files (assembler |
# output from the compiler), and will be deleted upon "make clean"! |
# Even though the DOS/Win* filesystem matches both .s and .S the same, |
# it will preserve the spelling of the filenames, and gcc itself does |
# care about how the name is spelled on its command-line. |
ASRC = |
# List any extra directories to look for include files here. |
# Each directory must be seperated by a space. |
EXTRAINCDIRS = |
# Optional compiler flags. |
# -g: generate debugging information (for GDB, or for COFF conversion) |
# -O*: optimization level |
# -f...: tuning, see gcc manual and avr-libc documentation |
# -Wall...: warning level |
# -Wa,...: tell GCC to pass this to the assembler. |
# -ahlms: create assembler listing |
CFLAGS = -O$(OPT) \ |
-funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums \ |
-Wall -Wstrict-prototypes \ |
-Wa,-adhlns=$(<:.c=.lst) \ |
$(patsubst %,-I%,$(EXTRAINCDIRS)) |
# Set a "language standard" compiler flag. |
# Unremark just one line below to set the language standard to use. |
# gnu99 = C99 + GNU extensions. See GCC manual for more information. |
#CFLAGS += -std=c89 |
#CFLAGS += -std=gnu89 |
#CFLAGS += -std=c99 |
CFLAGS += -std=gnu99 |
CFLAGS += -DVERSION_HAUPTVERSION=$(HAUPT_VERSION) -DVERSION_NEBENVERSION=$(NEBEN_VERSION) -DVERSION_KOMPATIBEL=$(VERSION_KOMPATIBEL) |
# Optional assembler flags. |
# -Wa,...: tell GCC to pass this to the assembler. |
# -ahlms: create listing |
# -gstabs: have the assembler create line number information; note that |
# for use in COFF files, additional information about filenames |
# and function names needs to be present in the assembler source |
# files -- see avr-libc docs [FIXME: not yet described there] |
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs |
# Optional linker flags. |
# -Wl,...: tell GCC to pass this to linker. |
# -Map: create map file |
# --cref: add cross reference to map file |
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref |
# Additional libraries |
# Minimalistic printf version |
#LDFLAGS += -Wl,-u,vfprintf -lprintf_min |
# Floating point printf version (requires -lm below) |
#LDFLAGS += -Wl,-u,vfprintf -lprintf_flt |
# -lm = math library |
LDFLAGS += -lm |
##LDFLAGS += -T./linkerfile/avr5.x |
# Programming support using avrdude. Settings and variables. |
# Programming hardware: alf avr910 avrisp bascom bsd |
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500 |
# |
# Type: avrdude -c ? |
# to get a full listing. |
# |
#AVRDUDE_PROGRAMMER = stk200 |
AVRDUDE_PROGRAMMER = dt006 |
#AVRDUDE_PROGRAMMER = ponyser |
#falls Ponyser ausgewählt wird, muss sich unsere avrdude-Configdatei im Bin-Verzeichnis des Compilers befinden |
#AVRDUDE_PORT = com1 # programmer connected to serial device |
AVRDUDE_PORT = lpt1 # programmer connected to parallel port |
#AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex |
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex $(FUSE_SETTINGS) |
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep |
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) |
# Uncomment the following if you want avrdude's erase cycle counter. |
# Note that this counter needs to be initialized first using -Yn, |
# see avrdude manual. |
#AVRDUDE_ERASE += -y |
# Uncomment the following if you do /not/ wish a verification to be |
# performed after programming the device. |
AVRDUDE_FLAGS += -V |
# Increase verbosity level. Please use this when submitting bug |
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> |
# to submit bug reports. |
#AVRDUDE_FLAGS += -v -v |
# --------------------------------------------------------------------------- |
# Define directories, if needed. |
DIRAVR = c:/winavr |
DIRAVRBIN = $(DIRAVR)/bin |
DIRAVRUTILS = $(DIRAVR)/utils/bin |
DIRINC = . |
DIRLIB = $(DIRAVR)/avr/lib |
# Define programs and commands. |
SHELL = sh |
CC = avr-gcc |
OBJCOPY = avr-objcopy |
OBJDUMP = avr-objdump |
SIZE = avr-size |
# Programming support using avrdude. |
AVRDUDE = avrdude |
REMOVE = rm -f |
COPY = cp |
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex |
ELFSIZE = $(SIZE) -A $(TARGET).elf |
# Define Messages |
# English |
MSG_ERRORS_NONE = Errors: none |
MSG_BEGIN = -------- begin -------- |
MSG_END = -------- end -------- |
MSG_SIZE_BEFORE = Size before: |
MSG_SIZE_AFTER = Size after: |
MSG_COFF = Converting to AVR COFF: |
MSG_EXTENDED_COFF = Converting to AVR Extended COFF: |
MSG_FLASH = Creating load file for Flash: |
MSG_EEPROM = Creating load file for EEPROM: |
MSG_EXTENDED_LISTING = Creating Extended Listing: |
MSG_SYMBOL_TABLE = Creating Symbol Table: |
MSG_LINKING = Linking: |
MSG_COMPILING = Compiling: |
MSG_ASSEMBLING = Assembling: |
MSG_CLEANING = Cleaning project: |
# Define all object files. |
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o) |
# Define all listing files. |
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst) |
# Combine all necessary flags and optional flags. |
# Add target processor to flags. |
#ALL_CFLAGS = -mmcu=$(MCU) -DF_CPU=$(F_CPU) -I. $(CFLAGS) |
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) |
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) |
# Default target. |
all: begin gccversion sizebefore $(TARGET).elf $(TARGET).hex $(TARGET).eep \ |
$(TARGET).lss $(TARGET).sym sizeafter finished end |
# Eye candy. |
# AVR Studio 3.x does not check make's exit code but relies on |
# the following magic strings to be generated by the compile job. |
begin: |
@echo |
@echo $(MSG_BEGIN) |
finished: |
@echo $(MSG_ERRORS_NONE) |
end: |
@echo $(MSG_END) |
@echo |
# Display size of file. |
sizebefore: |
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi |
sizeafter: |
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi |
# Display compiler version information. |
gccversion : |
@$(CC) --version |
# Convert ELF to COFF for use in debugging / simulating in |
# AVR Studio or VMLAB. |
COFFCONVERT=$(OBJCOPY) --debugging \ |
--change-section-address .data-0x800000 \ |
--change-section-address .bss-0x800000 \ |
--change-section-address .noinit-0x800000 \ |
--change-section-address .eeprom-0x810000 |
coff: $(TARGET).elf |
@echo |
@echo $(MSG_COFF) $(TARGET).cof |
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof |
extcoff: $(TARGET).elf |
@echo |
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof |
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof |
# Program the device. |
program: $(TARGET).hex $(TARGET).eep |
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) |
# Create final output files (.hex, .eep) from ELF output file. |
%.hex: %.elf |
@echo |
@echo $(MSG_FLASH) $@ |
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ |
%.eep: %.elf |
@echo |
@echo $(MSG_EEPROM) $@ |
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ |
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@ |
# Create extended listing file from ELF output file. |
%.lss: %.elf |
@echo |
@echo $(MSG_EXTENDED_LISTING) $@ |
$(OBJDUMP) -h -S $< > $@ |
# Create a symbol table from ELF output file. |
%.sym: %.elf |
@echo |
@echo $(MSG_SYMBOL_TABLE) $@ |
avr-nm -n $< > $@ |
# Link: create ELF output file from object files. |
.SECONDARY : $(TARGET).elf |
.PRECIOUS : $(OBJ) |
%.elf: $(OBJ) |
@echo |
@echo $(MSG_LINKING) $@ |
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS) |
# Compile: create object files from C source files. |
%.o : %.c |
@echo |
@echo $(MSG_COMPILING) $< |
$(CC) -c $(ALL_CFLAGS) $< -o $@ |
# Compile: create assembler files from C source files. |
%.s : %.c |
$(CC) -S $(ALL_CFLAGS) $< -o $@ |
# Assemble: create object files from assembler source files. |
%.o : %.S |
@echo |
@echo $(MSG_ASSEMBLING) $< |
$(CC) -c $(ALL_ASFLAGS) $< -o $@ |
# Target: clean project. |
clean: begin clean_list finished end |
clean_list : |
@echo |
@echo $(MSG_CLEANING) |
# $(REMOVE) $(TARGET).hex |
$(REMOVE) $(TARGET).eep |
$(REMOVE) $(TARGET).obj |
$(REMOVE) $(TARGET).cof |
$(REMOVE) $(TARGET).elf |
$(REMOVE) $(TARGET).map |
$(REMOVE) $(TARGET).obj |
$(REMOVE) $(TARGET).a90 |
$(REMOVE) $(TARGET).sym |
$(REMOVE) $(TARGET).lnk |
$(REMOVE) $(TARGET).lss |
$(REMOVE) $(OBJ) |
$(REMOVE) $(LST) |
$(REMOVE) $(SRC:.c=.s) |
$(REMOVE) $(SRC:.c=.d) |
# Automatically generate C source code dependencies. |
# (Code originally taken from the GNU make user manual and modified |
# (See README.txt Credits).) |
# |
# Note that this will work with sh (bash) and sed that is shipped with WinAVR |
# (see the SHELL variable defined above). |
# This may not work with other shells or other seds. |
# |
%.d: %.c |
set -e; $(CC) -MM $(ALL_CFLAGS) $< \ |
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > $@; \ |
[ -s $@ ] || rm -f $@ |
# Remove the '-' if you want to see the dependency files generated. |
-include $(SRC:.c=.d) |
# Listing of phony targets. |
.PHONY : all begin finish end sizebefore sizeafter gccversion coff extcoff \ |
clean clean_list program |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/math.c |
---|
0,0 → 1,118 |
/* |
Copyright 2007, Niklas Nold |
This program (files math.c and math.h) is free software; you can redistribute it and/or modify |
it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; |
either version 3 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
Please note: All the other files for the project "Mikrokopter" by H. Buss are under the license (license_buss.txt) published by www.mikrokopter.de |
*/ |
#include "main.h" |
const uint8_t pgm_atan[270] PROGMEM = {0,1,2,3,5,6,7,8,9,10,11,12,13,15,16,17,18,19,20,21,22,23,24,25,26,27,27,28,29,30,31,32,33,33,34,35,36,37,37,38,39,39,40,41,41,42,43,43,44,44,45,46,46,47,47,48,48,49,49,50,50,51,51,52,52,52,53,53,54,54,54,55,55,56,56,56,57,57,57,58,58,58,59,59,59,60,60,60,60,61,61,61,61,62,62,62,62,63,63,63,63,64,64,64,64,65,65,65,65,65,66,66,66,66,66,67,67,67,67,67,67,68,68,68,68,68,68,69,69,69,69,69,69,69,70,70,70,70,70,70,70,70,71,71,71,71,71,71,71,71,72,72,72,72,72,72,72,72,72,73,73,73,73,73,73,73,73,73,73,74,74,74,74,74,74,74,74,74,74,74,74,75,75,75,75,75,75,75,75,75,75,75,75,75,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79}; |
// Arkustangens2 im Gradmaß |
signed int atan2_i(signed int x, signed int y) |
{ |
int i,angle; |
int8_t m; |
if (!x && !y) return 0; //atan2 = 0 für x und y = 0 |
if (y < 0) m=-1; |
else m=1; |
if (x==0) return (90*m); // atan2 = 90° für x = 0 |
i = abs(((float)y / x) * 50); // Berechne i für die Lookup table (Schrittweite atan(x) ist 0.02 -> *50) |
if (i<270) angle = pgm_read_byte(&pgm_atan[i]); // Lookup für 1° bis 79° |
else if (i>5750) angle = 90; // Grenzwert ist 90° |
else if (i>=1910) angle = 89; // 89° bis 80° über Wertebereiche |
else if (i>=1150) angle = 88; |
else if (i>=820) angle = 87; |
else if (i>=640) angle = 86; |
else if (i>=520) angle = 85; |
else if (i>=440) angle = 84; |
else if (i>=380) angle = 83; |
else if (i>=335) angle = 82; |
else if (i>=299) angle = 81; |
else angle = 80; // (i>=270) |
if (x > 0) return (angle*m); // Quadrant I und IV |
else if ((x < 0) && (y >= 0)) return ((angle*-1) + 180); // Quadrant II |
else return (angle - 180); // x < 0 && y < 0 Quadrant III |
} |
const float pgm_sinus_f [91] PROGMEM = {0.000,0.017,0.035,0.052,0.070,0.087,0.105,0.122,0.139,0.156,0.174,0.191,0.208,0.225,0.242,0.259,0.276,0.292,0.309,0.326,0.342,0.358,0.375,0.391,0.407,0.423,0.438,0.454,0.469,0.485,0.500,0.515,0.530,0.545,0.559,0.574,0.588,0.602,0.616,0.629,0.643,0.656,0.669,0.682,0.695,0.707,0.719,0.731,0.743,0.755,0.766,0.777,0.788,0.799,0.809,0.819,0.829,0.839,0.848,0.857,0.866,0.875,0.883,0.891,0.899,0.906,0.914,0.921,0.927,0.934,0.940,0.946,0.951,0.956,0.961,0.966,0.970,0.974,0.978,0.982,0.985,0.988,0.990,0.993,0.995,0.996,0.998,0.999,0.999,1.000,1.000}; |
inline float pgm_read_float(const float *addr) |
{ |
union |
{ |
uint16_t i[2]; // 2 16-bit-Worte |
float f; |
} u; |
u.i[0]=pgm_read_word((PGM_P)addr); |
u.i[1]=pgm_read_word((PGM_P)addr+2); |
return u.f; |
} |
// Kosinusfunktion im Gradmaß |
float cos_f(signed int winkel) |
{ |
return (sin_f(90-winkel)); |
} |
// Sinusfunktion im Gradmaß |
float sin_f(signed int winkel) |
{ |
short int m,n; |
float sinus; |
//winkel = winkel % 360; |
if (winkel < 0) |
{ |
m = -1; |
winkel = abs(winkel); |
} |
else m = +1; |
// Quadranten auswerten |
if ((winkel > 90 ) && (winkel <= 180)) {winkel = 180 - winkel; n = 1;} |
else if ((winkel > 180 ) && (winkel <= 270)) {winkel = winkel - 180; n = -1;} |
else if ((winkel > 270) && (winkel <= 360)) {winkel = 360 - winkel; n = -1;} |
else n = 1; //0 - 90 Grad |
sinus = pgm_read_float(&pgm_sinus_f[winkel]); |
return (sinus*m*n); |
} |
const uint8_t pgm_asin[201] PROGMEM = {0,0,1,1,1,1,2,2,2,3,3,3,3,4,4,4,5,5,5,5,6,6,6,7,7,7,7,8,8,8,9,9,9,9,10,10,10,11,11,11,12,12,12,12,13,13,13,14,14,14,14,15,15,15,16,16,16,17,17,17,17,18,18,18,19,19,19,20,20,20,20,21,21,21,22,22,22,23,23,23,24,24,24,25,25,25,25,26,26,26,27,27,27,28,28,28,29,29,29,30,30,30,31,31,31,32,32,32,33,33,33,34,34,34,35,35,35,36,36,37,37,37,38,38,38,39,39,39,40,40,41,41,41,42,42,42,43,43,44,44,44,45,45,46,46,46,47,47,48,48,49,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,62,62,63,64,64,65,66,66,67,68,68,69,70,71,72,73,74,75,76,77,79,80,82,84,90}; |
// Akurssinusfunktion im Gradmaß |
int8_t asin_i(signed int i) |
{ |
signed char m; |
if (i < 0) {m=-1;i=abs(i);} |
else m=1; |
return (pgm_read_byte(&pgm_asin[i]) * m); |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/math.h |
---|
0,0 → 1,11 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Peter Muehlenbrock |
// Definitionen fuer Modul math |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
extern signed int atan2_i(signed int x, signed int y); |
extern float cos_f(signed int winkel); |
extern float sin_f(signed int winkel); |
extern int8_t asin_i(signed int i); |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/menu.c |
---|
0,0 → 1,118 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
unsigned int TestInt = 0; |
#define ARRAYGROESSE 10 |
unsigned char Array[ARRAYGROESSE] = {1,2,3,4,5,6,7,8,9,10}; |
char DisplayBuff[80] = "Hallo Welt"; |
unsigned char DispPtr = 0; |
unsigned char RemoteTasten = 0; |
#define KEY1 0x01 |
#define KEY2 0x02 |
#define KEY3 0x04 |
#define KEY4 0x08 |
#define KEY5 0x10 |
void LcdClear(void) |
{ |
unsigned char i; |
for(i=0;i<80;i++) DisplayBuff[i] = ' '; |
} |
void Menu(void) |
{ |
static unsigned char MaxMenue = 10,MenuePunkt=0; |
if(RemoteTasten & KEY1) { if(MenuePunkt) MenuePunkt--; else MenuePunkt = MaxMenue; LcdClear(); } |
if(RemoteTasten & KEY2) { MenuePunkt++; LcdClear(); } |
if((RemoteTasten & KEY1) && (RemoteTasten & KEY2)) MenuePunkt = 0; |
LCD_printfxy(17,0,"[%i]",MenuePunkt); |
switch(MenuePunkt) |
{ |
case 0: |
LCD_printfxy(0,0,"++ MikroKopter ++"); |
LCD_printfxy(0,1,"HW:V%d.%d SW:%d.%d",PlatinenVersion/10,PlatinenVersion%10,VERSION_HAUPTVERSION, VERSION_NEBENVERSION); |
LCD_printfxy(0,2,"Setting: %d ",GetActiveParamSetNumber()); |
LCD_printfxy(0,3,"(c) Holger Buss"); |
// if(RemoteTasten & KEY3) TestInt--; |
// if(RemoteTasten & KEY4) TestInt++; |
break; |
case 1: |
if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
LCD_printfxy(0,0,"Hoehe: %5i",HoehenWert); |
LCD_printfxy(0,1,"SollHoehe: %5i",SollHoehe); |
LCD_printfxy(0,2,"Luftdruck: %5i",MessLuftdruck); |
LCD_printfxy(0,3,"Off : %5i",DruckOffsetSetting); |
} |
else |
{ |
LCD_printfxy(0,1,"Keine "); |
LCD_printfxy(0,2,"Höhenregelung"); |
} |
break; |
case 2: |
LCD_printfxy(0,0,"akt. Lage"); |
LCD_printfxy(0,1,"Nick: %5i",IntegralNick/1024); |
LCD_printfxy(0,2,"Roll: %5i",IntegralRoll/1024); |
LCD_printfxy(0,3,"Kompass: %5i",KompassValue); |
break; |
case 3: |
LCD_printfxy(0,0,"K1:%4i K2:%4i ",PPM_in[1],PPM_in[2]); |
LCD_printfxy(0,1,"K3:%4i K4:%4i ",PPM_in[3],PPM_in[4]); |
LCD_printfxy(0,2,"K5:%4i K6:%4i ",PPM_in[5],PPM_in[6]); |
LCD_printfxy(0,3,"K7:%4i K8:%4i ",PPM_in[7],PPM_in[8]); |
break; |
case 4: |
LCD_printfxy(0,0,"Ni:%4i Ro:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_NICK]],PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]); |
LCD_printfxy(0,1,"Gs:%4i Gi:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_GAS]],PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]); |
LCD_printfxy(0,2,"P1:%4i P2:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]],PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]]); |
LCD_printfxy(0,3,"P3:%4i P4:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]],PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]]); |
break; |
case 5: |
LCD_printfxy(0,0,"Gyro - Sensor"); |
LCD_printfxy(0,1,"Nick %4i (%3i)",AccumulateNick / MessanzahlNick, AdNeutralNick); |
LCD_printfxy(0,2,"Roll %4i (%3i)",AccumulateRoll / MessanzahlRoll, AdNeutralRoll); |
LCD_printfxy(0,3,"Gier %4i (%3i)",AccumulateGier / MessanzahlGier, AdNeutralGier); |
break; |
case 6: |
LCD_printfxy(0,0,"ACC - Sensor"); |
LCD_printfxy(0,1,"Nick %4i (%3i)",accumulate_AccNick / messanzahl_AccNick,NeutralAccX); |
LCD_printfxy(0,2,"Roll %4i (%3i)",accumulate_AccRoll / messanzahl_AccRoll,NeutralAccY); |
LCD_printfxy(0,3,"Hoch %4i (%3i)",Aktuell_az/*accumulate_AccHoch / messanzahl_AccHoch*/,(int)NeutralAccZ); |
break; |
case 7: |
LCD_printfxy(0,1,"Spannung: %5i",UBat); |
LCD_printfxy(0,2,"Empf.Pegel:%5i",SenderOkay); |
break; |
case 8: |
LCD_printfxy(0,0,"Kompass "); |
LCD_printfxy(0,1,"Richtung: %5i",KompassRichtung); |
LCD_printfxy(0,2,"Messwert: %5i",KompassValue); |
LCD_printfxy(0,3,"Start: %5i",KompassStartwert); |
break; |
case 9: |
LCD_printfxy(0,0,"Po1: %3i Po5: %3i" ,Poti1,Poti5); //PPM24-Erweiterung (121007Kr) |
LCD_printfxy(0,1,"Po2: %3i Po6: %3i" ,Poti2,Poti6); //PPM24-Erweiterung (121007Kr) |
LCD_printfxy(0,2,"Po3: %3i Po7: %3i" ,Poti3,Poti7); //PPM24-Erweiterung (121007Kr) |
LCD_printfxy(0,3,"Po4: %3i Po8: %3i" ,Poti4,Poti8); //PPM24-Erweiterung (121007Kr) |
break; |
case 10: |
LCD_printfxy(0,0,"Servo " ); |
LCD_printfxy(0,1,"Setpoint %3i",Parameter_ServoNickControl); |
LCD_printfxy(0,2,"Stellung: %3i",ServoValue); |
LCD_printfxy(0,3,"Range:%3i-%3i",EE_Parameter.ServoNickMin,EE_Parameter.ServoNickMax); |
break; |
default: MaxMenue = MenuePunkt - 1; |
MenuePunkt = 0; |
break; |
} |
RemoteTasten = 0; |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/menu.h |
---|
0,0 → 1,5 |
extern void Menu(void); |
extern char DisplayBuff[80]; |
extern unsigned char DispPtr; |
unsigned char RemoteTasten; |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/old_macros.h |
---|
0,0 → 1,47 |
/* |
For backwards compatibility only. |
Ingo Busker ingo@mikrocontroller.com |
*/ |
#ifndef cbi |
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) |
#endif |
#ifndef sbi |
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit)) |
#endif |
#ifndef inb |
#define inb(sfr) _SFR_BYTE(sfr) |
#endif |
#ifndef outb |
#define outb(sfr, val) (_SFR_BYTE(sfr) = (val)) |
#endif |
#ifndef inw |
#define inw(sfr) _SFR_WORD(sfr) |
#endif |
#ifndef outw |
#define outw(sfr, val) (_SFR_WORD(sfr) = (val)) |
#endif |
#ifndef outp |
#define outp(val, sfr) outb(sfr, val) |
#endif |
#ifndef inp |
#define inp(sfr) inb(sfr) |
#endif |
#ifndef BV |
#define BV(bit) _BV(bit) |
#endif |
#ifndef PRG_RDB |
#define PRG_RDB pgm_read_byte |
#endif |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/printf_P.c |
---|
0,0 → 1,480 |
// Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist nicht von der Lizenz für den MikroKopter-Teil unterstellt |
/* |
Copyright (C) 1993 Free Software Foundation |
This file is part of the GNU IO Library. This library is free |
software; you can redistribute it and/or modify it under the |
terms of the GNU General Public License as published by the |
Free Software Foundation; either version 2, or (at your option) |
any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License for more details. |
You should have received a copy of the GNU General Public License |
along with this library; see the file COPYING. If not, write to the Free |
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
As a special exception, if you link this library with files |
compiled with a GNU compiler to produce an executable, this does not cause |
the resulting executable to be covered by the GNU General Public License. |
This exception does not however invalidate any other reasons why |
the executable file might be covered by the GNU General Public License. */ |
/* |
* Copyright (c) 1990 Regents of the University of California. |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* 1. Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* 2. Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* 3. [rescinded 22 July 1999] |
* 4. Neither the name of the University nor the names of its contributors |
* may be used to endorse or promote products derived from this software |
* without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
* SUCH DAMAGE. |
*/ |
/****************************************************************************** |
This file is a patched version of printf called _printf_P |
It is made to work with avr-gcc for Atmel AVR MCUs. |
There are some differences from standard printf: |
1. There is no floating point support (with fp the code is about 8K!) |
2. Return type is void |
3. Format string must be in program memory (by using macro printf this is |
done automaticaly) |
4. %n is not implemented (just remove the comment around it if you need it) |
5. If LIGHTPRINTF is defined, the code is about 550 bytes smaller and the |
folowing specifiers are disabled : |
space # * . - + p s o O |
6. A function void uart_sendchar(char c) is used for output. The UART must |
be initialized before using printf. |
Alexander Popov |
sasho@vip.orbitel.bg |
******************************************************************************/ |
/* |
* Actual printf innards. |
* |
* This code is large and complicated... |
*/ |
#include <string.h> |
#ifdef __STDC__ |
#include <stdarg.h> |
#else |
#include <varargs.h> |
#endif |
#include "main.h" |
//#define LIGHTPRINTF |
char PrintZiel; |
char Putchar(char zeichen) |
{ |
if(PrintZiel == OUT_LCD) { DisplayBuff[DispPtr++] = zeichen; return(1);} |
else return(uart_putchar(zeichen)); |
} |
void PRINT(const char * ptr, unsigned int len) |
{ |
for(;len;len--) Putchar(*ptr++); |
} |
void PRINTP(const char * ptr, unsigned int len) |
{ |
for(;len;len--) Putchar(pgm_read_byte(ptr++)); |
} |
void PAD_SP(signed char howmany) |
{ |
for(;howmany>0;howmany--) Putchar(' '); |
} |
void PAD_0(signed char howmany) |
{ |
for(;howmany>0;howmany--) Putchar('0'); |
} |
#define BUF 40 |
/* |
* Macros for converting digits to letters and vice versa |
*/ |
#define to_digit(c) ((c) - '0') |
#define is_digit(c) ((c)<='9' && (c)>='0') |
#define to_char(n) ((n) + '0') |
/* |
* Flags used during conversion. |
*/ |
#define LONGINT 0x01 /* long integer */ |
#define LONGDBL 0x02 /* long double; unimplemented */ |
#define SHORTINT 0x04 /* short integer */ |
#define ALT 0x08 /* alternate form */ |
#define LADJUST 0x10 /* left adjustment */ |
#define ZEROPAD 0x20 /* zero (as opposed to blank) pad */ |
#define HEXPREFIX 0x40 /* add 0x or 0X prefix */ |
void _printf_P (char ziel,char const *fmt0, ...) /* Works with string from FLASH */ |
{ |
va_list ap; |
register const char *fmt; /* format string */ |
register char ch; /* character from fmt */ |
register int n; /* handy integer (short term usage) */ |
register char *cp; /* handy char pointer (short term usage) */ |
const char *fmark; /* for remembering a place in fmt */ |
register unsigned char flags; /* flags as above */ |
signed char width; /* width from format (%8d), or 0 */ |
signed char prec; /* precision from format (%.3d), or -1 */ |
char sign; /* sign prefix (' ', '+', '-', or \0) */ |
unsigned long _ulong=0; /* integer arguments %[diouxX] */ |
#define OCT 8 |
#define DEC 10 |
#define HEX 16 |
unsigned char base; /* base for [diouxX] conversion */ |
signed char dprec; /* a copy of prec if [diouxX], 0 otherwise */ |
signed char dpad; /* extra 0 padding needed for integers */ |
signed char fieldsz; /* field size expanded by sign, dpad etc */ |
/* The initialization of 'size' is to suppress a warning that |
'size' might be used unitialized. It seems gcc can't |
quite grok this spaghetti code ... */ |
signed char size = 0; /* size of converted field or string */ |
char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */ |
char ox[2]; /* space for 0x hex-prefix */ |
PrintZiel = ziel; // bestimmt, LCD oder UART |
va_start(ap, fmt0); |
fmt = fmt0; |
/* |
* Scan the format for conversions (`%' character). |
*/ |
for (;;) { |
for (fmark = fmt; (ch = pgm_read_byte(fmt)) != '\0' && ch != '%'; fmt++) |
/* void */; |
if ((n = fmt - fmark) != 0) { |
PRINTP(fmark, n); |
} |
if (ch == '\0') |
goto done; |
fmt++; /* skip over '%' */ |
flags = 0; |
dprec = 0; |
width = 0; |
prec = -1; |
sign = '\0'; |
rflag: ch = PRG_RDB(fmt++); |
reswitch: |
#ifdef LIGHTPRINTF |
if (ch=='o' || ch=='u' || (ch|0x20)=='x') { |
#else |
if (ch=='u' || (ch|0x20)=='x') { |
#endif |
if (flags&LONGINT) { |
_ulong=va_arg(ap, unsigned long); |
} else { |
register unsigned int _d; |
_d=va_arg(ap, unsigned int); |
_ulong = flags&SHORTINT ? (unsigned long)(unsigned short)_d : (unsigned long)_d; |
} |
} |
#ifndef LIGHTPRINTF |
if(ch==' ') { |
/* |
* ``If the space and + flags both appear, the space |
* flag will be ignored.'' |
* -- ANSI X3J11 |
*/ |
if (!sign) |
sign = ' '; |
goto rflag; |
} else if (ch=='#') { |
flags |= ALT; |
goto rflag; |
} else if (ch=='*'||ch=='-') { |
if (ch=='*') { |
/* |
* ``A negative field width argument is taken as a |
* - flag followed by a positive field width.'' |
* -- ANSI X3J11 |
* They don't exclude field widths read from args. |
*/ |
if ((width = va_arg(ap, int)) >= 0) |
goto rflag; |
width = -width; |
} |
flags |= LADJUST; |
flags &= ~ZEROPAD; /* '-' disables '0' */ |
goto rflag; |
} else if (ch=='+') { |
sign = '+'; |
goto rflag; |
} else if (ch=='.') { |
if ((ch = PRG_RDB(fmt++)) == '*') { |
n = va_arg(ap, int); |
prec = n < 0 ? -1 : n; |
goto rflag; |
} |
n = 0; |
while (is_digit(ch)) { |
n = n*10 + to_digit(ch); |
ch = PRG_RDB(fmt++); |
} |
prec = n < 0 ? -1 : n; |
goto reswitch; |
} else |
#endif /* LIGHTPRINTF */ |
if (ch=='0') { |
/* |
* ``Note that 0 is taken as a flag, not as the |
* beginning of a field width.'' |
* -- ANSI X3J11 |
*/ |
if (!(flags & LADJUST)) |
flags |= ZEROPAD; /* '-' disables '0' */ |
goto rflag; |
} else if (ch>='1' && ch<='9') { |
n = 0; |
do { |
n = 10 * n + to_digit(ch); |
ch = PRG_RDB(fmt++); |
} while (is_digit(ch)); |
width = n; |
goto reswitch; |
} else if (ch=='h') { |
flags |= SHORTINT; |
goto rflag; |
} else if (ch=='l') { |
flags |= LONGINT; |
goto rflag; |
} else if (ch=='c') { |
*(cp = buf) = va_arg(ap, int); |
size = 1; |
sign = '\0'; |
} else if (ch=='D'||ch=='d'||ch=='i') { |
if(ch=='D') |
flags |= LONGINT; |
if (flags&LONGINT) { |
_ulong=va_arg(ap, long); |
} else { |
register int _d; |
_d=va_arg(ap, int); |
_ulong = flags&SHORTINT ? (long)(short)_d : (long)_d; |
} |
if ((long)_ulong < 0) { |
_ulong = -_ulong; |
sign = '-'; |
} |
base = DEC; |
goto number; |
} else |
/* |
if (ch=='n') { |
if (flags & LONGINT) |
*va_arg(ap, long *) = ret; |
else if (flags & SHORTINT) |
*va_arg(ap, short *) = ret; |
else |
*va_arg(ap, int *) = ret; |
continue; // no output |
} else |
*/ |
#ifndef LIGHTPRINTF |
if (ch=='O'||ch=='o') { |
if (ch=='O') |
flags |= LONGINT; |
base = OCT; |
goto nosign; |
} else if (ch=='p') { |
/* |
* ``The argument shall be a pointer to void. The |
* value of the pointer is converted to a sequence |
* of printable characters, in an implementation- |
* defined manner.'' |
* -- ANSI X3J11 |
*/ |
/* NOSTRICT */ |
_ulong = (unsigned int)va_arg(ap, void *); |
base = HEX; |
flags |= HEXPREFIX; |
ch = 'x'; |
goto nosign; |
} else if (ch=='s') { // print a string from RAM |
if ((cp = va_arg(ap, char *)) == NULL) { |
cp=buf; |
cp[0] = '('; |
cp[1] = 'n'; |
cp[2] = 'u'; |
cp[4] = cp[3] = 'l'; |
cp[5] = ')'; |
cp[6] = '\0'; |
} |
if (prec >= 0) { |
/* |
* can't use strlen; can only look for the |
* NUL in the first `prec' characters, and |
* strlen() will go further. |
*/ |
char *p = (char*)memchr(cp, 0, prec); |
if (p != NULL) { |
size = p - cp; |
if (size > prec) |
size = prec; |
} else |
size = prec; |
} else |
size = strlen(cp); |
sign = '\0'; |
} else |
#endif /* LIGHTPRINTF */ |
if(ch=='U'||ch=='u') { |
if (ch=='U') |
flags |= LONGINT; |
base = DEC; |
goto nosign; |
} else if (ch=='X'||ch=='x') { |
base = HEX; |
/* leading 0x/X only if non-zero */ |
if (flags & ALT && _ulong != 0) |
flags |= HEXPREFIX; |
/* unsigned conversions */ |
nosign: sign = '\0'; |
/* |
* ``... diouXx conversions ... if a precision is |
* specified, the 0 flag will be ignored.'' |
* -- ANSI X3J11 |
*/ |
number: if ((dprec = prec) >= 0) |
flags &= ~ZEROPAD; |
/* |
* ``The result of converting a zero value with an |
* explicit precision of zero is no characters.'' |
* -- ANSI X3J11 |
*/ |
cp = buf + BUF; |
if (_ulong != 0 || prec != 0) { |
register unsigned char _d,notlastdigit; |
do { |
notlastdigit=(_ulong>=base); |
_d = _ulong % base; |
if (_d<10) { |
_d+='0'; |
} else { |
_d+='a'-10; |
if (ch=='X') _d&=~0x20; |
} |
*--cp=_d; |
_ulong /= base; |
} while (notlastdigit); |
#ifndef LIGHTPRINTF |
// handle octal leading 0 |
if (base==OCT && flags & ALT && *cp != '0') |
*--cp = '0'; |
#endif |
} |
size = buf + BUF - cp; |
} else { //default |
/* "%?" prints ?, unless ? is NUL */ |
if (ch == '\0') |
goto done; |
/* pretend it was %c with argument ch */ |
cp = buf; |
*cp = ch; |
size = 1; |
sign = '\0'; |
} |
/* |
* All reasonable formats wind up here. At this point, |
* `cp' points to a string which (if not flags&LADJUST) |
* should be padded out to `width' places. If |
* flags&ZEROPAD, it should first be prefixed by any |
* sign or other prefix; otherwise, it should be blank |
* padded before the prefix is emitted. After any |
* left-hand padding and prefixing, emit zeroes |
* required by a decimal [diouxX] precision, then print |
* the string proper, then emit zeroes required by any |
* leftover floating precision; finally, if LADJUST, |
* pad with blanks. |
*/ |
/* |
* compute actual size, so we know how much to pad. |
*/ |
fieldsz = size; |
dpad = dprec - size; |
if (dpad < 0) |
dpad = 0; |
if (sign) |
fieldsz++; |
else if (flags & HEXPREFIX) |
fieldsz += 2; |
fieldsz += dpad; |
/* right-adjusting blank padding */ |
if ((flags & (LADJUST|ZEROPAD)) == 0) |
PAD_SP(width - fieldsz); |
/* prefix */ |
if (sign) { |
PRINT(&sign, 1); |
} else if (flags & HEXPREFIX) { |
ox[0] = '0'; |
ox[1] = ch; |
PRINT(ox, 2); |
} |
/* right-adjusting zero padding */ |
if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD) |
PAD_0(width - fieldsz); |
/* leading zeroes from decimal precision */ |
PAD_0(dpad); |
/* the string or number proper */ |
PRINT(cp, size); |
/* left-adjusting padding (always blank) */ |
if (flags & LADJUST) |
PAD_SP(width - fieldsz); |
} |
done: |
va_end(ap); |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/printf_P.h |
---|
0,0 → 1,19 |
#ifndef _PRINTF_P_H_ |
#define _PRINTF_P_H_ |
#include <avr/pgmspace.h> |
#define OUT_V24 0 |
#define OUT_LCD 1 |
extern void _printf_P (char, char const *fmt0, ...); |
extern char PrintZiel; |
#define printf_P(format, args...) _printf_P(OUT_V24,format , ## args) |
#define printf(format, args...) _printf_P(OUT_V24,PSTR(format) , ## args) |
#define LCD_printfxy(x,y,format, args...) { DispPtr = y * 20 + x; _printf_P(OUT_LCD,PSTR(format) , ## args);} |
#define LCD_printf(format, args...) { _printf_P(OUT_LCD,PSTR(format) , ## args);} |
#endif |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/rc.c |
---|
0,0 → 1,85 |
/*####################################################################################### |
Decodieren eines RC Summen Signals |
#######################################################################################*/ |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "rc.h" |
#include "main.h" |
volatile int PPM_in[15]; //PPM24-Erweiterung (121007Kr) |
volatile int PPM_diff[15]; // das diffenzierte Stick-Signal //PPM24-Erweiterung (121007Kr) |
volatile unsigned char NewPpmData = 1; |
//############################################################################ |
//zum decodieren des PPM-Signals wird Timer1 mit seiner Input |
//Capture Funktion benutzt: |
void rc_sum_init (void) |
//############################################################################ |
{ |
TCCR1B=(1<<CS11)|(1<<CS10)|(1<<ICES1)|(1<<ICNC1);//|(1 << WGM12); //timer1 prescale 64 |
// PWM |
//TCCR1A = (1 << COM1B1) | (1 << WGM11) | (1 << WGM10); |
//TCCR1B |= (1 << WGM12); |
//OCR1B = 55; |
TIMSK1 |= _BV(ICIE1); |
AdNeutralGier = 0; |
AdNeutralRoll = 0; |
AdNeutralNick = 0; |
return; |
} |
//############################################################################ |
//Diese Routine startet und inizialisiert den Timer für RC |
SIGNAL(SIG_INPUT_CAPTURE1) |
//############################################################################ |
{ |
static unsigned int AltICR=0; |
signed int signal = 0,tmp; |
static int index; |
signal = (unsigned int) ICR1 - AltICR; |
AltICR = ICR1; |
//Syncronisationspause? |
if ((signal > 1500) && (signal < 8000)) |
{ |
index = 1; |
NewPpmData = 0; // Null bedeutet: Neue Daten |
// OCR2A = Poti2/2 + 80; |
} |
else |
{ |
if(index < 14) //PPM24-Erweiterung (121007Kr) |
{ |
if((signal > 250) && (signal < 687)) |
{ |
signal -= 466; |
// Stabiles Signal |
if(abs(signal - PPM_in[index]) < 6) { if(SenderOkay < 200) SenderOkay += 10;} |
tmp = (3 * (PPM_in[index]) + signal) / 4; |
// if(tmp > signal+1) tmp--; else |
// if(tmp < signal-1) tmp++; |
PPM_diff[index] = tmp - PPM_in[index]; |
PPM_in[index] = tmp; |
} |
index++; |
if(index == 5) PORTD |= 0x20; else PORTD &= ~0x20; // Servosignal an J3 anlegen |
if(index == 6) PORTD |= 0x10; else PORTD &= ~0x10; // Servosignal an J4 anlegen |
if(index == 7) PORTD |= 0x08; else PORTD &= ~0x08; // Servosignal an J5 anlegen |
} |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/rc.h |
---|
0,0 → 1,29 |
/*####################################################################################### |
Derkodieren eines RC Summen Signals |
#######################################################################################*/ |
#ifndef _RC_H |
#define _RC_H |
#if defined (__AVR_ATmega32__) |
#define TIMER_TEILER CK64 |
#define TIMER_RELOAD_VALUE 250 |
#endif |
#if defined (__AVR_ATmega644__) |
//#define TIMER_TEILER CK64 |
#define TIMER_RELOAD_VALUE 250 |
//#define TIMER_TEILER CK256 // bei 20MHz |
//#define TIMER_RELOAD_VALUE -78 // bei 20MHz |
#endif |
#define GAS PPM_in[2] |
extern void rc_sum_init (void); |
extern volatile int PPM_in[15]; //PPM24-Erweiterung (121007Kr) |
extern volatile int PPM_diff[15]; // das diffenzierte Stick-Signal //PPM24-Erweiterung (121007Kr) |
extern volatile unsigned char NewPpmData; |
#endif //_RC_H |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/timer0.c |
---|
0,0 → 1,157 |
#include "main.h" |
volatile unsigned int CountMilliseconds = 0; |
volatile static unsigned int tim_main; |
volatile unsigned char UpdateMotor = 0; |
volatile unsigned int cntKompass = 0; |
volatile unsigned int beeptime = 0; |
unsigned int BeepMuster = 0xffff; |
int ServoValue = 0; |
enum { |
STOP = 0, |
CK = 1, |
CK8 = 2, |
CK64 = 3, |
CK256 = 4, |
CK1024 = 5, |
T0_FALLING_EDGE = 6, |
T0_RISING_EDGE = 7 |
}; |
SIGNAL (SIG_OVERFLOW0) // 8kHz |
{ |
static unsigned char cnt_1ms = 1,cnt = 0; |
unsigned char pieper_ein = 0; |
// TCNT0 -= 250;//TIMER_RELOAD_VALUE; |
if(!cnt--) |
{ |
cnt = 9; |
cnt_1ms++; |
cnt_1ms %= 2; |
if(!cnt_1ms) UpdateMotor = 1; |
CountMilliseconds++; |
} |
if(beeptime > 1) |
{ |
beeptime--; |
if(beeptime & BeepMuster) |
{ |
pieper_ein = 1; |
} |
else pieper_ein = 0; |
} |
else |
{ |
pieper_ein = 0; |
BeepMuster = 0xffff; |
} |
if(pieper_ein) |
{ |
if(PlatinenVersion == 10) PORTD |= (1<<2); // Speaker an PORTD.2 |
else PORTC |= (1<<7); // Speaker an PORTC.7 |
} |
else |
{ |
if(PlatinenVersion == 10) PORTD &= ~(1<<2); |
else PORTC &= ~(1<<7); |
} |
if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV) |
{ |
MM3_timer0(); // Kompass auslesen |
if (!cntKompass--) // Aufruf mit 25 Hz |
{ |
if (MM3_heading() > 0) { KompassValue = 360-MM3_heading();} |
if (MM3_heading() < 0 ) { KompassValue = MM3_heading()*-1;} |
KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) -180; |
cntKompass = 640; |
} |
} |
} |
void Timer_Init(void) |
{ |
tim_main = SetDelay(10); |
TCCR0B = CK8; |
TCCR0A = (1<<COM0A1)|(1<<COM0B1)|3;//fast PWM |
OCR0A = 0; |
OCR0B = 120; |
TCNT0 = -TIMER_RELOAD_VALUE; // reload |
//OCR1 = 0x00; |
TCCR2A=(1<<COM2A1)|(1<<COM2A0)|3; |
TCCR2B=(0<<CS20)|(1<<CS21)|(1<<CS22); |
// TIMSK2 |= _BV(TOIE2); |
TIMSK2 |= _BV(OCIE2A); |
TIMSK0 |= _BV(TOIE0); |
OCR2A = 10; |
TCNT2 = 0; |
} |
// ----------------------------------------------------------------------- |
unsigned int SetDelay (unsigned int t) |
{ |
// TIMSK0 &= ~_BV(TOIE0); |
return(CountMilliseconds + t + 1); |
// TIMSK0 |= _BV(TOIE0); |
} |
// ----------------------------------------------------------------------- |
char CheckDelay(unsigned int t) |
{ |
// TIMSK0 &= ~_BV(TOIE0); |
return(((t - CountMilliseconds) & 0x8000) >> 9); |
// TIMSK0 |= _BV(TOIE0); |
} |
// ----------------------------------------------------------------------- |
void Delay_ms(unsigned int w) |
{ |
unsigned int akt; |
akt = SetDelay(w); |
while (!CheckDelay(akt)); |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Servo ansteuern |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(SIG_OUTPUT_COMPARE2A) |
{ |
static unsigned char timer = 10; |
if(!timer--) |
{ |
TCCR2A=(1<<COM2A1)|(0<<COM2A0)|3; |
ServoValue = Parameter_ServoNickControl; |
if(EE_Parameter.ServoNickCompInvert & 0x01) ServoValue += ((long) EE_Parameter.ServoNickComp * (IntegralNick / 128)) / 512; |
else ServoValue -= ((long) EE_Parameter.ServoNickComp * (IntegralNick / 128)) / 512; |
if(ServoValue < EE_Parameter.ServoNickMin) ServoValue = EE_Parameter.ServoNickMin; |
else if(ServoValue > EE_Parameter.ServoNickMax) ServoValue = EE_Parameter.ServoNickMax; |
OCR2A = ServoValue;// + 75; |
timer = EE_Parameter.ServoNickRefresh; |
} |
else |
{ |
TCCR2A =3; |
PORTD&=~0x80; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/timer0.h |
---|
0,0 → 1,15 |
#define TIMER_TEILER CK8 |
#define TIMER_RELOAD_VALUE 250 |
void Timer_Init(void); |
void Delay_ms(unsigned int); |
unsigned int SetDelay (unsigned int t); |
char CheckDelay (unsigned int t); |
extern volatile unsigned int CountMilliseconds; |
extern volatile unsigned char UpdateMotor; |
extern volatile unsigned int beeptime; |
extern volatile unsigned int cntKompass; |
extern int ServoValue; |
extern unsigned int BeepMuster; |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/twimaster.c |
---|
0,0 → 1,152 |
/*############################################################################ |
############################################################################*/ |
#include "main.h" |
unsigned char twi_state = 0; |
unsigned char motor = 0; |
unsigned char motorread = 0; |
unsigned char motor_rx[8]; |
//############################################################################ |
//Initzialisieren der I2C (TWI) Schnittstelle |
void i2c_init(void) |
//############################################################################ |
{ |
TWSR = 0; |
TWBR = ((SYSCLK/SCL_CLOCK)-16)/2; |
} |
//############################################################################ |
//Start I2C |
char i2c_start(void) |
//############################################################################ |
{ |
TWCR = (1<<TWSTA) | (1<<TWEN) | (1<<TWINT) | (1<<TWIE); |
return(0); |
} |
//############################################################################ |
//Start I2C |
void i2c_stop(void) |
//############################################################################ |
{ |
TWCR = (1<<TWEN) | (1<<TWSTO) | (1<<TWINT); |
} |
void i2c_reset(void) |
//############################################################################ |
{ |
i2c_stop(); |
twi_state = 0; |
motor = TWDR; |
motor = 0; |
TWCR = 0x80; |
TWAMR = 0; |
TWAR = 0; |
TWDR = 0; |
TWSR = 0; |
TWBR = 0; |
i2c_init(); |
i2c_start(); |
i2c_write_byte(0); |
} |
//############################################################################ |
//Start I2C |
char i2c_write_byte(char byte) |
//############################################################################ |
{ |
TWSR = 0x00; |
TWDR = byte; |
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWIE); |
return(0); |
} |
//############################################################################ |
//Start I2C |
SIGNAL (TWI_vect) |
//############################################################################ |
{ |
switch (twi_state++) |
{ |
case 0: |
i2c_write_byte(0x52+(motor*2)); |
break; |
case 1: |
switch(motor++) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 2: |
i2c_stop(); |
if (motor<4) twi_state = 0; |
else motor = 0; |
i2c_start(); |
break; |
//Liest Daten von Motor |
case 3: |
i2c_write_byte(0x53+(motorread*2)); |
break; |
case 4: |
switch(motorread) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 5: //1 Byte vom Motor lesen |
motor_rx[motorread] = TWDR; |
case 6: |
switch(motorread) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 7: //2 Byte vom Motor lesen |
motor_rx[motorread+4] = TWDR; |
motorread++; |
if (motorread>3) motorread=0; |
i2c_stop(); |
I2CTimeout = 10; |
twi_state = 0; |
} |
TWCR |= 0x80; |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/twimaster.h |
---|
0,0 → 1,32 |
/*############################################################################ |
############################################################################*/ |
#ifndef _I2C_MASTER_H |
#define _I2C_MASTER_H |
//############################################################################ |
// I2C Konstanten |
#define SCL_CLOCK 200000L |
#define I2C_TIMEOUT 30000 |
#define I2C_START 0x08 |
#define I2C_REPEATED_START 0x10 |
#define I2C_TX_SLA_ACK 0x18 |
#define I2C_TX_DATA_ACK 0x28 |
#define I2C_RX_SLA_ACK 0x40 |
#define I2C_RX_DATA_ACK 0x50 |
//############################################################################ |
extern unsigned char twi_state; |
extern unsigned char motor; |
extern unsigned char motorread; |
extern unsigned char motor_rx[8]; |
void i2c_init (void); // I2C initialisieren |
char i2c_start (void); // Start I2C |
void i2c_stop (void); // Stop I2C |
char i2c_write_byte (char byte); // 1 Byte schreiben |
#endif |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/uart.c |
---|
0,0 → 1,644 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// + |
// + GPS read out: |
// + modified Version of the Pitschu Brushless Ufo - (c) Peter Schulten, Mülheim, Germany |
// + only for non-profit use |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
#include "uart.h" |
unsigned char DebugGetAnforderung = 0,DebugDisplayAnforderung = 0,DebugDataAnforderung = 0,GetVersionAnforderung = 0; |
unsigned volatile char SioTmp = 0; |
unsigned volatile char SendeBuffer[MAX_SENDE_BUFF]; |
unsigned volatile char RxdBuffer[MAX_EMPFANGS_BUFF]; |
unsigned volatile char NMEABuffer[MAX_EMPFANGS_BUFF]; |
unsigned volatile char NeuerDatensatzEmpfangen = 0; |
unsigned volatile char NeueKoordinateEmpfangen = 0; |
unsigned volatile char UebertragungAbgeschlossen = 1; |
unsigned volatile char CntCrcError = 0; |
unsigned volatile char AnzahlEmpfangsBytes = 0; |
unsigned volatile char PC_DebugTimeout = 0; |
unsigned char PcZugriff = 100; |
unsigned char MotorTest[4] = {0,0,0,0}; |
unsigned char MeineSlaveAdresse; |
struct str_DebugOut DebugOut; |
struct str_Debug DebugIn; |
struct str_VersionInfo VersionInfo; |
int Debug_Timer; |
static uint8_t gpsState; |
#define GPS_EMPTY 0 |
#define GPS_SYNC1 1 |
#define GPS_SYNC2 2 |
#define GPS_CLASS 3 |
#define GPS_LEN1 4 |
#define GPS_LEN2 5 |
#define GPS_FILLING 6 |
#define GPS_CKA 7 |
#define GPS_CKB 8 |
gpsInfo_t actualPos; // measured position (last gps record) |
#define SYNC_CHAR1 0xb5 |
#define SYNC_CHAR2 0x62 |
#define CLASS_NAV 0x01 |
#define MSGID_POSECEF 0x01 |
#define MSGID_STATUS 0x03 |
#define MSGID_VELECEF 0x11 |
#define MSGID_POSUTM 0x08 |
#define MSGID_VELNED 0x12 |
typedef struct { |
unsigned long ITOW; // time of week |
uint8_t GPSfix; // GPSfix Type, range 0..6 |
uint8_t Flags; // Navigation Status Flags |
uint8_t DiffS; // Differential Status |
uint8_t res; // reserved |
unsigned long TTFF; // Time to first fix (millisecond time tag) |
unsigned long MSSS; // Milliseconds since Startup / Reset |
uint8_t packetStatus; |
} NAV_STATUS_t; |
typedef struct { |
unsigned long ITOW; // time of week |
long LON; // longitude in 1e-07 deg |
long LAT; // lattitude |
long HEIGHT; // height in mm |
long HMSL; // height above mean sea level im mm |
unsigned long Hacc; // horizontal accuracy in mm |
unsigned long Vacc; // vertical accuracy in mm |
uint8_t packetStatus; |
} NAV_POSLLH_t; |
typedef struct { |
unsigned long ITOW; // time of week |
long EAST; // cm UTM Easting |
long NORTH; // cm UTM Nording |
long ALT; // cm altitude |
uint8_t ZONE; // UTM zone number |
uint8_t HEM; // Hemisphere Indicator (0=North, 1=South) |
uint8_t packetStatus; |
} NAV_POSUTM_t; |
typedef struct { |
unsigned long ITOW; // ms GPS Millisecond Time of Week |
long VEL_N; // cm/s NED north velocity |
long VEL_E; // cm/s NED east velocity |
long VEL_D; // cm/s NED down velocity |
unsigned long Speed; // cm/s Speed (3-D) |
unsigned long GSpeed; // cm/s Ground Speed (2-D) |
long Heading; // deg (1e-05) Heading 2-D |
unsigned long SAcc; // cm/s Speed Accuracy Estimate |
unsigned long CAcc; // deg Course / Heading Accuracy Estimate |
uint8_t packetStatus; |
} NAV_VELNED_t; |
typedef struct { |
unsigned long ITOW; // ms GPS Millisecond Time of Week |
long ECEF_X; // ecef x / cm |
long ECEF_Y; // ecef y / cm |
long ECEF_Z; // ecef z / cm |
unsigned long Pacc; // Abweichung |
uint8_t packetStatus; |
} NAV_POSECEF_t ; |
typedef struct { |
unsigned long ITOW; // ms GPS Millisecond Time of Week |
long ECEFVX; // ecef x velocity cm/s |
long ECEFVY; // ecef y velocity cm/s |
long ECEFVZ; // ecef z velocity cm/s |
unsigned long SAcc; // Abweichung |
uint8_t packetStatus; |
} NAV_VELECEF_t; |
NAV_STATUS_t navStatus; |
NAV_POSECEF_t navPosECEF; |
NAV_VELECEF_t navVelECEF; |
NAV_POSUTM_t navPosUtm; |
NAV_VELNED_t navVelNed; |
volatile char *ubxP, *ubxEp, *ubxSp; // pointers to packet currently transfered |
volatile uint8_t CK_A, CK_B; // UBX checksum bytes |
volatile unsigned short msgLen; |
volatile uint8_t msgID; |
volatile uint8_t ignorePacket; // true when previous packet was not processed |
// distance to target position |
long rollOffset; // in 10cm |
long nickOffset; |
#define GPS_INTCYCLES 100 |
#define GPS_I_LIMIT (long)(40 * MAINLOOPS_PER_SEC) |
#ifdef GPS_DEBUG // if set then the GPS data is transfered to display |
extern volatile uint8_t v24state; |
char buf[200]; |
char *bp; |
char *ep; |
#endif |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//++ Sende-Part der Datenübertragung |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(INT_VEC_TX) |
{ |
static unsigned int ptr = 0; |
unsigned char tmp_tx; |
if(!UebertragungAbgeschlossen) |
{ |
ptr++; // die [0] wurde schon gesendet |
tmp_tx = SendeBuffer[ptr]; |
if((tmp_tx == '\r') || (ptr == MAX_SENDE_BUFF)) |
{ |
ptr = 0; |
UebertragungAbgeschlossen = 1; |
} |
UDR = tmp_tx; |
} |
else ptr = 0; |
} |
void GPSscanData (void) |
{ |
if (navPosECEF.packetStatus == 1) // valid packet |
{ |
actualPos.x = navPosECEF.ECEF_X; //ECEF X in cm |
actualPos.y = navPosECEF.ECEF_Y; //ECEF Y in cm |
actualPos.z = navPosECEF.ECEF_Z; //ECEF Z in cm |
navPosECEF.packetStatus = 0; |
} |
if (navStatus.packetStatus == 1) // valid packet |
{ |
actualPos.GPSFix = navStatus.GPSfix; |
actualPos.newData = 1; // navStatus.packetStatus |
navStatus.packetStatus = 0; |
} |
if (navVelECEF.packetStatus == 1) // valid packet |
{ |
actualPos.vx = navVelECEF.ECEFVX; //ECEF VEL X in cm/s |
actualPos.vy = navVelECEF.ECEFVY; //ECEF VEL Y in cm/s |
actualPos.vz = navVelECEF.ECEFVZ; //ECEF VEL Z in cm/s |
navVelECEF.packetStatus = 0; |
} |
if (navPosUtm.packetStatus == 1) // valid packet |
{ |
actualPos.northing = navPosUtm.NORTH; |
actualPos.easting = navPosUtm.EAST; |
actualPos.altitude = navPosUtm.ALT; |
navPosUtm.packetStatus = 0; |
} |
if (navVelNed.packetStatus == 1) |
{ |
actualPos.velNorth = navVelNed.VEL_N; |
actualPos.velEast = navVelNed.VEL_E; |
navVelNed.packetStatus = 0; |
} |
if (actualPos.newData != 0){ROT_ON;} //-> Rot blinkt mit 4Hz wenn Daten vom GPS Empfänger ankommen und brauchbar sind |
} |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//++ Empfangs-Part der Datenübertragung, incl. CRC-Auswertung |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(INT_VEC_RX) |
{ |
static unsigned int crc; |
static unsigned char crc1,crc2,buf_ptr; |
static unsigned char UartState = 0; |
unsigned char CrcOkay = 0; |
SioTmp = UDR; |
uint8_t c; |
uint8_t re; |
re = (UCSR0A & (_B1(FE0) | _B1(DOR0))); // any error occured ? |
c = SioTmp; |
#ifdef GPS_DEBUG |
*bp++ = c; |
if (bp >= (buf+200)) bp = buf; |
if (v24state == 0) |
{ |
v24state = 1; |
UDR0 = *ep++; |
if (ep >= buf+200) |
ep = buf; |
UCSR0B |= _B1(UDRIE0); //enable further irqs |
} |
#endif |
if (re == 0) |
{ |
switch (gpsState) |
{ |
case GPS_EMPTY: |
if (c == SYNC_CHAR1) |
gpsState = GPS_SYNC1; |
break; |
case GPS_SYNC1: |
if (c == SYNC_CHAR2) |
gpsState = GPS_SYNC2; |
else if (c != SYNC_CHAR1) |
gpsState = GPS_EMPTY; |
break; |
case GPS_SYNC2: |
if (c == CLASS_NAV) |
gpsState = GPS_CLASS; |
else |
gpsState = GPS_EMPTY; |
break; |
case GPS_CLASS: // msg ID seen: init packed receive |
msgID = c; |
CK_A = CLASS_NAV + c; |
CK_B = CLASS_NAV + CK_A; |
gpsState = GPS_LEN1; |
switch (msgID) |
{ |
case MSGID_STATUS: |
ubxP = (char*)&navStatus; |
ubxEp = (char*)(&navStatus + sizeof(NAV_STATUS_t)); |
ubxSp = (char*)&navStatus.packetStatus; |
ignorePacket = navStatus.packetStatus; |
break; |
case MSGID_POSECEF: |
ubxP = (char*)&navPosECEF; |
ubxEp = (char*)(&navPosECEF + sizeof(NAV_POSECEF_t)); |
ubxSp = (char*)&navPosECEF.packetStatus; |
ignorePacket = navPosECEF.packetStatus; |
break; |
case MSGID_VELECEF: |
ubxP = (char*)&navVelECEF; |
ubxEp = (char*)(&navVelECEF + sizeof(NAV_VELECEF_t)); |
ubxSp = (char*)&navVelECEF.packetStatus; |
ignorePacket = navVelECEF.packetStatus; |
break; |
case MSGID_POSUTM: |
ubxP = (char*)&navPosUtm; |
ubxEp = (char*)(&navPosUtm + sizeof(NAV_POSUTM_t)); |
ubxSp = (char*)&navPosUtm.packetStatus; |
ignorePacket = navPosUtm.packetStatus; |
break; |
case MSGID_VELNED: |
ubxP = (char*)&navVelNed; |
ubxEp = (char*)(&navVelNed + sizeof(NAV_VELNED_t)); |
ubxSp = (char*)&navVelNed.packetStatus; |
ignorePacket = navVelNed.packetStatus; |
break; |
default: |
ignorePacket = 1; |
ubxSp = (char*)0; |
} |
break; |
case GPS_LEN1: // first len byte |
msgLen = c; |
CK_A += c; |
CK_B += CK_A; |
gpsState = GPS_LEN2; |
break; |
case GPS_LEN2: // second len byte |
msgLen = msgLen + (c * 256); |
CK_A += c; |
CK_B += CK_A; |
gpsState = GPS_FILLING; // next data will be stored in packet struct |
break; |
case GPS_FILLING: |
CK_A += c; |
CK_B += CK_A; |
if ( !ignorePacket && ubxP < ubxEp) |
*ubxP++ = c; |
if (--msgLen == 0) |
gpsState = GPS_CKA; |
break; |
case GPS_CKA: |
if (c == CK_A) |
gpsState = GPS_CKB; |
else |
gpsState = GPS_EMPTY; |
break; |
case GPS_CKB: |
if (c == CK_B && ubxSp) // No error -> packet received successfully |
*ubxSp = 1; // set packetStatus in struct |
gpsState = GPS_EMPTY; // ready for next packet |
break; |
default: |
gpsState = GPS_EMPTY; // ready for next packet |
} |
} |
else // discard any data if error occured |
{ |
gpsState = GPS_EMPTY; |
actualPos.newData = 0; // mal auf nummer sicher gehen |
//GPSscanData (); //Test kann ggf. wieder gelöscht werden! |
} |
GPSscanData (); |
if(buf_ptr >= MAX_EMPFANGS_BUFF) UartState = 0; |
if(SioTmp == '\r' && UartState == 2) |
{ |
UartState = 0; |
crc -= RxdBuffer[buf_ptr-2]; |
crc -= RxdBuffer[buf_ptr-1]; |
crc %= 4096; |
crc1 = '=' + crc / 64; |
crc2 = '=' + crc % 64; |
CrcOkay = 0; |
if((crc1 == RxdBuffer[buf_ptr-2]) && (crc2 == RxdBuffer[buf_ptr-1])) CrcOkay = 1; else { CrcOkay = 0; CntCrcError++;}; |
if(!NeuerDatensatzEmpfangen && CrcOkay) // Datensatz schon verarbeitet |
{ |
NeuerDatensatzEmpfangen = 1; |
AnzahlEmpfangsBytes = buf_ptr; |
RxdBuffer[buf_ptr] = '\r'; |
if(RxdBuffer[2] == 'R') wdt_enable(WDTO_250MS); // Reset-Commando |
} |
} |
else |
switch(UartState) |
{ |
case 0: |
if(SioTmp == '#' && !NeuerDatensatzEmpfangen) UartState = 1; // Startzeichen und Daten schon verarbeitet |
buf_ptr = 0; |
RxdBuffer[buf_ptr++] = SioTmp; |
crc = SioTmp; |
break; |
case 1: // Adresse auswerten |
UartState++; |
RxdBuffer[buf_ptr++] = SioTmp; |
crc += SioTmp; |
break; |
case 2: // Eingangsdaten sammeln |
RxdBuffer[buf_ptr] = SioTmp; |
if(buf_ptr < MAX_EMPFANGS_BUFF) buf_ptr++; |
else UartState = 0; |
crc += SioTmp; |
break; |
default: |
UartState = 0; |
break; |
} |
} |
// -------------------------------------------------------------------------- |
void AddCRC(unsigned int wieviele) |
{ |
unsigned int tmpCRC = 0,i; |
for(i = 0; i < wieviele;i++) |
{ |
tmpCRC += SendeBuffer[i]; |
} |
tmpCRC %= 4096; |
SendeBuffer[i++] = '=' + tmpCRC / 64; |
SendeBuffer[i++] = '=' + tmpCRC % 64; |
SendeBuffer[i++] = '\r'; |
UebertragungAbgeschlossen = 0; |
UDR = SendeBuffer[0]; |
} |
// -------------------------------------------------------------------------- |
void SendOutData(unsigned char cmd,unsigned char modul, unsigned char *snd, unsigned char len) |
{ |
unsigned int pt = 0; |
unsigned char a,b,c; |
unsigned char ptr = 0; |
SendeBuffer[pt++] = '#'; // Startzeichen |
SendeBuffer[pt++] = modul; // Adresse (a=0; b=1,...) |
SendeBuffer[pt++] = cmd; // Commando |
while(len) |
{ |
if(len) { a = snd[ptr++]; len--;} else a = 0; |
if(len) { b = snd[ptr++]; len--;} else b = 0; |
if(len) { c = snd[ptr++]; len--;} else c = 0; |
SendeBuffer[pt++] = '=' + (a >> 2); |
SendeBuffer[pt++] = '=' + (((a & 0x03) << 4) | ((b & 0xf0) >> 4)); |
SendeBuffer[pt++] = '=' + (((b & 0x0f) << 2) | ((c & 0xc0) >> 6)); |
SendeBuffer[pt++] = '=' + ( c & 0x3f); |
} |
AddCRC(pt); |
} |
// -------------------------------------------------------------------------- |
void Decode64(unsigned char *ptrOut, unsigned char len, unsigned char ptrIn,unsigned char max) // Wohin mit den Daten; Wie lang; Wo im RxdBuffer |
{ |
unsigned char a,b,c,d; |
unsigned char ptr = 0; |
unsigned char x,y,z; |
while(len) |
{ |
a = RxdBuffer[ptrIn++] - '='; |
b = RxdBuffer[ptrIn++] - '='; |
c = RxdBuffer[ptrIn++] - '='; |
d = RxdBuffer[ptrIn++] - '='; |
if(ptrIn > max - 2) break; // nicht mehr Daten verarbeiten, als empfangen wurden |
x = (a << 2) | (b >> 4); |
y = ((b & 0x0f) << 4) | (c >> 2); |
z = ((c & 0x03) << 6) | d; |
if(len--) ptrOut[ptr++] = x; else break; |
if(len--) ptrOut[ptr++] = y; else break; |
if(len--) ptrOut[ptr++] = z; else break; |
} |
} |
// -------------------------------------------------------------------------- |
void BearbeiteRxDaten(void) |
{ |
if(!NeuerDatensatzEmpfangen) return; |
unsigned int tmp_int_arr1[1]; |
unsigned int tmp_int_arr2[2]; |
unsigned int tmp_int_arr3[3]; |
unsigned char tmp_char_arr2[2]; |
unsigned char tmp_char_arr3[3]; |
unsigned char tmp_char_arr4[4]; |
//if(!MotorenEin) |
PcZugriff = 255; |
switch(RxdBuffer[2]) |
{ |
case 'c':// Debugdaten incl. Externe IOs usw |
Decode64((unsigned char *) &DebugIn,sizeof(DebugIn),3,AnzahlEmpfangsBytes); |
/* for(unsigned char i=0; i<4;i++) |
{ |
EE_CheckAndWrite(&EE_Buffer[EE_DEBUGWERTE + i*2], DebugIn.Analog[i]); |
EE_CheckAndWrite(&EE_Buffer[EE_DEBUGWERTE + i*2 + 1], DebugIn.Analog[i] >> 8); |
}*/ |
//RemoteTasten |= DebugIn.RemoteTasten; |
DebugDataAnforderung = 1; |
break; |
case 'h':// x-1 Displayzeilen |
Decode64((unsigned char *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes); |
RemoteTasten |= tmp_char_arr2[0]; |
DebugDisplayAnforderung = 1; |
break; |
case 't':// Motortest |
Decode64((unsigned char *) &MotorTest[0],sizeof(MotorTest),3,AnzahlEmpfangsBytes); |
break; |
case 'v': // Version-Anforderung und Ausbaustufe |
GetVersionAnforderung = 1; |
break; |
case 'g':// "Get"-Anforderung für Debug-Daten |
// Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
DebugGetAnforderung = 1; |
break; |
case 'q':// "Get"-Anforderung für Settings |
// Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
Decode64((unsigned char *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes); |
if(tmp_char_arr2[0] != 0xff) |
{ |
if(tmp_char_arr2[0] > 5) tmp_char_arr2[0] = 5; |
ReadParameterSet(tmp_char_arr2[0], (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
SendOutData('L' + tmp_char_arr2[0] -1,MeineSlaveAdresse,(unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE); |
} |
else |
SendOutData('L' + GetActiveParamSetNumber()-1,MeineSlaveAdresse,(unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE); |
break; |
case 'l': |
case 'm': |
case 'n': |
case 'o': |
case 'p': // Parametersatz speichern |
Decode64((unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE,3,AnzahlEmpfangsBytes); |
WriteParameterSet(RxdBuffer[2] - 'l' + 1, (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], RxdBuffer[2] - 'l' + 1); // aktiven Datensatz merken |
Piep(GetActiveParamSetNumber()); |
break; |
} |
// DebugOut.AnzahlZyklen = Debug_Timer_Intervall; |
NeuerDatensatzEmpfangen = 0; |
} |
//############################################################################ |
//Routine für die Serielle Ausgabe |
int uart_putchar (char c) |
//############################################################################ |
{ |
if (c == '\n') |
uart_putchar('\r'); |
//Warten solange bis Zeichen gesendet wurde |
loop_until_bit_is_set(USR, UDRE); |
//Ausgabe des Zeichens |
UDR = c; |
return (0); |
} |
// -------------------------------------------------------------------------- |
void WriteProgramData(unsigned int pos, unsigned char wert) |
{ |
//if (ProgramLocation == IN_RAM) Buffer[pos] = wert; |
// else eeprom_write_byte(&EE_Buffer[pos], wert); |
// Buffer[pos] = wert; |
} |
//############################################################################ |
//INstallation der Seriellen Schnittstelle |
void UART_Init (void) |
//############################################################################ |
{ |
//Enable TXEN im Register UCR TX-Data Enable & RX Enable |
UCR=(1 << TXEN) | (1 << RXEN); |
// UART Double Speed (U2X) |
USR |= (1<<U2X); |
// RX-Interrupt Freigabe |
UCSRB |= (1<<RXCIE); |
// TX-Interrupt Freigabe |
UCSRB |= (1<<TXCIE); |
//Teiler wird gesetzt |
UBRR=(SYSCLK / (BAUD_RATE * 8L) - 1); |
//UBRR = 33; |
//öffnet einen Kanal für printf (STDOUT) |
//fdevopen (uart_putchar, 0); |
//sbi(PORTD,4); |
Debug_Timer = SetDelay(200); |
gpsState = GPS_EMPTY; |
} |
//--------------------------------------------------------------------------------------------- |
void DatenUebertragung(void) |
{ |
static char dis_zeile = 0; |
if(!UebertragungAbgeschlossen) return; |
if(DebugGetAnforderung && UebertragungAbgeschlossen) // Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
{ |
SendOutData('G',MeineSlaveAdresse,(unsigned char *) &DebugIn,sizeof(DebugIn)); |
DebugGetAnforderung = 0; |
} |
if((CheckDelay(Debug_Timer) || DebugDataAnforderung) && UebertragungAbgeschlossen) |
{ |
SendOutData('D',MeineSlaveAdresse,(unsigned char *) &DebugOut,sizeof(DebugOut)); |
DebugDataAnforderung = 0; |
Debug_Timer = SetDelay(MIN_DEBUG_INTERVALL); |
} |
if(DebugDisplayAnforderung && UebertragungAbgeschlossen) |
{ |
Menu(); |
DebugDisplayAnforderung = 0; |
if(++dis_zeile == 4) |
{ |
SendOutData('4',0,&PPM_in,sizeof(PPM_in)); // DisplayZeile übertragen |
dis_zeile = -1; |
} |
else SendOutData('0' + dis_zeile,0,&DisplayBuff[20 * dis_zeile],20); // DisplayZeile übertragen |
} |
if(GetVersionAnforderung && UebertragungAbgeschlossen) |
{ |
SendOutData('V',MeineSlaveAdresse,(unsigned char *) &VersionInfo,sizeof(VersionInfo)); |
GetVersionAnforderung = 0; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/uart.h |
---|
0,0 → 1,119 |
#ifndef _UART_H |
#define _UART_H |
#define MAX_SENDE_BUFF 150 |
#define MAX_EMPFANGS_BUFF 150 |
extern unsigned char DebugGetAnforderung; |
extern unsigned volatile char SendeBuffer[MAX_SENDE_BUFF]; |
extern unsigned volatile char RxdBuffer[MAX_EMPFANGS_BUFF]; |
extern unsigned volatile char UebertragungAbgeschlossen; |
extern unsigned volatile char PC_DebugTimeout; |
extern unsigned volatile char NeueKoordinateEmpfangen; |
extern unsigned char MeineSlaveAdresse; |
extern unsigned char PcZugriff; |
extern int Debug_Timer; |
extern void UART_Init (void); |
extern int uart_putchar (char c); |
extern void boot_program_page (uint32_t page, uint8_t *buf); |
extern void DatenUebertragung(void); |
extern void DecodeNMEA(void); |
extern unsigned char MotorTest[4]; |
struct str_DebugOut |
{ |
unsigned char Digital[2]; |
unsigned int Analog[32]; // Debugwerte |
}; |
extern struct str_DebugOut DebugOut; |
#define _B1(bit) (1 << (bit)) |
#define _B0(bit) (0 << (bit)) |
typedef struct |
{ |
long x; // in cm (+ = north) |
long y; // in cm (+ = east) |
long z; // in cm |
long vx; |
long vy; |
long vz; |
long northing; |
long easting; |
long altitude; |
long velNorth; |
long velEast; |
uint8_t newData; // status of data: 0 = invlid; 1 = valid |
uint8_t GPSFix; |
uint8_t noSV; // number of sats |
} gpsInfo_t; |
extern gpsInfo_t lockedPos; // stored position to fly to |
extern gpsInfo_t actualPos; // measured position (last gps record) |
extern void GPSscanData (void); |
extern void GPSupdate(void); |
extern void GPSsaveTarget (uint8_t mode); |
struct str_Debug |
{ |
unsigned char Digital[2]; |
unsigned char RemoteTasten; |
unsigned int Analog[4]; |
}; |
extern struct str_Debug DebugIn; |
struct str_VersionInfo |
{ |
unsigned char Hauptversion; |
unsigned char Nebenversion; |
unsigned char PCKompatibel; |
unsigned char Rserved[7]; |
}; |
extern struct str_VersionInfo VersionInfo; |
//Die Baud_Rate der Seriellen Schnittstelle ist 9600 Baud |
//#define BAUD_RATE 9600 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 14400 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 28800 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 38400 //Baud Rate für die Serielle Schnittstelle |
#define BAUD_RATE 57600 //Baud Rate für die Serielle Schnittstelle |
//Anpassen der seriellen Schnittstellen Register wenn ein ATMega128 benutzt wird |
#if defined (__AVR_ATmega128__) |
# define USR UCSR0A |
# define UCR UCSR0B |
# define UDR UDR0 |
# define UBRR UBRR0L |
# define EICR EICRB |
#endif |
#if defined (__AVR_ATmega32__) |
# define USR UCSRA |
# define UCR UCSRB |
# define UBRR UBRRL |
# define EICR EICRB |
# define INT_VEC_RX SIG_UART_RECV |
# define INT_VEC_TX SIG_UART_TRANS |
#endif |
#if defined (__AVR_ATmega644__) |
# define USR UCSR0A |
# define UCR UCSR0B |
# define UDR UDR0 |
# define UBRR UBRR0L |
# define EICR EICR0B |
# define TXEN TXEN0 |
# define RXEN RXEN0 |
# define RXCIE RXCIE0 |
# define TXCIE TXCIE0 |
# define U2X U2X0 |
# define UCSRB UCSR0B |
# define UDRE UDRE0 |
# define INT_VEC_RX SIG_USART_RECV |
# define INT_VEC_TX SIG_USART_TRANS |
#endif |
#endif //_UART_H |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666Acc250/version.txt |
---|
0,0 → 1,104 |
------- |
V0.53 27.04.2007 H.Buss |
- erste öffentliche Version |
V0.53b 29.04.2007 H.Buss |
- der FAKTOR_I war versehentlich auf Null, dann liegt der MikroKopter nicht so hart in der Luft |
V0.53c 29.04.2007 H.Buss |
- es gib ein Menü, in dem die Werte der Kanäle nach Nick, Roll, Gas,... sortiert sind. |
Die angezeigten Werte waren nicht die Werte der Funke |
V0.54 01.05.2007 H.Buss |
- die Paramtersätze können jetzt vor dem Start ausgewählt werden |
Dazu wird beim Kalibrieren der Messwerte (Gashebel oben links) der Nick-Rollhebel abgefragt: |
2 3 4 |
1 x 5 |
- - - |
Bedeutet: Nick-Rollhebel Links Mitte = Setting:1 Links Oben = Setting:2 usw. |
- der Faktor_I für den Hauptregler ist hinzugekommen. Im Heading-Hold-Modus sollte er vergössert werden, was Stabilität bringt |
V0.55 14.05.2007 H.Buss |
- es können nun Servos an J3,J4,J5 mit den Kanälen 5-7 gesteuert werden |
V0.56 14.05.2007 H.Buss |
- es gab Probleme mit Funken, die mehr als 8 Kanäle haben, wenn mehrere Kanäle dann auf Null waren |
- Funken, die nicht bis +-120 aussteuern können, sollten jetzt auch gehen |
V0.57 24.05.2007 H.Buss |
- Der Höhenregler kann nun auch mittels Schalter bedient werden |
- Bug im Gier-Algorithmus behoben; Schnelles Gieren fürhrte dazu, dass der MK zu weit gedreht hat |
- Kompass-Einfluss dämpfen bei Neigung |
- Man kann zwischen Kompass FIX (Richtung beim Kalibrieren) und Variabel (einstellbar per Gier) wählen |
- Der Motortest vom Kopter-Tool geht jetzt |
- Man kann den Parametersätzen einen Namen geben |
- Das Kamerasetting ist unter Setting 2 defaultmässig integriert |
V0.58 30.05.2007 H.Buss |
- Der Höhenregler-Algorithmus wird nun umgangen, wenn der Höhenreglerschalter aus ist |
V0.60 17.08.2007 H.Buss |
- "Schwindel-Bug" behoben |
- Die Poti-Werte werden jetzt auf Unterlauf (<0) überprüft |
- Poti4 zugefügt |
- Es werden jetzt 8 Kanäle ausgewertet |
- Kamera-Servo (an J7) |
- Die Settings müssen überschrieben werden |
V0.61 - V0.63 H.Buss 27.09.2007 |
- Poti 4 und Kanal 8 werden im Menü angezeigt |
- ein paar Kleinigkeiten bei den DefaultKonstanten2 bereinigt |
- Analog.c: Aktuell_ax korrigiert |
- auf 32 Debug-Kanäle erweitert |
- Loopings sind jetzt möglich und einzeln im KopterTool freischaltbar |
- leichte Anpassungen im Gier - Geschwindigkeit und Drift |
- die Hardwareversion V1.1 wird erkannt und das Programm stellt sich auf die geänderte Gyroverstärkung und die geänderten Portpins ein |
- die Software startet nach dem Einschalten schneller, weil der Luftdruckoffset schneller gefunden wird |
- die PPM-Ausgänge liegen wieder an den Pins an |
- Details an der Sensordatenverarbeitung -> es fliegt sich geringfügig anders |
- der MK ist bei wenig Gas nicht mehr so giftig -> soll das Landen vereinfachen |
- I2C-Bus läuft jetzt sicher nach einer Störung wieder an |
- Sticksignale werden präziser ausgewertet |
- Stick-Kanäle werden ans Kopter-Tool übertragen |
- Es muss die Version V1.47 des Kopter-Tool verwendet werden |
- Die Settings werden auf Default zurückgesetzt |
- am Piepen kann man die Fehlerart unterscheiden |
1. einzelnes Piepen beim Einschalten und Kalibrieren |
2. langsames Intervall mindestens 1 Sek -> Empfangsausfall |
3. schnelleres Intervall mindestens 1 Sek -> Akku |
4. sehr schnelles Intervall mindestens 1 Sek -> Kommunikation zu den Reglern gestört |
V0.64 H.Buss 30.09.2007 |
- beim Gieren wurden die Achsen nicht hart genug geregelt |
- Höhenreglerabsenkung von -20 auf -40 (fc.c) |
- LED1 und LED2 Ansteuerung (fc.c) und (main.h) |
- geänderte Kanalbelegung K1-K8, Unterspannungsschwelle (9,5V) und StickD (fc.c) |
- P,D Anteil seperat in Variable geschrieben und auf das Analog Display Ausgegeben (Kopter Tool) |
- GPS_Nick und GPS_Roll werden nach Deaktivierung von Position-Hold auf Null gesetzt, um ein Einfrieren der GPS Steuerwerte auf den letzten Wert zu verhindern |
- Funktionsaufruf der GPS-Funktion von Chris/Hallo2 |
- UART.C für die GPS Signale im UTM Format auf Pitschu basierend |
- meine GPS.c-Routine |
- Mircos variable Filterung (funktioniert nur wenn 250ms Aufruf aktiv ist) |
- GPS wird deaktiviert und Summer eingeschaltet, wenn kein 3D-Fix (mehr) vorhanden |
- Statusanzeige auf eine LED reduziert (aus, blinkend, an) |
- blinkender LED_1 Ausgang für Positionsleuchten (einstellbar über Userparam.4) |
- Homing-Fkt. eingebaut |
- Diverse Absicherungen gegen Fehlbedienungen (z.B. nicht gelernte Home-Position, ...) |
- Rotationsmatrix mit Kompass, damit die GPS-Fkt. nicht nur nach Norden ausgerichtet funktioniert |
- dyn. Position Hold -> normaler Rundflug möglich |
- Limit_D_Anteil = Userparam3 um im Homing- bzw. Waypointmodus die Sollposition gleichmäßiger anzufliegen |
- Die Berechnung von Kompassvalue wird jetzt auch über den GPS Haken im Koptertool aktiviert |
- 12 Kanal Erweiterung (rc.c; rc.h; fc.c; fc.h; menu.c) |
- D-Anteil_Limit wegen HOMING ->> Radius von 700 cm -> 250 cm |
- ... |
(- Regelung wird nur noch alle 250 ms aufgerufen) |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/Flight-Ctrl_MEGA644_V0_64.aps |
---|
0,0 → 1,0 |
<AVRStudio><MANAGEMENT><ProjectName>Flight-Ctrl_MEGA644_V0_64</ProjectName><Created>19-Aug-2007 14:38:13</Created><LastEdit>15-Oct-2007 19:44:55</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>19-Aug-2007 14:38:13</Created><Version>4</Version><Build>4, 13, 0, 528</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>Flight-Ctrl_MEGA644_V0_64.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>E:\hubi\ufo\mickrokopter\eigene versionen\Kompass + GPS\Flight-Ctrl_V0_64_3_GPS_work_Jochenaccvonhand\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>AVR Simulator</CURRENT_TARGET><CURRENT_PART>ATmega644.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>main.c</SOURCEFILE><SOURCEFILE>analog.c</SOURCEFILE><SOURCEFILE>eeprom.c</SOURCEFILE><SOURCEFILE>fc.c</SOURCEFILE><SOURCEFILE>GPS.c</SOURCEFILE><SOURCEFILE>menu.c</SOURCEFILE><SOURCEFILE>printf_P.c</SOURCEFILE><SOURCEFILE>rc.c</SOURCEFILE><SOURCEFILE>timer0.c</SOURCEFILE><SOURCEFILE>twimaster.c</SOURCEFILE><SOURCEFILE>uart.c</SOURCEFILE><SOURCEFILE>compass.c</SOURCEFILE><HEADERFILE>_Settings.h</HEADERFILE><HEADERFILE>analog.h</HEADERFILE><HEADERFILE>fc.h</HEADERFILE><HEADERFILE>gps.h</HEADERFILE><HEADERFILE>main.h</HEADERFILE><HEADERFILE>menu.h</HEADERFILE><HEADERFILE>old_macros.h</HEADERFILE><HEADERFILE>printf_P.h</HEADERFILE><HEADERFILE>rc.h</HEADERFILE><HEADERFILE>Settings.h</HEADERFILE><HEADERFILE>timer0.h</HEADERFILE><HEADERFILE>twimaster.h</HEADERFILE><HEADERFILE>uart.h</HEADERFILE><HEADERFILE>compass.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega644</PART><HEX>1</HEX><LIST>0</LIST><MAP>0</MAP><OUTPUTFILENAME>Flight-Ctrl_MEGA644_V0_60.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -O0 -fsigned-char</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20070525\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20070525\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/></IOView><Files><File00000><FileId>00000</FileId><FileName>main.c</FileName><Status>1</Status></File00000><File00001><FileId>00001</FileId><FileName>compass.c</FileName><Status>1</Status></File00001><File00002><FileId>00002</FileId><FileName>compass.h</FileName><Status>1</Status></File00002><File00003><FileId>00003</FileId><FileName>fc.c</FileName><Status>1</Status></File00003></Files><Workspace><File00000><Position>346 108 878 484</Position><LineCol>155 3</LineCol></File00000><File00001><Position>355 114 901 482</Position><LineCol>0 0</LineCol></File00001><File00002><Position>377 136 923 504</Position><LineCol>0 0</LineCol></File00002><File00003><Position>336 71 1048 624</Position><LineCol>834 19</LineCol><State>Maximized</State></File00003></Workspace><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio> |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/GPS.c |
---|
0,0 → 1,300 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 10.2007 by Jochen Kromayer |
// + es handelt sich um eine Beta-Software, die zu nichtkommerziellen Zwecken frei veröffentlich und weitergegeben werden darf. Für evtl. |
// + Personen- und/der Sachschäden ist jegliche Haftung ausgeschlossen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
#include "math.h" |
//Sinusfunktion von 0° bis 359°. Ergebnis wurde mit 1000 multipliziert, damit als Definition platzsparend int |
//verwendet werden kann. d.h., es muss also in der späteren Berechnung noch mit 0,001 multipliziert werden //(090907Kr) |
const int c_sin[] = {0,17,34,52,69,87,104,121,139,156,173,190, |
207,224,241,258,275,292,309,325,342,358,374,390,406,422,438,453,469,484,500,515,529,544,559,573,587,601,615,629, |
642,656,669,682,694,707,719,731,743,754,766,777,788,798,809,819,829,838,848,857,866,874,882,891,898,906,913,920, |
927,933,939,945,951,956,961,965,970,974,978,981,984,987,990,992,994,996,997,998,999,999,1000,999,999,998,997,996, |
994,992,990,987,984,981,978,974,970,965,961,956,951,945,939,933,927,920,913,906,898,891,882,874,866,857,848,838, |
829,819,809,798,788,777,766,754,743,731,719,707,694,682,669,656,642,629,615,601,587,573,559,544,529,515,500,484, |
469,453,438,422,406,390,374,358,342,325,309,292,275,258,241,224,207,190,173,156,139,121,104,87,69,52,34,17,0,-17, |
-34,-52,-69,-87,-104,-121,-139,-156,-173,-190,-207,-224,-241,-258,-275,-292,-309,-325,-342,-358,-374,-390,-406, |
-422,-438,-453,-469,-484,-500,-515,-529,-544,-559,-573,-587,-601,-615,-629,-642,-656,-669,-682,-694,-707,-719, |
-731,-743,-754,-766,-777,-788,-798,-809,-819,-829,-838,-848,-857,-866,-874,-882,-891,-898,-906,-913,-920,-927, |
-933,-939,-945,-951,-956,-961,-965,-970,-974,-978,-981,-984,-987,-990,-992,-994,-996,-997,-998,-999,-999,-1000, |
-999,-999,-998,-997,-996,-994,-992,-990,-987,-984,-981,-978,-974,-970,-965,-961,-956,-951,-945,-939,-933,-927, |
-920,-913,-906,-898,-891,-882,-874,-866,-857,-848,-838,-829,-819,-809,-798,-788,-777,-766,-754,-743,-731,-719, |
-707,-694,-682,-669,-656,-642,-629,-615,-601,-587,-573,-559,-544,-529,-515,-500,-484,-469,-453,-438,-422,-406, |
-390,-374,-358,-342,-325,-309,-292,-275,-258,-241,-224,-207,-190,-173,-156,-139,-121,-104,-87,-69,-52,-34,-17}; |
//Cosinusfunktion von 0° bis 359°. Ergebnis wurde mit 1000 multipliziert, damit als Definition platzsparend int |
//verwendet werden kann. D.h., es muss also in der späteren Berechnung noch mit 0,001 multipliziert werden //(090907Kr) |
const int c_cos[] = {1000,999,999,998,997,996,994,992,990,987,984,981, |
978,974,970,965,961,956,951,945,939,933,927,920,913,906,898,891,882,874,866,857,848,838,829,819,809,798,788,777, |
766,754,743,731,719,707,694,682,669,656,642,629,615,601,587,573,559,544,529,515,500,484,469,453,438,422,406,390, |
374,358,342,325,309,292,275,258,241,224,207,190,173,156,139,121,104,87,69,52,34,17,0,-17,-34,-52,-69,-87,-104, |
-121,-139,-156,-173,-190,-207,-224,-241,-258,-275,-292,-309,-325,-342,-358,-374,-390,-406,-422,-438,-453,-469, |
-484,-500,-515,-529,-544,-559,-573,-587,-601,-615,-629,-642,-656,-669,-682,-694,-707,-719,-731,-743,-754,-766, |
-777,-788,-798,-809,-819,-829,-838,-848,-857,-866,-874,-882,-891,-898,-906,-913,-920,-927,-933,-939,-945,-951, |
-956,-961,-965,-970,-974,-978,-981,-984,-987,-990,-992,-994,-996,-997,-998,-999,-999,-1000,-999,-999,-998,-997, |
-996,-994,-992,-990,-987,-984,-981,-978,-974,-970,-965,-961,-956,-951,-945,-939,-933,-927,-920,-913,-906,-898, |
-891,-882,-874,-866,-857,-848,-838,-829,-819,-809,-798,-788,-777,-766,-754,-743,-731,-719,-707,-694,-682,-669, |
-656,-642,-629,-615,-601,-587,-573,-559,-544,-529,-515,-500,-484,-469,-453,-438,-422,-406,-390,-374,-358,-342, |
-325,-309,-292,-275,-258,-241,-224,-207,-190,-173,-156,-139,-121,-104,-87,-69,-52,-34,-17,0,17,34,52,69,87, |
104,121,139,156,173,190,207,224,241,258,275,292,309,325,342,358,374,390,406,422,438,453,469,484,500,515,529,544, |
559,573,587,601,615,629,642,656,669,682,694,707,719,731,743,754,766,777,788,798,809,819,829,838,848,857,866,874, |
882,891,898,906,913,920,927,933,939,945,951,956,961,965,970,974,978,981,984,987,990,992,994,996,997,998,999,999}; |
long Soll_Position_North = 0; |
long Soll_Position_East = 0; |
long GPS_Positionsabweichung_North = 0; |
long GPS_Positionsabweichung_East = 0; |
long GPS_Geschwindigkeit_North = 0; |
long GPS_Geschwindigkeit_East = 0; |
long P_Einfluss_North = 0; |
long D_Einfluss_North = 0; |
long P_Einfluss_East = 0; |
long D_Einfluss_East = 0; |
signed int GPS_North = 0; |
signed int GPS_East = 0; |
signed int GPS_Nick = 0; |
signed int GPS_Roll = 0; |
volatile char gethome = 0; //Flag ob GPS_Home_Position gelernt ist //(280807Kr) |
long GPS_Home_North = 0; |
long GPS_Home_East = 0; |
unsigned char blinkcount_LED2 = 0; //Hilfszähler für die blinkende LED (010907Kr) |
//**************************** MIRCOS DEFINITIONSANFANG FÜR DIE FILTERUNG |
// Filterung der GPS Messwerte vom Ublox-Empfänger. Es wird der gleitende Durchschnitt aus n Messwerten gebildet |
#define MITTELWERTZAHL 8 // Anzahl der Messwerte fuer gleitenden Mittelwert |
volatile char NeuerMittelwert = 0; //Flag ob ein neuer Mittelwert vorliegt, der mit 4 Hz berechnet wird, da nur dann neue Messwerte vom GPS vorliegen |
volatile unsigned char FilterPos = 0; |
volatile long NORTH_MITTEL = 0; |
volatile long EAST_MITTEL = 0; |
volatile long long NORTH_LONG_LONG = 0; |
volatile long long EAST_LONG_LONG = 0; |
volatile int filterfilled = 0; |
typedef struct { |
long NORTH[MITTELWERTZAHL]; |
} FILTER_NORTH; // Filterdefinition für die Positions-Nordwerte aus dem GPS-Empfänger |
typedef struct { |
long EAST[MITTELWERTZAHL]; |
} FILTER_EAST; // Filterdefinition für die Positions-Ostwerte aus dem GPS-Empfänger |
FILTER_NORTH filter_north; |
FILTER_EAST filter_east; |
//**************************** MIRCOS DEFINITIONSENDE FÜR DIE FILTERUNG |
void gps_main(void) |
{ |
//**************************** MIRCOS FILTERUNG ANFANG |
// if(actualPos.GPSFix == 3 && actualPos.newData == 1) //bilde neuen Positionsmittelwert, wenn 3D-Fix und neue GPS-Daten vorliegen |
if(actualPos.GPSFix == 3) // hier auskommentieren, wenn dauernd (also nicht nur alle 250ms) die GPS-Berechnung durchgeführt werden soll |
{ |
filter_north.NORTH[FilterPos] = actualPos.northing; |
filter_east.EAST[FilterPos] = actualPos.easting; |
FilterPos++; |
if (FilterPos==MITTELWERTZAHL) FilterPos=0; |
if (filterfilled<MITTELWERTZAHL) filterfilled++; |
NORTH_LONG_LONG = 0; |
EAST_LONG_LONG = 0; |
for (int i=0; i<filterfilled; i++) |
{ |
NORTH_LONG_LONG += filter_north.NORTH[i]; |
EAST_LONG_LONG += filter_east.EAST[i]; |
} |
NORTH_LONG_LONG /= filterfilled; |
EAST_LONG_LONG /= filterfilled; |
NORTH_MITTEL = NORTH_LONG_LONG; |
EAST_MITTEL = EAST_LONG_LONG; |
NeuerMittelwert = 1; |
//actualPos.newData = 0; // hier auskommentieren, wenn dauernd (also nicht nur alle 250ms) die GPS-Berechnung durchgeführt werden soll |
} |
//******************************* MIRCOS FILTERUNG ENDE |
//wenn kein 3D-Fix vorhanden, über das Poti jedoch irgendeine GPS Funktion aktiv ist, werden die GPS-Steuerbefehle |
//auf Null gesetzt, um unkontrolliertes Wegfliegen durch das GPS zu verhindern. Dadurch wird abgesichert |
//(auch im laufenden Flug), dass bei einem Verlust der GPS-Verbindung GPS deaktivert wird |
if (actualPos.GPSFix < 3 && Poti3 > 70) |
{ |
GPS_Nick = 0; |
GPS_Roll = 0; |
LED2_OFF; |
beeptime = 50; |
} |
// speichert die GPS_Home_Position beim 3D-Fix, MotorEINschalten und wenn noch nicht zu weit weggeflogen wurde |
// (modell_fliegt_gps < 2000) einmalig ab. Die Flugzeitabfrage sichert ab, dass bei einem Losfliegen ohne 3D-Fix die Home_Positinen |
// irgendwann später dort gelernt werden, wo dann zu ersten mal ein 3D-Fix vorhanden ist |
if (actualPos.GPSFix == 3 && MotorenEin == 1 && gethome == 0 && modell_fliegt_gps < 2000) |
{ |
GPS_Home_North = NORTH_MITTEL; |
GPS_Home_East = EAST_MITTEL; |
// Muss hier auch eingelernt werden, damit falls das Poti3 beim Motorenstarten in |
// Mittelstellung sein sollte, trotzdem schon eine Sollposition vorliegt. Andernfalls würde |
// GPS_Nick und _Roll maximal werden bis zum ersten Mal Stick_Nick und _Roll gesteuert würde |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
beeptime = 50; |
gethome = 1; |
} |
//löscht die GPS_Home_Position beim MotorAUSschalten wieder und resetet das Flag gethome //(280807Kr) |
if (MotorenEin == 0) |
{ |
GPS_Home_North = 0; |
GPS_Home_East = 0; |
gethome = 0; |
modell_fliegt_gps = 0; |
} |
// wenn Schalter ausgeschaltet, dann wird die LED2 ausgeschaltet und das GPS Steuerkommando gelöscht |
if(Poti3 < 70) |
{ |
// Sollpositionen müssen auch hier beschrieben werden, damit ausgeschlossen ist, dass falls gelandet wird und die GPS-Funktion |
// über Poti3 deaktivert und anschließend wieder aktiviert wird keine Soll-Positionen vorliegen. |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
GPS_Nick = 0; |
GPS_Roll = 0; |
LED2_OFF; |
} |
// wenn 3D-Fix, Schalter im mittleren Bereich und vom Pilot gesteuert wird, wird ständig neue GPS-Sollposition eingelernt |
if(actualPos.GPSFix == 3 && Poti3 > 70 && Poti3 < 150 && (StickNick > 12 || StickNick < -12 || StickRoll > 12 || StickRoll < -12)) |
{ |
GPS_Nick = 0; //wird genullt, damit das letzte GPS Kommando nicht ständig gegen den Piloten ansteuert |
GPS_Roll = 0; //wird genullt, damit das letzte GPS Kommando nicht ständig gegen den Piloten ansteuert |
Soll_Position_North = NORTH_MITTEL; // Soll-Position wird geschrieben |
Soll_Position_East = EAST_MITTEL; // Soll-Position wird geschrieben |
//++++++++++++++++++++++++++++++++++++ |
//Sorgt lediglich dafür, dass die LED2 langsam blinkt. Dauer ist durch die "> x" Abfrage festgelegt |
//++++++++++++++++++++++++++++++++++++ |
if(blinkcount_LED2 >= 200) // maximal erlaubt 255 wegen unsigned char |
{ |
LED2_FLASH; |
blinkcount_LED2 = 0; |
} |
blinkcount_LED2++; |
//++++++++++++++++++++++++++++++++++++ |
} |
// wenn 3D-Fix, Schalter im mittleren Bereich (oder höher), neuer Mittelwert vorhanden, wenigstens einmal Sollposition gelernt und der Pilot nicht selbst steuert wird eine GPS-Funktion aktiviert |
if (actualPos.GPSFix == 3 && Poti3 > 70 && NeuerMittelwert == 1 && Soll_Position_North != 0 && Soll_Position_East != 0 && StickNick <= 12 && StickNick >= -12 && StickRoll <= 12 && StickRoll >= -12) |
{ |
//Berechnung der GPS-Positionsabweichung je nach aktivierter GPS-Funktion (GPS_HOLD oder HOMING) |
//DYNAMISCHES GPS-HOLD, wenn Schalter noch in Mittelstellung ist wird die zuletzt gelernte Soll_Position angeflogen |
if(Poti3 < 150) |
{ |
GPS_Positionsabweichung_North = (Soll_Position_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (Soll_Position_East - EAST_MITTEL); |
LED2_ON; |
} |
//andernfalls, wenn Schalter in max. Stellung und zusätzlich die GPS_Home_Positionen beim Motorenstarten gelernt |
//werden konnten, wird zur GPS_Home_Position geflogen |
if (Poti3 >= 150 && GPS_Home_North != 0 && GPS_Home_East != 0) |
{ |
GPS_Positionsabweichung_North = (GPS_Home_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (GPS_Home_East - EAST_MITTEL); |
// durch das ständige Neulernen der Soll_Positionen während HOMING wird erreicht, dass der MK nach dem Umschalten |
// von HOMING zurück zu GPS-HOLD nicht wieder an die alte Soll_Position zurück fliegt |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
LED2_ON; |
} |
//verhindert, dass beim Umschalten von Mittelstellung (GPS_HOLD) auf Maximalstellung (HOMING) OHNE gelernte Homeposition |
//die GPS Funktion unkontrolliert steuert. Daher wird GPS_HOLD aktiv gehalten, die Sollpositon wird bei Stickbefehlen |
//jedoch nicht wie beim dynamischen GPS_HOLD überschrieben. Zusätzlich wird der Summer eingeschaltet. |
if (Poti3 >= 150 && GPS_Home_North == 0 && GPS_Home_East == 0) |
{ |
GPS_Positionsabweichung_North = (Soll_Position_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (Soll_Position_East - EAST_MITTEL); |
LED2_ON; |
beeptime = 50; |
} |
//GPS-Geschwindigkeiten |
GPS_Geschwindigkeit_North = actualPos.velNorth; //actualPos.velNorth ist die Geschwindigkeiten aus dem GPS Empfänger entlang der Nord-Süd Richtung |
GPS_Geschwindigkeit_East = actualPos.velEast; //actualPos.velEast ist die Geschwindigkeiten aus dem GPS Empfänger entlang der Ost-West Richtung |
//Berechnung der Einzelkomponenten des PD-Reglers |
P_Einfluss_North = (P_GPS_Verstaerkung * GPS_Positionsabweichung_North)*0.0005; //entspricht einer Skalierung von 1/2000 |
D_Einfluss_North = (D_GPS_Verstaerkung * GPS_Geschwindigkeit_North)*0.00333; //entspricht einer Skalierung von 1/300 |
P_Einfluss_East = (P_GPS_Verstaerkung * GPS_Positionsabweichung_East)*0.0005; //entspricht einer Skalierung von 1/2000 |
D_Einfluss_East = (D_GPS_Verstaerkung * GPS_Geschwindigkeit_East)*0.00333; //entspricht einer Skalierung von 1/300 |
// Begrenzung des maximalen D-Anteils für pos. und neg. Werte. Grenze muss so geählt werden, |
// dass das Limit im normalen Position-Hold nicht erreicht wird und somit keinen Einfluss hat. |
// Grund: Beim Zufliegen auf weiter entfernte Ziele bremst der D-Anteil kurz vor dem Ziel den Mikrokopter sehr stark ab. |
// Dieses Limit wirkt nur, wenn sich der MK im HOMING Modus befindet und sich noch weit (>2,5m) von der Home-Position weg befindet. |
if (Poti3 >= 150 && GPS_Home_North != 0 && GPS_Home_East != 0 && (abs(GPS_Positionsabweichung_North) > 250 || abs(GPS_Positionsabweichung_East) > 250)) |
{ |
if (D_Einfluss_North > Limit_D_Anteil) D_Einfluss_North = Limit_D_Anteil; |
if (D_Einfluss_East > Limit_D_Anteil) D_Einfluss_East = Limit_D_Anteil; |
if (D_Einfluss_North < -1 * Limit_D_Anteil) D_Einfluss_North = -1 * Limit_D_Anteil; |
if (D_Einfluss_East < -1 * Limit_D_Anteil) D_Einfluss_East = -1 * Limit_D_Anteil; |
} |
// PD-Regler |
GPS_North = (-P_Einfluss_North + D_Einfluss_North); |
GPS_East = (P_Einfluss_East - D_Einfluss_East); |
//Umrechnen vom globalen North- bzw. East- in das körperfeste X- bzw. Y- Koordinatensystem |
GPS_Nick = (-c_sin[KompassValue]*0.001*GPS_East + c_cos[KompassValue]*0.001*GPS_North); // die "0" kann später durch den Messwert des Kompasssensors (KompassValue/0.01745329251) ersetzt werden |
GPS_Roll = (c_cos[KompassValue]*0.001*GPS_East + c_sin[KompassValue]*0.001*GPS_North); // die "0" kann später durch den Messwert des Kompasssensors (KompassValue/180*3.1415926535) ersetzt werden |
// Begrenzung des maximalen GPS Einflusses für positive und negative Werte |
if (GPS_Nick > 35) GPS_Nick = 35; |
if (GPS_Roll > 35) GPS_Roll = 35; |
if (GPS_Nick < -35) GPS_Nick = -35; |
if (GPS_Roll < -35) GPS_Roll = -35; |
//Funktion wird dadurch nur alle 250 ms aufgerufen, wenn neue Mittelwerte aus den GPS-Daten vorliegen. |
//FUNKTIONIERT MOMENTAN NOCH NICHT, DA STÄNDIG OHNE UNTERBRECHUNG NEUE MITTELWERTE BERECHNET WERDEN. |
//GRUND: DIE ABFRAGE NACH NEUE GPS-DATEN ERFOLGT NOCH NICHT |
NeuerMittelwert = 0; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/License.txt |
---|
0,0 → 1,52 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + Nur für den privaten Gebrauch |
// + www.MikroKopter.com |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
// + dass eine Nutzung (auch auszugsweise) nur für den privaten und nichtkommerziellen Gebrauch zulässig ist. |
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
// + bzgl. der Nutzungsbedingungen aufzunehmen. |
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
// + Verkauf von Luftbildaufnahmen, usw. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
// + eindeutig als Ursprung verlinkt und genannt werden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
// + Benutzung auf eigene Gefahr |
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
// + mit unserer Zustimmung zulässig |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
// + this list of conditions and the following disclaimer. |
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
// + from this software without specific prior written permission. |
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
// + for non-profit use (directly or indirectly) |
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
// + with our written permission |
// + * If sources or documentations are redistributet, our webpage (http://www.MikroKopter.de) must be |
// + clearly linked and named as origin |
// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/MIKROKOPTER_TO_DO.txt |
---|
0,0 → 1,11 |
. Patricks neigungskompensierten Kompass |
. Aufruf der GPS.c innerhalb der fc.c nur wenn neue Daten vorliegen |
. innerhalb der GPS.c den PD-Regler nicht mit "NeuerMittelwert", sondern mit "actualpos.newdata" alle 250ms aufrufen |
. GPS-Empfänger auf 5Hz einstellen |
. Begrenzung von 35 auf 50 anheben, damit auch bei stärkerem Wind geflogen werden kann |
. Waypoints |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/Parameter.txt |
---|
0,0 → 1,15 |
bei leichtem, konstantem Wind |
P-Faktor(Userparam_1): 120 |
D-Faktor(Userparam_2): 90 |
D-Anteil_Limit(Userparam_3): 45 |
bei stärkerem, böhigem Wind: |
P-Faktor(Userparam_1): 150 |
D-Faktor(Userparam_2): 95 |
D-Anteil_Limit(Userparam_3): 45 |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/Setting_1.mkp |
---|
0,0 → 1,51 |
[Setup] |
Name=GPS |
GlobalConfig=43 |
[Channels] |
Gas=7 |
Gier=6 |
Nick=5 |
Roll=8 |
Poti_1=1 |
Poti_2=2 |
Poti_3=3 |
Poti_4=4 |
[Stick] |
Nick_Roll-P=4 |
Nick_Roll-D=0 |
Gier-P=16 |
[Altitude] |
Setpoint=254 |
MinGas=30 |
P=10 |
Barometric-D=50 |
Z-ACC-Effect=50 |
Gain=2 |
[Gyro] |
P=120 |
I=150 |
ACC_Gyro-Factor=26 |
Main-I=0 |
[Others] |
MinGas=5 |
MaxGas=250 |
Compass-Effect=64 |
UnderVoltage=95 |
NotGas=66 |
NotGasTime=60 |
[User] |
Parameter_1=251 |
Parameter_2=252 |
Parameter_3=35 |
Parameter_4=60 |
[Camera] |
ServoNickControl=100 |
ServoNickCompensation=40 |
ServoNickInvert=0 |
ServoNickMin=50 |
ServoNickMax=150 |
ServoNickRefreshRate=5 |
[Loop] |
Config=0 |
GasLimit=50 |
StickThreshold=90 |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/Settings.h |
---|
--- alpha/v064JokoGPSNick666AccMM3filtered/_Settings.h (nonexistent) |
+++ alpha/v064JokoGPSNick666AccMM3filtered/_Settings.h (revision 2762) |
@@ -0,0 +1,50 @@ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Testmodi |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define MOTOR_OFF 0 |
+#define MOTOR_TEST 0 |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Abstimmung |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define ACC_AMPLIFY 16 |
+#define FAKTOR_P 1 |
+#define FAKTOR_I 0.0001 |
+ |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Debug-Interface |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define SIO_DEBUG 1 // Soll der Debugger aktiviert sein? |
+#define MIN_DEBUG_INTERVALL 500 // in diesem Intervall werden Degugdaten ohne Aufforderung gesendet |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Sender |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ #define K_NICK 0 |
+ #define K_ROLL 1 |
+ #define K_GAS 2 |
+ #define K_GIER 3 |
+ #define K_POTI1 4 |
+ #define K_POTI2 5 |
+ #define K_POTI3 6 |
+ #define K_POTI4 7 |
+// +++++++++++++++++++++++++++++++ |
+// + Getestete Settings: |
+// +++++++++++++++++++++++++++++++ |
+// Setting: Kamera |
+// Stick_P:3 |
+// Stick_D:0 |
+// Gyro_P: 175 |
+// Gyro_I: 175 |
+// Ki_Anteil: 10 |
+// +++++++++++++++++++++++++++++++ |
+// + Getestete Settings: |
+// +++++++++++++++++++++++++++++++ |
+// Setting: Normal |
+// Stick_P:2 |
+// Stick_D:8 |
+// Gyro_P: 80 |
+// Gyro_I: 150 |
+// Ki_Anteil: 5 |
+ |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/analog.c |
---|
0,0 → 1,172 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
volatile int Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az, UBat = 100; |
volatile int AccumulateNick = 0, AccumulateRoll = 0, AccumulateGier = 0; |
volatile int accumulate_AccRoll = 0,accumulate_AccNick = 0,accumulate_AccHoch = 0; |
volatile char MessanzahlNick = 0, MessanzahlRoll = 0, MessanzahlGier = 0; |
volatile char messanzahl_AccNick = 0, messanzahl_AccRoll = 0, messanzahl_AccHoch = 0; |
volatile long Luftdruck = 32000; |
volatile int StartLuftdruck; |
volatile unsigned int MessLuftdruck = 1023; |
unsigned char DruckOffsetSetting; |
volatile int HoeheD = 0; |
volatile char messanzahl_Druck; |
volatile int tmpLuftdruck; |
volatile unsigned int ZaehlMessungen = 0; |
//####################################################################################### |
// |
void ADC_Init(void) |
//####################################################################################### |
{ |
ADMUX = 0;//Referenz ist extern |
ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE); |
//Free Running Mode, Division Factor 128, Interrupt on |
} |
void SucheLuftruckOffset(void) |
{ |
unsigned int off; |
off = eeprom_read_byte(&EEPromArray[EEPROM_ADR_LAST_OFFSET]); |
if(off > 20) off -= 10; |
OCR0A = off; |
Delay_ms(100); |
if(MessLuftdruck < 850) off = 0; |
for(; off < 250;off++) |
{ |
OCR0A = off; |
Delay_ms(50); |
printf("."); |
if(MessLuftdruck < 900) break; |
} |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_LAST_OFFSET], off); |
DruckOffsetSetting = off; |
Delay_ms(300); |
} |
//####################################################################################### |
// |
SIGNAL(SIG_ADC) |
//####################################################################################### |
{ |
static unsigned char kanal=0,state = 0; |
signed int wert; |
ANALOG_OFF; |
switch(state++) |
{ |
case 0: |
wert = (signed int) AdNeutralGier - ADC; |
if(PlatinenVersion != 10) wert *= 2; |
AccumulateGier += wert; // |
MessanzahlGier++; |
Mess_Integral_Gier += wert;// / 16; |
Mess_Integral_Gier2 += wert; |
kanal = 1; |
ZaehlMessungen++; |
break; |
case 1: |
wert = (signed int) ADC - AdNeutralRoll; |
if(PlatinenVersion != 10) wert *= 2; |
Mess_IntegralRoll += wert; |
Mess_IntegralRoll2 += wert; |
if(Mess_IntegralRoll > 310000L) Mess_IntegralRoll = -290000L; |
if(Mess_IntegralRoll <-310000L) Mess_IntegralRoll = 290000L; |
if(ADC < 15) wert = -1000; |
if(ADC < 7) wert = -2000; |
if(ADC > 1010) wert = +1000; |
if(ADC > 1017) wert = +2000; |
AccumulateRoll += wert; |
MessanzahlRoll++; |
kanal = 2; |
break; |
case 2: |
wert = (signed int) ADC - AdNeutralNick; |
if(PlatinenVersion != 10) wert *= 2; |
Mess_IntegralNick += wert; |
Mess_IntegralNick2 += wert; |
if(Mess_IntegralNick > 310000L) Mess_IntegralNick = -290000L; |
if(Mess_IntegralNick <-310000L) Mess_IntegralNick = 290000L; |
if(ADC < 15) wert = -1000; |
if(ADC < 7) wert = -2000; |
if(ADC > 1010) wert = +1000; |
if(ADC > 1017) wert = +2000; |
AccumulateNick += wert; |
MessanzahlNick++; |
kanal = 4; |
break; |
case 3: |
UBat = (3 * UBat + ADC / 3) / 4;//(UBat + ((ADC * 39) / 256) + 19) / 2; |
kanal = 6; |
break; |
case 4: |
Aktuell_ay = NeutralAccY - ADC; |
accumulate_AccRoll += Aktuell_ay; |
messanzahl_AccRoll++; |
kanal = 7; |
break; |
case 5: |
Aktuell_ax = ADC - NeutralAccX; |
accumulate_AccNick += Aktuell_ax; |
messanzahl_AccNick++; |
kanal = 5; |
state = 6; |
break; |
case 6: |
accumulate_AccHoch = (signed int) ADC - NeutralAccZ; |
accumulate_AccHoch += abs(Aktuell_ay) / 4 + abs(Aktuell_ax) / 4; |
if(accumulate_AccHoch > 1) |
{ |
if(NeutralAccZ < 800) NeutralAccZ+= 0.02; |
} |
else if(accumulate_AccHoch < -1) |
{ |
if(NeutralAccZ > 600) NeutralAccZ-= 0.02; |
} |
messanzahl_AccHoch = 1; |
Aktuell_az = ADC; |
Mess_Integral_Hoch += accumulate_AccHoch; // Integrieren |
Mess_Integral_Hoch -= Mess_Integral_Hoch / 1024; // dämfen |
// Mess_Integral_Hoch -= Mess_Integral_Hoch / 512; // dämfen |
/* if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
kanal = 3; |
state = 7; |
} |
else |
{ |
kanal = 0; |
state = 0; |
}*/ |
kanal = 3; |
state = 7; |
break; |
case 7: |
tmpLuftdruck += ADC; |
if(++messanzahl_Druck >= 5) |
{ |
MessLuftdruck = ADC; |
messanzahl_Druck = 0; |
HoeheD = (int)(StartLuftdruck - tmpLuftdruck - HoehenWert); // D-Anteil = neuerWert - AlterWert |
Luftdruck = (tmpLuftdruck + 3 * Luftdruck) / 4; |
HoehenWert = StartLuftdruck - Luftdruck; |
tmpLuftdruck = 0; |
} |
kanal = 0; |
state = 0; |
break; |
default: |
kanal = 0; |
state = 0; |
break; |
} |
ADMUX = kanal; |
ANALOG_ON; |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/analog.h |
---|
0,0 → 1,23 |
/*####################################################################################### |
#######################################################################################*/ |
extern volatile int UBat; |
extern volatile int AccumulateNick, AccumulateRoll, AccumulateGier,accumulate_AccRoll,accumulate_AccNick,accumulate_AccHoch; |
extern volatile char MessanzahlNick, MessanzahlRoll, MessanzahlGier,messanzahl_AccNick, messanzahl_AccRoll,messanzahl_AccHoch; |
extern volatile int Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az; |
extern volatile long Luftdruck; |
extern volatile char messanzahl_Druck; |
extern volatile unsigned int ZaehlMessungen; |
extern unsigned char DruckOffsetSetting; |
extern volatile int HoeheD; |
extern volatile unsigned int MessLuftdruck; |
extern volatile int StartLuftdruck; |
extern unsigned int ReadADC(unsigned char adc_input); |
extern void ADC_Init(void); |
extern void SucheLuftruckOffset(void); |
#define ANALOG_OFF ADCSRA=0 |
#define ANALOG_ON ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE) |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/compass.c |
---|
0,0 → 1,195 |
/* |
Copyright 2007, Niklas Nold |
This program (files compass.c and compass.h) is free software; you can redistribute it and/or modify |
it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; |
either version 3 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
Please note: All the other files for the project "Mikrokopter" by H. Buss are under the license (license_buss.txt) published by www.mikrokopter.de |
*/ |
#include "main.h" |
MM3_struct MM3; |
#define long int m; |
//############################################################################ |
//Initialisierung der SPI-Schnittstelle |
void init_spi(void) |
//############################################################################ |
{ |
SPCR = (1<<SPIE)|(1<<SPE)|(1<<MSTR)|(1<<SPR1)|(1<<SPR0); //Interrupt an, Master, 156 kHz Oszillator |
//SPSR = (1<<SPI2X); |
DDRB |= (1<<PB7)|(1<<PB5)|(1<<PB2); // J8, MOSI, SCK Ausgang |
PORTD &= ~(1<<PD3); // J5 auf Low |
MM3.AXIS = MM3_X; |
MM3.STATE = MM3_RESET; |
} |
//############################################################################ |
//Wird in der SIGNAL (SIG_OVERFLOW0) aufgerufen |
void MM3_timer0(void) |
//############################################################################ |
{ |
switch (MM3.STATE) |
{ |
case MM3_RESET: |
PORTB |= (1<<PB2); // J8 auf High, MM3 Reset |
MM3.STATE = MM3_START_TRANSFER; |
return; |
case MM3_START_TRANSFER: |
PORTB &= ~(1<<PB2); // J8 auf Low (war ~125 µs auf High) |
if (MM3.AXIS == MM3_X) SPDR = 0x51; // Schreiben ins SPDR löst automatisch Übertragung (MOSI und MISO) aus |
else if (MM3.AXIS == MM3_Y) SPDR = 0x52; // Micromag Period Select ist auf 1024 (0x50) |
else if (MM3.AXIS == MM3_Z) SPDR = 0x53; // 1: x-Achse, 2: Y-Achse, 3: Z-Achse |
MM3.DRDY = SetDelay(15); // 15 Laut Datenblatt max. Zeit bis Messung fertig (bei PS 1024) |
MM3.STATE = MM3_WAIT_DRDY; |
return; |
case MM3_WAIT_DRDY: |
if (CheckDelay(MM3.DRDY)) {SPDR = 0x00;MM3.STATE = MM3_DRDY;} // Irgendwas ins SPDR, damit Übertragung ausgelöst wird, wenn Wartezeit vorbei |
return; // Jetzt gehts weiter in SIGNAL (SIG_SPI) |
case MM3_TILT: // Zeitnahe Speicherung der aktuellen Neigung in ° |
MM3.NickGrad = asin_i((float)Aktuell_ax/208*200); |
MM3.RollGrad = asin_i((float)Aktuell_ay/208*200); |
MM3.AXIS = MM3_X; |
MM3.STATE = MM3_RESET; |
return; |
} |
} |
//############################################################################ |
//SPI byte ready |
SIGNAL (SIG_SPI) |
//############################################################################ |
{ |
switch (MM3.STATE) |
{ |
case MM3_DRDY: // 1. Byte ist da, abspeichern, an die MSB-Stelle rücken |
if (MM3.AXIS == MM3_X) |
{ |
MM3.x_axis = SPDR; |
MM3.x_axis <<= 8; |
} |
else if (MM3.AXIS == MM3_Y) |
{ |
MM3.y_axis = SPDR; |
MM3.y_axis <<= 8; |
} |
else // if (MM3.AXIS == MM3_Z) |
{ |
MM3.z_axis = SPDR; |
MM3.z_axis <<= 8; |
} |
SPDR=0x00; // Übertragung von 2. Byte auslösen |
MM3.STATE=MM3_BYTE2; |
return; |
case MM3_BYTE2: // 2. Byte der entsprechenden Achse ist da |
// versuch die werte nicht über min und max steigen zu lassen um so die spikes zu verhindern |
// verhindert hats nicht aber deutlich minimiert. Evtl kommen die restlichen |
if (MM3.AXIS == MM3_X) |
{ |
MM3.x_axis |= SPDR; |
MM3.x_axis -= OFF_X; // Sofort Offset aus der Kalibrierung berücksichtigen |
if (MM3.x_axis > MM3_Xmax || MM3.x_axis < MM3_Xmin) |
{ |
MM3.x_axis = MM3.x_axis_last_valid; |
} |
else |
{ |
//m = (MM3.x_axis + MM3.x_axis_last_valid) /2; |
MM3.x_axis_last_valid = MM3.x_axis; |
//MM3.x_axis = m; |
} |
MM3.AXIS = MM3_Y; |
MM3.STATE = MM3_RESET; |
} |
else if (MM3.AXIS == MM3_Y) |
{ |
MM3.y_axis |= SPDR; |
MM3.y_axis -= OFF_Y; |
if (MM3.y_axis > MM3_Ymax || MM3.y_axis < MM3_Ymin) |
{ |
MM3.y_axis = MM3.y_axis_last_valid; |
} |
else |
{ |
//m = (MM3.y_axis + MM3.y_axis_last_valid) /2; |
MM3.y_axis_last_valid = MM3.y_axis; |
//MM3.y_axis = m; |
} |
MM3.AXIS = MM3_Z; |
MM3.STATE = MM3_RESET; |
} |
else // if (MM3.AXIS == MM3_Z) |
{ |
MM3.z_axis |= SPDR; |
MM3.z_axis -= OFF_Z; |
if (MM3.z_axis > MM3_Zmax || MM3.z_axis < MM3_Zmin) |
{ |
MM3.z_axis = MM3.z_axis_last_valid; |
} |
else |
{ |
//m = (MM3.z_axis + MM3.z_axis_last_valid) /2; |
MM3.z_axis_last_valid = MM3.z_axis; |
//MM3.z_axis = m; |
} |
MM3.STATE = MM3_TILT; |
} |
return; |
} |
} |
signed int MM3_heading(void) |
{ |
float sin_nick, cos_nick, sin_roll, cos_roll; |
signed int x_corr, y_corr; |
signed int heading; |
// Berechung von sinus und cosinus |
sin_nick = sin_f(MM3.NickGrad); |
cos_nick = cos_f(MM3.NickGrad); |
sin_roll = sin_f(MM3.RollGrad); |
cos_roll = cos_f(MM3.RollGrad); |
// Neigungskompensation |
//x_corr = (cos_nick * MM3.x_axis) + (((sin_roll * MM3.y_axis) - (cos_roll * MM3.z_axis)) * sin_nick); |
x_corr = (cos_nick * MM3.x_axis) - (((sin_roll * MM3.y_axis) - (cos_roll * MM3.z_axis)) * sin_nick); |
y_corr = ((cos_roll * MM3.y_axis) + (sin_roll * MM3.z_axis)); |
// Winkelberechnung |
heading = atan2_i(x_corr, y_corr); |
return (heading); |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/compass.h |
---|
0,0 → 1,54 |
typedef struct |
{ |
uint8_t STATE; |
unsigned int DRDY; |
uint8_t AXIS; |
signed int x_axis; |
signed int y_axis; |
signed int z_axis; |
signed int x_axis_last_valid; |
signed int y_axis_last_valid; |
signed int z_axis_last_valid; |
signed int NickGrad; |
signed int RollGrad; |
}MM3_struct; |
extern MM3_struct MM3; |
void init_spi(void); |
void MM3_timer0(void); |
signed int MM3_heading(void); |
#define Int2Grad_Faktor 1024 |
// Die Werte der Statemachine |
#define MM3_RESET 0 |
#define MM3_START_TRANSFER 1 |
#define MM3_WAIT_DRDY 2 |
#define MM3_DRDY 4 |
#define MM3_BYTE2 8 |
#define MM3_X 16 |
#define MM3_Y 32 |
#define MM3_Z 64 |
#define MM3_TILT 128 |
// Die Werte der Kompasskalibrierung |
#define MM3_Xmin -806 |
#define MM3_Xmax 784 |
#define MM3_Ymin -865 |
#define MM3_Ymax 925 |
#define MM3_Zmin -813 |
#define MM3_Zmax 849 |
// Die Werte der Kompasskalibrierung |
// OFFSET: (Maximaler Wert + minimaler Wert) / 2 |
#define OFF_X (MM3_Xmax + MM3_Xmin) /2 //-11 |
#define OFF_Y (MM3_Ymax + MM3_Ymin) /2 //30 |
#define OFF_Z (MM3_Zmax + MM3_Zmin) /2 //18 |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/eeprom.c |
---|
--- alpha/v064JokoGPSNick666AccMM3filtered/fc.c (nonexistent) |
+++ alpha/v064JokoGPSNick666AccMM3filtered/fc.c (revision 2762) |
@@ -0,0 +1,1034 @@ |
+/*####################################################################################### |
+Flight Control |
+#######################################################################################*/ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Copyright (c) 04.2007 Holger Buss |
+// + Nur für den privaten Gebrauch |
+// + www.MikroKopter.com |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
+// + dass eine Nutzung (auch auszugsweise) nur für den privaten (nicht-kommerziellen) Gebrauch zulässig ist. |
+// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
+// + bzgl. der Nutzungsbedingungen aufzunehmen. |
+// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
+// + Verkauf von Luftbildaufnahmen, usw. |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
+// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
+// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
+// + eindeutig als Ursprung verlinkt werden |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
+// + Benutzung auf eigene Gefahr |
+// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
+// + mit unserer Zustimmung zulässig |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
+// + this list of conditions and the following disclaimer. |
+// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
+// + from this software without specific prior written permission. |
+// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
+// + for non-commercial use (directly or indirectly) |
+// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
+// + with our written permission |
+// + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
+// + clearly linked as origin |
+// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
+// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
+// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
+// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
+// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
+// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
+// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
+// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
+// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
+// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
+// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
+// + POSSIBILITY OF SUCH DAMAGE. |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+#include "main.h" |
+ |
+unsigned char h,m,s; |
+volatile unsigned int I2CTimeout = 100; |
+volatile int MesswertNick,MesswertRoll,MesswertGier; |
+volatile int AdNeutralNick = 0,AdNeutralRoll = 0,AdNeutralGier = 0; |
+volatile int Mittelwert_AccNick, Mittelwert_AccRoll,Mittelwert_AccHoch, NeutralAccX=0, NeutralAccY=0; |
+volatile float NeutralAccZ = 0; |
+unsigned char CosinusNickWinkel = 0, CosinusRollWinkel = 0; |
+volatile long IntegralNick = 0,IntegralNick2 = 0; |
+volatile long IntegralRoll = 0,IntegralRoll2 = 0; |
+volatile long Integral_Gier = 0; |
+volatile long Mess_IntegralNick = 0,Mess_IntegralNick2 = 0; |
+volatile long Mess_IntegralRoll = 0,Mess_IntegralRoll2 = 0; |
+volatile long Mess_Integral_Gier = 0,Mess_Integral_Gier2 = 0; |
+volatile long Mess_Integral_Hoch = 0; |
+volatile int KompassValue = 0; |
+volatile int KompassStartwert = 0; |
+volatile int KompassRichtung = 0; |
+unsigned char MAX_GAS,MIN_GAS; |
+unsigned char Notlandung = 0; |
+unsigned char HoehenReglerAktiv = 0; |
+ |
+unsigned char blinkcount_LED1 = 0;//Hilfszähler für die blinkende LED (310807Kr) |
+unsigned int modell_fliegt_gps = 0;//(030907Kr) |
+unsigned char Limit_D_Anteil = 0;//(210907Kr) |
+ |
+float GyroFaktor; |
+float IntegralFaktor; |
+ |
+volatile int DiffNick,DiffRoll; |
+int Poti1 = 0, Poti2 = 0, Poti3 = 0, Poti4 = 0, Poti5 = 0, Poti6 = 0, Poti7 = 0, Poti8 = 0; //PPM24-Erweiterung (121007Kr) |
+volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
+unsigned char MotorWert[5]; |
+volatile unsigned char SenderOkay = 0; |
+int StickNick = 0,StickRoll = 0,StickGier = 0; |
+char MotorenEin = 0; |
+int HoehenWert = 0; |
+int SollHoehe = 0; |
+unsigned char Looping_Nick = 0,Looping_Roll = 0; |
+ |
+float Kp = FAKTOR_P; |
+float Ki = FAKTOR_I; |
+ |
+unsigned char Parameter_Luftdruck_D = 48; // Wert : 0-250 |
+unsigned char Parameter_MaxHoehe = 251; // Wert : 0-250 |
+unsigned char Parameter_Hoehe_P = 16; // Wert : 0-32 |
+unsigned char Parameter_Hoehe_ACC_Wirkung = 58; // Wert : 0-250 |
+unsigned char Parameter_KompassWirkung = 64; // Wert : 0-250 |
+unsigned char Parameter_Gyro_P = 150; // Wert : 10-250 |
+unsigned char Parameter_Gyro_I = 150; // Wert : 0-250 |
+unsigned char Parameter_Gier_P = 2; // Wert : 1-20 |
+unsigned char Parameter_I_Faktor = 10; // Wert : 1-20 |
+unsigned char Parameter_UserParam1 = 0; |
+unsigned char Parameter_UserParam2 = 0; |
+unsigned char Parameter_UserParam3 = 0; |
+unsigned char Parameter_UserParam4 = 0; |
+unsigned char Parameter_ServoNickControl = 100; |
+unsigned char Parameter_LoopGasLimit = 70; |
+struct mk_param_struct EE_Parameter; |
+ |
+void Piep(unsigned char Anzahl) |
+{ |
+ while(Anzahl--) |
+ { |
+ if(MotorenEin) return; //auf keinen Fall im Flug! |
+ beeptime = 100; |
+ Delay_ms(250); |
+ } |
+} |
+ |
+//############################################################################ |
+// Nullwerte ermitteln |
+void SetNeutral(void) |
+//############################################################################ |
+{ |
+ unsigned int timer; |
+ NeutralAccX = 0; |
+ NeutralAccY = 0; |
+ NeutralAccZ = 0; |
+ AdNeutralNick = 0; |
+ AdNeutralRoll = 0; |
+ AdNeutralGier = 0; |
+ CalibrierMittelwert(); |
+ timer = SetDelay(5); |
+ while (!CheckDelay(timer)); |
+ CalibrierMittelwert(); |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
+ { |
+ if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset(); |
+ } |
+ |
+ if(PlatinenVersion == 10) |
+ { |
+ AdNeutralNick= abs(MesswertNick); |
+ AdNeutralRoll= abs(MesswertRoll); |
+ AdNeutralGier= abs(MesswertGier); |
+ } |
+ else |
+ { |
+ AdNeutralNick= abs(MesswertNick) / 2; |
+ AdNeutralRoll= abs(MesswertRoll) / 2; |
+ AdNeutralGier= abs(MesswertGier) / 2; |
+ } |
+ NeutralAccY = abs(Mittelwert_AccRoll) / ACC_AMPLIFY; |
+ NeutralAccX = abs(Mittelwert_AccNick) / ACC_AMPLIFY; |
+ NeutralAccZ = Aktuell_az; |
+ |
+ Mess_IntegralNick = 0; |
+ Mess_IntegralNick2 = 0; |
+ Mess_IntegralRoll = 0; |
+ Mess_IntegralRoll2 = 0; |
+ Mess_Integral_Gier = 0; |
+ MesswertNick = 0; |
+ MesswertRoll = 0; |
+ MesswertGier = 0; |
+ StartLuftdruck = Luftdruck; |
+ HoeheD = 0; |
+ Mess_Integral_Hoch = 0; |
+ KompassStartwert = KompassValue; |
+ beeptime = 50; |
+} |
+ |
+//############################################################################ |
+// Bildet den Mittelwert aus den Messwerten |
+void Mittelwert(void) |
+//############################################################################ |
+{ |
+ // ADC auschalten, damit die Werte sich nicht während der Berechnung ändern |
+ ANALOG_OFF; |
+ if(MessanzahlNick) (MesswertNick = AccumulateNick / MessanzahlNick); |
+ if(MessanzahlRoll) (MesswertRoll = AccumulateRoll / MessanzahlRoll); |
+ if(MessanzahlGier) (MesswertGier = AccumulateGier / MessanzahlGier); |
+ if(messanzahl_AccNick) Mittelwert_AccNick = ((long)Mittelwert_AccNick * 7 + ((ACC_AMPLIFY * (long)accumulate_AccNick) / messanzahl_AccNick)) / 8L; |
+ if(messanzahl_AccRoll) Mittelwert_AccRoll = ((long)Mittelwert_AccRoll * 7 + ((ACC_AMPLIFY * (long)accumulate_AccRoll) / messanzahl_AccRoll)) / 8L; |
+ if(messanzahl_AccHoch) Mittelwert_AccHoch = ((long)Mittelwert_AccHoch * 7 + ((long)accumulate_AccHoch) / messanzahl_AccHoch) / 8L; |
+ AccumulateNick = 0; MessanzahlNick = 0; |
+ AccumulateRoll = 0; MessanzahlRoll = 0; |
+ AccumulateGier = 0; MessanzahlGier = 0; |
+ accumulate_AccRoll = 0;messanzahl_AccRoll = 0; |
+ accumulate_AccNick = 0;messanzahl_AccNick = 0; |
+ accumulate_AccHoch = 0;messanzahl_AccHoch = 0; |
+ Integral_Gier = Mess_Integral_Gier; |
+// Integral_Gier2 = Mess_Integral_Gier2; |
+ IntegralNick = Mess_IntegralNick; |
+ IntegralRoll = Mess_IntegralRoll; |
+ IntegralNick2 = Mess_IntegralNick2; |
+ IntegralRoll2 = Mess_IntegralRoll2; |
+ // ADC einschalten |
+ ANALOG_ON; |
+ |
+/* |
+//------------------------------------------------------------------------------ |
+ if(MesswertNick > 200) MesswertNick += 4 * (MesswertNick - 200); |
+ else |
+ if(MesswertNick < -200) MesswertNick += 4 * (MesswertNick + 200); |
+ if(MesswertRoll > 200) MesswertRoll += 4 * (MesswertRoll - 200); |
+ else |
+ if(MesswertRoll < -200) MesswertRoll += 4 * (MesswertRoll + 200); |
+//------------------------------------------------------------------------------ |
+*/ |
+ if(Poti1 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110) Poti1++; else if(Poti1 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110 && Poti1) Poti1--; |
+ if(Poti2 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110) Poti2++; else if(Poti2 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110 && Poti2) Poti2--; |
+ if(Poti3 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110) Poti3++; else if(Poti3 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110 && Poti3) Poti3--; |
+ if(Poti4 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110) Poti4++; else if(Poti4 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110 && Poti4) Poti4--; |
+ //PPM24-Erweiterung (121007Kr) |
+ if(Poti5 < PPM_in[9] + 110) Poti5++; else if(Poti5 > PPM_in[9] + 110 && Poti5) Poti5--; |
+ if(Poti6 < PPM_in[10] + 110) Poti6++; else if(Poti6 > PPM_in[10] + 110 && Poti6) Poti6--; |
+ if(Poti7 < PPM_in[11] + 110) Poti7++; else if(Poti7 > PPM_in[11] + 110 && Poti7) Poti7--; |
+ if(Poti8 < PPM_in[12] + 110) Poti8++; else if(Poti8 > PPM_in[12] + 110 && Poti8) Poti8--; |
+ |
+ |
+ if(Poti1 < 0) Poti1 = 0; else if(Poti1 > 255) Poti1 = 255; |
+ if(Poti2 < 0) Poti2 = 0; else if(Poti2 > 255) Poti2 = 255; |
+ if(Poti3 < 0) Poti3 = 0; else if(Poti3 > 255) Poti3 = 255; |
+ if(Poti4 < 0) Poti4 = 0; else if(Poti4 > 255) Poti4 = 255; |
+ //PPM24-Erweiterung (121007Kr) |
+ if(Poti5 < 0) Poti5 = 0; else if(Poti5 > 255) Poti5 = 255; |
+ if(Poti6 < 0) Poti6 = 0; else if(Poti6 > 255) Poti6 = 255; |
+ if(Poti7 < 0) Poti7 = 0; else if(Poti7 > 255) Poti7 = 255; |
+ if(Poti8 < 0) Poti8 = 0; else if(Poti8 > 255) Poti8 = 255; |
+} |
+ |
+//############################################################################ |
+// Messwerte beim Ermitteln der Nullage |
+void CalibrierMittelwert(void) |
+//############################################################################ |
+{ |
+ // ADC auschalten, damit die Werte sich nicht während der Berechnung ändern |
+ ANALOG_OFF; |
+ if(MessanzahlNick) (MesswertNick = AccumulateNick / MessanzahlNick); |
+ if(MessanzahlRoll) (MesswertRoll = AccumulateRoll / MessanzahlRoll); |
+ if(MessanzahlGier) (MesswertGier = AccumulateGier / MessanzahlGier); |
+ if(messanzahl_AccNick) Mittelwert_AccNick = ((ACC_AMPLIFY * (long)accumulate_AccNick) / messanzahl_AccNick); |
+ if(messanzahl_AccRoll) Mittelwert_AccRoll = (ACC_AMPLIFY * (long)accumulate_AccRoll) / messanzahl_AccRoll; |
+ if(messanzahl_AccHoch) Mittelwert_AccHoch = ((long)accumulate_AccHoch) / messanzahl_AccHoch; |
+ AccumulateNick = 0; MessanzahlNick = 0; |
+ AccumulateRoll = 0; MessanzahlRoll = 0; |
+ AccumulateGier = 0; MessanzahlGier = 0; |
+ accumulate_AccRoll = 0;messanzahl_AccRoll = 0; |
+ accumulate_AccNick = 0;messanzahl_AccNick = 0; |
+ accumulate_AccHoch = 0;messanzahl_AccHoch = 0; |
+ // ADC einschalten |
+ ANALOG_ON; |
+ if(Poti1 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110) Poti1++; else if(Poti1 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110 && Poti1) Poti1--; |
+ if(Poti2 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110) Poti2++; else if(Poti2 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110 && Poti2) Poti2--; |
+ if(Poti3 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110) Poti3++; else if(Poti3 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110 && Poti3) Poti3--; |
+ if(Poti4 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110) Poti4++; else if(Poti4 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110 && Poti4) Poti4--; |
+ //PPM24-Erweiterung (121007Kr) |
+ if(Poti5 < PPM_in[9] + 110) Poti5++; else if(Poti5 > PPM_in[9] + 110 && Poti5) Poti5--; |
+ if(Poti6 < PPM_in[10] + 110) Poti6++; else if(Poti6 > PPM_in[10] + 110 && Poti6) Poti6--; |
+ if(Poti7 < PPM_in[11] + 110) Poti7++; else if(Poti7 > PPM_in[11] + 110 && Poti7) Poti7--; |
+ if(Poti8 < PPM_in[12] + 110) Poti8++; else if(Poti8 > PPM_in[12] + 110 && Poti8) Poti8--; |
+ |
+ |
+ |
+ |
+ if(Poti1 < 0) Poti1 = 0; else if(Poti1 > 255) Poti1 = 255; |
+ if(Poti2 < 0) Poti2 = 0; else if(Poti2 > 255) Poti2 = 255; |
+ if(Poti3 < 0) Poti3 = 0; else if(Poti3 > 255) Poti3 = 255; |
+ if(Poti4 < 0) Poti4 = 0; else if(Poti4 > 255) Poti4 = 255; |
+ //PPM24-Erweiterung (121007Kr) |
+ if(Poti5 < 0) Poti5 = 0; else if(Poti5 > 255) Poti5 = 255; |
+ if(Poti6 < 0) Poti6 = 0; else if(Poti6 > 255) Poti6 = 255; |
+ if(Poti7 < 0) Poti7 = 0; else if(Poti7 > 255) Poti7 = 255; |
+ if(Poti8 < 0) Poti8 = 0; else if(Poti8 > 255) Poti8 = 255; |
+} |
+ |
+//############################################################################ |
+// Senden der Motorwerte per I2C-Bus |
+void SendMotorData(void) |
+//############################################################################ |
+{ |
+ if(MOTOR_OFF || !MotorenEin) |
+ { |
+ Motor_Hinten = 0; |
+ Motor_Vorne = 0; |
+ Motor_Rechts = 0; |
+ Motor_Links = 0; |
+ if(MotorTest[0]) Motor_Vorne = MotorTest[0]; |
+ if(MotorTest[1]) Motor_Hinten = MotorTest[1]; |
+ if(MotorTest[2]) Motor_Links = MotorTest[2]; |
+ if(MotorTest[3]) Motor_Rechts = MotorTest[3]; |
+ } |
+ |
+ // DebugOut.Analog[12] = Motor_Vorne; |
+ // DebugOut.Analog[13] = Motor_Hinten; |
+ // DebugOut.Analog[14] = Motor_Links; |
+ // DebugOut.Analog[15] = Motor_Rechts; |
+ |
+ // DebugOut.Analog[12] = motor_rx[0]; //Motorstrom vorne |
+ // DebugOut.Analog[13] = motor_rx[1]; //Motorstrom hinten |
+ // DebugOut.Analog[14] = motor_rx[2]; //Motorstrom links |
+ // DebugOut.Analog[15] = motor_rx[3]; //Motorstrom rechts |
+ |
+ |
+ //Start I2C Interrupt Mode |
+ twi_state = 0; |
+ motor = 0; |
+ i2c_start(); |
+} |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Konstanten |
+// + 0-250 -> normale Werte |
+// + 251 -> Poti1 |
+// + 252 -> Poti2 |
+// + 253 -> Poti3 |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+void DefaultKonstanten1(void) |
+{ |
+ EE_Parameter.Kanalbelegung[K_NICK] = 1; |
+ EE_Parameter.Kanalbelegung[K_ROLL] = 2; |
+ EE_Parameter.Kanalbelegung[K_GAS] = 3; |
+ EE_Parameter.Kanalbelegung[K_GIER] = 4; |
+ EE_Parameter.Kanalbelegung[K_POTI1] = 5; |
+ EE_Parameter.Kanalbelegung[K_POTI2] = 6; |
+ EE_Parameter.Kanalbelegung[K_POTI3] = 7; |
+ EE_Parameter.Kanalbelegung[K_POTI4] = 8; |
+ EE_Parameter.GlobalConfig = 0;//CFG_HOEHENREGELUNG | /*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV | CFG_KOMPASS_FIX;//0x01; |
+ EE_Parameter.Hoehe_MinGas = 30; |
+ EE_Parameter.MaxHoehe = 251; // Wert : 0-32 251 -> Poti1 |
+ EE_Parameter.Hoehe_P = 10; // Wert : 0-32 |
+ EE_Parameter.Luftdruck_D = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_ACC_Wirkung = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_Verstaerkung = 4; // Wert : 0-50 |
+ EE_Parameter.Stick_P = 4; //2 // Wert : 1-6 |
+ EE_Parameter.Stick_D = 8; //8 // Wert : 0-64 |
+ EE_Parameter.Gier_P = 16; // Wert : 1-20 |
+ EE_Parameter.Gas_Min = 5; // Wert : 0-32 // (160607Kr) |
+ EE_Parameter.Gas_Max = 250; // Wert : 33-250 |
+ EE_Parameter.GyroAccFaktor = 26; // Wert : 1-64 |
+ EE_Parameter.KompassWirkung = 128; // Wert : 0-250 |
+ EE_Parameter.Gyro_P = 120; //80 // Wert : 0-250 |
+ EE_Parameter.Gyro_I = 150; // Wert : 0-250 |
+ EE_Parameter.UnterspannungsWarnung = 95; // Wert : 0-250 // (160607Kr) |
+ EE_Parameter.NotGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
+ EE_Parameter.NotGasZeit = 20; // Wert : 0-250 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen |
+ EE_Parameter.UfoAusrichtung = 0; // X oder + Formation |
+ EE_Parameter.I_Faktor = 0; |
+ EE_Parameter.UserParam1 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam2 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam3 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam4 = 0; //zur freien Verwendung |
+ EE_Parameter.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
+ EE_Parameter.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickRefresh = 5; |
+ EE_Parameter.LoopGasLimit = 50; |
+ EE_Parameter.LoopThreshold = 90; // Wert: 0-250 Schwelle für Stickausschlag |
+ EE_Parameter.LoopConfig = 0; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
+ memcpy(EE_Parameter.Name, "Sport\0", 12); |
+} |
+ |
+void DefaultKonstanten2(void) |
+{ |
+ EE_Parameter.Kanalbelegung[K_NICK] = 1; |
+ EE_Parameter.Kanalbelegung[K_ROLL] = 2; |
+ EE_Parameter.Kanalbelegung[K_GAS] = 3; |
+ EE_Parameter.Kanalbelegung[K_GIER] = 4; |
+ EE_Parameter.Kanalbelegung[K_POTI1] = 5; |
+ EE_Parameter.Kanalbelegung[K_POTI2] = 6; |
+ EE_Parameter.Kanalbelegung[K_POTI3] = 7; |
+ EE_Parameter.Kanalbelegung[K_POTI4] = 8; |
+ EE_Parameter.GlobalConfig = 0;//CFG_HOEHENREGELUNG | /*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV;//0x01; |
+ EE_Parameter.Hoehe_MinGas = 30; |
+ EE_Parameter.MaxHoehe = 251; // Wert : 0-32 251 -> Poti1 |
+ EE_Parameter.Hoehe_P = 10; // Wert : 0-32 |
+ EE_Parameter.Luftdruck_D = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_ACC_Wirkung = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_Verstaerkung = 2; // Wert : 0-50 |
+ EE_Parameter.Stick_P = 4; //2 // Wert : 1-6 |
+ EE_Parameter.Stick_D = 0; //8 // Wert : 0-64 |
+ EE_Parameter.Gier_P = 16; // Wert : 1-20 |
+ EE_Parameter.Gas_Min = 5; // Wert : 0-32 // (160607Kr) |
+ EE_Parameter.Gas_Max = 250; // Wert : 33-250 |
+ EE_Parameter.GyroAccFaktor = 26; // Wert : 1-64 |
+ EE_Parameter.KompassWirkung = 128; // Wert : 0-250 |
+ EE_Parameter.Gyro_P = 175; //80 // Wert : 0-250 |
+ EE_Parameter.Gyro_I = 175; // Wert : 0-250 |
+ EE_Parameter.UnterspannungsWarnung = 95; // Wert : 0-250 // (160607Kr) |
+ EE_Parameter.NotGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
+ EE_Parameter.NotGasZeit = 20; // Wert : 0-250 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen |
+ EE_Parameter.UfoAusrichtung = 0; // X oder + Formation |
+ EE_Parameter.I_Faktor = 0; |
+ EE_Parameter.UserParam1 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam2 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam3 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam4 = 0; //zur freien Verwendung |
+ EE_Parameter.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
+ EE_Parameter.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickRefresh = 5; |
+ EE_Parameter.LoopGasLimit = 50; |
+ EE_Parameter.LoopThreshold = 90; // Wert: 0-250 Schwelle für Stickausschlag |
+ EE_Parameter.LoopConfig = 0; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts |
+ memcpy(EE_Parameter.Name, "Kamera\0", 12); |
+} |
+ |
+ |
+//############################################################################ |
+// Trägt ggf. das Poti als Parameter ein |
+void ParameterZuordnung(void) |
+//############################################################################ |
+{ |
+ |
+ #define CHK_POTI(b,a,min,max) { if(a > 250) { if(a == 251) b = Poti1; else if(a == 252) b = Poti2; else if(a == 253) b = Poti3; else if(a == 254) b = Poti4;} else b = a; if(b <= min) b = min; else if(b >= max) b = max;} |
+ CHK_POTI(Parameter_MaxHoehe,EE_Parameter.MaxHoehe,0,255); |
+ CHK_POTI(Parameter_Luftdruck_D,EE_Parameter.Luftdruck_D,0,100); |
+ CHK_POTI(Parameter_Hoehe_P,EE_Parameter.Hoehe_P,0,100); |
+ CHK_POTI(Parameter_Hoehe_ACC_Wirkung,EE_Parameter.Hoehe_ACC_Wirkung,0,255); |
+ CHK_POTI(Parameter_KompassWirkung,EE_Parameter.KompassWirkung,0,255); |
+ CHK_POTI(Parameter_Gyro_P,EE_Parameter.Gyro_P,10,255); |
+ CHK_POTI(Parameter_Gyro_I,EE_Parameter.Gyro_I,0,255); |
+ CHK_POTI(Parameter_I_Faktor,EE_Parameter.I_Faktor,0,255); |
+ CHK_POTI(Parameter_UserParam1,EE_Parameter.UserParam1,0,255); |
+ CHK_POTI(Parameter_UserParam2,EE_Parameter.UserParam2,0,255); |
+ CHK_POTI(Parameter_UserParam3,EE_Parameter.UserParam3,0,255); |
+ CHK_POTI(Parameter_UserParam4,EE_Parameter.UserParam4,0,255); |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ CHK_POTI(Parameter_LoopGasLimit,EE_Parameter.LoopGasLimit,0,255); |
+ |
+ Ki = (float) Parameter_I_Faktor * 0.0001; |
+ MAX_GAS = EE_Parameter.Gas_Max; |
+ MIN_GAS = EE_Parameter.Gas_Min; |
+} |
+ |
+ |
+//############################################################################ |
+// |
+void MotorRegler(void) |
+//############################################################################ |
+{ |
+ int motorwert,pd_ergebnis,h,tmp_int; |
+ int GierMischanteil,GasMischanteil; |
+ static long SummeNick=0,SummeRoll=0; |
+ static long sollGier = 0,tmp_long,tmp_long2; |
+ long IntegralFehlerNick = 0; |
+ long IntegralFehlerRoll = 0; |
+ static unsigned int RcLostTimer; |
+ static unsigned char delay_neutral = 0; |
+ static unsigned char delay_einschalten = 0,delay_ausschalten = 0; |
+ static unsigned int modell_fliegt = 0; |
+ static int hoehenregler = 0; |
+ static char TimerWerteausgabe = 0; |
+ static char NeueKompassRichtungMerken = 0; |
+ Mittelwert(); |
+ |
+ GRN_ON; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gaswert ermitteln |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ GasMischanteil = PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] + 120; |
+ if(GasMischanteil < 0) GasMischanteil = 0; |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Emfang schlecht |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(SenderOkay < 100) |
+ { |
+ if(!PcZugriff) |
+ { |
+ if(BeepMuster == 0xffff) |
+ { |
+ beeptime = 15000; |
+ BeepMuster = 0x0c00; |
+ } |
+ } |
+ if(RcLostTimer) RcLostTimer--; |
+ else |
+ { |
+ MotorenEin = 0; |
+ Notlandung = 0; |
+ } |
+ ROT_ON; |
+ if(modell_fliegt > 2000) // wahrscheinlich in der Luft --> langsam absenken |
+ { |
+ GasMischanteil = EE_Parameter.NotGas; |
+ Notlandung = 1; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] = 0; |
+ } |
+ else MotorenEin = 0; |
+ } |
+ else |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Emfang gut |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(SenderOkay > 140) |
+ { |
+ Notlandung = 0; |
+ RcLostTimer = EE_Parameter.NotGasZeit * 50; |
+ if(GasMischanteil > 40) |
+ { |
+ if(modell_fliegt < 0xffff) modell_fliegt++; |
+ modell_fliegt_gps = modell_fliegt;// (030907Kr) |
+ } |
+ if((modell_fliegt < 200) || (GasMischanteil < 40)) |
+ { |
+ SummeNick = 0; |
+ SummeRoll = 0; |
+ Mess_Integral_Gier = 0; |
+ Mess_Integral_Gier2 = 0; |
+ } |
+ if((GasMischanteil > 200) && MotorenEin == 0) |
+ { |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// auf Nullwerte kalibrieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) // Neutralwerte |
+ { |
+ unsigned char setting; |
+ if(++delay_neutral > 200) // nicht sofort |
+ { |
+ GRN_OFF; |
+ MotorenEin = 0; |
+ delay_neutral = 0; |
+ modell_fliegt = 0; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70 || abs(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]) > 70) |
+ { |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < 70) setting = 1; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 2; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] < 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 3; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] <-70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 4; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] <-70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < 70) setting = 5; |
+ eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], setting); // aktiven Datensatz merken |
+ } |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
+ { |
+ if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset(); |
+ } |
+ ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
+ SetNeutral(); |
+ Piep(GetActiveParamSetNumber()); |
+ } |
+ } |
+ else delay_neutral = 0; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gas ist unten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(GasMischanteil < 35) |
+ { |
+ // Starten |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] < -75) |
+ { |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Einschalten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(++delay_einschalten > 200) |
+ { |
+ delay_einschalten = 200; |
+ modell_fliegt = 1; |
+ MotorenEin = 1; |
+ sollGier = 0; |
+ Mess_Integral_Gier = 0; |
+ Mess_Integral_Gier2 = 0; |
+ Mess_IntegralNick = 0; |
+ Mess_IntegralRoll = 0; |
+ Mess_IntegralNick2 = IntegralNick; |
+ Mess_IntegralRoll2 = IntegralRoll; |
+ SummeNick = 0; |
+ SummeRoll = 0; |
+ } |
+ } |
+ else delay_einschalten = 0; |
+ //Auf Neutralwerte setzen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Auschalten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) |
+ { |
+ if(++delay_ausschalten > 200) // nicht sofort |
+ { |
+ MotorenEin = 0; |
+ delay_ausschalten = 200; |
+ modell_fliegt = 0; |
+ } |
+ } |
+ else delay_ausschalten = 0; |
+ } |
+ } |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// neue Werte von der Funke |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(!NewPpmData-- || Notlandung) |
+ { |
+ ParameterZuordnung(); |
+ StickNick = PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_P; |
+ StickNick += PPM_diff[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_D; |
+ StickRoll = PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_P; |
+ StickRoll += PPM_diff[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_D; |
+ StickGier = -PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]; |
+ GyroFaktor = ((float)Parameter_Gyro_P + 10.0) / 256.0; |
+ IntegralFaktor = ((float) Parameter_Gyro_I) / 44000; |
+ |
+ if(EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) IntegralFaktor = 0; |
+ if(GyroFaktor < 0) GyroFaktor = 0; |
+ if(IntegralFaktor < 0) IntegralFaktor = 0; |
+ // greift in den Stick ein, um ungewolltes überschlagen zu verhindern |
+ if(!(EE_Parameter.LoopConfig & CFG_LOOP_LINKS) && !(EE_Parameter.LoopConfig & CFG_LOOP_RECHTS)) |
+ { |
+ if(IntegralNick > 60000) |
+ { |
+ StickNick -= 8 * EE_Parameter.Stick_P; |
+ if(IntegralNick > 80000) StickNick -= 16 * EE_Parameter.Stick_P; |
+ } |
+ else |
+ if(IntegralNick < -60000) |
+ { |
+ StickNick += 8 * EE_Parameter.Stick_P; |
+ if(IntegralNick > 80000) StickNick -= 16 * EE_Parameter.Stick_P; |
+ } |
+ if(IntegralRoll > 60000) |
+ { |
+ StickRoll -= 8 * EE_Parameter.Stick_P; |
+ if(IntegralRoll > 80000) StickRoll -= 16 * EE_Parameter.Stick_P; |
+ } |
+ else |
+ if(IntegralRoll < -60000) |
+ { |
+ StickRoll += 8 * EE_Parameter.Stick_P; |
+ if(IntegralRoll > 80000) StickRoll -= 16 * EE_Parameter.Stick_P; |
+ } |
+ } |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// LED Stuff |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+LED1_OFF; |
+ |
+ if(blinkcount_LED1 >= Parameter_UserParam4 && Parameter_UserParam4 > 0) |
+ { |
+ LED1_FLASH; |
+ blinkcount_LED1 = 0; |
+ } |
+ |
+ blinkcount_LED1++; |
+ |
+ //if(PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] > 75) LED1_ON; else LED1_OFF; //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
+ //if(PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] > 75) LED2_ON; else LED2_OFF; //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
+ } |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Looping? |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(((PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > EE_Parameter.LoopThreshold) && EE_Parameter.LoopConfig & CFG_LOOP_LINKS) || |
+ ((PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] < -EE_Parameter.LoopThreshold) && EE_Parameter.LoopConfig & CFG_LOOP_RECHTS)) |
+ { |
+ Looping_Roll = 1; |
+ if(GasMischanteil > EE_Parameter.LoopGasLimit) GasMischanteil = EE_Parameter.LoopGasLimit; |
+ } |
+ else Looping_Roll = 0; |
+ |
+ if(((PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > EE_Parameter.LoopThreshold) && EE_Parameter.LoopConfig & CFG_LOOP_OBEN) || |
+ ((PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < -EE_Parameter.LoopThreshold) && EE_Parameter.LoopConfig & CFG_LOOP_UNTEN)) |
+ { |
+ Looping_Nick = 1; |
+ Looping_Roll = 0; |
+ if(GasMischanteil > EE_Parameter.LoopGasLimit) GasMischanteil = EE_Parameter.LoopGasLimit; |
+ } |
+ else Looping_Nick = 0; |
+ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Bei Empfangsausfall im Flug |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(Notlandung) |
+ { |
+ StickGier = 0; |
+ StickNick = 0; |
+ StickRoll = 0; |
+ GyroFaktor = 0.1; |
+ IntegralFaktor = 0.005; |
+ Looping_Roll = 0; |
+ Looping_Nick = 0; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gyro-Drift kompensieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define DRIFT_FAKTOR 3 |
+ if(ZaehlMessungen >= 1000 / DRIFT_FAKTOR) |
+ { |
+ IntegralFehlerNick = IntegralNick2 - IntegralNick; |
+ IntegralFehlerRoll = IntegralRoll2 - IntegralRoll; |
+ ZaehlMessungen = 0; |
+ if(IntegralFehlerNick > 500/DRIFT_FAKTOR) AdNeutralNick++; |
+ if(IntegralFehlerNick < -500/DRIFT_FAKTOR) AdNeutralNick--; |
+ if(IntegralFehlerRoll > 500/DRIFT_FAKTOR) AdNeutralRoll++; |
+ if(IntegralFehlerRoll < -500/DRIFT_FAKTOR) AdNeutralRoll--; |
+// if(Mess_Integral_Gier2 > 500/DRIFT_FAKTOR) AdNeutralGier--; // macht nur mit Referenz (Kompass Sinn) |
+// if(Mess_Integral_Gier2 <-500/DRIFT_FAKTOR) AdNeutralGier++; // macht nur mit Referenz (Kompass Sinn) |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_IntegralNick2 = IntegralNick; |
+ Mess_IntegralRoll2 = IntegralRoll; |
+ Mess_Integral_Gier2 = Integral_Gier; |
+ ANALOG_ON; // ADC einschalten |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Integrale auf ACC-Signal abgleichen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+ |
+ if(EE_Parameter.GlobalConfig & CFG_GPS_AKTIV) |
+ { |
+ tmp_long = (long)(IntegralNick / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccNick) / 16; |
+ tmp_long2 = (long)(IntegralRoll / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccRoll) / 16; |
+ #define AUSGLEICH 500 |
+ if(tmp_long > AUSGLEICH) tmp_long = AUSGLEICH; |
+ if(tmp_long < -AUSGLEICH) tmp_long =-AUSGLEICH; |
+ if(tmp_long2 > AUSGLEICH) tmp_long2 = AUSGLEICH; |
+ if(tmp_long2 <-AUSGLEICH) tmp_long2 =-AUSGLEICH; |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_IntegralNick -= tmp_long; |
+ Mess_IntegralRoll -= tmp_long2; |
+ } |
+ |
+ else |
+ { |
+ if(IntegralFaktor && !Looping_Nick && !Looping_Roll) |
+ { |
+ tmp_long = (long)(IntegralNick / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccNick); |
+ if(labs(Mittelwert_AccNick) < 200) tmp_long /= 8; |
+ else tmp_long /= 16; |
+ tmp_long2 = (long)(IntegralRoll / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccRoll); |
+ if(labs(Mittelwert_AccRoll) < 200) tmp_long2 /= 8; |
+ else tmp_long2 /= 16; |
+ |
+ #define AUSGLEICH 500 |
+ if(tmp_long > AUSGLEICH) tmp_long = AUSGLEICH; |
+ if(tmp_long < -AUSGLEICH) tmp_long =-AUSGLEICH; |
+ if(tmp_long2 > AUSGLEICH) tmp_long2 = AUSGLEICH; |
+ if(tmp_long2 <-AUSGLEICH) tmp_long2 =-AUSGLEICH; |
+ } |
+ |
+ else |
+ { |
+ tmp_long = 0; |
+ tmp_long2 = 0; |
+ } |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_IntegralNick -= tmp_long; |
+ Mess_IntegralRoll -= tmp_long2; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(abs(StickGier) > 20) // war 35 |
+ { |
+ if(!(EE_Parameter.GlobalConfig & CFG_KOMPASS_FIX)) NeueKompassRichtungMerken = 1; |
+ } |
+ tmp_int = EE_Parameter.Gier_P * (StickGier * abs(StickGier)) / 512; // expo y = ax + bx² |
+ tmp_int += (EE_Parameter.Gier_P * StickGier) / 4; |
+ sollGier = tmp_int; |
+ Mess_Integral_Gier -= tmp_int; |
+ if(Mess_Integral_Gier > 25000) Mess_Integral_Gier = 25000; // begrenzen |
+ if(Mess_Integral_Gier <-25000) Mess_Integral_Gier =-25000; |
+ |
+ ANALOG_ON; // ADC einschalten |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Kompass |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+ if(KompassValue && (EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV)) |
+ { |
+ if(NeueKompassRichtungMerken) |
+ { |
+ KompassStartwert = KompassValue; |
+ NeueKompassRichtungMerken = 0; |
+ } |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_Integral_Gier -= (KompassRichtung * Parameter_KompassWirkung) / 32; // nach Kompass ausrichten |
+ ANALOG_ON; // ADC einschalten |
+ } |
+ |
+ |
+// if(KompassValue && (EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV)) |
+// { |
+// int w,v; |
+// static int SignalSchlecht = 0; |
+// w = abs(IntegralNick /512); // mit zunehmender Neigung den Einfluss drosseln |
+// v = abs(IntegralRoll /512); |
+// if(v > w) w = v; // grösste Neigung ermitteln |
+// if(w < 25 && NeueKompassRichtungMerken && !SignalSchlecht) |
+// { |
+// KompassStartwert = KompassValue; |
+// NeueKompassRichtungMerken = 0; |
+// } |
+// w = (w * Parameter_KompassWirkung) / 64; // auf die Wirkung normieren |
+// w = Parameter_KompassWirkung - w; // Wirkung ggf drosseln |
+// if(w > 0) |
+// { |
+// ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+// if(!SignalSchlecht) Mess_Integral_Gier += (KompassRichtung * w) / 32; // nach Kompass ausrichten |
+// ANALOG_ON; // ADC einschalten |
+// if(SignalSchlecht) SignalSchlecht--; |
+// } |
+// else SignalSchlecht = 500; // so lange das Signal taub stellen --> ca. 1 sek |
+// } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// GPS |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+if(EE_Parameter.GlobalConfig & CFG_GPS_AKTIV) |
+{ |
+ P_GPS_Verstaerkung = Parameter_UserParam1; |
+ D_GPS_Verstaerkung = Parameter_UserParam2; |
+ Limit_D_Anteil = Parameter_UserParam3; |
+ gps_main(); |
+} |
+else |
+{ |
+ GPS_Nick = 0; |
+ GPS_Roll = 0; |
+} |
+ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Debugwerte zuordnen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(!TimerWerteausgabe--) |
+ { |
+ TimerWerteausgabe = 49; |
+ DebugOut.Analog[0] = MM3.NickGrad; |
+ DebugOut.Analog[1] = MM3.RollGrad; |
+ DebugOut.Analog[2] = Mittelwert_AccNick; |
+ DebugOut.Analog[3] = Mittelwert_AccRoll; |
+ DebugOut.Analog[4] = MesswertGier; |
+ DebugOut.Analog[5] = HoehenWert; |
+ DebugOut.Analog[6] = (Mess_Integral_Hoch / 512); |
+ DebugOut.Analog[7] = GasMischanteil; |
+ DebugOut.Analog[8] = KompassValue; |
+ |
+//DebugOut.Analog[8] = MM3_heading(); |
+DebugOut.Analog[9] = MM3.x_axis; |
+DebugOut.Analog[10] = MM3.y_axis; |
+DebugOut.Analog[11] = MM3.z_axis; |
+ |
+ |
+// DebugOut.Analog[0] = actualPos.GPSFix; |
+// DebugOut.Analog[1] = GPS_Roll; |
+// DebugOut.Analog[2] = GPS_Nick; |
+// DebugOut.Analog[3] = GPS_Positionsabweichung_North; |
+// DebugOut.Analog[4] = GPS_Positionsabweichung_East; |
+// DebugOut.Analog[5] = P_Einfluss_East; |
+// DebugOut.Analog[6] = D_Einfluss_East; |
+// DebugOut.Analog[7] = P_Einfluss_North; |
+// DebugOut.Analog[8] = D_Einfluss_North; |
+// DebugOut.Analog[9] = Soll_Position_North; |
+// DebugOut.Analog[10] = Soll_Position_East; |
+// DebugOut.Analog[11] = Parameter_UserParam1; |
+ DebugOut.Analog[12] = MM3.x_axis_last_valid+20; |
+ DebugOut.Analog[13] = MM3.y_axis_last_valid+20; |
+ DebugOut.Analog[14] = MM3.z_axis_last_valid+20; |
+ DebugOut.Analog[15] = GPS_Home_North; |
+ DebugOut.Analog[16] = GPS_Home_East; |
+ DebugOut.Analog[17] = NORTH_MITTEL; |
+ DebugOut.Analog[18] = EAST_MITTEL; |
+ DebugOut.Analog[19] = actualPos.northing; |
+ DebugOut.Analog[20] = actualPos.easting; |
+ DebugOut.Analog[21] = actualPos.velNorth; |
+ DebugOut.Analog[22] = actualPos.velEast; |
+ DebugOut.Analog[23] = UBat; |
+ DebugOut.Analog[24] = (motor_rx[0]+motor_rx[1]+motor_rx[2]+motor_rx[3]); //Gesamtstrom |
+ DebugOut.Analog[25] = StickRoll; |
+ DebugOut.Analog[26] = HoehenWert; |
+ DebugOut.Analog[27] = IntegralNick / EE_Parameter.GyroAccFaktor; |
+ DebugOut.Analog[28] = IntegralRoll / EE_Parameter.GyroAccFaktor; |
+ DebugOut.Analog[29] = Mittelwert_AccNick; |
+ DebugOut.Analog[30] = Mittelwert_AccRoll; |
+ DebugOut.Analog[31] = StickNick; |
+ } |
+ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Drehgeschwindigkeit und -winkel zu einem Istwert zusammenfassen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(Looping_Nick) MesswertNick = MesswertNick * GyroFaktor; |
+ else MesswertNick = IntegralNick * IntegralFaktor + MesswertNick * GyroFaktor; |
+ if(Looping_Roll) MesswertRoll = MesswertRoll * GyroFaktor; |
+ else MesswertRoll = IntegralRoll * IntegralFaktor + MesswertRoll * GyroFaktor; |
+ //MesswertGier = MesswertGier * (GyroFaktor/2) + Integral_Gier * IntegralFaktor; |
+ MesswertGier = MesswertGier * (GyroFaktor) + Integral_Gier * IntegralFaktor/2; |
+ |
+ // Maximalwerte abfangen |
+ #define MAX_SENSOR 2048 |
+ if(MesswertNick > MAX_SENSOR) MesswertNick = MAX_SENSOR; |
+ if(MesswertNick < -MAX_SENSOR) MesswertNick = -MAX_SENSOR; |
+ if(MesswertRoll > MAX_SENSOR) MesswertRoll = MAX_SENSOR; |
+ if(MesswertRoll < -MAX_SENSOR) MesswertRoll = -MAX_SENSOR; |
+ if(MesswertGier > MAX_SENSOR) MesswertGier = MAX_SENSOR; |
+ if(MesswertGier < -MAX_SENSOR) MesswertGier = -MAX_SENSOR; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Höhenregelung |
+// Die Höhenregelung schwächt lediglich das Gas ab, erhöht es allerdings nicht |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+//OCR0B = 180 - (Poti1 + 120) / 4; |
+//DruckOffsetSetting = OCR0B; |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung |
+ { |
+ int tmp_int; |
+ if(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER) // Regler wird über Schalter gesteuert |
+ { |
+ if(Parameter_MaxHoehe < 50) |
+ { |
+ SollHoehe = HoehenWert - 40; // Parameter_MaxHoehe ist der PPM-Wert des Schalters // (160607Kr) |
+ HoehenReglerAktiv = 0; |
+ } |
+ else |
+ HoehenReglerAktiv = 1; |
+ } |
+ else |
+ { |
+ SollHoehe = Parameter_MaxHoehe * EE_Parameter.Hoehe_Verstaerkung - 40; // (160607Kr) |
+ HoehenReglerAktiv = 1; |
+ } |
+ |
+ if(Notlandung) SollHoehe = 0; |
+ h = HoehenWert; |
+ if((h > SollHoehe) && HoehenReglerAktiv) // zu hoch --> drosseln |
+ { h = ((h - SollHoehe) * (int) Parameter_Hoehe_P) / 16; // Differenz bestimmen --> P-Anteil |
+ h = GasMischanteil - h; // vom Gas abziehen |
+ h -= (HoeheD * Parameter_Luftdruck_D)/8; // D-Anteil |
+ tmp_int = ((Mess_Integral_Hoch / 512) * (signed long) Parameter_Hoehe_ACC_Wirkung) / 32; |
+ if(tmp_int > 50) tmp_int = 50; |
+ else if(tmp_int < -50) tmp_int = -50; |
+ h -= tmp_int; |
+ hoehenregler = (hoehenregler*15 + h) / 16; |
+ if(hoehenregler < EE_Parameter.Hoehe_MinGas) // nicht unter MIN |
+ { |
+ if(GasMischanteil >= EE_Parameter.Hoehe_MinGas) hoehenregler = EE_Parameter.Hoehe_MinGas; |
+ if(GasMischanteil < EE_Parameter.Hoehe_MinGas) hoehenregler = GasMischanteil; |
+ } |
+ if(hoehenregler > GasMischanteil) hoehenregler = GasMischanteil; // nicht mehr als Gas |
+ GasMischanteil = hoehenregler; |
+ } |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Mischer und PI-Regler |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ // DebugOut.Analog[7] = GasMischanteil; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gier-Anteil |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define MUL_G 1.0 |
+ GierMischanteil = MesswertGier - sollGier; // Regler für Gier |
+//GierMischanteil = 0; |
+ if(GierMischanteil > (MUL_G * GasMischanteil)) GierMischanteil = MUL_G * GasMischanteil; |
+ if(GierMischanteil < -(MUL_G * GasMischanteil)) GierMischanteil = -(MUL_G * GasMischanteil); |
+ if(GierMischanteil > 100) GierMischanteil = 100; |
+ if(GierMischanteil < -100) GierMischanteil = -100; |
+ |
+ if(GasMischanteil < 20) GierMischanteil = 0; |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Nick-Achse |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+ DiffNick = Kp * (MesswertNick - (StickNick - GPS_Nick)); // Differenz bestimmen |
+ SummeNick += DiffNick; // I-Anteil |
+ if(SummeNick > 0) SummeNick-= (abs(SummeNick)/256 + 1); else SummeNick += abs(SummeNick)/256 + 1; |
+ if(SummeNick > 16000) SummeNick = 16000; |
+ if(SummeNick < -16000) SummeNick = -16000; |
+ pd_ergebnis = DiffNick;// + Ki * SummeNick; // PI-Regler für Nick |
+ // Motor Vorn |
+#define MUL 2 |
+ if(pd_ergebnis > MUL * (GasMischanteil + abs(GierMischanteil))) pd_ergebnis = MUL * (GasMischanteil + abs(GierMischanteil)); |
+ if(pd_ergebnis < -MUL * (GasMischanteil + abs(GierMischanteil))) pd_ergebnis = -MUL * (GasMischanteil + abs(GierMischanteil)); |
+ |
+ motorwert = GasMischanteil + pd_ergebnis + GierMischanteil; // Mischer |
+ if ((motorwert < 0)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Vorne = motorwert; |
+ // Motor Heck |
+ motorwert = GasMischanteil - pd_ergebnis + GierMischanteil; |
+ if ((motorwert < 0)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Hinten = motorwert; |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Roll-Achse |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ DiffRoll = Kp * (MesswertRoll - (StickRoll - GPS_Roll)); // Differenz bestimmen |
+ SummeRoll += DiffRoll; // I-Anteil |
+ if(SummeRoll > 0) SummeRoll-= (abs(SummeRoll)/256 + 1); else SummeRoll += abs(SummeRoll)/256 + 1; |
+ if(SummeRoll > 16000) SummeRoll = 16000; |
+ if(SummeRoll < -16000) SummeRoll = -16000; |
+ pd_ergebnis = DiffRoll;// + Ki * SummeRoll; // PI-Regler für Roll |
+ if(pd_ergebnis > MUL * (GasMischanteil + abs(GierMischanteil))) pd_ergebnis = MUL * (GasMischanteil + abs(GierMischanteil)); |
+ if(pd_ergebnis < -MUL * (GasMischanteil + abs(GierMischanteil))) pd_ergebnis = -MUL * (GasMischanteil + abs(GierMischanteil)); |
+ // Motor Links |
+ motorwert = GasMischanteil + pd_ergebnis - GierMischanteil; |
+ if ((motorwert < 0)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Links = motorwert; |
+ // Motor Rechts |
+ motorwert = GasMischanteil - pd_ergebnis - GierMischanteil; |
+ if ((motorwert < 0)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Rechts = motorwert; |
+ // +++++++++++++++++++++++++++++++++++++++++++++++ |
+} |
+ |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/fc.h |
---|
0,0 → 1,121 |
/*####################################################################################### |
Flight Control |
#######################################################################################*/ |
#ifndef _FC_H |
#define _FC_H |
extern volatile unsigned int I2CTimeout; |
extern unsigned char Sekunde,Minute; |
extern volatile long IntegralNick,IntegralNick2; |
extern volatile long IntegralRoll,IntegralRoll2; |
extern volatile long Mess_IntegralNick,Mess_IntegralNick2; |
extern volatile long Mess_IntegralRoll,Mess_IntegralRoll2; |
extern volatile long Mess_Integral_Hoch; |
extern volatile long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2; |
extern volatile int KompassValue; |
extern volatile int KompassStartwert; |
extern volatile int KompassRichtung; |
extern int HoehenWert; |
extern int SollHoehe; |
extern volatile int MesswertNick,MesswertRoll,MesswertGier; |
extern volatile int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll; |
extern volatile int NeutralAccX, NeutralAccY,Mittelwert_AccHoch; |
extern volatile float NeutralAccZ; |
extern unsigned int modell_fliegt_gps;//(030907Kr) |
extern unsigned char Limit_D_Anteil;//(210907Kr) |
void MotorRegler(void); |
void SendMotorData(void); |
void CalibrierMittelwert(void); |
void Mittelwert(void); |
void SetNeutral(void); |
unsigned char h,m,s; |
volatile unsigned char Timeout ; |
unsigned char CosinusNickWinkel, CosinusRollWinkel; |
volatile long IntegralNick,IntegralNick2; |
volatile long IntegralRoll,IntegralRoll2; |
volatile long Integral_Gier; |
volatile long Mess_IntegralNick,Mess_IntegralNick2; |
volatile long Mess_IntegralRoll,Mess_IntegralRoll2; |
volatile long Mess_Integral_Gier; |
volatile int DiffNick,DiffRoll; |
extern int Poti1, Poti2, Poti3, Poti4, Poti5, Poti6, Poti7, Poti8; //PPM24-Erweiterung (121007Kr) |
volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
unsigned char MotorWert[5]; |
volatile unsigned char SenderOkay; |
int StickNick,StickRoll,StickGier; |
char MotorenEin; |
extern void DefaultKonstanten(void); |
#define STRUCT_PARAM_LAENGE 58 |
struct mk_param_struct |
{ |
unsigned char Kanalbelegung[8]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3 |
unsigned char GlobalConfig; // 0x01=Höhenregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv |
unsigned char Hoehe_MinGas; // Wert : 0-100 |
unsigned char Luftdruck_D; // Wert : 0-250 |
unsigned char MaxHoehe; // Wert : 0-32 |
unsigned char Hoehe_P; // Wert : 0-32 |
unsigned char Hoehe_Verstaerkung; // Wert : 0-50 |
unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250 |
unsigned char Stick_P; // Wert : 1-6 |
unsigned char Stick_D; // Wert : 0-64 |
unsigned char Gier_P; // Wert : 1-20 |
unsigned char Gas_Min; // Wert : 0-32 |
unsigned char Gas_Max; // Wert : 33-250 |
unsigned char GyroAccFaktor; // Wert : 1-64 |
unsigned char KompassWirkung; // Wert : 0-32 |
unsigned char Gyro_P; // Wert : 10-250 |
unsigned char Gyro_I; // Wert : 0-250 |
unsigned char UnterspannungsWarnung; // Wert : 0-250 |
unsigned char NotGas; // Wert : 0-250 //Gaswert bei Empängsverlust |
unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen |
unsigned char UfoAusrichtung; // X oder + Formation |
unsigned char I_Faktor; // Wert : 0-250 |
unsigned char UserParam1; // Wert : 0-250 |
unsigned char UserParam2; // Wert : 0-250 |
unsigned char UserParam3; // Wert : 0-250 |
unsigned char UserParam4; // Wert : 0-250 |
unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos |
unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo |
unsigned char ServoNickMin; // Wert : 0-250 // Anschlag |
unsigned char ServoNickMax; // Wert : 0-250 // Anschlag |
unsigned char ServoNickRefresh; // |
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping |
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag |
//------------------------------------------------ |
unsigned char LoopConfig; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen |
unsigned char Reserved[4]; |
char Name[12]; |
}; |
/* |
unsigned char ServoNickMax; // Wert : 0-250 |
unsigned char ServoNickRefresh; // |
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping |
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag |
//------------------------------------------------ |
unsigned char LoopConfig; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen |
unsigned char Reserved[4]; |
char Name[12]; |
*/ |
extern struct mk_param_struct EE_Parameter; |
extern unsigned char Parameter_Luftdruck_D; |
extern unsigned char Parameter_MaxHoehe; |
extern unsigned char Parameter_Hoehe_P; |
extern unsigned char Parameter_Hoehe_ACC_Wirkung; |
extern unsigned char Parameter_KompassWirkung; |
extern unsigned char Parameter_Gyro_P; |
extern unsigned char Parameter_Gyro_I; |
extern unsigned char Parameter_Gier_P; |
extern unsigned char Parameter_ServoNickControl; |
#endif //_FC_H |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/fc.h.bak |
---|
0,0 → 1,126 |
/*####################################################################################### |
Flight Control |
#######################################################################################*/ |
#ifndef _FC_H |
#define _FC_H |
extern volatile unsigned int I2CTimeout; |
extern unsigned char Sekunde,Minute; |
extern volatile long IntegralNick,IntegralNick2; |
extern volatile long IntegralRoll,IntegralRoll2; |
extern volatile long Mess_IntegralNick,Mess_IntegralNick2; |
extern volatile long Mess_IntegralRoll,Mess_IntegralRoll2; |
extern volatile long Mess_Integral_Hoch; |
extern volatile long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2; |
extern volatile int KompassValue; |
extern volatile int KompassStartwert; |
extern volatile int KompassRichtung; |
extern int HoehenWert; |
extern int SollHoehe; |
extern volatile int MesswertNick,MesswertRoll,MesswertGier; |
extern volatile int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll; |
extern volatile int NeutralAccX, NeutralAccY,Mittelwert_AccHoch; |
extern volatile float NeutralAccZ; |
extern unsigned int modell_fliegt_gps;//(030907Kr) |
extern unsigned char Limit_D_Anteil;//(210907Kr) |
void MotorRegler(void); |
void SendMotorData(void); |
void CalibrierMittelwert(void); |
void Mittelwert(void); |
void SetNeutral(void); |
void Piep(unsigned char Anzahl); |
void DefaultKonstanten1(void); |
void DefaultKonstanten2(void); |
unsigned char h,m,s; |
volatile unsigned char Timeout ; |
unsigned char CosinusNickWinkel, CosinusRollWinkel; |
volatile long IntegralNick,IntegralNick2; |
volatile long IntegralRoll,IntegralRoll2; |
volatile long Integral_Gier; |
volatile long Mess_IntegralNick,Mess_IntegralNick2; |
volatile long Mess_IntegralRoll,Mess_IntegralRoll2; |
volatile long Mess_Integral_Gier; |
volatile int DiffNick,DiffRoll; |
extern int Poti1, Poti2, Poti3, Poti4, Poti5, Poti6, Poti7, Poti8; //PPM24-Erweiterung (121007Kr) |
volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
unsigned char MotorWert[5]; |
volatile unsigned char SenderOkay; |
int StickNick,StickRoll,StickGier; |
char MotorenEin; |
extern void DefaultKonstanten(void); |
#define STRUCT_PARAM_LAENGE 58 |
struct mk_param_struct |
{ |
unsigned char Kanalbelegung[8]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3 |
unsigned char GlobalConfig; // 0x01=Höhenregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv |
unsigned char Hoehe_MinGas; // Wert : 0-100 |
unsigned char Luftdruck_D; // Wert : 0-250 |
unsigned char MaxHoehe; // Wert : 0-32 |
unsigned char Hoehe_P; // Wert : 0-32 |
unsigned char Hoehe_Verstaerkung; // Wert : 0-50 |
unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250 |
unsigned char Stick_P; // Wert : 1-6 |
unsigned char Stick_D; // Wert : 0-64 |
unsigned char Gier_P; // Wert : 1-20 |
unsigned char Gas_Min; // Wert : 0-32 |
unsigned char Gas_Max; // Wert : 33-250 |
unsigned char GyroAccFaktor; // Wert : 1-64 |
unsigned char KompassWirkung; // Wert : 0-32 |
unsigned char Gyro_P; // Wert : 10-250 |
unsigned char Gyro_I; // Wert : 0-250 |
unsigned char UnterspannungsWarnung; // Wert : 0-250 |
unsigned char NotGas; // Wert : 0-250 //Gaswert bei Empängsverlust |
unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen |
unsigned char UfoAusrichtung; // X oder + Formation |
unsigned char I_Faktor; // Wert : 0-250 |
unsigned char UserParam1; // Wert : 0-250 |
unsigned char UserParam2; // Wert : 0-250 |
unsigned char UserParam3; // Wert : 0-250 |
unsigned char UserParam4; // Wert : 0-250 |
unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos |
unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo |
unsigned char ServoNickMin; // Wert : 0-250 // Anschlag |
unsigned char ServoNickMax; // Wert : 0-250 // Anschlag |
unsigned char ServoNickRefresh; // |
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping |
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag |
//------------------------------------------------ |
unsigned char LoopConfig; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen |
unsigned char Reserved[4]; |
char Name[12]; |
}; |
/* |
unsigned char ServoNickMax; // Wert : 0-250 |
unsigned char ServoNickRefresh; // |
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping |
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag |
//------------------------------------------------ |
unsigned char LoopConfig; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen |
unsigned char Reserved[4]; |
char Name[12]; |
*/ |
extern struct mk_param_struct EE_Parameter; |
extern unsigned char Parameter_Luftdruck_D; |
extern unsigned char Parameter_MaxHoehe; |
extern unsigned char Parameter_Hoehe_P; |
extern unsigned char Parameter_Hoehe_ACC_Wirkung; |
extern unsigned char Parameter_KompassWirkung; |
extern unsigned char Parameter_Gyro_P; |
extern unsigned char Parameter_Gyro_I; |
extern unsigned char Parameter_Gier_P; |
extern unsigned char Parameter_ServoNickControl; |
#endif //_FC_H |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/flight-ctrl_mega644_v0_64.aws |
---|
0,0 → 1,0 |
<AVRWorkspace><IOSettings><CurrentRegisters/></IOSettings><part name="ATMEGA644"/><Files><File00000 Name="E:\hubi\ufo\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\alpha\v064JokoGPSNick666AccMM3filtered\main.c" Position="333 108 865 484" LineCol="155 0" State="Maximized"/><File00001 Name="E:\hubi\ufo\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\alpha\v064JokoGPSNick666AccMM3filtered\compass.c" Position="333 69 1179 567" LineCol="57 0" State="Maximized"/><File00002 Name="E:\hubi\ufo\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\alpha\v064JokoGPSNick666AccMM3filtered\compass.h" Position="338 110 884 478" LineCol="46 0" State="Maximized"/><File00003 Name="E:\hubi\ufo\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\alpha\v064JokoGPSNick666AccMM3filtered\fc.c" Position="336 71 1182 569" LineCol="880 0" State="Maximized"/></Files></AVRWorkspace> |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/flight.pnproj |
---|
0,0 → 1,0 |
<Project name="Flight-Ctrl"><File path="uart.h"></File><File path="main.c"></File><File path="main.h"></File><File path="makefile"></File><File path="uart.c"></File><File path="printf_P.h"></File><File path="printf_P.c"></File><File path="timer0.c"></File><File path="timer0.h"></File><File path="old_macros.h"></File><File path="twimaster.c"></File><File path="version.txt"></File><File path="twimaster.h"></File><File path="rc.c"></File><File path="rc.h"></File><File path="fc.h"></File><File path="fc.c"></File><File path="menu.h"></File><File path="menu.c"></File><File path="_Settings.h"></File><File path="analog.c"></File><File path="analog.h"></File><File path="GPS.c"></File><File path="gps.h"></File><File path="License.txt"></File></Project> |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/flight.pnps |
---|
0,0 → 1,0 |
<pd><ViewState><e p="Flight-Ctrl" x="true"></e></ViewState></pd> |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/gps.h |
---|
0,0 → 1,26 |
extern long P_Einfluss_North; |
extern long D_Einfluss_North; |
extern long P_Einfluss_East; |
extern long D_Einfluss_East; |
extern long GPS_Positionsabweichung_North; |
extern long GPS_Positionsabweichung_East; |
extern long GPS_Geschwindigkeit_North; |
extern long GPS_Geschwindigkeit_East; |
extern long GPS_Home_North; |
extern long GPS_Home_East; |
extern long Soll_Position_North; |
extern long Soll_Position_East; |
extern volatile long EAST_MITTEL; |
extern volatile long NORTH_MITTEL; |
extern signed int GPS_Nick; |
extern signed int GPS_Roll; |
extern void GPS_Neutral(void); |
extern void GPS_BerechneZielrichtung(void); |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/main.c |
---|
0,0 → 1,229 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + Nur für den privaten Gebrauch |
// + www.MikroKopter.com |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
// + dass eine Nutzung (auch auszugsweise) nur für den privaten und nicht-kommerziellen Gebrauch zulässig ist. |
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
// + bzgl. der Nutzungsbedingungen aufzunehmen. |
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
// + Verkauf von Luftbildaufnahmen, usw. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
// + auf anderen Webseiten oder Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
// + eindeutig als Ursprung verlinkt und genannt werden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
// + Benutzung auf eigene Gefahr |
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
// + mit unserer Zustimmung zulässig |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
// + this list of conditions and the following disclaimer. |
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
// + from this software without specific prior written permission. |
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
// + for non-commercial use (directly or indirectly) |
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
// + with our written permission |
// + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
// + clearly linked as origin |
// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
unsigned char EEPromArray[E2END+1] EEMEM; |
unsigned char PlatinenVersion = 10; |
// -- Parametersatz aus EEPROM lesen --- |
// number [0..5] |
void ReadParameterSet(unsigned char number, unsigned char *buffer, unsigned char length) |
{ |
if (number > 5) number = 5; |
eeprom_read_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * number], length); |
} |
// -- Parametersatz ins EEPROM schreiben --- |
// number [0..5] |
void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length) |
{ |
if(number > 5) number = 5; |
eeprom_write_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * number], length); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], number); // diesen Parametersatz als aktuell merken |
} |
unsigned char GetActiveParamSetNumber(void) |
{ |
unsigned char set; |
set = eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET]); |
if(set > 5) |
{ |
set = 2; |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], set); // diesen Parametersatz als aktuell merken |
} |
return(set); |
} |
//############################################################################ |
//Hauptprogramm |
int main (void) |
//############################################################################ |
{ |
unsigned int timer; |
unsigned int timer2 = 0; |
DDRB = 0x00; |
PORTB = 0x00; |
for(timer = 0; timer < 1000; timer++); // verzögern |
if(PINB & 0x01) PlatinenVersion = 11; else PlatinenVersion = 10; |
DDRC = 0x81; // SCL |
PORTC = 0xff; // Pullup SDA |
DDRB = 0x1B; // LEDs und Druckoffset |
PORTB = 0x01; // LED_Rot |
DDRD = 0x3E; // Speaker & TXD & J3 J4 J5 |
DDRD |=0x80; // J7 |
PORTD = 0xF7; // LED |
MCUSR &=~(1<<WDRF); |
WDTCSR |= (1<<WDCE)|(1<<WDE); |
WDTCSR = 0; |
beeptime = 2000; |
StickGier = 0; PPM_in[K_GAS] = 0;StickRoll = 0; StickNick = 0; |
ROT_OFF; |
Timer_Init(); |
UART_Init(); |
rc_sum_init(); |
ADC_Init(); |
i2c_init(); |
init_spi(); |
sei(); |
VersionInfo.Hauptversion = VERSION_HAUPTVERSION; |
VersionInfo.Nebenversion = VERSION_NEBENVERSION; |
VersionInfo.PCKompatibel = VERSION_KOMPATIBEL; |
printf("\n\rFlightControl\n\rHardware:%d.%d\n\rSoftware:V%d.%d ",PlatinenVersion/10,PlatinenVersion%10, VERSION_HAUPTVERSION, VERSION_NEBENVERSION); |
printf("\n\r=============================="); |
GRN_ON; |
#define EE_DATENREVISION 62 // wird angepasst, wenn sich die EEPROM-Daten geändert haben |
if(eeprom_read_byte(&EEPromArray[EEPROM_ADR_VALID]) != EE_DATENREVISION) |
{ |
printf("\n\rInit. EEPROM: Generiere Default-Parameter..."); |
DefaultKonstanten1(); |
for (unsigned char i=0;i<6;i++) |
{ |
if(i==2) DefaultKonstanten2(); |
WriteParameterSet(i, (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
} |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], 2); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_VALID], EE_DATENREVISION); |
} |
ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
printf("\n\rBenutze Parametersatz %d", GetActiveParamSetNumber()); |
if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
printf("\n\rAbgleich Luftdrucksensor.."); |
timer = SetDelay(1000); |
SucheLuftruckOffset(); |
while (!CheckDelay(timer)); |
printf("OK\n\r"); |
} |
SetNeutral(); |
ROT_OFF; |
beeptime = 2000; |
DebugIn.Analog[1] = 1000; |
DebugIn.Digital[0] = 0x55; |
printf("\n\rSteuerung: "); |
if (EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) printf("HeadingHold"); |
else printf("Neutral"); |
printf("\n\n\r"); |
LcdClear(); |
I2CTimeout = 5000; |
while (1) |
{ |
if (UpdateMotor) // ReglerIntervall |
{ |
UpdateMotor=0; |
MotorRegler(); |
SendMotorData(); |
ROT_OFF; |
if(PcZugriff) PcZugriff--; |
if(SenderOkay) SenderOkay--; |
if(!I2CTimeout) |
{ |
I2CTimeout = 5; |
i2c_reset(); |
if((BeepMuster == 0xffff) && MotorenEin) |
{ |
beeptime = 10000; |
BeepMuster = 0x0080; |
} |
} |
else |
{ |
I2CTimeout--; |
ROT_OFF; |
} |
} |
if(SIO_DEBUG) |
{ |
DatenUebertragung(); |
BearbeiteRxDaten(); |
} |
else BearbeiteRxDaten(); |
if(CheckDelay(timer)) |
{ |
if(UBat < EE_Parameter.UnterspannungsWarnung) |
{ |
if(BeepMuster == 0xffff) |
{ |
beeptime = 6000; |
BeepMuster = 0x0300; |
} |
} |
timer = SetDelay(100); |
} |
} |
return (1); |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/main.h |
---|
0,0 → 1,111 |
#ifndef _MAIN_H |
#define _MAIN_H |
//Hier die Quarz Frequenz einstellen |
#if defined (__AVR_ATmega32__) |
#define SYSCLK 20000000L //Quarz Frequenz in Hz |
#endif |
#if defined (__AVR_ATmega644__) |
#define SYSCLK 20000000L //Quarz Frequenz in Hz |
//#define SYSCLK 16000000L //Quarz Frequenz in Hz |
#endif |
// neue Hardware |
#define ROT_OFF {if(PlatinenVersion == 10) PORTB &=~0x01; else PORTB |= 0x01;} |
#define ROT_ON {if(PlatinenVersion == 10) PORTB |= 0x01; else PORTB &=~0x01;} |
#define ROT_FLASH PORTB ^= 0x01 |
#define GRN_OFF PORTB &=~0x02 |
#define GRN_ON PORTB |= 0x02 |
#define GRN_FLASH PORTB ^= 0x02 |
#define LED1_OFF PORTC &=~0x04 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED1_ON PORTC |= 0x04 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED1_FLASH PORTC ^= 0x04 //Erweiterung by 4ndreas aus mikrosvn branches // (280807Kr) |
#define LED2_OFF PORTC &=~0x08 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED2_ON PORTC |= 0x08 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED2_FLASH PORTC ^= 0x08 //Erweiterung by 4ndreas aus mikrosvn branches // (280807Kr) |
//#ifndef F_CPU |
//#error ################## F_CPU nicht definiert oder ungültig ############# |
//#endif |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//#define ANZ_MITTELWERT 4 |
#define EEPROM_ADR_VALID 1 |
#define EEPROM_ADR_ACTIVE_SET 2 |
#define EEPROM_ADR_LAST_OFFSET 3 |
#define EEPROM_ADR_PARAM_BEGIN 100 |
#define CFG_HOEHENREGELUNG 0x01 |
#define CFG_HOEHEN_SCHALTER 0x02 |
#define CFG_HEADING_HOLD 0x04 |
#define CFG_KOMPASS_AKTIV 0x08 |
#define CFG_KOMPASS_FIX 0x10 |
#define CFG_GPS_AKTIV 0x20 |
#define CFG_LOOP_OBEN 0x01 |
#define CFG_LOOP_UNTEN 0x02 |
#define CFG_LOOP_LINKS 0x04 |
#define CFG_LOOP_RECHTS 0x08 |
//#define SYSCLK |
//extern unsigned long SYSCLK; |
extern volatile int i_Nick[20],i_Roll[20],DiffNick,DiffRoll; |
extern volatile unsigned char SenderOkay; |
extern unsigned char CosinusNickWinkel, CosinusRollWinkel; |
extern unsigned char PlatinenVersion; |
extern void ReadParameterSet (unsigned char number, unsigned char *buffer, unsigned char length); |
extern void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length); |
extern unsigned char GetActiveParamSetNumber(void); |
extern unsigned char EEPromArray[]; |
long durchschnitt_northing; |
long durchschnitt_easting; |
volatile int P_GPS_Verstaerkung; //P-Anteil (80-120) |
volatile int D_GPS_Verstaerkung; //D-Anteil (90) |
#include <stdlib.h> |
#include <string.h> |
#include <avr/io.h> |
#include <avr/pgmspace.h> |
#include <avr/interrupt.h> |
#include <avr/eeprom.h> |
#include <avr/boot.h> |
#include <avr/wdt.h> |
#include "old_macros.h" |
#include "_settings.h" |
#include "printf_P.h" |
#include "timer0.h" |
#include "uart.h" |
#include "analog.h" |
#include "twimaster.h" |
#include "menu.h" |
#include "rc.h" |
#include "fc.h" |
#include "gps.h" |
#include "compass.h" |
#include "math.h" |
#ifndef EEMEM |
#define EEMEM __attribute__ ((section (".eeprom"))) |
#endif |
#define DEBUG_DISPLAY_INTERVALL 123 // in ms |
#define DELAY_US(x) ((unsigned int)( (x) * 1e-6 * F_CPU )) |
#endif //_MAIN_H |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/makefile |
---|
0,0 → 1,391 |
#-------------------------------------------------------------------- |
# MCU name |
MCU = atmega644 |
F_CPU = 20000000 |
#------------------------------------------------------------------- |
HAUPT_VERSION = 0 |
NEBEN_VERSION = 64 |
VERSION_KOMPATIBEL = 5 # PC-Kompatibilität |
#------------------------------------------------------------------- |
ifeq ($(MCU), atmega32) |
# FUSE_SETTINGS= -u -U lfuse:w:0xff:m -U hfuse:w:0xcf:m |
HEX_NAME = MEGA32 |
endif |
ifeq ($(MCU), atmega644) |
FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
#FUSE_SETTINGS = -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
# -u bei neuen Controllern wieder einspielen |
HEX_NAME = MEGA644 |
endif |
ifeq ($(F_CPU), 16000000) |
QUARZ = 16MHZ |
endif |
ifeq ($(F_CPU), 20000000) |
QUARZ = 20MHZ |
endif |
# Output format. (can be srec, ihex, binary) |
FORMAT = ihex |
# Target file name (without extension). |
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION) |
# Optimization level, can be [0, 1, 2, 3, s]. 0 turns off optimization. |
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.) |
OPT = s |
########################################################################################################## |
# List C source files here. (C dependencies are automatically generated.) |
SRC = main.c uart.c printf_P.c timer0.c analog.c menu.c |
SRC += twimaster.c rc.c fc.c GPS.c compass.c math.c |
########################################################################################################## |
# List Assembler source files here. |
# Make them always end in a capital .S. Files ending in a lowercase .s |
# will not be considered source files but generated files (assembler |
# output from the compiler), and will be deleted upon "make clean"! |
# Even though the DOS/Win* filesystem matches both .s and .S the same, |
# it will preserve the spelling of the filenames, and gcc itself does |
# care about how the name is spelled on its command-line. |
ASRC = |
# List any extra directories to look for include files here. |
# Each directory must be seperated by a space. |
EXTRAINCDIRS = |
# Optional compiler flags. |
# -g: generate debugging information (for GDB, or for COFF conversion) |
# -O*: optimization level |
# -f...: tuning, see gcc manual and avr-libc documentation |
# -Wall...: warning level |
# -Wa,...: tell GCC to pass this to the assembler. |
# -ahlms: create assembler listing |
CFLAGS = -O$(OPT) \ |
-funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums \ |
-Wall -Wstrict-prototypes \ |
-Wa,-adhlns=$(<:.c=.lst) \ |
$(patsubst %,-I%,$(EXTRAINCDIRS)) |
# Set a "language standard" compiler flag. |
# Unremark just one line below to set the language standard to use. |
# gnu99 = C99 + GNU extensions. See GCC manual for more information. |
#CFLAGS += -std=c89 |
#CFLAGS += -std=gnu89 |
#CFLAGS += -std=c99 |
CFLAGS += -std=gnu99 |
CFLAGS += -DVERSION_HAUPTVERSION=$(HAUPT_VERSION) -DVERSION_NEBENVERSION=$(NEBEN_VERSION) -DVERSION_KOMPATIBEL=$(VERSION_KOMPATIBEL) |
# Optional assembler flags. |
# -Wa,...: tell GCC to pass this to the assembler. |
# -ahlms: create listing |
# -gstabs: have the assembler create line number information; note that |
# for use in COFF files, additional information about filenames |
# and function names needs to be present in the assembler source |
# files -- see avr-libc docs [FIXME: not yet described there] |
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs |
# Optional linker flags. |
# -Wl,...: tell GCC to pass this to linker. |
# -Map: create map file |
# --cref: add cross reference to map file |
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref |
# Additional libraries |
# Minimalistic printf version |
#LDFLAGS += -Wl,-u,vfprintf -lprintf_min |
# Floating point printf version (requires -lm below) |
#LDFLAGS += -Wl,-u,vfprintf -lprintf_flt |
# -lm = math library |
LDFLAGS += -lm |
##LDFLAGS += -T./linkerfile/avr5.x |
# Programming support using avrdude. Settings and variables. |
# Programming hardware: alf avr910 avrisp bascom bsd |
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500 |
# |
# Type: avrdude -c ? |
# to get a full listing. |
# |
#AVRDUDE_PROGRAMMER = stk200 |
AVRDUDE_PROGRAMMER = dt006 |
#AVRDUDE_PROGRAMMER = ponyser |
#falls Ponyser ausgewählt wird, muss sich unsere avrdude-Configdatei im Bin-Verzeichnis des Compilers befinden |
#AVRDUDE_PORT = com1 # programmer connected to serial device |
AVRDUDE_PORT = lpt1 # programmer connected to parallel port |
#AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex |
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex $(FUSE_SETTINGS) |
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep |
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) |
# Uncomment the following if you want avrdude's erase cycle counter. |
# Note that this counter needs to be initialized first using -Yn, |
# see avrdude manual. |
#AVRDUDE_ERASE += -y |
# Uncomment the following if you do /not/ wish a verification to be |
# performed after programming the device. |
AVRDUDE_FLAGS += -V |
# Increase verbosity level. Please use this when submitting bug |
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> |
# to submit bug reports. |
#AVRDUDE_FLAGS += -v -v |
# --------------------------------------------------------------------------- |
# Define directories, if needed. |
DIRAVR = c:/winavr |
DIRAVRBIN = $(DIRAVR)/bin |
DIRAVRUTILS = $(DIRAVR)/utils/bin |
DIRINC = . |
DIRLIB = $(DIRAVR)/avr/lib |
# Define programs and commands. |
SHELL = sh |
CC = avr-gcc |
OBJCOPY = avr-objcopy |
OBJDUMP = avr-objdump |
SIZE = avr-size |
# Programming support using avrdude. |
AVRDUDE = avrdude |
REMOVE = rm -f |
COPY = cp |
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex |
ELFSIZE = $(SIZE) -A $(TARGET).elf |
# Define Messages |
# English |
MSG_ERRORS_NONE = Errors: none |
MSG_BEGIN = -------- begin -------- |
MSG_END = -------- end -------- |
MSG_SIZE_BEFORE = Size before: |
MSG_SIZE_AFTER = Size after: |
MSG_COFF = Converting to AVR COFF: |
MSG_EXTENDED_COFF = Converting to AVR Extended COFF: |
MSG_FLASH = Creating load file for Flash: |
MSG_EEPROM = Creating load file for EEPROM: |
MSG_EXTENDED_LISTING = Creating Extended Listing: |
MSG_SYMBOL_TABLE = Creating Symbol Table: |
MSG_LINKING = Linking: |
MSG_COMPILING = Compiling: |
MSG_ASSEMBLING = Assembling: |
MSG_CLEANING = Cleaning project: |
# Define all object files. |
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o) |
# Define all listing files. |
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst) |
# Combine all necessary flags and optional flags. |
# Add target processor to flags. |
#ALL_CFLAGS = -mmcu=$(MCU) -DF_CPU=$(F_CPU) -I. $(CFLAGS) |
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) |
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) |
# Default target. |
all: begin gccversion sizebefore $(TARGET).elf $(TARGET).hex $(TARGET).eep \ |
$(TARGET).lss $(TARGET).sym sizeafter finished end |
# Eye candy. |
# AVR Studio 3.x does not check make's exit code but relies on |
# the following magic strings to be generated by the compile job. |
begin: |
@echo |
@echo $(MSG_BEGIN) |
finished: |
@echo $(MSG_ERRORS_NONE) |
end: |
@echo $(MSG_END) |
@echo |
# Display size of file. |
sizebefore: |
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi |
sizeafter: |
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi |
# Display compiler version information. |
gccversion : |
@$(CC) --version |
# Convert ELF to COFF for use in debugging / simulating in |
# AVR Studio or VMLAB. |
COFFCONVERT=$(OBJCOPY) --debugging \ |
--change-section-address .data-0x800000 \ |
--change-section-address .bss-0x800000 \ |
--change-section-address .noinit-0x800000 \ |
--change-section-address .eeprom-0x810000 |
coff: $(TARGET).elf |
@echo |
@echo $(MSG_COFF) $(TARGET).cof |
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof |
extcoff: $(TARGET).elf |
@echo |
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof |
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof |
# Program the device. |
program: $(TARGET).hex $(TARGET).eep |
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) |
# Create final output files (.hex, .eep) from ELF output file. |
%.hex: %.elf |
@echo |
@echo $(MSG_FLASH) $@ |
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ |
%.eep: %.elf |
@echo |
@echo $(MSG_EEPROM) $@ |
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ |
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@ |
# Create extended listing file from ELF output file. |
%.lss: %.elf |
@echo |
@echo $(MSG_EXTENDED_LISTING) $@ |
$(OBJDUMP) -h -S $< > $@ |
# Create a symbol table from ELF output file. |
%.sym: %.elf |
@echo |
@echo $(MSG_SYMBOL_TABLE) $@ |
avr-nm -n $< > $@ |
# Link: create ELF output file from object files. |
.SECONDARY : $(TARGET).elf |
.PRECIOUS : $(OBJ) |
%.elf: $(OBJ) |
@echo |
@echo $(MSG_LINKING) $@ |
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS) |
# Compile: create object files from C source files. |
%.o : %.c |
@echo |
@echo $(MSG_COMPILING) $< |
$(CC) -c $(ALL_CFLAGS) $< -o $@ |
# Compile: create assembler files from C source files. |
%.s : %.c |
$(CC) -S $(ALL_CFLAGS) $< -o $@ |
# Assemble: create object files from assembler source files. |
%.o : %.S |
@echo |
@echo $(MSG_ASSEMBLING) $< |
$(CC) -c $(ALL_ASFLAGS) $< -o $@ |
# Target: clean project. |
clean: begin clean_list finished end |
clean_list : |
@echo |
@echo $(MSG_CLEANING) |
# $(REMOVE) $(TARGET).hex |
$(REMOVE) $(TARGET).eep |
$(REMOVE) $(TARGET).obj |
$(REMOVE) $(TARGET).cof |
$(REMOVE) $(TARGET).elf |
$(REMOVE) $(TARGET).map |
$(REMOVE) $(TARGET).obj |
$(REMOVE) $(TARGET).a90 |
$(REMOVE) $(TARGET).sym |
$(REMOVE) $(TARGET).lnk |
$(REMOVE) $(TARGET).lss |
$(REMOVE) $(OBJ) |
$(REMOVE) $(LST) |
$(REMOVE) $(SRC:.c=.s) |
$(REMOVE) $(SRC:.c=.d) |
# Automatically generate C source code dependencies. |
# (Code originally taken from the GNU make user manual and modified |
# (See README.txt Credits).) |
# |
# Note that this will work with sh (bash) and sed that is shipped with WinAVR |
# (see the SHELL variable defined above). |
# This may not work with other shells or other seds. |
# |
%.d: %.c |
set -e; $(CC) -MM $(ALL_CFLAGS) $< \ |
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > $@; \ |
[ -s $@ ] || rm -f $@ |
# Remove the '-' if you want to see the dependency files generated. |
-include $(SRC:.c=.d) |
# Listing of phony targets. |
.PHONY : all begin finish end sizebefore sizeafter gccversion coff extcoff \ |
clean clean_list program |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/math.c |
---|
0,0 → 1,118 |
/* |
Copyright 2007, Niklas Nold |
This program (files math.c and math.h) is free software; you can redistribute it and/or modify |
it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; |
either version 3 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
Please note: All the other files for the project "Mikrokopter" by H. Buss are under the license (license_buss.txt) published by www.mikrokopter.de |
*/ |
#include "main.h" |
const uint8_t pgm_atan[270] PROGMEM = {0,1,2,3,5,6,7,8,9,10,11,12,13,15,16,17,18,19,20,21,22,23,24,25,26,27,27,28,29,30,31,32,33,33,34,35,36,37,37,38,39,39,40,41,41,42,43,43,44,44,45,46,46,47,47,48,48,49,49,50,50,51,51,52,52,52,53,53,54,54,54,55,55,56,56,56,57,57,57,58,58,58,59,59,59,60,60,60,60,61,61,61,61,62,62,62,62,63,63,63,63,64,64,64,64,65,65,65,65,65,66,66,66,66,66,67,67,67,67,67,67,68,68,68,68,68,68,69,69,69,69,69,69,69,70,70,70,70,70,70,70,70,71,71,71,71,71,71,71,71,72,72,72,72,72,72,72,72,72,73,73,73,73,73,73,73,73,73,73,74,74,74,74,74,74,74,74,74,74,74,74,75,75,75,75,75,75,75,75,75,75,75,75,75,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79}; |
// Arkustangens2 im Gradmaß |
signed int atan2_i(signed int x, signed int y) |
{ |
int i,angle; |
int8_t m; |
if (!x && !y) return 0; //atan2 = 0 für x und y = 0 |
if (y < 0) m=-1; |
else m=1; |
if (x==0) return (90*m); // atan2 = 90° für x = 0 |
i = abs(((float)y / x) * 50); // Berechne i für die Lookup table (Schrittweite atan(x) ist 0.02 -> *50) |
if (i<270) angle = pgm_read_byte(&pgm_atan[i]); // Lookup für 1° bis 79° |
else if (i>5750) angle = 90; // Grenzwert ist 90° |
else if (i>=1910) angle = 89; // 89° bis 80° über Wertebereiche |
else if (i>=1150) angle = 88; |
else if (i>=820) angle = 87; |
else if (i>=640) angle = 86; |
else if (i>=520) angle = 85; |
else if (i>=440) angle = 84; |
else if (i>=380) angle = 83; |
else if (i>=335) angle = 82; |
else if (i>=299) angle = 81; |
else angle = 80; // (i>=270) |
if (x > 0) return (angle*m); // Quadrant I und IV |
else if ((x < 0) && (y >= 0)) return ((angle*-1) + 180); // Quadrant II |
else return (angle - 180); // x < 0 && y < 0 Quadrant III |
} |
const float pgm_sinus_f [91] PROGMEM = {0.000,0.017,0.035,0.052,0.070,0.087,0.105,0.122,0.139,0.156,0.174,0.191,0.208,0.225,0.242,0.259,0.276,0.292,0.309,0.326,0.342,0.358,0.375,0.391,0.407,0.423,0.438,0.454,0.469,0.485,0.500,0.515,0.530,0.545,0.559,0.574,0.588,0.602,0.616,0.629,0.643,0.656,0.669,0.682,0.695,0.707,0.719,0.731,0.743,0.755,0.766,0.777,0.788,0.799,0.809,0.819,0.829,0.839,0.848,0.857,0.866,0.875,0.883,0.891,0.899,0.906,0.914,0.921,0.927,0.934,0.940,0.946,0.951,0.956,0.961,0.966,0.970,0.974,0.978,0.982,0.985,0.988,0.990,0.993,0.995,0.996,0.998,0.999,0.999,1.000,1.000}; |
inline float pgm_read_float(const float *addr) |
{ |
union |
{ |
uint16_t i[2]; // 2 16-bit-Worte |
float f; |
} u; |
u.i[0]=pgm_read_word((PGM_P)addr); |
u.i[1]=pgm_read_word((PGM_P)addr+2); |
return u.f; |
} |
// Kosinusfunktion im Gradmaß |
float cos_f(signed int winkel) |
{ |
return (sin_f(90-winkel)); |
} |
// Sinusfunktion im Gradmaß |
float sin_f(signed int winkel) |
{ |
short int m,n; |
float sinus; |
//winkel = winkel % 360; |
if (winkel < 0) |
{ |
m = -1; |
winkel = abs(winkel); |
} |
else m = +1; |
// Quadranten auswerten |
if ((winkel > 90 ) && (winkel <= 180)) {winkel = 180 - winkel; n = 1;} |
else if ((winkel > 180 ) && (winkel <= 270)) {winkel = winkel - 180; n = -1;} |
else if ((winkel > 270) && (winkel <= 360)) {winkel = 360 - winkel; n = -1;} |
else n = 1; //0 - 90 Grad |
sinus = pgm_read_float(&pgm_sinus_f[winkel]); |
return (sinus*m*n); |
} |
const uint8_t pgm_asin[201] PROGMEM = {0,0,1,1,1,1,2,2,2,3,3,3,3,4,4,4,5,5,5,5,6,6,6,7,7,7,7,8,8,8,9,9,9,9,10,10,10,11,11,11,12,12,12,12,13,13,13,14,14,14,14,15,15,15,16,16,16,17,17,17,17,18,18,18,19,19,19,20,20,20,20,21,21,21,22,22,22,23,23,23,24,24,24,25,25,25,25,26,26,26,27,27,27,28,28,28,29,29,29,30,30,30,31,31,31,32,32,32,33,33,33,34,34,34,35,35,35,36,36,37,37,37,38,38,38,39,39,39,40,40,41,41,41,42,42,42,43,43,44,44,44,45,45,46,46,46,47,47,48,48,49,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,62,62,63,64,64,65,66,66,67,68,68,69,70,71,72,73,74,75,76,77,79,80,82,84,90}; |
// Akurssinusfunktion im Gradmaß |
int8_t asin_i(signed int i) |
{ |
signed char m; |
if (i < 0) {m=-1;i=abs(i);} |
else m=1; |
return (pgm_read_byte(&pgm_asin[i]) * m); |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/math.h |
---|
0,0 → 1,11 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Peter Muehlenbrock |
// Definitionen fuer Modul math |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
extern signed int atan2_i(signed int x, signed int y); |
extern float cos_f(signed int winkel); |
extern float sin_f(signed int winkel); |
extern int8_t asin_i(signed int i); |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/menu.c |
---|
0,0 → 1,118 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
unsigned int TestInt = 0; |
#define ARRAYGROESSE 10 |
unsigned char Array[ARRAYGROESSE] = {1,2,3,4,5,6,7,8,9,10}; |
char DisplayBuff[80] = "Hallo Welt"; |
unsigned char DispPtr = 0; |
unsigned char RemoteTasten = 0; |
#define KEY1 0x01 |
#define KEY2 0x02 |
#define KEY3 0x04 |
#define KEY4 0x08 |
#define KEY5 0x10 |
void LcdClear(void) |
{ |
unsigned char i; |
for(i=0;i<80;i++) DisplayBuff[i] = ' '; |
} |
void Menu(void) |
{ |
static unsigned char MaxMenue = 10,MenuePunkt=0; |
if(RemoteTasten & KEY1) { if(MenuePunkt) MenuePunkt--; else MenuePunkt = MaxMenue; LcdClear(); } |
if(RemoteTasten & KEY2) { MenuePunkt++; LcdClear(); } |
if((RemoteTasten & KEY1) && (RemoteTasten & KEY2)) MenuePunkt = 0; |
LCD_printfxy(17,0,"[%i]",MenuePunkt); |
switch(MenuePunkt) |
{ |
case 0: |
LCD_printfxy(0,0,"++ MikroKopter ++"); |
LCD_printfxy(0,1,"HW:V%d.%d SW:%d.%d",PlatinenVersion/10,PlatinenVersion%10,VERSION_HAUPTVERSION, VERSION_NEBENVERSION); |
LCD_printfxy(0,2,"Setting: %d ",GetActiveParamSetNumber()); |
LCD_printfxy(0,3,"(c) Holger Buss"); |
// if(RemoteTasten & KEY3) TestInt--; |
// if(RemoteTasten & KEY4) TestInt++; |
break; |
case 1: |
if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
LCD_printfxy(0,0,"Hoehe: %5i",HoehenWert); |
LCD_printfxy(0,1,"SollHoehe: %5i",SollHoehe); |
LCD_printfxy(0,2,"Luftdruck: %5i",MessLuftdruck); |
LCD_printfxy(0,3,"Off : %5i",DruckOffsetSetting); |
} |
else |
{ |
LCD_printfxy(0,1,"Keine "); |
LCD_printfxy(0,2,"Höhenregelung"); |
} |
break; |
case 2: |
LCD_printfxy(0,0,"akt. Lage"); |
LCD_printfxy(0,1,"Nick: %5i",IntegralNick/1024); |
LCD_printfxy(0,2,"Roll: %5i",IntegralRoll/1024); |
LCD_printfxy(0,3,"Kompass: %5i",KompassValue); |
break; |
case 3: |
LCD_printfxy(0,0,"K1:%4i K2:%4i ",PPM_in[1],PPM_in[2]); |
LCD_printfxy(0,1,"K3:%4i K4:%4i ",PPM_in[3],PPM_in[4]); |
LCD_printfxy(0,2,"K5:%4i K6:%4i ",PPM_in[5],PPM_in[6]); |
LCD_printfxy(0,3,"K7:%4i K8:%4i ",PPM_in[7],PPM_in[8]); |
break; |
case 4: |
LCD_printfxy(0,0,"Ni:%4i Ro:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_NICK]],PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]); |
LCD_printfxy(0,1,"Gs:%4i Gi:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_GAS]],PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]); |
LCD_printfxy(0,2,"P1:%4i P2:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]],PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]]); |
LCD_printfxy(0,3,"P3:%4i P4:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]],PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]]); |
break; |
case 5: |
LCD_printfxy(0,0,"Gyro - Sensor"); |
LCD_printfxy(0,1,"Nick %4i (%3i)",AccumulateNick / MessanzahlNick, AdNeutralNick); |
LCD_printfxy(0,2,"Roll %4i (%3i)",AccumulateRoll / MessanzahlRoll, AdNeutralRoll); |
LCD_printfxy(0,3,"Gier %4i (%3i)",AccumulateGier / MessanzahlGier, AdNeutralGier); |
break; |
case 6: |
LCD_printfxy(0,0,"ACC - Sensor"); |
LCD_printfxy(0,1,"Nick %4i (%3i)",accumulate_AccNick / messanzahl_AccNick,NeutralAccX); |
LCD_printfxy(0,2,"Roll %4i (%3i)",accumulate_AccRoll / messanzahl_AccRoll,NeutralAccY); |
LCD_printfxy(0,3,"Hoch %4i (%3i)",Aktuell_az/*accumulate_AccHoch / messanzahl_AccHoch*/,(int)NeutralAccZ); |
break; |
case 7: |
LCD_printfxy(0,1,"Spannung: %5i",UBat); |
LCD_printfxy(0,2,"Empf.Pegel:%5i",SenderOkay); |
break; |
case 8: |
LCD_printfxy(0,0,"Kompass "); |
LCD_printfxy(0,1,"Richtung: %5i",KompassRichtung); |
LCD_printfxy(0,2,"Messwert: %5i",KompassValue); |
LCD_printfxy(0,3,"Start: %5i",KompassStartwert); |
break; |
case 9: |
LCD_printfxy(0,0,"Po1: %3i Po5: %3i" ,Poti1,Poti5); //PPM24-Erweiterung (121007Kr) |
LCD_printfxy(0,1,"Po2: %3i Po6: %3i" ,Poti2,Poti6); //PPM24-Erweiterung (121007Kr) |
LCD_printfxy(0,2,"Po3: %3i Po7: %3i" ,Poti3,Poti7); //PPM24-Erweiterung (121007Kr) |
LCD_printfxy(0,3,"Po4: %3i Po8: %3i" ,Poti4,Poti8); //PPM24-Erweiterung (121007Kr) |
break; |
case 10: |
LCD_printfxy(0,0,"Servo " ); |
LCD_printfxy(0,1,"Setpoint %3i",Parameter_ServoNickControl); |
LCD_printfxy(0,2,"Stellung: %3i",ServoValue); |
LCD_printfxy(0,3,"Range:%3i-%3i",EE_Parameter.ServoNickMin,EE_Parameter.ServoNickMax); |
break; |
default: MaxMenue = MenuePunkt - 1; |
MenuePunkt = 0; |
break; |
} |
RemoteTasten = 0; |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/menu.h |
---|
0,0 → 1,5 |
extern void Menu(void); |
extern char DisplayBuff[80]; |
extern unsigned char DispPtr; |
unsigned char RemoteTasten; |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/old_macros.h |
---|
0,0 → 1,47 |
/* |
For backwards compatibility only. |
Ingo Busker ingo@mikrocontroller.com |
*/ |
#ifndef cbi |
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) |
#endif |
#ifndef sbi |
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit)) |
#endif |
#ifndef inb |
#define inb(sfr) _SFR_BYTE(sfr) |
#endif |
#ifndef outb |
#define outb(sfr, val) (_SFR_BYTE(sfr) = (val)) |
#endif |
#ifndef inw |
#define inw(sfr) _SFR_WORD(sfr) |
#endif |
#ifndef outw |
#define outw(sfr, val) (_SFR_WORD(sfr) = (val)) |
#endif |
#ifndef outp |
#define outp(val, sfr) outb(sfr, val) |
#endif |
#ifndef inp |
#define inp(sfr) inb(sfr) |
#endif |
#ifndef BV |
#define BV(bit) _BV(bit) |
#endif |
#ifndef PRG_RDB |
#define PRG_RDB pgm_read_byte |
#endif |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/printf_P.c |
---|
0,0 → 1,480 |
// Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist nicht von der Lizenz für den MikroKopter-Teil unterstellt |
/* |
Copyright (C) 1993 Free Software Foundation |
This file is part of the GNU IO Library. This library is free |
software; you can redistribute it and/or modify it under the |
terms of the GNU General Public License as published by the |
Free Software Foundation; either version 2, or (at your option) |
any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License for more details. |
You should have received a copy of the GNU General Public License |
along with this library; see the file COPYING. If not, write to the Free |
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
As a special exception, if you link this library with files |
compiled with a GNU compiler to produce an executable, this does not cause |
the resulting executable to be covered by the GNU General Public License. |
This exception does not however invalidate any other reasons why |
the executable file might be covered by the GNU General Public License. */ |
/* |
* Copyright (c) 1990 Regents of the University of California. |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* 1. Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* 2. Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* 3. [rescinded 22 July 1999] |
* 4. Neither the name of the University nor the names of its contributors |
* may be used to endorse or promote products derived from this software |
* without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
* SUCH DAMAGE. |
*/ |
/****************************************************************************** |
This file is a patched version of printf called _printf_P |
It is made to work with avr-gcc for Atmel AVR MCUs. |
There are some differences from standard printf: |
1. There is no floating point support (with fp the code is about 8K!) |
2. Return type is void |
3. Format string must be in program memory (by using macro printf this is |
done automaticaly) |
4. %n is not implemented (just remove the comment around it if you need it) |
5. If LIGHTPRINTF is defined, the code is about 550 bytes smaller and the |
folowing specifiers are disabled : |
space # * . - + p s o O |
6. A function void uart_sendchar(char c) is used for output. The UART must |
be initialized before using printf. |
Alexander Popov |
sasho@vip.orbitel.bg |
******************************************************************************/ |
/* |
* Actual printf innards. |
* |
* This code is large and complicated... |
*/ |
#include <string.h> |
#ifdef __STDC__ |
#include <stdarg.h> |
#else |
#include <varargs.h> |
#endif |
#include "main.h" |
//#define LIGHTPRINTF |
char PrintZiel; |
char Putchar(char zeichen) |
{ |
if(PrintZiel == OUT_LCD) { DisplayBuff[DispPtr++] = zeichen; return(1);} |
else return(uart_putchar(zeichen)); |
} |
void PRINT(const char * ptr, unsigned int len) |
{ |
for(;len;len--) Putchar(*ptr++); |
} |
void PRINTP(const char * ptr, unsigned int len) |
{ |
for(;len;len--) Putchar(pgm_read_byte(ptr++)); |
} |
void PAD_SP(signed char howmany) |
{ |
for(;howmany>0;howmany--) Putchar(' '); |
} |
void PAD_0(signed char howmany) |
{ |
for(;howmany>0;howmany--) Putchar('0'); |
} |
#define BUF 40 |
/* |
* Macros for converting digits to letters and vice versa |
*/ |
#define to_digit(c) ((c) - '0') |
#define is_digit(c) ((c)<='9' && (c)>='0') |
#define to_char(n) ((n) + '0') |
/* |
* Flags used during conversion. |
*/ |
#define LONGINT 0x01 /* long integer */ |
#define LONGDBL 0x02 /* long double; unimplemented */ |
#define SHORTINT 0x04 /* short integer */ |
#define ALT 0x08 /* alternate form */ |
#define LADJUST 0x10 /* left adjustment */ |
#define ZEROPAD 0x20 /* zero (as opposed to blank) pad */ |
#define HEXPREFIX 0x40 /* add 0x or 0X prefix */ |
void _printf_P (char ziel,char const *fmt0, ...) /* Works with string from FLASH */ |
{ |
va_list ap; |
register const char *fmt; /* format string */ |
register char ch; /* character from fmt */ |
register int n; /* handy integer (short term usage) */ |
register char *cp; /* handy char pointer (short term usage) */ |
const char *fmark; /* for remembering a place in fmt */ |
register unsigned char flags; /* flags as above */ |
signed char width; /* width from format (%8d), or 0 */ |
signed char prec; /* precision from format (%.3d), or -1 */ |
char sign; /* sign prefix (' ', '+', '-', or \0) */ |
unsigned long _ulong=0; /* integer arguments %[diouxX] */ |
#define OCT 8 |
#define DEC 10 |
#define HEX 16 |
unsigned char base; /* base for [diouxX] conversion */ |
signed char dprec; /* a copy of prec if [diouxX], 0 otherwise */ |
signed char dpad; /* extra 0 padding needed for integers */ |
signed char fieldsz; /* field size expanded by sign, dpad etc */ |
/* The initialization of 'size' is to suppress a warning that |
'size' might be used unitialized. It seems gcc can't |
quite grok this spaghetti code ... */ |
signed char size = 0; /* size of converted field or string */ |
char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */ |
char ox[2]; /* space for 0x hex-prefix */ |
PrintZiel = ziel; // bestimmt, LCD oder UART |
va_start(ap, fmt0); |
fmt = fmt0; |
/* |
* Scan the format for conversions (`%' character). |
*/ |
for (;;) { |
for (fmark = fmt; (ch = pgm_read_byte(fmt)) != '\0' && ch != '%'; fmt++) |
/* void */; |
if ((n = fmt - fmark) != 0) { |
PRINTP(fmark, n); |
} |
if (ch == '\0') |
goto done; |
fmt++; /* skip over '%' */ |
flags = 0; |
dprec = 0; |
width = 0; |
prec = -1; |
sign = '\0'; |
rflag: ch = PRG_RDB(fmt++); |
reswitch: |
#ifdef LIGHTPRINTF |
if (ch=='o' || ch=='u' || (ch|0x20)=='x') { |
#else |
if (ch=='u' || (ch|0x20)=='x') { |
#endif |
if (flags&LONGINT) { |
_ulong=va_arg(ap, unsigned long); |
} else { |
register unsigned int _d; |
_d=va_arg(ap, unsigned int); |
_ulong = flags&SHORTINT ? (unsigned long)(unsigned short)_d : (unsigned long)_d; |
} |
} |
#ifndef LIGHTPRINTF |
if(ch==' ') { |
/* |
* ``If the space and + flags both appear, the space |
* flag will be ignored.'' |
* -- ANSI X3J11 |
*/ |
if (!sign) |
sign = ' '; |
goto rflag; |
} else if (ch=='#') { |
flags |= ALT; |
goto rflag; |
} else if (ch=='*'||ch=='-') { |
if (ch=='*') { |
/* |
* ``A negative field width argument is taken as a |
* - flag followed by a positive field width.'' |
* -- ANSI X3J11 |
* They don't exclude field widths read from args. |
*/ |
if ((width = va_arg(ap, int)) >= 0) |
goto rflag; |
width = -width; |
} |
flags |= LADJUST; |
flags &= ~ZEROPAD; /* '-' disables '0' */ |
goto rflag; |
} else if (ch=='+') { |
sign = '+'; |
goto rflag; |
} else if (ch=='.') { |
if ((ch = PRG_RDB(fmt++)) == '*') { |
n = va_arg(ap, int); |
prec = n < 0 ? -1 : n; |
goto rflag; |
} |
n = 0; |
while (is_digit(ch)) { |
n = n*10 + to_digit(ch); |
ch = PRG_RDB(fmt++); |
} |
prec = n < 0 ? -1 : n; |
goto reswitch; |
} else |
#endif /* LIGHTPRINTF */ |
if (ch=='0') { |
/* |
* ``Note that 0 is taken as a flag, not as the |
* beginning of a field width.'' |
* -- ANSI X3J11 |
*/ |
if (!(flags & LADJUST)) |
flags |= ZEROPAD; /* '-' disables '0' */ |
goto rflag; |
} else if (ch>='1' && ch<='9') { |
n = 0; |
do { |
n = 10 * n + to_digit(ch); |
ch = PRG_RDB(fmt++); |
} while (is_digit(ch)); |
width = n; |
goto reswitch; |
} else if (ch=='h') { |
flags |= SHORTINT; |
goto rflag; |
} else if (ch=='l') { |
flags |= LONGINT; |
goto rflag; |
} else if (ch=='c') { |
*(cp = buf) = va_arg(ap, int); |
size = 1; |
sign = '\0'; |
} else if (ch=='D'||ch=='d'||ch=='i') { |
if(ch=='D') |
flags |= LONGINT; |
if (flags&LONGINT) { |
_ulong=va_arg(ap, long); |
} else { |
register int _d; |
_d=va_arg(ap, int); |
_ulong = flags&SHORTINT ? (long)(short)_d : (long)_d; |
} |
if ((long)_ulong < 0) { |
_ulong = -_ulong; |
sign = '-'; |
} |
base = DEC; |
goto number; |
} else |
/* |
if (ch=='n') { |
if (flags & LONGINT) |
*va_arg(ap, long *) = ret; |
else if (flags & SHORTINT) |
*va_arg(ap, short *) = ret; |
else |
*va_arg(ap, int *) = ret; |
continue; // no output |
} else |
*/ |
#ifndef LIGHTPRINTF |
if (ch=='O'||ch=='o') { |
if (ch=='O') |
flags |= LONGINT; |
base = OCT; |
goto nosign; |
} else if (ch=='p') { |
/* |
* ``The argument shall be a pointer to void. The |
* value of the pointer is converted to a sequence |
* of printable characters, in an implementation- |
* defined manner.'' |
* -- ANSI X3J11 |
*/ |
/* NOSTRICT */ |
_ulong = (unsigned int)va_arg(ap, void *); |
base = HEX; |
flags |= HEXPREFIX; |
ch = 'x'; |
goto nosign; |
} else if (ch=='s') { // print a string from RAM |
if ((cp = va_arg(ap, char *)) == NULL) { |
cp=buf; |
cp[0] = '('; |
cp[1] = 'n'; |
cp[2] = 'u'; |
cp[4] = cp[3] = 'l'; |
cp[5] = ')'; |
cp[6] = '\0'; |
} |
if (prec >= 0) { |
/* |
* can't use strlen; can only look for the |
* NUL in the first `prec' characters, and |
* strlen() will go further. |
*/ |
char *p = (char*)memchr(cp, 0, prec); |
if (p != NULL) { |
size = p - cp; |
if (size > prec) |
size = prec; |
} else |
size = prec; |
} else |
size = strlen(cp); |
sign = '\0'; |
} else |
#endif /* LIGHTPRINTF */ |
if(ch=='U'||ch=='u') { |
if (ch=='U') |
flags |= LONGINT; |
base = DEC; |
goto nosign; |
} else if (ch=='X'||ch=='x') { |
base = HEX; |
/* leading 0x/X only if non-zero */ |
if (flags & ALT && _ulong != 0) |
flags |= HEXPREFIX; |
/* unsigned conversions */ |
nosign: sign = '\0'; |
/* |
* ``... diouXx conversions ... if a precision is |
* specified, the 0 flag will be ignored.'' |
* -- ANSI X3J11 |
*/ |
number: if ((dprec = prec) >= 0) |
flags &= ~ZEROPAD; |
/* |
* ``The result of converting a zero value with an |
* explicit precision of zero is no characters.'' |
* -- ANSI X3J11 |
*/ |
cp = buf + BUF; |
if (_ulong != 0 || prec != 0) { |
register unsigned char _d,notlastdigit; |
do { |
notlastdigit=(_ulong>=base); |
_d = _ulong % base; |
if (_d<10) { |
_d+='0'; |
} else { |
_d+='a'-10; |
if (ch=='X') _d&=~0x20; |
} |
*--cp=_d; |
_ulong /= base; |
} while (notlastdigit); |
#ifndef LIGHTPRINTF |
// handle octal leading 0 |
if (base==OCT && flags & ALT && *cp != '0') |
*--cp = '0'; |
#endif |
} |
size = buf + BUF - cp; |
} else { //default |
/* "%?" prints ?, unless ? is NUL */ |
if (ch == '\0') |
goto done; |
/* pretend it was %c with argument ch */ |
cp = buf; |
*cp = ch; |
size = 1; |
sign = '\0'; |
} |
/* |
* All reasonable formats wind up here. At this point, |
* `cp' points to a string which (if not flags&LADJUST) |
* should be padded out to `width' places. If |
* flags&ZEROPAD, it should first be prefixed by any |
* sign or other prefix; otherwise, it should be blank |
* padded before the prefix is emitted. After any |
* left-hand padding and prefixing, emit zeroes |
* required by a decimal [diouxX] precision, then print |
* the string proper, then emit zeroes required by any |
* leftover floating precision; finally, if LADJUST, |
* pad with blanks. |
*/ |
/* |
* compute actual size, so we know how much to pad. |
*/ |
fieldsz = size; |
dpad = dprec - size; |
if (dpad < 0) |
dpad = 0; |
if (sign) |
fieldsz++; |
else if (flags & HEXPREFIX) |
fieldsz += 2; |
fieldsz += dpad; |
/* right-adjusting blank padding */ |
if ((flags & (LADJUST|ZEROPAD)) == 0) |
PAD_SP(width - fieldsz); |
/* prefix */ |
if (sign) { |
PRINT(&sign, 1); |
} else if (flags & HEXPREFIX) { |
ox[0] = '0'; |
ox[1] = ch; |
PRINT(ox, 2); |
} |
/* right-adjusting zero padding */ |
if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD) |
PAD_0(width - fieldsz); |
/* leading zeroes from decimal precision */ |
PAD_0(dpad); |
/* the string or number proper */ |
PRINT(cp, size); |
/* left-adjusting padding (always blank) */ |
if (flags & LADJUST) |
PAD_SP(width - fieldsz); |
} |
done: |
va_end(ap); |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/printf_P.h |
---|
0,0 → 1,19 |
#ifndef _PRINTF_P_H_ |
#define _PRINTF_P_H_ |
#include <avr/pgmspace.h> |
#define OUT_V24 0 |
#define OUT_LCD 1 |
extern void _printf_P (char, char const *fmt0, ...); |
extern char PrintZiel; |
#define printf_P(format, args...) _printf_P(OUT_V24,format , ## args) |
#define printf(format, args...) _printf_P(OUT_V24,PSTR(format) , ## args) |
#define LCD_printfxy(x,y,format, args...) { DispPtr = y * 20 + x; _printf_P(OUT_LCD,PSTR(format) , ## args);} |
#define LCD_printf(format, args...) { _printf_P(OUT_LCD,PSTR(format) , ## args);} |
#endif |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/rc.c |
---|
0,0 → 1,85 |
/*####################################################################################### |
Decodieren eines RC Summen Signals |
#######################################################################################*/ |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "rc.h" |
#include "main.h" |
volatile int PPM_in[15]; //PPM24-Erweiterung (121007Kr) |
volatile int PPM_diff[15]; // das diffenzierte Stick-Signal //PPM24-Erweiterung (121007Kr) |
volatile unsigned char NewPpmData = 1; |
//############################################################################ |
//zum decodieren des PPM-Signals wird Timer1 mit seiner Input |
//Capture Funktion benutzt: |
void rc_sum_init (void) |
//############################################################################ |
{ |
TCCR1B=(1<<CS11)|(1<<CS10)|(1<<ICES1)|(1<<ICNC1);//|(1 << WGM12); //timer1 prescale 64 |
// PWM |
//TCCR1A = (1 << COM1B1) | (1 << WGM11) | (1 << WGM10); |
//TCCR1B |= (1 << WGM12); |
//OCR1B = 55; |
TIMSK1 |= _BV(ICIE1); |
AdNeutralGier = 0; |
AdNeutralRoll = 0; |
AdNeutralNick = 0; |
return; |
} |
//############################################################################ |
//Diese Routine startet und inizialisiert den Timer für RC |
SIGNAL(SIG_INPUT_CAPTURE1) |
//############################################################################ |
{ |
static unsigned int AltICR=0; |
signed int signal = 0,tmp; |
static int index; |
signal = (unsigned int) ICR1 - AltICR; |
AltICR = ICR1; |
//Syncronisationspause? |
if ((signal > 1500) && (signal < 8000)) |
{ |
index = 1; |
NewPpmData = 0; // Null bedeutet: Neue Daten |
// OCR2A = Poti2/2 + 80; |
} |
else |
{ |
if(index < 14) //PPM24-Erweiterung (121007Kr) |
{ |
if((signal > 250) && (signal < 687)) |
{ |
signal -= 466; |
// Stabiles Signal |
if(abs(signal - PPM_in[index]) < 6) { if(SenderOkay < 200) SenderOkay += 10;} |
tmp = (3 * (PPM_in[index]) + signal) / 4; |
// if(tmp > signal+1) tmp--; else |
// if(tmp < signal-1) tmp++; |
PPM_diff[index] = tmp - PPM_in[index]; |
PPM_in[index] = tmp; |
} |
index++; |
if(index == 5) PORTD |= 0x20; else PORTD &= ~0x20; // Servosignal an J3 anlegen |
if(index == 6) PORTD |= 0x10; else PORTD &= ~0x10; // Servosignal an J4 anlegen |
if(index == 7) PORTD |= 0x08; else PORTD &= ~0x08; // Servosignal an J5 anlegen |
} |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/rc.h |
---|
0,0 → 1,29 |
/*####################################################################################### |
Derkodieren eines RC Summen Signals |
#######################################################################################*/ |
#ifndef _RC_H |
#define _RC_H |
#if defined (__AVR_ATmega32__) |
#define TIMER_TEILER CK64 |
#define TIMER_RELOAD_VALUE 250 |
#endif |
#if defined (__AVR_ATmega644__) |
//#define TIMER_TEILER CK64 |
#define TIMER_RELOAD_VALUE 250 |
//#define TIMER_TEILER CK256 // bei 20MHz |
//#define TIMER_RELOAD_VALUE -78 // bei 20MHz |
#endif |
#define GAS PPM_in[2] |
extern void rc_sum_init (void); |
extern volatile int PPM_in[15]; //PPM24-Erweiterung (121007Kr) |
extern volatile int PPM_diff[15]; // das diffenzierte Stick-Signal //PPM24-Erweiterung (121007Kr) |
extern volatile unsigned char NewPpmData; |
#endif //_RC_H |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/timer0.c |
---|
0,0 → 1,156 |
#include "main.h" |
volatile unsigned int CountMilliseconds = 0; |
volatile static unsigned int tim_main; |
volatile unsigned char UpdateMotor = 0; |
volatile unsigned int cntKompass = 0; |
volatile unsigned int beeptime = 0; |
unsigned int BeepMuster = 0xffff; |
int ServoValue = 0; |
enum { |
STOP = 0, |
CK = 1, |
CK8 = 2, |
CK64 = 3, |
CK256 = 4, |
CK1024 = 5, |
T0_FALLING_EDGE = 6, |
T0_RISING_EDGE = 7 |
}; |
SIGNAL (SIG_OVERFLOW0) // 8kHz |
{ |
static unsigned char cnt_1ms = 1,cnt = 0; |
unsigned char pieper_ein = 0; |
// TCNT0 -= 250;//TIMER_RELOAD_VALUE; |
if(!cnt--) |
{ |
cnt = 9; |
cnt_1ms++; |
cnt_1ms %= 2; |
if(!cnt_1ms) UpdateMotor = 1; |
CountMilliseconds++; |
} |
if(beeptime > 1) |
{ |
beeptime--; |
if(beeptime & BeepMuster) |
{ |
pieper_ein = 1; |
} |
else pieper_ein = 0; |
} |
else |
{ |
pieper_ein = 0; |
BeepMuster = 0xffff; |
} |
if(pieper_ein) |
{ |
if(PlatinenVersion == 10) PORTD |= (1<<2); // Speaker an PORTD.2 |
else PORTC |= (1<<7); // Speaker an PORTC.7 |
} |
else |
{ |
if(PlatinenVersion == 10) PORTD &= ~(1<<2); |
else PORTC &= ~(1<<7); |
} |
if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV) |
{ |
MM3_timer0(); // Kompass auslesen |
if (!cntKompass--) // Aufruf mit 25 Hz |
{ |
if (MM3_heading() > 0) { KompassValue = 360-MM3_heading();} |
if (MM3_heading() < 0 ) { KompassValue = MM3_heading()*-1;} |
KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360)-180; |
cntKompass = 320; // 320 |
} |
} |
} |
void Timer_Init(void) |
{ |
tim_main = SetDelay(10); |
TCCR0B = CK8; |
TCCR0A = (1<<COM0A1)|(1<<COM0B1)|3;//fast PWM |
OCR0A = 0; |
OCR0B = 120; |
TCNT0 = -TIMER_RELOAD_VALUE; // reload |
//OCR1 = 0x00; |
TCCR2A=(1<<COM2A1)|(1<<COM2A0)|3; |
TCCR2B=(0<<CS20)|(1<<CS21)|(1<<CS22); |
// TIMSK2 |= _BV(TOIE2); |
TIMSK2 |= _BV(OCIE2A); |
TIMSK0 |= _BV(TOIE0); |
OCR2A = 10; |
TCNT2 = 0; |
} |
// ----------------------------------------------------------------------- |
unsigned int SetDelay (unsigned int t) |
{ |
// TIMSK0 &= ~_BV(TOIE0); |
return(CountMilliseconds + t + 1); |
// TIMSK0 |= _BV(TOIE0); |
} |
// ----------------------------------------------------------------------- |
char CheckDelay(unsigned int t) |
{ |
// TIMSK0 &= ~_BV(TOIE0); |
return(((t - CountMilliseconds) & 0x8000) >> 9); |
// TIMSK0 |= _BV(TOIE0); |
} |
// ----------------------------------------------------------------------- |
void Delay_ms(unsigned int w) |
{ |
unsigned int akt; |
akt = SetDelay(w); |
while (!CheckDelay(akt)); |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Servo ansteuern |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(SIG_OUTPUT_COMPARE2A) |
{ |
static unsigned char timer = 10; |
if(!timer--) |
{ |
TCCR2A=(1<<COM2A1)|(0<<COM2A0)|3; |
ServoValue = Parameter_ServoNickControl; |
if(EE_Parameter.ServoNickCompInvert & 0x01) ServoValue += ((long) EE_Parameter.ServoNickComp * (IntegralNick / 128)) / 512; |
else ServoValue -= ((long) EE_Parameter.ServoNickComp * (IntegralNick / 128)) / 512; |
if(ServoValue < EE_Parameter.ServoNickMin) ServoValue = EE_Parameter.ServoNickMin; |
else if(ServoValue > EE_Parameter.ServoNickMax) ServoValue = EE_Parameter.ServoNickMax; |
OCR2A = ServoValue;// + 75; |
timer = EE_Parameter.ServoNickRefresh; |
} |
else |
{ |
TCCR2A =3; |
PORTD&=~0x80; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/timer0.h |
---|
0,0 → 1,15 |
#define TIMER_TEILER CK8 |
#define TIMER_RELOAD_VALUE 250 |
void Timer_Init(void); |
void Delay_ms(unsigned int); |
unsigned int SetDelay (unsigned int t); |
char CheckDelay (unsigned int t); |
extern volatile unsigned int CountMilliseconds; |
extern volatile unsigned char UpdateMotor; |
extern volatile unsigned int beeptime; |
extern volatile unsigned int cntKompass; |
extern int ServoValue; |
extern unsigned int BeepMuster; |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/twimaster.c |
---|
0,0 → 1,152 |
/*############################################################################ |
############################################################################*/ |
#include "main.h" |
unsigned char twi_state = 0; |
unsigned char motor = 0; |
unsigned char motorread = 0; |
unsigned char motor_rx[8]; |
//############################################################################ |
//Initzialisieren der I2C (TWI) Schnittstelle |
void i2c_init(void) |
//############################################################################ |
{ |
TWSR = 0; |
TWBR = ((SYSCLK/SCL_CLOCK)-16)/2; |
} |
//############################################################################ |
//Start I2C |
char i2c_start(void) |
//############################################################################ |
{ |
TWCR = (1<<TWSTA) | (1<<TWEN) | (1<<TWINT) | (1<<TWIE); |
return(0); |
} |
//############################################################################ |
//Start I2C |
void i2c_stop(void) |
//############################################################################ |
{ |
TWCR = (1<<TWEN) | (1<<TWSTO) | (1<<TWINT); |
} |
void i2c_reset(void) |
//############################################################################ |
{ |
i2c_stop(); |
twi_state = 0; |
motor = TWDR; |
motor = 0; |
TWCR = 0x80; |
TWAMR = 0; |
TWAR = 0; |
TWDR = 0; |
TWSR = 0; |
TWBR = 0; |
i2c_init(); |
i2c_start(); |
i2c_write_byte(0); |
} |
//############################################################################ |
//Start I2C |
char i2c_write_byte(char byte) |
//############################################################################ |
{ |
TWSR = 0x00; |
TWDR = byte; |
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWIE); |
return(0); |
} |
//############################################################################ |
//Start I2C |
SIGNAL (TWI_vect) |
//############################################################################ |
{ |
switch (twi_state++) |
{ |
case 0: |
i2c_write_byte(0x52+(motor*2)); |
break; |
case 1: |
switch(motor++) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 2: |
i2c_stop(); |
if (motor<4) twi_state = 0; |
else motor = 0; |
i2c_start(); |
break; |
//Liest Daten von Motor |
case 3: |
i2c_write_byte(0x53+(motorread*2)); |
break; |
case 4: |
switch(motorread) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 5: //1 Byte vom Motor lesen |
motor_rx[motorread] = TWDR; |
case 6: |
switch(motorread) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 7: //2 Byte vom Motor lesen |
motor_rx[motorread+4] = TWDR; |
motorread++; |
if (motorread>3) motorread=0; |
i2c_stop(); |
I2CTimeout = 10; |
twi_state = 0; |
} |
TWCR |= 0x80; |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/twimaster.h |
---|
0,0 → 1,32 |
/*############################################################################ |
############################################################################*/ |
#ifndef _I2C_MASTER_H |
#define _I2C_MASTER_H |
//############################################################################ |
// I2C Konstanten |
#define SCL_CLOCK 200000L |
#define I2C_TIMEOUT 30000 |
#define I2C_START 0x08 |
#define I2C_REPEATED_START 0x10 |
#define I2C_TX_SLA_ACK 0x18 |
#define I2C_TX_DATA_ACK 0x28 |
#define I2C_RX_SLA_ACK 0x40 |
#define I2C_RX_DATA_ACK 0x50 |
//############################################################################ |
extern unsigned char twi_state; |
extern unsigned char motor; |
extern unsigned char motorread; |
extern unsigned char motor_rx[8]; |
void i2c_init (void); // I2C initialisieren |
char i2c_start (void); // Start I2C |
void i2c_stop (void); // Stop I2C |
char i2c_write_byte (char byte); // 1 Byte schreiben |
#endif |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/uart.c |
---|
0,0 → 1,642 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// + |
// + GPS read out: |
// + modified Version of the Pitschu Brushless Ufo - (c) Peter Schulten, Mülheim, Germany |
// + only for non-profit use |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
#include "uart.h" |
unsigned char DebugGetAnforderung = 0,DebugDisplayAnforderung = 0,DebugDataAnforderung = 0,GetVersionAnforderung = 0; |
unsigned volatile char SioTmp = 0; |
unsigned volatile char SendeBuffer[MAX_SENDE_BUFF]; |
unsigned volatile char RxdBuffer[MAX_EMPFANGS_BUFF]; |
unsigned volatile char NMEABuffer[MAX_EMPFANGS_BUFF]; |
unsigned volatile char NeuerDatensatzEmpfangen = 0; |
unsigned volatile char NeueKoordinateEmpfangen = 0; |
unsigned volatile char UebertragungAbgeschlossen = 1; |
unsigned volatile char CntCrcError = 0; |
unsigned volatile char AnzahlEmpfangsBytes = 0; |
unsigned volatile char PC_DebugTimeout = 0; |
unsigned char PcZugriff = 100; |
unsigned char MotorTest[4] = {0,0,0,0}; |
unsigned char MeineSlaveAdresse; |
struct str_DebugOut DebugOut; |
struct str_Debug DebugIn; |
struct str_VersionInfo VersionInfo; |
int Debug_Timer; |
static uint8_t gpsState; |
#define GPS_EMPTY 0 |
#define GPS_SYNC1 1 |
#define GPS_SYNC2 2 |
#define GPS_CLASS 3 |
#define GPS_LEN1 4 |
#define GPS_LEN2 5 |
#define GPS_FILLING 6 |
#define GPS_CKA 7 |
#define GPS_CKB 8 |
gpsInfo_t actualPos; // measured position (last gps record) |
#define SYNC_CHAR1 0xb5 |
#define SYNC_CHAR2 0x62 |
#define CLASS_NAV 0x01 |
#define MSGID_POSECEF 0x01 |
#define MSGID_STATUS 0x03 |
#define MSGID_VELECEF 0x11 |
#define MSGID_POSUTM 0x08 |
#define MSGID_VELNED 0x12 |
typedef struct { |
unsigned long ITOW; // time of week |
uint8_t GPSfix; // GPSfix Type, range 0..6 |
uint8_t Flags; // Navigation Status Flags |
uint8_t DiffS; // Differential Status |
uint8_t res; // reserved |
unsigned long TTFF; // Time to first fix (millisecond time tag) |
unsigned long MSSS; // Milliseconds since Startup / Reset |
uint8_t packetStatus; |
} NAV_STATUS_t; |
typedef struct { |
unsigned long ITOW; // time of week |
long LON; // longitude in 1e-07 deg |
long LAT; // lattitude |
long HEIGHT; // height in mm |
long HMSL; // height above mean sea level im mm |
unsigned long Hacc; // horizontal accuracy in mm |
unsigned long Vacc; // vertical accuracy in mm |
uint8_t packetStatus; |
} NAV_POSLLH_t; |
typedef struct { |
unsigned long ITOW; // time of week |
long EAST; // cm UTM Easting |
long NORTH; // cm UTM Nording |
long ALT; // cm altitude |
uint8_t ZONE; // UTM zone number |
uint8_t HEM; // Hemisphere Indicator (0=North, 1=South) |
uint8_t packetStatus; |
} NAV_POSUTM_t; |
typedef struct { |
unsigned long ITOW; // ms GPS Millisecond Time of Week |
long VEL_N; // cm/s NED north velocity |
long VEL_E; // cm/s NED east velocity |
long VEL_D; // cm/s NED down velocity |
unsigned long Speed; // cm/s Speed (3-D) |
unsigned long GSpeed; // cm/s Ground Speed (2-D) |
long Heading; // deg (1e-05) Heading 2-D |
unsigned long SAcc; // cm/s Speed Accuracy Estimate |
unsigned long CAcc; // deg Course / Heading Accuracy Estimate |
uint8_t packetStatus; |
} NAV_VELNED_t; |
typedef struct { |
unsigned long ITOW; // ms GPS Millisecond Time of Week |
long ECEF_X; // ecef x / cm |
long ECEF_Y; // ecef y / cm |
long ECEF_Z; // ecef z / cm |
unsigned long Pacc; // Abweichung |
uint8_t packetStatus; |
} NAV_POSECEF_t ; |
typedef struct { |
unsigned long ITOW; // ms GPS Millisecond Time of Week |
long ECEFVX; // ecef x velocity cm/s |
long ECEFVY; // ecef y velocity cm/s |
long ECEFVZ; // ecef z velocity cm/s |
unsigned long SAcc; // Abweichung |
uint8_t packetStatus; |
} NAV_VELECEF_t; |
NAV_STATUS_t navStatus; |
NAV_POSECEF_t navPosECEF; |
NAV_VELECEF_t navVelECEF; |
NAV_POSUTM_t navPosUtm; |
NAV_VELNED_t navVelNed; |
volatile char *ubxP, *ubxEp, *ubxSp; // pointers to packet currently transfered |
volatile uint8_t CK_A, CK_B; // UBX checksum bytes |
volatile unsigned short msgLen; |
volatile uint8_t msgID; |
volatile uint8_t ignorePacket; // true when previous packet was not processed |
// distance to target position |
long rollOffset; // in 10cm |
long nickOffset; |
#define GPS_INTCYCLES 100 |
#define GPS_I_LIMIT (long)(40 * MAINLOOPS_PER_SEC) |
#ifdef GPS_DEBUG // if set then the GPS data is transfered to display |
extern volatile uint8_t v24state; |
char buf[200]; |
char *bp; |
char *ep; |
#endif |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//++ Sende-Part der Datenübertragung |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(INT_VEC_TX) |
{ |
static unsigned int ptr = 0; |
unsigned char tmp_tx; |
if(!UebertragungAbgeschlossen) |
{ |
ptr++; // die [0] wurde schon gesendet |
tmp_tx = SendeBuffer[ptr]; |
if((tmp_tx == '\r') || (ptr == MAX_SENDE_BUFF)) |
{ |
ptr = 0; |
UebertragungAbgeschlossen = 1; |
} |
UDR = tmp_tx; |
} |
else ptr = 0; |
} |
void GPSscanData (void) |
{ |
if (navPosECEF.packetStatus == 1) // valid packet |
{ |
actualPos.x = navPosECEF.ECEF_X; //ECEF X in cm |
actualPos.y = navPosECEF.ECEF_Y; //ECEF Y in cm |
actualPos.z = navPosECEF.ECEF_Z; //ECEF Z in cm |
navPosECEF.packetStatus = 0; |
} |
if (navStatus.packetStatus == 1) // valid packet |
{ |
actualPos.GPSFix = navStatus.GPSfix; |
actualPos.newData = navStatus.packetStatus; |
navStatus.packetStatus = 0; |
} |
if (navVelECEF.packetStatus == 1) // valid packet |
{ |
actualPos.vx = navVelECEF.ECEFVX; //ECEF VEL X in cm/s |
actualPos.vy = navVelECEF.ECEFVY; //ECEF VEL Y in cm/s |
actualPos.vz = navVelECEF.ECEFVZ; //ECEF VEL Z in cm/s |
navVelECEF.packetStatus = 0; |
} |
if (navPosUtm.packetStatus == 1) // valid packet |
{ |
actualPos.northing = navPosUtm.NORTH; |
actualPos.easting = navPosUtm.EAST; |
actualPos.altitude = navPosUtm.ALT; |
navPosUtm.packetStatus = 0; |
} |
if (navVelNed.packetStatus == 1) |
{ |
actualPos.velNorth = navVelNed.VEL_N; |
actualPos.velEast = navVelNed.VEL_E; |
navVelNed.packetStatus = 0; |
} |
if (actualPos.newData != 0){ROT_ON;} //-> Rot blinkt mit 4Hz wenn Daten vom GPS Empfänger ankommen und brauchbar sind |
} |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//++ Empfangs-Part der Datenübertragung, incl. CRC-Auswertung |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(INT_VEC_RX) |
{ |
static unsigned int crc; |
static unsigned char crc1,crc2,buf_ptr; |
static unsigned char UartState = 0; |
unsigned char CrcOkay = 0; |
SioTmp = UDR; |
uint8_t c; |
uint8_t re; |
re = (UCSR0A & (_B1(FE0) | _B1(DOR0))); // any error occured ? |
c = SioTmp; |
#ifdef GPS_DEBUG |
*bp++ = c; |
if (bp >= (buf+200)) bp = buf; |
if (v24state == 0) |
{ |
v24state = 1; |
UDR0 = *ep++; |
if (ep >= buf+200) |
ep = buf; |
UCSR0B |= _B1(UDRIE0); //enable further irqs |
} |
#endif |
if (re == 0) |
{ |
switch (gpsState) |
{ |
case GPS_EMPTY: |
if (c == SYNC_CHAR1) |
gpsState = GPS_SYNC1; |
break; |
case GPS_SYNC1: |
if (c == SYNC_CHAR2) |
gpsState = GPS_SYNC2; |
else if (c != SYNC_CHAR1) |
gpsState = GPS_EMPTY; |
break; |
case GPS_SYNC2: |
if (c == CLASS_NAV) |
gpsState = GPS_CLASS; |
else |
gpsState = GPS_EMPTY; |
break; |
case GPS_CLASS: // msg ID seen: init packed receive |
msgID = c; |
CK_A = CLASS_NAV + c; |
CK_B = CLASS_NAV + CK_A; |
gpsState = GPS_LEN1; |
switch (msgID) |
{ |
case MSGID_STATUS: |
ubxP = (char*)&navStatus; |
ubxEp = (char*)(&navStatus + sizeof(NAV_STATUS_t)); |
ubxSp = (char*)&navStatus.packetStatus; |
ignorePacket = navStatus.packetStatus; |
break; |
case MSGID_POSECEF: |
ubxP = (char*)&navPosECEF; |
ubxEp = (char*)(&navPosECEF + sizeof(NAV_POSECEF_t)); |
ubxSp = (char*)&navPosECEF.packetStatus; |
ignorePacket = navPosECEF.packetStatus; |
break; |
case MSGID_VELECEF: |
ubxP = (char*)&navVelECEF; |
ubxEp = (char*)(&navVelECEF + sizeof(NAV_VELECEF_t)); |
ubxSp = (char*)&navVelECEF.packetStatus; |
ignorePacket = navVelECEF.packetStatus; |
break; |
case MSGID_POSUTM: |
ubxP = (char*)&navPosUtm; |
ubxEp = (char*)(&navPosUtm + sizeof(NAV_POSUTM_t)); |
ubxSp = (char*)&navPosUtm.packetStatus; |
ignorePacket = navPosUtm.packetStatus; |
break; |
case MSGID_VELNED: |
ubxP = (char*)&navVelNed; |
ubxEp = (char*)(&navVelNed + sizeof(NAV_VELNED_t)); |
ubxSp = (char*)&navVelNed.packetStatus; |
ignorePacket = navVelNed.packetStatus; |
break; |
default: |
ignorePacket = 1; |
ubxSp = (char*)0; |
} |
break; |
case GPS_LEN1: // first len byte |
msgLen = c; |
CK_A += c; |
CK_B += CK_A; |
gpsState = GPS_LEN2; |
break; |
case GPS_LEN2: // second len byte |
msgLen = msgLen + (c * 256); |
CK_A += c; |
CK_B += CK_A; |
gpsState = GPS_FILLING; // next data will be stored in packet struct |
break; |
case GPS_FILLING: |
CK_A += c; |
CK_B += CK_A; |
if ( !ignorePacket && ubxP < ubxEp) |
*ubxP++ = c; |
if (--msgLen == 0) |
gpsState = GPS_CKA; |
break; |
case GPS_CKA: |
if (c == CK_A) |
gpsState = GPS_CKB; |
else |
gpsState = GPS_EMPTY; |
break; |
case GPS_CKB: |
if (c == CK_B && ubxSp) // No error -> packet received successfully |
*ubxSp = 1; // set packetStatus in struct |
gpsState = GPS_EMPTY; // ready for next packet |
break; |
default: |
gpsState = GPS_EMPTY; // ready for next packet |
} |
} |
else // discard any data if error occured |
{ |
gpsState = GPS_EMPTY; |
GPSscanData (); //Test kann ggf. wieder gelöscht werden! |
} |
GPSscanData (); |
if(buf_ptr >= MAX_EMPFANGS_BUFF) UartState = 0; |
if(SioTmp == '\r' && UartState == 2) |
{ |
UartState = 0; |
crc -= RxdBuffer[buf_ptr-2]; |
crc -= RxdBuffer[buf_ptr-1]; |
crc %= 4096; |
crc1 = '=' + crc / 64; |
crc2 = '=' + crc % 64; |
CrcOkay = 0; |
if((crc1 == RxdBuffer[buf_ptr-2]) && (crc2 == RxdBuffer[buf_ptr-1])) CrcOkay = 1; else { CrcOkay = 0; CntCrcError++;}; |
if(!NeuerDatensatzEmpfangen && CrcOkay) // Datensatz schon verarbeitet |
{ |
NeuerDatensatzEmpfangen = 1; |
AnzahlEmpfangsBytes = buf_ptr; |
RxdBuffer[buf_ptr] = '\r'; |
if(RxdBuffer[2] == 'R') wdt_enable(WDTO_250MS); // Reset-Commando |
} |
} |
else |
switch(UartState) |
{ |
case 0: |
if(SioTmp == '#' && !NeuerDatensatzEmpfangen) UartState = 1; // Startzeichen und Daten schon verarbeitet |
buf_ptr = 0; |
RxdBuffer[buf_ptr++] = SioTmp; |
crc = SioTmp; |
break; |
case 1: // Adresse auswerten |
UartState++; |
RxdBuffer[buf_ptr++] = SioTmp; |
crc += SioTmp; |
break; |
case 2: // Eingangsdaten sammeln |
RxdBuffer[buf_ptr] = SioTmp; |
if(buf_ptr < MAX_EMPFANGS_BUFF) buf_ptr++; |
else UartState = 0; |
crc += SioTmp; |
break; |
default: |
UartState = 0; |
break; |
} |
} |
// -------------------------------------------------------------------------- |
void AddCRC(unsigned int wieviele) |
{ |
unsigned int tmpCRC = 0,i; |
for(i = 0; i < wieviele;i++) |
{ |
tmpCRC += SendeBuffer[i]; |
} |
tmpCRC %= 4096; |
SendeBuffer[i++] = '=' + tmpCRC / 64; |
SendeBuffer[i++] = '=' + tmpCRC % 64; |
SendeBuffer[i++] = '\r'; |
UebertragungAbgeschlossen = 0; |
UDR = SendeBuffer[0]; |
} |
// -------------------------------------------------------------------------- |
void SendOutData(unsigned char cmd,unsigned char modul, unsigned char *snd, unsigned char len) |
{ |
unsigned int pt = 0; |
unsigned char a,b,c; |
unsigned char ptr = 0; |
SendeBuffer[pt++] = '#'; // Startzeichen |
SendeBuffer[pt++] = modul; // Adresse (a=0; b=1,...) |
SendeBuffer[pt++] = cmd; // Commando |
while(len) |
{ |
if(len) { a = snd[ptr++]; len--;} else a = 0; |
if(len) { b = snd[ptr++]; len--;} else b = 0; |
if(len) { c = snd[ptr++]; len--;} else c = 0; |
SendeBuffer[pt++] = '=' + (a >> 2); |
SendeBuffer[pt++] = '=' + (((a & 0x03) << 4) | ((b & 0xf0) >> 4)); |
SendeBuffer[pt++] = '=' + (((b & 0x0f) << 2) | ((c & 0xc0) >> 6)); |
SendeBuffer[pt++] = '=' + ( c & 0x3f); |
} |
AddCRC(pt); |
} |
// -------------------------------------------------------------------------- |
void Decode64(unsigned char *ptrOut, unsigned char len, unsigned char ptrIn,unsigned char max) // Wohin mit den Daten; Wie lang; Wo im RxdBuffer |
{ |
unsigned char a,b,c,d; |
unsigned char ptr = 0; |
unsigned char x,y,z; |
while(len) |
{ |
a = RxdBuffer[ptrIn++] - '='; |
b = RxdBuffer[ptrIn++] - '='; |
c = RxdBuffer[ptrIn++] - '='; |
d = RxdBuffer[ptrIn++] - '='; |
if(ptrIn > max - 2) break; // nicht mehr Daten verarbeiten, als empfangen wurden |
x = (a << 2) | (b >> 4); |
y = ((b & 0x0f) << 4) | (c >> 2); |
z = ((c & 0x03) << 6) | d; |
if(len--) ptrOut[ptr++] = x; else break; |
if(len--) ptrOut[ptr++] = y; else break; |
if(len--) ptrOut[ptr++] = z; else break; |
} |
} |
// -------------------------------------------------------------------------- |
void BearbeiteRxDaten(void) |
{ |
if(!NeuerDatensatzEmpfangen) return; |
unsigned int tmp_int_arr1[1]; |
unsigned int tmp_int_arr2[2]; |
unsigned int tmp_int_arr3[3]; |
unsigned char tmp_char_arr2[2]; |
unsigned char tmp_char_arr3[3]; |
unsigned char tmp_char_arr4[4]; |
//if(!MotorenEin) |
PcZugriff = 255; |
switch(RxdBuffer[2]) |
{ |
case 'c':// Debugdaten incl. Externe IOs usw |
Decode64((unsigned char *) &DebugIn,sizeof(DebugIn),3,AnzahlEmpfangsBytes); |
/* for(unsigned char i=0; i<4;i++) |
{ |
EE_CheckAndWrite(&EE_Buffer[EE_DEBUGWERTE + i*2], DebugIn.Analog[i]); |
EE_CheckAndWrite(&EE_Buffer[EE_DEBUGWERTE + i*2 + 1], DebugIn.Analog[i] >> 8); |
}*/ |
//RemoteTasten |= DebugIn.RemoteTasten; |
DebugDataAnforderung = 1; |
break; |
case 'h':// x-1 Displayzeilen |
Decode64((unsigned char *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes); |
RemoteTasten |= tmp_char_arr2[0]; |
DebugDisplayAnforderung = 1; |
break; |
case 't':// Motortest |
Decode64((unsigned char *) &MotorTest[0],sizeof(MotorTest),3,AnzahlEmpfangsBytes); |
break; |
case 'v': // Version-Anforderung und Ausbaustufe |
GetVersionAnforderung = 1; |
break; |
case 'g':// "Get"-Anforderung für Debug-Daten |
// Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
DebugGetAnforderung = 1; |
break; |
case 'q':// "Get"-Anforderung für Settings |
// Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
Decode64((unsigned char *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes); |
if(tmp_char_arr2[0] != 0xff) |
{ |
if(tmp_char_arr2[0] > 5) tmp_char_arr2[0] = 5; |
ReadParameterSet(tmp_char_arr2[0], (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
SendOutData('L' + tmp_char_arr2[0] -1,MeineSlaveAdresse,(unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE); |
} |
else |
SendOutData('L' + GetActiveParamSetNumber()-1,MeineSlaveAdresse,(unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE); |
break; |
case 'l': |
case 'm': |
case 'n': |
case 'o': |
case 'p': // Parametersatz speichern |
Decode64((unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE,3,AnzahlEmpfangsBytes); |
WriteParameterSet(RxdBuffer[2] - 'l' + 1, (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], RxdBuffer[2] - 'l' + 1); // aktiven Datensatz merken |
Piep(GetActiveParamSetNumber()); |
break; |
} |
// DebugOut.AnzahlZyklen = Debug_Timer_Intervall; |
NeuerDatensatzEmpfangen = 0; |
} |
//############################################################################ |
//Routine für die Serielle Ausgabe |
int uart_putchar (char c) |
//############################################################################ |
{ |
if (c == '\n') |
uart_putchar('\r'); |
//Warten solange bis Zeichen gesendet wurde |
loop_until_bit_is_set(USR, UDRE); |
//Ausgabe des Zeichens |
UDR = c; |
return (0); |
} |
// -------------------------------------------------------------------------- |
void WriteProgramData(unsigned int pos, unsigned char wert) |
{ |
//if (ProgramLocation == IN_RAM) Buffer[pos] = wert; |
// else eeprom_write_byte(&EE_Buffer[pos], wert); |
// Buffer[pos] = wert; |
} |
//############################################################################ |
//INstallation der Seriellen Schnittstelle |
void UART_Init (void) |
//############################################################################ |
{ |
//Enable TXEN im Register UCR TX-Data Enable & RX Enable |
UCR=(1 << TXEN) | (1 << RXEN); |
// UART Double Speed (U2X) |
USR |= (1<<U2X); |
// RX-Interrupt Freigabe |
UCSRB |= (1<<RXCIE); |
// TX-Interrupt Freigabe |
UCSRB |= (1<<TXCIE); |
//Teiler wird gesetzt |
UBRR=(SYSCLK / (BAUD_RATE * 8L) - 1); |
//UBRR = 33; |
//öffnet einen Kanal für printf (STDOUT) |
//fdevopen (uart_putchar, 0); |
//sbi(PORTD,4); |
Debug_Timer = SetDelay(200); |
gpsState = GPS_EMPTY; |
} |
//--------------------------------------------------------------------------------------------- |
void DatenUebertragung(void) |
{ |
static char dis_zeile = 0; |
if(!UebertragungAbgeschlossen) return; |
if(DebugGetAnforderung && UebertragungAbgeschlossen) // Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
{ |
SendOutData('G',MeineSlaveAdresse,(unsigned char *) &DebugIn,sizeof(DebugIn)); |
DebugGetAnforderung = 0; |
} |
if((CheckDelay(Debug_Timer) || DebugDataAnforderung) && UebertragungAbgeschlossen) |
{ |
SendOutData('D',MeineSlaveAdresse,(unsigned char *) &DebugOut,sizeof(DebugOut)); |
DebugDataAnforderung = 0; |
Debug_Timer = SetDelay(MIN_DEBUG_INTERVALL); |
} |
if(DebugDisplayAnforderung && UebertragungAbgeschlossen) |
{ |
Menu(); |
DebugDisplayAnforderung = 0; |
if(++dis_zeile == 4) |
{ |
SendOutData('4',0,&PPM_in,sizeof(PPM_in)); // DisplayZeile übertragen |
dis_zeile = -1; |
} |
else SendOutData('0' + dis_zeile,0,&DisplayBuff[20 * dis_zeile],20); // DisplayZeile übertragen |
} |
if(GetVersionAnforderung && UebertragungAbgeschlossen) |
{ |
SendOutData('V',MeineSlaveAdresse,(unsigned char *) &VersionInfo,sizeof(VersionInfo)); |
GetVersionAnforderung = 0; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/uart.h |
---|
0,0 → 1,119 |
#ifndef _UART_H |
#define _UART_H |
#define MAX_SENDE_BUFF 150 |
#define MAX_EMPFANGS_BUFF 150 |
extern unsigned char DebugGetAnforderung; |
extern unsigned volatile char SendeBuffer[MAX_SENDE_BUFF]; |
extern unsigned volatile char RxdBuffer[MAX_EMPFANGS_BUFF]; |
extern unsigned volatile char UebertragungAbgeschlossen; |
extern unsigned volatile char PC_DebugTimeout; |
extern unsigned volatile char NeueKoordinateEmpfangen; |
extern unsigned char MeineSlaveAdresse; |
extern unsigned char PcZugriff; |
extern int Debug_Timer; |
extern void UART_Init (void); |
extern int uart_putchar (char c); |
extern void boot_program_page (uint32_t page, uint8_t *buf); |
extern void DatenUebertragung(void); |
extern void DecodeNMEA(void); |
extern unsigned char MotorTest[4]; |
struct str_DebugOut |
{ |
unsigned char Digital[2]; |
unsigned int Analog[32]; // Debugwerte |
}; |
extern struct str_DebugOut DebugOut; |
#define _B1(bit) (1 << (bit)) |
#define _B0(bit) (0 << (bit)) |
typedef struct |
{ |
long x; // in cm (+ = north) |
long y; // in cm (+ = east) |
long z; // in cm |
long vx; |
long vy; |
long vz; |
long northing; |
long easting; |
long altitude; |
long velNorth; |
long velEast; |
uint8_t newData; // status of data: 0 = invlid; 1 = valid |
uint8_t GPSFix; |
uint8_t noSV; // number of sats |
} gpsInfo_t; |
extern gpsInfo_t lockedPos; // stored position to fly to |
extern gpsInfo_t actualPos; // measured position (last gps record) |
extern void GPSscanData (void); |
extern void GPSupdate(void); |
extern void GPSsaveTarget (uint8_t mode); |
struct str_Debug |
{ |
unsigned char Digital[2]; |
unsigned char RemoteTasten; |
unsigned int Analog[4]; |
}; |
extern struct str_Debug DebugIn; |
struct str_VersionInfo |
{ |
unsigned char Hauptversion; |
unsigned char Nebenversion; |
unsigned char PCKompatibel; |
unsigned char Rserved[7]; |
}; |
extern struct str_VersionInfo VersionInfo; |
//Die Baud_Rate der Seriellen Schnittstelle ist 9600 Baud |
//#define BAUD_RATE 9600 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 14400 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 28800 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 38400 //Baud Rate für die Serielle Schnittstelle |
#define BAUD_RATE 57600 //Baud Rate für die Serielle Schnittstelle |
//Anpassen der seriellen Schnittstellen Register wenn ein ATMega128 benutzt wird |
#if defined (__AVR_ATmega128__) |
# define USR UCSR0A |
# define UCR UCSR0B |
# define UDR UDR0 |
# define UBRR UBRR0L |
# define EICR EICRB |
#endif |
#if defined (__AVR_ATmega32__) |
# define USR UCSRA |
# define UCR UCSRB |
# define UBRR UBRRL |
# define EICR EICRB |
# define INT_VEC_RX SIG_UART_RECV |
# define INT_VEC_TX SIG_UART_TRANS |
#endif |
#if defined (__AVR_ATmega644__) |
# define USR UCSR0A |
# define UCR UCSR0B |
# define UDR UDR0 |
# define UBRR UBRR0L |
# define EICR EICR0B |
# define TXEN TXEN0 |
# define RXEN RXEN0 |
# define RXCIE RXCIE0 |
# define TXCIE TXCIE0 |
# define U2X U2X0 |
# define UCSRB UCSR0B |
# define UDRE UDRE0 |
# define INT_VEC_RX SIG_USART_RECV |
# define INT_VEC_TX SIG_USART_TRANS |
#endif |
#endif //_UART_H |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666AccMM3filtered/version.txt |
---|
0,0 → 1,104 |
------- |
V0.53 27.04.2007 H.Buss |
- erste öffentliche Version |
V0.53b 29.04.2007 H.Buss |
- der FAKTOR_I war versehentlich auf Null, dann liegt der MikroKopter nicht so hart in der Luft |
V0.53c 29.04.2007 H.Buss |
- es gib ein Menü, in dem die Werte der Kanäle nach Nick, Roll, Gas,... sortiert sind. |
Die angezeigten Werte waren nicht die Werte der Funke |
V0.54 01.05.2007 H.Buss |
- die Paramtersätze können jetzt vor dem Start ausgewählt werden |
Dazu wird beim Kalibrieren der Messwerte (Gashebel oben links) der Nick-Rollhebel abgefragt: |
2 3 4 |
1 x 5 |
- - - |
Bedeutet: Nick-Rollhebel Links Mitte = Setting:1 Links Oben = Setting:2 usw. |
- der Faktor_I für den Hauptregler ist hinzugekommen. Im Heading-Hold-Modus sollte er vergössert werden, was Stabilität bringt |
V0.55 14.05.2007 H.Buss |
- es können nun Servos an J3,J4,J5 mit den Kanälen 5-7 gesteuert werden |
V0.56 14.05.2007 H.Buss |
- es gab Probleme mit Funken, die mehr als 8 Kanäle haben, wenn mehrere Kanäle dann auf Null waren |
- Funken, die nicht bis +-120 aussteuern können, sollten jetzt auch gehen |
V0.57 24.05.2007 H.Buss |
- Der Höhenregler kann nun auch mittels Schalter bedient werden |
- Bug im Gier-Algorithmus behoben; Schnelles Gieren fürhrte dazu, dass der MK zu weit gedreht hat |
- Kompass-Einfluss dämpfen bei Neigung |
- Man kann zwischen Kompass FIX (Richtung beim Kalibrieren) und Variabel (einstellbar per Gier) wählen |
- Der Motortest vom Kopter-Tool geht jetzt |
- Man kann den Parametersätzen einen Namen geben |
- Das Kamerasetting ist unter Setting 2 defaultmässig integriert |
V0.58 30.05.2007 H.Buss |
- Der Höhenregler-Algorithmus wird nun umgangen, wenn der Höhenreglerschalter aus ist |
V0.60 17.08.2007 H.Buss |
- "Schwindel-Bug" behoben |
- Die Poti-Werte werden jetzt auf Unterlauf (<0) überprüft |
- Poti4 zugefügt |
- Es werden jetzt 8 Kanäle ausgewertet |
- Kamera-Servo (an J7) |
- Die Settings müssen überschrieben werden |
V0.61 - V0.63 H.Buss 27.09.2007 |
- Poti 4 und Kanal 8 werden im Menü angezeigt |
- ein paar Kleinigkeiten bei den DefaultKonstanten2 bereinigt |
- Analog.c: Aktuell_ax korrigiert |
- auf 32 Debug-Kanäle erweitert |
- Loopings sind jetzt möglich und einzeln im KopterTool freischaltbar |
- leichte Anpassungen im Gier - Geschwindigkeit und Drift |
- die Hardwareversion V1.1 wird erkannt und das Programm stellt sich auf die geänderte Gyroverstärkung und die geänderten Portpins ein |
- die Software startet nach dem Einschalten schneller, weil der Luftdruckoffset schneller gefunden wird |
- die PPM-Ausgänge liegen wieder an den Pins an |
- Details an der Sensordatenverarbeitung -> es fliegt sich geringfügig anders |
- der MK ist bei wenig Gas nicht mehr so giftig -> soll das Landen vereinfachen |
- I2C-Bus läuft jetzt sicher nach einer Störung wieder an |
- Sticksignale werden präziser ausgewertet |
- Stick-Kanäle werden ans Kopter-Tool übertragen |
- Es muss die Version V1.47 des Kopter-Tool verwendet werden |
- Die Settings werden auf Default zurückgesetzt |
- am Piepen kann man die Fehlerart unterscheiden |
1. einzelnes Piepen beim Einschalten und Kalibrieren |
2. langsames Intervall mindestens 1 Sek -> Empfangsausfall |
3. schnelleres Intervall mindestens 1 Sek -> Akku |
4. sehr schnelles Intervall mindestens 1 Sek -> Kommunikation zu den Reglern gestört |
V0.64 H.Buss 30.09.2007 |
- beim Gieren wurden die Achsen nicht hart genug geregelt |
- Höhenreglerabsenkung von -20 auf -40 (fc.c) |
- LED1 und LED2 Ansteuerung (fc.c) und (main.h) |
- geänderte Kanalbelegung K1-K8, Unterspannungsschwelle (9,5V) und StickD (fc.c) |
- P,D Anteil seperat in Variable geschrieben und auf das Analog Display Ausgegeben (Kopter Tool) |
- GPS_Nick und GPS_Roll werden nach Deaktivierung von Position-Hold auf Null gesetzt, um ein Einfrieren der GPS Steuerwerte auf den letzten Wert zu verhindern |
- Funktionsaufruf der GPS-Funktion von Chris/Hallo2 |
- UART.C für die GPS Signale im UTM Format auf Pitschu basierend |
- meine GPS.c-Routine |
- Mircos variable Filterung (funktioniert nur wenn 250ms Aufruf aktiv ist) |
- GPS wird deaktiviert und Summer eingeschaltet, wenn kein 3D-Fix (mehr) vorhanden |
- Statusanzeige auf eine LED reduziert (aus, blinkend, an) |
- blinkender LED_1 Ausgang für Positionsleuchten (einstellbar über Userparam.4) |
- Homing-Fkt. eingebaut |
- Diverse Absicherungen gegen Fehlbedienungen (z.B. nicht gelernte Home-Position, ...) |
- Rotationsmatrix mit Kompass, damit die GPS-Fkt. nicht nur nach Norden ausgerichtet funktioniert |
- dyn. Position Hold -> normaler Rundflug möglich |
- Limit_D_Anteil = Userparam3 um im Homing- bzw. Waypointmodus die Sollposition gleichmäßiger anzufliegen |
- Die Berechnung von Kompassvalue wird jetzt auch über den GPS Haken im Koptertool aktiviert |
- 12 Kanal Erweiterung (rc.c; rc.h; fc.c; fc.h; menu.c) |
- D-Anteil_Limit wegen HOMING ->> Radius von 700 cm -> 250 cm |
- ... |
(- Regelung wird nur noch alle 250 ms aufgerufen) |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/Flight-Ctrl_MEGA644_V0_64.aps |
---|
0,0 → 1,0 |
<AVRStudio><MANAGEMENT><ProjectName>Flight-Ctrl_MEGA644_V0_64</ProjectName><Created>19-Aug-2007 14:38:13</Created><LastEdit>15-Oct-2007 19:44:55</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>19-Aug-2007 14:38:13</Created><Version>4</Version><Build>4, 13, 0, 528</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>Flight-Ctrl_MEGA644_V0_64.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>E:\hubi\ufo\mickrokopter\eigene versionen\Kompass + GPS\Flight-Ctrl_V0_64_3_GPS_work_Jochenaccvonhand\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>AVR Simulator</CURRENT_TARGET><CURRENT_PART>ATmega644.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>main.c</SOURCEFILE><SOURCEFILE>analog.c</SOURCEFILE><SOURCEFILE>eeprom.c</SOURCEFILE><SOURCEFILE>fc.c</SOURCEFILE><SOURCEFILE>GPS.c</SOURCEFILE><SOURCEFILE>menu.c</SOURCEFILE><SOURCEFILE>printf_P.c</SOURCEFILE><SOURCEFILE>rc.c</SOURCEFILE><SOURCEFILE>timer0.c</SOURCEFILE><SOURCEFILE>twimaster.c</SOURCEFILE><SOURCEFILE>uart.c</SOURCEFILE><SOURCEFILE>compass.c</SOURCEFILE><HEADERFILE>_Settings.h</HEADERFILE><HEADERFILE>analog.h</HEADERFILE><HEADERFILE>fc.h</HEADERFILE><HEADERFILE>gps.h</HEADERFILE><HEADERFILE>main.h</HEADERFILE><HEADERFILE>menu.h</HEADERFILE><HEADERFILE>old_macros.h</HEADERFILE><HEADERFILE>printf_P.h</HEADERFILE><HEADERFILE>rc.h</HEADERFILE><HEADERFILE>Settings.h</HEADERFILE><HEADERFILE>timer0.h</HEADERFILE><HEADERFILE>twimaster.h</HEADERFILE><HEADERFILE>uart.h</HEADERFILE><HEADERFILE>compass.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega644</PART><HEX>1</HEX><LIST>0</LIST><MAP>0</MAP><OUTPUTFILENAME>Flight-Ctrl_MEGA644_V0_60.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -O0 -fsigned-char</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20070525\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20070525\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/></IOView><Files><File00000><FileId>00000</FileId><FileName>main.c</FileName><Status>1</Status></File00000><File00001><FileId>00001</FileId><FileName>compass.c</FileName><Status>1</Status></File00001><File00002><FileId>00002</FileId><FileName>compass.h</FileName><Status>1</Status></File00002><File00003><FileId>00003</FileId><FileName>fc.c</FileName><Status>1</Status></File00003></Files><Workspace><File00000><Position>346 108 878 484</Position><LineCol>155 3</LineCol></File00000><File00001><Position>355 114 901 482</Position><LineCol>0 0</LineCol></File00001><File00002><Position>377 136 923 504</Position><LineCol>0 0</LineCol></File00002><File00003><Position>336 71 1048 624</Position><LineCol>834 19</LineCol><State>Maximized</State></File00003></Workspace><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio> |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/GPS.c |
---|
0,0 → 1,300 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 10.2007 by Jochen Kromayer |
// + es handelt sich um eine Beta-Software, die zu nichtkommerziellen Zwecken frei veröffentlich und weitergegeben werden darf. Für evtl. |
// + Personen- und/der Sachschäden ist jegliche Haftung ausgeschlossen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
#include "math.h" |
//Sinusfunktion von 0° bis 359°. Ergebnis wurde mit 1000 multipliziert, damit als Definition platzsparend int |
//verwendet werden kann. d.h., es muss also in der späteren Berechnung noch mit 0,001 multipliziert werden //(090907Kr) |
const int c_sin[] = {0,17,34,52,69,87,104,121,139,156,173,190, |
207,224,241,258,275,292,309,325,342,358,374,390,406,422,438,453,469,484,500,515,529,544,559,573,587,601,615,629, |
642,656,669,682,694,707,719,731,743,754,766,777,788,798,809,819,829,838,848,857,866,874,882,891,898,906,913,920, |
927,933,939,945,951,956,961,965,970,974,978,981,984,987,990,992,994,996,997,998,999,999,1000,999,999,998,997,996, |
994,992,990,987,984,981,978,974,970,965,961,956,951,945,939,933,927,920,913,906,898,891,882,874,866,857,848,838, |
829,819,809,798,788,777,766,754,743,731,719,707,694,682,669,656,642,629,615,601,587,573,559,544,529,515,500,484, |
469,453,438,422,406,390,374,358,342,325,309,292,275,258,241,224,207,190,173,156,139,121,104,87,69,52,34,17,0,-17, |
-34,-52,-69,-87,-104,-121,-139,-156,-173,-190,-207,-224,-241,-258,-275,-292,-309,-325,-342,-358,-374,-390,-406, |
-422,-438,-453,-469,-484,-500,-515,-529,-544,-559,-573,-587,-601,-615,-629,-642,-656,-669,-682,-694,-707,-719, |
-731,-743,-754,-766,-777,-788,-798,-809,-819,-829,-838,-848,-857,-866,-874,-882,-891,-898,-906,-913,-920,-927, |
-933,-939,-945,-951,-956,-961,-965,-970,-974,-978,-981,-984,-987,-990,-992,-994,-996,-997,-998,-999,-999,-1000, |
-999,-999,-998,-997,-996,-994,-992,-990,-987,-984,-981,-978,-974,-970,-965,-961,-956,-951,-945,-939,-933,-927, |
-920,-913,-906,-898,-891,-882,-874,-866,-857,-848,-838,-829,-819,-809,-798,-788,-777,-766,-754,-743,-731,-719, |
-707,-694,-682,-669,-656,-642,-629,-615,-601,-587,-573,-559,-544,-529,-515,-500,-484,-469,-453,-438,-422,-406, |
-390,-374,-358,-342,-325,-309,-292,-275,-258,-241,-224,-207,-190,-173,-156,-139,-121,-104,-87,-69,-52,-34,-17}; |
//Cosinusfunktion von 0° bis 359°. Ergebnis wurde mit 1000 multipliziert, damit als Definition platzsparend int |
//verwendet werden kann. D.h., es muss also in der späteren Berechnung noch mit 0,001 multipliziert werden //(090907Kr) |
const int c_cos[] = {1000,999,999,998,997,996,994,992,990,987,984,981, |
978,974,970,965,961,956,951,945,939,933,927,920,913,906,898,891,882,874,866,857,848,838,829,819,809,798,788,777, |
766,754,743,731,719,707,694,682,669,656,642,629,615,601,587,573,559,544,529,515,500,484,469,453,438,422,406,390, |
374,358,342,325,309,292,275,258,241,224,207,190,173,156,139,121,104,87,69,52,34,17,0,-17,-34,-52,-69,-87,-104, |
-121,-139,-156,-173,-190,-207,-224,-241,-258,-275,-292,-309,-325,-342,-358,-374,-390,-406,-422,-438,-453,-469, |
-484,-500,-515,-529,-544,-559,-573,-587,-601,-615,-629,-642,-656,-669,-682,-694,-707,-719,-731,-743,-754,-766, |
-777,-788,-798,-809,-819,-829,-838,-848,-857,-866,-874,-882,-891,-898,-906,-913,-920,-927,-933,-939,-945,-951, |
-956,-961,-965,-970,-974,-978,-981,-984,-987,-990,-992,-994,-996,-997,-998,-999,-999,-1000,-999,-999,-998,-997, |
-996,-994,-992,-990,-987,-984,-981,-978,-974,-970,-965,-961,-956,-951,-945,-939,-933,-927,-920,-913,-906,-898, |
-891,-882,-874,-866,-857,-848,-838,-829,-819,-809,-798,-788,-777,-766,-754,-743,-731,-719,-707,-694,-682,-669, |
-656,-642,-629,-615,-601,-587,-573,-559,-544,-529,-515,-500,-484,-469,-453,-438,-422,-406,-390,-374,-358,-342, |
-325,-309,-292,-275,-258,-241,-224,-207,-190,-173,-156,-139,-121,-104,-87,-69,-52,-34,-17,0,17,34,52,69,87, |
104,121,139,156,173,190,207,224,241,258,275,292,309,325,342,358,374,390,406,422,438,453,469,484,500,515,529,544, |
559,573,587,601,615,629,642,656,669,682,694,707,719,731,743,754,766,777,788,798,809,819,829,838,848,857,866,874, |
882,891,898,906,913,920,927,933,939,945,951,956,961,965,970,974,978,981,984,987,990,992,994,996,997,998,999,999}; |
long Soll_Position_North = 0; |
long Soll_Position_East = 0; |
long GPS_Positionsabweichung_North = 0; |
long GPS_Positionsabweichung_East = 0; |
long GPS_Geschwindigkeit_North = 0; |
long GPS_Geschwindigkeit_East = 0; |
long P_Einfluss_North = 0; |
long D_Einfluss_North = 0; |
long P_Einfluss_East = 0; |
long D_Einfluss_East = 0; |
signed int GPS_North = 0; |
signed int GPS_East = 0; |
signed int GPS_Nick = 0; |
signed int GPS_Roll = 0; |
volatile char gethome = 0; //Flag ob GPS_Home_Position gelernt ist //(280807Kr) |
long GPS_Home_North = 0; |
long GPS_Home_East = 0; |
unsigned char blinkcount_LED2 = 0; //Hilfszähler für die blinkende LED (010907Kr) |
//**************************** MIRCOS DEFINITIONSANFANG FÜR DIE FILTERUNG |
// Filterung der GPS Messwerte vom Ublox-Empfänger. Es wird der gleitende Durchschnitt aus n Messwerten gebildet |
#define MITTELWERTZAHL 8 // Anzahl der Messwerte fuer gleitenden Mittelwert |
volatile char NeuerMittelwert = 0; //Flag ob ein neuer Mittelwert vorliegt, der mit 4 Hz berechnet wird, da nur dann neue Messwerte vom GPS vorliegen |
volatile unsigned char FilterPos = 0; |
volatile long NORTH_MITTEL = 0; |
volatile long EAST_MITTEL = 0; |
volatile long long NORTH_LONG_LONG = 0; |
volatile long long EAST_LONG_LONG = 0; |
volatile int filterfilled = 0; |
typedef struct { |
long NORTH[MITTELWERTZAHL]; |
} FILTER_NORTH; // Filterdefinition für die Positions-Nordwerte aus dem GPS-Empfänger |
typedef struct { |
long EAST[MITTELWERTZAHL]; |
} FILTER_EAST; // Filterdefinition für die Positions-Ostwerte aus dem GPS-Empfänger |
FILTER_NORTH filter_north; |
FILTER_EAST filter_east; |
//**************************** MIRCOS DEFINITIONSENDE FÜR DIE FILTERUNG |
void gps_main(void) |
{ |
//**************************** MIRCOS FILTERUNG ANFANG |
// if(actualPos.GPSFix == 3 && actualPos.newData == 1) //bilde neuen Positionsmittelwert, wenn 3D-Fix und neue GPS-Daten vorliegen |
if(actualPos.GPSFix == 3) // hier auskommentieren, wenn dauernd (also nicht nur alle 250ms) die GPS-Berechnung durchgeführt werden soll |
{ |
filter_north.NORTH[FilterPos] = actualPos.northing; |
filter_east.EAST[FilterPos] = actualPos.easting; |
FilterPos++; |
if (FilterPos==MITTELWERTZAHL) FilterPos=0; |
if (filterfilled<MITTELWERTZAHL) filterfilled++; |
NORTH_LONG_LONG = 0; |
EAST_LONG_LONG = 0; |
for (int i=0; i<filterfilled; i++) |
{ |
NORTH_LONG_LONG += filter_north.NORTH[i]; |
EAST_LONG_LONG += filter_east.EAST[i]; |
} |
NORTH_LONG_LONG /= filterfilled; |
EAST_LONG_LONG /= filterfilled; |
NORTH_MITTEL = NORTH_LONG_LONG; |
EAST_MITTEL = EAST_LONG_LONG; |
NeuerMittelwert = 1; |
//actualPos.newData = 0; // hier auskommentieren, wenn dauernd (also nicht nur alle 250ms) die GPS-Berechnung durchgeführt werden soll |
} |
//******************************* MIRCOS FILTERUNG ENDE |
//wenn kein 3D-Fix vorhanden, über das Poti jedoch irgendeine GPS Funktion aktiv ist, werden die GPS-Steuerbefehle |
//auf Null gesetzt, um unkontrolliertes Wegfliegen durch das GPS zu verhindern. Dadurch wird abgesichert |
//(auch im laufenden Flug), dass bei einem Verlust der GPS-Verbindung GPS deaktivert wird |
if (actualPos.GPSFix < 3 && Poti3 > 70) |
{ |
GPS_Nick = 0; |
GPS_Roll = 0; |
LED2_OFF; |
beeptime = 50; |
} |
// speichert die GPS_Home_Position beim 3D-Fix, MotorEINschalten und wenn noch nicht zu weit weggeflogen wurde |
// (modell_fliegt_gps < 2000) einmalig ab. Die Flugzeitabfrage sichert ab, dass bei einem Losfliegen ohne 3D-Fix die Home_Positinen |
// irgendwann später dort gelernt werden, wo dann zu ersten mal ein 3D-Fix vorhanden ist |
if (actualPos.GPSFix == 3 && MotorenEin == 1 && gethome == 0 && modell_fliegt_gps < 2000) |
{ |
GPS_Home_North = NORTH_MITTEL; |
GPS_Home_East = EAST_MITTEL; |
// Muss hier auch eingelernt werden, damit falls das Poti3 beim Motorenstarten in |
// Mittelstellung sein sollte, trotzdem schon eine Sollposition vorliegt. Andernfalls würde |
// GPS_Nick und _Roll maximal werden bis zum ersten Mal Stick_Nick und _Roll gesteuert würde |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
beeptime = 50; |
gethome = 1; |
} |
//löscht die GPS_Home_Position beim MotorAUSschalten wieder und resetet das Flag gethome //(280807Kr) |
if (MotorenEin == 0) |
{ |
GPS_Home_North = 0; |
GPS_Home_East = 0; |
gethome = 0; |
modell_fliegt_gps = 0; |
} |
// wenn Schalter ausgeschaltet, dann wird die LED2 ausgeschaltet und das GPS Steuerkommando gelöscht |
if(Poti3 < 70) |
{ |
// Sollpositionen müssen auch hier beschrieben werden, damit ausgeschlossen ist, dass falls gelandet wird und die GPS-Funktion |
// über Poti3 deaktivert und anschließend wieder aktiviert wird keine Soll-Positionen vorliegen. |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
GPS_Nick = 0; |
GPS_Roll = 0; |
LED2_OFF; |
} |
// wenn 3D-Fix, Schalter im mittleren Bereich und vom Pilot gesteuert wird, wird ständig neue GPS-Sollposition eingelernt |
if(actualPos.GPSFix == 3 && Poti3 > 70 && Poti3 < 150 && (StickNick > 12 || StickNick < -12 || StickRoll > 12 || StickRoll < -12)) |
{ |
GPS_Nick = 0; //wird genullt, damit das letzte GPS Kommando nicht ständig gegen den Piloten ansteuert |
GPS_Roll = 0; //wird genullt, damit das letzte GPS Kommando nicht ständig gegen den Piloten ansteuert |
Soll_Position_North = NORTH_MITTEL; // Soll-Position wird geschrieben |
Soll_Position_East = EAST_MITTEL; // Soll-Position wird geschrieben |
//++++++++++++++++++++++++++++++++++++ |
//Sorgt lediglich dafür, dass die LED2 langsam blinkt. Dauer ist durch die "> x" Abfrage festgelegt |
//++++++++++++++++++++++++++++++++++++ |
if(blinkcount_LED2 >= 200) // maximal erlaubt 255 wegen unsigned char |
{ |
LED2_FLASH; |
blinkcount_LED2 = 0; |
} |
blinkcount_LED2++; |
//++++++++++++++++++++++++++++++++++++ |
} |
// wenn 3D-Fix, Schalter im mittleren Bereich (oder höher), neuer Mittelwert vorhanden, wenigstens einmal Sollposition gelernt und der Pilot nicht selbst steuert wird eine GPS-Funktion aktiviert |
if (actualPos.GPSFix == 3 && Poti3 > 70 && NeuerMittelwert == 1 && Soll_Position_North != 0 && Soll_Position_East != 0 && StickNick <= 12 && StickNick >= -12 && StickRoll <= 12 && StickRoll >= -12) |
{ |
//Berechnung der GPS-Positionsabweichung je nach aktivierter GPS-Funktion (GPS_HOLD oder HOMING) |
//DYNAMISCHES GPS-HOLD, wenn Schalter noch in Mittelstellung ist wird die zuletzt gelernte Soll_Position angeflogen |
if(Poti3 < 150) |
{ |
GPS_Positionsabweichung_North = (Soll_Position_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (Soll_Position_East - EAST_MITTEL); |
LED2_ON; |
} |
//andernfalls, wenn Schalter in max. Stellung und zusätzlich die GPS_Home_Positionen beim Motorenstarten gelernt |
//werden konnten, wird zur GPS_Home_Position geflogen |
if (Poti3 >= 150 && GPS_Home_North != 0 && GPS_Home_East != 0) |
{ |
GPS_Positionsabweichung_North = (GPS_Home_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (GPS_Home_East - EAST_MITTEL); |
// durch das ständige Neulernen der Soll_Positionen während HOMING wird erreicht, dass der MK nach dem Umschalten |
// von HOMING zurück zu GPS-HOLD nicht wieder an die alte Soll_Position zurück fliegt |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
LED2_ON; |
} |
//verhindert, dass beim Umschalten von Mittelstellung (GPS_HOLD) auf Maximalstellung (HOMING) OHNE gelernte Homeposition |
//die GPS Funktion unkontrolliert steuert. Daher wird GPS_HOLD aktiv gehalten, die Sollpositon wird bei Stickbefehlen |
//jedoch nicht wie beim dynamischen GPS_HOLD überschrieben. Zusätzlich wird der Summer eingeschaltet. |
if (Poti3 >= 150 && GPS_Home_North == 0 && GPS_Home_East == 0) |
{ |
GPS_Positionsabweichung_North = (Soll_Position_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (Soll_Position_East - EAST_MITTEL); |
LED2_ON; |
beeptime = 50; |
} |
//GPS-Geschwindigkeiten |
GPS_Geschwindigkeit_North = actualPos.velNorth; //actualPos.velNorth ist die Geschwindigkeiten aus dem GPS Empfänger entlang der Nord-Süd Richtung |
GPS_Geschwindigkeit_East = actualPos.velEast; //actualPos.velEast ist die Geschwindigkeiten aus dem GPS Empfänger entlang der Ost-West Richtung |
//Berechnung der Einzelkomponenten des PD-Reglers |
P_Einfluss_North = (P_GPS_Verstaerkung * GPS_Positionsabweichung_North)*0.0005; //entspricht einer Skalierung von 1/2000 |
D_Einfluss_North = (D_GPS_Verstaerkung * GPS_Geschwindigkeit_North)*0.00333; //entspricht einer Skalierung von 1/300 |
P_Einfluss_East = (P_GPS_Verstaerkung * GPS_Positionsabweichung_East)*0.0005; //entspricht einer Skalierung von 1/2000 |
D_Einfluss_East = (D_GPS_Verstaerkung * GPS_Geschwindigkeit_East)*0.00333; //entspricht einer Skalierung von 1/300 |
// Begrenzung des maximalen D-Anteils für pos. und neg. Werte. Grenze muss so geählt werden, |
// dass das Limit im normalen Position-Hold nicht erreicht wird und somit keinen Einfluss hat. |
// Grund: Beim Zufliegen auf weiter entfernte Ziele bremst der D-Anteil kurz vor dem Ziel den Mikrokopter sehr stark ab. |
// Dieses Limit wirkt nur, wenn sich der MK im HOMING Modus befindet und sich noch weit (>2,5m) von der Home-Position weg befindet. |
if (Poti3 >= 150 && GPS_Home_North != 0 && GPS_Home_East != 0 && (abs(GPS_Positionsabweichung_North) > 250 || abs(GPS_Positionsabweichung_East) > 250)) |
{ |
if (D_Einfluss_North > Limit_D_Anteil) D_Einfluss_North = Limit_D_Anteil; |
if (D_Einfluss_East > Limit_D_Anteil) D_Einfluss_East = Limit_D_Anteil; |
if (D_Einfluss_North < -1 * Limit_D_Anteil) D_Einfluss_North = -1 * Limit_D_Anteil; |
if (D_Einfluss_East < -1 * Limit_D_Anteil) D_Einfluss_East = -1 * Limit_D_Anteil; |
} |
// PD-Regler |
GPS_North = (-P_Einfluss_North + D_Einfluss_North); |
GPS_East = (P_Einfluss_East - D_Einfluss_East); |
//Umrechnen vom globalen North- bzw. East- in das körperfeste X- bzw. Y- Koordinatensystem |
GPS_Nick = (-c_sin[KompassValue]*0.001*GPS_East + c_cos[KompassValue]*0.001*GPS_North); // die "0" kann später durch den Messwert des Kompasssensors (KompassValue/0.01745329251) ersetzt werden |
GPS_Roll = (c_cos[KompassValue]*0.001*GPS_East + c_sin[KompassValue]*0.001*GPS_North); // die "0" kann später durch den Messwert des Kompasssensors (KompassValue/180*3.1415926535) ersetzt werden |
// Begrenzung des maximalen GPS Einflusses für positive und negative Werte |
if (GPS_Nick > 35) GPS_Nick = 35; |
if (GPS_Roll > 35) GPS_Roll = 35; |
if (GPS_Nick < -35) GPS_Nick = -35; |
if (GPS_Roll < -35) GPS_Roll = -35; |
//Funktion wird dadurch nur alle 250 ms aufgerufen, wenn neue Mittelwerte aus den GPS-Daten vorliegen. |
//FUNKTIONIERT MOMENTAN NOCH NICHT, DA STÄNDIG OHNE UNTERBRECHUNG NEUE MITTELWERTE BERECHNET WERDEN. |
//GRUND: DIE ABFRAGE NACH NEUE GPS-DATEN ERFOLGT NOCH NICHT |
NeuerMittelwert = 0; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/License.txt |
---|
0,0 → 1,52 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + Nur für den privaten Gebrauch |
// + www.MikroKopter.com |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
// + dass eine Nutzung (auch auszugsweise) nur für den privaten und nichtkommerziellen Gebrauch zulässig ist. |
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
// + bzgl. der Nutzungsbedingungen aufzunehmen. |
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
// + Verkauf von Luftbildaufnahmen, usw. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
// + eindeutig als Ursprung verlinkt und genannt werden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
// + Benutzung auf eigene Gefahr |
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
// + mit unserer Zustimmung zulässig |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
// + this list of conditions and the following disclaimer. |
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
// + from this software without specific prior written permission. |
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
// + for non-profit use (directly or indirectly) |
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
// + with our written permission |
// + * If sources or documentations are redistributet, our webpage (http://www.MikroKopter.de) must be |
// + clearly linked and named as origin |
// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/MIKROKOPTER_TO_DO.txt |
---|
0,0 → 1,11 |
. Patricks neigungskompensierten Kompass |
. Aufruf der GPS.c innerhalb der fc.c nur wenn neue Daten vorliegen |
. innerhalb der GPS.c den PD-Regler nicht mit "NeuerMittelwert", sondern mit "actualpos.newdata" alle 250ms aufrufen |
. GPS-Empfänger auf 5Hz einstellen |
. Begrenzung von 35 auf 50 anheben, damit auch bei stärkerem Wind geflogen werden kann |
. Waypoints |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/Parameter.txt |
---|
0,0 → 1,15 |
bei leichtem, konstantem Wind |
P-Faktor(Userparam_1): 120 |
D-Faktor(Userparam_2): 90 |
D-Anteil_Limit(Userparam_3): 45 |
bei stärkerem, böhigem Wind: |
P-Faktor(Userparam_1): 150 |
D-Faktor(Userparam_2): 95 |
D-Anteil_Limit(Userparam_3): 45 |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/Setting_1.mkp |
---|
0,0 → 1,51 |
[Setup] |
Name=GPS |
GlobalConfig=43 |
[Channels] |
Gas=7 |
Gier=6 |
Nick=5 |
Roll=8 |
Poti_1=1 |
Poti_2=2 |
Poti_3=3 |
Poti_4=4 |
[Stick] |
Nick_Roll-P=4 |
Nick_Roll-D=0 |
Gier-P=16 |
[Altitude] |
Setpoint=254 |
MinGas=30 |
P=10 |
Barometric-D=50 |
Z-ACC-Effect=50 |
Gain=2 |
[Gyro] |
P=120 |
I=150 |
ACC_Gyro-Factor=26 |
Main-I=0 |
[Others] |
MinGas=5 |
MaxGas=250 |
Compass-Effect=64 |
UnderVoltage=95 |
NotGas=66 |
NotGasTime=60 |
[User] |
Parameter_1=251 |
Parameter_2=252 |
Parameter_3=35 |
Parameter_4=60 |
[Camera] |
ServoNickControl=100 |
ServoNickCompensation=40 |
ServoNickInvert=0 |
ServoNickMin=50 |
ServoNickMax=150 |
ServoNickRefreshRate=5 |
[Loop] |
Config=0 |
GasLimit=50 |
StickThreshold=90 |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/Settings.h |
---|
--- alpha/v064JokoGPSNick666MM3Acc/_Settings.h (nonexistent) |
+++ alpha/v064JokoGPSNick666MM3Acc/_Settings.h (revision 2762) |
@@ -0,0 +1,50 @@ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Testmodi |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define MOTOR_OFF 0 |
+#define MOTOR_TEST 0 |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Abstimmung |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define ACC_AMPLIFY 16 |
+#define FAKTOR_P 1 |
+#define FAKTOR_I 0.0001 |
+ |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Debug-Interface |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define SIO_DEBUG 1 // Soll der Debugger aktiviert sein? |
+#define MIN_DEBUG_INTERVALL 500 // in diesem Intervall werden Degugdaten ohne Aufforderung gesendet |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Sender |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ #define K_NICK 0 |
+ #define K_ROLL 1 |
+ #define K_GAS 2 |
+ #define K_GIER 3 |
+ #define K_POTI1 4 |
+ #define K_POTI2 5 |
+ #define K_POTI3 6 |
+ #define K_POTI4 7 |
+// +++++++++++++++++++++++++++++++ |
+// + Getestete Settings: |
+// +++++++++++++++++++++++++++++++ |
+// Setting: Kamera |
+// Stick_P:3 |
+// Stick_D:0 |
+// Gyro_P: 175 |
+// Gyro_I: 175 |
+// Ki_Anteil: 10 |
+// +++++++++++++++++++++++++++++++ |
+// + Getestete Settings: |
+// +++++++++++++++++++++++++++++++ |
+// Setting: Normal |
+// Stick_P:2 |
+// Stick_D:8 |
+// Gyro_P: 80 |
+// Gyro_I: 150 |
+// Ki_Anteil: 5 |
+ |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/analog.c |
---|
0,0 → 1,172 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
volatile int Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az, UBat = 100; |
volatile int AccumulateNick = 0, AccumulateRoll = 0, AccumulateGier = 0; |
volatile int accumulate_AccRoll = 0,accumulate_AccNick = 0,accumulate_AccHoch = 0; |
volatile char MessanzahlNick = 0, MessanzahlRoll = 0, MessanzahlGier = 0; |
volatile char messanzahl_AccNick = 0, messanzahl_AccRoll = 0, messanzahl_AccHoch = 0; |
volatile long Luftdruck = 32000; |
volatile int StartLuftdruck; |
volatile unsigned int MessLuftdruck = 1023; |
unsigned char DruckOffsetSetting; |
volatile int HoeheD = 0; |
volatile char messanzahl_Druck; |
volatile int tmpLuftdruck; |
volatile unsigned int ZaehlMessungen = 0; |
//####################################################################################### |
// |
void ADC_Init(void) |
//####################################################################################### |
{ |
ADMUX = 0;//Referenz ist extern |
ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE); |
//Free Running Mode, Division Factor 128, Interrupt on |
} |
void SucheLuftruckOffset(void) |
{ |
unsigned int off; |
off = eeprom_read_byte(&EEPromArray[EEPROM_ADR_LAST_OFFSET]); |
if(off > 20) off -= 10; |
OCR0A = off; |
Delay_ms(100); |
if(MessLuftdruck < 850) off = 0; |
for(; off < 250;off++) |
{ |
OCR0A = off; |
Delay_ms(50); |
printf("."); |
if(MessLuftdruck < 900) break; |
} |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_LAST_OFFSET], off); |
DruckOffsetSetting = off; |
Delay_ms(300); |
} |
//####################################################################################### |
// |
SIGNAL(SIG_ADC) |
//####################################################################################### |
{ |
static unsigned char kanal=0,state = 0; |
signed int wert; |
ANALOG_OFF; |
switch(state++) |
{ |
case 0: |
wert = (signed int) AdNeutralGier - ADC; |
if(PlatinenVersion != 10) wert *= 2; |
AccumulateGier += wert; // |
MessanzahlGier++; |
Mess_Integral_Gier += wert;// / 16; |
Mess_Integral_Gier2 += wert; |
kanal = 1; |
ZaehlMessungen++; |
break; |
case 1: |
wert = (signed int) ADC - AdNeutralRoll; |
if(PlatinenVersion != 10) wert *= 2; |
Mess_IntegralRoll += wert; |
Mess_IntegralRoll2 += wert; |
if(Mess_IntegralRoll > 310000L) Mess_IntegralRoll = -290000L; |
if(Mess_IntegralRoll <-310000L) Mess_IntegralRoll = 290000L; |
if(ADC < 15) wert = -1000; |
if(ADC < 7) wert = -2000; |
if(ADC > 1010) wert = +1000; |
if(ADC > 1017) wert = +2000; |
AccumulateRoll += wert; |
MessanzahlRoll++; |
kanal = 2; |
break; |
case 2: |
wert = (signed int) ADC - AdNeutralNick; |
if(PlatinenVersion != 10) wert *= 2; |
Mess_IntegralNick += wert; |
Mess_IntegralNick2 += wert; |
if(Mess_IntegralNick > 310000L) Mess_IntegralNick = -290000L; |
if(Mess_IntegralNick <-310000L) Mess_IntegralNick = 290000L; |
if(ADC < 15) wert = -1000; |
if(ADC < 7) wert = -2000; |
if(ADC > 1010) wert = +1000; |
if(ADC > 1017) wert = +2000; |
AccumulateNick += wert; |
MessanzahlNick++; |
kanal = 4; |
break; |
case 3: |
UBat = (3 * UBat + ADC / 3) / 4;//(UBat + ((ADC * 39) / 256) + 19) / 2; |
kanal = 6; |
break; |
case 4: |
Aktuell_ay = NeutralAccY - ADC; |
accumulate_AccRoll += Aktuell_ay; |
messanzahl_AccRoll++; |
kanal = 7; |
break; |
case 5: |
Aktuell_ax = ADC - NeutralAccX; |
accumulate_AccNick += Aktuell_ax; |
messanzahl_AccNick++; |
kanal = 5; |
state = 6; |
break; |
case 6: |
accumulate_AccHoch = (signed int) ADC - NeutralAccZ; |
accumulate_AccHoch += abs(Aktuell_ay) / 4 + abs(Aktuell_ax) / 4; |
if(accumulate_AccHoch > 1) |
{ |
if(NeutralAccZ < 800) NeutralAccZ+= 0.02; |
} |
else if(accumulate_AccHoch < -1) |
{ |
if(NeutralAccZ > 600) NeutralAccZ-= 0.02; |
} |
messanzahl_AccHoch = 1; |
Aktuell_az = ADC; |
Mess_Integral_Hoch += accumulate_AccHoch; // Integrieren |
Mess_Integral_Hoch -= Mess_Integral_Hoch / 1024; // dämfen |
// Mess_Integral_Hoch -= Mess_Integral_Hoch / 512; // dämfen |
/* if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
kanal = 3; |
state = 7; |
} |
else |
{ |
kanal = 0; |
state = 0; |
}*/ |
kanal = 3; |
state = 7; |
break; |
case 7: |
tmpLuftdruck += ADC; |
if(++messanzahl_Druck >= 5) |
{ |
MessLuftdruck = ADC; |
messanzahl_Druck = 0; |
HoeheD = (int)(StartLuftdruck - tmpLuftdruck - HoehenWert); // D-Anteil = neuerWert - AlterWert |
Luftdruck = (tmpLuftdruck + 3 * Luftdruck) / 4; |
HoehenWert = StartLuftdruck - Luftdruck; |
tmpLuftdruck = 0; |
} |
kanal = 0; |
state = 0; |
break; |
default: |
kanal = 0; |
state = 0; |
break; |
} |
ADMUX = kanal; |
ANALOG_ON; |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/analog.h |
---|
0,0 → 1,23 |
/*####################################################################################### |
#######################################################################################*/ |
extern volatile int UBat; |
extern volatile int AccumulateNick, AccumulateRoll, AccumulateGier,accumulate_AccRoll,accumulate_AccNick,accumulate_AccHoch; |
extern volatile char MessanzahlNick, MessanzahlRoll, MessanzahlGier,messanzahl_AccNick, messanzahl_AccRoll,messanzahl_AccHoch; |
extern volatile int Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az; |
extern volatile long Luftdruck; |
extern volatile char messanzahl_Druck; |
extern volatile unsigned int ZaehlMessungen; |
extern unsigned char DruckOffsetSetting; |
extern volatile int HoeheD; |
extern volatile unsigned int MessLuftdruck; |
extern volatile int StartLuftdruck; |
extern unsigned int ReadADC(unsigned char adc_input); |
extern void ADC_Init(void); |
extern void SucheLuftruckOffset(void); |
#define ANALOG_OFF ADCSRA=0 |
#define ANALOG_ON ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE) |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/compass.c |
---|
0,0 → 1,152 |
/* |
Copyright 2007, Niklas Nold |
This program (files compass.c and compass.h) is free software; you can redistribute it and/or modify |
it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; |
either version 3 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
Please note: All the other files for the project "Mikrokopter" by H. Buss are under the license (license_buss.txt) published by www.mikrokopter.de |
*/ |
#include "main.h" |
MM3_struct MM3; |
//############################################################################ |
//Initialisierung der SPI-Schnittstelle |
void init_spi(void) |
//############################################################################ |
{ |
SPCR = (1<<SPIE)|(1<<SPE)|(1<<MSTR)|(1<<SPR1)|(1<<SPR0); //Interrupt an, Master, 156 kHz Oszillator |
//SPSR = (1<<SPI2X); |
DDRB |= (1<<PB7)|(1<<PB5)|(1<<PB2); // J8, MOSI, SCK Ausgang |
PORTD &= ~(1<<PD3); // J5 auf Low |
MM3.AXIS = MM3_X; |
MM3.STATE = MM3_RESET; |
} |
//############################################################################ |
//Wird in der SIGNAL (SIG_OVERFLOW0) aufgerufen |
void MM3_timer0(void) |
//############################################################################ |
{ |
switch (MM3.STATE) |
{ |
case MM3_RESET: |
PORTB |= (1<<PB2); // J8 auf High, MM3 Reset |
MM3.STATE = MM3_START_TRANSFER; |
return; |
case MM3_START_TRANSFER: |
PORTB &= ~(1<<PB2); // J8 auf Low (war ~125 µs auf High) |
if (MM3.AXIS == MM3_X) SPDR = 0x51; // Schreiben ins SPDR löst automatisch Übertragung (MOSI und MISO) aus |
else if (MM3.AXIS == MM3_Y) SPDR = 0x52; // Micromag Period Select ist auf 1024 (0x50) |
else if (MM3.AXIS == MM3_Z) SPDR = 0x53; // 1: x-Achse, 2: Y-Achse, 3: Z-Achse |
MM3.DRDY = SetDelay(15); // Laut Datenblatt max. Zeit bis Messung fertig (bei PS 1024) |
MM3.STATE = MM3_WAIT_DRDY; |
return; |
case MM3_WAIT_DRDY: |
if (CheckDelay(MM3.DRDY)) {SPDR = 0x00;MM3.STATE = MM3_DRDY;} // Irgendwas ins SPDR, damit Übertragung ausgelöst wird, wenn Wartezeit vorbei |
return; // Jetzt gehts weiter in SIGNAL (SIG_SPI) |
case MM3_TILT: // Zeitnahe Speicherung der aktuellen Neigung in ° |
MM3.NickGrad = asin_i((float)Aktuell_ax/PARAMETER*200); |
MM3.RollGrad = asin_i((float)Aktuell_ay/PARAMETER*200); |
MM3.AXIS = MM3_X; |
MM3.STATE = MM3_RESET; |
return; |
} |
} |
//############################################################################ |
//SPI byte ready |
SIGNAL (SIG_SPI) |
//############################################################################ |
{ |
switch (MM3.STATE) |
{ |
case MM3_DRDY: // 1. Byte ist da, abspeichern, an die MSB-Stelle rücken |
if (MM3.AXIS == MM3_X) |
{ |
MM3.x_axis = SPDR; |
MM3.x_axis <<= 8; |
} |
else if (MM3.AXIS == MM3_Y) |
{ |
MM3.y_axis = SPDR; |
MM3.y_axis <<= 8; |
} |
else // if (MM3.AXIS == MM3_Z) |
{ |
MM3.z_axis = SPDR; |
MM3.z_axis <<= 8; |
} |
SPDR=0x00; // Übertragung von 2. Byte auslösen |
MM3.STATE=MM3_BYTE2; |
return; |
case MM3_BYTE2: // 2. Byte der entsprechenden Achse ist da |
if (MM3.AXIS == MM3_X) |
{ |
MM3.x_axis |= SPDR; |
MM3.x_axis -= OFF_X; // Sofort Offset aus der Kalibrierung berücksichtigen |
MM3.AXIS = MM3_Y; |
MM3.STATE = MM3_RESET; |
} |
else if (MM3.AXIS == MM3_Y) |
{ |
MM3.y_axis |= SPDR; |
MM3.y_axis -= OFF_Y; |
MM3.AXIS = MM3_Z; |
MM3.STATE = MM3_RESET; |
} |
else // if (MM3.AXIS == MM3_Z) |
{ |
MM3.z_axis |= SPDR; |
MM3.z_axis -= OFF_Z; |
MM3.STATE = MM3_TILT; |
} |
return; |
} |
} |
signed int MM3_heading(void) |
{ |
float sin_nick, cos_nick, sin_roll, cos_roll; |
signed int x_corr, y_corr; |
signed int heading; |
// Berechung von sinus und cosinus |
sin_nick = sin_f(MM3.NickGrad); |
cos_nick = cos_f(MM3.NickGrad); |
sin_roll = sin_f(MM3.RollGrad); |
cos_roll = cos_f(MM3.RollGrad); |
// Neigungskompensation |
//x_corr = (cos_nick * MM3.x_axis) + (((sin_roll * MM3.y_axis) - (cos_roll * MM3.z_axis)) * sin_nick); |
x_corr = (cos_nick * MM3.x_axis) - (((sin_roll * MM3.y_axis) - (cos_roll * MM3.z_axis)) * sin_nick); |
y_corr = ((cos_roll * MM3.y_axis) + (sin_roll * MM3.z_axis)); |
// Winkelberechnung |
heading = atan2_i(x_corr, y_corr); |
return (heading); |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/compass.h |
---|
0,0 → 1,40 |
typedef struct |
{ |
uint8_t STATE; |
unsigned int DRDY; |
uint8_t AXIS; |
signed int x_axis; |
signed int y_axis; |
signed int z_axis; |
signed int NickGrad; |
signed int RollGrad; |
}MM3_struct; |
extern MM3_struct MM3; |
void init_spi(void); |
void MM3_timer0(void); |
signed int MM3_heading(void); |
#define Int2Grad_Faktor 1024 |
// Die Werte der Statemachine |
#define MM3_RESET 0 |
#define MM3_START_TRANSFER 1 |
#define MM3_WAIT_DRDY 2 |
#define MM3_DRDY 4 |
#define MM3_BYTE2 8 |
#define MM3_X 16 |
#define MM3_Y 32 |
#define MM3_Z 64 |
#define MM3_TILT 128 |
// Die Werte der Kompasskalibrierung |
// OFFSET: (Maximaler Wert + minimaler Wert) / 2 |
#define OFF_X 0 |
#define OFF_Y 0 |
#define OFF_Z 0 |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/eeprom.c |
---|
--- alpha/v064JokoGPSNick666MM3Acc/fc.c (nonexistent) |
+++ alpha/v064JokoGPSNick666MM3Acc/fc.c (revision 2762) |
@@ -0,0 +1,1034 @@ |
+/*####################################################################################### |
+Flight Control |
+#######################################################################################*/ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Copyright (c) 04.2007 Holger Buss |
+// + Nur für den privaten Gebrauch |
+// + www.MikroKopter.com |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
+// + dass eine Nutzung (auch auszugsweise) nur für den privaten (nicht-kommerziellen) Gebrauch zulässig ist. |
+// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
+// + bzgl. der Nutzungsbedingungen aufzunehmen. |
+// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
+// + Verkauf von Luftbildaufnahmen, usw. |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
+// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
+// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
+// + eindeutig als Ursprung verlinkt werden |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
+// + Benutzung auf eigene Gefahr |
+// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
+// + mit unserer Zustimmung zulässig |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
+// + this list of conditions and the following disclaimer. |
+// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
+// + from this software without specific prior written permission. |
+// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
+// + for non-commercial use (directly or indirectly) |
+// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
+// + with our written permission |
+// + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
+// + clearly linked as origin |
+// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
+// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
+// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
+// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
+// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
+// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
+// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
+// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
+// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
+// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
+// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
+// + POSSIBILITY OF SUCH DAMAGE. |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+#include "main.h" |
+ |
+unsigned char h,m,s; |
+volatile unsigned int I2CTimeout = 100; |
+volatile int MesswertNick,MesswertRoll,MesswertGier; |
+volatile int AdNeutralNick = 0,AdNeutralRoll = 0,AdNeutralGier = 0; |
+volatile int Mittelwert_AccNick, Mittelwert_AccRoll,Mittelwert_AccHoch, NeutralAccX=0, NeutralAccY=0; |
+volatile float NeutralAccZ = 0; |
+unsigned char CosinusNickWinkel = 0, CosinusRollWinkel = 0; |
+volatile long IntegralNick = 0,IntegralNick2 = 0; |
+volatile long IntegralRoll = 0,IntegralRoll2 = 0; |
+volatile long Integral_Gier = 0; |
+volatile long Mess_IntegralNick = 0,Mess_IntegralNick2 = 0; |
+volatile long Mess_IntegralRoll = 0,Mess_IntegralRoll2 = 0; |
+volatile long Mess_Integral_Gier = 0,Mess_Integral_Gier2 = 0; |
+volatile long Mess_Integral_Hoch = 0; |
+volatile int KompassValue = 0; |
+volatile int KompassStartwert = 0; |
+volatile int KompassRichtung = 0; |
+unsigned char MAX_GAS,MIN_GAS; |
+unsigned char Notlandung = 0; |
+unsigned char HoehenReglerAktiv = 0; |
+ |
+unsigned char blinkcount_LED1 = 0;//Hilfszähler für die blinkende LED (310807Kr) |
+unsigned int modell_fliegt_gps = 0;//(030907Kr) |
+unsigned char Limit_D_Anteil = 0;//(210907Kr) |
+ |
+float GyroFaktor; |
+float IntegralFaktor; |
+ |
+volatile int DiffNick,DiffRoll; |
+int Poti1 = 0, Poti2 = 0, Poti3 = 0, Poti4 = 0, Poti5 = 0, Poti6 = 0, Poti7 = 0, Poti8 = 0; //PPM24-Erweiterung (121007Kr) |
+volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
+unsigned char MotorWert[5]; |
+volatile unsigned char SenderOkay = 0; |
+int StickNick = 0,StickRoll = 0,StickGier = 0; |
+char MotorenEin = 0; |
+int HoehenWert = 0; |
+int SollHoehe = 0; |
+unsigned char Looping_Nick = 0,Looping_Roll = 0; |
+ |
+float Kp = FAKTOR_P; |
+float Ki = FAKTOR_I; |
+ |
+unsigned char Parameter_Luftdruck_D = 48; // Wert : 0-250 |
+unsigned char Parameter_MaxHoehe = 251; // Wert : 0-250 |
+unsigned char Parameter_Hoehe_P = 16; // Wert : 0-32 |
+unsigned char Parameter_Hoehe_ACC_Wirkung = 58; // Wert : 0-250 |
+unsigned char Parameter_KompassWirkung = 64; // Wert : 0-250 |
+unsigned char Parameter_Gyro_P = 150; // Wert : 10-250 |
+unsigned char Parameter_Gyro_I = 150; // Wert : 0-250 |
+unsigned char Parameter_Gier_P = 2; // Wert : 1-20 |
+unsigned char Parameter_I_Faktor = 10; // Wert : 1-20 |
+unsigned char Parameter_UserParam1 = 0; |
+unsigned char Parameter_UserParam2 = 0; |
+unsigned char Parameter_UserParam3 = 0; |
+unsigned char Parameter_UserParam4 = 0; |
+unsigned char Parameter_ServoNickControl = 100; |
+unsigned char Parameter_LoopGasLimit = 70; |
+struct mk_param_struct EE_Parameter; |
+ |
+void Piep(unsigned char Anzahl) |
+{ |
+ while(Anzahl--) |
+ { |
+ if(MotorenEin) return; //auf keinen Fall im Flug! |
+ beeptime = 100; |
+ Delay_ms(250); |
+ } |
+} |
+ |
+//############################################################################ |
+// Nullwerte ermitteln |
+void SetNeutral(void) |
+//############################################################################ |
+{ |
+ unsigned int timer; |
+ NeutralAccX = 0; |
+ NeutralAccY = 0; |
+ NeutralAccZ = 0; |
+ AdNeutralNick = 0; |
+ AdNeutralRoll = 0; |
+ AdNeutralGier = 0; |
+ CalibrierMittelwert(); |
+ timer = SetDelay(5); |
+ while (!CheckDelay(timer)); |
+ CalibrierMittelwert(); |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
+ { |
+ if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset(); |
+ } |
+ |
+ if(PlatinenVersion == 10) |
+ { |
+ AdNeutralNick= abs(MesswertNick); |
+ AdNeutralRoll= abs(MesswertRoll); |
+ AdNeutralGier= abs(MesswertGier); |
+ } |
+ else |
+ { |
+ AdNeutralNick= abs(MesswertNick) / 2; |
+ AdNeutralRoll= abs(MesswertRoll) / 2; |
+ AdNeutralGier= abs(MesswertGier) / 2; |
+ } |
+ NeutralAccY = abs(Mittelwert_AccRoll) / ACC_AMPLIFY; |
+ NeutralAccX = abs(Mittelwert_AccNick) / ACC_AMPLIFY; |
+ NeutralAccZ = Aktuell_az; |
+ |
+ Mess_IntegralNick = 0; |
+ Mess_IntegralNick2 = 0; |
+ Mess_IntegralRoll = 0; |
+ Mess_IntegralRoll2 = 0; |
+ Mess_Integral_Gier = 0; |
+ MesswertNick = 0; |
+ MesswertRoll = 0; |
+ MesswertGier = 0; |
+ StartLuftdruck = Luftdruck; |
+ HoeheD = 0; |
+ Mess_Integral_Hoch = 0; |
+ KompassStartwert = KompassValue; |
+ beeptime = 50; |
+} |
+ |
+//############################################################################ |
+// Bildet den Mittelwert aus den Messwerten |
+void Mittelwert(void) |
+//############################################################################ |
+{ |
+ // ADC auschalten, damit die Werte sich nicht während der Berechnung ändern |
+ ANALOG_OFF; |
+ if(MessanzahlNick) (MesswertNick = AccumulateNick / MessanzahlNick); |
+ if(MessanzahlRoll) (MesswertRoll = AccumulateRoll / MessanzahlRoll); |
+ if(MessanzahlGier) (MesswertGier = AccumulateGier / MessanzahlGier); |
+ if(messanzahl_AccNick) Mittelwert_AccNick = ((long)Mittelwert_AccNick * 7 + ((ACC_AMPLIFY * (long)accumulate_AccNick) / messanzahl_AccNick)) / 8L; |
+ if(messanzahl_AccRoll) Mittelwert_AccRoll = ((long)Mittelwert_AccRoll * 7 + ((ACC_AMPLIFY * (long)accumulate_AccRoll) / messanzahl_AccRoll)) / 8L; |
+ if(messanzahl_AccHoch) Mittelwert_AccHoch = ((long)Mittelwert_AccHoch * 7 + ((long)accumulate_AccHoch) / messanzahl_AccHoch) / 8L; |
+ AccumulateNick = 0; MessanzahlNick = 0; |
+ AccumulateRoll = 0; MessanzahlRoll = 0; |
+ AccumulateGier = 0; MessanzahlGier = 0; |
+ accumulate_AccRoll = 0;messanzahl_AccRoll = 0; |
+ accumulate_AccNick = 0;messanzahl_AccNick = 0; |
+ accumulate_AccHoch = 0;messanzahl_AccHoch = 0; |
+ Integral_Gier = Mess_Integral_Gier; |
+// Integral_Gier2 = Mess_Integral_Gier2; |
+ IntegralNick = Mess_IntegralNick; |
+ IntegralRoll = Mess_IntegralRoll; |
+ IntegralNick2 = Mess_IntegralNick2; |
+ IntegralRoll2 = Mess_IntegralRoll2; |
+ // ADC einschalten |
+ ANALOG_ON; |
+ |
+/* |
+//------------------------------------------------------------------------------ |
+ if(MesswertNick > 200) MesswertNick += 4 * (MesswertNick - 200); |
+ else |
+ if(MesswertNick < -200) MesswertNick += 4 * (MesswertNick + 200); |
+ if(MesswertRoll > 200) MesswertRoll += 4 * (MesswertRoll - 200); |
+ else |
+ if(MesswertRoll < -200) MesswertRoll += 4 * (MesswertRoll + 200); |
+//------------------------------------------------------------------------------ |
+*/ |
+ if(Poti1 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110) Poti1++; else if(Poti1 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110 && Poti1) Poti1--; |
+ if(Poti2 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110) Poti2++; else if(Poti2 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110 && Poti2) Poti2--; |
+ if(Poti3 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110) Poti3++; else if(Poti3 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110 && Poti3) Poti3--; |
+ if(Poti4 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110) Poti4++; else if(Poti4 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110 && Poti4) Poti4--; |
+ //PPM24-Erweiterung (121007Kr) |
+ if(Poti5 < PPM_in[9] + 110) Poti5++; else if(Poti5 > PPM_in[9] + 110 && Poti5) Poti5--; |
+ if(Poti6 < PPM_in[10] + 110) Poti6++; else if(Poti6 > PPM_in[10] + 110 && Poti6) Poti6--; |
+ if(Poti7 < PPM_in[11] + 110) Poti7++; else if(Poti7 > PPM_in[11] + 110 && Poti7) Poti7--; |
+ if(Poti8 < PPM_in[12] + 110) Poti8++; else if(Poti8 > PPM_in[12] + 110 && Poti8) Poti8--; |
+ |
+ |
+ if(Poti1 < 0) Poti1 = 0; else if(Poti1 > 255) Poti1 = 255; |
+ if(Poti2 < 0) Poti2 = 0; else if(Poti2 > 255) Poti2 = 255; |
+ if(Poti3 < 0) Poti3 = 0; else if(Poti3 > 255) Poti3 = 255; |
+ if(Poti4 < 0) Poti4 = 0; else if(Poti4 > 255) Poti4 = 255; |
+ //PPM24-Erweiterung (121007Kr) |
+ if(Poti5 < 0) Poti5 = 0; else if(Poti5 > 255) Poti5 = 255; |
+ if(Poti6 < 0) Poti6 = 0; else if(Poti6 > 255) Poti6 = 255; |
+ if(Poti7 < 0) Poti7 = 0; else if(Poti7 > 255) Poti7 = 255; |
+ if(Poti8 < 0) Poti8 = 0; else if(Poti8 > 255) Poti8 = 255; |
+} |
+ |
+//############################################################################ |
+// Messwerte beim Ermitteln der Nullage |
+void CalibrierMittelwert(void) |
+//############################################################################ |
+{ |
+ // ADC auschalten, damit die Werte sich nicht während der Berechnung ändern |
+ ANALOG_OFF; |
+ if(MessanzahlNick) (MesswertNick = AccumulateNick / MessanzahlNick); |
+ if(MessanzahlRoll) (MesswertRoll = AccumulateRoll / MessanzahlRoll); |
+ if(MessanzahlGier) (MesswertGier = AccumulateGier / MessanzahlGier); |
+ if(messanzahl_AccNick) Mittelwert_AccNick = ((ACC_AMPLIFY * (long)accumulate_AccNick) / messanzahl_AccNick); |
+ if(messanzahl_AccRoll) Mittelwert_AccRoll = (ACC_AMPLIFY * (long)accumulate_AccRoll) / messanzahl_AccRoll; |
+ if(messanzahl_AccHoch) Mittelwert_AccHoch = ((long)accumulate_AccHoch) / messanzahl_AccHoch; |
+ AccumulateNick = 0; MessanzahlNick = 0; |
+ AccumulateRoll = 0; MessanzahlRoll = 0; |
+ AccumulateGier = 0; MessanzahlGier = 0; |
+ accumulate_AccRoll = 0;messanzahl_AccRoll = 0; |
+ accumulate_AccNick = 0;messanzahl_AccNick = 0; |
+ accumulate_AccHoch = 0;messanzahl_AccHoch = 0; |
+ // ADC einschalten |
+ ANALOG_ON; |
+ if(Poti1 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110) Poti1++; else if(Poti1 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110 && Poti1) Poti1--; |
+ if(Poti2 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110) Poti2++; else if(Poti2 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110 && Poti2) Poti2--; |
+ if(Poti3 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110) Poti3++; else if(Poti3 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110 && Poti3) Poti3--; |
+ if(Poti4 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110) Poti4++; else if(Poti4 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110 && Poti4) Poti4--; |
+ //PPM24-Erweiterung (121007Kr) |
+ if(Poti5 < PPM_in[9] + 110) Poti5++; else if(Poti5 > PPM_in[9] + 110 && Poti5) Poti5--; |
+ if(Poti6 < PPM_in[10] + 110) Poti6++; else if(Poti6 > PPM_in[10] + 110 && Poti6) Poti6--; |
+ if(Poti7 < PPM_in[11] + 110) Poti7++; else if(Poti7 > PPM_in[11] + 110 && Poti7) Poti7--; |
+ if(Poti8 < PPM_in[12] + 110) Poti8++; else if(Poti8 > PPM_in[12] + 110 && Poti8) Poti8--; |
+ |
+ |
+ |
+ |
+ if(Poti1 < 0) Poti1 = 0; else if(Poti1 > 255) Poti1 = 255; |
+ if(Poti2 < 0) Poti2 = 0; else if(Poti2 > 255) Poti2 = 255; |
+ if(Poti3 < 0) Poti3 = 0; else if(Poti3 > 255) Poti3 = 255; |
+ if(Poti4 < 0) Poti4 = 0; else if(Poti4 > 255) Poti4 = 255; |
+ //PPM24-Erweiterung (121007Kr) |
+ if(Poti5 < 0) Poti5 = 0; else if(Poti5 > 255) Poti5 = 255; |
+ if(Poti6 < 0) Poti6 = 0; else if(Poti6 > 255) Poti6 = 255; |
+ if(Poti7 < 0) Poti7 = 0; else if(Poti7 > 255) Poti7 = 255; |
+ if(Poti8 < 0) Poti8 = 0; else if(Poti8 > 255) Poti8 = 255; |
+} |
+ |
+//############################################################################ |
+// Senden der Motorwerte per I2C-Bus |
+void SendMotorData(void) |
+//############################################################################ |
+{ |
+ if(MOTOR_OFF || !MotorenEin) |
+ { |
+ Motor_Hinten = 0; |
+ Motor_Vorne = 0; |
+ Motor_Rechts = 0; |
+ Motor_Links = 0; |
+ if(MotorTest[0]) Motor_Vorne = MotorTest[0]; |
+ if(MotorTest[1]) Motor_Hinten = MotorTest[1]; |
+ if(MotorTest[2]) Motor_Links = MotorTest[2]; |
+ if(MotorTest[3]) Motor_Rechts = MotorTest[3]; |
+ } |
+ |
+ // DebugOut.Analog[12] = Motor_Vorne; |
+ // DebugOut.Analog[13] = Motor_Hinten; |
+ // DebugOut.Analog[14] = Motor_Links; |
+ // DebugOut.Analog[15] = Motor_Rechts; |
+ |
+ // DebugOut.Analog[12] = motor_rx[0]; //Motorstrom vorne |
+ // DebugOut.Analog[13] = motor_rx[1]; //Motorstrom hinten |
+ // DebugOut.Analog[14] = motor_rx[2]; //Motorstrom links |
+ // DebugOut.Analog[15] = motor_rx[3]; //Motorstrom rechts |
+ |
+ |
+ //Start I2C Interrupt Mode |
+ twi_state = 0; |
+ motor = 0; |
+ i2c_start(); |
+} |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Konstanten |
+// + 0-250 -> normale Werte |
+// + 251 -> Poti1 |
+// + 252 -> Poti2 |
+// + 253 -> Poti3 |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+void DefaultKonstanten1(void) |
+{ |
+ EE_Parameter.Kanalbelegung[K_NICK] = 1; |
+ EE_Parameter.Kanalbelegung[K_ROLL] = 2; |
+ EE_Parameter.Kanalbelegung[K_GAS] = 3; |
+ EE_Parameter.Kanalbelegung[K_GIER] = 4; |
+ EE_Parameter.Kanalbelegung[K_POTI1] = 5; |
+ EE_Parameter.Kanalbelegung[K_POTI2] = 6; |
+ EE_Parameter.Kanalbelegung[K_POTI3] = 7; |
+ EE_Parameter.Kanalbelegung[K_POTI4] = 8; |
+ EE_Parameter.GlobalConfig = 0;//CFG_HOEHENREGELUNG | /*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV | CFG_KOMPASS_FIX;//0x01; |
+ EE_Parameter.Hoehe_MinGas = 30; |
+ EE_Parameter.MaxHoehe = 251; // Wert : 0-32 251 -> Poti1 |
+ EE_Parameter.Hoehe_P = 10; // Wert : 0-32 |
+ EE_Parameter.Luftdruck_D = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_ACC_Wirkung = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_Verstaerkung = 4; // Wert : 0-50 |
+ EE_Parameter.Stick_P = 4; //2 // Wert : 1-6 |
+ EE_Parameter.Stick_D = 8; //8 // Wert : 0-64 |
+ EE_Parameter.Gier_P = 16; // Wert : 1-20 |
+ EE_Parameter.Gas_Min = 5; // Wert : 0-32 // (160607Kr) |
+ EE_Parameter.Gas_Max = 250; // Wert : 33-250 |
+ EE_Parameter.GyroAccFaktor = 26; // Wert : 1-64 |
+ EE_Parameter.KompassWirkung = 128; // Wert : 0-250 |
+ EE_Parameter.Gyro_P = 120; //80 // Wert : 0-250 |
+ EE_Parameter.Gyro_I = 150; // Wert : 0-250 |
+ EE_Parameter.UnterspannungsWarnung = 95; // Wert : 0-250 // (160607Kr) |
+ EE_Parameter.NotGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
+ EE_Parameter.NotGasZeit = 20; // Wert : 0-250 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen |
+ EE_Parameter.UfoAusrichtung = 0; // X oder + Formation |
+ EE_Parameter.I_Faktor = 0; |
+ EE_Parameter.UserParam1 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam2 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam3 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam4 = 0; //zur freien Verwendung |
+ EE_Parameter.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
+ EE_Parameter.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickRefresh = 5; |
+ EE_Parameter.LoopGasLimit = 50; |
+ EE_Parameter.LoopThreshold = 90; // Wert: 0-250 Schwelle für Stickausschlag |
+ EE_Parameter.LoopConfig = 0; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
+ memcpy(EE_Parameter.Name, "Sport\0", 12); |
+} |
+ |
+void DefaultKonstanten2(void) |
+{ |
+ EE_Parameter.Kanalbelegung[K_NICK] = 1; |
+ EE_Parameter.Kanalbelegung[K_ROLL] = 2; |
+ EE_Parameter.Kanalbelegung[K_GAS] = 3; |
+ EE_Parameter.Kanalbelegung[K_GIER] = 4; |
+ EE_Parameter.Kanalbelegung[K_POTI1] = 5; |
+ EE_Parameter.Kanalbelegung[K_POTI2] = 6; |
+ EE_Parameter.Kanalbelegung[K_POTI3] = 7; |
+ EE_Parameter.Kanalbelegung[K_POTI4] = 8; |
+ EE_Parameter.GlobalConfig = 0;//CFG_HOEHENREGELUNG | /*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV;//0x01; |
+ EE_Parameter.Hoehe_MinGas = 30; |
+ EE_Parameter.MaxHoehe = 251; // Wert : 0-32 251 -> Poti1 |
+ EE_Parameter.Hoehe_P = 10; // Wert : 0-32 |
+ EE_Parameter.Luftdruck_D = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_ACC_Wirkung = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_Verstaerkung = 2; // Wert : 0-50 |
+ EE_Parameter.Stick_P = 4; //2 // Wert : 1-6 |
+ EE_Parameter.Stick_D = 0; //8 // Wert : 0-64 |
+ EE_Parameter.Gier_P = 16; // Wert : 1-20 |
+ EE_Parameter.Gas_Min = 5; // Wert : 0-32 // (160607Kr) |
+ EE_Parameter.Gas_Max = 250; // Wert : 33-250 |
+ EE_Parameter.GyroAccFaktor = 26; // Wert : 1-64 |
+ EE_Parameter.KompassWirkung = 128; // Wert : 0-250 |
+ EE_Parameter.Gyro_P = 175; //80 // Wert : 0-250 |
+ EE_Parameter.Gyro_I = 175; // Wert : 0-250 |
+ EE_Parameter.UnterspannungsWarnung = 95; // Wert : 0-250 // (160607Kr) |
+ EE_Parameter.NotGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
+ EE_Parameter.NotGasZeit = 20; // Wert : 0-250 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen |
+ EE_Parameter.UfoAusrichtung = 0; // X oder + Formation |
+ EE_Parameter.I_Faktor = 0; |
+ EE_Parameter.UserParam1 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam2 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam3 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam4 = 0; //zur freien Verwendung |
+ EE_Parameter.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
+ EE_Parameter.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickRefresh = 5; |
+ EE_Parameter.LoopGasLimit = 50; |
+ EE_Parameter.LoopThreshold = 90; // Wert: 0-250 Schwelle für Stickausschlag |
+ EE_Parameter.LoopConfig = 0; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts |
+ memcpy(EE_Parameter.Name, "Kamera\0", 12); |
+} |
+ |
+ |
+//############################################################################ |
+// Trägt ggf. das Poti als Parameter ein |
+void ParameterZuordnung(void) |
+//############################################################################ |
+{ |
+ |
+ #define CHK_POTI(b,a,min,max) { if(a > 250) { if(a == 251) b = Poti1; else if(a == 252) b = Poti2; else if(a == 253) b = Poti3; else if(a == 254) b = Poti4;} else b = a; if(b <= min) b = min; else if(b >= max) b = max;} |
+ CHK_POTI(Parameter_MaxHoehe,EE_Parameter.MaxHoehe,0,255); |
+ CHK_POTI(Parameter_Luftdruck_D,EE_Parameter.Luftdruck_D,0,100); |
+ CHK_POTI(Parameter_Hoehe_P,EE_Parameter.Hoehe_P,0,100); |
+ CHK_POTI(Parameter_Hoehe_ACC_Wirkung,EE_Parameter.Hoehe_ACC_Wirkung,0,255); |
+ CHK_POTI(Parameter_KompassWirkung,EE_Parameter.KompassWirkung,0,255); |
+ CHK_POTI(Parameter_Gyro_P,EE_Parameter.Gyro_P,10,255); |
+ CHK_POTI(Parameter_Gyro_I,EE_Parameter.Gyro_I,0,255); |
+ CHK_POTI(Parameter_I_Faktor,EE_Parameter.I_Faktor,0,255); |
+ CHK_POTI(Parameter_UserParam1,EE_Parameter.UserParam1,0,255); |
+ CHK_POTI(Parameter_UserParam2,EE_Parameter.UserParam2,0,255); |
+ CHK_POTI(Parameter_UserParam3,EE_Parameter.UserParam3,0,255); |
+ CHK_POTI(Parameter_UserParam4,EE_Parameter.UserParam4,0,255); |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ CHK_POTI(Parameter_LoopGasLimit,EE_Parameter.LoopGasLimit,0,255); |
+ |
+ Ki = (float) Parameter_I_Faktor * 0.0001; |
+ MAX_GAS = EE_Parameter.Gas_Max; |
+ MIN_GAS = EE_Parameter.Gas_Min; |
+} |
+ |
+ |
+//############################################################################ |
+// |
+void MotorRegler(void) |
+//############################################################################ |
+{ |
+ int motorwert,pd_ergebnis,h,tmp_int; |
+ int GierMischanteil,GasMischanteil; |
+ static long SummeNick=0,SummeRoll=0; |
+ static long sollGier = 0,tmp_long,tmp_long2; |
+ long IntegralFehlerNick = 0; |
+ long IntegralFehlerRoll = 0; |
+ static unsigned int RcLostTimer; |
+ static unsigned char delay_neutral = 0; |
+ static unsigned char delay_einschalten = 0,delay_ausschalten = 0; |
+ static unsigned int modell_fliegt = 0; |
+ static int hoehenregler = 0; |
+ static char TimerWerteausgabe = 0; |
+ static char NeueKompassRichtungMerken = 0; |
+ Mittelwert(); |
+ |
+ GRN_ON; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gaswert ermitteln |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ GasMischanteil = PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] + 120; |
+ if(GasMischanteil < 0) GasMischanteil = 0; |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Emfang schlecht |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(SenderOkay < 100) |
+ { |
+ if(!PcZugriff) |
+ { |
+ if(BeepMuster == 0xffff) |
+ { |
+ beeptime = 15000; |
+ BeepMuster = 0x0c00; |
+ } |
+ } |
+ if(RcLostTimer) RcLostTimer--; |
+ else |
+ { |
+ MotorenEin = 0; |
+ Notlandung = 0; |
+ } |
+ ROT_ON; |
+ if(modell_fliegt > 2000) // wahrscheinlich in der Luft --> langsam absenken |
+ { |
+ GasMischanteil = EE_Parameter.NotGas; |
+ Notlandung = 1; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] = 0; |
+ } |
+ else MotorenEin = 0; |
+ } |
+ else |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Emfang gut |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(SenderOkay > 140) |
+ { |
+ Notlandung = 0; |
+ RcLostTimer = EE_Parameter.NotGasZeit * 50; |
+ if(GasMischanteil > 40) |
+ { |
+ if(modell_fliegt < 0xffff) modell_fliegt++; |
+ modell_fliegt_gps = modell_fliegt;// (030907Kr) |
+ } |
+ if((modell_fliegt < 200) || (GasMischanteil < 40)) |
+ { |
+ SummeNick = 0; |
+ SummeRoll = 0; |
+ Mess_Integral_Gier = 0; |
+ Mess_Integral_Gier2 = 0; |
+ } |
+ if((GasMischanteil > 200) && MotorenEin == 0) |
+ { |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// auf Nullwerte kalibrieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) // Neutralwerte |
+ { |
+ unsigned char setting; |
+ if(++delay_neutral > 200) // nicht sofort |
+ { |
+ GRN_OFF; |
+ MotorenEin = 0; |
+ delay_neutral = 0; |
+ modell_fliegt = 0; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70 || abs(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]) > 70) |
+ { |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < 70) setting = 1; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 2; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] < 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 3; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] <-70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 4; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] <-70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < 70) setting = 5; |
+ eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], setting); // aktiven Datensatz merken |
+ } |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
+ { |
+ if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset(); |
+ } |
+ ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
+ SetNeutral(); |
+ Piep(GetActiveParamSetNumber()); |
+ } |
+ } |
+ else delay_neutral = 0; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gas ist unten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(GasMischanteil < 35) |
+ { |
+ // Starten |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] < -75) |
+ { |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Einschalten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(++delay_einschalten > 200) |
+ { |
+ delay_einschalten = 200; |
+ modell_fliegt = 1; |
+ MotorenEin = 1; |
+ sollGier = 0; |
+ Mess_Integral_Gier = 0; |
+ Mess_Integral_Gier2 = 0; |
+ Mess_IntegralNick = 0; |
+ Mess_IntegralRoll = 0; |
+ Mess_IntegralNick2 = IntegralNick; |
+ Mess_IntegralRoll2 = IntegralRoll; |
+ SummeNick = 0; |
+ SummeRoll = 0; |
+ } |
+ } |
+ else delay_einschalten = 0; |
+ //Auf Neutralwerte setzen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Auschalten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) |
+ { |
+ if(++delay_ausschalten > 200) // nicht sofort |
+ { |
+ MotorenEin = 0; |
+ delay_ausschalten = 200; |
+ modell_fliegt = 0; |
+ } |
+ } |
+ else delay_ausschalten = 0; |
+ } |
+ } |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// neue Werte von der Funke |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(!NewPpmData-- || Notlandung) |
+ { |
+ ParameterZuordnung(); |
+ StickNick = PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_P; |
+ StickNick += PPM_diff[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_D; |
+ StickRoll = PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_P; |
+ StickRoll += PPM_diff[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_D; |
+ StickGier = -PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]; |
+ GyroFaktor = ((float)Parameter_Gyro_P + 10.0) / 256.0; |
+ IntegralFaktor = ((float) Parameter_Gyro_I) / 44000; |
+ |
+ if(EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) IntegralFaktor = 0; |
+ if(GyroFaktor < 0) GyroFaktor = 0; |
+ if(IntegralFaktor < 0) IntegralFaktor = 0; |
+ // greift in den Stick ein, um ungewolltes überschlagen zu verhindern |
+ if(!(EE_Parameter.LoopConfig & CFG_LOOP_LINKS) && !(EE_Parameter.LoopConfig & CFG_LOOP_RECHTS)) |
+ { |
+ if(IntegralNick > 60000) |
+ { |
+ StickNick -= 8 * EE_Parameter.Stick_P; |
+ if(IntegralNick > 80000) StickNick -= 16 * EE_Parameter.Stick_P; |
+ } |
+ else |
+ if(IntegralNick < -60000) |
+ { |
+ StickNick += 8 * EE_Parameter.Stick_P; |
+ if(IntegralNick > 80000) StickNick -= 16 * EE_Parameter.Stick_P; |
+ } |
+ if(IntegralRoll > 60000) |
+ { |
+ StickRoll -= 8 * EE_Parameter.Stick_P; |
+ if(IntegralRoll > 80000) StickRoll -= 16 * EE_Parameter.Stick_P; |
+ } |
+ else |
+ if(IntegralRoll < -60000) |
+ { |
+ StickRoll += 8 * EE_Parameter.Stick_P; |
+ if(IntegralRoll > 80000) StickRoll -= 16 * EE_Parameter.Stick_P; |
+ } |
+ } |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// LED Stuff |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+LED1_OFF; |
+ |
+ if(blinkcount_LED1 >= Parameter_UserParam4 && Parameter_UserParam4 > 0) |
+ { |
+ LED1_FLASH; |
+ blinkcount_LED1 = 0; |
+ } |
+ |
+ blinkcount_LED1++; |
+ |
+ //if(PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] > 75) LED1_ON; else LED1_OFF; //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
+ //if(PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] > 75) LED2_ON; else LED2_OFF; //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
+ } |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Looping? |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(((PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > EE_Parameter.LoopThreshold) && EE_Parameter.LoopConfig & CFG_LOOP_LINKS) || |
+ ((PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] < -EE_Parameter.LoopThreshold) && EE_Parameter.LoopConfig & CFG_LOOP_RECHTS)) |
+ { |
+ Looping_Roll = 1; |
+ if(GasMischanteil > EE_Parameter.LoopGasLimit) GasMischanteil = EE_Parameter.LoopGasLimit; |
+ } |
+ else Looping_Roll = 0; |
+ |
+ if(((PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > EE_Parameter.LoopThreshold) && EE_Parameter.LoopConfig & CFG_LOOP_OBEN) || |
+ ((PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < -EE_Parameter.LoopThreshold) && EE_Parameter.LoopConfig & CFG_LOOP_UNTEN)) |
+ { |
+ Looping_Nick = 1; |
+ Looping_Roll = 0; |
+ if(GasMischanteil > EE_Parameter.LoopGasLimit) GasMischanteil = EE_Parameter.LoopGasLimit; |
+ } |
+ else Looping_Nick = 0; |
+ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Bei Empfangsausfall im Flug |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(Notlandung) |
+ { |
+ StickGier = 0; |
+ StickNick = 0; |
+ StickRoll = 0; |
+ GyroFaktor = 0.1; |
+ IntegralFaktor = 0.005; |
+ Looping_Roll = 0; |
+ Looping_Nick = 0; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gyro-Drift kompensieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define DRIFT_FAKTOR 3 |
+ if(ZaehlMessungen >= 1000 / DRIFT_FAKTOR) |
+ { |
+ IntegralFehlerNick = IntegralNick2 - IntegralNick; |
+ IntegralFehlerRoll = IntegralRoll2 - IntegralRoll; |
+ ZaehlMessungen = 0; |
+ if(IntegralFehlerNick > 500/DRIFT_FAKTOR) AdNeutralNick++; |
+ if(IntegralFehlerNick < -500/DRIFT_FAKTOR) AdNeutralNick--; |
+ if(IntegralFehlerRoll > 500/DRIFT_FAKTOR) AdNeutralRoll++; |
+ if(IntegralFehlerRoll < -500/DRIFT_FAKTOR) AdNeutralRoll--; |
+// if(Mess_Integral_Gier2 > 500/DRIFT_FAKTOR) AdNeutralGier--; // macht nur mit Referenz (Kompass Sinn) |
+// if(Mess_Integral_Gier2 <-500/DRIFT_FAKTOR) AdNeutralGier++; // macht nur mit Referenz (Kompass Sinn) |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_IntegralNick2 = IntegralNick; |
+ Mess_IntegralRoll2 = IntegralRoll; |
+ Mess_Integral_Gier2 = Integral_Gier; |
+ ANALOG_ON; // ADC einschalten |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Integrale auf ACC-Signal abgleichen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+ |
+ if(EE_Parameter.GlobalConfig & CFG_GPS_AKTIV) |
+ { |
+ tmp_long = (long)(IntegralNick / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccNick) / 16; |
+ tmp_long2 = (long)(IntegralRoll / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccRoll) / 16; |
+ #define AUSGLEICH 500 |
+ if(tmp_long > AUSGLEICH) tmp_long = AUSGLEICH; |
+ if(tmp_long < -AUSGLEICH) tmp_long =-AUSGLEICH; |
+ if(tmp_long2 > AUSGLEICH) tmp_long2 = AUSGLEICH; |
+ if(tmp_long2 <-AUSGLEICH) tmp_long2 =-AUSGLEICH; |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_IntegralNick -= tmp_long; |
+ Mess_IntegralRoll -= tmp_long2; |
+ } |
+ |
+ else |
+ { |
+ if(IntegralFaktor && !Looping_Nick && !Looping_Roll) |
+ { |
+ tmp_long = (long)(IntegralNick / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccNick); |
+ if(labs(Mittelwert_AccNick) < 200) tmp_long /= 8; |
+ else tmp_long /= 16; |
+ tmp_long2 = (long)(IntegralRoll / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccRoll); |
+ if(labs(Mittelwert_AccRoll) < 200) tmp_long2 /= 8; |
+ else tmp_long2 /= 16; |
+ |
+ #define AUSGLEICH 500 |
+ if(tmp_long > AUSGLEICH) tmp_long = AUSGLEICH; |
+ if(tmp_long < -AUSGLEICH) tmp_long =-AUSGLEICH; |
+ if(tmp_long2 > AUSGLEICH) tmp_long2 = AUSGLEICH; |
+ if(tmp_long2 <-AUSGLEICH) tmp_long2 =-AUSGLEICH; |
+ } |
+ |
+ else |
+ { |
+ tmp_long = 0; |
+ tmp_long2 = 0; |
+ } |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_IntegralNick -= tmp_long; |
+ Mess_IntegralRoll -= tmp_long2; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(abs(StickGier) > 20) // war 35 |
+ { |
+ if(!(EE_Parameter.GlobalConfig & CFG_KOMPASS_FIX)) NeueKompassRichtungMerken = 1; |
+ } |
+ tmp_int = EE_Parameter.Gier_P * (StickGier * abs(StickGier)) / 512; // expo y = ax + bx² |
+ tmp_int += (EE_Parameter.Gier_P * StickGier) / 4; |
+ sollGier = tmp_int; |
+ Mess_Integral_Gier -= tmp_int; |
+ if(Mess_Integral_Gier > 25000) Mess_Integral_Gier = 25000; // begrenzen |
+ if(Mess_Integral_Gier <-25000) Mess_Integral_Gier =-25000; |
+ |
+ ANALOG_ON; // ADC einschalten |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Kompass |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+ if(KompassValue && (EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV)) |
+ { |
+ if(NeueKompassRichtungMerken) |
+ { |
+ KompassStartwert = KompassValue; |
+ NeueKompassRichtungMerken = 0; |
+ } |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_Integral_Gier -= (KompassRichtung * Parameter_KompassWirkung) / 32; // nach Kompass ausrichten |
+ ANALOG_ON; // ADC einschalten |
+ } |
+ |
+ |
+// if(KompassValue && (EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV)) |
+// { |
+// int w,v; |
+// static int SignalSchlecht = 0; |
+// w = abs(IntegralNick /512); // mit zunehmender Neigung den Einfluss drosseln |
+// v = abs(IntegralRoll /512); |
+// if(v > w) w = v; // grösste Neigung ermitteln |
+// if(w < 25 && NeueKompassRichtungMerken && !SignalSchlecht) |
+// { |
+// KompassStartwert = KompassValue; |
+// NeueKompassRichtungMerken = 0; |
+// } |
+// w = (w * Parameter_KompassWirkung) / 64; // auf die Wirkung normieren |
+// w = Parameter_KompassWirkung - w; // Wirkung ggf drosseln |
+// if(w > 0) |
+// { |
+// ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+// if(!SignalSchlecht) Mess_Integral_Gier += (KompassRichtung * w) / 32; // nach Kompass ausrichten |
+// ANALOG_ON; // ADC einschalten |
+// if(SignalSchlecht) SignalSchlecht--; |
+// } |
+// else SignalSchlecht = 500; // so lange das Signal taub stellen --> ca. 1 sek |
+// } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// GPS |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+if(EE_Parameter.GlobalConfig & CFG_GPS_AKTIV) |
+{ |
+ P_GPS_Verstaerkung = Parameter_UserParam1; |
+ D_GPS_Verstaerkung = Parameter_UserParam2; |
+ Limit_D_Anteil = Parameter_UserParam3; |
+ gps_main(); |
+} |
+else |
+{ |
+ GPS_Nick = 0; |
+ GPS_Roll = 0; |
+} |
+ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Debugwerte zuordnen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(!TimerWerteausgabe--) |
+ { |
+ TimerWerteausgabe = 49; |
+ DebugOut.Analog[0] = MM3.NickGrad; |
+ DebugOut.Analog[1] = MM3.RollGrad; |
+ DebugOut.Analog[2] = Mittelwert_AccNick; |
+ DebugOut.Analog[3] = Mittelwert_AccRoll; |
+ DebugOut.Analog[4] = MesswertGier; |
+ DebugOut.Analog[5] = HoehenWert; |
+ DebugOut.Analog[6] = (Mess_Integral_Hoch / 512); |
+ DebugOut.Analog[7] = GasMischanteil; |
+ DebugOut.Analog[8] = KompassValue; |
+ |
+//DebugOut.Analog[8] = MM3_heading(); |
+DebugOut.Analog[9] = MM3.x_axis; |
+DebugOut.Analog[10] = MM3.y_axis; |
+DebugOut.Analog[11] = MM3.z_axis; |
+ |
+ |
+// DebugOut.Analog[0] = actualPos.GPSFix; |
+// DebugOut.Analog[1] = GPS_Roll; |
+// DebugOut.Analog[2] = GPS_Nick; |
+// DebugOut.Analog[3] = GPS_Positionsabweichung_North; |
+// DebugOut.Analog[4] = GPS_Positionsabweichung_East; |
+// DebugOut.Analog[5] = P_Einfluss_East; |
+// DebugOut.Analog[6] = D_Einfluss_East; |
+// DebugOut.Analog[7] = P_Einfluss_North; |
+// DebugOut.Analog[8] = D_Einfluss_North; |
+// DebugOut.Analog[9] = Soll_Position_North; |
+// DebugOut.Analog[10] = Soll_Position_East; |
+// DebugOut.Analog[11] = Parameter_UserParam1; |
+ DebugOut.Analog[12] = Parameter_UserParam2; |
+ DebugOut.Analog[13] = Poti3; |
+ DebugOut.Analog[14] = KompassValue; |
+ DebugOut.Analog[15] = GPS_Home_North; |
+ DebugOut.Analog[16] = GPS_Home_East; |
+ DebugOut.Analog[17] = NORTH_MITTEL; |
+ DebugOut.Analog[18] = EAST_MITTEL; |
+ DebugOut.Analog[19] = actualPos.northing; |
+ DebugOut.Analog[20] = actualPos.easting; |
+ DebugOut.Analog[21] = actualPos.velNorth; |
+ DebugOut.Analog[22] = actualPos.velEast; |
+ DebugOut.Analog[23] = UBat; |
+ DebugOut.Analog[24] = (motor_rx[0]+motor_rx[1]+motor_rx[2]+motor_rx[3]); //Gesamtstrom |
+ DebugOut.Analog[25] = StickRoll; |
+ DebugOut.Analog[26] = HoehenWert; |
+ DebugOut.Analog[27] = IntegralNick / EE_Parameter.GyroAccFaktor; |
+ DebugOut.Analog[28] = IntegralRoll / EE_Parameter.GyroAccFaktor; |
+ DebugOut.Analog[29] = Mittelwert_AccNick; |
+ DebugOut.Analog[30] = Mittelwert_AccRoll; |
+ DebugOut.Analog[31] = StickNick; |
+ } |
+ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Drehgeschwindigkeit und -winkel zu einem Istwert zusammenfassen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(Looping_Nick) MesswertNick = MesswertNick * GyroFaktor; |
+ else MesswertNick = IntegralNick * IntegralFaktor + MesswertNick * GyroFaktor; |
+ if(Looping_Roll) MesswertRoll = MesswertRoll * GyroFaktor; |
+ else MesswertRoll = IntegralRoll * IntegralFaktor + MesswertRoll * GyroFaktor; |
+ MesswertGier = MesswertGier * (GyroFaktor/2) + Integral_Gier * IntegralFaktor; |
+ // MesswertGier = MesswertGier * (GyroFaktor) + Integral_Gier * IntegralFaktor/2; |
+ |
+ // Maximalwerte abfangen |
+ #define MAX_SENSOR 2048 |
+ if(MesswertNick > MAX_SENSOR) MesswertNick = MAX_SENSOR; |
+ if(MesswertNick < -MAX_SENSOR) MesswertNick = -MAX_SENSOR; |
+ if(MesswertRoll > MAX_SENSOR) MesswertRoll = MAX_SENSOR; |
+ if(MesswertRoll < -MAX_SENSOR) MesswertRoll = -MAX_SENSOR; |
+ if(MesswertGier > MAX_SENSOR) MesswertGier = MAX_SENSOR; |
+ if(MesswertGier < -MAX_SENSOR) MesswertGier = -MAX_SENSOR; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Höhenregelung |
+// Die Höhenregelung schwächt lediglich das Gas ab, erhöht es allerdings nicht |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+//OCR0B = 180 - (Poti1 + 120) / 4; |
+//DruckOffsetSetting = OCR0B; |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung |
+ { |
+ int tmp_int; |
+ if(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER) // Regler wird über Schalter gesteuert |
+ { |
+ if(Parameter_MaxHoehe < 50) |
+ { |
+ SollHoehe = HoehenWert - 40; // Parameter_MaxHoehe ist der PPM-Wert des Schalters // (160607Kr) |
+ HoehenReglerAktiv = 0; |
+ } |
+ else |
+ HoehenReglerAktiv = 1; |
+ } |
+ else |
+ { |
+ SollHoehe = Parameter_MaxHoehe * EE_Parameter.Hoehe_Verstaerkung - 40; // (160607Kr) |
+ HoehenReglerAktiv = 1; |
+ } |
+ |
+ if(Notlandung) SollHoehe = 0; |
+ h = HoehenWert; |
+ if((h > SollHoehe) && HoehenReglerAktiv) // zu hoch --> drosseln |
+ { h = ((h - SollHoehe) * (int) Parameter_Hoehe_P) / 16; // Differenz bestimmen --> P-Anteil |
+ h = GasMischanteil - h; // vom Gas abziehen |
+ h -= (HoeheD * Parameter_Luftdruck_D)/8; // D-Anteil |
+ tmp_int = ((Mess_Integral_Hoch / 512) * (signed long) Parameter_Hoehe_ACC_Wirkung) / 32; |
+ if(tmp_int > 50) tmp_int = 50; |
+ else if(tmp_int < -50) tmp_int = -50; |
+ h -= tmp_int; |
+ hoehenregler = (hoehenregler*15 + h) / 16; |
+ if(hoehenregler < EE_Parameter.Hoehe_MinGas) // nicht unter MIN |
+ { |
+ if(GasMischanteil >= EE_Parameter.Hoehe_MinGas) hoehenregler = EE_Parameter.Hoehe_MinGas; |
+ if(GasMischanteil < EE_Parameter.Hoehe_MinGas) hoehenregler = GasMischanteil; |
+ } |
+ if(hoehenregler > GasMischanteil) hoehenregler = GasMischanteil; // nicht mehr als Gas |
+ GasMischanteil = hoehenregler; |
+ } |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Mischer und PI-Regler |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ // DebugOut.Analog[7] = GasMischanteil; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gier-Anteil |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define MUL_G 1.0 |
+ GierMischanteil = MesswertGier - sollGier; // Regler für Gier |
+//GierMischanteil = 0; |
+ if(GierMischanteil > (MUL_G * GasMischanteil)) GierMischanteil = MUL_G * GasMischanteil; |
+ if(GierMischanteil < -(MUL_G * GasMischanteil)) GierMischanteil = -(MUL_G * GasMischanteil); |
+ if(GierMischanteil > 100) GierMischanteil = 100; |
+ if(GierMischanteil < -100) GierMischanteil = -100; |
+ |
+ if(GasMischanteil < 20) GierMischanteil = 0; |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Nick-Achse |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+ DiffNick = Kp * (MesswertNick - (StickNick - GPS_Nick)); // Differenz bestimmen |
+ SummeNick += DiffNick; // I-Anteil |
+ if(SummeNick > 0) SummeNick-= (abs(SummeNick)/256 + 1); else SummeNick += abs(SummeNick)/256 + 1; |
+ if(SummeNick > 16000) SummeNick = 16000; |
+ if(SummeNick < -16000) SummeNick = -16000; |
+ pd_ergebnis = DiffNick;// + Ki * SummeNick; // PI-Regler für Nick |
+ // Motor Vorn |
+#define MUL 2 |
+ if(pd_ergebnis > MUL * (GasMischanteil + abs(GierMischanteil))) pd_ergebnis = MUL * (GasMischanteil + abs(GierMischanteil)); |
+ if(pd_ergebnis < -MUL * (GasMischanteil + abs(GierMischanteil))) pd_ergebnis = -MUL * (GasMischanteil + abs(GierMischanteil)); |
+ |
+ motorwert = GasMischanteil + pd_ergebnis + GierMischanteil; // Mischer |
+ if ((motorwert < 0)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Vorne = motorwert; |
+ // Motor Heck |
+ motorwert = GasMischanteil - pd_ergebnis + GierMischanteil; |
+ if ((motorwert < 0)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Hinten = motorwert; |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Roll-Achse |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ DiffRoll = Kp * (MesswertRoll - (StickRoll - GPS_Roll)); // Differenz bestimmen |
+ SummeRoll += DiffRoll; // I-Anteil |
+ if(SummeRoll > 0) SummeRoll-= (abs(SummeRoll)/256 + 1); else SummeRoll += abs(SummeRoll)/256 + 1; |
+ if(SummeRoll > 16000) SummeRoll = 16000; |
+ if(SummeRoll < -16000) SummeRoll = -16000; |
+ pd_ergebnis = DiffRoll;// + Ki * SummeRoll; // PI-Regler für Roll |
+ if(pd_ergebnis > MUL * (GasMischanteil + abs(GierMischanteil))) pd_ergebnis = MUL * (GasMischanteil + abs(GierMischanteil)); |
+ if(pd_ergebnis < -MUL * (GasMischanteil + abs(GierMischanteil))) pd_ergebnis = -MUL * (GasMischanteil + abs(GierMischanteil)); |
+ // Motor Links |
+ motorwert = GasMischanteil + pd_ergebnis - GierMischanteil; |
+ if ((motorwert < 0)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Links = motorwert; |
+ // Motor Rechts |
+ motorwert = GasMischanteil - pd_ergebnis - GierMischanteil; |
+ if ((motorwert < 0)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Rechts = motorwert; |
+ // +++++++++++++++++++++++++++++++++++++++++++++++ |
+} |
+ |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/fc.h |
---|
0,0 → 1,121 |
/*####################################################################################### |
Flight Control |
#######################################################################################*/ |
#ifndef _FC_H |
#define _FC_H |
extern volatile unsigned int I2CTimeout; |
extern unsigned char Sekunde,Minute; |
extern volatile long IntegralNick,IntegralNick2; |
extern volatile long IntegralRoll,IntegralRoll2; |
extern volatile long Mess_IntegralNick,Mess_IntegralNick2; |
extern volatile long Mess_IntegralRoll,Mess_IntegralRoll2; |
extern volatile long Mess_Integral_Hoch; |
extern volatile long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2; |
extern volatile int KompassValue; |
extern volatile int KompassStartwert; |
extern volatile int KompassRichtung; |
extern int HoehenWert; |
extern int SollHoehe; |
extern volatile int MesswertNick,MesswertRoll,MesswertGier; |
extern volatile int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll; |
extern volatile int NeutralAccX, NeutralAccY,Mittelwert_AccHoch; |
extern volatile float NeutralAccZ; |
extern unsigned int modell_fliegt_gps;//(030907Kr) |
extern unsigned char Limit_D_Anteil;//(210907Kr) |
void MotorRegler(void); |
void SendMotorData(void); |
void CalibrierMittelwert(void); |
void Mittelwert(void); |
void SetNeutral(void); |
unsigned char h,m,s; |
volatile unsigned char Timeout ; |
unsigned char CosinusNickWinkel, CosinusRollWinkel; |
volatile long IntegralNick,IntegralNick2; |
volatile long IntegralRoll,IntegralRoll2; |
volatile long Integral_Gier; |
volatile long Mess_IntegralNick,Mess_IntegralNick2; |
volatile long Mess_IntegralRoll,Mess_IntegralRoll2; |
volatile long Mess_Integral_Gier; |
volatile int DiffNick,DiffRoll; |
extern int Poti1, Poti2, Poti3, Poti4, Poti5, Poti6, Poti7, Poti8; //PPM24-Erweiterung (121007Kr) |
volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
unsigned char MotorWert[5]; |
volatile unsigned char SenderOkay; |
int StickNick,StickRoll,StickGier; |
char MotorenEin; |
extern void DefaultKonstanten(void); |
#define STRUCT_PARAM_LAENGE 58 |
struct mk_param_struct |
{ |
unsigned char Kanalbelegung[8]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3 |
unsigned char GlobalConfig; // 0x01=Höhenregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv |
unsigned char Hoehe_MinGas; // Wert : 0-100 |
unsigned char Luftdruck_D; // Wert : 0-250 |
unsigned char MaxHoehe; // Wert : 0-32 |
unsigned char Hoehe_P; // Wert : 0-32 |
unsigned char Hoehe_Verstaerkung; // Wert : 0-50 |
unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250 |
unsigned char Stick_P; // Wert : 1-6 |
unsigned char Stick_D; // Wert : 0-64 |
unsigned char Gier_P; // Wert : 1-20 |
unsigned char Gas_Min; // Wert : 0-32 |
unsigned char Gas_Max; // Wert : 33-250 |
unsigned char GyroAccFaktor; // Wert : 1-64 |
unsigned char KompassWirkung; // Wert : 0-32 |
unsigned char Gyro_P; // Wert : 10-250 |
unsigned char Gyro_I; // Wert : 0-250 |
unsigned char UnterspannungsWarnung; // Wert : 0-250 |
unsigned char NotGas; // Wert : 0-250 //Gaswert bei Empängsverlust |
unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen |
unsigned char UfoAusrichtung; // X oder + Formation |
unsigned char I_Faktor; // Wert : 0-250 |
unsigned char UserParam1; // Wert : 0-250 |
unsigned char UserParam2; // Wert : 0-250 |
unsigned char UserParam3; // Wert : 0-250 |
unsigned char UserParam4; // Wert : 0-250 |
unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos |
unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo |
unsigned char ServoNickMin; // Wert : 0-250 // Anschlag |
unsigned char ServoNickMax; // Wert : 0-250 // Anschlag |
unsigned char ServoNickRefresh; // |
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping |
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag |
//------------------------------------------------ |
unsigned char LoopConfig; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen |
unsigned char Reserved[4]; |
char Name[12]; |
}; |
/* |
unsigned char ServoNickMax; // Wert : 0-250 |
unsigned char ServoNickRefresh; // |
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping |
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag |
//------------------------------------------------ |
unsigned char LoopConfig; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen |
unsigned char Reserved[4]; |
char Name[12]; |
*/ |
extern struct mk_param_struct EE_Parameter; |
extern unsigned char Parameter_Luftdruck_D; |
extern unsigned char Parameter_MaxHoehe; |
extern unsigned char Parameter_Hoehe_P; |
extern unsigned char Parameter_Hoehe_ACC_Wirkung; |
extern unsigned char Parameter_KompassWirkung; |
extern unsigned char Parameter_Gyro_P; |
extern unsigned char Parameter_Gyro_I; |
extern unsigned char Parameter_Gier_P; |
extern unsigned char Parameter_ServoNickControl; |
#endif //_FC_H |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/flight-ctrl_mega644_v0_64.aws |
---|
0,0 → 1,0 |
<AVRWorkspace><IOSettings><CurrentRegisters/></IOSettings><part name="ATMEGA644"/><Files><File00000 Name="E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v064JokoGPSNick666Acc\main.c" Position="341 108 873 484" LineCol="155 0" State="Maximized"/><File00001 Name="E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v064JokoGPSNick666Acc\compass.c" Position="327 65 1039 618" LineCol="25 0" State="Maximized"/><File00002 Name="E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v064JokoGPSNick666Acc\compass.h" Position="362 126 908 494" LineCol="0 0" State="Maximized"/><File00003 Name="E:\hubi\ufo\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v064JokoGPSNick666Acc\fc.c" Position="336 71 1182 830" LineCol="834 0" State="Maximized"/></Files></AVRWorkspace> |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/flight.pnproj |
---|
0,0 → 1,0 |
<Project name="Flight-Ctrl"><File path="uart.h"></File><File path="main.c"></File><File path="main.h"></File><File path="makefile"></File><File path="uart.c"></File><File path="printf_P.h"></File><File path="printf_P.c"></File><File path="timer0.c"></File><File path="timer0.h"></File><File path="old_macros.h"></File><File path="twimaster.c"></File><File path="version.txt"></File><File path="twimaster.h"></File><File path="rc.c"></File><File path="rc.h"></File><File path="fc.h"></File><File path="fc.c"></File><File path="menu.h"></File><File path="menu.c"></File><File path="_Settings.h"></File><File path="analog.c"></File><File path="analog.h"></File><File path="GPS.c"></File><File path="gps.h"></File><File path="License.txt"></File></Project> |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/flight.pnps |
---|
0,0 → 1,0 |
<pd><ViewState><e p="Flight-Ctrl" x="true"></e></ViewState></pd> |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/gps.h |
---|
0,0 → 1,26 |
extern long P_Einfluss_North; |
extern long D_Einfluss_North; |
extern long P_Einfluss_East; |
extern long D_Einfluss_East; |
extern long GPS_Positionsabweichung_North; |
extern long GPS_Positionsabweichung_East; |
extern long GPS_Geschwindigkeit_North; |
extern long GPS_Geschwindigkeit_East; |
extern long GPS_Home_North; |
extern long GPS_Home_East; |
extern long Soll_Position_North; |
extern long Soll_Position_East; |
extern volatile long EAST_MITTEL; |
extern volatile long NORTH_MITTEL; |
extern signed int GPS_Nick; |
extern signed int GPS_Roll; |
extern void GPS_Neutral(void); |
extern void GPS_BerechneZielrichtung(void); |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/main.c |
---|
0,0 → 1,229 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + Nur für den privaten Gebrauch |
// + www.MikroKopter.com |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
// + dass eine Nutzung (auch auszugsweise) nur für den privaten und nicht-kommerziellen Gebrauch zulässig ist. |
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
// + bzgl. der Nutzungsbedingungen aufzunehmen. |
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
// + Verkauf von Luftbildaufnahmen, usw. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
// + auf anderen Webseiten oder Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
// + eindeutig als Ursprung verlinkt und genannt werden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
// + Benutzung auf eigene Gefahr |
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
// + mit unserer Zustimmung zulässig |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
// + this list of conditions and the following disclaimer. |
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
// + from this software without specific prior written permission. |
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
// + for non-commercial use (directly or indirectly) |
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
// + with our written permission |
// + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
// + clearly linked as origin |
// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
unsigned char EEPromArray[E2END+1] EEMEM; |
unsigned char PlatinenVersion = 10; |
// -- Parametersatz aus EEPROM lesen --- |
// number [0..5] |
void ReadParameterSet(unsigned char number, unsigned char *buffer, unsigned char length) |
{ |
if (number > 5) number = 5; |
eeprom_read_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * number], length); |
} |
// -- Parametersatz ins EEPROM schreiben --- |
// number [0..5] |
void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length) |
{ |
if(number > 5) number = 5; |
eeprom_write_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * number], length); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], number); // diesen Parametersatz als aktuell merken |
} |
unsigned char GetActiveParamSetNumber(void) |
{ |
unsigned char set; |
set = eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET]); |
if(set > 5) |
{ |
set = 2; |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], set); // diesen Parametersatz als aktuell merken |
} |
return(set); |
} |
//############################################################################ |
//Hauptprogramm |
int main (void) |
//############################################################################ |
{ |
unsigned int timer; |
unsigned int timer2 = 0; |
DDRB = 0x00; |
PORTB = 0x00; |
for(timer = 0; timer < 1000; timer++); // verzögern |
if(PINB & 0x01) PlatinenVersion = 11; else PlatinenVersion = 10; |
DDRC = 0x81; // SCL |
PORTC = 0xff; // Pullup SDA |
DDRB = 0x1B; // LEDs und Druckoffset |
PORTB = 0x01; // LED_Rot |
DDRD = 0x3E; // Speaker & TXD & J3 J4 J5 |
DDRD |=0x80; // J7 |
PORTD = 0xF7; // LED |
MCUSR &=~(1<<WDRF); |
WDTCSR |= (1<<WDCE)|(1<<WDE); |
WDTCSR = 0; |
beeptime = 2000; |
StickGier = 0; PPM_in[K_GAS] = 0;StickRoll = 0; StickNick = 0; |
ROT_OFF; |
Timer_Init(); |
UART_Init(); |
rc_sum_init(); |
ADC_Init(); |
i2c_init(); |
init_spi(); |
sei(); |
VersionInfo.Hauptversion = VERSION_HAUPTVERSION; |
VersionInfo.Nebenversion = VERSION_NEBENVERSION; |
VersionInfo.PCKompatibel = VERSION_KOMPATIBEL; |
printf("\n\rFlightControl\n\rHardware:%d.%d\n\rSoftware:V%d.%d ",PlatinenVersion/10,PlatinenVersion%10, VERSION_HAUPTVERSION, VERSION_NEBENVERSION); |
printf("\n\r=============================="); |
GRN_ON; |
#define EE_DATENREVISION 62 // wird angepasst, wenn sich die EEPROM-Daten geändert haben |
if(eeprom_read_byte(&EEPromArray[EEPROM_ADR_VALID]) != EE_DATENREVISION) |
{ |
printf("\n\rInit. EEPROM: Generiere Default-Parameter..."); |
DefaultKonstanten1(); |
for (unsigned char i=0;i<6;i++) |
{ |
if(i==2) DefaultKonstanten2(); |
WriteParameterSet(i, (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
} |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], 2); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_VALID], EE_DATENREVISION); |
} |
ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
printf("\n\rBenutze Parametersatz %d", GetActiveParamSetNumber()); |
if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
printf("\n\rAbgleich Luftdrucksensor.."); |
timer = SetDelay(1000); |
SucheLuftruckOffset(); |
while (!CheckDelay(timer)); |
printf("OK\n\r"); |
} |
SetNeutral(); |
ROT_OFF; |
beeptime = 2000; |
DebugIn.Analog[1] = 1000; |
DebugIn.Digital[0] = 0x55; |
printf("\n\rSteuerung: "); |
if (EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) printf("HeadingHold"); |
else printf("Neutral"); |
printf("\n\n\r"); |
LcdClear(); |
I2CTimeout = 5000; |
while (1) |
{ |
if (UpdateMotor) // ReglerIntervall |
{ |
UpdateMotor=0; |
MotorRegler(); |
SendMotorData(); |
ROT_OFF; |
if(PcZugriff) PcZugriff--; |
if(SenderOkay) SenderOkay--; |
if(!I2CTimeout) |
{ |
I2CTimeout = 5; |
i2c_reset(); |
if((BeepMuster == 0xffff) && MotorenEin) |
{ |
beeptime = 10000; |
BeepMuster = 0x0080; |
} |
} |
else |
{ |
I2CTimeout--; |
ROT_OFF; |
} |
} |
if(SIO_DEBUG) |
{ |
DatenUebertragung(); |
BearbeiteRxDaten(); |
} |
else BearbeiteRxDaten(); |
if(CheckDelay(timer)) |
{ |
if(UBat < EE_Parameter.UnterspannungsWarnung) |
{ |
if(BeepMuster == 0xffff) |
{ |
beeptime = 6000; |
BeepMuster = 0x0300; |
} |
} |
timer = SetDelay(100); |
} |
} |
return (1); |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/main.h |
---|
0,0 → 1,111 |
#ifndef _MAIN_H |
#define _MAIN_H |
//Hier die Quarz Frequenz einstellen |
#if defined (__AVR_ATmega32__) |
#define SYSCLK 20000000L //Quarz Frequenz in Hz |
#endif |
#if defined (__AVR_ATmega644__) |
#define SYSCLK 20000000L //Quarz Frequenz in Hz |
//#define SYSCLK 16000000L //Quarz Frequenz in Hz |
#endif |
// neue Hardware |
#define ROT_OFF {if(PlatinenVersion == 10) PORTB &=~0x01; else PORTB |= 0x01;} |
#define ROT_ON {if(PlatinenVersion == 10) PORTB |= 0x01; else PORTB &=~0x01;} |
#define ROT_FLASH PORTB ^= 0x01 |
#define GRN_OFF PORTB &=~0x02 |
#define GRN_ON PORTB |= 0x02 |
#define GRN_FLASH PORTB ^= 0x02 |
#define LED1_OFF PORTC &=~0x04 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED1_ON PORTC |= 0x04 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED1_FLASH PORTC ^= 0x04 //Erweiterung by 4ndreas aus mikrosvn branches // (280807Kr) |
#define LED2_OFF PORTC &=~0x08 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED2_ON PORTC |= 0x08 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED2_FLASH PORTC ^= 0x08 //Erweiterung by 4ndreas aus mikrosvn branches // (280807Kr) |
//#ifndef F_CPU |
//#error ################## F_CPU nicht definiert oder ungültig ############# |
//#endif |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//#define ANZ_MITTELWERT 4 |
#define EEPROM_ADR_VALID 1 |
#define EEPROM_ADR_ACTIVE_SET 2 |
#define EEPROM_ADR_LAST_OFFSET 3 |
#define EEPROM_ADR_PARAM_BEGIN 100 |
#define CFG_HOEHENREGELUNG 0x01 |
#define CFG_HOEHEN_SCHALTER 0x02 |
#define CFG_HEADING_HOLD 0x04 |
#define CFG_KOMPASS_AKTIV 0x08 |
#define CFG_KOMPASS_FIX 0x10 |
#define CFG_GPS_AKTIV 0x20 |
#define CFG_LOOP_OBEN 0x01 |
#define CFG_LOOP_UNTEN 0x02 |
#define CFG_LOOP_LINKS 0x04 |
#define CFG_LOOP_RECHTS 0x08 |
//#define SYSCLK |
//extern unsigned long SYSCLK; |
extern volatile int i_Nick[20],i_Roll[20],DiffNick,DiffRoll; |
extern volatile unsigned char SenderOkay; |
extern unsigned char CosinusNickWinkel, CosinusRollWinkel; |
extern unsigned char PlatinenVersion; |
extern void ReadParameterSet (unsigned char number, unsigned char *buffer, unsigned char length); |
extern void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length); |
extern unsigned char GetActiveParamSetNumber(void); |
extern unsigned char EEPromArray[]; |
long durchschnitt_northing; |
long durchschnitt_easting; |
volatile int P_GPS_Verstaerkung; //P-Anteil (80-120) |
volatile int D_GPS_Verstaerkung; //D-Anteil (90) |
#include <stdlib.h> |
#include <string.h> |
#include <avr/io.h> |
#include <avr/pgmspace.h> |
#include <avr/interrupt.h> |
#include <avr/eeprom.h> |
#include <avr/boot.h> |
#include <avr/wdt.h> |
#include "old_macros.h" |
#include "_settings.h" |
#include "printf_P.h" |
#include "timer0.h" |
#include "uart.h" |
#include "analog.h" |
#include "twimaster.h" |
#include "menu.h" |
#include "rc.h" |
#include "fc.h" |
#include "gps.h" |
#include "compass.h" |
#include "math.h" |
#ifndef EEMEM |
#define EEMEM __attribute__ ((section (".eeprom"))) |
#endif |
#define DEBUG_DISPLAY_INTERVALL 123 // in ms |
#define DELAY_US(x) ((unsigned int)( (x) * 1e-6 * F_CPU )) |
#endif //_MAIN_H |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/makefile |
---|
0,0 → 1,391 |
#-------------------------------------------------------------------- |
# MCU name |
MCU = atmega644 |
F_CPU = 20000000 |
#------------------------------------------------------------------- |
HAUPT_VERSION = 0 |
NEBEN_VERSION = 64 |
VERSION_KOMPATIBEL = 5 # PC-Kompatibilität |
#------------------------------------------------------------------- |
ifeq ($(MCU), atmega32) |
# FUSE_SETTINGS= -u -U lfuse:w:0xff:m -U hfuse:w:0xcf:m |
HEX_NAME = MEGA32 |
endif |
ifeq ($(MCU), atmega644) |
FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
#FUSE_SETTINGS = -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
# -u bei neuen Controllern wieder einspielen |
HEX_NAME = MEGA644 |
endif |
ifeq ($(F_CPU), 16000000) |
QUARZ = 16MHZ |
endif |
ifeq ($(F_CPU), 20000000) |
QUARZ = 20MHZ |
endif |
# Output format. (can be srec, ihex, binary) |
FORMAT = ihex |
# Target file name (without extension). |
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION) |
# Optimization level, can be [0, 1, 2, 3, s]. 0 turns off optimization. |
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.) |
OPT = s |
########################################################################################################## |
# List C source files here. (C dependencies are automatically generated.) |
SRC = main.c uart.c printf_P.c timer0.c analog.c menu.c |
SRC += twimaster.c rc.c fc.c GPS.c compass.c math.c |
########################################################################################################## |
# List Assembler source files here. |
# Make them always end in a capital .S. Files ending in a lowercase .s |
# will not be considered source files but generated files (assembler |
# output from the compiler), and will be deleted upon "make clean"! |
# Even though the DOS/Win* filesystem matches both .s and .S the same, |
# it will preserve the spelling of the filenames, and gcc itself does |
# care about how the name is spelled on its command-line. |
ASRC = |
# List any extra directories to look for include files here. |
# Each directory must be seperated by a space. |
EXTRAINCDIRS = |
# Optional compiler flags. |
# -g: generate debugging information (for GDB, or for COFF conversion) |
# -O*: optimization level |
# -f...: tuning, see gcc manual and avr-libc documentation |
# -Wall...: warning level |
# -Wa,...: tell GCC to pass this to the assembler. |
# -ahlms: create assembler listing |
CFLAGS = -O$(OPT) \ |
-funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums \ |
-Wall -Wstrict-prototypes \ |
-Wa,-adhlns=$(<:.c=.lst) \ |
$(patsubst %,-I%,$(EXTRAINCDIRS)) |
# Set a "language standard" compiler flag. |
# Unremark just one line below to set the language standard to use. |
# gnu99 = C99 + GNU extensions. See GCC manual for more information. |
#CFLAGS += -std=c89 |
#CFLAGS += -std=gnu89 |
#CFLAGS += -std=c99 |
CFLAGS += -std=gnu99 |
CFLAGS += -DVERSION_HAUPTVERSION=$(HAUPT_VERSION) -DVERSION_NEBENVERSION=$(NEBEN_VERSION) -DVERSION_KOMPATIBEL=$(VERSION_KOMPATIBEL) |
# Optional assembler flags. |
# -Wa,...: tell GCC to pass this to the assembler. |
# -ahlms: create listing |
# -gstabs: have the assembler create line number information; note that |
# for use in COFF files, additional information about filenames |
# and function names needs to be present in the assembler source |
# files -- see avr-libc docs [FIXME: not yet described there] |
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs |
# Optional linker flags. |
# -Wl,...: tell GCC to pass this to linker. |
# -Map: create map file |
# --cref: add cross reference to map file |
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref |
# Additional libraries |
# Minimalistic printf version |
#LDFLAGS += -Wl,-u,vfprintf -lprintf_min |
# Floating point printf version (requires -lm below) |
#LDFLAGS += -Wl,-u,vfprintf -lprintf_flt |
# -lm = math library |
LDFLAGS += -lm |
##LDFLAGS += -T./linkerfile/avr5.x |
# Programming support using avrdude. Settings and variables. |
# Programming hardware: alf avr910 avrisp bascom bsd |
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500 |
# |
# Type: avrdude -c ? |
# to get a full listing. |
# |
#AVRDUDE_PROGRAMMER = stk200 |
AVRDUDE_PROGRAMMER = dt006 |
#AVRDUDE_PROGRAMMER = ponyser |
#falls Ponyser ausgewählt wird, muss sich unsere avrdude-Configdatei im Bin-Verzeichnis des Compilers befinden |
#AVRDUDE_PORT = com1 # programmer connected to serial device |
AVRDUDE_PORT = lpt1 # programmer connected to parallel port |
#AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex |
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex $(FUSE_SETTINGS) |
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep |
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) |
# Uncomment the following if you want avrdude's erase cycle counter. |
# Note that this counter needs to be initialized first using -Yn, |
# see avrdude manual. |
#AVRDUDE_ERASE += -y |
# Uncomment the following if you do /not/ wish a verification to be |
# performed after programming the device. |
AVRDUDE_FLAGS += -V |
# Increase verbosity level. Please use this when submitting bug |
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> |
# to submit bug reports. |
#AVRDUDE_FLAGS += -v -v |
# --------------------------------------------------------------------------- |
# Define directories, if needed. |
DIRAVR = c:/winavr |
DIRAVRBIN = $(DIRAVR)/bin |
DIRAVRUTILS = $(DIRAVR)/utils/bin |
DIRINC = . |
DIRLIB = $(DIRAVR)/avr/lib |
# Define programs and commands. |
SHELL = sh |
CC = avr-gcc |
OBJCOPY = avr-objcopy |
OBJDUMP = avr-objdump |
SIZE = avr-size |
# Programming support using avrdude. |
AVRDUDE = avrdude |
REMOVE = rm -f |
COPY = cp |
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex |
ELFSIZE = $(SIZE) -A $(TARGET).elf |
# Define Messages |
# English |
MSG_ERRORS_NONE = Errors: none |
MSG_BEGIN = -------- begin -------- |
MSG_END = -------- end -------- |
MSG_SIZE_BEFORE = Size before: |
MSG_SIZE_AFTER = Size after: |
MSG_COFF = Converting to AVR COFF: |
MSG_EXTENDED_COFF = Converting to AVR Extended COFF: |
MSG_FLASH = Creating load file for Flash: |
MSG_EEPROM = Creating load file for EEPROM: |
MSG_EXTENDED_LISTING = Creating Extended Listing: |
MSG_SYMBOL_TABLE = Creating Symbol Table: |
MSG_LINKING = Linking: |
MSG_COMPILING = Compiling: |
MSG_ASSEMBLING = Assembling: |
MSG_CLEANING = Cleaning project: |
# Define all object files. |
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o) |
# Define all listing files. |
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst) |
# Combine all necessary flags and optional flags. |
# Add target processor to flags. |
#ALL_CFLAGS = -mmcu=$(MCU) -DF_CPU=$(F_CPU) -I. $(CFLAGS) |
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) |
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) |
# Default target. |
all: begin gccversion sizebefore $(TARGET).elf $(TARGET).hex $(TARGET).eep \ |
$(TARGET).lss $(TARGET).sym sizeafter finished end |
# Eye candy. |
# AVR Studio 3.x does not check make's exit code but relies on |
# the following magic strings to be generated by the compile job. |
begin: |
@echo |
@echo $(MSG_BEGIN) |
finished: |
@echo $(MSG_ERRORS_NONE) |
end: |
@echo $(MSG_END) |
@echo |
# Display size of file. |
sizebefore: |
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi |
sizeafter: |
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi |
# Display compiler version information. |
gccversion : |
@$(CC) --version |
# Convert ELF to COFF for use in debugging / simulating in |
# AVR Studio or VMLAB. |
COFFCONVERT=$(OBJCOPY) --debugging \ |
--change-section-address .data-0x800000 \ |
--change-section-address .bss-0x800000 \ |
--change-section-address .noinit-0x800000 \ |
--change-section-address .eeprom-0x810000 |
coff: $(TARGET).elf |
@echo |
@echo $(MSG_COFF) $(TARGET).cof |
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof |
extcoff: $(TARGET).elf |
@echo |
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof |
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof |
# Program the device. |
program: $(TARGET).hex $(TARGET).eep |
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) |
# Create final output files (.hex, .eep) from ELF output file. |
%.hex: %.elf |
@echo |
@echo $(MSG_FLASH) $@ |
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ |
%.eep: %.elf |
@echo |
@echo $(MSG_EEPROM) $@ |
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ |
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@ |
# Create extended listing file from ELF output file. |
%.lss: %.elf |
@echo |
@echo $(MSG_EXTENDED_LISTING) $@ |
$(OBJDUMP) -h -S $< > $@ |
# Create a symbol table from ELF output file. |
%.sym: %.elf |
@echo |
@echo $(MSG_SYMBOL_TABLE) $@ |
avr-nm -n $< > $@ |
# Link: create ELF output file from object files. |
.SECONDARY : $(TARGET).elf |
.PRECIOUS : $(OBJ) |
%.elf: $(OBJ) |
@echo |
@echo $(MSG_LINKING) $@ |
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS) |
# Compile: create object files from C source files. |
%.o : %.c |
@echo |
@echo $(MSG_COMPILING) $< |
$(CC) -c $(ALL_CFLAGS) $< -o $@ |
# Compile: create assembler files from C source files. |
%.s : %.c |
$(CC) -S $(ALL_CFLAGS) $< -o $@ |
# Assemble: create object files from assembler source files. |
%.o : %.S |
@echo |
@echo $(MSG_ASSEMBLING) $< |
$(CC) -c $(ALL_ASFLAGS) $< -o $@ |
# Target: clean project. |
clean: begin clean_list finished end |
clean_list : |
@echo |
@echo $(MSG_CLEANING) |
# $(REMOVE) $(TARGET).hex |
$(REMOVE) $(TARGET).eep |
$(REMOVE) $(TARGET).obj |
$(REMOVE) $(TARGET).cof |
$(REMOVE) $(TARGET).elf |
$(REMOVE) $(TARGET).map |
$(REMOVE) $(TARGET).obj |
$(REMOVE) $(TARGET).a90 |
$(REMOVE) $(TARGET).sym |
$(REMOVE) $(TARGET).lnk |
$(REMOVE) $(TARGET).lss |
$(REMOVE) $(OBJ) |
$(REMOVE) $(LST) |
$(REMOVE) $(SRC:.c=.s) |
$(REMOVE) $(SRC:.c=.d) |
# Automatically generate C source code dependencies. |
# (Code originally taken from the GNU make user manual and modified |
# (See README.txt Credits).) |
# |
# Note that this will work with sh (bash) and sed that is shipped with WinAVR |
# (see the SHELL variable defined above). |
# This may not work with other shells or other seds. |
# |
%.d: %.c |
set -e; $(CC) -MM $(ALL_CFLAGS) $< \ |
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > $@; \ |
[ -s $@ ] || rm -f $@ |
# Remove the '-' if you want to see the dependency files generated. |
-include $(SRC:.c=.d) |
# Listing of phony targets. |
.PHONY : all begin finish end sizebefore sizeafter gccversion coff extcoff \ |
clean clean_list program |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/math.c |
---|
0,0 → 1,118 |
/* |
Copyright 2007, Niklas Nold |
This program (files math.c and math.h) is free software; you can redistribute it and/or modify |
it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; |
either version 3 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
Please note: All the other files for the project "Mikrokopter" by H. Buss are under the license (license_buss.txt) published by www.mikrokopter.de |
*/ |
#include "main.h" |
const uint8_t pgm_atan[270] PROGMEM = {0,1,2,3,5,6,7,8,9,10,11,12,13,15,16,17,18,19,20,21,22,23,24,25,26,27,27,28,29,30,31,32,33,33,34,35,36,37,37,38,39,39,40,41,41,42,43,43,44,44,45,46,46,47,47,48,48,49,49,50,50,51,51,52,52,52,53,53,54,54,54,55,55,56,56,56,57,57,57,58,58,58,59,59,59,60,60,60,60,61,61,61,61,62,62,62,62,63,63,63,63,64,64,64,64,65,65,65,65,65,66,66,66,66,66,67,67,67,67,67,67,68,68,68,68,68,68,69,69,69,69,69,69,69,70,70,70,70,70,70,70,70,71,71,71,71,71,71,71,71,72,72,72,72,72,72,72,72,72,73,73,73,73,73,73,73,73,73,73,74,74,74,74,74,74,74,74,74,74,74,74,75,75,75,75,75,75,75,75,75,75,75,75,75,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79}; |
// Arkustangens2 im Gradmaß |
signed int atan2_i(signed int x, signed int y) |
{ |
int i,angle; |
int8_t m; |
if (!x && !y) return 0; //atan2 = 0 für x und y = 0 |
if (y < 0) m=-1; |
else m=1; |
if (x==0) return (90*m); // atan2 = 90° für x = 0 |
i = abs(((float)y / x) * 50); // Berechne i für die Lookup table (Schrittweite atan(x) ist 0.02 -> *50) |
if (i<270) angle = pgm_read_byte(&pgm_atan[i]); // Lookup für 1° bis 79° |
else if (i>5750) angle = 90; // Grenzwert ist 90° |
else if (i>=1910) angle = 89; // 89° bis 80° über Wertebereiche |
else if (i>=1150) angle = 88; |
else if (i>=820) angle = 87; |
else if (i>=640) angle = 86; |
else if (i>=520) angle = 85; |
else if (i>=440) angle = 84; |
else if (i>=380) angle = 83; |
else if (i>=335) angle = 82; |
else if (i>=299) angle = 81; |
else angle = 80; // (i>=270) |
if (x > 0) return (angle*m); // Quadrant I und IV |
else if ((x < 0) && (y >= 0)) return ((angle*-1) + 180); // Quadrant II |
else return (angle - 180); // x < 0 && y < 0 Quadrant III |
} |
const float pgm_sinus_f [91] PROGMEM = {0.000,0.017,0.035,0.052,0.070,0.087,0.105,0.122,0.139,0.156,0.174,0.191,0.208,0.225,0.242,0.259,0.276,0.292,0.309,0.326,0.342,0.358,0.375,0.391,0.407,0.423,0.438,0.454,0.469,0.485,0.500,0.515,0.530,0.545,0.559,0.574,0.588,0.602,0.616,0.629,0.643,0.656,0.669,0.682,0.695,0.707,0.719,0.731,0.743,0.755,0.766,0.777,0.788,0.799,0.809,0.819,0.829,0.839,0.848,0.857,0.866,0.875,0.883,0.891,0.899,0.906,0.914,0.921,0.927,0.934,0.940,0.946,0.951,0.956,0.961,0.966,0.970,0.974,0.978,0.982,0.985,0.988,0.990,0.993,0.995,0.996,0.998,0.999,0.999,1.000,1.000}; |
inline float pgm_read_float(const float *addr) |
{ |
union |
{ |
uint16_t i[2]; // 2 16-bit-Worte |
float f; |
} u; |
u.i[0]=pgm_read_word((PGM_P)addr); |
u.i[1]=pgm_read_word((PGM_P)addr+2); |
return u.f; |
} |
// Kosinusfunktion im Gradmaß |
float cos_f(signed int winkel) |
{ |
return (sin_f(90-winkel)); |
} |
// Sinusfunktion im Gradmaß |
float sin_f(signed int winkel) |
{ |
short int m,n; |
float sinus; |
//winkel = winkel % 360; |
if (winkel < 0) |
{ |
m = -1; |
winkel = abs(winkel); |
} |
else m = +1; |
// Quadranten auswerten |
if ((winkel > 90 ) && (winkel <= 180)) {winkel = 180 - winkel; n = 1;} |
else if ((winkel > 180 ) && (winkel <= 270)) {winkel = winkel - 180; n = -1;} |
else if ((winkel > 270) && (winkel <= 360)) {winkel = 360 - winkel; n = -1;} |
else n = 1; //0 - 90 Grad |
sinus = pgm_read_float(&pgm_sinus_f[winkel]); |
return (sinus*m*n); |
} |
const uint8_t pgm_asin[201] PROGMEM = {0,0,1,1,1,1,2,2,2,3,3,3,3,4,4,4,5,5,5,5,6,6,6,7,7,7,7,8,8,8,9,9,9,9,10,10,10,11,11,11,12,12,12,12,13,13,13,14,14,14,14,15,15,15,16,16,16,17,17,17,17,18,18,18,19,19,19,20,20,20,20,21,21,21,22,22,22,23,23,23,24,24,24,25,25,25,25,26,26,26,27,27,27,28,28,28,29,29,29,30,30,30,31,31,31,32,32,32,33,33,33,34,34,34,35,35,35,36,36,37,37,37,38,38,38,39,39,39,40,40,41,41,41,42,42,42,43,43,44,44,44,45,45,46,46,46,47,47,48,48,49,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,62,62,63,64,64,65,66,66,67,68,68,69,70,71,72,73,74,75,76,77,79,80,82,84,90}; |
// Akurssinusfunktion im Gradmaß |
int8_t asin_i(signed int i) |
{ |
signed char m; |
if (i < 0) {m=-1;i=abs(i);} |
else m=1; |
return (pgm_read_byte(&pgm_asin[i]) * m); |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/math.h |
---|
0,0 → 1,11 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Peter Muehlenbrock |
// Definitionen fuer Modul math |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
extern signed int atan2_i(signed int x, signed int y); |
extern float cos_f(signed int winkel); |
extern float sin_f(signed int winkel); |
extern int8_t asin_i(signed int i); |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/menu.c |
---|
0,0 → 1,118 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
unsigned int TestInt = 0; |
#define ARRAYGROESSE 10 |
unsigned char Array[ARRAYGROESSE] = {1,2,3,4,5,6,7,8,9,10}; |
char DisplayBuff[80] = "Hallo Welt"; |
unsigned char DispPtr = 0; |
unsigned char RemoteTasten = 0; |
#define KEY1 0x01 |
#define KEY2 0x02 |
#define KEY3 0x04 |
#define KEY4 0x08 |
#define KEY5 0x10 |
void LcdClear(void) |
{ |
unsigned char i; |
for(i=0;i<80;i++) DisplayBuff[i] = ' '; |
} |
void Menu(void) |
{ |
static unsigned char MaxMenue = 10,MenuePunkt=0; |
if(RemoteTasten & KEY1) { if(MenuePunkt) MenuePunkt--; else MenuePunkt = MaxMenue; LcdClear(); } |
if(RemoteTasten & KEY2) { MenuePunkt++; LcdClear(); } |
if((RemoteTasten & KEY1) && (RemoteTasten & KEY2)) MenuePunkt = 0; |
LCD_printfxy(17,0,"[%i]",MenuePunkt); |
switch(MenuePunkt) |
{ |
case 0: |
LCD_printfxy(0,0,"++ MikroKopter ++"); |
LCD_printfxy(0,1,"HW:V%d.%d SW:%d.%d",PlatinenVersion/10,PlatinenVersion%10,VERSION_HAUPTVERSION, VERSION_NEBENVERSION); |
LCD_printfxy(0,2,"Setting: %d ",GetActiveParamSetNumber()); |
LCD_printfxy(0,3,"(c) Holger Buss"); |
// if(RemoteTasten & KEY3) TestInt--; |
// if(RemoteTasten & KEY4) TestInt++; |
break; |
case 1: |
if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
LCD_printfxy(0,0,"Hoehe: %5i",HoehenWert); |
LCD_printfxy(0,1,"SollHoehe: %5i",SollHoehe); |
LCD_printfxy(0,2,"Luftdruck: %5i",MessLuftdruck); |
LCD_printfxy(0,3,"Off : %5i",DruckOffsetSetting); |
} |
else |
{ |
LCD_printfxy(0,1,"Keine "); |
LCD_printfxy(0,2,"Höhenregelung"); |
} |
break; |
case 2: |
LCD_printfxy(0,0,"akt. Lage"); |
LCD_printfxy(0,1,"Nick: %5i",IntegralNick/1024); |
LCD_printfxy(0,2,"Roll: %5i",IntegralRoll/1024); |
LCD_printfxy(0,3,"Kompass: %5i",KompassValue); |
break; |
case 3: |
LCD_printfxy(0,0,"K1:%4i K2:%4i ",PPM_in[1],PPM_in[2]); |
LCD_printfxy(0,1,"K3:%4i K4:%4i ",PPM_in[3],PPM_in[4]); |
LCD_printfxy(0,2,"K5:%4i K6:%4i ",PPM_in[5],PPM_in[6]); |
LCD_printfxy(0,3,"K7:%4i K8:%4i ",PPM_in[7],PPM_in[8]); |
break; |
case 4: |
LCD_printfxy(0,0,"Ni:%4i Ro:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_NICK]],PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]); |
LCD_printfxy(0,1,"Gs:%4i Gi:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_GAS]],PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]); |
LCD_printfxy(0,2,"P1:%4i P2:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]],PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]]); |
LCD_printfxy(0,3,"P3:%4i P4:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]],PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]]); |
break; |
case 5: |
LCD_printfxy(0,0,"Gyro - Sensor"); |
LCD_printfxy(0,1,"Nick %4i (%3i)",AccumulateNick / MessanzahlNick, AdNeutralNick); |
LCD_printfxy(0,2,"Roll %4i (%3i)",AccumulateRoll / MessanzahlRoll, AdNeutralRoll); |
LCD_printfxy(0,3,"Gier %4i (%3i)",AccumulateGier / MessanzahlGier, AdNeutralGier); |
break; |
case 6: |
LCD_printfxy(0,0,"ACC - Sensor"); |
LCD_printfxy(0,1,"Nick %4i (%3i)",accumulate_AccNick / messanzahl_AccNick,NeutralAccX); |
LCD_printfxy(0,2,"Roll %4i (%3i)",accumulate_AccRoll / messanzahl_AccRoll,NeutralAccY); |
LCD_printfxy(0,3,"Hoch %4i (%3i)",Aktuell_az/*accumulate_AccHoch / messanzahl_AccHoch*/,(int)NeutralAccZ); |
break; |
case 7: |
LCD_printfxy(0,1,"Spannung: %5i",UBat); |
LCD_printfxy(0,2,"Empf.Pegel:%5i",SenderOkay); |
break; |
case 8: |
LCD_printfxy(0,0,"Kompass "); |
LCD_printfxy(0,1,"Richtung: %5i",KompassRichtung); |
LCD_printfxy(0,2,"Messwert: %5i",KompassValue); |
LCD_printfxy(0,3,"Start: %5i",KompassStartwert); |
break; |
case 9: |
LCD_printfxy(0,0,"Po1: %3i Po5: %3i" ,Poti1,Poti5); //PPM24-Erweiterung (121007Kr) |
LCD_printfxy(0,1,"Po2: %3i Po6: %3i" ,Poti2,Poti6); //PPM24-Erweiterung (121007Kr) |
LCD_printfxy(0,2,"Po3: %3i Po7: %3i" ,Poti3,Poti7); //PPM24-Erweiterung (121007Kr) |
LCD_printfxy(0,3,"Po4: %3i Po8: %3i" ,Poti4,Poti8); //PPM24-Erweiterung (121007Kr) |
break; |
case 10: |
LCD_printfxy(0,0,"Servo " ); |
LCD_printfxy(0,1,"Setpoint %3i",Parameter_ServoNickControl); |
LCD_printfxy(0,2,"Stellung: %3i",ServoValue); |
LCD_printfxy(0,3,"Range:%3i-%3i",EE_Parameter.ServoNickMin,EE_Parameter.ServoNickMax); |
break; |
default: MaxMenue = MenuePunkt - 1; |
MenuePunkt = 0; |
break; |
} |
RemoteTasten = 0; |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/menu.h |
---|
0,0 → 1,5 |
extern void Menu(void); |
extern char DisplayBuff[80]; |
extern unsigned char DispPtr; |
unsigned char RemoteTasten; |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/old_macros.h |
---|
0,0 → 1,47 |
/* |
For backwards compatibility only. |
Ingo Busker ingo@mikrocontroller.com |
*/ |
#ifndef cbi |
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) |
#endif |
#ifndef sbi |
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit)) |
#endif |
#ifndef inb |
#define inb(sfr) _SFR_BYTE(sfr) |
#endif |
#ifndef outb |
#define outb(sfr, val) (_SFR_BYTE(sfr) = (val)) |
#endif |
#ifndef inw |
#define inw(sfr) _SFR_WORD(sfr) |
#endif |
#ifndef outw |
#define outw(sfr, val) (_SFR_WORD(sfr) = (val)) |
#endif |
#ifndef outp |
#define outp(val, sfr) outb(sfr, val) |
#endif |
#ifndef inp |
#define inp(sfr) inb(sfr) |
#endif |
#ifndef BV |
#define BV(bit) _BV(bit) |
#endif |
#ifndef PRG_RDB |
#define PRG_RDB pgm_read_byte |
#endif |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/printf_P.c |
---|
0,0 → 1,480 |
// Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist nicht von der Lizenz für den MikroKopter-Teil unterstellt |
/* |
Copyright (C) 1993 Free Software Foundation |
This file is part of the GNU IO Library. This library is free |
software; you can redistribute it and/or modify it under the |
terms of the GNU General Public License as published by the |
Free Software Foundation; either version 2, or (at your option) |
any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License for more details. |
You should have received a copy of the GNU General Public License |
along with this library; see the file COPYING. If not, write to the Free |
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
As a special exception, if you link this library with files |
compiled with a GNU compiler to produce an executable, this does not cause |
the resulting executable to be covered by the GNU General Public License. |
This exception does not however invalidate any other reasons why |
the executable file might be covered by the GNU General Public License. */ |
/* |
* Copyright (c) 1990 Regents of the University of California. |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* 1. Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* 2. Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* 3. [rescinded 22 July 1999] |
* 4. Neither the name of the University nor the names of its contributors |
* may be used to endorse or promote products derived from this software |
* without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
* SUCH DAMAGE. |
*/ |
/****************************************************************************** |
This file is a patched version of printf called _printf_P |
It is made to work with avr-gcc for Atmel AVR MCUs. |
There are some differences from standard printf: |
1. There is no floating point support (with fp the code is about 8K!) |
2. Return type is void |
3. Format string must be in program memory (by using macro printf this is |
done automaticaly) |
4. %n is not implemented (just remove the comment around it if you need it) |
5. If LIGHTPRINTF is defined, the code is about 550 bytes smaller and the |
folowing specifiers are disabled : |
space # * . - + p s o O |
6. A function void uart_sendchar(char c) is used for output. The UART must |
be initialized before using printf. |
Alexander Popov |
sasho@vip.orbitel.bg |
******************************************************************************/ |
/* |
* Actual printf innards. |
* |
* This code is large and complicated... |
*/ |
#include <string.h> |
#ifdef __STDC__ |
#include <stdarg.h> |
#else |
#include <varargs.h> |
#endif |
#include "main.h" |
//#define LIGHTPRINTF |
char PrintZiel; |
char Putchar(char zeichen) |
{ |
if(PrintZiel == OUT_LCD) { DisplayBuff[DispPtr++] = zeichen; return(1);} |
else return(uart_putchar(zeichen)); |
} |
void PRINT(const char * ptr, unsigned int len) |
{ |
for(;len;len--) Putchar(*ptr++); |
} |
void PRINTP(const char * ptr, unsigned int len) |
{ |
for(;len;len--) Putchar(pgm_read_byte(ptr++)); |
} |
void PAD_SP(signed char howmany) |
{ |
for(;howmany>0;howmany--) Putchar(' '); |
} |
void PAD_0(signed char howmany) |
{ |
for(;howmany>0;howmany--) Putchar('0'); |
} |
#define BUF 40 |
/* |
* Macros for converting digits to letters and vice versa |
*/ |
#define to_digit(c) ((c) - '0') |
#define is_digit(c) ((c)<='9' && (c)>='0') |
#define to_char(n) ((n) + '0') |
/* |
* Flags used during conversion. |
*/ |
#define LONGINT 0x01 /* long integer */ |
#define LONGDBL 0x02 /* long double; unimplemented */ |
#define SHORTINT 0x04 /* short integer */ |
#define ALT 0x08 /* alternate form */ |
#define LADJUST 0x10 /* left adjustment */ |
#define ZEROPAD 0x20 /* zero (as opposed to blank) pad */ |
#define HEXPREFIX 0x40 /* add 0x or 0X prefix */ |
void _printf_P (char ziel,char const *fmt0, ...) /* Works with string from FLASH */ |
{ |
va_list ap; |
register const char *fmt; /* format string */ |
register char ch; /* character from fmt */ |
register int n; /* handy integer (short term usage) */ |
register char *cp; /* handy char pointer (short term usage) */ |
const char *fmark; /* for remembering a place in fmt */ |
register unsigned char flags; /* flags as above */ |
signed char width; /* width from format (%8d), or 0 */ |
signed char prec; /* precision from format (%.3d), or -1 */ |
char sign; /* sign prefix (' ', '+', '-', or \0) */ |
unsigned long _ulong=0; /* integer arguments %[diouxX] */ |
#define OCT 8 |
#define DEC 10 |
#define HEX 16 |
unsigned char base; /* base for [diouxX] conversion */ |
signed char dprec; /* a copy of prec if [diouxX], 0 otherwise */ |
signed char dpad; /* extra 0 padding needed for integers */ |
signed char fieldsz; /* field size expanded by sign, dpad etc */ |
/* The initialization of 'size' is to suppress a warning that |
'size' might be used unitialized. It seems gcc can't |
quite grok this spaghetti code ... */ |
signed char size = 0; /* size of converted field or string */ |
char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */ |
char ox[2]; /* space for 0x hex-prefix */ |
PrintZiel = ziel; // bestimmt, LCD oder UART |
va_start(ap, fmt0); |
fmt = fmt0; |
/* |
* Scan the format for conversions (`%' character). |
*/ |
for (;;) { |
for (fmark = fmt; (ch = pgm_read_byte(fmt)) != '\0' && ch != '%'; fmt++) |
/* void */; |
if ((n = fmt - fmark) != 0) { |
PRINTP(fmark, n); |
} |
if (ch == '\0') |
goto done; |
fmt++; /* skip over '%' */ |
flags = 0; |
dprec = 0; |
width = 0; |
prec = -1; |
sign = '\0'; |
rflag: ch = PRG_RDB(fmt++); |
reswitch: |
#ifdef LIGHTPRINTF |
if (ch=='o' || ch=='u' || (ch|0x20)=='x') { |
#else |
if (ch=='u' || (ch|0x20)=='x') { |
#endif |
if (flags&LONGINT) { |
_ulong=va_arg(ap, unsigned long); |
} else { |
register unsigned int _d; |
_d=va_arg(ap, unsigned int); |
_ulong = flags&SHORTINT ? (unsigned long)(unsigned short)_d : (unsigned long)_d; |
} |
} |
#ifndef LIGHTPRINTF |
if(ch==' ') { |
/* |
* ``If the space and + flags both appear, the space |
* flag will be ignored.'' |
* -- ANSI X3J11 |
*/ |
if (!sign) |
sign = ' '; |
goto rflag; |
} else if (ch=='#') { |
flags |= ALT; |
goto rflag; |
} else if (ch=='*'||ch=='-') { |
if (ch=='*') { |
/* |
* ``A negative field width argument is taken as a |
* - flag followed by a positive field width.'' |
* -- ANSI X3J11 |
* They don't exclude field widths read from args. |
*/ |
if ((width = va_arg(ap, int)) >= 0) |
goto rflag; |
width = -width; |
} |
flags |= LADJUST; |
flags &= ~ZEROPAD; /* '-' disables '0' */ |
goto rflag; |
} else if (ch=='+') { |
sign = '+'; |
goto rflag; |
} else if (ch=='.') { |
if ((ch = PRG_RDB(fmt++)) == '*') { |
n = va_arg(ap, int); |
prec = n < 0 ? -1 : n; |
goto rflag; |
} |
n = 0; |
while (is_digit(ch)) { |
n = n*10 + to_digit(ch); |
ch = PRG_RDB(fmt++); |
} |
prec = n < 0 ? -1 : n; |
goto reswitch; |
} else |
#endif /* LIGHTPRINTF */ |
if (ch=='0') { |
/* |
* ``Note that 0 is taken as a flag, not as the |
* beginning of a field width.'' |
* -- ANSI X3J11 |
*/ |
if (!(flags & LADJUST)) |
flags |= ZEROPAD; /* '-' disables '0' */ |
goto rflag; |
} else if (ch>='1' && ch<='9') { |
n = 0; |
do { |
n = 10 * n + to_digit(ch); |
ch = PRG_RDB(fmt++); |
} while (is_digit(ch)); |
width = n; |
goto reswitch; |
} else if (ch=='h') { |
flags |= SHORTINT; |
goto rflag; |
} else if (ch=='l') { |
flags |= LONGINT; |
goto rflag; |
} else if (ch=='c') { |
*(cp = buf) = va_arg(ap, int); |
size = 1; |
sign = '\0'; |
} else if (ch=='D'||ch=='d'||ch=='i') { |
if(ch=='D') |
flags |= LONGINT; |
if (flags&LONGINT) { |
_ulong=va_arg(ap, long); |
} else { |
register int _d; |
_d=va_arg(ap, int); |
_ulong = flags&SHORTINT ? (long)(short)_d : (long)_d; |
} |
if ((long)_ulong < 0) { |
_ulong = -_ulong; |
sign = '-'; |
} |
base = DEC; |
goto number; |
} else |
/* |
if (ch=='n') { |
if (flags & LONGINT) |
*va_arg(ap, long *) = ret; |
else if (flags & SHORTINT) |
*va_arg(ap, short *) = ret; |
else |
*va_arg(ap, int *) = ret; |
continue; // no output |
} else |
*/ |
#ifndef LIGHTPRINTF |
if (ch=='O'||ch=='o') { |
if (ch=='O') |
flags |= LONGINT; |
base = OCT; |
goto nosign; |
} else if (ch=='p') { |
/* |
* ``The argument shall be a pointer to void. The |
* value of the pointer is converted to a sequence |
* of printable characters, in an implementation- |
* defined manner.'' |
* -- ANSI X3J11 |
*/ |
/* NOSTRICT */ |
_ulong = (unsigned int)va_arg(ap, void *); |
base = HEX; |
flags |= HEXPREFIX; |
ch = 'x'; |
goto nosign; |
} else if (ch=='s') { // print a string from RAM |
if ((cp = va_arg(ap, char *)) == NULL) { |
cp=buf; |
cp[0] = '('; |
cp[1] = 'n'; |
cp[2] = 'u'; |
cp[4] = cp[3] = 'l'; |
cp[5] = ')'; |
cp[6] = '\0'; |
} |
if (prec >= 0) { |
/* |
* can't use strlen; can only look for the |
* NUL in the first `prec' characters, and |
* strlen() will go further. |
*/ |
char *p = (char*)memchr(cp, 0, prec); |
if (p != NULL) { |
size = p - cp; |
if (size > prec) |
size = prec; |
} else |
size = prec; |
} else |
size = strlen(cp); |
sign = '\0'; |
} else |
#endif /* LIGHTPRINTF */ |
if(ch=='U'||ch=='u') { |
if (ch=='U') |
flags |= LONGINT; |
base = DEC; |
goto nosign; |
} else if (ch=='X'||ch=='x') { |
base = HEX; |
/* leading 0x/X only if non-zero */ |
if (flags & ALT && _ulong != 0) |
flags |= HEXPREFIX; |
/* unsigned conversions */ |
nosign: sign = '\0'; |
/* |
* ``... diouXx conversions ... if a precision is |
* specified, the 0 flag will be ignored.'' |
* -- ANSI X3J11 |
*/ |
number: if ((dprec = prec) >= 0) |
flags &= ~ZEROPAD; |
/* |
* ``The result of converting a zero value with an |
* explicit precision of zero is no characters.'' |
* -- ANSI X3J11 |
*/ |
cp = buf + BUF; |
if (_ulong != 0 || prec != 0) { |
register unsigned char _d,notlastdigit; |
do { |
notlastdigit=(_ulong>=base); |
_d = _ulong % base; |
if (_d<10) { |
_d+='0'; |
} else { |
_d+='a'-10; |
if (ch=='X') _d&=~0x20; |
} |
*--cp=_d; |
_ulong /= base; |
} while (notlastdigit); |
#ifndef LIGHTPRINTF |
// handle octal leading 0 |
if (base==OCT && flags & ALT && *cp != '0') |
*--cp = '0'; |
#endif |
} |
size = buf + BUF - cp; |
} else { //default |
/* "%?" prints ?, unless ? is NUL */ |
if (ch == '\0') |
goto done; |
/* pretend it was %c with argument ch */ |
cp = buf; |
*cp = ch; |
size = 1; |
sign = '\0'; |
} |
/* |
* All reasonable formats wind up here. At this point, |
* `cp' points to a string which (if not flags&LADJUST) |
* should be padded out to `width' places. If |
* flags&ZEROPAD, it should first be prefixed by any |
* sign or other prefix; otherwise, it should be blank |
* padded before the prefix is emitted. After any |
* left-hand padding and prefixing, emit zeroes |
* required by a decimal [diouxX] precision, then print |
* the string proper, then emit zeroes required by any |
* leftover floating precision; finally, if LADJUST, |
* pad with blanks. |
*/ |
/* |
* compute actual size, so we know how much to pad. |
*/ |
fieldsz = size; |
dpad = dprec - size; |
if (dpad < 0) |
dpad = 0; |
if (sign) |
fieldsz++; |
else if (flags & HEXPREFIX) |
fieldsz += 2; |
fieldsz += dpad; |
/* right-adjusting blank padding */ |
if ((flags & (LADJUST|ZEROPAD)) == 0) |
PAD_SP(width - fieldsz); |
/* prefix */ |
if (sign) { |
PRINT(&sign, 1); |
} else if (flags & HEXPREFIX) { |
ox[0] = '0'; |
ox[1] = ch; |
PRINT(ox, 2); |
} |
/* right-adjusting zero padding */ |
if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD) |
PAD_0(width - fieldsz); |
/* leading zeroes from decimal precision */ |
PAD_0(dpad); |
/* the string or number proper */ |
PRINT(cp, size); |
/* left-adjusting padding (always blank) */ |
if (flags & LADJUST) |
PAD_SP(width - fieldsz); |
} |
done: |
va_end(ap); |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/printf_P.h |
---|
0,0 → 1,19 |
#ifndef _PRINTF_P_H_ |
#define _PRINTF_P_H_ |
#include <avr/pgmspace.h> |
#define OUT_V24 0 |
#define OUT_LCD 1 |
extern void _printf_P (char, char const *fmt0, ...); |
extern char PrintZiel; |
#define printf_P(format, args...) _printf_P(OUT_V24,format , ## args) |
#define printf(format, args...) _printf_P(OUT_V24,PSTR(format) , ## args) |
#define LCD_printfxy(x,y,format, args...) { DispPtr = y * 20 + x; _printf_P(OUT_LCD,PSTR(format) , ## args);} |
#define LCD_printf(format, args...) { _printf_P(OUT_LCD,PSTR(format) , ## args);} |
#endif |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/rc.c |
---|
0,0 → 1,85 |
/*####################################################################################### |
Decodieren eines RC Summen Signals |
#######################################################################################*/ |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "rc.h" |
#include "main.h" |
volatile int PPM_in[15]; //PPM24-Erweiterung (121007Kr) |
volatile int PPM_diff[15]; // das diffenzierte Stick-Signal //PPM24-Erweiterung (121007Kr) |
volatile unsigned char NewPpmData = 1; |
//############################################################################ |
//zum decodieren des PPM-Signals wird Timer1 mit seiner Input |
//Capture Funktion benutzt: |
void rc_sum_init (void) |
//############################################################################ |
{ |
TCCR1B=(1<<CS11)|(1<<CS10)|(1<<ICES1)|(1<<ICNC1);//|(1 << WGM12); //timer1 prescale 64 |
// PWM |
//TCCR1A = (1 << COM1B1) | (1 << WGM11) | (1 << WGM10); |
//TCCR1B |= (1 << WGM12); |
//OCR1B = 55; |
TIMSK1 |= _BV(ICIE1); |
AdNeutralGier = 0; |
AdNeutralRoll = 0; |
AdNeutralNick = 0; |
return; |
} |
//############################################################################ |
//Diese Routine startet und inizialisiert den Timer für RC |
SIGNAL(SIG_INPUT_CAPTURE1) |
//############################################################################ |
{ |
static unsigned int AltICR=0; |
signed int signal = 0,tmp; |
static int index; |
signal = (unsigned int) ICR1 - AltICR; |
AltICR = ICR1; |
//Syncronisationspause? |
if ((signal > 1500) && (signal < 8000)) |
{ |
index = 1; |
NewPpmData = 0; // Null bedeutet: Neue Daten |
// OCR2A = Poti2/2 + 80; |
} |
else |
{ |
if(index < 14) //PPM24-Erweiterung (121007Kr) |
{ |
if((signal > 250) && (signal < 687)) |
{ |
signal -= 466; |
// Stabiles Signal |
if(abs(signal - PPM_in[index]) < 6) { if(SenderOkay < 200) SenderOkay += 10;} |
tmp = (3 * (PPM_in[index]) + signal) / 4; |
// if(tmp > signal+1) tmp--; else |
// if(tmp < signal-1) tmp++; |
PPM_diff[index] = tmp - PPM_in[index]; |
PPM_in[index] = tmp; |
} |
index++; |
if(index == 5) PORTD |= 0x20; else PORTD &= ~0x20; // Servosignal an J3 anlegen |
if(index == 6) PORTD |= 0x10; else PORTD &= ~0x10; // Servosignal an J4 anlegen |
if(index == 7) PORTD |= 0x08; else PORTD &= ~0x08; // Servosignal an J5 anlegen |
} |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/rc.h |
---|
0,0 → 1,29 |
/*####################################################################################### |
Derkodieren eines RC Summen Signals |
#######################################################################################*/ |
#ifndef _RC_H |
#define _RC_H |
#if defined (__AVR_ATmega32__) |
#define TIMER_TEILER CK64 |
#define TIMER_RELOAD_VALUE 250 |
#endif |
#if defined (__AVR_ATmega644__) |
//#define TIMER_TEILER CK64 |
#define TIMER_RELOAD_VALUE 250 |
//#define TIMER_TEILER CK256 // bei 20MHz |
//#define TIMER_RELOAD_VALUE -78 // bei 20MHz |
#endif |
#define GAS PPM_in[2] |
extern void rc_sum_init (void); |
extern volatile int PPM_in[15]; //PPM24-Erweiterung (121007Kr) |
extern volatile int PPM_diff[15]; // das diffenzierte Stick-Signal //PPM24-Erweiterung (121007Kr) |
extern volatile unsigned char NewPpmData; |
#endif //_RC_H |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/timer0.c |
---|
0,0 → 1,160 |
#include "main.h" |
volatile unsigned int CountMilliseconds = 0; |
volatile static unsigned int tim_main; |
volatile unsigned char UpdateMotor = 0; |
volatile unsigned int cntKompass = 0; |
volatile unsigned int beeptime = 0; |
unsigned int BeepMuster = 0xffff; |
int ServoValue = 0; |
enum { |
STOP = 0, |
CK = 1, |
CK8 = 2, |
CK64 = 3, |
CK256 = 4, |
CK1024 = 5, |
T0_FALLING_EDGE = 6, |
T0_RISING_EDGE = 7 |
}; |
SIGNAL (SIG_OVERFLOW0) // 8kHz |
{ |
static unsigned char cnt_1ms = 1,cnt = 0; |
unsigned char pieper_ein = 0; |
// TCNT0 -= 250;//TIMER_RELOAD_VALUE; |
if(!cnt--) |
{ |
cnt = 9; |
cnt_1ms++; |
cnt_1ms %= 2; |
if(!cnt_1ms) UpdateMotor = 1; |
CountMilliseconds++; |
} |
if(beeptime > 1) |
{ |
beeptime--; |
if(beeptime & BeepMuster) |
{ |
pieper_ein = 1; |
} |
else pieper_ein = 0; |
} |
else |
{ |
pieper_ein = 0; |
BeepMuster = 0xffff; |
} |
if(pieper_ein) |
{ |
if(PlatinenVersion == 10) PORTD |= (1<<2); // Speaker an PORTD.2 |
else PORTC |= (1<<7); // Speaker an PORTC.7 |
} |
else |
{ |
if(PlatinenVersion == 10) PORTD &= ~(1<<2); |
else PORTC &= ~(1<<7); |
} |
if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV) |
{ |
MM3_timer0(); // Kompass auslesen |
if (!cntKompass--) // Aufruf mit 25 Hz |
{ |
if (MM3_heading() > 0) { KompassValue = 360-MM3_heading();} |
if (MM3_heading() < 0 ) { KompassValue = MM3_heading()*-1;} |
KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360); |
cntKompass = 640; |
} |
} |
} |
void Timer_Init(void) |
{ |
tim_main = SetDelay(10); |
TCCR0B = CK8; |
TCCR0A = (1<<COM0A1)|(1<<COM0B1)|3;//fast PWM |
OCR0A = 0; |
OCR0B = 120; |
TCNT0 = -TIMER_RELOAD_VALUE; // reload |
//OCR1 = 0x00; |
TCCR2A=(1<<COM2A1)|(1<<COM2A0)|3; |
TCCR2B=(0<<CS20)|(1<<CS21)|(1<<CS22); |
// TIMSK2 |= _BV(TOIE2); |
TIMSK2 |= _BV(OCIE2A); |
TIMSK0 |= _BV(TOIE0); |
OCR2A = 10; |
TCNT2 = 0; |
} |
// ----------------------------------------------------------------------- |
unsigned int SetDelay (unsigned int t) |
{ |
// TIMSK0 &= ~_BV(TOIE0); |
return(CountMilliseconds + t + 1); |
// TIMSK0 |= _BV(TOIE0); |
} |
// ----------------------------------------------------------------------- |
char CheckDelay(unsigned int t) |
{ |
// TIMSK0 &= ~_BV(TOIE0); |
return(((t - CountMilliseconds) & 0x8000) >> 9); |
// TIMSK0 |= _BV(TOIE0); |
} |
// ----------------------------------------------------------------------- |
void Delay_ms(unsigned int w) |
{ |
unsigned int akt; |
akt = SetDelay(w); |
while (!CheckDelay(akt)); |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Servo ansteuern |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(SIG_OUTPUT_COMPARE2A) |
{ |
static unsigned char timer = 10; |
if(!timer--) |
{ |
TCCR2A=(1<<COM2A1)|(0<<COM2A0)|3; |
ServoValue = Parameter_ServoNickControl; |
if(EE_Parameter.ServoNickCompInvert & 0x01) ServoValue += ((long) EE_Parameter.ServoNickComp * (IntegralNick / 128)) / 512; |
else ServoValue -= ((long) EE_Parameter.ServoNickComp * (IntegralNick / 128)) / 512; |
if(ServoValue < EE_Parameter.ServoNickMin) ServoValue = EE_Parameter.ServoNickMin; |
else if(ServoValue > EE_Parameter.ServoNickMax) ServoValue = EE_Parameter.ServoNickMax; |
OCR2A = ServoValue;// + 75; |
timer = EE_Parameter.ServoNickRefresh; |
} |
else |
{ |
TCCR2A =3; |
PORTD&=~0x80; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/timer0.h |
---|
0,0 → 1,15 |
#define TIMER_TEILER CK8 |
#define TIMER_RELOAD_VALUE 250 |
void Timer_Init(void); |
void Delay_ms(unsigned int); |
unsigned int SetDelay (unsigned int t); |
char CheckDelay (unsigned int t); |
extern volatile unsigned int CountMilliseconds; |
extern volatile unsigned char UpdateMotor; |
extern volatile unsigned int beeptime; |
extern volatile unsigned int cntKompass; |
extern int ServoValue; |
extern unsigned int BeepMuster; |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/twimaster.c |
---|
0,0 → 1,152 |
/*############################################################################ |
############################################################################*/ |
#include "main.h" |
unsigned char twi_state = 0; |
unsigned char motor = 0; |
unsigned char motorread = 0; |
unsigned char motor_rx[8]; |
//############################################################################ |
//Initzialisieren der I2C (TWI) Schnittstelle |
void i2c_init(void) |
//############################################################################ |
{ |
TWSR = 0; |
TWBR = ((SYSCLK/SCL_CLOCK)-16)/2; |
} |
//############################################################################ |
//Start I2C |
char i2c_start(void) |
//############################################################################ |
{ |
TWCR = (1<<TWSTA) | (1<<TWEN) | (1<<TWINT) | (1<<TWIE); |
return(0); |
} |
//############################################################################ |
//Start I2C |
void i2c_stop(void) |
//############################################################################ |
{ |
TWCR = (1<<TWEN) | (1<<TWSTO) | (1<<TWINT); |
} |
void i2c_reset(void) |
//############################################################################ |
{ |
i2c_stop(); |
twi_state = 0; |
motor = TWDR; |
motor = 0; |
TWCR = 0x80; |
TWAMR = 0; |
TWAR = 0; |
TWDR = 0; |
TWSR = 0; |
TWBR = 0; |
i2c_init(); |
i2c_start(); |
i2c_write_byte(0); |
} |
//############################################################################ |
//Start I2C |
char i2c_write_byte(char byte) |
//############################################################################ |
{ |
TWSR = 0x00; |
TWDR = byte; |
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWIE); |
return(0); |
} |
//############################################################################ |
//Start I2C |
SIGNAL (TWI_vect) |
//############################################################################ |
{ |
switch (twi_state++) |
{ |
case 0: |
i2c_write_byte(0x52+(motor*2)); |
break; |
case 1: |
switch(motor++) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 2: |
i2c_stop(); |
if (motor<4) twi_state = 0; |
else motor = 0; |
i2c_start(); |
break; |
//Liest Daten von Motor |
case 3: |
i2c_write_byte(0x53+(motorread*2)); |
break; |
case 4: |
switch(motorread) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 5: //1 Byte vom Motor lesen |
motor_rx[motorread] = TWDR; |
case 6: |
switch(motorread) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 7: //2 Byte vom Motor lesen |
motor_rx[motorread+4] = TWDR; |
motorread++; |
if (motorread>3) motorread=0; |
i2c_stop(); |
I2CTimeout = 10; |
twi_state = 0; |
} |
TWCR |= 0x80; |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/twimaster.h |
---|
0,0 → 1,32 |
/*############################################################################ |
############################################################################*/ |
#ifndef _I2C_MASTER_H |
#define _I2C_MASTER_H |
//############################################################################ |
// I2C Konstanten |
#define SCL_CLOCK 200000L |
#define I2C_TIMEOUT 30000 |
#define I2C_START 0x08 |
#define I2C_REPEATED_START 0x10 |
#define I2C_TX_SLA_ACK 0x18 |
#define I2C_TX_DATA_ACK 0x28 |
#define I2C_RX_SLA_ACK 0x40 |
#define I2C_RX_DATA_ACK 0x50 |
//############################################################################ |
extern unsigned char twi_state; |
extern unsigned char motor; |
extern unsigned char motorread; |
extern unsigned char motor_rx[8]; |
void i2c_init (void); // I2C initialisieren |
char i2c_start (void); // Start I2C |
void i2c_stop (void); // Stop I2C |
char i2c_write_byte (char byte); // 1 Byte schreiben |
#endif |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/uart.c |
---|
0,0 → 1,642 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// + |
// + GPS read out: |
// + modified Version of the Pitschu Brushless Ufo - (c) Peter Schulten, Mülheim, Germany |
// + only for non-profit use |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
#include "uart.h" |
unsigned char DebugGetAnforderung = 0,DebugDisplayAnforderung = 0,DebugDataAnforderung = 0,GetVersionAnforderung = 0; |
unsigned volatile char SioTmp = 0; |
unsigned volatile char SendeBuffer[MAX_SENDE_BUFF]; |
unsigned volatile char RxdBuffer[MAX_EMPFANGS_BUFF]; |
unsigned volatile char NMEABuffer[MAX_EMPFANGS_BUFF]; |
unsigned volatile char NeuerDatensatzEmpfangen = 0; |
unsigned volatile char NeueKoordinateEmpfangen = 0; |
unsigned volatile char UebertragungAbgeschlossen = 1; |
unsigned volatile char CntCrcError = 0; |
unsigned volatile char AnzahlEmpfangsBytes = 0; |
unsigned volatile char PC_DebugTimeout = 0; |
unsigned char PcZugriff = 100; |
unsigned char MotorTest[4] = {0,0,0,0}; |
unsigned char MeineSlaveAdresse; |
struct str_DebugOut DebugOut; |
struct str_Debug DebugIn; |
struct str_VersionInfo VersionInfo; |
int Debug_Timer; |
static uint8_t gpsState; |
#define GPS_EMPTY 0 |
#define GPS_SYNC1 1 |
#define GPS_SYNC2 2 |
#define GPS_CLASS 3 |
#define GPS_LEN1 4 |
#define GPS_LEN2 5 |
#define GPS_FILLING 6 |
#define GPS_CKA 7 |
#define GPS_CKB 8 |
gpsInfo_t actualPos; // measured position (last gps record) |
#define SYNC_CHAR1 0xb5 |
#define SYNC_CHAR2 0x62 |
#define CLASS_NAV 0x01 |
#define MSGID_POSECEF 0x01 |
#define MSGID_STATUS 0x03 |
#define MSGID_VELECEF 0x11 |
#define MSGID_POSUTM 0x08 |
#define MSGID_VELNED 0x12 |
typedef struct { |
unsigned long ITOW; // time of week |
uint8_t GPSfix; // GPSfix Type, range 0..6 |
uint8_t Flags; // Navigation Status Flags |
uint8_t DiffS; // Differential Status |
uint8_t res; // reserved |
unsigned long TTFF; // Time to first fix (millisecond time tag) |
unsigned long MSSS; // Milliseconds since Startup / Reset |
uint8_t packetStatus; |
} NAV_STATUS_t; |
typedef struct { |
unsigned long ITOW; // time of week |
long LON; // longitude in 1e-07 deg |
long LAT; // lattitude |
long HEIGHT; // height in mm |
long HMSL; // height above mean sea level im mm |
unsigned long Hacc; // horizontal accuracy in mm |
unsigned long Vacc; // vertical accuracy in mm |
uint8_t packetStatus; |
} NAV_POSLLH_t; |
typedef struct { |
unsigned long ITOW; // time of week |
long EAST; // cm UTM Easting |
long NORTH; // cm UTM Nording |
long ALT; // cm altitude |
uint8_t ZONE; // UTM zone number |
uint8_t HEM; // Hemisphere Indicator (0=North, 1=South) |
uint8_t packetStatus; |
} NAV_POSUTM_t; |
typedef struct { |
unsigned long ITOW; // ms GPS Millisecond Time of Week |
long VEL_N; // cm/s NED north velocity |
long VEL_E; // cm/s NED east velocity |
long VEL_D; // cm/s NED down velocity |
unsigned long Speed; // cm/s Speed (3-D) |
unsigned long GSpeed; // cm/s Ground Speed (2-D) |
long Heading; // deg (1e-05) Heading 2-D |
unsigned long SAcc; // cm/s Speed Accuracy Estimate |
unsigned long CAcc; // deg Course / Heading Accuracy Estimate |
uint8_t packetStatus; |
} NAV_VELNED_t; |
typedef struct { |
unsigned long ITOW; // ms GPS Millisecond Time of Week |
long ECEF_X; // ecef x / cm |
long ECEF_Y; // ecef y / cm |
long ECEF_Z; // ecef z / cm |
unsigned long Pacc; // Abweichung |
uint8_t packetStatus; |
} NAV_POSECEF_t ; |
typedef struct { |
unsigned long ITOW; // ms GPS Millisecond Time of Week |
long ECEFVX; // ecef x velocity cm/s |
long ECEFVY; // ecef y velocity cm/s |
long ECEFVZ; // ecef z velocity cm/s |
unsigned long SAcc; // Abweichung |
uint8_t packetStatus; |
} NAV_VELECEF_t; |
NAV_STATUS_t navStatus; |
NAV_POSECEF_t navPosECEF; |
NAV_VELECEF_t navVelECEF; |
NAV_POSUTM_t navPosUtm; |
NAV_VELNED_t navVelNed; |
volatile char *ubxP, *ubxEp, *ubxSp; // pointers to packet currently transfered |
volatile uint8_t CK_A, CK_B; // UBX checksum bytes |
volatile unsigned short msgLen; |
volatile uint8_t msgID; |
volatile uint8_t ignorePacket; // true when previous packet was not processed |
// distance to target position |
long rollOffset; // in 10cm |
long nickOffset; |
#define GPS_INTCYCLES 100 |
#define GPS_I_LIMIT (long)(40 * MAINLOOPS_PER_SEC) |
#ifdef GPS_DEBUG // if set then the GPS data is transfered to display |
extern volatile uint8_t v24state; |
char buf[200]; |
char *bp; |
char *ep; |
#endif |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//++ Sende-Part der Datenübertragung |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(INT_VEC_TX) |
{ |
static unsigned int ptr = 0; |
unsigned char tmp_tx; |
if(!UebertragungAbgeschlossen) |
{ |
ptr++; // die [0] wurde schon gesendet |
tmp_tx = SendeBuffer[ptr]; |
if((tmp_tx == '\r') || (ptr == MAX_SENDE_BUFF)) |
{ |
ptr = 0; |
UebertragungAbgeschlossen = 1; |
} |
UDR = tmp_tx; |
} |
else ptr = 0; |
} |
void GPSscanData (void) |
{ |
if (navPosECEF.packetStatus == 1) // valid packet |
{ |
actualPos.x = navPosECEF.ECEF_X; //ECEF X in cm |
actualPos.y = navPosECEF.ECEF_Y; //ECEF Y in cm |
actualPos.z = navPosECEF.ECEF_Z; //ECEF Z in cm |
navPosECEF.packetStatus = 0; |
} |
if (navStatus.packetStatus == 1) // valid packet |
{ |
actualPos.GPSFix = navStatus.GPSfix; |
actualPos.newData = navStatus.packetStatus; |
navStatus.packetStatus = 0; |
} |
if (navVelECEF.packetStatus == 1) // valid packet |
{ |
actualPos.vx = navVelECEF.ECEFVX; //ECEF VEL X in cm/s |
actualPos.vy = navVelECEF.ECEFVY; //ECEF VEL Y in cm/s |
actualPos.vz = navVelECEF.ECEFVZ; //ECEF VEL Z in cm/s |
navVelECEF.packetStatus = 0; |
} |
if (navPosUtm.packetStatus == 1) // valid packet |
{ |
actualPos.northing = navPosUtm.NORTH; |
actualPos.easting = navPosUtm.EAST; |
actualPos.altitude = navPosUtm.ALT; |
navPosUtm.packetStatus = 0; |
} |
if (navVelNed.packetStatus == 1) |
{ |
actualPos.velNorth = navVelNed.VEL_N; |
actualPos.velEast = navVelNed.VEL_E; |
navVelNed.packetStatus = 0; |
} |
if (actualPos.newData != 0){ROT_ON;} //-> Rot blinkt mit 4Hz wenn Daten vom GPS Empfänger ankommen und brauchbar sind |
} |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//++ Empfangs-Part der Datenübertragung, incl. CRC-Auswertung |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(INT_VEC_RX) |
{ |
static unsigned int crc; |
static unsigned char crc1,crc2,buf_ptr; |
static unsigned char UartState = 0; |
unsigned char CrcOkay = 0; |
SioTmp = UDR; |
uint8_t c; |
uint8_t re; |
re = (UCSR0A & (_B1(FE0) | _B1(DOR0))); // any error occured ? |
c = SioTmp; |
#ifdef GPS_DEBUG |
*bp++ = c; |
if (bp >= (buf+200)) bp = buf; |
if (v24state == 0) |
{ |
v24state = 1; |
UDR0 = *ep++; |
if (ep >= buf+200) |
ep = buf; |
UCSR0B |= _B1(UDRIE0); //enable further irqs |
} |
#endif |
if (re == 0) |
{ |
switch (gpsState) |
{ |
case GPS_EMPTY: |
if (c == SYNC_CHAR1) |
gpsState = GPS_SYNC1; |
break; |
case GPS_SYNC1: |
if (c == SYNC_CHAR2) |
gpsState = GPS_SYNC2; |
else if (c != SYNC_CHAR1) |
gpsState = GPS_EMPTY; |
break; |
case GPS_SYNC2: |
if (c == CLASS_NAV) |
gpsState = GPS_CLASS; |
else |
gpsState = GPS_EMPTY; |
break; |
case GPS_CLASS: // msg ID seen: init packed receive |
msgID = c; |
CK_A = CLASS_NAV + c; |
CK_B = CLASS_NAV + CK_A; |
gpsState = GPS_LEN1; |
switch (msgID) |
{ |
case MSGID_STATUS: |
ubxP = (char*)&navStatus; |
ubxEp = (char*)(&navStatus + sizeof(NAV_STATUS_t)); |
ubxSp = (char*)&navStatus.packetStatus; |
ignorePacket = navStatus.packetStatus; |
break; |
case MSGID_POSECEF: |
ubxP = (char*)&navPosECEF; |
ubxEp = (char*)(&navPosECEF + sizeof(NAV_POSECEF_t)); |
ubxSp = (char*)&navPosECEF.packetStatus; |
ignorePacket = navPosECEF.packetStatus; |
break; |
case MSGID_VELECEF: |
ubxP = (char*)&navVelECEF; |
ubxEp = (char*)(&navVelECEF + sizeof(NAV_VELECEF_t)); |
ubxSp = (char*)&navVelECEF.packetStatus; |
ignorePacket = navVelECEF.packetStatus; |
break; |
case MSGID_POSUTM: |
ubxP = (char*)&navPosUtm; |
ubxEp = (char*)(&navPosUtm + sizeof(NAV_POSUTM_t)); |
ubxSp = (char*)&navPosUtm.packetStatus; |
ignorePacket = navPosUtm.packetStatus; |
break; |
case MSGID_VELNED: |
ubxP = (char*)&navVelNed; |
ubxEp = (char*)(&navVelNed + sizeof(NAV_VELNED_t)); |
ubxSp = (char*)&navVelNed.packetStatus; |
ignorePacket = navVelNed.packetStatus; |
break; |
default: |
ignorePacket = 1; |
ubxSp = (char*)0; |
} |
break; |
case GPS_LEN1: // first len byte |
msgLen = c; |
CK_A += c; |
CK_B += CK_A; |
gpsState = GPS_LEN2; |
break; |
case GPS_LEN2: // second len byte |
msgLen = msgLen + (c * 256); |
CK_A += c; |
CK_B += CK_A; |
gpsState = GPS_FILLING; // next data will be stored in packet struct |
break; |
case GPS_FILLING: |
CK_A += c; |
CK_B += CK_A; |
if ( !ignorePacket && ubxP < ubxEp) |
*ubxP++ = c; |
if (--msgLen == 0) |
gpsState = GPS_CKA; |
break; |
case GPS_CKA: |
if (c == CK_A) |
gpsState = GPS_CKB; |
else |
gpsState = GPS_EMPTY; |
break; |
case GPS_CKB: |
if (c == CK_B && ubxSp) // No error -> packet received successfully |
*ubxSp = 1; // set packetStatus in struct |
gpsState = GPS_EMPTY; // ready for next packet |
break; |
default: |
gpsState = GPS_EMPTY; // ready for next packet |
} |
} |
else // discard any data if error occured |
{ |
gpsState = GPS_EMPTY; |
GPSscanData (); //Test kann ggf. wieder gelöscht werden! |
} |
GPSscanData (); |
if(buf_ptr >= MAX_EMPFANGS_BUFF) UartState = 0; |
if(SioTmp == '\r' && UartState == 2) |
{ |
UartState = 0; |
crc -= RxdBuffer[buf_ptr-2]; |
crc -= RxdBuffer[buf_ptr-1]; |
crc %= 4096; |
crc1 = '=' + crc / 64; |
crc2 = '=' + crc % 64; |
CrcOkay = 0; |
if((crc1 == RxdBuffer[buf_ptr-2]) && (crc2 == RxdBuffer[buf_ptr-1])) CrcOkay = 1; else { CrcOkay = 0; CntCrcError++;}; |
if(!NeuerDatensatzEmpfangen && CrcOkay) // Datensatz schon verarbeitet |
{ |
NeuerDatensatzEmpfangen = 1; |
AnzahlEmpfangsBytes = buf_ptr; |
RxdBuffer[buf_ptr] = '\r'; |
if(RxdBuffer[2] == 'R') wdt_enable(WDTO_250MS); // Reset-Commando |
} |
} |
else |
switch(UartState) |
{ |
case 0: |
if(SioTmp == '#' && !NeuerDatensatzEmpfangen) UartState = 1; // Startzeichen und Daten schon verarbeitet |
buf_ptr = 0; |
RxdBuffer[buf_ptr++] = SioTmp; |
crc = SioTmp; |
break; |
case 1: // Adresse auswerten |
UartState++; |
RxdBuffer[buf_ptr++] = SioTmp; |
crc += SioTmp; |
break; |
case 2: // Eingangsdaten sammeln |
RxdBuffer[buf_ptr] = SioTmp; |
if(buf_ptr < MAX_EMPFANGS_BUFF) buf_ptr++; |
else UartState = 0; |
crc += SioTmp; |
break; |
default: |
UartState = 0; |
break; |
} |
} |
// -------------------------------------------------------------------------- |
void AddCRC(unsigned int wieviele) |
{ |
unsigned int tmpCRC = 0,i; |
for(i = 0; i < wieviele;i++) |
{ |
tmpCRC += SendeBuffer[i]; |
} |
tmpCRC %= 4096; |
SendeBuffer[i++] = '=' + tmpCRC / 64; |
SendeBuffer[i++] = '=' + tmpCRC % 64; |
SendeBuffer[i++] = '\r'; |
UebertragungAbgeschlossen = 0; |
UDR = SendeBuffer[0]; |
} |
// -------------------------------------------------------------------------- |
void SendOutData(unsigned char cmd,unsigned char modul, unsigned char *snd, unsigned char len) |
{ |
unsigned int pt = 0; |
unsigned char a,b,c; |
unsigned char ptr = 0; |
SendeBuffer[pt++] = '#'; // Startzeichen |
SendeBuffer[pt++] = modul; // Adresse (a=0; b=1,...) |
SendeBuffer[pt++] = cmd; // Commando |
while(len) |
{ |
if(len) { a = snd[ptr++]; len--;} else a = 0; |
if(len) { b = snd[ptr++]; len--;} else b = 0; |
if(len) { c = snd[ptr++]; len--;} else c = 0; |
SendeBuffer[pt++] = '=' + (a >> 2); |
SendeBuffer[pt++] = '=' + (((a & 0x03) << 4) | ((b & 0xf0) >> 4)); |
SendeBuffer[pt++] = '=' + (((b & 0x0f) << 2) | ((c & 0xc0) >> 6)); |
SendeBuffer[pt++] = '=' + ( c & 0x3f); |
} |
AddCRC(pt); |
} |
// -------------------------------------------------------------------------- |
void Decode64(unsigned char *ptrOut, unsigned char len, unsigned char ptrIn,unsigned char max) // Wohin mit den Daten; Wie lang; Wo im RxdBuffer |
{ |
unsigned char a,b,c,d; |
unsigned char ptr = 0; |
unsigned char x,y,z; |
while(len) |
{ |
a = RxdBuffer[ptrIn++] - '='; |
b = RxdBuffer[ptrIn++] - '='; |
c = RxdBuffer[ptrIn++] - '='; |
d = RxdBuffer[ptrIn++] - '='; |
if(ptrIn > max - 2) break; // nicht mehr Daten verarbeiten, als empfangen wurden |
x = (a << 2) | (b >> 4); |
y = ((b & 0x0f) << 4) | (c >> 2); |
z = ((c & 0x03) << 6) | d; |
if(len--) ptrOut[ptr++] = x; else break; |
if(len--) ptrOut[ptr++] = y; else break; |
if(len--) ptrOut[ptr++] = z; else break; |
} |
} |
// -------------------------------------------------------------------------- |
void BearbeiteRxDaten(void) |
{ |
if(!NeuerDatensatzEmpfangen) return; |
unsigned int tmp_int_arr1[1]; |
unsigned int tmp_int_arr2[2]; |
unsigned int tmp_int_arr3[3]; |
unsigned char tmp_char_arr2[2]; |
unsigned char tmp_char_arr3[3]; |
unsigned char tmp_char_arr4[4]; |
//if(!MotorenEin) |
PcZugriff = 255; |
switch(RxdBuffer[2]) |
{ |
case 'c':// Debugdaten incl. Externe IOs usw |
Decode64((unsigned char *) &DebugIn,sizeof(DebugIn),3,AnzahlEmpfangsBytes); |
/* for(unsigned char i=0; i<4;i++) |
{ |
EE_CheckAndWrite(&EE_Buffer[EE_DEBUGWERTE + i*2], DebugIn.Analog[i]); |
EE_CheckAndWrite(&EE_Buffer[EE_DEBUGWERTE + i*2 + 1], DebugIn.Analog[i] >> 8); |
}*/ |
//RemoteTasten |= DebugIn.RemoteTasten; |
DebugDataAnforderung = 1; |
break; |
case 'h':// x-1 Displayzeilen |
Decode64((unsigned char *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes); |
RemoteTasten |= tmp_char_arr2[0]; |
DebugDisplayAnforderung = 1; |
break; |
case 't':// Motortest |
Decode64((unsigned char *) &MotorTest[0],sizeof(MotorTest),3,AnzahlEmpfangsBytes); |
break; |
case 'v': // Version-Anforderung und Ausbaustufe |
GetVersionAnforderung = 1; |
break; |
case 'g':// "Get"-Anforderung für Debug-Daten |
// Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
DebugGetAnforderung = 1; |
break; |
case 'q':// "Get"-Anforderung für Settings |
// Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
Decode64((unsigned char *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes); |
if(tmp_char_arr2[0] != 0xff) |
{ |
if(tmp_char_arr2[0] > 5) tmp_char_arr2[0] = 5; |
ReadParameterSet(tmp_char_arr2[0], (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
SendOutData('L' + tmp_char_arr2[0] -1,MeineSlaveAdresse,(unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE); |
} |
else |
SendOutData('L' + GetActiveParamSetNumber()-1,MeineSlaveAdresse,(unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE); |
break; |
case 'l': |
case 'm': |
case 'n': |
case 'o': |
case 'p': // Parametersatz speichern |
Decode64((unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE,3,AnzahlEmpfangsBytes); |
WriteParameterSet(RxdBuffer[2] - 'l' + 1, (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], RxdBuffer[2] - 'l' + 1); // aktiven Datensatz merken |
Piep(GetActiveParamSetNumber()); |
break; |
} |
// DebugOut.AnzahlZyklen = Debug_Timer_Intervall; |
NeuerDatensatzEmpfangen = 0; |
} |
//############################################################################ |
//Routine für die Serielle Ausgabe |
int uart_putchar (char c) |
//############################################################################ |
{ |
if (c == '\n') |
uart_putchar('\r'); |
//Warten solange bis Zeichen gesendet wurde |
loop_until_bit_is_set(USR, UDRE); |
//Ausgabe des Zeichens |
UDR = c; |
return (0); |
} |
// -------------------------------------------------------------------------- |
void WriteProgramData(unsigned int pos, unsigned char wert) |
{ |
//if (ProgramLocation == IN_RAM) Buffer[pos] = wert; |
// else eeprom_write_byte(&EE_Buffer[pos], wert); |
// Buffer[pos] = wert; |
} |
//############################################################################ |
//INstallation der Seriellen Schnittstelle |
void UART_Init (void) |
//############################################################################ |
{ |
//Enable TXEN im Register UCR TX-Data Enable & RX Enable |
UCR=(1 << TXEN) | (1 << RXEN); |
// UART Double Speed (U2X) |
USR |= (1<<U2X); |
// RX-Interrupt Freigabe |
UCSRB |= (1<<RXCIE); |
// TX-Interrupt Freigabe |
UCSRB |= (1<<TXCIE); |
//Teiler wird gesetzt |
UBRR=(SYSCLK / (BAUD_RATE * 8L) - 1); |
//UBRR = 33; |
//öffnet einen Kanal für printf (STDOUT) |
//fdevopen (uart_putchar, 0); |
//sbi(PORTD,4); |
Debug_Timer = SetDelay(200); |
gpsState = GPS_EMPTY; |
} |
//--------------------------------------------------------------------------------------------- |
void DatenUebertragung(void) |
{ |
static char dis_zeile = 0; |
if(!UebertragungAbgeschlossen) return; |
if(DebugGetAnforderung && UebertragungAbgeschlossen) // Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
{ |
SendOutData('G',MeineSlaveAdresse,(unsigned char *) &DebugIn,sizeof(DebugIn)); |
DebugGetAnforderung = 0; |
} |
if((CheckDelay(Debug_Timer) || DebugDataAnforderung) && UebertragungAbgeschlossen) |
{ |
SendOutData('D',MeineSlaveAdresse,(unsigned char *) &DebugOut,sizeof(DebugOut)); |
DebugDataAnforderung = 0; |
Debug_Timer = SetDelay(MIN_DEBUG_INTERVALL); |
} |
if(DebugDisplayAnforderung && UebertragungAbgeschlossen) |
{ |
Menu(); |
DebugDisplayAnforderung = 0; |
if(++dis_zeile == 4) |
{ |
SendOutData('4',0,&PPM_in,sizeof(PPM_in)); // DisplayZeile übertragen |
dis_zeile = -1; |
} |
else SendOutData('0' + dis_zeile,0,&DisplayBuff[20 * dis_zeile],20); // DisplayZeile übertragen |
} |
if(GetVersionAnforderung && UebertragungAbgeschlossen) |
{ |
SendOutData('V',MeineSlaveAdresse,(unsigned char *) &VersionInfo,sizeof(VersionInfo)); |
GetVersionAnforderung = 0; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/uart.h |
---|
0,0 → 1,119 |
#ifndef _UART_H |
#define _UART_H |
#define MAX_SENDE_BUFF 150 |
#define MAX_EMPFANGS_BUFF 150 |
extern unsigned char DebugGetAnforderung; |
extern unsigned volatile char SendeBuffer[MAX_SENDE_BUFF]; |
extern unsigned volatile char RxdBuffer[MAX_EMPFANGS_BUFF]; |
extern unsigned volatile char UebertragungAbgeschlossen; |
extern unsigned volatile char PC_DebugTimeout; |
extern unsigned volatile char NeueKoordinateEmpfangen; |
extern unsigned char MeineSlaveAdresse; |
extern unsigned char PcZugriff; |
extern int Debug_Timer; |
extern void UART_Init (void); |
extern int uart_putchar (char c); |
extern void boot_program_page (uint32_t page, uint8_t *buf); |
extern void DatenUebertragung(void); |
extern void DecodeNMEA(void); |
extern unsigned char MotorTest[4]; |
struct str_DebugOut |
{ |
unsigned char Digital[2]; |
unsigned int Analog[32]; // Debugwerte |
}; |
extern struct str_DebugOut DebugOut; |
#define _B1(bit) (1 << (bit)) |
#define _B0(bit) (0 << (bit)) |
typedef struct |
{ |
long x; // in cm (+ = north) |
long y; // in cm (+ = east) |
long z; // in cm |
long vx; |
long vy; |
long vz; |
long northing; |
long easting; |
long altitude; |
long velNorth; |
long velEast; |
uint8_t newData; // status of data: 0 = invlid; 1 = valid |
uint8_t GPSFix; |
uint8_t noSV; // number of sats |
} gpsInfo_t; |
extern gpsInfo_t lockedPos; // stored position to fly to |
extern gpsInfo_t actualPos; // measured position (last gps record) |
extern void GPSscanData (void); |
extern void GPSupdate(void); |
extern void GPSsaveTarget (uint8_t mode); |
struct str_Debug |
{ |
unsigned char Digital[2]; |
unsigned char RemoteTasten; |
unsigned int Analog[4]; |
}; |
extern struct str_Debug DebugIn; |
struct str_VersionInfo |
{ |
unsigned char Hauptversion; |
unsigned char Nebenversion; |
unsigned char PCKompatibel; |
unsigned char Rserved[7]; |
}; |
extern struct str_VersionInfo VersionInfo; |
//Die Baud_Rate der Seriellen Schnittstelle ist 9600 Baud |
//#define BAUD_RATE 9600 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 14400 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 28800 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 38400 //Baud Rate für die Serielle Schnittstelle |
#define BAUD_RATE 57600 //Baud Rate für die Serielle Schnittstelle |
//Anpassen der seriellen Schnittstellen Register wenn ein ATMega128 benutzt wird |
#if defined (__AVR_ATmega128__) |
# define USR UCSR0A |
# define UCR UCSR0B |
# define UDR UDR0 |
# define UBRR UBRR0L |
# define EICR EICRB |
#endif |
#if defined (__AVR_ATmega32__) |
# define USR UCSRA |
# define UCR UCSRB |
# define UBRR UBRRL |
# define EICR EICRB |
# define INT_VEC_RX SIG_UART_RECV |
# define INT_VEC_TX SIG_UART_TRANS |
#endif |
#if defined (__AVR_ATmega644__) |
# define USR UCSR0A |
# define UCR UCSR0B |
# define UDR UDR0 |
# define UBRR UBRR0L |
# define EICR EICR0B |
# define TXEN TXEN0 |
# define RXEN RXEN0 |
# define RXCIE RXCIE0 |
# define TXCIE TXCIE0 |
# define U2X U2X0 |
# define UCSRB UCSR0B |
# define UDRE UDRE0 |
# define INT_VEC_RX SIG_USART_RECV |
# define INT_VEC_TX SIG_USART_TRANS |
#endif |
#endif //_UART_H |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM3Acc/version.txt |
---|
0,0 → 1,104 |
------- |
V0.53 27.04.2007 H.Buss |
- erste öffentliche Version |
V0.53b 29.04.2007 H.Buss |
- der FAKTOR_I war versehentlich auf Null, dann liegt der MikroKopter nicht so hart in der Luft |
V0.53c 29.04.2007 H.Buss |
- es gib ein Menü, in dem die Werte der Kanäle nach Nick, Roll, Gas,... sortiert sind. |
Die angezeigten Werte waren nicht die Werte der Funke |
V0.54 01.05.2007 H.Buss |
- die Paramtersätze können jetzt vor dem Start ausgewählt werden |
Dazu wird beim Kalibrieren der Messwerte (Gashebel oben links) der Nick-Rollhebel abgefragt: |
2 3 4 |
1 x 5 |
- - - |
Bedeutet: Nick-Rollhebel Links Mitte = Setting:1 Links Oben = Setting:2 usw. |
- der Faktor_I für den Hauptregler ist hinzugekommen. Im Heading-Hold-Modus sollte er vergössert werden, was Stabilität bringt |
V0.55 14.05.2007 H.Buss |
- es können nun Servos an J3,J4,J5 mit den Kanälen 5-7 gesteuert werden |
V0.56 14.05.2007 H.Buss |
- es gab Probleme mit Funken, die mehr als 8 Kanäle haben, wenn mehrere Kanäle dann auf Null waren |
- Funken, die nicht bis +-120 aussteuern können, sollten jetzt auch gehen |
V0.57 24.05.2007 H.Buss |
- Der Höhenregler kann nun auch mittels Schalter bedient werden |
- Bug im Gier-Algorithmus behoben; Schnelles Gieren fürhrte dazu, dass der MK zu weit gedreht hat |
- Kompass-Einfluss dämpfen bei Neigung |
- Man kann zwischen Kompass FIX (Richtung beim Kalibrieren) und Variabel (einstellbar per Gier) wählen |
- Der Motortest vom Kopter-Tool geht jetzt |
- Man kann den Parametersätzen einen Namen geben |
- Das Kamerasetting ist unter Setting 2 defaultmässig integriert |
V0.58 30.05.2007 H.Buss |
- Der Höhenregler-Algorithmus wird nun umgangen, wenn der Höhenreglerschalter aus ist |
V0.60 17.08.2007 H.Buss |
- "Schwindel-Bug" behoben |
- Die Poti-Werte werden jetzt auf Unterlauf (<0) überprüft |
- Poti4 zugefügt |
- Es werden jetzt 8 Kanäle ausgewertet |
- Kamera-Servo (an J7) |
- Die Settings müssen überschrieben werden |
V0.61 - V0.63 H.Buss 27.09.2007 |
- Poti 4 und Kanal 8 werden im Menü angezeigt |
- ein paar Kleinigkeiten bei den DefaultKonstanten2 bereinigt |
- Analog.c: Aktuell_ax korrigiert |
- auf 32 Debug-Kanäle erweitert |
- Loopings sind jetzt möglich und einzeln im KopterTool freischaltbar |
- leichte Anpassungen im Gier - Geschwindigkeit und Drift |
- die Hardwareversion V1.1 wird erkannt und das Programm stellt sich auf die geänderte Gyroverstärkung und die geänderten Portpins ein |
- die Software startet nach dem Einschalten schneller, weil der Luftdruckoffset schneller gefunden wird |
- die PPM-Ausgänge liegen wieder an den Pins an |
- Details an der Sensordatenverarbeitung -> es fliegt sich geringfügig anders |
- der MK ist bei wenig Gas nicht mehr so giftig -> soll das Landen vereinfachen |
- I2C-Bus läuft jetzt sicher nach einer Störung wieder an |
- Sticksignale werden präziser ausgewertet |
- Stick-Kanäle werden ans Kopter-Tool übertragen |
- Es muss die Version V1.47 des Kopter-Tool verwendet werden |
- Die Settings werden auf Default zurückgesetzt |
- am Piepen kann man die Fehlerart unterscheiden |
1. einzelnes Piepen beim Einschalten und Kalibrieren |
2. langsames Intervall mindestens 1 Sek -> Empfangsausfall |
3. schnelleres Intervall mindestens 1 Sek -> Akku |
4. sehr schnelles Intervall mindestens 1 Sek -> Kommunikation zu den Reglern gestört |
V0.64 H.Buss 30.09.2007 |
- beim Gieren wurden die Achsen nicht hart genug geregelt |
- Höhenreglerabsenkung von -20 auf -40 (fc.c) |
- LED1 und LED2 Ansteuerung (fc.c) und (main.h) |
- geänderte Kanalbelegung K1-K8, Unterspannungsschwelle (9,5V) und StickD (fc.c) |
- P,D Anteil seperat in Variable geschrieben und auf das Analog Display Ausgegeben (Kopter Tool) |
- GPS_Nick und GPS_Roll werden nach Deaktivierung von Position-Hold auf Null gesetzt, um ein Einfrieren der GPS Steuerwerte auf den letzten Wert zu verhindern |
- Funktionsaufruf der GPS-Funktion von Chris/Hallo2 |
- UART.C für die GPS Signale im UTM Format auf Pitschu basierend |
- meine GPS.c-Routine |
- Mircos variable Filterung (funktioniert nur wenn 250ms Aufruf aktiv ist) |
- GPS wird deaktiviert und Summer eingeschaltet, wenn kein 3D-Fix (mehr) vorhanden |
- Statusanzeige auf eine LED reduziert (aus, blinkend, an) |
- blinkender LED_1 Ausgang für Positionsleuchten (einstellbar über Userparam.4) |
- Homing-Fkt. eingebaut |
- Diverse Absicherungen gegen Fehlbedienungen (z.B. nicht gelernte Home-Position, ...) |
- Rotationsmatrix mit Kompass, damit die GPS-Fkt. nicht nur nach Norden ausgerichtet funktioniert |
- dyn. Position Hold -> normaler Rundflug möglich |
- Limit_D_Anteil = Userparam3 um im Homing- bzw. Waypointmodus die Sollposition gleichmäßiger anzufliegen |
- Die Berechnung von Kompassvalue wird jetzt auch über den GPS Haken im Koptertool aktiviert |
- 12 Kanal Erweiterung (rc.c; rc.h; fc.c; fc.h; menu.c) |
- D-Anteil_Limit wegen HOMING ->> Radius von 700 cm -> 250 cm |
- ... |
(- Regelung wird nur noch alle 250 ms aufgerufen) |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/Flight-Ctrl_MEGA644_V0_64.aps |
---|
0,0 → 1,0 |
<AVRStudio><MANAGEMENT><ProjectName>Flight-Ctrl_MEGA644_V0_64</ProjectName><Created>19-Aug-2007 14:38:13</Created><LastEdit>15-Oct-2007 19:44:55</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>19-Aug-2007 14:38:13</Created><Version>4</Version><Build>4, 13, 0, 528</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>Flight-Ctrl_MEGA644_V0_64.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>E:\hubi\ufo\mickrokopter\eigene versionen\Kompass + GPS\Flight-Ctrl_V0_64_3_GPS_work_Jochenaccvonhand\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>AVR Simulator</CURRENT_TARGET><CURRENT_PART>ATmega644.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>main.c</SOURCEFILE><SOURCEFILE>analog.c</SOURCEFILE><SOURCEFILE>eeprom.c</SOURCEFILE><SOURCEFILE>fc.c</SOURCEFILE><SOURCEFILE>GPS.c</SOURCEFILE><SOURCEFILE>menu.c</SOURCEFILE><SOURCEFILE>printf_P.c</SOURCEFILE><SOURCEFILE>rc.c</SOURCEFILE><SOURCEFILE>timer0.c</SOURCEFILE><SOURCEFILE>twimaster.c</SOURCEFILE><SOURCEFILE>uart.c</SOURCEFILE><SOURCEFILE>compass.c</SOURCEFILE><HEADERFILE>_Settings.h</HEADERFILE><HEADERFILE>analog.h</HEADERFILE><HEADERFILE>fc.h</HEADERFILE><HEADERFILE>gps.h</HEADERFILE><HEADERFILE>main.h</HEADERFILE><HEADERFILE>menu.h</HEADERFILE><HEADERFILE>old_macros.h</HEADERFILE><HEADERFILE>printf_P.h</HEADERFILE><HEADERFILE>rc.h</HEADERFILE><HEADERFILE>Settings.h</HEADERFILE><HEADERFILE>timer0.h</HEADERFILE><HEADERFILE>twimaster.h</HEADERFILE><HEADERFILE>uart.h</HEADERFILE><HEADERFILE>compass.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega644</PART><HEX>1</HEX><LIST>0</LIST><MAP>0</MAP><OUTPUTFILENAME>Flight-Ctrl_MEGA644_V0_60.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -O0 -fsigned-char</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20070525\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20070525\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/></IOView><Files><File00000><FileId>00000</FileId><FileName>main.c</FileName><Status>1</Status></File00000><File00001><FileId>00001</FileId><FileName>compass.c</FileName><Status>1</Status></File00001><File00002><FileId>00002</FileId><FileName>compass.h</FileName><Status>1</Status></File00002><File00003><FileId>00003</FileId><FileName>fc.c</FileName><Status>1</Status></File00003></Files><Workspace><File00000><Position>346 108 878 484</Position><LineCol>155 3</LineCol></File00000><File00001><Position>355 114 901 482</Position><LineCol>0 0</LineCol></File00001><File00002><Position>377 136 923 504</Position><LineCol>0 0</LineCol></File00002><File00003><Position>336 71 1048 624</Position><LineCol>834 19</LineCol><State>Maximized</State></File00003></Workspace><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio> |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/GPS.c |
---|
0,0 → 1,300 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 10.2007 by Jochen Kromayer |
// + es handelt sich um eine Beta-Software, die zu nichtkommerziellen Zwecken frei veröffentlich und weitergegeben werden darf. Für evtl. |
// + Personen- und/der Sachschäden ist jegliche Haftung ausgeschlossen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
#include "math.h" |
//Sinusfunktion von 0° bis 359°. Ergebnis wurde mit 1000 multipliziert, damit als Definition platzsparend int |
//verwendet werden kann. d.h., es muss also in der späteren Berechnung noch mit 0,001 multipliziert werden //(090907Kr) |
const int c_sin[] = {0,17,34,52,69,87,104,121,139,156,173,190, |
207,224,241,258,275,292,309,325,342,358,374,390,406,422,438,453,469,484,500,515,529,544,559,573,587,601,615,629, |
642,656,669,682,694,707,719,731,743,754,766,777,788,798,809,819,829,838,848,857,866,874,882,891,898,906,913,920, |
927,933,939,945,951,956,961,965,970,974,978,981,984,987,990,992,994,996,997,998,999,999,1000,999,999,998,997,996, |
994,992,990,987,984,981,978,974,970,965,961,956,951,945,939,933,927,920,913,906,898,891,882,874,866,857,848,838, |
829,819,809,798,788,777,766,754,743,731,719,707,694,682,669,656,642,629,615,601,587,573,559,544,529,515,500,484, |
469,453,438,422,406,390,374,358,342,325,309,292,275,258,241,224,207,190,173,156,139,121,104,87,69,52,34,17,0,-17, |
-34,-52,-69,-87,-104,-121,-139,-156,-173,-190,-207,-224,-241,-258,-275,-292,-309,-325,-342,-358,-374,-390,-406, |
-422,-438,-453,-469,-484,-500,-515,-529,-544,-559,-573,-587,-601,-615,-629,-642,-656,-669,-682,-694,-707,-719, |
-731,-743,-754,-766,-777,-788,-798,-809,-819,-829,-838,-848,-857,-866,-874,-882,-891,-898,-906,-913,-920,-927, |
-933,-939,-945,-951,-956,-961,-965,-970,-974,-978,-981,-984,-987,-990,-992,-994,-996,-997,-998,-999,-999,-1000, |
-999,-999,-998,-997,-996,-994,-992,-990,-987,-984,-981,-978,-974,-970,-965,-961,-956,-951,-945,-939,-933,-927, |
-920,-913,-906,-898,-891,-882,-874,-866,-857,-848,-838,-829,-819,-809,-798,-788,-777,-766,-754,-743,-731,-719, |
-707,-694,-682,-669,-656,-642,-629,-615,-601,-587,-573,-559,-544,-529,-515,-500,-484,-469,-453,-438,-422,-406, |
-390,-374,-358,-342,-325,-309,-292,-275,-258,-241,-224,-207,-190,-173,-156,-139,-121,-104,-87,-69,-52,-34,-17}; |
//Cosinusfunktion von 0° bis 359°. Ergebnis wurde mit 1000 multipliziert, damit als Definition platzsparend int |
//verwendet werden kann. D.h., es muss also in der späteren Berechnung noch mit 0,001 multipliziert werden //(090907Kr) |
const int c_cos[] = {1000,999,999,998,997,996,994,992,990,987,984,981, |
978,974,970,965,961,956,951,945,939,933,927,920,913,906,898,891,882,874,866,857,848,838,829,819,809,798,788,777, |
766,754,743,731,719,707,694,682,669,656,642,629,615,601,587,573,559,544,529,515,500,484,469,453,438,422,406,390, |
374,358,342,325,309,292,275,258,241,224,207,190,173,156,139,121,104,87,69,52,34,17,0,-17,-34,-52,-69,-87,-104, |
-121,-139,-156,-173,-190,-207,-224,-241,-258,-275,-292,-309,-325,-342,-358,-374,-390,-406,-422,-438,-453,-469, |
-484,-500,-515,-529,-544,-559,-573,-587,-601,-615,-629,-642,-656,-669,-682,-694,-707,-719,-731,-743,-754,-766, |
-777,-788,-798,-809,-819,-829,-838,-848,-857,-866,-874,-882,-891,-898,-906,-913,-920,-927,-933,-939,-945,-951, |
-956,-961,-965,-970,-974,-978,-981,-984,-987,-990,-992,-994,-996,-997,-998,-999,-999,-1000,-999,-999,-998,-997, |
-996,-994,-992,-990,-987,-984,-981,-978,-974,-970,-965,-961,-956,-951,-945,-939,-933,-927,-920,-913,-906,-898, |
-891,-882,-874,-866,-857,-848,-838,-829,-819,-809,-798,-788,-777,-766,-754,-743,-731,-719,-707,-694,-682,-669, |
-656,-642,-629,-615,-601,-587,-573,-559,-544,-529,-515,-500,-484,-469,-453,-438,-422,-406,-390,-374,-358,-342, |
-325,-309,-292,-275,-258,-241,-224,-207,-190,-173,-156,-139,-121,-104,-87,-69,-52,-34,-17,0,17,34,52,69,87, |
104,121,139,156,173,190,207,224,241,258,275,292,309,325,342,358,374,390,406,422,438,453,469,484,500,515,529,544, |
559,573,587,601,615,629,642,656,669,682,694,707,719,731,743,754,766,777,788,798,809,819,829,838,848,857,866,874, |
882,891,898,906,913,920,927,933,939,945,951,956,961,965,970,974,978,981,984,987,990,992,994,996,997,998,999,999}; |
long Soll_Position_North = 0; |
long Soll_Position_East = 0; |
long GPS_Positionsabweichung_North = 0; |
long GPS_Positionsabweichung_East = 0; |
long GPS_Geschwindigkeit_North = 0; |
long GPS_Geschwindigkeit_East = 0; |
long P_Einfluss_North = 0; |
long D_Einfluss_North = 0; |
long P_Einfluss_East = 0; |
long D_Einfluss_East = 0; |
signed int GPS_North = 0; |
signed int GPS_East = 0; |
signed int GPS_Nick = 0; |
signed int GPS_Roll = 0; |
volatile char gethome = 0; //Flag ob GPS_Home_Position gelernt ist //(280807Kr) |
long GPS_Home_North = 0; |
long GPS_Home_East = 0; |
unsigned char blinkcount_LED2 = 0; //Hilfszähler für die blinkende LED (010907Kr) |
//**************************** MIRCOS DEFINITIONSANFANG FÜR DIE FILTERUNG |
// Filterung der GPS Messwerte vom Ublox-Empfänger. Es wird der gleitende Durchschnitt aus n Messwerten gebildet |
#define MITTELWERTZAHL 8 // Anzahl der Messwerte fuer gleitenden Mittelwert |
volatile char NeuerMittelwert = 0; //Flag ob ein neuer Mittelwert vorliegt, der mit 4 Hz berechnet wird, da nur dann neue Messwerte vom GPS vorliegen |
volatile unsigned char FilterPos = 0; |
volatile long NORTH_MITTEL = 0; |
volatile long EAST_MITTEL = 0; |
volatile long long NORTH_LONG_LONG = 0; |
volatile long long EAST_LONG_LONG = 0; |
volatile int filterfilled = 0; |
typedef struct { |
long NORTH[MITTELWERTZAHL]; |
} FILTER_NORTH; // Filterdefinition für die Positions-Nordwerte aus dem GPS-Empfänger |
typedef struct { |
long EAST[MITTELWERTZAHL]; |
} FILTER_EAST; // Filterdefinition für die Positions-Ostwerte aus dem GPS-Empfänger |
FILTER_NORTH filter_north; |
FILTER_EAST filter_east; |
//**************************** MIRCOS DEFINITIONSENDE FÜR DIE FILTERUNG |
void gps_main(void) |
{ |
//**************************** MIRCOS FILTERUNG ANFANG |
// if(actualPos.GPSFix == 3 && actualPos.newData == 1) //bilde neuen Positionsmittelwert, wenn 3D-Fix und neue GPS-Daten vorliegen |
if(actualPos.GPSFix == 3) // hier auskommentieren, wenn dauernd (also nicht nur alle 250ms) die GPS-Berechnung durchgeführt werden soll |
{ |
filter_north.NORTH[FilterPos] = actualPos.northing; |
filter_east.EAST[FilterPos] = actualPos.easting; |
FilterPos++; |
if (FilterPos==MITTELWERTZAHL) FilterPos=0; |
if (filterfilled<MITTELWERTZAHL) filterfilled++; |
NORTH_LONG_LONG = 0; |
EAST_LONG_LONG = 0; |
for (int i=0; i<filterfilled; i++) |
{ |
NORTH_LONG_LONG += filter_north.NORTH[i]; |
EAST_LONG_LONG += filter_east.EAST[i]; |
} |
NORTH_LONG_LONG /= filterfilled; |
EAST_LONG_LONG /= filterfilled; |
NORTH_MITTEL = NORTH_LONG_LONG; |
EAST_MITTEL = EAST_LONG_LONG; |
NeuerMittelwert = 1; |
//actualPos.newData = 0; // hier auskommentieren, wenn dauernd (also nicht nur alle 250ms) die GPS-Berechnung durchgeführt werden soll |
} |
//******************************* MIRCOS FILTERUNG ENDE |
//wenn kein 3D-Fix vorhanden, über das Poti jedoch irgendeine GPS Funktion aktiv ist, werden die GPS-Steuerbefehle |
//auf Null gesetzt, um unkontrolliertes Wegfliegen durch das GPS zu verhindern. Dadurch wird abgesichert |
//(auch im laufenden Flug), dass bei einem Verlust der GPS-Verbindung GPS deaktivert wird |
if (actualPos.GPSFix < 3 && Poti3 > 70) |
{ |
GPS_Nick = 0; |
GPS_Roll = 0; |
LED2_OFF; |
beeptime = 50; |
} |
// speichert die GPS_Home_Position beim 3D-Fix, MotorEINschalten und wenn noch nicht zu weit weggeflogen wurde |
// (modell_fliegt_gps < 2000) einmalig ab. Die Flugzeitabfrage sichert ab, dass bei einem Losfliegen ohne 3D-Fix die Home_Positinen |
// irgendwann später dort gelernt werden, wo dann zu ersten mal ein 3D-Fix vorhanden ist |
if (actualPos.GPSFix == 3 && MotorenEin == 1 && gethome == 0 && modell_fliegt_gps < 2000) |
{ |
GPS_Home_North = NORTH_MITTEL; |
GPS_Home_East = EAST_MITTEL; |
// Muss hier auch eingelernt werden, damit falls das Poti3 beim Motorenstarten in |
// Mittelstellung sein sollte, trotzdem schon eine Sollposition vorliegt. Andernfalls würde |
// GPS_Nick und _Roll maximal werden bis zum ersten Mal Stick_Nick und _Roll gesteuert würde |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
beeptime = 50; |
gethome = 1; |
} |
//löscht die GPS_Home_Position beim MotorAUSschalten wieder und resetet das Flag gethome //(280807Kr) |
if (MotorenEin == 0) |
{ |
GPS_Home_North = 0; |
GPS_Home_East = 0; |
gethome = 0; |
modell_fliegt_gps = 0; |
} |
// wenn Schalter ausgeschaltet, dann wird die LED2 ausgeschaltet und das GPS Steuerkommando gelöscht |
if(Poti3 < 70) |
{ |
// Sollpositionen müssen auch hier beschrieben werden, damit ausgeschlossen ist, dass falls gelandet wird und die GPS-Funktion |
// über Poti3 deaktivert und anschließend wieder aktiviert wird keine Soll-Positionen vorliegen. |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
GPS_Nick = 0; |
GPS_Roll = 0; |
LED2_OFF; |
} |
// wenn 3D-Fix, Schalter im mittleren Bereich und vom Pilot gesteuert wird, wird ständig neue GPS-Sollposition eingelernt |
if(actualPos.GPSFix == 3 && Poti3 > 70 && Poti3 < 150 && (StickNick > 12 || StickNick < -12 || StickRoll > 12 || StickRoll < -12)) |
{ |
GPS_Nick = 0; //wird genullt, damit das letzte GPS Kommando nicht ständig gegen den Piloten ansteuert |
GPS_Roll = 0; //wird genullt, damit das letzte GPS Kommando nicht ständig gegen den Piloten ansteuert |
Soll_Position_North = NORTH_MITTEL; // Soll-Position wird geschrieben |
Soll_Position_East = EAST_MITTEL; // Soll-Position wird geschrieben |
//++++++++++++++++++++++++++++++++++++ |
//Sorgt lediglich dafür, dass die LED2 langsam blinkt. Dauer ist durch die "> x" Abfrage festgelegt |
//++++++++++++++++++++++++++++++++++++ |
if(blinkcount_LED2 >= 200) // maximal erlaubt 255 wegen unsigned char |
{ |
LED2_FLASH; |
blinkcount_LED2 = 0; |
} |
blinkcount_LED2++; |
//++++++++++++++++++++++++++++++++++++ |
} |
// wenn 3D-Fix, Schalter im mittleren Bereich (oder höher), neuer Mittelwert vorhanden, wenigstens einmal Sollposition gelernt und der Pilot nicht selbst steuert wird eine GPS-Funktion aktiviert |
if (actualPos.GPSFix == 3 && Poti3 > 70 && NeuerMittelwert == 1 && Soll_Position_North != 0 && Soll_Position_East != 0 && StickNick <= 12 && StickNick >= -12 && StickRoll <= 12 && StickRoll >= -12) |
{ |
//Berechnung der GPS-Positionsabweichung je nach aktivierter GPS-Funktion (GPS_HOLD oder HOMING) |
//DYNAMISCHES GPS-HOLD, wenn Schalter noch in Mittelstellung ist wird die zuletzt gelernte Soll_Position angeflogen |
if(Poti3 < 150) |
{ |
GPS_Positionsabweichung_North = (Soll_Position_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (Soll_Position_East - EAST_MITTEL); |
LED2_ON; |
} |
//andernfalls, wenn Schalter in max. Stellung und zusätzlich die GPS_Home_Positionen beim Motorenstarten gelernt |
//werden konnten, wird zur GPS_Home_Position geflogen |
if (Poti3 >= 150 && GPS_Home_North != 0 && GPS_Home_East != 0) |
{ |
GPS_Positionsabweichung_North = (GPS_Home_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (GPS_Home_East - EAST_MITTEL); |
// durch das ständige Neulernen der Soll_Positionen während HOMING wird erreicht, dass der MK nach dem Umschalten |
// von HOMING zurück zu GPS-HOLD nicht wieder an die alte Soll_Position zurück fliegt |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
LED2_ON; |
} |
//verhindert, dass beim Umschalten von Mittelstellung (GPS_HOLD) auf Maximalstellung (HOMING) OHNE gelernte Homeposition |
//die GPS Funktion unkontrolliert steuert. Daher wird GPS_HOLD aktiv gehalten, die Sollpositon wird bei Stickbefehlen |
//jedoch nicht wie beim dynamischen GPS_HOLD überschrieben. Zusätzlich wird der Summer eingeschaltet. |
if (Poti3 >= 150 && GPS_Home_North == 0 && GPS_Home_East == 0) |
{ |
GPS_Positionsabweichung_North = (Soll_Position_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (Soll_Position_East - EAST_MITTEL); |
LED2_ON; |
beeptime = 50; |
} |
//GPS-Geschwindigkeiten |
GPS_Geschwindigkeit_North = actualPos.velNorth; //actualPos.velNorth ist die Geschwindigkeiten aus dem GPS Empfänger entlang der Nord-Süd Richtung |
GPS_Geschwindigkeit_East = actualPos.velEast; //actualPos.velEast ist die Geschwindigkeiten aus dem GPS Empfänger entlang der Ost-West Richtung |
//Berechnung der Einzelkomponenten des PD-Reglers |
P_Einfluss_North = (P_GPS_Verstaerkung * GPS_Positionsabweichung_North)*0.0005; //entspricht einer Skalierung von 1/2000 |
D_Einfluss_North = (D_GPS_Verstaerkung * GPS_Geschwindigkeit_North)*0.00333; //entspricht einer Skalierung von 1/300 |
P_Einfluss_East = (P_GPS_Verstaerkung * GPS_Positionsabweichung_East)*0.0005; //entspricht einer Skalierung von 1/2000 |
D_Einfluss_East = (D_GPS_Verstaerkung * GPS_Geschwindigkeit_East)*0.00333; //entspricht einer Skalierung von 1/300 |
// Begrenzung des maximalen D-Anteils für pos. und neg. Werte. Grenze muss so geählt werden, |
// dass das Limit im normalen Position-Hold nicht erreicht wird und somit keinen Einfluss hat. |
// Grund: Beim Zufliegen auf weiter entfernte Ziele bremst der D-Anteil kurz vor dem Ziel den Mikrokopter sehr stark ab. |
// Dieses Limit wirkt nur, wenn sich der MK im HOMING Modus befindet und sich noch weit (>2,5m) von der Home-Position weg befindet. |
if (Poti3 >= 150 && GPS_Home_North != 0 && GPS_Home_East != 0 && (abs(GPS_Positionsabweichung_North) > 250 || abs(GPS_Positionsabweichung_East) > 250)) |
{ |
if (D_Einfluss_North > Limit_D_Anteil) D_Einfluss_North = Limit_D_Anteil; |
if (D_Einfluss_East > Limit_D_Anteil) D_Einfluss_East = Limit_D_Anteil; |
if (D_Einfluss_North < -1 * Limit_D_Anteil) D_Einfluss_North = -1 * Limit_D_Anteil; |
if (D_Einfluss_East < -1 * Limit_D_Anteil) D_Einfluss_East = -1 * Limit_D_Anteil; |
} |
// PD-Regler |
GPS_North = (-P_Einfluss_North + D_Einfluss_North); |
GPS_East = (P_Einfluss_East - D_Einfluss_East); |
//Umrechnen vom globalen North- bzw. East- in das körperfeste X- bzw. Y- Koordinatensystem |
GPS_Nick = (-c_sin[KompassValue]*0.001*GPS_East + c_cos[KompassValue]*0.001*GPS_North); // die "0" kann später durch den Messwert des Kompasssensors (KompassValue/0.01745329251) ersetzt werden |
GPS_Roll = (c_cos[KompassValue]*0.001*GPS_East + c_sin[KompassValue]*0.001*GPS_North); // die "0" kann später durch den Messwert des Kompasssensors (KompassValue/180*3.1415926535) ersetzt werden |
// Begrenzung des maximalen GPS Einflusses für positive und negative Werte |
if (GPS_Nick > 35) GPS_Nick = 35; |
if (GPS_Roll > 35) GPS_Roll = 35; |
if (GPS_Nick < -35) GPS_Nick = -35; |
if (GPS_Roll < -35) GPS_Roll = -35; |
//Funktion wird dadurch nur alle 250 ms aufgerufen, wenn neue Mittelwerte aus den GPS-Daten vorliegen. |
//FUNKTIONIERT MOMENTAN NOCH NICHT, DA STÄNDIG OHNE UNTERBRECHUNG NEUE MITTELWERTE BERECHNET WERDEN. |
//GRUND: DIE ABFRAGE NACH NEUE GPS-DATEN ERFOLGT NOCH NICHT |
NeuerMittelwert = 0; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/License.txt |
---|
0,0 → 1,52 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + Nur für den privaten Gebrauch |
// + www.MikroKopter.com |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
// + dass eine Nutzung (auch auszugsweise) nur für den privaten und nichtkommerziellen Gebrauch zulässig ist. |
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
// + bzgl. der Nutzungsbedingungen aufzunehmen. |
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
// + Verkauf von Luftbildaufnahmen, usw. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
// + eindeutig als Ursprung verlinkt und genannt werden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
// + Benutzung auf eigene Gefahr |
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
// + mit unserer Zustimmung zulässig |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
// + this list of conditions and the following disclaimer. |
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
// + from this software without specific prior written permission. |
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
// + for non-profit use (directly or indirectly) |
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
// + with our written permission |
// + * If sources or documentations are redistributet, our webpage (http://www.MikroKopter.de) must be |
// + clearly linked and named as origin |
// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/MIKROKOPTER_TO_DO.txt |
---|
0,0 → 1,11 |
. Patricks neigungskompensierten Kompass |
. Aufruf der GPS.c innerhalb der fc.c nur wenn neue Daten vorliegen |
. innerhalb der GPS.c den PD-Regler nicht mit "NeuerMittelwert", sondern mit "actualpos.newdata" alle 250ms aufrufen |
. GPS-Empfänger auf 5Hz einstellen |
. Begrenzung von 35 auf 50 anheben, damit auch bei stärkerem Wind geflogen werden kann |
. Waypoints |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/Parameter.txt |
---|
0,0 → 1,15 |
bei leichtem, konstantem Wind |
P-Faktor(Userparam_1): 120 |
D-Faktor(Userparam_2): 90 |
D-Anteil_Limit(Userparam_3): 45 |
bei stärkerem, böhigem Wind: |
P-Faktor(Userparam_1): 150 |
D-Faktor(Userparam_2): 95 |
D-Anteil_Limit(Userparam_3): 45 |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/README_Nickk666Kompass.pdf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/Setting_1.mkp |
---|
0,0 → 1,51 |
[Setup] |
Name=GPS |
GlobalConfig=43 |
[Channels] |
Gas=3 |
Gier=2 |
Nick=1 |
Roll=4 |
Poti_1=5 |
Poti_2=6 |
Poti_3=7 |
Poti_4=8 |
[Stick] |
Nick_Roll-P=4 |
Nick_Roll-D=0 |
Gier-P=16 |
[Altitude] |
Setpoint=254 |
MinGas=30 |
P=10 |
Barometric-D=50 |
Z-ACC-Effect=50 |
Gain=2 |
[Gyro] |
P=120 |
I=150 |
ACC_Gyro-Factor=26 |
Main-I=0 |
[Others] |
MinGas=5 |
MaxGas=250 |
Compass-Effect=64 |
UnderVoltage=95 |
NotGas=66 |
NotGasTime=60 |
[User] |
Parameter_1=251 |
Parameter_2=252 |
Parameter_3=35 |
Parameter_4=60 |
[Camera] |
ServoNickControl=100 |
ServoNickCompensation=40 |
ServoNickInvert=0 |
ServoNickMin=50 |
ServoNickMax=150 |
ServoNickRefreshRate=5 |
[Loop] |
Config=0 |
GasLimit=50 |
StickThreshold=90 |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/Settings.h |
---|
--- alpha/v064JokoGPSNick666MM_1_1/_Settings.h (nonexistent) |
+++ alpha/v064JokoGPSNick666MM_1_1/_Settings.h (revision 2762) |
@@ -0,0 +1,50 @@ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Testmodi |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define MOTOR_OFF 0 |
+#define MOTOR_TEST 0 |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Abstimmung |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define ACC_AMPLIFY 16 |
+#define FAKTOR_P 1 |
+#define FAKTOR_I 0.0001 |
+ |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Debug-Interface |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define SIO_DEBUG 1 // Soll der Debugger aktiviert sein? |
+#define MIN_DEBUG_INTERVALL 500 // in diesem Intervall werden Degugdaten ohne Aufforderung gesendet |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Sender |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ #define K_NICK 0 |
+ #define K_ROLL 1 |
+ #define K_GAS 2 |
+ #define K_GIER 3 |
+ #define K_POTI1 4 |
+ #define K_POTI2 5 |
+ #define K_POTI3 6 |
+ #define K_POTI4 7 |
+// +++++++++++++++++++++++++++++++ |
+// + Getestete Settings: |
+// +++++++++++++++++++++++++++++++ |
+// Setting: Kamera |
+// Stick_P:3 |
+// Stick_D:0 |
+// Gyro_P: 175 |
+// Gyro_I: 175 |
+// Ki_Anteil: 10 |
+// +++++++++++++++++++++++++++++++ |
+// + Getestete Settings: |
+// +++++++++++++++++++++++++++++++ |
+// Setting: Normal |
+// Stick_P:2 |
+// Stick_D:8 |
+// Gyro_P: 80 |
+// Gyro_I: 150 |
+// Ki_Anteil: 5 |
+ |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/analog.c |
---|
0,0 → 1,172 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
volatile int Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az, UBat = 100; |
volatile int AccumulateNick = 0, AccumulateRoll = 0, AccumulateGier = 0; |
volatile int accumulate_AccRoll = 0,accumulate_AccNick = 0,accumulate_AccHoch = 0; |
volatile char MessanzahlNick = 0, MessanzahlRoll = 0, MessanzahlGier = 0; |
volatile char messanzahl_AccNick = 0, messanzahl_AccRoll = 0, messanzahl_AccHoch = 0; |
volatile long Luftdruck = 32000; |
volatile int StartLuftdruck; |
volatile unsigned int MessLuftdruck = 1023; |
unsigned char DruckOffsetSetting; |
volatile int HoeheD = 0; |
volatile char messanzahl_Druck; |
volatile int tmpLuftdruck; |
volatile unsigned int ZaehlMessungen = 0; |
//####################################################################################### |
// |
void ADC_Init(void) |
//####################################################################################### |
{ |
ADMUX = 0;//Referenz ist extern |
ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE); |
//Free Running Mode, Division Factor 128, Interrupt on |
} |
void SucheLuftruckOffset(void) |
{ |
unsigned int off; |
off = eeprom_read_byte(&EEPromArray[EEPROM_ADR_LAST_OFFSET]); |
if(off > 20) off -= 10; |
OCR0A = off; |
Delay_ms(100); |
if(MessLuftdruck < 850) off = 0; |
for(; off < 250;off++) |
{ |
OCR0A = off; |
Delay_ms(50); |
printf("."); |
if(MessLuftdruck < 900) break; |
} |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_LAST_OFFSET], off); |
DruckOffsetSetting = off; |
Delay_ms(300); |
} |
//####################################################################################### |
// |
SIGNAL(SIG_ADC) |
//####################################################################################### |
{ |
static unsigned char kanal=0,state = 0; |
signed int wert; |
ANALOG_OFF; |
switch(state++) |
{ |
case 0: |
wert = (signed int) AdNeutralGier - ADC; |
if(PlatinenVersion != 10) wert *= 2; |
AccumulateGier += wert; // |
MessanzahlGier++; |
Mess_Integral_Gier += wert;// / 16; |
Mess_Integral_Gier2 += wert; |
kanal = 1; |
ZaehlMessungen++; |
break; |
case 1: |
wert = (signed int) ADC - AdNeutralRoll; |
if(PlatinenVersion != 10) wert *= 2; |
Mess_IntegralRoll += wert; |
Mess_IntegralRoll2 += wert; |
if(Mess_IntegralRoll > 310000L) Mess_IntegralRoll = -290000L; |
if(Mess_IntegralRoll <-310000L) Mess_IntegralRoll = 290000L; |
if(ADC < 15) wert = -1000; |
if(ADC < 7) wert = -2000; |
if(ADC > 1010) wert = +1000; |
if(ADC > 1017) wert = +2000; |
AccumulateRoll += wert; |
MessanzahlRoll++; |
kanal = 2; |
break; |
case 2: |
wert = (signed int) ADC - AdNeutralNick; |
if(PlatinenVersion != 10) wert *= 2; |
Mess_IntegralNick += wert; |
Mess_IntegralNick2 += wert; |
if(Mess_IntegralNick > 310000L) Mess_IntegralNick = -290000L; |
if(Mess_IntegralNick <-310000L) Mess_IntegralNick = 290000L; |
if(ADC < 15) wert = -1000; |
if(ADC < 7) wert = -2000; |
if(ADC > 1010) wert = +1000; |
if(ADC > 1017) wert = +2000; |
AccumulateNick += wert; |
MessanzahlNick++; |
kanal = 4; |
break; |
case 3: |
UBat = (3 * UBat + ADC / 3) / 4;//(UBat + ((ADC * 39) / 256) + 19) / 2; |
kanal = 6; |
break; |
case 4: |
Aktuell_ay = NeutralAccY - ADC; |
accumulate_AccRoll += Aktuell_ay; |
messanzahl_AccRoll++; |
kanal = 7; |
break; |
case 5: |
Aktuell_ax = ADC - NeutralAccX; |
accumulate_AccNick += Aktuell_ax; |
messanzahl_AccNick++; |
kanal = 5; |
state = 6; |
break; |
case 6: |
accumulate_AccHoch = (signed int) ADC - NeutralAccZ; |
accumulate_AccHoch += abs(Aktuell_ay) / 4 + abs(Aktuell_ax) / 4; |
if(accumulate_AccHoch > 1) |
{ |
if(NeutralAccZ < 800) NeutralAccZ+= 0.02; |
} |
else if(accumulate_AccHoch < -1) |
{ |
if(NeutralAccZ > 600) NeutralAccZ-= 0.02; |
} |
messanzahl_AccHoch = 1; |
Aktuell_az = ADC; |
Mess_Integral_Hoch += accumulate_AccHoch; // Integrieren |
Mess_Integral_Hoch -= Mess_Integral_Hoch / 1024; // dämfen |
// Mess_Integral_Hoch -= Mess_Integral_Hoch / 512; // dämfen |
/* if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
kanal = 3; |
state = 7; |
} |
else |
{ |
kanal = 0; |
state = 0; |
}*/ |
kanal = 3; |
state = 7; |
break; |
case 7: |
tmpLuftdruck += ADC; |
if(++messanzahl_Druck >= 5) |
{ |
MessLuftdruck = ADC; |
messanzahl_Druck = 0; |
HoeheD = (int)(StartLuftdruck - tmpLuftdruck - HoehenWert); // D-Anteil = neuerWert - AlterWert |
Luftdruck = (tmpLuftdruck + 3 * Luftdruck) / 4; |
HoehenWert = StartLuftdruck - Luftdruck; |
tmpLuftdruck = 0; |
} |
kanal = 0; |
state = 0; |
break; |
default: |
kanal = 0; |
state = 0; |
break; |
} |
ADMUX = kanal; |
ANALOG_ON; |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/analog.h |
---|
0,0 → 1,23 |
/*####################################################################################### |
#######################################################################################*/ |
extern volatile int UBat; |
extern volatile int AccumulateNick, AccumulateRoll, AccumulateGier,accumulate_AccRoll,accumulate_AccNick,accumulate_AccHoch; |
extern volatile char MessanzahlNick, MessanzahlRoll, MessanzahlGier,messanzahl_AccNick, messanzahl_AccRoll,messanzahl_AccHoch; |
extern volatile int Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az; |
extern volatile long Luftdruck; |
extern volatile char messanzahl_Druck; |
extern volatile unsigned int ZaehlMessungen; |
extern unsigned char DruckOffsetSetting; |
extern volatile int HoeheD; |
extern volatile unsigned int MessLuftdruck; |
extern volatile int StartLuftdruck; |
extern unsigned int ReadADC(unsigned char adc_input); |
extern void ADC_Init(void); |
extern void SucheLuftruckOffset(void); |
#define ANALOG_OFF ADCSRA=0 |
#define ANALOG_ON ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE) |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/compass.c |
---|
0,0 → 1,230 |
/* |
Copyright 2007, Niklas Nold |
This program (files compass.c and compass.h) is free software; you can redistribute it and/or modify |
it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; |
either version 3 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
Please note: All the other files for the project "Mikrokopter" by H. Buss are under the license (license_buss.txt) published by www.mikrokopter.de |
*/ |
#include "main.h" |
MM3_struct MM3; |
int8_t Kompass_Offset[2] EEMEM; // X_off[0], Y_off[1], Z_off[2] |
int8_t X_off, Y_off, Z_off; |
//############################################################################ |
// Initialisierung |
void MM3_init(void) |
//############################################################################ |
{ |
SPCR = (1<<SPIE)|(1<<SPE)|(1<<MSTR)|(1<<SPR1)|(1<<SPR0); //Interrupt an, Master, 156 kHz Oszillator |
//SPSR = (1<<SPI2X); |
DDRB |= (1<<PB7)|(1<<PB5)|(1<<PB2); // J8, MOSI, SCK Ausgang |
PORTD &= ~(1<<PD3); // J5 auf Low |
MM3.AXIS = MM3_X; |
MM3.STATE = MM3_RESET; |
// Kalibrierung aus dem EEprom lesen |
X_off = (int8_t)eeprom_read_byte(&Kompass_Offset[0]); |
Y_off = (int8_t)eeprom_read_byte(&Kompass_Offset[1]); |
Z_off = (int8_t)eeprom_read_byte(&Kompass_Offset[2]); |
//X_off = -11; |
//Y_off = 30; |
//Z_off = 18; |
} |
//############################################################################ |
// Wird in der SIGNAL (SIG_OVERFLOW0) aufgerufen |
void MM3_timer0(void) |
//############################################################################ |
{ |
switch (MM3.STATE) |
{ |
case MM3_RESET: |
PORTB |= (1<<PB2); // J8 auf High, MM3 Reset |
MM3.STATE = MM3_START_TRANSFER; |
return; |
case MM3_START_TRANSFER: |
PORTB &= ~(1<<PB2); // J8 auf Low (war ~125 µs auf High) |
if (MM3.AXIS == MM3_X) SPDR = 0x31; // Schreiben ins SPDR löst automatisch Übertragung (MOSI und MISO) aus |
else if (MM3.AXIS == MM3_Y) SPDR = 0x32; // Micromag Period Select ist auf 256 (0x30) |
else if (MM3.AXIS == MM3_Z) SPDR = 0x33; // 1: x-Achse, 2: Y-Achse, 3: Z-Achse |
MM3.DRDY = SetDelay(8); // Laut Datenblatt max. Zeit bis Messung fertig (bei PS 256 eigentlich 4 ms) |
MM3.STATE = MM3_WAIT_DRDY; |
return; |
case MM3_WAIT_DRDY: |
if (CheckDelay(MM3.DRDY)) {SPDR = 0x00;MM3.STATE = MM3_DRDY;} // Irgendwas ins SPDR, damit Übertragung ausgelöst wird, wenn Wartezeit vorbei |
return; // Jetzt gehts weiter in SIGNAL (SIG_SPI) |
/* |
case MM3_TILT: // Zeitnahe Speicherung der aktuellen Neigung in ° |
MM3.NickGrad = IntegralNick/(EE_Parameter.UserParam1*8); |
MM3.RollGrad = IntegralRoll/(EE_Parameter.UserParam2*8); |
MM3.AXIS = MM3_X; |
MM3.STATE = MM3_RESET; |
return; |
*/ |
} |
} |
//############################################################################ |
// SPI byte ready |
SIGNAL (SIG_SPI) |
//############################################################################ |
{ |
switch (MM3.STATE) |
{ |
case MM3_DRDY: // 1. Byte ist da, abspeichern, an die MSB-Stelle rücken |
if (MM3.AXIS == MM3_X) |
{ |
MM3.x_axis = SPDR; |
MM3.x_axis <<= 8; |
} |
else if (MM3.AXIS == MM3_Y) |
{ |
MM3.y_axis = SPDR; |
MM3.y_axis <<= 8; |
} |
else // if (MM3.AXIS == MM3_Z) |
{ |
MM3.z_axis = SPDR; |
MM3.z_axis <<= 8; |
} |
SPDR=0x00; // Übertragung von 2. Byte auslösen |
MM3.STATE=MM3_BYTE2; |
return; |
case MM3_BYTE2: // 2. Byte der entsprechenden Achse ist da |
if (MM3.AXIS == MM3_X) |
{ |
MM3.x_axis |= SPDR; |
// Spikes filtern |
if (abs(MM3.x_axis) < Max_Axis_Value) MM3.x_axis_old = MM3.x_axis; |
else MM3.x_axis = MM3.x_axis_old; |
MM3.AXIS = MM3_Y; |
MM3.STATE = MM3_RESET; |
} |
else if (MM3.AXIS == MM3_Y) |
{ |
MM3.y_axis |= SPDR; |
if (abs(MM3.y_axis) < Max_Axis_Value) MM3.y_axis_old = MM3.y_axis; |
else MM3.y_axis = MM3.y_axis_old; |
MM3.AXIS = MM3_Z; |
MM3.STATE = MM3_RESET; |
} |
else // if (MM3.AXIS == MM3_Z) |
{ |
MM3.z_axis |= SPDR; |
if (abs(MM3.z_axis) < Max_Axis_Value) MM3.z_axis_old = MM3.z_axis; |
else MM3.z_axis = MM3.z_axis_old; |
MM3.AXIS = MM3_X; |
MM3.STATE = MM3_RESET; |
} |
return; |
} |
} |
//############################################################################ |
// Kompass kalibrieren |
void MM3_calib(void) |
//############################################################################ |
{ |
signed int x_min=0,x_max=0,y_min=0,y_max=0,z_min=0,z_max=0; |
uint8_t measurement=50,beeper=0; |
unsigned int timer; |
while (measurement) |
{ |
//H_earth = MM3.x_axis*MM3.x_axis + MM3.y_axis*MM3.y_axis + MM3.z_axis*MM3.z_axis; |
if (MM3.x_axis > x_max) x_max = MM3.x_axis; |
else if (MM3.x_axis < x_min) x_min = MM3.x_axis; |
if (MM3.y_axis > y_max) y_max = MM3.y_axis; |
else if (MM3.y_axis < y_min) y_min = MM3.y_axis; |
if (MM3.z_axis > z_max) z_max = MM3.z_axis; |
else if (MM3.z_axis < z_min) z_min = MM3.z_axis; |
if (!beeper) |
{ |
beeper = 50; |
beeptime = 50; |
} |
beeper--; |
// Schleife mit 100 Hz voll ausreichend |
timer = SetDelay(10); |
while(!CheckDelay(timer)); |
// Wenn Gas zurück genommen wird, Kalibrierung mit Verzögerung beenden |
if (PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] < 100) measurement--; |
} |
// Offset der Achsen berechnen |
X_off = (x_max + x_min) / 2; |
Y_off = (y_max + y_min) / 2; |
Z_off = (z_max + z_min) / 2; |
// und im EEProm abspeichern |
eeprom_write_byte(&Kompass_Offset[0], X_off); |
eeprom_write_byte(&Kompass_Offset[1], Y_off); |
eeprom_write_byte(&Kompass_Offset[2], Z_off); |
} |
//############################################################################ |
// Neigungskompensierung und Berechnung der Ausrichtung |
signed int MM3_heading(void) |
//############################################################################ |
{ |
float sin_nick, cos_nick, sin_roll, cos_roll; |
signed int x_corr, y_corr, heading; |
signed int x_axis,y_axis,z_axis; |
MM3.NickGrad = IntegralNick/(EE_Parameter.UserParam4*8); |
MM3.RollGrad = IntegralRoll/(EE_Parameter.UserParam4*8); |
// Berechung von sinus und cosinus |
sin_nick = sin_f(MM3.NickGrad); |
cos_nick = cos_f(MM3.NickGrad); |
sin_roll = sin_f(MM3.RollGrad); |
cos_roll = cos_f(MM3.RollGrad); |
// Offset der Achsen nur bei Bedarf (also hier) berücksichtigen |
x_axis = MM3.x_axis - X_off; |
y_axis = MM3.y_axis - Y_off; |
z_axis = MM3.z_axis - Z_off; |
// Neigungskompensation |
x_corr = (cos_nick * x_axis) - (((sin_roll * y_axis) - (cos_roll * z_axis)) * sin_nick); |
y_corr = ((cos_roll * y_axis) + (sin_roll * z_axis)); |
// Winkelberechnung |
heading = atan2_i(x_corr, y_corr); |
return (heading); |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/compass.h |
---|
0,0 → 1,37 |
typedef struct |
{ |
uint8_t STATE; |
unsigned int DRDY; |
uint8_t AXIS; |
signed int x_axis; |
signed int x_axis_old; |
signed int y_axis; |
signed int y_axis_old; |
signed int z_axis; |
signed int z_axis_old; |
signed int NickGrad; |
signed int RollGrad; |
}MM3_struct; |
extern MM3_struct MM3; |
extern int8_t X_off, Y_off, Z_off; |
void MM3_init(void); |
void MM3_timer0(void); |
void MM3_calib(void); |
signed int MM3_heading(void); |
#define Max_Axis_Value 500 |
// Die Werte der Statemachine |
#define MM3_RESET 0 |
#define MM3_START_TRANSFER 1 |
#define MM3_WAIT_DRDY 2 |
#define MM3_DRDY 4 |
#define MM3_BYTE2 8 |
#define MM3_X 16 |
#define MM3_Y 32 |
#define MM3_Z 64 |
#define MM3_TILT 128 |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/eeprom.c |
---|
--- alpha/v064JokoGPSNick666MM_1_1/fc.c (nonexistent) |
+++ alpha/v064JokoGPSNick666MM_1_1/fc.c (revision 2762) |
@@ -0,0 +1,1028 @@ |
+/*####################################################################################### |
+Flight Control |
+#######################################################################################*/ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Copyright (c) 04.2007 Holger Buss |
+// + Nur für den privaten Gebrauch |
+// + www.MikroKopter.com |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
+// + dass eine Nutzung (auch auszugsweise) nur für den privaten (nicht-kommerziellen) Gebrauch zulässig ist. |
+// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
+// + bzgl. der Nutzungsbedingungen aufzunehmen. |
+// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
+// + Verkauf von Luftbildaufnahmen, usw. |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
+// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
+// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
+// + eindeutig als Ursprung verlinkt werden |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
+// + Benutzung auf eigene Gefahr |
+// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
+// + mit unserer Zustimmung zulässig |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
+// + this list of conditions and the following disclaimer. |
+// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
+// + from this software without specific prior written permission. |
+// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
+// + for non-commercial use (directly or indirectly) |
+// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
+// + with our written permission |
+// + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
+// + clearly linked as origin |
+// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
+// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
+// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
+// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
+// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
+// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
+// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
+// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
+// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
+// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
+// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
+// + POSSIBILITY OF SUCH DAMAGE. |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+#include "main.h" |
+ |
+unsigned char h,m,s; |
+volatile unsigned int I2CTimeout = 100; |
+volatile int MesswertNick,MesswertRoll,MesswertGier; |
+volatile int AdNeutralNick = 0,AdNeutralRoll = 0,AdNeutralGier = 0; |
+volatile int Mittelwert_AccNick, Mittelwert_AccRoll,Mittelwert_AccHoch, NeutralAccX=0, NeutralAccY=0; |
+volatile float NeutralAccZ = 0; |
+unsigned char CosinusNickWinkel = 0, CosinusRollWinkel = 0; |
+volatile long IntegralNick = 0,IntegralNick2 = 0; |
+volatile long IntegralRoll = 0,IntegralRoll2 = 0; |
+volatile long Integral_Gier = 0; |
+volatile long Mess_IntegralNick = 0,Mess_IntegralNick2 = 0; |
+volatile long Mess_IntegralRoll = 0,Mess_IntegralRoll2 = 0; |
+volatile long Mess_Integral_Gier = 0,Mess_Integral_Gier2 = 0; |
+volatile long Mess_Integral_Hoch = 0; |
+volatile int KompassValue = 0; |
+volatile int KompassStartwert = 0; |
+volatile int KompassRichtung = 0; |
+unsigned char MAX_GAS,MIN_GAS; |
+unsigned char Notlandung = 0; |
+unsigned char HoehenReglerAktiv = 0; |
+ |
+unsigned char blinkcount_LED1 = 0;//Hilfszähler für die blinkende LED (310807Kr) |
+unsigned int modell_fliegt_gps = 0;//(030907Kr) |
+unsigned char Limit_D_Anteil = 0;//(210907Kr) |
+ |
+float GyroFaktor; |
+float IntegralFaktor; |
+ |
+volatile int DiffNick,DiffRoll; |
+int Poti1 = 0, Poti2 = 0, Poti3 = 0, Poti4 = 0, Poti5 = 0, Poti6 = 0, Poti7 = 0, Poti8 = 0; //PPM24-Erweiterung (121007Kr) |
+volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
+unsigned char MotorWert[5]; |
+volatile unsigned char SenderOkay = 0; |
+int StickNick = 0,StickRoll = 0,StickGier = 0; |
+char MotorenEin = 0; |
+int HoehenWert = 0; |
+int SollHoehe = 0; |
+unsigned char Looping_Nick = 0,Looping_Roll = 0; |
+ |
+float Kp = FAKTOR_P; |
+float Ki = FAKTOR_I; |
+ |
+unsigned char Parameter_Luftdruck_D = 48; // Wert : 0-250 |
+unsigned char Parameter_MaxHoehe = 251; // Wert : 0-250 |
+unsigned char Parameter_Hoehe_P = 16; // Wert : 0-32 |
+unsigned char Parameter_Hoehe_ACC_Wirkung = 58; // Wert : 0-250 |
+unsigned char Parameter_KompassWirkung = 64; // Wert : 0-250 |
+unsigned char Parameter_Gyro_P = 150; // Wert : 10-250 |
+unsigned char Parameter_Gyro_I = 150; // Wert : 0-250 |
+unsigned char Parameter_Gier_P = 2; // Wert : 1-20 |
+unsigned char Parameter_I_Faktor = 10; // Wert : 1-20 |
+unsigned char Parameter_UserParam1 = 0; |
+unsigned char Parameter_UserParam2 = 0; |
+unsigned char Parameter_UserParam3 = 0; |
+unsigned char Parameter_UserParam4 = 0; |
+unsigned char Parameter_ServoNickControl = 100; |
+unsigned char Parameter_LoopGasLimit = 70; |
+struct mk_param_struct EE_Parameter; |
+ |
+void Piep(unsigned char Anzahl) |
+{ |
+ while(Anzahl--) |
+ { |
+ if(MotorenEin) return; //auf keinen Fall im Flug! |
+ beeptime = 100; |
+ Delay_ms(250); |
+ } |
+} |
+ |
+//############################################################################ |
+// Nullwerte ermitteln |
+void SetNeutral(void) |
+//############################################################################ |
+{ |
+ unsigned int timer; |
+ NeutralAccX = 0; |
+ NeutralAccY = 0; |
+ NeutralAccZ = 0; |
+ AdNeutralNick = 0; |
+ AdNeutralRoll = 0; |
+ AdNeutralGier = 0; |
+ CalibrierMittelwert(); |
+ timer = SetDelay(5); |
+ while (!CheckDelay(timer)); |
+ CalibrierMittelwert(); |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
+ { |
+ if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset(); |
+ } |
+ |
+ if(PlatinenVersion == 10) |
+ { |
+ AdNeutralNick= abs(MesswertNick); |
+ AdNeutralRoll= abs(MesswertRoll); |
+ AdNeutralGier= abs(MesswertGier); |
+ } |
+ else |
+ { |
+ AdNeutralNick= abs(MesswertNick) / 2; |
+ AdNeutralRoll= abs(MesswertRoll) / 2; |
+ AdNeutralGier= abs(MesswertGier) / 2; |
+ } |
+ NeutralAccY = abs(Mittelwert_AccRoll) / ACC_AMPLIFY; |
+ NeutralAccX = abs(Mittelwert_AccNick) / ACC_AMPLIFY; |
+ NeutralAccZ = Aktuell_az; |
+ |
+ Mess_IntegralNick = 0; |
+ Mess_IntegralNick2 = 0; |
+ Mess_IntegralRoll = 0; |
+ Mess_IntegralRoll2 = 0; |
+ Mess_Integral_Gier = 0; |
+ MesswertNick = 0; |
+ MesswertRoll = 0; |
+ MesswertGier = 0; |
+ StartLuftdruck = Luftdruck; |
+ HoeheD = 0; |
+ Mess_Integral_Hoch = 0; |
+ KompassStartwert = KompassValue; |
+ beeptime = 50; |
+} |
+ |
+//############################################################################ |
+// Bildet den Mittelwert aus den Messwerten |
+void Mittelwert(void) |
+//############################################################################ |
+{ |
+ // ADC auschalten, damit die Werte sich nicht während der Berechnung ändern |
+ ANALOG_OFF; |
+ if(MessanzahlNick) (MesswertNick = AccumulateNick / MessanzahlNick); |
+ if(MessanzahlRoll) (MesswertRoll = AccumulateRoll / MessanzahlRoll); |
+ if(MessanzahlGier) (MesswertGier = AccumulateGier / MessanzahlGier); |
+ if(messanzahl_AccNick) Mittelwert_AccNick = ((long)Mittelwert_AccNick * 7 + ((ACC_AMPLIFY * (long)accumulate_AccNick) / messanzahl_AccNick)) / 8L; |
+ if(messanzahl_AccRoll) Mittelwert_AccRoll = ((long)Mittelwert_AccRoll * 7 + ((ACC_AMPLIFY * (long)accumulate_AccRoll) / messanzahl_AccRoll)) / 8L; |
+ if(messanzahl_AccHoch) Mittelwert_AccHoch = ((long)Mittelwert_AccHoch * 7 + ((long)accumulate_AccHoch) / messanzahl_AccHoch) / 8L; |
+ AccumulateNick = 0; MessanzahlNick = 0; |
+ AccumulateRoll = 0; MessanzahlRoll = 0; |
+ AccumulateGier = 0; MessanzahlGier = 0; |
+ accumulate_AccRoll = 0;messanzahl_AccRoll = 0; |
+ accumulate_AccNick = 0;messanzahl_AccNick = 0; |
+ accumulate_AccHoch = 0;messanzahl_AccHoch = 0; |
+ Integral_Gier = Mess_Integral_Gier; |
+// Integral_Gier2 = Mess_Integral_Gier2; |
+ IntegralNick = Mess_IntegralNick; |
+ IntegralRoll = Mess_IntegralRoll; |
+ IntegralNick2 = Mess_IntegralNick2; |
+ IntegralRoll2 = Mess_IntegralRoll2; |
+ // ADC einschalten |
+ ANALOG_ON; |
+ |
+/* |
+//------------------------------------------------------------------------------ |
+ if(MesswertNick > 200) MesswertNick += 4 * (MesswertNick - 200); |
+ else |
+ if(MesswertNick < -200) MesswertNick += 4 * (MesswertNick + 200); |
+ if(MesswertRoll > 200) MesswertRoll += 4 * (MesswertRoll - 200); |
+ else |
+ if(MesswertRoll < -200) MesswertRoll += 4 * (MesswertRoll + 200); |
+//------------------------------------------------------------------------------ |
+*/ |
+ if(Poti1 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110) Poti1++; else if(Poti1 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110 && Poti1) Poti1--; |
+ if(Poti2 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110) Poti2++; else if(Poti2 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110 && Poti2) Poti2--; |
+ if(Poti3 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110) Poti3++; else if(Poti3 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110 && Poti3) Poti3--; |
+ if(Poti4 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110) Poti4++; else if(Poti4 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110 && Poti4) Poti4--; |
+ //PPM24-Erweiterung (121007Kr) |
+ if(Poti5 < PPM_in[9] + 110) Poti5++; else if(Poti5 > PPM_in[9] + 110 && Poti5) Poti5--; |
+ if(Poti6 < PPM_in[10] + 110) Poti6++; else if(Poti6 > PPM_in[10] + 110 && Poti6) Poti6--; |
+ if(Poti7 < PPM_in[11] + 110) Poti7++; else if(Poti7 > PPM_in[11] + 110 && Poti7) Poti7--; |
+ if(Poti8 < PPM_in[12] + 110) Poti8++; else if(Poti8 > PPM_in[12] + 110 && Poti8) Poti8--; |
+ |
+ |
+ if(Poti1 < 0) Poti1 = 0; else if(Poti1 > 255) Poti1 = 255; |
+ if(Poti2 < 0) Poti2 = 0; else if(Poti2 > 255) Poti2 = 255; |
+ if(Poti3 < 0) Poti3 = 0; else if(Poti3 > 255) Poti3 = 255; |
+ if(Poti4 < 0) Poti4 = 0; else if(Poti4 > 255) Poti4 = 255; |
+ //PPM24-Erweiterung (121007Kr) |
+ if(Poti5 < 0) Poti5 = 0; else if(Poti5 > 255) Poti5 = 255; |
+ if(Poti6 < 0) Poti6 = 0; else if(Poti6 > 255) Poti6 = 255; |
+ if(Poti7 < 0) Poti7 = 0; else if(Poti7 > 255) Poti7 = 255; |
+ if(Poti8 < 0) Poti8 = 0; else if(Poti8 > 255) Poti8 = 255; |
+} |
+ |
+//############################################################################ |
+// Messwerte beim Ermitteln der Nullage |
+void CalibrierMittelwert(void) |
+//############################################################################ |
+{ |
+ // ADC auschalten, damit die Werte sich nicht während der Berechnung ändern |
+ ANALOG_OFF; |
+ if(MessanzahlNick) (MesswertNick = AccumulateNick / MessanzahlNick); |
+ if(MessanzahlRoll) (MesswertRoll = AccumulateRoll / MessanzahlRoll); |
+ if(MessanzahlGier) (MesswertGier = AccumulateGier / MessanzahlGier); |
+ if(messanzahl_AccNick) Mittelwert_AccNick = ((ACC_AMPLIFY * (long)accumulate_AccNick) / messanzahl_AccNick); |
+ if(messanzahl_AccRoll) Mittelwert_AccRoll = (ACC_AMPLIFY * (long)accumulate_AccRoll) / messanzahl_AccRoll; |
+ if(messanzahl_AccHoch) Mittelwert_AccHoch = ((long)accumulate_AccHoch) / messanzahl_AccHoch; |
+ AccumulateNick = 0; MessanzahlNick = 0; |
+ AccumulateRoll = 0; MessanzahlRoll = 0; |
+ AccumulateGier = 0; MessanzahlGier = 0; |
+ accumulate_AccRoll = 0;messanzahl_AccRoll = 0; |
+ accumulate_AccNick = 0;messanzahl_AccNick = 0; |
+ accumulate_AccHoch = 0;messanzahl_AccHoch = 0; |
+ // ADC einschalten |
+ ANALOG_ON; |
+ if(Poti1 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110) Poti1++; else if(Poti1 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110 && Poti1) Poti1--; |
+ if(Poti2 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110) Poti2++; else if(Poti2 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110 && Poti2) Poti2--; |
+ if(Poti3 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110) Poti3++; else if(Poti3 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110 && Poti3) Poti3--; |
+ if(Poti4 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110) Poti4++; else if(Poti4 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110 && Poti4) Poti4--; |
+ //PPM24-Erweiterung (121007Kr) |
+ if(Poti5 < PPM_in[9] + 110) Poti5++; else if(Poti5 > PPM_in[9] + 110 && Poti5) Poti5--; |
+ if(Poti6 < PPM_in[10] + 110) Poti6++; else if(Poti6 > PPM_in[10] + 110 && Poti6) Poti6--; |
+ if(Poti7 < PPM_in[11] + 110) Poti7++; else if(Poti7 > PPM_in[11] + 110 && Poti7) Poti7--; |
+ if(Poti8 < PPM_in[12] + 110) Poti8++; else if(Poti8 > PPM_in[12] + 110 && Poti8) Poti8--; |
+ |
+ |
+ |
+ |
+ if(Poti1 < 0) Poti1 = 0; else if(Poti1 > 255) Poti1 = 255; |
+ if(Poti2 < 0) Poti2 = 0; else if(Poti2 > 255) Poti2 = 255; |
+ if(Poti3 < 0) Poti3 = 0; else if(Poti3 > 255) Poti3 = 255; |
+ if(Poti4 < 0) Poti4 = 0; else if(Poti4 > 255) Poti4 = 255; |
+ //PPM24-Erweiterung (121007Kr) |
+ if(Poti5 < 0) Poti5 = 0; else if(Poti5 > 255) Poti5 = 255; |
+ if(Poti6 < 0) Poti6 = 0; else if(Poti6 > 255) Poti6 = 255; |
+ if(Poti7 < 0) Poti7 = 0; else if(Poti7 > 255) Poti7 = 255; |
+ if(Poti8 < 0) Poti8 = 0; else if(Poti8 > 255) Poti8 = 255; |
+} |
+ |
+//############################################################################ |
+// Senden der Motorwerte per I2C-Bus |
+void SendMotorData(void) |
+//############################################################################ |
+{ |
+ if(MOTOR_OFF || !MotorenEin) |
+ { |
+ Motor_Hinten = 0; |
+ Motor_Vorne = 0; |
+ Motor_Rechts = 0; |
+ Motor_Links = 0; |
+ if(MotorTest[0]) Motor_Vorne = MotorTest[0]; |
+ if(MotorTest[1]) Motor_Hinten = MotorTest[1]; |
+ if(MotorTest[2]) Motor_Links = MotorTest[2]; |
+ if(MotorTest[3]) Motor_Rechts = MotorTest[3]; |
+ } |
+ |
+ // DebugOut.Analog[12] = Motor_Vorne; |
+ // DebugOut.Analog[13] = Motor_Hinten; |
+ // DebugOut.Analog[14] = Motor_Links; |
+ // DebugOut.Analog[15] = Motor_Rechts; |
+ |
+ // DebugOut.Analog[12] = motor_rx[0]; //Motorstrom vorne |
+ // DebugOut.Analog[13] = motor_rx[1]; //Motorstrom hinten |
+ // DebugOut.Analog[14] = motor_rx[2]; //Motorstrom links |
+ // DebugOut.Analog[15] = motor_rx[3]; //Motorstrom rechts |
+ |
+ |
+ //Start I2C Interrupt Mode |
+ twi_state = 0; |
+ motor = 0; |
+ i2c_start(); |
+} |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Konstanten |
+// + 0-250 -> normale Werte |
+// + 251 -> Poti1 |
+// + 252 -> Poti2 |
+// + 253 -> Poti3 |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+void DefaultKonstanten1(void) |
+{ |
+ EE_Parameter.Kanalbelegung[K_NICK] = 1; |
+ EE_Parameter.Kanalbelegung[K_ROLL] = 2; |
+ EE_Parameter.Kanalbelegung[K_GAS] = 3; |
+ EE_Parameter.Kanalbelegung[K_GIER] = 4; |
+ EE_Parameter.Kanalbelegung[K_POTI1] = 5; |
+ EE_Parameter.Kanalbelegung[K_POTI2] = 6; |
+ EE_Parameter.Kanalbelegung[K_POTI3] = 7; |
+ EE_Parameter.Kanalbelegung[K_POTI4] = 8; |
+ EE_Parameter.GlobalConfig = 0;//CFG_HOEHENREGELUNG | /*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV | CFG_KOMPASS_FIX;//0x01; |
+ EE_Parameter.Hoehe_MinGas = 30; |
+ EE_Parameter.MaxHoehe = 251; // Wert : 0-32 251 -> Poti1 |
+ EE_Parameter.Hoehe_P = 10; // Wert : 0-32 |
+ EE_Parameter.Luftdruck_D = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_ACC_Wirkung = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_Verstaerkung = 4; // Wert : 0-50 |
+ EE_Parameter.Stick_P = 4; //2 // Wert : 1-6 |
+ EE_Parameter.Stick_D = 8; //8 // Wert : 0-64 |
+ EE_Parameter.Gier_P = 16; // Wert : 1-20 |
+ EE_Parameter.Gas_Min = 5; // Wert : 0-32 // (160607Kr) |
+ EE_Parameter.Gas_Max = 250; // Wert : 33-250 |
+ EE_Parameter.GyroAccFaktor = 26; // Wert : 1-64 |
+ EE_Parameter.KompassWirkung = 16; // Wert : 0-250 |
+ EE_Parameter.Gyro_P = 120; //80 // Wert : 0-250 |
+ EE_Parameter.Gyro_I = 150; // Wert : 0-250 |
+ EE_Parameter.UnterspannungsWarnung = 95; // Wert : 0-250 // (160607Kr) |
+ EE_Parameter.NotGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
+ EE_Parameter.NotGasZeit = 20; // Wert : 0-250 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen |
+ EE_Parameter.UfoAusrichtung = 0; // X oder + Formation |
+ EE_Parameter.I_Faktor = 0; |
+ EE_Parameter.UserParam1 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam2 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam3 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam4 = 120; //zur freien Verwendung |
+ EE_Parameter.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
+ EE_Parameter.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickRefresh = 5; |
+ EE_Parameter.LoopGasLimit = 50; |
+ EE_Parameter.LoopThreshold = 90; // Wert: 0-250 Schwelle für Stickausschlag |
+ EE_Parameter.LoopConfig = 0; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
+ memcpy(EE_Parameter.Name, "Sport\0", 12); |
+} |
+ |
+void DefaultKonstanten2(void) |
+{ |
+ EE_Parameter.Kanalbelegung[K_NICK] = 1; |
+ EE_Parameter.Kanalbelegung[K_ROLL] = 2; |
+ EE_Parameter.Kanalbelegung[K_GAS] = 3; |
+ EE_Parameter.Kanalbelegung[K_GIER] = 4; |
+ EE_Parameter.Kanalbelegung[K_POTI1] = 5; |
+ EE_Parameter.Kanalbelegung[K_POTI2] = 6; |
+ EE_Parameter.Kanalbelegung[K_POTI3] = 7; |
+ EE_Parameter.Kanalbelegung[K_POTI4] = 8; |
+ EE_Parameter.GlobalConfig = 0;//CFG_HOEHENREGELUNG | /*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV;//0x01; |
+ EE_Parameter.Hoehe_MinGas = 30; |
+ EE_Parameter.MaxHoehe = 251; // Wert : 0-32 251 -> Poti1 |
+ EE_Parameter.Hoehe_P = 10; // Wert : 0-32 |
+ EE_Parameter.Luftdruck_D = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_ACC_Wirkung = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_Verstaerkung = 2; // Wert : 0-50 |
+ EE_Parameter.Stick_P = 4; //2 // Wert : 1-6 |
+ EE_Parameter.Stick_D = 0; //8 // Wert : 0-64 |
+ EE_Parameter.Gier_P = 16; // Wert : 1-20 |
+ EE_Parameter.Gas_Min = 5; // Wert : 0-32 // (160607Kr) |
+ EE_Parameter.Gas_Max = 250; // Wert : 33-250 |
+ EE_Parameter.GyroAccFaktor = 26; // Wert : 1-64 |
+ EE_Parameter.KompassWirkung = 16; // Wert : 0-250 |
+ EE_Parameter.Gyro_P = 175; //80 // Wert : 0-250 |
+ EE_Parameter.Gyro_I = 175; // Wert : 0-250 |
+ EE_Parameter.UnterspannungsWarnung = 95; // Wert : 0-250 // (160607Kr) |
+ EE_Parameter.NotGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
+ EE_Parameter.NotGasZeit = 20; // Wert : 0-250 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen |
+ EE_Parameter.UfoAusrichtung = 0; // X oder + Formation |
+ EE_Parameter.I_Faktor = 0; |
+ EE_Parameter.UserParam1 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam2 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam3 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam4 = 120; //zur freien Verwendung |
+ EE_Parameter.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
+ EE_Parameter.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickRefresh = 5; |
+ EE_Parameter.LoopGasLimit = 50; |
+ EE_Parameter.LoopThreshold = 90; // Wert: 0-250 Schwelle für Stickausschlag |
+ EE_Parameter.LoopConfig = 0; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts |
+ memcpy(EE_Parameter.Name, "Kamera\0", 12); |
+} |
+ |
+ |
+//############################################################################ |
+// Trägt ggf. das Poti als Parameter ein |
+void ParameterZuordnung(void) |
+//############################################################################ |
+{ |
+ |
+ #define CHK_POTI(b,a,min,max) { if(a > 250) { if(a == 251) b = Poti1; else if(a == 252) b = Poti2; else if(a == 253) b = Poti3; else if(a == 254) b = Poti4;} else b = a; if(b <= min) b = min; else if(b >= max) b = max;} |
+ CHK_POTI(Parameter_MaxHoehe,EE_Parameter.MaxHoehe,0,255); |
+ CHK_POTI(Parameter_Luftdruck_D,EE_Parameter.Luftdruck_D,0,100); |
+ CHK_POTI(Parameter_Hoehe_P,EE_Parameter.Hoehe_P,0,100); |
+ CHK_POTI(Parameter_Hoehe_ACC_Wirkung,EE_Parameter.Hoehe_ACC_Wirkung,0,255); |
+ CHK_POTI(Parameter_KompassWirkung,EE_Parameter.KompassWirkung,0,255); |
+ CHK_POTI(Parameter_Gyro_P,EE_Parameter.Gyro_P,10,255); |
+ CHK_POTI(Parameter_Gyro_I,EE_Parameter.Gyro_I,0,255); |
+ CHK_POTI(Parameter_I_Faktor,EE_Parameter.I_Faktor,0,255); |
+ CHK_POTI(Parameter_UserParam1,EE_Parameter.UserParam1,0,255); |
+ CHK_POTI(Parameter_UserParam2,EE_Parameter.UserParam2,0,255); |
+ CHK_POTI(Parameter_UserParam3,EE_Parameter.UserParam3,0,255); |
+ CHK_POTI(Parameter_UserParam4,EE_Parameter.UserParam4,0,255); |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ CHK_POTI(Parameter_LoopGasLimit,EE_Parameter.LoopGasLimit,0,255); |
+ |
+ Ki = (float) Parameter_I_Faktor * 0.0001; |
+ MAX_GAS = EE_Parameter.Gas_Max; |
+ MIN_GAS = EE_Parameter.Gas_Min; |
+} |
+ |
+ |
+//############################################################################ |
+// |
+void MotorRegler(void) |
+//############################################################################ |
+{ |
+ int motorwert,pd_ergebnis,h,tmp_int; |
+ int GierMischanteil,GasMischanteil; |
+ static long SummeNick=0,SummeRoll=0; |
+ static long sollGier = 0,tmp_long,tmp_long2; |
+ long IntegralFehlerNick = 0; |
+ long IntegralFehlerRoll = 0; |
+ static unsigned int RcLostTimer; |
+ static unsigned char delay_neutral = 0; |
+ static unsigned char delay_einschalten = 0,delay_ausschalten = 0; |
+ static unsigned int modell_fliegt = 0; |
+ static int hoehenregler = 0; |
+ static char TimerWerteausgabe = 0; |
+ static char NeueKompassRichtungMerken = 0; |
+ Mittelwert(); |
+ |
+ GRN_ON; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gaswert ermitteln |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ GasMischanteil = PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] + 120; |
+ if(GasMischanteil < 0) GasMischanteil = 0; |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Emfang schlecht |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(SenderOkay < 100) |
+ { |
+ if(!PcZugriff) |
+ { |
+ if(BeepMuster == 0xffff) |
+ { |
+ beeptime = 15000; |
+ BeepMuster = 0x0c00; |
+ } |
+ } |
+ if(RcLostTimer) RcLostTimer--; |
+ else |
+ { |
+ MotorenEin = 0; |
+ Notlandung = 0; |
+ } |
+ ROT_ON; |
+ if(modell_fliegt > 2000) // wahrscheinlich in der Luft --> langsam absenken |
+ { |
+ GasMischanteil = EE_Parameter.NotGas; |
+ Notlandung = 1; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] = 0; |
+ } |
+ else MotorenEin = 0; |
+ } |
+ else |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Emfang gut |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(SenderOkay > 140) |
+ { |
+ Notlandung = 0; |
+ RcLostTimer = EE_Parameter.NotGasZeit * 50; |
+ if(GasMischanteil > 40) |
+ { |
+ if(modell_fliegt < 0xffff) modell_fliegt++; |
+ modell_fliegt_gps = modell_fliegt;// (030907Kr) |
+ } |
+ if((modell_fliegt < 200) || (GasMischanteil < 40)) |
+ { |
+ SummeNick = 0; |
+ SummeRoll = 0; |
+ Mess_Integral_Gier = 0; |
+ Mess_Integral_Gier2 = 0; |
+ } |
+ if((GasMischanteil > 200) && MotorenEin == 0) |
+ { |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// auf Nullwerte kalibrieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) // Neutralwerte |
+ { |
+ unsigned char setting; |
+ if(++delay_neutral > 200) // nicht sofort |
+ { |
+ GRN_OFF; |
+ MotorenEin = 0; |
+ delay_neutral = 0; |
+ modell_fliegt = 0; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70 || abs(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]) > 70) |
+ { |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < 70) setting = 1; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 2; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] < 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 3; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] <-70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 4; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] <-70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < 70) setting = 5; |
+ eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], setting); // aktiven Datensatz merken |
+ } |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
+ { |
+ if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset(); |
+ } |
+ ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
+ SetNeutral(); |
+ Piep(GetActiveParamSetNumber()); |
+ } |
+ } |
+ else delay_neutral = 0; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gas ist unten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(GasMischanteil < 35) |
+ { |
+ // Starten |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] < -75) |
+ { |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Einschalten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(++delay_einschalten > 200) |
+ { |
+ delay_einschalten = 200; |
+ modell_fliegt = 1; |
+ MotorenEin = 1; |
+ sollGier = 0; |
+ Mess_Integral_Gier = 0; |
+ Mess_Integral_Gier2 = 0; |
+ Mess_IntegralNick = 0; |
+ Mess_IntegralRoll = 0; |
+ Mess_IntegralNick2 = IntegralNick; |
+ Mess_IntegralRoll2 = IntegralRoll; |
+ SummeNick = 0; |
+ SummeRoll = 0; |
+ } |
+ } |
+ else delay_einschalten = 0; |
+ //Auf Neutralwerte setzen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Auschalten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) |
+ { |
+ if(++delay_ausschalten > 200) // nicht sofort |
+ { |
+ MotorenEin = 0; |
+ delay_ausschalten = 200; |
+ modell_fliegt = 0; |
+ } |
+ } |
+ else delay_ausschalten = 0; |
+ } |
+ } |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// neue Werte von der Funke |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(!NewPpmData-- || Notlandung) |
+ { |
+ ParameterZuordnung(); |
+ StickNick = PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_P; |
+ StickNick += PPM_diff[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_D; |
+ StickRoll = PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_P; |
+ StickRoll += PPM_diff[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_D; |
+ StickGier = -PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]; |
+ GyroFaktor = ((float)Parameter_Gyro_P + 10.0) / 256.0; |
+ IntegralFaktor = ((float) Parameter_Gyro_I) / 44000; |
+ |
+ if(EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) IntegralFaktor = 0; |
+ if(GyroFaktor < 0) GyroFaktor = 0; |
+ if(IntegralFaktor < 0) IntegralFaktor = 0; |
+ // greift in den Stick ein, um ungewolltes überschlagen zu verhindern |
+ if(!(EE_Parameter.LoopConfig & CFG_LOOP_LINKS) && !(EE_Parameter.LoopConfig & CFG_LOOP_RECHTS)) |
+ { |
+ if(IntegralNick > 60000) |
+ { |
+ StickNick -= 8 * EE_Parameter.Stick_P; |
+ if(IntegralNick > 80000) StickNick -= 16 * EE_Parameter.Stick_P; |
+ } |
+ else |
+ if(IntegralNick < -60000) |
+ { |
+ StickNick += 8 * EE_Parameter.Stick_P; |
+ if(IntegralNick > 80000) StickNick -= 16 * EE_Parameter.Stick_P; |
+ } |
+ if(IntegralRoll > 60000) |
+ { |
+ StickRoll -= 8 * EE_Parameter.Stick_P; |
+ if(IntegralRoll > 80000) StickRoll -= 16 * EE_Parameter.Stick_P; |
+ } |
+ else |
+ if(IntegralRoll < -60000) |
+ { |
+ StickRoll += 8 * EE_Parameter.Stick_P; |
+ if(IntegralRoll > 80000) StickRoll -= 16 * EE_Parameter.Stick_P; |
+ } |
+ } |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// LED Stuff |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+LED1_OFF; |
+ |
+ if(blinkcount_LED1 >= Parameter_UserParam4 && Parameter_UserParam4 > 0) |
+ { |
+ LED1_FLASH; |
+ blinkcount_LED1 = 0; |
+ } |
+ |
+ blinkcount_LED1++; |
+ |
+ //if(PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] > 75) LED1_ON; else LED1_OFF; //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
+ //if(PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] > 75) LED2_ON; else LED2_OFF; //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
+ } |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Looping? |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(((PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > EE_Parameter.LoopThreshold) && EE_Parameter.LoopConfig & CFG_LOOP_LINKS) || |
+ ((PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] < -EE_Parameter.LoopThreshold) && EE_Parameter.LoopConfig & CFG_LOOP_RECHTS)) |
+ { |
+ Looping_Roll = 1; |
+ if(GasMischanteil > EE_Parameter.LoopGasLimit) GasMischanteil = EE_Parameter.LoopGasLimit; |
+ } |
+ else Looping_Roll = 0; |
+ |
+ if(((PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > EE_Parameter.LoopThreshold) && EE_Parameter.LoopConfig & CFG_LOOP_OBEN) || |
+ ((PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < -EE_Parameter.LoopThreshold) && EE_Parameter.LoopConfig & CFG_LOOP_UNTEN)) |
+ { |
+ Looping_Nick = 1; |
+ Looping_Roll = 0; |
+ if(GasMischanteil > EE_Parameter.LoopGasLimit) GasMischanteil = EE_Parameter.LoopGasLimit; |
+ } |
+ else Looping_Nick = 0; |
+ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Bei Empfangsausfall im Flug |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(Notlandung) |
+ { |
+ StickGier = 0; |
+ StickNick = 0; |
+ StickRoll = 0; |
+ GyroFaktor = 0.1; |
+ IntegralFaktor = 0.005; |
+ Looping_Roll = 0; |
+ Looping_Nick = 0; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gyro-Drift kompensieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define DRIFT_FAKTOR 3 |
+ if(ZaehlMessungen >= 1000 / DRIFT_FAKTOR) |
+ { |
+ IntegralFehlerNick = IntegralNick2 - IntegralNick; |
+ IntegralFehlerRoll = IntegralRoll2 - IntegralRoll; |
+ ZaehlMessungen = 0; |
+ if(IntegralFehlerNick > 500/DRIFT_FAKTOR) AdNeutralNick++; |
+ if(IntegralFehlerNick < -500/DRIFT_FAKTOR) AdNeutralNick--; |
+ if(IntegralFehlerRoll > 500/DRIFT_FAKTOR) AdNeutralRoll++; |
+ if(IntegralFehlerRoll < -500/DRIFT_FAKTOR) AdNeutralRoll--; |
+// if(Mess_Integral_Gier2 > 500/DRIFT_FAKTOR) AdNeutralGier--; // macht nur mit Referenz (Kompass Sinn) |
+// if(Mess_Integral_Gier2 <-500/DRIFT_FAKTOR) AdNeutralGier++; // macht nur mit Referenz (Kompass Sinn) |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_IntegralNick2 = IntegralNick; |
+ Mess_IntegralRoll2 = IntegralRoll; |
+ Mess_Integral_Gier2 = Integral_Gier; |
+ ANALOG_ON; // ADC einschalten |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Integrale auf ACC-Signal abgleichen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+ |
+ if(EE_Parameter.GlobalConfig & CFG_GPS_AKTIV) |
+ { |
+ tmp_long = (long)(IntegralNick / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccNick) / 16; |
+ tmp_long2 = (long)(IntegralRoll / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccRoll) / 16; |
+ #define AUSGLEICH 500 |
+ if(tmp_long > AUSGLEICH) tmp_long = AUSGLEICH; |
+ if(tmp_long < -AUSGLEICH) tmp_long =-AUSGLEICH; |
+ if(tmp_long2 > AUSGLEICH) tmp_long2 = AUSGLEICH; |
+ if(tmp_long2 <-AUSGLEICH) tmp_long2 =-AUSGLEICH; |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_IntegralNick -= tmp_long; |
+ Mess_IntegralRoll -= tmp_long2; |
+ } |
+ |
+ else |
+ { |
+ if(IntegralFaktor && !Looping_Nick && !Looping_Roll) |
+ { |
+ tmp_long = (long)(IntegralNick / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccNick); |
+ if(labs(Mittelwert_AccNick) < 200) tmp_long /= 8; |
+ else tmp_long /= 16; |
+ tmp_long2 = (long)(IntegralRoll / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccRoll); |
+ if(labs(Mittelwert_AccRoll) < 200) tmp_long2 /= 8; |
+ else tmp_long2 /= 16; |
+ |
+ #define AUSGLEICH 500 |
+ if(tmp_long > AUSGLEICH) tmp_long = AUSGLEICH; |
+ if(tmp_long < -AUSGLEICH) tmp_long =-AUSGLEICH; |
+ if(tmp_long2 > AUSGLEICH) tmp_long2 = AUSGLEICH; |
+ if(tmp_long2 <-AUSGLEICH) tmp_long2 =-AUSGLEICH; |
+ } |
+ |
+ else |
+ { |
+ tmp_long = 0; |
+ tmp_long2 = 0; |
+ } |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_IntegralNick -= tmp_long; |
+ Mess_IntegralRoll -= tmp_long2; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(abs(StickGier) > 20) // war 35 |
+ { |
+ if(!(EE_Parameter.GlobalConfig & CFG_KOMPASS_FIX)) NeueKompassRichtungMerken = 1; |
+ } |
+ tmp_int = EE_Parameter.Gier_P * (StickGier * abs(StickGier)) / 512; // expo y = ax + bx² |
+ tmp_int += (EE_Parameter.Gier_P * StickGier) / 4; |
+ sollGier = tmp_int; |
+ Mess_Integral_Gier -= tmp_int; |
+ if(Mess_Integral_Gier > 25000) Mess_Integral_Gier = 25000; // begrenzen |
+ if(Mess_Integral_Gier <-25000) Mess_Integral_Gier =-25000; |
+ |
+ ANALOG_ON; // ADC einschalten |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Kompass |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(KompassValue && (EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV)) |
+ { |
+ if(NeueKompassRichtungMerken) |
+ { |
+ KompassStartwert = KompassValue; |
+ NeueKompassRichtungMerken = 0; |
+ } |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_Integral_Gier -= (KompassRichtung * Parameter_KompassWirkung) / 32; // nach Kompass ausrichten |
+ ANALOG_ON; // ADC einschalten |
+ } |
+ |
+ |
+ |
+ |
+/* if(KompassValue && (EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV)) |
+ { |
+ int w,v; |
+ static int SignalSchlecht = 0; |
+ w = abs(IntegralNick /512); // mit zunehmender Neigung den Einfluss drosseln |
+ v = abs(IntegralRoll /512); |
+ if(v > w) w = v; // grösste Neigung ermitteln |
+ if(w < 25 && NeueKompassRichtungMerken && !SignalSchlecht) |
+ { |
+ KompassStartwert = KompassValue; |
+ NeueKompassRichtungMerken = 0; |
+ } |
+ w = (w * Parameter_KompassWirkung) / 64; // auf die Wirkung normieren |
+ w = Parameter_KompassWirkung - w; // Wirkung ggf drosseln |
+ if(w > 0) |
+ { |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ if(!SignalSchlecht) Mess_Integral_Gier += (KompassRichtung * w) / 32; // nach Kompass ausrichten |
+ ANALOG_ON; // ADC einschalten |
+ if(SignalSchlecht) SignalSchlecht--; |
+ } |
+ else SignalSchlecht = 500; // so lange das Signal taub stellen --> ca. 1 sek |
+ } |
+*/ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// GPS |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+if(EE_Parameter.GlobalConfig & CFG_GPS_AKTIV) |
+{ |
+ P_GPS_Verstaerkung = Parameter_UserParam1; |
+ D_GPS_Verstaerkung = Parameter_UserParam2; |
+ Limit_D_Anteil = Parameter_UserParam3; |
+ gps_main(); |
+} |
+else |
+{ |
+ GPS_Nick = 0; |
+ GPS_Roll = 0; |
+} |
+ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Debugwerte zuordnen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(!TimerWerteausgabe--) |
+ { |
+ TimerWerteausgabe = 49; |
+ |
+ DebugOut.Analog[0] = actualPos.GPSFix; |
+ DebugOut.Analog[1] = GPS_Roll; |
+ DebugOut.Analog[2] = GPS_Nick; |
+ DebugOut.Analog[3] = GPS_Positionsabweichung_North; |
+ DebugOut.Analog[4] = GPS_Positionsabweichung_East; |
+ DebugOut.Analog[5] = P_Einfluss_East; |
+ DebugOut.Analog[6] = D_Einfluss_East; |
+ DebugOut.Analog[7] = KompassRichtung; |
+ DebugOut.Analog[8] = KompassValue; |
+ DebugOut.Analog[9] = MM3.x_axis; |
+ DebugOut.Analog[10] = MM3.y_axis; |
+ DebugOut.Analog[11] = MM3.z_axis; |
+ DebugOut.Analog[12] = Parameter_UserParam2; |
+ DebugOut.Analog[13] = Poti3; |
+ DebugOut.Analog[14] = KompassValue; |
+ DebugOut.Analog[15] = GPS_Home_North; |
+ DebugOut.Analog[16] = GPS_Home_East; |
+ DebugOut.Analog[17] = NORTH_MITTEL; |
+ DebugOut.Analog[18] = EAST_MITTEL; |
+ DebugOut.Analog[19] = actualPos.northing; |
+ DebugOut.Analog[20] = actualPos.easting; |
+ DebugOut.Analog[21] = actualPos.velNorth; |
+ DebugOut.Analog[22] = actualPos.velEast; |
+ DebugOut.Analog[23] = UBat; |
+ DebugOut.Analog[24] = (motor_rx[0]+motor_rx[1]+motor_rx[2]+motor_rx[3]); //Gesamtstrom |
+ DebugOut.Analog[25] = StickRoll; |
+ DebugOut.Analog[26] = HoehenWert; |
+ DebugOut.Analog[27] = IntegralNick / EE_Parameter.GyroAccFaktor; |
+ DebugOut.Analog[28] = IntegralRoll / EE_Parameter.GyroAccFaktor; |
+ DebugOut.Analog[29] = Mittelwert_AccNick; |
+ DebugOut.Analog[30] = Mittelwert_AccRoll; |
+ DebugOut.Analog[31] = StickNick; |
+ } |
+/* |
+DebugOut.Analog[0] = MM3.NickGrad; |
+DebugOut.Analog[1] = MM3.RollGrad; |
+DebugOut.Analog[9] = MM3.x_axis; |
+DebugOut.Analog[10] = MM3.y_axis; |
+DebugOut.Analog[11] = MM3.z_axis; |
+*/ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Drehgeschwindigkeit und -winkel zu einem Istwert zusammenfassen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(Looping_Nick) MesswertNick = MesswertNick * GyroFaktor; |
+ else MesswertNick = IntegralNick * IntegralFaktor + MesswertNick * GyroFaktor; |
+ if(Looping_Roll) MesswertRoll = MesswertRoll * GyroFaktor; |
+ else MesswertRoll = IntegralRoll * IntegralFaktor + MesswertRoll * GyroFaktor; |
+// MesswertGier = MesswertGier * (GyroFaktor/2) + Integral_Gier * IntegralFaktor; |
+ |
+ MesswertGier = MesswertGier * (GyroFaktor) + Integral_Gier * IntegralFaktor/2; |
+ |
+ // Maximalwerte abfangen |
+ #define MAX_SENSOR 2048 |
+ if(MesswertNick > MAX_SENSOR) MesswertNick = MAX_SENSOR; |
+ if(MesswertNick < -MAX_SENSOR) MesswertNick = -MAX_SENSOR; |
+ if(MesswertRoll > MAX_SENSOR) MesswertRoll = MAX_SENSOR; |
+ if(MesswertRoll < -MAX_SENSOR) MesswertRoll = -MAX_SENSOR; |
+ if(MesswertGier > MAX_SENSOR) MesswertGier = MAX_SENSOR; |
+ if(MesswertGier < -MAX_SENSOR) MesswertGier = -MAX_SENSOR; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Höhenregelung |
+// Die Höhenregelung schwächt lediglich das Gas ab, erhöht es allerdings nicht |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+//OCR0B = 180 - (Poti1 + 120) / 4; |
+//DruckOffsetSetting = OCR0B; |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung |
+ { |
+ int tmp_int; |
+ if(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER) // Regler wird über Schalter gesteuert |
+ { |
+ if(Parameter_MaxHoehe < 50) |
+ { |
+ SollHoehe = HoehenWert - 40; // Parameter_MaxHoehe ist der PPM-Wert des Schalters // (160607Kr) |
+ HoehenReglerAktiv = 0; |
+ } |
+ else |
+ HoehenReglerAktiv = 1; |
+ } |
+ else |
+ { |
+ SollHoehe = Parameter_MaxHoehe * EE_Parameter.Hoehe_Verstaerkung - 40; // (160607Kr) |
+ HoehenReglerAktiv = 1; |
+ } |
+ |
+ if(Notlandung) SollHoehe = 0; |
+ h = HoehenWert; |
+ if((h > SollHoehe) && HoehenReglerAktiv) // zu hoch --> drosseln |
+ { h = ((h - SollHoehe) * (int) Parameter_Hoehe_P) / 16; // Differenz bestimmen --> P-Anteil |
+ h = GasMischanteil - h; // vom Gas abziehen |
+ h -= (HoeheD * Parameter_Luftdruck_D)/8; // D-Anteil |
+ tmp_int = ((Mess_Integral_Hoch / 512) * (signed long) Parameter_Hoehe_ACC_Wirkung) / 32; |
+ if(tmp_int > 50) tmp_int = 50; |
+ else if(tmp_int < -50) tmp_int = -50; |
+ h -= tmp_int; |
+ hoehenregler = (hoehenregler*15 + h) / 16; |
+ if(hoehenregler < EE_Parameter.Hoehe_MinGas) // nicht unter MIN |
+ { |
+ if(GasMischanteil >= EE_Parameter.Hoehe_MinGas) hoehenregler = EE_Parameter.Hoehe_MinGas; |
+ if(GasMischanteil < EE_Parameter.Hoehe_MinGas) hoehenregler = GasMischanteil; |
+ } |
+ if(hoehenregler > GasMischanteil) hoehenregler = GasMischanteil; // nicht mehr als Gas |
+ GasMischanteil = hoehenregler; |
+ } |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Mischer und PI-Regler |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ // DebugOut.Analog[7] = GasMischanteil; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gier-Anteil |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define MUL_G 1.0 |
+ GierMischanteil = MesswertGier - sollGier; // Regler für Gier |
+//GierMischanteil = 0; |
+ if(GierMischanteil > (MUL_G * GasMischanteil)) GierMischanteil = MUL_G * GasMischanteil; |
+ if(GierMischanteil < -(MUL_G * GasMischanteil)) GierMischanteil = -(MUL_G * GasMischanteil); |
+ if(GierMischanteil > 100) GierMischanteil = 100; |
+ if(GierMischanteil < -100) GierMischanteil = -100; |
+ |
+ if(GasMischanteil < 20) GierMischanteil = 0; |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Nick-Achse |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+ DiffNick = Kp * (MesswertNick - (StickNick - GPS_Nick)); // Differenz bestimmen |
+ SummeNick += DiffNick; // I-Anteil |
+ if(SummeNick > 0) SummeNick-= (abs(SummeNick)/256 + 1); else SummeNick += abs(SummeNick)/256 + 1; |
+ if(SummeNick > 16000) SummeNick = 16000; |
+ if(SummeNick < -16000) SummeNick = -16000; |
+ pd_ergebnis = DiffNick;// + Ki * SummeNick; // PI-Regler für Nick |
+ // Motor Vorn |
+#define MUL 2 |
+ if(pd_ergebnis > MUL * (GasMischanteil + abs(GierMischanteil))) pd_ergebnis = MUL * (GasMischanteil + abs(GierMischanteil)); |
+ if(pd_ergebnis < -MUL * (GasMischanteil + abs(GierMischanteil))) pd_ergebnis = -MUL * (GasMischanteil + abs(GierMischanteil)); |
+ |
+ motorwert = GasMischanteil + pd_ergebnis + GierMischanteil; // Mischer |
+ if ((motorwert < 0)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Vorne = motorwert; |
+ // Motor Heck |
+ motorwert = GasMischanteil - pd_ergebnis + GierMischanteil; |
+ if ((motorwert < 0)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Hinten = motorwert; |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Roll-Achse |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ DiffRoll = Kp * (MesswertRoll - (StickRoll - GPS_Roll)); // Differenz bestimmen |
+ SummeRoll += DiffRoll; // I-Anteil |
+ if(SummeRoll > 0) SummeRoll-= (abs(SummeRoll)/256 + 1); else SummeRoll += abs(SummeRoll)/256 + 1; |
+ if(SummeRoll > 16000) SummeRoll = 16000; |
+ if(SummeRoll < -16000) SummeRoll = -16000; |
+ pd_ergebnis = DiffRoll;// + Ki * SummeRoll; // PI-Regler für Roll |
+ if(pd_ergebnis > MUL * (GasMischanteil + abs(GierMischanteil))) pd_ergebnis = MUL * (GasMischanteil + abs(GierMischanteil)); |
+ if(pd_ergebnis < -MUL * (GasMischanteil + abs(GierMischanteil))) pd_ergebnis = -MUL * (GasMischanteil + abs(GierMischanteil)); |
+ // Motor Links |
+ motorwert = GasMischanteil + pd_ergebnis - GierMischanteil; |
+ if ((motorwert < 0)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Links = motorwert; |
+ // Motor Rechts |
+ motorwert = GasMischanteil - pd_ergebnis - GierMischanteil; |
+ if ((motorwert < 0)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Rechts = motorwert; |
+ // +++++++++++++++++++++++++++++++++++++++++++++++ |
+} |
+ |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/fc.h |
---|
0,0 → 1,128 |
/*####################################################################################### |
Flight Control |
#######################################################################################*/ |
#ifndef _FC_H |
#define _FC_H |
extern volatile unsigned int I2CTimeout; |
extern unsigned char Sekunde,Minute; |
extern volatile long IntegralNick,IntegralNick2; |
extern volatile long IntegralRoll,IntegralRoll2; |
extern volatile long Mess_IntegralNick,Mess_IntegralNick2; |
extern volatile long Mess_IntegralRoll,Mess_IntegralRoll2; |
extern volatile long Mess_Integral_Hoch; |
extern volatile long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2; |
extern volatile int KompassValue; |
extern volatile int KompassStartwert; |
extern volatile int KompassRichtung; |
extern int HoehenWert; |
extern int SollHoehe; |
extern volatile int MesswertNick,MesswertRoll,MesswertGier; |
extern volatile int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll; |
extern volatile int NeutralAccX, NeutralAccY,Mittelwert_AccHoch; |
extern volatile float NeutralAccZ; |
extern unsigned int modell_fliegt_gps;//(030907Kr) |
extern unsigned char Limit_D_Anteil;//(210907Kr) |
void MotorRegler(void); |
void SendMotorData(void); |
void CalibrierMittelwert(void); |
void Mittelwert(void); |
void SetNeutral(void); |
//Nick666 Kompass |
void Piep(unsigned char Anzahl); |
void DefaultKonstanten1(void); |
void DefaultKonstanten2(void); |
unsigned char h,m,s; |
volatile unsigned char Timeout ; |
unsigned char CosinusNickWinkel, CosinusRollWinkel; |
volatile long IntegralNick,IntegralNick2; |
volatile long IntegralRoll,IntegralRoll2; |
volatile long Integral_Gier; |
volatile long Mess_IntegralNick,Mess_IntegralNick2; |
volatile long Mess_IntegralRoll,Mess_IntegralRoll2; |
volatile long Mess_Integral_Gier; |
volatile int DiffNick,DiffRoll; |
extern int Poti1, Poti2, Poti3, Poti4, Poti5, Poti6, Poti7, Poti8; //PPM24-Erweiterung (121007Kr) |
volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
unsigned char MotorWert[5]; |
volatile unsigned char SenderOkay; |
int StickNick,StickRoll,StickGier; |
char MotorenEin; |
extern void DefaultKonstanten(void); |
#define STRUCT_PARAM_LAENGE 58 |
struct mk_param_struct |
{ |
unsigned char Kanalbelegung[8]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3 |
unsigned char GlobalConfig; // 0x01=Höhenregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv |
unsigned char Hoehe_MinGas; // Wert : 0-100 |
unsigned char Luftdruck_D; // Wert : 0-250 |
unsigned char MaxHoehe; // Wert : 0-32 |
unsigned char Hoehe_P; // Wert : 0-32 |
unsigned char Hoehe_Verstaerkung; // Wert : 0-50 |
unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250 |
unsigned char Stick_P; // Wert : 1-6 |
unsigned char Stick_D; // Wert : 0-64 |
unsigned char Gier_P; // Wert : 1-20 |
unsigned char Gas_Min; // Wert : 0-32 |
unsigned char Gas_Max; // Wert : 33-250 |
unsigned char GyroAccFaktor; // Wert : 1-64 |
unsigned char KompassWirkung; // Wert : 0-32 |
unsigned char Gyro_P; // Wert : 10-250 |
unsigned char Gyro_I; // Wert : 0-250 |
unsigned char UnterspannungsWarnung; // Wert : 0-250 |
unsigned char NotGas; // Wert : 0-250 //Gaswert bei Empängsverlust |
unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen |
unsigned char UfoAusrichtung; // X oder + Formation |
unsigned char I_Faktor; // Wert : 0-250 |
unsigned char UserParam1; // Wert : 0-250 |
unsigned char UserParam2; // Wert : 0-250 |
unsigned char UserParam3; // Wert : 0-250 |
unsigned char UserParam4; // Wert : 0-250 |
unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos |
unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo |
unsigned char ServoNickMin; // Wert : 0-250 // Anschlag |
unsigned char ServoNickMax; // Wert : 0-250 // Anschlag |
unsigned char ServoNickRefresh; // |
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping |
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag |
//------------------------------------------------ |
unsigned char LoopConfig; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen |
unsigned char Reserved[4]; |
char Name[12]; |
}; |
/* |
unsigned char ServoNickMax; // Wert : 0-250 |
unsigned char ServoNickRefresh; // |
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping |
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag |
//------------------------------------------------ |
unsigned char LoopConfig; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen |
unsigned char Reserved[4]; |
char Name[12]; |
*/ |
extern struct mk_param_struct EE_Parameter; |
extern unsigned char Parameter_Luftdruck_D; |
extern unsigned char Parameter_MaxHoehe; |
extern unsigned char Parameter_Hoehe_P; |
extern unsigned char Parameter_Hoehe_ACC_Wirkung; |
extern unsigned char Parameter_KompassWirkung; |
extern unsigned char Parameter_Gyro_P; |
extern unsigned char Parameter_Gyro_I; |
extern unsigned char Parameter_Gier_P; |
extern unsigned char Parameter_ServoNickControl; |
#endif //_FC_H |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/flight-ctrl_mega644_v0_64.aws |
---|
0,0 → 1,0 |
<AVRWorkspace><IOSettings><CurrentRegisters/></IOSettings><part name="ATMEGA644"/><Files><File00000 Name="E:\hubi\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v64jokogpsNick666_1_1\main.c" Position="332 71 1178 569" LineCol="127 0" State="Maximized"/><File00001 Name="E:\hubi\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v64jokogpsNick666_1_1\compass.c" Position="333 69 1179 567" LineCol="47 0" State="Maximized"/><File00002 Name="E:\hubi\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v64jokogpsNick666_1_1\compass.h" Position="305 88 851 456" LineCol="37 0" State="Maximized"/><File00003 Name="E:\hubi\mickrokopter\a Versions\eigene versionen\Kompass + GPS\v64jokogpsNick666_1_1\fc.c" Position="336 71 1182 569" LineCol="864 0" State="Maximized"/></Files></AVRWorkspace> |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/flight.pnproj |
---|
0,0 → 1,0 |
<Project name="Flight-Ctrl"><File path="uart.h"></File><File path="main.c"></File><File path="main.h"></File><File path="makefile"></File><File path="uart.c"></File><File path="printf_P.h"></File><File path="printf_P.c"></File><File path="timer0.c"></File><File path="timer0.h"></File><File path="old_macros.h"></File><File path="twimaster.c"></File><File path="version.txt"></File><File path="twimaster.h"></File><File path="rc.c"></File><File path="rc.h"></File><File path="fc.h"></File><File path="fc.c"></File><File path="menu.h"></File><File path="menu.c"></File><File path="_Settings.h"></File><File path="analog.c"></File><File path="analog.h"></File><File path="GPS.c"></File><File path="gps.h"></File><File path="License.txt"></File></Project> |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/flight.pnps |
---|
0,0 → 1,0 |
<pd><ViewState><e p="Flight-Ctrl" x="true"></e></ViewState></pd> |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/gps.h |
---|
0,0 → 1,26 |
extern long P_Einfluss_North; |
extern long D_Einfluss_North; |
extern long P_Einfluss_East; |
extern long D_Einfluss_East; |
extern long GPS_Positionsabweichung_North; |
extern long GPS_Positionsabweichung_East; |
extern long GPS_Geschwindigkeit_North; |
extern long GPS_Geschwindigkeit_East; |
extern long GPS_Home_North; |
extern long GPS_Home_East; |
extern long Soll_Position_North; |
extern long Soll_Position_East; |
extern volatile long EAST_MITTEL; |
extern volatile long NORTH_MITTEL; |
extern signed int GPS_Nick; |
extern signed int GPS_Roll; |
extern void GPS_Neutral(void); |
extern void GPS_BerechneZielrichtung(void); |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/main.c |
---|
0,0 → 1,257 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + Nur für den privaten Gebrauch |
// + www.MikroKopter.com |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
// + dass eine Nutzung (auch auszugsweise) nur für den privaten und nicht-kommerziellen Gebrauch zulässig ist. |
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
// + bzgl. der Nutzungsbedingungen aufzunehmen. |
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
// + Verkauf von Luftbildaufnahmen, usw. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
// + auf anderen Webseiten oder Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
// + eindeutig als Ursprung verlinkt und genannt werden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
// + Benutzung auf eigene Gefahr |
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
// + mit unserer Zustimmung zulässig |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
// + this list of conditions and the following disclaimer. |
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
// + from this software without specific prior written permission. |
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
// + for non-commercial use (directly or indirectly) |
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
// + with our written permission |
// + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
// + clearly linked as origin |
// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
//unsigned char EEPromArray[E2END+1] EEMEM; |
unsigned char EEPromArray[501] EEMEM; //Nick666 Kompass |
unsigned char PlatinenVersion = 10; |
// -- Parametersatz aus EEPROM lesen --- |
// number [0..5] |
void ReadParameterSet(unsigned char number, unsigned char *buffer, unsigned char length) |
{ |
if (number > 5) number = 5; |
eeprom_read_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * number], length); |
} |
// -- Parametersatz ins EEPROM schreiben --- |
// number [0..5] |
void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length) |
{ |
if(number > 5) number = 5; |
eeprom_write_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * number], length); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], number); // diesen Parametersatz als aktuell merken |
} |
unsigned char GetActiveParamSetNumber(void) |
{ |
unsigned char set; |
set = eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET]); |
if(set > 5) |
{ |
set = 2; |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], set); // diesen Parametersatz als aktuell merken |
} |
return(set); |
} |
//############################################################################ |
//Hauptprogramm |
int main (void) |
//############################################################################ |
{ |
unsigned int timer; |
//unsigned int timer2 = 0; |
DDRB = 0x00; |
PORTB = 0x00; |
for(timer = 0; timer < 1000; timer++); // verzögern |
if(PINB & 0x01) PlatinenVersion = 11; else PlatinenVersion = 10; |
DDRC = 0x81; // SCL |
PORTC = 0xff; // Pullup SDA |
DDRB = 0x1B; // LEDs und Druckoffset |
//Nick666 |
PORTB |= (1<<PB0); // LED_Rot |
DDRD = 0x3E; // Speaker & TXD & J3 J4 J5 |
//Nick666 |
DDRD |= (1<<PD7); // J7 |
/* |
PORTB = 0x01; // LED_Rot |
DDRD |=0x80; // J7 |
*/ |
PORTD = 0xF7; // LED |
MCUSR &=~(1<<WDRF); |
WDTCSR |= (1<<WDCE)|(1<<WDE); |
WDTCSR = 0; |
//Nick666 |
beeptime = 1000; |
//beeptime = 2000; |
StickGier = 0; PPM_in[K_GAS] = 0;StickRoll = 0; StickNick = 0; |
ROT_OFF; |
Timer_Init(); |
UART_Init(); |
rc_sum_init(); |
ADC_Init(); |
i2c_init(); |
MM3_init(); //Nick666 |
sei(); |
VersionInfo.Hauptversion = VERSION_HAUPTVERSION; |
VersionInfo.Nebenversion = VERSION_NEBENVERSION; |
VersionInfo.PCKompatibel = VERSION_KOMPATIBEL; |
printf("\n\rFlightControl\n\rHardware:%d.%d\n\rSoftware:V%d.%d ",PlatinenVersion/10,PlatinenVersion%10, VERSION_HAUPTVERSION, VERSION_NEBENVERSION); |
printf("\n\r=============================="); |
GRN_ON; |
#define EE_DATENREVISION 62 // wird angepasst, wenn sich die EEPROM-Daten geändert haben |
if(eeprom_read_byte(&EEPromArray[EEPROM_ADR_VALID]) != EE_DATENREVISION) |
{ |
printf("\n\rInit. EEPROM: Generiere Default-Parameter..."); |
DefaultKonstanten1(); |
for (unsigned char i=0;i<6;i++) |
{ |
if(i==2) DefaultKonstanten2(); |
WriteParameterSet(i, (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
} |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], 2); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_VALID], EE_DATENREVISION); |
} |
ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
printf("\n\rBenutze Parametersatz %d", GetActiveParamSetNumber()); |
//kurze Wartezeit (sonst reagiert die "Kompass kalibrieren?"-Abfrage nicht |
timer = SetDelay(500); |
while(!CheckDelay(timer)); |
//Kompass kalibrieren? |
if(PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] > 100 && PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 100) |
{ |
printf("\n\rKalibriere Kompass"); |
if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV) MM3_calib(); |
} |
if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
printf("\n\rAbgleich Luftdrucksensor.."); |
timer = SetDelay(1000); |
SucheLuftruckOffset(); |
while (!CheckDelay(timer)); |
printf("OK\n\r"); |
} |
SetNeutral(); |
ROT_OFF; |
beeptime = 2000; |
DebugIn.Analog[1] = 1000; |
DebugIn.Digital[0] = 0x55; |
printf("\n\rSteuerung: "); |
if (EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) printf("HeadingHold"); |
else printf("Neutral"); |
printf("\n\n\r"); |
LcdClear(); |
I2CTimeout = 5000; |
while (1) |
{ |
if (UpdateMotor) // ReglerIntervall |
{ |
UpdateMotor=0; |
MotorRegler(); |
SendMotorData(); |
ROT_OFF; |
if(PcZugriff) PcZugriff--; |
if(SenderOkay) SenderOkay--; |
if(!I2CTimeout) |
{ |
I2CTimeout = 5; |
i2c_reset(); |
if((BeepMuster == 0xffff) && MotorenEin) |
{ |
beeptime = 10000; |
BeepMuster = 0x0080; |
} |
} |
else |
{ |
I2CTimeout--; |
ROT_OFF; |
} |
} |
if(SIO_DEBUG) |
{ |
DatenUebertragung(); |
BearbeiteRxDaten(); |
} |
else BearbeiteRxDaten(); |
if(CheckDelay(timer)) |
{ |
if(UBat < EE_Parameter.UnterspannungsWarnung) |
{ |
if(BeepMuster == 0xffff) |
{ |
beeptime = 6000; |
BeepMuster = 0x0300; |
} |
} |
timer = SetDelay(100); |
} |
} |
return (1); |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/main.h |
---|
0,0 → 1,127 |
#ifndef _MAIN_H |
#define _MAIN_H |
//Hier die Quarz Frequenz einstellen |
#if defined (__AVR_ATmega32__) |
#define SYSCLK 20000000L //Quarz Frequenz in Hz |
#endif |
#if defined (__AVR_ATmega644__) |
#define SYSCLK 20000000L //Quarz Frequenz in Hz |
//#define SYSCLK 16000000L //Quarz Frequenz in Hz |
#endif |
// neue Hardware |
#define ROT_OFF PORTB &=~(1<<PB0) |
#define ROT_ON PORTB |= (1<<PB0) |
#define ROT_FLASH PORTB ^= (1<<PB0) |
#define GRN_OFF PORTB &=~(1<<PB1) |
#define GRN_ON PORTB |= (1<<PB1) |
#define GRN_FLASH PORTD ^= (1<<PB1) |
/* |
#define ROT_OFF {if(PlatinenVersion == 10) PORTB &=~0x01; else PORTB |= 0x01;} |
#define ROT_ON {if(PlatinenVersion == 10) PORTB |= 0x01; else PORTB &=~0x01;} |
#define ROT_FLASH PORTB ^= 0x01 |
#define GRN_OFF PORTB &=~0x02 |
#define GRN_ON PORTB |= 0x02 |
#define GRN_FLASH PORTB ^= 0x02 |
*/ |
#define LED1_OFF PORTC &=~0x04 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED1_ON PORTC |= 0x04 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED1_FLASH PORTC ^= 0x04 //Erweiterung by 4ndreas aus mikrosvn branches // (280807Kr) |
#define LED2_OFF PORTC &=~0x08 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED2_ON PORTC |= 0x08 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED2_FLASH PORTC ^= 0x08 //Erweiterung by 4ndreas aus mikrosvn branches // (280807Kr) |
//#ifndef F_CPU |
//#error ################## F_CPU nicht definiert oder ungültig ############# |
//#endif |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//#define ANZ_MITTELWERT 4 |
#define EEPROM_ADR_VALID 1 |
#define EEPROM_ADR_ACTIVE_SET 2 |
#define EEPROM_ADR_LAST_OFFSET 3 |
#define EEPROM_ADR_PARAM_BEGIN 100 |
#define CFG_HOEHENREGELUNG 0x01 |
#define CFG_HOEHEN_SCHALTER 0x02 |
#define CFG_HEADING_HOLD 0x04 |
#define CFG_KOMPASS_AKTIV 0x08 |
#define CFG_KOMPASS_FIX 0x10 |
#define CFG_GPS_AKTIV 0x20 |
#define CFG_LOOP_OBEN 0x01 |
#define CFG_LOOP_UNTEN 0x02 |
#define CFG_LOOP_LINKS 0x04 |
#define CFG_LOOP_RECHTS 0x08 |
//#define SYSCLK |
//extern unsigned long SYSCLK; |
extern volatile int i_Nick[20],i_Roll[20],DiffNick,DiffRoll; |
extern volatile unsigned char SenderOkay; |
extern unsigned char CosinusNickWinkel, CosinusRollWinkel; |
extern unsigned char PlatinenVersion; |
extern void ReadParameterSet (unsigned char number, unsigned char *buffer, unsigned char length); |
extern void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length); |
extern unsigned char GetActiveParamSetNumber(void); |
extern unsigned char EEPromArray[]; |
long durchschnitt_northing; |
long durchschnitt_easting; |
volatile int P_GPS_Verstaerkung; //P-Anteil (80-120) |
volatile int D_GPS_Verstaerkung; //D-Anteil (90) |
#include <stdlib.h> |
#include <string.h> |
#include <avr/io.h> |
#include <avr/pgmspace.h> |
#include <avr/interrupt.h> |
#include <avr/eeprom.h> |
#include <avr/boot.h> |
#include <avr/wdt.h> |
#include "old_macros.h" |
#include "_settings.h" |
#include "printf_P.h" |
#include "compass.h" //Nick666 |
#include "timer0.h" |
#include "uart.h" |
#include "analog.h" |
#include "twimaster.h" |
#include "menu.h" |
#include "rc.h" |
#include "fc.h" |
#include "gps.h" |
#include "math.h" //Nick666 |
#ifndef EEMEM |
#define EEMEM __attribute__ ((section (".eeprom"))) |
#endif |
#define DEBUG_DISPLAY_INTERVALL 123 // in ms |
#define DELAY_US(x) ((unsigned int)( (x) * 1e-6 * F_CPU )) |
#endif //_MAIN_H |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/makefile |
---|
0,0 → 1,392 |
#-------------------------------------------------------------------- |
# MCU name |
MCU = atmega644 |
F_CPU = 20000000 |
#------------------------------------------------------------------- |
HAUPT_VERSION = 0 |
NEBEN_VERSION = 64 |
VERSION_KOMPATIBEL = 5 # PC-Kompatibilität |
#------------------------------------------------------------------- |
ifeq ($(MCU), atmega32) |
# FUSE_SETTINGS= -u -U lfuse:w:0xff:m -U hfuse:w:0xcf:m |
HEX_NAME = MEGA32 |
endif |
ifeq ($(MCU), atmega644) |
FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
#FUSE_SETTINGS = -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
# -u bei neuen Controllern wieder einspielen |
HEX_NAME = MEGA644 |
endif |
ifeq ($(F_CPU), 16000000) |
QUARZ = 16MHZ |
endif |
ifeq ($(F_CPU), 20000000) |
QUARZ = 20MHZ |
endif |
# Output format. (can be srec, ihex, binary) |
FORMAT = ihex |
# Target file name (without extension). |
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION) |
# Optimization level, can be [0, 1, 2, 3, s]. 0 turns off optimization. |
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.) |
OPT = s |
########################################################################################################## |
# List C source files here. (C dependencies are automatically generated.) |
SRC = main.c uart.c printf_P.c timer0.c analog.c menu.c compass.c math.c |
SRC += twimaster.c rc.c fc.c GPS.c |
########################################################################################################## |
# List Assembler source files here. |
# Make them always end in a capital .S. Files ending in a lowercase .s |
# will not be considered source files but generated files (assembler |
# output from the compiler), and will be deleted upon "make clean"! |
# Even though the DOS/Win* filesystem matches both .s and .S the same, |
# it will preserve the spelling of the filenames, and gcc itself does |
# care about how the name is spelled on its command-line. |
ASRC = |
# List any extra directories to look for include files here. |
# Each directory must be seperated by a space. |
EXTRAINCDIRS = |
# Optional compiler flags. |
# -g: generate debugging information (for GDB, or for COFF conversion) |
# -O*: optimization level |
# -f...: tuning, see gcc manual and avr-libc documentation |
# -Wall...: warning level |
# -Wa,...: tell GCC to pass this to the assembler. |
# -ahlms: create assembler listing |
CFLAGS = -O$(OPT) \ |
-funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums \ |
-Wall -Wstrict-prototypes \ |
-mtiny-stack -mcall-prologues -Wno-pointer-sign \ |
-Wa,-adhlns=$(<:.c=.lst) \ |
$(patsubst %,-I%,$(EXTRAINCDIRS)) |
# Set a "language standard" compiler flag. |
# Unremark just one line below to set the language standard to use. |
# gnu99 = C99 + GNU extensions. See GCC manual for more information. |
#CFLAGS += -std=c89 |
#CFLAGS += -std=gnu89 |
#CFLAGS += -std=c99 |
CFLAGS += -std=gnu99 |
CFLAGS += -DVERSION_HAUPTVERSION=$(HAUPT_VERSION) -DVERSION_NEBENVERSION=$(NEBEN_VERSION) -DVERSION_KOMPATIBEL=$(VERSION_KOMPATIBEL) |
# Optional assembler flags. |
# -Wa,...: tell GCC to pass this to the assembler. |
# -ahlms: create listing |
# -gstabs: have the assembler create line number information; note that |
# for use in COFF files, additional information about filenames |
# and function names needs to be present in the assembler source |
# files -- see avr-libc docs [FIXME: not yet described there] |
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs |
# Optional linker flags. |
# -Wl,...: tell GCC to pass this to linker. |
# -Map: create map file |
# --cref: add cross reference to map file |
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref |
# Additional libraries |
# Minimalistic printf version |
#LDFLAGS += -Wl,-u,vfprintf -lprintf_min |
# Floating point printf version (requires -lm below) |
#LDFLAGS += -Wl,-u,vfprintf -lprintf_flt |
# -lm = math library |
LDFLAGS += -lm |
##LDFLAGS += -T./linkerfile/avr5.x |
# Programming support using avrdude. Settings and variables. |
# Programming hardware: alf avr910 avrisp bascom bsd |
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500 |
# |
# Type: avrdude -c ? |
# to get a full listing. |
# |
#AVRDUDE_PROGRAMMER = stk200 |
AVRDUDE_PROGRAMMER = dt006 |
#AVRDUDE_PROGRAMMER = ponyser |
#falls Ponyser ausgewählt wird, muss sich unsere avrdude-Configdatei im Bin-Verzeichnis des Compilers befinden |
#AVRDUDE_PORT = com1 # programmer connected to serial device |
AVRDUDE_PORT = lpt1 # programmer connected to parallel port |
#AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex |
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex $(FUSE_SETTINGS) |
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep |
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) |
# Uncomment the following if you want avrdude's erase cycle counter. |
# Note that this counter needs to be initialized first using -Yn, |
# see avrdude manual. |
#AVRDUDE_ERASE += -y |
# Uncomment the following if you do /not/ wish a verification to be |
# performed after programming the device. |
AVRDUDE_FLAGS += -V |
# Increase verbosity level. Please use this when submitting bug |
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> |
# to submit bug reports. |
#AVRDUDE_FLAGS += -v -v |
# --------------------------------------------------------------------------- |
# Define directories, if needed. |
DIRAVR = c:/winavr |
DIRAVRBIN = $(DIRAVR)/bin |
DIRAVRUTILS = $(DIRAVR)/utils/bin |
DIRINC = . |
DIRLIB = $(DIRAVR)/avr/lib |
# Define programs and commands. |
SHELL = sh |
CC = avr-gcc |
OBJCOPY = avr-objcopy |
OBJDUMP = avr-objdump |
SIZE = avr-size |
# Programming support using avrdude. |
AVRDUDE = avrdude |
REMOVE = rm -f |
COPY = cp |
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex |
ELFSIZE = $(SIZE) -A $(TARGET).elf |
# Define Messages |
# English |
MSG_ERRORS_NONE = Errors: none |
MSG_BEGIN = -------- begin -------- |
MSG_END = -------- end -------- |
MSG_SIZE_BEFORE = Size before: |
MSG_SIZE_AFTER = Size after: |
MSG_COFF = Converting to AVR COFF: |
MSG_EXTENDED_COFF = Converting to AVR Extended COFF: |
MSG_FLASH = Creating load file for Flash: |
MSG_EEPROM = Creating load file for EEPROM: |
MSG_EXTENDED_LISTING = Creating Extended Listing: |
MSG_SYMBOL_TABLE = Creating Symbol Table: |
MSG_LINKING = Linking: |
MSG_COMPILING = Compiling: |
MSG_ASSEMBLING = Assembling: |
MSG_CLEANING = Cleaning project: |
# Define all object files. |
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o) |
# Define all listing files. |
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst) |
# Combine all necessary flags and optional flags. |
# Add target processor to flags. |
#ALL_CFLAGS = -mmcu=$(MCU) -DF_CPU=$(F_CPU) -I. $(CFLAGS) |
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) |
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) |
# Default target. |
all: begin gccversion sizebefore $(TARGET).elf $(TARGET).hex $(TARGET).eep \ |
$(TARGET).lss $(TARGET).sym sizeafter finished end |
# Eye candy. |
# AVR Studio 3.x does not check make's exit code but relies on |
# the following magic strings to be generated by the compile job. |
begin: |
@echo |
@echo $(MSG_BEGIN) |
finished: |
@echo $(MSG_ERRORS_NONE) |
end: |
@echo $(MSG_END) |
@echo |
# Display size of file. |
sizebefore: |
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi |
sizeafter: |
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi |
# Display compiler version information. |
gccversion : |
@$(CC) --version |
# Convert ELF to COFF for use in debugging / simulating in |
# AVR Studio or VMLAB. |
COFFCONVERT=$(OBJCOPY) --debugging \ |
--change-section-address .data-0x800000 \ |
--change-section-address .bss-0x800000 \ |
--change-section-address .noinit-0x800000 \ |
--change-section-address .eeprom-0x810000 |
coff: $(TARGET).elf |
@echo |
@echo $(MSG_COFF) $(TARGET).cof |
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof |
extcoff: $(TARGET).elf |
@echo |
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof |
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof |
# Program the device. |
program: $(TARGET).hex $(TARGET).eep |
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) |
# Create final output files (.hex, .eep) from ELF output file. |
%.hex: %.elf |
@echo |
@echo $(MSG_FLASH) $@ |
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ |
%.eep: %.elf |
@echo |
@echo $(MSG_EEPROM) $@ |
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ |
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@ |
# Create extended listing file from ELF output file. |
%.lss: %.elf |
@echo |
@echo $(MSG_EXTENDED_LISTING) $@ |
$(OBJDUMP) -h -S $< > $@ |
# Create a symbol table from ELF output file. |
%.sym: %.elf |
@echo |
@echo $(MSG_SYMBOL_TABLE) $@ |
avr-nm -n $< > $@ |
# Link: create ELF output file from object files. |
.SECONDARY : $(TARGET).elf |
.PRECIOUS : $(OBJ) |
%.elf: $(OBJ) |
@echo |
@echo $(MSG_LINKING) $@ |
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS) |
# Compile: create object files from C source files. |
%.o : %.c |
@echo |
@echo $(MSG_COMPILING) $< |
$(CC) -c $(ALL_CFLAGS) $< -o $@ |
# Compile: create assembler files from C source files. |
%.s : %.c |
$(CC) -S $(ALL_CFLAGS) $< -o $@ |
# Assemble: create object files from assembler source files. |
%.o : %.S |
@echo |
@echo $(MSG_ASSEMBLING) $< |
$(CC) -c $(ALL_ASFLAGS) $< -o $@ |
# Target: clean project. |
clean: begin clean_list finished end |
clean_list : |
@echo |
@echo $(MSG_CLEANING) |
# $(REMOVE) $(TARGET).hex |
$(REMOVE) $(TARGET).eep |
$(REMOVE) $(TARGET).obj |
$(REMOVE) $(TARGET).cof |
$(REMOVE) $(TARGET).elf |
$(REMOVE) $(TARGET).map |
$(REMOVE) $(TARGET).obj |
$(REMOVE) $(TARGET).a90 |
$(REMOVE) $(TARGET).sym |
$(REMOVE) $(TARGET).lnk |
$(REMOVE) $(TARGET).lss |
$(REMOVE) $(OBJ) |
$(REMOVE) $(LST) |
$(REMOVE) $(SRC:.c=.s) |
$(REMOVE) $(SRC:.c=.d) |
# Automatically generate C source code dependencies. |
# (Code originally taken from the GNU make user manual and modified |
# (See README.txt Credits).) |
# |
# Note that this will work with sh (bash) and sed that is shipped with WinAVR |
# (see the SHELL variable defined above). |
# This may not work with other shells or other seds. |
# |
%.d: %.c |
set -e; $(CC) -MM $(ALL_CFLAGS) $< \ |
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > $@; \ |
[ -s $@ ] || rm -f $@ |
# Remove the '-' if you want to see the dependency files generated. |
-include $(SRC:.c=.d) |
# Listing of phony targets. |
.PHONY : all begin finish end sizebefore sizeafter gccversion coff extcoff \ |
clean clean_list program |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/math.c |
---|
0,0 → 1,118 |
/* |
Copyright 2007, Niklas Nold |
This program (files math.c and math.h) is free software; you can redistribute it and/or modify |
it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; |
either version 3 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
Please note: All the other files for the project "Mikrokopter" by H. Buss are under the license (license_buss.txt) published by www.mikrokopter.de |
*/ |
#include "main.h" |
const uint8_t pgm_atan[270] PROGMEM = {0,1,2,3,5,6,7,8,9,10,11,12,13,15,16,17,18,19,20,21,22,23,24,25,26,27,27,28,29,30,31,32,33,33,34,35,36,37,37,38,39,39,40,41,41,42,43,43,44,44,45,46,46,47,47,48,48,49,49,50,50,51,51,52,52,52,53,53,54,54,54,55,55,56,56,56,57,57,57,58,58,58,59,59,59,60,60,60,60,61,61,61,61,62,62,62,62,63,63,63,63,64,64,64,64,65,65,65,65,65,66,66,66,66,66,67,67,67,67,67,67,68,68,68,68,68,68,69,69,69,69,69,69,69,70,70,70,70,70,70,70,70,71,71,71,71,71,71,71,71,72,72,72,72,72,72,72,72,72,73,73,73,73,73,73,73,73,73,73,74,74,74,74,74,74,74,74,74,74,74,74,75,75,75,75,75,75,75,75,75,75,75,75,75,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79}; |
// Arkustangens2 im Gradmaß |
signed int atan2_i(signed int x, signed int y) |
{ |
int i,angle; |
int8_t m; |
if (!x && !y) return 0; //atan2 = 0 für x und y = 0 |
if (y < 0) m=-1; |
else m=1; |
if (x==0) return (90*m); // atan2 = 90° für x = 0 |
i = abs(((float)y / x) * 50); // Berechne i für die Lookup table (Schrittweite atan(x) ist 0.02 -> *50) |
if (i<270) angle = pgm_read_byte(&pgm_atan[i]); // Lookup für 1° bis 79° |
else if (i>5750) angle = 90; // Grenzwert ist 90° |
else if (i>=1910) angle = 89; // 89° bis 80° über Wertebereiche |
else if (i>=1150) angle = 88; |
else if (i>=820) angle = 87; |
else if (i>=640) angle = 86; |
else if (i>=520) angle = 85; |
else if (i>=440) angle = 84; |
else if (i>=380) angle = 83; |
else if (i>=335) angle = 82; |
else if (i>=299) angle = 81; |
else angle = 80; // (i>=270) |
if (x > 0) return (angle*m); // Quadrant I und IV |
else if ((x < 0) && (y >= 0)) return ((angle*-1) + 180); // Quadrant II |
else return (angle - 180); // x < 0 && y < 0 Quadrant III |
} |
const float pgm_sinus_f [91] PROGMEM = {0.000,0.017,0.035,0.052,0.070,0.087,0.105,0.122,0.139,0.156,0.174,0.191,0.208,0.225,0.242,0.259,0.276,0.292,0.309,0.326,0.342,0.358,0.375,0.391,0.407,0.423,0.438,0.454,0.469,0.485,0.500,0.515,0.530,0.545,0.559,0.574,0.588,0.602,0.616,0.629,0.643,0.656,0.669,0.682,0.695,0.707,0.719,0.731,0.743,0.755,0.766,0.777,0.788,0.799,0.809,0.819,0.829,0.839,0.848,0.857,0.866,0.875,0.883,0.891,0.899,0.906,0.914,0.921,0.927,0.934,0.940,0.946,0.951,0.956,0.961,0.966,0.970,0.974,0.978,0.982,0.985,0.988,0.990,0.993,0.995,0.996,0.998,0.999,0.999,1.000,1.000}; |
inline float pgm_read_float(const float *addr) |
{ |
union |
{ |
uint16_t i[2]; // 2 16-bit-Worte |
float f; |
} u; |
u.i[0]=pgm_read_word((PGM_P)addr); |
u.i[1]=pgm_read_word((PGM_P)addr+2); |
return u.f; |
} |
// Kosinusfunktion im Gradmaß |
float cos_f(signed int winkel) |
{ |
return (sin_f(90-winkel)); |
} |
// Sinusfunktion im Gradmaß |
float sin_f(signed int winkel) |
{ |
short int m,n; |
float sinus; |
//winkel = winkel % 360; |
if (winkel < 0) |
{ |
m = -1; |
winkel = abs(winkel); |
} |
else m = +1; |
// Quadranten auswerten |
if ((winkel > 90 ) && (winkel <= 180)) {winkel = 180 - winkel; n = 1;} |
else if ((winkel > 180 ) && (winkel <= 270)) {winkel = winkel - 180; n = -1;} |
else if ((winkel > 270) && (winkel <= 360)) {winkel = 360 - winkel; n = -1;} |
else n = 1; //0 - 90 Grad |
sinus = pgm_read_float(&pgm_sinus_f[winkel]); |
return (sinus*m*n); |
} |
const uint8_t pgm_asin[201] PROGMEM = {0,0,1,1,1,1,2,2,2,3,3,3,3,4,4,4,5,5,5,5,6,6,6,7,7,7,7,8,8,8,9,9,9,9,10,10,10,11,11,11,12,12,12,12,13,13,13,14,14,14,14,15,15,15,16,16,16,17,17,17,17,18,18,18,19,19,19,20,20,20,20,21,21,21,22,22,22,23,23,23,24,24,24,25,25,25,25,26,26,26,27,27,27,28,28,28,29,29,29,30,30,30,31,31,31,32,32,32,33,33,33,34,34,34,35,35,35,36,36,37,37,37,38,38,38,39,39,39,40,40,41,41,41,42,42,42,43,43,44,44,44,45,45,46,46,46,47,47,48,48,49,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,62,62,63,64,64,65,66,66,67,68,68,69,70,71,72,73,74,75,76,77,79,80,82,84,90}; |
// Akurssinusfunktion im Gradmaß |
int8_t asin_i(signed int i) |
{ |
signed char m; |
if (i < 0) {m=-1;i=abs(i);} |
else m=1; |
return (pgm_read_byte(&pgm_asin[i]) * m); |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/math.h |
---|
0,0 → 1,11 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Peter Muehlenbrock |
// Definitionen fuer Modul math |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
extern signed int atan2_i(signed int x, signed int y); |
extern float cos_f(signed int winkel); |
extern float sin_f(signed int winkel); |
extern int8_t asin_i(signed int i); |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/menu.c |
---|
0,0 → 1,124 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
unsigned int TestInt = 0; |
#define ARRAYGROESSE 10 |
unsigned char Array[ARRAYGROESSE] = {1,2,3,4,5,6,7,8,9,10}; |
char DisplayBuff[80] = "Hallo Welt"; |
unsigned char DispPtr = 0; |
unsigned char RemoteTasten = 0; |
#define KEY1 0x01 |
#define KEY2 0x02 |
#define KEY3 0x04 |
#define KEY4 0x08 |
#define KEY5 0x10 |
void LcdClear(void) |
{ |
unsigned char i; |
for(i=0;i<80;i++) DisplayBuff[i] = ' '; |
} |
void Menu(void) |
{ |
static unsigned char MaxMenue = 11,MenuePunkt=0; |
if(RemoteTasten & KEY1) { if(MenuePunkt) MenuePunkt--; else MenuePunkt = MaxMenue; LcdClear(); } |
if(RemoteTasten & KEY2) { MenuePunkt++; LcdClear(); } |
if((RemoteTasten & KEY1) && (RemoteTasten & KEY2)) MenuePunkt = 0; |
LCD_printfxy(17,0,"[%i]",MenuePunkt); |
switch(MenuePunkt) |
{ |
case 0: |
LCD_printfxy(0,0,"++ MikroKopter ++"); |
LCD_printfxy(0,1,"HW:V%d.%d SW:%d.%d",PlatinenVersion/10,PlatinenVersion%10,VERSION_HAUPTVERSION, VERSION_NEBENVERSION); |
LCD_printfxy(0,2,"Setting: %d ",GetActiveParamSetNumber()); |
LCD_printfxy(0,3,"(c) Holger Buss"); |
// if(RemoteTasten & KEY3) TestInt--; |
// if(RemoteTasten & KEY4) TestInt++; |
break; |
case 1: |
if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
LCD_printfxy(0,0,"Hoehe: %5i",HoehenWert); |
LCD_printfxy(0,1,"SollHoehe: %5i",SollHoehe); |
LCD_printfxy(0,2,"Luftdruck: %5i",MessLuftdruck); |
LCD_printfxy(0,3,"Off : %5i",DruckOffsetSetting); |
} |
else |
{ |
LCD_printfxy(0,1,"Keine "); |
LCD_printfxy(0,2,"Höhenregelung"); |
} |
break; |
case 2: |
LCD_printfxy(0,0,"akt. Lage"); |
LCD_printfxy(0,1,"Nick: %5i",IntegralNick/1024); |
LCD_printfxy(0,2,"Roll: %5i",IntegralRoll/1024); |
LCD_printfxy(0,3,"Kompass: %5i",KompassValue); |
break; |
case 3: |
LCD_printfxy(0,0,"K1:%4i K2:%4i ",PPM_in[1],PPM_in[2]); |
LCD_printfxy(0,1,"K3:%4i K4:%4i ",PPM_in[3],PPM_in[4]); |
LCD_printfxy(0,2,"K5:%4i K6:%4i ",PPM_in[5],PPM_in[6]); |
LCD_printfxy(0,3,"K7:%4i K8:%4i ",PPM_in[7],PPM_in[8]); |
break; |
case 4: |
LCD_printfxy(0,0,"Ni:%4i Ro:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_NICK]],PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]); |
LCD_printfxy(0,1,"Gs:%4i Gi:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_GAS]],PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]); |
LCD_printfxy(0,2,"P1:%4i P2:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]],PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]]); |
LCD_printfxy(0,3,"P3:%4i P4:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]],PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]]); |
break; |
case 5: |
LCD_printfxy(0,0,"Gyro - Sensor"); |
LCD_printfxy(0,1,"Nick %4i (%3i)",AccumulateNick / MessanzahlNick, AdNeutralNick); |
LCD_printfxy(0,2,"Roll %4i (%3i)",AccumulateRoll / MessanzahlRoll, AdNeutralRoll); |
LCD_printfxy(0,3,"Gier %4i (%3i)",AccumulateGier / MessanzahlGier, AdNeutralGier); |
break; |
case 6: |
LCD_printfxy(0,0,"ACC - Sensor"); |
LCD_printfxy(0,1,"Nick %4i (%3i)",accumulate_AccNick / messanzahl_AccNick,NeutralAccX); |
LCD_printfxy(0,2,"Roll %4i (%3i)",accumulate_AccRoll / messanzahl_AccRoll,NeutralAccY); |
LCD_printfxy(0,3,"Hoch %4i (%3i)",Aktuell_az/*accumulate_AccHoch / messanzahl_AccHoch*/,(int)NeutralAccZ); |
break; |
case 7: |
LCD_printfxy(0,1,"Spannung: %5i",UBat); |
LCD_printfxy(0,2,"Empf.Pegel:%5i",SenderOkay); |
break; |
case 8: |
LCD_printfxy(0,0,"Kompass "); |
LCD_printfxy(0,1,"Richtung: %5i",KompassRichtung); |
LCD_printfxy(0,2,"Messwert: %5i",KompassValue); |
LCD_printfxy(0,3,"Start: %5i",KompassStartwert); |
break; |
case 9: |
LCD_printfxy(0,0,"Po1: %3i Po5: %3i" ,Poti1,Poti5); //PPM24-Erweiterung (121007Kr) |
LCD_printfxy(0,1,"Po2: %3i Po6: %3i" ,Poti2,Poti6); //PPM24-Erweiterung (121007Kr) |
LCD_printfxy(0,2,"Po3: %3i Po7: %3i" ,Poti3,Poti7); //PPM24-Erweiterung (121007Kr) |
LCD_printfxy(0,3,"Po4: %3i Po8: %3i" ,Poti4,Poti8); //PPM24-Erweiterung (121007Kr) |
break; |
case 10: |
LCD_printfxy(0,0,"Servo " ); |
LCD_printfxy(0,1,"Setpoint %3i",Parameter_ServoNickControl); |
LCD_printfxy(0,2,"Stellung: %3i",ServoValue); |
LCD_printfxy(0,3,"Range:%3i-%3i",EE_Parameter.ServoNickMin,EE_Parameter.ServoNickMax); |
break; |
case 11: |
LCD_printfxy(0,0,"MM3 kalib."); |
LCD_printfxy(0,1,"X_Offset: %3i",X_off); |
LCD_printfxy(0,2,"Y_Offset: %3i",Y_off); |
LCD_printfxy(0,3,"Z_Offset: %3i",Z_off); |
break; |
default: MaxMenue = MenuePunkt - 1; |
MenuePunkt = 0; |
break; |
} |
RemoteTasten = 0; |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/menu.h |
---|
0,0 → 1,7 |
void LcdClear(void); //Nick666 |
extern void Menu(void); |
extern char DisplayBuff[80]; |
extern unsigned char DispPtr; |
unsigned char RemoteTasten; |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/old_macros.h |
---|
0,0 → 1,47 |
/* |
For backwards compatibility only. |
Ingo Busker ingo@mikrocontroller.com |
*/ |
#ifndef cbi |
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) |
#endif |
#ifndef sbi |
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit)) |
#endif |
#ifndef inb |
#define inb(sfr) _SFR_BYTE(sfr) |
#endif |
#ifndef outb |
#define outb(sfr, val) (_SFR_BYTE(sfr) = (val)) |
#endif |
#ifndef inw |
#define inw(sfr) _SFR_WORD(sfr) |
#endif |
#ifndef outw |
#define outw(sfr, val) (_SFR_WORD(sfr) = (val)) |
#endif |
#ifndef outp |
#define outp(val, sfr) outb(sfr, val) |
#endif |
#ifndef inp |
#define inp(sfr) inb(sfr) |
#endif |
#ifndef BV |
#define BV(bit) _BV(bit) |
#endif |
#ifndef PRG_RDB |
#define PRG_RDB pgm_read_byte |
#endif |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/printf_P.c |
---|
0,0 → 1,480 |
// Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist nicht von der Lizenz für den MikroKopter-Teil unterstellt |
/* |
Copyright (C) 1993 Free Software Foundation |
This file is part of the GNU IO Library. This library is free |
software; you can redistribute it and/or modify it under the |
terms of the GNU General Public License as published by the |
Free Software Foundation; either version 2, or (at your option) |
any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License for more details. |
You should have received a copy of the GNU General Public License |
along with this library; see the file COPYING. If not, write to the Free |
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
As a special exception, if you link this library with files |
compiled with a GNU compiler to produce an executable, this does not cause |
the resulting executable to be covered by the GNU General Public License. |
This exception does not however invalidate any other reasons why |
the executable file might be covered by the GNU General Public License. */ |
/* |
* Copyright (c) 1990 Regents of the University of California. |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* 1. Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* 2. Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* 3. [rescinded 22 July 1999] |
* 4. Neither the name of the University nor the names of its contributors |
* may be used to endorse or promote products derived from this software |
* without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
* SUCH DAMAGE. |
*/ |
/****************************************************************************** |
This file is a patched version of printf called _printf_P |
It is made to work with avr-gcc for Atmel AVR MCUs. |
There are some differences from standard printf: |
1. There is no floating point support (with fp the code is about 8K!) |
2. Return type is void |
3. Format string must be in program memory (by using macro printf this is |
done automaticaly) |
4. %n is not implemented (just remove the comment around it if you need it) |
5. If LIGHTPRINTF is defined, the code is about 550 bytes smaller and the |
folowing specifiers are disabled : |
space # * . - + p s o O |
6. A function void uart_sendchar(char c) is used for output. The UART must |
be initialized before using printf. |
Alexander Popov |
sasho@vip.orbitel.bg |
******************************************************************************/ |
/* |
* Actual printf innards. |
* |
* This code is large and complicated... |
*/ |
#include <string.h> |
#ifdef __STDC__ |
#include <stdarg.h> |
#else |
#include <varargs.h> |
#endif |
#include "main.h" |
//#define LIGHTPRINTF |
char PrintZiel; |
char Putchar(char zeichen) |
{ |
if(PrintZiel == OUT_LCD) { DisplayBuff[DispPtr++] = zeichen; return(1);} |
else return(uart_putchar(zeichen)); |
} |
void PRINT(const char * ptr, unsigned int len) |
{ |
for(;len;len--) Putchar(*ptr++); |
} |
void PRINTP(const char * ptr, unsigned int len) |
{ |
for(;len;len--) Putchar(pgm_read_byte(ptr++)); |
} |
void PAD_SP(signed char howmany) |
{ |
for(;howmany>0;howmany--) Putchar(' '); |
} |
void PAD_0(signed char howmany) |
{ |
for(;howmany>0;howmany--) Putchar('0'); |
} |
#define BUF 40 |
/* |
* Macros for converting digits to letters and vice versa |
*/ |
#define to_digit(c) ((c) - '0') |
#define is_digit(c) ((c)<='9' && (c)>='0') |
#define to_char(n) ((n) + '0') |
/* |
* Flags used during conversion. |
*/ |
#define LONGINT 0x01 /* long integer */ |
#define LONGDBL 0x02 /* long double; unimplemented */ |
#define SHORTINT 0x04 /* short integer */ |
#define ALT 0x08 /* alternate form */ |
#define LADJUST 0x10 /* left adjustment */ |
#define ZEROPAD 0x20 /* zero (as opposed to blank) pad */ |
#define HEXPREFIX 0x40 /* add 0x or 0X prefix */ |
void _printf_P (char ziel,char const *fmt0, ...) /* Works with string from FLASH */ |
{ |
va_list ap; |
register const char *fmt; /* format string */ |
register char ch; /* character from fmt */ |
register int n; /* handy integer (short term usage) */ |
register char *cp; /* handy char pointer (short term usage) */ |
const char *fmark; /* for remembering a place in fmt */ |
register unsigned char flags; /* flags as above */ |
signed char width; /* width from format (%8d), or 0 */ |
signed char prec; /* precision from format (%.3d), or -1 */ |
char sign; /* sign prefix (' ', '+', '-', or \0) */ |
unsigned long _ulong=0; /* integer arguments %[diouxX] */ |
#define OCT 8 |
#define DEC 10 |
#define HEX 16 |
unsigned char base; /* base for [diouxX] conversion */ |
signed char dprec; /* a copy of prec if [diouxX], 0 otherwise */ |
signed char dpad; /* extra 0 padding needed for integers */ |
signed char fieldsz; /* field size expanded by sign, dpad etc */ |
/* The initialization of 'size' is to suppress a warning that |
'size' might be used unitialized. It seems gcc can't |
quite grok this spaghetti code ... */ |
signed char size = 0; /* size of converted field or string */ |
char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */ |
char ox[2]; /* space for 0x hex-prefix */ |
PrintZiel = ziel; // bestimmt, LCD oder UART |
va_start(ap, fmt0); |
fmt = fmt0; |
/* |
* Scan the format for conversions (`%' character). |
*/ |
for (;;) { |
for (fmark = fmt; (ch = pgm_read_byte(fmt)) != '\0' && ch != '%'; fmt++) |
/* void */; |
if ((n = fmt - fmark) != 0) { |
PRINTP(fmark, n); |
} |
if (ch == '\0') |
goto done; |
fmt++; /* skip over '%' */ |
flags = 0; |
dprec = 0; |
width = 0; |
prec = -1; |
sign = '\0'; |
rflag: ch = PRG_RDB(fmt++); |
reswitch: |
#ifdef LIGHTPRINTF |
if (ch=='o' || ch=='u' || (ch|0x20)=='x') { |
#else |
if (ch=='u' || (ch|0x20)=='x') { |
#endif |
if (flags&LONGINT) { |
_ulong=va_arg(ap, unsigned long); |
} else { |
register unsigned int _d; |
_d=va_arg(ap, unsigned int); |
_ulong = flags&SHORTINT ? (unsigned long)(unsigned short)_d : (unsigned long)_d; |
} |
} |
#ifndef LIGHTPRINTF |
if(ch==' ') { |
/* |
* ``If the space and + flags both appear, the space |
* flag will be ignored.'' |
* -- ANSI X3J11 |
*/ |
if (!sign) |
sign = ' '; |
goto rflag; |
} else if (ch=='#') { |
flags |= ALT; |
goto rflag; |
} else if (ch=='*'||ch=='-') { |
if (ch=='*') { |
/* |
* ``A negative field width argument is taken as a |
* - flag followed by a positive field width.'' |
* -- ANSI X3J11 |
* They don't exclude field widths read from args. |
*/ |
if ((width = va_arg(ap, int)) >= 0) |
goto rflag; |
width = -width; |
} |
flags |= LADJUST; |
flags &= ~ZEROPAD; /* '-' disables '0' */ |
goto rflag; |
} else if (ch=='+') { |
sign = '+'; |
goto rflag; |
} else if (ch=='.') { |
if ((ch = PRG_RDB(fmt++)) == '*') { |
n = va_arg(ap, int); |
prec = n < 0 ? -1 : n; |
goto rflag; |
} |
n = 0; |
while (is_digit(ch)) { |
n = n*10 + to_digit(ch); |
ch = PRG_RDB(fmt++); |
} |
prec = n < 0 ? -1 : n; |
goto reswitch; |
} else |
#endif /* LIGHTPRINTF */ |
if (ch=='0') { |
/* |
* ``Note that 0 is taken as a flag, not as the |
* beginning of a field width.'' |
* -- ANSI X3J11 |
*/ |
if (!(flags & LADJUST)) |
flags |= ZEROPAD; /* '-' disables '0' */ |
goto rflag; |
} else if (ch>='1' && ch<='9') { |
n = 0; |
do { |
n = 10 * n + to_digit(ch); |
ch = PRG_RDB(fmt++); |
} while (is_digit(ch)); |
width = n; |
goto reswitch; |
} else if (ch=='h') { |
flags |= SHORTINT; |
goto rflag; |
} else if (ch=='l') { |
flags |= LONGINT; |
goto rflag; |
} else if (ch=='c') { |
*(cp = buf) = va_arg(ap, int); |
size = 1; |
sign = '\0'; |
} else if (ch=='D'||ch=='d'||ch=='i') { |
if(ch=='D') |
flags |= LONGINT; |
if (flags&LONGINT) { |
_ulong=va_arg(ap, long); |
} else { |
register int _d; |
_d=va_arg(ap, int); |
_ulong = flags&SHORTINT ? (long)(short)_d : (long)_d; |
} |
if ((long)_ulong < 0) { |
_ulong = -_ulong; |
sign = '-'; |
} |
base = DEC; |
goto number; |
} else |
/* |
if (ch=='n') { |
if (flags & LONGINT) |
*va_arg(ap, long *) = ret; |
else if (flags & SHORTINT) |
*va_arg(ap, short *) = ret; |
else |
*va_arg(ap, int *) = ret; |
continue; // no output |
} else |
*/ |
#ifndef LIGHTPRINTF |
if (ch=='O'||ch=='o') { |
if (ch=='O') |
flags |= LONGINT; |
base = OCT; |
goto nosign; |
} else if (ch=='p') { |
/* |
* ``The argument shall be a pointer to void. The |
* value of the pointer is converted to a sequence |
* of printable characters, in an implementation- |
* defined manner.'' |
* -- ANSI X3J11 |
*/ |
/* NOSTRICT */ |
_ulong = (unsigned int)va_arg(ap, void *); |
base = HEX; |
flags |= HEXPREFIX; |
ch = 'x'; |
goto nosign; |
} else if (ch=='s') { // print a string from RAM |
if ((cp = va_arg(ap, char *)) == NULL) { |
cp=buf; |
cp[0] = '('; |
cp[1] = 'n'; |
cp[2] = 'u'; |
cp[4] = cp[3] = 'l'; |
cp[5] = ')'; |
cp[6] = '\0'; |
} |
if (prec >= 0) { |
/* |
* can't use strlen; can only look for the |
* NUL in the first `prec' characters, and |
* strlen() will go further. |
*/ |
char *p = (char*)memchr(cp, 0, prec); |
if (p != NULL) { |
size = p - cp; |
if (size > prec) |
size = prec; |
} else |
size = prec; |
} else |
size = strlen(cp); |
sign = '\0'; |
} else |
#endif /* LIGHTPRINTF */ |
if(ch=='U'||ch=='u') { |
if (ch=='U') |
flags |= LONGINT; |
base = DEC; |
goto nosign; |
} else if (ch=='X'||ch=='x') { |
base = HEX; |
/* leading 0x/X only if non-zero */ |
if (flags & ALT && _ulong != 0) |
flags |= HEXPREFIX; |
/* unsigned conversions */ |
nosign: sign = '\0'; |
/* |
* ``... diouXx conversions ... if a precision is |
* specified, the 0 flag will be ignored.'' |
* -- ANSI X3J11 |
*/ |
number: if ((dprec = prec) >= 0) |
flags &= ~ZEROPAD; |
/* |
* ``The result of converting a zero value with an |
* explicit precision of zero is no characters.'' |
* -- ANSI X3J11 |
*/ |
cp = buf + BUF; |
if (_ulong != 0 || prec != 0) { |
register unsigned char _d,notlastdigit; |
do { |
notlastdigit=(_ulong>=base); |
_d = _ulong % base; |
if (_d<10) { |
_d+='0'; |
} else { |
_d+='a'-10; |
if (ch=='X') _d&=~0x20; |
} |
*--cp=_d; |
_ulong /= base; |
} while (notlastdigit); |
#ifndef LIGHTPRINTF |
// handle octal leading 0 |
if (base==OCT && flags & ALT && *cp != '0') |
*--cp = '0'; |
#endif |
} |
size = buf + BUF - cp; |
} else { //default |
/* "%?" prints ?, unless ? is NUL */ |
if (ch == '\0') |
goto done; |
/* pretend it was %c with argument ch */ |
cp = buf; |
*cp = ch; |
size = 1; |
sign = '\0'; |
} |
/* |
* All reasonable formats wind up here. At this point, |
* `cp' points to a string which (if not flags&LADJUST) |
* should be padded out to `width' places. If |
* flags&ZEROPAD, it should first be prefixed by any |
* sign or other prefix; otherwise, it should be blank |
* padded before the prefix is emitted. After any |
* left-hand padding and prefixing, emit zeroes |
* required by a decimal [diouxX] precision, then print |
* the string proper, then emit zeroes required by any |
* leftover floating precision; finally, if LADJUST, |
* pad with blanks. |
*/ |
/* |
* compute actual size, so we know how much to pad. |
*/ |
fieldsz = size; |
dpad = dprec - size; |
if (dpad < 0) |
dpad = 0; |
if (sign) |
fieldsz++; |
else if (flags & HEXPREFIX) |
fieldsz += 2; |
fieldsz += dpad; |
/* right-adjusting blank padding */ |
if ((flags & (LADJUST|ZEROPAD)) == 0) |
PAD_SP(width - fieldsz); |
/* prefix */ |
if (sign) { |
PRINT(&sign, 1); |
} else if (flags & HEXPREFIX) { |
ox[0] = '0'; |
ox[1] = ch; |
PRINT(ox, 2); |
} |
/* right-adjusting zero padding */ |
if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD) |
PAD_0(width - fieldsz); |
/* leading zeroes from decimal precision */ |
PAD_0(dpad); |
/* the string or number proper */ |
PRINT(cp, size); |
/* left-adjusting padding (always blank) */ |
if (flags & LADJUST) |
PAD_SP(width - fieldsz); |
} |
done: |
va_end(ap); |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/printf_P.h |
---|
0,0 → 1,19 |
#ifndef _PRINTF_P_H_ |
#define _PRINTF_P_H_ |
#include <avr/pgmspace.h> |
#define OUT_V24 0 |
#define OUT_LCD 1 |
extern void _printf_P (char, char const *fmt0, ...); |
extern char PrintZiel; |
#define printf_P(format, args...) _printf_P(OUT_V24,format , ## args) |
#define printf(format, args...) _printf_P(OUT_V24,PSTR(format) , ## args) |
#define LCD_printfxy(x,y,format, args...) { DispPtr = y * 20 + x; _printf_P(OUT_LCD,PSTR(format) , ## args);} |
#define LCD_printf(format, args...) { _printf_P(OUT_LCD,PSTR(format) , ## args);} |
#endif |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/rc.c |
---|
0,0 → 1,85 |
/*####################################################################################### |
Decodieren eines RC Summen Signals |
#######################################################################################*/ |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "rc.h" |
#include "main.h" |
volatile int PPM_in[15]; //PPM24-Erweiterung (121007Kr) |
volatile int PPM_diff[15]; // das diffenzierte Stick-Signal //PPM24-Erweiterung (121007Kr) |
volatile unsigned char NewPpmData = 1; |
//############################################################################ |
//zum decodieren des PPM-Signals wird Timer1 mit seiner Input |
//Capture Funktion benutzt: |
void rc_sum_init (void) |
//############################################################################ |
{ |
TCCR1B=(1<<CS11)|(1<<CS10)|(1<<ICES1)|(1<<ICNC1);//|(1 << WGM12); //timer1 prescale 64 |
// PWM |
//TCCR1A = (1 << COM1B1) | (1 << WGM11) | (1 << WGM10); |
//TCCR1B |= (1 << WGM12); |
//OCR1B = 55; |
TIMSK1 |= _BV(ICIE1); |
AdNeutralGier = 0; |
AdNeutralRoll = 0; |
AdNeutralNick = 0; |
return; |
} |
//############################################################################ |
//Diese Routine startet und inizialisiert den Timer für RC |
SIGNAL(SIG_INPUT_CAPTURE1) |
//############################################################################ |
{ |
static unsigned int AltICR=0; |
signed int signal = 0,tmp; |
static int index; |
signal = (unsigned int) ICR1 - AltICR; |
AltICR = ICR1; |
//Syncronisationspause? |
if ((signal > 1500) && (signal < 8000)) |
{ |
index = 1; |
NewPpmData = 0; // Null bedeutet: Neue Daten |
// OCR2A = Poti2/2 + 80; |
} |
else |
{ |
if(index < 14) //PPM24-Erweiterung (121007Kr) |
{ |
if((signal > 250) && (signal < 687)) |
{ |
signal -= 466; |
// Stabiles Signal |
if(abs(signal - PPM_in[index]) < 6) { if(SenderOkay < 200) SenderOkay += 10;} |
tmp = (3 * (PPM_in[index]) + signal) / 4; |
// if(tmp > signal+1) tmp--; else |
// if(tmp < signal-1) tmp++; |
PPM_diff[index] = tmp - PPM_in[index]; |
PPM_in[index] = tmp; |
} |
index++; |
if(index == 5) PORTD |= 0x20; else PORTD &= ~0x20; // Servosignal an J3 anlegen |
if(index == 6) PORTD |= 0x10; else PORTD &= ~0x10; // Servosignal an J4 anlegen |
if(index == 7) PORTD |= 0x08; else PORTD &= ~0x08; // Servosignal an J5 anlegen |
} |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/rc.h |
---|
0,0 → 1,29 |
/*####################################################################################### |
Derkodieren eines RC Summen Signals |
#######################################################################################*/ |
#ifndef _RC_H |
#define _RC_H |
#if defined (__AVR_ATmega32__) |
#define TIMER_TEILER CK64 |
#define TIMER_RELOAD_VALUE 250 |
#endif |
#if defined (__AVR_ATmega644__) |
//#define TIMER_TEILER CK64 |
#define TIMER_RELOAD_VALUE 250 |
//#define TIMER_TEILER CK256 // bei 20MHz |
//#define TIMER_RELOAD_VALUE -78 // bei 20MHz |
#endif |
#define GAS PPM_in[2] |
extern void rc_sum_init (void); |
extern volatile int PPM_in[15]; //PPM24-Erweiterung (121007Kr) |
extern volatile int PPM_diff[15]; // das diffenzierte Stick-Signal //PPM24-Erweiterung (121007Kr) |
extern volatile unsigned char NewPpmData; |
#endif //_RC_H |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/timer0.c |
---|
0,0 → 1,187 |
#include "main.h" |
volatile unsigned int CountMilliseconds = 0; |
volatile static unsigned int tim_main; |
volatile unsigned char UpdateMotor = 0; |
volatile unsigned int cntKompass = 800; |
volatile unsigned int beeptime = 0; |
unsigned int BeepMuster = 0xffff; |
int ServoValue = 0; |
enum { |
STOP = 0, |
CK = 1, |
CK8 = 2, |
CK64 = 3, |
CK256 = 4, |
CK1024 = 5, |
T0_FALLING_EDGE = 6, |
T0_RISING_EDGE = 7 |
}; |
SIGNAL (SIG_OVERFLOW0) // 8kHz |
{ |
static unsigned char cnt_1ms = 1,cnt = 0; |
unsigned char pieper_ein = 0; |
// TCNT0 -= 250;//TIMER_RELOAD_VALUE; |
if(!cnt--) |
{ |
cnt = 9; |
cnt_1ms++; |
cnt_1ms %= 2; |
if(!cnt_1ms) UpdateMotor = 1; |
CountMilliseconds++; |
} |
if(beeptime > 1) |
{ |
beeptime--; |
PORTD |= (1<<PD2); |
if(beeptime & BeepMuster) |
{ |
pieper_ein = 1; |
} |
else pieper_ein = 0; |
} |
else |
{ |
pieper_ein = 0; |
BeepMuster = 0xffff; |
PORTD &= ~(1<<PD2); |
if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV) |
{ |
MM3_timer0(); // Kompass auslesen |
if (!cntKompass--) // Aufruf mit 10 Hz |
{ |
// KompassValue = MM3_heading(); |
// OsiAir hier machen wir den den KompassValue zu 0-359 damit das GPS damit weiterarbeiten kann |
if (MM3_heading() > 0) { KompassValue = 360-MM3_heading();} |
if (MM3_heading() < 0 ) { KompassValue = MM3_heading()*-1;} |
KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180; |
cntKompass = 800; |
} |
} |
} |
if(pieper_ein) |
{ |
if(PlatinenVersion == 10) PORTD |= (1<<2); // Speaker an PORTD.2 |
else PORTC |= (1<<7); // Speaker an PORTC.7 |
} |
else |
{ |
if(PlatinenVersion == 10) PORTD &= ~(1<<2); |
else PORTC &= ~(1<<7); |
} |
} |
/* |
if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV || EE_Parameter.GlobalConfig & CFG_GPS_AKTIV) //Abfrage um GPS_AKTIV erweitert, damit auch bei nur eingeschaltetem GPS OHNE Kompass der benötigte Kompassvalue berechnet wird (200907Kr) |
{ |
if(PINC & 0x10) |
{ |
cntKompass++; |
} |
else |
{ |
if((cntKompass) && (cntKompass < 4000)) |
{ |
KompassValue = cntKompass; |
} |
// if(cntKompass < 10) cntKompass = 10; |
// KompassValue = (unsigned long)((unsigned long)(cntKompass-10)*720L + 1L) / 703L; |
KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180; |
cntKompass = 0; |
} |
} |
} |
*/ |
void Timer_Init(void) |
{ |
tim_main = SetDelay(10); |
TCCR0B = CK8; |
TCCR0A = (1<<COM0A1)|(1<<COM0B1)|3;//fast PWM |
OCR0A = 0; |
OCR0B = 120; |
//TCNT0 = -TIMER_RELOAD_VALUE; // reload |
//OCR1 = 0x00; |
TCCR2A=(1<<COM2A1)|(1<<COM2A0)|3; |
TCCR2B=(0<<CS20)|(1<<CS21)|(1<<CS22); |
// TIMSK2 |= _BV(TOIE2); |
TIMSK2 |= _BV(OCIE2A); |
TIMSK0 |= _BV(TOIE0); |
OCR2A = 10; |
TCNT2 = 0; |
} |
// ----------------------------------------------------------------------- |
unsigned int SetDelay (unsigned int t) |
{ |
// TIMSK0 &= ~_BV(TOIE0); |
return(CountMilliseconds + t + 1); |
// TIMSK0 |= _BV(TOIE0); |
} |
// ----------------------------------------------------------------------- |
char CheckDelay(unsigned int t) |
{ |
// TIMSK0 &= ~_BV(TOIE0); |
return(((t - CountMilliseconds) & 0x8000) >> 9); |
// TIMSK0 |= _BV(TOIE0); |
} |
// ----------------------------------------------------------------------- |
void Delay_ms(unsigned int w) |
{ |
unsigned int akt; |
akt = SetDelay(w); |
while (!CheckDelay(akt)); |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Servo ansteuern |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(SIG_OUTPUT_COMPARE2A) |
{ |
static unsigned char timer = 10; |
if(!timer--) |
{ |
TCCR2A=(1<<COM2A1)|(0<<COM2A0)|3; |
ServoValue = Parameter_ServoNickControl; |
if(EE_Parameter.ServoNickCompInvert & 0x01) ServoValue += ((long) EE_Parameter.ServoNickComp * (IntegralNick / 128)) / 512; |
else ServoValue -= ((long) EE_Parameter.ServoNickComp * (IntegralNick / 128)) / 512; |
if(ServoValue < EE_Parameter.ServoNickMin) ServoValue = EE_Parameter.ServoNickMin; |
else if(ServoValue > EE_Parameter.ServoNickMax) ServoValue = EE_Parameter.ServoNickMax; |
OCR2A = ServoValue;// + 75; |
timer = EE_Parameter.ServoNickRefresh; |
} |
else |
{ |
TCCR2A =3; |
PORTD&=~0x80; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/timer0.c.bak |
---|
0,0 → 1,183 |
#include "main.h" |
volatile unsigned int CountMilliseconds = 0; |
volatile static unsigned int tim_main; |
volatile unsigned char UpdateMotor = 0; |
volatile unsigned int cntKompass = 800; |
volatile unsigned int beeptime = 0; |
unsigned int BeepMuster = 0xffff; |
int ServoValue = 0; |
enum { |
STOP = 0, |
CK = 1, |
CK8 = 2, |
CK64 = 3, |
CK256 = 4, |
CK1024 = 5, |
T0_FALLING_EDGE = 6, |
T0_RISING_EDGE = 7 |
}; |
SIGNAL (SIG_OVERFLOW0) // 8kHz |
{ |
static unsigned char cnt_1ms = 1,cnt = 0; |
unsigned char pieper_ein = 0; |
// TCNT0 -= 250;//TIMER_RELOAD_VALUE; |
if(!cnt--) |
{ |
cnt = 9; |
cnt_1ms++; |
cnt_1ms %= 2; |
if(!cnt_1ms) UpdateMotor = 1; |
CountMilliseconds++; |
} |
if(beeptime > 1) |
{ |
beeptime--; |
PORTD |= (1<<PD2); |
if(beeptime & BeepMuster) |
{ |
pieper_ein = 1; |
} |
else pieper_ein = 0; |
} |
else |
{ |
pieper_ein = 0; |
BeepMuster = 0xffff; |
} |
if(pieper_ein) |
{ |
if(PlatinenVersion == 10) PORTD |= (1<<2); // Speaker an PORTD.2 |
else PORTC |= (1<<7); // Speaker an PORTC.7 |
} |
else |
{ |
if(PlatinenVersion == 10) PORTD &= ~(1<<2); |
else PORTC &= ~(1<<7); |
} |
PORTD &= ~(1<<PD2); |
if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV) |
{ |
MM3_timer0(); // Kompass auslesen |
if (!cntKompass--) // Aufruf mit 10 Hz |
{ |
// KompassValue = MM3_heading(); |
// OsiAir hier machen wir den den KompassValue zu 0-359 damit das GPS damit weiterarbeiten kann |
if (MM3_heading() > 0) { KompassValue = 360-MM3_heading();} |
if (MM3_heading() < 0 ) { KompassValue = MM3_heading()*-1;} |
KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180; |
cntKompass = 800; |
} |
} |
} |
/* |
if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV || EE_Parameter.GlobalConfig & CFG_GPS_AKTIV) //Abfrage um GPS_AKTIV erweitert, damit auch bei nur eingeschaltetem GPS OHNE Kompass der benötigte Kompassvalue berechnet wird (200907Kr) |
{ |
if(PINC & 0x10) |
{ |
cntKompass++; |
} |
else |
{ |
if((cntKompass) && (cntKompass < 4000)) |
{ |
KompassValue = cntKompass; |
} |
// if(cntKompass < 10) cntKompass = 10; |
// KompassValue = (unsigned long)((unsigned long)(cntKompass-10)*720L + 1L) / 703L; |
KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180; |
cntKompass = 0; |
} |
} |
} |
*/ |
void Timer_Init(void) |
{ |
tim_main = SetDelay(10); |
TCCR0B = CK8; |
TCCR0A = (1<<COM0A1)|(1<<COM0B1)|3;//fast PWM |
OCR0A = 0; |
OCR0B = 120; |
//TCNT0 = -TIMER_RELOAD_VALUE; // reload |
//OCR1 = 0x00; |
TCCR2A=(1<<COM2A1)|(1<<COM2A0)|3; |
TCCR2B=(0<<CS20)|(1<<CS21)|(1<<CS22); |
// TIMSK2 |= _BV(TOIE2); |
TIMSK2 |= _BV(OCIE2A); |
TIMSK0 |= _BV(TOIE0); |
OCR2A = 10; |
TCNT2 = 0; |
} |
// ----------------------------------------------------------------------- |
unsigned int SetDelay (unsigned int t) |
{ |
// TIMSK0 &= ~_BV(TOIE0); |
return(CountMilliseconds + t + 1); |
// TIMSK0 |= _BV(TOIE0); |
} |
// ----------------------------------------------------------------------- |
char CheckDelay(unsigned int t) |
{ |
// TIMSK0 &= ~_BV(TOIE0); |
return(((t - CountMilliseconds) & 0x8000) >> 9); |
// TIMSK0 |= _BV(TOIE0); |
} |
// ----------------------------------------------------------------------- |
void Delay_ms(unsigned int w) |
{ |
unsigned int akt; |
akt = SetDelay(w); |
while (!CheckDelay(akt)); |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Servo ansteuern |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(SIG_OUTPUT_COMPARE2A) |
{ |
static unsigned char timer = 10; |
if(!timer--) |
{ |
TCCR2A=(1<<COM2A1)|(0<<COM2A0)|3; |
ServoValue = Parameter_ServoNickControl; |
if(EE_Parameter.ServoNickCompInvert & 0x01) ServoValue += ((long) EE_Parameter.ServoNickComp * (IntegralNick / 128)) / 512; |
else ServoValue -= ((long) EE_Parameter.ServoNickComp * (IntegralNick / 128)) / 512; |
if(ServoValue < EE_Parameter.ServoNickMin) ServoValue = EE_Parameter.ServoNickMin; |
else if(ServoValue > EE_Parameter.ServoNickMax) ServoValue = EE_Parameter.ServoNickMax; |
OCR2A = ServoValue;// + 75; |
timer = EE_Parameter.ServoNickRefresh; |
} |
else |
{ |
TCCR2A =3; |
PORTD&=~0x80; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/timer0.h |
---|
0,0 → 1,15 |
#define TIMER_TEILER CK8 |
#define TIMER_RELOAD_VALUE 250 |
void Timer_Init(void); |
void Delay_ms(unsigned int); |
unsigned int SetDelay (unsigned int t); |
char CheckDelay (unsigned int t); |
extern volatile unsigned int CountMilliseconds; |
extern volatile unsigned char UpdateMotor; |
extern volatile unsigned int beeptime; |
extern volatile unsigned int cntKompass; |
extern int ServoValue; |
extern unsigned int BeepMuster; |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/twimaster.c |
---|
0,0 → 1,152 |
/*############################################################################ |
############################################################################*/ |
#include "main.h" |
unsigned char twi_state = 0; |
unsigned char motor = 0; |
unsigned char motorread = 0; |
unsigned char motor_rx[8]; |
//############################################################################ |
//Initzialisieren der I2C (TWI) Schnittstelle |
void i2c_init(void) |
//############################################################################ |
{ |
TWSR = 0; |
TWBR = ((SYSCLK/SCL_CLOCK)-16)/2; |
} |
//############################################################################ |
//Start I2C |
char i2c_start(void) |
//############################################################################ |
{ |
TWCR = (1<<TWSTA) | (1<<TWEN) | (1<<TWINT) | (1<<TWIE); |
return(0); |
} |
//############################################################################ |
//Start I2C |
void i2c_stop(void) |
//############################################################################ |
{ |
TWCR = (1<<TWEN) | (1<<TWSTO) | (1<<TWINT); |
} |
void i2c_reset(void) |
//############################################################################ |
{ |
i2c_stop(); |
twi_state = 0; |
motor = TWDR; |
motor = 0; |
TWCR = 0x80; |
TWAMR = 0; |
TWAR = 0; |
TWDR = 0; |
TWSR = 0; |
TWBR = 0; |
i2c_init(); |
i2c_start(); |
i2c_write_byte(0); |
} |
//############################################################################ |
//Start I2C |
char i2c_write_byte(char byte) |
//############################################################################ |
{ |
TWSR = 0x00; |
TWDR = byte; |
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWIE); |
return(0); |
} |
//############################################################################ |
//Start I2C |
SIGNAL (TWI_vect) |
//############################################################################ |
{ |
switch (twi_state++) |
{ |
case 0: |
i2c_write_byte(0x52+(motor*2)); |
break; |
case 1: |
switch(motor++) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 2: |
i2c_stop(); |
if (motor<4) twi_state = 0; |
else motor = 0; |
i2c_start(); |
break; |
//Liest Daten von Motor |
case 3: |
i2c_write_byte(0x53+(motorread*2)); |
break; |
case 4: |
switch(motorread) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 5: //1 Byte vom Motor lesen |
motor_rx[motorread] = TWDR; |
case 6: |
switch(motorread) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 7: //2 Byte vom Motor lesen |
motor_rx[motorread+4] = TWDR; |
motorread++; |
if (motorread>3) motorread=0; |
i2c_stop(); |
I2CTimeout = 10; |
twi_state = 0; |
} |
TWCR |= 0x80; |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/twimaster.h |
---|
0,0 → 1,32 |
/*############################################################################ |
############################################################################*/ |
#ifndef _I2C_MASTER_H |
#define _I2C_MASTER_H |
//############################################################################ |
// I2C Konstanten |
#define SCL_CLOCK 200000L |
#define I2C_TIMEOUT 30000 |
#define I2C_START 0x08 |
#define I2C_REPEATED_START 0x10 |
#define I2C_TX_SLA_ACK 0x18 |
#define I2C_TX_DATA_ACK 0x28 |
#define I2C_RX_SLA_ACK 0x40 |
#define I2C_RX_DATA_ACK 0x50 |
//############################################################################ |
extern unsigned char twi_state; |
extern unsigned char motor; |
extern unsigned char motorread; |
extern unsigned char motor_rx[8]; |
void i2c_init (void); // I2C initialisieren |
char i2c_start (void); // Start I2C |
void i2c_stop (void); // Stop I2C |
char i2c_write_byte (char byte); // 1 Byte schreiben |
#endif |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/uart.c |
---|
0,0 → 1,652 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// + |
// + GPS read out: |
// + modified Version of the Pitschu Brushless Ufo - (c) Peter Schulten, Mülheim, Germany |
// + only for non-profit use |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
#include "uart.h" |
unsigned char DebugGetAnforderung = 0,DebugDisplayAnforderung = 0,DebugDataAnforderung = 0,GetVersionAnforderung = 0; |
unsigned volatile char SioTmp = 0; |
unsigned volatile char SendeBuffer[MAX_SENDE_BUFF]; |
unsigned volatile char RxdBuffer[MAX_EMPFANGS_BUFF]; |
unsigned volatile char NMEABuffer[MAX_EMPFANGS_BUFF]; |
unsigned volatile char NeuerDatensatzEmpfangen = 0; |
unsigned volatile char NeueKoordinateEmpfangen = 0; |
unsigned volatile char UebertragungAbgeschlossen = 1; |
unsigned volatile char CntCrcError = 0; |
unsigned volatile char AnzahlEmpfangsBytes = 0; |
unsigned volatile char PC_DebugTimeout = 0; |
unsigned char PcZugriff = 100; |
unsigned char MotorTest[4] = {0,0,0,0}; |
unsigned char MeineSlaveAdresse; |
struct str_DebugOut DebugOut; |
struct str_Debug DebugIn; |
struct str_VersionInfo VersionInfo; |
int Debug_Timer; |
static uint8_t gpsState; |
#define GPS_EMPTY 0 |
#define GPS_SYNC1 1 |
#define GPS_SYNC2 2 |
#define GPS_CLASS 3 |
#define GPS_LEN1 4 |
#define GPS_LEN2 5 |
#define GPS_FILLING 6 |
#define GPS_CKA 7 |
#define GPS_CKB 8 |
gpsInfo_t actualPos; // measured position (last gps record) |
#define SYNC_CHAR1 0xb5 |
#define SYNC_CHAR2 0x62 |
#define CLASS_NAV 0x01 |
#define MSGID_POSECEF 0x01 |
#define MSGID_STATUS 0x03 |
#define MSGID_VELECEF 0x11 |
#define MSGID_POSUTM 0x08 |
#define MSGID_VELNED 0x12 |
typedef struct { |
unsigned long ITOW; // time of week |
uint8_t GPSfix; // GPSfix Type, range 0..6 |
uint8_t Flags; // Navigation Status Flags |
uint8_t DiffS; // Differential Status |
uint8_t res; // reserved |
unsigned long TTFF; // Time to first fix (millisecond time tag) |
unsigned long MSSS; // Milliseconds since Startup / Reset |
uint8_t packetStatus; |
} NAV_STATUS_t; |
typedef struct { |
unsigned long ITOW; // time of week |
long LON; // longitude in 1e-07 deg |
long LAT; // lattitude |
long HEIGHT; // height in mm |
long HMSL; // height above mean sea level im mm |
unsigned long Hacc; // horizontal accuracy in mm |
unsigned long Vacc; // vertical accuracy in mm |
uint8_t packetStatus; |
} NAV_POSLLH_t; |
typedef struct { |
unsigned long ITOW; // time of week |
long EAST; // cm UTM Easting |
long NORTH; // cm UTM Nording |
long ALT; // cm altitude |
uint8_t ZONE; // UTM zone number |
uint8_t HEM; // Hemisphere Indicator (0=North, 1=South) |
uint8_t packetStatus; |
} NAV_POSUTM_t; |
typedef struct { |
unsigned long ITOW; // ms GPS Millisecond Time of Week |
long VEL_N; // cm/s NED north velocity |
long VEL_E; // cm/s NED east velocity |
long VEL_D; // cm/s NED down velocity |
unsigned long Speed; // cm/s Speed (3-D) |
unsigned long GSpeed; // cm/s Ground Speed (2-D) |
long Heading; // deg (1e-05) Heading 2-D |
unsigned long SAcc; // cm/s Speed Accuracy Estimate |
unsigned long CAcc; // deg Course / Heading Accuracy Estimate |
uint8_t packetStatus; |
} NAV_VELNED_t; |
typedef struct { |
unsigned long ITOW; // ms GPS Millisecond Time of Week |
long ECEF_X; // ecef x / cm |
long ECEF_Y; // ecef y / cm |
long ECEF_Z; // ecef z / cm |
unsigned long Pacc; // Abweichung |
uint8_t packetStatus; |
} NAV_POSECEF_t ; |
typedef struct { |
unsigned long ITOW; // ms GPS Millisecond Time of Week |
long ECEFVX; // ecef x velocity cm/s |
long ECEFVY; // ecef y velocity cm/s |
long ECEFVZ; // ecef z velocity cm/s |
unsigned long SAcc; // Abweichung |
uint8_t packetStatus; |
} NAV_VELECEF_t; |
NAV_STATUS_t navStatus; |
NAV_POSECEF_t navPosECEF; |
NAV_VELECEF_t navVelECEF; |
NAV_POSUTM_t navPosUtm; |
NAV_VELNED_t navVelNed; |
volatile char *ubxP, *ubxEp, *ubxSp; // pointers to packet currently transfered |
volatile uint8_t CK_A, CK_B; // UBX checksum bytes |
volatile unsigned short msgLen; |
volatile uint8_t msgID; |
volatile uint8_t ignorePacket; // true when previous packet was not processed |
// distance to target position |
long rollOffset; // in 10cm |
long nickOffset; |
#define GPS_INTCYCLES 100 |
#define GPS_I_LIMIT (long)(40 * MAINLOOPS_PER_SEC) |
#ifdef GPS_DEBUG // if set then the GPS data is transfered to display |
extern volatile uint8_t v24state; |
char buf[200]; |
char *bp; |
char *ep; |
#endif |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//++ Sende-Part der Datenübertragung |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(INT_VEC_TX) |
{ |
static unsigned int ptr = 0; |
unsigned char tmp_tx; |
if(!UebertragungAbgeschlossen) |
{ |
ptr++; // die [0] wurde schon gesendet |
tmp_tx = SendeBuffer[ptr]; |
if((tmp_tx == '\r') || (ptr == MAX_SENDE_BUFF)) |
{ |
ptr = 0; |
UebertragungAbgeschlossen = 1; |
} |
UDR = tmp_tx; |
} |
else ptr = 0; |
} |
void GPSscanData (void) |
{ |
if (navPosECEF.packetStatus == 1) // valid packet |
{ |
actualPos.x = navPosECEF.ECEF_X; //ECEF X in cm |
actualPos.y = navPosECEF.ECEF_Y; //ECEF Y in cm |
actualPos.z = navPosECEF.ECEF_Z; //ECEF Z in cm |
navPosECEF.packetStatus = 0; |
} |
if (navStatus.packetStatus == 1) // valid packet |
{ |
actualPos.GPSFix = navStatus.GPSfix; |
actualPos.newData = navStatus.packetStatus; |
navStatus.packetStatus = 0; |
} |
if (navVelECEF.packetStatus == 1) // valid packet |
{ |
actualPos.vx = navVelECEF.ECEFVX; //ECEF VEL X in cm/s |
actualPos.vy = navVelECEF.ECEFVY; //ECEF VEL Y in cm/s |
actualPos.vz = navVelECEF.ECEFVZ; //ECEF VEL Z in cm/s |
navVelECEF.packetStatus = 0; |
} |
if (navPosUtm.packetStatus == 1) // valid packet |
{ |
actualPos.northing = navPosUtm.NORTH; |
actualPos.easting = navPosUtm.EAST; |
actualPos.altitude = navPosUtm.ALT; |
navPosUtm.packetStatus = 0; |
} |
if (navVelNed.packetStatus == 1) |
{ |
actualPos.velNorth = navVelNed.VEL_N; |
actualPos.velEast = navVelNed.VEL_E; |
navVelNed.packetStatus = 0; |
} |
if (actualPos.newData != 0){ROT_ON;} //-> Rot blinkt mit 4Hz wenn Daten vom GPS Empfänger ankommen und brauchbar sind |
} |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//++ Empfangs-Part der Datenübertragung, incl. CRC-Auswertung |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(INT_VEC_RX) |
{ |
static unsigned int crc; |
static unsigned char crc1,crc2,buf_ptr; |
static unsigned char UartState = 0; |
unsigned char CrcOkay = 0; |
SioTmp = UDR; |
uint8_t c; |
uint8_t re; |
re = (UCSR0A & (_B1(FE0) | _B1(DOR0))); // any error occured ? |
c = SioTmp; |
#ifdef GPS_DEBUG |
*bp++ = c; |
if (bp >= (buf+200)) bp = buf; |
if (v24state == 0) |
{ |
v24state = 1; |
UDR0 = *ep++; |
if (ep >= buf+200) |
ep = buf; |
UCSR0B |= _B1(UDRIE0); //enable further irqs |
} |
#endif |
if (re == 0) |
{ |
switch (gpsState) |
{ |
case GPS_EMPTY: |
if (c == SYNC_CHAR1) |
gpsState = GPS_SYNC1; |
break; |
case GPS_SYNC1: |
if (c == SYNC_CHAR2) |
gpsState = GPS_SYNC2; |
else if (c != SYNC_CHAR1) |
gpsState = GPS_EMPTY; |
break; |
case GPS_SYNC2: |
if (c == CLASS_NAV) |
gpsState = GPS_CLASS; |
else |
gpsState = GPS_EMPTY; |
break; |
case GPS_CLASS: // msg ID seen: init packed receive |
msgID = c; |
CK_A = CLASS_NAV + c; |
CK_B = CLASS_NAV + CK_A; |
gpsState = GPS_LEN1; |
switch (msgID) |
{ |
case MSGID_STATUS: |
ubxP = (char*)&navStatus; |
ubxEp = (char*)(&navStatus + sizeof(NAV_STATUS_t)); |
ubxSp = (char*)&navStatus.packetStatus; |
ignorePacket = navStatus.packetStatus; |
break; |
case MSGID_POSECEF: |
ubxP = (char*)&navPosECEF; |
ubxEp = (char*)(&navPosECEF + sizeof(NAV_POSECEF_t)); |
ubxSp = (char*)&navPosECEF.packetStatus; |
ignorePacket = navPosECEF.packetStatus; |
break; |
case MSGID_VELECEF: |
ubxP = (char*)&navVelECEF; |
ubxEp = (char*)(&navVelECEF + sizeof(NAV_VELECEF_t)); |
ubxSp = (char*)&navVelECEF.packetStatus; |
ignorePacket = navVelECEF.packetStatus; |
break; |
case MSGID_POSUTM: |
ubxP = (char*)&navPosUtm; |
ubxEp = (char*)(&navPosUtm + sizeof(NAV_POSUTM_t)); |
ubxSp = (char*)&navPosUtm.packetStatus; |
ignorePacket = navPosUtm.packetStatus; |
break; |
case MSGID_VELNED: |
ubxP = (char*)&navVelNed; |
ubxEp = (char*)(&navVelNed + sizeof(NAV_VELNED_t)); |
ubxSp = (char*)&navVelNed.packetStatus; |
ignorePacket = navVelNed.packetStatus; |
break; |
default: |
ignorePacket = 1; |
ubxSp = (char*)0; |
} |
break; |
case GPS_LEN1: // first len byte |
msgLen = c; |
CK_A += c; |
CK_B += CK_A; |
gpsState = GPS_LEN2; |
break; |
case GPS_LEN2: // second len byte |
msgLen = msgLen + (c * 256); |
CK_A += c; |
CK_B += CK_A; |
gpsState = GPS_FILLING; // next data will be stored in packet struct |
break; |
case GPS_FILLING: |
CK_A += c; |
CK_B += CK_A; |
if ( !ignorePacket && ubxP < ubxEp) |
*ubxP++ = c; |
if (--msgLen == 0) |
gpsState = GPS_CKA; |
break; |
case GPS_CKA: |
if (c == CK_A) |
gpsState = GPS_CKB; |
else |
gpsState = GPS_EMPTY; |
break; |
case GPS_CKB: |
if (c == CK_B && ubxSp) // No error -> packet received successfully |
*ubxSp = 1; // set packetStatus in struct |
gpsState = GPS_EMPTY; // ready for next packet |
break; |
default: |
gpsState = GPS_EMPTY; // ready for next packet |
} |
} |
else // discard any data if error occured |
{ |
gpsState = GPS_EMPTY; |
GPSscanData (); //Test kann ggf. wieder gelöscht werden! |
} |
GPSscanData (); |
if(buf_ptr >= MAX_EMPFANGS_BUFF) UartState = 0; |
if(SioTmp == '\r' && UartState == 2) |
{ |
UartState = 0; |
crc -= RxdBuffer[buf_ptr-2]; |
crc -= RxdBuffer[buf_ptr-1]; |
crc %= 4096; |
crc1 = '=' + crc / 64; |
crc2 = '=' + crc % 64; |
CrcOkay = 0; |
if((crc1 == RxdBuffer[buf_ptr-2]) && (crc2 == RxdBuffer[buf_ptr-1])) CrcOkay = 1; else { CrcOkay = 0; CntCrcError++;}; |
if(!NeuerDatensatzEmpfangen && CrcOkay) // Datensatz schon verarbeitet |
{ |
NeuerDatensatzEmpfangen = 1; |
AnzahlEmpfangsBytes = buf_ptr; |
RxdBuffer[buf_ptr] = '\r'; |
if(RxdBuffer[2] == 'R') wdt_enable(WDTO_250MS); // Reset-Commando |
} |
} |
else |
switch(UartState) |
{ |
case 0: |
if(SioTmp == '#' && !NeuerDatensatzEmpfangen) UartState = 1; // Startzeichen und Daten schon verarbeitet |
buf_ptr = 0; |
RxdBuffer[buf_ptr++] = SioTmp; |
crc = SioTmp; |
break; |
case 1: // Adresse auswerten |
UartState++; |
RxdBuffer[buf_ptr++] = SioTmp; |
crc += SioTmp; |
break; |
case 2: // Eingangsdaten sammeln |
RxdBuffer[buf_ptr] = SioTmp; |
if(buf_ptr < MAX_EMPFANGS_BUFF) buf_ptr++; |
else UartState = 0; |
crc += SioTmp; |
break; |
default: |
UartState = 0; |
break; |
} |
} |
// -------------------------------------------------------------------------- |
void AddCRC(unsigned int wieviele) |
{ |
unsigned int tmpCRC = 0,i; |
for(i = 0; i < wieviele;i++) |
{ |
tmpCRC += SendeBuffer[i]; |
} |
tmpCRC %= 4096; |
SendeBuffer[i++] = '=' + tmpCRC / 64; |
SendeBuffer[i++] = '=' + tmpCRC % 64; |
SendeBuffer[i++] = '\r'; |
UebertragungAbgeschlossen = 0; |
UDR = SendeBuffer[0]; |
} |
// -------------------------------------------------------------------------- |
void SendOutData(unsigned char cmd,unsigned char modul, unsigned char *snd, unsigned char len) |
{ |
unsigned int pt = 0; |
unsigned char a,b,c; |
unsigned char ptr = 0; |
SendeBuffer[pt++] = '#'; // Startzeichen |
SendeBuffer[pt++] = modul; // Adresse (a=0; b=1,...) |
SendeBuffer[pt++] = cmd; // Commando |
while(len) |
{ |
if(len) { a = snd[ptr++]; len--;} else a = 0; |
if(len) { b = snd[ptr++]; len--;} else b = 0; |
if(len) { c = snd[ptr++]; len--;} else c = 0; |
SendeBuffer[pt++] = '=' + (a >> 2); |
SendeBuffer[pt++] = '=' + (((a & 0x03) << 4) | ((b & 0xf0) >> 4)); |
SendeBuffer[pt++] = '=' + (((b & 0x0f) << 2) | ((c & 0xc0) >> 6)); |
SendeBuffer[pt++] = '=' + ( c & 0x3f); |
} |
AddCRC(pt); |
} |
// -------------------------------------------------------------------------- |
void Decode64(unsigned char *ptrOut, unsigned char len, unsigned char ptrIn,unsigned char max) // Wohin mit den Daten; Wie lang; Wo im RxdBuffer |
{ |
unsigned char a,b,c,d; |
unsigned char ptr = 0; |
unsigned char x,y,z; |
while(len) |
{ |
a = RxdBuffer[ptrIn++] - '='; |
b = RxdBuffer[ptrIn++] - '='; |
c = RxdBuffer[ptrIn++] - '='; |
d = RxdBuffer[ptrIn++] - '='; |
if(ptrIn > max - 2) break; // nicht mehr Daten verarbeiten, als empfangen wurden |
x = (a << 2) | (b >> 4); |
y = ((b & 0x0f) << 4) | (c >> 2); |
z = ((c & 0x03) << 6) | d; |
if(len--) ptrOut[ptr++] = x; else break; |
if(len--) ptrOut[ptr++] = y; else break; |
if(len--) ptrOut[ptr++] = z; else break; |
} |
} |
// -------------------------------------------------------------------------- |
void BearbeiteRxDaten(void) |
{ |
if(!NeuerDatensatzEmpfangen) return; |
//unsigned int tmp_int_arr1[1]; |
//unsigned int tmp_int_arr2[2]; |
//unsigned int tmp_int_arr3[3]; |
unsigned char tmp_char_arr2[2]; |
//unsigned char tmp_char_arr3[3]; |
//unsigned char tmp_char_arr4[4]; |
/* |
unsigned int tmp_int_arr1[1]; |
unsigned int tmp_int_arr2[2]; |
unsigned int tmp_int_arr3[3]; |
unsigned char tmp_char_arr2[2]; |
unsigned char tmp_char_arr3[3]; |
unsigned char tmp_char_arr4[4]; |
*/ |
//if(!MotorenEin) |
PcZugriff = 255; |
switch(RxdBuffer[2]) |
{ |
case 'c':// Debugdaten incl. Externe IOs usw |
Decode64((unsigned char *) &DebugIn,sizeof(DebugIn),3,AnzahlEmpfangsBytes); |
/* for(unsigned char i=0; i<4;i++) |
{ |
EE_CheckAndWrite(&EE_Buffer[EE_DEBUGWERTE + i*2], DebugIn.Analog[i]); |
EE_CheckAndWrite(&EE_Buffer[EE_DEBUGWERTE + i*2 + 1], DebugIn.Analog[i] >> 8); |
}*/ |
//RemoteTasten |= DebugIn.RemoteTasten; |
DebugDataAnforderung = 1; |
break; |
case 'h':// x-1 Displayzeilen |
Decode64((unsigned char *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes); |
RemoteTasten |= tmp_char_arr2[0]; |
DebugDisplayAnforderung = 1; |
break; |
case 't':// Motortest |
Decode64((unsigned char *) &MotorTest[0],sizeof(MotorTest),3,AnzahlEmpfangsBytes); |
break; |
case 'v': // Version-Anforderung und Ausbaustufe |
GetVersionAnforderung = 1; |
break; |
case 'g':// "Get"-Anforderung für Debug-Daten |
// Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
DebugGetAnforderung = 1; |
break; |
case 'q':// "Get"-Anforderung für Settings |
// Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
Decode64((unsigned char *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes); |
if(tmp_char_arr2[0] != 0xff) |
{ |
if(tmp_char_arr2[0] > 5) tmp_char_arr2[0] = 5; |
ReadParameterSet(tmp_char_arr2[0], (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
SendOutData('L' + tmp_char_arr2[0] -1,MeineSlaveAdresse,(unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE); |
} |
else |
SendOutData('L' + GetActiveParamSetNumber()-1,MeineSlaveAdresse,(unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE); |
break; |
case 'l': |
case 'm': |
case 'n': |
case 'o': |
case 'p': // Parametersatz speichern |
Decode64((unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE,3,AnzahlEmpfangsBytes); |
WriteParameterSet(RxdBuffer[2] - 'l' + 1, (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], RxdBuffer[2] - 'l' + 1); // aktiven Datensatz merken |
Piep(GetActiveParamSetNumber()); |
break; |
} |
// DebugOut.AnzahlZyklen = Debug_Timer_Intervall; |
NeuerDatensatzEmpfangen = 0; |
} |
//############################################################################ |
//Routine für die Serielle Ausgabe |
int uart_putchar (char c) |
//############################################################################ |
{ |
if (c == '\n') |
uart_putchar('\r'); |
//Warten solange bis Zeichen gesendet wurde |
loop_until_bit_is_set(USR, UDRE); |
//Ausgabe des Zeichens |
UDR = c; |
return (0); |
} |
// -------------------------------------------------------------------------- |
void WriteProgramData(unsigned int pos, unsigned char wert) |
{ |
//if (ProgramLocation == IN_RAM) Buffer[pos] = wert; |
// else eeprom_write_byte(&EE_Buffer[pos], wert); |
// Buffer[pos] = wert; |
} |
//############################################################################ |
//INstallation der Seriellen Schnittstelle |
void UART_Init (void) |
//############################################################################ |
{ |
//Enable TXEN im Register UCR TX-Data Enable & RX Enable |
UCR=(1 << TXEN) | (1 << RXEN); |
// UART Double Speed (U2X) |
USR |= (1<<U2X); |
// RX-Interrupt Freigabe |
UCSRB |= (1<<RXCIE); |
// TX-Interrupt Freigabe |
UCSRB |= (1<<TXCIE); |
//Teiler wird gesetzt |
UBRR=(SYSCLK / (BAUD_RATE * 8L) - 1); |
//UBRR = 33; |
//öffnet einen Kanal für printf (STDOUT) |
//fdevopen (uart_putchar, 0); |
//sbi(PORTD,4); |
Debug_Timer = SetDelay(200); |
gpsState = GPS_EMPTY; |
} |
//--------------------------------------------------------------------------------------------- |
void DatenUebertragung(void) |
{ |
static char dis_zeile = 0; |
if(!UebertragungAbgeschlossen) return; |
if(DebugGetAnforderung && UebertragungAbgeschlossen) // Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
{ |
SendOutData('G',MeineSlaveAdresse,(unsigned char *) &DebugIn,sizeof(DebugIn)); |
DebugGetAnforderung = 0; |
} |
if((CheckDelay(Debug_Timer) || DebugDataAnforderung) && UebertragungAbgeschlossen) |
{ |
SendOutData('D',MeineSlaveAdresse,(unsigned char *) &DebugOut,sizeof(DebugOut)); |
DebugDataAnforderung = 0; |
Debug_Timer = SetDelay(MIN_DEBUG_INTERVALL); |
} |
if(DebugDisplayAnforderung && UebertragungAbgeschlossen) |
{ |
Menu(); |
DebugDisplayAnforderung = 0; |
if(++dis_zeile == 4) |
{ |
SendOutData('4',0,&PPM_in,sizeof(PPM_in)); // DisplayZeile übertragen |
dis_zeile = -1; |
} |
else SendOutData('0' + dis_zeile,0,&DisplayBuff[20 * dis_zeile],20); // DisplayZeile übertragen |
} |
if(GetVersionAnforderung && UebertragungAbgeschlossen) |
{ |
SendOutData('V',MeineSlaveAdresse,(unsigned char *) &VersionInfo,sizeof(VersionInfo)); |
GetVersionAnforderung = 0; |
} |
} |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/uart.h |
---|
0,0 → 1,119 |
#ifndef _UART_H |
#define _UART_H |
#define MAX_SENDE_BUFF 150 |
#define MAX_EMPFANGS_BUFF 150 |
extern unsigned char DebugGetAnforderung; |
extern unsigned volatile char SendeBuffer[MAX_SENDE_BUFF]; |
extern unsigned volatile char RxdBuffer[MAX_EMPFANGS_BUFF]; |
extern unsigned volatile char UebertragungAbgeschlossen; |
extern unsigned volatile char PC_DebugTimeout; |
extern unsigned volatile char NeueKoordinateEmpfangen; |
extern unsigned char MeineSlaveAdresse; |
extern unsigned char PcZugriff; |
extern int Debug_Timer; |
extern void UART_Init (void); |
extern int uart_putchar (char c); |
extern void boot_program_page (uint32_t page, uint8_t *buf); |
extern void DatenUebertragung(void); |
extern void DecodeNMEA(void); |
extern unsigned char MotorTest[4]; |
struct str_DebugOut |
{ |
unsigned char Digital[2]; |
unsigned int Analog[32]; // Debugwerte |
}; |
extern struct str_DebugOut DebugOut; |
#define _B1(bit) (1 << (bit)) |
#define _B0(bit) (0 << (bit)) |
typedef struct |
{ |
long x; // in cm (+ = north) |
long y; // in cm (+ = east) |
long z; // in cm |
long vx; |
long vy; |
long vz; |
long northing; |
long easting; |
long altitude; |
long velNorth; |
long velEast; |
uint8_t newData; // status of data: 0 = invlid; 1 = valid |
uint8_t GPSFix; |
uint8_t noSV; // number of sats |
} gpsInfo_t; |
extern gpsInfo_t lockedPos; // stored position to fly to |
extern gpsInfo_t actualPos; // measured position (last gps record) |
extern void GPSscanData (void); |
extern void GPSupdate(void); |
extern void GPSsaveTarget (uint8_t mode); |
struct str_Debug |
{ |
unsigned char Digital[2]; |
unsigned char RemoteTasten; |
unsigned int Analog[4]; |
}; |
extern struct str_Debug DebugIn; |
struct str_VersionInfo |
{ |
unsigned char Hauptversion; |
unsigned char Nebenversion; |
unsigned char PCKompatibel; |
unsigned char Rserved[7]; |
}; |
extern struct str_VersionInfo VersionInfo; |
//Die Baud_Rate der Seriellen Schnittstelle ist 9600 Baud |
//#define BAUD_RATE 9600 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 14400 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 28800 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 38400 //Baud Rate für die Serielle Schnittstelle |
#define BAUD_RATE 57600 //Baud Rate für die Serielle Schnittstelle |
//Anpassen der seriellen Schnittstellen Register wenn ein ATMega128 benutzt wird |
#if defined (__AVR_ATmega128__) |
# define USR UCSR0A |
# define UCR UCSR0B |
# define UDR UDR0 |
# define UBRR UBRR0L |
# define EICR EICRB |
#endif |
#if defined (__AVR_ATmega32__) |
# define USR UCSRA |
# define UCR UCSRB |
# define UBRR UBRRL |
# define EICR EICRB |
# define INT_VEC_RX SIG_UART_RECV |
# define INT_VEC_TX SIG_UART_TRANS |
#endif |
#if defined (__AVR_ATmega644__) |
# define USR UCSR0A |
# define UCR UCSR0B |
# define UDR UDR0 |
# define UBRR UBRR0L |
# define EICR EICR0B |
# define TXEN TXEN0 |
# define RXEN RXEN0 |
# define RXCIE RXCIE0 |
# define TXCIE TXCIE0 |
# define U2X U2X0 |
# define UCSRB UCSR0B |
# define UDRE UDRE0 |
# define INT_VEC_RX SIG_USART_RECV |
# define INT_VEC_TX SIG_USART_TRANS |
#endif |
#endif //_UART_H |
/branches/MergedVersionsByOsiair/alpha/v064JokoGPSNick666MM_1_1/version.txt |
---|
0,0 → 1,104 |
------- |
V0.53 27.04.2007 H.Buss |
- erste öffentliche Version |
V0.53b 29.04.2007 H.Buss |
- der FAKTOR_I war versehentlich auf Null, dann liegt der MikroKopter nicht so hart in der Luft |
V0.53c 29.04.2007 H.Buss |
- es gib ein Menü, in dem die Werte der Kanäle nach Nick, Roll, Gas,... sortiert sind. |
Die angezeigten Werte waren nicht die Werte der Funke |
V0.54 01.05.2007 H.Buss |
- die Paramtersätze können jetzt vor dem Start ausgewählt werden |
Dazu wird beim Kalibrieren der Messwerte (Gashebel oben links) der Nick-Rollhebel abgefragt: |
2 3 4 |
1 x 5 |
- - - |
Bedeutet: Nick-Rollhebel Links Mitte = Setting:1 Links Oben = Setting:2 usw. |
- der Faktor_I für den Hauptregler ist hinzugekommen. Im Heading-Hold-Modus sollte er vergössert werden, was Stabilität bringt |
V0.55 14.05.2007 H.Buss |
- es können nun Servos an J3,J4,J5 mit den Kanälen 5-7 gesteuert werden |
V0.56 14.05.2007 H.Buss |
- es gab Probleme mit Funken, die mehr als 8 Kanäle haben, wenn mehrere Kanäle dann auf Null waren |
- Funken, die nicht bis +-120 aussteuern können, sollten jetzt auch gehen |
V0.57 24.05.2007 H.Buss |
- Der Höhenregler kann nun auch mittels Schalter bedient werden |
- Bug im Gier-Algorithmus behoben; Schnelles Gieren fürhrte dazu, dass der MK zu weit gedreht hat |
- Kompass-Einfluss dämpfen bei Neigung |
- Man kann zwischen Kompass FIX (Richtung beim Kalibrieren) und Variabel (einstellbar per Gier) wählen |
- Der Motortest vom Kopter-Tool geht jetzt |
- Man kann den Parametersätzen einen Namen geben |
- Das Kamerasetting ist unter Setting 2 defaultmässig integriert |
V0.58 30.05.2007 H.Buss |
- Der Höhenregler-Algorithmus wird nun umgangen, wenn der Höhenreglerschalter aus ist |
V0.60 17.08.2007 H.Buss |
- "Schwindel-Bug" behoben |
- Die Poti-Werte werden jetzt auf Unterlauf (<0) überprüft |
- Poti4 zugefügt |
- Es werden jetzt 8 Kanäle ausgewertet |
- Kamera-Servo (an J7) |
- Die Settings müssen überschrieben werden |
V0.61 - V0.63 H.Buss 27.09.2007 |
- Poti 4 und Kanal 8 werden im Menü angezeigt |
- ein paar Kleinigkeiten bei den DefaultKonstanten2 bereinigt |
- Analog.c: Aktuell_ax korrigiert |
- auf 32 Debug-Kanäle erweitert |
- Loopings sind jetzt möglich und einzeln im KopterTool freischaltbar |
- leichte Anpassungen im Gier - Geschwindigkeit und Drift |
- die Hardwareversion V1.1 wird erkannt und das Programm stellt sich auf die geänderte Gyroverstärkung und die geänderten Portpins ein |
- die Software startet nach dem Einschalten schneller, weil der Luftdruckoffset schneller gefunden wird |
- die PPM-Ausgänge liegen wieder an den Pins an |
- Details an der Sensordatenverarbeitung -> es fliegt sich geringfügig anders |
- der MK ist bei wenig Gas nicht mehr so giftig -> soll das Landen vereinfachen |
- I2C-Bus läuft jetzt sicher nach einer Störung wieder an |
- Sticksignale werden präziser ausgewertet |
- Stick-Kanäle werden ans Kopter-Tool übertragen |
- Es muss die Version V1.47 des Kopter-Tool verwendet werden |
- Die Settings werden auf Default zurückgesetzt |
- am Piepen kann man die Fehlerart unterscheiden |
1. einzelnes Piepen beim Einschalten und Kalibrieren |
2. langsames Intervall mindestens 1 Sek -> Empfangsausfall |
3. schnelleres Intervall mindestens 1 Sek -> Akku |
4. sehr schnelles Intervall mindestens 1 Sek -> Kommunikation zu den Reglern gestört |
V0.64 H.Buss 30.09.2007 |
- beim Gieren wurden die Achsen nicht hart genug geregelt |
- Höhenreglerabsenkung von -20 auf -40 (fc.c) |
- LED1 und LED2 Ansteuerung (fc.c) und (main.h) |
- geänderte Kanalbelegung K1 mit K3 getauscht, Unterspannungsschwelle (9,5V) und StickD (fc.c) |
- P,D Anteil seperat in Variable geschrieben und auf das Analog Display Ausgegeben (Kopter Tool) |
- GPS_Nick und GPS_Roll werden nach Deaktivierung von Position-Hold auf Null gesetzt, um ein Einfrieren der GPS Steuerwerte auf den letzten Wert zu verhindern |
- Funktionsaufruf der GPS-Funktion von Chris/Hallo2 |
- UART.C für die GPS Signale im UTM Format auf Pitschu basierend |
- meine GPS.c-Routine |
- Mircos variable Filterung (funktioniert nur wenn 250ms Aufruf aktiv ist) |
- GPS wird deaktiviert und Summer eingeschaltet, wenn kein 3D-Fix (mehr) vorhanden |
- Statusanzeige auf eine LED reduziert (aus, blinkend, an) |
- blinkender LED_1 Ausgang für Positionsleuchten (einstellbar über Userparam.4) |
- Homing-Fkt. eingebaut |
- Diverse Absicherungen gegen Fehlbedienungen (z.B. nicht gelernte Home-Position, ...) |
- Rotationsmatrix mit Kompass, damit die GPS-Fkt. nicht nur nach Norden ausgerichtet funktioniert |
- dyn. Position Hold -> normaler Rundflug möglich |
- Limit_D_Anteil = Userparam3 um im Homing- bzw. Waypointmodus die Sollposition gleichmäßiger anzufliegen |
- Die Berechnung von Kompassvalue wird jetzt auch über den GPS Haken im Koptertool aktiviert |
- 12 Kanal Erweiterung (rc.c; rc.h; fc.c; fc.h; menu.c) |
- D-Anteil_Limit wegen HOMING ->> Radius von 700 cm -> 250 cm |
- ... |
(- Regelung wird nur noch alle 250 ms aufgerufen) |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/Flight-Ctrl_MEGA644_V0_64.aps |
---|
0,0 → 1,0 |
<AVRStudio><MANAGEMENT><ProjectName>Flight-Ctrl_MEGA644_V0_64</ProjectName><Created>19-Aug-2007 14:38:13</Created><LastEdit>15-Oct-2007 19:44:55</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>19-Aug-2007 14:38:13</Created><Version>4</Version><Build>4, 13, 0, 528</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>Flight-Ctrl_MEGA644_V0_64.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>E:\hubi\ufo\mickrokopter\eigene versionen\Kompass + GPS\Flight-Ctrl_V0_64_3_GPS_work_Jochenaccvonhand\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>AVR Simulator</CURRENT_TARGET><CURRENT_PART>ATmega644.xml</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>0</WATCHNUM><WATCHNAMES><Pane0></Pane0><Pane1></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>main.c</SOURCEFILE><SOURCEFILE>analog.c</SOURCEFILE><SOURCEFILE>eeprom.c</SOURCEFILE><SOURCEFILE>fc.c</SOURCEFILE><SOURCEFILE>GPS.c</SOURCEFILE><SOURCEFILE>menu.c</SOURCEFILE><SOURCEFILE>printf_P.c</SOURCEFILE><SOURCEFILE>rc.c</SOURCEFILE><SOURCEFILE>timer0.c</SOURCEFILE><SOURCEFILE>twimaster.c</SOURCEFILE><SOURCEFILE>uart.c</SOURCEFILE><SOURCEFILE>compass.c</SOURCEFILE><HEADERFILE>_Settings.h</HEADERFILE><HEADERFILE>analog.h</HEADERFILE><HEADERFILE>fc.h</HEADERFILE><HEADERFILE>gps.h</HEADERFILE><HEADERFILE>main.h</HEADERFILE><HEADERFILE>menu.h</HEADERFILE><HEADERFILE>old_macros.h</HEADERFILE><HEADERFILE>printf_P.h</HEADERFILE><HEADERFILE>rc.h</HEADERFILE><HEADERFILE>Settings.h</HEADERFILE><HEADERFILE>timer0.h</HEADERFILE><HEADERFILE>twimaster.h</HEADERFILE><HEADERFILE>uart.h</HEADERFILE><HEADERFILE>compass.h</HEADERFILE><OTHERFILE>makefile</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>YES</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE>makefile</EXTERNALMAKEFILE><PART>atmega644</PART><HEX>1</HEX><LIST>0</LIST><MAP>0</MAP><OUTPUTFILENAME>Flight-Ctrl_MEGA644_V0_60.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS/><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -O0 -fsigned-char</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20070525\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20070525\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/></IOView><Files><File00000><FileId>00000</FileId><FileName>main.c</FileName><Status>1</Status></File00000><File00001><FileId>00001</FileId><FileName>compass.c</FileName><Status>1</Status></File00001><File00002><FileId>00002</FileId><FileName>compass.h</FileName><Status>1</Status></File00002><File00003><FileId>00003</FileId><FileName>fc.c</FileName><Status>1</Status></File00003></Files><Workspace><File00000><Position>346 108 878 484</Position><LineCol>155 3</LineCol></File00000><File00001><Position>355 114 901 482</Position><LineCol>0 0</LineCol></File00001><File00002><Position>377 136 923 504</Position><LineCol>0 0</LineCol></File00002><File00003><Position>336 71 1048 624</Position><LineCol>834 19</LineCol><State>Maximized</State></File00003></Workspace><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio> |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/Flight-Ctrl_MEGA644_V0_64.hex |
---|
0,0 → 1,2450 |
:100000000C94F9030C9416040C9416040C94160426 |
:100010000C9416040C9416040C9416040C941604F8 |
:100020000C9416040C946A0E0C9416040C9416048A |
:100030000C94C21C0C9416040C9416040C94160414 |
:100040000C9416040C9416040C94110F0C942D1897 |
:100050000C9452070C9416040C9443060C9416044A |
:100060000C9414100C9416040C94001C0C9416049C |
:100070007C0781078B0790071E0832084E087F080F |
:1000800085080A0B7D0B7D0B7D0B350B160B7D0B4D |
:100090007D0B7D0B610B610B610B610B610B390BF0 |
:1000A0007D0B7D0B280B7D0B310B3D10951037110F |
:1000B000DB11F8111B12411228136714AB140C1535 |
:1000C0006215B61532168C16ED1611174717A317C1 |
:1000D000E117191C1E1C2F1C3D1C4A1C421C4A1CEB |
:1000E0005E1C0A0A0D004E65757472616C004865ED |
:1000F0006164696E67486F6C64000A0D53746575BE |
:100100006572756E673A20004F4B0A0D000A0D416B |
:1001100062676C65696368204C75667464727563A8 |
:100120006B73656E736F722E2E000A0D4B616C69D6 |
:10013000627269657265204B6F6D70617373000A3E |
:100140000D42656E75747A6520506172616D6574DB |
:1001500065727361747A202564000A0D496E6974B2 |
:100160002E20454550524F4D3A2047656E657269C5 |
:100170006572652044656661756C742D50617261AD |
:100180006D657465722E2E2E000A0D3D3D3D3D3D80 |
:100190003D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D8F |
:1001A0003D3D3D3D3D3D3D3D3D000A0D466C696791 |
:1001B0006874436F6E74726F6C0A0D486172647775 |
:1001C0006172653A25642E25640A0D536F66747753 |
:1001D0006172653A5625642E256420002E005A5F10 |
:1001E0004F66667365743A202025336900595F4F66 |
:1001F00066667365743A202025336900585F4F6640 |
:10020000667365743A2020253369004D4D33206BA9 |
:10021000616C69622E0052616E67653A2533692D03 |
:10022000253369005374656C6C756E673A2025330D |
:100230006900536574706F696E74202025336900FE |
:10024000536572766F202000506F343A2025336951 |
:1002500020506F383A2025336900506F333A2025FB |
:10026000336920506F373A2025336900506F323A96 |
:100270002025336920506F363A2025336900506FAE |
:10028000313A2025336920506F353A2025336900F3 |
:1002900053746172743A2020202020253569004D66 |
:1002A000657373776572743A202025356900526949 |
:1002B000636874756E673A2020253569004B6F6D51 |
:1002C000706173732020202020202000456D70660F |
:1002D0002E506567656C3A253569005370616E6E06 |
:1002E000756E673A202025356900486F63682025C0 |
:1002F000346920282533692900526F6C6C2025341D |
:1003000069202825336929004E69636B20253469EB |
:1003100020282533692900414343202D2053656E51 |
:10032000736F720047696572202534692028253370 |
:10033000692900526F6C6C202534692028253369A7 |
:1003400029004E69636B20253469202825336929EB |
:10035000004779726F202D2053656E736F720050C5 |
:10036000333A253469202050343A2534692000502E |
:10037000313A253469202050323A2534692000472B |
:10038000733A253469202047693A25346920004EA4 |
:10039000693A2534692020526F3A25346920004B90 |
:1003A000373A25346920204B383A25346920004BF0 |
:1003B000353A25346920204B363A25346920004BE4 |
:1003C000333A25346920204B343A25346920004BD8 |
:1003D000313A25346920204B323A25346920004BCC |
:1003E0006F6D706173733A20202025356900526F5C |
:1003F0006C6C3A202020202020253569004E69634E |
:100400006B3A20202020202025356900616B742E56 |
:10041000204C6167650048F668656E726567656CBB |
:10042000756E67004B65696E6520004F666620201B |
:10043000202020203A20253569004C7566746472AE |
:1004400075636B3A2025356900536F6C6C486F6596 |
:1004500068653A2025356900486F6568653A20204F |
:100460002020202535690028632920486F6C6765A6 |
:100470007220427573730053657474696E673A2015 |
:100480002564200048573A5625642E25642053578A |
:100490003A25642E2564002B2B204D696B726F4B1F |
:1004A0006F70746572202B2B005B25695D00000165 |
:1004B000020305060708090A0B0C0D0F1011121391 |
:1004C0001415161718191A1B1B1C1D1E1F2021217D |
:1004D00022232425252627272829292A2B2B2C2CA3 |
:1004E0002D2E2E2F2F3030313132323333343434FD |
:1004F000353536363637373838383939393A3A3A81 |
:100500003B3B3B3C3C3C3C3D3D3D3D3E3E3E3E3F1F |
:100510003F3F3F40404040414141414142424242D1 |
:100520004243434343434344444444444445454590 |
:10053000454545454646464646464646474747475B |
:10054000474747474848484848484848484949492C |
:10055000494949494949494A4A4A4A4A4A4A4A4A02 |
:100560004A4A4A4B4B4B4B4B4B4B4B4B4B4B4B4BDE |
:100570004C4C4C4C4C4C4C4C4C4C4C4C4C4C4C4DBA |
:100580004D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D9B |
:100590004E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E7B |
:1005A0004E4E4E4E4F4F4F4F4F4F4F4F4F4F4F4F5F |
:1005B0004F4F4F4F4F4F4F4F4F4F4F4F0000000087 |
:1005C00096438B3C295C0F3DF4FD543D295C8F3DE7 |
:1005D0000E2DB23D3D0AD73D23DBF93D04560E3EBC |
:1005E00077BE1F3E0E2D323E8195433EF4FD543EB4 |
:1005F0006666663ED9CE773EA69B843EDF4F8D3E33 |
:100600000681953E3F359E3E79E9A63EA01AAF3E53 |
:10061000C74BB73E0000C03E2731C83E4E62D03EB9 |
:100620007593D83E8941E03EB072E83EC520F03E69 |
:10063000EC51F83E0000003F0AD7033F14AE073FDD |
:100640001F850B3FA01A0F3FAAF1123F2B87163FC1 |
:10065000AC1C1A3F2DB21D3F2506213FA69B243F0F |
:100660009EEF273F96432B3F8D972E3F85EB313FE3 |
:10067000F4FD343F6210383FD1223B3F3F353E3FCF |
:10068000AE47413F9318443F79E9463F5EBA493F40 |
:10069000448B4C3FA01A4F3FFCA9513F5839543F5F |
:1006A000B4C8563F8716593F5A645B3F2DB25D3F31 |
:1006B0000000603F4A0C623F9318643FDD24663FB0 |
:1006C0009EEF673FE7FB693FA8C66B3FDF4F6D3F7B |
:1006D000A01A6F3FD7A3703F0E2D723FBC74733FBB |
:1006E0006ABC743F1904763FC74B773FEC51783FA3 |
:1006F0001058793F355E7A3F5A647B3FF6287C3F3D |
:1007000091ED7C3FA4707D3F3F357E3F52B87E3FE8 |
:10071000DBF97E3FEE7C7F3F77BE7F3F77BE7F3F3A |
:100720000000803F0000803F000001010101020243 |
:100730000203030303040404050505050606060772 |
:10074000070707080808090909090A0A0A0B0B0B19 |
:100750000C0C0C0C0D0D0D0E0E0E0E0F0F0F1010BD |
:100760001011111111121212131313141414141561 |
:100770001515161616171717181818191919191A02 |
:100780001A1A1B1B1B1C1C1C1D1D1D1E1E1E1F1FA1 |
:100790001F2020202121212222222323232424253B |
:1007A000252526262627272728282929292A2A2ACF |
:1007B0002B2B2C2C2C2D2D2E2E2E2F2F303031315B |
:1007C00031323233333434353536363737383839D9 |
:1007D000393A3A3B3B3C3C3D3E3E3F404041424241 |
:1007E00043444445464748494A4B4C4D4F50525468 |
:1007F0005A0011241FBECFEFD0E1DEBFCDBF18E0FD |
:10080000A0E0B1E0ECECF1E902C005900D92A2335A |
:10081000B107D9F71DE0A2E3B8E001C01D92A934E9 |
:10082000B107E1F70E9455040C94E5480C940000D0 |
:1008300022E030E0D9010E94D148802D863028F096 |
:1008400082E0D901082E0E94D94899270895FB011A |
:10085000282F863008F025E0842F9927429FD00169 |
:100860001124AC59BF4F019724F001900E94D94840 |
:10087000FACFA2E0B0E0022E0E94D9480895CF93AB |
:10088000DF93FB01C42FDD27863008F085E0489F09 |
:10089000D0011124AC59BF4F219724F00E94D148B8 |
:1008A0000192FACFDF91CF9108951F93CF93DF93F9 |
:1008B00014B815B8189B02C08BE001C08AE0809381 |
:1008C000000181E887B98FEF88B98BE184B9289A54 |
:1008D0008EE38AB9579A87EF8BB984B7877F84BF35 |
:1008E000809160008861809360001092600088EEC3 |
:1008F00093E090934E0880934D081092DA0810927E |
:10090000D9081092820C1092810C1092D808109283 |
:10091000D7081092D6081092D50828980E94D60FB2 |
:100920000E94590A0E94AD1C0E940E100E94E61BF4 |
:100930000E94F51978941092C80A80E48093C90A3D |
:1009400085E08093CA0A2091000180E490E09F93A3 |
:100950008F931F921F92822F6AE00E942448892F52 |
:1009600099279F938F93822F0E94244899279F93C2 |
:100970008F938AEA91E09F938F931F920E94DC0BE2 |
:1009800089E891E09F938F931F920E94DC0B299A34 |
:10099000A1E0B0E00E94D148802D2DB73EB7225F84 |
:1009A0003F4F2DBF8E33A9F18AE591E09F938F933E |
:1009B0001F920E94DC0B0E940E264AE369EB7CE04A |
:1009C00080E00E94270411E00F900F900F901230EA |
:1009D00049F40E9498254AE369EB7CE082E00E949A |
:1009E000270413E04AE369EB7CE0812F0E9427048F |
:1009F0001F5F163060F382E022E030E0D901082E5C |
:100A00000E94D9488EE321503040D901082E0E941F |
:100A1000D948C2E0D0E0DE010E94D148802D863066 |
:100A200028F082E0DE01082E0E94D9484AE369EBF3 |
:100A30007CE00E943F04DE010E94D148802D863078 |
:100A400028F082E0DE01082E0E94D94899279F9362 |
:100A50008F938FE391E09F938F931F920E94DC0B03 |
:100A600084EF91E00E94550EEC010F900F900F90D3 |
:100A70000F900F90CE010E945E0E8823D9F3E09173 |
:100A8000BB0CFF27EE0FFF1FE358F34F80819181CE |
:100A900085369105E4F0E091BC0CFF27EE0FFF1FB7 |
:100AA000E358F34F808191818536910584F08AE285 |
:100AB00091E09F938F931F920E94DC0B8091C10C59 |
:100AC0000F900F900F9083FF02C00E94161A809122 |
:100AD000C10C80FF20C08DE091E09F938F931F9207 |
:100AE0000E94DC0B88EE93E00E94550EEC010E9400 |
:100AF000C2130F900F900F90CE010E945E0E8823BC |
:100B0000D9F388E091E09F938F931F920E94DC0BB2 |
:100B10000F900F900F900E94AE26289880ED97E0DE |
:100B200090934E0880934D0888EE93E09093C30A0B |
:100B30008093C20A85E58093BD0A8AEF90E09F9377 |
:100B40008F931F920E94DC0B8091C10C0F900F902D |
:100B50000F9082FF03C08EEE90E002C086EE90E020 |
:100B60009F938F931F920E94DC0B0F900F900F901A |
:100B700082EE90E09F938F931F920E94DC0B0E9465 |
:100B8000061488E893E190937D0180937C010F9097 |
:100B90000F900F9080914C08882309F447C0109261 |
:100BA0004C080E94F7270E94832628988091020112 |
:100BB000882319F08150809302018091D408882302 |
:100BC00029F08091D40881508093D40880917C01D1 |
:100BD00090917D01892B01F585E090E090937D0156 |
:100BE00080937C010E94871C8091050190910601F1 |
:100BF0008F5F9F4FD9F48091DB088823B9F080E1A3 |
:100C000097E290934E0880934D0880E890E090938F |
:100C10000601809305010AC080917C0190917D01BD |
:100C2000019790937D0180937C0128980E94760A19 |
:100C30000E94EC0ACE010E945E0E882309F4AACF1E |
:100C40002091090130910A018091D10C9927281730 |
:100C500039079CF480910501909106018F5F9F4FA9 |
:100C600061F480E797E190934E0880934D0880E00F |
:100C700093E0909306018093050184E690E00E9442 |
:100C8000550EEC0187CF1F920F920FB60F921124D1 |
:100C90008F939F93EF93FF93809101018823E1F459 |
:100CA0008091470890914808019690934808809356 |
:100CB0004708FC01E358F64FE081ED3019F0863922 |
:100CC000910539F4109248081092470881E080930A |
:100CD0000101E093C60004C0109248081092470832 |
:100CE000FF91EF919F918F910F900FBE0F901F90EA |
:100CF00018958091B20B813091F58091A20B909163 |
:100D0000A30BA091A40BB091A50B8093F50B90932E |
:100D1000F60BA093F70BB093F80B8091A60B909174 |
:100D2000A70BA091A80BB091A90B8093F90B9093FE |
:100D3000FA0BA093FB0BB093FC0B8091AA0B909144 |
:100D4000AB0BA091AC0BB091AD0B8093FD0B9093CE |
:100D5000FE0BA093FF0BB093000C1092B20B90917E |
:100D6000BC0A913041F48091B00A8093220C909398 |
:100D7000210C1092BC0A8091EC0A813091F580918F |
:100D8000DC0A9091DD0AA091DE0AB091DF0A80931F |
:100D9000010C9093020CA093030CB093040C80916F |
:100DA000E00A9091E10AA091E20AB091E30A8093EF |
:100DB000050C9093060CA093070CB093080C80913F |
:100DC000E40A9091E50AA091E60AB091E70A8093BF |
:100DD000090C90930A0CA0930B0CB0930C0C10927E |
:100DE000EC0A8091950B813091F580918B0B90915D |
:100DF0008C0BA0918D0BB0918E0B80930D0C90936A |
:100E00000E0CA0930F0CB093100C8091870B909157 |
:100E1000880BA091890BB0918A0B8093110C909351 |
:100E2000120CA093130CB093140C80918F0B909123 |
:100E3000900BA091910BB091920B8093150C909315 |
:100E4000160CA093170CB093180C1092950B809170 |
:100E50004A0C813011F580912A0C90912B0CA091B5 |
:100E60002C0CB0912D0C8093190C90931A0CA0931C |
:100E70001B0CB0931C0C80912E0C90912F0CA09108 |
:100E8000300CB091310C80931D0C90931E0CA093EC |
:100E90001F0CB093200C10924A0C8091210C8111F0 |
:100EA000289A08951F920F920FB60F9211242F9334 |
:100EB0003F934F935F936F937F938F939F93AF93E2 |
:100EC000BF93CF93DF93EF93FF938091C6008093FE |
:100ED00036088091C00040913608887109F024C11D |
:100EE00080914908E82FFF27E930F10508F019C182 |
:100EF000E85CFF4F0C94CB48453B09F019C181E0F9 |
:100F000003C0423621F482E08093490811C1453B79 |
:100F100009F40EC106C1413009F003C183E0F4CFEA |
:100F20004093240C4F5F40937C0980917C098F5F34 |
:100F30008093AB0A84E0809349088091240C883028 |
:100F400009F44AC0893030F48130F1F0833009F07F |
:100F50006DC006C0813161F1823109F067C050C0B7 |
:100F60008CEA9AE09093D70A8093D60A2DEC3BE066 |
:100F700030937A092093790940969093970B809348 |
:100F8000960B8091BC0A4FC08EE99BE09093D70AE4 |
:100F90008093D60A27E53DE030937A0920937909BA |
:100FA00044969093970B8093960B8091B20B3BC025 |
:100FB00088ED9AE09093D70A8093D60A21E93CE025 |
:100FC00030937A092093790944969093970B8093F4 |
:100FD000960B8091EC0A27C083E89BE09093D70A98 |
:100FE0008093D60A2CEE3CE030937A09209379095D |
:100FF00042969093970B8093960B8091950B13C01C |
:1010000086E29CE09093D70A8093D60A2FE731E1DD |
:1010100030937A092093790984969093970B809363 |
:10102000960B80914A0C8093250C82C081E08093BE |
:10103000250C1092970B1092960B7AC0842F99274B |
:101040009093990B8093980B80917C09840F8093E7 |
:101050007C098091AB0A90917C09890F8093AB0A3F |
:1010600085E052CF2091980B3091990B842F9927CE |
:10107000982F8827280F391F3093990B2093980BAE |
:1010800080917C09840F80937C098091AB0A9091B8 |
:101090007C09890F8093AB0A86E036CF80917C096A |
:1010A000840F80937C098091AB0A90917C09890F11 |
:1010B0008093AB0A8091250C882381F4E091D60AB5 |
:1010C000F091D70A8091790990917A09E817F90788 |
:1010D00028F44193F093D70AE093D60A8091980BB5 |
:1010E0009091990B01979093990B8093980B809115 |
:1010F000980B9091990B892BD9F487E005CF8091BB |
:101100007C09481771F488E0FFCE8091AB0A48173C |
:1011100041F4E091960BF091970B309711F081E03C |
:1011200080831092490804C0109249080E947906F1 |
:101130000E94790640914208463910F01092410809 |
:10114000809136088D3009F05CC080914108823072 |
:1011500009F057C010924108A42FBB27FD01E551AB |
:10116000F54F3081ED01C451D54F2881809145085C |
:1011700090914608831B9109821B91099F7090935F |
:101180004608809345089C0196E0369527959A95E8 |
:10119000E1F7235C20934408982F9F73935C90930E |
:1011A00043088081281729F48881981711F491E069 |
:1011B00006C0809139088F5F8093390890E0809154 |
:1011C0003708882309F064C0992309F461C081E0DD |
:1011D0008093370840933A08A351B54F8DE08C9324 |
:1011E0008091EF0A823509F053C088E190E02CE04D |
:1011F0000FB6F894A895809360000FBE209360000E |
:1012000047C0809141088130D9F0813018F0823098 |
:10121000E9F530C080913608833239F4809137087F |
:10122000882319F481E080934108809136088093E7 |
:10123000ED0A81E08093420880913608992715C015 |
:1012400082E080934108E42FFF2780913608E35124 |
:10125000F54F80834F5F409342082091360880917C |
:10126000450890914608820F911D909346088093FF |
:1012700045080EC0E42FFF2780913608E351F54F53 |
:101280008083463938F310924108E7CF1092410825 |
:10129000FF91EF91DF91CF91BF91AF919F918F918E |
:1012A0007F916F915F914F913F912F910F900FBE62 |
:1012B0000F901F901895DC0120E030E040E050E0F6 |
:1012C000EDE7F9E005C08191280F311D4F5F5F4FB9 |
:1012D0004A175B07C1F73F70C90166E0969587958D |
:1012E0006A95E1F7835CFD01E358F64F8083119620 |
:1012F0002F73235CFD01E358F64F2083A258B64FAD |
:101300008DE08C931092010180917D098093C6003D |
:101310000895EF92FF920F931F93CF93DF937A017B |
:10132000722F93E290937D0960937E0980937F09E9 |
:1013300003E010E060E0A0E8B9E046C0F701E60F86 |
:10134000F11D90816F5F715019F4E0E040E00FC033 |
:10135000F701E60FF11D40816F5F715011F4E0E07D |
:1013600006C0F701E60FF11DE0816F5F7150892F14 |
:1013700086958695835C8C935527892F9927837052 |
:10138000907024E0880F991F2A95E1F79A0194E064 |
:10139000369527959A95E1F7822B835CED01898339 |
:1013A0004F705070440F551F440F551F8E2F82955C |
:1013B000869586958370842B835C8A83EF73E35CC8 |
:1013C000EB830C5F1F4F1496772309F0B7CFC8014A |
:1013D0000E945B09E6E0CDB7DEB70C94BC481F93D2 |
:1013E000CF93DF93EC0170E0A22FBB27129748C088 |
:1013F000E42FFF27E351F54F30814F5FE42FFF27A4 |
:10140000E351F54F50814F5FE42FFF27E351F54F34 |
:1014100010814F5FE42FFF27E351F54F20814F5F8D |
:10142000842F9927A817B90774F15D53FE01E70FC0 |
:10143000F11D3D53330F330F852F82958F70382B5D |
:101440003083613001F1912F9D537F5FFE01E70FE3 |
:10145000F11D71505295507F892F86958695582B96 |
:10146000508363506F3F79F07E5FFE01E70FF11DFF |
:101470009295990F990F907C2D53922B90837F5FBB |
:10148000662309F0B5CFDF91CF911F9108951F9387 |
:10149000182F8A3019F48DE00E94470A8091C0000D |
:1014A00085FFFCCF1093C60080E090E01F91089567 |
:1014B0000895E1ECF0E088E18083A0ECB0E08C914D |
:1014C00082608C9380818068808380818064808347 |
:1014D0008AE28093C40088EC90E00E94550E9093BD |
:1014E000AA0A8093A90A10924908089580910101DF |
:1014F000882309F470C080913208882371F08091AC |
:101500000101882351F02BE04DEB5AE060917B09FB |
:1015100087E40E948909109232088091A90A90916B |
:10152000AA0A0E945E0E882321F480913408882341 |
:10153000B1F080910101882391F022E443EB5BE05C |
:1015400060917B0984E40E9489091092340884EF39 |
:1015500091E00E94550E9093AA0A8093A90A809167 |
:101560003308882331F180910101882311F10E9411 |
:101570000F141092330880914008982F9F5F90932A |
:101580004008943059F42EE14DE75CE060E084E3DC |
:101590000E9489098FEF809340080BC044E1949F1B |
:1015A000A0011124455E5E4F24E160E08F5C0E9443 |
:1015B000890980913508882371F080910101882381 |
:1015C00051F02AE048EC5AE060917B0986E50E94E0 |
:1015D0008909109235080895A2E0B0E0E2EFFAE040 |
:1015E0000C94A34880913708882309F488C08FEFB2 |
:1015F000809302018091EF0A9927AA27BB27FC015B |
:10160000E356F040E431F10508F077C0EF5BFF4F9F |
:101610000C94CB4820913A0843E06BE08DEB9AE0C4 |
:101620000E94EF0981E08093340867C020913A0856 |
:1016300043E062E0CE0101960E94EF0980916F08BD |
:101640009981892B80936F0881E08093330855C07E |
:1016500020913A0843E064E08CE398E00E94EF09AF |
:101660004CC081E08093350848C081E08093320807 |
:1016700044C020913A0843E062E0CE0101960E9406 |
:10168000EF0989818F3F89F0863010F085E08983EA |
:101690004AE369EB7CE089810E943F0489812AE367 |
:1016A00049EB5CE060917B0908C010917B090E94C6 |
:1016B00018042AE349EB5CE0612F855B0E948909ED |
:1016C0001CC020913A0843E06AE389EB9CE00E9449 |
:1016D000EF098091EF0A4AE369EB7CE08B560E94A8 |
:1016E00027048091EF0A8B56A2E0B0E0082E0E94FA |
:1016F000D9480E9418040E94E22710923708E3E0BC |
:10170000CE5F0C94BF48982F80914B0C813069F4C8 |
:1017100080916E08E82FFF27E55EFE4F90838F5F74 |
:1017200080936E0821E030E005C0892F0E94470AAF |
:10173000282F3327C90108951F93182F04C080E371 |
:101740000E94830B11501116D4F31F9108951F931B |
:10175000182F04C080E20E94830B11501116D4F39D |
:101760001F9108950F931F93CF93DF938C01EB018B |
:1017700008C0F8010F5F1F4FE4918E2F0E94830B6A |
:1017800021972097B1F7DF91CF911F910F91089585 |
:101790000F931F93CF93DF938C01EB0106C0F801E9 |
:1017A00081918F010E94830B21972097C1F7DF91D0 |
:1017B000CF911F910F910895A3E3B0E0E2EEFBE01B |
:1017C0000C94944829968FAD299780934B0CCE01A9 |
:1017D000855B9F4F9D838C832B968EAD9FAD2B9702 |
:1017E0009FA78EA722243324210102C013012401C4 |
:1017F0000EA51FA502C00F5F1F4FF801F490FF2038 |
:1018000019F0F5E2FF16B9F7B8018EA59FA5681B80 |
:10181000790B11F00E94B20BFF2009F442C20F5F56 |
:101820001F4F1FA70EA71982AC81BD811BAA1AAA40 |
:101830009FEF99ABEEA5FFA5CF0101969FA78EA7BD |
:10184000B49095E7B91621F08B2D8062883789F422 |
:10185000EBA9E0FF07C02D903D904D905C90139751 |
:10186000149607C08D919C9111971C014424552416 |
:101870001296F0E2BF1621F489818823D9F685C03B |
:1018800083E2B81609F483C09AE2B91621F0EDE2BA |
:10189000BE1669F408C0FD011296E081EAABE7FFCD |
:1018A000C9CFE195EAABFBA9F061FF7D72C08BE285 |
:1018B000B81609F46AC09EE2B916B1F52EA53FA587 |
:1018C0002F5F3F4FEEA5FFA584918A3221F0B82EFD |
:1018D00020E030E01BC0FD0112964081518157FF8E |
:1018E00002C04FEF5FEF49AB3FA72EA7A3CFC901BF |
:1018F00003E0880F991F0A95E1F7220F331F280F85 |
:10190000391F2B0D311D20533040B49031968B2D53 |
:1019100080538A3060F3FFA7EEA7A90137FF02C00A |
:101920004FEF5FEF49AB8DCFF0E3BF1631F48BA9DA |
:1019300084FD80CF80628BAB7DCF8B2D815389302E |
:10194000E8F420E030E0C901F3E0880F991FFA9530 |
:10195000E1F7220F331F280F391F2B0D311D2053A4 |
:101960003040EEA5FFA5CF0101969FA78EA7B490AA |
:101970008B2D80538A3038F32AAB63CF98E6B916A3 |
:1019800051F4EBA9E460EBAB55CFB98253CFFBA97F |
:10199000F860FBAB4FCF8CE6B81621F49BA99160A1 |
:1019A0009BAB48CFBD83AC83E3E6BE1639F41296F9 |
:1019B000BD83AC8312978C918E8318C1F4E4BF165B |
:1019C00039F084E6B81639F099E6B91659F503C02E |
:1019D000EBA9E160EBABFBA9F0FF08C01496BD8357 |
:1019E000AC835E904E903E902E900AC01296BD83BE |
:1019F000AC839E918E911C01442437FC4094542C5E |
:101A000057FC03C08AE088AB92C050944094309455 |
:101A10002094211C311C411C511C8DE289839AE0C9 |
:101A200098AB85C0EFE4BE1629F0FFE6BF1639F487 |
:101A300088E061C09BA991609BABE8E056C0F0E7ED |
:101A4000BF1671F41296BD83AC839E918E911C01DA |
:101A5000442455248BA980648BAB78E7B72E5EC0F5 |
:101A6000E3E7BE16D9F51296BD83AC83DE90CE9027 |
:101A7000C114D10489F488E28E838EE68F8385E7D2 |
:101A800088878CE689878A8789E28B871C8666E04F |
:101A9000C62ED12CCC0EDD1EF9A9F7FD13C04F2F99 |
:101AA000552747FD509560E070E0C6010E949046C2 |
:101AB000009711F419A90DC08C1919A981174CF4BC |
:101AC000182F07C0F60101900020E9F731971E2F6B |
:101AD0001C1919824201310140E094C085E5B81615 |
:101AE00031F095E7B91649F4EAE0E8AB1FC0FBA96D |
:101AF000F160FBAB8AE088AB19C098E5B91621F01C |
:101B0000E8E7BE1609F06EC0FBA9F3FD02C080E154 |
:101B1000F2CF211431044104510419F490E198AB3F |
:101B200005C0EBA9E064EBABF0E1F8AB198289A941 |
:101B300087FD03C09BA99F7D9BAB21143104410409 |
:101B4000510461F4E9A9EE2349F4662477244301A2 |
:101B50005EE2C52ED12CCC0EDD1E3EC04EE2C42E60 |
:101B6000D12CCC0EDD1EF8A9EF2EFF240027112763 |
:101B7000C201B101A80197010E9457486A3020F4C0 |
:101B800030E3A32EA60E08C027E5A22EA60E88E5F8 |
:101B9000B81611F49FEDA922F601A2926F01C201BD |
:101BA000B101A80197010E94574839014A012E143A |
:101BB0003F044006510618F019012A01D9CFF8A9AF |
:101BC000F83051F48BA983FF07C090E3A91621F0E8 |
:101BD00080E3F60182936F01CE018C19182F125DFC |
:101BE00049A910C0BB2009F45CC0BE821982420121 |
:101BF000310100E096E0C92ED12CCC0EDD1E11E0A3 |
:101C000021E005C0212F042F011B07FD00E0898181 |
:101C1000882319F0812F8F5F07C09BA996FD02C012 |
:101C2000812F02C0822F8E5FA82EA00EEBA9EE2E70 |
:101C3000FF2480E3482E512C4E205F204114510494 |
:101C400021F48AA98A190E94A70B8981882329F087 |
:101C500061E070E0CE01019609C0E6FE09C080E3B4 |
:101C60008A83BB8262E070E0CE0102960E94C80BBC |
:101C7000F0E24F16510421F48AA98A190E949C0BA4 |
:101C8000802F0E949C0B612F772767FD7095C601FE |
:101C90000E94C80BE4FEAACD8AA98A190E94A70B4C |
:101CA000A5CDE2E1CD5C0C94B04820914A0830917A |
:101CB0004B082F5F3F4F820F931F089520914A08D2 |
:101CC00030914B08821B930B892F9927869580743E |
:101CD000992708951F920F920FB60F921124EF9239 |
:101CE000FF920F931F932F933F934F935F936F93A5 |
:101CF0007F938F939F93AF93BF93CF93DF93EF9394 |
:101D0000FF93809107018150809307018F3F09F075 |
:101D10006DC083E88093B00080918F01C82FDD27CC |
:101D2000D0935008C0934F088091E20CE090DB0CF8 |
:101D300080FF1EC0609188087091890880918A0890 |
:101D400090918B08FF240027112720E830E040E025 |
:101D500050E00E947948C801B7010E94054820E080 |
:101D600032E040E050E00E947948C20FD31F1DC00E |
:101D7000609188087091890880918A0890918B08F9 |
:101D8000FF240027112720E830E040E050E00E94C7 |
:101D90007948C801B7010E94054820E032E040E0E0 |
:101DA00050E00E947948C21BD30BD0935008C093D7 |
:101DB0004F0820914F08309150088091DC0C9927F2 |
:101DC0002817390734F08091DD0C99278217930783 |
:101DD00024F49093500880934F0880914F0880938B |
:101DE000B3008091DE0C8093070104C083E08093F0 |
:101DF000B0005F98FF91EF91DF91CF91BF91AF91CC |
:101E00009F918F917F916F915F914F913F912F9112 |
:101E10001F910F91FF90EF900F900FBE0F901F90AA |
:101E200018951F920F920FB60F9211242F933F9384 |
:101E30004F935F936F937F938F939F93AF93BF93D2 |
:101E4000EF93FF93809151088150809351088F3F09 |
:101E5000B9F489E080935108809108018F5F817007 |
:101E600080930801882319F481E080934C088091C5 |
:101E70004A0890914B08019690934B0880934A082A |
:101E800080914D0890914E080297C0F080914D08C6 |
:101E900090914E08019790934E0880934D085A9A5E |
:101EA00080914D0890914E082091050130910601D6 |
:101EB00082239323892B09F063C055C08FEF9FEFD6 |
:101EC00090930601809305015A988091C10C83FF7D |
:101ED0004AC00E94C11980910301909104010197A9 |
:101EE0009093040180930301809103019091040178 |
:101EF0008F5F9F4FC1F50E94DD181816190654F424 |
:101F00000E94DD1828E631E0281B390B3093B90810 |
:101F10002093B8080E94DD1897FF09C00E94DD18C1 |
:101F2000909581959F4F9093B9088093B8088091C0 |
:101F3000B8089091B9082091BA083091BB08821B6B |
:101F4000930B845E9D4F68E671E00E944448845B79 |
:101F500090409093BD088093BC0880E293E09093FA |
:101F6000040180930301809100018A3039F404C098 |
:101F70005A9A0BC0479A09C05A9807C0479805C09B |
:101F8000809100018A30B1F7F3CFFF91EF91BF91BB |
:101F9000AF919F918F917F916F915F914F913F9101 |
:101FA0002F910F900FBE0F901F90189580914A08A7 |
:101FB00090914B080B96909353088093520882E0BF |
:101FC00085BD83EA84BD17BC88E788BD83EC809318 |
:101FD000B00086E08093B100E0E7F0E080818260AD |
:101FE0008083EEE6F0E08081816080838AE08093E8 |
:101FF000B3001092B200089520914A0830914B0826 |
:102000002F5F3F4F280F391F80914A0890914B084E |
:10201000A901481B590B57FFF7CF089510927C0078 |
:102020008FEE80937A0008951F920F920FB60F9251 |
:102030001124EF92FF920F931F932F933F934F938F |
:102040005F936F937F938F939F93AF93BF93CF9340 |
:10205000DF93EF93FF9310927A0080916A088F5F6D |
:1020600080936A088150E82FFF27E830F10508F0D7 |
:1020700067C3EB5AFF4F0C94CB4820917C083091FA |
:102080007D088091780090917900281B390B809110 |
:1020900000018A3011F0220F331F8091580890916F |
:1020A0005908820F931F9093590880935808809184 |
:1020B00062088F5F809362088091AC089091AD08B0 |
:1020C000A091AE08B091AF08442737FD4095542F3A |
:1020D000820F931FA41FB51F8093AC089093AD0887 |
:1020E000A093AE08B093AF088091B0089091B1086A |
:1020F000A091B208B091B308820F931FA41FB51F1F |
:102100008093B0089093B108A093B208B093B3083D |
:1021100081E080936B08809168089091690801962E |
:1021200090936908809368080FC36091780070915C |
:10213000790080917A0890917B08681B790B8091D7 |
:1021400000018A3011F0660F771F8091A4089091EA |
:10215000A508A091A608B091A7089B01442737FDC8 |
:102160004095542F820F931FA41FB51F8093A4087E |
:102170009093A508A093A608B093A7088091A808FB |
:102180009091A908A091AA08B091AB08820F931F63 |
:10219000A41FB51F8093A8089093A908A093AA082C |
:1021A000B093AB088091A4089091A508A091A608CF |
:1021B000B091A708815F9A4BA440B04064F080E3DF |
:1021C00093E9ABEFBFEF8093A4089093A508A09389 |
:1021D000A608B093A7088091A4089091A508A091A3 |
:1021E000A608B091A70880519544AB4FBF4F64F447 |
:1021F00080ED9CE6A4E0B0E08093A4089093A5084D |
:10220000A093A608B093A7088091780090917900D8 |
:102210000F9710F468E17CEF80917800909179003D |
:10222000079710F460E378EF80917800909179003F |
:10223000835F934010F068EE73E080917800909196 |
:1022400079008A5F934010F060ED77E08091560846 |
:1022500090915708860F971F9093570880935608C0 |
:10226000809161088F5F8093610882E0A1C06091D6 |
:102270007800709179008091780890917908681BB6 |
:10228000790B809100018A3011F0660F771F8091E1 |
:102290009C0890919D08A0919E08B0919F089B0179 |
:1022A000442737FD4095542F820F931FA41FB51F5D |
:1022B00080939C0890939D08A0939E08B0939F08DC |
:1022C0008091A0089091A108A091A208B091A308C4 |
:1022D000820F931FA41FB51F8093A0089093A1089D |
:1022E000A093A208B093A30880919C0890919D08A8 |
:1022F000A0919E08B0919F08815F9A4BA440B04086 |
:1023000064F080E393E9ABEFBFEF80939C08909378 |
:102310009D08A0939E08B0939F0880919C0890917F |
:102320009D08A0919E08B0919F0880519544AB4FA5 |
:10233000BF4F64F480ED9CE6A4E0B0E080939C087D |
:1023400090939D08A0939E08B0939F088091780079 |
:10235000909179000F9710F468E17CEF80917800FC |
:1023600090917900079710F460E378EF80917800FE |
:1023700090917900835F934010F068EE73E0809154 |
:102380007800909179008A5F934010F060ED77E0DB |
:102390008091540890915508860F971F9093550887 |
:1023A00080935408809160088F5F8093600884E078 |
:1023B00080936B08C9C14091090150910A01809135 |
:1023C0007800909179009A01220F331F240F351F56 |
:1023D00063E070E00E943048260F371F369527953E |
:1023E0003695279530930A012093090186E0E0CFC6 |
:1023F0008091800890918108209178003091790037 |
:10240000821B930B90934D0C80934C0C80915A0837 |
:1024100090915B0820914C0C30914D0C820F931FD2 |
:1024200090935B0880935A08809164088F5F809333 |
:10243000640887E0BDCF8091780090917900209169 |
:102440007E0830917F08821B930B9093580C8093E9 |
:10245000570C80915C0890915D082091570C309149 |
:10246000580C820F931F90935D0880935C088091B5 |
:1024700063088F5F8093630885E080936B0886E034 |
:10248000E4C06091780070917900E0908208F0904B |
:1024900083080091840810918508882777FD80952E |
:1024A000982F0E944347A80197010E949D460E94D1 |
:1024B000264770935F0860935E0820915E08309114 |
:1024C0005F08E0914C0CF0914D0C8091570C90916D |
:1024D000580C97FF03C0909581959F4F64E070E082 |
:1024E0000E944448EB01CF01F7FF03C0909581950E |
:1024F0009F4F64E070E00E944448260F371F2C0F66 |
:102500003D1F30935F0820935E0880915E08909194 |
:102510005F08029704F160918208709183088091AE |
:1025200084089091850820E030E048E454E40E945B |
:102530004D4788230CF03CC060918208709183085D |
:1025400080918408909185082AE037ED43EA5CE3A6 |
:102550000E949E4625C080915E0890915F088F5F23 |
:102560009F4F34F5609182087091830880918408B0 |
:102570009091850820E030E046E154E40E94504705 |
:102580001816B4F4609182087091830880918408D1 |
:10259000909185082AE037ED43EA5CE30E949D466E |
:1025A00060938208709383088093840890938508D1 |
:1025B00081E08093650880917800909179009093F4 |
:1025C0004F0C80934E0C2091B4083091B508409187 |
:1025D000B6085091B70880915E0890915F08AA27CD |
:1025E00097FDA095BA2F280F391F4A1F5B1F209314 |
:1025F000B4083093B5084093B6085093B708E090FC |
:10260000B408F090B5080091B6081091B708609131 |
:10261000B4087091B5088091B6089091B70820E091 |
:1026200034E040E050E00E947948E21AF30A040BDB |
:10263000150BE092B408F092B5080093B608109319 |
:10264000B70883E080936B0887E080936A087CC0BA |
:1026500080915C0C90915D0C209178003091790014 |
:10266000820F931F90935D0C80935C0C8091540CAF |
:102670008F5F8093540C8091540C853008F460C0B7 |
:1026800080917800909179009093100180930F01D0 |
:102690001092540C8091500C9091510C20915C0C34 |
:1026A00030915D0C821B930B2091DC083091DD088A |
:1026B000821B930B909367088093660860915C0C73 |
:1026C00070915D0CE0900B01F0900C0100910D01F8 |
:1026D00010910E01882777FD8095982FA80197010A |
:1026E000220F331F441F551F2E0D3F1D401F511F2A |
:1026F000620F731F841F951F24E030E040E050E01C |
:102700000E94794820930B0130930C0140930D01F6 |
:1027100050930E012091500C3091510C80910B017F |
:1027200090910C01A0910D01B0910E01281B390B65 |
:102730003093DD082093DC0810925D0C10925C0C45 |
:1027400010926B0810926A0880916B0880937C004D |
:102750008FEE80937A00FF91EF91DF91CF91BF913F |
:10276000AF919F918F917F916F915F914F913F9129 |
:102770002F911F910F91FF90EF900F900FBE0F9030 |
:102780001F901895CF93DF93A3E0B0E00E94D1484B |
:10279000802DC82FDD27C531D10508F02A97C7BD88 |
:1027A00084E690E00E94FC0F80910F01909110014F |
:1027B00082559340D0F4C0E0D0E017C0C7BD82E39B |
:1027C00090E00E94FC0F8CED91E09F938F931F92FD |
:1027D0000E94DC0B80910F01909110010F900F90DF |
:1027E0000F908458934020F02196CA3FD10530F3D2 |
:1027F000A3E0B0E00C2E0E94D948C093590C8CE2A3 |
:1028000091E00E94FC0FDF91CF910895EBE1F1E0A0 |
:1028100080E2819391E0EB36F907D9F70895FF92B2 |
:102820000F931F9380916F08282F3327C901817060 |
:102830009070682F882391F080917008882311F0A0 |
:10284000815002C080916B0180937008EBE1F1E050 |
:1028500080E2819391E0EB36F907D9F7A901427044 |
:10286000507021FF0DC0809170088F5F80937008B9 |
:10287000EBE1F1E080E2819391E0EB36F907D9F7E3 |
:10288000662321F0452B11F01092700881E18093AE |
:102890006E088091700899279F938F9389EA94E03E |
:1028A0009F938F9381E08F930E94DC0B809170083F |
:1028B0000F900F900F900F900F90E82FFF27EC30A4 |
:1028C000F10508F0BFC3E35AFF4F0C94CB481092B8 |
:1028D0006E0887E994E09F938F9311E01F930E9405 |
:1028E000DC0B84E180936E082091000180E490E08D |
:1028F0009F938F931F921F92822F6AE00E94244819 |
:10290000892F99279F938F93822F0E94244899277C |
:102910009F938F9384E894E09F938F931F930E94DB |
:10292000DC0B88E280936E080E94180499279F931D |
:102930008F9387E794E09F938F931F930E94DC0B04 |
:102940008CE380936E0887E694E09F938F931F93A8 |
:102950000E94DC0BB3C08091C10C80FF44C0109278 |
:102960006E088091DC089091DD089F938F9388E535 |
:1029700094E09F938F9311E01F930E94DC0B84E1FE |
:1029800080936E088091DE089091DF089F938F936B |
:1029900089E494E09F938F931F930E94DC0B88E25D |
:1029A00080936E0880910F01909110019F938F93F7 |
:1029B0008AE394E09F938F931F930E94DC0B8CE338 |
:1029C00080936E088091590C99279F938F938BE287 |
:1029D00094E09F938F931F930E94DC0B8DB79EB75B |
:1029E00044968DBF34C384E180936E0884E294E002 |
:1029F0009F938F9311E01F930E94DC0B88E28093DA |
:102A00006E0886E194E09F938F931F930E94DC0BE6 |
:102A10008DB79EB70696E5CF10926E088CE094E0D5 |
:102A20009F938F9311E01F930E94DC0B84E18093AE |
:102A30006E08609188087091890880918A08909149 |
:102A40008B0820E034E040E050E00E9479485F933A |
:102A50004F933F932F938DEF93E09F938F931F930B |
:102A60000E94DC0B88E280936E0860919008709160 |
:102A70009108809192089091930820E034E040E022 |
:102A800050E00E9479485F934F933F932F938EEECF |
:102A900093E09F938F931F930E94DC0B8CE38093B2 |
:102AA0006E088091B8089091B9089F938F938FED2D |
:102AB00093E09F938F931F930E94DC0B8DB79EB77B |
:102AC00046968FCF10926E088091810C9091820C67 |
:102AD00020917F0C3091800C9F938F933F932F9385 |
:102AE0008FEC93E09F938F9311E01F930E94DC0B78 |
:102AF00084E180936E088091850C9091860C2091E2 |
:102B0000830C3091840C9F938F933F932F938FEB83 |
:102B100093E09F938F931F930E94DC0B88E2809336 |
:102B20006E088091890C90918A0C2091870C3091CD |
:102B3000880C9F938F933F932F938FEA93E09F93FB |
:102B40008F931F930E94DC0B8CE380936E0880911F |
:102B50008D0C90918E0C20918B0C30918C0C9F934E |
:102B60008F933F932F938FE993E0E4C110926E0807 |
:102B7000E091BA0CFF27EE0FFF1FE358F34F2081BF |
:102B80003181E091B90CFF27EE0FFF1FE358F34F9F |
:102B9000808191813F932F939F938F938FE893E050 |
:102BA0009F938F9311E01F930E94DC0B84E180932D |
:102BB0006E08E091BC0CFF27EE0FFF1FE358F34FA8 |
:102BC00020813181E091BB0CFF27EE0FFF1FE358FE |
:102BD000F34F808191813F932F939F938F938FE742 |
:102BE00093E09F938F931F930E94DC0B88E2809366 |
:102BF0006E08E091BE0CFF27EE0FFF1FE358F34F66 |
:102C000020813181E091BD0CFF27EE0FFF1FE358BB |
:102C1000F34F808191813F932F939F938F938FE602 |
:102C200093E09F938F931F930E94DC0B8CE3809320 |
:102C30006E08E091C00CFF27EE0FFF1FE358F34F23 |
:102C400020813181E091BF0CFF27EE0FFF1FE35879 |
:102C5000F34F808191813F932F939F938F938FE5C3 |
:102C600093E068C110926E0881E593E09F938F9383 |
:102C700011E01F930E94DC0B84E180936E08209189 |
:102C800078083091790880915408909155086091A6 |
:102C900060083F932F9377270E9444487F936F9358 |
:102CA00082E493E09F938F931F930E94DC0B88E252 |
:102CB00080936E0820917A0830917B0880915608A5 |
:102CC00090915708609161083F932F9377270E9456 |
:102CD00044487F936F9383E393E09F938F931F9375 |
:102CE0000E94DC0B8CE380936E0820917C0830916D |
:102CF0007D088091580890915908609162083F932F |
:102D00002F9377270E9444487F936F9384E293E048 |
:102D10009F938F931F935BC010926E0887E193E09F |
:102D20009F938F9381E0F82EFF920E94DC0B84E149 |
:102D300080936E0820917E0830917F0880915C0816 |
:102D400090915D08609163083F932F9377270E94CD |
:102D500044487F936F9388E093E09F938F93FF9213 |
:102D60000E94DC0B88E280936E08209180083091ED |
:102D7000810880915A0890915B08609164083F93A4 |
:102D80002F9377270E9444487F936F9389EF92E0B7 |
:102D90009F938F93FF920E94DC0B8CE380936E08CD |
:102DA00060918208709183088091840890918508D1 |
:102DB00000914E0C10914F0C0E9426477F936F9309 |
:102DC0001F930F938AEE92E09F938F93FF920E943E |
:102DD000DC0B8DB79EB7489604CE84E180936E08D5 |
:102DE0008091090190910A019F938F938BED92E05E |
:102DF0009F938F9311E01F930E94DC0B88E28093D6 |
:102E00006E088091D40899279F938F938CEC92E061 |
:102E10009F938F931F930E94DC0B8DB79EB70A96EA |
:102E2000E0CD10926E088DEB92E09F938F9311E0AE |
:102E30001F930E94DC0B84E180936E088091BC0894 |
:102E40009091BD089F938F938EEA92E09F938F930A |
:102E50001F930E94DC0B88E280936E088091B80873 |
:102E60009091B9089F938F938FE992E09F938F93EE |
:102E70001F930E94DC0B8CE380936E088091BA084C |
:102E80009091BB089F938F9380E992E0D2C01092FB |
:102E90006E088091CC089091CD089F938F9380917C |
:102EA000C4089091C5089F938F938EE792E09F93FB |
:102EB0008F9311E01F930E94DC0B84E180936E08D6 |
:102EC0008091CE089091CF089F938F938091C608F0 |
:102ED0009091C7089F938F938CE692E09F938F9376 |
:102EE0001F930E94DC0B88E280936E088091D008CB |
:102EF0009091D1089F938F938091C8089091C908B1 |
:102F00009F938F938AE592E09F938F931F930E94E4 |
:102F1000DC0B8CE380936E088091D2089091D308EB |
:102F20009F938F938091CA089091CB089F938F9322 |
:102F300088E492E09F938F931F930E94DC0B8DB7E0 |
:102F40009EB74C964ECD10926E0880E492E09F930F |
:102F50008F9311E01F930E94DC0B84E180936E0835 |
:102F600080918F0199279F938F9382E392E09F93A3 |
:102F70008F931F930E94DC0B88E280936E088091F0 |
:102F80004F08909150089F938F9384E292E09F9313 |
:102F90008F931F930E94DC0B8CE380936E088091CB |
:102FA000DD0C99279F938F938091DC0C99279F9339 |
:102FB0008F9386E192E09F938F931F930E94DC0B87 |
:102FC0000DCD10926E088BE092E09F938F9311E0ED |
:102FD0001F930E94DC0B84E180936E0880915F0C4C |
:102FE000992787FD90959F938F938CEF91E09F9306 |
:102FF0008F931F930E94DC0B88E280936E08809170 |
:10300000600C992787FD90959F938F938DEE91E0AB |
:103010009F938F931F930E94DC0B8CE380936E0829 |
:1030200080915E0C992787FD90959F938F938EEDED |
:1030300091E09F938F931F930E94DC0B8DB79EB7F7 |
:103040004296CFCC815080936B0110927008109201 |
:103050006F081F910F91FF9008951F920F920FB666 |
:103060000F9211242F933F934F938F939F938091AF |
:10307000610C843021F0883009F095C025C0809122 |
:10308000640C803149F48EB59927982F8827909346 |
:10309000660C8093650C13C0803249F48EB5992775 |
:1030A000982F882790936A0C8093690C08C08EB57E |
:1030B0009927982F882790936E0C80936D0C1EBCD7 |
:1030C00088E08093610C6FC08091640C803111F5B1 |
:1030D0008EB5282F33278091650C9091660C282B94 |
:1030E000392B3093660C2093650CC9018D509E4F8F |
:1030F000875E934028F43093680C2093670C08C0D7 |
:103100008091670C9091680C9093660C8093650C8D |
:1031100080E245C0803211F58EB5282F332780918B |
:10312000690C90916A0C282B392B30936A0C2093F0 |
:10313000690CC9018D509E4F875E934028F43093EF |
:103140006C0C20936B0C08C080916B0C90916C0CF4 |
:1031500090936A0C8093690C80E421C08EB5282F6F |
:10316000332780916D0C90916E0C282B392B309366 |
:103170006E0C20936D0CC9018D509E4F875E93405D |
:1031800028F43093700C20936F0C08C080916F0C62 |
:103190009091700C90936E0C80936D0C80E18093F5 |
:1031A000640C1092610C9F918F914F913F912F91E0 |
:1031B0000F900FBE0F901F901895A0E1B0E0E3EEC6 |
:1031C000F8E10C9494486091880870918908809186 |
:1031D0008A0890918B08E090D90CFF2453E0EE0C04 |
:1031E000FF1C5A95E1F70027F7FC0095102FA80166 |
:1031F00097010E94794859016A013093720C20931B |
:10320000710C609190087091910880919208909152 |
:103210009308A80197010E9479483093740C209379 |
:10322000730CC5010E94671B69877A878B879C870F |
:103230008091710C9091720C0E94CB1B5B016C0110 |
:103240008091730C9091740C0E94671B6D837E8338 |
:103250008F8398878091730C9091740C0E94CB1B84 |
:1032600069837A838B839C832091600C332727FDAD |
:1032700030956091690C70916A0C621B730B882702 |
:1032800077FD8095982F0E9443471B012C012091C8 |
:103290005E0C332727FD309560916D0C70916E0C9C |
:1032A000621B730B882777FD8095982F0E944347F8 |
:1032B0003B014C01A201910169817A818B819C8142 |
:1032C0000E94BD477B018C01A40193016D817E8129 |
:1032D0008F8198850E94BD479B01AC01C801B70151 |
:1032E0000E949E460E9426476D877E878F87988B17 |
:1032F00020915F0C332727FD30956091650C70910C |
:10330000660C621B730B882777FD8095982F0E94AF |
:1033100043479B01AC01C601B5010E94BD475B015B |
:103320006C01A20191016D817E818F8198850E943F |
:10333000BD477B018C01A401930169817A818B8156 |
:103340009C810E94BD479B01AC01C801B7010E944E |
:103350009D4629853A854B855C850E94BD479B012A |
:10336000AC01C601B5010E949D460E942647DC01C2 |
:10337000CB016D857E850E94AB1AE2E1C05F0C94A3 |
:10338000B0488091610C813041F0813018F082307A |
:1033900059F51EC02A9A81E018C02A988091640CC1 |
:1033A000803111F481E307C0803211F482E303C05D |
:1033B000803411F483E38EBD88E090E00E94550EC6 |
:1033C0009093630C8093620C82E08093610C08956B |
:1033D0008091620C9091630C0E945E0E882321F014 |
:1033E0001EBC84E08093610C089583ED8CBD84B194 |
:1033F000846A84B95B9880E18093640C1092610CBC |
:10340000A5EFB1E00E94D148802D80935F0CA6EF1C |
:10341000B1E00E94D148802D8093600CA7EFB1E00D |
:103420000E94D148802D80935E0C0895A0E0B0E00A |
:10343000ECE1FAE10C94964866247724EE24FF240C |
:1034400000E010E0AA24BB24CC24DD2488249924A5 |
:10345000E2E34E2E55248091650C9091660C08177E |
:10346000190714F48C0104C08E159F050CF47C011F |
:103470008091690C90916A0CC816D90614F46C01FD |
:1034800004C08A159B050CF45C0180916D0C909131 |
:103490006E0C6816790614F43C0104C08815990571 |
:1034A0000CF44C01552041F482E390E090934E08D7 |
:1034B00080934D0872E3572E8AE090E00E94550EEB |
:1034C000EC01CE010E945E0E8823D9F3E091BB0C83 |
:1034D000FF27EE0FFF1FE358F34F80819181843661 |
:1034E00091050CF44A94442011F05A94B4CFC801C9 |
:1034F0008E0D9F1D62E070E00E9444489B01609326 |
:103500005F0CC6018A0D9B1D62E070E00E9444487A |
:103510006093600CC301880D991D62E070E00E9409 |
:10352000444860935E0CA5EFB1E0022E0E94D9489A |
:103530008091600CA6EFB1E0082E0E94D9488091DE |
:103540005E0CA7EFB1E0082E0E94D948E0E1CDB7AC |
:10355000DEB70C94B248A0E0B0E0E1EBFAE10C94E5 |
:103560009D48EC016B01892B29F4672B19F480E04D |
:1035700090E09EC0D7FC03C091E0B92E02C08FEF4F |
:10358000B82E209731F48AE52B2D2802C001112492 |
:103590008FC0B601882777FD8095982F0E944347FA |
:1035A0007B018C01BE01882777FD8095982F0E94B2 |
:1035B00043479B01AC01C801B7010E94E04620E0EF |
:1035C00030E048E452E40E94BD470E942647FB01D8 |
:1035D00077FF03C0F095E195FF4F31E0EE30F30740 |
:1035E00034F4E255FB4F8491682F772747C086E17A |
:1035F000E737F8071CF06AE570E040C027E0E637DF |
:10360000F2071CF069E570E039C034E0EE37F307EB |
:103610001CF068E570E032C083E0E433F8071CF08A |
:1036200067E570E02BC022E0E038F2071CF066E5A9 |
:1036300070E024C032E0E830F3071CF065E570E08C |
:103640001DC081E0E83BF8071CF064E570E016C09F |
:1036500021E0EC37F2071CF063E570E00FC031E0C9 |
:10366000EF34F3071CF062E570E008C0EB52F14064 |
:103670001CF061E570E002C060E570E01C161D06FC |
:103680006CF48B2D992787FD90959C01629FC0015A |
:10369000639F900D729F900D11240AC0D7FC05C046 |
:1036A00084EB90E0861B970B03C0CB01845B9040BA |
:1036B000E9E0CDB7DEB70C94B948FC01259134910F |
:1036C000FC01329645915491CA01B9010895A0E0D8 |
:1036D000B0E0EDE6FBE10C949E489C0197FD04C030 |
:1036E00061E0C62ED12C06C0309521953F4F5FEF8B |
:1036F000C52ED52EC9018B5590408A35910530F4E1 |
:1037000084EB90E0821B930B9C010FC0C901855B89 |
:1037100090408A35910518F4245B30400EC0C901F1 |
:103720008F5091408A35910518F0C1E0D0E007C074 |
:1037300088E691E0821B930B9C01CFEFDFEF220F15 |
:10374000331F220F331FC90184549A4F0E945D1BFF |
:103750007B018C01B601882777FD8095982F0E9408 |
:1037600043479B01AC01C801B7010E94BD477B01E3 |
:103770008C01BE01882777FD8095982F0E944347D2 |
:103780009B01AC01C801B7010E94BD47E8E0CDB77D |
:10379000DEB70C94BA482AE530E0281B390BC90182 |
:1037A0000E94671B0895FC0197FD02C091E004C0D0 |
:1037B000F095E195FF4F9FEFE85DF84F8491989F5A |
:1037C000802D1124992787FD909508951092B900B6 |
:1037D0008AE28093B800089585EA8093BC0080E077 |
:1037E00090E0089584E98093BC0008951092B90098 |
:1037F0008093BB0085E88093BC0080E090E0089552 |
:103800001F920F920FB60F9211248F939F93EF93F5 |
:10381000FF93809171088F5F809371088150E82F2A |
:10382000FF27E830F10508F064C0E759FF4F0C941A |
:10383000CB4880917208880F8E5A09C08091720817 |
:103840008F5F80937208815027C080916109109228 |
:10385000B9008093BB0085E88093BC004AC084E92E |
:103860008093BC0080917208843018F41092710823 |
:1038700002C01092720885EAEFCF80917308880F1A |
:103880008D5AE5CF8091BB00E0917308FF27EB587C |
:10389000F34F808380917308813039F08130A8F232 |
:1038A000823031F0833029F506C080916209CFCF94 |
:1038B00080916709CCCF80916D09C9CF8091730841 |
:1038C0009091BB00E82FFF27EB58F34F94838F5F55 |
:1038D00080937308843010F01092730884E9809309 |
:1038E000BC008AE090E090937D0180937C0110926F |
:1038F00071088091BC0080688093BC00FF91EF91BB |
:103900009F918F910F900FBE0F901F9018954CEBC9 |
:1039100050E084E9DA018C93109271082BEB30E0CF |
:10392000F90180811092720880E88C931092BD009A |
:103930001092BA001082E9EBF0E01082A8EBB0E040 |
:103940001C9210828AE28C9385EADA018C931082B1 |
:10395000F901108285E88C93089583EC80938100AF |
:10396000EFE6F0E080818062808310927D08109203 |
:103970007C0810927B0810927A08109279081092B5 |
:10398000780808951F920F920FB60F9211240F938B |
:103990001F932F933F934F935F936F937F938F93D7 |
:1039A0009F93AF93BF93CF93DF93EF93FF932091B8 |
:1039B0008600309187008091760890917708281BC7 |
:1039C000390B8091860090918700909377088093BF |
:1039D0007608C9018D5D95408356994148F481E090 |
:1039E00090E0909375088093740810926C0167C002 |
:1039F000C0917408D0917508CE30D1050CF05FC02D |
:103A0000C9018B5F9040845B914008F040C0A901E0 |
:103A1000425D5140FE01EE0FFF1FE358F34F8081DE |
:103A20009181FA01E81BF90BCF01F7FF03C09095D4 |
:103A300081959F4F06974CF48091D408883C28F4D8 |
:103A40008091D408865F8093D408FE01EE0FFF1F9B |
:103A50008F010358134FD8012D913C91C901880F54 |
:103A6000991F820F931F840F951F64E070E00E94DE |
:103A70004448D8018D919C9111979B01281B390BCB |
:103A8000E556F34F3183208311967C936E93FE01AC |
:103A90003196F0937508E0937408E530F10519F458 |
:103AA0005D9A5C980BC05D98E630F10511F45C9A64 |
:103AB00005C05C98379711F45B9A01C05B98FF9141 |
:103AC000EF91DF91CF91BF91AF919F918F917F91B6 |
:103AD0006F915F914F913F912F911F910F910F9097 |
:103AE0000FBE0F901F901895AF92BF92CF92DF92AA |
:103AF000EF92FF920F931F9310927A0080916008CB |
:103B0000882369F08091540890915508609160086D |
:103B100077270E9444487093F60C6093F50C8091CF |
:103B20006108882369F08091560890915708609148 |
:103B3000610877270E9444487093F40C6093F30C5B |
:103B400080916208882369F0809158089091590803 |
:103B50006091620877270E9444487093020D609339 |
:103B6000010D809163088823D9F1E090FE0CF0905C |
:103B7000FF0C60915C0870915D082091630800273C |
:103B8000F7FC0095102F5701680183E0AA0CBB1CBD |
:103B9000CC1CDD1C8A95D1F7AE18BF08C00AD10A2B |
:103BA000882777FD8095982FB4E0660F771F881FD0 |
:103BB000991FBA95D1F73327442755270E94794892 |
:103BC000A20EB31EC41ED51EC601B50128E030E00A |
:103BD00040E050E00E9479483093FF0C2093FE0CA7 |
:103BE000809164088823D9F1E090070DF090080DCA |
:103BF00060915A0870915B08209164080027F7FCD7 |
:103C00000095102F57016801A3E0AA0CBB1CCC1C27 |
:103C1000DD1CAA95D1F7AE18BF08C00AD10A8827C3 |
:103C200077FD8095982FF4E0660F771F881F991F06 |
:103C3000FA95D1F73327442755270E947948A20ED9 |
:103C4000B31EC41ED51EC601B50128E030E040E019 |
:103C500050E00E9479483093080D2093070D809121 |
:103C600065088823A1F1E090F80CF090F90C6091C0 |
:103C70005E0870915F08209165080027F7FC0095A9 |
:103C8000102F57016801E3E0AA0CBB1CCC1CDD1C03 |
:103C9000EA95D1F7AE18BF08C00AD10A882777FD88 |
:103CA0008095982F3327442755270E947948A20EE4 |
:103CB000B31EC41ED51EC601B50128E030E040E0A9 |
:103CC00050E00E9479483093F90C2093F80C109240 |
:103CD00055081092540810926008109257081092DC |
:103CE00056081092610810925908109258081092C4 |
:103CF000620810925B0810925A08109264081092A1 |
:103D00005D0810925C081092630810925F08109290 |
:103D10005E08109265088091AC089091AD08A09162 |
:103D2000AE08B091AF088093980890939908A0933B |
:103D30009A08B0939B0880919C0890919D08A0914F |
:103D40009E08B0919F088093880890938908A0935B |
:103D50008A08B0938B088091A4089091A508A0913F |
:103D6000A608B091A7088093900890939108A0931B |
:103D70009208B09393088091A0089091A108A09117 |
:103D8000A208B091A30880938C0890938D08A0930B |
:103D90008E08B0938F088091A8089091A908A091EF |
:103DA000AA08B091AB088093940890939508A093CB |
:103DB0009608B09397088FEE80937A002091C408FC |
:103DC0003091C5088091BD0CE82FFF27EE0FFF1F33 |
:103DD000E358F34F8081918182599F4F281739070B |
:103DE0001CF42F5F3F4F0CC08081918182599F4FFF |
:103DF000821793074CF42115310531F021503040E2 |
:103E00003093C5082093C4082091C6083091C70894 |
:103E10008091BE0CE82FFF27EE0FFF1FE358F34FF2 |
:103E20008081918182599F4F281739071CF42F5F99 |
:103E30003F4F0CC08081918182599F4F8217930719 |
:103E40004CF42115310531F0215030403093C70832 |
:103E50002093C6082091C8083091C9088091BF0CF2 |
:103E6000E82FFF27EE0FFF1FE358F34F808191816A |
:103E700082599F4F281739071CF42F5F3F4F0CC002 |
:103E80008081918182599F4F821793074CF42115AD |
:103E9000310531F0215030403093C9082093C808D3 |
:103EA0002091CA083091CB088091C00CE82FFF27E1 |
:103EB000EE0FFF1FE358F34F8081918182599F4F8E |
:103EC000281739071CF42F5F3F4F0CC08081918168 |
:103ED00082599F4F821793074CF42115310531F019 |
:103EE000215030403093CB082093CA082091CC0851 |
:103EF0003091CD0880918F0C9091900C82599F4FFA |
:103F0000281739071CF42F5F3F4F0EC080918F0C8C |
:103F10009091900C82599F4F821793074CF4211572 |
:103F2000310531F0215030403093CD082093CC083A |
:103F30002091CE083091CF088091910C9091920CF5 |
:103F400082599F4F281739071CF42F5F3F4F0EC02F |
:103F50008091910C9091920C82599F4F82179307F8 |
:103F60004CF42115310531F0215030403093CF0809 |
:103F70002093CE082091D0083091D1088091930CE5 |
:103F80009091940C82599F4F281739071CF42F5F8A |
:103F90003F4F0EC08091930C9091940C82599F4F8B |
:103FA000821793074CF42115310531F02150304030 |
:103FB0003093D1082093D0082091D2083091D308B3 |
:103FC0008091950C9091960C82599F4F2817390734 |
:103FD0001CF42F5F3F4F0EC08091950C9091960C72 |
:103FE00082599F4F821793074CF42115310531F008 |
:103FF000215030403093D3082093D2088091C408D8 |
:104000009091C50897FF05C01092C5081092C4088A |
:104010000AC08F3F910539F034F08FEF90E0909314 |
:10402000C5088093C4088091C6089091C70897FF7F |
:1040300005C01092C7081092C6080AC08F3F9105AC |
:1040400039F034F08FEF90E09093C7088093C60862 |
:104050008091C8089091C90897FF05C01092C908BF |
:104060001092C8080AC08F3F910539F034F08FEFE5 |
:1040700090E09093C9088093C8088091CA089091F5 |
:10408000CB0897FF05C01092CB081092CA080AC04F |
:104090008F3F910539F034F08FEF90E09093CB088B |
:1040A0008093CA088091CC089091CD0897FF05C0F5 |
:1040B0001092CD081092CC080AC08F3F910539F0BC |
:1040C00034F08FEF90E09093CD088093CC088091EE |
:1040D000CE089091CF0897FF05C01092CF0810929C |
:1040E000CE080AC08F3F910539F034F08FEF90E091 |
:1040F0009093CF088093CE088091D0089091D108FA |
:1041000097FF05C01092D1081092D0080AC08F3FC7 |
:10411000910539F034F08FEF90E09093D1088093BF |
:10412000D0088091D2089091D30897FF05C01092D3 |
:10413000D3081092D2080AC08F3F910539F034F0AD |
:104140008FEF90E09093D3088093D2081F910F9146 |
:10415000FF90EF90DF90CF90BF90AF9008951092B6 |
:104160007A0080916008882369F0809154089091CA |
:1041700055086091600877270E9444487093F60CB8 |
:104180006093F50C80916108882369F0809156084E |
:10419000909157086091610877270E944448709376 |
:1041A000F40C6093F30C80916208882369F080918D |
:1041B0005808909159086091620877270E944448F6 |
:1041C0007093020D6093010D809163088823D1F0F4 |
:1041D00060915C0870915D0820916308882777FDE5 |
:1041E0008095982FF4E0660F771F881F991FFA9526 |
:1041F000D1F73327442755270E9479483093FF0C85 |
:104200002093FE0C809164088823D1F060915A08B5 |
:1042100070915B0820916408882777FD8095982F1E |
:10422000E4E0660F771F881F991FEA95D1F73327BF |
:10423000442755270E9479483093080D2093070D95 |
:1042400080916508882399F060915E0870915F08FD |
:1042500020916508882777FD8095982F332744277C |
:1042600055270E9479483093F90C2093F80C10924E |
:104270005508109254081092600810925708109236 |
:10428000560810926108109259081092580810921E |
:10429000620810925B0810925A08109264081092FB |
:1042A0005D0810925C081092630810925F081092EB |
:1042B0005E08109265088FEE80937A002091C40802 |
:1042C0003091C5088091BD0CE82FFF27EE0FFF1F2E |
:1042D000E358F34F8081918182599F4F2817390706 |
:1042E0001CF42F5F3F4F0CC08081918182599F4FFA |
:1042F000821793074CF42115310531F021503040DD |
:104300003093C5082093C4082091C6083091C7088F |
:104310008091BE0CE82FFF27EE0FFF1FE358F34FED |
:104320008081918182599F4F281739071CF42F5F94 |
:104330003F4F0CC08081918182599F4F8217930714 |
:104340004CF42115310531F0215030403093C7082D |
:104350002093C6082091C8083091C9088091BF0CED |
:10436000E82FFF27EE0FFF1FE358F34F8081918165 |
:1043700082599F4F281739071CF42F5F3F4F0CC0FD |
:104380008081918182599F4F821793074CF42115A8 |
:10439000310531F0215030403093C9082093C808CE |
:1043A0002091CA083091CB088091C00CE82FFF27DC |
:1043B000EE0FFF1FE358F34F8081918182599F4F89 |
:1043C000281739071CF42F5F3F4F0CC08081918163 |
:1043D00082599F4F821793074CF42115310531F014 |
:1043E000215030403093CB082093CA082091CC084C |
:1043F0003091CD0880918F0C9091900C82599F4FF5 |
:10440000281739071CF42F5F3F4F0EC080918F0C87 |
:104410009091900C82599F4F821793074CF421156D |
:10442000310531F0215030403093CD082093CC0835 |
:104430002091CE083091CF088091910C9091920CF0 |
:1044400082599F4F281739071CF42F5F3F4F0EC02A |
:104450008091910C9091920C82599F4F82179307F3 |
:104460004CF42115310531F0215030403093CF0804 |
:104470002093CE082091D0083091D1088091930CE0 |
:104480009091940C82599F4F281739071CF42F5F85 |
:104490003F4F0EC08091930C9091940C82599F4F86 |
:1044A000821793074CF42115310531F0215030402B |
:1044B0003093D1082093D0082091D2083091D308AE |
:1044C0008091950C9091960C82599F4F281739072F |
:1044D0001CF42F5F3F4F0EC08091950C9091960C6D |
:1044E00082599F4F821793074CF42115310531F003 |
:1044F000215030403093D3082093D2088091C408D3 |
:104500009091C50897FF05C01092C5081092C40885 |
:104510000AC08F3F910539F034F08FEF90E090930F |
:10452000C5088093C4088091C6089091C70897FF7A |
:1045300005C01092C7081092C6080AC08F3F9105A7 |
:1045400039F034F08FEF90E09093C7088093C6085D |
:104550008091C8089091C90897FF05C01092C908BA |
:104560001092C8080AC08F3F910539F034F08FEFE0 |
:1045700090E09093C9088093C8088091CA089091F0 |
:10458000CB0897FF05C01092CB081092CA080AC04A |
:104590008F3F910539F034F08FEF90E09093CB0886 |
:1045A0008093CA088091CC089091CD0897FF05C0F0 |
:1045B0001092CD081092CC080AC08F3F910539F0B7 |
:1045C00034F08FEF90E09093CD088093CC088091E9 |
:1045D000CE089091CF0897FF05C01092CF08109297 |
:1045E000CE080AC08F3F910539F034F08FEF90E08C |
:1045F0009093CF088093CE088091D0089091D108F5 |
:1046000097FF05C01092D1081092D0080AC08F3FC2 |
:10461000910539F034F08FEF90E09093D1088093BA |
:10462000D0088091D2089091D30897FF05C01092CE |
:10463000D3081092D20808958F3F910539F034F0D5 |
:104640008FEF90E09093D3088093D20808951F9342 |
:104650008091C40C8B3F98F08B3F19F48091C40873 |
:104660000EC08C3F19F48091C60809C08D3F19F423 |
:104670008091C80804C08E3F21F48091CA088093BD |
:10468000870180918701882319F41092870104C063 |
:104690008F3F11F4809387018091C30C8B3F98F07A |
:1046A0008B3F19F48091C4080EC08C3F19F480919F |
:1046B000C60809C08D3F19F48091C80804C08E3F18 |
:1046C00021F48091CA088093860180918601882315 |
:1046D00019F41092860105C0843618F084E68093A0 |
:1046E00086018091C50C8B3F98F08B3F19F4809127 |
:1046F000C4080EC08C3F19F48091C60809C08D3FD4 |
:1047000019F48091C80804C08E3F21F48091CA0832 |
:104710008093880180918801882319F41092880180 |
:1047200005C0843618F084E6809388018091C70C18 |
:104730008B3F98F08B3F19F48091C4080EC08C3FDA |
:1047400019F48091C60809C08D3F19F48091C808FA |
:1047500004C08E3F21F48091CA0880938901809122 |
:104760008901882319F41092890104C08F3F11F444 |
:10477000809389018091CE0C8B3F98F08B3F19F488 |
:104780008091C4080EC08C3F19F48091C60809C0FE |
:104790008D3F19F48091C80804C08E3F21F48091A8 |
:1047A000CA0880938A0180918A01882319F41092A3 |
:1047B0008A0104C08F3F11F480938A018091CF0C4D |
:1047C0008B3F98F08B3F19F48091C4080EC08C3F4A |
:1047D00019F48091C60809C08D3F19F48091C8086A |
:1047E00004C08E3F21F48091CA0880938B01809190 |
:1047F0008B018B3010F48AE002C08F3F11F480935C |
:104800008B018091D00C8B3F98F08B3F19F48091F5 |
:10481000C4080EC08C3F19F48091C60809C08D3FB2 |
:1048200019F48091C80804C08E3F21F48091CA0811 |
:1048300080938C0180918C01882319F410928C0153 |
:1048400004C08F3F11F480938C018091D50C8B3F75 |
:1048500098F08B3F19F48091C4080EC08C3F19F476 |
:104860008091C60809C08D3F19F48091C80804C022 |
:104870008E3F21F48091CA0880938E0180918E0131 |
:10488000882319F410928E0104C08F3F11F4809395 |
:104890008E018091D60C8B3F98F08B3F19F480915C |
:1048A000C4080EC08C3F19F48091C60809C08D3F22 |
:1048B00019F48091C80804C08E3F21F48091CA0881 |
:1048C0008093E2088091E208882319F41092E208AC |
:1048D00004C08F3F11F48093E2088091D70C8B3F86 |
:1048E00098F08B3F19F48091C4080EC08C3F19F4E6 |
:1048F0008091C60809C08D3F19F48091C80804C092 |
:104900008E3F21F48091CA088093E3088091E308E8 |
:10491000882319F41092E30804C08F3F11F48093A8 |
:10492000E3088091D80C8B3F98F08B3F19F480916D |
:10493000C4080EC08C3F19F48091C60809C08D3F91 |
:1049400019F48091C80804C08E3F21F48091CA08F0 |
:104950008093E4088091E408882319F41092E40815 |
:1049600004C08F3F11F48093E4088091D90C8B3FF1 |
:1049700098F08B3F19F48091C4080EC08C3F19F455 |
:104980008091C60809C08D3F19F48091C80804C001 |
:104990008E3F21F48091CA088093E5088091E50854 |
:1049A000882319F41092E50804C08F3F11F4809316 |
:1049B000E5089091DA0C9B3FB0F09B3F19F4809191 |
:1049C000C40804C09C3F29F48091C60880938F01DD |
:1049D0000CC09D3F19F48091C808F8CF9E3F29F480 |
:1049E0008091CA08F3CF90938F0180918F01882323 |
:1049F00019F410928F0104C08F3F11F480938F013E |
:104A00009B3FB0F09B3F19F48091C40804C09C3FC9 |
:104A100029F48091C60880938F010CC09D3F19F442 |
:104A20008091C808F8CF9E3F29F48091CA08F3CF3F |
:104A300090938F0180918F01882319F410928F0138 |
:104A400004C08F3F11F480938F019B3FB0F09B3FD8 |
:104A500019F48091C40804C09C3F29F48091C608D1 |
:104A600080938F010CC09D3F19F48091C808F8CF46 |
:104A70009E3F29F48091CA08F3CF90938F018091D3 |
:104A80008F01882319F410928F0104C08F3F11F415 |
:104A900080938F018091DF0C8B3F98F08B3F19F44E |
:104AA0008091C4080EC08C3F19F48091C60809C0DB |
:104AB0008D3F19F48091C80804C08E3F21F4809185 |
:104AC000CA088093900180919001882319F4109274 |
:104AD000900104C08F3F11F48093900110918E01DA |
:104AE000612F772767FD7095872F972F0E94434787 |
:104AF00017FF06C020E030E040E853E40E949E46E5 |
:104B000027E137EB41ED58E30E94BD4760938201F6 |
:104B10007093830180938401909385018091CC0CE4 |
:104B20008093000D8091CB0C8093F70C1F9108951A |
:104B300081E08093B90C42E04093BA0C83E080930B |
:104B4000BB0C94E09093BC0C35E03093BD0C86E038 |
:104B50008093BE0C87E08093BF0C88E08093C00CEC |
:104B60001092C10C8EE18093C20C8BEF8093C40C29 |
:104B70008AE08093C50C22E32093C30C2093C70CDA |
:104B80004093C60C9093C80C1092C90C90E190937E |
:104B9000CA0C3093CB0C8AEF8093CC0C8AE18093C3 |
:104BA000CD0C9093CE0C8FEA8093CF0C8093D00CD9 |
:104BB0008FE58093D10C83E28093D20C84E18093C3 |
:104BC000D30C1092D40C1092D50C1092D60C1092DB |
:104BD000D70C1092D80C88E78093D90C84E6809388 |
:104BE000DA0C88E28093DB0C1092E20C2093DC0C50 |
:104BF00086E98093DD0C3093DE0C2093DF0C8AE590 |
:104C00008093E00C1092E10CA7EEBCE0EDE6F1E041 |
:104C10008CE001900D928150E1F7089581E080933E |
:104C2000B90C82E08093BA0C83E08093BB0C94E0D3 |
:104C30009093BC0C45E04093BD0C86E08093BE0C85 |
:104C400087E08093BF0C38E03093C00C1092C10C09 |
:104C50008EE18093C20C8BEF8093C40C8AE080932A |
:104C6000C50C22E32093C30C2093C70C9093C60C71 |
:104C70009093C80C3093C90C90E19093CA0C409368 |
:104C8000CB0C8AEF8093CC0C8AE18093CD0C90936F |
:104C9000CE0C98E79093CF0C36E93093D00C8FE58B |
:104CA0008093D10C83E28093D20C84E18093D30C67 |
:104CB0001092D40C1092D50C1092D60C1092D70CE6 |
:104CC0001092D80C9093D90C84E68093DA0C88E289 |
:104CD0008093DB0C1092E20C2093DC0C3093DD0C03 |
:104CE0004093DE0C2093DF0C8AE58093E00C109259 |
:104CF000E10CA7EEBCE0E5E7F1E08CE001900D925D |
:104D00008150E1F708958091DB08882301F5109226 |
:104D10006209109261091092670910926D098091E1 |
:104D20003C08882311F08093610980913D08882315 |
:104D300011F08093620980913E08882311F08093DE |
:104D40006D0980913F08882311F0809367091092C4 |
:104D50007108109272080E94EC1B0895CF93DF93A4 |
:104D600010927F0810927E0810928108109280089D |
:104D700080E090E0A0E0B0E0809382089093830808 |
:104D8000A0938408B093850810927908109278084F |
:104D900010927B0810927A0810927D0810927C087D |
:104DA0000E94AF2085E090E00E94550EEC01CE01FC |
:104DB0000E945E0E8823D9F30E94AF208091C10C1F |
:104DC00080FF10C080910F0190911001875B93408C |
:104DD00038F480910F01909110018E5E924010F492 |
:104DE0000E94C213809100018A3041F58091F50C38 |
:104DF0009091F60C97FF03C0909581959F4F9093EB |
:104E00007908809378088091F30C9091F40C97FFC7 |
:104E100003C0909581959F4F90937B0880937A086B |
:104E20008091010D9091020D97FF03C0909581959F |
:104E30009F4F90937D0880937C0833C08091F50C40 |
:104E40009091F60C97FF03C0909581959F4F62E07B |
:104E500070E00E94444870937908609378088091CC |
:104E6000F30C9091F40C97FF03C0909581959F4FA0 |
:104E700062E070E00E94444870937B0860937A0877 |
:104E80008091010D9091020D97FF03C0909581953F |
:104E90009F4F62E070E00E94444870937D086093E9 |
:104EA0007C088091070D9091080D97FF03C09095A5 |
:104EB00081959F4F60E170E00E94444870938108A3 |
:104EC000609380088091FE0C9091FF0C97FF03C0C7 |
:104ED000909581959F4F60E170E00E9444487093E7 |
:104EE0007F0860937E0860914E0C70914F0C88276C |
:104EF00077FD8095982F0E944347609382087093B6 |
:104F00008308809384089093850810929C081092DF |
:104F10009D0810929E0810929F081092A00810926F |
:104F2000A1081092A2081092A3081092A40810924F |
:104F3000A5081092A6081092A7081092A80810922F |
:104F4000A9081092AA081092AB081092AC0810920F |
:104F5000AD081092AE081092AF081092F60C1092A5 |
:104F6000F50C1092F40C1092F30C1092020D1092AA |
:104F7000010D80910B0190910C01A0910D01B09158 |
:104F80000E019093510C8093500C10926708109270 |
:104F900066081092B4081092B5081092B6081092E4 |
:104FA000B7088091B8089091B9089093BB08809396 |
:104FB000BA0882E390E090934E0880934D08DF9109 |
:104FC000CF9108951F93182F0EC08091DB0888237E |
:104FD00061F484E690E090934E0880934D088AEF48 |
:104FE00090E00E94FC0F115080F71F910895A6E0F9 |
:104FF000B0E0EDEFF7E20C9494480E94741D299AFA |
:10500000E091BB0CFF27EE0FFF1FE358F34FA0808A |
:10501000B18028E730E0A20EB31EB7FE02C0AA247A |
:10502000BB248091D408843608F055C080910201D9 |
:10503000882399F480910501909106018F5F9F4F1D |
:1050400061F488E99AE390934E0880934D0880E0DC |
:105050009CE090930601809305018091EF08909168 |
:10506000F008009731F001979093F0088093EF08D3 |
:1050700004C01092DB081092BE08289A8091EA08BA |
:105080009091EB08815D974018F18091D20CA82E89 |
:10509000BB2481E08093BE08E091B90CFF27EE0F9E |
:1050A000FF1FE358F34F11821082E091BA0CFF27E3 |
:1050B000EE0FFF1FE358F34F11821082E091BC0CFA |
:1050C000FF27EE0FFF1FE358F34F11821082D2C16A |
:1050D0001092DB08CFC18091D4088D3808F4CAC182 |
:1050E0001092BE088091D30C22E3829FC00111244C |
:1050F0009093F0088093EF0859E2A516B104ACF044 |
:105100008091EA089091EB086FEF8F3F960729F0A6 |
:1051100001969093EB088093EA088091EA089091B9 |
:10512000EB089093C2088093C1088091EA0890919F |
:10513000EB08883C910520F078E2A716B10404F54D |
:1051400010920109109202091092030910920409A9 |
:105150001092FD081092FE081092FF0810920009AC |
:105160001092AC081092AD081092AE081092AF08E1 |
:105170001092B0081092B1081092B2081092B308C1 |
:1051800089ECA816B1040CF4D5C08091DB08882303 |
:1051900009F070C1E091BC0CFF27EE0FFF1FE35830 |
:1051A000F34F808191818C3491050CF4C0C08091C3 |
:1051B000EE088F5F8093EE08893C08F45BC1299864 |
:1051C0001092DB081092EE081092EB081092EA0899 |
:1051D0008091B90C282F3327F901EE0FFF1FE358F8 |
:1051E000F34F80819181873491059CF4E091BA0C52 |
:1051F000FF27EE0FFF1FE358F34F0190F081E02DE2 |
:10520000F7FF03C0F095E195FF4FE734F1050CF48B |
:105210006CC08091BA0C682F7727DB01AA0FBB1FE7 |
:10522000A358B34F8D919C911197873491053CF011 |
:10523000F901EE0FFF1FE358F34F808191818D91AB |
:105240009C918734910564F0F901EE0FFF1FE3583C |
:10525000F34F808191818734910514F042E001C0C1 |
:1052600041E0FB01EE0FFF1FE358F34F8081918176 |
:10527000863491055CF4F901EE0FFF1FE358F34FFC |
:1052800080819181873491050CF043E0FB01EE0FA2 |
:10529000FF1FE358F34F808191818A5B9F4F5CF43D |
:1052A000F901EE0FFF1FE358F34F8081918187349E |
:1052B00091050CF044E0660F771F6358734FFB01B4 |
:1052C000808191818A5B9F4F5CF4220F331F2358AA |
:1052D000334FD9018D919C91863491050CF445E0B2 |
:1052E000A2E0B0E0042E0E94D9488091C10C80FF5A |
:1052F00010C080910F0190911001875B934038F4AA |
:1053000080910F01909110018E5E924010F40E94E6 |
:10531000C2130E9418044AE369EB7CE00E943F0438 |
:105320000E94AE260E9418040E94E227A3C0109299 |
:10533000EE08A0C0F3E2AF16B1040CF09BC0809160 |
:10534000BC0C482F5527FA01EE0FFF1FE358F34F0F |
:1053500080819181855B9F4F0CF06DC08091ED083D |
:105360008F5F8093ED08893C08F467C088EC8093D8 |
:10537000ED0881E090E09093EB088093EA0881E0EB |
:105380008093DB081092F9081092FA081092FB083B |
:105390001092FC081092AC081092AD081092AE0862 |
:1053A0001092AF081092B0081092B1081092B20893 |
:1053B0001092B30810929C0810929D0810929E08BB |
:1053C00010929F081092A4081092A5081092A608A7 |
:1053D0001092A7088091880890918908A0918A0866 |
:1053E000B0918B088093A0089093A108A093A20885 |
:1053F000B093A3088091900890919108A091920891 |
:10540000B09193088093A8089093A908A093AA0844 |
:10541000B093AB081092010910920209109203098F |
:10542000109204091092FD081092FE081092FF08D5 |
:105430001092000902C01092ED08440F551F435806 |
:10544000534FDA018D919C918C3491058CF08091B1 |
:10545000EC088F5F8093EC08893C60F01092DB08C9 |
:1054600088EC8093EC081092EB081092EA0802C0D6 |
:105470001092EC0880916C01815080936C018091B6 |
:105480006C018F3F29F08091BE08882309F4D0C1B8 |
:105490000E942723E091B90CFF27EE0FFF1FDF01C9 |
:1054A000A358B34F4D915C918091C80C482E552460 |
:1054B000E556F34F808191812091C90C3327449D9B |
:1054C0007001459DF00C549DF00C1124FC01E29FED |
:1054D000C001E39F900DF29F900D1124E80EF91E7C |
:1054E000F092D608E092D508E091BA0CFF27EE0FB3 |
:1054F000FF1FDF01A358B34F4D915C91E556F34F69 |
:1055000080819181449D6001459DD00C549DD00CBB |
:105510001124AC01429FC001439F900D529F900DFA |
:105520001124C80ED91ED092D808C092D708E09195 |
:10553000BC0CFF27EE0FFF1FE358F34F80819181D2 |
:10554000909581959F4F9093DA088093D908109198 |
:105550008B01612F772767FD7095872F972F0E940A |
:10556000434717FF06C020E030E040E853E40E94C4 |
:105570009E4620E030E040E251E40E949E4620E05A |
:1055800030E040E85BE30E94BD473B014C01609383 |
:10559000030D7093040D8093050D9093060D1091EB |
:1055A0008C01612F772767FD7095872F972F0E94B9 |
:1055B000434717FF06C020E030E040E853E40E9474 |
:1055C0009E4620E030EE4BE257E40E94E0466093B6 |
:1055D000FA0C7093FB0C8093FC0C9093FD0C809163 |
:1055E000C10C82FF0CC080E090E0A0E0B0E08093AE |
:1055F000FA0C9093FB0CA093FC0CB093FD0C20E0F4 |
:1056000030E040E050E0C401B3010E944D478823E0 |
:1056100064F480E090E0A0E0B0E08093030D90930C |
:10562000040DA093050DB093060D20E030E040E09E |
:1056300050E06091FA0C7091FB0C8091FC0C909101 |
:10564000FD0C0E944D47882364F480E090E0A0E0C8 |
:10565000B0E08093FA0C9093FB0CA093FC0CB093F9 |
:10566000FD0C8091E10C992782FDCEC083FDCCC05A |
:105670008091880890918908A0918A08B0918B0840 |
:1056800081569A4EA040B04044F1C20173E0880FA9 |
:10569000991F7A95E1F7A701481B590B5093D6083B |
:1056A0004093D5088091880890918908A0918A0834 |
:1056B000B0918B0881589843A140B0400CF43FC092 |
:1056C000C20164E0880F991F6A95E1F7481B590BE6 |
:1056D0005093D6084093D50832C0809188089091A5 |
:1056E0008908A0918A08B0918B08805A9541AF4FE4 |
:1056F000BF4F2CF5920153E0220F331F5A95E1F76B |
:105700002E0D3F1D3093D6082093D5088091880830 |
:1057100090918908A0918A08B0918B08815898438C |
:10572000A140B04064F0C20144E0880F991F4A953F |
:10573000E1F7281B390B3093D6082093D5088091C8 |
:10574000900890919108A0919208B0919308815689 |
:105750009A4EA040B0403CF1C20123E0880F991F4F |
:105760002A95E1F7A601481B590B5093D80840939E |
:10577000D7088091900890919108A0919208B091DB |
:10578000930881589843A140B0400CF43DC004E018 |
:10579000440C551C0A95E1F7441955095093D80853 |
:1057A0004093D70831C08091900890919108A091C2 |
:1057B0009208B0919308805A9541AF4FBF4F24F59E |
:1057C000920113E0220F331F1A95E1F72C0D3D1DB6 |
:1057D0003093D8082093D708809190089091910831 |
:1057E000A0919208B091930881589843A140B0408D |
:1057F0005CF0B4E0440C551CBA95E1F72419350966 |
:105800003093D8082093D70842989091E50880916A |
:10581000C008891740F0992331F088B194E08927B6 |
:1058200088B91092C0088091C0088F5F8093C0082B |
:105830008091BA0CE82FFF27EE0FFF1FE358F34FBC |
:10584000208131818091E00C482F55274217530762 |
:1058500024F48091E10C82FD0DC0208131818827E4 |
:105860009927841B950B281739077CF48091E10C4C |
:1058700083FF0BC081E08093E1088091DF0C482E0C |
:1058800055244A145B0424F002C01092E10825015B |
:105890008091B90CE82FFF27EE0FFF1FE358F34F5D |
:1058A000808191814817590724F48091E10C80FD93 |
:1058B0000DC02081318188279927841B950B2817DB |
:1058C00039078CF48091E10C81FF0DC081E0809359 |
:1058D000E0081092E1088091DF0C99278415950566 |
:1058E00024F42C0102C01092E0088091BE088823A5 |
:1058F00041F11092DA081092D9081092D60810924D |
:10590000D5081092D8081092D7088DEC9CECACEC1E |
:10591000BDE38093030D9093040DA093050DB09308 |
:10592000060D8AE097EDA3EABBE38093FA0C90930F |
:10593000FB0CA093FC0CB093FD0C1092E1081092AC |
:10594000E00880916808909169088D54914008F4AE |
:1059500098C020918C0830918D0840918E0850910C |
:105960008F088091880890918908A0918A08B09149 |
:105970008B08281B390B4A0B5B0BE0909408F090C6 |
:105980009508009196081091970880919008909141 |
:105990009108A0919208B0919308E81AF90A0A0BAD |
:1059A0001B0B1092690810926808273A31054105CF |
:1059B000510534F0809178089091790801960AC0D9 |
:1059C0002A553F4F4F4F5F4F4CF48091780890918C |
:1059D00079080197909379088093780877EAE71619 |
:1059E000F1040105110534F080917A0890917B084B |
:1059F00001960EC08AE5E8168FEFF8068FEF0807CC |
:105A00008FEF18074CF480917A0890917B080197EA |
:105A100090937B0880937A0810927A00809188088E |
:105A200090918908A0918A08B0918B088093A00872 |
:105A30009093A108A093A208B093A3088091900826 |
:105A400090919108A0919208B09193088093A80832 |
:105A50009093A908A093AA08B093AB0880919808E6 |
:105A600090919908A0919A08B0919B088093B008F2 |
:105A70009093B108A093B208B093B3088FEE8093CF |
:105A80007A008091C10CA82FBB27BE83AD831D0176 |
:105A9000B0E22B223324A5FF8AC060918808709160 |
:105AA000890880918A0890918B08A090CD0CBB2426 |
:105AB000CC24DD24E090FE0CF090FF0CA6019501B3 |
:105AC0000E9479480027F7FC0095102F2E193F09F6 |
:105AD000400B510BCA01B90120E130E040E050E039 |
:105AE0000E94794839014A012093F5083093F6085D |
:105AF0004093F7085093F8086091900870919108CE |
:105B00008091920890919308E090070DF090080D15 |
:105B1000A60195010E9479480027F7FC0095102FF7 |
:105B20002E193F09400B510BCA01B90120E130E0A9 |
:105B300040E050E00E9479482093F1083093F20849 |
:105B40004093F3085093F408E5EF6E16E1E07E060B |
:105B5000E0E08E06E0E09E062CF084EF91E0A0E00D |
:105B6000B0E00DC0FCE06F16FEEF7F06FFEF8F0682 |
:105B7000FFEF9F0664F48CE09EEFAFEFBFEF8093E2 |
:105B8000F5089093F608A093F708B093F808253F1E |
:105B900061E0360760E0460760E056070CF0F8C0A9 |
:105BA0002C503E4F4F4F5F4F0CF019C1FBC020E00F |
:105BB00030E040E050E06091FA0C7091FB0C809175 |
:105BC000FC0C9091FD0C0E944D47882309F4F7C00E |
:105BD0008091E008882309F0F2C08091E1088823D1 |
:105BE00009F0EDC0609188087091890880918A0859 |
:105BF00090918B082091CD0C622E772488249924D3 |
:105C0000E090FE0CF090FF0CA40193010E947948F3 |
:105C10000027F7FC0095102F2E193F09400B510B60 |
:105C20002093F5083093F6084093F7085093F8084E |
:105C30008091FE0C9091FF0CAA2797FDA095BA2F9A |
:105C4000B7FF07C0B095A095909581959F4FAF4F36 |
:105C5000BF4F883C9105A105B1053CF4CA01B901CB |
:105C600028E030E040E050E006C0CA01B90120E180 |
:105C700030E040E050E00E9479482093F5083093EE |
:105C8000F6084093F7085093F808609190087091D7 |
:105C900091088091920890919308E090070DF09000 |
:105CA000080DA40193010E9479480027F7FC009594 |
:105CB000102F2E193F09400B510B2093F108309300 |
:105CC000F2084093F3085093F4088091070D9091E7 |
:105CD000080DAA2797FDA095BA2FB7FF07C0B0956A |
:105CE000A095909581959F4FAF4FBF4F883C9105F0 |
:105CF000A105B1053CF4CA01B90128E030E040E05B |
:105D000050E006C0CA01B90120E130E040E050E0B7 |
:105D10000E9479482093F1083093F2084093F308E9 |
:105D20005093F4088091F5089091F608A091F70837 |
:105D3000B091F808853FE1E09E07E0E0AE07E0E0C3 |
:105D4000BE072CF084EF91E0A0E0B0E009C08C50D9 |
:105D50009E4FAF4FBF4F64F48CE09EEFAFEFBFEFAD |
:105D60008093F5089093F608A093F708B093F8088D |
:105D70008091F1089091F208A091F308B091F40895 |
:105D8000853F21E0920720E0A20720E0B2072CF037 |
:105D900084EF91E0A0E0B0E009C08C509E4FAF4F7F |
:105DA000BF4FECF48CE09EEFAFEFBFEF8093F108B4 |
:105DB0009093F208A093F308B093F40810C01092E7 |
:105DC000F5081092F6081092F7081092F808109251 |
:105DD000F1081092F2081092F3081092F408109251 |
:105DE0007A0080919C0890919D08A0919E08B091A6 |
:105DF0009F082091F5083091F6084091F7085091DE |
:105E0000F808821B930BA40BB50B80939C0890930E |
:105E10009D08A0939E08B0939F088091A40890913C |
:105E2000A508A091A608B091A7082091F10830918B |
:105E3000F2084091F3085091F408821B930BA40BD5 |
:105E4000B50B8093A4089093A508A093A608B093DF |
:105E5000A708E090D908F090DA089701F7FE04C08F |
:105E6000222733272E193F092531310534F04D8182 |
:105E700044FD03C081E08093E608E091CA0CFF274F |
:105E8000E29EC001E39E900DF29E900D1124BC0194 |
:105E9000E69FC001E79F900DF69F900D112460E0F2 |
:105EA00072E00E9444488B01EE9DC001EF9D900D71 |
:105EB000FE9D900D112464E070E00E944448060F9E |
:105EC000171F222717FD2095322F0093F9081093F2 |
:105ED000FA082093FB083093FC088091AC0890915D |
:105EE000AD08A091AE08B091AF08801B910BA20B3A |
:105EF000B30B8093AC089093AD08A093AE08B09319 |
:105F0000AF088091AC089091AD08A091AE08B09117 |
:105F1000AF08895A9146A040B04064F088EA91E603 |
:105F2000A0E0B0E08093AC089093AD08A093AE08D9 |
:105F3000B093AF088091AC089091AD08A091AE08E5 |
:105F4000B091AF0888559E49AF4FBF4F64F488E5C4 |
:105F50009EE9AFEFBFEF8093AC089093AD08A0939C |
:105F6000AE08B093AF08EFEEE0937A008091B808E6 |
:105F70009091B908892B09F440C0FD81F3FF3DC021 |
:105F80008091E608882351F08091B8089091B90873 |
:105F90009093BB088093BA081092E60810927A009A |
:105FA0000091AC081091AD082091AE083091AF0877 |
:105FB0004091BC085091BD0880918A019927BC018D |
:105FC000469FC001479F900D569F900D112460E29F |
:105FD00070E00E944448882777FD8095982F061B23 |
:105FE000170B280B390B0093AC081093AD082093C6 |
:105FF000AE083093AF08E0937A002328A9F080918F |
:10600000E208992790937209809371098091E308BF |
:10601000992790936409809363098091E4088093A1 |
:10602000C3080E946E3508C01092320910923109DF |
:1060300010923409109233098091E70881508093BF |
:10604000E7088F3F09F02AC181E38093E708809138 |
:10605000220C99279093B60B8093B50B809133094E |
:10606000909134099093B80B8093B70B80913109CC |
:10607000909132099093BA0B8093B90B80910D09DE |
:1060800090910E099093BC0B8093BB0B80911109EA |
:10609000909112099093BE0B8093BD0B80912509BE |
:1060A000909126099093C00B8093BF0B8091290992 |
:1060B00090912A099093C20B8093C10B8091BC08E8 |
:1060C0009091BD089093C40B8093C30B8091B80846 |
:1060D0009091B9089093C60B8093C50B8091650C85 |
:1060E0009091660C9093C80B8093C70B8091690CBC |
:1060F00090916A0C9093CA0B8093C90B80916D0CA0 |
:1061000090916E0C9093CC0B8093CB0B8091E30815 |
:1061100099279093CE0B8093CD0B8091C8089091D6 |
:10612000C9089093D00B8093CF0B8091B8089091C1 |
:10613000B9089093D20B8093D10B8091360990913E |
:1061400037099093D40B8093D30B80913A099091A7 |
:106150003B099093D60B8093D50B80914109909188 |
:106160004209A0914309B09144099093D80B8093C0 |
:10617000D70B8091450990914609A0914709B091AC |
:1061800048099093DA0B8093D90B80910D0C909174 |
:106190000E0C9093DC0B8093DB0B8091110C909193 |
:1061A000120C9093DE0B8093DD0B8091190C909173 |
:1061B0001A0C9093E00B8093DF0B80911D0C909153 |
:1061C0001E0C9093E20B8093E10B8091090190915A |
:1061D0000A019093E40B8093E30B2091750C80915E |
:1061E000760C280F312D311D8091780C4091770C61 |
:1061F000840F912D911D280F391F3093E60B2093AA |
:10620000E50B8091D7089091D8089093E80B809384 |
:10621000E70B8091DC089091DD089093EA0B809366 |
:10622000E90B609188087091890880918A089091A3 |
:106230008B08E090CD0CFF2400271127A8019701BF |
:106240000E9479483093EC0B2093EB0B60919008FF |
:10625000709191088091920890919308A8019701FC |
:106260000E9479483093EE0B2093ED0B8091FE0C49 |
:106270009091FF0C9093F00B8093EF0B8091070DA2 |
:106280009091080D9093F20B8093F10B8091D508BB |
:106290009091D6089093F40B8093F30B8091E008D3 |
:1062A0008823A9F06091F50C7091F60C882777FD92 |
:1062B0008095982F0E9443472091030D3091040D43 |
:1062C0004091050D5091060D0E94BD4732C060916E |
:1062D00088087091890880918A0890918B08E090D5 |
:1062E000F50CF090F60C0E9443472091FA0C309187 |
:1062F000FB0C4091FC0C5091FD0C0E94BD475B01D2 |
:106300006C010027F7FC0095102FC801B7010E940F |
:1063100043472091030D3091040D4091050D50919C |
:10632000060D0E94BD479B01AC01C601B5010E944C |
:106330009E460E9426477093F60C6093F50C809160 |
:10634000E1088823A9F06091F30C7091F40C882780 |
:1063500077FD8095982F0E9443472091030D30913F |
:10636000040D4091050D5091060D0E94BD4732C0AD |
:106370006091900870919108809192089091930893 |
:10638000E090F30CF090F40C0E9443472091FA0C3B |
:106390003091FB0C4091FC0C5091FD0C0E94BD47CC |
:1063A0005B016C010027F7FC0095102FC801B701B5 |
:1063B0000E9443472091030D3091040D4091050D3B |
:1063C0005091060D0E94BD479B01AC01C601B5016D |
:1063D0000E949E460E9426477093F40C6093F30C33 |
:1063E0006091010D7091020DE0909808F09099086D |
:1063F00000919A0810919B08882777FD8095982F27 |
:106400000E9443472091030D3091040D4091050DEA |
:106410005091060D0E94BD475B016C01C801B70198 |
:106420000E9443472091FA0C3091FB0C4091FC0CE8 |
:106430005091FD0C0E94BD4720E030E040E05FE35A |
:106440000E94BD479B01AC01C601B5010E949E465A |
:106450000E9426477093020D6093010D8091F50C08 |
:106460009091F60C8150984034F080E098E0909341 |
:10647000F60C8093F50C8091F50C9091F60C805001 |
:10648000984F34F480E098EF9093F60C8093F50CDD |
:106490008091F30C9091F40C8150984034F080E09E |
:1064A00098E09093F40C8093F30C8091F30C90910E |
:1064B000F40C8050984F34F480E098EF9093F40CF3 |
:1064C0008093F30C8091010D9091020D81509840C2 |
:1064D00034F080E098E09093020D8093010D80915C |
:1064E000010D9091020D8050984F34F480E098EFA8 |
:1064F0009093020D8093010D8091C10C992780FF2C |
:10650000BEC02091870181FF0EC02233B0F480917C |
:10651000DC089091DD0888979093DF088093DE086F |
:106520001092BF080DC08091C60C289FC001112495 |
:1065300088979093DF088093DE0881E08093BF08FE |
:106540008091BE08882321F01092DF081092DE08A7 |
:106550002091DC083091DD084091DE085091DF0881 |
:10656000421753070CF08BC08091BF08882309F4B1 |
:1065700086C0241B350B809188019927AC01249F8C |
:10658000C001259F900D349F900D112460E170E0B3 |
:106590000E9444488201061B170B20916608309127 |
:1065A0006708809186019927BC01269FC001279F1B |
:1065B000900D369F900D112468E070E00E944448D1 |
:1065C000061B170B6091B4087091B5088091B6084E |
:1065D0009091B70820E032E040E050E00E94794816 |
:1065E000CA01B901209189013327442755270E9408 |
:1065F000054820E230E040E050E00E9479487FEF1B |
:106600002E3C370714F42EEC3FEF8091E808909170 |
:10661000E908AC0164E0440F551F6A95E1F7481B97 |
:10662000590B2333310514F022E330E0021B130B26 |
:10663000CA01800F911F60E170E00E94444870938E |
:10664000E9086093E8088091C20C992768177907D8 |
:106650003CF4481659065CF09093E9088093E808EA |
:106660008091E8089091E9084816590624F4509260 |
:10667000E9084092E8084090E8085090E908A090A6 |
:10668000010DB090020D8091F9089091FA08A81AB6 |
:10669000B90AB201882777FD8095982F0E94434759 |
:1066A0007B018C01B501882777FD8095982F0E948A |
:1066B0004347A80197010E94504718162CF4C801BF |
:1066C000B7010E9426475B0117FB109517F910953B |
:1066D000B501882777FD8095982F0E944347A80130 |
:1066E00097010E944D4788232CF4C801B7010E94EE |
:1066F00026475B0185E6A816B10424F014E6A12E16 |
:10670000B12C09C09CE9A9169FEFB90624F4BCE995 |
:10671000AB2EBFEFBB2EA4E14A16510414F4AA24F9 |
:10672000BB2420917E0130917F01409180015091E6 |
:10673000810129833A834B835C836091F50C7091CE |
:10674000F60C2091D5083091D6084091310950912E |
:106750003209241B350B621B730B882777FD80954C |
:10676000982F0E9443479B01AC0169817A818B81FC |
:106770009C810E94BD470E942647709366096093E2 |
:10678000650980916509909166098C01222717FDA2 |
:106790002095322F8091010990910209A09103095F |
:1067A000B0910409080F191F2A1F3B1F009301090C |
:1067B000109302092093030930930409101611065F |
:1067C00012061306ACF4C80117FF03C0909581951B |
:1067D0009F4F60E071E00E9444486F5F7F4F8827C1 |
:1067E00077FD8095982F061B170B280B390B14C0CB |
:1067F000C80117FF03C0909581959F4F60E071E03D |
:106800000E9444486F5F7F4F882777FD8095982FBF |
:10681000060F171F281F391F009301091093020943 |
:106820002093030930930409809101099091020992 |
:10683000A0910309B091040981383EE3930730E049 |
:10684000A30730E0B3072CF080E89EE3A0E0B0E0BF |
:1068500009C08058914CAF4FBF4F64F480E891EC71 |
:10686000AFEFBFEF8093010990930209A093030952 |
:10687000B09304092091650930916609C501B7FEFE |
:1068800004C0882799278A199B094201880E991EFE |
:10689000880C991CC401281539050CF4C901CC24B5 |
:1068A000DD24C818D908B601C816D9060CF4BC01F5 |
:1068B00092012A0D3B1D260F371F37FF03C040E012 |
:1068C00050E008C08091000D482F55272417350748 |
:1068D0000CF4A9018091F70CE82EFF24C701E416FF |
:1068E000F5060CF4CA01809361099201261B370B4F |
:1068F0002A0D3B1D37FF03C080E090E007C0809168 |
:10690000000D9927281739070CF4C9019701E816DB |
:10691000F9060CF49C01209362096091F30C7091CC |
:10692000F40C2091D7083091D80840913309509148 |
:106930003409241B350B621B730B882777FD809568 |
:10694000982F0E9443479B01AC0169817A818B811A |
:106950009C810E94BD470E94264770936009609306 |
:106960005F0980915F09909160098C01222717FDD2 |
:106970002095322F8091FD089091FE08A091FF088C |
:10698000B0910009080F191F2A1F3B1F0093FD0833 |
:106990001093FE082093FF0830930009101611068B |
:1069A00012061306ACF4C80117FF03C09095819539 |
:1069B0009F4F60E071E00E9444486F5F7F4F8827DF |
:1069C00077FD8095982F061B170B280B390B14C0E9 |
:1069D000C80117FF03C0909581959F4F60E071E05B |
:1069E0000E9444486F5F7F4F882777FD8095982FDE |
:1069F000060F171F281F391F0093FD081093FE086C |
:106A00002093FF08309300098091FD089091FE08C3 |
:106A1000A091FF08B091000981385EE3950750E02E |
:106A2000A50750E0B5072CF080E89EE3A0E0B0E0B9 |
:106A300009C08058914CAF4FBF4F64F480E891EC8F |
:106A4000AFEFBFEF8093FD089093FE08A093FF087F |
:106A5000B093000980915F099091600994018815B5 |
:106A600099050CF49C01B601C216D3060CF4B901C9 |
:106A70009201260F371F2A193B0937FF03C040E058 |
:106A800050E008C08091000D482F55272417350786 |
:106A90000CF4A9019701E416F5060CF49A01209371 |
:106AA0006D09461A570AB2016A197B0977FF03C0BC |
:106AB00020E030E008C08091000D282F33276217B6 |
:106AC00073070CF49B01C701E216F3060CF4C9012D |
:106AD00080936709E2E1CA5F0C94B048AFE1B0E08F |
:106AE000E4E7F5E30C9494482091220C2D872330A1 |
:106AF00009F058C2E0914009FF27EE0FFF1FEE0F8B |
:106B0000FF1FE75FF24F80910D0C90910E0CA0914A |
:106B10000F0CB091100C80839183A283B383E0911A |
:106B20004009FF27EE0FFF1FEE0FFF1FE75DF24F3B |
:106B30008091110C9091120CA091130CB091140C37 |
:106B400080839183A283B383809140098F5F809378 |
:106B5000400980914009883011F4109240098091D9 |
:106B6000590990915A0908974CF4809159099091CC |
:106B70005A09019690935A0980935909109249092C |
:106B800010924A0910924B0910924C0910924D092B |
:106B900010924E0910924F0910925009109251090B |
:106BA00010925209109253091092540910925509EB |
:106BB0001092560910925709109258091C821B8294 |
:106BC00089E09DE09A838983A9E2BDE0BF8FAE8F03 |
:106BD00030C12090490930904A0940904B095090AB |
:106BE0004C0960904D0970904E0980904F0990902B |
:106BF0005009E981FA812081318142815381DA0192 |
:106C0000C901BB0F880B982FDC012E873F87488B6B |
:106C1000598B8A8B8B8B8C8B8D8BAE84A20C81E0F5 |
:106C2000A21408F080E0BF84B30C21E0B31408F094 |
:106C300020E08B0D91E08B1508F090E0292BB82E09 |
:106C4000C888C40C31E0C41408F030E0822F8C0DE9 |
:106C500091E08C1508F090E0392BC82ED988D50C1E |
:106C600021E0D51408F020E0832F8D0D91E08D15E3 |
:106C700008F090E0292BD82EEA88E60C31E0E614E3 |
:106C800008F030E0822F8E0D91E08E1508F090E034 |
:106C9000392BE82EFB88F70C21E0F71408F020E0F0 |
:106CA000832F8F0D91E08F1508F090E0292BF82E9F |
:106CB0000C89080D91E0081508F090E0822F800FF4 |
:106CC000E1E0801708F0E0E0AE2FA92B1D89190D37 |
:106CD000A10FA0924909B0924A09C0924B09D092E3 |
:106CE0004C09E0924D09F0924E0980934F09A09310 |
:106CF000500920905109309052094090530950900A |
:106D000054096090550970905609809057099090E9 |
:106D10005809AE8DBF8D2D913D914D915C91DA0159 |
:106D2000C901BB0F880B982FDC012E8B3F8B488F3E |
:106D3000598F8A8F8B8F8C8F8D8FAE88A20C81E0BC |
:106D4000A21408F080E0BF88B30C21E0B31408F06F |
:106D500020E08B0D91E08B1508F090E0292BB82EE8 |
:106D6000C88CC40C31E0C41408F030E0822F8C0DC4 |
:106D700091E08C1508F090E0392BC82ED98CD50CF9 |
:106D800021E0D51408F020E0832F8D0D91E08D15C2 |
:106D900008F090E0292BD82EEA8CE60C31E0E614BE |
:106DA00008F030E0822F8E0D91E08E1508F090E013 |
:106DB000392BE82EFB8CF70C21E0F71408F020E0CB |
:106DC000832F8F0D91E08F1508F090E0292BF82E7E |
:106DD0000C8D080D91E0081508F090E0822F800FCF |
:106DE000E1E0801708F0E0E0AE2FA92B1D8D190D12 |
:106DF000A10FA0925109B0925209C0925309D092AA |
:106E00005409E0925509F092560980935709A093CE |
:106E10005809EB81FC813196FC83EB8329813A810F |
:106E20002C5F3F4F3A8329838E8D9F8D04969F8FD1 |
:106E30008E8F8091590990915A09AB81BC81A81716 |
:106E4000B9070CF4C6CE2090490930904A09409009 |
:106E50004B0950904C0960904D0970904E098090FC |
:106E60004F0990905009A0915909B0915A09FD011C |
:106E7000FF0FEE0BFE2F9D01AA2EB32ECE2EDE2E7F |
:106E8000EE2EFE2E0E2F1E2F222D332D442D552D8E |
:106E9000662D772D882D992D0E94183C2093490945 |
:106EA00030934A0940934B0950934C0960934D0924 |
:106EB00070934E0980934F09909350092090510987 |
:106EC00030905209409053095090540960905509F0 |
:106ED000709056098090570990905809A0915909CF |
:106EE000B0915A09FD01FF0FEE0BFE2F9D01AA2E56 |
:106EF000B32ECE2EDE2EEE2EFE2E0E2F1E2F222D88 |
:106F0000332D442D552D662D772D882D992D0E94DA |
:106F1000183C2093510930935209409353095093E0 |
:106F200054096093550970935609809357099093BB |
:106F300058092091490930914A0940914B095091D3 |
:106F40004C0960914D0970914E0980914F099091C3 |
:106F500050092093410930934209409343095093CB |
:106F6000440920915109309152094091530950919F |
:106F70005409609155097091560980915709909173 |
:106F80005809209345093093460940934709509387 |
:106F9000480981E080933F092091DB08213009F006 |
:106FA00073C01CC0BD85B33008F06EC08091C808A6 |
:106FB0009091C908873491050CF466C0109232098B |
:106FC000109231091092340910923309439882E3E8 |
:106FD00090E090934E0880934D0856C080913509FB |
:106FE000882309F06BC08091C1089091C208805D30 |
:106FF000974008F063C08091410990914209A091A7 |
:107000004309B09144098093360990933709A093BE |
:107010003809B09339098091450990914609A091AA |
:107020004709B091480980933A0990933B09A0938E |
:107030003C09B0933D098091410990914209A0918A |
:107040004309B09144098093050990930609A093E0 |
:107050000709B09308098091450990914609A091CC |
:107060004709B09148098093090990930A09A093B0 |
:107070000B09B0930C0982E390E090934E08809343 |
:107080004D08209335091AC08091DB088823B1F49C |
:107090001092360910923709109238091092390966 |
:1070A00010923A0910923B0910923C0910923D0946 |
:1070B000109235091092C2081092C1082091C80898 |
:1070C0003091C9083F8F2E8F263431054CF58091C1 |
:1070D000410990914209A0914309B09144098093DC |
:1070E000050990930609A0930709B09308098091B8 |
:1070F000450990914609A0914709B09148098093AC |
:10710000090990930A09A0930B09B0930C091092F6 |
:1071100032091092310910923409109233094398C0 |
:107120003D85333009F080C38E8D9F8D8734910566 |
:107130000CF47AC3863991050CF048C08091D508CB |
:107140009091D6080C96499750F48091D708909169 |
:10715000D8088D3091051CF4845F9F4FBCF51092C8 |
:10716000320910923109109234091092330980913A |
:10717000410990914209A0914309B091440980933B |
:10718000050990930609A0930709B0930809809117 |
:10719000450990914609A0914709B091480980930B |
:1071A000090990930A09A0930B09B0930C098091E7 |
:1071B0003E09883C30F088B198E0892788B9109260 |
:1071C0003E0980913E098F5F80933E0980913F097F |
:1071D000813009F029C3E0900509F090060900917B |
:1071E000070910910809E114F1040105110509F4DA |
:1071F0001BC3A0900909B0900A09C0900B09D09058 |
:107200000C09A114B104C104D10409F40DC3809187 |
:10721000D5089091D6088D3091050CF005C3845F98 |
:107220009F4F0CF401C38091D7089091D8088D30FE |
:1072300091050CF0F9C2845F9F4F0CF4F5C22E8DBE |
:107240003F8D263931050CF0E0C2809141099091C3 |
:107250004209A0914309B0914409E81AF90A0A0BBE |
:107260001B0BE0920D09F0920E0900930F09109389 |
:1072700010098091450990914609A0914709B09164 |
:107280004809A81AB90ACA0ADB0AA0921109B092E1 |
:107290001209C0921309D092140956C0E0903A091D |
:1072A000F0903B0900913C0910913D09E114F10473 |
:1072B0000105110509F485C08091410990914209A9 |
:1072C000A0914309B0914409281B390B4A0B5B0B71 |
:1072D00020930D0930930E0940930F095093100924 |
:1072E0008091450990914609A0914709B0914809BC |
:1072F000E81AF90A0A0B1B0BE0921109F092120925 |
:107300000093130910931409809141099091420947 |
:10731000A0914309B091440980930509909306090F |
:10732000A0930709B09308098091450990914609F7 |
:10733000A0914709B09148098093090990930A09DF |
:10734000A0930B09B0930C09439A3BC080913A0972 |
:1073500090913B09A0913C09B0913D090097A1058E |
:10736000B10579F58091410990914209A0914309B5 |
:10737000B0914409E81AF90A0A0B1B0BE0920D09B7 |
:10738000F0920E0900930F0910931009809145099E |
:1073900090914609A0914709B0914809A81AB90AE5 |
:1073A000CA0ADB0AA0921109B0921209C09213090D |
:1073B000D0921409439A82E390E090934E08809310 |
:1073C0004D08E090190CF0901A0C00911B0C1091D4 |
:1073D0001C0CE0921509F0921609009317091093FE |
:1073E0001809A0901D0CB0901E0CC0901F0CD090DE |
:1073F000200CA0921909B0921A09C0921B09D092D0 |
:107400001C09609171097091720960900D0970906A |
:107410000E0980900F0990901009882777FD8095BC |
:10742000982FA40193010E9405480E9443472FE62C |
:1074300032E143E05AE30E94BD470E942647698734 |
:107440007A878B879C8760931D0970931E098093B0 |
:107450001F0990932009609163097091640988273E |
:1074600077FD8095982FA80197010E9405480E94FA |
:10747000434721E23CE34AE55BE30E94BD470E94AB |
:1074800026471B012C0160932109709322098093E8 |
:107490002309909324096091710970917209E09019 |
:1074A0001109F0901209009113091091140988270D |
:1074B00077FD8095982FA80197010E9405480E94AA |
:1074C00043472FE632E143E05AE30E94BD470E9462 |
:1074D00026476D837E838F839887609325097093F9 |
:1074E0002609809327099093280960916309709178 |
:1074F0006409882777FD8095982FA60195010E9441 |
:1075000005480E94434721E23CE34AE55BE30E94D1 |
:10751000BD470E9426475B016C0160932909709367 |
:107520002A0980932B0990932C098E8D9F8D863983 |
:1075300091050CF480C08091360990913709A09193 |
:107540003809B09139090097A105B10509F473C054 |
:1075500080913A0990913B09A0913C09B0913D0975 |
:107560000097A105B10509F466C0C30177FE03C009 |
:10757000909581959F4F8B3F910554F4C701F7FE7D |
:1075800003C0909581959F4F8B3F91050CF453C09C |
:107590008091C308282F3327442755272215330508 |
:1075A0004405550544F42093210930932209409362 |
:1075B0002309509324092A153B054C055D0544F425 |
:1075C0002093290930932A0940932B0950932C09C1 |
:1075D0009927909581959F4F9C01442737FD4095B1 |
:1075E000542F8091210990912209A0912309B091F3 |
:1075F000240982179307A407B50744F420932109AF |
:10760000309322094093230950932409809129093A |
:1076100090912A09A0912B09B0912C098217930708 |
:10762000A407B50744F42093290930932A0940930D |
:107630002B0950932C09E0902109F0902209A9858B |
:10764000BA85EA1AFB0AF0922E09E0922D09809180 |
:10765000290990912A096D817E81681B790B7093AD |
:10766000300960932F09C090B808D090B9088827D6 |
:1076700077FD8095982F0E9443473B014C01A090D5 |
:10768000B808B090B9080027F7FC0095102FC80182 |
:10769000B7010E9443471B012C01CC0CDD1CE1E922 |
:1076A000F1E0CE0EDF1ED6016D917C917095619553 |
:1076B0007F4F882777FD8095982F0E9443472FE6BC |
:1076C00032E143E85AE30E94BD47A40193010E94BE |
:1076D000BD477B018C01AA0CBB1CE1E6F4E0AE0EB9 |
:1076E000BF1ED5016D917C91882777FD8095982FDD |
:1076F0000E9443472FE632E143E85AE30E94BD4728 |
:10770000A20191010E94BD479B01AC01C801B701D4 |
:107710000E949E460E9426475B0170933209609347 |
:107720003109E091B808F091B9080091B8081091BA |
:10773000B908EE0FFF1FEF59FB4F60817181882759 |
:1077400077FD8095982F0E9443472FE632E143E86A |
:107750005AE30E94BD47A40193010E94BD476B01FB |
:107760007C01000F111F0F561E4FF80160817181BF |
:10777000882777FD8095982F0E9443472FE632E1B6 |
:1077800043E85AE30E94BD47A20191010E94BD4710 |
:107790009B01AC01C701B6010E949E460E9426478C |
:1077A0009B017093340960933309F4E2AF16B1047E |
:1077B00034F083E290E090933209809331092432CF |
:1077C000310534F083E290E09093340980933309DB |
:1077D00080913109909132098D5D9F4F34F48DED88 |
:1077E0009FEF9093320980933109809133099091F2 |
:1077F00034098D5D9F4F34F48DED9FEF90933409E4 |
:107800008093330910923F090FC0209136093091BF |
:107810003709409138095091390921153105410541 |
:10782000510509F03BCD92CDE2E1C15E0C94B04828 |
:10783000A9E9B0E0EEE1FCE30C949448222E332E4B |
:10784000442E552E662E772E882E992E2A2DA8E0AE |
:10785000FE01B196AA2E1192AA94E9F729A23AA2A2 |
:107860004BA25CA26DA27EA28FA298A6FE013196C9 |
:107870001192AA95E9F72983BA82CB82DC82ED8244 |
:10788000FE820F8318878DA19EA1AFA1B8A5B7FD79 |
:10789000EDC4CF57DF4F1882C158D0408D819E81F3 |
:1078A000AF81B885B7FD14C4A980BA80CB80DC80D5 |
:1078B000ED80FE800F81188529A13AA14BA15CA122 |
:1078C0006DA17EA18FA198A5A8E0FE013996BA2FDF |
:1078D0001192BA95E9F729873A874B875C876D87BC |
:1078E0007E878F87988BFE0171961192AA95E9F792 |
:1078F000A98ABA8ACB8ADC8AED8AFE8A0F8B188F16 |
:1079000029883A884B885C88ED88FE880F89188D15 |
:1079100069847A848B849C8429966CAE7DAE8EAE0D |
:107920009FAE29978D849E84AF84B8882D968CAEA7 |
:107930009DAEAEAEBFAE2D97E114F1040105110569 |
:1079400009F02BC182149304A404B50408F422C2E4 |
:10795000211431044104510409F467C500E02016E4 |
:1079600000E0300601E0400600E0500608F04CC59B |
:107970001FEF211631044104510419F010F00C944A |
:10798000FF4520E030E040E050E080E090E0420140 |
:10799000310104C096948794779467948A95D2F7BE |
:1079A000D401C3018F5C984FDC018C91280F311DED |
:1079B000411D511DDA01C90120E230E040E050E0F4 |
:1079C00039014A01681A790A8A0A9B0A09F090C7A4 |
:1079D0002D96ACACBDACCEACDFAC2D97A218B308E5 |
:1079E000C408D508720100271127A196ECAEFDAEA0 |
:1079F0000EAF1FAFA1979201810120703070A59644 |
:107A00000CAF1DAF2EAF3FAFA59721E030E040E0B7 |
:107A100050E065962CAF3DAF4EAF5FAF6597C601A6 |
:107A2000B501A1962CAD3DAD4EAD5FADA1970E94C5 |
:107A30005748E1962CAF3DAF4EAF5FAFE197A596AB |
:107A40006CAD7DAD8EAD9FADA5970E9405483B0105 |
:107A50004C01C601B501A1962CAD3DAD4EAD5FAD5B |
:107A6000A1970E945748CB01772766272996ACAC8F |
:107A7000BDACCEACDFAC29979601442755277B01DE |
:107A80008C01E22AF32A042B152BE614F7040805CF |
:107A9000190500F5E1962CAD3DAD4EAD5FADE1971A |
:107AA0002150304040405040E1962CAF3DAF4EAFAA |
:107AB0005FAFE197E20CF31C041D151DE214F30403 |
:107AC0000405150538F0E614F7040805190510F447 |
:107AD0000C947346E618F70808091909C801B7019C |
:107AE000A1962CAD3DAD4EAD5FADA1970E9457481C |
:107AF00059016A01A5966CAD7DAD8EAD9FADA59780 |
:107B00000E9405483B014C01C801B701A1962CAD6C |
:107B10003DAD4EAD5FADA1970E945748CB01772791 |
:107B2000662729962CAD3DAD4EAD5FAD29974070CF |
:107B30005070262B372B482B592B26153705480517 |
:107B40005905A8F40894A108B108C108D108220D6C |
:107B5000331D441D551D221533054405550538F0C8 |
:107B6000261537054805590510F40C945746E1963B |
:107B70006CAC7DAC8EAC9FACE197D3019927882784 |
:107B800015012601282A392A4A2A5B2A65962CAD36 |
:107B90003DAD4EAD5FAD659713C02D968CAC9DACE1 |
:107BA000AEACBFAC2D978E149F04A006B10608F0B2 |
:107BB00032C222243324210120E030E040E050E0B2 |
:107BC00088E0FE01799611928A95E9F7298E3A8E1E |
:107BD0004B8E5C8E2D8F3E8F4F8F58A3298C3A8C05 |
:107BE0004B8C5C8C6D8C7E8C8F8C98A0CF57DF4F2C |
:107BF000B880C158D040BB2011F40C948346CE56B7 |
:107C0000DF4F1882C259D040CD56DF4F1882C3597A |
:107C1000D040CC56DF4F1882C459D040CB56DF4FEE |
:107C20001882C559D040CA56DF4F1882C659D04075 |
:107C3000C956DF4F1882C759D040C856DF4F188247 |
:107C4000C859D040C756DF4F1882C959D04000E00C |
:107C5000021981E0CC24C01608F080E0CD56DF4F39 |
:107C60001881C359D040131991E0CD56DF4FD88009 |
:107C7000C359D040D11608F090E0E12EE81A8E2DBD |
:107C8000E1E01E1508F0E0E09E2B182FCC56DF4FE8 |
:107C90002881C459D0402419E1E0CC56DF4FF88048 |
:107CA000C459D040F21608F0E0E0822F891B91E021 |
:107CB000281708F090E0E92B282FCB56DF4F3881AA |
:107CC000C559D040351991E0CB56DF4F8881C55951 |
:107CD000D040831708F090E0832F8E1BE1E0381727 |
:107CE00008F0E0E09E2B382FCA56DF4F4881C65976 |
:107CF000D0404619E1E0CA56DF4FA881C659D040AE |
:107D0000A41708F0E0E0842F891B91E0481708F0E1 |
:107D100090E0E92B482FC956DF4F5881C759D04012 |
:107D20005719F1E0C956DF4FB881C759D040B51790 |
:107D300008F0F0E0852F8E1B91E0581708F090E0D6 |
:107D4000F92B582FC856DF4F6881C859D0406819A1 |
:107D500091E0C856DF4FE881C859D040E61708F0D7 |
:107D600090E0862F8F1BE1E0681708F0E0E09E2B83 |
:107D7000682FC756DF4F7881C959D0407919872FAE |
:107D8000891B202E312E422E532E642E752E862EC8 |
:107D9000982EB9C700E0201600E0300601E040064A |
:107DA00000E0500608F04EC31FEF211631044104D5 |
:107DB000510411F008F01CC720E030E040E050E032 |
:107DC00080E090E04201310104C09694879477945A |
:107DD00067948A95D2F7D401C3018F5C984FDC0178 |
:107DE0008C91280F311D411D511D80E290E0A0E0D3 |
:107DF000B0E03C014D01621A730A840A950A09F445 |
:107E000045C0C301062C04C0220C331C441C551C65 |
:107E10000A94D2F72D96ECACFDAC0EAD1FAD2D97AC |
:107E2000062C04C0EE0CFF1C001F111F0A94D2F791 |
:107E300020E230E02619370929966CAC7DAC8EAC77 |
:107E40009FAC299704C096948794779467942A9559 |
:107E5000D2F7E628F728082919292D96ECAEFDAEB1 |
:107E60000EAF1FAF2D9729968CAC9DACAEACBFACBE |
:107E7000299704C0880C991CAA1CBB1C8A95D2F7B0 |
:107E800029968CAE9DAEAEAEBFAE29973201882446 |
:107E90009924920181012070307069960CAF1DAF5A |
:107EA0002EAF3FAF69972D966CAD7DAD8EAD9FAD7A |
:107EB0002D97A40193010E9457486D962CAF3DAFBA |
:107EC0004EAF5FAF6D9769966CAD7DAD8EAD9FADDA |
:107ED00069970E9405485B016C012D966CAD7DADE4 |
:107EE0008EAD9FAD2D97A40193010E945748CB0101 |
:107EF000772766272996ECACFDAC0EAD1FAD299710 |
:107F00009801442755277B018C01E22AF32A042B90 |
:107F1000152BEA14FB040C051D05F8F46D962CAD29 |
:107F20003DAD4EAD5FAD6D9721503040404050406B |
:107F30006D962CAF3DAF4EAF5FAF6D97E20CF31C6B |
:107F4000041D151DE214F3040405150530F0EA14B0 |
:107F5000FB040C051D0508F4B7C6EA18FB080C095C |
:107F60001D09C801B701A40193010E945748590196 |
:107F70006A0169966CAD7DAD8EAD9FAD69970E942B |
:107F8000054869AF7AAF8BAF9CAFC801B701A401B8 |
:107F900093010E945748CB017727662729962CAD7D |
:107FA0003DAD4EAD5FAD299740705070262B372BFD |
:107FB000482B592B89AD9AADABADBCAD281739070D |
:107FC0004A075B07A0F40894A108B108C108D108CA |
:107FD000220D331D441D551D22153305440555053D |
:107FE00030F0281739074A075B0708F467C66D9613 |
:107FF0006CAC7DAC8EAC9FAC6D97D3019927882774 |
:1080000015012601282A392A4A2A5B2A20E030E075 |
:1080100040E050E0D5CD20E0E21620E0F20621E07D |
:10802000020720E0120708F41EC240E0E41640E018 |
:10803000F40640E0040741E0140708F0E8C520E139 |
:1080400030E040E050E080E190E03701480104C0BA |
:1080500096948794779467948A95D2F7D401C30154 |
:108060008F5C984FDC018C91280F311D411D511DF3 |
:10807000DA01C90120E2A22EB12CC12CD12CA6011B |
:108080009501281B390B4A0B5B0B09F079C22D9621 |
:108090006CAC7DAC8EAC9FAC2D97E614F704080554 |
:1080A000190560F029968CAC9DACAEACBFAC29979D |
:1080B00082149304A404B50408F47BCD81E0282E37 |
:1080C000312C412C512C20E030E040E050E078CDC4 |
:1080D000CF57DF4FE881C158D040E095CF57DF4FF1 |
:1080E000E883C158D04088249924AA24BB24CC24F6 |
:1080F000DD24EE24FF24F981C657DF4FF883CA58E8 |
:10810000D0406A80C557DF4F6882CB58D0407B8013 |
:10811000C457DF4F7882CC58D0400C81C357DF4F13 |
:108120000883CD58D0401D81C257DF4F1883CE58E9 |
:10813000D0402E81C157DF4F2883CF58D0403F8198 |
:10814000C057DF4F3883C059D0404885CF56DF4FE6 |
:108150004883C159D040082D0F1B81E0801608F0DC |
:10816000E5C1192DC557DF4F9881CB58D040191B59 |
:1081700091E0911608F0D1C1A12FA81B8A2FE1E050 |
:108180001A1708F0C8C19E2B182F2A2DC457DF4F8D |
:10819000B881CC58D0402B1BE1E0A21608F0B3C147 |
:1081A000822F891B91E0281708F0ABC1E92B282FFB |
:1081B0003B2DC357DF4FF881CD58D0403F1B91E096 |
:1081C000B31608F096C1832F8E1BE1E0381708F034 |
:1081D0008EC19E2B382F4C2DC257DF4F6880CE5852 |
:1081E000D0404619E1E0C41608F079C1842F891BFC |
:1081F00091E0481708F071C1E92B482F5D2DC15758 |
:10820000DF4F7880CF58D0405719F1E0D51608F0ED |
:108210005CC1852F8E1B91E0581708F054C1F92BD3 |
:10822000582F6E2DC057DF4F8881C059D040681B32 |
:1082300091E0E61608F03FC1862F8F1BE1E068173A |
:1082400008F037C19E2B682F7F2DCF56DF4FA881B6 |
:10825000C159D0407A1B872F891B09831A832B832E |
:108260003C834D835E836F8388871ECB882499244B |
:10827000AA24BB24CC24DD24EE24FF2409A1CE575C |
:10828000DF4F0883C258D0401AA1CD57DF4F188363 |
:10829000C358D0402BA1CC57DF4F2883C458D040BF |
:1082A0003CA1CB57DF4F3883C558D0404DA1CA57AA |
:1082B000DF4F4883C658D0405EA1C957DF4F58836F |
:1082C000C758D0408FA1C857DF4F8883C858D040C7 |
:1082D00098A5C757DF4F9883C958D040082DCE576F |
:1082E000DF4FA881C258D0400A1B81E0801608F0F9 |
:1082F000DEC0192DCD57DF4FB881C358D0401B1BAE |
:1083000091E0911608F0CAC0E12FE81B8E2FE1E042 |
:10831000181708F0C1C09E2B182F2A2DCC57DF4FFD |
:10832000F881C458D0402F1BE1E0A21608F020C10C |
:10833000822F891B91E0281708F018C1E92B282FFC |
:108340003B2DCB57DF4F6880C558D040361991E0A0 |
:10835000B31608F003C1832F8E1BE1E0381708F035 |
:10836000FBC09E2B382F4C2DCA57DF4F7880C65844 |
:10837000D0404719E1E0C41608F0E6C0842F891BFD |
:1083800091E0481708F0DEC0E92B482F5D2DC95752 |
:10839000DF4F8881C758D040581BF1E0D51608F050 |
:1083A000C9C0852F8E1B91E0581708F0C1C0F92B6A |
:1083B000582F6E2DC857DF4F9881C858D040691B81 |
:1083C00091E0E61608F060C0862F8F1BE1E0681789 |
:1083D00008F058C09E2B682F7F2DC757DF4FA8810C |
:1083E000C958D0407A1B872F891B09A31AA32BA336 |
:1083F0003CA34DA35EA36FA388A7BFEFCF57DF4F6A |
:10840000B883C158D0404ACA20E0221620E0320684 |
:1084100020E0420621E0520608F007C420E130E0E7 |
:1084200040E050E080E190E0B2CA61E070E080E0BE |
:1084300090E020E030E040E050E00E945748190111 |
:108440002A018CCA20E0221620E0320620E04206F3 |
:1084500021E0520608F0E2C320E130E040E050E0C5 |
:1084600080E190E0AFCC3FEFE316F1040105110588 |
:1084700011F008F0B6C320E030E040E050E080E0CA |
:1084800090E0E3CDE0E0A6CF90E0862F8F1BE1E007 |
:10849000681708F49FCFF6CFE0E03DCF90E0E12FE2 |
:1084A000E81B8E2FE1E0181708F435CFF5CF80E0F8 |
:1084B00020CFE0E0C7CE90E0862F8F1BE1E0681769 |
:1084C00008F4C0CEF6CF90E0AACEF0E0852F8E1B48 |
:1084D00091E0581708F4A3CEF6CF90E08DCEE0E0FF |
:1084E000842F891B91E0481708F486CEF6CFE0E090 |
:1084F00070CE90E0832F8E1BE1E0381708F469CE30 |
:10850000F6CF90E053CEE0E0822F891B91E0281750 |
:1085100008F44CCEF6CFE0E036CE90E0A12FA81BB9 |
:108520008A2FE1E01A1708F42ECEF5CF80E019CE9D |
:1085300090E03DCFF0E0852F8E1B91E0581708F4B6 |
:1085400036CFF6CF90E020CFE0E0842F891B91E07A |
:10855000481708F419CFF6CFE0E003CF90E0832F5F |
:108560008E1BE1E0381708F4FCCEF6CF90E0E6CEA3 |
:10857000E0E0822F891B91E0281708F4DFCEF6CFC8 |
:1085800021963FAF2EAF2197A21AB30AC40AD50A8B |
:10859000A60195010FAC04C0EE0CFF1C001F111FBB |
:1085A0000A94D2F7D201C10104C0B695A795979558 |
:1085B0008795AA94D2F7E82AF92A0A2B1B2B25962D |
:1085C000ECAEFDAE0EAF1FAF25970FAC04C0220C72 |
:1085D000331C441C551C0A94D2F729A63AA64BA674 |
:1085E0005CA62D96ACACBDACCEACDFAC2D97022E0C |
:1085F00004C0D694C794B794A7940A94D2F72D9642 |
:10860000ECACFDAC0EAD1FAD2D970FAC04C0EE0C65 |
:10861000FF1C001F111F0A94D2F729968CAD9DAD47 |
:10862000AEADBFAD299704C0B695A7959795879530 |
:108630002A95D2F7E82AF92A0A2B1B2BEDAAFEAAC3 |
:108640000FAB18AF25960CAD1DAD2EAD3FAD2597E8 |
:10865000790100271127E596ECAEFDAE0EAF1FAFF6 |
:10866000E59725962CAD3DAD4EAD5FAD259740709D |
:108670005070E9962CAF3DAF4EAF5FAFE997C601A2 |
:10868000B501A80197010E945748ED962CAF3DAF68 |
:108690004EAF5FAFED97E9966CAD7DAD8EAD9FAD02 |
:1086A000E9970E9405483B014C01C601B501A801AC |
:1086B00097010E945748CB0177276627ADA8BEA82F |
:1086C000CFA8D8AC9601442755277B018C01E22A1C |
:1086D000F32A042B152BE614F7040805190500F5F9 |
:1086E000ED962CAD3DAD4EAD5FADED9721503040D8 |
:1086F00040405040ED962CAF3DAF4EAF5FAFED9791 |
:1087000025968CAD9DADAEADBFAD2597E80EF91E9B |
:108710000A1F1B1FE816F9060A071B0708F0B2C25A |
:10872000E618F70808091909C801B701E5962CAD44 |
:108730003DAD4EAD5FADE5970E94574819012A0146 |
:10874000E9966CAD7DAD8EAD9FADE9970E94054871 |
:108750003B014C01C801B701E5962CAD3DAD4EADD6 |
:108760005FADE5970E945748CB01772766272DA973 |
:108770003EA94FA958AD407050705B016C01A22A10 |
:10878000B32AC42AD52AA614B704C804D904A8F465 |
:10879000089421083108410851082596ECACFDAC3D |
:1087A0000EAD1FAD2597AE0CBF1CC01ED11EAE1462 |
:1087B000BF04C006D10608F055C2A618B708C808FD |
:1087C000D908A9AABAAACBAADCAAED960CAD1DAD10 |
:1087D0002EAD3FADED97D80199278827282A392A51 |
:1087E0004A2A5B2A61962CAE3DAE4EAE5FAE6197D3 |
:1087F000820171012FEF3FEF40E050E0E222F322CF |
:1088000004231523120144245524A9A4BAA4CBA4FB |
:10881000DCA4A222B322C422D52229A53AA54BA5C5 |
:108820005CA53A0188249924C801B701A6019501E5 |
:108830000E940548C358DF4F688379838A839B83EE |
:10884000CD57D040C801B701A40193010E9405484B |
:108850007B018C01C201B101A60195010E9405486E |
:108860005B016C01C201B101A40193010E940548A2 |
:108870009B01AC01EA0CFB1C0C1D1D1DC358DF4FF6 |
:10888000688079808A809B80CD57D040C401AA2718 |
:10889000BB27E80EF91E0A1F1B1FEA14FB040C0578 |
:1088A0001D0520F4205030404F4F5F4FC801AA27CC |
:1088B000BB27280F391F4A1F5B1F89A89AA8ABA89E |
:1088C000BCA882169306A406B50608F479C18216E0 |
:1088D0009306A406B50609F446C161962CAC3DACDE |
:1088E0004EAC5FAC619720E030E040E050E068C9FA |
:1088F0007EAE6DAE0DAC04C0220C331C441C551C66 |
:108900000A94D2F72619370948095909DA01C90129 |
:108910002D96ECACFDAC0EAD1FAD2D9704C0169599 |
:108920000795F794E7942A95D2F72D962CAD3DAD97 |
:108930004EAD5FAD2D970DAC04C0220F331F441F09 |
:10894000551F0A94D2F729966CAC7DAC8EAC9FACC7 |
:10895000299704C096948794779467948A95D2F760 |
:1089600026293729482959292DA73EA74FA758ABB3 |
:108970004201AA24BB24A1968CAE9DAEAEAEBFAE82 |
:10898000A197A201910140705070A5962CAF3DAF08 |
:108990004EAF5FAFA597C801B701A50194010E9432 |
:1089A0005748A9962CAF3DAF4EAF5FAFA997A5969C |
:1089B0006CAD7DAD8EAD9FADA5970E9405485B0166 |
:1089C0006C01C801B701A1962CAD3DAD4EAD5FADB8 |
:1089D000A1970E945748CB01772766276DA47EA4F4 |
:1089E0008FA498A89401442755277B018C01E22A83 |
:1089F000F32A042B152BEA14FB040C051D05D0F4F7 |
:108A0000A9962CAD3DAD4EAD5FADA997215030403C |
:108A100040405040A9962CAF3DAF4EAF5FAFA997F5 |
:108A2000E20CF31C041D151DE214F30404051505E6 |
:108A300008F003C1EA18FB080C091D09C801B701B9 |
:108A4000A1962CAD3DAD4EAD5FADA1970E945748AC |
:108A5000AD962CAF3DAF4EAF5FAFAD97A5966CAD69 |
:108A60007DAD8EAD9FADA5970E9405483B014C01A1 |
:108A7000C801B701A1962CAD3DAD4EAD5FADA1973C |
:108A80000E945748CB01772766272DA53EA54FA505 |
:108A900058A9407050705B016C01A22AB32AC42A05 |
:108AA000D52AA614B704C804D90450F5AD968CADE8 |
:108AB0009DADAEADBFADAD970197A109B109AD9622 |
:108AC0008CAF9DAFAEAFBFAFAD97A20CB31CC41CB3 |
:108AD000D51CA214B304C404D50490F0A614B704A2 |
:108AE000C804D90468F40197A109B109AD968CAF07 |
:108AF0009DAFAEAFBFAFAD97A20CB31CC41CD51CCD |
:108B00002996ECACFDAC0EAD1FAD29970DAC04C0A1 |
:108B1000EE0CFF1C001F111F0A94D2F72996ECAE31 |
:108B2000FDAE0EAF1FAF2997A618B708C808D90821 |
:108B3000A9960CAD1DAD2EAD3FADA997D8019927D3 |
:108B40008827AD962CAD3DAD4EAD5FADAD97282BD2 |
:108B5000392B4A2B5B2B65962CAF3DAF4EAF5FAFE9 |
:108B600065970C940F3D29968CAD9DADAEADBFAD14 |
:108B700029970FAC04C0880F991FAA1FBB1F0A9426 |
:108B8000D2F7A70133272227C358DF4FE880F980A7 |
:108B90000A811B81CD57D0406FEFA62E6FEFB62E06 |
:108BA000C12CD12CEA20FB200C211D212E0D3F1DB4 |
:108BB000401F511F82179307A407B50708F08DCEF9 |
:108BC00061962CAC3DAC4EAC5FAC6197089421082B |
:108BD00031084108510820E030E040E050E00C94BA |
:108BE000E03D28E030E040E050E088E090E02DCA31 |
:108BF00028E030E040E050E088E090E0E3C828E082 |
:108C000030E040E050E088E090E00C94C73C28E180 |
:108C100030E040E050E088E190E017CA28E130E021 |
:108C200040E050E088E190E0CDC828E130E040E04D |
:108C300050E088E190E00C94C73CEA14FB040C057A |
:108C40001D0508F0F7CE2150304040405040A99615 |
:108C50002CAF3DAF4EAF5FAFA997E20CF31C041DE4 |
:108C6000151DE8CEA614B704C804D90408F0A5CD94 |
:108C700008942108310841085108AE0CBF1CC01EE1 |
:108C8000D11E9BCDE614F7040805190508F048CD60 |
:108C90002150304040405040ED962CAF3DAF4EAF9C |
:108CA0005FAFED97E80EF91E0A1F1B1F39CD089420 |
:108CB000A108B108C108D1080C94B73D0894A108D7 |
:108CC000B108C108D10893C92150304040405040FC |
:108CD0006D962CAF3DAF4EAF5FAF6D97E20CF31CBE |
:108CE000041D151D3AC92150304040405040E196C6 |
:108CF0002CAF3DAF4EAF5FAFE197E20CF31C041D0C |
:108D0000151D0C946A3D222D332D442D552D662DB5 |
:108D1000772D882D992DE2E1C756DF4F0C94B0488E |
:108D2000FC014150504030F001900616D1F73197C8 |
:108D3000CF0108958827992708955058192EEFD00C |
:108D400001D0D2C0BA176207730784079507B1F143 |
:108D500088F40EF410940B2EBA2FA02D062E622F3D |
:108D6000202D072E732F302D082E842F402D092EF5 |
:108D7000952F502DFF275523B9F0591B49F0573E29 |
:108D800098F0469537952795A795F0405395C9F7E4 |
:108D900076F0BA0F621F731F841F30F487957795A2 |
:108DA0006795B795F040939517FA0F2E0895BF1B5E |
:108DB000BB27BA0B620B730B840BF6CFDEF6DBC05E |
:108DC000AED001D091C0552359F0992369F09F5737 |
:108DD0005F57951B33F442F4903811F4915805C055 |
:108DE0009BC091589F3F09F4C6C0BB27112462174E |
:108DF0007307840730F4660F771F881FBB1F9150DD |
:108E000098F311D00F920FD00F920DD0A0E8261733 |
:108E1000370748071B0609F0A048BA2F602D7F913D |
:108E20008F9100240895A0E8002462177307840737 |
:108E3000B10528F0621B730B840BB1090A2A660F77 |
:108E4000771F881FBB1FA69581F7089597FB73D0E6 |
:108E50009F3738F0FEE9F91B982F872F762F6B2F5D |
:108E600005C086C09695879577956795F150D0F7A0 |
:108E70003EF490958095709561957F4F8F4F9F4FF1 |
:108E80000895E89403C097FB0EF4F3DFB62F672F25 |
:108E9000782F892F9EE9002427C00ED05EF004C0F1 |
:108EA0000BD026F001C008D019F020F48FEF089500 |
:108EB00080E0089581E0089597FB092E052600F8CB |
:108EC000689430D0E89407FC07C0621773078407E2 |
:108ED000950721F008F400940794989408959A95C2 |
:108EE000BB0F661F771F881F11249923A1F08823C9 |
:108EF000B2F79F3F59F0BB0F48F421F4002011F462 |
:108F000060FF04C06F5F7F4F8F4F9F4F881F979503 |
:108F1000879597F908952CC09FEF80EC0895052E52 |
:108F2000092607FA440F551F5F3F79F0AA27A517B6 |
:108F300008F051E04795880F991F9F3F31F0BB27FC |
:108F4000B91708F091E0879508959F919F9111249A |
:108F5000E3CF97FB880F991F9F3F31F0BB27B917CD |
:108F600008F091E0879508959F919F911124D4CFA7 |
:108F700066277727882799270895D1DF01D0B4CFB6 |
:108F8000992339F0552329F09F575F57950F13F414 |
:108F90009AF1F1CF91589F3FE1F3629FA12D0F927B |
:108FA000BB27639FA00DB11DEE27729FA00DB11DC1 |
:108FB000EE1FAF93AA27649FB00DE11D739FB00D04 |
:108FC000E11DAA1F6627829FB00DE11DA61F552730 |
:108FD000749FE00DA11D551F839FE00DA11D561F1D |
:108FE000849FA00D511D852F7A2F6E2F1F900F90FB |
:108FF00088231AF4939539F48FCF000C111CBB1FF2 |
:10900000661F771F881F01280895629FD001739FF4 |
:10901000F001829FE00DF11D649FE00DF11D929F14 |
:10902000F00D839FF00D749FF00D659FF00D992753 |
:10903000729FB00DE11DF91F639FB00DE11DF91F77 |
:10904000BD01CF0111240895991B79E004C0991F37 |
:10905000961708F0961B881F7A95C9F78095089592 |
:10906000AA1BBB1B51E107C0AA1FBB1FA617B7074E |
:1090700010F0A61BB70B881F991F5A95A9F780956A |
:109080009095BC01CD01089597FB092E07260AD0C3 |
:1090900077FD04D0E5DF06D000201AF470956195C5 |
:1090A0007F4F0895F6F7909581959F4F0895A1E21F |
:1090B0001A2EAA1BBB1BFD010DC0AA1FBB1FEE1F52 |
:1090C000FF1FA217B307E407F50720F0A21BB30B9D |
:1090D000E40BF50B661F771F881F991F1A9469F719 |
:1090E00060957095809590959B01AC01BD01CF0175 |
:1090F000089597FB092E05260ED057FD04D0D7DF23 |
:109100000AD0001C38F450954095309521953F4F7A |
:109110004F4F5F4F0895F6F7909580957095619544 |
:109120007F4F8F4F9F4F08952F923F924F925F92A4 |
:109130006F927F928F929F92AF92BF92CF92DF9267 |
:10914000EF92FF920F931F93CF93DF93CDB7DEB7CC |
:10915000CA1BDB0B0FB6F894DEBF0FBECDBF099460 |
:109160002A88398848885F846E847D848C849B84B7 |
:10917000AA84B984C884DF80EE80FD800C811B81C5 |
:10918000AA81B981CE0FD11D0FB6F894DEBF0FBEF4 |
:10919000CDBFED010895EE0FFF1F0590F491E02D76 |
:1091A0000994F999FECFB2BDA1BDF89A119600B409 |
:1091B0000895F999FECFB2BDA1BD00BC11960FB6BE |
:0C91C000F894FA9AF99A0FBE0895FFCFB8 |
:1091CC000A01642003FFFF0A016400007D0000FF18 |
:1091DC00030102030405060708090A48616C6C6F59 |
:1091EC002057656C740000000000000000000000B7 |
:1091FC000000000000000000000000000000000063 |
:10920C000000000000000000000000000000000052 |
:10921C000000000000000000000000000000000042 |
:10922C0000000000000000000000000B014B616D0D |
:10923C00657261000053706F72740000640000006E |
:10924C00803F17B7D13830FB103A409696020A642B |
:10925C0046000011002200340045005700680079D8 |
:10926C00008B009C00AD00BE00CF00E000F10002BE |
:10927C000113012401350145015601660176018671 |
:10928C00019601A601B601C501D501E401F4010363 |
:10929C0002110220022F023D024B02590267027595 |
:1092AC0002820290029D02AA02B602C302CF02DB26 |
:1092BC0002E702F202FE02090314031E0329033320 |
:1092CC00033D0346035003590362036A0372037B95 |
:1092DC000382038A03910398039F03A503AB03B195 |
:1092EC0003B703BC03C103C503CA03CE03D203D522 |
:1092FC0003D803DB03DE03E003E203E403E503E648 |
:10930C0003E703E703E803E703E703E603E503E406 |
:10931C0003E203E003DE03DB03D803D503D203CE61 |
:10932C0003CA03C503C103BC03B703B103AB03A555 |
:10933C00039F03980391038A0382037B0372036ADE |
:10934C000362035903500346033D03330329031EF1 |
:10935C000314030903FE02F202E702DB02CF02C38D |
:10936C0002B602AA029D029002820275026702599D |
:10937C00024B023D022F02200211020302F401E40F |
:10938C0001D501C501B601A60196018601760166DB |
:10939C0001560145013501240113010201F100E0E0 |
:1093AC0000CF00BE00AD009C008B00790068005718 |
:1093BC000045003400220011000000EFFFDEFFCC5E |
:1093CC00FFBBFFA9FF98FF87FF75FF64FF53FF42A8 |
:1093DC00FF31FF20FF0FFFFEFEEDFEDCFECBFEBBE0 |
:1093EC00FEAAFE9AFE8AFE7AFE6AFE5AFE4AFE3BF0 |
:1093FC00FE2BFE1CFE0CFEFDFDEFFDE0FDD1FDC3C2 |
:10940C00FDB5FDA7FD99FD8BFD7EFD70FD63FD5641 |
:10941C00FD4AFD3DFD31FD25FD19FD0EFD02FDF75B |
:10942C00FCECFCE2FCD7FCCDFCC3FCBAFCB0FCA70A |
:10943C00FC9EFC96FC8EFC85FC7EFC76FC6FFC682E |
:10944C00FC61FC5BFC55FC4FFC49FC44FC3FFC3BC9 |
:10945C00FC36FC32FC2EFC2BFC28FC25FC22FC20D0 |
:10946C00FC1EFC1CFC1BFC1AFC19FC19FC18FC193E |
:10947C00FC19FC1AFC1BFC1CFC1EFC20FC22FC2511 |
:10948C00FC28FC2BFC2EFC32FC36FC3BFC3FFC4449 |
:10949C00FC49FC4FFC55FC5BFC61FC68FC6FFC76EA |
:1094AC00FC7EFC85FC8EFC96FC9EFCA7FCB0FCBAFA |
:1094BC00FCC3FCCDFCD7FCE2FCECFCF7FC02FD0E83 |
:1094CC00FD19FD25FD31FD3DFD4AFD56FD63FD7089 |
:1094DC00FD7EFD8BFD99FDA7FDB5FDC3FDD1FDE026 |
:1094EC00FDEFFDFDFD0CFE1CFE2BFE3BFE4AFE5A65 |
:1094FC00FE6AFE7AFE8AFE9AFEAAFEBBFECBFEDC5C |
:10950C00FEEDFEFEFE0FFF20FF31FF42FF53FF6416 |
:10951C00FF75FF87FF98FFA9FFBBFFCCFFDEFFEFB6 |
:10952C00FFE803E703E703E603E503E403E203E0F4 |
:10953C0003DE03DB03D803D503D203CE03CA03C572 |
:10954C0003C103BC03B703B103AB03A5039F03988B |
:10955C000391038A0382037B0372036A0362035938 |
:10956C0003500346033D03330329031E031403096D |
:10957C0003FE02F202E702DB02CF02C302B602AA2A |
:10958C00029D02900282027502670259024B023D53 |
:10959C00022F02200211020302F401E401D501C5DD |
:1095AC0001B601A6019601860176016601560145B8 |
:1095BC00013501240113010201F100E000CF00BECE |
:1095CC0000AD009C008B007900680057004500340A |
:1095DC0000220011000000EFFFDEFFCCFFBBFFA953 |
:1095EC00FF98FF87FF75FF64FF53FF42FF31FF2099 |
:1095FC00FF0FFFFEFEEDFEDCFECBFEBBFEAAFE9ACD |
:10960C00FE8AFE7AFE6AFE5AFE4AFE3BFE2BFE1CCA |
:10961C00FE0CFEFDFDEFFDE0FDD1FDC3FDB5FDA78C |
:10962C00FD99FD8BFD7EFD70FD63FD56FD4AFD3DF4 |
:10963C00FD31FD25FD19FD0EFD02FDF7FCECFCE2F4 |
:10964C00FCD7FCCDFCC3FCBAFCB0FCA7FC9EFC9682 |
:10965C00FC8EFC85FC7EFC76FC6FFC68FC61FC5B84 |
:10966C00FC55FC4FFC49FC44FC3FFC3BFC36FC32FB |
:10967C00FC2EFC2BFC28FC25FC22FC20FC1EFC1CDC |
:10968C00FC1BFC1AFC19FC19FC18FC19FC19FC1A23 |
:10969C00FC1BFC1CFC1EFC20FC22FC25FC28FC2BCF |
:1096AC00FC2EFC32FC36FC3BFC3FFC44FC49FC4FE2 |
:1096BC00FC55FC5BFC61FC68FC6FFC76FC7EFC855D |
:1096CC00FC8EFC96FC9EFCA7FCB0FCBAFCC3FCCD4B |
:1096DC00FCD7FCE2FCECFCF7FC02FD0EFD19FD25B1 |
:1096EC00FD31FD3DFD4AFD56FD63FD70FD7EFD8B9C |
:1096FC00FD99FDA7FDB5FDC3FDD1FDE0FDEFFDFD21 |
:10970C00FD0CFE1CFE2BFE3BFE4AFE5AFE6AFE7A48 |
:10971C00FE8AFE9AFEAAFEBBFECBFEDCFEEDFEFE32 |
:10972C00FE0FFF20FF31FF42FF53FF64FF75FF87E1 |
:10973C00FF98FFA9FFBBFFCCFFDEFFEFFF0000117E |
:10974C00002200340045005700680079008B009C13 |
:10975C0000AD00BE00CF00E000F1000201130124B7 |
:10976C00013501450156016601760186019601A677 |
:10977C0001B601C501D501E401F401030211022077 |
:10978C00022F023D024B02590267027502820290BF |
:10979C00029D02AA02B602C302CF02DB02E702F26A |
:1097AC0002FE02090314031E03290333033D03467F |
:1097BC00035003590362036A0372037B0382038A17 |
:1097CC0003910398039F03A503AB03B103B703BC39 |
:1097DC0003C103C503CA03CE03D203D503D803DBED |
:1097EC0003DE03E003E203E403E503E603E703E738 |
:1097FC00030001020203030303040404040404042D |
:10980C0004050505050505050505050505050505FD |
:10981C0005060606060606060606060606060606DD |
:10982C0006060606060606060606060606060606CC |
:10983C0006070707070707070707070707070707AD |
:10984C00070707070707070707070707070707079C |
:10985C00070707070707070707070707070707078C |
:10986C00070707070707070707070707070707077C |
:10987C00070808080808080808080808080808085D |
:10988C00080808080808080808080808080808084C |
:10989C00080808080808080808080808080808083C |
:1098AC00080808080808080808080808080808082C |
:1098BC00080808080808080808080808080808081C |
:1098CC00080808080808080808080808080808080C |
:1098DC0008080808080808080808080808080808FC |
:1098EC0008080808080808080808080808080808EC |
:0298FC00080062 |
:00000001FF |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/GPS.c |
---|
0,0 → 1,300 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 10.2007 by Jochen Kromayer |
// + es handelt sich um eine Beta-Software, die zu nichtkommerziellen Zwecken frei veröffentlich und weitergegeben werden darf. Für evtl. |
// + Personen- und/der Sachschäden ist jegliche Haftung ausgeschlossen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
#include "math.h" |
//Sinusfunktion von 0° bis 359°. Ergebnis wurde mit 1000 multipliziert, damit als Definition platzsparend int |
//verwendet werden kann. d.h., es muss also in der späteren Berechnung noch mit 0,001 multipliziert werden //(090907Kr) |
const int c_sin[] = {0,17,34,52,69,87,104,121,139,156,173,190, |
207,224,241,258,275,292,309,325,342,358,374,390,406,422,438,453,469,484,500,515,529,544,559,573,587,601,615,629, |
642,656,669,682,694,707,719,731,743,754,766,777,788,798,809,819,829,838,848,857,866,874,882,891,898,906,913,920, |
927,933,939,945,951,956,961,965,970,974,978,981,984,987,990,992,994,996,997,998,999,999,1000,999,999,998,997,996, |
994,992,990,987,984,981,978,974,970,965,961,956,951,945,939,933,927,920,913,906,898,891,882,874,866,857,848,838, |
829,819,809,798,788,777,766,754,743,731,719,707,694,682,669,656,642,629,615,601,587,573,559,544,529,515,500,484, |
469,453,438,422,406,390,374,358,342,325,309,292,275,258,241,224,207,190,173,156,139,121,104,87,69,52,34,17,0,-17, |
-34,-52,-69,-87,-104,-121,-139,-156,-173,-190,-207,-224,-241,-258,-275,-292,-309,-325,-342,-358,-374,-390,-406, |
-422,-438,-453,-469,-484,-500,-515,-529,-544,-559,-573,-587,-601,-615,-629,-642,-656,-669,-682,-694,-707,-719, |
-731,-743,-754,-766,-777,-788,-798,-809,-819,-829,-838,-848,-857,-866,-874,-882,-891,-898,-906,-913,-920,-927, |
-933,-939,-945,-951,-956,-961,-965,-970,-974,-978,-981,-984,-987,-990,-992,-994,-996,-997,-998,-999,-999,-1000, |
-999,-999,-998,-997,-996,-994,-992,-990,-987,-984,-981,-978,-974,-970,-965,-961,-956,-951,-945,-939,-933,-927, |
-920,-913,-906,-898,-891,-882,-874,-866,-857,-848,-838,-829,-819,-809,-798,-788,-777,-766,-754,-743,-731,-719, |
-707,-694,-682,-669,-656,-642,-629,-615,-601,-587,-573,-559,-544,-529,-515,-500,-484,-469,-453,-438,-422,-406, |
-390,-374,-358,-342,-325,-309,-292,-275,-258,-241,-224,-207,-190,-173,-156,-139,-121,-104,-87,-69,-52,-34,-17}; |
//Cosinusfunktion von 0° bis 359°. Ergebnis wurde mit 1000 multipliziert, damit als Definition platzsparend int |
//verwendet werden kann. D.h., es muss also in der späteren Berechnung noch mit 0,001 multipliziert werden //(090907Kr) |
const int c_cos[] = {1000,999,999,998,997,996,994,992,990,987,984,981, |
978,974,970,965,961,956,951,945,939,933,927,920,913,906,898,891,882,874,866,857,848,838,829,819,809,798,788,777, |
766,754,743,731,719,707,694,682,669,656,642,629,615,601,587,573,559,544,529,515,500,484,469,453,438,422,406,390, |
374,358,342,325,309,292,275,258,241,224,207,190,173,156,139,121,104,87,69,52,34,17,0,-17,-34,-52,-69,-87,-104, |
-121,-139,-156,-173,-190,-207,-224,-241,-258,-275,-292,-309,-325,-342,-358,-374,-390,-406,-422,-438,-453,-469, |
-484,-500,-515,-529,-544,-559,-573,-587,-601,-615,-629,-642,-656,-669,-682,-694,-707,-719,-731,-743,-754,-766, |
-777,-788,-798,-809,-819,-829,-838,-848,-857,-866,-874,-882,-891,-898,-906,-913,-920,-927,-933,-939,-945,-951, |
-956,-961,-965,-970,-974,-978,-981,-984,-987,-990,-992,-994,-996,-997,-998,-999,-999,-1000,-999,-999,-998,-997, |
-996,-994,-992,-990,-987,-984,-981,-978,-974,-970,-965,-961,-956,-951,-945,-939,-933,-927,-920,-913,-906,-898, |
-891,-882,-874,-866,-857,-848,-838,-829,-819,-809,-798,-788,-777,-766,-754,-743,-731,-719,-707,-694,-682,-669, |
-656,-642,-629,-615,-601,-587,-573,-559,-544,-529,-515,-500,-484,-469,-453,-438,-422,-406,-390,-374,-358,-342, |
-325,-309,-292,-275,-258,-241,-224,-207,-190,-173,-156,-139,-121,-104,-87,-69,-52,-34,-17,0,17,34,52,69,87, |
104,121,139,156,173,190,207,224,241,258,275,292,309,325,342,358,374,390,406,422,438,453,469,484,500,515,529,544, |
559,573,587,601,615,629,642,656,669,682,694,707,719,731,743,754,766,777,788,798,809,819,829,838,848,857,866,874, |
882,891,898,906,913,920,927,933,939,945,951,956,961,965,970,974,978,981,984,987,990,992,994,996,997,998,999,999}; |
long Soll_Position_North = 0; |
long Soll_Position_East = 0; |
long GPS_Positionsabweichung_North = 0; |
long GPS_Positionsabweichung_East = 0; |
long GPS_Geschwindigkeit_North = 0; |
long GPS_Geschwindigkeit_East = 0; |
long P_Einfluss_North = 0; |
long D_Einfluss_North = 0; |
long P_Einfluss_East = 0; |
long D_Einfluss_East = 0; |
signed int GPS_North = 0; |
signed int GPS_East = 0; |
signed int GPS_Nick = 0; |
signed int GPS_Roll = 0; |
volatile char gethome = 0; //Flag ob GPS_Home_Position gelernt ist //(280807Kr) |
long GPS_Home_North = 0; |
long GPS_Home_East = 0; |
unsigned char blinkcount_LED2 = 0; //Hilfszähler für die blinkende LED (010907Kr) |
//**************************** MIRCOS DEFINITIONSANFANG FÜR DIE FILTERUNG |
// Filterung der GPS Messwerte vom Ublox-Empfänger. Es wird der gleitende Durchschnitt aus n Messwerten gebildet |
#define MITTELWERTZAHL 8 // Anzahl der Messwerte fuer gleitenden Mittelwert |
volatile char NeuerMittelwert = 0; //Flag ob ein neuer Mittelwert vorliegt, der mit 4 Hz berechnet wird, da nur dann neue Messwerte vom GPS vorliegen |
volatile unsigned char FilterPos = 0; |
volatile long NORTH_MITTEL = 0; |
volatile long EAST_MITTEL = 0; |
volatile long long NORTH_LONG_LONG = 0; |
volatile long long EAST_LONG_LONG = 0; |
volatile int filterfilled = 0; |
typedef struct { |
long NORTH[MITTELWERTZAHL]; |
} FILTER_NORTH; // Filterdefinition für die Positions-Nordwerte aus dem GPS-Empfänger |
typedef struct { |
long EAST[MITTELWERTZAHL]; |
} FILTER_EAST; // Filterdefinition für die Positions-Ostwerte aus dem GPS-Empfänger |
FILTER_NORTH filter_north; |
FILTER_EAST filter_east; |
//**************************** MIRCOS DEFINITIONSENDE FÜR DIE FILTERUNG |
void gps_main(void) |
{ |
//**************************** MIRCOS FILTERUNG ANFANG |
// if(actualPos.GPSFix == 3 && actualPos.newData == 1) //bilde neuen Positionsmittelwert, wenn 3D-Fix und neue GPS-Daten vorliegen |
if(actualPos.GPSFix == 3) // hier auskommentieren, wenn dauernd (also nicht nur alle 250ms) die GPS-Berechnung durchgeführt werden soll |
{ |
filter_north.NORTH[FilterPos] = actualPos.northing; |
filter_east.EAST[FilterPos] = actualPos.easting; |
FilterPos++; |
if (FilterPos==MITTELWERTZAHL) FilterPos=0; |
if (filterfilled<MITTELWERTZAHL) filterfilled++; |
NORTH_LONG_LONG = 0; |
EAST_LONG_LONG = 0; |
for (int i=0; i<filterfilled; i++) |
{ |
NORTH_LONG_LONG += filter_north.NORTH[i]; |
EAST_LONG_LONG += filter_east.EAST[i]; |
} |
NORTH_LONG_LONG /= filterfilled; |
EAST_LONG_LONG /= filterfilled; |
NORTH_MITTEL = NORTH_LONG_LONG; |
EAST_MITTEL = EAST_LONG_LONG; |
NeuerMittelwert = 1; |
//actualPos.newData = 0; // hier auskommentieren, wenn dauernd (also nicht nur alle 250ms) die GPS-Berechnung durchgeführt werden soll |
} |
//******************************* MIRCOS FILTERUNG ENDE |
//wenn kein 3D-Fix vorhanden, über das Poti jedoch irgendeine GPS Funktion aktiv ist, werden die GPS-Steuerbefehle |
//auf Null gesetzt, um unkontrolliertes Wegfliegen durch das GPS zu verhindern. Dadurch wird abgesichert |
//(auch im laufenden Flug), dass bei einem Verlust der GPS-Verbindung GPS deaktivert wird |
if (actualPos.GPSFix < 3 && Poti3 > 70) |
{ |
GPS_Nick = 0; |
GPS_Roll = 0; |
LED2_OFF; |
beeptime = 50; |
} |
// speichert die GPS_Home_Position beim 3D-Fix, MotorEINschalten und wenn noch nicht zu weit weggeflogen wurde |
// (modell_fliegt_gps < 2000) einmalig ab. Die Flugzeitabfrage sichert ab, dass bei einem Losfliegen ohne 3D-Fix die Home_Positinen |
// irgendwann später dort gelernt werden, wo dann zu ersten mal ein 3D-Fix vorhanden ist |
if (actualPos.GPSFix == 3 && MotorenEin == 1 && gethome == 0 && modell_fliegt_gps < 2000) |
{ |
GPS_Home_North = NORTH_MITTEL; |
GPS_Home_East = EAST_MITTEL; |
// Muss hier auch eingelernt werden, damit falls das Poti3 beim Motorenstarten in |
// Mittelstellung sein sollte, trotzdem schon eine Sollposition vorliegt. Andernfalls würde |
// GPS_Nick und _Roll maximal werden bis zum ersten Mal Stick_Nick und _Roll gesteuert würde |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
beeptime = 50; |
gethome = 1; |
} |
//löscht die GPS_Home_Position beim MotorAUSschalten wieder und resetet das Flag gethome //(280807Kr) |
if (MotorenEin == 0) |
{ |
GPS_Home_North = 0; |
GPS_Home_East = 0; |
gethome = 0; |
modell_fliegt_gps = 0; |
} |
// wenn Schalter ausgeschaltet, dann wird die LED2 ausgeschaltet und das GPS Steuerkommando gelöscht |
if(Poti3 < 70) |
{ |
// Sollpositionen müssen auch hier beschrieben werden, damit ausgeschlossen ist, dass falls gelandet wird und die GPS-Funktion |
// über Poti3 deaktivert und anschließend wieder aktiviert wird keine Soll-Positionen vorliegen. |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
GPS_Nick = 0; |
GPS_Roll = 0; |
LED2_OFF; |
} |
// wenn 3D-Fix, Schalter im mittleren Bereich und vom Pilot gesteuert wird, wird ständig neue GPS-Sollposition eingelernt |
if(actualPos.GPSFix == 3 && Poti3 > 70 && Poti3 < 150 && (StickNick > 12 || StickNick < -12 || StickRoll > 12 || StickRoll < -12)) |
{ |
GPS_Nick = 0; //wird genullt, damit das letzte GPS Kommando nicht ständig gegen den Piloten ansteuert |
GPS_Roll = 0; //wird genullt, damit das letzte GPS Kommando nicht ständig gegen den Piloten ansteuert |
Soll_Position_North = NORTH_MITTEL; // Soll-Position wird geschrieben |
Soll_Position_East = EAST_MITTEL; // Soll-Position wird geschrieben |
//++++++++++++++++++++++++++++++++++++ |
//Sorgt lediglich dafür, dass die LED2 langsam blinkt. Dauer ist durch die "> x" Abfrage festgelegt |
//++++++++++++++++++++++++++++++++++++ |
if(blinkcount_LED2 >= 200) // maximal erlaubt 255 wegen unsigned char |
{ |
LED2_FLASH; |
blinkcount_LED2 = 0; |
} |
blinkcount_LED2++; |
//++++++++++++++++++++++++++++++++++++ |
} |
// wenn 3D-Fix, Schalter im mittleren Bereich (oder höher), neuer Mittelwert vorhanden, wenigstens einmal Sollposition gelernt und der Pilot nicht selbst steuert wird eine GPS-Funktion aktiviert |
if (actualPos.GPSFix == 3 && Poti3 > 70 && NeuerMittelwert == 1 && Soll_Position_North != 0 && Soll_Position_East != 0 && StickNick <= 12 && StickNick >= -12 && StickRoll <= 12 && StickRoll >= -12) |
{ |
//Berechnung der GPS-Positionsabweichung je nach aktivierter GPS-Funktion (GPS_HOLD oder HOMING) |
//DYNAMISCHES GPS-HOLD, wenn Schalter noch in Mittelstellung ist wird die zuletzt gelernte Soll_Position angeflogen |
if(Poti3 < 150) |
{ |
GPS_Positionsabweichung_North = (Soll_Position_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (Soll_Position_East - EAST_MITTEL); |
LED2_ON; |
} |
//andernfalls, wenn Schalter in max. Stellung und zusätzlich die GPS_Home_Positionen beim Motorenstarten gelernt |
//werden konnten, wird zur GPS_Home_Position geflogen |
if (Poti3 >= 150 && GPS_Home_North != 0 && GPS_Home_East != 0) |
{ |
GPS_Positionsabweichung_North = (GPS_Home_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (GPS_Home_East - EAST_MITTEL); |
// durch das ständige Neulernen der Soll_Positionen während HOMING wird erreicht, dass der MK nach dem Umschalten |
// von HOMING zurück zu GPS-HOLD nicht wieder an die alte Soll_Position zurück fliegt |
Soll_Position_North = NORTH_MITTEL; |
Soll_Position_East = EAST_MITTEL; |
LED2_ON; |
} |
//verhindert, dass beim Umschalten von Mittelstellung (GPS_HOLD) auf Maximalstellung (HOMING) OHNE gelernte Homeposition |
//die GPS Funktion unkontrolliert steuert. Daher wird GPS_HOLD aktiv gehalten, die Sollpositon wird bei Stickbefehlen |
//jedoch nicht wie beim dynamischen GPS_HOLD überschrieben. Zusätzlich wird der Summer eingeschaltet. |
if (Poti3 >= 150 && GPS_Home_North == 0 && GPS_Home_East == 0) |
{ |
GPS_Positionsabweichung_North = (Soll_Position_North - NORTH_MITTEL); |
GPS_Positionsabweichung_East = (Soll_Position_East - EAST_MITTEL); |
LED2_ON; |
beeptime = 50; |
} |
//GPS-Geschwindigkeiten |
GPS_Geschwindigkeit_North = actualPos.velNorth; //actualPos.velNorth ist die Geschwindigkeiten aus dem GPS Empfänger entlang der Nord-Süd Richtung |
GPS_Geschwindigkeit_East = actualPos.velEast; //actualPos.velEast ist die Geschwindigkeiten aus dem GPS Empfänger entlang der Ost-West Richtung |
//Berechnung der Einzelkomponenten des PD-Reglers |
P_Einfluss_North = (P_GPS_Verstaerkung * GPS_Positionsabweichung_North)*0.0005; //entspricht einer Skalierung von 1/2000 |
D_Einfluss_North = (D_GPS_Verstaerkung * GPS_Geschwindigkeit_North)*0.00333; //entspricht einer Skalierung von 1/300 |
P_Einfluss_East = (P_GPS_Verstaerkung * GPS_Positionsabweichung_East)*0.0005; //entspricht einer Skalierung von 1/2000 |
D_Einfluss_East = (D_GPS_Verstaerkung * GPS_Geschwindigkeit_East)*0.00333; //entspricht einer Skalierung von 1/300 |
// Begrenzung des maximalen D-Anteils für pos. und neg. Werte. Grenze muss so geählt werden, |
// dass das Limit im normalen Position-Hold nicht erreicht wird und somit keinen Einfluss hat. |
// Grund: Beim Zufliegen auf weiter entfernte Ziele bremst der D-Anteil kurz vor dem Ziel den Mikrokopter sehr stark ab. |
// Dieses Limit wirkt nur, wenn sich der MK im HOMING Modus befindet und sich noch weit (>2,5m) von der Home-Position weg befindet. |
if (Poti3 >= 150 && GPS_Home_North != 0 && GPS_Home_East != 0 && (abs(GPS_Positionsabweichung_North) > 250 || abs(GPS_Positionsabweichung_East) > 250)) |
{ |
if (D_Einfluss_North > Limit_D_Anteil) D_Einfluss_North = Limit_D_Anteil; |
if (D_Einfluss_East > Limit_D_Anteil) D_Einfluss_East = Limit_D_Anteil; |
if (D_Einfluss_North < -1 * Limit_D_Anteil) D_Einfluss_North = -1 * Limit_D_Anteil; |
if (D_Einfluss_East < -1 * Limit_D_Anteil) D_Einfluss_East = -1 * Limit_D_Anteil; |
} |
// PD-Regler |
GPS_North = (-P_Einfluss_North + D_Einfluss_North); |
GPS_East = (P_Einfluss_East - D_Einfluss_East); |
//Umrechnen vom globalen North- bzw. East- in das körperfeste X- bzw. Y- Koordinatensystem |
GPS_Nick = (-c_sin[KompassValue]*0.001*GPS_East + c_cos[KompassValue]*0.001*GPS_North); // die "0" kann später durch den Messwert des Kompasssensors (KompassValue/0.01745329251) ersetzt werden |
GPS_Roll = (c_cos[KompassValue]*0.001*GPS_East + c_sin[KompassValue]*0.001*GPS_North); // die "0" kann später durch den Messwert des Kompasssensors (KompassValue/180*3.1415926535) ersetzt werden |
// Begrenzung des maximalen GPS Einflusses für positive und negative Werte |
if (GPS_Nick > 35) GPS_Nick = 35; |
if (GPS_Roll > 35) GPS_Roll = 35; |
if (GPS_Nick < -35) GPS_Nick = -35; |
if (GPS_Roll < -35) GPS_Roll = -35; |
//Funktion wird dadurch nur alle 250 ms aufgerufen, wenn neue Mittelwerte aus den GPS-Daten vorliegen. |
//FUNKTIONIERT MOMENTAN NOCH NICHT, DA STÄNDIG OHNE UNTERBRECHUNG NEUE MITTELWERTE BERECHNET WERDEN. |
//GRUND: DIE ABFRAGE NACH NEUE GPS-DATEN ERFOLGT NOCH NICHT |
NeuerMittelwert = 0; |
} |
} |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/License.txt |
---|
0,0 → 1,52 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + Nur für den privaten Gebrauch |
// + www.MikroKopter.com |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
// + dass eine Nutzung (auch auszugsweise) nur für den privaten und nichtkommerziellen Gebrauch zulässig ist. |
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
// + bzgl. der Nutzungsbedingungen aufzunehmen. |
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
// + Verkauf von Luftbildaufnahmen, usw. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
// + eindeutig als Ursprung verlinkt und genannt werden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
// + Benutzung auf eigene Gefahr |
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
// + mit unserer Zustimmung zulässig |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
// + this list of conditions and the following disclaimer. |
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
// + from this software without specific prior written permission. |
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
// + for non-profit use (directly or indirectly) |
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
// + with our written permission |
// + * If sources or documentations are redistributet, our webpage (http://www.MikroKopter.de) must be |
// + clearly linked and named as origin |
// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/MIKROKOPTER_TO_DO.txt |
---|
0,0 → 1,11 |
. Patricks neigungskompensierten Kompass |
. Aufruf der GPS.c innerhalb der fc.c nur wenn neue Daten vorliegen |
. innerhalb der GPS.c den PD-Regler nicht mit "NeuerMittelwert", sondern mit "actualpos.newdata" alle 250ms aufrufen |
. GPS-Empfänger auf 5Hz einstellen |
. Begrenzung von 35 auf 50 anheben, damit auch bei stärkerem Wind geflogen werden kann |
. Waypoints |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/Parameter.txt |
---|
0,0 → 1,15 |
bei leichtem, konstantem Wind |
P-Faktor(Userparam_1): 120 |
D-Faktor(Userparam_2): 90 |
D-Anteil_Limit(Userparam_3): 45 |
bei stärkerem, böhigem Wind: |
P-Faktor(Userparam_1): 150 |
D-Faktor(Userparam_2): 95 |
D-Anteil_Limit(Userparam_3): 45 |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/README_Nickk666Kompass.pdf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/Setting_1.mkp |
---|
0,0 → 1,51 |
[Setup] |
Name=GPS |
GlobalConfig=43 |
[Channels] |
Gas=3 |
Gier=2 |
Nick=1 |
Roll=4 |
Poti_1=5 |
Poti_2=6 |
Poti_3=7 |
Poti_4=8 |
[Stick] |
Nick_Roll-P=4 |
Nick_Roll-D=0 |
Gier-P=16 |
[Altitude] |
Setpoint=254 |
MinGas=30 |
P=10 |
Barometric-D=50 |
Z-ACC-Effect=50 |
Gain=2 |
[Gyro] |
P=120 |
I=150 |
ACC_Gyro-Factor=26 |
Main-I=0 |
[Others] |
MinGas=5 |
MaxGas=250 |
Compass-Effect=64 |
UnderVoltage=95 |
NotGas=66 |
NotGasTime=60 |
[User] |
Parameter_1=251 |
Parameter_2=252 |
Parameter_3=35 |
Parameter_4=60 |
[Camera] |
ServoNickControl=100 |
ServoNickCompensation=40 |
ServoNickInvert=0 |
ServoNickMin=50 |
ServoNickMax=150 |
ServoNickRefreshRate=5 |
[Loop] |
Config=0 |
GasLimit=50 |
StickThreshold=90 |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/Settings.h |
---|
--- beta/v064JokoGPSNick666MM_1_1_compiled/_Settings.h (nonexistent) |
+++ beta/v064JokoGPSNick666MM_1_1_compiled/_Settings.h (revision 2762) |
@@ -0,0 +1,50 @@ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Testmodi |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define MOTOR_OFF 0 |
+#define MOTOR_TEST 0 |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Abstimmung |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define ACC_AMPLIFY 16 |
+#define FAKTOR_P 1 |
+#define FAKTOR_I 0.0001 |
+ |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Debug-Interface |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define SIO_DEBUG 1 // Soll der Debugger aktiviert sein? |
+#define MIN_DEBUG_INTERVALL 500 // in diesem Intervall werden Degugdaten ohne Aufforderung gesendet |
+ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Sender |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ #define K_NICK 0 |
+ #define K_ROLL 1 |
+ #define K_GAS 2 |
+ #define K_GIER 3 |
+ #define K_POTI1 4 |
+ #define K_POTI2 5 |
+ #define K_POTI3 6 |
+ #define K_POTI4 7 |
+// +++++++++++++++++++++++++++++++ |
+// + Getestete Settings: |
+// +++++++++++++++++++++++++++++++ |
+// Setting: Kamera |
+// Stick_P:3 |
+// Stick_D:0 |
+// Gyro_P: 175 |
+// Gyro_I: 175 |
+// Ki_Anteil: 10 |
+// +++++++++++++++++++++++++++++++ |
+// + Getestete Settings: |
+// +++++++++++++++++++++++++++++++ |
+// Setting: Normal |
+// Stick_P:2 |
+// Stick_D:8 |
+// Gyro_P: 80 |
+// Gyro_I: 150 |
+// Ki_Anteil: 5 |
+ |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/analog.c |
---|
0,0 → 1,172 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
volatile int Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az, UBat = 100; |
volatile int AccumulateNick = 0, AccumulateRoll = 0, AccumulateGier = 0; |
volatile int accumulate_AccRoll = 0,accumulate_AccNick = 0,accumulate_AccHoch = 0; |
volatile char MessanzahlNick = 0, MessanzahlRoll = 0, MessanzahlGier = 0; |
volatile char messanzahl_AccNick = 0, messanzahl_AccRoll = 0, messanzahl_AccHoch = 0; |
volatile long Luftdruck = 32000; |
volatile int StartLuftdruck; |
volatile unsigned int MessLuftdruck = 1023; |
unsigned char DruckOffsetSetting; |
volatile int HoeheD = 0; |
volatile char messanzahl_Druck; |
volatile int tmpLuftdruck; |
volatile unsigned int ZaehlMessungen = 0; |
//####################################################################################### |
// |
void ADC_Init(void) |
//####################################################################################### |
{ |
ADMUX = 0;//Referenz ist extern |
ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE); |
//Free Running Mode, Division Factor 128, Interrupt on |
} |
void SucheLuftruckOffset(void) |
{ |
unsigned int off; |
off = eeprom_read_byte(&EEPromArray[EEPROM_ADR_LAST_OFFSET]); |
if(off > 20) off -= 10; |
OCR0A = off; |
Delay_ms(100); |
if(MessLuftdruck < 850) off = 0; |
for(; off < 250;off++) |
{ |
OCR0A = off; |
Delay_ms(50); |
printf("."); |
if(MessLuftdruck < 900) break; |
} |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_LAST_OFFSET], off); |
DruckOffsetSetting = off; |
Delay_ms(300); |
} |
//####################################################################################### |
// |
SIGNAL(SIG_ADC) |
//####################################################################################### |
{ |
static unsigned char kanal=0,state = 0; |
signed int wert; |
ANALOG_OFF; |
switch(state++) |
{ |
case 0: |
wert = (signed int) AdNeutralGier - ADC; |
if(PlatinenVersion != 10) wert *= 2; |
AccumulateGier += wert; // |
MessanzahlGier++; |
Mess_Integral_Gier += wert;// / 16; |
Mess_Integral_Gier2 += wert; |
kanal = 1; |
ZaehlMessungen++; |
break; |
case 1: |
wert = (signed int) ADC - AdNeutralRoll; |
if(PlatinenVersion != 10) wert *= 2; |
Mess_IntegralRoll += wert; |
Mess_IntegralRoll2 += wert; |
if(Mess_IntegralRoll > 310000L) Mess_IntegralRoll = -290000L; |
if(Mess_IntegralRoll <-310000L) Mess_IntegralRoll = 290000L; |
if(ADC < 15) wert = -1000; |
if(ADC < 7) wert = -2000; |
if(ADC > 1010) wert = +1000; |
if(ADC > 1017) wert = +2000; |
AccumulateRoll += wert; |
MessanzahlRoll++; |
kanal = 2; |
break; |
case 2: |
wert = (signed int) ADC - AdNeutralNick; |
if(PlatinenVersion != 10) wert *= 2; |
Mess_IntegralNick += wert; |
Mess_IntegralNick2 += wert; |
if(Mess_IntegralNick > 310000L) Mess_IntegralNick = -290000L; |
if(Mess_IntegralNick <-310000L) Mess_IntegralNick = 290000L; |
if(ADC < 15) wert = -1000; |
if(ADC < 7) wert = -2000; |
if(ADC > 1010) wert = +1000; |
if(ADC > 1017) wert = +2000; |
AccumulateNick += wert; |
MessanzahlNick++; |
kanal = 4; |
break; |
case 3: |
UBat = (3 * UBat + ADC / 3) / 4;//(UBat + ((ADC * 39) / 256) + 19) / 2; |
kanal = 6; |
break; |
case 4: |
Aktuell_ay = NeutralAccY - ADC; |
accumulate_AccRoll += Aktuell_ay; |
messanzahl_AccRoll++; |
kanal = 7; |
break; |
case 5: |
Aktuell_ax = ADC - NeutralAccX; |
accumulate_AccNick += Aktuell_ax; |
messanzahl_AccNick++; |
kanal = 5; |
state = 6; |
break; |
case 6: |
accumulate_AccHoch = (signed int) ADC - NeutralAccZ; |
accumulate_AccHoch += abs(Aktuell_ay) / 4 + abs(Aktuell_ax) / 4; |
if(accumulate_AccHoch > 1) |
{ |
if(NeutralAccZ < 800) NeutralAccZ+= 0.02; |
} |
else if(accumulate_AccHoch < -1) |
{ |
if(NeutralAccZ > 600) NeutralAccZ-= 0.02; |
} |
messanzahl_AccHoch = 1; |
Aktuell_az = ADC; |
Mess_Integral_Hoch += accumulate_AccHoch; // Integrieren |
Mess_Integral_Hoch -= Mess_Integral_Hoch / 1024; // dämfen |
// Mess_Integral_Hoch -= Mess_Integral_Hoch / 512; // dämfen |
/* if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
kanal = 3; |
state = 7; |
} |
else |
{ |
kanal = 0; |
state = 0; |
}*/ |
kanal = 3; |
state = 7; |
break; |
case 7: |
tmpLuftdruck += ADC; |
if(++messanzahl_Druck >= 5) |
{ |
MessLuftdruck = ADC; |
messanzahl_Druck = 0; |
HoeheD = (int)(StartLuftdruck - tmpLuftdruck - HoehenWert); // D-Anteil = neuerWert - AlterWert |
Luftdruck = (tmpLuftdruck + 3 * Luftdruck) / 4; |
HoehenWert = StartLuftdruck - Luftdruck; |
tmpLuftdruck = 0; |
} |
kanal = 0; |
state = 0; |
break; |
default: |
kanal = 0; |
state = 0; |
break; |
} |
ADMUX = kanal; |
ANALOG_ON; |
} |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/analog.h |
---|
0,0 → 1,23 |
/*####################################################################################### |
#######################################################################################*/ |
extern volatile int UBat; |
extern volatile int AccumulateNick, AccumulateRoll, AccumulateGier,accumulate_AccRoll,accumulate_AccNick,accumulate_AccHoch; |
extern volatile char MessanzahlNick, MessanzahlRoll, MessanzahlGier,messanzahl_AccNick, messanzahl_AccRoll,messanzahl_AccHoch; |
extern volatile int Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az; |
extern volatile long Luftdruck; |
extern volatile char messanzahl_Druck; |
extern volatile unsigned int ZaehlMessungen; |
extern unsigned char DruckOffsetSetting; |
extern volatile int HoeheD; |
extern volatile unsigned int MessLuftdruck; |
extern volatile int StartLuftdruck; |
extern unsigned int ReadADC(unsigned char adc_input); |
extern void ADC_Init(void); |
extern void SucheLuftruckOffset(void); |
#define ANALOG_OFF ADCSRA=0 |
#define ANALOG_ON ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE) |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/compass.c |
---|
0,0 → 1,230 |
/* |
Copyright 2007, Niklas Nold |
This program (files compass.c and compass.h) is free software; you can redistribute it and/or modify |
it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; |
either version 3 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
Please note: All the other files for the project "Mikrokopter" by H. Buss are under the license (license_buss.txt) published by www.mikrokopter.de |
*/ |
#include "main.h" |
MM3_struct MM3; |
int8_t Kompass_Offset[2] EEMEM; // X_off[0], Y_off[1], Z_off[2] |
int8_t X_off, Y_off, Z_off; |
//############################################################################ |
// Initialisierung |
void MM3_init(void) |
//############################################################################ |
{ |
SPCR = (1<<SPIE)|(1<<SPE)|(1<<MSTR)|(1<<SPR1)|(1<<SPR0); //Interrupt an, Master, 156 kHz Oszillator |
//SPSR = (1<<SPI2X); |
DDRB |= (1<<PB7)|(1<<PB5)|(1<<PB2); // J8, MOSI, SCK Ausgang |
PORTD &= ~(1<<PD3); // J5 auf Low |
MM3.AXIS = MM3_X; |
MM3.STATE = MM3_RESET; |
// Kalibrierung aus dem EEprom lesen |
X_off = (int8_t)eeprom_read_byte(&Kompass_Offset[0]); |
Y_off = (int8_t)eeprom_read_byte(&Kompass_Offset[1]); |
Z_off = (int8_t)eeprom_read_byte(&Kompass_Offset[2]); |
//X_off = -11; |
//Y_off = 30; |
//Z_off = 18; |
} |
//############################################################################ |
// Wird in der SIGNAL (SIG_OVERFLOW0) aufgerufen |
void MM3_timer0(void) |
//############################################################################ |
{ |
switch (MM3.STATE) |
{ |
case MM3_RESET: |
PORTB |= (1<<PB2); // J8 auf High, MM3 Reset |
MM3.STATE = MM3_START_TRANSFER; |
return; |
case MM3_START_TRANSFER: |
PORTB &= ~(1<<PB2); // J8 auf Low (war ~125 µs auf High) |
if (MM3.AXIS == MM3_X) SPDR = 0x31; // Schreiben ins SPDR löst automatisch Übertragung (MOSI und MISO) aus |
else if (MM3.AXIS == MM3_Y) SPDR = 0x32; // Micromag Period Select ist auf 256 (0x30) |
else if (MM3.AXIS == MM3_Z) SPDR = 0x33; // 1: x-Achse, 2: Y-Achse, 3: Z-Achse |
MM3.DRDY = SetDelay(8); // Laut Datenblatt max. Zeit bis Messung fertig (bei PS 256 eigentlich 4 ms) |
MM3.STATE = MM3_WAIT_DRDY; |
return; |
case MM3_WAIT_DRDY: |
if (CheckDelay(MM3.DRDY)) {SPDR = 0x00;MM3.STATE = MM3_DRDY;} // Irgendwas ins SPDR, damit Übertragung ausgelöst wird, wenn Wartezeit vorbei |
return; // Jetzt gehts weiter in SIGNAL (SIG_SPI) |
/* |
case MM3_TILT: // Zeitnahe Speicherung der aktuellen Neigung in ° |
MM3.NickGrad = IntegralNick/(EE_Parameter.UserParam1*8); |
MM3.RollGrad = IntegralRoll/(EE_Parameter.UserParam2*8); |
MM3.AXIS = MM3_X; |
MM3.STATE = MM3_RESET; |
return; |
*/ |
} |
} |
//############################################################################ |
// SPI byte ready |
SIGNAL (SIG_SPI) |
//############################################################################ |
{ |
switch (MM3.STATE) |
{ |
case MM3_DRDY: // 1. Byte ist da, abspeichern, an die MSB-Stelle rücken |
if (MM3.AXIS == MM3_X) |
{ |
MM3.x_axis = SPDR; |
MM3.x_axis <<= 8; |
} |
else if (MM3.AXIS == MM3_Y) |
{ |
MM3.y_axis = SPDR; |
MM3.y_axis <<= 8; |
} |
else // if (MM3.AXIS == MM3_Z) |
{ |
MM3.z_axis = SPDR; |
MM3.z_axis <<= 8; |
} |
SPDR=0x00; // Übertragung von 2. Byte auslösen |
MM3.STATE=MM3_BYTE2; |
return; |
case MM3_BYTE2: // 2. Byte der entsprechenden Achse ist da |
if (MM3.AXIS == MM3_X) |
{ |
MM3.x_axis |= SPDR; |
// Spikes filtern |
if (abs(MM3.x_axis) < Max_Axis_Value) MM3.x_axis_old = MM3.x_axis; |
else MM3.x_axis = MM3.x_axis_old; |
MM3.AXIS = MM3_Y; |
MM3.STATE = MM3_RESET; |
} |
else if (MM3.AXIS == MM3_Y) |
{ |
MM3.y_axis |= SPDR; |
if (abs(MM3.y_axis) < Max_Axis_Value) MM3.y_axis_old = MM3.y_axis; |
else MM3.y_axis = MM3.y_axis_old; |
MM3.AXIS = MM3_Z; |
MM3.STATE = MM3_RESET; |
} |
else // if (MM3.AXIS == MM3_Z) |
{ |
MM3.z_axis |= SPDR; |
if (abs(MM3.z_axis) < Max_Axis_Value) MM3.z_axis_old = MM3.z_axis; |
else MM3.z_axis = MM3.z_axis_old; |
MM3.AXIS = MM3_X; |
MM3.STATE = MM3_RESET; |
} |
return; |
} |
} |
//############################################################################ |
// Kompass kalibrieren |
void MM3_calib(void) |
//############################################################################ |
{ |
signed int x_min=0,x_max=0,y_min=0,y_max=0,z_min=0,z_max=0; |
uint8_t measurement=50,beeper=0; |
unsigned int timer; |
while (measurement) |
{ |
//H_earth = MM3.x_axis*MM3.x_axis + MM3.y_axis*MM3.y_axis + MM3.z_axis*MM3.z_axis; |
if (MM3.x_axis > x_max) x_max = MM3.x_axis; |
else if (MM3.x_axis < x_min) x_min = MM3.x_axis; |
if (MM3.y_axis > y_max) y_max = MM3.y_axis; |
else if (MM3.y_axis < y_min) y_min = MM3.y_axis; |
if (MM3.z_axis > z_max) z_max = MM3.z_axis; |
else if (MM3.z_axis < z_min) z_min = MM3.z_axis; |
if (!beeper) |
{ |
beeper = 50; |
beeptime = 50; |
} |
beeper--; |
// Schleife mit 100 Hz voll ausreichend |
timer = SetDelay(10); |
while(!CheckDelay(timer)); |
// Wenn Gas zurück genommen wird, Kalibrierung mit Verzögerung beenden |
if (PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] < 100) measurement--; |
} |
// Offset der Achsen berechnen |
X_off = (x_max + x_min) / 2; |
Y_off = (y_max + y_min) / 2; |
Z_off = (z_max + z_min) / 2; |
// und im EEProm abspeichern |
eeprom_write_byte(&Kompass_Offset[0], X_off); |
eeprom_write_byte(&Kompass_Offset[1], Y_off); |
eeprom_write_byte(&Kompass_Offset[2], Z_off); |
} |
//############################################################################ |
// Neigungskompensierung und Berechnung der Ausrichtung |
signed int MM3_heading(void) |
//############################################################################ |
{ |
float sin_nick, cos_nick, sin_roll, cos_roll; |
signed int x_corr, y_corr, heading; |
signed int x_axis,y_axis,z_axis; |
MM3.NickGrad = IntegralNick/(EE_Parameter.UserParam4*8); |
MM3.RollGrad = IntegralRoll/(EE_Parameter.UserParam4*8); |
// Berechung von sinus und cosinus |
sin_nick = sin_f(MM3.NickGrad); |
cos_nick = cos_f(MM3.NickGrad); |
sin_roll = sin_f(MM3.RollGrad); |
cos_roll = cos_f(MM3.RollGrad); |
// Offset der Achsen nur bei Bedarf (also hier) berücksichtigen |
x_axis = MM3.x_axis - X_off; |
y_axis = MM3.y_axis - Y_off; |
z_axis = MM3.z_axis - Z_off; |
// Neigungskompensation |
x_corr = (cos_nick * x_axis) - (((sin_roll * y_axis) - (cos_roll * z_axis)) * sin_nick); |
y_corr = ((cos_roll * y_axis) + (sin_roll * z_axis)); |
// Winkelberechnung |
heading = atan2_i(x_corr, y_corr); |
return (heading); |
} |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/compass.h |
---|
0,0 → 1,37 |
typedef struct |
{ |
uint8_t STATE; |
unsigned int DRDY; |
uint8_t AXIS; |
signed int x_axis; |
signed int x_axis_old; |
signed int y_axis; |
signed int y_axis_old; |
signed int z_axis; |
signed int z_axis_old; |
signed int NickGrad; |
signed int RollGrad; |
}MM3_struct; |
extern MM3_struct MM3; |
extern int8_t X_off, Y_off, Z_off; |
void MM3_init(void); |
void MM3_timer0(void); |
void MM3_calib(void); |
signed int MM3_heading(void); |
#define Max_Axis_Value 500 |
// Die Werte der Statemachine |
#define MM3_RESET 0 |
#define MM3_START_TRANSFER 1 |
#define MM3_WAIT_DRDY 2 |
#define MM3_DRDY 4 |
#define MM3_BYTE2 8 |
#define MM3_X 16 |
#define MM3_Y 32 |
#define MM3_Z 64 |
#define MM3_TILT 128 |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/eeprom.c |
---|
--- beta/v064JokoGPSNick666MM_1_1_compiled/fc.c (nonexistent) |
+++ beta/v064JokoGPSNick666MM_1_1_compiled/fc.c (revision 2762) |
@@ -0,0 +1,1028 @@ |
+/*####################################################################################### |
+Flight Control |
+#######################################################################################*/ |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Copyright (c) 04.2007 Holger Buss |
+// + Nur für den privaten Gebrauch |
+// + www.MikroKopter.com |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
+// + dass eine Nutzung (auch auszugsweise) nur für den privaten (nicht-kommerziellen) Gebrauch zulässig ist. |
+// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
+// + bzgl. der Nutzungsbedingungen aufzunehmen. |
+// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
+// + Verkauf von Luftbildaufnahmen, usw. |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
+// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
+// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
+// + eindeutig als Ursprung verlinkt werden |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
+// + Benutzung auf eigene Gefahr |
+// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
+// + mit unserer Zustimmung zulässig |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
+// + this list of conditions and the following disclaimer. |
+// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
+// + from this software without specific prior written permission. |
+// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
+// + for non-commercial use (directly or indirectly) |
+// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
+// + with our written permission |
+// + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
+// + clearly linked as origin |
+// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
+// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
+// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
+// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
+// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
+// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
+// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
+// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
+// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
+// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
+// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
+// + POSSIBILITY OF SUCH DAMAGE. |
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+#include "main.h" |
+ |
+unsigned char h,m,s; |
+volatile unsigned int I2CTimeout = 100; |
+volatile int MesswertNick,MesswertRoll,MesswertGier; |
+volatile int AdNeutralNick = 0,AdNeutralRoll = 0,AdNeutralGier = 0; |
+volatile int Mittelwert_AccNick, Mittelwert_AccRoll,Mittelwert_AccHoch, NeutralAccX=0, NeutralAccY=0; |
+volatile float NeutralAccZ = 0; |
+unsigned char CosinusNickWinkel = 0, CosinusRollWinkel = 0; |
+volatile long IntegralNick = 0,IntegralNick2 = 0; |
+volatile long IntegralRoll = 0,IntegralRoll2 = 0; |
+volatile long Integral_Gier = 0; |
+volatile long Mess_IntegralNick = 0,Mess_IntegralNick2 = 0; |
+volatile long Mess_IntegralRoll = 0,Mess_IntegralRoll2 = 0; |
+volatile long Mess_Integral_Gier = 0,Mess_Integral_Gier2 = 0; |
+volatile long Mess_Integral_Hoch = 0; |
+volatile int KompassValue = 0; |
+volatile int KompassStartwert = 0; |
+volatile int KompassRichtung = 0; |
+unsigned char MAX_GAS,MIN_GAS; |
+unsigned char Notlandung = 0; |
+unsigned char HoehenReglerAktiv = 0; |
+ |
+unsigned char blinkcount_LED1 = 0;//Hilfszähler für die blinkende LED (310807Kr) |
+unsigned int modell_fliegt_gps = 0;//(030907Kr) |
+unsigned char Limit_D_Anteil = 0;//(210907Kr) |
+ |
+float GyroFaktor; |
+float IntegralFaktor; |
+ |
+volatile int DiffNick,DiffRoll; |
+int Poti1 = 0, Poti2 = 0, Poti3 = 0, Poti4 = 0, Poti5 = 0, Poti6 = 0, Poti7 = 0, Poti8 = 0; //PPM24-Erweiterung (121007Kr) |
+volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
+unsigned char MotorWert[5]; |
+volatile unsigned char SenderOkay = 0; |
+int StickNick = 0,StickRoll = 0,StickGier = 0; |
+char MotorenEin = 0; |
+int HoehenWert = 0; |
+int SollHoehe = 0; |
+unsigned char Looping_Nick = 0,Looping_Roll = 0; |
+ |
+float Kp = FAKTOR_P; |
+float Ki = FAKTOR_I; |
+ |
+unsigned char Parameter_Luftdruck_D = 48; // Wert : 0-250 |
+unsigned char Parameter_MaxHoehe = 251; // Wert : 0-250 |
+unsigned char Parameter_Hoehe_P = 16; // Wert : 0-32 |
+unsigned char Parameter_Hoehe_ACC_Wirkung = 58; // Wert : 0-250 |
+unsigned char Parameter_KompassWirkung = 64; // Wert : 0-250 |
+unsigned char Parameter_Gyro_P = 150; // Wert : 10-250 |
+unsigned char Parameter_Gyro_I = 150; // Wert : 0-250 |
+unsigned char Parameter_Gier_P = 2; // Wert : 1-20 |
+unsigned char Parameter_I_Faktor = 10; // Wert : 1-20 |
+unsigned char Parameter_UserParam1 = 0; |
+unsigned char Parameter_UserParam2 = 0; |
+unsigned char Parameter_UserParam3 = 0; |
+unsigned char Parameter_UserParam4 = 0; |
+unsigned char Parameter_ServoNickControl = 100; |
+unsigned char Parameter_LoopGasLimit = 70; |
+struct mk_param_struct EE_Parameter; |
+ |
+void Piep(unsigned char Anzahl) |
+{ |
+ while(Anzahl--) |
+ { |
+ if(MotorenEin) return; //auf keinen Fall im Flug! |
+ beeptime = 100; |
+ Delay_ms(250); |
+ } |
+} |
+ |
+//############################################################################ |
+// Nullwerte ermitteln |
+void SetNeutral(void) |
+//############################################################################ |
+{ |
+ unsigned int timer; |
+ NeutralAccX = 0; |
+ NeutralAccY = 0; |
+ NeutralAccZ = 0; |
+ AdNeutralNick = 0; |
+ AdNeutralRoll = 0; |
+ AdNeutralGier = 0; |
+ CalibrierMittelwert(); |
+ timer = SetDelay(5); |
+ while (!CheckDelay(timer)); |
+ CalibrierMittelwert(); |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
+ { |
+ if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset(); |
+ } |
+ |
+ if(PlatinenVersion == 10) |
+ { |
+ AdNeutralNick= abs(MesswertNick); |
+ AdNeutralRoll= abs(MesswertRoll); |
+ AdNeutralGier= abs(MesswertGier); |
+ } |
+ else |
+ { |
+ AdNeutralNick= abs(MesswertNick) / 2; |
+ AdNeutralRoll= abs(MesswertRoll) / 2; |
+ AdNeutralGier= abs(MesswertGier) / 2; |
+ } |
+ NeutralAccY = abs(Mittelwert_AccRoll) / ACC_AMPLIFY; |
+ NeutralAccX = abs(Mittelwert_AccNick) / ACC_AMPLIFY; |
+ NeutralAccZ = Aktuell_az; |
+ |
+ Mess_IntegralNick = 0; |
+ Mess_IntegralNick2 = 0; |
+ Mess_IntegralRoll = 0; |
+ Mess_IntegralRoll2 = 0; |
+ Mess_Integral_Gier = 0; |
+ MesswertNick = 0; |
+ MesswertRoll = 0; |
+ MesswertGier = 0; |
+ StartLuftdruck = Luftdruck; |
+ HoeheD = 0; |
+ Mess_Integral_Hoch = 0; |
+ KompassStartwert = KompassValue; |
+ beeptime = 50; |
+} |
+ |
+//############################################################################ |
+// Bildet den Mittelwert aus den Messwerten |
+void Mittelwert(void) |
+//############################################################################ |
+{ |
+ // ADC auschalten, damit die Werte sich nicht während der Berechnung ändern |
+ ANALOG_OFF; |
+ if(MessanzahlNick) (MesswertNick = AccumulateNick / MessanzahlNick); |
+ if(MessanzahlRoll) (MesswertRoll = AccumulateRoll / MessanzahlRoll); |
+ if(MessanzahlGier) (MesswertGier = AccumulateGier / MessanzahlGier); |
+ if(messanzahl_AccNick) Mittelwert_AccNick = ((long)Mittelwert_AccNick * 7 + ((ACC_AMPLIFY * (long)accumulate_AccNick) / messanzahl_AccNick)) / 8L; |
+ if(messanzahl_AccRoll) Mittelwert_AccRoll = ((long)Mittelwert_AccRoll * 7 + ((ACC_AMPLIFY * (long)accumulate_AccRoll) / messanzahl_AccRoll)) / 8L; |
+ if(messanzahl_AccHoch) Mittelwert_AccHoch = ((long)Mittelwert_AccHoch * 7 + ((long)accumulate_AccHoch) / messanzahl_AccHoch) / 8L; |
+ AccumulateNick = 0; MessanzahlNick = 0; |
+ AccumulateRoll = 0; MessanzahlRoll = 0; |
+ AccumulateGier = 0; MessanzahlGier = 0; |
+ accumulate_AccRoll = 0;messanzahl_AccRoll = 0; |
+ accumulate_AccNick = 0;messanzahl_AccNick = 0; |
+ accumulate_AccHoch = 0;messanzahl_AccHoch = 0; |
+ Integral_Gier = Mess_Integral_Gier; |
+// Integral_Gier2 = Mess_Integral_Gier2; |
+ IntegralNick = Mess_IntegralNick; |
+ IntegralRoll = Mess_IntegralRoll; |
+ IntegralNick2 = Mess_IntegralNick2; |
+ IntegralRoll2 = Mess_IntegralRoll2; |
+ // ADC einschalten |
+ ANALOG_ON; |
+ |
+/* |
+//------------------------------------------------------------------------------ |
+ if(MesswertNick > 200) MesswertNick += 4 * (MesswertNick - 200); |
+ else |
+ if(MesswertNick < -200) MesswertNick += 4 * (MesswertNick + 200); |
+ if(MesswertRoll > 200) MesswertRoll += 4 * (MesswertRoll - 200); |
+ else |
+ if(MesswertRoll < -200) MesswertRoll += 4 * (MesswertRoll + 200); |
+//------------------------------------------------------------------------------ |
+*/ |
+ if(Poti1 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110) Poti1++; else if(Poti1 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110 && Poti1) Poti1--; |
+ if(Poti2 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110) Poti2++; else if(Poti2 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110 && Poti2) Poti2--; |
+ if(Poti3 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110) Poti3++; else if(Poti3 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110 && Poti3) Poti3--; |
+ if(Poti4 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110) Poti4++; else if(Poti4 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110 && Poti4) Poti4--; |
+ //PPM24-Erweiterung (121007Kr) |
+ if(Poti5 < PPM_in[9] + 110) Poti5++; else if(Poti5 > PPM_in[9] + 110 && Poti5) Poti5--; |
+ if(Poti6 < PPM_in[10] + 110) Poti6++; else if(Poti6 > PPM_in[10] + 110 && Poti6) Poti6--; |
+ if(Poti7 < PPM_in[11] + 110) Poti7++; else if(Poti7 > PPM_in[11] + 110 && Poti7) Poti7--; |
+ if(Poti8 < PPM_in[12] + 110) Poti8++; else if(Poti8 > PPM_in[12] + 110 && Poti8) Poti8--; |
+ |
+ |
+ if(Poti1 < 0) Poti1 = 0; else if(Poti1 > 255) Poti1 = 255; |
+ if(Poti2 < 0) Poti2 = 0; else if(Poti2 > 255) Poti2 = 255; |
+ if(Poti3 < 0) Poti3 = 0; else if(Poti3 > 255) Poti3 = 255; |
+ if(Poti4 < 0) Poti4 = 0; else if(Poti4 > 255) Poti4 = 255; |
+ //PPM24-Erweiterung (121007Kr) |
+ if(Poti5 < 0) Poti5 = 0; else if(Poti5 > 255) Poti5 = 255; |
+ if(Poti6 < 0) Poti6 = 0; else if(Poti6 > 255) Poti6 = 255; |
+ if(Poti7 < 0) Poti7 = 0; else if(Poti7 > 255) Poti7 = 255; |
+ if(Poti8 < 0) Poti8 = 0; else if(Poti8 > 255) Poti8 = 255; |
+} |
+ |
+//############################################################################ |
+// Messwerte beim Ermitteln der Nullage |
+void CalibrierMittelwert(void) |
+//############################################################################ |
+{ |
+ // ADC auschalten, damit die Werte sich nicht während der Berechnung ändern |
+ ANALOG_OFF; |
+ if(MessanzahlNick) (MesswertNick = AccumulateNick / MessanzahlNick); |
+ if(MessanzahlRoll) (MesswertRoll = AccumulateRoll / MessanzahlRoll); |
+ if(MessanzahlGier) (MesswertGier = AccumulateGier / MessanzahlGier); |
+ if(messanzahl_AccNick) Mittelwert_AccNick = ((ACC_AMPLIFY * (long)accumulate_AccNick) / messanzahl_AccNick); |
+ if(messanzahl_AccRoll) Mittelwert_AccRoll = (ACC_AMPLIFY * (long)accumulate_AccRoll) / messanzahl_AccRoll; |
+ if(messanzahl_AccHoch) Mittelwert_AccHoch = ((long)accumulate_AccHoch) / messanzahl_AccHoch; |
+ AccumulateNick = 0; MessanzahlNick = 0; |
+ AccumulateRoll = 0; MessanzahlRoll = 0; |
+ AccumulateGier = 0; MessanzahlGier = 0; |
+ accumulate_AccRoll = 0;messanzahl_AccRoll = 0; |
+ accumulate_AccNick = 0;messanzahl_AccNick = 0; |
+ accumulate_AccHoch = 0;messanzahl_AccHoch = 0; |
+ // ADC einschalten |
+ ANALOG_ON; |
+ if(Poti1 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110) Poti1++; else if(Poti1 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110 && Poti1) Poti1--; |
+ if(Poti2 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110) Poti2++; else if(Poti2 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110 && Poti2) Poti2--; |
+ if(Poti3 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110) Poti3++; else if(Poti3 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110 && Poti3) Poti3--; |
+ if(Poti4 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110) Poti4++; else if(Poti4 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110 && Poti4) Poti4--; |
+ //PPM24-Erweiterung (121007Kr) |
+ if(Poti5 < PPM_in[9] + 110) Poti5++; else if(Poti5 > PPM_in[9] + 110 && Poti5) Poti5--; |
+ if(Poti6 < PPM_in[10] + 110) Poti6++; else if(Poti6 > PPM_in[10] + 110 && Poti6) Poti6--; |
+ if(Poti7 < PPM_in[11] + 110) Poti7++; else if(Poti7 > PPM_in[11] + 110 && Poti7) Poti7--; |
+ if(Poti8 < PPM_in[12] + 110) Poti8++; else if(Poti8 > PPM_in[12] + 110 && Poti8) Poti8--; |
+ |
+ |
+ |
+ |
+ if(Poti1 < 0) Poti1 = 0; else if(Poti1 > 255) Poti1 = 255; |
+ if(Poti2 < 0) Poti2 = 0; else if(Poti2 > 255) Poti2 = 255; |
+ if(Poti3 < 0) Poti3 = 0; else if(Poti3 > 255) Poti3 = 255; |
+ if(Poti4 < 0) Poti4 = 0; else if(Poti4 > 255) Poti4 = 255; |
+ //PPM24-Erweiterung (121007Kr) |
+ if(Poti5 < 0) Poti5 = 0; else if(Poti5 > 255) Poti5 = 255; |
+ if(Poti6 < 0) Poti6 = 0; else if(Poti6 > 255) Poti6 = 255; |
+ if(Poti7 < 0) Poti7 = 0; else if(Poti7 > 255) Poti7 = 255; |
+ if(Poti8 < 0) Poti8 = 0; else if(Poti8 > 255) Poti8 = 255; |
+} |
+ |
+//############################################################################ |
+// Senden der Motorwerte per I2C-Bus |
+void SendMotorData(void) |
+//############################################################################ |
+{ |
+ if(MOTOR_OFF || !MotorenEin) |
+ { |
+ Motor_Hinten = 0; |
+ Motor_Vorne = 0; |
+ Motor_Rechts = 0; |
+ Motor_Links = 0; |
+ if(MotorTest[0]) Motor_Vorne = MotorTest[0]; |
+ if(MotorTest[1]) Motor_Hinten = MotorTest[1]; |
+ if(MotorTest[2]) Motor_Links = MotorTest[2]; |
+ if(MotorTest[3]) Motor_Rechts = MotorTest[3]; |
+ } |
+ |
+ // DebugOut.Analog[12] = Motor_Vorne; |
+ // DebugOut.Analog[13] = Motor_Hinten; |
+ // DebugOut.Analog[14] = Motor_Links; |
+ // DebugOut.Analog[15] = Motor_Rechts; |
+ |
+ // DebugOut.Analog[12] = motor_rx[0]; //Motorstrom vorne |
+ // DebugOut.Analog[13] = motor_rx[1]; //Motorstrom hinten |
+ // DebugOut.Analog[14] = motor_rx[2]; //Motorstrom links |
+ // DebugOut.Analog[15] = motor_rx[3]; //Motorstrom rechts |
+ |
+ |
+ //Start I2C Interrupt Mode |
+ twi_state = 0; |
+ motor = 0; |
+ i2c_start(); |
+} |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Konstanten |
+// + 0-250 -> normale Werte |
+// + 251 -> Poti1 |
+// + 252 -> Poti2 |
+// + 253 -> Poti3 |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+void DefaultKonstanten1(void) |
+{ |
+ EE_Parameter.Kanalbelegung[K_NICK] = 1; |
+ EE_Parameter.Kanalbelegung[K_ROLL] = 2; |
+ EE_Parameter.Kanalbelegung[K_GAS] = 3; |
+ EE_Parameter.Kanalbelegung[K_GIER] = 4; |
+ EE_Parameter.Kanalbelegung[K_POTI1] = 5; |
+ EE_Parameter.Kanalbelegung[K_POTI2] = 6; |
+ EE_Parameter.Kanalbelegung[K_POTI3] = 7; |
+ EE_Parameter.Kanalbelegung[K_POTI4] = 8; |
+ EE_Parameter.GlobalConfig = 0;//CFG_HOEHENREGELUNG | /*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV | CFG_KOMPASS_FIX;//0x01; |
+ EE_Parameter.Hoehe_MinGas = 30; |
+ EE_Parameter.MaxHoehe = 251; // Wert : 0-32 251 -> Poti1 |
+ EE_Parameter.Hoehe_P = 10; // Wert : 0-32 |
+ EE_Parameter.Luftdruck_D = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_ACC_Wirkung = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_Verstaerkung = 4; // Wert : 0-50 |
+ EE_Parameter.Stick_P = 4; //2 // Wert : 1-6 |
+ EE_Parameter.Stick_D = 8; //8 // Wert : 0-64 |
+ EE_Parameter.Gier_P = 16; // Wert : 1-20 |
+ EE_Parameter.Gas_Min = 5; // Wert : 0-32 // (160607Kr) |
+ EE_Parameter.Gas_Max = 250; // Wert : 33-250 |
+ EE_Parameter.GyroAccFaktor = 26; // Wert : 1-64 |
+ EE_Parameter.KompassWirkung = 16; // Wert : 0-250 |
+ EE_Parameter.Gyro_P = 120; //80 // Wert : 0-250 |
+ EE_Parameter.Gyro_I = 150; // Wert : 0-250 |
+ EE_Parameter.UnterspannungsWarnung = 95; // Wert : 0-250 // (160607Kr) |
+ EE_Parameter.NotGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
+ EE_Parameter.NotGasZeit = 20; // Wert : 0-250 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen |
+ EE_Parameter.UfoAusrichtung = 0; // X oder + Formation |
+ EE_Parameter.I_Faktor = 0; |
+ EE_Parameter.UserParam1 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam2 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam3 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam4 = 120; //zur freien Verwendung |
+ EE_Parameter.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
+ EE_Parameter.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickRefresh = 5; |
+ EE_Parameter.LoopGasLimit = 50; |
+ EE_Parameter.LoopThreshold = 90; // Wert: 0-250 Schwelle für Stickausschlag |
+ EE_Parameter.LoopConfig = 0; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
+ memcpy(EE_Parameter.Name, "Sport\0", 12); |
+} |
+ |
+void DefaultKonstanten2(void) |
+{ |
+ EE_Parameter.Kanalbelegung[K_NICK] = 1; |
+ EE_Parameter.Kanalbelegung[K_ROLL] = 2; |
+ EE_Parameter.Kanalbelegung[K_GAS] = 3; |
+ EE_Parameter.Kanalbelegung[K_GIER] = 4; |
+ EE_Parameter.Kanalbelegung[K_POTI1] = 5; |
+ EE_Parameter.Kanalbelegung[K_POTI2] = 6; |
+ EE_Parameter.Kanalbelegung[K_POTI3] = 7; |
+ EE_Parameter.Kanalbelegung[K_POTI4] = 8; |
+ EE_Parameter.GlobalConfig = 0;//CFG_HOEHENREGELUNG | /*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV;//0x01; |
+ EE_Parameter.Hoehe_MinGas = 30; |
+ EE_Parameter.MaxHoehe = 251; // Wert : 0-32 251 -> Poti1 |
+ EE_Parameter.Hoehe_P = 10; // Wert : 0-32 |
+ EE_Parameter.Luftdruck_D = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_ACC_Wirkung = 50; // Wert : 0-250 |
+ EE_Parameter.Hoehe_Verstaerkung = 2; // Wert : 0-50 |
+ EE_Parameter.Stick_P = 4; //2 // Wert : 1-6 |
+ EE_Parameter.Stick_D = 0; //8 // Wert : 0-64 |
+ EE_Parameter.Gier_P = 16; // Wert : 1-20 |
+ EE_Parameter.Gas_Min = 5; // Wert : 0-32 // (160607Kr) |
+ EE_Parameter.Gas_Max = 250; // Wert : 33-250 |
+ EE_Parameter.GyroAccFaktor = 26; // Wert : 1-64 |
+ EE_Parameter.KompassWirkung = 16; // Wert : 0-250 |
+ EE_Parameter.Gyro_P = 175; //80 // Wert : 0-250 |
+ EE_Parameter.Gyro_I = 175; // Wert : 0-250 |
+ EE_Parameter.UnterspannungsWarnung = 95; // Wert : 0-250 // (160607Kr) |
+ EE_Parameter.NotGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
+ EE_Parameter.NotGasZeit = 20; // Wert : 0-250 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen |
+ EE_Parameter.UfoAusrichtung = 0; // X oder + Formation |
+ EE_Parameter.I_Faktor = 0; |
+ EE_Parameter.UserParam1 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam2 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam3 = 0; //zur freien Verwendung |
+ EE_Parameter.UserParam4 = 120; //zur freien Verwendung |
+ EE_Parameter.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
+ EE_Parameter.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
+ EE_Parameter.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
+ EE_Parameter.ServoNickRefresh = 5; |
+ EE_Parameter.LoopGasLimit = 50; |
+ EE_Parameter.LoopThreshold = 90; // Wert: 0-250 Schwelle für Stickausschlag |
+ EE_Parameter.LoopConfig = 0; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts |
+ memcpy(EE_Parameter.Name, "Kamera\0", 12); |
+} |
+ |
+ |
+//############################################################################ |
+// Trägt ggf. das Poti als Parameter ein |
+void ParameterZuordnung(void) |
+//############################################################################ |
+{ |
+ |
+ #define CHK_POTI(b,a,min,max) { if(a > 250) { if(a == 251) b = Poti1; else if(a == 252) b = Poti2; else if(a == 253) b = Poti3; else if(a == 254) b = Poti4;} else b = a; if(b <= min) b = min; else if(b >= max) b = max;} |
+ CHK_POTI(Parameter_MaxHoehe,EE_Parameter.MaxHoehe,0,255); |
+ CHK_POTI(Parameter_Luftdruck_D,EE_Parameter.Luftdruck_D,0,100); |
+ CHK_POTI(Parameter_Hoehe_P,EE_Parameter.Hoehe_P,0,100); |
+ CHK_POTI(Parameter_Hoehe_ACC_Wirkung,EE_Parameter.Hoehe_ACC_Wirkung,0,255); |
+ CHK_POTI(Parameter_KompassWirkung,EE_Parameter.KompassWirkung,0,255); |
+ CHK_POTI(Parameter_Gyro_P,EE_Parameter.Gyro_P,10,255); |
+ CHK_POTI(Parameter_Gyro_I,EE_Parameter.Gyro_I,0,255); |
+ CHK_POTI(Parameter_I_Faktor,EE_Parameter.I_Faktor,0,255); |
+ CHK_POTI(Parameter_UserParam1,EE_Parameter.UserParam1,0,255); |
+ CHK_POTI(Parameter_UserParam2,EE_Parameter.UserParam2,0,255); |
+ CHK_POTI(Parameter_UserParam3,EE_Parameter.UserParam3,0,255); |
+ CHK_POTI(Parameter_UserParam4,EE_Parameter.UserParam4,0,255); |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255); |
+ CHK_POTI(Parameter_LoopGasLimit,EE_Parameter.LoopGasLimit,0,255); |
+ |
+ Ki = (float) Parameter_I_Faktor * 0.0001; |
+ MAX_GAS = EE_Parameter.Gas_Max; |
+ MIN_GAS = EE_Parameter.Gas_Min; |
+} |
+ |
+ |
+//############################################################################ |
+// |
+void MotorRegler(void) |
+//############################################################################ |
+{ |
+ int motorwert,pd_ergebnis,h,tmp_int; |
+ int GierMischanteil,GasMischanteil; |
+ static long SummeNick=0,SummeRoll=0; |
+ static long sollGier = 0,tmp_long,tmp_long2; |
+ long IntegralFehlerNick = 0; |
+ long IntegralFehlerRoll = 0; |
+ static unsigned int RcLostTimer; |
+ static unsigned char delay_neutral = 0; |
+ static unsigned char delay_einschalten = 0,delay_ausschalten = 0; |
+ static unsigned int modell_fliegt = 0; |
+ static int hoehenregler = 0; |
+ static char TimerWerteausgabe = 0; |
+ static char NeueKompassRichtungMerken = 0; |
+ Mittelwert(); |
+ |
+ GRN_ON; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gaswert ermitteln |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ GasMischanteil = PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] + 120; |
+ if(GasMischanteil < 0) GasMischanteil = 0; |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Emfang schlecht |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(SenderOkay < 100) |
+ { |
+ if(!PcZugriff) |
+ { |
+ if(BeepMuster == 0xffff) |
+ { |
+ beeptime = 15000; |
+ BeepMuster = 0x0c00; |
+ } |
+ } |
+ if(RcLostTimer) RcLostTimer--; |
+ else |
+ { |
+ MotorenEin = 0; |
+ Notlandung = 0; |
+ } |
+ ROT_ON; |
+ if(modell_fliegt > 2000) // wahrscheinlich in der Luft --> langsam absenken |
+ { |
+ GasMischanteil = EE_Parameter.NotGas; |
+ Notlandung = 1; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
+ PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] = 0; |
+ } |
+ else MotorenEin = 0; |
+ } |
+ else |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Emfang gut |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(SenderOkay > 140) |
+ { |
+ Notlandung = 0; |
+ RcLostTimer = EE_Parameter.NotGasZeit * 50; |
+ if(GasMischanteil > 40) |
+ { |
+ if(modell_fliegt < 0xffff) modell_fliegt++; |
+ modell_fliegt_gps = modell_fliegt;// (030907Kr) |
+ } |
+ if((modell_fliegt < 200) || (GasMischanteil < 40)) |
+ { |
+ SummeNick = 0; |
+ SummeRoll = 0; |
+ Mess_Integral_Gier = 0; |
+ Mess_Integral_Gier2 = 0; |
+ } |
+ if((GasMischanteil > 200) && MotorenEin == 0) |
+ { |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// auf Nullwerte kalibrieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) // Neutralwerte |
+ { |
+ unsigned char setting; |
+ if(++delay_neutral > 200) // nicht sofort |
+ { |
+ GRN_OFF; |
+ MotorenEin = 0; |
+ delay_neutral = 0; |
+ modell_fliegt = 0; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70 || abs(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]) > 70) |
+ { |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < 70) setting = 1; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 2; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] < 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 3; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] <-70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 4; |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] <-70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < 70) setting = 5; |
+ eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], setting); // aktiven Datensatz merken |
+ } |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
+ { |
+ if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset(); |
+ } |
+ ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
+ SetNeutral(); |
+ Piep(GetActiveParamSetNumber()); |
+ } |
+ } |
+ else delay_neutral = 0; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gas ist unten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(GasMischanteil < 35) |
+ { |
+ // Starten |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] < -75) |
+ { |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Einschalten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(++delay_einschalten > 200) |
+ { |
+ delay_einschalten = 200; |
+ modell_fliegt = 1; |
+ MotorenEin = 1; |
+ sollGier = 0; |
+ Mess_Integral_Gier = 0; |
+ Mess_Integral_Gier2 = 0; |
+ Mess_IntegralNick = 0; |
+ Mess_IntegralRoll = 0; |
+ Mess_IntegralNick2 = IntegralNick; |
+ Mess_IntegralRoll2 = IntegralRoll; |
+ SummeNick = 0; |
+ SummeRoll = 0; |
+ } |
+ } |
+ else delay_einschalten = 0; |
+ //Auf Neutralwerte setzen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Auschalten |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) |
+ { |
+ if(++delay_ausschalten > 200) // nicht sofort |
+ { |
+ MotorenEin = 0; |
+ delay_ausschalten = 200; |
+ modell_fliegt = 0; |
+ } |
+ } |
+ else delay_ausschalten = 0; |
+ } |
+ } |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// neue Werte von der Funke |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(!NewPpmData-- || Notlandung) |
+ { |
+ ParameterZuordnung(); |
+ StickNick = PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_P; |
+ StickNick += PPM_diff[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_D; |
+ StickRoll = PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_P; |
+ StickRoll += PPM_diff[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_D; |
+ StickGier = -PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]; |
+ GyroFaktor = ((float)Parameter_Gyro_P + 10.0) / 256.0; |
+ IntegralFaktor = ((float) Parameter_Gyro_I) / 44000; |
+ |
+ if(EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) IntegralFaktor = 0; |
+ if(GyroFaktor < 0) GyroFaktor = 0; |
+ if(IntegralFaktor < 0) IntegralFaktor = 0; |
+ // greift in den Stick ein, um ungewolltes überschlagen zu verhindern |
+ if(!(EE_Parameter.LoopConfig & CFG_LOOP_LINKS) && !(EE_Parameter.LoopConfig & CFG_LOOP_RECHTS)) |
+ { |
+ if(IntegralNick > 60000) |
+ { |
+ StickNick -= 8 * EE_Parameter.Stick_P; |
+ if(IntegralNick > 80000) StickNick -= 16 * EE_Parameter.Stick_P; |
+ } |
+ else |
+ if(IntegralNick < -60000) |
+ { |
+ StickNick += 8 * EE_Parameter.Stick_P; |
+ if(IntegralNick > 80000) StickNick -= 16 * EE_Parameter.Stick_P; |
+ } |
+ if(IntegralRoll > 60000) |
+ { |
+ StickRoll -= 8 * EE_Parameter.Stick_P; |
+ if(IntegralRoll > 80000) StickRoll -= 16 * EE_Parameter.Stick_P; |
+ } |
+ else |
+ if(IntegralRoll < -60000) |
+ { |
+ StickRoll += 8 * EE_Parameter.Stick_P; |
+ if(IntegralRoll > 80000) StickRoll -= 16 * EE_Parameter.Stick_P; |
+ } |
+ } |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// LED Stuff |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+LED1_OFF; |
+ |
+ if(blinkcount_LED1 >= Parameter_UserParam4 && Parameter_UserParam4 > 0) |
+ { |
+ LED1_FLASH; |
+ blinkcount_LED1 = 0; |
+ } |
+ |
+ blinkcount_LED1++; |
+ |
+ //if(PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] > 75) LED1_ON; else LED1_OFF; //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
+ //if(PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] > 75) LED2_ON; else LED2_OFF; //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
+ } |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Looping? |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(((PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > EE_Parameter.LoopThreshold) && EE_Parameter.LoopConfig & CFG_LOOP_LINKS) || |
+ ((PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] < -EE_Parameter.LoopThreshold) && EE_Parameter.LoopConfig & CFG_LOOP_RECHTS)) |
+ { |
+ Looping_Roll = 1; |
+ if(GasMischanteil > EE_Parameter.LoopGasLimit) GasMischanteil = EE_Parameter.LoopGasLimit; |
+ } |
+ else Looping_Roll = 0; |
+ |
+ if(((PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > EE_Parameter.LoopThreshold) && EE_Parameter.LoopConfig & CFG_LOOP_OBEN) || |
+ ((PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < -EE_Parameter.LoopThreshold) && EE_Parameter.LoopConfig & CFG_LOOP_UNTEN)) |
+ { |
+ Looping_Nick = 1; |
+ Looping_Roll = 0; |
+ if(GasMischanteil > EE_Parameter.LoopGasLimit) GasMischanteil = EE_Parameter.LoopGasLimit; |
+ } |
+ else Looping_Nick = 0; |
+ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Bei Empfangsausfall im Flug |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(Notlandung) |
+ { |
+ StickGier = 0; |
+ StickNick = 0; |
+ StickRoll = 0; |
+ GyroFaktor = 0.1; |
+ IntegralFaktor = 0.005; |
+ Looping_Roll = 0; |
+ Looping_Nick = 0; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gyro-Drift kompensieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define DRIFT_FAKTOR 3 |
+ if(ZaehlMessungen >= 1000 / DRIFT_FAKTOR) |
+ { |
+ IntegralFehlerNick = IntegralNick2 - IntegralNick; |
+ IntegralFehlerRoll = IntegralRoll2 - IntegralRoll; |
+ ZaehlMessungen = 0; |
+ if(IntegralFehlerNick > 500/DRIFT_FAKTOR) AdNeutralNick++; |
+ if(IntegralFehlerNick < -500/DRIFT_FAKTOR) AdNeutralNick--; |
+ if(IntegralFehlerRoll > 500/DRIFT_FAKTOR) AdNeutralRoll++; |
+ if(IntegralFehlerRoll < -500/DRIFT_FAKTOR) AdNeutralRoll--; |
+// if(Mess_Integral_Gier2 > 500/DRIFT_FAKTOR) AdNeutralGier--; // macht nur mit Referenz (Kompass Sinn) |
+// if(Mess_Integral_Gier2 <-500/DRIFT_FAKTOR) AdNeutralGier++; // macht nur mit Referenz (Kompass Sinn) |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_IntegralNick2 = IntegralNick; |
+ Mess_IntegralRoll2 = IntegralRoll; |
+ Mess_Integral_Gier2 = Integral_Gier; |
+ ANALOG_ON; // ADC einschalten |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Integrale auf ACC-Signal abgleichen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+ |
+ if(EE_Parameter.GlobalConfig & CFG_GPS_AKTIV) |
+ { |
+ tmp_long = (long)(IntegralNick / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccNick) / 16; |
+ tmp_long2 = (long)(IntegralRoll / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccRoll) / 16; |
+ #define AUSGLEICH 500 |
+ if(tmp_long > AUSGLEICH) tmp_long = AUSGLEICH; |
+ if(tmp_long < -AUSGLEICH) tmp_long =-AUSGLEICH; |
+ if(tmp_long2 > AUSGLEICH) tmp_long2 = AUSGLEICH; |
+ if(tmp_long2 <-AUSGLEICH) tmp_long2 =-AUSGLEICH; |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_IntegralNick -= tmp_long; |
+ Mess_IntegralRoll -= tmp_long2; |
+ } |
+ |
+ else |
+ { |
+ if(IntegralFaktor && !Looping_Nick && !Looping_Roll) |
+ { |
+ tmp_long = (long)(IntegralNick / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccNick); |
+ if(labs(Mittelwert_AccNick) < 200) tmp_long /= 8; |
+ else tmp_long /= 16; |
+ tmp_long2 = (long)(IntegralRoll / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccRoll); |
+ if(labs(Mittelwert_AccRoll) < 200) tmp_long2 /= 8; |
+ else tmp_long2 /= 16; |
+ |
+ #define AUSGLEICH 500 |
+ if(tmp_long > AUSGLEICH) tmp_long = AUSGLEICH; |
+ if(tmp_long < -AUSGLEICH) tmp_long =-AUSGLEICH; |
+ if(tmp_long2 > AUSGLEICH) tmp_long2 = AUSGLEICH; |
+ if(tmp_long2 <-AUSGLEICH) tmp_long2 =-AUSGLEICH; |
+ } |
+ |
+ else |
+ { |
+ tmp_long = 0; |
+ tmp_long2 = 0; |
+ } |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_IntegralNick -= tmp_long; |
+ Mess_IntegralRoll -= tmp_long2; |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gieren |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(abs(StickGier) > 20) // war 35 |
+ { |
+ if(!(EE_Parameter.GlobalConfig & CFG_KOMPASS_FIX)) NeueKompassRichtungMerken = 1; |
+ } |
+ tmp_int = EE_Parameter.Gier_P * (StickGier * abs(StickGier)) / 512; // expo y = ax + bx² |
+ tmp_int += (EE_Parameter.Gier_P * StickGier) / 4; |
+ sollGier = tmp_int; |
+ Mess_Integral_Gier -= tmp_int; |
+ if(Mess_Integral_Gier > 25000) Mess_Integral_Gier = 25000; // begrenzen |
+ if(Mess_Integral_Gier <-25000) Mess_Integral_Gier =-25000; |
+ |
+ ANALOG_ON; // ADC einschalten |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Kompass |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(KompassValue && (EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV)) |
+ { |
+ if(NeueKompassRichtungMerken) |
+ { |
+ KompassStartwert = KompassValue; |
+ NeueKompassRichtungMerken = 0; |
+ } |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ Mess_Integral_Gier -= (KompassRichtung * Parameter_KompassWirkung) / 32; // nach Kompass ausrichten |
+ ANALOG_ON; // ADC einschalten |
+ } |
+ |
+ |
+ |
+ |
+/* if(KompassValue && (EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV)) |
+ { |
+ int w,v; |
+ static int SignalSchlecht = 0; |
+ w = abs(IntegralNick /512); // mit zunehmender Neigung den Einfluss drosseln |
+ v = abs(IntegralRoll /512); |
+ if(v > w) w = v; // grösste Neigung ermitteln |
+ if(w < 25 && NeueKompassRichtungMerken && !SignalSchlecht) |
+ { |
+ KompassStartwert = KompassValue; |
+ NeueKompassRichtungMerken = 0; |
+ } |
+ w = (w * Parameter_KompassWirkung) / 64; // auf die Wirkung normieren |
+ w = Parameter_KompassWirkung - w; // Wirkung ggf drosseln |
+ if(w > 0) |
+ { |
+ ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern |
+ if(!SignalSchlecht) Mess_Integral_Gier += (KompassRichtung * w) / 32; // nach Kompass ausrichten |
+ ANALOG_ON; // ADC einschalten |
+ if(SignalSchlecht) SignalSchlecht--; |
+ } |
+ else SignalSchlecht = 500; // so lange das Signal taub stellen --> ca. 1 sek |
+ } |
+*/ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// GPS |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+if(EE_Parameter.GlobalConfig & CFG_GPS_AKTIV) |
+{ |
+ P_GPS_Verstaerkung = Parameter_UserParam1; |
+ D_GPS_Verstaerkung = Parameter_UserParam2; |
+ Limit_D_Anteil = Parameter_UserParam3; |
+ gps_main(); |
+} |
+else |
+{ |
+ GPS_Nick = 0; |
+ GPS_Roll = 0; |
+} |
+ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Debugwerte zuordnen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(!TimerWerteausgabe--) |
+ { |
+ TimerWerteausgabe = 49; |
+ |
+ DebugOut.Analog[0] = actualPos.GPSFix; |
+ DebugOut.Analog[1] = GPS_Roll; |
+ DebugOut.Analog[2] = GPS_Nick; |
+ DebugOut.Analog[3] = GPS_Positionsabweichung_North; |
+ DebugOut.Analog[4] = GPS_Positionsabweichung_East; |
+ DebugOut.Analog[5] = P_Einfluss_East; |
+ DebugOut.Analog[6] = D_Einfluss_East; |
+ DebugOut.Analog[7] = KompassRichtung; |
+ DebugOut.Analog[8] = KompassValue; |
+ DebugOut.Analog[9] = MM3.x_axis; |
+ DebugOut.Analog[10] = MM3.y_axis; |
+ DebugOut.Analog[11] = MM3.z_axis; |
+ DebugOut.Analog[12] = Parameter_UserParam2; |
+ DebugOut.Analog[13] = Poti3; |
+ DebugOut.Analog[14] = KompassValue; |
+ DebugOut.Analog[15] = GPS_Home_North; |
+ DebugOut.Analog[16] = GPS_Home_East; |
+ DebugOut.Analog[17] = NORTH_MITTEL; |
+ DebugOut.Analog[18] = EAST_MITTEL; |
+ DebugOut.Analog[19] = actualPos.northing; |
+ DebugOut.Analog[20] = actualPos.easting; |
+ DebugOut.Analog[21] = actualPos.velNorth; |
+ DebugOut.Analog[22] = actualPos.velEast; |
+ DebugOut.Analog[23] = UBat; |
+ DebugOut.Analog[24] = (motor_rx[0]+motor_rx[1]+motor_rx[2]+motor_rx[3]); //Gesamtstrom |
+ DebugOut.Analog[25] = StickRoll; |
+ DebugOut.Analog[26] = HoehenWert; |
+ DebugOut.Analog[27] = IntegralNick / EE_Parameter.GyroAccFaktor; |
+ DebugOut.Analog[28] = IntegralRoll / EE_Parameter.GyroAccFaktor; |
+ DebugOut.Analog[29] = Mittelwert_AccNick; |
+ DebugOut.Analog[30] = Mittelwert_AccRoll; |
+ DebugOut.Analog[31] = StickNick; |
+ } |
+/* |
+DebugOut.Analog[0] = MM3.NickGrad; |
+DebugOut.Analog[1] = MM3.RollGrad; |
+DebugOut.Analog[9] = MM3.x_axis; |
+DebugOut.Analog[10] = MM3.y_axis; |
+DebugOut.Analog[11] = MM3.z_axis; |
+*/ |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Drehgeschwindigkeit und -winkel zu einem Istwert zusammenfassen |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ if(Looping_Nick) MesswertNick = MesswertNick * GyroFaktor; |
+ else MesswertNick = IntegralNick * IntegralFaktor + MesswertNick * GyroFaktor; |
+ if(Looping_Roll) MesswertRoll = MesswertRoll * GyroFaktor; |
+ else MesswertRoll = IntegralRoll * IntegralFaktor + MesswertRoll * GyroFaktor; |
+// MesswertGier = MesswertGier * (GyroFaktor/2) + Integral_Gier * IntegralFaktor; |
+ |
+ MesswertGier = MesswertGier * (GyroFaktor) + Integral_Gier * IntegralFaktor/2; |
+ |
+ // Maximalwerte abfangen |
+ #define MAX_SENSOR 2048 |
+ if(MesswertNick > MAX_SENSOR) MesswertNick = MAX_SENSOR; |
+ if(MesswertNick < -MAX_SENSOR) MesswertNick = -MAX_SENSOR; |
+ if(MesswertRoll > MAX_SENSOR) MesswertRoll = MAX_SENSOR; |
+ if(MesswertRoll < -MAX_SENSOR) MesswertRoll = -MAX_SENSOR; |
+ if(MesswertGier > MAX_SENSOR) MesswertGier = MAX_SENSOR; |
+ if(MesswertGier < -MAX_SENSOR) MesswertGier = -MAX_SENSOR; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Höhenregelung |
+// Die Höhenregelung schwächt lediglich das Gas ab, erhöht es allerdings nicht |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+//OCR0B = 180 - (Poti1 + 120) / 4; |
+//DruckOffsetSetting = OCR0B; |
+ if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung |
+ { |
+ int tmp_int; |
+ if(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER) // Regler wird über Schalter gesteuert |
+ { |
+ if(Parameter_MaxHoehe < 50) |
+ { |
+ SollHoehe = HoehenWert - 40; // Parameter_MaxHoehe ist der PPM-Wert des Schalters // (160607Kr) |
+ HoehenReglerAktiv = 0; |
+ } |
+ else |
+ HoehenReglerAktiv = 1; |
+ } |
+ else |
+ { |
+ SollHoehe = Parameter_MaxHoehe * EE_Parameter.Hoehe_Verstaerkung - 40; // (160607Kr) |
+ HoehenReglerAktiv = 1; |
+ } |
+ |
+ if(Notlandung) SollHoehe = 0; |
+ h = HoehenWert; |
+ if((h > SollHoehe) && HoehenReglerAktiv) // zu hoch --> drosseln |
+ { h = ((h - SollHoehe) * (int) Parameter_Hoehe_P) / 16; // Differenz bestimmen --> P-Anteil |
+ h = GasMischanteil - h; // vom Gas abziehen |
+ h -= (HoeheD * Parameter_Luftdruck_D)/8; // D-Anteil |
+ tmp_int = ((Mess_Integral_Hoch / 512) * (signed long) Parameter_Hoehe_ACC_Wirkung) / 32; |
+ if(tmp_int > 50) tmp_int = 50; |
+ else if(tmp_int < -50) tmp_int = -50; |
+ h -= tmp_int; |
+ hoehenregler = (hoehenregler*15 + h) / 16; |
+ if(hoehenregler < EE_Parameter.Hoehe_MinGas) // nicht unter MIN |
+ { |
+ if(GasMischanteil >= EE_Parameter.Hoehe_MinGas) hoehenregler = EE_Parameter.Hoehe_MinGas; |
+ if(GasMischanteil < EE_Parameter.Hoehe_MinGas) hoehenregler = GasMischanteil; |
+ } |
+ if(hoehenregler > GasMischanteil) hoehenregler = GasMischanteil; // nicht mehr als Gas |
+ GasMischanteil = hoehenregler; |
+ } |
+ } |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// + Mischer und PI-Regler |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ // DebugOut.Analog[7] = GasMischanteil; |
+ |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Gier-Anteil |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+#define MUL_G 1.0 |
+ GierMischanteil = MesswertGier - sollGier; // Regler für Gier |
+//GierMischanteil = 0; |
+ if(GierMischanteil > (MUL_G * GasMischanteil)) GierMischanteil = MUL_G * GasMischanteil; |
+ if(GierMischanteil < -(MUL_G * GasMischanteil)) GierMischanteil = -(MUL_G * GasMischanteil); |
+ if(GierMischanteil > 100) GierMischanteil = 100; |
+ if(GierMischanteil < -100) GierMischanteil = -100; |
+ |
+ if(GasMischanteil < 20) GierMischanteil = 0; |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Nick-Achse |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ |
+ DiffNick = Kp * (MesswertNick - (StickNick - GPS_Nick)); // Differenz bestimmen |
+ SummeNick += DiffNick; // I-Anteil |
+ if(SummeNick > 0) SummeNick-= (abs(SummeNick)/256 + 1); else SummeNick += abs(SummeNick)/256 + 1; |
+ if(SummeNick > 16000) SummeNick = 16000; |
+ if(SummeNick < -16000) SummeNick = -16000; |
+ pd_ergebnis = DiffNick;// + Ki * SummeNick; // PI-Regler für Nick |
+ // Motor Vorn |
+#define MUL 2 |
+ if(pd_ergebnis > MUL * (GasMischanteil + abs(GierMischanteil))) pd_ergebnis = MUL * (GasMischanteil + abs(GierMischanteil)); |
+ if(pd_ergebnis < -MUL * (GasMischanteil + abs(GierMischanteil))) pd_ergebnis = -MUL * (GasMischanteil + abs(GierMischanteil)); |
+ |
+ motorwert = GasMischanteil + pd_ergebnis + GierMischanteil; // Mischer |
+ if ((motorwert < 0)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Vorne = motorwert; |
+ // Motor Heck |
+ motorwert = GasMischanteil - pd_ergebnis + GierMischanteil; |
+ if ((motorwert < 0)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Hinten = motorwert; |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+// Roll-Achse |
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
+ DiffRoll = Kp * (MesswertRoll - (StickRoll - GPS_Roll)); // Differenz bestimmen |
+ SummeRoll += DiffRoll; // I-Anteil |
+ if(SummeRoll > 0) SummeRoll-= (abs(SummeRoll)/256 + 1); else SummeRoll += abs(SummeRoll)/256 + 1; |
+ if(SummeRoll > 16000) SummeRoll = 16000; |
+ if(SummeRoll < -16000) SummeRoll = -16000; |
+ pd_ergebnis = DiffRoll;// + Ki * SummeRoll; // PI-Regler für Roll |
+ if(pd_ergebnis > MUL * (GasMischanteil + abs(GierMischanteil))) pd_ergebnis = MUL * (GasMischanteil + abs(GierMischanteil)); |
+ if(pd_ergebnis < -MUL * (GasMischanteil + abs(GierMischanteil))) pd_ergebnis = -MUL * (GasMischanteil + abs(GierMischanteil)); |
+ // Motor Links |
+ motorwert = GasMischanteil + pd_ergebnis - GierMischanteil; |
+ if ((motorwert < 0)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Links = motorwert; |
+ // Motor Rechts |
+ motorwert = GasMischanteil - pd_ergebnis - GierMischanteil; |
+ if ((motorwert < 0)) motorwert = 0; |
+ else if(motorwert > MAX_GAS) motorwert = MAX_GAS; |
+ if (motorwert < MIN_GAS) motorwert = MIN_GAS; |
+ Motor_Rechts = motorwert; |
+ // +++++++++++++++++++++++++++++++++++++++++++++++ |
+} |
+ |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/fc.h |
---|
0,0 → 1,128 |
/*####################################################################################### |
Flight Control |
#######################################################################################*/ |
#ifndef _FC_H |
#define _FC_H |
extern volatile unsigned int I2CTimeout; |
extern unsigned char Sekunde,Minute; |
extern volatile long IntegralNick,IntegralNick2; |
extern volatile long IntegralRoll,IntegralRoll2; |
extern volatile long Mess_IntegralNick,Mess_IntegralNick2; |
extern volatile long Mess_IntegralRoll,Mess_IntegralRoll2; |
extern volatile long Mess_Integral_Hoch; |
extern volatile long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2; |
extern volatile int KompassValue; |
extern volatile int KompassStartwert; |
extern volatile int KompassRichtung; |
extern int HoehenWert; |
extern int SollHoehe; |
extern volatile int MesswertNick,MesswertRoll,MesswertGier; |
extern volatile int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll; |
extern volatile int NeutralAccX, NeutralAccY,Mittelwert_AccHoch; |
extern volatile float NeutralAccZ; |
extern unsigned int modell_fliegt_gps;//(030907Kr) |
extern unsigned char Limit_D_Anteil;//(210907Kr) |
void MotorRegler(void); |
void SendMotorData(void); |
void CalibrierMittelwert(void); |
void Mittelwert(void); |
void SetNeutral(void); |
//Nick666 Kompass |
void Piep(unsigned char Anzahl); |
void DefaultKonstanten1(void); |
void DefaultKonstanten2(void); |
unsigned char h,m,s; |
volatile unsigned char Timeout ; |
unsigned char CosinusNickWinkel, CosinusRollWinkel; |
volatile long IntegralNick,IntegralNick2; |
volatile long IntegralRoll,IntegralRoll2; |
volatile long Integral_Gier; |
volatile long Mess_IntegralNick,Mess_IntegralNick2; |
volatile long Mess_IntegralRoll,Mess_IntegralRoll2; |
volatile long Mess_Integral_Gier; |
volatile int DiffNick,DiffRoll; |
extern int Poti1, Poti2, Poti3, Poti4, Poti5, Poti6, Poti7, Poti8; //PPM24-Erweiterung (121007Kr) |
volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
unsigned char MotorWert[5]; |
volatile unsigned char SenderOkay; |
int StickNick,StickRoll,StickGier; |
char MotorenEin; |
extern void DefaultKonstanten(void); |
#define STRUCT_PARAM_LAENGE 58 |
struct mk_param_struct |
{ |
unsigned char Kanalbelegung[8]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3 |
unsigned char GlobalConfig; // 0x01=Höhenregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv |
unsigned char Hoehe_MinGas; // Wert : 0-100 |
unsigned char Luftdruck_D; // Wert : 0-250 |
unsigned char MaxHoehe; // Wert : 0-32 |
unsigned char Hoehe_P; // Wert : 0-32 |
unsigned char Hoehe_Verstaerkung; // Wert : 0-50 |
unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250 |
unsigned char Stick_P; // Wert : 1-6 |
unsigned char Stick_D; // Wert : 0-64 |
unsigned char Gier_P; // Wert : 1-20 |
unsigned char Gas_Min; // Wert : 0-32 |
unsigned char Gas_Max; // Wert : 33-250 |
unsigned char GyroAccFaktor; // Wert : 1-64 |
unsigned char KompassWirkung; // Wert : 0-32 |
unsigned char Gyro_P; // Wert : 10-250 |
unsigned char Gyro_I; // Wert : 0-250 |
unsigned char UnterspannungsWarnung; // Wert : 0-250 |
unsigned char NotGas; // Wert : 0-250 //Gaswert bei Empängsverlust |
unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen |
unsigned char UfoAusrichtung; // X oder + Formation |
unsigned char I_Faktor; // Wert : 0-250 |
unsigned char UserParam1; // Wert : 0-250 |
unsigned char UserParam2; // Wert : 0-250 |
unsigned char UserParam3; // Wert : 0-250 |
unsigned char UserParam4; // Wert : 0-250 |
unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos |
unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo |
unsigned char ServoNickMin; // Wert : 0-250 // Anschlag |
unsigned char ServoNickMax; // Wert : 0-250 // Anschlag |
unsigned char ServoNickRefresh; // |
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping |
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag |
//------------------------------------------------ |
unsigned char LoopConfig; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen |
unsigned char Reserved[4]; |
char Name[12]; |
}; |
/* |
unsigned char ServoNickMax; // Wert : 0-250 |
unsigned char ServoNickRefresh; // |
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping |
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag |
//------------------------------------------------ |
unsigned char LoopConfig; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen |
unsigned char Reserved[4]; |
char Name[12]; |
*/ |
extern struct mk_param_struct EE_Parameter; |
extern unsigned char Parameter_Luftdruck_D; |
extern unsigned char Parameter_MaxHoehe; |
extern unsigned char Parameter_Hoehe_P; |
extern unsigned char Parameter_Hoehe_ACC_Wirkung; |
extern unsigned char Parameter_KompassWirkung; |
extern unsigned char Parameter_Gyro_P; |
extern unsigned char Parameter_Gyro_I; |
extern unsigned char Parameter_Gier_P; |
extern unsigned char Parameter_ServoNickControl; |
#endif //_FC_H |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/flight-ctrl_mega644_v0_64.aws |
---|
0,0 → 1,0 |
<AVRWorkspace><IOSettings><CurrentRegisters/></IOSettings><part name="ATMEGA644"/><Files><File00000 Name="E:\hubi\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\beta\v064JokoGPSNick666MM_1_1_compiled\main.c" Position="330 71 1176 569" LineCol="127 0" State="Maximized"/><File00001 Name="E:\hubi\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\beta\v064JokoGPSNick666MM_1_1_compiled\compass.c" Position="327 65 1173 563" LineCol="47 0" State="Maximized"/><File00002 Name="E:\hubi\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\beta\v064JokoGPSNick666MM_1_1_compiled\compass.h" Position="299 84 845 452" LineCol="37 0" State="Maximized"/><File00003 Name="E:\hubi\mickrokopter\a Versions\version system\flightcontrol\branches\MergedVersionsByOsiair\beta\v064JokoGPSNick666MM_1_1_compiled\fc.c" Position="336 71 1182 569" LineCol="864 0" State="Maximized"/></Files></AVRWorkspace> |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/flight.pnproj |
---|
0,0 → 1,0 |
<Project name="Flight-Ctrl"><File path="uart.h"></File><File path="main.c"></File><File path="main.h"></File><File path="makefile"></File><File path="uart.c"></File><File path="printf_P.h"></File><File path="printf_P.c"></File><File path="timer0.c"></File><File path="timer0.h"></File><File path="old_macros.h"></File><File path="twimaster.c"></File><File path="version.txt"></File><File path="twimaster.h"></File><File path="rc.c"></File><File path="rc.h"></File><File path="fc.h"></File><File path="fc.c"></File><File path="menu.h"></File><File path="menu.c"></File><File path="_Settings.h"></File><File path="analog.c"></File><File path="analog.h"></File><File path="GPS.c"></File><File path="gps.h"></File><File path="License.txt"></File></Project> |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/flight.pnps |
---|
0,0 → 1,0 |
<pd><ViewState><e p="Flight-Ctrl" x="true"></e></ViewState></pd> |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/gps.h |
---|
0,0 → 1,26 |
extern long P_Einfluss_North; |
extern long D_Einfluss_North; |
extern long P_Einfluss_East; |
extern long D_Einfluss_East; |
extern long GPS_Positionsabweichung_North; |
extern long GPS_Positionsabweichung_East; |
extern long GPS_Geschwindigkeit_North; |
extern long GPS_Geschwindigkeit_East; |
extern long GPS_Home_North; |
extern long GPS_Home_East; |
extern long Soll_Position_North; |
extern long Soll_Position_East; |
extern volatile long EAST_MITTEL; |
extern volatile long NORTH_MITTEL; |
extern signed int GPS_Nick; |
extern signed int GPS_Roll; |
extern void GPS_Neutral(void); |
extern void GPS_BerechneZielrichtung(void); |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/main.c |
---|
0,0 → 1,257 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + Nur für den privaten Gebrauch |
// + www.MikroKopter.com |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
// + dass eine Nutzung (auch auszugsweise) nur für den privaten und nicht-kommerziellen Gebrauch zulässig ist. |
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
// + bzgl. der Nutzungsbedingungen aufzunehmen. |
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
// + Verkauf von Luftbildaufnahmen, usw. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
// + auf anderen Webseiten oder Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
// + eindeutig als Ursprung verlinkt und genannt werden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
// + Benutzung auf eigene Gefahr |
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
// + mit unserer Zustimmung zulässig |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
// + this list of conditions and the following disclaimer. |
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
// + from this software without specific prior written permission. |
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet |
// + for non-commercial use (directly or indirectly) |
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
// + with our written permission |
// + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
// + clearly linked as origin |
// + * porting to systems other than hardware from www.mikrokopter.de is not allowed |
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
//unsigned char EEPromArray[E2END+1] EEMEM; |
unsigned char EEPromArray[501] EEMEM; //Nick666 Kompass |
unsigned char PlatinenVersion = 10; |
// -- Parametersatz aus EEPROM lesen --- |
// number [0..5] |
void ReadParameterSet(unsigned char number, unsigned char *buffer, unsigned char length) |
{ |
if (number > 5) number = 5; |
eeprom_read_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * number], length); |
} |
// -- Parametersatz ins EEPROM schreiben --- |
// number [0..5] |
void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length) |
{ |
if(number > 5) number = 5; |
eeprom_write_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * number], length); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], number); // diesen Parametersatz als aktuell merken |
} |
unsigned char GetActiveParamSetNumber(void) |
{ |
unsigned char set; |
set = eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET]); |
if(set > 5) |
{ |
set = 2; |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], set); // diesen Parametersatz als aktuell merken |
} |
return(set); |
} |
//############################################################################ |
//Hauptprogramm |
int main (void) |
//############################################################################ |
{ |
unsigned int timer; |
//unsigned int timer2 = 0; |
DDRB = 0x00; |
PORTB = 0x00; |
for(timer = 0; timer < 1000; timer++); // verzögern |
if(PINB & 0x01) PlatinenVersion = 11; else PlatinenVersion = 10; |
DDRC = 0x81; // SCL |
PORTC = 0xff; // Pullup SDA |
DDRB = 0x1B; // LEDs und Druckoffset |
//Nick666 |
PORTB |= (1<<PB0); // LED_Rot |
DDRD = 0x3E; // Speaker & TXD & J3 J4 J5 |
//Nick666 |
DDRD |= (1<<PD7); // J7 |
/* |
PORTB = 0x01; // LED_Rot |
DDRD |=0x80; // J7 |
*/ |
PORTD = 0xF7; // LED |
MCUSR &=~(1<<WDRF); |
WDTCSR |= (1<<WDCE)|(1<<WDE); |
WDTCSR = 0; |
//Nick666 |
beeptime = 1000; |
//beeptime = 2000; |
StickGier = 0; PPM_in[K_GAS] = 0;StickRoll = 0; StickNick = 0; |
ROT_OFF; |
Timer_Init(); |
UART_Init(); |
rc_sum_init(); |
ADC_Init(); |
i2c_init(); |
MM3_init(); //Nick666 |
sei(); |
VersionInfo.Hauptversion = VERSION_HAUPTVERSION; |
VersionInfo.Nebenversion = VERSION_NEBENVERSION; |
VersionInfo.PCKompatibel = VERSION_KOMPATIBEL; |
printf("\n\rFlightControl\n\rHardware:%d.%d\n\rSoftware:V%d.%d ",PlatinenVersion/10,PlatinenVersion%10, VERSION_HAUPTVERSION, VERSION_NEBENVERSION); |
printf("\n\r=============================="); |
GRN_ON; |
#define EE_DATENREVISION 62 // wird angepasst, wenn sich die EEPROM-Daten geändert haben |
if(eeprom_read_byte(&EEPromArray[EEPROM_ADR_VALID]) != EE_DATENREVISION) |
{ |
printf("\n\rInit. EEPROM: Generiere Default-Parameter..."); |
DefaultKonstanten1(); |
for (unsigned char i=0;i<6;i++) |
{ |
if(i==2) DefaultKonstanten2(); |
WriteParameterSet(i, (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
} |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], 2); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_VALID], EE_DATENREVISION); |
} |
ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
printf("\n\rBenutze Parametersatz %d", GetActiveParamSetNumber()); |
//kurze Wartezeit (sonst reagiert die "Kompass kalibrieren?"-Abfrage nicht |
timer = SetDelay(500); |
while(!CheckDelay(timer)); |
//Kompass kalibrieren? |
if(PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] > 100 && PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 100) |
{ |
printf("\n\rKalibriere Kompass"); |
if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV) MM3_calib(); |
} |
if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
printf("\n\rAbgleich Luftdrucksensor.."); |
timer = SetDelay(1000); |
SucheLuftruckOffset(); |
while (!CheckDelay(timer)); |
printf("OK\n\r"); |
} |
SetNeutral(); |
ROT_OFF; |
beeptime = 2000; |
DebugIn.Analog[1] = 1000; |
DebugIn.Digital[0] = 0x55; |
printf("\n\rSteuerung: "); |
if (EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) printf("HeadingHold"); |
else printf("Neutral"); |
printf("\n\n\r"); |
LcdClear(); |
I2CTimeout = 5000; |
while (1) |
{ |
if (UpdateMotor) // ReglerIntervall |
{ |
UpdateMotor=0; |
MotorRegler(); |
SendMotorData(); |
ROT_OFF; |
if(PcZugriff) PcZugriff--; |
if(SenderOkay) SenderOkay--; |
if(!I2CTimeout) |
{ |
I2CTimeout = 5; |
i2c_reset(); |
if((BeepMuster == 0xffff) && MotorenEin) |
{ |
beeptime = 10000; |
BeepMuster = 0x0080; |
} |
} |
else |
{ |
I2CTimeout--; |
ROT_OFF; |
} |
} |
if(SIO_DEBUG) |
{ |
DatenUebertragung(); |
BearbeiteRxDaten(); |
} |
else BearbeiteRxDaten(); |
if(CheckDelay(timer)) |
{ |
if(UBat < EE_Parameter.UnterspannungsWarnung) |
{ |
if(BeepMuster == 0xffff) |
{ |
beeptime = 6000; |
BeepMuster = 0x0300; |
} |
} |
timer = SetDelay(100); |
} |
} |
return (1); |
} |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/main.h |
---|
0,0 → 1,127 |
#ifndef _MAIN_H |
#define _MAIN_H |
//Hier die Quarz Frequenz einstellen |
#if defined (__AVR_ATmega32__) |
#define SYSCLK 20000000L //Quarz Frequenz in Hz |
#endif |
#if defined (__AVR_ATmega644__) |
#define SYSCLK 20000000L //Quarz Frequenz in Hz |
//#define SYSCLK 16000000L //Quarz Frequenz in Hz |
#endif |
// neue Hardware |
#define ROT_OFF PORTB &=~(1<<PB0) |
#define ROT_ON PORTB |= (1<<PB0) |
#define ROT_FLASH PORTB ^= (1<<PB0) |
#define GRN_OFF PORTB &=~(1<<PB1) |
#define GRN_ON PORTB |= (1<<PB1) |
#define GRN_FLASH PORTD ^= (1<<PB1) |
/* |
#define ROT_OFF {if(PlatinenVersion == 10) PORTB &=~0x01; else PORTB |= 0x01;} |
#define ROT_ON {if(PlatinenVersion == 10) PORTB |= 0x01; else PORTB &=~0x01;} |
#define ROT_FLASH PORTB ^= 0x01 |
#define GRN_OFF PORTB &=~0x02 |
#define GRN_ON PORTB |= 0x02 |
#define GRN_FLASH PORTB ^= 0x02 |
*/ |
#define LED1_OFF PORTC &=~0x04 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED1_ON PORTC |= 0x04 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED1_FLASH PORTC ^= 0x04 //Erweiterung by 4ndreas aus mikrosvn branches // (280807Kr) |
#define LED2_OFF PORTC &=~0x08 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED2_ON PORTC |= 0x08 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
#define LED2_FLASH PORTC ^= 0x08 //Erweiterung by 4ndreas aus mikrosvn branches // (280807Kr) |
//#ifndef F_CPU |
//#error ################## F_CPU nicht definiert oder ungültig ############# |
//#endif |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//#define ANZ_MITTELWERT 4 |
#define EEPROM_ADR_VALID 1 |
#define EEPROM_ADR_ACTIVE_SET 2 |
#define EEPROM_ADR_LAST_OFFSET 3 |
#define EEPROM_ADR_PARAM_BEGIN 100 |
#define CFG_HOEHENREGELUNG 0x01 |
#define CFG_HOEHEN_SCHALTER 0x02 |
#define CFG_HEADING_HOLD 0x04 |
#define CFG_KOMPASS_AKTIV 0x08 |
#define CFG_KOMPASS_FIX 0x10 |
#define CFG_GPS_AKTIV 0x20 |
#define CFG_LOOP_OBEN 0x01 |
#define CFG_LOOP_UNTEN 0x02 |
#define CFG_LOOP_LINKS 0x04 |
#define CFG_LOOP_RECHTS 0x08 |
//#define SYSCLK |
//extern unsigned long SYSCLK; |
extern volatile int i_Nick[20],i_Roll[20],DiffNick,DiffRoll; |
extern volatile unsigned char SenderOkay; |
extern unsigned char CosinusNickWinkel, CosinusRollWinkel; |
extern unsigned char PlatinenVersion; |
extern void ReadParameterSet (unsigned char number, unsigned char *buffer, unsigned char length); |
extern void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length); |
extern unsigned char GetActiveParamSetNumber(void); |
extern unsigned char EEPromArray[]; |
long durchschnitt_northing; |
long durchschnitt_easting; |
volatile int P_GPS_Verstaerkung; //P-Anteil (80-120) |
volatile int D_GPS_Verstaerkung; //D-Anteil (90) |
#include <stdlib.h> |
#include <string.h> |
#include <avr/io.h> |
#include <avr/pgmspace.h> |
#include <avr/interrupt.h> |
#include <avr/eeprom.h> |
#include <avr/boot.h> |
#include <avr/wdt.h> |
#include "old_macros.h" |
#include "_settings.h" |
#include "printf_P.h" |
#include "compass.h" //Nick666 |
#include "timer0.h" |
#include "uart.h" |
#include "analog.h" |
#include "twimaster.h" |
#include "menu.h" |
#include "rc.h" |
#include "fc.h" |
#include "gps.h" |
#include "math.h" //Nick666 |
#ifndef EEMEM |
#define EEMEM __attribute__ ((section (".eeprom"))) |
#endif |
#define DEBUG_DISPLAY_INTERVALL 123 // in ms |
#define DELAY_US(x) ((unsigned int)( (x) * 1e-6 * F_CPU )) |
#endif //_MAIN_H |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/makefile |
---|
0,0 → 1,392 |
#-------------------------------------------------------------------- |
# MCU name |
MCU = atmega644 |
F_CPU = 20000000 |
#------------------------------------------------------------------- |
HAUPT_VERSION = 0 |
NEBEN_VERSION = 64 |
VERSION_KOMPATIBEL = 5 # PC-Kompatibilität |
#------------------------------------------------------------------- |
ifeq ($(MCU), atmega32) |
# FUSE_SETTINGS= -u -U lfuse:w:0xff:m -U hfuse:w:0xcf:m |
HEX_NAME = MEGA32 |
endif |
ifeq ($(MCU), atmega644) |
FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
#FUSE_SETTINGS = -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
# -u bei neuen Controllern wieder einspielen |
HEX_NAME = MEGA644 |
endif |
ifeq ($(F_CPU), 16000000) |
QUARZ = 16MHZ |
endif |
ifeq ($(F_CPU), 20000000) |
QUARZ = 20MHZ |
endif |
# Output format. (can be srec, ihex, binary) |
FORMAT = ihex |
# Target file name (without extension). |
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION) |
# Optimization level, can be [0, 1, 2, 3, s]. 0 turns off optimization. |
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.) |
OPT = s |
########################################################################################################## |
# List C source files here. (C dependencies are automatically generated.) |
SRC = main.c uart.c printf_P.c timer0.c analog.c menu.c compass.c math.c |
SRC += twimaster.c rc.c fc.c GPS.c |
########################################################################################################## |
# List Assembler source files here. |
# Make them always end in a capital .S. Files ending in a lowercase .s |
# will not be considered source files but generated files (assembler |
# output from the compiler), and will be deleted upon "make clean"! |
# Even though the DOS/Win* filesystem matches both .s and .S the same, |
# it will preserve the spelling of the filenames, and gcc itself does |
# care about how the name is spelled on its command-line. |
ASRC = |
# List any extra directories to look for include files here. |
# Each directory must be seperated by a space. |
EXTRAINCDIRS = |
# Optional compiler flags. |
# -g: generate debugging information (for GDB, or for COFF conversion) |
# -O*: optimization level |
# -f...: tuning, see gcc manual and avr-libc documentation |
# -Wall...: warning level |
# -Wa,...: tell GCC to pass this to the assembler. |
# -ahlms: create assembler listing |
CFLAGS = -O$(OPT) \ |
-funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums \ |
-Wall -Wstrict-prototypes \ |
-mtiny-stack -mcall-prologues -Wno-pointer-sign \ |
-Wa,-adhlns=$(<:.c=.lst) \ |
$(patsubst %,-I%,$(EXTRAINCDIRS)) |
# Set a "language standard" compiler flag. |
# Unremark just one line below to set the language standard to use. |
# gnu99 = C99 + GNU extensions. See GCC manual for more information. |
#CFLAGS += -std=c89 |
#CFLAGS += -std=gnu89 |
#CFLAGS += -std=c99 |
CFLAGS += -std=gnu99 |
CFLAGS += -DVERSION_HAUPTVERSION=$(HAUPT_VERSION) -DVERSION_NEBENVERSION=$(NEBEN_VERSION) -DVERSION_KOMPATIBEL=$(VERSION_KOMPATIBEL) |
# Optional assembler flags. |
# -Wa,...: tell GCC to pass this to the assembler. |
# -ahlms: create listing |
# -gstabs: have the assembler create line number information; note that |
# for use in COFF files, additional information about filenames |
# and function names needs to be present in the assembler source |
# files -- see avr-libc docs [FIXME: not yet described there] |
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs |
# Optional linker flags. |
# -Wl,...: tell GCC to pass this to linker. |
# -Map: create map file |
# --cref: add cross reference to map file |
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref |
# Additional libraries |
# Minimalistic printf version |
#LDFLAGS += -Wl,-u,vfprintf -lprintf_min |
# Floating point printf version (requires -lm below) |
#LDFLAGS += -Wl,-u,vfprintf -lprintf_flt |
# -lm = math library |
LDFLAGS += -lm |
##LDFLAGS += -T./linkerfile/avr5.x |
# Programming support using avrdude. Settings and variables. |
# Programming hardware: alf avr910 avrisp bascom bsd |
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500 |
# |
# Type: avrdude -c ? |
# to get a full listing. |
# |
#AVRDUDE_PROGRAMMER = stk200 |
AVRDUDE_PROGRAMMER = dt006 |
#AVRDUDE_PROGRAMMER = ponyser |
#falls Ponyser ausgewählt wird, muss sich unsere avrdude-Configdatei im Bin-Verzeichnis des Compilers befinden |
#AVRDUDE_PORT = com1 # programmer connected to serial device |
AVRDUDE_PORT = lpt1 # programmer connected to parallel port |
#AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex |
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex $(FUSE_SETTINGS) |
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep |
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) |
# Uncomment the following if you want avrdude's erase cycle counter. |
# Note that this counter needs to be initialized first using -Yn, |
# see avrdude manual. |
#AVRDUDE_ERASE += -y |
# Uncomment the following if you do /not/ wish a verification to be |
# performed after programming the device. |
AVRDUDE_FLAGS += -V |
# Increase verbosity level. Please use this when submitting bug |
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> |
# to submit bug reports. |
#AVRDUDE_FLAGS += -v -v |
# --------------------------------------------------------------------------- |
# Define directories, if needed. |
DIRAVR = c:/winavr |
DIRAVRBIN = $(DIRAVR)/bin |
DIRAVRUTILS = $(DIRAVR)/utils/bin |
DIRINC = . |
DIRLIB = $(DIRAVR)/avr/lib |
# Define programs and commands. |
SHELL = sh |
CC = avr-gcc |
OBJCOPY = avr-objcopy |
OBJDUMP = avr-objdump |
SIZE = avr-size |
# Programming support using avrdude. |
AVRDUDE = avrdude |
REMOVE = rm -f |
COPY = cp |
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex |
ELFSIZE = $(SIZE) -A $(TARGET).elf |
# Define Messages |
# English |
MSG_ERRORS_NONE = Errors: none |
MSG_BEGIN = -------- begin -------- |
MSG_END = -------- end -------- |
MSG_SIZE_BEFORE = Size before: |
MSG_SIZE_AFTER = Size after: |
MSG_COFF = Converting to AVR COFF: |
MSG_EXTENDED_COFF = Converting to AVR Extended COFF: |
MSG_FLASH = Creating load file for Flash: |
MSG_EEPROM = Creating load file for EEPROM: |
MSG_EXTENDED_LISTING = Creating Extended Listing: |
MSG_SYMBOL_TABLE = Creating Symbol Table: |
MSG_LINKING = Linking: |
MSG_COMPILING = Compiling: |
MSG_ASSEMBLING = Assembling: |
MSG_CLEANING = Cleaning project: |
# Define all object files. |
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o) |
# Define all listing files. |
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst) |
# Combine all necessary flags and optional flags. |
# Add target processor to flags. |
#ALL_CFLAGS = -mmcu=$(MCU) -DF_CPU=$(F_CPU) -I. $(CFLAGS) |
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) |
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) |
# Default target. |
all: begin gccversion sizebefore $(TARGET).elf $(TARGET).hex $(TARGET).eep \ |
$(TARGET).lss $(TARGET).sym sizeafter finished end |
# Eye candy. |
# AVR Studio 3.x does not check make's exit code but relies on |
# the following magic strings to be generated by the compile job. |
begin: |
@echo |
@echo $(MSG_BEGIN) |
finished: |
@echo $(MSG_ERRORS_NONE) |
end: |
@echo $(MSG_END) |
@echo |
# Display size of file. |
sizebefore: |
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi |
sizeafter: |
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi |
# Display compiler version information. |
gccversion : |
@$(CC) --version |
# Convert ELF to COFF for use in debugging / simulating in |
# AVR Studio or VMLAB. |
COFFCONVERT=$(OBJCOPY) --debugging \ |
--change-section-address .data-0x800000 \ |
--change-section-address .bss-0x800000 \ |
--change-section-address .noinit-0x800000 \ |
--change-section-address .eeprom-0x810000 |
coff: $(TARGET).elf |
@echo |
@echo $(MSG_COFF) $(TARGET).cof |
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof |
extcoff: $(TARGET).elf |
@echo |
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof |
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof |
# Program the device. |
program: $(TARGET).hex $(TARGET).eep |
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) |
# Create final output files (.hex, .eep) from ELF output file. |
%.hex: %.elf |
@echo |
@echo $(MSG_FLASH) $@ |
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ |
%.eep: %.elf |
@echo |
@echo $(MSG_EEPROM) $@ |
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ |
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@ |
# Create extended listing file from ELF output file. |
%.lss: %.elf |
@echo |
@echo $(MSG_EXTENDED_LISTING) $@ |
$(OBJDUMP) -h -S $< > $@ |
# Create a symbol table from ELF output file. |
%.sym: %.elf |
@echo |
@echo $(MSG_SYMBOL_TABLE) $@ |
avr-nm -n $< > $@ |
# Link: create ELF output file from object files. |
.SECONDARY : $(TARGET).elf |
.PRECIOUS : $(OBJ) |
%.elf: $(OBJ) |
@echo |
@echo $(MSG_LINKING) $@ |
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS) |
# Compile: create object files from C source files. |
%.o : %.c |
@echo |
@echo $(MSG_COMPILING) $< |
$(CC) -c $(ALL_CFLAGS) $< -o $@ |
# Compile: create assembler files from C source files. |
%.s : %.c |
$(CC) -S $(ALL_CFLAGS) $< -o $@ |
# Assemble: create object files from assembler source files. |
%.o : %.S |
@echo |
@echo $(MSG_ASSEMBLING) $< |
$(CC) -c $(ALL_ASFLAGS) $< -o $@ |
# Target: clean project. |
clean: begin clean_list finished end |
clean_list : |
@echo |
@echo $(MSG_CLEANING) |
# $(REMOVE) $(TARGET).hex |
$(REMOVE) $(TARGET).eep |
$(REMOVE) $(TARGET).obj |
$(REMOVE) $(TARGET).cof |
$(REMOVE) $(TARGET).elf |
$(REMOVE) $(TARGET).map |
$(REMOVE) $(TARGET).obj |
$(REMOVE) $(TARGET).a90 |
$(REMOVE) $(TARGET).sym |
$(REMOVE) $(TARGET).lnk |
$(REMOVE) $(TARGET).lss |
$(REMOVE) $(OBJ) |
$(REMOVE) $(LST) |
$(REMOVE) $(SRC:.c=.s) |
$(REMOVE) $(SRC:.c=.d) |
# Automatically generate C source code dependencies. |
# (Code originally taken from the GNU make user manual and modified |
# (See README.txt Credits).) |
# |
# Note that this will work with sh (bash) and sed that is shipped with WinAVR |
# (see the SHELL variable defined above). |
# This may not work with other shells or other seds. |
# |
%.d: %.c |
set -e; $(CC) -MM $(ALL_CFLAGS) $< \ |
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > $@; \ |
[ -s $@ ] || rm -f $@ |
# Remove the '-' if you want to see the dependency files generated. |
-include $(SRC:.c=.d) |
# Listing of phony targets. |
.PHONY : all begin finish end sizebefore sizeafter gccversion coff extcoff \ |
clean clean_list program |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/math.c |
---|
0,0 → 1,118 |
/* |
Copyright 2007, Niklas Nold |
This program (files math.c and math.h) is free software; you can redistribute it and/or modify |
it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; |
either version 3 of the License, or (at your option) any later version. |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
Please note: All the other files for the project "Mikrokopter" by H. Buss are under the license (license_buss.txt) published by www.mikrokopter.de |
*/ |
#include "main.h" |
const uint8_t pgm_atan[270] PROGMEM = {0,1,2,3,5,6,7,8,9,10,11,12,13,15,16,17,18,19,20,21,22,23,24,25,26,27,27,28,29,30,31,32,33,33,34,35,36,37,37,38,39,39,40,41,41,42,43,43,44,44,45,46,46,47,47,48,48,49,49,50,50,51,51,52,52,52,53,53,54,54,54,55,55,56,56,56,57,57,57,58,58,58,59,59,59,60,60,60,60,61,61,61,61,62,62,62,62,63,63,63,63,64,64,64,64,65,65,65,65,65,66,66,66,66,66,67,67,67,67,67,67,68,68,68,68,68,68,69,69,69,69,69,69,69,70,70,70,70,70,70,70,70,71,71,71,71,71,71,71,71,72,72,72,72,72,72,72,72,72,73,73,73,73,73,73,73,73,73,73,74,74,74,74,74,74,74,74,74,74,74,74,75,75,75,75,75,75,75,75,75,75,75,75,75,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79}; |
// Arkustangens2 im Gradmaß |
signed int atan2_i(signed int x, signed int y) |
{ |
int i,angle; |
int8_t m; |
if (!x && !y) return 0; //atan2 = 0 für x und y = 0 |
if (y < 0) m=-1; |
else m=1; |
if (x==0) return (90*m); // atan2 = 90° für x = 0 |
i = abs(((float)y / x) * 50); // Berechne i für die Lookup table (Schrittweite atan(x) ist 0.02 -> *50) |
if (i<270) angle = pgm_read_byte(&pgm_atan[i]); // Lookup für 1° bis 79° |
else if (i>5750) angle = 90; // Grenzwert ist 90° |
else if (i>=1910) angle = 89; // 89° bis 80° über Wertebereiche |
else if (i>=1150) angle = 88; |
else if (i>=820) angle = 87; |
else if (i>=640) angle = 86; |
else if (i>=520) angle = 85; |
else if (i>=440) angle = 84; |
else if (i>=380) angle = 83; |
else if (i>=335) angle = 82; |
else if (i>=299) angle = 81; |
else angle = 80; // (i>=270) |
if (x > 0) return (angle*m); // Quadrant I und IV |
else if ((x < 0) && (y >= 0)) return ((angle*-1) + 180); // Quadrant II |
else return (angle - 180); // x < 0 && y < 0 Quadrant III |
} |
const float pgm_sinus_f [91] PROGMEM = {0.000,0.017,0.035,0.052,0.070,0.087,0.105,0.122,0.139,0.156,0.174,0.191,0.208,0.225,0.242,0.259,0.276,0.292,0.309,0.326,0.342,0.358,0.375,0.391,0.407,0.423,0.438,0.454,0.469,0.485,0.500,0.515,0.530,0.545,0.559,0.574,0.588,0.602,0.616,0.629,0.643,0.656,0.669,0.682,0.695,0.707,0.719,0.731,0.743,0.755,0.766,0.777,0.788,0.799,0.809,0.819,0.829,0.839,0.848,0.857,0.866,0.875,0.883,0.891,0.899,0.906,0.914,0.921,0.927,0.934,0.940,0.946,0.951,0.956,0.961,0.966,0.970,0.974,0.978,0.982,0.985,0.988,0.990,0.993,0.995,0.996,0.998,0.999,0.999,1.000,1.000}; |
inline float pgm_read_float(const float *addr) |
{ |
union |
{ |
uint16_t i[2]; // 2 16-bit-Worte |
float f; |
} u; |
u.i[0]=pgm_read_word((PGM_P)addr); |
u.i[1]=pgm_read_word((PGM_P)addr+2); |
return u.f; |
} |
// Kosinusfunktion im Gradmaß |
float cos_f(signed int winkel) |
{ |
return (sin_f(90-winkel)); |
} |
// Sinusfunktion im Gradmaß |
float sin_f(signed int winkel) |
{ |
short int m,n; |
float sinus; |
//winkel = winkel % 360; |
if (winkel < 0) |
{ |
m = -1; |
winkel = abs(winkel); |
} |
else m = +1; |
// Quadranten auswerten |
if ((winkel > 90 ) && (winkel <= 180)) {winkel = 180 - winkel; n = 1;} |
else if ((winkel > 180 ) && (winkel <= 270)) {winkel = winkel - 180; n = -1;} |
else if ((winkel > 270) && (winkel <= 360)) {winkel = 360 - winkel; n = -1;} |
else n = 1; //0 - 90 Grad |
sinus = pgm_read_float(&pgm_sinus_f[winkel]); |
return (sinus*m*n); |
} |
const uint8_t pgm_asin[201] PROGMEM = {0,0,1,1,1,1,2,2,2,3,3,3,3,4,4,4,5,5,5,5,6,6,6,7,7,7,7,8,8,8,9,9,9,9,10,10,10,11,11,11,12,12,12,12,13,13,13,14,14,14,14,15,15,15,16,16,16,17,17,17,17,18,18,18,19,19,19,20,20,20,20,21,21,21,22,22,22,23,23,23,24,24,24,25,25,25,25,26,26,26,27,27,27,28,28,28,29,29,29,30,30,30,31,31,31,32,32,32,33,33,33,34,34,34,35,35,35,36,36,37,37,37,38,38,38,39,39,39,40,40,41,41,41,42,42,42,43,43,44,44,44,45,45,46,46,46,47,47,48,48,49,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,62,62,63,64,64,65,66,66,67,68,68,69,70,71,72,73,74,75,76,77,79,80,82,84,90}; |
// Akurssinusfunktion im Gradmaß |
int8_t asin_i(signed int i) |
{ |
signed char m; |
if (i < 0) {m=-1;i=abs(i);} |
else m=1; |
return (pgm_read_byte(&pgm_asin[i]) * m); |
} |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/math.h |
---|
0,0 → 1,11 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Peter Muehlenbrock |
// Definitionen fuer Modul math |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
extern signed int atan2_i(signed int x, signed int y); |
extern float cos_f(signed int winkel); |
extern float sin_f(signed int winkel); |
extern int8_t asin_i(signed int i); |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/menu.c |
---|
0,0 → 1,124 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
unsigned int TestInt = 0; |
#define ARRAYGROESSE 10 |
unsigned char Array[ARRAYGROESSE] = {1,2,3,4,5,6,7,8,9,10}; |
char DisplayBuff[80] = "Hallo Welt"; |
unsigned char DispPtr = 0; |
unsigned char RemoteTasten = 0; |
#define KEY1 0x01 |
#define KEY2 0x02 |
#define KEY3 0x04 |
#define KEY4 0x08 |
#define KEY5 0x10 |
void LcdClear(void) |
{ |
unsigned char i; |
for(i=0;i<80;i++) DisplayBuff[i] = ' '; |
} |
void Menu(void) |
{ |
static unsigned char MaxMenue = 11,MenuePunkt=0; |
if(RemoteTasten & KEY1) { if(MenuePunkt) MenuePunkt--; else MenuePunkt = MaxMenue; LcdClear(); } |
if(RemoteTasten & KEY2) { MenuePunkt++; LcdClear(); } |
if((RemoteTasten & KEY1) && (RemoteTasten & KEY2)) MenuePunkt = 0; |
LCD_printfxy(17,0,"[%i]",MenuePunkt); |
switch(MenuePunkt) |
{ |
case 0: |
LCD_printfxy(0,0,"++ MikroKopter ++"); |
LCD_printfxy(0,1,"HW:V%d.%d SW:%d.%d",PlatinenVersion/10,PlatinenVersion%10,VERSION_HAUPTVERSION, VERSION_NEBENVERSION); |
LCD_printfxy(0,2,"Setting: %d ",GetActiveParamSetNumber()); |
LCD_printfxy(0,3,"(c) Holger Buss"); |
// if(RemoteTasten & KEY3) TestInt--; |
// if(RemoteTasten & KEY4) TestInt++; |
break; |
case 1: |
if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
LCD_printfxy(0,0,"Hoehe: %5i",HoehenWert); |
LCD_printfxy(0,1,"SollHoehe: %5i",SollHoehe); |
LCD_printfxy(0,2,"Luftdruck: %5i",MessLuftdruck); |
LCD_printfxy(0,3,"Off : %5i",DruckOffsetSetting); |
} |
else |
{ |
LCD_printfxy(0,1,"Keine "); |
LCD_printfxy(0,2,"Höhenregelung"); |
} |
break; |
case 2: |
LCD_printfxy(0,0,"akt. Lage"); |
LCD_printfxy(0,1,"Nick: %5i",IntegralNick/1024); |
LCD_printfxy(0,2,"Roll: %5i",IntegralRoll/1024); |
LCD_printfxy(0,3,"Kompass: %5i",KompassValue); |
break; |
case 3: |
LCD_printfxy(0,0,"K1:%4i K2:%4i ",PPM_in[1],PPM_in[2]); |
LCD_printfxy(0,1,"K3:%4i K4:%4i ",PPM_in[3],PPM_in[4]); |
LCD_printfxy(0,2,"K5:%4i K6:%4i ",PPM_in[5],PPM_in[6]); |
LCD_printfxy(0,3,"K7:%4i K8:%4i ",PPM_in[7],PPM_in[8]); |
break; |
case 4: |
LCD_printfxy(0,0,"Ni:%4i Ro:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_NICK]],PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]); |
LCD_printfxy(0,1,"Gs:%4i Gi:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_GAS]],PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]); |
LCD_printfxy(0,2,"P1:%4i P2:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]],PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]]); |
LCD_printfxy(0,3,"P3:%4i P4:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]],PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]]); |
break; |
case 5: |
LCD_printfxy(0,0,"Gyro - Sensor"); |
LCD_printfxy(0,1,"Nick %4i (%3i)",AccumulateNick / MessanzahlNick, AdNeutralNick); |
LCD_printfxy(0,2,"Roll %4i (%3i)",AccumulateRoll / MessanzahlRoll, AdNeutralRoll); |
LCD_printfxy(0,3,"Gier %4i (%3i)",AccumulateGier / MessanzahlGier, AdNeutralGier); |
break; |
case 6: |
LCD_printfxy(0,0,"ACC - Sensor"); |
LCD_printfxy(0,1,"Nick %4i (%3i)",accumulate_AccNick / messanzahl_AccNick,NeutralAccX); |
LCD_printfxy(0,2,"Roll %4i (%3i)",accumulate_AccRoll / messanzahl_AccRoll,NeutralAccY); |
LCD_printfxy(0,3,"Hoch %4i (%3i)",Aktuell_az/*accumulate_AccHoch / messanzahl_AccHoch*/,(int)NeutralAccZ); |
break; |
case 7: |
LCD_printfxy(0,1,"Spannung: %5i",UBat); |
LCD_printfxy(0,2,"Empf.Pegel:%5i",SenderOkay); |
break; |
case 8: |
LCD_printfxy(0,0,"Kompass "); |
LCD_printfxy(0,1,"Richtung: %5i",KompassRichtung); |
LCD_printfxy(0,2,"Messwert: %5i",KompassValue); |
LCD_printfxy(0,3,"Start: %5i",KompassStartwert); |
break; |
case 9: |
LCD_printfxy(0,0,"Po1: %3i Po5: %3i" ,Poti1,Poti5); //PPM24-Erweiterung (121007Kr) |
LCD_printfxy(0,1,"Po2: %3i Po6: %3i" ,Poti2,Poti6); //PPM24-Erweiterung (121007Kr) |
LCD_printfxy(0,2,"Po3: %3i Po7: %3i" ,Poti3,Poti7); //PPM24-Erweiterung (121007Kr) |
LCD_printfxy(0,3,"Po4: %3i Po8: %3i" ,Poti4,Poti8); //PPM24-Erweiterung (121007Kr) |
break; |
case 10: |
LCD_printfxy(0,0,"Servo " ); |
LCD_printfxy(0,1,"Setpoint %3i",Parameter_ServoNickControl); |
LCD_printfxy(0,2,"Stellung: %3i",ServoValue); |
LCD_printfxy(0,3,"Range:%3i-%3i",EE_Parameter.ServoNickMin,EE_Parameter.ServoNickMax); |
break; |
case 11: |
LCD_printfxy(0,0,"MM3 kalib."); |
LCD_printfxy(0,1,"X_Offset: %3i",X_off); |
LCD_printfxy(0,2,"Y_Offset: %3i",Y_off); |
LCD_printfxy(0,3,"Z_Offset: %3i",Z_off); |
break; |
default: MaxMenue = MenuePunkt - 1; |
MenuePunkt = 0; |
break; |
} |
RemoteTasten = 0; |
} |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/menu.h |
---|
0,0 → 1,7 |
void LcdClear(void); //Nick666 |
extern void Menu(void); |
extern char DisplayBuff[80]; |
extern unsigned char DispPtr; |
unsigned char RemoteTasten; |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/old_macros.h |
---|
0,0 → 1,47 |
/* |
For backwards compatibility only. |
Ingo Busker ingo@mikrocontroller.com |
*/ |
#ifndef cbi |
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) |
#endif |
#ifndef sbi |
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit)) |
#endif |
#ifndef inb |
#define inb(sfr) _SFR_BYTE(sfr) |
#endif |
#ifndef outb |
#define outb(sfr, val) (_SFR_BYTE(sfr) = (val)) |
#endif |
#ifndef inw |
#define inw(sfr) _SFR_WORD(sfr) |
#endif |
#ifndef outw |
#define outw(sfr, val) (_SFR_WORD(sfr) = (val)) |
#endif |
#ifndef outp |
#define outp(val, sfr) outb(sfr, val) |
#endif |
#ifndef inp |
#define inp(sfr) inb(sfr) |
#endif |
#ifndef BV |
#define BV(bit) _BV(bit) |
#endif |
#ifndef PRG_RDB |
#define PRG_RDB pgm_read_byte |
#endif |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/printf_P.c |
---|
0,0 → 1,480 |
// Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist nicht von der Lizenz für den MikroKopter-Teil unterstellt |
/* |
Copyright (C) 1993 Free Software Foundation |
This file is part of the GNU IO Library. This library is free |
software; you can redistribute it and/or modify it under the |
terms of the GNU General Public License as published by the |
Free Software Foundation; either version 2, or (at your option) |
any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License for more details. |
You should have received a copy of the GNU General Public License |
along with this library; see the file COPYING. If not, write to the Free |
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
As a special exception, if you link this library with files |
compiled with a GNU compiler to produce an executable, this does not cause |
the resulting executable to be covered by the GNU General Public License. |
This exception does not however invalidate any other reasons why |
the executable file might be covered by the GNU General Public License. */ |
/* |
* Copyright (c) 1990 Regents of the University of California. |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* 1. Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* 2. Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* 3. [rescinded 22 July 1999] |
* 4. Neither the name of the University nor the names of its contributors |
* may be used to endorse or promote products derived from this software |
* without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
* SUCH DAMAGE. |
*/ |
/****************************************************************************** |
This file is a patched version of printf called _printf_P |
It is made to work with avr-gcc for Atmel AVR MCUs. |
There are some differences from standard printf: |
1. There is no floating point support (with fp the code is about 8K!) |
2. Return type is void |
3. Format string must be in program memory (by using macro printf this is |
done automaticaly) |
4. %n is not implemented (just remove the comment around it if you need it) |
5. If LIGHTPRINTF is defined, the code is about 550 bytes smaller and the |
folowing specifiers are disabled : |
space # * . - + p s o O |
6. A function void uart_sendchar(char c) is used for output. The UART must |
be initialized before using printf. |
Alexander Popov |
sasho@vip.orbitel.bg |
******************************************************************************/ |
/* |
* Actual printf innards. |
* |
* This code is large and complicated... |
*/ |
#include <string.h> |
#ifdef __STDC__ |
#include <stdarg.h> |
#else |
#include <varargs.h> |
#endif |
#include "main.h" |
//#define LIGHTPRINTF |
char PrintZiel; |
char Putchar(char zeichen) |
{ |
if(PrintZiel == OUT_LCD) { DisplayBuff[DispPtr++] = zeichen; return(1);} |
else return(uart_putchar(zeichen)); |
} |
void PRINT(const char * ptr, unsigned int len) |
{ |
for(;len;len--) Putchar(*ptr++); |
} |
void PRINTP(const char * ptr, unsigned int len) |
{ |
for(;len;len--) Putchar(pgm_read_byte(ptr++)); |
} |
void PAD_SP(signed char howmany) |
{ |
for(;howmany>0;howmany--) Putchar(' '); |
} |
void PAD_0(signed char howmany) |
{ |
for(;howmany>0;howmany--) Putchar('0'); |
} |
#define BUF 40 |
/* |
* Macros for converting digits to letters and vice versa |
*/ |
#define to_digit(c) ((c) - '0') |
#define is_digit(c) ((c)<='9' && (c)>='0') |
#define to_char(n) ((n) + '0') |
/* |
* Flags used during conversion. |
*/ |
#define LONGINT 0x01 /* long integer */ |
#define LONGDBL 0x02 /* long double; unimplemented */ |
#define SHORTINT 0x04 /* short integer */ |
#define ALT 0x08 /* alternate form */ |
#define LADJUST 0x10 /* left adjustment */ |
#define ZEROPAD 0x20 /* zero (as opposed to blank) pad */ |
#define HEXPREFIX 0x40 /* add 0x or 0X prefix */ |
void _printf_P (char ziel,char const *fmt0, ...) /* Works with string from FLASH */ |
{ |
va_list ap; |
register const char *fmt; /* format string */ |
register char ch; /* character from fmt */ |
register int n; /* handy integer (short term usage) */ |
register char *cp; /* handy char pointer (short term usage) */ |
const char *fmark; /* for remembering a place in fmt */ |
register unsigned char flags; /* flags as above */ |
signed char width; /* width from format (%8d), or 0 */ |
signed char prec; /* precision from format (%.3d), or -1 */ |
char sign; /* sign prefix (' ', '+', '-', or \0) */ |
unsigned long _ulong=0; /* integer arguments %[diouxX] */ |
#define OCT 8 |
#define DEC 10 |
#define HEX 16 |
unsigned char base; /* base for [diouxX] conversion */ |
signed char dprec; /* a copy of prec if [diouxX], 0 otherwise */ |
signed char dpad; /* extra 0 padding needed for integers */ |
signed char fieldsz; /* field size expanded by sign, dpad etc */ |
/* The initialization of 'size' is to suppress a warning that |
'size' might be used unitialized. It seems gcc can't |
quite grok this spaghetti code ... */ |
signed char size = 0; /* size of converted field or string */ |
char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */ |
char ox[2]; /* space for 0x hex-prefix */ |
PrintZiel = ziel; // bestimmt, LCD oder UART |
va_start(ap, fmt0); |
fmt = fmt0; |
/* |
* Scan the format for conversions (`%' character). |
*/ |
for (;;) { |
for (fmark = fmt; (ch = pgm_read_byte(fmt)) != '\0' && ch != '%'; fmt++) |
/* void */; |
if ((n = fmt - fmark) != 0) { |
PRINTP(fmark, n); |
} |
if (ch == '\0') |
goto done; |
fmt++; /* skip over '%' */ |
flags = 0; |
dprec = 0; |
width = 0; |
prec = -1; |
sign = '\0'; |
rflag: ch = PRG_RDB(fmt++); |
reswitch: |
#ifdef LIGHTPRINTF |
if (ch=='o' || ch=='u' || (ch|0x20)=='x') { |
#else |
if (ch=='u' || (ch|0x20)=='x') { |
#endif |
if (flags&LONGINT) { |
_ulong=va_arg(ap, unsigned long); |
} else { |
register unsigned int _d; |
_d=va_arg(ap, unsigned int); |
_ulong = flags&SHORTINT ? (unsigned long)(unsigned short)_d : (unsigned long)_d; |
} |
} |
#ifndef LIGHTPRINTF |
if(ch==' ') { |
/* |
* ``If the space and + flags both appear, the space |
* flag will be ignored.'' |
* -- ANSI X3J11 |
*/ |
if (!sign) |
sign = ' '; |
goto rflag; |
} else if (ch=='#') { |
flags |= ALT; |
goto rflag; |
} else if (ch=='*'||ch=='-') { |
if (ch=='*') { |
/* |
* ``A negative field width argument is taken as a |
* - flag followed by a positive field width.'' |
* -- ANSI X3J11 |
* They don't exclude field widths read from args. |
*/ |
if ((width = va_arg(ap, int)) >= 0) |
goto rflag; |
width = -width; |
} |
flags |= LADJUST; |
flags &= ~ZEROPAD; /* '-' disables '0' */ |
goto rflag; |
} else if (ch=='+') { |
sign = '+'; |
goto rflag; |
} else if (ch=='.') { |
if ((ch = PRG_RDB(fmt++)) == '*') { |
n = va_arg(ap, int); |
prec = n < 0 ? -1 : n; |
goto rflag; |
} |
n = 0; |
while (is_digit(ch)) { |
n = n*10 + to_digit(ch); |
ch = PRG_RDB(fmt++); |
} |
prec = n < 0 ? -1 : n; |
goto reswitch; |
} else |
#endif /* LIGHTPRINTF */ |
if (ch=='0') { |
/* |
* ``Note that 0 is taken as a flag, not as the |
* beginning of a field width.'' |
* -- ANSI X3J11 |
*/ |
if (!(flags & LADJUST)) |
flags |= ZEROPAD; /* '-' disables '0' */ |
goto rflag; |
} else if (ch>='1' && ch<='9') { |
n = 0; |
do { |
n = 10 * n + to_digit(ch); |
ch = PRG_RDB(fmt++); |
} while (is_digit(ch)); |
width = n; |
goto reswitch; |
} else if (ch=='h') { |
flags |= SHORTINT; |
goto rflag; |
} else if (ch=='l') { |
flags |= LONGINT; |
goto rflag; |
} else if (ch=='c') { |
*(cp = buf) = va_arg(ap, int); |
size = 1; |
sign = '\0'; |
} else if (ch=='D'||ch=='d'||ch=='i') { |
if(ch=='D') |
flags |= LONGINT; |
if (flags&LONGINT) { |
_ulong=va_arg(ap, long); |
} else { |
register int _d; |
_d=va_arg(ap, int); |
_ulong = flags&SHORTINT ? (long)(short)_d : (long)_d; |
} |
if ((long)_ulong < 0) { |
_ulong = -_ulong; |
sign = '-'; |
} |
base = DEC; |
goto number; |
} else |
/* |
if (ch=='n') { |
if (flags & LONGINT) |
*va_arg(ap, long *) = ret; |
else if (flags & SHORTINT) |
*va_arg(ap, short *) = ret; |
else |
*va_arg(ap, int *) = ret; |
continue; // no output |
} else |
*/ |
#ifndef LIGHTPRINTF |
if (ch=='O'||ch=='o') { |
if (ch=='O') |
flags |= LONGINT; |
base = OCT; |
goto nosign; |
} else if (ch=='p') { |
/* |
* ``The argument shall be a pointer to void. The |
* value of the pointer is converted to a sequence |
* of printable characters, in an implementation- |
* defined manner.'' |
* -- ANSI X3J11 |
*/ |
/* NOSTRICT */ |
_ulong = (unsigned int)va_arg(ap, void *); |
base = HEX; |
flags |= HEXPREFIX; |
ch = 'x'; |
goto nosign; |
} else if (ch=='s') { // print a string from RAM |
if ((cp = va_arg(ap, char *)) == NULL) { |
cp=buf; |
cp[0] = '('; |
cp[1] = 'n'; |
cp[2] = 'u'; |
cp[4] = cp[3] = 'l'; |
cp[5] = ')'; |
cp[6] = '\0'; |
} |
if (prec >= 0) { |
/* |
* can't use strlen; can only look for the |
* NUL in the first `prec' characters, and |
* strlen() will go further. |
*/ |
char *p = (char*)memchr(cp, 0, prec); |
if (p != NULL) { |
size = p - cp; |
if (size > prec) |
size = prec; |
} else |
size = prec; |
} else |
size = strlen(cp); |
sign = '\0'; |
} else |
#endif /* LIGHTPRINTF */ |
if(ch=='U'||ch=='u') { |
if (ch=='U') |
flags |= LONGINT; |
base = DEC; |
goto nosign; |
} else if (ch=='X'||ch=='x') { |
base = HEX; |
/* leading 0x/X only if non-zero */ |
if (flags & ALT && _ulong != 0) |
flags |= HEXPREFIX; |
/* unsigned conversions */ |
nosign: sign = '\0'; |
/* |
* ``... diouXx conversions ... if a precision is |
* specified, the 0 flag will be ignored.'' |
* -- ANSI X3J11 |
*/ |
number: if ((dprec = prec) >= 0) |
flags &= ~ZEROPAD; |
/* |
* ``The result of converting a zero value with an |
* explicit precision of zero is no characters.'' |
* -- ANSI X3J11 |
*/ |
cp = buf + BUF; |
if (_ulong != 0 || prec != 0) { |
register unsigned char _d,notlastdigit; |
do { |
notlastdigit=(_ulong>=base); |
_d = _ulong % base; |
if (_d<10) { |
_d+='0'; |
} else { |
_d+='a'-10; |
if (ch=='X') _d&=~0x20; |
} |
*--cp=_d; |
_ulong /= base; |
} while (notlastdigit); |
#ifndef LIGHTPRINTF |
// handle octal leading 0 |
if (base==OCT && flags & ALT && *cp != '0') |
*--cp = '0'; |
#endif |
} |
size = buf + BUF - cp; |
} else { //default |
/* "%?" prints ?, unless ? is NUL */ |
if (ch == '\0') |
goto done; |
/* pretend it was %c with argument ch */ |
cp = buf; |
*cp = ch; |
size = 1; |
sign = '\0'; |
} |
/* |
* All reasonable formats wind up here. At this point, |
* `cp' points to a string which (if not flags&LADJUST) |
* should be padded out to `width' places. If |
* flags&ZEROPAD, it should first be prefixed by any |
* sign or other prefix; otherwise, it should be blank |
* padded before the prefix is emitted. After any |
* left-hand padding and prefixing, emit zeroes |
* required by a decimal [diouxX] precision, then print |
* the string proper, then emit zeroes required by any |
* leftover floating precision; finally, if LADJUST, |
* pad with blanks. |
*/ |
/* |
* compute actual size, so we know how much to pad. |
*/ |
fieldsz = size; |
dpad = dprec - size; |
if (dpad < 0) |
dpad = 0; |
if (sign) |
fieldsz++; |
else if (flags & HEXPREFIX) |
fieldsz += 2; |
fieldsz += dpad; |
/* right-adjusting blank padding */ |
if ((flags & (LADJUST|ZEROPAD)) == 0) |
PAD_SP(width - fieldsz); |
/* prefix */ |
if (sign) { |
PRINT(&sign, 1); |
} else if (flags & HEXPREFIX) { |
ox[0] = '0'; |
ox[1] = ch; |
PRINT(ox, 2); |
} |
/* right-adjusting zero padding */ |
if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD) |
PAD_0(width - fieldsz); |
/* leading zeroes from decimal precision */ |
PAD_0(dpad); |
/* the string or number proper */ |
PRINT(cp, size); |
/* left-adjusting padding (always blank) */ |
if (flags & LADJUST) |
PAD_SP(width - fieldsz); |
} |
done: |
va_end(ap); |
} |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/printf_P.h |
---|
0,0 → 1,19 |
#ifndef _PRINTF_P_H_ |
#define _PRINTF_P_H_ |
#include <avr/pgmspace.h> |
#define OUT_V24 0 |
#define OUT_LCD 1 |
extern void _printf_P (char, char const *fmt0, ...); |
extern char PrintZiel; |
#define printf_P(format, args...) _printf_P(OUT_V24,format , ## args) |
#define printf(format, args...) _printf_P(OUT_V24,PSTR(format) , ## args) |
#define LCD_printfxy(x,y,format, args...) { DispPtr = y * 20 + x; _printf_P(OUT_LCD,PSTR(format) , ## args);} |
#define LCD_printf(format, args...) { _printf_P(OUT_LCD,PSTR(format) , ## args);} |
#endif |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/rc.c |
---|
0,0 → 1,85 |
/*####################################################################################### |
Decodieren eines RC Summen Signals |
#######################################################################################*/ |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "rc.h" |
#include "main.h" |
volatile int PPM_in[15]; //PPM24-Erweiterung (121007Kr) |
volatile int PPM_diff[15]; // das diffenzierte Stick-Signal //PPM24-Erweiterung (121007Kr) |
volatile unsigned char NewPpmData = 1; |
//############################################################################ |
//zum decodieren des PPM-Signals wird Timer1 mit seiner Input |
//Capture Funktion benutzt: |
void rc_sum_init (void) |
//############################################################################ |
{ |
TCCR1B=(1<<CS11)|(1<<CS10)|(1<<ICES1)|(1<<ICNC1);//|(1 << WGM12); //timer1 prescale 64 |
// PWM |
//TCCR1A = (1 << COM1B1) | (1 << WGM11) | (1 << WGM10); |
//TCCR1B |= (1 << WGM12); |
//OCR1B = 55; |
TIMSK1 |= _BV(ICIE1); |
AdNeutralGier = 0; |
AdNeutralRoll = 0; |
AdNeutralNick = 0; |
return; |
} |
//############################################################################ |
//Diese Routine startet und inizialisiert den Timer für RC |
SIGNAL(SIG_INPUT_CAPTURE1) |
//############################################################################ |
{ |
static unsigned int AltICR=0; |
signed int signal = 0,tmp; |
static int index; |
signal = (unsigned int) ICR1 - AltICR; |
AltICR = ICR1; |
//Syncronisationspause? |
if ((signal > 1500) && (signal < 8000)) |
{ |
index = 1; |
NewPpmData = 0; // Null bedeutet: Neue Daten |
// OCR2A = Poti2/2 + 80; |
} |
else |
{ |
if(index < 14) //PPM24-Erweiterung (121007Kr) |
{ |
if((signal > 250) && (signal < 687)) |
{ |
signal -= 466; |
// Stabiles Signal |
if(abs(signal - PPM_in[index]) < 6) { if(SenderOkay < 200) SenderOkay += 10;} |
tmp = (3 * (PPM_in[index]) + signal) / 4; |
// if(tmp > signal+1) tmp--; else |
// if(tmp < signal-1) tmp++; |
PPM_diff[index] = tmp - PPM_in[index]; |
PPM_in[index] = tmp; |
} |
index++; |
if(index == 5) PORTD |= 0x20; else PORTD &= ~0x20; // Servosignal an J3 anlegen |
if(index == 6) PORTD |= 0x10; else PORTD &= ~0x10; // Servosignal an J4 anlegen |
if(index == 7) PORTD |= 0x08; else PORTD &= ~0x08; // Servosignal an J5 anlegen |
} |
} |
} |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/rc.h |
---|
0,0 → 1,29 |
/*####################################################################################### |
Derkodieren eines RC Summen Signals |
#######################################################################################*/ |
#ifndef _RC_H |
#define _RC_H |
#if defined (__AVR_ATmega32__) |
#define TIMER_TEILER CK64 |
#define TIMER_RELOAD_VALUE 250 |
#endif |
#if defined (__AVR_ATmega644__) |
//#define TIMER_TEILER CK64 |
#define TIMER_RELOAD_VALUE 250 |
//#define TIMER_TEILER CK256 // bei 20MHz |
//#define TIMER_RELOAD_VALUE -78 // bei 20MHz |
#endif |
#define GAS PPM_in[2] |
extern void rc_sum_init (void); |
extern volatile int PPM_in[15]; //PPM24-Erweiterung (121007Kr) |
extern volatile int PPM_diff[15]; // das diffenzierte Stick-Signal //PPM24-Erweiterung (121007Kr) |
extern volatile unsigned char NewPpmData; |
#endif //_RC_H |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/timer0.c |
---|
0,0 → 1,187 |
#include "main.h" |
volatile unsigned int CountMilliseconds = 0; |
volatile static unsigned int tim_main; |
volatile unsigned char UpdateMotor = 0; |
volatile unsigned int cntKompass = 800; |
volatile unsigned int beeptime = 0; |
unsigned int BeepMuster = 0xffff; |
int ServoValue = 0; |
enum { |
STOP = 0, |
CK = 1, |
CK8 = 2, |
CK64 = 3, |
CK256 = 4, |
CK1024 = 5, |
T0_FALLING_EDGE = 6, |
T0_RISING_EDGE = 7 |
}; |
SIGNAL (SIG_OVERFLOW0) // 8kHz |
{ |
static unsigned char cnt_1ms = 1,cnt = 0; |
unsigned char pieper_ein = 0; |
// TCNT0 -= 250;//TIMER_RELOAD_VALUE; |
if(!cnt--) |
{ |
cnt = 9; |
cnt_1ms++; |
cnt_1ms %= 2; |
if(!cnt_1ms) UpdateMotor = 1; |
CountMilliseconds++; |
} |
if(beeptime > 1) |
{ |
beeptime--; |
PORTD |= (1<<PD2); |
if(beeptime & BeepMuster) |
{ |
pieper_ein = 1; |
} |
else pieper_ein = 0; |
} |
else |
{ |
pieper_ein = 0; |
BeepMuster = 0xffff; |
PORTD &= ~(1<<PD2); |
if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV) |
{ |
MM3_timer0(); // Kompass auslesen |
if (!cntKompass--) // Aufruf mit 10 Hz |
{ |
// KompassValue = MM3_heading(); |
// OsiAir hier machen wir den den KompassValue zu 0-359 damit das GPS damit weiterarbeiten kann |
if (MM3_heading() > 0) { KompassValue = 360-MM3_heading();} |
if (MM3_heading() < 0 ) { KompassValue = MM3_heading()*-1;} |
KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180; |
cntKompass = 800; |
} |
} |
} |
if(pieper_ein) |
{ |
if(PlatinenVersion == 10) PORTD |= (1<<2); // Speaker an PORTD.2 |
else PORTC |= (1<<7); // Speaker an PORTC.7 |
} |
else |
{ |
if(PlatinenVersion == 10) PORTD &= ~(1<<2); |
else PORTC &= ~(1<<7); |
} |
} |
/* |
if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV || EE_Parameter.GlobalConfig & CFG_GPS_AKTIV) //Abfrage um GPS_AKTIV erweitert, damit auch bei nur eingeschaltetem GPS OHNE Kompass der benötigte Kompassvalue berechnet wird (200907Kr) |
{ |
if(PINC & 0x10) |
{ |
cntKompass++; |
} |
else |
{ |
if((cntKompass) && (cntKompass < 4000)) |
{ |
KompassValue = cntKompass; |
} |
// if(cntKompass < 10) cntKompass = 10; |
// KompassValue = (unsigned long)((unsigned long)(cntKompass-10)*720L + 1L) / 703L; |
KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180; |
cntKompass = 0; |
} |
} |
} |
*/ |
void Timer_Init(void) |
{ |
tim_main = SetDelay(10); |
TCCR0B = CK8; |
TCCR0A = (1<<COM0A1)|(1<<COM0B1)|3;//fast PWM |
OCR0A = 0; |
OCR0B = 120; |
//TCNT0 = -TIMER_RELOAD_VALUE; // reload |
//OCR1 = 0x00; |
TCCR2A=(1<<COM2A1)|(1<<COM2A0)|3; |
TCCR2B=(0<<CS20)|(1<<CS21)|(1<<CS22); |
// TIMSK2 |= _BV(TOIE2); |
TIMSK2 |= _BV(OCIE2A); |
TIMSK0 |= _BV(TOIE0); |
OCR2A = 10; |
TCNT2 = 0; |
} |
// ----------------------------------------------------------------------- |
unsigned int SetDelay (unsigned int t) |
{ |
// TIMSK0 &= ~_BV(TOIE0); |
return(CountMilliseconds + t + 1); |
// TIMSK0 |= _BV(TOIE0); |
} |
// ----------------------------------------------------------------------- |
char CheckDelay(unsigned int t) |
{ |
// TIMSK0 &= ~_BV(TOIE0); |
return(((t - CountMilliseconds) & 0x8000) >> 9); |
// TIMSK0 |= _BV(TOIE0); |
} |
// ----------------------------------------------------------------------- |
void Delay_ms(unsigned int w) |
{ |
unsigned int akt; |
akt = SetDelay(w); |
while (!CheckDelay(akt)); |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Servo ansteuern |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(SIG_OUTPUT_COMPARE2A) |
{ |
static unsigned char timer = 10; |
if(!timer--) |
{ |
TCCR2A=(1<<COM2A1)|(0<<COM2A0)|3; |
ServoValue = Parameter_ServoNickControl; |
if(EE_Parameter.ServoNickCompInvert & 0x01) ServoValue += ((long) EE_Parameter.ServoNickComp * (IntegralNick / 128)) / 512; |
else ServoValue -= ((long) EE_Parameter.ServoNickComp * (IntegralNick / 128)) / 512; |
if(ServoValue < EE_Parameter.ServoNickMin) ServoValue = EE_Parameter.ServoNickMin; |
else if(ServoValue > EE_Parameter.ServoNickMax) ServoValue = EE_Parameter.ServoNickMax; |
OCR2A = ServoValue;// + 75; |
timer = EE_Parameter.ServoNickRefresh; |
} |
else |
{ |
TCCR2A =3; |
PORTD&=~0x80; |
} |
} |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/timer0.c.bak |
---|
0,0 → 1,183 |
#include "main.h" |
volatile unsigned int CountMilliseconds = 0; |
volatile static unsigned int tim_main; |
volatile unsigned char UpdateMotor = 0; |
volatile unsigned int cntKompass = 800; |
volatile unsigned int beeptime = 0; |
unsigned int BeepMuster = 0xffff; |
int ServoValue = 0; |
enum { |
STOP = 0, |
CK = 1, |
CK8 = 2, |
CK64 = 3, |
CK256 = 4, |
CK1024 = 5, |
T0_FALLING_EDGE = 6, |
T0_RISING_EDGE = 7 |
}; |
SIGNAL (SIG_OVERFLOW0) // 8kHz |
{ |
static unsigned char cnt_1ms = 1,cnt = 0; |
unsigned char pieper_ein = 0; |
// TCNT0 -= 250;//TIMER_RELOAD_VALUE; |
if(!cnt--) |
{ |
cnt = 9; |
cnt_1ms++; |
cnt_1ms %= 2; |
if(!cnt_1ms) UpdateMotor = 1; |
CountMilliseconds++; |
} |
if(beeptime > 1) |
{ |
beeptime--; |
PORTD |= (1<<PD2); |
if(beeptime & BeepMuster) |
{ |
pieper_ein = 1; |
} |
else pieper_ein = 0; |
} |
else |
{ |
pieper_ein = 0; |
BeepMuster = 0xffff; |
} |
if(pieper_ein) |
{ |
if(PlatinenVersion == 10) PORTD |= (1<<2); // Speaker an PORTD.2 |
else PORTC |= (1<<7); // Speaker an PORTC.7 |
} |
else |
{ |
if(PlatinenVersion == 10) PORTD &= ~(1<<2); |
else PORTC &= ~(1<<7); |
} |
PORTD &= ~(1<<PD2); |
if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV) |
{ |
MM3_timer0(); // Kompass auslesen |
if (!cntKompass--) // Aufruf mit 10 Hz |
{ |
// KompassValue = MM3_heading(); |
// OsiAir hier machen wir den den KompassValue zu 0-359 damit das GPS damit weiterarbeiten kann |
if (MM3_heading() > 0) { KompassValue = 360-MM3_heading();} |
if (MM3_heading() < 0 ) { KompassValue = MM3_heading()*-1;} |
KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180; |
cntKompass = 800; |
} |
} |
} |
/* |
if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV || EE_Parameter.GlobalConfig & CFG_GPS_AKTIV) //Abfrage um GPS_AKTIV erweitert, damit auch bei nur eingeschaltetem GPS OHNE Kompass der benötigte Kompassvalue berechnet wird (200907Kr) |
{ |
if(PINC & 0x10) |
{ |
cntKompass++; |
} |
else |
{ |
if((cntKompass) && (cntKompass < 4000)) |
{ |
KompassValue = cntKompass; |
} |
// if(cntKompass < 10) cntKompass = 10; |
// KompassValue = (unsigned long)((unsigned long)(cntKompass-10)*720L + 1L) / 703L; |
KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180; |
cntKompass = 0; |
} |
} |
} |
*/ |
void Timer_Init(void) |
{ |
tim_main = SetDelay(10); |
TCCR0B = CK8; |
TCCR0A = (1<<COM0A1)|(1<<COM0B1)|3;//fast PWM |
OCR0A = 0; |
OCR0B = 120; |
//TCNT0 = -TIMER_RELOAD_VALUE; // reload |
//OCR1 = 0x00; |
TCCR2A=(1<<COM2A1)|(1<<COM2A0)|3; |
TCCR2B=(0<<CS20)|(1<<CS21)|(1<<CS22); |
// TIMSK2 |= _BV(TOIE2); |
TIMSK2 |= _BV(OCIE2A); |
TIMSK0 |= _BV(TOIE0); |
OCR2A = 10; |
TCNT2 = 0; |
} |
// ----------------------------------------------------------------------- |
unsigned int SetDelay (unsigned int t) |
{ |
// TIMSK0 &= ~_BV(TOIE0); |
return(CountMilliseconds + t + 1); |
// TIMSK0 |= _BV(TOIE0); |
} |
// ----------------------------------------------------------------------- |
char CheckDelay(unsigned int t) |
{ |
// TIMSK0 &= ~_BV(TOIE0); |
return(((t - CountMilliseconds) & 0x8000) >> 9); |
// TIMSK0 |= _BV(TOIE0); |
} |
// ----------------------------------------------------------------------- |
void Delay_ms(unsigned int w) |
{ |
unsigned int akt; |
akt = SetDelay(w); |
while (!CheckDelay(akt)); |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Servo ansteuern |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(SIG_OUTPUT_COMPARE2A) |
{ |
static unsigned char timer = 10; |
if(!timer--) |
{ |
TCCR2A=(1<<COM2A1)|(0<<COM2A0)|3; |
ServoValue = Parameter_ServoNickControl; |
if(EE_Parameter.ServoNickCompInvert & 0x01) ServoValue += ((long) EE_Parameter.ServoNickComp * (IntegralNick / 128)) / 512; |
else ServoValue -= ((long) EE_Parameter.ServoNickComp * (IntegralNick / 128)) / 512; |
if(ServoValue < EE_Parameter.ServoNickMin) ServoValue = EE_Parameter.ServoNickMin; |
else if(ServoValue > EE_Parameter.ServoNickMax) ServoValue = EE_Parameter.ServoNickMax; |
OCR2A = ServoValue;// + 75; |
timer = EE_Parameter.ServoNickRefresh; |
} |
else |
{ |
TCCR2A =3; |
PORTD&=~0x80; |
} |
} |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/timer0.h |
---|
0,0 → 1,15 |
#define TIMER_TEILER CK8 |
#define TIMER_RELOAD_VALUE 250 |
void Timer_Init(void); |
void Delay_ms(unsigned int); |
unsigned int SetDelay (unsigned int t); |
char CheckDelay (unsigned int t); |
extern volatile unsigned int CountMilliseconds; |
extern volatile unsigned char UpdateMotor; |
extern volatile unsigned int beeptime; |
extern volatile unsigned int cntKompass; |
extern int ServoValue; |
extern unsigned int BeepMuster; |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/twimaster.c |
---|
0,0 → 1,152 |
/*############################################################################ |
############################################################################*/ |
#include "main.h" |
unsigned char twi_state = 0; |
unsigned char motor = 0; |
unsigned char motorread = 0; |
unsigned char motor_rx[8]; |
//############################################################################ |
//Initzialisieren der I2C (TWI) Schnittstelle |
void i2c_init(void) |
//############################################################################ |
{ |
TWSR = 0; |
TWBR = ((SYSCLK/SCL_CLOCK)-16)/2; |
} |
//############################################################################ |
//Start I2C |
char i2c_start(void) |
//############################################################################ |
{ |
TWCR = (1<<TWSTA) | (1<<TWEN) | (1<<TWINT) | (1<<TWIE); |
return(0); |
} |
//############################################################################ |
//Start I2C |
void i2c_stop(void) |
//############################################################################ |
{ |
TWCR = (1<<TWEN) | (1<<TWSTO) | (1<<TWINT); |
} |
void i2c_reset(void) |
//############################################################################ |
{ |
i2c_stop(); |
twi_state = 0; |
motor = TWDR; |
motor = 0; |
TWCR = 0x80; |
TWAMR = 0; |
TWAR = 0; |
TWDR = 0; |
TWSR = 0; |
TWBR = 0; |
i2c_init(); |
i2c_start(); |
i2c_write_byte(0); |
} |
//############################################################################ |
//Start I2C |
char i2c_write_byte(char byte) |
//############################################################################ |
{ |
TWSR = 0x00; |
TWDR = byte; |
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWIE); |
return(0); |
} |
//############################################################################ |
//Start I2C |
SIGNAL (TWI_vect) |
//############################################################################ |
{ |
switch (twi_state++) |
{ |
case 0: |
i2c_write_byte(0x52+(motor*2)); |
break; |
case 1: |
switch(motor++) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 2: |
i2c_stop(); |
if (motor<4) twi_state = 0; |
else motor = 0; |
i2c_start(); |
break; |
//Liest Daten von Motor |
case 3: |
i2c_write_byte(0x53+(motorread*2)); |
break; |
case 4: |
switch(motorread) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 5: //1 Byte vom Motor lesen |
motor_rx[motorread] = TWDR; |
case 6: |
switch(motorread) |
{ |
case 0: |
i2c_write_byte(Motor_Vorne); |
break; |
case 1: |
i2c_write_byte(Motor_Hinten); |
break; |
case 2: |
i2c_write_byte(Motor_Rechts); |
break; |
case 3: |
i2c_write_byte(Motor_Links); |
break; |
} |
break; |
case 7: //2 Byte vom Motor lesen |
motor_rx[motorread+4] = TWDR; |
motorread++; |
if (motorread>3) motorread=0; |
i2c_stop(); |
I2CTimeout = 10; |
twi_state = 0; |
} |
TWCR |= 0x80; |
} |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/twimaster.h |
---|
0,0 → 1,32 |
/*############################################################################ |
############################################################################*/ |
#ifndef _I2C_MASTER_H |
#define _I2C_MASTER_H |
//############################################################################ |
// I2C Konstanten |
#define SCL_CLOCK 200000L |
#define I2C_TIMEOUT 30000 |
#define I2C_START 0x08 |
#define I2C_REPEATED_START 0x10 |
#define I2C_TX_SLA_ACK 0x18 |
#define I2C_TX_DATA_ACK 0x28 |
#define I2C_RX_SLA_ACK 0x40 |
#define I2C_RX_DATA_ACK 0x50 |
//############################################################################ |
extern unsigned char twi_state; |
extern unsigned char motor; |
extern unsigned char motorread; |
extern unsigned char motor_rx[8]; |
void i2c_init (void); // I2C initialisieren |
char i2c_start (void); // Start I2C |
void i2c_stop (void); // Stop I2C |
char i2c_write_byte (char byte); // 1 Byte schreiben |
#endif |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/uart.c |
---|
0,0 → 1,652 |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 04.2007 Holger Buss |
// + only for non-profit use |
// + www.MikroKopter.com |
// + see the File "License.txt" for further Informations |
// + |
// + GPS read out: |
// + modified Version of the Pitschu Brushless Ufo - (c) Peter Schulten, Mülheim, Germany |
// + only for non-profit use |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include "main.h" |
#include "uart.h" |
unsigned char DebugGetAnforderung = 0,DebugDisplayAnforderung = 0,DebugDataAnforderung = 0,GetVersionAnforderung = 0; |
unsigned volatile char SioTmp = 0; |
unsigned volatile char SendeBuffer[MAX_SENDE_BUFF]; |
unsigned volatile char RxdBuffer[MAX_EMPFANGS_BUFF]; |
unsigned volatile char NMEABuffer[MAX_EMPFANGS_BUFF]; |
unsigned volatile char NeuerDatensatzEmpfangen = 0; |
unsigned volatile char NeueKoordinateEmpfangen = 0; |
unsigned volatile char UebertragungAbgeschlossen = 1; |
unsigned volatile char CntCrcError = 0; |
unsigned volatile char AnzahlEmpfangsBytes = 0; |
unsigned volatile char PC_DebugTimeout = 0; |
unsigned char PcZugriff = 100; |
unsigned char MotorTest[4] = {0,0,0,0}; |
unsigned char MeineSlaveAdresse; |
struct str_DebugOut DebugOut; |
struct str_Debug DebugIn; |
struct str_VersionInfo VersionInfo; |
int Debug_Timer; |
static uint8_t gpsState; |
#define GPS_EMPTY 0 |
#define GPS_SYNC1 1 |
#define GPS_SYNC2 2 |
#define GPS_CLASS 3 |
#define GPS_LEN1 4 |
#define GPS_LEN2 5 |
#define GPS_FILLING 6 |
#define GPS_CKA 7 |
#define GPS_CKB 8 |
gpsInfo_t actualPos; // measured position (last gps record) |
#define SYNC_CHAR1 0xb5 |
#define SYNC_CHAR2 0x62 |
#define CLASS_NAV 0x01 |
#define MSGID_POSECEF 0x01 |
#define MSGID_STATUS 0x03 |
#define MSGID_VELECEF 0x11 |
#define MSGID_POSUTM 0x08 |
#define MSGID_VELNED 0x12 |
typedef struct { |
unsigned long ITOW; // time of week |
uint8_t GPSfix; // GPSfix Type, range 0..6 |
uint8_t Flags; // Navigation Status Flags |
uint8_t DiffS; // Differential Status |
uint8_t res; // reserved |
unsigned long TTFF; // Time to first fix (millisecond time tag) |
unsigned long MSSS; // Milliseconds since Startup / Reset |
uint8_t packetStatus; |
} NAV_STATUS_t; |
typedef struct { |
unsigned long ITOW; // time of week |
long LON; // longitude in 1e-07 deg |
long LAT; // lattitude |
long HEIGHT; // height in mm |
long HMSL; // height above mean sea level im mm |
unsigned long Hacc; // horizontal accuracy in mm |
unsigned long Vacc; // vertical accuracy in mm |
uint8_t packetStatus; |
} NAV_POSLLH_t; |
typedef struct { |
unsigned long ITOW; // time of week |
long EAST; // cm UTM Easting |
long NORTH; // cm UTM Nording |
long ALT; // cm altitude |
uint8_t ZONE; // UTM zone number |
uint8_t HEM; // Hemisphere Indicator (0=North, 1=South) |
uint8_t packetStatus; |
} NAV_POSUTM_t; |
typedef struct { |
unsigned long ITOW; // ms GPS Millisecond Time of Week |
long VEL_N; // cm/s NED north velocity |
long VEL_E; // cm/s NED east velocity |
long VEL_D; // cm/s NED down velocity |
unsigned long Speed; // cm/s Speed (3-D) |
unsigned long GSpeed; // cm/s Ground Speed (2-D) |
long Heading; // deg (1e-05) Heading 2-D |
unsigned long SAcc; // cm/s Speed Accuracy Estimate |
unsigned long CAcc; // deg Course / Heading Accuracy Estimate |
uint8_t packetStatus; |
} NAV_VELNED_t; |
typedef struct { |
unsigned long ITOW; // ms GPS Millisecond Time of Week |
long ECEF_X; // ecef x / cm |
long ECEF_Y; // ecef y / cm |
long ECEF_Z; // ecef z / cm |
unsigned long Pacc; // Abweichung |
uint8_t packetStatus; |
} NAV_POSECEF_t ; |
typedef struct { |
unsigned long ITOW; // ms GPS Millisecond Time of Week |
long ECEFVX; // ecef x velocity cm/s |
long ECEFVY; // ecef y velocity cm/s |
long ECEFVZ; // ecef z velocity cm/s |
unsigned long SAcc; // Abweichung |
uint8_t packetStatus; |
} NAV_VELECEF_t; |
NAV_STATUS_t navStatus; |
NAV_POSECEF_t navPosECEF; |
NAV_VELECEF_t navVelECEF; |
NAV_POSUTM_t navPosUtm; |
NAV_VELNED_t navVelNed; |
volatile char *ubxP, *ubxEp, *ubxSp; // pointers to packet currently transfered |
volatile uint8_t CK_A, CK_B; // UBX checksum bytes |
volatile unsigned short msgLen; |
volatile uint8_t msgID; |
volatile uint8_t ignorePacket; // true when previous packet was not processed |
// distance to target position |
long rollOffset; // in 10cm |
long nickOffset; |
#define GPS_INTCYCLES 100 |
#define GPS_I_LIMIT (long)(40 * MAINLOOPS_PER_SEC) |
#ifdef GPS_DEBUG // if set then the GPS data is transfered to display |
extern volatile uint8_t v24state; |
char buf[200]; |
char *bp; |
char *ep; |
#endif |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//++ Sende-Part der Datenübertragung |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(INT_VEC_TX) |
{ |
static unsigned int ptr = 0; |
unsigned char tmp_tx; |
if(!UebertragungAbgeschlossen) |
{ |
ptr++; // die [0] wurde schon gesendet |
tmp_tx = SendeBuffer[ptr]; |
if((tmp_tx == '\r') || (ptr == MAX_SENDE_BUFF)) |
{ |
ptr = 0; |
UebertragungAbgeschlossen = 1; |
} |
UDR = tmp_tx; |
} |
else ptr = 0; |
} |
void GPSscanData (void) |
{ |
if (navPosECEF.packetStatus == 1) // valid packet |
{ |
actualPos.x = navPosECEF.ECEF_X; //ECEF X in cm |
actualPos.y = navPosECEF.ECEF_Y; //ECEF Y in cm |
actualPos.z = navPosECEF.ECEF_Z; //ECEF Z in cm |
navPosECEF.packetStatus = 0; |
} |
if (navStatus.packetStatus == 1) // valid packet |
{ |
actualPos.GPSFix = navStatus.GPSfix; |
actualPos.newData = navStatus.packetStatus; |
navStatus.packetStatus = 0; |
} |
if (navVelECEF.packetStatus == 1) // valid packet |
{ |
actualPos.vx = navVelECEF.ECEFVX; //ECEF VEL X in cm/s |
actualPos.vy = navVelECEF.ECEFVY; //ECEF VEL Y in cm/s |
actualPos.vz = navVelECEF.ECEFVZ; //ECEF VEL Z in cm/s |
navVelECEF.packetStatus = 0; |
} |
if (navPosUtm.packetStatus == 1) // valid packet |
{ |
actualPos.northing = navPosUtm.NORTH; |
actualPos.easting = navPosUtm.EAST; |
actualPos.altitude = navPosUtm.ALT; |
navPosUtm.packetStatus = 0; |
} |
if (navVelNed.packetStatus == 1) |
{ |
actualPos.velNorth = navVelNed.VEL_N; |
actualPos.velEast = navVelNed.VEL_E; |
navVelNed.packetStatus = 0; |
} |
if (actualPos.newData != 0){ROT_ON;} //-> Rot blinkt mit 4Hz wenn Daten vom GPS Empfänger ankommen und brauchbar sind |
} |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//++ Empfangs-Part der Datenübertragung, incl. CRC-Auswertung |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
SIGNAL(INT_VEC_RX) |
{ |
static unsigned int crc; |
static unsigned char crc1,crc2,buf_ptr; |
static unsigned char UartState = 0; |
unsigned char CrcOkay = 0; |
SioTmp = UDR; |
uint8_t c; |
uint8_t re; |
re = (UCSR0A & (_B1(FE0) | _B1(DOR0))); // any error occured ? |
c = SioTmp; |
#ifdef GPS_DEBUG |
*bp++ = c; |
if (bp >= (buf+200)) bp = buf; |
if (v24state == 0) |
{ |
v24state = 1; |
UDR0 = *ep++; |
if (ep >= buf+200) |
ep = buf; |
UCSR0B |= _B1(UDRIE0); //enable further irqs |
} |
#endif |
if (re == 0) |
{ |
switch (gpsState) |
{ |
case GPS_EMPTY: |
if (c == SYNC_CHAR1) |
gpsState = GPS_SYNC1; |
break; |
case GPS_SYNC1: |
if (c == SYNC_CHAR2) |
gpsState = GPS_SYNC2; |
else if (c != SYNC_CHAR1) |
gpsState = GPS_EMPTY; |
break; |
case GPS_SYNC2: |
if (c == CLASS_NAV) |
gpsState = GPS_CLASS; |
else |
gpsState = GPS_EMPTY; |
break; |
case GPS_CLASS: // msg ID seen: init packed receive |
msgID = c; |
CK_A = CLASS_NAV + c; |
CK_B = CLASS_NAV + CK_A; |
gpsState = GPS_LEN1; |
switch (msgID) |
{ |
case MSGID_STATUS: |
ubxP = (char*)&navStatus; |
ubxEp = (char*)(&navStatus + sizeof(NAV_STATUS_t)); |
ubxSp = (char*)&navStatus.packetStatus; |
ignorePacket = navStatus.packetStatus; |
break; |
case MSGID_POSECEF: |
ubxP = (char*)&navPosECEF; |
ubxEp = (char*)(&navPosECEF + sizeof(NAV_POSECEF_t)); |
ubxSp = (char*)&navPosECEF.packetStatus; |
ignorePacket = navPosECEF.packetStatus; |
break; |
case MSGID_VELECEF: |
ubxP = (char*)&navVelECEF; |
ubxEp = (char*)(&navVelECEF + sizeof(NAV_VELECEF_t)); |
ubxSp = (char*)&navVelECEF.packetStatus; |
ignorePacket = navVelECEF.packetStatus; |
break; |
case MSGID_POSUTM: |
ubxP = (char*)&navPosUtm; |
ubxEp = (char*)(&navPosUtm + sizeof(NAV_POSUTM_t)); |
ubxSp = (char*)&navPosUtm.packetStatus; |
ignorePacket = navPosUtm.packetStatus; |
break; |
case MSGID_VELNED: |
ubxP = (char*)&navVelNed; |
ubxEp = (char*)(&navVelNed + sizeof(NAV_VELNED_t)); |
ubxSp = (char*)&navVelNed.packetStatus; |
ignorePacket = navVelNed.packetStatus; |
break; |
default: |
ignorePacket = 1; |
ubxSp = (char*)0; |
} |
break; |
case GPS_LEN1: // first len byte |
msgLen = c; |
CK_A += c; |
CK_B += CK_A; |
gpsState = GPS_LEN2; |
break; |
case GPS_LEN2: // second len byte |
msgLen = msgLen + (c * 256); |
CK_A += c; |
CK_B += CK_A; |
gpsState = GPS_FILLING; // next data will be stored in packet struct |
break; |
case GPS_FILLING: |
CK_A += c; |
CK_B += CK_A; |
if ( !ignorePacket && ubxP < ubxEp) |
*ubxP++ = c; |
if (--msgLen == 0) |
gpsState = GPS_CKA; |
break; |
case GPS_CKA: |
if (c == CK_A) |
gpsState = GPS_CKB; |
else |
gpsState = GPS_EMPTY; |
break; |
case GPS_CKB: |
if (c == CK_B && ubxSp) // No error -> packet received successfully |
*ubxSp = 1; // set packetStatus in struct |
gpsState = GPS_EMPTY; // ready for next packet |
break; |
default: |
gpsState = GPS_EMPTY; // ready for next packet |
} |
} |
else // discard any data if error occured |
{ |
gpsState = GPS_EMPTY; |
GPSscanData (); //Test kann ggf. wieder gelöscht werden! |
} |
GPSscanData (); |
if(buf_ptr >= MAX_EMPFANGS_BUFF) UartState = 0; |
if(SioTmp == '\r' && UartState == 2) |
{ |
UartState = 0; |
crc -= RxdBuffer[buf_ptr-2]; |
crc -= RxdBuffer[buf_ptr-1]; |
crc %= 4096; |
crc1 = '=' + crc / 64; |
crc2 = '=' + crc % 64; |
CrcOkay = 0; |
if((crc1 == RxdBuffer[buf_ptr-2]) && (crc2 == RxdBuffer[buf_ptr-1])) CrcOkay = 1; else { CrcOkay = 0; CntCrcError++;}; |
if(!NeuerDatensatzEmpfangen && CrcOkay) // Datensatz schon verarbeitet |
{ |
NeuerDatensatzEmpfangen = 1; |
AnzahlEmpfangsBytes = buf_ptr; |
RxdBuffer[buf_ptr] = '\r'; |
if(RxdBuffer[2] == 'R') wdt_enable(WDTO_250MS); // Reset-Commando |
} |
} |
else |
switch(UartState) |
{ |
case 0: |
if(SioTmp == '#' && !NeuerDatensatzEmpfangen) UartState = 1; // Startzeichen und Daten schon verarbeitet |
buf_ptr = 0; |
RxdBuffer[buf_ptr++] = SioTmp; |
crc = SioTmp; |
break; |
case 1: // Adresse auswerten |
UartState++; |
RxdBuffer[buf_ptr++] = SioTmp; |
crc += SioTmp; |
break; |
case 2: // Eingangsdaten sammeln |
RxdBuffer[buf_ptr] = SioTmp; |
if(buf_ptr < MAX_EMPFANGS_BUFF) buf_ptr++; |
else UartState = 0; |
crc += SioTmp; |
break; |
default: |
UartState = 0; |
break; |
} |
} |
// -------------------------------------------------------------------------- |
void AddCRC(unsigned int wieviele) |
{ |
unsigned int tmpCRC = 0,i; |
for(i = 0; i < wieviele;i++) |
{ |
tmpCRC += SendeBuffer[i]; |
} |
tmpCRC %= 4096; |
SendeBuffer[i++] = '=' + tmpCRC / 64; |
SendeBuffer[i++] = '=' + tmpCRC % 64; |
SendeBuffer[i++] = '\r'; |
UebertragungAbgeschlossen = 0; |
UDR = SendeBuffer[0]; |
} |
// -------------------------------------------------------------------------- |
void SendOutData(unsigned char cmd,unsigned char modul, unsigned char *snd, unsigned char len) |
{ |
unsigned int pt = 0; |
unsigned char a,b,c; |
unsigned char ptr = 0; |
SendeBuffer[pt++] = '#'; // Startzeichen |
SendeBuffer[pt++] = modul; // Adresse (a=0; b=1,...) |
SendeBuffer[pt++] = cmd; // Commando |
while(len) |
{ |
if(len) { a = snd[ptr++]; len--;} else a = 0; |
if(len) { b = snd[ptr++]; len--;} else b = 0; |
if(len) { c = snd[ptr++]; len--;} else c = 0; |
SendeBuffer[pt++] = '=' + (a >> 2); |
SendeBuffer[pt++] = '=' + (((a & 0x03) << 4) | ((b & 0xf0) >> 4)); |
SendeBuffer[pt++] = '=' + (((b & 0x0f) << 2) | ((c & 0xc0) >> 6)); |
SendeBuffer[pt++] = '=' + ( c & 0x3f); |
} |
AddCRC(pt); |
} |
// -------------------------------------------------------------------------- |
void Decode64(unsigned char *ptrOut, unsigned char len, unsigned char ptrIn,unsigned char max) // Wohin mit den Daten; Wie lang; Wo im RxdBuffer |
{ |
unsigned char a,b,c,d; |
unsigned char ptr = 0; |
unsigned char x,y,z; |
while(len) |
{ |
a = RxdBuffer[ptrIn++] - '='; |
b = RxdBuffer[ptrIn++] - '='; |
c = RxdBuffer[ptrIn++] - '='; |
d = RxdBuffer[ptrIn++] - '='; |
if(ptrIn > max - 2) break; // nicht mehr Daten verarbeiten, als empfangen wurden |
x = (a << 2) | (b >> 4); |
y = ((b & 0x0f) << 4) | (c >> 2); |
z = ((c & 0x03) << 6) | d; |
if(len--) ptrOut[ptr++] = x; else break; |
if(len--) ptrOut[ptr++] = y; else break; |
if(len--) ptrOut[ptr++] = z; else break; |
} |
} |
// -------------------------------------------------------------------------- |
void BearbeiteRxDaten(void) |
{ |
if(!NeuerDatensatzEmpfangen) return; |
//unsigned int tmp_int_arr1[1]; |
//unsigned int tmp_int_arr2[2]; |
//unsigned int tmp_int_arr3[3]; |
unsigned char tmp_char_arr2[2]; |
//unsigned char tmp_char_arr3[3]; |
//unsigned char tmp_char_arr4[4]; |
/* |
unsigned int tmp_int_arr1[1]; |
unsigned int tmp_int_arr2[2]; |
unsigned int tmp_int_arr3[3]; |
unsigned char tmp_char_arr2[2]; |
unsigned char tmp_char_arr3[3]; |
unsigned char tmp_char_arr4[4]; |
*/ |
//if(!MotorenEin) |
PcZugriff = 255; |
switch(RxdBuffer[2]) |
{ |
case 'c':// Debugdaten incl. Externe IOs usw |
Decode64((unsigned char *) &DebugIn,sizeof(DebugIn),3,AnzahlEmpfangsBytes); |
/* for(unsigned char i=0; i<4;i++) |
{ |
EE_CheckAndWrite(&EE_Buffer[EE_DEBUGWERTE + i*2], DebugIn.Analog[i]); |
EE_CheckAndWrite(&EE_Buffer[EE_DEBUGWERTE + i*2 + 1], DebugIn.Analog[i] >> 8); |
}*/ |
//RemoteTasten |= DebugIn.RemoteTasten; |
DebugDataAnforderung = 1; |
break; |
case 'h':// x-1 Displayzeilen |
Decode64((unsigned char *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes); |
RemoteTasten |= tmp_char_arr2[0]; |
DebugDisplayAnforderung = 1; |
break; |
case 't':// Motortest |
Decode64((unsigned char *) &MotorTest[0],sizeof(MotorTest),3,AnzahlEmpfangsBytes); |
break; |
case 'v': // Version-Anforderung und Ausbaustufe |
GetVersionAnforderung = 1; |
break; |
case 'g':// "Get"-Anforderung für Debug-Daten |
// Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
DebugGetAnforderung = 1; |
break; |
case 'q':// "Get"-Anforderung für Settings |
// Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
Decode64((unsigned char *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes); |
if(tmp_char_arr2[0] != 0xff) |
{ |
if(tmp_char_arr2[0] > 5) tmp_char_arr2[0] = 5; |
ReadParameterSet(tmp_char_arr2[0], (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
SendOutData('L' + tmp_char_arr2[0] -1,MeineSlaveAdresse,(unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE); |
} |
else |
SendOutData('L' + GetActiveParamSetNumber()-1,MeineSlaveAdresse,(unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE); |
break; |
case 'l': |
case 'm': |
case 'n': |
case 'o': |
case 'p': // Parametersatz speichern |
Decode64((unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE,3,AnzahlEmpfangsBytes); |
WriteParameterSet(RxdBuffer[2] - 'l' + 1, (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], RxdBuffer[2] - 'l' + 1); // aktiven Datensatz merken |
Piep(GetActiveParamSetNumber()); |
break; |
} |
// DebugOut.AnzahlZyklen = Debug_Timer_Intervall; |
NeuerDatensatzEmpfangen = 0; |
} |
//############################################################################ |
//Routine für die Serielle Ausgabe |
int uart_putchar (char c) |
//############################################################################ |
{ |
if (c == '\n') |
uart_putchar('\r'); |
//Warten solange bis Zeichen gesendet wurde |
loop_until_bit_is_set(USR, UDRE); |
//Ausgabe des Zeichens |
UDR = c; |
return (0); |
} |
// -------------------------------------------------------------------------- |
void WriteProgramData(unsigned int pos, unsigned char wert) |
{ |
//if (ProgramLocation == IN_RAM) Buffer[pos] = wert; |
// else eeprom_write_byte(&EE_Buffer[pos], wert); |
// Buffer[pos] = wert; |
} |
//############################################################################ |
//INstallation der Seriellen Schnittstelle |
void UART_Init (void) |
//############################################################################ |
{ |
//Enable TXEN im Register UCR TX-Data Enable & RX Enable |
UCR=(1 << TXEN) | (1 << RXEN); |
// UART Double Speed (U2X) |
USR |= (1<<U2X); |
// RX-Interrupt Freigabe |
UCSRB |= (1<<RXCIE); |
// TX-Interrupt Freigabe |
UCSRB |= (1<<TXCIE); |
//Teiler wird gesetzt |
UBRR=(SYSCLK / (BAUD_RATE * 8L) - 1); |
//UBRR = 33; |
//öffnet einen Kanal für printf (STDOUT) |
//fdevopen (uart_putchar, 0); |
//sbi(PORTD,4); |
Debug_Timer = SetDelay(200); |
gpsState = GPS_EMPTY; |
} |
//--------------------------------------------------------------------------------------------- |
void DatenUebertragung(void) |
{ |
static char dis_zeile = 0; |
if(!UebertragungAbgeschlossen) return; |
if(DebugGetAnforderung && UebertragungAbgeschlossen) // Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
{ |
SendOutData('G',MeineSlaveAdresse,(unsigned char *) &DebugIn,sizeof(DebugIn)); |
DebugGetAnforderung = 0; |
} |
if((CheckDelay(Debug_Timer) || DebugDataAnforderung) && UebertragungAbgeschlossen) |
{ |
SendOutData('D',MeineSlaveAdresse,(unsigned char *) &DebugOut,sizeof(DebugOut)); |
DebugDataAnforderung = 0; |
Debug_Timer = SetDelay(MIN_DEBUG_INTERVALL); |
} |
if(DebugDisplayAnforderung && UebertragungAbgeschlossen) |
{ |
Menu(); |
DebugDisplayAnforderung = 0; |
if(++dis_zeile == 4) |
{ |
SendOutData('4',0,&PPM_in,sizeof(PPM_in)); // DisplayZeile übertragen |
dis_zeile = -1; |
} |
else SendOutData('0' + dis_zeile,0,&DisplayBuff[20 * dis_zeile],20); // DisplayZeile übertragen |
} |
if(GetVersionAnforderung && UebertragungAbgeschlossen) |
{ |
SendOutData('V',MeineSlaveAdresse,(unsigned char *) &VersionInfo,sizeof(VersionInfo)); |
GetVersionAnforderung = 0; |
} |
} |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/uart.h |
---|
0,0 → 1,119 |
#ifndef _UART_H |
#define _UART_H |
#define MAX_SENDE_BUFF 150 |
#define MAX_EMPFANGS_BUFF 150 |
extern unsigned char DebugGetAnforderung; |
extern unsigned volatile char SendeBuffer[MAX_SENDE_BUFF]; |
extern unsigned volatile char RxdBuffer[MAX_EMPFANGS_BUFF]; |
extern unsigned volatile char UebertragungAbgeschlossen; |
extern unsigned volatile char PC_DebugTimeout; |
extern unsigned volatile char NeueKoordinateEmpfangen; |
extern unsigned char MeineSlaveAdresse; |
extern unsigned char PcZugriff; |
extern int Debug_Timer; |
extern void UART_Init (void); |
extern int uart_putchar (char c); |
extern void boot_program_page (uint32_t page, uint8_t *buf); |
extern void DatenUebertragung(void); |
extern void DecodeNMEA(void); |
extern unsigned char MotorTest[4]; |
struct str_DebugOut |
{ |
unsigned char Digital[2]; |
unsigned int Analog[32]; // Debugwerte |
}; |
extern struct str_DebugOut DebugOut; |
#define _B1(bit) (1 << (bit)) |
#define _B0(bit) (0 << (bit)) |
typedef struct |
{ |
long x; // in cm (+ = north) |
long y; // in cm (+ = east) |
long z; // in cm |
long vx; |
long vy; |
long vz; |
long northing; |
long easting; |
long altitude; |
long velNorth; |
long velEast; |
uint8_t newData; // status of data: 0 = invlid; 1 = valid |
uint8_t GPSFix; |
uint8_t noSV; // number of sats |
} gpsInfo_t; |
extern gpsInfo_t lockedPos; // stored position to fly to |
extern gpsInfo_t actualPos; // measured position (last gps record) |
extern void GPSscanData (void); |
extern void GPSupdate(void); |
extern void GPSsaveTarget (uint8_t mode); |
struct str_Debug |
{ |
unsigned char Digital[2]; |
unsigned char RemoteTasten; |
unsigned int Analog[4]; |
}; |
extern struct str_Debug DebugIn; |
struct str_VersionInfo |
{ |
unsigned char Hauptversion; |
unsigned char Nebenversion; |
unsigned char PCKompatibel; |
unsigned char Rserved[7]; |
}; |
extern struct str_VersionInfo VersionInfo; |
//Die Baud_Rate der Seriellen Schnittstelle ist 9600 Baud |
//#define BAUD_RATE 9600 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 14400 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 28800 //Baud Rate für die Serielle Schnittstelle |
//#define BAUD_RATE 38400 //Baud Rate für die Serielle Schnittstelle |
#define BAUD_RATE 57600 //Baud Rate für die Serielle Schnittstelle |
//Anpassen der seriellen Schnittstellen Register wenn ein ATMega128 benutzt wird |
#if defined (__AVR_ATmega128__) |
# define USR UCSR0A |
# define UCR UCSR0B |
# define UDR UDR0 |
# define UBRR UBRR0L |
# define EICR EICRB |
#endif |
#if defined (__AVR_ATmega32__) |
# define USR UCSRA |
# define UCR UCSRB |
# define UBRR UBRRL |
# define EICR EICRB |
# define INT_VEC_RX SIG_UART_RECV |
# define INT_VEC_TX SIG_UART_TRANS |
#endif |
#if defined (__AVR_ATmega644__) |
# define USR UCSR0A |
# define UCR UCSR0B |
# define UDR UDR0 |
# define UBRR UBRR0L |
# define EICR EICR0B |
# define TXEN TXEN0 |
# define RXEN RXEN0 |
# define RXCIE RXCIE0 |
# define TXCIE TXCIE0 |
# define U2X U2X0 |
# define UCSRB UCSR0B |
# define UDRE UDRE0 |
# define INT_VEC_RX SIG_USART_RECV |
# define INT_VEC_TX SIG_USART_TRANS |
#endif |
#endif //_UART_H |
/branches/MergedVersionsByOsiair/beta/v064JokoGPSNick666MM_1_1_compiled/version.txt |
---|
0,0 → 1,104 |
------- |
V0.53 27.04.2007 H.Buss |
- erste öffentliche Version |
V0.53b 29.04.2007 H.Buss |
- der FAKTOR_I war versehentlich auf Null, dann liegt der MikroKopter nicht so hart in der Luft |
V0.53c 29.04.2007 H.Buss |
- es gib ein Menü, in dem die Werte der Kanäle nach Nick, Roll, Gas,... sortiert sind. |
Die angezeigten Werte waren nicht die Werte der Funke |
V0.54 01.05.2007 H.Buss |
- die Paramtersätze können jetzt vor dem Start ausgewählt werden |
Dazu wird beim Kalibrieren der Messwerte (Gashebel oben links) der Nick-Rollhebel abgefragt: |
2 3 4 |
1 x 5 |
- - - |
Bedeutet: Nick-Rollhebel Links Mitte = Setting:1 Links Oben = Setting:2 usw. |
- der Faktor_I für den Hauptregler ist hinzugekommen. Im Heading-Hold-Modus sollte er vergössert werden, was Stabilität bringt |
V0.55 14.05.2007 H.Buss |
- es können nun Servos an J3,J4,J5 mit den Kanälen 5-7 gesteuert werden |
V0.56 14.05.2007 H.Buss |
- es gab Probleme mit Funken, die mehr als 8 Kanäle haben, wenn mehrere Kanäle dann auf Null waren |
- Funken, die nicht bis +-120 aussteuern können, sollten jetzt auch gehen |
V0.57 24.05.2007 H.Buss |
- Der Höhenregler kann nun auch mittels Schalter bedient werden |
- Bug im Gier-Algorithmus behoben; Schnelles Gieren fürhrte dazu, dass der MK zu weit gedreht hat |
- Kompass-Einfluss dämpfen bei Neigung |
- Man kann zwischen Kompass FIX (Richtung beim Kalibrieren) und Variabel (einstellbar per Gier) wählen |
- Der Motortest vom Kopter-Tool geht jetzt |
- Man kann den Parametersätzen einen Namen geben |
- Das Kamerasetting ist unter Setting 2 defaultmässig integriert |
V0.58 30.05.2007 H.Buss |
- Der Höhenregler-Algorithmus wird nun umgangen, wenn der Höhenreglerschalter aus ist |
V0.60 17.08.2007 H.Buss |
- "Schwindel-Bug" behoben |
- Die Poti-Werte werden jetzt auf Unterlauf (<0) überprüft |
- Poti4 zugefügt |
- Es werden jetzt 8 Kanäle ausgewertet |
- Kamera-Servo (an J7) |
- Die Settings müssen überschrieben werden |
V0.61 - V0.63 H.Buss 27.09.2007 |
- Poti 4 und Kanal 8 werden im Menü angezeigt |
- ein paar Kleinigkeiten bei den DefaultKonstanten2 bereinigt |
- Analog.c: Aktuell_ax korrigiert |
- auf 32 Debug-Kanäle erweitert |
- Loopings sind jetzt möglich und einzeln im KopterTool freischaltbar |
- leichte Anpassungen im Gier - Geschwindigkeit und Drift |
- die Hardwareversion V1.1 wird erkannt und das Programm stellt sich auf die geänderte Gyroverstärkung und die geänderten Portpins ein |
- die Software startet nach dem Einschalten schneller, weil der Luftdruckoffset schneller gefunden wird |
- die PPM-Ausgänge liegen wieder an den Pins an |
- Details an der Sensordatenverarbeitung -> es fliegt sich geringfügig anders |
- der MK ist bei wenig Gas nicht mehr so giftig -> soll das Landen vereinfachen |
- I2C-Bus läuft jetzt sicher nach einer Störung wieder an |
- Sticksignale werden präziser ausgewertet |
- Stick-Kanäle werden ans Kopter-Tool übertragen |
- Es muss die Version V1.47 des Kopter-Tool verwendet werden |
- Die Settings werden auf Default zurückgesetzt |
- am Piepen kann man die Fehlerart unterscheiden |
1. einzelnes Piepen beim Einschalten und Kalibrieren |
2. langsames Intervall mindestens 1 Sek -> Empfangsausfall |
3. schnelleres Intervall mindestens 1 Sek -> Akku |
4. sehr schnelles Intervall mindestens 1 Sek -> Kommunikation zu den Reglern gestört |
V0.64 H.Buss 30.09.2007 |
- beim Gieren wurden die Achsen nicht hart genug geregelt |
- Höhenreglerabsenkung von -20 auf -40 (fc.c) |
- LED1 und LED2 Ansteuerung (fc.c) und (main.h) |
- geänderte Kanalbelegung K1 mit K3 getauscht, Unterspannungsschwelle (9,5V) und StickD (fc.c) |
- P,D Anteil seperat in Variable geschrieben und auf das Analog Display Ausgegeben (Kopter Tool) |
- GPS_Nick und GPS_Roll werden nach Deaktivierung von Position-Hold auf Null gesetzt, um ein Einfrieren der GPS Steuerwerte auf den letzten Wert zu verhindern |
- Funktionsaufruf der GPS-Funktion von Chris/Hallo2 |
- UART.C für die GPS Signale im UTM Format auf Pitschu basierend |
- meine GPS.c-Routine |
- Mircos variable Filterung (funktioniert nur wenn 250ms Aufruf aktiv ist) |
- GPS wird deaktiviert und Summer eingeschaltet, wenn kein 3D-Fix (mehr) vorhanden |
- Statusanzeige auf eine LED reduziert (aus, blinkend, an) |
- blinkender LED_1 Ausgang für Positionsleuchten (einstellbar über Userparam.4) |
- Homing-Fkt. eingebaut |
- Diverse Absicherungen gegen Fehlbedienungen (z.B. nicht gelernte Home-Position, ...) |
- Rotationsmatrix mit Kompass, damit die GPS-Fkt. nicht nur nach Norden ausgerichtet funktioniert |
- dyn. Position Hold -> normaler Rundflug möglich |
- Limit_D_Anteil = Userparam3 um im Homing- bzw. Waypointmodus die Sollposition gleichmäßiger anzufliegen |
- Die Berechnung von Kompassvalue wird jetzt auch über den GPS Haken im Koptertool aktiviert |
- 12 Kanal Erweiterung (rc.c; rc.h; fc.c; fc.h; menu.c) |
- D-Anteil_Limit wegen HOMING ->> Radius von 700 cm -> 250 cm |
- ... |
(- Regelung wird nur noch alle 250 ms aufgerufen) |