Subversion Repositories FlightCtrl

Compare Revisions

Regard whitespace Rev 1105 → Rev 1106

/branches/V0.71h KiliPet/FlightCtrl.aps
0,0 → 1,0
<AVRStudio><MANAGEMENT><ProjectName>FlightCtrl</ProjectName><Created>15-May-2007 11:20:41</Created><LastEdit>11-Oct-2007 22:58:54</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>15-May-2007 11:20:41</Created><Version>4</Version><Build>4, 13, 0, 528</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>default\Flight-Ctrl.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>F:\SVN\MikroKopter\FlightCtrl\branches\V0.64_ZeroWarnings\</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>uart.c</SOURCEFILE><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><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></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.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 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -DVERSION_HAUPTVERSION=0 -DVERSION_NEBENVERSION=64 -DVERSION_KOMPATIBEL=5</OPTIONSFORALL><LINKEROPTIONS></LINKEROPTIONS><SEGMENTS/></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\Program Files\WinAVR\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\Program Files\WinAVR\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>uart.c</FileName><Status>1</Status></File00001><File00002><FileId>00002</FileId><FileName>menu.c</FileName><Status>1</Status></File00002><File00003><FileId>00003</FileId><FileName>timer0.c</FileName><Status>1</Status></File00003><File00004><FileId>00004</FileId><FileName>fc.c</FileName><Status>1</Status></File00004><File00005><FileId>00005</FileId><FileName>fc.h</FileName><Status>1</Status></File00005><File00006><FileId>00006</FileId><FileName>menu.h</FileName><Status>1</Status></File00006><File00007><FileId>00007</FileId><FileName>TWIMASTER.C</FileName><Status>1</Status></File00007><File00008><FileId>00008</FileId><FileName>twimaster.h</FileName><Status>1</Status></File00008><File00009><FileId>00009</FileId><FileName>uart.h</FileName><Status>1</Status></File00009><File00010><FileId>00010</FileId><FileName>_Settings.h</FileName><Status>1</Status></File00010><File00011><FileId>00011</FileId><FileName>analog.h</FileName><Status>1</Status></File00011><File00012><FileId>00012</FileId><FileName>gps.h</FileName><Status>1</Status></File00012><File00013><FileId>00013</FileId><FileName>main.h</FileName><Status>1</Status></File00013><File00014><FileId>00014</FileId><FileName>old_macros.h</FileName><Status>1</Status></File00014><File00015><FileId>00015</FileId><FileName>printf_P.h</FileName><Status>1</Status></File00015><File00016><FileId>00016</FileId><FileName>rc.h</FileName><Status>1</Status></File00016><File00017><FileId>00017</FileId><FileName>Settings.h</FileName><Status>1</Status></File00017><File00018><FileId>00018</FileId><FileName>timer0.h</FileName><Status>1</Status></File00018></Files><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio>
/branches/V0.71h KiliPet/GPS.c
0,0 → 1,32
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + 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"
 
signed int GPS_Nick = 0;
signed int GPS_Roll = 0;
signed int GPS_Nick2 = 0;
signed int GPS_Roll2 = 0;
long GpsAktuell_X = 0;
long GpsAktuell_Y = 0;
long GpsZiel_X = 0;
long GpsZiel_Y = 0;
void GPS_Neutral(void)
{
GpsZiel_X = GpsAktuell_X;
GpsZiel_Y = GpsAktuell_Y;
}
 
void GPS_BerechneZielrichtung(void)
{
GPS_Nick = 0;
GPS_Roll = 0;
}
 
 
 
 
/branches/V0.71h KiliPet/Hex-Files/BootLoader_MEGA644_20MHZ_V0_1.hex
0,0 → 1,64
:10F8000011241FBECFEFD0E1DEBFCDBF11E0A0E0DD
:10F81000B1E0E0EEFBEF02C005900D92A030B10721
:10F82000D9F712E0A0E0B1E001C01D92A230B1070B
:10F83000E1F70C943B7C0C941D7C0895982F8091EB
:10F84000C00085FFFCCF9093C60008958091C00052
:10F850008823E4F78091C600992708958DE40E94DB
:10F860001E7C8BE40E941E7C82E40E941E7C8CE441
:10F870000E941E7C0895CFEFD0E1DEBFCDBFE0E057
:10F88000F0E014915F01772474BE98E10FB6F8940C
:10F8900090936000109260000FBE7092C5008AE2E3
:10F8A0008093C4008091C00082608093C0009093D8
:10F8B000C10086E08093C200EF01072D8091C00057
:10F8C00087FF0DC0013031F48091C6008A3AB1F152
:10F8D00000E005C08091C6008B3109F401E0CE0143
:10F8E00021968436910528F11F3F41F0112331F014
:10F8F000E0910001F091010109951BC01092C50033
:10F900008AE28093C4008AE00E941E7C8DE00E94FF
:10F910001E7C86E50E941E7C80E30E941E7C8EE297
:10F920000E941E7C81E30E941E7C8AE30E941E7C52
:10F9300005C080E593EC0197F1F7C0CF0E942E7CC3
:10F940000E94267C813611F489E547C1813471F427
:10F950000E94267CA82EBB24BA2CAA240E94267CB6
:10F960009927A82AB92AB694A79406C1823629F401
:10F9700089E50E941E7C81E00BC1823409F083C0BE
:10F980000E94267C9927D82FCC270E94267C992775
:10F99000C82BD92B0E94267C082F12E0812E11E063
:10F9A000912EEE24FF2464010894811C911CEC1616
:10F9B000FD0618F40E94267C01C08FEFD6018C93BF
:10F9C0000894E11CF11CBFEFEB16F10461F358F34E
:10F9D000E4E77E1609F0DEC0063409F03DC0FFEF13
:10F9E000AF16F7EFBF0608F033C0DE01A5016627AA
:10F9F0007727440F551F661F771F6A017B01C2E0FE
:10FA0000D1E001E08991992729913327322F2227CC
:10FA1000822B932B0C01FA0100935700E8951124D7
:10FA20004E5F5F4F6F4F7F4F129761F785E0F60192
:10FA300080935700E89507B600FCFDCF81E18093E5
:10FA40005700E89576956795579547955A0194C064
:10FA500080E00E941E7C90C0053409F08DC0F50145
:10FA60009E01A2E0B1E0E1BD8F2F992782BD8D916B
:10FA700080BD3196FA9AF99AF999FECF215030401B
:10FA800091F75F0179C0873609F047C00E94267C54
:10FA90009927D82ECC240E94267C9927C82AD92AB7
:10FAA0000E94267C863411F5E6016501EE24FF24D0
:10FAB000CC0CDD1CEE1CFF1CF60105911491802F6F
:10FAC0000E941E7C812F99270E941E7C82E090E07C
:10FAD000A0E0B0E0C80ED91EEA1EFB1E229761F717
:10FAE000F694E794D794C79456012ACF853409F049
:10FAF00027CF7501E1BC8F2D992782BDF89A089414
:10FB0000E11CF11C80B50E941E7C0894C108D1083C
:10FB1000C114D10479F7570113CF853601F594E765
:10FB2000791651F580E090E0A0E0B0E023E0FC0120
:10FB300020935700E89507B600FCFDCF80509F4FFB
:10FB4000AF4FBF4F8F3FE7EF9E07E0E0AE07E0E02B
:10FB5000BE0768F381E180935700E8950DC08534B6
:10FB600069F488E190E02CE00FB6F894A8958093B2
:10FB700060000FBE209360008DE02FC08035E1F360
:10FB80008C34D1F3803711F483E527C0843721F416
:10FB90000E941E7C80E021C0843521F40E94267CD6
:10FBA000782EEACF8B3109F4C9CE8A3A09F4C6CE51
:10FBB000863529F480E30E941E7C81E30EC08337E2
:10FBC00041F489E00E941E7C86E90E941E7C8EE141
:10FBD00004C08B3109F4B4CE8FE30E941E7CB0CEFA
:040000030000F80001
:00000001FF
/branches/V0.71h KiliPet/Hex-Files/Flight-Ctrl_MEGA644_V0_71h.hex
0,0 → 1,2444
:100000000C9494020C94AF020C94AF020C94AF02C7
:100010000C94AF020C94AF020C94AF020C94AF029C
:100020000C94AF020C946C100C94AF020C944D1015
:100030000C94E71C0C94AF020C94AF020C94AF022A
:100040000C94AF020C94AF020C94150F0C94AF02F9
:100050000C94C2050C94AF020C948C050C94AF0266
:100060000C9493120C94AF020C94051C0C94AF02E8
:100070002C1C311C481C541C621C591C621C801C0A
:10008000A71C921C941CAE1C9C1CA71C971C991CA2
:10009000AE1C9C1CA71CA91CAB1CAE1CB21C0A0DE0
:1000A000466C69676874436F6E74726F6C0A0D48B2
:1000B000617264776172653A25642E25640A0D5376
:1000C0006F6674776172653A5625642E25642563E0
:1000D00020000A0D3D3D3D3D3D3D3D3D3D3D3D3D0D
:1000E0003D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D40
:1000F0003D3D000A0D496E69742E20454550524F12
:100100004D3A2047656E65726174696E672044657B
:100110006661756C742D506172616D6574657220D5
:10012000616E6420537469636B2D53657474696EDA
:1001300067732E2E2E000A0D496E69742E204545D8
:1001400050524F4D3A2047656E65726174696E6713
:100150002044656661756C742D506172616D6574C3
:100160006572207573696E67206F6C6420537469C3
:10017000636B2053657474696E6773000A0D4143A5
:1001800043206E696368742061626765676C6963A8
:1001900068656E21000A0D42656E75747A6520509F
:1001A0006172616D657465727361747A2025640093
:1001B0000A0D4162676C65696368204C75667464FA
:1001C0007275636B73656E736F722E2E004F4B0AE0
:1001D0000D000A0D537465756572756E673A2000DF
:1001E00048656164696E67486F6C64004E6575743C
:1001F00072616C000A0A0D002E005B25695D005BD0
:1002000025695D002B204D696B726F4B6F707465B3
:1002100072202B0048573A5625642E2564205357E8
:100220003A25642E256425630053657474696E67EE
:100230003A202564200028632920486F6C67657286
:10024000204275737300486F6568653A202020204E
:100250002025356900536F6C6C486F6568653A20DE
:10026000253569004C756674647275636B3A202598
:100270003569004F66662020202020203A20253551
:1002800069004B65696E65200048F668656E7265A9
:1002900067656C756E6700616B742E204C616765D5
:1002A000004E69636B3A202020202020253569000C
:1002B000526F6C6C3A202020202020253569004B9D
:1002C0006F6D706173733A202020253569004B31C2
:1002D0003A25346920204B323A25346920004B33CB
:1002E0003A25346920204B343A25346920004B35B7
:1002F0003A25346920204B363A25346920004B37A3
:100300003A25346920204B383A25346920004E695B
:100310003A2534692020526F3A253469200047730A
:100320003A253469202047693A2534692000503144
:100330003A253469202050323A2534692000503360
:100340003A253469202050343A2534692000477911
:10035000726F202D2053656E736F72004E69636B50
:100360002025346920282533692900526F6C6C20C0
:1003700025346920282533692900476965722025BD
:100380003469202825336929004E69636B202534A0
:100390006920282533692900526F6C6C2025346947
:1003A0002028253369290047696572202534692092
:1003B0002825336929004E69636B2025346920287C
:1003C00025336929282533692900526F6C6C202553
:1003D000346920282533692928253369290047698C
:1003E0006572202534692028253369292825336939
:1003F0002900414343202D2053656E736F72004ED8
:1004000069636B2025346920282533692900526FE0
:100410006C6C2025346920282533692900486F63D6
:100420006820253469202825336929005370616EBE
:100430006E756E673A202025356900456D70662E11
:10044000506567656C3A253569004B6F6D70617357
:100450007320202020202020005269636874756E6C
:10046000673A2020253569004D657373776572748E
:100470003A20202535690053746172743A20202097
:10048000202025356900506F7469313A20202533CA
:100490006900506F7469323A202025336900506F2B
:1004A0007469333A202025336900506F7469343AF7
:1004B000202025336900536572766F202000536534
:1004C00074706F696E742020253369005374656CF5
:1004D0006C756E673A202533690052616E67653A24
:1004E0002533692D2533690045787465726E436F35
:1004F0006E74726F6C2020004E693A25346920209A
:10050000526F3A253469200047733A253469202018
:1005100047693A253469200048693A253469202022
:1005200043663A253469200011241FBECFEFD0E185
:10053000DEBFCDBF13E0A0E0B1E0EEEEF5E902C012
:1005400005900D92A83BB107D9F718E0A8EBB3E0EE
:1005500001C01D92A538B107E1F70C9442030C9439
:100560000000282FFB018150853008F023E0842F04
:100570009927332721503040829FD001839FB00DAF
:10058000929FB00D1124AC59BF4F019724F00E94E7
:10059000E34A0192FACF0E9457480895863010F03E
:1005A00085E002C0882329F0A2E0B0E0082E0E9476
:1005B000EB4A0895582FFB01863010F055E002C039
:1005C0008823D1F0842F9927252F332721503040BD
:1005D000829FD001839FB00D929FB00D1124AC5922
:1005E000BF4F019724F001900E94EB4AFACF852F6C
:1005F0000E94CE020E9457480895CF93A2E0B0E037
:100600000E94E34A802DC82F8150853020F0C3E03E
:100610008C2F0E94CE028C2F9927CF910895809124
:100620007C07E82FFF27EE0FFF1FE25BF84F80816A
:1006300091818D5E9F4F14F0109202018081918113
:100640008A5B9F4FBCF480910201882399F481E07A
:100650008093020180914B068F5F80934B0685301B
:1006600038F088EE93E09093D8038093D70302C0CC
:100670000E94D61F80914B0699279093190780936B
:1006800018070895CFEFD0E1DEBFCDBF14B815B87D
:1006900097EEE92E93E0F92E8EEC9FEFE80EF91E0F
:1006A000F7FEFACF88EEE82E83E0F82E189B06C0FE
:1006B000199B02C08DE007C08BE005C0199B02C0EA
:1006C00084E101C08AE08093010181E887B93E9A04
:1006D0008FEF88B98BE184B981E085B98EE38AB95F
:1006E000579A87E78BB984B7877F84BF8091600072
:1006F0008861809360001092600080ED97E0909395
:10070000D8038093D70310923804109237041092C4
:1007100053071092520710923A0410923904109223
:100720003C0410923B04809101018A3011F0843125
:1007300011F4289801C0289A0E94FC0F0E94290AEF
:100740000E94D21C0E948A110E94CE1B0E94494521
:10075000789488E690E09F938F9387E490E09F934E
:100760008F931F921F92809101016AE00E94734A49
:10077000892F99279F938F93809101010E94734A3B
:1007800099279F938F938EE990E09F938F931F9269
:100790000E948B0C8DB79EB70D960FB6F8949EBF36
:1007A0000FBE8DBF82ED90E09F938F931F920E94AA
:1007B0008B0C809101010F900F900F908C3010F4F2
:1007C000299A01C0299849E06CE777E083E00E940C
:1007D000B10221E030E0D9010E94E34A802D8F3F31
:1007E000B1F0D9010E94E34A802D893480F08091D4
:1007F0007C078A3060F480917D078A3040F48091D4
:100800007E078A3020F480917F078A3050F083EF92
:1008100090E09F938F931F920E948B0C0E94D11D9A
:100820000DC0D9010E94E34A802D893451F086E33E
:1008300091E09F938F931F920E948B0C0F900F90CB
:100840000F9001E010E0D8010E94E34A802D893426
:10085000F9F00E94EA1DC1E0C23039F0C33019F44A
:100860000E94351F04C0C43010F00E948E1E46E561
:100870006CE777E08C2F0E94DA02CF5FC63060F31E
:1008800083E00E94CE0289E4D801082E0E94EB4A40
:10089000A4E0B0E00E94E34A802D853050F08CE760
:1008A00091E09F938F931F920E948B0C0F900F905B
:1008B0000F900E94FD0246E56CE777E00E94B102CE
:1008C0000E94FD0299279F938F9385E991E09F9362
:1008D0008F931F920E948B0C809184070F900F9032
:1008E0000F900F900F9080FF20C080EB91E09F93BE
:1008F0008F931F920E948B0C88EE93E00E94F30F5F
:100900007C010E9490110F900F900F90C7010E94E0
:1009100023108823D9F38DEC91E09F938F931F923E
:100920000E948B0C0F900F900F900E94EE278091E9
:1009300001018A3011F0843111F4289801C0289AFD
:1009400080ED97E09093D8038093D70385E580935B
:100950004D0682ED91E09F938F931F920E948B0C26
:10096000809184070F900F900F9082FF03C080EE5C
:1009700091E002C08CEE91E09F938F931F920E94B2
:100980008B0C0F900F900F9084EF91E09F938F93BB
:100990001F920E948B0C0E94BF1588E893E19093F0
:1009A00095038093940381E080934C060F900F9001
:1009B0000F908091DB03882309F4A6C01092DB031B
:1009C00080914B06882319F00E940F0302C00E94F9
:1009D000A72C0E94A029209101012A3011F0243176
:1009E00011F4289801C0289A80910603882321F0E9
:1009F0008150809306030EC08093570610921B040B
:100A000010921A04109219041092180410921704EC
:100A10001092160480913D04882329F080913D04B2
:100A2000815080933D048091940390919503892B8C
:100A300001F585E090E090939503809394030E94E4
:100A4000E81B8091090390910A038F5F9F4F09F57E
:100A5000809134048823E9F080E197E29093D803F1
:100A60008093D70380E890E090930A038093090372
:100A700010C08091940390919503019790939503F2
:100A8000809394032A3011F0243111F4289801C086
:100A9000289A8091DB03882321F0809134048823F5
:100AA00011F40E94640A0E940208C7010E942310E8
:100AB000882341F180919407282F332780911A03CE
:100AC00090911B03821793079CF4809109039091E6
:100AD0000A038F5F9F4F61F480E797E19093D803FB
:100AE0008093D70380E093E090930A0380930903F7
:100AF0000E948B4784E08093D60384E190E00E94BB
:100B0000F30F7C010E9466488091D603882309F088
:100B100050CF0E94CC474DCF1F920F920FB60F922D
:100B200011248F939F93EF93FF9380910803882361
:100B3000E1F48091CC039091CD0301969093CD0385
:100B40008093CC03FC01E35FFA4FE081ED3019F0B4
:100B50008639910539F41092CD031092CC0381E0CF
:100B600080930803E093C60004C01092CD03109256
:100B7000CC03FF91EF919F918F910F900FBE0F903B
:100B80001F9018951F920F920FB60F9211242F935A
:100B90003F934F935F938F939F93AF93BF93EF9345
:100BA000FF9390E08091C6008093C4035091D203DC
:100BB000563910F09093D3038091C4038D3009F01F
:100BC00061C08091D303823009F05CC09093D3035D
:100BD000852F9927865A994FFC01329740812091A1
:100BE000CE033091CF03241B3109DC0111978C9186
:100BF000281B3109C9019F709093CF038093CE03C6
:100C000046E0969587954A95E1F7982F935C9093E7
:100C1000D0032F733070235C2093D1038081981709
:100C200029F48C91281711F491E006C090E080918E
:100C3000C1038F5F8093C1038091C303882309F0B0
:100C400070C0992309F46DC081E08093C303580FED
:100C50005093C0035150E52FFF27E65AF94F8DE01E
:100C6000808380915C06823509F05BC088E190E06A
:100C70002CE00FB6F894A895809360000FBE2093E7
:100C800060004FC02091D303822F992781309105B6
:100C9000F9F0823091051CF4892B21F040C00297B5
:100CA00011F13DC08091C403833239F48091C303B4
:100CB000882319F481E08093D3038091C403809347
:100CC0005A0681E08093D2038091C403992722C001
:100CD0002F5F2093D303E52FFF27E65AF94F80912A
:100CE000C403808309C0E52FFF27E65AF94F80919E
:100CF000C4038083563920F45F5F5093D20302C04F
:100D00001092D3032091C4038091CE039091CF031E
:100D1000820F911D9093CF038093CE0302C0109257
:100D2000D303FF91EF91BF91AF919F918F915F910D
:100D30004F913F912F910F900FBE0F901F901895DC
:100D4000AC01A0E0B0E09D01A817B90748F4EDE0C0
:100D5000F5E08191280F311D1196A417B507C8F34E
:100D60003F70FD01E35FFA4FC90156E09695879504
:100D70005A95E1F7835C80831196FD01E35FFA4F9A
:100D80002F733070822F835C8083A25FBA4F8DE017
:100D90008C931092080380910D058093C6000895EE
:100DA000BF92CF92DF92EF92FF920F931F93CF9358
:100DB000DF93CDB7DEB72C859D850E85BB2483E2FE
:100DC00080930D059F5990930E0520930F0533E0F6
:100DD000E32EF12C002309F49EC0CF84D888BE01F5
:100DE0006D5E7F4FA989BA890150109709F493C0AD
:100DF0001097B9F0F601EB0DF11DB39490811197A6
:100E000091F4002349F1FB016E5F7F4FDB01C0804D
:100E1000D1806E5F7F4F0D90BC91A02DBB240150FF
:100E200002C090E019C01097B9F0F601EB0DF11D6A
:100E3000B3944081119791F4002341F1FB016E5F5F
:100E40007F4FDB01C080D1806E5F7F4F0D90BC91E2
:100E5000A02DBB24015002C040E018C01097B1F093
:100E6000F601EB0DF11DB3941081119781F400236D
:100E700071F0FB013296DB01CD90DC90BF016E5F1B
:100E80007F4FA081B181BB24015001C010E0F70168
:100E9000E35FFA4F892F86958695835C808308945B
:100EA000E11CF11CF701E35FFA4F892F992783704A
:100EB000907024E0880F991F2A95E1F755279A0131
:100EC00094E0369527959A95E1F7822B835C808391
:100ED0000894E11CF11CF701E35FFA4F4F7050706A
:100EE000440F551F440F551F812F992726E09695D3
:100EF00087952A95E1F7842B835C80830894E11C15
:100F0000F11CF701E35FFA4F1F73135C1083089421
:100F1000E11CF11C6ACFC7010E94A006DF91CF91AE
:100F20001F910F91FF90EF90DF90CF90BF900895A9
:100F3000A3E07A2F4091C0034650442309F458C0DF
:100F4000E72FFF27E65AF94F80818D537F5FE72F08
:100F5000FF27E65AF94F20812D537F5FE72FFF27A8
:100F6000E65AF94F30813D537F5FE72FFF27E65A5E
:100F7000F94F60816D537F5F9927880F991F880F04
:100F8000991F522F52955F70582B822F99278F707F
:100F90009070F4E0880F991FFA95E1F7232F2695BA
:100FA0002695282B832F992783709070E6E0880F71
:100FB000991FEA95E1F7682B41504F3FC9F0EA2F9E
:100FC000FF27E65AF94F5083AF5F41504F3F81F002
:100FD000EA2FFF27E65AF94F2083AF5F41504F3F7A
:100FE00039F0EA2FFF27E65AF94F6083AF5FA5CFAC
:100FF0008DE596E09093BF038093BE03A350A0932A
:10100000BD030895CF93DF93CDB7DEB722970FB618
:10101000F894DEBF0FBECDBF8091C303882309F4CF
:10102000FDC10E94980780915B06823609F01AC1C3
:1010300080915C0699278137910509F44BC082376E
:1010400091053CF48B34910561F080379105F1F105
:1010500009C18337910509F491C08437910511F1D5
:1010600001C1E091BE03F091BF0380819181909313
:10107000500480934F0480914F049091500420912C
:101080004D0430914E04821B930B845E9D4F68E6A5
:1010900071E00E94934A845B904090934C0480934B
:1010A0004B04E0C0E091BE03F091BF0380819181C9
:1010B000A281B3818093B8039093B903A093BA033C
:1010C000B093BB038FEF80930603CCC081E0809385
:1010D000C603C8C0E091BE03F091BF0380818F3F7B
:1010E00039F40E94FD02E091BE03F091BF038083BA
:1010F000E091BE03F091BF038081882311F481E069
:1011000003C0863010F085E08083E091BE03F0914B
:10111000BF0346E56CE777E080810E94B1028091D1
:1011200008038823E1F3E091BE03F091BF038081BF
:101130008A8389E4898386E590E09F938F938CE787
:1011400097E09F938F9321E030E03F932F93CE0160
:10115000820F931F9F938F933F932F93CE010296FD
:101160009F938F9383E08F9381E08F9381E58F939B
:101170000E94D0068DB79EB70F966FC0E091BE0358
:10118000F091BF0380818150853008F04FC081818C
:10119000893409F04BC02CE737E0AF014E5F5F4F59
:1011A00086E5DA010D90AD01D9010D929D018150C6
:1011B000C1F746E56CE777E080810E94DA02809112
:1011C000A7079927AA27BB27BC01CD0124EC39E04A
:1011D00040E050E00E94544ADC01CB0180938E0332
:1011E00090938F03A0939003B09391038091A807ED
:1011F0009927AA27BB27BC01CD010E94544ADC01D4
:10120000CB0180938A0390938B03A0938C03B093BC
:101210008D03E091BE03F091BF0380810E94CE0256
:101220000E94FD028A830E94D61F01C01A8280910B
:1012300008038823E1F381E090E09F938F93CE0130
:1012400002969F938F9381E08F938F9383E58F9383
:101250000E94D0068DB79EB707960FB6F8949EBF32
:101260000FBE8DBF80915C0699278736910509F4E2
:10127000CAC088369105ACF48136910509F469C07D
:10128000823691052CF48B34910509F441C0BEC01F
:101290008236910509F46AC08436910509F479C053
:1012A000B5C08C36910509F49CC08D3691052CF49F
:1012B0008836910509F480C0A9C08437910529F0CA
:1012C0008637910509F49BC0A1C0E091BE03F0915F
:1012D000BF0380819181A281B3818093B8039093F1
:1012E000B903A093BA03B093BB038091080388238A
:1012F000E1F31F92809105038F9384E58F930E9401
:10130000D0068FEF809306030F900F900F907EC052
:10131000E091BE03F091BF038081918190935004CE
:1013200080934F0480914F049091500420914D047C
:1013300030914E04821B930B845E9D4F68E671E0F2
:101340000E94934A845B904090934C0480934B049A
:101350005DC0E091BE03F091BF03808180930703DD
:10136000803298F08FE1809307030FC0ADE4B6E0C0
:10137000E091BE03F091BF038BE001900D9281508C
:10138000E1F780915606809332078FEF8093060332
:101390003DC0E091BE03F091BF0390818AE0989F29
:1013A000C00111249093040380930303892B71F1EE
:1013B00081E08093C8032AC08FEF80930603E091F9
:1013C000BE03F091BF03809103049081892B809329
:1013D0000304882311F01092C50381E08093C903B0
:1013E00015C08FEF80930603E091BE03F091BF0319
:1013F00080818093040481E08093CA0307C081E068
:101400008093C70303C081E08093CB031092C30392
:101410001092BF031092BE031092BD0322960FB626
:10142000F894DEBF0FBECDBFDF91CF910895CF936B
:10143000C82F8A3019F48DE00E94170A8091C000ED
:1014400085FFFCCFC093C60080E090E0CF91089567
:10145000089588E18093C1008091C00082608093EC
:10146000C0008091C10080688093C1008091C1005C
:1014700080648093C1008AE28093C400809103035A
:10148000909104030E94F30F90933A0680933906DB
:101490008CED90E00E94F30F9093590680935806CC
:1014A00010923B0687E480933C0687E080933F06DA
:1014B0008AE080933D0610923E061092BF03109280
:1014C000BE031092BD03089580910803882309F498
:1014D000C7C18091C9038823C1F180910803882383
:1014E000A1F10E94C81584E190E09F938F939091A1
:1014F000C50384E1989FC0011124835E9C4F9F9394
:101500008F9381E090E09F938F9385EC93E09F937E
:101510008F9382E08F9381E08F9388E48F930E9472
:10152000D0068091C5038F5F8093C5032DB73EB76A
:10153000255F3F4F0FB6F8943EBF0FBE2DBF8430DE
:1015400010F01092C5031092C9038091CA0388233A
:1015500071F180910803882351F10E94C81580E53C
:1015600090E09F938F938DE193E09F938F9321E081
:1015700030E03F932F938CE193E09F938F933F93C1
:101580002F9384E094E09F938F9383E08F9381E087
:101590008F938CE48F930E94D0061092CA038DB76C
:1015A0009EB70F960FB6F8949EBF0FBE8DBF809169
:1015B000C7038823F1F0809108038823D1F08AE0E3
:1015C00090E09F938F938BE396E09F938F9381E0BE
:1015D0008F938F9386E58F930E94D0061092C70356
:1015E0002DB73EB7295F3F4F0FB6F8943EBF0FBEF1
:1015F0002DBF8091CB038823F9F0809108038823C5
:10160000D9F08BE090E09F938F938DE496E09F93C9
:101610008F9381E08F93809105038F9387E48F935D
:101620000E94D0061092CB038DB79EB707960FB6D7
:10163000F8949EBF0FBE8DBF8091580690915906B9
:101640000E942310882309F45DC080910803882339
:1016500009F458C08091890490918A04A0918B0468
:10166000B0918C04BC01CD012CE630E040E050E0AC
:101670000E94C84A30934606209345068091810413
:1016800090918204A0918304B0918404BC01CD01A7
:101690002CE630E040E050E00E94C84A3093480613
:1016A0002093470680912504809349068091240465
:1016B00080934A0688E090E09F938F9385E496E0BC
:1016C0009F938F9381E08F9383E08F9387E78F932E
:1016D0000E94D00680914B062DB73EB7295F3F4F41
:1016E0000FB6F8943EBF0FBE2DBF853018F086E0D0
:1016F00080934B0683E690E00E94F30F9093590687
:10170000809358068091030390910403892B41F044
:101710008091390690913A060E942310882321F483
:101720008091C803882349F180910803882329F117
:1017300082E490E09F938F9380EF96E09F938F9346
:1017400081E08F938F9384E48F930E94D006109250
:10175000C8038DB79EB707960FB6F8949EBF0FBE0D
:101760008DBF8091030390910403009731F00E9494
:10177000F30F90933A0680933906809107038F3FC9
:1017800061F180E190E09F938F9380910703992707
:1017900024E0880F991F2A95E1F78D5F9E4F9F9354
:1017A0008F9381E090E09F938F9387E093E09F93E6
:1017B0008F9382E08F9381E08F9381E48F930E94D7
:1017C000D0068FEF809307032DB73EB7255F3F4FBD
:1017D0000FB6F8943EBF0FBE2DBF8091320788230D
:1017E000E9F0809108038823C9F081E090E09F939D
:1017F0008F9382E397E09F938F9381E08F938F93F2
:1018000082E48F930E94D006109232078DB79EB764
:1018100007960FB6F8949EBF0FBE8DBF8091C6038A
:101820008823F1F0809108038823D1F086E190E0CD
:101830009F938F938EE497E09F938F9381E08F9394
:101840008F9380E58F930E94D0061092C6032DB728
:101850003EB7295F3F4F0FB6F8943EBF0FBE2DBF76
:101860000895982F80913307813069F480910504A1
:10187000E82FFF27E35EFC4F90838F5F8093050482
:1018800021E030E005C0892F0E94170A282F332756
:10189000C90108950F931F93CF93DF938C01EB0140
:1018A000672B39F0F80181918F010E94310C21974B
:1018B000C9F7DF91CF911F910F9108950F931F9357
:1018C000CF93DF938C01EB01672B41F0F8010F5FA1
:1018D0001F4F84910E94310C2197C1F7DF91CF9166
:1018E0001F910F910895CF93C82F181634F480E2FA
:1018F0000E94310CC1501C16D4F3CF910895CF93A0
:10190000C82F181634F480E30E94310CC1501C1605
:10191000D4F3CF9108952F923F924F925F926F929E
:101920007F928F929F92AF92BF92CF92DF92EF926F
:10193000FF920F931F93CF93DF93CDB7DEB7E0975E
:101940000FB6F894DEBF0FBECDBF26968FAD26979B
:101950002896EEADFFAD28971CA61DA61EA61FA6B5
:1019600080933307A8E46A2E712C6C0E7D1E5F01F4
:10197000C50105C0053239F00894A11CB11CF50160
:1019800004910023B9F7B501681B790B11F00E948F
:101990005E0C002309F430C20894A11CB11C55242C
:1019A00058AA252C1FEF59A6F5010894A11CB11CBB
:1019B0000491053721F0802F80628837F1F450FEC2
:1019C0000EC0F30124E030E0620E731E808191812D
:1019D000A281B3818CA79DA7AEA7BFA70EC0F301BC
:1019E000A2E0B0E06A0E7B1E808191819C014427B9
:1019F00055272CA73DA74EA75FA7003221F489A544
:101A0000882391F61BC0033211F438E081C00A32FA
:101A100011F00D3289F40A3251F4F30142E050E042
:101A2000640E751E208022200CF0BECF219450E160
:101A3000552A8FED5822B8CF0B3211F409A7B4CF35
:101A40000E32C1F5F5010894A11CB11C04910A32B3
:101A500079F4F301A2E0B0E06A0E7B1E608171812F
:101A6000BFEF6F3F7B0714F46FEF7FEF162F9CCF14
:101A700060E070E0802F80538A30A0F4CB01F3E067
:101A8000880F991FFA95E1F7860F971F680F791F46
:101A9000600F711D60537040F5010894A11CB11CCA
:101AA0000491E8CFEFEF6F3F7E0714F46FEF7FEF05
:101AB000162F7FCF003329F454FC76CFF0E25F2A53
:101AC00073CF802F81538930D8F460E070E0CB0170
:101AD000E3E0880F991FEA95E1F7860F971F680FDB
:101AE000791F600F711D60537040F5010894A11CAF
:101AF000B11C0491802F80538A3048F3262E59CF91
:101B0000083619F424E0522A4FCF0C3619F431E08C
:101B1000532A4ACF033661F44E010894811C911C6C
:101B2000F30142E050E0640E751E808189831BC181
:101B3000043421F0043611F00936B1F5043411F4FF
:101B400051E0552A50FE0AC0F30184E090E0680E8F
:101B5000791E20813181428153810CC0F30142E022
:101B600050E0640E751E808191819C01442737FDF1
:101B70004095542F2CA73DA74EA75FA78CA59DA5E8
:101B8000AEA5BFA5B7FF0DC0B095A0959095819566
:101B90009F4FAF4FBF4F8CA79DA7AEA7BFA78DE2AA
:101BA00089A77AE0472E7BC00F3411F00F3639F445
:101BB0000F3411F491E0592A68E0462E6FC00037C7
:101BC000A1F4F301A2E0B0E06A0E7B1E8081918156
:101BD0009C01442755272CA73DA74EA75FA750E19E
:101BE000452E30E4532A08E759C00337C1F5F30105
:101BF00042E050E0640E751E808091808114910453
:101C000089F44E010894811C911C88E289838EE638
:101C1000F401818385E78B838CE68C838D8389E255
:101C20008E831F8217FD13C0812F992787FD909502
:101C3000AC0160E070E0C4010E94DF48009729F029
:101C4000D82ED8181D150CF090C0D12E8EC0F401DE
:101C500001900020E9F73197DE2ED81886C00535AF
:101C600011F0053739F4053511F4F1E05F2A4AE047
:101C7000442E14C0083519F0083709F06CC030E163
:101C8000432E53FE0BC02CA53DA54EA55FA52115E7
:101C900031054105510511F030E4532A19A618AB5E
:101CA00017FD02C04FED542229E2822E912C8C0E9A
:101CB0009D1E8CA59DA5AEA5BFA50097A105B1054C
:101CC00021F498A9992309F43FC0C42CDD24EE2403
:101CD000FF2433242CA53DA54EA55FA52C153D055D
:101CE0004E055F0510F091E0392E6CA57DA58EA5FF
:101CF0009FA5A70196010E94A64ADC01CB01182FDF
:101D00008A3010F4105D04C0195A083509F41F7D9B
:101D1000D4011E934D016CA57DA58EA59FA5A7019D
:101D200096010E94A64A2CA73DA74EA75FA7332085
:101D300081F6B8E04B1641F453FE06C0103321F093
:101D400080E3F40182934F01CE010196D82ED8187A
:101D5000F8E2DF0E0BC0002309F44EC04E010894D8
:101D6000811C911C098381E0D82E19A61D2DC8A8BD
:101D7000CD18C7FCCC2489A5882311F01F5F02C0B1
:101D800056FC1E5F1C0DE52CFF24C701807390706C
:101D9000892B21F4822D811B0E94730C89A5882335
:101DA00029F061E070E0CE01899609C0E6FE09C025
:101DB00080E38AA70BA762E070E0CE018A960E94BA
:101DC0004A0CC70180739070809721F4822D811B8B
:101DD0000E947F0C8C2D0E947F0C8D2D992787FDF2
:101DE0009095BC01C4010E944A0CE4FEC1CD822D35
:101DF000811B0E94730CBCCDE0960FB6F894DEBF39
:101E00000FBECDBFDF91CF911F910F91FF90EF904B
:101E1000DF90CF90BF90AF909F908F907F906F900A
:101E20005F904F903F902F9008951F920F920FB6A2
:101E30000F9211242F933F935F936F937F938F9310
:101E40009F93AF93BF93EF93FF938091D603882323
:101E500029F08091D60381508093D6038091DE03D0
:101E600081508093DE038F3FB9F489E08093DE03D5
:101E700080910D038F5F817080930D03882319F487
:101E800081E08093DB038091DC039091DD03019678
:101E90009093DD038093DC038091D7039091D80366
:101EA0000297C8F08091D7039091D803019790933F
:101EB000D8038093D7038091D7039091D8032091C2
:101EC000090330910A0382239323892B11F021E027
:101ED00009C020E007C020E08FEF9FEF90930A0336
:101EE0008093090380910101222331F08A3011F49B
:101EF0005A9A07C0479A05C08A3011F45A9801C00F
:101F000047988091840783FF5EC086B19927FC01C2
:101F1000E071F07084FF0AC08091D9039091DA03D8
:101F200001969093DA038093D9034DC08091D90331
:101F30009091DA03892B69F18091D9039091DA03AA
:101F40008A56914030F58091D9039091DA0369E285
:101F500070E00E947F4A8091D9039091DA03860F46
:101F6000971F9093DA038093D9038091D9039091BE
:101F7000DA030B9750F08091D9039091DA030A9716
:101F80009093500480934F0404C0F0935004E09366
:101F90004F0480914F049091500420914D04309152
:101FA0004E04821B930B845E9D4F68E671E00E9495
:101FB000934A845B904090934C0480934B0410921E
:101FC000DA031092D903FF91EF91BF91AF919F91E6
:101FD0008F917F916F915F913F912F910F900FBEE5
:101FE0000F901F9018952091DC033091DD03280F8E
:101FF000391FC901019608958AE090E00E94F30F0D
:102000009093E0038093DF0382E085BD83EA84BD83
:1020100017BC88E788BD86E086BD83EC8093B0005E
:1020200084E08093B10080917000826080937000A2
:1020300080916E00816080936E008AE08093B3008F
:102040001092B20008952091DC033091DD03821BD1
:10205000930B892F99278695807490700895CF935C
:10206000DF930E94F30FEC01CE010E94231088231E
:10207000D9F3DF91CF910895CF93DF930E94F30FAF
:10208000EC0103C08FEE80937A00CE010E942310F2
:102090008823C1F3DF91CF9108951F920F920FB65D
:1020A0000F9211248F939F9380910B0390910C03B7
:1020B000892B11F05F9A01C05F9883E08093B00094
:1020C000809170008E7F809370009F918F910F9010
:1020D0000FBE0F901F9018951F920F920FB60F9280
:1020E00011242F933F934F935F936F937F938F931D
:1020F0009F93AF93BF93CF93DF93EF93FF93809121
:102100000B0390910C03049709F0A6C080E390E0C4
:102110009093D5038093D40380910F039091100383
:102120009C01220F331F280F391F80917C039927B0
:10213000880F991F280F391F37FF02C02D5F3F4FAF
:10214000C9019595879595958795909310038093F0
:102150000F03EC01E096D093D503C093D403809194
:10216000C20790919E072091890430918A04409182
:102170008B0450918C0480FF18C0892F9927AA27BF
:10218000BB27BC01CD010E94544A97FF04C0615097
:10219000704C8F4F9F4F5EE095958795779567952B
:1021A0005A95D1F7C60FD71F17C0892F9927AA278D
:1021B000BB27BC01CD010E94544A97FF04C0615067
:1021C000704C8F4F9F4F4EE095958795779567950B
:1021D0004A95D1F7C61BD70BD093D503C093D40330
:1021E00080919F0743E0849FC00111242091D40374
:1021F0003091D5032817390740F08091A007849FBC
:10220000C00111248217930720F49093D503809383
:10221000D4032091D4033091D50330931B0720932E
:102220001A07C9016FEF70E00E947F4A8D9740F452
:10223000235B3F4F3093D5032093D40383E101C048
:1022400080E680930E038091D4039091D50380950E
:102250008093B30083EC40C080910B0390910C03FA
:10226000892B39F180910B0390910C03049708F5A9
:102270002091D4033091D5032F3F310561F058F000
:102280005F9A83E08093B0002F5F30403093D50396
:102290002093D40323C083E88093B00080910E0381
:1022A0008093B30081E090E090930C0380930B0344
:1022B00015C080910B0390910C03892B79F48091C8
:1022C000A1079927880F991F880F991F90930C03D6
:1022D00080930B035F9883E08093B00080910B03A1
:1022E00090910C03019790930C0380930B03FF9143
:1022F000EF91DF91CF91BF91AF919F918F917F919E
:102300006F915F914F913F912F910F900FBE0F9062
:102310001F90189510927C008FEE80937A0008959C
:102320000F931F93CF93DF9303E010E0D8010E9437
:10233000E34A802DC82FDD27C531D10508F02A9743
:10234000C7BD1092E80384E690E00E943C108091A3
:102350001403909115038255934010F4C0E0D0E02F
:10236000CA3FD105C0F4C7BD82E390E00E943C1093
:1023700088EF91E09F938F931F920E948B0C809126
:102380001403909115030F900F900F908255934076
:1023900010F02196E5CFD8010C2E0E94EB4AC09395
:1023A00041078CE291E00E943C10DF91CF911F9198
:1023B0000F9108951F93CF93C0E0C093E303C093A0
:1023C000E203C093E1031CE8C33019F41B3008F0AA
:1023D00019E0C0E08091F9039091FA038C5F93407B
:1023E00024F48091130381500AC08091F9039091E5
:1023F000FA038750944034F0809113038F5F8093E9
:10240000130301C0C1E08091F7039091F8038C5F42
:10241000934024F48091120381500AC08091F70305
:102420009091F8038750944034F0809112038F5FAD
:102430008093120301C0CF5F8091F5039091F60362
:102440008C5F934024F48091110381500AC08091E5
:10245000F5039091F6038750944034F08091110376
:102460008F5F8093110301C0CF5F88E080930A04DF
:102470000E94D41B809113038A3030F481E0809352
:10248000E3038AE08093130380911303863F30F0C7
:1024900081E08093E30385EF80931303809112031F
:1024A0008A3030F481E08093E2038AE08093120363
:1024B00080911203863F30F081E08093E20385EF44
:1024C00080931203809111038A3030F481E080936D
:1024D000E1038AE08093110380911103863F30F07D
:1024E00081E08093E10385EF8093110380910A04DA
:1024F0008823E1F780933C078FEE80937A008091E8
:102500003C078823E1F31A3020F48AE090E00E942F
:102510003C10115009F058CF86E490E00E943C1026
:10252000CF911F9108951F920F920FB60F92112411
:10253000EF92FF920F931F932F933F934F935F93CD
:102540006F937F938F939F93AF93BF93CF93DF93BB
:10255000EF93FF9310927A008091FC03682F772706
:102560008F5F8093FC036530710509F48EC066307F
:102570007105BCF46230710509F44AC0633071051D
:102580003CF46115710531F161307105C1F1D1C2C1
:102590006330710509F446C06430710509F45DC00B
:1025A000C8C26830710509F4D4C0693071054CF4B3
:1025B0006630710509F482C06730710509F4ACC05A
:1025C000B8C26930710509F4E1C06A30710509F4D7
:1025D000FCC1AFC280917800909179009093FE0386
:1025E0008093FD0381E08093FB038091E40390914D
:1025F000E50301969093E5038093E4039EC28091E6
:10260000780090917900909300048093FF039FC01D
:102610008091780090917900909302048093010456
:1026200084E0D0C180911A0390911B039C01220F7A
:10263000331F280F391F80917800909179000E94F4
:102640007F4A260F371F3695279536952795309365
:102650001B0320931A0386E0B5C1809195049091E5
:1026600096042091780030917900821B930B90930F
:102670003507809334078091340790913507909304
:10268000F4038093F30387E09DC1809178009091DB
:1026900079002091970430919804821B930B9093BA
:1026A000400780933F0780913F07909140079093A8
:1026B000F2038093F1031092FB033FC2809101016A
:1026C0008A3069F480917800909179002091FD031F
:1026D0003091FE03820F931F9695879517C0409106
:1026E000FD035091FE03843159F42091780030911C
:1026F0007900240F351F8FEF93E0821B930B06C0E8
:102700008091780090917900840F951F9093F60343
:102710008093F50381E056C1809101012091FF0370
:10272000309100048A3049F48091780090917900CA
:10273000820F931F9695879506C08091780090919F
:102740007900820F931F9093F8038093F70382E040
:1027500039C18091010120910104309102048A3035
:1027600049F48091780090917900820F931F96959B
:10277000879506C08091780090917900820F931F11
:102780009093FA038093F90385E01CC1809178004F
:1027900090917900AA2797FDA095BA2FBC01CD0191
:1027A0000E9492497B018C0180918F04909190044A
:1027B000A0919104B09192049C01AD01C801B701B0
:1027C0000E94EC48DC01CB01BC01CD010E9475499F
:1027D000DC01CB019093F0038093EF038091EF0332
:1027E0009091F00302970CF446C080918F04909171
:1027F0009004A0919104B091920420E030E84BE362
:1028000054E4BC01CD010E949C4988230CF088C08F
:1028100080918F0490919004A0919104B0919204C2
:102820002AE037ED43EA5CE3BC01CD010E94ED48AC
:10283000DC01CB0180938F0490939004A0939104CA
:10284000B09392048091100490911104845F9140A0
:1028500008F066C080918F0490919004A09191043B
:10286000B09192042DEC3CEC4CEC5DE3BC01CD014D
:102870000E94ED484BC08091EF039091F0038F5F71
:102880009F4F0CF04DC080918F0490919004A091C7
:102890009104B091920420E030E849E054E4BC0196
:1028A000CD010E949F491816DCF580918F0490910C
:1028B0009004A0919104B09192042AE037ED43EA8C
:1028C0005CE3BC01CD010E94EC48DC01CB018093AC
:1028D0008F0490939004A0939104B09392048091FC
:1028E000100490911104845F9140D0F480918F0482
:1028F00090919004A0919104B09192042DEC3CEC45
:102900004CEC5DE3BC01CD010E94EC48DC01CB0145
:1029100080938F0490939004A0939104B0939204B9
:1029200081E08093E9038091780090917900909301
:102930003707809336078091EF039091F0039C0155
:10294000442737FD4095542F8091510490915204B3
:10295000A0915304B0915404820F931FA41FB51F7C
:102960008093510490935204A0935304B093540461
:1029700020915104309152044091530450915404D9
:1029800057FF04C021503C4F4F4F5F4FAAE0559571
:10299000479537952795AA95D1F780915104909145
:1029A0005204A0915304B0915404821B930BA40BC6
:1029B000B50B8093510490935204A0935304B093A9
:1029C000540483E08093FB03B8C080914407909146
:1029D00045072091780030917900820F931F9093E2
:1029E00045078093440780913C078F5F80933C07A5
:1029F00080913C07853008F49CC0809178009091CC
:102A00007900909315038093140310923C078091F2
:102A1000E6039091E703BC01F3E0660F771FFA9598
:102A2000E1F7681B790B80918503482F552780912A
:102A3000E803282F332727FD30958FEF90E0289F5C
:102A40008001299F100D389F100D112480913807A7
:102A500090913907800F911F2091440730914507CD
:102A6000821B930B2091320430913304821B930B11
:102A7000489F9001499F300D589F300D1124620FDF
:102A8000731F77FF02C0695F7F4FE3E0759567951D
:102A9000EA95E1F77093E7036093E60380914407BA
:102AA00090914507EC01EE27D7FDE095FE2F209190
:102AB0001603309117034091180350911903DA015E
:102AC000C901880F991FAA1FBB1F820F931FA41F44
:102AD000B51FC80FD91FEA1FFB1FF7FF03C02396BE
:102AE000E11DF11D82E0F595E795D795C7958A958B
:102AF000D1F7C0931603D0931703E0931803F09314
:102B000019038091380790913907800F911F209108
:102B10001603309117034091180350911903821B3B
:102B2000930B9093330480933204109245071092D4
:102B300044071092FB031092FC038091FB038093E7
:102B40007C008091FC03882319F08FEE80937A003B
:102B5000FF91EF91DF91CF91BF91AF919F918F91B5
:102B60007F916F915F914F913F912F911F910F91A5
:102B7000FF90EF900F900FBE0F901F90189590E26E
:102B8000EDE1F3E08FE49193815087FFFCCF08954E
:102B90001F93CF93DF938091040490911C039817A7
:102BA00010F4909304042091030420FF0AC0809144
:102BB0000404882321F081508093040402C0909380
:102BC000040421FF0AC080910404891719F41092AB
:102BD000040403C08F5F80930404822F992780FF31
:102BE00004C081FF02C0109204040E94BF158091AE
:102BF0000404282F33278A3040F481E180930504B0
:102C00003F932F938AEF91E007C080E18093050402
:102C10003F932F938FEF91E09F938F9381E08F935A
:102C20000E948B0C0F900F900F900F900F9080913F
:102C30000404C82FDD27C530D10509F46AC2C630A7
:102C4000D105ACF4C230D10509F4E9C0C330D105D7
:102C500034F4209739F1219709F477C094C5C33033
:102C6000D10509F44EC1249709F4B7C18CC5C83009
:102C7000D10509F440C4C930D10544F4C630D105AA
:102C800009F4B3C3279709F415C47DC5CA30D1052B
:102C900009F4C9C4CA30D1050CF470C42B9709F4E7
:102CA00008C571C51092050484E092E09F938F934C
:102CB00011E01F930E948B0C84E1809305040F9018
:102CC0000F900F9088E690E09F938F9387E490E0B9
:102CD0009F938F93DF93CF93809101016AE00E94CD
:102CE000734A892F99279F938F93809101010E94A6
:102CF000734A99279F938F9384E192E09F938F93D8
:102D00001F930E948B0C88E2809305048DB79EB7B9
:102D10000D960FB6F8949EBF0FBE8DBF0E94FD02A8
:102D200099279F938F9389E292E09F938F931F93AC
:102D30000E948B0C8CE3809305040F900F900F90F2
:102D40000F900F9086E392E061C08091840780FF2E
:102D50004AC01092050480913204909133049F93ED
:102D60008F9386E492E09F938F9311E01F930E94CC
:102D70008B0C84E1809305040F900F900F900F90BF
:102D80000F9080913004909131049F938F9385E54B
:102D900092E09F938F931F930E948B0C88E2809305
:102DA00005040F900F900F900F900F9080911403D7
:102DB000909115039F938F9384E692E09F938F9356
:102DC0001F930E948B0C8CE3809305040F900F904F
:102DD0000F900F900F908091410799279F938F93A9
:102DE00083E792E015C484E18093050482E892E0D1
:102DF0009F938F9311E01F930E948B0C88E2809326
:102E000005040F900F900F9089E892E09F938F93A5
:102E10001F930E948B0C0F900F900F90B9C41092CB
:102E2000050487E992E09F938F93C1E0CF930E94BE
:102E30008B0C84E1809305040F900F900F9080918C
:102E4000890490918A04A0918B04B0918C04B7FFFF
:102E500004C081509C4FAF4FBF4FFAE0B595A79586
:102E600097958795FA95D1F7BF93AF939F938F93DB
:102E700081EA92E09F938F93CF930E948B0C88E21C
:102E8000809305048DB79EB707960FB6F8949EBF42
:102E90000FBE8DBF8091810490918204A091830424
:102EA000B0918404B7FF04C081509C4FAF4FBF4F17
:102EB000EAE0B595A79597958795EA95D1F7BF93E1
:102EC000AF939F938F9380EB92E09F938F93CF93D9
:102ED0000E948B0C8CE3809305048DB79EB70796F8
:102EE0000FB6F8949EBF0FBE8DBF80914F04909196
:102EF00050049F938F938FEB92E09F938F93CF9388
:102F00008AC31092050480915207909153079F93B2
:102F10008F9380915007909151079F938F938EECE0
:102F200092E09F938F9311E01F930E948B0C84E19A
:102F3000809305048DB79EB707960FB6F8949EBF91
:102F40000FBE8DBF80915607909157079F938F9327
:102F500080915407909155079F938F938EED92E047
:102F60009F938F931F930E948B0C88E2809305049C
:102F70008DB79EB707960FB6F8949EBF0FBE8DBF54
:102F800080915A0790915B079F938F938091580788
:102F9000909159079F938F938EEE92E09F938F931A
:102FA0001F930E948B0C8CE3809305048DB79EB712
:102FB00007960FB6F8949EBF0FBE8DBF80915E0737
:102FC00090915F079F938F9380915C0790915D072D
:102FD0009F938F938EEF92E0C8C310920504809167
:102FE0007D07E82FFF27EE0FFF1FE25BF84F808180
:102FF00091819F938F9380917C07E82FFF27EE0F9D
:10300000FF1FE25BF84F808191819F938F938EE049
:1030100093E09F938F9311E01F930E948B0C84E1A8
:10302000809305048DB79EB707960FB6F8949EBFA0
:103030000FBE8DBF80917F07E82FFF27EE0FFF1F88
:10304000E25BF84F808191819F938F9380917E07FF
:10305000E82FFF27EE0FFF1FE25BF84F8081918181
:103060009F938F938EE193E09F938F931F930E9482
:103070008B0C88E2809305048DB79EB707960FB638
:10308000F8949EBF0FBE8DBF80918107E82FFF2768
:10309000EE0FFF1FE25BF84F808191819F938F932A
:1030A00080918007E82FFF27EE0FFF1FE25BF84FAC
:1030B000808191819F938F938EE293E09F938F9372
:1030C0001F930E948B0C8CE3809305048DB79EB7F1
:1030D00007960FB6F8949EBF0FBE8DBF80918307F1
:1030E000E82FFF27EE0FFF1FE25BF84F80819181F1
:1030F0009F938F9380918207E82FFF27EE0FFF1F8A
:10310000E25BF84F808191819F938F938EE393E0F0
:103110002CC3109205048EE493E09F938F93C1E03B
:10312000CF930E948B0C809101010F900F900F9014
:103130008A3009F060C084E1809305048091A10485
:103140009091A2049F938F938091F9039091FA0339
:103150002091A1043091A204821B930B9F938F9323
:103160008CE593E09F938F93CF930E948B0C88E222
:10317000809305048DB79EB707960FB6F8949EBF4F
:103180000FBE8DBF80919F049091A0049F938F9359
:103190008091F7039091F80320919F043091A0044F
:1031A000821B930B9F938F938BE693E09F938F9358
:1031B000CF930E948B0C8CE3809305048DB79EB750
:1031C00007960FB6F8949EBF0FBE8DBF80919D04E9
:1031D00090919E049F938F9380919D0490919E0463
:1031E0002091F5033091F603821B930B9F938F93ED
:1031F0008AE793E070C08B3019F0843109F06FC01A
:1032000084E1809305048091A1049091A20497FD2C
:103210000196959587959F938F938091F90390914F
:10322000FA032091A1043091A204821B930B9F9377
:103230008F9389E893E09F938F93CF930E948B0C99
:1032400088E2809305048DB79EB707960FB6F89471
:103250009EBF0FBE8DBF80919F049091A00497FDEB
:103260000196959587959F938F938091F703909101
:10327000F80320919F043091A004821B930B9F932D
:103280008F9388E993E09F938F93CF930E948B0C49
:103290008CE3809305048DB79EB707960FB6F8941C
:1032A0009EBF0FBE8DBF80919D0490919E0497FD9F
:1032B0000196959587959F938F9380919D0490910A
:1032C0009E042091F5033091F603821B930B9F938C
:1032D0008F9387EA93E09F938F93CF9349C28D306A
:1032E00009F056C284E18093050480911303992765
:1032F0009F938F938091A1049091A20497FD0196D2
:10330000959587959F938F938091F9039091FA03F8
:103310002091A1043091A204821B930B9F938F9361
:1033200086EB93E09F938F93CF930E948B0C88E260
:10333000809305048DB79EB709960FB6F8949EBF8B
:103340000FBE8DBF8091120399279F938F93809119
:103350009F049091A00497FD0196959587959F9362
:103360008F938091F7039091F80320919F043091FF
:10337000A004821B930B9F938F938AEC93E09F93FF
:103380008F93CF930E948B0C8CE3809305048DB7B1
:103390009EB709960FB6F8949EBF0FBE8DBF809161
:1033A000110399279F938F9380919D0490919E0480
:1033B00097FD0196959587959F938F9380919D0496
:1033C00090919E042091F5033091F603821B930B9C
:1033D0009F938F938EED93E09F938F93CF930E9453
:1033E0008B0C8DB79EB70996C8C11092050482EF69
:1033F00093E09F938F9311E01F930E948B0C84E1C5
:10340000809305040F900F900F90809197049091F6
:1034100098049F938F938091F1039091F2039F936F
:103420008F938FEF93E09F938F931F930E948B0C4A
:1034300088E2809305048DB79EB707960FB6F8947F
:103440009EBF0FBE8DBF80919504909196049F936F
:103450008F938091F3039091F4039F938F938EE069
:1034600094E09F938F931F930E948B0C8CE3809327
:1034700005048DB79EB707960FB6F8949EBF0FBE92
:103480008DBF80918F0490919004A0919104B09190
:103490009204BC01CD010E947549DC01CB019F93D0
:1034A0008F938091EA079091EB079F938F938DE123
:1034B00094E05BC184E18093050480911A039091AC
:1034C0001B039F938F938CE294E09F938F9311E063
:1034D0001F930E948B0C88E2809305040F900F903D
:1034E0000F900F900F9080913D0499279F938F9399
:1034F0008BE394E08DC0109205048AE494E09F93DE
:103500008F9311E01F930E948B0C84E1809305043C
:103510000F900F900F9080914B0490914C049F93CB
:103520008F9389E594E09F938F931F930E948B0C58
:1035300088E2809305040F900F900F900F900F90EA
:1035400080914F04909150049F938F9388E694E06C
:103550009F938F931F930E948B0C8CE380930504A1
:103560000F900F900F900F900F9080914D049091BD
:103570004E049F938F9387E794E04AC0109205040E
:1035800080914404909145049F938F9386E894E042
:103590009F938F9311E01F930E948B0C84E1809383
:1035A00005040F900F900F900F900F9080914204A0
:1035B000909143049F938F9382E994E09F938F931C
:1035C0001F930E948B0C88E2809305040F900F904C
:1035D0000F900F900F9080914004909141049F9321
:1035E0008F938EE994E09F938F931F930E948B0C8F
:1035F0008CE3809305040F900F900F900F900F9025
:1036000080913E0490913F049F938F938AEA94E0C7
:103610009F938F931F930E948B0C0F900F900F908E
:103620000F900F90B5C01092050486EB94E09F9325
:103630008F9311E01F930E948B0C84E1809305040B
:103640000F900F900F9080917C0399279F938F93F9
:103650008EEB94E09F938F931F930E948B0C88E2D4
:10366000809305040F900F900F900F900F90809112
:10367000D4039091D5039F938F938CEC94E09F9308
:103680008F931F930E948B0C8CE3809305040F9003
:103690000F900F900F900F908091A00799279F9304
:1036A0008F9380919F0799279F938F938AED94E042
:1036B0005CC01092050488EE94E09F938F9311E014
:1036C0001F930E948B0C84E1809305040F900F9050
:1036D0000F9080915106992787FD90959F938F9326
:1036E00080915006992787FD90959F938F9388EF3F
:1036F00094E09F938F931F930E948B0C88E280939A
:1037000005048DB79EB707960FB6F8949EBF0FBEFF
:103710008DBF80915206992787FD90959F938F9337
:103720008091530699279F938F9388E095E09F930C
:103730008F931F930E948B0C8CE3809305048DB7AD
:103740009EB707960FB6F8949EBF0FBE8DBF8091AF
:10375000570699279F938F9380915406992787FD49
:1037600090959F938F9388E195E09F938F931F93FC
:103770000E948B0C8DB79EB707960FB6F8949EBF2C
:103780000FBE8DBF05C0815080931C0310920404AE
:1037900010920304DF91CF911F9108951092B90008
:1037A0008AE28093B800089585EA8093BC0080E0A7
:1037B00090E0089584E98093BC0008951092B900C8
:1037C0008093BB0085E88093BC0080E090E0089582
:1037D0000E94DA1B10920A048091BB001092090427
:1037E00080E88093BC001092BD001092BA00109245
:1037F000BB001092B9001092B8000E94CE1B0E942C
:10380000D41B80E00E94DE1B08951F920F920FB61A
:103810000F9211242F933F934F935F936F937F9356
:103820008F939F93AF93BF93EF93FF9380910A047D
:10383000282F3327442755278F5F80930A04F901E7
:103840002731310508F098C0E85CFF4FEE0FFF1FED
:103850000590F491E02D099480910904880F8E5A07
:103860007EC080910904282F33278F5F809309043D
:1038700021303105E1F1223031051CF4232BA1F177
:103880007BC022303105B1F123303105B1F174C074
:103890000E94DA1B80910904843018F410920A0403
:1038A00053C01092090450C080910804880F8D5AAB
:1038B00056C080910804E82FFF27EA5BF84F8091FB
:1038C000BB0080838091080499278130910579F0AD
:1038D000823091051CF4892B39F04EC0823091055D
:1038E00049F0039751F048C08091D70738C08091C4
:1038F000E00735C08091FF0732C0809102082FC0D9
:1039000090910804E92FFF27EA5BF84F8091BB00F4
:103910008483892F8F5F80930804843018F110927C
:10392000080420C080E11BC08091130318C082E10D
:1039300016C08091120313C00E94DA1B8AE090E047
:1039400090939503809394030E94D41B15C088E93B
:1039500006C084E104C08091110301C080E80E9488
:10396000DE1B0AC00E94DA1B8AE090E09093950368
:103970008093940310920A048091BC008068809325
:10398000BC00FF91EF91BF91AF919F918F917F917B
:103990006F915F914F913F912F910F900FBE0F90BC
:1039A0001F90189583EC8093810080916F00806256
:1039B00080936F0010929E0410929D041092A004B8
:1039C00010929F041092A2041092A10408951F92D5
:1039D0000F920FB60F9211240F931F932F933F93C3
:1039E0004F935F936F937F938F939F93AF93BF9307
:1039F000CF93DF93EF93FF93409186005091870020
:103A000080910B0490910C04481B590B8091860007
:103A10009091870090930C0480930B04CA018D54FD
:103A20009440A0910D04B0910E04835F9A4158F424
:103A3000149714F01092770381E090E090930E04B5
:103A400080930D0499C0AA30B1050CF095C0CA014D
:103A50008B5F9040845B914008F071C0425D5140A3
:103A6000FD01EA0FFB1FE25BF84F80819181FA01B3
:103A7000E81BF90BCF01F7FF03C0909581959F4F8D
:103A800006974CF480913D04883C28F480913D04D5
:103A9000865F80933D04FD01EA0FFB1FE25BF84F58
:103AA000808191819C01220F331F280F391F240F21
:103AB000351F37FF02C02D5F3F4FE901D595C795F0
:103AC000D595C795CA0101968C179D0714F42197C7
:103AD00006C041505040C417D5070CF42196809180
:103AE0003D04833CD8F08D010A0F1B1FF801E25BF7
:103AF000F84F808191819E01281B390BC90163E039
:103B000070E00E94934ACB01880F991F860F971F80
:103B10000C59184FF8019183808307C0AA0FBB1F6F
:103B2000AC59B84F11961C921E92E0910D04F09181
:103B30000E04EE0FFF1FE25BF84FD183C08380912C
:103B40000D0490910E04019690930E0480930D0441
:103B5000059711F45D9A01C05D9880910D049091D4
:103B60000E048630910511F45C9A01C05C980797A9
:103B700011F45B9A01C05B98FF91EF91DF91CF91B7
:103B8000BF91AF919F918F917F916F915F914F9175
:103B90003F912F911F910F910F900FBE0F901F908B
:103BA000189581E080937C0782E080937D0783E015
:103BB00080937E0784E080937F0785E08093800771
:103BC00086E08093810787E08093820788E0809376
:103BD00083070895CF93DF9388E6809384073EE1BF
:103BE000309385078BEF809387078AE0809388075F
:103BF0003093860730938A0764E0609389075FE01B
:103C000050938B0730938C07ECE0E0938D0778E0BE
:103C100070938E0786EE80938F073093900780E82D
:103C20008093910780E58093920796E9909393079C
:103C30008EE58093940783E28093950730939607EF
:103C40001092970780E2809398071092990710923C
:103C50009A0710929B0710929C071092AC07109243
:103C6000AD071092AE071092AF0744E640939D0750
:103C700088E280939E071092C20782E380939F0799
:103C80009093A00725E02093A1078093A2079AE5CF
:103C90009093A3078093A4071092C1079093A50760
:103CA0002093A60785E58093A7078093A80780E166
:103CB0008093A9076093AA074093AB078FE5809391
:103CC000B00783EF8093B2075093B1075093B307C7
:103CD0008DEF8093B4074093B5079093B607909308
:103CE000B7079093B8071092B90786E08093BA0798
:103CF0007093BB079093BC073093BD074093BE07FA
:103D00008CE38093BF07C7ECD7E0A6E9B3E00D9042
:103D10000992E150E1F7DF91CF910895CF93DF93BE
:103D200088E6809384074EE1409385078BEF80936C
:103D300087078AE0809388074093860740938A0725
:103D400083E080938907ECE0E0938B0780E1809328
:103D50008C0776E070938D0768E060938E0786EE9F
:103D600080938F074093900780E88093910780E5C8
:103D70008093920788E7809393078EE5809394075A
:103D800083E280939507409396071092970750E23D
:103D9000509398071092990710929A0710929B07D8
:103DA00010929C071092AC071092AD071092AE07CC
:103DB0001092AF0734E630939D0788E280939E0708
:103DC0001092C20792E390939F0786E98093A00721
:103DD00085E08093A1079093A2072AE52093A3078B
:103DE0009093A4071092C1072093A5078093A6077C
:103DF00085E58093A7078093A8075093A90784E0DF
:103E00008093AA078BE48093AB078FE58093B0077C
:103E100083EF8093B20784E18093B1078093B30767
:103E20008DEF8093B4073093B5072093B6072093A6
:103E3000B7072093B8071092B9077093BA07609339
:103E4000BB072093BC074093BD073093BE078CE3AC
:103E50008093BF07C7ECD7E0ADE9B3E00D900992BE
:103E6000E150E1F7DF91CF91089588EE80938407C8
:103E70003EE1309385078BEF809387078AE080933C
:103E800088073093860730938A0783E080938907F9
:103E900058E050938B0790E190938C0766E0609315
:103EA0008D0750938E0786EE80938F07309390078F
:103EB00080E88093910744E64093920788E78093D7
:103EC00093078EE58093940783E28093950784E1BE
:103ED00080939607109297079093980710929907EE
:103EE00010929A0710929B0710929C071092AC07B1
:103EF0001092AD071092AE071092AF0740939D0746
:103F000088E280939E071092C20792E390939F07E6
:103F100086E98093A00785E08093A1079093A2078C
:103F20002AE52093A3079093A4071092C10720933A
:103F3000A5078093A60785E58093A7078093A80728
:103F400080E28093A90784E08093AA079093AB074F
:103F50008FE58093B00783EF8093B2073093B1076A
:103F60003093B3078DEF8093B4074093B507209348
:103F7000B6072093B7072093B8071092B90760934C
:103F8000BA075093BB072093BC073093BD074093FB
:103F9000BE078CE38093BF07A7ECB7E0E5EAF3E048
:103FA0008CE001900D928150E1F70895CF93C82FD6
:103FB000C150CF3F81F080913404882361F484E6BE
:103FC00090E09093D8038093D7038AEF90E00E940B
:103FD0002F10C15080F7CF9108959F92AF92BF925A
:103FE000CF92DF92EF92FF920F931F93CF93DF93C5
:103FF00080919D0490919E042091F5033091F603E9
:10400000821B930B90930C0880930B088091F90707
:104010009091FA072091F5033091F603821B930BE0
:1040200090937B0780937A078091F7039091F80330
:1040300020919F043091A004821B930B9093D6078C
:104040008093D5078091F9039091FA032091A10400
:104050003091A204821B930B9093E2078093E107B7
:104060008091D5079091D60790932B0780932A07CC
:1040700080910608909107087C010027F7FC0095C5
:10408000102F8091F1039091F203AA2797FDA0953C
:10409000BA2FBC01CD012CE030E040E050E00E949E
:1040A000544ADC01CB01E80EF91E0A1F1B1F17FF43
:1040B00005C00894E11CF11C011D111D1595079503
:1040C000F794E794F0920708E092060880911908A7
:1040D00090911A087C010027F7FC0095102F809121
:1040E000F3039091F403AA2797FDA095BA2FBC0182
:1040F000CD012CE030E040E050E00E94544ADC0169
:10410000CB01E80EF91E0A1F1B1F17FF05C00894FC
:10411000E11CF11C011D111D15950795F794E794FD
:10412000F0921A08E09219088091EA079091EB0743
:104130009C01442737FD4095542F8091EF039091C7
:10414000F003AA2797FDA095BA2F280F391F4A1F01
:104150005B1F57FF04C02F5F3F4F4F4F5F4F559579
:104160004795379527953093EB072093EA07809181
:10417000F1039091F2036CE070E0869F9001879FBD
:10418000300D969F300D1124C9019C01442737FD45
:104190004095542F8091790490917A04A0917B04EA
:1041A000B0917C04820F931FA41FB51F80937904E4
:1041B00090937A04A0937B04B0937C048091F303E2
:1041C0009091F403869F9001879F300D969F300D4C
:1041D0001124C9019C01442737FD4095542F80913B
:1041E000750490917604A0917704B0917804820FC1
:1041F000931FA41FB51F8093750490937604A0931A
:104200007704B09378048091F2079091F30720919E
:10421000F1033091F203820F931F9093F307809381
:10422000F20780910E0890910F082091F3033091CE
:10423000F403820F931F90930F0880930E088091D0
:104240009304909194040196909394048093930422
:104250008091710490917204A0917304B0917404E0
:10426000BC01CD010E9492495B016C01809136072F
:1042700090913707AA2797FDA095BA2FBC01CD01D1
:104280000E9492497B018C0180918F04909190044F
:10429000A0919104B09192049C01AD01C801B701B5
:1042A0000E94EC48DC01CB019C01AD01C601B501C7
:1042B0000E94ED48DC01CB01BC01CD010E94754993
:1042C000DC01CB018093710490937204A09373047A
:1042D000B093740480910B0890910C08AA2797FD65
:1042E000A095BA2FC0911508D0911608E091170833
:1042F000F0911808C80FD91FEA1FFB1FC0931508BB
:10430000D0931608E0931708F093180880910B08D3
:1043100090910C089C01442737FD4095542F8091C3
:10432000590490915A04A0915B04B0915C04820FEF
:10433000931FA41FB51F8093590490935A04A09310
:104340005B04B0935C04C83737E1D30737E0E30779
:1043500030E0F30764F0C857D741E740F040C0931E
:104360001508D0931608E0931708F0931808809169
:10437000150890911608A0911708B0911808B7FF7A
:104380000CC08858984EA84FBF4F80931508909343
:104390001608A0931708B093180890902B04992042
:1043A00009F0C3C080912A04882309F0BEC080911F
:1043B000840786FFBAC080917A0790917B07AA276D
:1043C00097FDA095BA2F2091690430916A0440911D
:1043D0006B0450916C04BC01CD010E94544AEC0165
:1043E000DB0197FF04C0A150B84FCF4FDF4F1BE058
:1043F000D595C795B795A7951A95D1F780911D04C6
:10440000E82EFF2400271127BD01CE01A801970146
:104410000E94544ADC01CB018093A3049093A4042E
:10442000A093A504B093A604B7FF04C08150904F99
:10443000AF4FBF4F5C016D01ACE0D594C794B7940A
:10444000A794AA95D1F7A092A304B092A404C09215
:10445000A504D092A60480917A0790917B07AA27A1
:1044600097FDA095BA2F209161043091620440918C
:10447000630450916404BC01CD010E94544A97FF2B
:1044800004C06150784F8F4F9F4FFBE09595879503
:1044900077956795FA95D1F7A80197010E94544A3C
:1044A000DC01CB018093A7049093A804A093A904F6
:1044B000B093AA04B7FF04C08150904FAF4FBF4FD5
:1044C0009C01AD01ECE05595479537952795EA9508
:1044D000D1F72093A7043093A8044093A9045093E4
:1044E000AA04D601C501D7FE07C0B095A095909546
:1044F00081959F4FAF4FBF4F81389105A105B10501
:1045000084F4DA01C90157FF07C0B095A0959095D2
:1045100081959F4FAF4FBF4F81389105A105B105E0
:10452000A4F081E08093480410C01092A704109278
:10453000A8041092A9041092AA041092A304109245
:10454000A4041092A5041092A6048091D50790911E
:10455000D6072091A3043091A404820F931F909357
:10456000D6078093D50700911C04202F33274427BA
:1045700055278091A7049091A804A091A904B09117
:10458000AA04BC01CD010E94544A9B01AC0197FFD3
:1045900004C021503E4F4F4F5F4F79E055954795EE
:1045A000379527957A95D1F78091D5079091D607C1
:1045B000820F931F9093D6078093D5078091D507DC
:1045C0009091D6079C01442737FD4095542F809148
:1045D0005D0490915E04A0915F04B0916004820F2D
:1045E000931FA41FB51F80935D0490935E04A09356
:1045F0005F04B09360048091D5079091D607209115
:104600002E0430912F04821B930B9C01442737FD0D
:104610004095542F8091610490916204A0916304AD
:10462000B0916404820F931FA41FB51F809361048F
:1046300090936204A0936304B0936404C0918A03CE
:10464000D0918B03E0918C03F0918D03C817D907AB
:10465000EA07FB07C4F488EA91E6A0E0B0E08C1B0F
:104660009D0BAE0BBF0B8093610490936204A093EB
:104670006304B093640480935D0490935E04A093FC
:104680005F04B093600422273327A9012C1B3D0B44
:104690004E0B5F0B8091610490916204A0916304C2
:1046A000B091640482179307A407B507B4F4CE0150
:1046B000DF01885A9146A040B040809361049093F6
:1046C0006204A0936304B093640480935D049093A8
:1046D0005E04A0935F04B09360048091F70390910F
:1046E000F8030F9734F488E19CEF9093D6078093FA
:1046F000D5078091F7039091F803079734F480E38E
:1047000098EF9093D6078093D507109101011A3046
:10471000A9F48091F7039091F803835F934034F0FC
:1047200088EE93E09093D6078093D5078091F703A6
:104730009091F8038A5F9340DCF014C08091F703F6
:104740009091F803855E974034F088EE93E0909363
:10475000D6078093D5078091F7039091F803835F84
:10476000974034F080ED97E09093D6078093D5077B
:104770008091E1079091E2072091A7043091A8046D
:10478000821B930B9093E2078093E107202F33273E
:10479000442755278091A3049091A404A091A504D7
:1047A000B091A604BC01CD010E94544A9B01AC010A
:1047B00097FF04C021503E4F4F4F5F4F69E0559522
:1047C0004795379527956A95D1F78091E1079091A4
:1047D000E207821B930B9093E2078093E10780919D
:1047E000E1079091E2079C01442737FD4095542F43
:1047F0008091650490916604A0916704B09168046B
:10480000820F931FA41FB51F8093650490936604C5
:10481000A0936704B09368048091E1079091E20748
:1048200020912C0430912D04821B930B9C01442772
:1048300037FD4095542F8091690490916A04A091AE
:104840006B04B0916C04820F931FA41FB51F80935B
:10485000690490936A04A0936B04B0936C04C091B4
:104860008E03D0918F03E0919003F0919103C817CC
:10487000D907EA07FB07C4F488EA91E6A0E0B0E0B4
:104880008C1B9D0BAE0BBF0B8093690490936A0445
:10489000A0936B04B0936C048093650490936604BA
:1048A000A0936704B093680422273327A9012C1B27
:1048B0003D0B4E0B5F0B8091690490916A04A091AF
:1048C0006B04B0916C0482179307A407B507B4F486
:1048D000CE01DF01885A9146A040B0408093690420
:1048E00090936A04A0936B04B0936C048093650466
:1048F00090936604A0936704B09368048091F903D1
:104900009091FA030F9734F488E19CEF9093E207BB
:104910008093E1078091F9039091FA03079734F4AB
:1049200080E398EF9093E2078093E1071A30A9F4AF
:104930008091F9039091FA03835F934034F088EEFD
:1049400093E09093E2078093E1078091F9039091BF
:10495000FA038A5F9340DCF014C08091F9039091D0
:10496000FA03855E974034F088EE93E09093E20777
:104970008093E1078091F9039091FA03835F974058
:1049800034F080ED97E09093E2078093E1078FEE9B
:1049900080937A008091590490915A04A0915B040D
:1049A000B0915C0480936D0490936E04A0936F04A7
:1049B000B09370048091690490916A04A0916B0493
:1049C000B0916C048093890490938A04A0938B0423
:1049D000B0938C048091610490916204A09163046F
:1049E000B09164048093810490938204A093830423
:1049F000B09384048091650490916604A09167044B
:104A0000B09168048093850490938604A0938704F2
:104A1000B093880480915D0490915E04A0915F043E
:104A2000B091600480937D0490937E04A0937F04F2
:104A3000B09380048091840787FF6EC0992009F0AD
:104A40006BC080912A04882309F066C08091E10739
:104A50009091E207893C91058CF02091E10730911B
:104A6000E207220F331F220F331F8091E10790913D
:104A7000E207820F931F8052934017C08091E10795
:104A80009091E20788539F4FA4F42091E107309161
:104A9000E207220F331F220F331F8091E10790910D
:104AA000E207820F931F805E9C4F9093E2078093F2
:104AB000E1078091D5079091D607893C91058CF04C
:104AC0002091D5073091D607220F331F220F331FB5
:104AD0008091D5079091D607820F931F8052934003
:104AE00017C08091D5079091D60788539F4FA4F4A3
:104AF0002091D5073091D607220F331F220F331F85
:104B00008091D5079091D607820F931F805E9C4FAE
:104B10009093D6078093D50780918007E82FFF27D1
:104B2000EE0FFF1FE25BF84F8081918182599F4F0A
:104B30002091440430914504281739071CF42F5F55
:104B40003F4F0CC08081918182599F4F82179307FC
:104B50004CF42115310531F021503040309345049B
:104B60002093440480918107E82FFF27EE0FFF1F59
:104B7000E25BF84F8081918182599F4F20914204DE
:104B800030914304281739071CF42F5F3F4F0CC0A6
:104B90008081918182599F4F821793074CF4211590
:104BA000310531F0215030403093430420934204CA
:104BB00080918207E82FFF27EE0FFF1FE25BF84F7F
:104BC0008081918182599F4F20914004309141040E
:104BD000281739071CF42F5F3F4F0CC0808191814B
:104BE00082599F4F821793074CF42115310531F0FC
:104BF000215030403093410420934004809183073A
:104C0000E82FFF27EE0FFF1FE25BF84F80819181B5
:104C100082599F4F20913E0430913F042817390755
:104C20001CF42F5F3F4F0CC08081918182599F4FB0
:104C3000821793074CF42115310531F02150304093
:104C400030933F0420933E048091440490914504A6
:104C500097FF05C010924504109244040AC08F3F8C
:104C6000910539F034F08FEF90E0909345048093F4
:104C70004404809142049091430497FF05C0109230
:104C80004304109242040AC08F3F910539F034F07A
:104C90008FEF90E09093430480934204809140040E
:104CA0009091410497FF05C0109241041092400476
:104CB0000AC08F3F910539F034F08FEF90E0909368
:104CC00041048093400480913E0490913F0497FFFB
:104CD00005C010923F0410923E040AC08F3F910518
:104CE00039F034F08FEF90E090933F0480933E04CE
:104CF000DF91CF911F910F91FF90EF90DF90CF90B8
:104D0000BF90AF909F900895809101018D3011F474
:104D10000E94DA1110927A008091F9039091FA03BF
:104D20009093E2078093E1078091F7039091F80355
:104D30009093D6078093D5078091F5039091F60361
:104D400090930C0880930B088091F1039091F203EB
:104D5000AA2797FDA095BA2FBC01CD012CE030E029
:104D600040E050E00E94544ADC01CB0190930708D8
:104D7000809306088091F3039091F403AA2797FD8E
:104D8000A095BA2FBC01CD010E94544ADC01CB0191
:104D900090931A08809319088091EF039091F00383
:104DA0009093EB078093EA078FEE80937A008091CF
:104DB0008007E82FFF27EE0FFF1FE25BF84F80818F
:104DC000918182599F4F20914404309145042817C6
:104DD00039071CF42F5F3F4F0CC0808191818259AD
:104DE0009F4F821793074CF42115310531F0215064
:104DF0003040309345042093440480918107E82F8C
:104E0000FF27EE0FFF1FE25BF84F808191818259EF
:104E10009F4F2091420430914304281739071CF416
:104E20002F5F3F4F0CC08081918182599F4F821725
:104E300093074CF42115310531F021503040309367
:104E400043042093420480918207E82FFF27EE0F4E
:104E5000FF1FE25BF84F8081918182599F4F209123
:104E6000400430914104281739071CF42F5F3F4F4D
:104E70000CC08081918182599F4F821793074CF417
:104E80002115310531F021503040309341042093F9
:104E9000400480918307E82FFF27EE0FFF1FE25B9E
:104EA000F84F8081918182599F4F20913E0430912B
:104EB0003F04281739071CF42F5F3F4F0CC0808137
:104EC000918182599F4F821793074CF42115310528
:104ED00031F02150304030933F0420933E048091C4
:104EE00044049091450497FF05C010924504109228
:104EF00044040AC08F3F910539F034F08FEF90E001
:104F0000909345048093440480914204909143041B
:104F100097FF05C010924304109242040AC08F3FCD
:104F2000910539F034F08FEF90E090934304809333
:104F30004204809140049091410497FF05C0109273
:104F40004104109240040AC08F3F910539F034F0BB
:104F50008FEF90E0909341048093400480913E0451
:104F600090913F0497FF05C010923F0410923E04B9
:104F70000AC08F3F910539F034F08FEF90E09093A5
:104F80003F0480933E048091A7079927AA27BB2757
:104F9000BC01CD0124EC39E040E050E00E94544ACD
:104FA000DC01CB0180938E0390938F03A093900339
:104FB000B09391038091A8079927AA27BB27BC012A
:104FC000CD010E94544ADC01CB0180938A03909367
:104FD0008B03A0938C03B0938D03089510929804D3
:104FE00010929704109296041092950480E090E03D
:104FF000A0E0B0E080938F0490939004A09391047C
:10500000B09392041092A2041092A1041092A004F2
:1050100010929F0410929E0410929D041092FA0721
:105020001092F90710921D0410921C041092E803CC
:105030000E94842684E690E00E943C100E94842610
:105040008091840780FF10C0809114039091150314
:10505000875B934038F480911403909115038E5E22
:10506000924010F40E9490114091F9035091FA037C
:105070005093A2044093A1042091F7033091F803C8
:105080003093A00420939F048091F5039091F60340
:1050900090939E0480939D048091F5039091F60374
:1050A0009093FA078093F90730939C0420939B0414
:1050B00050939A044093990444E050E0DA010E942E
:1050C000E34A802D853038F18091190890911A08B3
:1050D00097FF03C0909581959F4F6CE070E00E9410
:1050E000934A70939604609395048091060890917A
:1050F000070897FF03C0909581959F4F6CE070E083
:105100000E94934A709398046093970480913607A5
:105110009091370734C0DA010E94E34A802D992725
:10512000982F8827DA0111960E94E34A202D820FDA
:10513000911D9093980480939704DA0112960E942F
:10514000E34A802D9927982F8827DA0113960E9429
:10515000E34A202D820F911D90939604809395042D
:10516000DA0114960E94E34A802D9927982F882708
:10517000DA0115960E94E34A202D820F911DAA277D
:1051800097FDA095BA2FBC01CD010E949249DC0188
:10519000CB0180938F0490939004A0939104B093DB
:1051A00092041092690410926A0410926B04109297
:1051B0006C041092650410926604109267041092B9
:1051C00068041092610410926204109263041092B9
:1051D000640410925D0410925E0410925F041092B9
:1051E00060041092590410925A0410925B041092B9
:1051F0005C041092E2071092E1071092D607109219
:10520000D50710920C0810920B0884E690E00E94DB
:105210003C108091160390911703A0911803B09150
:10522000190390933907809338071092E70310927F
:10523000E6031092510410925204109253041092FB
:10524000540480914F049091500490934E048093A5
:105250004D040E941F4582E390E09093D803809311
:10526000D7038091A7079927AA27BB27BC01CD01A7
:1052700024EC39E040E050E00E94544ADC01CB01CC
:105280008856954CAF4FBF4F80938E0390938F03FA
:10529000A0939003B09391038091A8079927AA2720
:1052A000BB27BC01CD010E94544ADC01CB018856CA
:1052B000954CAF4FBF4F80938A0390938B03A0937D
:1052C0008C03B0938D031092790310927803809130
:1052D0004F0490915004AA2797FDA095BA2FBC01C6
:1052E000CD012BE035E040E050E00E94544ADC0163
:1052F000CB018093150890931608A0931708B093DC
:105300001808109247041092460481E0809300012F
:105310000E94574880910F04846080930F048FEFA0
:10532000809382088091AA07992724E0880F991F0B
:105330002A95E1F78093830880E28093840808959A
:1053400080913404882321F58093E0078093D70768
:105350008093FF07809302088091B803882311F09F
:105360008093D7078091B903882311F08093E007D9
:105370008091BA03882311F0809302088091BB03C7
:10538000882311F08093FF0780910F048C7F03C066
:1053900080910F04816080930F048091D707992733
:1053A00090930B0780930A078091E00799279093C9
:1053B0000D0780930C0780910208992790930F079F
:1053C00080930E078091FF07992790931107809390
:1053D000100710920A04109209040E94D41B089529
:1053E0001F93809187078B3F98F08B3F19F4809132
:1053F00044040EC08C3F19F48091420409C08D3FD3
:1054000019F48091400404C08E3F21F480913E0441
:1054100080938403809186078B3F98F08B3F19F42B
:10542000809144040EC08C3F19F48091420409C05D
:105430008D3F19F48091400404C08E3F21F4809187
:105440003E048093850380918503882329F0843668
:1054500018F084E680938503809188078B3F98F04D
:105460008B3F19F4809144040EC08C3F19F4809155
:10547000420409C08D3F19F48091400404C08E3F5E
:1054800021F480913E0480938303809183038823D9
:1054900029F0843618F084E68093830380918A078C
:1054A0008B3F98F08B3F19F4809144040EC08C3FE1
:1054B00019F48091420409C08D3F19F48091400491
:1054C00004C08E3F21F480913E048093820380913A
:1054D00091078B3F98F08B3F19F4809144040EC0E4
:1054E0008C3F19F48091420409C08D3F19F48091DA
:1054F000400404C08E3F21F480913E0480938103D8
:10550000809192078B3F98F08B3F19F4809144046F
:105510000EC08C3F19F48091420409C08D3F19F4EC
:105520008091400404C08E3F21F480913E0480931A
:105530008003809180038B3010F48AE002C08F3F9B
:1055400011F480938003809193078B3F98F08B3FF9
:1055500019F4809144040EC08C3F19F480914204E8
:1055600009C08D3F19F48091400404C08E3F21F49E
:1055700080913E0480937F03809198078B3F98F041
:105580008B3F19F4809144040EC08C3F19F4809134
:10559000420409C08D3F19F48091400404C08E3F3D
:1055A00021F480913E0480937D03809199078B3F85
:1055B00098F08B3F19F4809144040EC08C3F19F48D
:1055C0008091420409C08D3F19F48091400404C0C9
:1055D0008E3F21F480913E048093250480919A07A8
:1055E0008B3F98F08B3F19F4809144040EC08C3FA0
:1055F00019F48091420409C08D3F19F48091400450
:1056000004C08E3F21F480913E0480932404809155
:105610009B078B3F98F08B3F19F4809144040EC098
:105620008C3F19F48091420409C08D3F19F4809198
:10563000400404C08E3F21F480913E0480932304F3
:1056400080919C078B3F98F08B3F19F48091440424
:105650000EC08C3F19F48091420409C08D3F19F4AB
:105660008091400404C08E3F21F480913E048093D9
:1056700022048091AC078B3F98F08B3F19F4809106
:1056800044040EC08C3F19F48091420409C08D3F40
:1056900019F48091400404C08E3F21F480913E04AF
:1056A000809321048091AD078B3F98F08B3F19F4D4
:1056B000809144040EC08C3F19F48091420409C0CB
:1056C0008D3F19F48091400404C08E3F21F48091F5
:1056D0003E04809320048091AE078B3F98F08B3F6F
:1056E00019F4809144040EC08C3F19F48091420457
:1056F00009C08D3F19F48091400404C08E3F21F40D
:1057000080913E0480931F048091AF078B3F98F0F7
:105710008B3F19F4809144040EC08C3F19F48091A2
:10572000420409C08D3F19F48091400404C08E3FAB
:1057300021F480913E0480931E0480919D078B3F4D
:1057400098F08B3F19F4809144040EC08C3F19F4FB
:105750008091420409C08D3F19F48091400404C037
:105760008E3F21F480913E0480937C038091A207B8
:105770008B3F98F08B3F19F4809144040EC08C3F0E
:1057800019F48091420409C08D3F19F480914004BE
:1057900004C08E3F21F480913E0480937B0380916E
:1057A000A5078B3F98F08B3F19F4809144040EC0FD
:1057B0008C3F19F48091420409C08D3F19F4809107
:1057C000400404C08E3F21F480913E0480931D0468
:1057D0008091A6078B3F98F08B3F19F48091440489
:1057E0000EC08C3F19F48091420409C08D3F19F41A
:1057F0008091400404C08E3F21F480913E04809348
:105800001C048091AB078B3F98F08B3F19F480917B
:1058100044040EC08C3F19F48091420409C08D3FAE
:1058200019F48091400404C08E3F21F480913E041D
:1058300080937A038091B1078B3F98F08B3F19F4E6
:10584000809144040EC08C3F19F48091420409C039
:105850008D3F19F48091400404C08E3F21F4809163
:105860003E048093F4078091F407823010F481E0C5
:1058700002C08F3F11F48093F4078091B3078B3FF0
:1058800098F08B3F19F4809144040EC08C3F19F4BA
:105890008091420409C08D3F19F48091400404C0F6
:1058A0008E3F21F480913E0480930908809109087D
:1058B000823010F481E002C08F3F11F48093090818
:1058C0008091C0078B3F98F08B3F19F4809144047E
:1058D0000EC08C3F19F48091420409C08D3F19F429
:1058E0008091400404C08E3F21F480913E04809357
:1058F0001C0810917D03812F992787FD9095A92F72
:10590000B92FBC01CD010E94924917FF06C020E0CB
:1059100030E040E853E40E94ED4827E137EB41EDE9
:1059200058E30E940C4ADC01CB01809386039093DC
:105930008703A0938803B093890380918F07809396
:105940000A0880918E078093E4071F9108952F9293
:105950003F924F925F926F927F928F929F92AF92FF
:10596000BF92CF92DF92EF92FF920F931F93CF934C
:10597000DF93CDB7DEB768970FB6F894DEBF0FBEE2
:10598000CDBF0E94ED1F309101013C3010F4299AE7
:1059900001C02998E0903504F0903604FA82E9823B
:1059A0008091E40799270A96E816F90614F49A8379
:1059B000898380913D04843608F06EC0809106038F
:1059C000882399F48091090390910A038F5F9F4F78
:1059D00061F488E99AE39093D8038093D70380E039
:1059E0009CE090930A03809309038091C7049091EF
:1059F000C804009731F001979093C8048093C704BE
:105A000004C01092340410924A043A3011F0343138
:105A100011F4289A01C028988091100490911104E3
:105A2000895E9340B0F180919507282F33273A8300
:105A3000298381E080934A0480917C07A82FBB27AB
:105A4000AA0FBB1FFD01EC59F84F11821082809103
:105A50007D07282F3327220F331FC9018C59984FF8
:105A6000FC0111821082A25BB84F11961C921E920B
:105A7000225B384FD90111961C921E9280917F07AC
:105A8000E82FFF27EE0FFF1FE25BF84F1182108215
:105A9000B2C210923404AFC280913D048D3808F434
:105AA000AAC210924A049091960782E3989FC0017F
:105AB00011249093C8048093C704E981FA81B997AF
:105AC0008CF080913404882369F0809110049091C7
:105AD0001104FFEF8F3F9F0729F001969093110467
:105AE0008093100480911004909111048F3F9105D0
:105AF00009F038F51092AB041092AC041092AD048A
:105B00001092AE041092AF041092B0041092B1043F
:105B10001092B2048A3F9105C9F481E08093CF04CA
:105B20001092B3041092B4041092B5041092B6040B
:105B30001092590410925A0410925B0410925C0463
:105B400005C080910F04826080930F0480917E07CE
:105B5000E82FFF27EE0FFF1FE25BF84F8081918156
:105B6000813591050CF499C120913404222309F068
:105B700094C180917F07E82FFF27EE0FFF1FE25BA4
:105B8000F84F808191818C3491050CF4F9C080919B
:105B9000C9048F5F8093C904893C08F47EC13C30FE
:105BA00010F4299801C0299A109234041092C90463
:105BB000109211041092100430917C07E32FFF27FC
:105BC000EE0FFF1FE25BF84F8081918187349105D2
:105BD000B4F480917D07E82FFF27EE0FFF1FE25BF3
:105BE000F84F808191810190F081E02DF7FF03C093
:105BF000F095E195FF4FE734F1050CF478C041E0F2
:105C000020917D07A22FBB27AA0FBB1FA25BB84F15
:105C10008D919C9111978734910544F0E32FFF27D4
:105C2000EE0FFF1FE25BF84F808191818D919C9177
:105C30008734910574F080917C07E82FFF27EE0FE1
:105C4000FF1FE25BF84F80819181873491050CF052
:105C500042E0E22FFF27EE0FFF1FE25BF84F80814B
:105C600091818634910574F480917C07E82FFF2799
:105C7000EE0FFF1FE25BF84F808191818734910521
:105C80000CF043E0E22FFF27EE0FFF1FE25BF84F1F
:105C9000808191818A5B9F4F74F480917C07E82F0B
:105CA000FF27EE0FFF1FE25BF84F80819181873461
:105CB00091050CF044E0E22FFF27EE0FFF1FE25B9F
:105CC000F84F808191818A5B9F4F74F480917C07AB
:105CD000E82FFF27EE0FFF1FE25BF84F80819181D5
:105CE000863491050CF445E0842F0E94CE02809109
:105CF0007D07E82FFF27EE0FFF1FE25BF84F808143
:105D000091810190F081E02DF7FF03C0F095E195BE
:105D1000FF4F7E97BCF480917C07E82FFF27EE0FA2
:105D2000FF1FE25BF84F808191818A5B9F4F54F4A3
:105D300081E080934B0688EE93E09093D8038093A4
:105D4000D703ABC00E94FD0246E56CE777E00E94F6
:105D5000B1028091840780FF10C08091140390915C
:105D60001503875B934038F48091140390911503D9
:105D70008E5E924010F40E9490110E94EE2786C021
:105D800080819181855B9F4F0CF085C08091C90413
:105D90008F5F8093C904893C08F47FC03C3010F4C5
:105DA000299801C0299AA4E0B0E08FEF082E0E9444
:105DB000EB4A109234041092C9041092110410920C
:105DC00010040E94EE27A4E0B0E080919704909127
:105DD000980497FF02C081509F4F892F990F990B0C
:105DE000082E0E94EB4AA5E0B0E0809197049091C4
:105DF0009804082E0E94EB4AA6E0B0E0809195043A
:105E00009091960497FF02C081509F4F892F990F60
:105E1000990B082E0E94EB4AA7E0B0E08091950410
:105E200090919604082E0E94EB4A08E010E08091C1
:105E30008F0490919004A0919104B0919204BC01C0
:105E4000CD010E947549DC01CB019C0197FF02C086
:105E500021503F4F832F992787FD9A95D801082E0F
:105E60000E94EB4A09E010E080918F049091900429
:105E7000A0919104B0919204BC01CD010E9475499A
:105E8000DC01CB01D801082E0E94EB4A0E94FD02E2
:105E90000E94D61F02C02093C90480917E07E82F7C
:105EA000FF27EE0FFF1FE25BF84F808191818B5A35
:105EB0009F4F0CF0A0C020917F07E22FFF27EE0F2D
:105EC000FF1FE25BF84F80819181855B9F4F0CF053
:105ED00072C08091CA048F5F8093CA04893C08F421
:105EE0006CC088EC8093CA0481E090E09093110428
:105EF0008093100481E0809334041092B3041092D4
:105F0000B4041092B5041092B60410925904109281
:105F10005A0410925B0410925C0410925504109283
:105F2000560410925704109258041092690410926B
:105F30006A0410926B0410926C0410926104109227
:105F40006204109263041092640480918904909119
:105F50008A04A0918B04B0918C0480936504909383
:105F60006604A0936704B0936804809181049091C3
:105F70008204A0918304B091840480935D04909383
:105F80005E04A0935F04B09360041092AB0410927F
:105F9000AC041092AD041092AE041092AF041092B3
:105FA000B0041092B1041092B20480910F04886082
:105FB00080930F0402C01092CA04E22FFF27EE0F55
:105FC000FF1FE25BF84F808191818C3491058CF04A
:105FD0008091CB048F5F8093CB04893C60F010925A
:105FE000340488EC8093CB041092110410921004B6
:105FF00002C01092CB048091770381508093770385
:10600000809177038F3F29F080914A04882309F417
:1060100008C30E94F0298091D8049091D904AC0162
:10602000440F551F480F591F70907C07A72DBB27A1
:10603000AA0FBB1FFD01E25BF84F80918B07882EF2
:10604000992480819181889D7001899DF00C989D93
:10605000F00C11244E0D5F1D57FF02C04D5F5F4FC6
:106060005595479555954795AC59B84F80918C07F4
:10607000682F77278D919C91869F8001879F100DB7
:10608000969F100D1124400F511F5093D904409337
:10609000D80480910005909101052091FC04309175
:1060A000FD04820F931F5A01A81AB90AB0923C044A
:1060B000A0923B048091DA049091DB04AC01440F80
:1060C000551F480F591F00917D07A02FBB27AA0F0E
:1060D000BB1FFD01E25BF84F80819181889D90019B
:1060E000899D300D989D300D1124420F531F57FF8D
:1060F00002C04D5F5F4F5595479555954795AC59F3
:10610000B84F8D919C91869FD001879FB00D969F2F
:10611000B00D11244A0F5B1F5093DB044093DA0447
:106120008091FE049091FF042091FA043091FB04C9
:10613000820F931F7A01E81AF90AF0923A04E0926A
:10614000390480917F07E82FFF27EE0FFF1FE25BE6
:10615000F84F8081918144245524481A590A50925D
:1061600038044092370480917E07E82FFF27EE0F16
:10617000FF1FE25BF84FC080D180E8E7F0E0CE0E71
:10618000DF1ED0923604C092350410918003812F17
:10619000992787FD9095A92FB92FBC01CD010E94A9
:1061A000924917FF06C020E030E040E853E40E9427
:1061B000ED4820E030E040E251E40E94ED48DC018F
:1061C000CB0120E030E040E85CE3BC01CD010E945F
:1061D0000C4ADC01CB018093100890931108A09326
:1061E0001208B093130810917F03812F992787FD20
:1061F0009095A92FB92FBC01CD010E94924917FF9C
:1062000006C020E030E040E853E40E94ED4820E082
:1062100030EE4BE256E40E942F49DC01CB01809323
:10622000FB079093FC07A093FD07B093FE078091B6
:10623000570680FF52C080911C08813808F44DC079
:1062400080915006992787FD9095889D9001899DA2
:10625000300D989D300D1124A20EB31EB0923C0457
:10626000A0923B0480915106992787FD9095889DC7
:10627000A001899D500D989D500D1124E40EF51E2E
:10628000F0923A04E092390480915206992787FDF2
:106290009095480E591E50923804409237048091D0
:1062A0005406282F332727FD309580918907992799
:1062B000289FD001299FB00D389FB00D1124B093B5
:1062C0007903A09378038091530699278C159D0537
:1062D00024F4909336048093350480913504909192
:1062E000360497FF04C01092360410923504809152
:1062F000840782FF0CC080E090E0A0E0B0E08093D3
:10630000FB079093FC07A093FD07B093FE078091D5
:10631000100890911108A0911208B091130820E084
:1063200030E040E050E0BC01CD010E949C49882350
:1063300064F480E090E0A0E0B0E0809310089093D7
:106340001108A0931208B09313088091FB07909155
:10635000FC07A091FD07B091FE0720E030E040E08F
:1063600050E0BC01CD010E949C49882364F480E088
:1063700090E0A0E0B0E08093FB079093FC07A0932F
:10638000FD07B093FE0740913B0450913C04CA01C5
:1063900057FD03969C01359527953595279537FF31
:1063A00003C0309521953F4F8091140490911504BE
:1063B00082179307B4F4CA0157FF03C090958195E3
:1063C0009F4F97FD03969595879595958795909303
:1063D0001504809314048536910544F084E690E01A
:1063E00001C00197909315048093140440913904DF
:1063F00050913A04CA0157FD03969C0135952795A3
:106400003595279537FF03C0309521953F4F8091F3
:1064100012049091130482179307B4F4CA0157FF32
:1064200003C0909581959F4F97FD0396959587950D
:106430009595879590931304809312048536910562
:1064400044F084E690E001C0019790931304809398
:10645000120480914A04882341F01092150410928E
:1064600014041092130410921204E02FFF27EE0F71
:10647000FF1FE25BF84F4091A307242F3327808151
:1064800091812817390744F48091C10782FF04C025
:1064900081E08093290413C0E02FFF27EE0FFF1F38
:1064A000E25BF84F842F99272091A407821B910962
:1064B000208131812817390714F410922904409162
:1064C0007D07E42FFF27EE0FFF1FE25BF84F50918F
:1064D000A307852F992722273327281B390B808173
:1064E00091818217930744F48091C10783FF04C010
:1064F00081E08093280416C080912804882391F0BD
:10650000E42FFF27EE0FFF1FE25BF84F8091A407F7
:106510009927851B9109208131818217930714F4F3
:1065200010922804E72DFF27EE0FFF1FE25BF84FC4
:106530004091A307242F33278081918128173907A1
:1065400044F48091C10780FF04C081E08093260459
:1065500017C080912604882399F0E72DFF27EE0FBE
:10656000FF1FE25BF84F842F99272091A407821B1D
:106570009109208131812817390714F410922604DB
:1065800040917C07E42FFF27EE0FFF1FE25BF84FDF
:106590005091A307852F992722273327281B390BD2
:1065A000808191818217930744F48091C10781FF14
:1065B00004C081E08093270416C0809127048823BB
:1065C00091F0E42FFF27EE0FFF1FE25BF84F809161
:1065D000A4079927851B9109208131818217930790
:1065E00014F41092270480912904882319F48091CF
:1065F0002804811181E080932A0480912604882355
:1066000021F480912704882351F081E080932B04AA
:1066100010922A04109229041092280402C0809338
:106620002B0480912A04882321F480912B04882351
:1066300051F08091A2079927E981FA818E179F076F
:1066400014F49A838983F0914A04FB83FF2341F178
:10665000109238041092370410923C0410923B04BC
:1066600010923A041092390480E090E0A8ECBFE365
:106670008093100890931108A0931208B093130808
:106680008BE09CEBA2E3BCE38093FB079093FC07B9
:10669000A093FD07B093FE0710922A0410922B04DA
:1066A0008091EE079091EF07A091F007B091F1076C
:1066B0002091890430918A0440918B0450918C047C
:1066C000820F931FA41FB51F8093EE079093EF07CF
:1066D000A093F007B093F1078091F5079091F6072A
:1066E000A091F707B091F8072090810430908204C0
:1066F0004090830450908404820D931DA41DB51D09
:106700008093F5079093F607A093F707B093F807E7
:106710008091E6079091E707A091E807B091E9071B
:10672000E0908504F090860400918704109188041D
:10673000EC82FD820E831F838E0D9F1DA01FB11F53
:106740008093E6079093E707A093E807B093E907E3
:106750008091DB079091DC07A091DD07B091DE0707
:10676000E0907D04F0907E0400917F0410918004FD
:10677000E886F9860A871B878E0D9F1DA01FB11F13
:106780008093DB079093DC07A093DD07B093DE07CF
:10679000F0902B04FC86FF2029F480912A048823A2
:1067A00009F460C01092790410927A0410927B046C
:1067B00010927C0410927504109276041092770463
:1067C000109278041092EE071092EF071092F007E3
:1067D0001092F1071092F5071092F6071092F70742
:1067E0001092F8071092E6071092E7071092E80758
:1067F0001092E9071092DB071092DC071092DD0778
:106800001092DE078091690490916A04A0916B0454
:10681000B0916C048093650490936604A093670420
:10682000B09368048091610490916204A091630424
:10683000B091640480935D0490935E04A0935F0420
:10684000B09360041092E5031092E40310922D04BB
:1068500010922C0410922F0410922E040C85002309
:1068600009F0E6C180912A04882309F0E1C19090E3
:106870008208A09090078091060890910708988F51
:106880008F8BA0911908B0911A08BE8BAD8BBFEF0A
:106890009B1609F4D9C0BB24CC24DD24CA01B9015C
:1068A000A60195010E94C84A79018A01EF89F88DF5
:1068B000CF01AA2797FDA095BA2FE81AF90A0A0B6B
:1068C0001B0BC201B101A60195010E94C84A5901E2
:1068D0006A012D893E89C901AA2797FDA095BA2F83
:1068E000A81AB90ACA0ADB0A292C332427FC3094D7
:1068F000432C532CC801B701A20191010E94544AB4
:1069000097FF04C061507E4F8F4F9F4F3B014C015A
:1069100029E095948794779467942A95D1F7C601D6
:10692000B501A20191010E94544A97FF04C0615031
:106930007E4F8F4F9F4F5B016C0199E0D594C794B8
:10694000B794A7949A95D1F7809114049091150467
:10695000813491053CF480911204909113048134A8
:106960009105D4F0D401C30197FE03C00196A11D87
:10697000B11D3C014D019594879477946794D6019D
:10698000C501D7FE03C00196A11DB11D5C016D01BB
:10699000D594C794B794A79480917F07E82FFF27D9
:1069A000EE0FFF1FE25BF84F808191810190F08133
:1069B000E02DF7FF03C0F095E195FF4F7A97A4F023
:1069C000C401B30123E030E040E050E00E94C84A37
:1069D00039014A01C601B50123E030E040E050E052
:1069E0000E94C84A59016A0180918408282F3327E0
:1069F00027FD3095432F532F261537054805590598
:106A000014F439014A01992787FD90959095819555
:106A10009F4FAA2797FDA095BA2F681679068A0678
:106A20009B0614F43C014D012A153B054C055D0500
:106A300014F459016A01A816B906CA06DB060CF05F
:106A4000CFC05C016D01CCC0EA2CFF2400271127C8
:106A5000CA01B901A80197010E94C84A39014A0137
:106A60004F89588DCA01AA2797FDA095BA2F681A99
:106A7000790A8A0A9B0AC201B101A80197010E9402
:106A8000C84A59016A01ED89FE89CF01AA2797FDFD
:106A9000A095BA2FA81AB90ACA0ADB0AD401C30101
:106AA00097FE03C00F96A11DB11D3C014D0114E0DE
:106AB00095948794779467941A95D1F7D601C50178
:106AC000D7FE03C00F96A11DB11D5C016D01B4E09E
:106AD000D594C794B794A794BA95D1F7809114042C
:106AE00090911504813491053CF4809112049091A9
:106AF000130481349105A4F0C401B30123E030E014
:106B000040E050E00E94C84A39014A01C601B5017F
:106B100023E030E040E050E00E94C84A59016A0199
:106B200080917F07E82FFF27EE0FFF1FE25BF84FF2
:106B3000808191810190F081E02DF7FF03C0F095F5
:106B4000E195FF4F7A97A4F0C401B30123E030E050
:106B500040E050E00E94C84A39014A01C601B5012F
:106B600023E030E040E050E00E94C84A59016A0149
:106B7000F1E26F167104810491042CF0A0E26A2EF8
:106B8000712C812C912C00EE60160FEF70060FEF28
:106B900080060FEF900644F4F0EE6F2EFFEF7F2E8D
:106BA000FFEF8F2EFFEF9F2E11E2A116B104C1045B
:106BB000D1042CF0E0E2AE2EB12CC12CD12C20EE71
:106BC000A2162FEFB2062FEFC2062FEFD20644F423
:106BD00070EEA72E7FEFB72E7FEFC72E7FEFD72E59
:106BE0008091690490916A04A0916B04B0916C0447
:106BF00086199709A809B9098093690490936A04D2
:106C0000A0936B04B0936C04809161049091620432
:106C1000A0916304B09164048A199B09AC09BD0971
:106C20008093610490936204A0936304B09364041E
:106C30008091E4039091E5038F3F910509F008F4FA
:106C4000D4C53C85332309F050C580912A0488239C
:106C500009F04BC580914804882309F046C580910E
:106C6000EE079091EF07A091F007B091F107B7FF01
:106C700004C081509F4FAF4FBF4FE92EFA2E0B2F0C
:106C8000112707FD1A95E092EE07F092EF070093A7
:106C9000F0071093F1078091F5079091F607A09106
:106CA000F707B091F807B7FF04C081509F4FAF4F6F
:106CB000BF4F892F9A2FAB2FBB27A7FDBA958D8782
:106CC0009E87AF87B88B8093F5079093F607A093C4
:106CD000F707B093F80780919007A82EBB24CC2427
:106CE000DD242091790430917A0440917B04509105
:106CF0007C04C601B5010E94544A97FF04C061504C
:106D00007F4F8F4F9F4F672E782E892E992487FCB7
:106D10009A946092790470927A0480927B049092A3
:106D20007C04209175043091760440917704509151
:106D30007804C601B5010E94544A97FF04C061500F
:106D40007F4F8F4F9F4F272E382E492E552447FCBB
:106D50005A942092750430927604409277045092AF
:106D600078048091710490917204A0917304B091A1
:106D70007404B7FF04C081509F4FAF4FBF4F892F9E
:106D80009A2FAB2FBB27A7FDBA95809371049093E0
:106D90007204A0937304B0937404D801C7018619D8
:106DA0009709A809B9098093BF049093C004A093E0
:106DB000C104B093C2042091A907E22EFF2400274A
:106DC0001127BC01CD01A80197010E94C84A5901B1
:106DD0006A012093D0043093D1044093D20450939D
:106DE000D3048D859E85AF85B88982199309A4093E
:106DF000B5098093C3049093C404A093C504B093D1
:106E0000C604BC01CD01A80197010E94C84A209385
:106E1000D4043093D5044093D6045093D704D601BC
:106E2000C501D7FE04C081509F4FAF4FBF4F892F80
:106E30009A2FAB2FBB27A7FDBA9590932D04809373
:106E40002C0457FF04C021503F4F4F4F5F4FBB27CB
:106E500057FDBA95A52F942F832F90932F048093DD
:106E60002E04809114049091150481349105DCF472
:106E7000809112049091130481349105A4F48091BF
:106E80007F07E82FFF27EE0FFF1FE25BF84F80819F
:106E900091810190F081E02DF7FF03C0F095E1951D
:106EA000FF4F7A97E4F0809182088F3FC1F4809180
:106EB0002C0490912D0497FD0196959587959093BC
:106EC0002D0480932C0480912E0490912F0497FD23
:106ED00001969595879590932F0480932E04809129
:106EE000E6079091E707A091E807B091E907B7FF9F
:106EF00004C081509F4FAF4FBF4F892F9A2FAB2FA8
:106F0000BB27A7FDBA958093E6079093E707A09368
:106F1000E807B093E9078091DB079091DC07A09127
:106F2000DD07B091DE07B7FF04C081509F4FAF4F20
:106F3000BF4F892F9A2FAB2FBB27A7FDBA95809300
:106F4000DB079093DC07A093DD07B093DE07809109
:106F5000890490918A04A0918B04B0918C04AC8038
:106F6000BD80CE80DF80A81AB90ACA0ADB0AA092C7
:106F7000B704B092B804C092B904D092BA04809118
:106F8000810490918204A0918304B09184042885A7
:106F900039854A855B85281B390B4A0B5B0B20938F
:106FA000BB043093BC044093BD045093BE04A09234
:106FB000BF04B092C004C092C104D092C204209316
:106FC000C3043093C4044093C5045093C604809115
:106FD000650490916604A0916704B09168048A19D1
:106FE0009B09AC09BD098093650490936604A09346
:106FF0006704B093680480915D0490915E04A09151
:107000005F04B0916004821B930BA40BB50B8093BB
:107010005D0490935E04A0935F04B093600420919C
:107020004604309147042138310594F080919D0445
:1070300090919E04019690939E0480939D0480916C
:10704000F9079091FA0701969093FA078093F90750
:1070500020583F4F94F480919D0490919E04019795
:1070600090939E0480939D048091F9079091FA0774
:1070700001979093FA078093F907E090F507F09055
:10708000F6070091F7071091F807C801B7012AE148
:1070900030E040E050E00E94C84A30931F07209340
:1070A0001E07109247041092460481E090E09093EE
:1070B000DD048093DC048091E2049091E304A091CC
:1070C000E404B091E5042091EE073091EF07409180
:1070D000F0075091F107821B930BA40BB50B815E57
:1070E000914BAF4FBF4F8F539C49A040B04028F009
:1070F0008091830881330CF4FEC081E0A81680E102
:10710000B80680E0C80680E0D8060CF46CC0809118
:10711000DE04882309F463C0D601C501D7FE07C089
:1071200088279927DC018A199B09AC09BD09B7FF9B
:1071300004C08150904FAF4FBF4F3CE0B595A7952D
:10714000979587953A95D1F701969093DD048093B2
:10715000DC04D601C501D7FE03C00796A11DB11DF1
:1071600023E0B595A795979587952A95D1F78093B4
:10717000D0049093D104A093D204B093D30489583F
:107180009341A040B04064F088E893E1A0E0B0E013
:107190008093D0049093D104A093D204B093D304ED
:1071A0002091D0043091D1044091D2045091D30465
:1071B00057FF04C021503F4F4F4F5F4F232F342FB5
:1071C000452F552747FD5A9580912C0490912D0409
:1071D000820F931F90932D0480932C0406C081E0AE
:1071E0008093DE0402C01092DE04A090BF04B09031
:1071F000C004C090C104D090C204F0E0AF16F0EF1C
:10720000BF06FFEFCF06FFEFDF060CF071C08091E5
:10721000DF04882309F468C0A6019501D7FE07C0E2
:1072200022273327A9012A193B094C095D0957FF79
:1072300004C02150304F4F4F5F4FECE055954795BC
:1072400037952795EA95D1F78091DC049091DD047C
:10725000820F931F9093DD048093DC04D601C50157
:10726000D7FE03C00796A11DB11D73E0B595A79584
:10727000979587957A95D1F78093D0049093D10410
:10728000A093D204B093D30488579C4EAF4FBF4F06
:1072900064F488E79CEEAFEFBFEF8093D004909347
:1072A000D104A093D204B093D3042091D0043091A0
:1072B000D1044091D2045091D30457FF04C021500F
:1072C0003F4F4F4F5F4F232F342F452F552747FDFB
:1072D0005A9580912C0490912D04820F931F9093C6
:1072E0002D0480932C0411C081E08093DF040DC035
:1072F0001092DF040AC01092DD041092DC0488EEC4
:1073000093E09093930380939203D090AA072D2D3E
:1073100033278091DC049091DD042817390724F489
:107320003093DD042093DC048091DC049091DD0433
:1073300044E0880F991F4A95E1F7E09183082E2FCA
:10734000332727FD30952817390774F48E2FE7FD72
:10735000815F8595859585958595992787FD90957C
:107360009093DD048093DC044091BF045091C004ED
:107370006091C1047091C204413034E0530730E0A1
:10738000630730E0730774F08091A1049091A20428
:107390002091DC043091DD04820F931F9093A204AE
:1073A0008093A10440505C4F6F4F7F4F74F48091E5
:1073B000A1049091A2042091DC043091DD04821B91
:1073C000930B9093A2048093A10481E090E09093AA
:1073D000DD048093DC041092D4041092D504109242
:1073E000D6041092D7048091E6049091E704A0910E
:1073F000E804B091E9048E199F09A00BB10B815EDE
:10740000914BAF4FBF4F8F539C49A040B04018F0F5
:10741000E1330CF400C1E090C304F090C404009187
:10742000C5041091C60421E0E21620E1F20620E036
:10743000020720E012070CF46CC08091E00488235E
:1074400009F463C0D801C70117FF07C0882799272F
:10745000DC018E199F09A00BB10BB7FF04C081504E
:10746000904FAF4FBF4F3CE0B595A7959795879547
:107470003A95D1F701969093DD048093DC04D8010E
:10748000C70117FF03C00796A11DB11D23E0B595E5
:10749000A795979587952A95D1F78093D4049093D3
:1074A000D504A093D604B093D70489589341A04043
:1074B000B04064F088E893E1A0E0B0E08093D404A9
:1074C0009093D504A093D604B093D7042091D4040C
:1074D0003091D5044091D6045091D70457FF04C091
:1074E00021503F4F4F4F5F4F232F342F452F5527AC
:1074F00047FD5A9580912E0490912F04820F931F7F
:1075000090932F0480932E0406C081E08093E004C2
:1075100002C01092E00440E0E41640EFF4064FEFA2
:1075200004074FEF14070CF073C08091E104882327
:1075300009F46AC0D801C70117FF07C08827992737
:10754000DC018E199F09A00BB10B9C01AD01B7FFA7
:1075500004C02150304F4F4F5F4F8CE055954795F9
:10756000379527958A95D1F78091DC049091DD04B9
:10757000820F931F9093DD048093DC04D801C70130
:1075800017FF03C00796A11DB11D13E0B595A79580
:10759000979587951A95D1F78093D4049093D50445
:1075A000A093D604B093D70488579C4EAF4FBF4FDB
:1075B00064F488E79CEEAFEFBFEF8093D404909320
:1075C000D504A093D604B093D7042091D40430916D
:1075D000D5044091D6045091D70457FF04C02150E0
:1075E0003F4F4F4F5F4F232F342F452F552747FDD8
:1075F0005A9580912E0490912F04820F931F90939F
:107600002F0480932E0411C081E08093E1040DC00B
:107610001092E1040AC01092DD041092DC0488EE9E
:1076200093E090939303809392032D2D33278091C1
:10763000DC049091DD042817390724F43093DD042D
:107640002093DC048091DC049091DD04F4E0880F49
:10765000991FFA95E1F740918308242F332727FDDE
:107660003095281739077CF4242F47FD215F259595
:10767000259525952595822F992787FD909590939F
:10768000DD048093DC044091C3045091C4046091F4
:10769000C5047091C604413084E0580780E0680753
:1076A00080E0780774F080919F049091A00420916D
:1076B000DC043091DD04820F931F9093A00480932B
:1076C0009F0440505C4F6F4F7F4FCCF480919F04DC
:1076D0009091A0042091DC043091DD04821B930B77
:1076E0009093A00480939F040AC010922F041092DC
:1076F0002E0410922D0410922C04109248048091B4
:10770000FB079091FC07A091FD07B091FE0720E0D8
:1077100030E040E050E0BC01CD010E949C4988234C
:1077200041F410922F0410922E0410922D04109206
:107730002C048091EE079091EF07A091F007B09193
:10774000F1078093E2049093E304A093E404B093E0
:10775000E5048091F5079091F607A091F707B091A5
:10776000F8078093E6049093E704A093E804B093AD
:10777000E9041092790410927A0410927B0410921A
:107780007C04109275041092760410927704109283
:107790007804109271041092720410927304109283
:1077A00074041092EE071092EF071092F0071092F7
:1077B000F1071092F5071092F6071092F707109252
:1077C000F8071092E6071092E7071092E807109268
:1077D000E9071092DB071092DC071092DD07109288
:1077E000DE071092E5031092E403E0903704F09076
:1077F0003804C701F7FE04C0882799278E199F090E
:1078000040976CF088EE93E09093930380939203FB
:107810008091840784FD03C081E08093CF041091A0
:107820008D07A12EBB24CC24DD24B701882777FD4A
:107830008095982F9701F7FE04C0222733272E1931
:107840003F09442737FD4095542F0E94544A9B011D
:10785000AC01C601B5010E94544A97FF04C06150B3
:107860007E4F8F4F9F4FE9E0959587957795679568
:10787000EA95D1F79B01812F99278E9DD0018F9D8D
:10788000B00D9E9DB00D1124CD01B7FD03969595C9
:10789000879595958795280F391F442737FD409583
:1078A000542F2093B3043093B4044093B504509301
:1078B000B6048091590490915A04A0915B04B09150
:1078C0005C04821B930BA40BB50B8093590490931B
:1078D0005A04A0935B04B0935C048155934CA04080
:1078E000B04064F080E593ECA0E0B0E080935904F0
:1078F00090935A04A0935B04B0935C048091590464
:1079000090915A04A0915B04B0915C04805B9C430D
:10791000AF4FBF4F64F480EB9CE3AFEFBFEF8093BA
:10792000590490935A04A0935B04B0935C04809133
:107930004F0490915004892B09F48DC180918407E4
:1079400083FF89C18091890490918A04A0918B045E
:10795000B0918C04B7FF04C081509E4FAF4FBF4F12
:1079600059E0B595A795979587955A95D1F76C01EC
:1079700097FF04C0D094C194D108D394809181041E
:1079800090918204A0918304B0918404B7FF04C055
:1079900081509E4FAF4FBF4F49E0B595A795979542
:1079A00087954A95D1F7BC0197FF03C07095619503
:1079B0007F4FC616D7060CF46B01B601D7FE02C086
:1079C000695F7F4F5B0133E0B594A7943A95E1F787
:1079D0000894A11CB11C80914F0490915004845EC6
:1079E0009D4F7C010027F7FC0095102F8091150812
:1079F00090911608A0911708B0911808BC01CD010C
:107A00002BE035E040E050E00E94C84AE21AF30A59
:107A1000040B150BC801B70128E631E040E050E047
:107A20000E94C84ADC01CB018C01045B1040F0903D
:107A3000CF04FF20E1F000E010E080914F0490912E
:107A40005004AA2797FDA095BA2FBC01CD012BE0C9
:107A500035E040E050E00E94544ADC01CB018093C5
:107A6000150890931608A0931708B09318088090F3
:107A70009203909093038114910461F529E1C21659
:107A8000D10444F58091460490914704800F911FE2
:107A90009093470480934604FF20E1F088EC90E047
:107AA0009093D8038093D70380911508909116087E
:107AB000A0911708B0911808BC01CD012BE035E06A
:107AC00040E050E00E94C84A30934E0420934D0499
:107AD0001092CF04C80123E0880F991F2A95E1F77F
:107AE000B5010E94934ACB01AA2797FDA095BA2F12
:107AF00020911508309116084091170850911808E8
:107B0000280F391F4A1F5B1F209315083093160852
:107B1000409317085093180810918103612F77271D
:107B2000C69EC001C79E900DD69E900D112497FD54
:107B30004F966C0185E0D594C7948A95E1F76C194E
:107B40007D096B0177FD81C08114910409F075C036
:107B5000E0901404F09015048091120490911304A5
:107B6000E80EF91EF7FE04C087E090E0E80EF91E6B
:107B700003E0F594E7940A95E1F7A0E4B0E0EA0E9B
:107B8000FB1ECA01B9012BE035E040E050E00E9445
:107B9000C84ADA01C90120914D0430914E044427AE
:107BA00037FD4095542F821B930BA40BB50B845EBD
:107BB0009D4FAF4FBF4FBC01CD0128E631E040E003
:107BC00050E00E94C84ADC01CB01845B90408C9D50
:107BD000F0018D9DF00D9C9DF00D1124CF01B7019A
:107BE0000E94934A83E0189F60011124C616D706AD
:107BF00014F4B60108C0882799278C199D096817C5
:107C000079070CF4BC019B01442737FD4095542FA4
:107C10008091590490915A04A0915B04B0915C0446
:107C2000820F931FA41FB51F8093590490935A0489
:107C3000A0935B04B0935C040EC008948108910883
:107C4000909293038092920306C084EF91E0909308
:107C50009303809392038091CE0481508093CE044D
:107C60008F3F09F0D2C088E18093CE0480919007C5
:107C7000E82EFF24002711278091890490918A041F
:107C8000A0918B04B0918C04BC01CD01A801970197
:107C90000E94C84A3093F3062093F2068091810433
:107CA00090918204A0918304B0918404BC01CD0121
:107CB000A80197010E94C84A3093F5062093F40664
:107CC00080910608909107089093F7068093F60636
:107CD0008091190890911A089093F9068093F806FC
:107CE00080910B0890910C089093FB068093FA0604
:107CF00080913204909133049093FD068093FC06AA
:107D00008091510490915204A0915304B091540475
:107D1000B7FF04C081509E4FAF4FBF4F19E0B595DC
:107D2000A795979587951A95D1F79093FF0680931D
:107D3000FE0680914F049091500490930307809326
:107D4000020780911A0390911B039093050780937B
:107D500004078091150890911608A0911708B0911A
:107D60001808BC01CD012BE035E040E050E00E9456
:107D7000C84A309309072093080780913D0499274A
:107D8000909307078093060780918008909181085F
:107D9000909315078093140780917E0890917F0837
:107DA000909317078093160780914B06992790931D
:107DB0001907809318078091D4039091D50390936D
:107DC0001B0780931A0780918308992787FD909558
:107DD000909329078093280780918208992787FD2F
:107DE000909590932D0780932C078091000590919A
:107DF000010590932F0780932E078091FE049091A8
:107E0000FF04909331078093300780912B04A0905A
:107E10001008B0901108C0901208D0901308882361
:107E2000A9F08091E1079091E207AA2797FDA0951C
:107E3000BA2FBC01CD010E949249DC01CB01A60101
:107E40009501BC01CD010E940C4A3AC08091890481
:107E500090918A04A0918B04B0918C04BC01CD0157
:107E60000E9492497B018C018091FB079091FC0755
:107E7000A091FD07B091FE079C01AD01C801B701BB
:107E80000E940C4A7B018C018091E1079091E207EE
:107E9000AA2797FDA095BA2FBC01CD010E94924957
:107EA000DC01CB01A6019501BC01CD010E940C4A69
:107EB000DC01CB019C01AD01C801B7010E94ED4876
:107EC000DC01CB01BC01CD010E947549DC01CB0175
:107ED0009093E2078093E10780912A04A090100814
:107EE000B0901108C0901208D09013088823A9F010
:107EF0008091D5079091D607AA2797FDA095BA2F14
:107F0000BC01CD010E949249DC01CB01A601950183
:107F1000BC01CD010E940C4A3AC08091810490912D
:107F20008204A0918304B0918404BC01CD010E941D
:107F300092497B018C018091FB079091FC07A091F5
:107F4000FD07B091FE079C01AD01C801B7010E9479
:107F50000C4A7B018C018091D5079091D607AA2706
:107F600097FDA095BA2FBC01CD010E949249DC017A
:107F7000CB01A6019501BC01CD010E940C4ADC0198
:107F8000CB019C01AD01C801B7010E94ED48DC01A5
:107F9000CB01BC01CD010E947549DC01CB0190935E
:107FA000D6078093D50780910B0890910C08AA27DB
:107FB00097FDA095BA2FBC01CD010E9492497B018B
:107FC0008C018091100890911108A0911208B09135
:107FD00013089C01AD01BC01CD010E94ED48DC01FC
:107FE000CB019C01AD01C801B7010E940C4A7B0185
:107FF0008C0180916D0490916E04A0916F04B091FA
:108000007004BC01CD010E949249DC01CB0140907B
:10801000FB075090FC076090FD077090FE07A301DE
:108020009201BC01CD010E940C4ADC01CB0120E091
:1080300030E040E05FE3BC01CD010E940C4ADC016E
:10804000CB019C01AD01C801B7010E94ED48DC01E4
:10805000CB01BC01CD010E947549DC01CB0190939D
:108060000C0880930B088091E1079091E2079093B0
:108070001D0780931C078091D5079091D607909398
:108080001F0780931E078091E1079091E2078150BE
:10809000904434F080E090E49093E2078093E1070D
:1080A0008091E1079091E2078050904C34F480E099
:1080B00090EC9093E2078093E1078091D50790912F
:1080C000D6078150904434F080E090E49093D60736
:1080D0008093D5078091D5079091D6078050904C1A
:1080E00034F480E090EC9093D6078093D50780918C
:1080F0000B0890910C088150904434F080E090E49B
:1081000090930C0880930B0880910B0890910C08B9
:108110008050904C34F480E090EC90930C08809365
:108120000B0889819A81880F991F880F991F9A835C
:10813000898380918407992780FF34C181FF52C0D1
:108140008091C10799279C012071307084FF05C080
:108150008091840381558B3330F0232BE1F580919E
:1081600084038233C0F58091AF0381508093AF03C5
:108170008F3F09F052C08091140390911503895EDE
:10818000934020F09091E8039A500AC08091140324
:10819000909115038436910588F49091E803965FD9
:1081A0009093E80380914107891B87BD8CE291E0A1
:1081B0009093D8038093D7038AEF11C08091320443
:1081C000909133044497909331048093300410923B
:1081D000490481E004C081E08093490488EC8093E5
:1081E000AF031BC0209184038091780390917903A1
:1081F000820F911D209189073327829FF001839F71
:10820000F00D929FF00D1124CF014497909331040B
:108210008093300481E080934904FB81FF2321F0A7
:108220001092310410923004009132041091330402
:108230002091300430913104201731070CF0B2C086
:1082400080914904882309F4ADC0021B130B80916F
:1082500083039927089F7001099FF00C189FF00C69
:108260001124C701F7FC03968C0115950795159508
:10827000079529813A81201B310B89018091E60302
:108280009091E70397FD019695958795081B190B2B
:10829000C0905104D0905204E0905304F0905404E4
:1082A000F7FE08C08FE790E0A0E0B0E0C80ED91E4E
:1082B000EA1EFB1E67E0F594E794D794C7946A958D
:1082C000D1F780918203282F332744275527C701F0
:1082D000B6010E94544A97FF04C0615E7F4F8F4FE2
:1082E0009F4F55E095958795779567955A95D1F766
:1082F00091E0693179071CF068E171E006C0AEEFEA
:10830000683E7A0714F468EE7EEF061B170B809127
:10831000CC049091CD049C0144E0220F331F4A9578
:10832000E1F7281B390B200F311F37FF02C0215FF7
:108330003F4F14E0359527951A95E1F73093CD041A
:108340002093CC0480918507482F5527440F551F53
:10835000440F551F2417350794F4E981FA81E41777
:10836000F50724F05093CD044093CC04E980FA80C3
:10837000E416F50624F4F092CD04E092CC0480914A
:10838000CC049091CD0409811A810817190724F4AF
:108390001093CD040093CC042091CC043091CD04F3
:1083A0003A83298330900A08832D9927880F991FD3
:1083B000880F991F8055904049815A8184179507ED
:1083C00014F49A83898389819A8190930107809319
:1083D00000078091B3049091B404A091B504B091CA
:1083E000B604F2E0880F991FAA1FBB1FFA95D1F7B8
:1083F00080900B0890900C08881A990AA981BA817C
:10840000A13AB1058CF0CD01B7FD01969595879500
:10841000881599050CF44C01909581959F4F88160D
:10842000990694F44C0110C0B1E58B1691041CF030
:1084300070E5872E912CE0EB8E16EFEF9E0624F46C
:1084400060EB862E6FEF962E232D3327220F331FDE
:10845000220F331FC901E980FA808E199F09881500
:1084600099050CF44C0109811A81021B130B80162B
:1084700091060CF448018091E1079091E207209168
:108480003B0430913C04388F2F8B821B930B9093CD
:10849000ED078093EC0720E030E040E050E0C301BE
:1084A000B2010E949C492091AB043091AC044091F0
:1084B000AD045091AE04882309F448C0CA01B90143
:1084C0000E9492495B016C018091890490918A0419
:1084D000A0918B04B0918C04BC01CD010E94924903
:1084E000DC01CB01A3019201BC01CD010E940C4A29
:1084F0007B018C014F89588DCA01AA2797FDA09551
:10850000BA2FBC01CD010E949249DC01CB019C0134
:10851000AD01C801B7010E94EC48DC01CB019C0110
:10852000AD01C601B5010E94ED48DC01CB01BC01E3
:10853000CD010E947549DC01CB018093AB0490937F
:10854000AC04A093AD04B093AE0414C08091EC07CA
:108550009091ED07AA2797FDA095BA2F280F391FF4
:108560004A1F5B1F2093AB043093AC044093AD04CF
:108570005093AE048091AB049091AC04A091AD04F3
:10858000B091AE0481509A4FA040B04064F080E0BA
:108590009AEFA0E0B0E08093AB049093AC04A0937A
:1085A000AD04B093AE048091AB049091AC04A09163
:1085B000AD04B091AE0480509640AF4FBF4F64F40D
:1085C00080E096E0AFEFBFEF8093AB049093AC04F4
:1085D000A093AD04B093AE048091EC079091ED07A9
:1085E000AA2797FDA095BA2FBC01CD010E94924900
:1085F0007B018C018091AB049091AC04A091AD04FF
:10860000B091AE04BC01CD010E949249DC01CB01C6
:10861000209186033091870340918803509189030C
:10862000298B3A8B4B8B5C8B9C01AD0169897A89D4
:108630008B899C890E940C4ADC01CB019C01AD0115
:10864000C801B7010E94ED48DC01CB01BC01CD019E
:108650000E947549DC01CB018C0120907A03622DC8
:10866000772788279927940197FE04C0222733276C
:108670002819390937FF02C02F5F3F4F35952795DD
:1086800049815A81240F351F442737FD4095542FC7
:108690000E94544A97FF04C0615C7F4F8F4F9F4FE9
:1086A00026E095958795779567952A95D1F79B0153
:1086B000601771070CF48B01309521953F4F02171D
:1086C00013070CF4890129813A81200F311F280DED
:1086D000391DC90137FD03969C01359527953595C0
:1086E000279537FF03C020E030E006C0832D99278F
:1086F000821793070CF49C013090E407832D99278F
:10870000281739070CF49C012093D70729813A8157
:10871000201B310B280D391DC90137FD03969C0123
:10872000359527953595279537FF03C020E030E034
:1087300007C080910A089927821793070CF49C01BF
:10874000832D9927281739070CF49C012093E00703
:108750008091D5079091D607A0913904B0913A0441
:10876000B88FAF8B8A1B9B0B9093D4078093D30752
:1087700020E030E040E050E0C301B2010E949C499B
:108780002091AF043091B0044091B1045091B204F3
:10879000882309F448C0CA01B9010E9492495B01CB
:1087A0006C018091810490918204A0918304B09126
:1087B0008404BC01CD010E949249DC01CB01A301DC
:1087C0009201BC01CD010E940C4A7B018C01EF8912
:1087D000F88DCF01AA2797FDA095BA2FBC01CD0136
:1087E0000E949249DC01CB019C01AD01C801B70197
:1087F0000E94EC48DC01CB019C01AD01C601B50132
:108800000E94ED48DC01CB01BC01CD010E947549FD
:10881000DC01CB018093AF049093B004A093B1042A
:10882000B093B20414C08091D3079091D407AA27C3
:1088300097FDA095BA2F280F391F4A1F5B1F209361
:10884000AF043093B0044093B1045093B2048091CC
:10885000AF049091B004A091B104B091B2048150E2
:108860009A4FA040B04064F080E09AEFA0E0B0E002
:108870008093AF049093B004A093B104B093B2047A
:108880008091AF049091B004A091B104B091B20472
:1088900080509640AF4FBF4F64F480E096E0AFEF5A
:1088A000BFEF8093AF049093B004A093B104B09352
:1088B000B2048091D3079091D407AA2797FDA09581
:1088C000BA2FBC01CD010E9492497B018C0180919D
:1088D000AF049091B004A091B104B091B204BC0176
:1088E000CD010E949249DC01CB019C01AD01698957
:1088F0007A898B899C890E940C4ADC01CB019C01FE
:10890000AD01C801B7010E94ED48DC01CB01BC01FB
:10891000CD010E947549DC01CB018C01622D7727C6
:1089200088279927940197FE04C022273327281906
:10893000390937FF02C02F5F3F4F35952795498191
:108940005A81240F351F442737FD4095542F0E942C
:10895000544A97FF04C0615C7F4F8F4F9F4FA6E042
:108960009595879577956795AA95D1F79B0160179F
:1089700071070CF48B01309521953F4F02171307B7
:108980000CF4890129813A81200F311F28193909F6
:10899000C90137FD03969C01359527953595279597
:1089A00037FF03C020E030E007C080910A08992714
:1089B000821793070CF49C01832D992728173907F8
:1089C0000CF49C012093020829813A81201B310B71
:1089D00028193909C90137FD03969C01359527955A
:1089E0003595279537FF03C020E030E007C0809120
:1089F0000A089927821793070CF49C01832D992765
:108A0000281739070CF49C012093FF0768960FB6CE
:108A1000F894DEBF0FBECDBFDF91CF911F910F91B4
:108A2000FF90EF90DF90CF90BF90AF909F908F908E
:108A30007F906F905F904F903F902F90089580911E
:108A4000F6049091F704A091F804B091F904809392
:108A5000EE049093EF04A093F004B093F10480919E
:108A6000F2049091F304A091F404B091F504809382
:108A7000EA049093EB04A093EC04B093ED04089502
:108A800010920105109200051092FF041092FE044E
:108A9000089584B1806A84B93D9A82E58CBD1DBC7D
:108AA000459A81E080931F088AEA8093230883E82F
:108AB000809324088AE0809325081092270810925A
:108AC0002608109229081092280810924508109242
:108AD000460887E48093470887E08093480883E04E
:108AE000809349080895F8948091890490918A04AC
:108AF000A0918B04B0918C04BC01CD012CE630E038
:108B000040E050E00E94C84A30932708209326088E
:108B10008091810490918204A0918304B091840497
:108B2000BC01CD012CE630E040E050E00E94C84A94
:108B300030932908209328088091150890911608F1
:108B4000A0911708B0911808BC01CD012BE035E0C9
:108B500040E050E00E94C84A30932F0820932E082E
:108B6000E0919304F09194048091F2079091F307BF
:108B7000BF010E94934A2CE030E0629FA001639FF6
:108B8000500D729F500D112450932B0840932A08CA
:108B900080910E0890910F08BF010E94934A629F36
:108BA000A001639F500D729F500D112450932D080A
:108BB00040932C0810929404109293041092F3079F
:108BC0001092F20710920F0810920E08809125085B
:108BD00099278217930709F4F2C0281739073CF048
:108BE0008A30910559F00B9709F470C00AC18D3095
:108BF0009105D9F10E9709F4F4C003C180912504C1
:108C00008093360880912404809337088091230450
:108C10008093380880912204809339088091210440
:108C200080933A088091200480933B0880911F0430
:108C300080933C0880911E0480933D0880910F042E
:108C400080933E08837F80930F0480911A03909154
:108C50001B0380933F088091940780934008A2E013
:108C6000B0E00E94E34A802D2EC08091B40780932B
:108C700036088091B507809337088091B6078093B6
:108C800038088091B707809339088091B80780939E
:108C90003A088091B90780933B088091BA07809386
:108CA0003C088091BB0780933D088091BE0780936C
:108CB0003E088091BC0780933F088091BD07809358
:108CC00040088091BF07809341089BC080917E0738
:108CD000E82FFF27EE0FFF1FE25BF84F0190F081B6
:108CE000E02DE038F1051CF0EFE7F0E006C05FEFA3
:108CF000E138F50714F4E1E8FFEFE09336088091DE
:108D00007F07E82FFF27EE0FFF1FE25BF84F019070
:108D1000F081E02DE038F1051CF0EFE7F0E006C04F
:108D20006FEFE138F60714F4E1E8FFEFE09337085E
:108D300080917D07E82FFF27EE0FFF1FE25BF84FC2
:108D40000190F081E02DE038F1051CF0EFE7F0E054
:108D500006C08FEFE138F80714F4E1E8FFEFE09385
:108D6000380880917C07E82FFF27EE0FFF1FE25B9A
:108D7000F84F0190F081E02DE038F1051CF0EFE7AD
:108D8000F0E006C02FEFE138F20714F4E1E8FFEF5E
:108D9000E09339088091440480933A08809142041A
:108DA00080933B088091400480933C0880913E046E
:108DB00080933D0880913D0480933E0822C08091BD
:108DC0004B06863018F010924B0685E080933608EB
:108DD000809132049091330490933908809338083D
:108DE00010C0809146088093360880914708809390
:108DF000370880914808809338088091490880930B
:108E00003908789480914508882309F47BC0409103
:108E10004B0850914C08CA0181509E4F8F5F934080
:108E2000B0F420914D0830914E08C90181509E4FF9
:108E30008F5F934060F48091840785FF08C0509352
:108E40000105409300053093FF042093FE048091B8
:108E500051089091520821E08936920724F49093AA
:108E6000500480934F0480914F04909150042091BE
:108E70004D0430914E04821B930B845E9D4F68E637
:108E800071E00E94934A845B904090934C048093DD
:108E90004B0420915508309156088091D70390914A
:108EA000D8038217930740F480914B06882321F45E
:108EB0003093D8032093D70380914A0899278436AA
:108EC000910581F08736910529F5809157088093A7
:108ED0008208809158088093840880915908809373
:108EE0008308089580915708992790937F0880936D
:108EF0007E088091590890915A0890938108809338
:108F00008008089510920105109200051092FF0448
:108F10001092FE04089580911F08882309F43BC035
:108F2000459883E298E090932108809320089091DF
:108F30000205E92FFF27E055FC4F9F5F9093020544
:108F4000808180932508963010F0109202051092CF
:108F50001F080E94734581E08093220800000000F2
:108F60000000000000000000000000000000000001
:108F700000000000000000000000000000000000F1
:108F800000000000000000000000000080912308A5
:108F9000809342088EBD089530911F08332309F055
:108FA00085C00DB407FE82C084E08093D603459A45
:108FB0002EB58091040599278130910589F0823082
:108FC00091051CF4892B21F03EC00297B9F03BC0FB
:108FD00030934408209305052138A9F581E008C0A5
:108FE000253549F480910505820F8093050582E0BF
:108FF0008093040528C03093040525C0809144085F
:10900000E82FFF27EC59F74F20838F5F80934408A8
:10901000909105058A31A0F0291769F4AAE4B8E017
:10902000E4E6F8E08AE101900D928150E1F781E0F9
:109030008093450802C0309345081092040503C090
:10904000920F9093050520912208203208F028C045
:109050004598000000000000000000000000000033
:109060000000000000000000000000000000000000
:1090700000000000000000000000000000000000F0
:109080000000E0912008F0912108E20FF11D80819D
:109090008EBD809142089081890F8093420803C061
:1090A00081E080931F082F5F20932208089587B1E5
:1090B0008C6087B9429843981092070580E88093A6
:1090C000B703109206058093B603089580910C05AE
:1090D000815080930C058F3F09F070C084E080932D
:1090E0000C059091B1079B3F48F08091F407873EB3
:1090F00028F08091B00788233CF128C09B3F48F0BE
:109100008091F4078A3028F48091B0078823F4F026
:109110001BC0809107058150809307058F3FB9F4EC
:109120008091F4078150809307058091B7038130C7
:1091300011F480E801C086958093B7038091B7034E
:109140009091B007892311F0429A01C04298909102
:10915000B3079B3F48F080910908873E28F0809133
:10916000B207882344F10AC09B3F50F08091090860
:109170008A3030F48091B20787FF1DC0439808956C
:10918000809106058150809306058F3FB9F4809148
:1091900009088150809306058091B603813011F44F
:1091A00080E801C086958093B6038091B6039091C4
:1091B000B207892311F0439A089543980895FC015A
:1091C0004150504030F001900616D1F73197CF0151
:1091D00008958827992708955058192EEFD001D067
:1091E000D2C0BA176207730784079507B1F188F4F4
:1091F0000EF410940B2EBA2FA02D062E622F202DC8
:10920000072E732F302D082E842F402D092E952FD9
:10921000502DFF275523B9F0591B49F0573E98F0C0
:10922000469537952795A795F0405395C9F776F061
:10923000BA0F621F731F841F30F487957795679567
:10924000B795F040939517FA0F2E0895BF1BBB27D3
:10925000BA0B620B730B840BF6CFDEF6DBC0AED01D
:1092600001D091C0552359F0992369F09F575F575A
:10927000951B33F442F4903811F4915805C09BC00B
:1092800091589F3F09F4C6C0BB271124621773078A
:10929000840730F4660F771F881FBB1F915098F327
:1092A00011D00F920FD00F920DD0A0E826173707DC
:1092B00048071B0609F0A048BA2F602D7F918F91B7
:1092C00000240895A0E80024621773078407B105FD
:1092D00028F0621B730B840BB1090A2A660F771FF3
:1092E000881FBB1FA69581F7089597FB73D09F3702
:1092F00038F0FEE9F91B982F872F762F6B2F05C0CA
:1093000086C09695879577956795F150D0F73EF48E
:1093100090958095709561957F4F8F4F9F4F0895E1
:10932000E89403C097FB0EF4F3DFB62F672F782F76
:10933000892F9EE9002427C00ED05EF004C00BD018
:1093400026F001C008D019F020F48FEF089580E0D6
:10935000089581E0089597FB092E052600F868948A
:1093600030D0E89407FC07C062177307840795079D
:1093700021F008F400940794989408959A95BB0FEF
:10938000661F771F881F11249923A1F08823B2F745
:109390009F3F59F0BB0F48F421F4002011F460FF07
:1093A00004C06F5F7F4F8F4F9F4F881F97958795A2
:1093B00097F908952CC09FEF80EC0895052E09269B
:1093C00007FA440F551F5F3F79F0AA27A51708F049
:1093D00051E04795880F991F9F3F31F0BB27B91780
:1093E00008F091E0879508959F919F911124E3CF14
:1093F00097FB880F991F9F3F31F0BB27B91708F0E3
:1094000091E0879508959F919F911124D4CF66276D
:109410007727882799270895D1DF01D0B4CF9923E2
:1094200039F0552329F09F575F57950F13F49AF1A0
:10943000F1CF91589F3FE1F3629FA12D0F92BB277F
:10944000639FA00DB11DEE27729FA00DB11DEE1FF1
:10945000AF93AA27649FB00DE11D739FB00DE11D6E
:10946000AA1F6627829FB00DE11DA61F5527749F76
:10947000E00DA11D551F839FE00DA11D561F849F68
:10948000A00D511D852F7A2F6E2F1F900F908823CE
:109490001AF4939539F48FCF000C111CBB1F661F73
:1094A000771F881F01280895629FD001739FF001E4
:1094B000829FE00DF11D649FE00DF11D929FF00D64
:1094C000839FF00D749FF00D659FF00D9927729F9B
:1094D000B00DE11DF91F639FB00DE11DF91FBD0126
:1094E000CF0111240895991B79E004C0991F9617A4
:1094F00008F0961B881F7A95C9F780950895AA1BD6
:10950000BB1B51E107C0AA1FBB1FA617B70710F06E
:10951000A61BB70B881F991F5A95A9F780959095A0
:10952000BC01CD01089597FB092E07260AD077FDCF
:1095300004D0E5DF06D000201AF4709561957F4FC6
:109540000895F6F7909581959F4F0895A1E21A2E00
:10955000AA1BBB1BFD010DC0AA1FBB1FEE1FFF1FD7
:10956000A217B307E407F50720F0A21BB30BE40B27
:10957000F50B661F771F881F991F1A9469F760956E
:109580007095809590959B01AC01BD01CF01089528
:1095900097FB092E05260ED057FD04D0D7DF0AD041
:1095A000001C38F450954095309521953F4F4F4F12
:1095B0005F4F0895F6F790958095709561957F4F70
:1095C0008F4F9F4F0895F999FECFB2BDA1BDF89A74
:1095D000119600B40895F999FECFB2BDA1BD00BCAB
:0E95E00011960FB6F894FA9AF99A0FBE0895F4
:1095EE00010A01496E74656772616C4E69636B2086
:1095FE00202020496E74656772616C526F6C6C200E
:10960E002020204163634E69636B202020202020A0
:10961E00202020416363526F6C6C2020202020207C
:10962E002020204779726F47696572202020202004
:10963E00202020486F6568656E5765727420202063
:10964E002020204163635A2020202020202020202B
:10965E002020204761732020202020202020202041
:10966E002020204B6F6D7061737356616C75652091
:10967E002020205370616E6E756E67202020202092
:10968E00202020456D7066616E67202020202020EE
:10969E0020202045727361747A6B6F6D70617373E5
:1096AE002020204D6F746F725F566F726E65202092
:1096BE002020204D6F746F725F48696E74656E2046
:1096CE002020204D6F746F725F4C696E6B7320207B
:1096DE002020204D6F746F725F5265636874732023
:1096EE00202020202020202020202020202020206C
:1096FE0020202044697374616E6365202020202031
:10970E002020204F736442617220202020202020D0
:10971E002020204D4B334D61672043616C537461A3
:10972E00746520536572766F202020202020202023
:10973E002020204E69636B20202020202020202016
:10974E00202020526F6C6C202020202020202020F2
:10975E0020202020202020202020202020202020FB
:10976E0020202020202020202020202020202020EB
:10977E0020202020202020202020202020202020DB
:10978E0020202020202020202020202020202020CB
:10979E002020204B616C6D616E5F4D617844726963
:1097AE006674202020202020202020202020202011
:1097BE002020204B616C6D616E204B2020202020DC
:1097CE002020204750535F4E69636B2020202020BD
:1097DE002020204750535F526F6C6C202020202099
:1097EE00202020C8000164FF01FFFF2800018064D3
:1097FE0000737373FF03007D000064000B48616CFF
:10980E006C6F2057656C74000000000000000000B3
:10981E00000000000000000000000000000000003A
:10982E00000000000000000000000000000000002A
:10983E00000000000000000000000000000000001A
:10984E000000000000000000000000000001020304
:10985E000405060708090A01ECFF6446640A02962D
:10986E0096403A10FB3017B7D13890D0030090D005
:10987E000300F401640053706F727400004E6F7237
:10988E006D616C0000426567696E6E657200006402
:08989E000A0B0D0B0C0E010179
:00000001FF
/branches/V0.71h KiliPet/Hex-Files/WasIstWas.txt
0,0 → 1,15
+++++++++++++++++++++++++
+ Flight-Ctrl:
+++++++++++++++++++++++++
BootLoader_MEGA644_20MHZ_V0_1.hex
Der Bootloader wird per ISP eingespielt
Der Bootloader nur dann eingespielt werden, wenn noch nie ein Bootloader eingespielt wurde!
Danach können Softwareupdates seriell eingespielt werden.
 
Flight-Ctrl_MEGA644_Vx_yy.hex
Aktuelle Firmware
Wird per serielle Schnittstelle (durch den Bootloader) eingespielt
 
Flight-Ctrl SW > 0.62 benötigt das Kopter-Tool >1.47
/branches/V0.71h KiliPet/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/V0.71h KiliPet/Settings.h
--- V0.71h KiliPet/_Settings.h (nonexistent)
+++ V0.71h KiliPet/_Settings.h (revision 1106)
@@ -0,0 +1,44 @@
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Abstimmung
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+#define ACC_AMPLIFY 12
+#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/V0.71h KiliPet/analog.c
0,0 → 1,185
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + 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 AdWertNick = 0, AdWertRoll = 0, AdWertGier = 0;
volatile int AdWertAccRoll = 0,AdWertAccNick = 0,AdWertAccHoch = 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;
signed char ExpandBaro = 0;
volatile int HoeheD = 0;
volatile char messanzahl_Druck;
volatile int tmpLuftdruck;
volatile unsigned int ZaehlMessungen = 0;
unsigned char AnalogOffsetNick = 115,AnalogOffsetRoll = 115,AnalogOffsetGier = 115;
unsigned char GyroDefektN = 0,GyroDefektR = 0,GyroDefektG = 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;
ExpandBaro = 0;
Delay_ms_Mess(100);
if(MessLuftdruck < 850) off = 0;
for(; off < 250;off++)
{
OCR0A = off;
Delay_ms_Mess(50);
printf(".");
if(MessLuftdruck < 850) break;
}
eeprom_write_byte(&EEPromArray[EEPROM_ADR_LAST_OFFSET], off);
DruckOffsetSetting = off;
Delay_ms_Mess(300);
}
 
void SucheGyroOffset(void)
{
unsigned char i, ready = 0;
GyroDefektN = 0; GyroDefektR = 0; GyroDefektG = 0;
for(i=140; i != 0; i--)
{
if(ready == 3 && i > 10) i = 9;
ready = 0;
if(AdWertNick < 1020) AnalogOffsetNick--; else if(AdWertNick > 1030) AnalogOffsetNick++; else ready++;
if(AdWertRoll < 1020) AnalogOffsetRoll--; else if(AdWertRoll > 1030) AnalogOffsetRoll++; else ready++;
if(AdWertGier < 1020) AnalogOffsetGier--; else if(AdWertGier > 1030) AnalogOffsetGier++; else ready++;
twi_state = 8;
i2c_start();
if(AnalogOffsetNick < 10) { GyroDefektN = 1; AnalogOffsetNick = 10;}; if(AnalogOffsetNick > 245) { GyroDefektN = 1; AnalogOffsetNick = 245;};
if(AnalogOffsetRoll < 10) { GyroDefektR = 1; AnalogOffsetRoll = 10;}; if(AnalogOffsetRoll > 245) { GyroDefektR = 1; AnalogOffsetRoll = 245;};
if(AnalogOffsetGier < 10) { GyroDefektG = 1; AnalogOffsetGier = 10;}; if(AnalogOffsetGier > 245) { GyroDefektG = 1; AnalogOffsetGier = 245;};
while(twi_state);
messanzahl_Druck = 0;
ANALOG_ON;
while(messanzahl_Druck == 0);
if(i<10) Delay_ms_Mess(10);
}
Delay_ms_Mess(70);
}
 
 
//#######################################################################################
//
SIGNAL(SIG_ADC)
//#######################################################################################
{
static unsigned char kanal=0,state = 0;
static unsigned int gier1, roll1, nick1;
ANALOG_OFF;
switch(state++)
{
case 0:
gier1 = ADC;
kanal = 1;
ZaehlMessungen++;
break;
case 1:
roll1 = ADC;
kanal = 2;
break;
case 2:
nick1 = ADC;
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;
AdWertAccRoll = Aktuell_ay;
kanal = 7;
break;
case 5:
Aktuell_ax = ADC - NeutralAccX;
AdWertAccNick = Aktuell_ax;
kanal = 0;
break;
case 6:
if(PlatinenVersion == 10) AdWertGier = (ADC + gier1) / 2;
else
if(PlatinenVersion == 20) AdWertGier = 1023 - (ADC + gier1);
else AdWertGier = ADC + gier1;
kanal = 1;
break;
case 7:
if(PlatinenVersion == 10) AdWertRoll = (ADC + roll1) / 2;
else AdWertRoll = ADC + roll1;
kanal = 2;
break;
case 8:
if(PlatinenVersion == 10) AdWertNick = (ADC + nick1) / 2;
else AdWertNick = ADC + nick1;
//AdWertNick = 0;
//AdWertNick += Poti2;
kanal = 5;
break;
case 9:
AdWertAccHoch = (signed int) ADC - NeutralAccZ;
// AdWertAccHoch += abs(Aktuell_ay) / 4 + abs(Aktuell_ax) / 4;
if(AdWertAccHoch > 1)
{
if(NeutralAccZ < 750)
{
NeutralAccZ += 0.02;
if(modell_fliegt < 500) NeutralAccZ += 0.1;
}
}
else if(AdWertAccHoch < -1)
{
if(NeutralAccZ > 550)
{
NeutralAccZ-= 0.02;
if(modell_fliegt < 500) NeutralAccZ -= 0.1;
}
}
messanzahl_AccHoch = 1;
Aktuell_az = ADC;
Mess_Integral_Hoch += AdWertAccHoch; // Integrieren
Mess_Integral_Hoch -= Mess_Integral_Hoch / 1024; // dämfen
kanal = 3;
break;
case 10:
tmpLuftdruck += ADC;
if(++messanzahl_Druck >= 5)
{
MessLuftdruck = ADC;
messanzahl_Druck = 0;
HoeheD = (7 * HoeheD + (int) Parameter_Luftdruck_D * (int)(255 * ExpandBaro + StartLuftdruck - tmpLuftdruck - HoehenWert))/8; // D-Anteil = neuerWert - AlterWert
Luftdruck = (tmpLuftdruck + 3 * Luftdruck) / 4;
HoehenWert = 255 * ExpandBaro + StartLuftdruck - Luftdruck;
tmpLuftdruck = 0;
}
kanal = 0;
state = 0;
break;
default:
kanal = 0;
state = 0;
break;
}
ADMUX = kanal;
if(state != 0) ANALOG_ON;
}
/branches/V0.71h KiliPet/analog.h
0,0 → 1,27
/*#######################################################################################
 
#######################################################################################*/
 
extern volatile int UBat;
extern volatile int AdWertNick, AdWertRoll, AdWertGier;
extern volatile int AdWertAccRoll,AdWertAccNick,AdWertAccHoch;
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 signed char ExpandBaro;
extern volatile int HoeheD;
extern volatile unsigned int MessLuftdruck;
extern volatile int StartLuftdruck;
extern volatile char MessanzahlNick;
extern unsigned char AnalogOffsetNick,AnalogOffsetRoll,AnalogOffsetGier;
 
unsigned int ReadADC(unsigned char adc_input);
void ADC_Init(void);
void SucheLuftruckOffset(void);
void SucheGyroOffset(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/V0.71h KiliPet/eeprom.c
0,0 → 1,218
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Konstanten
// + 0-250 -> normale Werte
// + 251 -> Poti1
// + 252 -> Poti2
// + 253 -> Poti3
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
void DefaultStickMapping(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;
}
 
void DefaultKonstanten1(void)
{
EE_Parameter.GlobalConfig = CFG_ACHSENKOPPLUNG_AKTIV | CFG_KOMPASS_AKTIV | CFG_GPS_AKTIV;//CFG_HOEHEN_SCHALTER
EE_Parameter.Hoehe_MinGas = 30;
EE_Parameter.MaxHoehe = 251; // Wert : 0-250 251 -> Poti1
EE_Parameter.Hoehe_P = 10; // Wert : 0-32
EE_Parameter.Luftdruck_D = 30; // Wert : 0-250
EE_Parameter.Hoehe_ACC_Wirkung = 30; // Wert : 0-250
EE_Parameter.Hoehe_Verstaerkung = 4; // Wert : 0-50
EE_Parameter.Stick_P = 15; // Wert : 1-6
EE_Parameter.Stick_D = 30; // Wert : 0-64
EE_Parameter.Gier_P = 12; // Wert : 1-20
EE_Parameter.Gas_Min = 8; // Wert : 0-32
EE_Parameter.Gas_Max = 230; // Wert : 33-250
EE_Parameter.GyroAccFaktor = 30; // Wert : 1-64
EE_Parameter.KompassWirkung = 128; // Wert : 0-250
EE_Parameter.Gyro_P = 80; // Wert : 0-250
EE_Parameter.Gyro_I = 150; // Wert : 0-250
EE_Parameter.UnterspannungsWarnung = 94; // Wert : 0-250
EE_Parameter.NotGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust
EE_Parameter.NotGasZeit = 30; // Wert : 0-250 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen
EE_Parameter.UfoAusrichtung = 0; // X oder + Formation
EE_Parameter.I_Faktor = 32;
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.UserParam5 = 0; // zur freien Verwendung
EE_Parameter.UserParam6 = 0; // zur freien Verwendung
EE_Parameter.UserParam7 = 0; // zur freien Verwendung
EE_Parameter.UserParam8 = 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.LoopHysterese = 50;
EE_Parameter.BitConfig = 0; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt
EE_Parameter.AchsKopplung1 = 90;
EE_Parameter.AchsGegenKopplung1 = 5;
EE_Parameter.WinkelUmschlagNick = 85;
EE_Parameter.WinkelUmschlagRoll = 85;
EE_Parameter.GyroAccAbgleich = 16; // 1/k
EE_Parameter.Driftkomp = 4;
EE_Parameter.DynamicStability = 100;
EE_Parameter.J16Bitmask = 95;
EE_Parameter.J17Bitmask = 243;
EE_Parameter.J16Timing = 15;
EE_Parameter.J17Timing = 15;
EE_Parameter.NaviGpsModeControl = 253;
EE_Parameter.NaviGpsGain = 100;
EE_Parameter.NaviGpsP = 90;
EE_Parameter.NaviGpsI = 90;
EE_Parameter.NaviGpsD = 90;
EE_Parameter.NaviGpsACC = 0;
EE_Parameter.NaviGpsMinSat = 6;
EE_Parameter.NaviStickThreshold = 8;
EE_Parameter.NaviWindCorrection = 90;
EE_Parameter.NaviSpeedCompensation = 30;
EE_Parameter.NaviOperatingRadius = 100;
EE_Parameter.NaviAngleLimitation = 60;
memcpy(EE_Parameter.Name, "Sport\0", 12);
}
void DefaultKonstanten2(void)
{
EE_Parameter.GlobalConfig = CFG_ACHSENKOPPLUNG_AKTIV | CFG_KOMPASS_AKTIV | CFG_GPS_AKTIV;///*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV;//0x01;
EE_Parameter.Hoehe_MinGas = 30;
EE_Parameter.MaxHoehe = 251; // Wert : 0-250 251 -> Poti1
EE_Parameter.Hoehe_P = 10; // Wert : 0-32
EE_Parameter.Luftdruck_D = 30; // Wert : 0-250
EE_Parameter.Hoehe_ACC_Wirkung = 30; // Wert : 0-250
EE_Parameter.Hoehe_Verstaerkung = 3; // Wert : 0-50
EE_Parameter.Stick_P = 12; // Wert : 1-6
EE_Parameter.Stick_D = 16; // Wert : 0-64
EE_Parameter.Gier_P = 6; // Wert : 1-20
EE_Parameter.Gas_Min = 8; // Wert : 0-32
EE_Parameter.Gas_Max = 230; // Wert : 33-250
EE_Parameter.GyroAccFaktor = 30; // Wert : 1-64
EE_Parameter.KompassWirkung = 128; // Wert : 0-250
EE_Parameter.Gyro_P = 80; // Wert : 0-250
EE_Parameter.Gyro_I = 120; // Wert : 0-250
EE_Parameter.UnterspannungsWarnung = 94; // Wert : 0-250
EE_Parameter.NotGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust
EE_Parameter.NotGasZeit = 30; // Wert : 0-250 // Zeit bis auf NotGas geschaltet wird, wg. Rx-Problemen
EE_Parameter.UfoAusrichtung = 0; // X oder + Formation
EE_Parameter.I_Faktor = 32;
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.UserParam5 = 0; // zur freien Verwendung
EE_Parameter.UserParam6 = 0; // zur freien Verwendung
EE_Parameter.UserParam7 = 0; // zur freien Verwendung
EE_Parameter.UserParam8 = 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.LoopHysterese = 50;
EE_Parameter.BitConfig = 0; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts
EE_Parameter.AchsKopplung1 = 90; // Faktor, mit dem Gier die Achsen Roll und Nick verkoppelt
EE_Parameter.AchsGegenKopplung1 = 5;
EE_Parameter.WinkelUmschlagNick = 85;
EE_Parameter.WinkelUmschlagRoll = 85;
EE_Parameter.GyroAccAbgleich = 32; // 1/k
EE_Parameter.Driftkomp = 4;
EE_Parameter.DynamicStability = 75;
EE_Parameter.J16Bitmask = 95;
EE_Parameter.J17Bitmask = 243;
EE_Parameter.J16Timing = 20;
EE_Parameter.J17Timing = 20;
EE_Parameter.NaviGpsModeControl = 253;
EE_Parameter.NaviGpsGain = 100;
EE_Parameter.NaviGpsP = 90;
EE_Parameter.NaviGpsI = 90;
EE_Parameter.NaviGpsD = 90;
EE_Parameter.NaviGpsACC = 0;
EE_Parameter.NaviGpsMinSat = 6;
EE_Parameter.NaviStickThreshold = 8;
EE_Parameter.NaviWindCorrection = 90;
EE_Parameter.NaviSpeedCompensation = 30;
EE_Parameter.NaviOperatingRadius = 100;
EE_Parameter.NaviAngleLimitation = 60;
memcpy(EE_Parameter.Name, "Normal\0", 12);
}
 
void DefaultKonstanten3(void)
{
EE_Parameter.GlobalConfig = CFG_DREHRATEN_BEGRENZER | CFG_ACHSENKOPPLUNG_AKTIV | CFG_KOMPASS_AKTIV | CFG_GPS_AKTIV;///*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV;//0x01;
EE_Parameter.Hoehe_MinGas = 30;
EE_Parameter.MaxHoehe = 251; // Wert : 0-250 251 -> Poti1
EE_Parameter.Hoehe_P = 10; // Wert : 0-32
EE_Parameter.Luftdruck_D = 30; // Wert : 0-250
EE_Parameter.Hoehe_ACC_Wirkung = 30; // Wert : 0-250
EE_Parameter.Hoehe_Verstaerkung = 3; // Wert : 0-50
EE_Parameter.Stick_P = 8; // Wert : 1-6
EE_Parameter.Stick_D = 16; // Wert : 0-64
EE_Parameter.Gier_P = 6; // Wert : 1-20
EE_Parameter.Gas_Min = 8; // Wert : 0-32
EE_Parameter.Gas_Max = 230; // Wert : 33-250
EE_Parameter.GyroAccFaktor = 30; // Wert : 1-64
EE_Parameter.KompassWirkung = 128; // Wert : 0-250
EE_Parameter.Gyro_P = 100; // Wert : 0-250
EE_Parameter.Gyro_I = 120; // Wert : 0-250
EE_Parameter.UnterspannungsWarnung = 94; // 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 = 16;
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.UserParam5 = 0; // zur freien Verwendung
EE_Parameter.UserParam6 = 0; // zur freien Verwendung
EE_Parameter.UserParam7 = 0; // zur freien Verwendung
EE_Parameter.UserParam8 = 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.LoopHysterese = 50;
EE_Parameter.BitConfig = 0; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts
EE_Parameter.AchsKopplung1 = 90; // Faktor, mit dem Gier die Achsen Roll und Nick verkoppelt
EE_Parameter.AchsGegenKopplung1 = 5;
EE_Parameter.WinkelUmschlagNick = 85;
EE_Parameter.WinkelUmschlagRoll = 85;
EE_Parameter.GyroAccAbgleich = 32; // 1/k
EE_Parameter.Driftkomp = 4;
EE_Parameter.DynamicStability = 50;
EE_Parameter.J16Bitmask = 95;
EE_Parameter.J17Bitmask = 243;
EE_Parameter.J16Timing = 30;
EE_Parameter.J17Timing = 30;
EE_Parameter.NaviGpsModeControl = 253;
EE_Parameter.NaviGpsGain = 100;
EE_Parameter.NaviGpsP = 90;
EE_Parameter.NaviGpsI = 90;
EE_Parameter.NaviGpsD = 90;
EE_Parameter.NaviGpsACC = 0;
EE_Parameter.NaviGpsMinSat = 6;
EE_Parameter.NaviStickThreshold = 8;
EE_Parameter.NaviWindCorrection = 90;
EE_Parameter.NaviSpeedCompensation = 30;
EE_Parameter.NaviOperatingRadius = 100;
EE_Parameter.NaviAngleLimitation = 60;
memcpy(EE_Parameter.Name, "Beginner\0", 12);
}
/branches/V0.71h KiliPet/fc.c
0,0 → 1,1331
/*#######################################################################################
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"
#include "eeprom.c"
 
unsigned char h,m,s;
volatile unsigned int I2CTimeout = 100;
volatile int MesswertNick,MesswertRoll,MesswertGier,MesswertGierBias;
int AdNeutralGierBias;
int AdNeutralNick = 0,AdNeutralRoll = 0,AdNeutralGier = 0,StartNeutralRoll = 0,StartNeutralNick = 0;
int Mittelwert_AccNick, Mittelwert_AccRoll,Mittelwert_AccHoch, NeutralAccX=0, NeutralAccY=0;
int NaviAccNick, NaviAccRoll,NaviCntAcc = 0;
volatile float NeutralAccZ = 0;
unsigned char CosinusNickWinkel = 0, CosinusRollWinkel = 0;
long IntegralNick = 0,IntegralNick2 = 0;
long IntegralRoll = 0,IntegralRoll2 = 0;
long IntegralAccNick = 0,IntegralAccRoll = 0,IntegralAccZ = 0;
long Integral_Gier = 0;
long Mess_IntegralNick = 0,Mess_IntegralNick2 = 0;
long Mess_IntegralRoll = 0,Mess_IntegralRoll2 = 0;
long Mess_Integral_Gier = 0,Mess_Integral_Gier2 = 0;
long MittelIntegralNick,MittelIntegralRoll,MittelIntegralNick2,MittelIntegralRoll2;
volatile long Mess_Integral_Hoch = 0;
volatile int KompassValue = 0;
volatile int KompassStartwert = 0;
volatile int KompassRichtung = 0;
unsigned int KompassSignalSchlecht = 500;
unsigned char MAX_GAS,MIN_GAS;
unsigned char Notlandung = 0;
unsigned char HoehenReglerAktiv = 0;
unsigned char TrichterFlug = 0;
long Umschlag180Nick = 250000L, Umschlag180Roll = 250000L;
long ErsatzKompass;
int ErsatzKompassInGrad; // Kompasswert in Grad
int GierGyroFehler = 0;
float GyroFaktor;
float IntegralFaktor;
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;
volatile unsigned char SenderOkay = 0;
int StickNick = 0,StickRoll = 0,StickGier = 0,StickGas = 0;
char MotorenEin = 0;
int HoehenWert = 0;
int SollHoehe = 0;
int LageKorrekturRoll = 0,LageKorrekturNick = 0;
float Ki = FAKTOR_I;
unsigned char Looping_Nick = 0,Looping_Roll = 0;
unsigned char Looping_Links = 0, Looping_Rechts = 0, Looping_Unten = 0, Looping_Oben = 0;
 
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_UserParam5 = 0;
unsigned char Parameter_UserParam6 = 0;
unsigned char Parameter_UserParam7 = 0;
unsigned char Parameter_UserParam8 = 0;
unsigned char Parameter_ServoNickControl = 100;
unsigned char Parameter_LoopGasLimit = 70;
unsigned char Parameter_AchsKopplung1 = 0;
unsigned char Parameter_AchsGegenKopplung1 = 0;
unsigned char Parameter_DynamicStability = 100;
unsigned char Parameter_J16Bitmask; // for the J16 Output
unsigned char Parameter_J16Timing; // for the J16 Output
unsigned char Parameter_J17Bitmask; // for the J17 Output
unsigned char Parameter_J17Timing; // for the J17 Output
unsigned char Parameter_NaviGpsModeControl; // Parameters for the Naviboard
unsigned char Parameter_NaviGpsGain;
unsigned char Parameter_NaviGpsP;
unsigned char Parameter_NaviGpsI;
unsigned char Parameter_NaviGpsD;
unsigned char Parameter_NaviGpsACC;
unsigned char Parameter_NaviOperatingRadius;
unsigned char Parameter_NaviWindCorrection;
unsigned char Parameter_NaviSpeedCompensation;
unsigned char Parameter_ExternalControl;
struct mk_param_struct EE_Parameter;
signed int ExternStickNick = 0,ExternStickRoll = 0,ExternStickGier = 0, ExternHoehenValue = -20;
int MaxStickNick = 0,MaxStickRoll = 0;
unsigned int modell_fliegt = 0;
unsigned char MikroKopterFlags = 0;
 
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)
//############################################################################
{
NeutralAccX = 0;
NeutralAccY = 0;
NeutralAccZ = 0;
AdNeutralNick = 0;
AdNeutralRoll = 0;
AdNeutralGier = 0;
AdNeutralGierBias = 0;
Parameter_AchsKopplung1 = 0;
Parameter_AchsGegenKopplung1 = 0;
ExpandBaro = 0;
CalibrierMittelwert();
Delay_ms_Mess(100);
CalibrierMittelwert();
if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert?
{
if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset();
}
 
AdNeutralNick= AdWertNick;
AdNeutralRoll= AdWertRoll;
AdNeutralGier= AdWertGier;
AdNeutralGierBias = AdWertGier;
StartNeutralRoll = AdNeutralRoll;
StartNeutralNick = AdNeutralNick;
if(eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACC_NICK]) > 4)
{
NeutralAccY = abs(Mittelwert_AccRoll) / ACC_AMPLIFY;
NeutralAccX = abs(Mittelwert_AccNick) / ACC_AMPLIFY;
NeutralAccZ = Aktuell_az;
}
else
{
NeutralAccX = (int)eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACC_NICK]) * 256 + (int)eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACC_NICK+1]);
NeutralAccY = (int)eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACC_ROLL]) * 256 + (int)eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACC_ROLL+1]);
NeutralAccZ = (int)eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACC_Z]) * 256 + (int)eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACC_Z+1]);
}
 
Mess_IntegralNick = 0;
Mess_IntegralNick2 = 0;
Mess_IntegralRoll = 0;
Mess_IntegralRoll2 = 0;
Mess_Integral_Gier = 0;
MesswertNick = 0;
MesswertRoll = 0;
MesswertGier = 0;
Delay_ms_Mess(100);
StartLuftdruck = Luftdruck;
HoeheD = 0;
Mess_Integral_Hoch = 0;
KompassStartwert = KompassValue;
GPS_Neutral();
beeptime = 50;
Umschlag180Nick = ((long) EE_Parameter.WinkelUmschlagNick * 2500L) + 15000L;
Umschlag180Roll = ((long) EE_Parameter.WinkelUmschlagRoll * 2500L) + 15000L;
ExternHoehenValue = 0;
ErsatzKompass = KompassValue * GIER_GRAD_FAKTOR;
GierGyroFehler = 0;
SendVersionToNavi = 1;
LED_Init();
MikroKopterFlags |= FLAG_CALIBRATE;
FromNaviCtrl_Value.Kalman_K = -1;
FromNaviCtrl_Value.Kalman_MaxDrift = EE_Parameter.Driftkomp * 16;
FromNaviCtrl_Value.Kalman_MaxFusion = 32;
}
 
//############################################################################
// Bearbeitet die Messwerte
void Mittelwert(void)
//############################################################################
{
static signed long tmpl,tmpl2;
MesswertGier = (signed int) AdNeutralGier - AdWertGier;
MesswertGierBias = (signed int) AdNeutralGierBias - AdWertGier;
MesswertRoll = (signed int) AdWertRoll - AdNeutralRoll;
MesswertNick = (signed int) AdWertNick - AdNeutralNick;
 
//DebugOut.Analog[26] = MesswertNick;
DebugOut.Analog[28] = MesswertRoll;
 
// Beschleunigungssensor ++++++++++++++++++++++++++++++++++++++++++++++++
Mittelwert_AccNick = ((long)Mittelwert_AccNick * 1 + ((ACC_AMPLIFY * (long)AdWertAccNick))) / 2L;
Mittelwert_AccRoll = ((long)Mittelwert_AccRoll * 1 + ((ACC_AMPLIFY * (long)AdWertAccRoll))) / 2L;
Mittelwert_AccHoch = ((long)Mittelwert_AccHoch * 1 + ((long)AdWertAccHoch)) / 2L;
IntegralAccNick += ACC_AMPLIFY * AdWertAccNick;
IntegralAccRoll += ACC_AMPLIFY * AdWertAccRoll;
NaviAccNick += AdWertAccNick;
NaviAccRoll += AdWertAccRoll;
NaviCntAcc++;
IntegralAccZ += Aktuell_az - NeutralAccZ;
// Gier ++++++++++++++++++++++++++++++++++++++++++++++++
ErsatzKompass += MesswertGier;
Mess_Integral_Gier += MesswertGier;
// Mess_Integral_Gier2 += MesswertGier;
if(ErsatzKompass >= (360L * GIER_GRAD_FAKTOR)) ErsatzKompass -= 360L * GIER_GRAD_FAKTOR; // 360° Umschlag
if(ErsatzKompass < 0) ErsatzKompass += 360L * GIER_GRAD_FAKTOR;
// Kopplungsanteil +++++++++++++++++++++++++++++++++++++
if(!Looping_Nick && !Looping_Roll && (EE_Parameter.GlobalConfig & CFG_ACHSENKOPPLUNG_AKTIV))
{
tmpl = (MesswertGierBias * Mess_IntegralNick) / 2048L;
tmpl *= Parameter_AchsKopplung1; //125
tmpl /= 4096L;
tmpl2 = (MesswertGierBias * Mess_IntegralRoll) / 2048L;
tmpl2 *= Parameter_AchsKopplung1;
tmpl2 /= 4096L;
if(labs(tmpl) > 128 || labs(tmpl2) > 128) TrichterFlug = 1;
}
else tmpl = tmpl2 = 0;
// Roll ++++++++++++++++++++++++++++++++++++++++++++++++
MesswertRoll += tmpl;
MesswertRoll += (tmpl2*Parameter_AchsGegenKopplung1)/512L; //109
Mess_IntegralRoll2 += MesswertRoll;
Mess_IntegralRoll += MesswertRoll - LageKorrekturRoll;
if(Mess_IntegralRoll > Umschlag180Roll)
{
Mess_IntegralRoll = -(Umschlag180Roll - 25000L);
Mess_IntegralRoll2 = Mess_IntegralRoll;
}
if(Mess_IntegralRoll <-Umschlag180Roll)
{
Mess_IntegralRoll = (Umschlag180Roll - 25000L);
Mess_IntegralRoll2 = Mess_IntegralRoll;
}
if(AdWertRoll < 15) MesswertRoll = -1000;
if(AdWertRoll < 7) MesswertRoll = -2000;
if(PlatinenVersion == 10)
{
if(AdWertRoll > 1010) MesswertRoll = +1000;
if(AdWertRoll > 1017) MesswertRoll = +2000;
}
else
{
if(AdWertRoll > 2020) MesswertRoll = +1000;
if(AdWertRoll > 2034) MesswertRoll = +2000;
}
// Nick ++++++++++++++++++++++++++++++++++++++++++++++++
MesswertNick -= tmpl2;
MesswertNick -= (tmpl*Parameter_AchsGegenKopplung1)/512L;
Mess_IntegralNick2 += MesswertNick;
Mess_IntegralNick += MesswertNick - LageKorrekturNick;
 
if(Mess_IntegralNick > Umschlag180Nick)
{
Mess_IntegralNick = -(Umschlag180Nick - 25000L);
Mess_IntegralNick2 = Mess_IntegralNick;
}
if(Mess_IntegralNick <-Umschlag180Nick)
{
Mess_IntegralNick = (Umschlag180Nick - 25000L);
Mess_IntegralNick2 = Mess_IntegralNick;
}
if(AdWertNick < 15) MesswertNick = -1000;
if(AdWertNick < 7) MesswertNick = -2000;
if(PlatinenVersion == 10)
{
if(AdWertNick > 1010) MesswertNick = +1000;
if(AdWertNick > 1017) MesswertNick = +2000;
}
else
{
if(AdWertNick > 2020) MesswertNick = +1000;
if(AdWertNick > 2034) MesswertNick = +2000;
}
//++++++++++++++++++++++++++++++++++++++++++++++++
// ADC einschalten
ANALOG_ON;
//++++++++++++++++++++++++++++++++++++++++++++++++
 
Integral_Gier = Mess_Integral_Gier;
IntegralNick = Mess_IntegralNick;
IntegralRoll = Mess_IntegralRoll;
IntegralNick2 = Mess_IntegralNick2;
IntegralRoll2 = Mess_IntegralRoll2;
 
if(EE_Parameter.GlobalConfig & CFG_DREHRATEN_BEGRENZER && !Looping_Nick && !Looping_Roll)
{
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)
//############################################################################
{
if(PlatinenVersion == 13) SucheGyroOffset();
// ADC auschalten, damit die Werte sich nicht während der Berechnung ändern
ANALOG_OFF;
MesswertNick = AdWertNick;
MesswertRoll = AdWertRoll;
MesswertGier = AdWertGier;
Mittelwert_AccNick = ACC_AMPLIFY * (long)AdWertAccNick;
Mittelwert_AccRoll = ACC_AMPLIFY * (long)AdWertAccRoll;
Mittelwert_AccHoch = (long)AdWertAccHoch;
// 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;
 
Umschlag180Nick = (long) EE_Parameter.WinkelUmschlagNick * 2500L;
Umschlag180Roll = (long) EE_Parameter.WinkelUmschlagRoll * 2500L;
}
 
//############################################################################
// Senden der Motorwerte per I2C-Bus
void SendMotorData(void)
//############################################################################
{
if(!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];
MikroKopterFlags &= ~(FLAG_MOTOR_RUN | FLAG_FLY);
} else MikroKopterFlags |= FLAG_MOTOR_RUN;
 
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();
}
 
 
 
//############################################################################
// Trägt ggf. das Poti als Parameter ein
void ParameterZuordnung(void)
//############################################################################
{
#define CHK_POTI_MM(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;}
#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; }
CHK_POTI(Parameter_MaxHoehe,EE_Parameter.MaxHoehe,0,255);
CHK_POTI_MM(Parameter_Luftdruck_D,EE_Parameter.Luftdruck_D,0,100);
CHK_POTI_MM(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_MM(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_UserParam5,EE_Parameter.UserParam5,0,255);
CHK_POTI(Parameter_UserParam6,EE_Parameter.UserParam6,0,255);
CHK_POTI(Parameter_UserParam7,EE_Parameter.UserParam7,0,255);
CHK_POTI(Parameter_UserParam8,EE_Parameter.UserParam8,0,255);
CHK_POTI(Parameter_ServoNickControl,EE_Parameter.ServoNickControl,0,255);
CHK_POTI(Parameter_LoopGasLimit,EE_Parameter.LoopGasLimit,0,255);
CHK_POTI(Parameter_AchsKopplung1, EE_Parameter.AchsKopplung1,0,255);
CHK_POTI(Parameter_AchsGegenKopplung1,EE_Parameter.AchsGegenKopplung1,0,255);
CHK_POTI(Parameter_DynamicStability,EE_Parameter.DynamicStability,0,255);
CHK_POTI_MM(Parameter_J16Timing,EE_Parameter.J16Timing,1,255);
CHK_POTI_MM(Parameter_J17Timing,EE_Parameter.J17Timing,1,255);
 
CHK_POTI(Parameter_NaviGpsModeControl,EE_Parameter.NaviGpsModeControl,0,255);
//CHK_POTI(Parameter_NaviGpsGain,EE_Parameter.NaviGpsGain,0,255);
// CHK_POTI(Parameter_NaviGpsP,EE_Parameter.NaviGpsP,0,255);
// CHK_POTI(Parameter_NaviGpsI,EE_Parameter.NaviGpsI,0,255);
// CHK_POTI(Parameter_NaviGpsD,EE_Parameter.NaviGpsD,0,255);
// CHK_POTI(Parameter_NaviGpsACC,EE_Parameter.NaviGpsACC,0,255);
// CHK_POTI_MM(Parameter_NaviOperatingRadius,EE_Parameter.NaviOperatingRadius,10,255);
// CHK_POTI(Parameter_NaviWindCorrection,EE_Parameter.NaviWindCorrection,0,255);
// CHK_POTI(Parameter_NaviSpeedCompensation,EE_Parameter.NaviSpeedCompensation,0,255);
 
CHK_POTI(Parameter_ExternalControl,EE_Parameter.ExternalControl,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 long IntegralFehlerNick = 0;
static long IntegralFehlerRoll = 0;
static unsigned int RcLostTimer;
static unsigned char delay_neutral = 0;
static unsigned char delay_einschalten = 0,delay_ausschalten = 0;
static int hoehenregler = 0;
static char TimerWerteausgabe = 0;
static char NeueKompassRichtungMerken = 0;
static long ausgleichNick, ausgleichRoll;
 
Mittelwert();
 
GRN_ON;
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Gaswert ermitteln
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
GasMischanteil = StickGas;
if(GasMischanteil < MIN_GAS + 10) GasMischanteil = MIN_GAS + 10;
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Empfang 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 > 1000) // wahrscheinlich in der Luft --> langsam absenken
{
GasMischanteil = EE_Parameter.NotGas;
Notlandung = 1;
PPM_diff[EE_Parameter.Kanalbelegung[K_NICK]] = 0;
PPM_diff[EE_Parameter.Kanalbelegung[K_ROLL]] = 0;
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 && MotorenEin)
{
if(modell_fliegt < 0xffff) modell_fliegt++;
}
if((modell_fliegt < 256))
{
SummeNick = 0;
SummeRoll = 0;
if(modell_fliegt == 250)
{
NeueKompassRichtungMerken = 1;
sollGier = 0;
Mess_Integral_Gier = 0;
// Mess_Integral_Gier2 = 0;
}
} else MikroKopterFlags |= FLAG_FLY;
 
if((PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] > 80) && MotorenEin == 0)
{
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// auf Nullwerte kalibrieren
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) // Neutralwerte
{
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)
{
unsigned char setting=1;
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;
SetActiveParamSetNumber(setting); // aktiven Datensatz merken
}
// else
if(abs(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]) < 30 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < -70)
{
WinkelOut.CalcState = 1;
beeptime = 1000;
}
else
{
ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE);
if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert?
{
if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset();
}
SetNeutral();
Piep(GetActiveParamSetNumber());
}
}
}
else
if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] < -75) // ACC Neutralwerte speichern
{
if(++delay_neutral > 200) // nicht sofort
{
GRN_OFF;
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACC_NICK],0xff); // Werte löschen
MotorenEin = 0;
delay_neutral = 0;
modell_fliegt = 0;
SetNeutral();
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACC_NICK],NeutralAccX / 256); // ACC-NeutralWerte speichern
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACC_NICK+1],NeutralAccX % 256); // ACC-NeutralWerte speichern
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACC_ROLL],NeutralAccY / 256);
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACC_ROLL+1],NeutralAccY % 256);
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACC_Z],(int)NeutralAccZ / 256);
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACC_Z+1],(int)NeutralAccZ % 256);
Piep(GetActiveParamSetNumber());
}
}
else delay_neutral = 0;
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Gas ist unten
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if(PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] < 35-120)
{
// 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;
MikroKopterFlags |= FLAG_START;
}
}
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)
{
int tmp_int;
static int stick_nick,stick_roll;
ParameterZuordnung();
stick_nick = (stick_nick * 3 + PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_P) / 4;
stick_nick += PPM_diff[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_D;
StickNick = stick_nick - (GPS_Nick + GPS_Nick2);
// StickNick = (StickNick * 3 + PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_P) / 4;
 
stick_roll = (stick_roll * 3 + PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_P) / 4;
stick_roll += PPM_diff[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_D;
StickRoll = stick_roll - (GPS_Roll + GPS_Roll2);
 
// StickRoll = (StickRoll * 3 + PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_P) / 4;
 
StickGier = -PPM_in[EE_Parameter.Kanalbelegung[K_GIER]];
StickGas = PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] + 120;
 
/* if(abs(PPM_in[EE_Parameter.Kanalbelegung[K_NICK]]) > MaxStickNick)
MaxStickNick = abs(PPM_in[EE_Parameter.Kanalbelegung[K_NICK]]); else MaxStickNick--;
if(abs(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]) > MaxStickRoll)
MaxStickRoll = abs(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]); else MaxStickRoll--;
*/
GyroFaktor = ((float)Parameter_Gyro_P + 10.0) / (256.0/STICK_GAIN);
IntegralFaktor = ((float) Parameter_Gyro_I) / (44000 / STICK_GAIN);
 
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Analoge Steuerung per Seriell
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if(ExternControl.Config & 0x01 && Parameter_ExternalControl > 128)
{
StickNick += (int) ExternControl.Nick * (int) EE_Parameter.Stick_P;
StickRoll += (int) ExternControl.Roll * (int) EE_Parameter.Stick_P;
StickGier += ExternControl.Gier;
ExternHoehenValue = (int) ExternControl.Hight * (int)EE_Parameter.Hoehe_Verstaerkung;
if(ExternControl.Gas < StickGas) StickGas = ExternControl.Gas;
}
if(StickGas < 0) StickGas = 0;
 
if(EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) IntegralFaktor = 0;
if(GyroFaktor < 0) GyroFaktor = 0;
if(IntegralFaktor < 0) IntegralFaktor = 0;
 
if(abs(StickNick/STICK_GAIN) > MaxStickNick)
{
MaxStickNick = abs(StickNick)/STICK_GAIN;
if(MaxStickNick > 100) MaxStickNick = 100;
}
else MaxStickNick--;
if(abs(StickRoll/STICK_GAIN) > MaxStickRoll)
{
MaxStickRoll = abs(StickRoll)/STICK_GAIN;
if(MaxStickRoll > 100) MaxStickRoll = 100;
}
else MaxStickRoll--;
if(Notlandung) {MaxStickNick = 0; MaxStickRoll = 0;}
 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Looping?
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if((PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > EE_Parameter.LoopThreshold) && EE_Parameter.BitConfig & CFG_LOOP_LINKS) Looping_Links = 1;
else
{
{
if((PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] < (EE_Parameter.LoopThreshold - EE_Parameter.LoopHysterese))) Looping_Links = 0;
}
}
if((PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] < -EE_Parameter.LoopThreshold) && EE_Parameter.BitConfig & CFG_LOOP_RECHTS) Looping_Rechts = 1;
else
{
if(Looping_Rechts) // Hysterese
{
if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > -(EE_Parameter.LoopThreshold - EE_Parameter.LoopHysterese)) Looping_Rechts = 0;
}
}
 
if((PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > EE_Parameter.LoopThreshold) && EE_Parameter.BitConfig & CFG_LOOP_OBEN) Looping_Oben = 1;
else
{
if(Looping_Oben) // Hysterese
{
if((PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < (EE_Parameter.LoopThreshold - EE_Parameter.LoopHysterese))) Looping_Oben = 0;
}
}
if((PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < -EE_Parameter.LoopThreshold) && EE_Parameter.BitConfig & CFG_LOOP_UNTEN) Looping_Unten = 1;
else
{
if(Looping_Unten) // Hysterese
{
if(PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > -(EE_Parameter.LoopThreshold - EE_Parameter.LoopHysterese)) Looping_Unten = 0;
}
}
 
if(Looping_Links || Looping_Rechts) Looping_Roll = 1; else Looping_Roll = 0;
if(Looping_Oben || Looping_Unten) {Looping_Nick = 1; Looping_Roll = 0; Looping_Links = 0; Looping_Rechts = 0;} else Looping_Nick = 0;
} // Ende neue Funken-Werte
 
if(Looping_Roll || Looping_Nick)
{
if(GasMischanteil > EE_Parameter.LoopGasLimit) GasMischanteil = EE_Parameter.LoopGasLimit;
}
 
 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Bei Empfangsausfall im Flug
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if(Notlandung)
{
StickGier = 0;
StickNick = 0;
StickRoll = 0;
GyroFaktor = (float) 100 / (256.0 / STICK_GAIN);
IntegralFaktor = (float) 120 / (44000 / STICK_GAIN);
Looping_Roll = 0;
Looping_Nick = 0;
}
 
 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Integrale auf ACC-Signal abgleichen
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#define ABGLEICH_ANZAHL 256L
 
MittelIntegralNick += IntegralNick; // Für die Mittelwertbildung aufsummieren
MittelIntegralRoll += IntegralRoll;
MittelIntegralNick2 += IntegralNick2;
MittelIntegralRoll2 += IntegralRoll2;
 
if(Looping_Nick || Looping_Roll)
{
IntegralAccNick = 0;
IntegralAccRoll = 0;
MittelIntegralNick = 0;
MittelIntegralRoll = 0;
MittelIntegralNick2 = 0;
MittelIntegralRoll2 = 0;
Mess_IntegralNick2 = Mess_IntegralNick;
Mess_IntegralRoll2 = Mess_IntegralRoll;
ZaehlMessungen = 0;
LageKorrekturNick = 0;
LageKorrekturRoll = 0;
}
 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if(!Looping_Nick && !Looping_Roll)
{
long tmp_long, tmp_long2;
if(FromNaviCtrl_Value.Kalman_K != -1)
{
tmp_long = (long)(IntegralNick / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccNick);
tmp_long2 = (long)(IntegralRoll / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccRoll);
tmp_long = (tmp_long * FromNaviCtrl_Value.Kalman_K) / (32 * 16);
tmp_long2 = (tmp_long2 * FromNaviCtrl_Value.Kalman_K) / (32 * 16);
if((MaxStickNick > 64) || (MaxStickRoll > 64))
{
tmp_long /= 2;
tmp_long2 /= 2;
}
if(abs(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]) > 25)
{
tmp_long /= 3;
tmp_long2 /= 3;
}
if(tmp_long > (long) FromNaviCtrl_Value.Kalman_MaxFusion) tmp_long = (long) FromNaviCtrl_Value.Kalman_MaxFusion;
if(tmp_long < (long)-FromNaviCtrl_Value.Kalman_MaxFusion) tmp_long = (long)-FromNaviCtrl_Value.Kalman_MaxFusion;
if(tmp_long2 > (long) FromNaviCtrl_Value.Kalman_MaxFusion) tmp_long2 = (long) FromNaviCtrl_Value.Kalman_MaxFusion;
if(tmp_long2 < (long)-FromNaviCtrl_Value.Kalman_MaxFusion) tmp_long2 = (long)-FromNaviCtrl_Value.Kalman_MaxFusion;
}
else
{
tmp_long = (long)(IntegralNick / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccNick);
tmp_long2 = (long)(IntegralRoll / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccRoll);
tmp_long /= 16;
tmp_long2 /= 16;
if((MaxStickNick > 64) || (MaxStickRoll > 64))
{
tmp_long /= 3;
tmp_long2 /= 3;
}
if(abs(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]) > 25)
{
tmp_long /= 3;
tmp_long2 /= 3;
}
#define AUSGLEICH 32
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;
}
 
Mess_IntegralNick -= tmp_long;
Mess_IntegralRoll -= tmp_long2;
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if(ZaehlMessungen >= ABGLEICH_ANZAHL)
{
static int cnt = 0;
static char last_n_p,last_n_n,last_r_p,last_r_n;
static long MittelIntegralNick_Alt,MittelIntegralRoll_Alt;
if(!Looping_Nick && !Looping_Roll && !TrichterFlug)
{
MittelIntegralNick /= ABGLEICH_ANZAHL;
MittelIntegralRoll /= ABGLEICH_ANZAHL;
IntegralAccNick = (EE_Parameter.GyroAccFaktor * IntegralAccNick) / ABGLEICH_ANZAHL;
IntegralAccRoll = (EE_Parameter.GyroAccFaktor * IntegralAccRoll) / ABGLEICH_ANZAHL;
IntegralAccZ = IntegralAccZ / ABGLEICH_ANZAHL;
#define MAX_I 0//(Poti2/10)
// Nick ++++++++++++++++++++++++++++++++++++++++++++++++
IntegralFehlerNick = (long)(MittelIntegralNick - (long)IntegralAccNick);
ausgleichNick = IntegralFehlerNick / EE_Parameter.GyroAccAbgleich;
// Roll ++++++++++++++++++++++++++++++++++++++++++++++++
IntegralFehlerRoll = (long)(MittelIntegralRoll - (long)IntegralAccRoll);
ausgleichRoll = IntegralFehlerRoll / EE_Parameter.GyroAccAbgleich;
 
LageKorrekturNick = ausgleichNick / ABGLEICH_ANZAHL;
LageKorrekturRoll = ausgleichRoll / ABGLEICH_ANZAHL;
 
if(((MaxStickNick > 64) || (MaxStickRoll > 64) || (abs(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]) > 25)) && (FromNaviCtrl_Value.Kalman_K == -1))
{
LageKorrekturNick /= 2;
LageKorrekturRoll /= 2;
}
 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Gyro-Drift ermitteln
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MittelIntegralNick2 /= ABGLEICH_ANZAHL;
MittelIntegralRoll2 /= ABGLEICH_ANZAHL;
tmp_long = IntegralNick2 - IntegralNick;
tmp_long2 = IntegralRoll2 - IntegralRoll;
//DebugOut.Analog[25] = MittelIntegralRoll2 / 26;
 
IntegralFehlerNick = tmp_long;
IntegralFehlerRoll = tmp_long2;
Mess_IntegralNick2 -= IntegralFehlerNick;
Mess_IntegralRoll2 -= IntegralFehlerRoll;
 
// IntegralFehlerNick = (IntegralFehlerNick * 1 + tmp_long) / 2;
// IntegralFehlerRoll = (IntegralFehlerRoll * 1 + tmp_long2) / 2;
if(GierGyroFehler > ABGLEICH_ANZAHL/2) { AdNeutralGier++; AdNeutralGierBias++; }
if(GierGyroFehler <-ABGLEICH_ANZAHL/2) { AdNeutralGier--; AdNeutralGierBias--; }
 
DebugOut.Analog[22] = MittelIntegralRoll / 26;
//DebugOut.Analog[24] = GierGyroFehler;
GierGyroFehler = 0;
 
 
/*DebugOut.Analog[17] = IntegralAccNick / 26;
DebugOut.Analog[18] = IntegralAccRoll / 26;
DebugOut.Analog[19] = IntegralFehlerNick;// / 26;
DebugOut.Analog[20] = IntegralFehlerRoll;// / 26;
*/
//DebugOut.Analog[21] = MittelIntegralNick / 26;
//MittelIntegralRoll = MittelIntegralRoll;
//DebugOut.Analog[28] = ausgleichNick;
/*
DebugOut.Analog[29] = ausgleichRoll;
DebugOut.Analog[30] = LageKorrekturRoll * 10;
*/
 
#define FEHLER_LIMIT (ABGLEICH_ANZAHL * 4)
#define FEHLER_LIMIT2 (ABGLEICH_ANZAHL * 16)
#define BEWEGUNGS_LIMIT 20000
// Nick +++++++++++++++++++++++++++++++++++++++++++++++++
cnt = 1;// + labs(IntegralFehlerNick) / 4096;
if(labs(MittelIntegralNick_Alt - MittelIntegralNick) < BEWEGUNGS_LIMIT || (FromNaviCtrl_Value.Kalman_MaxDrift > 3*16))
{
if(IntegralFehlerNick > FEHLER_LIMIT2)
{
if(last_n_p)
{
cnt += labs(IntegralFehlerNick) / FEHLER_LIMIT2;
ausgleichNick = IntegralFehlerNick / 8;
if(ausgleichNick > 5000) ausgleichNick = 5000;
LageKorrekturNick += ausgleichNick / ABGLEICH_ANZAHL;
}
else last_n_p = 1;
} else last_n_p = 0;
if(IntegralFehlerNick < -FEHLER_LIMIT2)
{
if(last_n_n)
{
cnt += labs(IntegralFehlerNick) / FEHLER_LIMIT2;
ausgleichNick = IntegralFehlerNick / 8;
if(ausgleichNick < -5000) ausgleichNick = -5000;
LageKorrekturNick += ausgleichNick / ABGLEICH_ANZAHL;
}
else last_n_n = 1;
} else last_n_n = 0;
}
else
{
cnt = 0;
KompassSignalSchlecht = 1000;
}
if(cnt > EE_Parameter.Driftkomp) cnt = EE_Parameter.Driftkomp;
if(cnt * 16 > FromNaviCtrl_Value.Kalman_MaxDrift) cnt = FromNaviCtrl_Value.Kalman_MaxDrift/16;
if(IntegralFehlerNick > FEHLER_LIMIT) AdNeutralNick += cnt;
if(IntegralFehlerNick < -FEHLER_LIMIT) AdNeutralNick -= cnt;
 
// Roll +++++++++++++++++++++++++++++++++++++++++++++++++
cnt = 1;// + labs(IntegralFehlerNick) / 4096;
 
ausgleichRoll = 0;
if(labs(MittelIntegralRoll_Alt - MittelIntegralRoll) < BEWEGUNGS_LIMIT || (FromNaviCtrl_Value.Kalman_MaxDrift > 3*16))
{
if(IntegralFehlerRoll > FEHLER_LIMIT2)
{
if(last_r_p)
{
cnt += labs(IntegralFehlerRoll) / FEHLER_LIMIT2;
ausgleichRoll = IntegralFehlerRoll / 8;
if(ausgleichRoll > 5000) ausgleichRoll = 5000;
LageKorrekturRoll += ausgleichRoll / ABGLEICH_ANZAHL;
}
else last_r_p = 1;
} else last_r_p = 0;
if(IntegralFehlerRoll < -FEHLER_LIMIT2)
{
if(last_r_n)
{
cnt += labs(IntegralFehlerRoll) / FEHLER_LIMIT2;
ausgleichRoll = IntegralFehlerRoll / 8;
if(ausgleichRoll < -5000) ausgleichRoll = -5000;
LageKorrekturRoll += ausgleichRoll / ABGLEICH_ANZAHL;
}
else last_r_n = 1;
} else last_r_n = 0;
} else
{
cnt = 0;
KompassSignalSchlecht = 1000;
}
if(cnt > EE_Parameter.Driftkomp) cnt = EE_Parameter.Driftkomp;
if(cnt * 16 > FromNaviCtrl_Value.Kalman_MaxDrift) cnt = FromNaviCtrl_Value.Kalman_MaxDrift/16;
if(IntegralFehlerRoll > FEHLER_LIMIT) AdNeutralRoll += cnt;
if(IntegralFehlerRoll < -FEHLER_LIMIT) AdNeutralRoll -= cnt;
}
else
{
LageKorrekturRoll = 0;
LageKorrekturNick = 0;
TrichterFlug = 0;
}
 
if(!IntegralFaktor) { LageKorrekturRoll = 0; LageKorrekturNick = 0;} // z.B. bei HH
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
MittelIntegralNick_Alt = MittelIntegralNick;
MittelIntegralRoll_Alt = MittelIntegralRoll;
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
IntegralAccNick = 0;
IntegralAccRoll = 0;
IntegralAccZ = 0;
MittelIntegralNick = 0;
MittelIntegralRoll = 0;
MittelIntegralNick2 = 0;
MittelIntegralRoll2 = 0;
ZaehlMessungen = 0;
}
//DebugOut.Analog[31] = StickRoll / (26*IntegralFaktor);
 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Gieren
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// if(GasMischanteil < 35) { if(StickGier > 10) StickGier = 10; else if(StickGier < -10) StickGier = -10;};
if(abs(StickGier) > 15) // war 35
{
KompassSignalSchlecht = 1000;
if(!(EE_Parameter.GlobalConfig & CFG_KOMPASS_FIX))
{
NeueKompassRichtungMerken = 1;
};
}
tmp_int = (long) EE_Parameter.Gier_P * ((long)StickGier * abs(StickGier)) / 512L; // expo y = ax + bx²
tmp_int += (EE_Parameter.Gier_P * StickGier) / 4;
sollGier = tmp_int;
Mess_Integral_Gier -= tmp_int;
if(Mess_Integral_Gier > 50000) Mess_Integral_Gier = 50000; // begrenzen
if(Mess_Integral_Gier <-50000) Mess_Integral_Gier =-50000;
 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Kompass
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//DebugOut.Analog[29] = (MaxStickNick + MaxStickRoll);
 
if(KompassValue && (EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV))
{
int w,v,r,fehler,korrektur;
w = abs(IntegralNick /512); // mit zunehmender Neigung den Einfluss drosseln
v = abs(IntegralRoll /512);
if(v > w) w = v; // grösste Neigung ermitteln
korrektur = w / 8 + 1;
fehler = ((540 + KompassValue - (ErsatzKompass/GIER_GRAD_FAKTOR)) % 360) - 180;
if(NeueKompassRichtungMerken)
{
fehler = 0;
ErsatzKompass = KompassValue * GIER_GRAD_FAKTOR;
}
if(!KompassSignalSchlecht && w < 25)
{
GierGyroFehler += fehler;
if(NeueKompassRichtungMerken)
{
beeptime = 200;
// KompassStartwert = KompassValue;
KompassStartwert = (ErsatzKompass/GIER_GRAD_FAKTOR);
NeueKompassRichtungMerken = 0;
}
}
ErsatzKompass += (fehler * 8) / korrektur;
w = (w * Parameter_KompassWirkung) / 32; // auf die Wirkung normieren
w = Parameter_KompassWirkung - w; // Wirkung ggf drosseln
if(w >= 0)
{
if(!KompassSignalSchlecht)
{
v = 64 + ((MaxStickNick + MaxStickRoll)) / 8;
r = ((540 + (ErsatzKompass/GIER_GRAD_FAKTOR) - KompassStartwert) % 360) - 180;
// r = KompassRichtung;
v = (r * w) / v; // nach Kompass ausrichten
w = 3 * Parameter_KompassWirkung;
if(v > w) v = w; // Begrenzen
else
if(v < -w) v = -w;
Mess_Integral_Gier += v;
}
if(KompassSignalSchlecht) KompassSignalSchlecht--;
}
else KompassSignalSchlecht = 500; // so lange das Signal taub stellen --> ca. 1 sek
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Debugwerte zuordnen
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if(!TimerWerteausgabe--)
{
TimerWerteausgabe = 24;
 
DebugOut.Analog[0] = IntegralNick / EE_Parameter.GyroAccFaktor;
DebugOut.Analog[1] = IntegralRoll / EE_Parameter.GyroAccFaktor;
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[8] = KompassValue;
DebugOut.Analog[9] = UBat;
DebugOut.Analog[11] = ErsatzKompass / GIER_GRAD_FAKTOR;
DebugOut.Analog[10] = SenderOkay;
//DebugOut.Analog[16] = Mittelwert_AccHoch;
DebugOut.Analog[17] = FromNaviCtrl_Value.Distance;
DebugOut.Analog[18] = (int)FromNaviCtrl_Value.OsdBar;
DebugOut.Analog[19] = WinkelOut.CalcState;
DebugOut.Analog[20] = ServoValue;
DebugOut.Analog[27] = (int)FromNaviCtrl_Value.Kalman_MaxDrift;
DebugOut.Analog[29] = (int)FromNaviCtrl_Value.Kalman_K;
DebugOut.Analog[30] = GPS_Nick;
DebugOut.Analog[31] = GPS_Roll;
 
 
// DebugOut.Analog[19] -= DebugOut.Analog[19]/128;
// if(DebugOut.Analog[19] > 0) DebugOut.Analog[19]--; else DebugOut.Analog[19]++;
 
/* DebugOut.Analog[16] = motor_rx[0];
DebugOut.Analog[17] = motor_rx[1];
DebugOut.Analog[18] = motor_rx[2];
DebugOut.Analog[19] = motor_rx[3];
DebugOut.Analog[20] = motor_rx[0] + motor_rx[1] + motor_rx[2] + motor_rx[3];
DebugOut.Analog[20] /= 14;
DebugOut.Analog[21] = motor_rx[4];
DebugOut.Analog[22] = motor_rx[5];
DebugOut.Analog[23] = motor_rx[6];
DebugOut.Analog[24] = motor_rx[7];
DebugOut.Analog[25] = motor_rx[4] + motor_rx[5] + motor_rx[6] + motor_rx[7];
*/
// DebugOut.Analog[9] = MesswertNick;
// 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
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
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 * (2 * GyroFaktor) + Integral_Gier * IntegralFaktor / 2;
 
DebugOut.Analog[21] = MesswertNick;
DebugOut.Analog[22] = MesswertRoll;
 
// Maximalwerte abfangen
#define MAX_SENSOR (4096*STICK_GAIN)
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;
GasMischanteil *= STICK_GAIN;
/*
if(Poti1 > 200) {OCR0A = DruckOffsetSetting - 16; ExpandBaro = 16; }else
if(Poti1 > 150) {OCR0A = DruckOffsetSetting - 8; ExpandBaro = 8; }else
if(Poti1 > 100) {OCR0A = DruckOffsetSetting - 4; ExpandBaro = 4; }else
if(Poti1 > 50) {OCR0A = DruckOffsetSetting - 2; ExpandBaro = 1; }else
{OCR0A = DruckOffsetSetting; ExpandBaro = 0;}
*/
if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung
{
int tmp_int;
static char delay = 100;
if(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER) // Regler wird über Schalter gesteuert
{
if(((EE_Parameter.BitConfig & CFG_HIGHT_3SWITCH) && ((Parameter_MaxHoehe > 80) && (Parameter_MaxHoehe < 140))) ||
(!(EE_Parameter.BitConfig & CFG_HIGHT_3SWITCH) && (Parameter_MaxHoehe < 50)))
{
if(!delay--)
{
if(MessLuftdruck > 1000)
{
ExpandBaro -= 10;
OCR0A = DruckOffsetSetting - ExpandBaro;
beeptime = 300;
delay = 250;
}
else
if(MessLuftdruck < 100)
{
ExpandBaro += 10;
OCR0A = DruckOffsetSetting - ExpandBaro;
beeptime = 300;
delay = 250;
}
else
{
SollHoehe = HoehenWert - 20; // Parameter_MaxHoehe ist der PPM-Wert des Schalters
HoehenReglerAktiv = 0;
delay = 1;
}
}
}
else
{
HoehenReglerAktiv = 1;
delay = 200;
}
}
else
{
SollHoehe = ((int) ExternHoehenValue + (int) Parameter_MaxHoehe) * (int)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 / STICK_GAIN); // Differenz bestimmen --> P-Anteil
h = GasMischanteil - h; // vom Gas abziehen
// h -= (HoeheD * Parameter_Luftdruck_D)/(8/STICK_GAIN); // D-Anteil
h -= (HoeheD)/(8/STICK_GAIN); // D-Anteil
tmp_int = ((Mess_Integral_Hoch / 128) * (signed long) Parameter_Hoehe_ACC_Wirkung) / (128 / STICK_GAIN);
if(tmp_int > 70*STICK_GAIN) tmp_int = 70*STICK_GAIN;
else if(tmp_int < -(70*STICK_GAIN)) tmp_int = -(70*STICK_GAIN);
h -= tmp_int;
hoehenregler = (hoehenregler*15 + h) / 16;
if(hoehenregler < EE_Parameter.Hoehe_MinGas * STICK_GAIN) // nicht unter MIN
{
if(GasMischanteil >= EE_Parameter.Hoehe_MinGas * STICK_GAIN) hoehenregler = EE_Parameter.Hoehe_MinGas * STICK_GAIN;
if(GasMischanteil < EE_Parameter.Hoehe_MinGas * STICK_GAIN) hoehenregler = GasMischanteil;
}
if(hoehenregler > GasMischanteil) hoehenregler = GasMischanteil; // nicht mehr als Gas
GasMischanteil = hoehenregler;
}
}
if(GasMischanteil > (MAX_GAS - 20) * STICK_GAIN) GasMischanteil = (MAX_GAS - 20) * STICK_GAIN;
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Mischer und PI-Regler
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
DebugOut.Analog[7] = GasMischanteil;
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Gier-Anteil
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#define MUL_G 1.0
GierMischanteil = MesswertGier - sollGier * STICK_GAIN; // Regler für Gier
// GierMischanteil = 0;
#define MIN_GIERGAS (40*STICK_GAIN) // unter diesem Gaswert trotzdem Gieren
if(GasMischanteil > MIN_GIERGAS)
{
if(GierMischanteil > (GasMischanteil / 2)) GierMischanteil = GasMischanteil / 2;
if(GierMischanteil < -(GasMischanteil / 2)) GierMischanteil = -(GasMischanteil / 2);
}
else
{
if(GierMischanteil > (MIN_GIERGAS / 2)) GierMischanteil = MIN_GIERGAS / 2;
if(GierMischanteil < -(MIN_GIERGAS / 2)) GierMischanteil = -(MIN_GIERGAS / 2);
}
tmp_int = MAX_GAS*STICK_GAIN;
if(GierMischanteil > ((tmp_int - GasMischanteil))) GierMischanteil = ((tmp_int - GasMischanteil));
if(GierMischanteil < -((tmp_int - GasMischanteil))) GierMischanteil = -((tmp_int - GasMischanteil));
 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Nick-Achse
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
DiffNick = MesswertNick - StickNick; // Differenz bestimmen
if(IntegralFaktor) SummeNick += IntegralNick * IntegralFaktor - StickNick; // I-Anteil bei Winkelregelung
else SummeNick += DiffNick; // I-Anteil bei HH
if(SummeNick > (STICK_GAIN * 16000L)) SummeNick = (STICK_GAIN * 16000L);
if(SummeNick < -(16000L * STICK_GAIN)) SummeNick = -(16000L * STICK_GAIN);
pd_ergebnis = DiffNick + Ki * SummeNick; // PI-Regler für Nick
// Motor Vorn
tmp_int = (long)((long)Parameter_DynamicStability * (long)(GasMischanteil + abs(GierMischanteil)/2)) / 64;
if(pd_ergebnis > tmp_int) pd_ergebnis = tmp_int;
if(pd_ergebnis < -tmp_int) pd_ergebnis = -tmp_int;
 
motorwert = GasMischanteil + pd_ergebnis + GierMischanteil; // Mischer
motorwert /= STICK_GAIN;
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;
motorwert /= STICK_GAIN;
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 = MesswertRoll - StickRoll; // Differenz bestimmen
if(IntegralFaktor) SummeRoll += IntegralRoll * IntegralFaktor - StickRoll;// I-Anteil bei Winkelregelung
else SummeRoll += DiffRoll; // I-Anteil bei HH
if(SummeRoll > (STICK_GAIN * 16000L)) SummeRoll = (STICK_GAIN * 16000L);
if(SummeRoll < -(16000L * STICK_GAIN)) SummeRoll = -(16000L * STICK_GAIN);
pd_ergebnis = DiffRoll + Ki * SummeRoll; // PI-Regler für Roll
tmp_int = (long)((long)Parameter_DynamicStability * (long)(GasMischanteil + abs(GierMischanteil)/2)) / 64;
if(pd_ergebnis > tmp_int) pd_ergebnis = tmp_int;
if(pd_ergebnis < -tmp_int) pd_ergebnis = -tmp_int;
// Motor Links
motorwert = GasMischanteil + pd_ergebnis - GierMischanteil;
motorwert /= STICK_GAIN;
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;
motorwert /= STICK_GAIN;
if ((motorwert < 0)) motorwert = 0;
else if(motorwert > MAX_GAS) motorwert = MAX_GAS;
if (motorwert < MIN_GAS) motorwert = MIN_GAS;
Motor_Rechts = motorwert;
// +++++++++++++++++++++++++++++++++++++++++++++++
}
 
/branches/V0.71h KiliPet/fc.h
0,0 → 1,174
/*#######################################################################################
Flight Control
#######################################################################################*/
 
#ifndef _FC_H
#define _FC_H
//#define GIER_GRAD_FAKTOR 1450L // Abhängigkeit zwischen GyroIntegral und Winkel
//#define GIER_GRAD_FAKTOR 1550L // Abhängigkeit zwischen GyroIntegral und Winkel
#define GIER_GRAD_FAKTOR 1291L // Abhängigkeit zwischen GyroIntegral und Winkel
#define STICK_GAIN 4
 
#define FLAG_MOTOR_RUN 1
#define FLAG_FLY 2
#define FLAG_CALIBRATE 4
#define FLAG_START 8
extern unsigned char MikroKopterFlags;
 
extern volatile unsigned int I2CTimeout;
extern unsigned char Sekunde,Minute;
extern long IntegralNick,IntegralNick2;
extern long IntegralRoll,IntegralRoll2;
extern long Mess_IntegralNick,Mess_IntegralNick2;
extern long Mess_IntegralRoll,Mess_IntegralRoll2;
extern long IntegralAccNick,IntegralAccRoll;
extern volatile long Mess_Integral_Hoch;
extern long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2;
extern volatile int KompassValue;
extern volatile int KompassStartwert;
extern volatile int KompassRichtung;
extern long ErsatzKompass;
extern int ErsatzKompassInGrad; // Kompasswert in Grad
extern int HoehenWert;
extern int SollHoehe;
extern volatile int MesswertNick,MesswertRoll,MesswertGier;
extern int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll;
extern int NeutralAccX, NeutralAccY,Mittelwert_AccHoch;
extern volatile float NeutralAccZ;
extern long Umschlag180Nick, Umschlag180Roll;
extern signed int ExternStickNick,ExternStickRoll,ExternStickGier;
extern unsigned char Parameter_UserParam1,Parameter_UserParam2,Parameter_UserParam3,Parameter_UserParam4,Parameter_UserParam5,Parameter_UserParam6,Parameter_UserParam7,Parameter_UserParam8;
extern int NaviAccNick,NaviAccRoll,NaviCntAcc;
extern unsigned int modell_fliegt;
void MotorRegler(void);
void SendMotorData(void);
void CalibrierMittelwert(void);
void Mittelwert(void);
void SetNeutral(void);
void Piep(unsigned char Anzahl);
extern void DefaultKonstanten(void);
void DefaultKonstanten1(void);
void DefaultKonstanten2(void);
 
extern unsigned char h,m,s;
extern volatile unsigned char Timeout ;
extern unsigned char CosinusNickWinkel, CosinusRollWinkel;
extern volatile int DiffNick,DiffRoll;
extern int Poti1, Poti2, Poti3, Poti4;
extern volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count;
extern volatile unsigned char SenderOkay;
extern int StickNick,StickRoll,StickGier;
extern char MotorenEin;
extern void DefaultKonstanten1(void);
extern void DefaultKonstanten2(void);
 
#define STRUCT_PARAM_LAENGE 86
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 LoopHysterese; // Wert: 0-250 Hysterese für Stickausschlag
unsigned char AchsKopplung1; // Wert: 0-250 Faktor, mit dem Gier die Achsen Roll und Nick koppelt (NickRollMitkopplung)
unsigned char AchsGegenKopplung1; // Wert: 0-250 Faktor, mit dem Gier die Achsen Roll und Nick Gegenkoppelt (NickRollGegenkopplung)
unsigned char WinkelUmschlagNick; // Wert: 0-250 180°-Punkt
unsigned char WinkelUmschlagRoll; // Wert: 0-250 180°-Punkt
unsigned char GyroAccAbgleich; // 1/k (Koppel_ACC_Wirkung)
unsigned char Driftkomp;
unsigned char DynamicStability;
unsigned char UserParam5; // Wert : 0-250
unsigned char UserParam6; // Wert : 0-250
unsigned char UserParam7; // Wert : 0-250
unsigned char UserParam8; // Wert : 0-250
//---Output ---------------------------------------------
unsigned char J16Bitmask; // for the J16 Output
unsigned char J16Timing; // for the J16 Output
unsigned char J17Bitmask; // for the J17 Output
unsigned char J17Timing; // for the J17 Output
//---NaviCtrl---------------------------------------------
unsigned char NaviGpsModeControl; // Parameters for the Naviboard
unsigned char NaviGpsGain;
unsigned char NaviGpsP;
unsigned char NaviGpsI;
unsigned char NaviGpsD;
unsigned char NaviGpsACC;
unsigned char NaviGpsMinSat;
unsigned char NaviStickThreshold;
unsigned char NaviWindCorrection;
unsigned char NaviSpeedCompensation;
unsigned char NaviOperatingRadius;
unsigned char NaviAngleLimitation;
//---Ext.Ctrl---------------------------------------------
unsigned char ExternalControl; // for serial Control
//------------------------------------------------
unsigned char BitConfig; // (war Loop-Cfg) 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;
 
//KP
extern unsigned char HoehenReglerAktiv;
 
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;
extern unsigned char Parameter_AchsKopplung1;
extern unsigned char Parameter_AchsGegenKopplung1;
extern unsigned char Parameter_J16Bitmask; // for the J16 Output
extern unsigned char Parameter_J16Timing; // for the J16 Output
extern unsigned char Parameter_J17Bitmask; // for the J17 Output
extern unsigned char Parameter_J17Timing; // for the J17 Output
 
extern unsigned char Parameter_NaviGpsModeControl; // Parameters for the Naviboard
/*
extern unsigned char Parameter_NaviGpsGain;
extern unsigned char Parameter_NaviGpsP;
extern unsigned char Parameter_NaviGpsI;
extern unsigned char Parameter_NaviGpsD;
extern unsigned char Parameter_NaviGpsACC;
extern unsigned char Parameter_NaviOperatingRadius;
extern unsigned char Parameter_NaviWindCorrection;
extern unsigned char Parameter_NaviSpeedCompensation;
*/
#endif //_FC_H
 
/branches/V0.71h KiliPet/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="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="eeprom.c"></File><File path="spi.h"></File><File path="spi.c"></File><File path="led.h"></File><File path="led.c"></File><File path="fc.c"></File></Project>
/branches/V0.71h KiliPet/flight.pnps
0,0 → 1,0
<pd><ViewState><e p="Flight-Ctrl" x="true"></e></ViewState></pd>
/branches/V0.71h KiliPet/gps.h
0,0 → 1,7
extern signed int GPS_Nick;
extern signed int GPS_Roll;
extern signed int GPS_Nick2;
extern signed int GPS_Roll2;
 
void GPS_Neutral(void);
void GPS_BerechneZielrichtung(void);
/branches/V0.71h KiliPet/led.c
0,0 → 1,84
#include <inttypes.h>
#include "main.h"
//#include "fc.c"
 
uint16_t LED1_Timing = 0;
uint16_t LED2_Timing = 0;
unsigned char J16Blinkcount = 0, J16Mask = 1;
unsigned char J17Blinkcount = 0, J17Mask = 1;
 
// initializes the LED control outputs J16, J17
void LED_Init(void)
{
// set PC2 & PC3 as output (control of J16 & J17)
DDRC |= (1<<DDC2)|(1<<DDC3);
J16_OFF;
J17_OFF;
J16Blinkcount = 0; J16Mask = 128;
J17Blinkcount = 0; J17Mask = 128;
}
 
 
// called in UpdateMotors() every 2ms
void LED_Update(void)
{
static char delay = 0;
if(!delay--) // 10ms Intervall
{
delay = 4;
//nur Höhe an
if(HoehenReglerAktiv > 0 && Parameter_NaviGpsModeControl > 90 && Parameter_NaviGpsModeControl < 200)
{
if(!J16Blinkcount--)
{
J16Blinkcount = Parameter_J16Timing-1;
if(J16Mask == 1) J16Mask = 128; else J16Mask /= 2;
if(J16Mask & EE_Parameter.UserParam1) J16_ON; else J16_OFF;
}
}
//Höhe an und AID
else
if(HoehenReglerAktiv > 0 && Parameter_NaviGpsModeControl < 100 )
{
if(!J16Blinkcount--)
{
J16Blinkcount = Parameter_J16Timing-1;
if(J16Mask == 1) J16Mask = 128; else J16Mask /= 2;
if(J16Mask & EE_Parameter.UserParam2) J16_ON; else J16_OFF;
}
}
else
//Höhe an und CH
if(HoehenReglerAktiv > 0 && Parameter_NaviGpsModeControl > 150 )
{
if(!J16Blinkcount--)
{
J16Blinkcount = Parameter_J16Timing-1;
if(J16Mask == 1) J16Mask = 128; else J16Mask /= 2;
if(J16Mask & EE_Parameter.UserParam3) J16_ON; else J16_OFF;
}
}
else
{
J16_ON;
}
if((EE_Parameter.J17Timing > 250) && (Parameter_J17Timing > 230)) {if(EE_Parameter.J17Bitmask & 128) J17_ON; else J17_OFF;}
else
if((EE_Parameter.J17Timing > 250) && (Parameter_J17Timing < 10)) {if(EE_Parameter.J17Bitmask & 128) J17_OFF; else J17_ON;}
else
if(!J17Blinkcount--)
{
J17Blinkcount = Parameter_J17Timing-1;
if(J17Mask == 1) J17Mask = 128; else J17Mask /= 2;
if(J17Mask & EE_Parameter.J17Bitmask) J17_ON; else J17_OFF;
}
}
}
/branches/V0.71h KiliPet/led.h
0,0 → 1,11
#include <avr/io.h>
 
#define J16_ON PORTC |= (1<<PORTC2)
#define J16_OFF PORTC &= ~(1<<PORTC2)
#define J16_TOGGLE PORTC ^= (1<<PORTC2)
#define J17_ON PORTC |= (1<<PORTC3)
#define J17_OFF PORTC &= ~(1<<PORTC3)
#define J17_TOGGLE PORTC ^= (1<<PORTC3)
 
extern void LED_Init(void);
extern void LED_Update(void);
/branches/V0.71h KiliPet/main.c
0,0 → 1,304
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + 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;
unsigned char SendVersionToNavi = 1;
// -- Parametersatz aus EEPROM lesen ---
// number [1..5]
void ReadParameterSet(unsigned char number, unsigned char *buffer, unsigned char length)
{
if((number > 5)||(number < 1)) number = 3;
eeprom_read_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * (number - 1)], length);
LED_Init();
}
 
// -- Parametersatz ins EEPROM schreiben ---
// number [1..5]
void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length)
{
if(number > 5) number = 5;
if(number < 1) return;
eeprom_write_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * (number - 1)], length);
SetActiveParamSetNumber(number);
LED_Init();
}
 
unsigned char GetActiveParamSetNumber(void)
{
unsigned char set;
set = eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET]);
if((set > 5) || (set < 1))
{
set = 3;
SetActiveParamSetNumber(set); // diesen Parametersatz als aktuell merken
}
return(set);
}
 
 
void SetActiveParamSetNumber(unsigned char number)
{
if(number > 5) number = 5;
if(number < 1) return;
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], number); // diesen Parametersatz als aktuell merken
}
 
 
void CalMk3Mag(void)
{
static unsigned char stick = 1;
 
if(PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > -20) stick = 0;
if((PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < -70) && !stick)
{
stick = 1;
WinkelOut.CalcState++;
if(WinkelOut.CalcState > 4)
{
// WinkelOut.CalcState = 0; // in Uart.c
beeptime = 1000;
}
else Piep(WinkelOut.CalcState);
}
DebugOut.Analog[19] = WinkelOut.CalcState;
}
 
//############################################################################
//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)
{
if(PINB & 0x02) PlatinenVersion = 13;
else PlatinenVersion = 11;
}
else
{
if(PINB & 0x02) PlatinenVersion = 20;
else PlatinenVersion = 10;
}
 
DDRC = 0x81; // SCL
DDRC |=0x40; // HEF4017 Reset
PORTC = 0xff; // Pullup SDA
DDRB = 0x1B; // LEDs und Druckoffset
PORTB = 0x01; // LED_Rot
DDRD = 0x3E; // Speaker & TXD & J3 J4 J5
DDRD |=0x80; // J7 -> Servo signal
PORTD = 0x77; // 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();
SPI_MasterInit();
 
sei();
 
printf("\n\rFlightControl\n\rHardware:%d.%d\n\rSoftware:V%d.%d%c ",PlatinenVersion/10,PlatinenVersion%10, VERSION_MAJOR, VERSION_MINOR,VERSION_PATCH + 'a');
printf("\n\r==============================");
 
GRN_ON;
 
 
ReadParameterSet(3, (unsigned char *) &EE_Parameter.Kanalbelegung[0], 9); // read only the first bytes
// valid Stick-Settings?
if(eeprom_read_byte(&EEPromArray[EEPROM_ADR_VALID]) == 255 || eeprom_read_byte(&EEPromArray[EEPROM_ADR_VALID]) < EE_DATENREVISION ||
EE_Parameter.Kanalbelegung[0] > 9 || EE_Parameter.Kanalbelegung[1] > 9 || EE_Parameter.Kanalbelegung[2] > 9 || EE_Parameter.Kanalbelegung[3] > 9)
{
printf("\n\rInit. EEPROM: Generating Default-Parameter and Stick-Settings...");
DefaultStickMapping();
}
else if(eeprom_read_byte(&EEPromArray[EEPROM_ADR_VALID]) != EE_DATENREVISION) printf("\n\rInit. EEPROM: Generating Default-Parameter using old Stick Settings");
 
if(eeprom_read_byte(&EEPromArray[EEPROM_ADR_VALID]) != EE_DATENREVISION)
{
DefaultKonstanten1();
for (unsigned char i=1;i<6;i++)
{
if(i==2) DefaultKonstanten2(); // Kamera
if(i==3) DefaultKonstanten3(); // Beginner
if(i>3) DefaultKonstanten2(); // Kamera
WriteParameterSet(i, (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE);
}
SetActiveParamSetNumber(3); // default-Setting
eeprom_write_byte(&EEPromArray[EEPROM_ADR_VALID], EE_DATENREVISION);
}
 
if(eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACC_NICK]) > 4)
{
printf("\n\rACC nicht abgeglichen!");
}
 
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;
ExternControl.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;
WinkelOut.Orientation = 1;
while (1)
{
 
if(UpdateMotor) // ReglerIntervall
{
UpdateMotor=0;
//PORTD |= 0x08;
if(WinkelOut.CalcState) CalMk3Mag();
else MotorRegler();
//PORTD &= ~0x08;
SendMotorData();
ROT_OFF;
if(PcZugriff) PcZugriff--;
else
{
ExternControl.Config = 0;
ExternStickNick = 0;
ExternStickRoll = 0;
ExternStickGier = 0;
}
if(SenderOkay) SenderOkay--;
if(!I2CTimeout)
{
I2CTimeout = 5;
i2c_reset();
if((BeepMuster == 0xffff) && MotorenEin)
{
beeptime = 10000;
BeepMuster = 0x0080;
}
}
else
{
I2CTimeout--;
ROT_OFF;
}
if(SIO_DEBUG && (!UpdateMotor || !MotorenEin))
{
DatenUebertragung();
BearbeiteRxDaten();
}
else BearbeiteRxDaten();
if(CheckDelay(timer))
{
if(UBat < EE_Parameter.UnterspannungsWarnung)
{
if(BeepMuster == 0xffff)
{
beeptime = 6000;
BeepMuster = 0x0300;
}
}
/* if(SendVersionToNavi)
{
SPI_StartTransmitPacket(SPI_CMD_VERSION);//#
SendVersionToNavi = 0;
}
else SPI_StartTransmitPacket(SPI_CMD_VALUE);//#
*/
SPI_StartTransmitPacket();//#
 
SendSPI = 4;
timer = SetDelay(20);
}
//if(UpdateMotor) DebugOut.Analog[26]++;
LED_Update();
}
if(!SendSPI) { SPI_TransmitByte(); }
}
return (1);
}
 
/branches/V0.71h KiliPet/main.h
0,0 → 1,106
#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)||(PlatinenVersion == 20)) PORTB &=~0x01; else PORTB |= 0x01;}
#define ROT_ON {if((PlatinenVersion == 10)||(PlatinenVersion == 20)) PORTB |= 0x01; else PORTB &=~0x01;}
#define ROT_FLASH PORTB ^= 0x01
#define GRN_OFF {if((PlatinenVersion < 12)) PORTB &=~0x02; else PORTB |= 0x02;}
#define GRN_ON {if((PlatinenVersion < 12)) PORTB |= 0x02; else PORTB &=~0x02;}
#define GRN_FLASH PORTB ^= 0x02
 
#define F_CPU SYSCLK
//#ifndef F_CPU
//#error ################## F_CPU nicht definiert oder ungültig #############
//#endif
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#define EE_DATENREVISION 73 // wird angepasst, wenn sich die EEPROM-Daten geändert haben
 
#define EEPROM_ADR_VALID 1
#define EEPROM_ADR_ACTIVE_SET 2
#define EEPROM_ADR_LAST_OFFSET 3
 
#define EEPROM_ADR_ACC_NICK 4
#define EEPROM_ADR_ACC_ROLL 6
#define EEPROM_ADR_ACC_Z 8
 
#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_ACHSENKOPPLUNG_AKTIV 0x40
#define CFG_DREHRATEN_BEGRENZER 0x80
 
#define CFG_LOOP_OBEN 0x01
#define CFG_LOOP_UNTEN 0x02
#define CFG_LOOP_LINKS 0x04
#define CFG_LOOP_RECHTS 0x08
#define CFG_HIGHT_3SWITCH 0x10
 
//#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 unsigned char SendVersionToNavi;
void ReadParameterSet (unsigned char number, unsigned char *buffer, unsigned char length);
void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length);
extern unsigned char GetActiveParamSetNumber(void);
void SetActiveParamSetNumber(unsigned char number);
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 "timer0.h"
#include "uart.h"
#include "analog.h"
#include "twimaster.h"
#include "menu.h"
#include "rc.h"
#include "fc.h"
#include "gps.h"
#include "spi.h"
#include "led.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/V0.71h KiliPet/makefile
0,0 → 1,433
#--------------------------------------------------------------------
# MCU name
MCU = atmega644
F_CPU = 20000000
#-------------------------------------------------------------------
VERSION_MAJOR = 0
VERSION_MINOR = 71
VERSION_PATCH = 7
 
VERSION_SERIAL_MAJOR = 10 # Serial Protocol
VERSION_SERIAL_MINOR = 0 # Serial Protocol
NC_SPI_COMPATIBLE = 3 # Navi-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 ($(MCU), atmega644p)
FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m
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).
 
ifeq ($(VERSION_PATCH), 0)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)a
endif
ifeq ($(VERSION_PATCH), 1)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)b
endif
ifeq ($(VERSION_PATCH), 2)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)c
endif
ifeq ($(VERSION_PATCH), 3)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)d
endif
ifeq ($(VERSION_PATCH), 4)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)e
endif
ifeq ($(VERSION_PATCH), 5)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)f
endif
ifeq ($(VERSION_PATCH), 6)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)g
endif
ifeq ($(VERSION_PATCH), 7)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)h
endif
ifeq ($(VERSION_PATCH), 8)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)i
endif
ifeq ($(VERSION_PATCH), 9)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)j
endif
ifeq ($(VERSION_PATCH), 10)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)k
endif
 
# 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 spi.c led.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_MAJOR=$(VERSION_MAJOR) -DVERSION_MINOR=$(VERSION_MINOR) -DVERSION_PATCH=$(VERSION_PATCH) -DVERSION_SERIAL_MAJOR=$(VERSION_SERIAL_MAJOR) -DVERSION_SERIAL_MINOR=$(VERSION_SERIAL_MINOR) -DNC_SPI_COMPATIBLE=$(NC_SPI_COMPATIBLE)
 
 
# 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 = dt006
#AVRDUDE_PROGRAMMER = stk200
#AVRDUDE_PROGRAMMER = ponyser
AVRDUDE_PROGRAMMER = avrispv2
#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_PORT = usb # programmer connected to USB
 
#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 -c avrispv2 -P usb -p m32 -U flash:w:blink.hex
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/V0.71h KiliPet/menu.c
0,0 → 1,150
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + 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 MaxMenue = 11;
unsigned char MenuePunkt = 0;
unsigned char RemoteKeys = 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)
{
 
if(MenuePunkt > MaxMenue) MenuePunkt = MaxMenue;
 
if(RemoteKeys & KEY1) { if(MenuePunkt) MenuePunkt--; else MenuePunkt = MaxMenue;}
if(RemoteKeys & KEY2) { if(MenuePunkt == MaxMenue) MenuePunkt = 0; else MenuePunkt++;}
if((RemoteKeys & KEY1) && (RemoteKeys & KEY2)) MenuePunkt = 0;
LcdClear();
if(MenuePunkt < 10) {LCD_printfxy(17,0,"[%i]",MenuePunkt);}
else {LCD_printfxy(16,0,"[%i]",MenuePunkt);};
 
 
switch(MenuePunkt)
{
case 0:
LCD_printfxy(0,0,"+ MikroKopter +");
LCD_printfxy(0,1,"HW:V%d.%d SW:%d.%d%c",PlatinenVersion/10,PlatinenVersion%10, VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH +'a');
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");
if(PlatinenVersion == 10)
{
LCD_printfxy(0,1,"Nick %4i (%3i)",AdWertNick - AdNeutralNick, AdNeutralNick);
LCD_printfxy(0,2,"Roll %4i (%3i)",AdWertRoll - AdNeutralRoll, AdNeutralRoll);
LCD_printfxy(0,3,"Gier %4i (%3i)",AdNeutralGier - AdWertGier, AdNeutralGier);
}
else
if((PlatinenVersion == 11) || (PlatinenVersion == 20))
{
LCD_printfxy(0,1,"Nick %4i (%3i)",AdWertNick - AdNeutralNick, AdNeutralNick/2);
LCD_printfxy(0,2,"Roll %4i (%3i)",AdWertRoll - AdNeutralRoll, AdNeutralRoll/2);
LCD_printfxy(0,3,"Gier %4i (%3i)",AdNeutralGier - AdWertGier, AdNeutralGier/2);
}
else
if(PlatinenVersion == 13)
{
LCD_printfxy(0,1,"Nick %4i (%3i)(%3i)",AdWertNick - AdNeutralNick, AdNeutralNick/2,AnalogOffsetNick);
LCD_printfxy(0,2,"Roll %4i (%3i)(%3i)",AdWertRoll - AdNeutralRoll, AdNeutralRoll/2,AnalogOffsetRoll);
LCD_printfxy(0,3,"Gier %4i (%3i)(%3i)",AdNeutralGier - AdWertGier, AdNeutralGier/2,AnalogOffsetGier);
}
 
break;
case 6:
LCD_printfxy(0,0,"ACC - Sensor");
LCD_printfxy(0,1,"Nick %4i (%3i)",AdWertAccNick,NeutralAccX);
LCD_printfxy(0,2,"Roll %4i (%3i)",AdWertAccRoll,NeutralAccY);
LCD_printfxy(0,3,"Hoch %4i (%3i)",Mittelwert_AccHoch/*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;
case 11:
LCD_printfxy(0,0,"ExternControl " );
LCD_printfxy(0,1,"Ni:%4i Ro:%4i ",ExternControl.Nick,ExternControl.Roll);
LCD_printfxy(0,2,"Gs:%4i Gi:%4i ",ExternControl.Gas,ExternControl.Gier);
LCD_printfxy(0,3,"Hi:%4i Cf:%4i ",ExternControl.Hight,ExternControl.Config);
break;
default: MaxMenue = MenuePunkt - 1;
MenuePunkt = 0;
break;
}
RemoteKeys = 0;
}
/branches/V0.71h KiliPet/menu.h
0,0 → 1,9
extern void Menu(void);
extern void LcdClear(void);
extern char DisplayBuff[80];
extern unsigned char DispPtr;
 
extern unsigned char MaxMenue;
extern unsigned char MenuePunkt;
extern unsigned char RemoteKeys;
 
/branches/V0.71h KiliPet/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/V0.71h KiliPet/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/V0.71h KiliPet/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
 
 
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/V0.71h KiliPet/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,tmp;
static int index;
signal = (unsigned int) ICR1 - AltICR;
AltICR = ICR1;
//Syncronisationspause?
// if((signal > (int) Parameter_UserParam2 * 10) && (signal < 8000))
if((signal > 1100) && (signal < 8000))
{
if(index >= 4) NewPpmData = 0; // Null bedeutet: Neue Daten
index = 1;
}
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;}
// tmp = (7 * (PPM_in[index]) + signal) / 8;
tmp = (3 * (PPM_in[index]) + signal) / 4;
if(tmp > signal+1) tmp--; else
if(tmp < signal-1) tmp++;
if(SenderOkay >= 195) PPM_diff[index] = ((tmp - PPM_in[index]) / 3) * 3;
else PPM_diff[index] = 0;
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/V0.71h KiliPet/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/V0.71h KiliPet/spi.c
0,0 → 1,290
// ######################## SPI - FlightCtrl ###################
#include "main.h"
 
 
//struct str_ToNaviCtrl_Version ToNaviCtrl_Version;
//struct str_FromNaviCtrl_Version FromNaviCtrl_Version;
struct str_ToNaviCtrl ToNaviCtrl;
struct str_FromNaviCtrl FromNaviCtrl;
struct str_FromNaviCtrl_Value FromNaviCtrl_Value;
struct str_SPI_VersionInfo SPI_VersionInfo;
 
unsigned char SPI_BufferIndex;
unsigned char SPI_RxBufferIndex;
 
volatile unsigned char SPI_Buffer[sizeof(FromNaviCtrl)];
unsigned char *SPI_TX_Buffer;
 
unsigned char SPITransferCompleted, SPI_ChkSum;
unsigned char SPI_RxDataValid;
 
unsigned char SPI_CommandSequence[] = { SPI_CMD_USER, SPI_CMD_STICK, SPI_CMD_PARAMETER1, SPI_CMD_STICK, SPI_CMD_MISC, SPI_CMD_VERSION };
unsigned char SPI_CommandCounter = 0;
 
#ifdef USE_SPI_COMMUNICATION
 
//------------------------------------------------------
void SPI_MasterInit(void)
{
DDR_SPI |= (1<<DD_MOSI)|(1<<DD_SCK); // Set MOSI and SCK output, all others input
SLAVE_SELECT_DDR_PORT |= (1 << SPI_SLAVE_SELECT);
 
SPCR = (1<<SPE)|(1<<MSTR)|(1<<SPR1)|(0<<SPR0)|(0<<SPIE); // Enable SPI, Master, set clock rate fck/64
SPSR = 0;//(1<<SPI2X);
 
SLAVE_SELECT_PORT |= (1 << SPI_SLAVE_SELECT);
SPITransferCompleted = 1;
 
//SPDR = 0x00; // dummy write
 
ToNaviCtrl.Sync1 = 0xAA;
ToNaviCtrl.Sync2 = 0x83;
 
ToNaviCtrl.Command = SPI_CMD_USER;
ToNaviCtrl.IntegralNick = 0;
ToNaviCtrl.IntegralRoll = 0;
SPI_RxDataValid = 0;
 
SPI_VersionInfo.Major = VERSION_MAJOR;
SPI_VersionInfo.Minor = VERSION_MINOR;
SPI_VersionInfo.Patch = VERSION_PATCH;
SPI_VersionInfo.Compatible = NC_SPI_COMPATIBLE;
}
 
//------------------------------------------------------
void SPI_StartTransmitPacket(void)
{
//if ((SLAVE_SELECT_PORT & (1 << SPI_SLAVE_SELECT)) == 0) return; // transfer of prev. packet not completed
if (!SPITransferCompleted) return;
// _delay_us(30);
 
SLAVE_SELECT_PORT &= ~(1 << SPI_SLAVE_SELECT); // SelectSlave
SPI_TX_Buffer = (unsigned char *) &ToNaviCtrl;
 
ToNaviCtrl.Command = SPI_CommandSequence[SPI_CommandCounter++];
if (SPI_CommandCounter >= sizeof(SPI_CommandSequence)) SPI_CommandCounter = 0;
 
SPITransferCompleted = 0;
UpdateSPI_Buffer(); // update buffer
 
SPI_BufferIndex = 1;
//ebugOut.Analog[16]++;
// -- Debug-Output ---
//----
asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop");
asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop");
asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop");
ToNaviCtrl.Chksum = ToNaviCtrl.Sync1;
SPDR = ToNaviCtrl.Sync1; // Start transmission
// SLAVE_SELECT_PORT |= (1 << SPI_SLAVE_SELECT); // DeselectSlave
 
}
 
//------------------------------------------------------
//SIGNAL(SIG_SPI)
void SPI_TransmitByte(void)
{
static unsigned char SPI_RXState = 0;
unsigned char rxdata;
static unsigned char rxchksum;
 
if (SPITransferCompleted) return;
if (!(SPSR & (1 << SPIF))) return;
SendSPI = 4;
 
// _delay_us(30);
SLAVE_SELECT_PORT |= (1 << SPI_SLAVE_SELECT); // DeselectSlave
 
rxdata = SPDR;
switch ( SPI_RXState)
{
case 0:
 
SPI_RxBufferIndex = 0;
//DebugOut.Analog[17]++;
rxchksum = rxdata;
if (rxdata == 0x81 ) { SPI_RXState = 1; } // 1. Syncbyte ok
 
break;
 
case 1:
if (rxdata == 0x55) { rxchksum += rxdata; SPI_RXState = 2; } // 2. Syncbyte ok
else SPI_RXState = 0;
//DebugOut.Analog[18]++;
break;
 
case 2:
SPI_Buffer[SPI_RxBufferIndex++]= rxdata; // get data
//DebugOut.Analog[19]++;
if (SPI_RxBufferIndex >= sizeof(FromNaviCtrl))
{
 
if (rxdata == rxchksum)
{
unsigned char *ptr = (unsigned char *)&FromNaviCtrl;
 
memcpy(ptr, (unsigned char *) SPI_Buffer, sizeof(SPI_Buffer));
 
SPI_RxDataValid = 1;
}
else SPI_RxDataValid = 0;
 
SPI_RXState = 0;
}
else rxchksum += rxdata;
break;
 
}
 
if (SPI_BufferIndex < sizeof(ToNaviCtrl))
{
SLAVE_SELECT_PORT &= ~(1 << SPI_SLAVE_SELECT); // SelectSlave
asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop");
asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop");
asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop");
 
SPDR = SPI_TX_Buffer[SPI_BufferIndex];
ToNaviCtrl.Chksum += SPI_TX_Buffer[SPI_BufferIndex];
// SLAVE_SELECT_PORT |= (1 << SPI_SLAVE_SELECT); // DeselectSlave
 
}
else SPITransferCompleted = 1;
 
SPI_BufferIndex++;
}
 
 
//------------------------------------------------------
void UpdateSPI_Buffer(void)
{
static unsigned char i =0;
signed int tmp;
cli();
 
ToNaviCtrl.IntegralNick = (int) (IntegralNick / 108);
ToNaviCtrl.IntegralRoll = (int) (IntegralRoll / 108);
ToNaviCtrl.GyroCompass = ErsatzKompass / GIER_GRAD_FAKTOR;
ToNaviCtrl.AccNick = (int) ACC_AMPLIFY * (NaviAccNick / NaviCntAcc);
ToNaviCtrl.AccRoll = (int) ACC_AMPLIFY * (NaviAccRoll / NaviCntAcc);
NaviCntAcc = 0; NaviAccNick = 0; NaviAccRoll = 0;
// ToNaviCtrl.User8 = Parameter_UserParam8;
// ToNaviCtrl.CalState = WinkelOut.CalcState;
 
switch(ToNaviCtrl.Command) //
{
case SPI_CMD_USER:
ToNaviCtrl.Param.Byte[0] = Parameter_UserParam1;
ToNaviCtrl.Param.Byte[1] = Parameter_UserParam2;
ToNaviCtrl.Param.Byte[2] = Parameter_UserParam3;
ToNaviCtrl.Param.Byte[3] = Parameter_UserParam4;
ToNaviCtrl.Param.Byte[4] = Parameter_UserParam5;
ToNaviCtrl.Param.Byte[5] = Parameter_UserParam6;
ToNaviCtrl.Param.Byte[6] = Parameter_UserParam7;
ToNaviCtrl.Param.Byte[7] = Parameter_UserParam8;
ToNaviCtrl.Param.Byte[8] = (unsigned char) MikroKopterFlags;
MikroKopterFlags &= ~(FLAG_CALIBRATE | FLAG_START);
ToNaviCtrl.Param.Byte[9] = (unsigned char) UBat;
ToNaviCtrl.Param.Byte[10] =(unsigned char) EE_Parameter.UnterspannungsWarnung;
ToNaviCtrl.Param.Byte[11] =(unsigned char) eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET]);
break;
case SPI_CMD_PARAMETER1:
ToNaviCtrl.Param.Byte[0] = EE_Parameter.NaviGpsModeControl; // Parameters for the Naviboard
ToNaviCtrl.Param.Byte[1] = EE_Parameter.NaviGpsGain;
ToNaviCtrl.Param.Byte[2] = EE_Parameter.NaviGpsP;
ToNaviCtrl.Param.Byte[3] = EE_Parameter.NaviGpsI;
ToNaviCtrl.Param.Byte[4] = EE_Parameter.NaviGpsD;
ToNaviCtrl.Param.Byte[5] = EE_Parameter.NaviGpsACC;
ToNaviCtrl.Param.Byte[6] = EE_Parameter.NaviGpsMinSat;
ToNaviCtrl.Param.Byte[7] = EE_Parameter.NaviStickThreshold;
ToNaviCtrl.Param.Byte[8] = EE_Parameter.NaviOperatingRadius;
ToNaviCtrl.Param.Byte[9] = EE_Parameter.NaviWindCorrection;
ToNaviCtrl.Param.Byte[10] = EE_Parameter.NaviSpeedCompensation;
ToNaviCtrl.Param.Byte[11] = EE_Parameter.NaviAngleLimitation;
break;
case SPI_CMD_STICK:
tmp = PPM_in[EE_Parameter.Kanalbelegung[K_GAS]]; if(tmp > 127) tmp = 127; else if(tmp < -127) tmp = -127;
ToNaviCtrl.Param.Byte[0] = (char) tmp;
tmp = PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]; if(tmp > 127) tmp = 127; else if(tmp < -127) tmp = -127;
ToNaviCtrl.Param.Byte[1] = (char) tmp;
tmp = PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]; if(tmp > 127) tmp = 127; else if(tmp < -127) tmp = -127;
ToNaviCtrl.Param.Byte[2] = (char) tmp;
tmp = PPM_in[EE_Parameter.Kanalbelegung[K_NICK]]; if(tmp > 127) tmp = 127; else if(tmp < -127) tmp = -127;
ToNaviCtrl.Param.Byte[3] = (char) tmp;
ToNaviCtrl.Param.Byte[4] = (unsigned char) Poti1;
ToNaviCtrl.Param.Byte[5] = (unsigned char) Poti2;
ToNaviCtrl.Param.Byte[6] = (unsigned char) Poti3;
ToNaviCtrl.Param.Byte[7] = (unsigned char) Poti4;
ToNaviCtrl.Param.Byte[8] = (unsigned char) SenderOkay;
break;
case SPI_CMD_MISC:
if(WinkelOut.CalcState > 5)
{
WinkelOut.CalcState = 0;
ToNaviCtrl.Param.Byte[0] = 5;
}
else ToNaviCtrl.Param.Byte[0] = WinkelOut.CalcState;
ToNaviCtrl.Param.Int[1] = HoehenWert;
break;
 
case SPI_CMD_VERSION:
ToNaviCtrl.Param.Byte[0] = SPI_VersionInfo.Major;
ToNaviCtrl.Param.Byte[1] = SPI_VersionInfo.Minor;
ToNaviCtrl.Param.Byte[2] = SPI_VersionInfo.Patch;
ToNaviCtrl.Param.Byte[3] = SPI_VersionInfo.Compatible;
break;
}
 
sei();
 
if (SPI_RxDataValid)
{
if(abs(FromNaviCtrl.GPS_Nick) < 512 && abs(FromNaviCtrl.GPS_Roll) < 512 && (EE_Parameter.GlobalConfig & CFG_GPS_AKTIV))
{
GPS_Nick = FromNaviCtrl.GPS_Nick;
GPS_Roll = FromNaviCtrl.GPS_Roll;
}
if(FromNaviCtrl.CompassValue <= 360) KompassValue = FromNaviCtrl.CompassValue;
KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180;
 
if(FromNaviCtrl.BeepTime > beeptime && !WinkelOut.CalcState) beeptime = FromNaviCtrl.BeepTime;
 
switch (FromNaviCtrl.Command)
{
case SPI_KALMAN:
FromNaviCtrl_Value.Kalman_K = FromNaviCtrl.Param.Byte[0];
FromNaviCtrl_Value.Kalman_MaxFusion = FromNaviCtrl.Param.Byte[1];
FromNaviCtrl_Value.Kalman_MaxDrift = FromNaviCtrl.Param.Byte[2];
break;
 
case SPI_CMD_OSD_DATA:
FromNaviCtrl_Value.OsdBar = FromNaviCtrl.Param.Byte[0];
FromNaviCtrl_Value.Distance = FromNaviCtrl.Param.Int[1];
break;
 
case SPI_CMD_GPS_POS:
// ToFlightCtrl.Param.Long[0] = GPS_Data.Longitude;
// ToFlightCtrl.Param.Long[1] = GPS_Data.Latitude;
break;
 
case SPI_CMD_GPS_TARGET:
// ToFlightCtrl.Param.Long[0] = GPS_Data.TargetLongitude;
// ToFlightCtrl.Param.Long[1] = GPS_Data.TargetLatitude;
break;
 
default:
break;
}
}
else
{
// KompassValue = 0;
// KompassRichtung = 0;
 
GPS_Nick = 0;
GPS_Roll = 0;
}
}
 
#endif
 
 
/branches/V0.71h KiliPet/spi.h
0,0 → 1,144
// ######################## SPI - FlightCtrl ###################
#ifndef _SPI_H
#define _SPI_H
 
#include <util/delay.h>
 
#define USE_SPI_COMMUNICATION
 
#define SPI_PROTOCOL_COMP 1
 
//-----------------------------------------
#define DDR_SPI DDRB
#define DD_SS PB4
#define DD_SCK PB7
#define DD_MOSI PB5
#define DD_MISO PB6
 
// for compatibility reasons gcc3.x <-> gcc4.x
#ifndef SPCR
#define SPCR SPCR0
#endif
#ifndef SPE
#define SPE SPE0
#endif
#ifndef MSTR
#define MSTR MSTR0
#endif
#ifndef SPR1
#define SPR1 SPR01
#endif
#ifndef SPR0
#define SPR0 SPR00
#endif
#ifndef SPIE
#define SPIE SPIE0
#endif
#ifndef SPDR
#define SPDR SPDR0
#endif
#ifndef SPIF
#define SPIF SPIF0
#endif
#ifndef SPSR
#define SPSR SPSR0
#endif
// -------------------------
 
#define SLAVE_SELECT_DDR_PORT DDRC
#define SLAVE_SELECT_PORT PORTC
#define SPI_SLAVE_SELECT PC5
 
 
#define SPI_CMD_USER 10
#define SPI_CMD_STICK 11
#define SPI_CMD_MISC 12
#define SPI_CMD_PARAMETER1 13
#define SPI_CMD_VERSION 14
 
struct str_ToNaviCtrl
{
unsigned char Sync1, Sync2;
unsigned char Command;
signed int IntegralNick;
signed int IntegralRoll;
signed int AccNick;
signed int AccRoll;
signed int GyroCompass;
signed int GyroNick;
signed int GyroRoll;
signed int GyroGier;
union
{ char Byte[12];
int Int[6];
long Long[3];
float Float[3];
} Param;
unsigned char Chksum;
};
 
#define SPI_CMD_OSD_DATA 100
#define SPI_CMD_GPS_POS 101
#define SPI_CMD_GPS_TARGET 102
#define SPI_KALMAN 103
 
struct str_FromNaviCtrl
{
unsigned char Command;
signed int GPS_Nick;
signed int GPS_Roll;
signed int GPS_Gier;
signed int CompassValue;
signed int Status;
unsigned int BeepTime;
union
{ char Byte[12];
int Int[6];
long Long[3];
float Float[3];
} Param;
unsigned char Chksum;
};
 
struct str_FromNaviCtrl_Value
{
signed int OsdBar;
signed int Distance;
signed char Kalman_K;
signed char Kalman_MaxDrift;
signed char Kalman_MaxFusion;
};
 
struct str_SPI_VersionInfo
{
unsigned char Major;
unsigned char Minor;
unsigned char Patch;
unsigned char Compatible;
};
 
#ifdef USE_SPI_COMMUNICATION
 
extern struct str_FromNaviCtrl_Value FromNaviCtrl_Value;
extern struct str_ToNaviCtrl ToNaviCtrl;
extern struct str_FromNaviCtrl FromNaviCtrl;
extern unsigned char SPI_CommandCounter;
 
//#define SPI_CMD_VALUE 0x03
 
extern void SPI_MasterInit(void);
extern void SPI_StartTransmitPacket(void);
extern void UpdateSPI_Buffer(void);
extern void SPI_TransmitByte(void);
#else
 
 
// -------------------------------- Dummy -----------------------------------------
#define SPI_MasterInit() ;
#define SPI_StartTransmitPacket() ;
#define UpdateSPI_Buffer() ;
#define SPI_TransmitByte() ;
#endif
 
 
#endif
/branches/V0.71h KiliPet/timer0.c
0,0 → 1,198
#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;
volatile unsigned char SendSPI = 0;
volatile unsigned int ServoState = 40;
 
unsigned int BeepMuster = 0xffff;
unsigned 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(SendSPI) SendSPI--;
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)
{
if(PINC & 0x10)
{
cntKompass++;
}
else
{
if((cntKompass) && (cntKompass < 362))
{
cntKompass += cntKompass / 41;
if(cntKompass > 10) KompassValue = cntKompass - 10; else KompassValue = 0;
}
// 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); // clk/256
TCCR2B=(0<<CS20)|(0<<CS21)|(1<<CS22); // clk/64
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));
}
 
void Delay_ms_Mess(unsigned int w)
{
unsigned int akt;
akt = SetDelay(w);
while (!CheckDelay(akt)) ANALOG_ON;
}
 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Servo ansteuern
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SIGNAL(SIG_OVERFLOW2)
{
if (ServoState > 0) PORTD |= 0x80;
else PORTD &= ~0x80;
TCCR2A =3;
TIMSK2 &= ~_BV(TOIE2);
}
 
SIGNAL(SIG_OUTPUT_COMPARE2A)
{
static unsigned char postPulse = 0x80;
static int filterServo = 100;
#define MULTIPLIER 4
if(ServoState == 4)
{
ServoValue = 0x0030; // Offset Part1
filterServo = (filterServo * 3 + (int) Parameter_ServoNickControl * 2)/4;
ServoValue += filterServo;
if(EE_Parameter.ServoNickCompInvert & 0x01) ServoValue += ((long) ((long)EE_Parameter.ServoNickComp * IntegralNick) / 128L )/ (512L/MULTIPLIER);
else ServoValue -= ((long) ((long)EE_Parameter.ServoNickComp * IntegralNick) / 128L) / (512L/MULTIPLIER);
if((ServoValue) < ((int)EE_Parameter.ServoNickMin*3)) ServoValue = (int)EE_Parameter.ServoNickMin*3;
else if((ServoValue) > ((int)EE_Parameter.ServoNickMax*3)) ServoValue = (int)EE_Parameter.ServoNickMax*3;
DebugOut.Analog[20] = ServoValue;
if ((ServoValue % 255) < 45) { ServoValue+= 77; postPulse = 0x60 - 77; } else postPulse = 0x60;
OCR2A = 255-(ServoValue % 256);
TCCR2A=(1<<COM2A1)|(1<<COM2A0)|3;
}
else if ((ServoState > 0) && (ServoState < 4))
{
if(ServoValue > 255)
{ PORTD |= 0x80;
TCCR2A =3;
ServoValue -= 255;
}
else
{
TCCR2A=(1<<COM2A1)|(0<<COM2A0)|3;
OCR2A = postPulse; // Offset Part2
ServoState = 1;
}
}
else if (ServoState == 0)
{
ServoState = (int) EE_Parameter.ServoNickRefresh * MULTIPLIER;
PORTD&=~0x80;
TCCR2A = 3;
}
ServoState--;
 
}
/branches/V0.71h KiliPet/timer0.h
0,0 → 1,19
 
#define TIMER_TEILER CK8
#define TIMER_RELOAD_VALUE 250
#define HEF4017R_ON PORTC ^= (1<<PORTC6)
#define HEF4017R_OFF PORTC &= ~(1<<PORTC6)
 
void Timer_Init(void);
void Delay_ms(unsigned int);
void Delay_ms_Mess(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 unsigned int ServoValue;
extern unsigned int BeepMuster;
extern volatile unsigned char SendSPI;
/branches/V0.71h KiliPet/twimaster.c
0,0 → 1,204
/*############################################################################
############################################################################*/
 
#include "main.h"
 
volatile 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;
break;
case 8: // Gyro-Offset
i2c_write_byte(0x98); // Address of the DAC
break;
case 9:
i2c_write_byte(0x10); // Update Channel A
break;
case 10:
i2c_write_byte(AnalogOffsetNick); // Value
break;
case 11:
i2c_write_byte(0x80); // Value
break;
case 12:
i2c_stop();
I2CTimeout = 10;
i2c_start();
break;
case 13:
i2c_write_byte(0x98); // Address of the DAC
break;
case 14:
i2c_write_byte(0x12); // Update Channel B
break;
case 15:
i2c_write_byte(AnalogOffsetRoll); // Value
break;
case 16:
i2c_write_byte(0x80); // Value
break;
case 17:
i2c_stop();
I2CTimeout = 10;
i2c_start();
break;
case 18:
i2c_write_byte(0x98); // Address of the DAC
break;
case 19:
i2c_write_byte(0x14); // Update Channel C
break;
case 20:
i2c_write_byte(AnalogOffsetGier); // Value
break;
case 21:
i2c_write_byte(0x80); // Value
break;
case 22:
i2c_stop();
I2CTimeout = 10;
twi_state = 0;
break;
}
TWCR |= 0x80;
}
/branches/V0.71h KiliPet/twimaster.h
0,0 → 1,33
/*############################################################################
############################################################################*/
 
#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 volatile unsigned char twi_state;
extern unsigned char motor;
extern unsigned char motorread;
extern unsigned char motor_rx[8];
 
void i2c_reset(void);
extern void i2c_init (void); // I2C initialisieren
extern char i2c_start (void); // Start I2C
extern void i2c_stop (void); // Stop I2C
extern char i2c_write_byte (char byte); // 1 Byte schreiben
extern void i2c_reset(void);
 
#endif
/branches/V0.71h KiliPet/uart.c
0,0 → 1,533
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Copyright (c) 04.2007 Holger Buss
// + only for non-profit use
// + www.MikroKopter.com
// + see the File "License.txt" for further Informations
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#include <stdarg.h>
#include <string.h>
#include "main.h"
#include "uart.h"
 
 
#define FC_ADDRESS 1
#define NC_ADDRESS 2
#define MK3MAG_ADDRESS 3
 
unsigned char GetExternalControl = 0,DebugDisplayAnforderung1 = 0, DebugDisplayAnforderung = 0,DebugDataAnforderung = 0,GetVersionAnforderung = 0, GetPPMChannelAnforderung = 0;
unsigned char DisplayLine = 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 char *pRxData = 0;
unsigned char RxDataLen = 0;
unsigned volatile char PC_DebugTimeout = 0;
 
unsigned char DebugTextAnforderung = 255;
unsigned char PcZugriff = 100;
unsigned char MotorTest[4] = {0,0,0,0};
unsigned char MeineSlaveAdresse = 1; // Flight-Ctrl
unsigned char ConfirmFrame;
struct str_DebugOut DebugOut;
struct str_ExternControl ExternControl;
struct str_VersionInfo VersionInfo;
struct str_WinkelOut WinkelOut;
 
int Debug_Timer,Kompass_Timer;
unsigned int DebugDataIntervall = 200;
 
const unsigned char ANALOG_TEXT[32][16] =
{
//1234567890123456
"IntegralNick ", //0
"IntegralRoll ",
"AccNick ",
"AccRoll ",
"GyroGier ",
"HoehenWert ", //5
"AccZ ",
"Gas ",
"KompassValue ",
"Spannung ",
"Empfang ", //10
"Ersatzkompass ",
"Motor_Vorne ",
"Motor_Hinten ",
"Motor_Links ",
"Motor_Rechts ", //15
" ",
"Distance ",
"OsdBar ",
"MK3Mag CalState ",
"Servo ", //20
"Nick ",
"Roll ",
" ",
" ",
" ", //25
" ",
"Kalman_MaxDrift ",
" ",
"Kalman K ",
"GPS_Nick ", //30
"GPS_Roll "
};
 
 
 
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++ 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;
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 + 1;
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 address, unsigned char BufferAnzahl, ...) //unsigned char *snd, unsigned char len)
{
va_list ap;
unsigned int pt = 0;
unsigned char a,b,c;
unsigned char ptr = 0;
 
unsigned char *snd = 0;
int len = 0;
 
SendeBuffer[pt++] = '#'; // Startzeichen
SendeBuffer[pt++] = 'a' + address; // Adresse (a=0; b=1,...)
SendeBuffer[pt++] = cmd; // Commando
 
va_start(ap, BufferAnzahl);
if(BufferAnzahl)
{
snd = va_arg(ap, unsigned char*);
len = va_arg(ap, int);
ptr = 0;
BufferAnzahl--;
}
while(len)
{
if(len)
{
a = snd[ptr++];
len--;
if((!len) && BufferAnzahl)
{
snd = va_arg(ap, unsigned char*);
len = va_arg(ap, int);
ptr = 0;
BufferAnzahl--;
}
}
else a = 0;
if(len)
{
b = snd[ptr++];
len--;
if((!len) && BufferAnzahl)
{
snd = va_arg(ap, unsigned char*);
len = va_arg(ap, int);
ptr = 0;
BufferAnzahl--;
}
}
else b = 0;
if(len)
{
c = snd[ptr++];
len--;
if((!len) && BufferAnzahl)
{
snd = va_arg(ap, unsigned char*);
len = va_arg(ap, int);
ptr = 0;
BufferAnzahl--;
}
}
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);
}
va_end(ap);
AddCRC(pt);
}
 
 
// --------------------------------------------------------------------------
void Decode64(void) // die daten werden im rx buffer dekodiert, das geht nur, weil aus 4 byte immer 3 gemacht werden.
{
unsigned char a,b,c,d;
unsigned char x,y,z;
unsigned char ptrIn = 3; // start at begin of data block
unsigned char ptrOut = 3;
unsigned char len = AnzahlEmpfangsBytes - 6; // von der Gesamtbytezahl eines Frames gehen 3 Bytes des Headers ('#',Addr, Cmd) und 3 Bytes des Footers (CRC1, CRC2, '\r') ab.
 
while(len)
{
a = RxdBuffer[ptrIn++] - '=';
b = RxdBuffer[ptrIn++] - '=';
c = RxdBuffer[ptrIn++] - '=';
d = RxdBuffer[ptrIn++] - '=';
 
x = (a << 2) | (b >> 4);
y = ((b & 0x0f) << 4) | (c >> 2);
z = ((c & 0x03) << 6) | d;
 
if(len--) RxdBuffer[ptrOut++] = x; else break;
if(len--) RxdBuffer[ptrOut++] = y; else break;
if(len--) RxdBuffer[ptrOut++] = z; else break;
}
pRxData = (unsigned char*)&RxdBuffer[3]; // decodierte Daten beginnen beim 4. Byte
RxDataLen = ptrOut - 3; // wie viele Bytes wurden dekodiert?
 
}
 
// --------------------------------------------------------------------------
void BearbeiteRxDaten(void)
{
if(!NeuerDatensatzEmpfangen) return;
 
unsigned char tempchar1, tempchar2;
Decode64(); // dekodiere datenblock im Empfangsbuffer
switch(RxdBuffer[1]-'a') // check for Slave Address
{
case FC_ADDRESS: // FC special commands
 
switch(RxdBuffer[2])
{
case 'K':// Kompasswert
memcpy((unsigned char *)&KompassValue , (unsigned char *)pRxData, sizeof(KompassValue));
KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180;
break;
 
case 't':// Motortest
memcpy(&MotorTest[0], (unsigned char *)pRxData, sizeof(MotorTest));
//while(!UebertragungAbgeschlossen);
//SendOutData('T', MeineSlaveAdresse, 0);
PcZugriff = 255;
break;
 
case 'p': // get PPM Channels
GetPPMChannelAnforderung = 1;
break;
 
case 'q':// "Get"-Anforderung für Settings
// Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen
if(pRxData[0] == 0xFF)
{
pRxData[0] = GetActiveParamSetNumber();
}
// limit settings range
if(pRxData[0] < 1) pRxData[0] = 1; // limit to 5
else if(pRxData[0] > 5) pRxData[0] = 5; // limit to 5
// load requested parameter set
ReadParameterSet(pRxData[0], (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE);
 
while(!UebertragungAbgeschlossen);
tempchar1 = pRxData[0];
tempchar2 = EE_DATENREVISION;
SendOutData('Q', FC_ADDRESS, 3, &tempchar1, sizeof(tempchar1), &tempchar2, sizeof(tempchar2), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE);
break;
 
case 's': // Parametersatz speichern
if((1 <= pRxData[0]) && (pRxData[0] <= 5) && (pRxData[1] == EE_DATENREVISION)) // check for setting to be in range
{
memcpy((unsigned char *) &EE_Parameter.Kanalbelegung[0], (unsigned char *)&pRxData[2], STRUCT_PARAM_LAENGE);
WriteParameterSet(pRxData[0], (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE);
Umschlag180Nick = (long) EE_Parameter.WinkelUmschlagNick * 2500L;
Umschlag180Roll = (long) EE_Parameter.WinkelUmschlagRoll * 2500L;
SetActiveParamSetNumber(pRxData[0]);
tempchar1 = GetActiveParamSetNumber();
Piep(tempchar1);
}
else
{
tempchar1 = 0; // mark in response an invlid setting
}
while(!UebertragungAbgeschlossen);
SendOutData('S', FC_ADDRESS, 1, &tempchar1, sizeof(tempchar1));
break;
 
} // case FC_ADDRESS:
 
default: // any Slave Address
 
switch(RxdBuffer[2])
{
// 't' comand placed here only for compatibility to BL
case 't':// Motortest
memcpy(&MotorTest[0], (unsigned char *)pRxData, sizeof(MotorTest));
while(!UebertragungAbgeschlossen);
SendOutData('T', MeineSlaveAdresse, 0);
PcZugriff = 255;
break;
// 'K' comand placed here only for compatibility to old MK3MAG software, that does not send the right Slave Address
case 'K':// Kompasswert
memcpy((unsigned char *)&KompassValue , (unsigned char *)pRxData, sizeof(KompassValue));
KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180;
break;
 
case 'a':// Texte der Analogwerte
DebugTextAnforderung = pRxData[0];
if (DebugTextAnforderung > 31) DebugTextAnforderung = 31;
PcZugriff = 255;
break;
 
case 'b':
memcpy((unsigned char *)&ExternControl, (unsigned char *)pRxData, sizeof(ExternControl));
ConfirmFrame = ExternControl.Frame;
PcZugriff = 255;
break;
case 'd': // Poll the debug data
DebugDataIntervall = pRxData[0] * 10;
if (DebugDataIntervall > 0) DebugDataAnforderung = 1;
break;
 
case 'h':// x-1 Displayzeilen
PcZugriff = 255;
RemoteKeys |= pRxData[0];
if(RemoteKeys) DisplayLine = 0;
DebugDisplayAnforderung = 1;
break;
 
case 'l':// x-1 Displayzeilen
PcZugriff = 255;
MenuePunkt = pRxData[0];
DebugDisplayAnforderung1 = 1;
break;
case 'v': // Version-Anforderung und Ausbaustufe
GetVersionAnforderung = 1;
break;
 
case 'g'://
GetExternalControl = 1;
break;
}
break; // default:
}
NeuerDatensatzEmpfangen = 0;
pRxData = 0;
RxDataLen = 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(DebugDataIntervall);
Kompass_Timer = SetDelay(220);
 
VersionInfo.SWMajor = VERSION_MAJOR;
VersionInfo.SWMinor = VERSION_MINOR;
VersionInfo.SWPatch = VERSION_PATCH;
VersionInfo.ProtoMajor = VERSION_SERIAL_MAJOR;
VersionInfo.ProtoMinor = VERSION_SERIAL_MINOR;
 
pRxData = 0;
RxDataLen = 0;
}
 
//---------------------------------------------------------------------------------------------
void DatenUebertragung(void)
{
if(!UebertragungAbgeschlossen) return;
 
if(DebugDisplayAnforderung && UebertragungAbgeschlossen)
{
Menu();
SendOutData('H', FC_ADDRESS, 2, &DisplayLine, sizeof(DisplayLine), &DisplayBuff[DisplayLine * 20], 20);
DisplayLine++;
if(DisplayLine >= 4) DisplayLine = 0;
DebugDisplayAnforderung = 0;
}
if(DebugDisplayAnforderung1 && UebertragungAbgeschlossen)
{
Menu();
SendOutData('L', FC_ADDRESS, 3, &MenuePunkt, sizeof(MenuePunkt), &MaxMenue, sizeof(MaxMenue), DisplayBuff, sizeof(DisplayBuff));
DebugDisplayAnforderung1 = 0;
}
if(GetVersionAnforderung && UebertragungAbgeschlossen)
{
SendOutData('V', FC_ADDRESS, 1, (unsigned char *) &VersionInfo, sizeof(VersionInfo));
GetVersionAnforderung = 0;
}
 
if(GetExternalControl && UebertragungAbgeschlossen) // Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen
{
SendOutData('G',MeineSlaveAdresse, 1, (unsigned char *) &ExternControl, sizeof(ExternControl));
GetExternalControl = 0;
}
 
if((CheckDelay(Kompass_Timer)) && UebertragungAbgeschlossen)
{
WinkelOut.Winkel[0] = (int) (IntegralNick / 108); // etwa in 0,1 Grad
WinkelOut.Winkel[1] = (int) (IntegralRoll / 108); // etwa in 0,1 Grad
WinkelOut.UserParameter[0] = Parameter_UserParam1;
WinkelOut.UserParameter[1] = Parameter_UserParam2;
SendOutData('w', MK3MAG_ADDRESS, 1, (unsigned char *) &WinkelOut,sizeof(WinkelOut));
if(WinkelOut.CalcState > 4) WinkelOut.CalcState = 6; // wird dann in SPI auf Null gesetzt
Kompass_Timer = SetDelay(99);
}
if((( DebugDataIntervall>0 && CheckDelay(Debug_Timer)) || DebugDataAnforderung) && UebertragungAbgeschlossen)
{
SendOutData('D', FC_ADDRESS, 1, (unsigned char *) &DebugOut,sizeof(DebugOut));
DebugDataAnforderung = 0;
if(DebugDataIntervall>0) Debug_Timer = SetDelay(DebugDataIntervall);
}
if(DebugTextAnforderung != 255) // Texte für die Analogdaten
{
SendOutData('A', FC_ADDRESS, 2, (unsigned char *)&DebugTextAnforderung, sizeof(DebugTextAnforderung),(unsigned char *) ANALOG_TEXT[DebugTextAnforderung], 16);
DebugTextAnforderung = 255;
}
if(ConfirmFrame && UebertragungAbgeschlossen) // Datensatz bestätigen
{
SendOutData('B', FC_ADDRESS, 1, (uint8_t*)&ConfirmFrame, sizeof(ConfirmFrame));
ConfirmFrame = 0;
}
 
if(GetPPMChannelAnforderung && UebertragungAbgeschlossen)
{
SendOutData('P', FC_ADDRESS, 1, (unsigned char *) &PPM_in, sizeof(PPM_in));
GetPPMChannelAnforderung = 0;
}
 
}
 
/branches/V0.71h KiliPet/uart.h
0,0 → 1,112
#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 unsigned char RemotePollDisplayLine;
extern int Debug_Timer,Kompass_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 void BearbeiteRxDaten(void);
extern unsigned char MotorTest[4];
struct str_DebugOut
{
unsigned char Digital[2];
signed int Analog[32]; // Debugwerte
};
 
extern struct str_DebugOut DebugOut;
 
struct str_WinkelOut
{
signed int Winkel[2];
unsigned char UserParameter[2];
unsigned char CalcState;
unsigned char Orientation;
};
extern struct str_WinkelOut WinkelOut;
 
struct str_ExternControl
{
unsigned char Digital[2];
unsigned char RemoteTasten;
signed char Nick;
signed char Roll;
signed char Gier;
unsigned char Gas;
signed char Hight;
unsigned char free;
unsigned char Frame;
unsigned char Config;
};
extern struct str_ExternControl ExternControl;
 
struct str_VersionInfo
{
unsigned char SWMajor;
unsigned char SWMinor;
unsigned char ProtoMajor;
unsigned char ProtoMinor;
unsigned char SWPatch;
unsigned char Reserved[5];
};
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/V0.71h KiliPet/version.txt
0,0 → 1,187
 
-------
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
V0.65a H.Buss 15.10.2007
- Integral im Mischer wieder integriert
- Feinabstimmung im ACC/Gyro Abgleich -> 1/32 & 100
- ACC/Gyro Abgleich auch bei HH
 
V0.66a H.Buss 3.11.2007
- Messwertverarbeitung aus dem Analog-Interrupt entfernt
- Analogmessung hängt jetzt am FC-Timing
- Looping-Stick-Hysterese eingebaut
- Looping-180°-Umschlag einstellbar
- Achsenkopplung: Gierbewegung verkoppelt Nick und Roll
- Lageregelung nach ACC-Sensor verbessert
- zusätzlicher I-Anteil in der Lageregelung verbessert die Neutrallage
- Gyrodriftkompensation überarbeitet
- Bug in der Gier-Stick-Berechnung behoben
- Gyro-Messung auf 1kHz beschleunigt
V0.67a H.Buss 16.11.2007
- der Hauptregler-I-Anteil wirkt jetzt nur noch auf den Winkel (ausser im HH-Mode)
- Gyro-Acc-Abgleich jetzt wieder in jedem Zyklus
- Feinabstimmung
- Beim HH-Modus gab es noch Bugs
 
V0.67e H.Buss 29.11.2007
- Parameter: Dynamic Stability und Driftfaktor eingeführt
- Die Namen der Analogwerte werden jetzt zum Koptertool übertragen
- Kompatibilität zum Koptertool erhöht
 
V0.67f H.Buss 04.12.2007
- Das Integral des Hauptreglers wird jetzt linear entladen und nicht mehr proportional
- Schub für Gier wird jetzt auf den Gaswert begrenzt, dadurch steigt der MK nicht mehr beim Gieren. Gier ist allerdings nicht mehr so agressiv
- Die ACC-Nullwerte können jetzt dauerhaft im EEPROM gespeichert werden (Stick:Vollgas und Gier rechts)
V0.68a I.Busker 28.12.2007
- SPI.c & SPI.h ins Projekt aufgenommen
SPI-Kommuikation kann in SPI.h aktiviert/deaktivert werden
 
V0.68c H.Buss 05.01.2008
- Stickauswertung verbessert -> träger und präziser
- Alle Settings angepasst
 
V0.69e H.Buss 05.05.2008
- kleinere Bugs beseitigt
- Schneller Sinkflug jetzt möglich
- Min- und Maxgas in den Settings geändert
- Lagewinkel wird jetzt in 0,1 Grad an Kompass und Navi gesendet
- Kalibrierung für MK3Mag -> Nick unten beim Kalibrieren
- Kompassroutine um den Ersatzkompass (Gyro unterstützt Kompasswert) erweitert
V0.69h H.Buss 21.05.2008
- STICK_GAIN = 4 eingeführt. Das erhöht die Auflösung der Sollwerte. Stick_P und Stick_I müssen nun um Faktor 4 erhöht werden
- SenderOkay auch an das Naviboard übertragen
- Bessere Parameter bei Senderausfall
V0.69j H.Buss 30.05.2008
- Höhere Präzision der Achsenkopplung
 
V0.69k H.Buss 31.05.2008
- Bug in SPI.C behoben
- in 0.69h war ein Bug, der zu ungewollten Loopings führen konnte
 
V0.69L H.Buss 14.06.2008
- feinere Cam-Servo-Auflösung
V0.70a H.Buss 01.07.2008
- Unterstützung der V1.3-Hardware mit automatischem Hardware-Gyro-Abgleich
 
V0.70b H.Buss 14.07.2008
- flexible Einstellungsmöglichkeit von J16 und J17 (Transistorausgänge)
- eigene Parameter für GPS-Naviboard
- eigener Parameter für ExternalControl (war vorher UserParameter1 bzw. 8)
- neue Parameter im EEPROM-Datensatz: J16Bitmask, J16Timing, ExternalControl, Navi...
- MikroKopterFlags eingeführt, damit das Navi den Status des MKs kennt
- KopterTool-Kompatibilität auf 8 erhöht
V0.70c H.Buss 30.07.2008
- Parameter der Datenfusion leicht modifiziert
- EEPROM-Parameter für Looping-Umschlag angepasst (von 100 auf 85)
- MaxStick wird auf 100 begrenzt
 
V0.70d H.Buss 02.08.2008
- Transistorausgänge: das oberste Bit der Blinkmaske (im KopterTool linkes Bit) gibt nun den Zustand des Ausgangs im Schalterbetrieb an
0.71b: H.Buss 19.10.2008
Kommunikation zum Navi erweitert:
- Beeptime jetzt 32Bit
- Datenfusion und Driftkopensation wird durch NaviBoard unterstützt
0.71c: H.Buss 20.10.2008
- LoopConfig heisst jetzt BitConfig
- 3-Fach-Schalter für Höhensteuerung möglich -> kann man mit GPS-Schalter zusammenlegen
- bei den Settings wurde Setting[0] mit abgespeichert, welches es nicht gab.
- in Zukunft werden bei neuen EEPROM-Settings die Kanäle von Setting 1 übernommen
- Variablen NaviWindCorrection, NaviSpeedCompensation, NaviOperatingRadius eingeführt
 
0.71f: H.Buss 15.11.2008
- Ausschalten der Höhenregelung per Schalter um 0,3 sek verzögert
- bei der seriellen Übertragung hat die FC jetzt als SlaveAdresse die 1
- VersionInfo.NaviKompatibel eingeführt
- wenn manuell gegiert wird, wird der GyroKompass-Wert auf den Kompasswert gesetzt
- Luftdruckwert wird an das Navi übertragen
- Der Baro-Offset wird jetzt nachgeführt, um den Messbereich zu erweitern. Geht nur bei Höhenregler mit Schalter
- Debugdaten können jetzt mit 'f' gepollt werden
0.71g: Gregor 09.12.2008
- Kommunikation überarbeitet
Infos hier: http://www.mikrokopter.de/ucwiki/en/SerialCommands
0.71h: H.Buss 15.12.2008 - Freigegebene Version
- NaviAngleLimitation als Parameter zum Navi implementiert
- Antwort auf CMD: 't' entfernt