Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 795 → Rev 796

/branches/Flight-Ctrl_V0_xx_GPS_Joko/V0_67g_fuer_2_achs_Kompass_CMPS03/Flight-Ctrl_MEGA644_V0_67g.hex
File deleted
/branches/Flight-Ctrl_V0_xx_GPS_Joko/V0_67g_fuer_3_achs_Kompass_MM3/Flight-Ctrl_MEGA644_V0_67g.hex
File deleted
/branches/Flight-Ctrl_V0_xx_GPS_Joko/V0_68d_fuer_2_achs_Kompass_CMPS03/Flight-Ctrl_MEGA644_V0_68d_CMPS.hex
File deleted
/branches/Flight-Ctrl_V0_xx_GPS_Joko/V0_68d_fuer_3_achs_Kompass_MM3/Flight-Ctrl_MEGA644_V0_68d_MM3.hex
File deleted
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/COPYING
0,0 → 1,674
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
 
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
 
Preamble
 
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
 
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
 
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
 
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
 
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
 
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
 
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
 
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
 
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
 
The precise terms and conditions for copying, distribution and
modification follow.
 
TERMS AND CONDITIONS
 
0. Definitions.
 
"This License" refers to version 3 of the GNU General Public License.
 
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
 
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
 
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
 
A "covered work" means either the unmodified Program or a work based
on the Program.
 
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
 
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
 
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
 
1. Source Code.
 
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
 
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
 
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
 
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
 
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
 
The Corresponding Source for a work in source code form is that
same work.
 
2. Basic Permissions.
 
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
 
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
 
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
 
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
 
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
 
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
 
4. Conveying Verbatim Copies.
 
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
 
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
 
5. Conveying Modified Source Versions.
 
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
 
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
 
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
 
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
 
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
 
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
 
6. Conveying Non-Source Forms.
 
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
 
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
 
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
 
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
 
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
 
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
 
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
 
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
 
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
 
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
 
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
 
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
 
7. Additional Terms.
 
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
 
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
 
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
 
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
 
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
 
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
 
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
 
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
 
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
 
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
 
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
 
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
 
8. Termination.
 
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
 
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
 
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
 
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
 
9. Acceptance Not Required for Having Copies.
 
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
 
10. Automatic Licensing of Downstream Recipients.
 
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
 
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
 
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
 
11. Patents.
 
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
 
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
 
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
 
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
 
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
 
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
 
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
 
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
 
12. No Surrender of Others' Freedom.
 
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
 
13. Use with the GNU Affero General Public License.
 
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
 
14. Revised Versions of this License.
 
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
 
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
 
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
 
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
 
15. Disclaimer of Warranty.
 
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
 
16. Limitation of Liability.
 
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
 
17. Interpretation of Sections 15 and 16.
 
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
 
END OF TERMS AND CONDITIONS
 
How to Apply These Terms to Your New Programs
 
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
 
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
 
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
 
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
 
Also add information on how to contact you by electronic and paper mail.
 
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
 
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
 
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
 
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
 
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/COPYING.LESSER
0,0 → 1,165
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
 
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
 
 
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
 
0. Additional Definitions.
 
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
 
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
 
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
 
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
 
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
 
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
 
1. Exception to Section 3 of the GNU GPL.
 
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
 
2. Conveying Modified Versions.
 
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
 
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
 
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
 
3. Object Code Incorporating Material from Library Header Files.
 
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
 
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
 
b) Accompany the object code with a copy of the GNU GPL and this license
document.
 
4. Combined Works.
 
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
 
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
 
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
 
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
 
d) Do one of the following:
 
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
 
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
 
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
 
5. Combined Libraries.
 
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
 
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
 
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
 
6. Revised Versions of the GNU Lesser General Public License.
 
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
 
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
 
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/Flight-Ctrl_MEGA644_V0_68d.hex
0,0 → 1,2331
:100000000C94C7030C94E4030C94E4030C94E403F1
:100010000C94E4030C94E4030C94E4030C94E403C4
:100020000C94E4030C940E110C94E4030C94E4037C
:100030000C94151B0C94E4030C94E4030C94E4035B
:100040000C94E4030C94E4030C94B5110C94E603B3
:100050000C947D090C94E4030C94B4080C94E40310
:100060000C9460120C94E4030C94531A0C94E40363
:10007000A709AC09B609BB09160A2A0A460A770A73
:100080007D0A2F0D3B0D4D0D030E030E030E990D32
:10009000640D030E030E880DC50DC50DC50DC50DF0
:1000A000C50D9D0D030E030E7F0D030E950D8A12D7
:1000B0009F12A812B212CF12E71200131D133A13A7
:1000C00057133B149615DE153F169516E91665175E
:1000D0001F1871189518CB1827196519B719F01939
:1000E0006C1A711A821A901A9D1A951A9D1AB11AD1
:1000F0000A0A0D004E65757472616C004865616492
:10010000696E67486F6C64000A0D5374657565729B
:10011000756E673A20004F4B0A0D000A0D41626769
:100120006C65696368204C756674647275636B7383
:10013000656E736F722E2E000A0D4B616C696272D0
:1001400069657265204B6F6D70617373000A0D42B3
:10015000656E75747A6520506172616D6574657243
:100160007361747A202564000A0D414343206E694F
:100170006368742061626765676C696368656E2196
:10018000000A0D496E69742E20454550524F4D3A74
:100190002047656E657269657265204465666175A4
:1001A0006C742D506172616D657465722E2E2E0017
:1001B0000A0D3D3D3D3D3D3D3D3D3D3D3D3D3D3DD2
:1001C0003D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D5F
:1001D000000A0D466C69676874436F6E74726F6CC9
:1001E0000A0D48617264776172653A25642E256450
:1001F0000A0D536F6674776172653A5625642E2531
:1002000064256320002E005A5F52616E67653A20B4
:100210002025346900595F52616E67653A202025B8
:10022000346900585F52616E67653A202025346951
:10023000004D4D332052616E6765005A5F4F666610
:100240007365743A202025336900595F4F666673E1
:1002500065743A202025336900585F4F66667365E0
:10026000743A2020253369004D4D33204F66667364
:1002700065740048693A253469202043663A25347C
:1002800069200047733A253469202047693A2534AC
:100290006920004E693A2534692020526F3A25348E
:1002A00069200045787465726E436F6E74726F6C6E
:1002B00020200052616E67653A2533692D25336928
:1002C000005374656C6C756E673A20253369005372
:1002D0006574706F696E74202025336900536572F0
:1002E000766F202000506F343A2025336920506FFC
:1002F000383A2025336900506F333A20253369207E
:10030000506F373A2025336900506F323A20253339
:100310006920506F363A2025336900506F313A20FA
:1003200025336920506F353A2025336900537461B5
:1003300072743A2020202020253569004D657373A2
:10034000776572743A2020253569005269636874B4
:10035000756E673A2020253569004B6F6D706173AB
:10036000732020202020202000456D70662E5065CF
:1003700067656C3A253569005370616E6E756E67FE
:100380003A202025356900486F63682025346920AC
:10039000282533692900526F6C6C20253469202888
:1003A00025336929004E69636B202534692028258F
:1003B00033692900414343202D2053656E736F72CA
:1003C0000047696572202534692028253369290092
:1003D000526F6C6C20253469202825336929004E22
:1003E00069636B2025346920282533692900476912
:1003F00065722025346920282533692900526F6CE5
:100400006C20253469202825336929004E69636BE7
:1004100020253469202825336929004779726F2007
:100420002D2053656E736F720050333A2534692066
:100430002050343A253469200050313A253469205F
:100440002050323A253469200047733A2534692018
:100450002047693A25346920004E693A25346920DD
:1004600020526F3A25346920004B373A25346920F1
:10047000204B383A25346920004B353A2534692021
:10048000204B363A25346920004B333A2534692015
:10049000204B343A25346920004B313A2534692009
:1004A000204B323A25346920004B6F6D70617373B5
:1004B0003A20202025356900526F6C6C3A202020AC
:1004C000202020253569004E69636B3A20202020CA
:1004D000202025356900616B742E204C6167650012
:1004E00048F668656E726567656C756E67004B658A
:1004F000696E6520004F66662020202020203A206B
:10050000253569004C756674647275636B3A2025F5
:10051000356900536F6C6C486F6568653A20253506
:100520006900486F6568653A2020202020253569DC
:100530000028632920486F6C6765722042757373C9
:100540000053657474696E673A202564200048572B
:100550003A5625642E25642053573A25642E256487
:100560002563002B204D696B726F4B6F7074657241
:10057000202B005B25695D005B25695D00000102A1
:1005800003040405060708090A0B0B0C0D0E0F10D7
:100590001111121314151516171818191A1B1B1CF4
:1005A0001D1D1E1F1F202121222323242425252633
:1005B0002727282829292A2A2B2B2C2C2D2D2D2E94
:1005C0002E2F2F3030303131323232333333343416
:1005D00034353535363636373737373838383939B0
:1005E00039393A3A3A3A3B3B3B3B3C3C3C3C3C3D5C
:1005F0003D3D3D3E3E3E3E3E3F3F3F3F3F3F404014
:1006000040404040414141414141424242424242D8
:1006100042434343434343434444444444444444A3
:100620004545454545454545454646464646464673
:100630004646474747474747474747474748484849
:100640004848484848484848494949494949494922
:100650004949494949494A4A4A4A4A4A4A4A4A4A00
:100660004A4A4A4A4B4B4B4B4B4B4B4B4B4B4B4BDE
:100670004B4B4B4B4B4C4C4C4C4C4C4C4C4C4C4CBF
:100680004C4C4C4C4C4C4C4C4D4D4D4D4D4D4D4DA2
:100690004D4D4D4D4D4D4D4D4D4D4D4D4D4D4E4E88
:1006A0004E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E6A
:1006B0004E4E4E4E4E4E4E4E4F4F4F4F4F4F4F4F52
:1006C0004F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F3A
:1006D0004F4F4F4F4F4F4F000047008F00D6001E27
:1006E000016501AC01F3013A028102C7020E035415
:1006F000039903DF0324046904AE04F20436057988
:1007000005BC05FE0540068206C3060407440783B0
:1007100007C20700083E087B08B708F2082D0968E1
:1007200009A109DA09120A490A7F0AB50AE90A1D6C
:100730000B500B820BB40BE40B130C420C6F0C9C94
:100740000CC70CF20C1B0D440D6B0D920DB70DDB9D
:100750000DFE0D210E420E610E800E9E0EBA0ED6BB
:100760000EF00E090F210F380F4D0F610F740F8619
:100770000F970FA60FB50FC20FCE0FD80FE10FEADC
:100780000FF00FF60FFA0FFE0FFF0F0010001124ED
:100790001FBECFEFD0E1DEBFCDBF13E0A0E0B1E0E0
:1007A000E4EEFEE802C005900D92A43AB107D9F735
:1007B00018E0A4EAB3E001C01D92AE3AB107E1F738
:1007C0000E9482060C9471470C9400001F920F92B5
:1007D0000FB60F9211242F933F934F938F939F93B4
:1007E00080911D05833019F08430A1F508C08EB5C5
:1007F0008093A4031EBC84E080931D052BC08091D0
:10080000A4039927382F22278EB59927282B392B17
:10081000C9018D509E4F875E9340D0F48091200592
:10082000853019F0863069F406C030932205209394
:10083000210586E00BC0309324052093230587E033
:1008400005C0309326052093250585E0809320057B
:1008500010921D059F918F914F913F912F910F9075
:100860000FBE0F901F90189522E030E0D9010E9432
:100870005347802D863028F082E0D901082E0E944F
:1008800060479927089580911D05813041F081309E
:1008900018F0823049F51CC02A9A81E016C02A98C7
:1008A00080912005853011F481E305C0863011F474
:1008B00082E301C083E38EBD88E090E00E94F910DE
:1008C00090931F0580931E0582E080931D05089577
:1008D00080911E0590911F050E940211882321F02E
:1008E0001EBC83E080931D050895FB01282F8630F0
:1008F00008F025E0842F9927429FD0011124AC599C
:10090000BF4F019724F001900E946047FACFA2E008
:10091000B0E0022E0E9460470895CF93DF93FB0161
:10092000C42FDD27863008F085E0489FD0011124D0
:10093000AC59BF4F219724F00E9453470192FACF40
:10094000DF91CF910895A0E0B0E0E9EAF4E00C94E3
:100950001847299A809100018A3011F4289801C023
:10096000289AAA24BB2400E010E088249924EE24CD
:10097000FF2466247724CC24DD2452E3452E55241D
:100980008091210590912205081719072CF40091F8
:100990002105109122050BC080912105909122051F
:1009A0008A159B0524F4A0902105B0902205809122
:1009B000230590912405E816F9062CF4E090230510
:1009C000F09024050BC08091230590912405881593
:1009D000990524F4809023059090240580912505A5
:1009E00090912605C816D9062CF4C0902505D09004
:1009F00026050BC080912505909126058615970543
:100A000024F46090250570902605552081F485B169
:100A100091E0892785B985B192E0892785B982E37C
:100A200090E09093C7038093C60342E3542E8AE07C
:100A300090E00E94F910EC01CE010E94021188237F
:100A4000D9F3E0911308FF27EE0FFF1FEB52F84F89
:100A500080819181843691050CF44A94442011F0F0
:100A60005A948ECFC8018A199B09909316058093DA
:100A70001505C701881999099093180580931705E2
:100A8000C6018619970990931A0580931905E2E12A
:100A9000F5E0C8018A0D9B1D62E070E00E94C64629
:100AA00060931205C701880D991D62E070E00E94F5
:100AB000C64660931305C601860D971D62E070E07F
:100AC0000E94C6466093140589E0AAE0B0E0182EA3
:100AD0000E946C47E0E1CDB7DEB70C94344783ED5C
:100AE0008CBD84B1846A84B93E9A469885E080932F
:100AF000200510921D05E2E1F5E089E0AAE0B0E0F2
:100B0000182E0E945B470895AAE0B0E0EAE8F5E0FD
:100B10000C94164760910B0470910C0480910D04A5
:100B200090910E04A0903008BB24E3E0AA0CBB1CFB
:100B3000EA95E1F7CC24DD24A60195010E94FB464D
:100B400079018A01FF24E7FCF094C7010E94C744A1
:100B50002C01C7010E940A453C0160911304709169
:100B600014048091150490911604A60195010E9429
:100B7000FB4679018A01FF24E7FCF094C7010E943B
:100B8000C7449A878987C7010E940A451C01609162
:100B9000210570912205E0902305F0902405209115
:100BA0001305332727FD3095E21AF30A0027F7FCD7
:100BB0000095102FA0902505B090260520911405D2
:100BC000332727FD3095A21AB30ACC24B7FCC09472
:100BD000DC2C20911205332727FD3095621B730B07
:100BE000882777FD8095982F882477FC8094982C0F
:100BF000A40193010E9487463B014C0189859A8597
:100C0000AA2797FDA095BA2F8D839E83AF83B887BF
:100C1000C201AA2797FDA095BA2F89839A83AB8337
:100C2000BC83C801B7012D813E814F8158850E9448
:100C3000874620E030E140E050E00E94FB46CA01D8
:100C4000B90129813A814B815C810E948746660EF9
:100C5000771E881E991E442437FC4094542CC601EC
:100C6000B501A20191010E94874620E030E140E0F9
:100C700050E00E94FB46CA01B90129813A814B81AB
:100C80005C810E948746661A770A880A990AC80119
:100C9000B701A20191010E9487467B018C01C60128
:100CA000B5012D813E814F8158850E948746E60E11
:100CB000F71E081F191FC801B70120E030E140E00E
:100CC00050E00E94FB4679018A01C401B30120E093
:100CD00030E140E050E00E94FB46DA01C901B70173
:100CE0000E9428449C0197FF05C088279927821BF2
:100CF000930B04C088E691E0821B930BE2E1C65F90
:100D00000C9432471F93CF93DF9314B815B8189BF8
:100D100002C08BE001C08AE08093000181E887B9BE
:100D20003C9A8FEF88B98BE184B981E085B98EE375
:100D30008AB9579A87EF8BB984B7877F84BF809130
:100D400060008861809360001092600080ED97E001
:100D50009093C7038093C60310926B0410926A04A9
:100D60001092DA071092D907109269041092680461
:100D70001092670410926604809100018A3011F489
:100D8000289801C0289A0E94DB100E944C0C0E94F7
:100D9000001B0E945A120E94391A0E946F05789413
:100DA00010926D0684E480936E0687E080936F0650
:100DB0002091000184E690E09F938F9384E490E07B
:100DC0009F938F931F921F92822F6AE00E94A646E4
:100DD000892F99279F938F93822F0E94A646992748
:100DE0009F938F9381ED91E09F938F931F920E9429
:100DF000620E80EB91E09F938F931F920E94620E90
:100E0000299AA1E0B0E00E945347802D2DB73EB74C
:100E1000205F3F4F2DBF853409F43FC081E891E04A
:100E20009F938F931F920E94620E0E94972A10E058
:100E30000F900F900F90123049F40E94062A47E459
:100E400061E178E082E00E94750402C0133051F441
:100E50000E94752947E461E178E083E00E9475040F
:100E600014E002C0143010F00E94062A47E461E149
:100E700078E0812F0E9475041F5F1630E0F283E056
:100E800022E030E0D901082E0E94604785E421501D
:100E90003040D901082E0E946047C4E0D0E0DE0156
:100EA0000E945347802D853050F088E691E09F9353
:100EB0008F931F920E94620E0F900F900F902297B7
:100EC000DE010E945347802D863028F082E0DE014B
:100ED000082E0E94604747E461E178E00E948D049B
:100EE000DE010E945347802D863028F082E0DE012B
:100EF000082E0E94604799279F938F938DE491E07D
:100F00009F938F931F920E94620E84EF91E00E9444
:100F1000F910EC010F900F900F900F900F90CE01F1
:100F20000E9402118823D9F3E0911308FF27EE0FE6
:100F3000FF1FEB52F84F8081918185369105C4F0F7
:100F4000E0911408FF27EE0FFF1FEB52F84F80814E
:100F500091818536910564F088E391E09F938F93AA
:100F60001F920E94620E0E94A3040F900F900F9098
:100F70008091190880FF20C08BE191E09F938F93AF
:100F80001F920E94620E88EE93E00E94F910EC011D
:100F90000E94DC140F900F900F90CE010E9402115E
:100FA0008823D9F386E191E09F938F931F920E944B
:100FB000620E0F900F900F900E9401288091000107
:100FC0008A3011F4289801C0289A80ED97E0909318
:100FD000C7038093C60385E58093770688E091E098
:100FE0009F938F931F920E94620E809119080F9019
:100FF0000F900F9082FF03C08CEF90E002C084EF4F
:1010000090E09F938F931F920E94620E0F900F901B
:101010000F9080EF90E09F938F931F920E94620E3B
:101020000E94201588E893E19093860380938503BE
:101030000F900F900F908091C5038823E1F31092D9
:10104000C5030E94282B0E94D627209100012A3038
:1010500011F4289801C0289A80910301882321F077
:1010600081508093030112C01092B5031092B60311
:1010700010928106109288041092870410928A04BC
:101080001092890410928C0410928B048091650454
:10109000882329F0809165048150809365048091B4
:1010A000850390918603892B01F585E090E090936C
:1010B0008603809385030E94DA1A8091040390913D
:1010C00005038F5F9F4FF9F480916E048823D9F058
:1010D00080E197E29093C7038093C60380E890E095
:1010E00090930503809304030EC080918503909133
:1010F0008603019790938603809385032A3011F429
:10110000289801C0289A8091C503882311F40E9471
:10111000690C0E94110DCE010E940211882309F46E
:101120008ACF2091080330910903809129089927DB
:10113000281739079CF480910403909105038F5F71
:101140009F4F61F480E797E19093C7038093C603B4
:1011500080E093E0909305038093040384E690E09D
:101160000E94F910EC0167CF1F920F920FB60F92F9
:1011700011248F939F93EF93FF9380910101882314
:10118000E1F48091C0039091C10301969093C10353
:101190008093C003FC01E35DFA4FE081ED3019F06C
:1011A0008639910539F41092C1031092C00381E091
:1011B00080930101E093C60004C01092C103109215
:1011C000C003FF91EF919F918F910F900FBE0F90F1
:1011D0001F90189590916C06913041F480916006B3
:1011E0008093900790938F0710926C0620912C07A4
:1011F0002130D9F58091220790912307A0912407EF
:10120000B09125078093730790937407A093750797
:10121000B093760780911E0790911F07A091200739
:10122000B09121078093770790937807A09379076F
:10123000B0937A078091260790912707A0912807FD
:10124000B091290780937B0790937C07A0937D073B
:10125000B0937E0710922C072093B9038091000170
:101260008A3011F4289A01C028988091B9078130FA
:1012700009F042C08091990790919A07A0919B072D
:10128000B0919C0780937F0790938007A09381077C
:10129000B093820780919D0790919E07A0919F0730
:1012A000B091A0078093830790938407A09385074C
:1012B000B09386078091A1079091A207A091A30700
:1012C000B091A4078093870790938807A09389071C
:1012D000B0938A078091A9079091AA07A091AB07C4
:1012E000B091AC0780938B0790938C07A0938D07E8
:1012F000B0938E071092B90708951F920F920FB600
:101300000F9211242F933F934F935F936F937F938B
:101310008F939F93AF93BF93CF93DF93EF93FF93FD
:101320008091C6008093A9038091C0004091A903D9
:10133000887109F0EEC08091C203E82FFF27E930E1
:10134000F10508F0E6C0E85CFF4F0C944D47453BC3
:1013500009F0E1C081E003C0423621F482E08093CD
:10136000C203D9C0453B09F4D6C0D3C0413009F00F
:10137000D0C083E0F4CF409392074F5F40932C0599
:1013800080912C058F5F80935B0684E08093C2037D
:10139000809192078830C1F0823151F18330F1F5AC
:1013A0008CE596E090938306809382062DE737E0E4
:1013B00030932A0520932905409690932E07809319
:1013C0002D0780916C0627C08AE197E090938306F1
:1013D0008093820623E838E030932A05209329057C
:1013E000429690932E0780932D0780912C0713C06F
:1013F00085E997E090938306809382062EEE3CE089
:1014000030932A0520932905849690932E07809384
:101410002D078091B907809394077DC081E0809368
:10142000940710922E0710922D0775C0842F9927CC
:101430009093300780932F0780912C05840F809321
:101440002C0580915B0690912C05890F80935B069B
:1014500085E085CF20912F0730913007842F992781
:10146000982F8827280F391F3093300720932F0794
:1014700080912C05840F80932C0580915B069091C0
:101480002C05890F80935B0686E069CF80912C053F
:10149000840F80932C0580915B0690912C05890F19
:1014A00080935B0680919407882381F4E091820603
:1014B000F09183068091290590912A05E817F90794
:1014C00028F44193F0938306E093820680912F07DE
:1014D0009091300701979093300780932F07809168
:1014E0002F0790913007892BB1F487E038CF809196
:1014F0002C05481771F488E032CF80915B064817BD
:1015000041F4E0912D07F0912E07309711F081E022
:1015100080831092C2030E94EA084091BB034639BF
:1015200010F01092BA038091A9038D3009F05CC0CD
:101530008091BA03823009F057C01092BA03A42FE9
:10154000BB27FD01EE57F94F3081ED01CD57D94F43
:1015500028818091BE039091BF03831B9109821B58
:1015600091099F709093BF038093BE039C0196E006
:10157000369527959A95E1F7235C2093BD03982F24
:101580009F73935C9093BC038081281729F4888112
:10159000981711F491E006C08091AC038F5F80939F
:1015A000AC0390E08091AA03882309F064C09923DA
:1015B00009F461C081E08093AA034093AD03AC5766
:1015C000B94F8DE08C9380918606823509F053C027
:1015D00088E190E02CE00FB6F894A8958093600025
:1015E0000FBE2093600047C08091BA038130D9F0CC
:1015F000813018F08230E9F530C08091A903833240
:1016000039F48091AA03882319F481E08093BA0306
:101610008091A9038093840681E08093BB0380912D
:10162000A903992715C082E08093BA03E42FFF270E
:101630008091A903EC57F94F80834F5F4093BB0320
:101640002091A9038091BE039091BF03820F911D49
:101650009093BF038093BE030EC0E42FFF278091B9
:10166000A903EC57F94F8083463938F31092BA0337
:10167000E7CF1092BA03FF91EF91DF91CF91BF9125
:10168000AF919F918F917F916F915F914F913F911A
:101690002F910F900FBE0F901F901895DC0120E046
:1016A00030E040E050E0EDE2F5E005C08191280F28
:1016B000311D4F5F5F4F4A175B07C1F73F70C9018C
:1016C00066E0969587956A95E1F7835CFD01E35D99
:1016D000FA4F808311962F73235CFD01E35DFA4F6F
:1016E0002083A25DBA4F8DE08C931092010180910E
:1016F0002D058093C6000895EF92FF920F931F93DC
:10170000CF93DF937A01722F93E290932D0560932C
:101710002E0580932F0503E010E060E0A0E3B5E024
:1017200046C0F701E60FF11D90816F5F715019F40B
:10173000E0E040E00FC0F701E60FF11D40816F5F70
:10174000715011F4E0E006C0F701E60FF11DE081F1
:101750006F5F7150892F86958695835C8C93552792
:10176000892F99278370907024E0880F991F2A95FC
:10177000E1F79A0194E0369527959A95E1F7822B47
:10178000835CED0189834F705070440F551F440FE7
:10179000551F8E2F8295869586958370842B835C4A
:1017A0008A83EF73E35CEB830C5F1F4F1496772300
:1017B00009F0B7CFC8010E944E0BE6E0CDB7DEB707
:1017C0000C943E471F93CF93DF93EC0170E0A22F60
:1017D000BB27129748C0E42FFF27EC57F94F308101
:1017E0004F5FE42FFF27EC57F94F50814F5FE42FF5
:1017F000FF27EC57F94F10814F5FE42FFF27EC577D
:10180000F94F20814F5F842F9927A817B90774F1EA
:101810005D53FE01E70FF11D3D53330F330F852F4D
:1018200082958F70382B3083613001F1912F9D5359
:101830007F5FFE01E70FF11D71505295507F892F98
:1018400086958695582B508363506F3F79F07E5F65
:10185000FE01E70FF11D9295990F990F907C2D5382
:10186000922B90837F5F662309F0B5CFDF91CF91F4
:101870001F9108951F93182F8A3019F48DE00E944C
:101880003A0C8091C00085FFFCCF1093C60080E029
:1018900090E01F9108950895E1ECF0E088E18083E5
:1018A000A0ECB0E08C9182608C9380818068808312
:1018B0008081806480838AE28093C40088EC90E019
:1018C0000E94F91090935A06809359061092C20311
:1018D000089580910101882309F4A2C08091A50395
:1018E000882371F080910101882351F02BE047E7B4
:1018F00056E060912B0587E40E947C0B1092A503B3
:101900008091590690915A060E940211882321F471
:101910008091A7038823B1F080910101882391F081
:1019200022E441E357E060912B0584E40E947C0BA4
:101930001092A70384EF91E00E94F91090935A0649
:1019400080935906609102016F3F89F0462F552719
:1019500034E0440F551F3A95E1F74C5F5E4F605DF0
:1019600020E181E40E947C0B8FEF80930201909133
:1019700093079923A1F080910101882381F083E2EC
:1019800080932D0590932E058DE080932F05109266
:1019900001011092930780912D058093C6008091DC
:1019A000A603882359F180910101882339F10E940F
:1019B00029151092A6033091AF03932F9F5F909348
:1019C000AF03943021F08091B003882359F02EE1C9
:1019D00045ED57E060E084E30E947C0B8FEF80933D
:1019E000AF030CC044E1949FA0011124465E5C4FFC
:1019F00024E160E0832F8F5C0E947C0B8091A80320
:101A0000882371F080910101882351F02AE04DE68E
:101A100056E060912B0586E50E947C0B1092A8038E
:101A20000895A2E0B0E0E7E1FDE00C942547809145
:101A3000AA03882309F4E9C08FEF80930301809102
:101A400086069927AA27BB27FC01E156F040E6311C
:101A5000F10508F0D8C0EF5BFF4F0C944D47209183
:101A6000AD0343E062E0CE0101960E94E20B898162
:101A700080930201C8C02091AD0343E06BE087E78B
:101A800096E00E94E20B8091EE0390917906892BFB
:101A90008093EE038091800645C02091AD0343E022
:101AA0006BE087E796E00E94E20B8091EE03909155
:101AB0007906892B8093EE038091800680939307AB
:101AC00081E08093A7039FC02091AD0343E062E0D3
:101AD000CE0101960E94E20B8091EE039981892B41
:101AE0008093EE038A818F3F21F481E08093B003DD
:101AF00002C01092B00381E08093A60384C02091BD
:101B0000AD0343E064E081EB93E00E94E20B7BC015
:101B10002091AD0343E064E085EB93E00E94E20B8B
:101B20008091B803809393076EC081E08093A803EF
:101B30006AC081E08093A50366C02091AD0343E0B5
:101B400062E0CE0101960E94E20B89818F3F89F00D
:101B5000863010F085E0898347E461E178E089818F
:101B60000E948D04898127E441E158E060912B05B2
:101B700008C010912B050E94340427E441E158E08D
:101B8000612F855B0E947C0B3EC02091AD0343E03A
:101B900067E481E198E00E94E20B8091860647E4C9
:101BA00061E178E08B560E947504809186068B5621
:101BB000A2E0B0E0082E0E94604760913C087727C1
:101BC0008827992724EC39E040E050E00E948746BE
:101BD00060938703709388038093890390938A03AB
:101BE00060913D087727882799270E948746609350
:101BF0008B0370938C0380938D0390938E030E94CC
:101C000034040E9460291092AA03E3E0CE5F0C9492
:101C10004147982F8091BA07813069F48091ED0394
:101C2000E82FFF27E65EFC4F90838F5F8093ED03E4
:101C300021E030E005C0892F0E943A0C282F33277D
:101C4000C90108951F93182F04C080E30E94090E54
:101C500011501116D4F31F9108951F93182F04C02B
:101C600080E20E94090E11501116D4F31F910895BD
:101C70000F931F93CF93DF938C01EB0108C0F80102
:101C80000F5F1F4FE4918E2F0E94090E219720971E
:101C9000B1F7DF91CF911F910F9108950F931F938B
:101CA000CF93DF938C01EB0106C0F80181918F0186
:101CB0000E94090E21972097C1F7DF91CF911F91C4
:101CC0000F910895A3E3B0E0E8E6FEE00C94164718
:101CD00029968FAD29978093BA07CE01855B9F4FD8
:101CE0009D838C832B968EAD9FAD2B979FA78EA740
:101CF00022243324210102C0130124010EA51FA5B3
:101D000002C00F5F1F4FF801F490FF2019F0F5E2B9
:101D1000FF16B9F7B8018EA59FA5681B790B11F0C6
:101D20000E94380EFF2009F442C20F5F1F4F1FA709
:101D30000EA71982AC81BD811BAA1AAA9FEF99AB8D
:101D4000EEA5FFA5CF0101969FA78EA7B49095E7BA
:101D5000B91621F08B2D8062883789F4EBA9E0FF5A
:101D600007C02D903D904D905C901397149607C03E
:101D70008D919C9111971C01442455241296F0E2F8
:101D8000BF1621F489818823D9F685C083E2B8166D
:101D900009F483C09AE2B91621F0EDE2BE1669F4A7
:101DA00008C0FD011296E081EAABE7FFC9CFE195DB
:101DB000EAABFBA9F061FF7D72C08BE2B81609F4B3
:101DC0006AC09EE2B916B1F52EA53FA52F5F3F4F21
:101DD000EEA5FFA584918A3221F0B82E20E030E0F4
:101DE0001BC0FD0112964081518157FF02C04FEF89
:101DF0005FEF49AB3FA72EA7A3CFC90103E0880F30
:101E0000991F0A95E1F7220F331F280F391F2B0D59
:101E1000311D20533040B49031968B2D80538A3041
:101E200060F3FFA7EEA7A90137FF02C04FEF5FEFF6
:101E300049AB8DCFF0E3BF1631F48BA984FD80CF81
:101E400080628BAB7DCF8B2D81538930E8F420E00D
:101E500030E0C901F3E0880F991FFA95E1F7220FEE
:101E6000331F280F391F2B0D311D20533040EEA595
:101E7000FFA5CF0101969FA78EA7B4908B2D80530D
:101E80008A3038F32AAB63CF98E6B91651F4EBA940
:101E9000E460EBAB55CFB98253CFFBA9F860FBAB45
:101EA0004FCF8CE6B81621F49BA991609BAB48CF2D
:101EB000BD83AC83E3E6BE1639F41296BD83AC83D2
:101EC00012978C918E8318C1F4E4BF1639F084E622
:101ED000B81639F099E6B91659F503C0EBA9E160D7
:101EE000EBABFBA9F0FF08C01496BD83AC835E90FA
:101EF0004E903E902E900AC01296BD83AC839E9168
:101F00008E911C01442437FC4094542C57FC03C090
:101F10008AE088AB92C05094409430942094211C65
:101F2000311C411C511C8DE289839AE098AB85C01D
:101F3000EFE4BE1629F0FFE6BF1639F488E061C071
:101F40009BA991609BABE8E056C0F0E7BF1671F427
:101F50001296BD83AC839E918E911C01442455241E
:101F60008BA980648BAB78E7B72E5EC0E3E7BE1623
:101F7000D9F51296BD83AC83DE90CE90C114D10406
:101F800089F488E28E838EE68F8385E788878CE6E6
:101F900089878A8789E28B871C8666E0C62ED12CCA
:101FA000CC0EDD1EF9A9F7FD13C04F2F552747FDB5
:101FB000509560E070E0C6010E941245009711F450
:101FC00019A90DC08C1919A981174CF4182F07C035
:101FD000F60101900020E9F731971E2F1C19198294
:101FE0004201310140E094C085E5B81631F095E733
:101FF000B91649F4EAE0E8AB1FC0FBA9F160FBABFE
:102000008AE088AB19C098E5B91621F0E8E7BE165A
:1020100009F06EC0FBA9F3FD02C080E1F2CF2114EC
:1020200031044104510419F490E198AB05C0EBA9C7
:10203000E064EBABF0E1F8AB198289A987FD03C03E
:102040009BA99F7D9BAB211431044104510461F491
:10205000E9A9EE2349F46624772443015EE2C52E04
:10206000D12CCC0EDD1E3EC04EE2C42ED12CCC0EA7
:10207000DD1EF8A9EF2EFF2400271127C201B101B0
:10208000A80197010E94D9466A3020F430E3A32EBC
:10209000A60E08C027E5A22EA60E88E5B81611F4F4
:1020A0009FEDA922F601A2926F01C201B101A80120
:1020B00097010E94D94639014A012E143F04400677
:1020C000510618F019012A01D9CFF8A9F83051F4B6
:1020D0008BA983FF07C090E3A91621F080E3F601E6
:1020E00082936F01CE018C19182F125D49A910C07F
:1020F000BB2009F45CC0BE8219824201310100E0BC
:1021000096E0C92ED12CCC0EDD1E11E021E005C0D9
:10211000212F042F011B07FD00E08981882319F07E
:10212000812F8F5F07C09BA996FD02C0812F02C03F
:10213000822F8E5FA82EA00EEBA9EE2EFF2480E347
:10214000482E512C4E205F204114510421F48AA9BD
:102150008A190E942D0E8981882329F061E070E0A0
:10216000CE01019609C0E6FE09C080E38A83BB82E6
:1021700062E070E0CE0102960E944E0EF0E24F1631
:10218000510421F48AA98A190E94220E802F0E94EC
:10219000220E612F772767FD7095C6010E944E0EB3
:1021A000E4FEAACD8AA98A190E942D0EA5CDE2E1EE
:1021B000CD5C0C94324782E085BD83EA84BD17BCB8
:1021C00088E788BD96E096BD83EC8093B00090933D
:1021D000B100E0E7F0E0808182608083EEE6F0E02D
:1021E0008081816080838AE08093B3001092B20086
:1021F00008952091C3033091C4032F5F3F4F820F96
:10220000931F08952091C3033091C403821B930B45
:10221000892F992786958074992708951F920F9288
:102220000FB60F921124EF92FF920F931F932F93EB
:102230003F934F935F936F937F938F939F93AF934E
:10224000BF93CF93DF93EF93FF9380910603815069
:10225000809306038F3F09F06DC083E88093B00040
:1022600080919C03C82FDD27D093CB03C093CA0372
:1022700080914608E090330880FF1EC060910B04F7
:1022800070910C0480910D0490910E04FF2400279E
:10229000112720E830E040E050E00E94FB46C801F2
:1022A000B7010E94874620E032E040E050E00E9403
:1022B000FB46C20FD31F1DC060910B0470910C042C
:1022C00080910D0490910E04FF240027112720E82F
:1022D00030E040E050E00E94FB46C801B7010E9498
:1022E000874620E032E040E050E00E94FB46C21BFF
:1022F000D30BD093CB03C093CA032091CA03309170
:10230000CB038091340899272817390734F080913E
:10231000350899278217930724F49093CB03809371
:10232000CA038091CA038093B300809136088093DA
:10233000060304C083E08093B0005F98FF91EF91A3
:10234000DF91CF91BF91AF919F918F917F916F91CD
:102350005F914F913F912F911F910F91FF90EF90BF
:102360000F900FBE0F901F9018951F920F920FB6EF
:102370000F9211242F933F934F935F936F937F930B
:102380008F939F93AF93BF93EF93FF938091CC0371
:1023900081508093CC038F3FB9F489E08093CC03C4
:1023A000809107038F5F817080930703882319F45E
:1023B00081E08093C5038091C3039091C40301968B
:1023C0009093C4038093C3038091C6039091C70385
:1023D0000297B0F08091C6039091C7030197909344
:1023E000C7038093C6038091C6039091C7032091D1
:1023F00004033091050382239323892BE9F406C05B
:102400008FEF9FEF90930503809304038091000169
:102410008A3039F404C05A9A05C0479A03C05A98C2
:1024200001C0479880911908992783FD02C085FF54
:1024300008C00E94430405C0809100018A3069F7FA
:10244000EACFFF91EF91BF91AF919F918F917F91D3
:102450006F915F914F913F912F910F900FBE0F9011
:102460001F9018952091C3033091C4032F5F3F4FF5
:10247000280F391F4FEE02C040937A008091C303AA
:102480009091C403B901681B790B77FFF5CF0895CC
:102490002091C3033091C4032F5F3F4F280F391F92
:1024A0008091C3039091C403A901481B590B57FFA6
:1024B000F7CF089510927C008FEE80937A000895F4
:1024C0001F920F920FB60F921124DF92EF92FF929C
:1024D0000F931F932F933F934F935F936F937F932C
:1024E0008F939F93AF93BF93CF93DF93EF93FF931C
:1024F00010927A008091E903D82ED394D092E90308
:10250000E82FFF27EB30F10508F038C2E95AFF4FFA
:102510000C944D4780917800909179009093E80356
:102520008093E70381E08093EA038091E103909137
:10253000E20301969093E2038093E10315C2809138
:102540007800909179009093E6038093E50390C022
:1025500080917800909179009093E4038093E30355
:1025600084E086C14091080350910903809178006E
:10257000909179009A01220F331F240F351F63E0D9
:1025800070E00E94B246260F371F36952795369584
:102590002795309309032093080386E069C1809151
:1025A0000304909104042091780030917900821BFB
:1025B000930B9093BC078093BB078091BB079091CE
:1025C000BC079093D4038093D30387E051C18091DB
:1025D0007800909179002091010430910204821BCF
:1025E000930B9093C7078093C6078091C60790917D
:1025F000C7079093D6038093D5031092EA03B4C122
:10260000809100012091E7033091E8038A3049F47A
:102610008091780090917900820F931F969587950D
:1026200006C08091780090917900820F931F90935B
:10263000D2038093D10381E01BC1809100012091DE
:10264000E5033091E6038A3049F480917800909157
:102650007900820F931F9695879506C08091780028
:1026600090917900820F931F9093D0038093CF03B2
:1026700082E0FEC0809100012091E3033091E403E9
:102680008A3049F48091780090917900820F931FED
:102690009695879506C08091780090917900820F79
:1026A000931F9093CE038093CD0385E0E1C06091AA
:1026B000780070917900E0900504F0900604009194
:1026C000070410910804882777FD8095982F0E94B1
:1026D000C545A80197010E941F450E94A845709317
:1026E000D8036093D7032091D7033091D803E091AA
:1026F000BB07F091BC078091C6079091C70797FF71
:1027000003C0909581959F4F64E070E00E94C6469B
:10271000EB01CF01F7FF03C0909581959F4F64E0D7
:1027200070E00E94C646260F371F2C0F3D1F3093C6
:10273000D8032093D7038091D7039091D8030297B1
:1027400004F1609105047091060480910704909152
:10275000080420E030E048E454E40E94CF45882398
:102760000CF03CC060910504709106048091070450
:10277000909108042AE037ED43EA5CE30E9420458B
:1027800025C08091D7039091D8038F5F9F4F34F578
:1027900060910504709106048091070490910804EB
:1027A00020E030E046E154E40E94D2451816B4F42B
:1027B00060910504709106048091070490910804CB
:1027C0002AE037ED43EA5CE30E941F45609305046D
:1027D00070930604809307049093080481E080932B
:1027E000DE0380917800909179009093BE078093EA
:1027F000BD07209143043091440440914504509119
:1028000046048091D7039091D803AA2797FDA095FD
:10281000BA2F280F391F4A1F5B1F209343043093A0
:1028200044044093450450934604E0904304F090E0
:102830004404009145041091460460914304709152
:102840004404809145049091460420E034E040E047
:1028500050E00E94FB46E21AF30A040B150BE092CB
:102860004304F0924404009345041093460483E02B
:102870008093EA0379C08091CB079091CC07209197
:10288000780030917900820F931F9093CC0780934A
:10289000CB078091C3078F5F8093C3078091C307E5
:1028A000853008F46BC08091780090917900909306
:1028B0000F0380930E031092C3078091BF0790917E
:1028C000C0072091CB073091CC07821B930B20913E
:1028D0006F0430917004821B930B9093E0038093FC
:1028E000DF036091CB077091CC07E0900A03F09072
:1028F0000B0300910C0310910D03882777FD809541
:10290000982FA8019701220F331F441F551F2E0D2A
:102910003F1D401F511F620F731F841F951F24E02E
:1029200030E040E050E00E94FB4620930A033093E1
:102930000B0340930C0350930D032091BF0730917C
:10294000C00780910A0390910B03A0910C03B091F2
:102950000D03281B390B3093700420936F041092E1
:10296000CC071092CB070AC08091EA0380937C00C9
:10297000DD2051F08FEE80937A0006C01092EA03BA
:102980001092E90310927C00FF91EF91DF91CF91BB
:10299000BF91AF919F918F917F916F915F914F9177
:1029A0003F912F911F910F91FF90EF90DF900F902B
:1029B0000FBE0F901F901895CF93DF93A3E0B0E068
:1029C0000E945347802DC82FDD27C531D10508F05F
:1029D0002A97C7BD84E690E00E94321280910E03D0
:1029E00090910F0382559340D0F4C0E0D0E017C01F
:1029F000C7BD82E390E00E94321285E092E09F938F
:102A00008F931F920E94620E80910E0390910F038C
:102A10000F900F900F908458934020F02196CA3F5A
:102A2000D10530F3A3E0B0E00C2E0E946047C093C4
:102A3000C8078CE291E00E943212DF91CF91089595
:102A4000EAE1F3E080E2819393E0EA36F907D9F70F
:102A50000895FF920F931F938091EE03282F332741
:102A6000C90181709070682F8823A9F08091EF03CD
:102A7000882311F0815002C080916A038093EF0394
:102A8000EAE1F3E080E2819393E0EA36F907D9F7CF
:102A90008FEF8093AF03A9014270507021FF10C0E7
:102AA0008091EF038F5F8093EF03EAE1F3E080E230
:102AB000819393E0EA36F907D9F78FEF8093AF035C
:102AC000662331F0452B21F01092EF0390E004C013
:102AD0009091EF039A3050F481E18093ED03892FB8
:102AE00099279F938F9388E795E009C080E18093B1
:102AF000ED03892F99279F938F9383E795E09F9309
:102B00008F9381E08F930E94620E0F900F900F9031
:102B10000F900F908091EF03E82FFF27EE30F10523
:102B200008F09CC4EE59FF4F0C944D471092ED03F2
:102B300083E695E09F938F9311E01F930E94620EAE
:102B400084E18093ED032091000184E690E09F935F
:102B50008F9384E490E09F938F931F921F92822F14
:102B60006AE00E94A646892F99279F938F93822F10
:102B70000E94A64699279F938F938EE495E09F939A
:102B80008F931F930E94620E88E28093ED030E9450
:102B9000340499279F938F9381E495E09F938F93BB
:102BA0001F930E94620E8CE38093ED0381E395E016
:102BB0009F938F931F930E94620ED5C38091190833
:102BC00080FF44C01092ED0380916F0490917004D7
:102BD0009F938F9382E295E09F938F9311E01F93D1
:102BE0000E94620E84E18093ED03809171049091C4
:102BF00072049F938F9383E195E09F938F931F932C
:102C00000E94620E88E28093ED0380910E03909102
:102C10000F039F938F9384E095E09F938F931F936F
:102C20000E94620E8CE38093ED038091C807992780
:102C30009F938F9385EF94E09F938F931F930E94B0
:102C4000620E8DB79EB744968DBF0DC484E180930C
:102C5000ED038EEE94E09F938F9311E01F930E94FB
:102C6000620E88E28093ED0380EE94E09F938F9351
:102C70001F930E94620E8DB79EB70696E5CF109205
:102C8000ED0386ED94E09F938F9311E01F930E94D4
:102C9000620E84E18093ED0360910B0470910C044B
:102CA00080910D0490910E0420E034E040E050E06B
:102CB0000E94FB465F934F933F932F9387EC94E0E2
:102CC0009F938F931F930E94620E88E28093ED037F
:102CD000609113047091140480911504909116046E
:102CE00020E034E040E050E00E94FB465F934F93C9
:102CF0003F932F9388EB94E09F938F931F930E94B1
:102D0000620E8CE38093ED03809147049091480418
:102D10009F938F9389EA94E09F938F931F930E94D0
:102D2000620E8DB79EB746968FCF1092ED038091BD
:102D3000D9079091DA072091D7073091D8079F9350
:102D40008F933F932F9389E994E09F938F9311E0A2
:102D50001F930E94620E84E18093ED038091DD0752
:102D60009091DE072091DB073091DC079F938F93D2
:102D70003F932F9389E894E09F938F931F930E9432
:102D8000620E88E28093ED038091E1079091E20763
:102D90002091DF073091E0079F938F933F932F930C
:102DA00089E794E09F938F931F930E94620E8CE3B8
:102DB0008093ED038091E5079091E6072091E3076A
:102DC0003091E4079F938F933F932F9389E694E08C
:102DD00035C21092ED03E0911208FF27EE0FFF1F9E
:102DE000EB52F84F20813181E0911108FF27EE0F5F
:102DF000FF1FEB52F84F808191813F932F939F9358
:102E00008F9389E594E09F938F9311E01F930E9425
:102E1000620E84E18093ED03E0911408FF27EE0F2A
:102E2000FF1FEB52F84F20813181E0911308FF27FB
:102E3000EE0FFF1FEB52F84F808191813F932F934C
:102E40009F938F9389E494E09F938F931F930E94A5
:102E5000620E88E28093ED03E0911608FF27EE0FE3
:102E6000FF1FEB52F84F20813181E0911508FF27B9
:102E7000EE0FFF1FEB52F84F808191813F932F930C
:102E80009F938F9389E394E09F938F931F930E9466
:102E9000620E8CE38093ED03E0911808FF27EE0F9C
:102EA000FF1FEB52F84F20813181E0911708FF2777
:102EB000EE0FFF1FEB52F84F808191813F932F93CC
:102EC0009F938F9389E294E0B9C11092ED038BE157
:102ED00094E09F938F9311E01F930E94620E0F90D6
:102EE0000F900F90809100018A3009F04AC084E170
:102EF0008093ED034091F7035091F8038091CD0347
:102F00009091CE032091F7033091F8035F934F9394
:102F1000821B930B9F938F938CE094E09F938F93EE
:102F20001F930E94620E88E28093ED034091F903A3
:102F30005091FA038091CF039091D0032091F9032F
:102F40003091FA035F934F93821B930B9F938F9360
:102F50008DEF93E09F938F931F930E94620E8CE3FB
:102F60008093ED038091FB039091FC0320918008F6
:102F7000309181089F938F933F932F938EEE93E030
:102F800055C084E18093ED038091F7039091F8039D
:102F90002091CD033091CE03E091F703F091F80337
:102FA00062E070E00E94C6467F936F932E1B3F0B3A
:102FB0003F932F938FED93E09F938F931F930E94E6
:102FC000620E88E28093ED038091F9039091FA03F9
:102FD0002091CF033091D003E091F903F091FA03EF
:102FE00062E070E00E94C6467F936F932E1B3F0BFA
:102FF0003F932F9380ED93E09F938F931F930E94B5
:10300000620E8CE38093ED038091FB039091FC03AF
:10301000209180083091810862E070E00E94C646ED
:103020007F936F933F932F9381EC93E09F938F93C4
:103030001F930E94620E8DB79EB7459605CE1092E3
:10304000ED0384EB93E09F938F9381E0F82EFF9242
:103050000E94620E84E18093ED03809101049091BF
:1030600002042091D5033091D6039F938F933F9311
:103070002F9385EA93E09F938F93FF920E94620EB5
:1030800088E28093ED0380910304909104042091E1
:10309000D3033091D4039F938F933F932F9386E96B
:1030A00093E09F938F93FF920E94620E8CE3809334
:1030B000ED036091050470910604809107049091DE
:1030C000080400916808109169080E94A8457F9340
:1030D0006F931F930F9387E893E09F938F93FF92D3
:1030E00040C184E18093ED0380910803909109032E
:1030F0009F938F9388E793E09F938F9311E01F93A3
:103100000E94620E88E28093ED0380916504992706
:103110009F938F9389E693E09F938F931F930E94D1
:10312000620E8DB79EB70A968FCD1092ED038AE599
:1031300093E09F938F9311E01F930E94620E84E1AE
:103140008093ED0380914B0490914C049F938F9357
:103150008BE493E09F938F931F930E94620E88E20B
:103160008093ED0380914704909148049F938F933F
:103170008CE393E09F938F931F930E94620E8CE3E6
:103180008093ED038091490490914A049F938F931B
:103190008DE293E05AC11092ED0380915D0490910D
:1031A0005E049F938F9380915504909156049F9352
:1031B0008F938BE193E09F938F9311E01F930E9475
:1031C000620E84E18093ED0380915F04909160042E
:1031D0009F938F9380915704909158049F938F935E
:1031E00089E093E09F938F931F930E94620E88E281
:1031F0008093ED0380916104909162049F938F937B
:103200008091590490915A049F938F9387EF92E095
:103210009F938F931F930E94620E8CE38093ED0324
:1032200080916304909164049F938F9380915B04D9
:1032300090915C049F938F9385EE92E09F938F9380
:103240001F930E94620E8DB79EB74C96FDCC1092D4
:10325000ED038DED92E09F938F9311E01F930E94F9
:10326000620E84E18093ED0380919C0399279F93E4
:103270008F938FEC92E09F938F931F930E94620E27
:1032800088E28093ED038091CA039091CB039F93D2
:103290008F9381EC92E09F938F931F930E94620E15
:1032A0008CE38093ED038091350899279F938F934A
:1032B0008091340899279F938F9383EB92E09F939B
:1032C0008F931F930E94620EBCCC1092ED0383EA91
:1032D00092E09F938F9311E01F930E94620E84E10E
:1032E0008093ED0380917B06992787FD90959F93AE
:1032F0008F9380917A06992787FD90959F938F935E
:1033000083E992E09F938F931F930E94620E88E25D
:103310008093ED0380917C06992787FD90959F937C
:103320008F9380917D0699279F938F9383E892E0F6
:103330009F938F931F930E94620E8CE38093ED0303
:103340008091810699279F938F9380917E0699277C
:1033500087FD90959F938F9383E792E09F938F9340
:103360001F930E94620E8DB79EB748966DCC109247
:10337000ED0388E692E09F938F9311E01F930E94E4
:10338000620E84E18093ED0380911205992787FDF9
:1033900090959F938F9389E592E09F938F931F93CE
:1033A0000E94620E88E28093ED03809113059927B5
:1033B00087FD90959F938F938AE492E09F938F93DC
:1033C0001F930E94620E8CE38093ED03809114059D
:1033D000992787FD90959F938F938BE392E035C05B
:1033E0001092ED0381E392E09F938F9311E01F937E
:1033F0000E94620E84E18093ED0380911505909107
:1034000016059F938F9383E292E09F938F931F9370
:103410000E94620E88E28093ED03809117059091DF
:1034200018059F938F9385E192E09F938F931F934D
:103430000E94620E8CE38093ED03809119059091B8
:103440001A059F938F9387E092E09F938F931F932A
:103450000E94620E8DB79EB74296F6CB8150809344
:103460006A031092EF031092EE031F910F91FF90E9
:1034700008951092B9008AE28093B800089585EA11
:103480008093BC0080E090E0089584E98093BC00C4
:1034900008951092B9008093BB0085E88093BC002A
:1034A00080E090E008951F920F920FB60F921124C2
:1034B0008F939F93EF93FF938091F0038F5F80939F
:1034C000F0038150E82FFF27E830F10508F064C0D1
:1034D000E059FF4F0C944D478091F103880F8E5AAD
:1034E00009C08091F1038F5F8093F103815027C061
:1034F00080915B081092B9008093BB0085E88093AF
:10350000BC004AC084E98093BC008091F103843000
:1035100018F41092F00302C01092F10385EAEFCF85
:103520008091F203880F8D5AE5CF8091BB00E09126
:10353000F203FF27E353F84F80838091F203813039
:1035400039F08130A8F2823031F0833029F506C09D
:1035500080916008CFCF80917808CCCF80917A0895
:10356000C9CF8091F2039091BB00E82FFF27E3536E
:10357000F84F94838F5F8093F203843010F01092A1
:10358000F20384E98093BC008AE090E09093860384
:10359000809385031092F0038091BC008068809333
:1035A000BC00FF91EF919F918F910F900FBE0F90F4
:1035B0001F9018954CEB50E084E9DA018C9310923F
:1035C000F0032BEB30E0F90180811092F10380E8E9
:1035D0008C931092BD001092BA001082E9EBF0E0DB
:1035E0001082A8EBB0E01C9210828AE28C9385EAEC
:1035F000DA018C931082F901108285E88C9308958A
:1036000083EC80938100EFE6F0E08081806280832C
:103610001092FC031092FB031092FA031092F9032C
:103620001092F8031092F70308951F920F920FB6AD
:103630000F9211240F931F932F933F934F935F93F8
:103640006F937F938F939F93AF93BF93CF93DF93AA
:10365000EF93FF9320918600309187008091F503CE
:103660009091F603281B390B80918600909187007A
:103670009093F6038093F503C9018D549440009113
:10368000F3031091F403835F9A4160F40430110551
:1036900014F010926B0381E090E09093F403809318
:1036A000F30384C00E3011050CF080C0C9018B5F9C
:1036B0009040845B914008F068C0E901C25DD14050
:1036C000F801EE0FFF1FEB52F84F808191819E01B0
:1036D000281B390BC90137FF03C0909581959F4F77
:1036E00006974CF480916504883C28F48091650429
:1036F000865F80936504F801EE0FFF1FEB52F84FD1
:1037000020813181C901880F991F820F931F8C0F6F
:103710009D1F64E070E00E94C6469B01CE010196A9
:10372000861797071CF42150304006C021976C176C
:103730007D0714F42F5F3F4F80916504E801CC0FA3
:10374000DD1F833CB8F0FE01EB52F84F8081918180
:10375000A901481B590BCA0163E070E00E94C646EC
:10376000CB01880F991F860F971FCD50D84F998393
:10377000888304C0CD50D84F19821882F801EE0F0B
:10378000FF1FEB52F84F31832083F8013196F093FD
:10379000F403E093F303E530F10511F45D9A05C0FD
:1037A0005D98369711F45C9A01C05C98FF91EF9197
:1037B000DF91CF91BF91AF919F918F917F916F9149
:1037C0005F914F913F912F911F910F910F900FBEDD
:1037D0000F901F901895A2E0B0E0E1EFFBE10C9490
:1037E00016478091FB039091FC032091D103309107
:1037F000D203821B930B9093810880938008809161
:10380000CF039091D0032091F9033091FA03821BEA
:10381000930B90935A08809359088091CD0390910F
:10382000CE032091F7033091F803821B930B909302
:10383000620880936108E0907D08F0907E086091B6
:10384000D5037091D6030027F7FC0095102F882729
:1038500077FD8095982F2CE030E040E050E00E940A
:103860008746E60EF71E081F191FC801B70122E0A0
:1038700030E040E050E00E94FB4630937E08209309
:103880007D08E0908708F09088086091D3037091DC
:10389000D4030027F7FC0095102F882777FD80952B
:1038A000982F2CE030E040E050E00E948746E60E82
:1038B000F71E081F191FC801B70122E030E040E0E1
:1038C00050E00E94FB46309388082093870860915F
:1038D0006808709169082091D7033091D803882730
:1038E00077FD8095982F442737FD4095542F620F20
:1038F000731F841F951F22E030E040E050E00E94DB
:10390000FB46309369082093680820911B0430918E
:103910001C0440911D0450911E046091D5037091C8
:10392000D603CB01880F991F860F971F880F991F09
:10393000880F991FAA2797FDA095BA2F280F391F26
:103940004A1F5B1F20931B0430931C0440931D04EB
:1039500050931E0420911F043091200440912104B3
:10396000509122046091D3037091D403CB01880F4E
:10397000991F860F971F880F991F880F991FAA27D5
:1039800097FDA095BA2F280F391F4A1F5B1F209360
:103990001F0430932004409321045093220460912B
:1039A0002304709124048091250490912604E090D2
:1039B000BD07F090BE07A0900504B0900604C0902B
:1039C0000704D09008040E94C5453B014C01002724
:1039D000F7FC0095102FC801B7010E94C545A6014C
:1039E00095010E941F459B01AC01C401B3010E94D7
:1039F00020450E94A845609323047093240480937B
:103A000025049093260420913B0430913C0440917E
:103A10003D0450913E048091800890918108AA272E
:103A200097FDA095BA2F280F391F4A1F5B1F2093BF
:103A30003B0430933C0440933D0450933E0420915A
:103A40003F043091400440914104509142048091E0
:103A5000800890918108AA2797FDA095BA2F280F7A
:103A6000391F4A1F5B1F20933F043093400440934B
:103A7000410450934204209177042A83222309F0C1
:103A80006BC080917804882309F066C08091190882
:103A900086FF62C060912B0470912C0480912D04EC
:103AA00090912E04E0908008F0908108A090850409
:103AB000BB24CC24DD2420E030E140E050E00E9433
:103AC000FB460027F7FC0095102FCA01B901A80199
:103AD00097010E948746A60195010E94874620E033
:103AE00038E040E050E00E94FB462093D20430933F
:103AF000D3044093D4045093D5046091330470915F
:103B000034048091350490913604E0908008F09060
:103B1000810820E030E140E050E00E94FB460027B1
:103B2000F7FC0095102FCA01B901A80197010E9466
:103B30008746A60195010E94874620E038E040E0D4
:103B400050E00E94FB462093CE043093CF04409374
:103B5000D0045093D10410C01092CE041092CF0420
:103B60001092D0041092D1041092D2041092D30477
:103B70001092D4041092D5048091590890915A085B
:103B80002090D2043090D3044090D4045090D504B7
:103B9000820D931D90935A088093590800915908FB
:103BA00010915A08A090CE04B090CF04C090D004D9
:103BB000D090D10480918604682E7724882499249B
:103BC000C601B501A40193010E94874620E032E0BE
:103BD00040E050E00E94FB46020F131F10935A086A
:103BE00000935908209137043091380440913904EA
:103BF00050913A048091590890915A08AA2797FD4C
:103C0000A095BA2F280F391F4A1F5B1F2093370436
:103C1000309338044093390450933A04209133048C
:103C20003091340440913504509136048091590804
:103C300090915A086091730470917404861B970BDD
:103C4000AA2797FDA095BA2F280F391F4A1F5B1F7F
:103C50002093330430933404409335045093360456
:103C60008091330490913404A0913504B0913604CE
:103C7000E0908B03F0908C0300918D0310918E03E4
:103C8000E816F9060A071B0704F580E197E2A0E0B1
:103C9000B0E08E199F09A00BB10B80933304909371
:103CA0003404A0933504B09336048091330490918A
:103CB0003404A0913504B091360480933704909376
:103CC0003804A0933904B0933A042091330430911E
:103CD0003404409135045091360488279927DC013B
:103CE0008E199F09A00BB10B281739074A075B07EC
:103CF00004F580EF98EDAFEFBFEFE80EF91E0A1F55
:103D00001B1FE0923304F0923404009335041093A7
:103D100036048091330490913404A0913504B0911D
:103D200036048093370490933804A0933904B093F9
:103D30003A048091CF039091D0030F9734F488E137
:103D40009CEF90935A08809359088091CF039091EB
:103D5000D003079734F480E398EF90935A08809348
:103D600059089091000199839A30A9F48091CF036A
:103D70009091D003835F934034F088EE93E090936A
:103D80005A08809359088091CF039091D0038A5F9D
:103D90009340DCF014C08091CF039091D003855EF6
:103DA000974034F088EE93E090935A088093590836
:103DB0008091CF039091D003835F974034F080EDE2
:103DC00097E090935A0880935908809161089091E8
:103DD00062088A199B099093620880936108009198
:103DE000610810916208C201B101A40193010E940F
:103DF000874620E032E040E050E00E94FB46021B94
:103E0000130B109362080093610820912F043091E6
:103E100030044091310450913204809161089091B6
:103E20006208AA2797FDA095BA2F280F391F4A1FAD
:103E30005B1F20932F043093300440933104509340
:103E4000320420912B0430912C0440912D04509188
:103E50002E048091610890916208609175047091C0
:103E60007604861B970BAA2797FDA095BA2F280FDB
:103E7000391F4A1F5B1F20932B0430932C0440935F
:103E80002D0450932E0480912B0490912C04A0912A
:103E90002D04B0912E04E0908703F09088030091E8
:103EA000890310918A03E816F9060A071B0704F52F
:103EB00080E197E2A0E0B0E08E199F09A00BB10B62
:103EC00080932B0490932C04A0932D04B0932E0484
:103ED00080912B0490912C04A0912D04B0912E047C
:103EE00080932F0490933004A0933104B093320454
:103EF00020912B0430912C0440912D0450912E04DC
:103F000088279927DC018E199F09A00BB10B281770
:103F100039074A075B0704F580EF98EDAFEFBFEF75
:103F2000E80EF91E0A1F1B1FE0922B04F0922C04CE
:103F300000932D0410932E0480912B0490912C0457
:103F4000A0912D04B0912E0480932F0490933004FF
:103F5000A0933104B09332048091CD039091CE03AD
:103F60000F9734F488E19CEF909362088093610886
:103F70008091CD039091CE03079734F480E398EFBE
:103F8000909362088093610899819A30A9F4809196
:103F9000CD039091CE03835F934034F088EE93E09D
:103FA00090936208809361088091CD039091CE0335
:103FB0008A5F9340DCF014C08091CD039091CE03D2
:103FC000855E974034F088EE93E09093620880938A
:103FD00061088091CD039091CE03835F974034F0C8
:103FE00080ED97E090936208809361088FEE809354
:103FF0007A0080913B0490913C04A0913D04B091E3
:104000003E048093270490932804A0932904B0933E
:104010002A0480912B0490912C04A0912D04B0913E
:104020002E0480930B0490930C04A0930D04B09382
:104030000E048091330490913404A0913504B09122
:1040400036048093130490931404A0931504B09342
:10405000160480912F0490913004A0913104B09106
:10406000320480930F0490931004A0931104B09332
:1040700012048091370490913804A0913904B091D2
:104080003A048093170490931804A0931904B093F2
:104090001A049091190897FF6DC02A81222309F014
:1040A00069C080917804882309F064C092FD62C0E1
:1040B0008091610890916208893C91057CF0209183
:1040C0006108309162088091610890916208880FC0
:1040D000991F880F991F2052334015C080916108A5
:1040E0009091620888539F4FA4F420916108309109
:1040F00062088091610890916208880F991F880F6B
:10410000991F205E3C4F820F931F9093620880930B
:1041100061088091590890915A08893C91057CF07A
:104120002091590830915A088091590890915A0865
:10413000880F991F880F991F2052334015C0809116
:10414000590890915A0888539F4FA4F42091590818
:1041500030915A088091590890915A08880F991FF8
:10416000880F991F205E3C4F820F931F90935A082F
:104170008093590820915504309156048091150878
:10418000E82FFF27EE0FFF1FEB52F84F8081918140
:1041900082599F4F281739071CF42F5F3F4F0CC0DF
:1041A0008081918182599F4F821793074CF421158A
:1041B000310531F02150304030935604209355049E
:1041C000209157043091580480911608E82FFF275A
:1041D000EE0FFF1FEB52F84F8081918182599F4F64
:1041E000281739071CF42F5F3F4F0CC08081918145
:1041F00082599F4F821793074CF42115310531F0F6
:104200002150304030935804209357042091590492
:1042100030915A0480911708E82FFF27EE0FFF1FF7
:10422000EB52F84F8081918182599F4F28173907AF
:104230001CF42F5F3F4F0CC08081918182599F4FAA
:10424000821793074CF42115310531F0215030408D
:1042500030935A042093590420915B0430915C04FC
:1042600080911808E82FFF27EE0FFF1FEB52F84F41
:104270008081918182599F4F281739071CF42F5F45
:104280003F4F0CC08081918182599F4F82179307C5
:104290004CF42115310531F02150304030935C044D
:1042A00020935B0420915D0430915E048091E707C8
:1042B0009091E80782599F4F281739071CF42F5F08
:1042C0003F4F0EC08091E7079091E80782599F4FBA
:1042D000821793074CF42115310531F021503040FD
:1042E00030935E0420935D0420915F04309160045C
:1042F0008091E9079091EA0782599F4F2817390763
:104300001CF42F5F3F4F0EC08091E9079091EA07A0
:1043100082599F4F821793074CF42115310531F0D4
:10432000215030403093600420935F042091610459
:10433000309162048091EB079091EC0782599F4F76
:10434000281739071CF42F5F3F4F0EC08091EB07F1
:104350009091EC0782599F4F821793074CF42115D7
:10436000310531F0215030403093620420936104D4
:1043700020916304309164048091ED079091EE07E1
:1043800082599F4F281739071CF42F5F3F4F0EC0EB
:104390008091ED079091EE0782599F4F8217930706
:1043A0004CF42115310531F0215030403093640434
:1043B00020936304809155049091560497FF05C0A3
:1043C00010925604109255040AC08F3F910539F09F
:1043D00034F08FEF90E090935604809355048091D1
:1043E00057049091580497FF05C0109258041092FA
:1043F00057040AC08F3F910539F034F08FEF90E0F9
:1044000090935804809357048091590490915A04D2
:1044100097FF05C010925A04109259040AC08F3FAA
:10442000910539F034F08FEF90E090935A04809327
:10443000590480915B0490915C0497FF05C0109231
:104440005C0410925B040AC08F3F910539F034F090
:104450008FEF90E090935C0480935B0480915D0407
:1044600090915E0497FF05C010925E0410925D0467
:104470000AC08F3F910539F034F08FEF90E09093B0
:104480005E0480935D0480915F049091600497FFC7
:1044900005C01092600410925F040AC08F3F91051E
:1044A00039F034F08FEF90E09093600480935F04D4
:1044B000809161049091620497FF05C0109262049C
:1044C000109261040AC08F3F910539F034F08FEFEC
:1044D00090E09093620480936104809163049091D2
:1044E000640497FF05C010926404109263040AC02C
:1044F0008F3F910539F034F08FEF90E09093640492
:1045000080936304E2E1CE5F0C94324710927A000C
:104510008091CD039091CE039093620880936108BF
:104520008091CF039091D00390935A0880935908BB
:104530008091D1039091D203909381088093800859
:104540006091D5037091D603882777FD8095982FC9
:104550002CE030E040E050E00E94874670937E08F7
:1045600060937D086091D3037091D403882777FD11
:104570008095982F0E9487467093880860938708DB
:104580008091D7039091D80390936908809368082D
:104590008FEE80937A0020915504309156048091DB
:1045A0001508E82FFF27EE0FFF1FEB52F84F808111
:1045B000918182599F4F281739071CF42F5F3F4F75
:1045C0000CC08081918182599F4F821793074CF4D0
:1045D0002115310531F0215030403093560420939D
:1045E0005504209157043091580480911608E82F03
:1045F000FF27EE0FFF1FEB52F84F80819181825908
:104600009F4F281739071CF42F5F3F4F0CC0808144
:10461000918182599F4F821793074CF421153105E0
:1046200031F02150304030935804209357042091AA
:10463000590430915A0480911708E82FFF27EE0F94
:10464000FF1FEB52F84F8081918182599F4F2817AD
:1046500039071CF42F5F3F4F0CC080819181825934
:104660009F4F821793074CF42115310531F02150EB
:10467000304030935A042093590420915B043091C8
:104680005C0480911808E82FFF27EE0FFF1FEB5204
:10469000F84F8081918182599F4F281739071CF468
:1046A0002F5F3F4F0CC08081918182599F4F8217AD
:1046B00093074CF42115310531F0215030403093EF
:1046C0005C0420935B0420915D0430915E04809132
:1046D000E7079091E80782599F4F281739071CF484
:1046E0002F5F3F4F0EC08091E7079091E8078259F6
:1046F0009F4F821793074CF42115310531F021505B
:10470000304030935E0420935D0420915F0430912B
:1047100060048091E9079091EA0782599F4F28171A
:1047200039071CF42F5F3F4F0EC08091E90790912D
:10473000EA0782599F4F821793074CF421153105E0
:1047400031F0215030403093600420935F04209179
:104750006104309162048091EB079091EC078259DB
:104760009F4F281739071CF42F5F3F4F0EC08091D1
:10477000EB079091EC0782599F4F821793074CF4F7
:104780002115310531F021503040309362042093DF
:10479000610420916304309164048091ED0790914D
:1047A000EE0782599F4F281739071CF42F5F3F4FA0
:1047B0000EC08091ED079091EE0782599F4F8217AE
:1047C00093074CF42115310531F0215030403093DE
:1047D000640420936304809155049091560497FFDC
:1047E00005C010925604109255040AC08F3F9105DF
:1047F00039F034F08FEF90E0909356048093550495
:10480000809157049091580497FF05C01092580466
:10481000109257040AC08F3F910539F034F08FEFA2
:1048200090E090935804809357048091590490919C
:104830005A0497FF05C010925A04109259040AC0F6
:104840008F3F910539F034F08FEF90E090935A0448
:104850008093590480915B0490915C0497FF05C09C
:1048600010925C0410925B040AC08F3F910539F0EE
:1048700034F08FEF90E090935C0480935B04809120
:104880005D0490915E0497FF05C010925E04109243
:104890005D040AC08F3F910539F034F08FEF90E04E
:1048A00090935E0480935D0480915F049091600416
:1048B00097FF05C01092600410925F040AC08F3FFA
:1048C000910539F034F08FEF90E09093600480937D
:1048D0005F04809161049091620497FF05C010927B
:1048E0006204109261040AC08F3F910539F034F0E0
:1048F0008FEF90E090936204809361048091630451
:104900009091640497FF05C01092640410926304B0
:104910000AC08F3F910539F034F08FEF90E090930B
:1049200064048093630460913C0877278827992763
:1049300024EC39E040E050E00E9487466093870312
:10494000709388038093890390938A0360913D0854
:104950007727882799270E94874660938B03709357
:104960008C0380938D0390938E0308951F93809101
:104970001C088B3F98F08B3F19F4809155040EC0B2
:104980008C3F19F48091570409C08D3F19F4809130
:10499000590404C08E3F21F480915B0480939403FA
:1049A00080919403882319F41092940304C08F3FDC
:1049B00011F48093940380911B088B3F98F08B3FF8
:1049C00019F4809155040EC08C3F19F4809157045E
:1049D00009C08D3F19F48091590404C08E3F21F421
:1049E00080915B048093930380919303882319F44F
:1049F0001092930305C0843618F084E680939303E5
:104A000080911D088B3F98F08B3F19F480915504DD
:104A10000EC08C3F19F48091570409C08D3F19F4E2
:104A20008091590404C08E3F21F480915B048093EF
:104A3000950380919503882319F41092950305C07E
:104A4000843618F084E68093950380911F088B3F8D
:104A500098F08B3F19F4809155040EC08C3F19F4E7
:104A60008091570409C08D3F19F48091590404C006
:104A70008E3F21F480915B0480939603809196038E
:104A8000882319F41092960304C08F3F11F4809389
:104A90009603809126088B3F98F08B3F19F4809104
:104AA00055040EC08C3F19F48091570409C08D3F06
:104AB00019F48091590404C08E3F21F480915B0465
:104AC0008093970380919703882319F4109297039A
:104AD00004C08F3F11F480939703809127088B3F88
:104AE00098F08B3F19F4809155040EC08C3F19F457
:104AF0008091570409C08D3F19F48091590404C076
:104B00008E3F21F480915B048093980380919803F9
:104B10008B3010F48AE002C08F3F11F48093980329
:104B2000809128088B3F98F08B3F19F480915504B1
:104B30000EC08C3F19F48091570409C08D3F19F4C1
:104B40008091590404C08E3F21F480915B048093CE
:104B5000990380919903882319F41092990304C052
:104B60008F3F11F48093990380912D088B3F98F02B
:104B70008B3F19F4809155040EC08C3F19F480913D
:104B8000570409C08D3F19F48091590404C08E3F29
:104B900021F480915B0480939B0380919B03882385
:104BA00019F410929B0304C08F3F11F480939B0370
:104BB00080912E088B3F98F08B3F19F4809155041B
:104BC0000EC08C3F19F48091570409C08D3F19F431
:104BD0008091590404C08E3F21F480915B0480933E
:104BE0007D0480917D04882319F410927D0404C013
:104BF0008F3F11F480937D0480912F088B3F98F0B4
:104C00008B3F19F4809155040EC08C3F19F48091AC
:104C1000570409C08D3F19F48091590404C08E3F98
:104C200021F480915B0480937E0480917E0488232C
:104C300019F410927E0404C08F3F11F480937E0417
:104C4000809130088B3F98F08B3F19F48091550488
:104C50000EC08C3F19F48091570409C08D3F19F4A0
:104C60008091590404C08E3F21F480915B048093AD
:104C70007F0480917F04882319F410927F0404C07C
:104C80008F3F11F480937F04809131088B3F98F01F
:104C90008B3F19F4809155040EC08C3F19F480911C
:104CA000570409C08D3F19F48091590404C08E3F08
:104CB00021F480915B048093800480918004882398
:104CC00019F41092800404C08F3F11F48093800483
:104CD000809141088B3F98F08B3F19F480915504E7
:104CE0000EC08C3F19F48091570409C08D3F19F410
:104CF0008091590404C08E3F21F480915B0480931D
:104D0000810480918104882319F41092810404C0E5
:104D10008F3F11F480938104809142088B3F98F07B
:104D20008B3F19F4809155040EC08C3F19F480918B
:104D3000570409C08D3F19F48091590404C08E3F77
:104D400021F480915B048093820480918204882303
:104D500019F41092820404C08F3F11F480938204EE
:104D6000809143088B3F98F08B3F19F48091550454
:104D70000EC08C3F19F48091570409C08D3F19F47F
:104D80008091590404C08E3F21F480915B0480938C
:104D9000830480918304882319F41092830404C04F
:104DA0008F3F11F480938304809144088B3F98F0E7
:104DB0008B3F19F4809155040EC08C3F19F48091FB
:104DC000570409C08D3F19F48091590404C08E3FE7
:104DD00021F480915B04809384048091840488236F
:104DE00019F41092840404C08F3F11F4809384045A
:104DF000809132088B3F98F08B3F19F480915504D5
:104E00000EC08C3F19F48091570409C08D3F19F4EE
:104E10008091590404C08E3F21F480915B048093FB
:104E20009C0380919C03882319F410929C0304C076
:104E30008F3F11F480939C03809137088B3F98F04B
:104E40008B3F19F4809155040EC08C3F19F480916A
:104E5000570409C08D3F19F48091590404C08E3F56
:104E600021F480915B0480939D0380919D038823AE
:104E700019F410929D0304C08F3F11F480939D0399
:104E800080913A088B3F98F08B3F19F4809155043C
:104E90000EC08C3F19F48091570409C08D3F19F45E
:104EA0008091590404C08E3F21F480915B0480936B
:104EB000850480918504882319F41092850404C028
:104EC0008F3F11F48093850480913B088B3F98F0CD
:104ED0008B3F19F4809155040EC08C3F19F48091DA
:104EE000570409C08D3F19F48091590404C08E3FC6
:104EF00021F480915B04809386048091860488234A
:104F000019F41092860404C08F3F11F48093860434
:104F1000809140088B3F98F08B3F19F480915504A5
:104F20000EC08C3F19F48091570409C08D3F19F4CD
:104F30008091590404C08E3F21F480915B048093DA
:104F40009E0380919E03882319F410929E0304C04F
:104F50008F3F11F480939E0310919B03612F77275D
:104F600067FD7095872F972F0E94C54517FF06C0D4
:104F700020E030E040E853E40E94204527E137EB91
:104F800041ED58E30E943F4660938F037093900376
:104F900080939103909392038091240880937F08DB
:104FA00080912308809363081F91089580916E0477
:104FB000882301F51092600810925B08109278081F
:104FC00010927A088091B103882311F080935B08D6
:104FD0008091B203882311F0809360088091B3031D
:104FE000882311F080937A088091B403882311F00C
:104FF000809378081092F0031092F1030E943F1AF8
:105000000895109202041092010410920404109268
:10501000030480E090E0A0E0B0E08093050490936A
:105020000604A0930704B09308041092F8031092AA
:10503000F7031092FA031092F9031092FC031092F6
:10504000FB0310928504109286040E94862284E657
:1050500090E00E9432120E9486228091190880FFFF
:1050600010C080910E0390910F03875B934038F43A
:1050700080910E0390910F038E5E924010F40E9477
:10508000DC148091CD039091CE039093F80380932C
:10509000F7038091CF039091D0039093FA0380930C
:1050A000F9038091D1039091D2039093FC038093F4
:1050B000FB038091F9039091FA039093FE03809390
:1050C000FD038091F7039091F8039093000480937F
:1050D000FF0344E050E0DA010E945347802D853001
:1050E00038F1809187089091880897FF03C09095C8
:1050F00081959F4F6CE070E00E94C6467093040457
:105100006093030480917D0890917E0897FF03C00F
:10511000909581959F4F6CE070E00E94C646709319
:105120000204609301046091BD077091BE0739C00D
:10513000DA010E945347802D4F5F5F4FDA010E94D2
:105140005347202D9927982F8827820F911D9093E0
:105150000204809301044F5F5F4FDA010E945347BE
:10516000802D4F5F5F4FDA010E945347202D992712
:10517000982F8827820F911D909304048093030435
:105180004F5F5F4FDA010E945347602D4F5F5F4FC3
:10519000DA010E945347202D7727762F6627620F6A
:1051A000711D882777FD8095982F0E94C5456093D3
:1051B00005047093060480930704909308041092EA
:1051C0002B0410922C0410922D0410922E04109295
:1051D0002F04109230041092310410923204109275
:1051E0003304109234041092350410923604109255
:1051F0003704109238041092390410923A04109235
:105200003B0410923C0410923D0410923E04109214
:1052100062081092610810925A0810925908109270
:1052200081081092800880910A0390910B03A0914D
:105230000C03B0910D039093C0078093BF071092A9
:10524000E0031092DF031092430410924404109282
:10525000450410924604809147049091480490932D
:105260004A048093490482E390E09093C7038093BB
:10527000C60360913C0877278827992724EC39E0FA
:1052800040E050E00E948746609387037093880354
:105290008093890390938A0360913D08772788273C
:1052A00099270E94874660938B0370938C038093A9
:1052B0008D0390938E031092A00310929F03089584
:1052C0001F93182F0EC080916E04882361F484E62A
:1052D00090E09093C7038093C6038AEF90E00E940A
:1052E0004812115080F71F91089581E080931108B2
:1052F00022E02093120883E08093130854E0509337
:10530000140845E04093150836E03093160887E00E
:105310008093170888E08093180880EC8093190820
:105320009EE190931A088BEF80931C088AE080938B
:105330001D0890931B0890931F0820931E0820932C
:10534000200850932108309322088FE0809323088F
:105350008AEF809324089093250880E8809326089C
:1053600024E6209327088CE8809328088EE5809314
:10537000290883E280932A0884E180932B08109205
:105380002C0880E180932D0880E580932E081092F0
:105390002F08109230081092310810924108109294
:1053A000420810924308109244082093320888E281
:1053B000809333081092460892E39093340886E96C
:1053C0008093350840933608909337088AE5809398
:1053D0003808909339081092450880933A08409312
:1053E0003B0820933C0820933D0880E280933E08D0
:1053F00050933F0890934008ABE4B8E0ECE6F3E04C
:105400008CE001900D928150E1F7089581E0809346
:10541000110882E08093120823E02093130854E0DF
:105420005093140845E04093150836E03093160871
:1054300087E08093170888E08093180880E48093C1
:1054400019089EE190931A088BEF80931C088AE05C
:1054500080931D0890931B0890931F0820931E08AB
:105460002093200850932108309322088FE08093E6
:1054700023088AEF809324089093250880E880937E
:10548000260890E59093270888E7809328088EE502
:105490008093290883E280932A0884E180932B0873
:1054A00010922C0830E230932D0890932E08109221
:1054B0002F08109230081092310810924108109273
:1054C0004208109243081092440824E620933208C0
:1054D00088E2809333081092460892E39093340850
:1054E00086E98093350840933608909337088AE51B
:1054F00080933808909339081092450880933A08B1
:1055000040933B0820933C0820933D0830933E088D
:1055100050933F088BE480934008ABE4B8E0E6E7A3
:10552000F3E08CE001900D928150E1F7089581E065
:105530008093110882E08093120883E0809313081F
:1055400034E03093140845E04093150886E08093DA
:10555000160887E08093170828E02093180880E455
:10556000809319089EE190931A088BEF80931C0892
:105570008AE080931D0890931B0890931F08309336
:105580001E0830932008209321088CE08093220885
:105590008FE0809323088AEF809324089093250856
:1055A00090E89093260880E58093270856E9509369
:1055B00028088EE58093290883E280932A0884E1F5
:1055C00080932B0810922C0880E280932D089093F2
:1055D0002E0810922F081092300810923108109265
:1055E000410810924208109243081092440824E6A1
:1055F0002093320888E2809333081092460882E3B1
:1056000080933408509335084093360880933708C8
:105610009AE5909338088093390810924508909342
:105620003A0840933B0820933C0820933D0880E1D2
:1056300080933E0830933F0820934008ABE4B8E0E5
:10564000EEE7F3E08CE001900D928150E1F70895D0
:10565000AFE1B0E0EEE2FBE20C9416470E94EB1BD8
:10566000299A20916C0430916D043E832D8337FF7D
:1056700002C01E821D8280916504843608F05DC0E0
:1056800080910301882399F480910403909105038C
:105690008F5F9F4F61F488E99AE39093C7038093EB
:1056A000C60380E09CE090930503809304038091FF
:1056B000B0049091B104009731F001979093B10438
:1056C0008093B00404C010926E0410924E04809136
:1056D00000018A3011F4289A01C028988091AB0407
:1056E0009091AC04815D974028F180912A08682F41
:1056F00077277E836D8381E080934E04E0911108CB
:10570000FF27EE0FFF1FEB52F84F11821082E0913E
:105710001208FF27EE0FFF1FEB52F84F1182108285
:10572000E0911408FF27EE0FFF1FEB52F84F118294
:10573000108265C210926E0462C2809165048D3839
:1057400008F45DC210924E0480912B0822E3829FE0
:10575000C00111249093B1048093B0048D819E8187
:105760008997ACF08091AB049091AC04AFEF8F3F80
:105770009A0729F001969093AC048093AB04809132
:10578000AB049091AC0490935404809353048091A3
:10579000AB049091AC04883C910520F0ED81FE8132
:1057A000B89704F51092CA041092CB041092CC045E
:1057B0001092CD041092C6041092C7041092C8042F
:1057C0001092C90410923B0410923C0410923D04C4
:1057D00010923E0410923F04109240041092410433
:1057E00010924204E0911308FF27EE0FFF1FEB52C7
:1057F000F84F80819181813591050CF458C18091D9
:105800006E04882309F053C180911408E82FFF2704
:10581000EE0FFF1FEB52F84F808191818C34910580
:105820000CF4BCC08091AF048F5F8093AF04893CBF
:1058300008F43DC1299810926E041092AF041092A2
:10584000AC041092AB0480911108282F3327F90182
:10585000EE0FFF1FEB52F84F808191818734910545
:105860009CF4E0911208FF27EE0FFF1FEB52F84F58
:105870000190F081E02DF7FF03C0F095E195FF4F17
:10588000E734F1050CF46CC080911208682F77277B
:10589000DB01AA0FBB1FAB52B84F8D919C911197A2
:1058A000873491053CF0F901EE0FFF1FEB52F84FE2
:1058B000808191818D919C918734910564F0F901EB
:1058C000EE0FFF1FEB52F84F8081918187349105D5
:1058D00014F042E001C041E0FB01EE0FFF1FEB526C
:1058E000F84F80819181863491055CF4F901EE0FC7
:1058F000FF1FEB52F84F80819181873491050CF0A6
:1059000043E0FB01EE0FFF1FEB52F84F80819181C6
:105910008A5B9F4F5CF4F901EE0FFF1FEB52F84FCB
:1059200080819181873491050CF044E0660F771FE8
:105930006B52784FDB018D919C918A5B9F4F5CF499
:10594000220F331F2B52384FF90180819181863409
:1059500091050CF445E0A2E0B0E0042E0E946047FF
:105960008091190880FF10C080910E0390910F0361
:10597000875B934038F480910E0390910F038E5E05
:10598000924010F40E94DC140E94340447E461E168
:1059900078E00E948D040E94012882C0808191815C
:1059A000855B9F4F0CF081C08091AF048F5F809327
:1059B000AF04893C08F47BC029988FEF04E010E025
:1059C000D801082E0E94604710926E041092AF0416
:1059D0001092AC041092AB040E9401288091010443
:1059E0009091020460E071E00E94C646D801062E44
:1059F0000E946047809101049091020460E071E090
:105A00000E94C6460F5F1F4FD801082E0E946047B4
:105A1000809103049091040460E071E00E94C64606
:105A20000F5F1F4FD801062E0E946047809103042C
:105A30009091040460E071E00E94C6460F5F1F4F22
:105A4000D801082E0E9460476091050470910604F9
:105A500080910704909108040E94A845DC01CB01C5
:105A600060E071E00E94C6460F5F1F4FD801062E0E
:105A70000E946047609105047091060480910704BC
:105A8000909108040E94A845DC01CB0160E071E020
:105A90000E94C6460F5F1F4FD801082E0E94604724
:105AA0000E9434040E94602902C01092AF04E09169
:105AB0001308FF27EE0FFF1FEB52F84F80819181F3
:105AC0008B5A9F4F0CF09BC080911408482F55278C
:105AD000FA01EE0FFF1FEB52F84F80819181855B39
:105AE0009F4F0CF06DC08091AE048F5F8093AE0429
:105AF000893C08F467C088EC8093AE0481E090E0B4
:105B00009093AC048093AB0481E080936E04109278
:105B1000C2041092C3041092C4041092C5041092DF
:105B20003B0410923C0410923D0410923E041092EB
:105B30003F041092400410924104109242041092CB
:105B40002B0410922C0410922D0410922E0410920B
:105B5000330410923404109235041092360480916C
:105B60000B0490910C04A0910D04B0910E0480934D
:105B70002F0490933004A0933104B09332048091A9
:105B8000130490911404A0911504B091160480930D
:105B9000370490933804A0933904B0933A041092D8
:105BA000CA041092CB041092CC041092CD0410922F
:105BB000C6041092C7041092C8041092C90402C00F
:105BC0001092AE04440F551F4B52584FDA018D917D
:105BD0009C918C3491058CF08091AD048F5F809303
:105BE000AD04893C60F010926E0488EC8093AD04A3
:105BF0001092AC041092AB0402C01092AD048091DC
:105C00006B03815080936B0380916B038F3F29F06E
:105C100080914E04882309F494C30E94B6242090F6
:105C200066043090670480911108C82EDD24D601E7
:105C3000AA0FBB1FAD014B52584FFA010190F081E2
:105C4000E02DFD8FEC8F80912008882E9924AD5097
:105C5000B84F0D90BC91A02DBB8FAA8F80912108C9
:105C6000282F3327398F288F609168047091690439
:105C70007C836B8380911208E82EFF24C701880F74
:105C8000991FDC01AB52B84F0D90BC91A02DBF8B7A
:105C9000AE8B8D50984FDC018D919C919D8B8C8BA0
:105CA000E0911408AE2FBB27AA0FBB1FAB52B84F11
:105CB0000D90BC91A02DBB8BAA8BE0911308FF2700
:105CC000EE0FFF1FEB52F84FA080B180E8E7F0E045
:105CD000AE0EBF1EB0926D04A0926C04DA018D91DD
:105CE0009C9120918D0430918E0497FF03C0909574
:105CF00081959F4F281739078CF4FA018081918193
:105D000090938E0480938D0497FF0EC0909581959B
:105D10009F4F90938E0480938D0406C02150304095
:105D200030938E0420938D04F701EE0FFF1FEB528A
:105D3000F84F8081918120918F043091900497FFDA
:105D400003C0909581959F4F2817390784F480816F
:105D500091819093900480938F0497FF0EC090954B
:105D600081959F4F9093900480938F0406C021509B
:105D700030403093900420938F0480914E04882308
:105D800041F010928E0410928D04109290041092A3
:105D90008F0410919803612F772767FD7095872FE7
:105DA000972F0E94C54517FF06C020E030E040E86D
:105DB00053E40E94204520E030E040E251E40E949C
:105DC000204520E030E040E85BE30E943F462B01A5
:105DD0003C016093820870938308809384089093B9
:105DE000850810919903612F772767FD7095872F9C
:105DF000972F0E94C54517FF06C020E030E040E81D
:105E000053E40E94204520E030EE4BE257E40E942C
:105E10006245609374087093750880937608909338
:105E200077082091B603222311F40C94C13E8AE036
:105E300090E09093C7038093C603E22FFF27E2FF11
:105E400009C080917D04482F5527440F551F440FEA
:105E5000551F10C0E3FD03C040E050E00BC080912F
:105E60007D049927880F991F880F991F442755276C
:105E7000481B590B2091870430918804C901A3E085
:105E8000880F991FAA95E1F7821B930B840F951F2A
:105E900068E070E00E94C6467F8F6E8F7093880422
:105EA00060938704E4FF09C080917D04482F552743
:105EB000440F551F440F551F0FC0E5FD02C00C9441
:105EC000D73E80917D049927880F991F880F991FCD
:105ED00044275527481B590B2091890430918A0487
:105EE000C90173E0880F991F7A95E1F7821B930B24
:105EF000840F951F68E070E00E94C6468B01709386
:105F00008A04609389048091B503282F332723FFE7
:105F100003C082E390E004C022FF07C08EEC9FEF35
:105F200090938C0480938B0404C010928C04109284
:105F30008B0421FF09C080919F039091A0030196DB
:105F40009093A00380939F0324FF09C080919F0337
:105F50009091A00301979093A00380939F03C101A8
:105F6000880F991F820D931D4C8D5D8D489D90016A
:105F7000499D300D589D300D1124820F931F64E010
:105F800070E00E94C6461B016A8D7B8DA88DB98D7D
:105F90006A9FC0016B9F900D7A9F900D1124280E6F
:105FA000391E8E8D9F8D68E070E00E94C646260ED9
:105FB000371E30926704209266048B819C81880F83
:105FC000991FEB81FC818E0F9F1F4E895F89489D31
:105FD0009001499D300D589D300D1124820F931F63
:105FE00064E070E00E94C6469B016C897D89A88DA3
:105FF000B98D6A9FC0016B9F900D7A9F900D1124FF
:10600000280F391FC80168E070E00E94C646260FBD
:10601000371F309369042093680440918B0450919A
:106020008C04EA89FB894E1B5F0B50936B044093F1
:106030006A048091810680FF54C080917D0481387C
:1060400008F44FC080917A06992787FD9095BC018E
:10605000689DC001699D900D789D900D1124280EBA
:10606000391E309267042092660480917B0699273E
:1060700087FD9095DC01A89DC001A99D900DB89D5C
:10608000900D1124280F391F309369042093680460
:1060900080917C06992787FD9095480F591F509352
:1060A0006B0440936A0420917E06332727FD3095C8
:1060B00080911E089927FC012E9FC0012F9F900DF3
:1060C0003E9F900D11249093A00380939F03809195
:1060D0007D0699278A159B0524F490936D0480937F
:1060E0006C048091190882FF0CC080E090E0A0E071
:1060F000B0E08093740890937508A0937608B093ED
:10610000770820E030E040E050E0C301B2010E9497
:10611000CF45882364F480E090E0A0E0B0E0809375
:10612000820890938308A0938408B093850820E0A8
:1061300030E040E050E06091740870917508809103
:106140007608909177080E94CF45882364F480E018
:1061500090E0A0E0B0E08093740890937508A0935D
:106160007608B093770890918304909351044091FE
:106170008404409352044298983C10F0429A14C010
:1061800020915004291790F0992381F080916E049A
:10619000813061F4429A3327642F690F712D711D8C
:1061A000261737071CF04298109250048091500433
:1061B0008F5F80935004F701EE0FFF1FEB52F84FF3
:1061C0002081318180913808482F55274217530785
:1061D00044F48091450882FF04C081E080937904F3
:1061E00011C0F701EE0FFF1FEB52F84F20813181F4
:1061F00080913908DA01A81BB1092A173B0714F46A
:1062000010927904F701EE0FFF1FEB52F84F8081D7
:10621000918166277727641B750B8617970744F4CF
:106220008091450883FF04C081E080937A0417C001
:1062300080917A04882399F0EE0CFF1CE5EDF7E0DD
:10624000EE0EFF1ED7012D913C91809139089927C0
:10625000841B950B8217930714F410927A04F601AD
:10626000EE0FFF1FEB52F84F8081918148175907BD
:1062700044F48091450880FF04C081E080937C0451
:1062800015C080917C04882389F0F601EE0FFF1F72
:10629000EB52F84F2081318180913908FA01E81BD7
:1062A000F1092E173F0714F410927C04F601EE0F4B
:1062B000FF1FEB52F84F808191818617970744F4B6
:1062C0008091450881FF04C081E080937B0417C062
:1062D00080917B04882399F0CC0CDD1C25ED37E000
:1062E000C20ED31ED6012D913C9180913908992779
:1062F000841B950B8217930714F410927B048091F2
:106300007904882321F480917A04882321F081E0A4
:106310008093780402C01092780480917C048823D2
:1063200021F480917B04882351F081E080937704ED
:10633000109278041092790410927A040AC0109294
:10634000770480917804882321F48091770488234E
:1063500051F0809137089927ED81FE818E179F07B4
:1063600014F49E838D8380914E04882371F11092E2
:106370006B0410926A0410926704109266041092E3
:1063800069041092680480E090E0A0E0BFE380938D
:10639000820890938308A0938408B093850886EAC6
:1063A0009BE9A4E4BBE38093740890937508A093E1
:1063B0007608B093770810927804109277048DE4F1
:1063C00090E090935A048093590480916C089091C6
:1063D0006D08A0916E08B0916F0820910B04309168
:1063E0000C0440910D0450910E04820F931FA41FC2
:1063F000B51F80936C0890936D08A0936E08B093BE
:106400006F088091700890917108A0917208B09106
:106410007308209113043091140440911504509195
:106420001604820F931FA41FB51F809370089093CA
:106430007108A0937208B0937308809164089091DA
:106440006508A0916608B091670820910F0430910B
:1064500010044091110450911204820F931FA41F45
:10646000B51F8093640890936508A0936608B09365
:10647000670880915C0890915D08A0915E08B091DA
:106480005F0820911704309118044091190450912D
:106490001A04820F931FA41FB51F80935C0890936A
:1064A0005D08A0935E08B0935F08F0917704FD87C4
:1064B000FF2311F00C94363F80917804882311F06B
:1064C0000C94363F0C94DB3E80918F0490919004A5
:1064D0004097A4F0C201B10123E030E040E050E079
:1064E0000E94FB4639014A01C601B50123E030E0B4
:1064F00040E050E00E94FB4679018A01E0911408D7
:10650000FF27EE0FFF1FEB52F84F0190F081E02DB7
:10651000F7FF03C0F095E195FF4F7A97A4F0C4010F
:10652000B30123E030E040E050E00E94FB46390137
:106530004A01C801B70123E030E040E050E00E948A
:10654000FB4679018A0121E26216710481049104FB
:1065500034F0F0E26F2E712C812C912C11C030EEB2
:1065600063163FEF73063FEF83063FEF930644F455
:10657000E0EE6E2EEFEF7E2EEFEF8E2EEFEF9E2EE3
:1065800041E2E416F1040105110534F070E2E72E52
:10659000F12C012D112D11C050EEE5165FEFF5061F
:1065A0005FEF05075FEF150744F460EEE62E6FEF2F
:1065B000F62E6FEF062F6FEF162F80912B04909120
:1065C0002C04A0912D04B0912E0486199709A809D6
:1065D000B90980932B0490932C04A0932D04B093BD
:1065E0002E048091330490913404A0913504B0912D
:1065F00036048E199F09A00BB10B8093330490933E
:106600003404A0933504B09336048091E103909153
:10661000E2038F3F910509F008F479C46D85662384
:1066200009F0F9C380917804882309F0F4C36091DC
:106630006C0870916D0880916E0890916F0820E051
:1066400031E040E050E00E94FB4620936C0830931C
:106650006D0840936E0850936F08609170087091B8
:106660007108809172089091730820E031E040E059
:1066700050E00E94FB4620937008309371084093CD
:10668000720850937308E0902508FF240027112713
:1066900020911B0430911C0440911D0450911E0454
:1066A000C801B7010E94874620E031E040E050E099
:1066B0000E94FB4620931B0430931C0440931D044E
:1066C00050931E0420911F04309120044091210416
:1066D00050912204C801B7010E94874620E031E0B2
:1066E00040E050E00E94FB4620931F0430932004BA
:1066F0004093210450932204609123047091240458
:10670000809125049091260420E031E040E050E0A3
:106710000E94FB46209323043093240440932504D5
:106720005093260460916C0870916D0880916E08FA
:1067300090916F0820911B0430911C0440911D041E
:1067400050911E04A0903E08BB24CC24DD24621B83
:10675000730B840B950BA60195010E94FB462093B9
:10676000A3043093A4044093A5045093A604E0909E
:106770007008F09071080091720810917308609091
:106780001F04709020048090210490902204CA017C
:10679000B90120E031E040E050E00E94FB462901D1
:1067A0003093760420937504E618F7080809190950
:1067B000C801B701A60195010E94FB46CA01B901B3
:1067C00020E031E040E050E00E94FB468901309338
:1067D00074042093730480918D0490918E044097EB
:1067E000BCF480918F049091900440978CF4E091D8
:1067F0001408FF27EE0FFF1FEB52F84F0190F081B6
:10680000E02DF7FF03C0F095E195FF4F7A9794F0E4
:10681000C20162E070E00E94C64670937604609305
:106820007504C80162E070E00E94C646709374046B
:1068300060937304609164087091650880916608A4
:106840009091670820E031E040E050E00E94FB4674
:106850002093640830936508409366085093670856
:1068600060915C0870915D0880915E0890915F086E
:1068700020E031E040E050E00E94FB4620935C08BD
:1068800030935D0840935E0850935F08E0900F04DA
:10689000F0901004009111041091120480910B04E7
:1068A00090910C04A0910D04B0910E04E81AF90A1D
:1068B0000A0B1B0BE092BE04F092BF040093C004CD
:1068C0001093C1046090170470901804809019040C
:1068D00090901A048091130490911404A0911504CF
:1068E000B0911604681A790A8A0A9B0A6092BA045F
:1068F0007092BB048092BC049092BD04E092B604F6
:10690000F092B7040093B8041093B9046092B204F3
:106910007092B3048092B4049092B50480912F04D5
:1069200090913004A0913104B09132048E199F09E6
:10693000A00BB10B80932F0490933004A0933104EB
:10694000B09332048091370490913804A0913904B7
:10695000B0913A0486199709A809B90980933704B8
:1069600090933804A0933904B0933A0481E090E006
:1069700090939E0480939D0480916C0890916D0883
:10698000A0916E08B0916F08209195043091960403
:106990004091970450919804281B390B4A0B5B0BCC
:1069A00057FF07C050954095309521953F4F4F4F69
:1069B0005F4F20523E44404050400CF0C1C081E047
:1069C000E81680E1F80680E0080780E018070CF47C
:1069D00052C080919C04882309F449C0D801C701A2
:1069E0004CE0B595A795979587954A95D1F701966F
:1069F00090939E0480939D04D801C70133E0B59520
:106A0000A795979587953A95D1F78093A30490938E
:106A1000A404A093A504B093A60489589341A04070
:106A2000B04064F088E893E1A0E0B0E08093A30474
:106A30009093A404A093A504B093A6046091A3042A
:106A40007091A4048091A5049091A60420E031E007
:106A500040E050E00E94FB468091750490917604DE
:106A6000820F931F909376048093750466C081E033
:106A700080939C0462C010929C04F0E0EF16F0EF4B
:106A8000FF06FFEF0F07FFEF1F070CF056C08091C6
:106A90009B04882309F44DC088279927DC018E19AF
:106AA0009F09A00BB10B2CE0B595A79597958795FD
:106AB0002A95D1F7019690939E0480939D04C80176
:106AC000B70128E030E040E050E00E94FB46209310
:106AD000A3043093A4044093A5045093A60428571C
:106AE0003C4E4F4F5F4F64F488E79CEEAFEFBFEF33
:106AF0008093A3049093A404A093A504B093A60448
:106B00006091A3047091A4048091A5049091A604BF
:106B100020E031E040E050E00E94FB4680917504A7
:106B200090917604820F931F90937604809375045E
:106B30000BC081E080939B0407C010929B0404C0AB
:106B400010929E0410929D0480913F08C82EDD246F
:106B500080919D0490919E04C816D90624F4D09289
:106B60009E04C0929D0471E0E71674E0F70670E0A1
:106B7000070770E017075CF08091F7039091F80326
:106B800020919D0430919E04820F931F13C080E0DA
:106B9000E8168CEFF8068FEF08078FEF180774F4EC
:106BA0008091F7039091F80320919D0430919E0409
:106BB000821B930B9093F8038093F70381E090E09E
:106BC00090939E0480939D0410929F041092A004C1
:106BD0001092A1041092A204809170089091710803
:106BE000A0917208B09173082091910430919204A1
:106BF0004091930450919404281B390B4A0B5B0B72
:106C000057FF07C050954095309521953F4F4F4F06
:106C10005F4F20523E44404050400CF0C1C0A1E0C4
:106C20006A16A0E17A06A0E08A06A0E09A060CF4B3
:106C300052C080919A04882309F449C0D401C30149
:106C4000FCE0B595A79597958795FA95D1F70196AC
:106C500090939E0480939D04D401C301E3E0B59515
:106C6000A79597958795EA95D1F780939F04909380
:106C7000A004A093A104B093A20489589341A0401A
:106C8000B04064F088E893E1A0E0B0E080939F0416
:106C90009093A004A093A104B093A20460919F04D8
:106CA0007091A0048091A1049091A20420E031E0B1
:106CB00040E050E00E94FB46809173049091740480
:106CC000820F931F909374048093730466C081E0D5
:106CD00080939A0462C010929A04F0E06F16F0EF6D
:106CE0007F06FFEF8F06FFEF9F060CF056C08091E6
:106CF0009904882309F44DC088279927DC01861957
:106D00009709A809B9097CE0B595A7959795879546
:106D10007A95D1F7019690939E0480939D04C401C7
:106D2000B30128E030E040E050E00E94FB462093B1
:106D30009F043093A0044093A1045093A2042857C9
:106D40003C4E4F4F5F4F64F488E79CEEAFEFBFEFD0
:106D500080939F049093A004A093A104B093A204F5
:106D600060919F047091A0048091A1049091A2046D
:106D700020E031E040E050E00E94FB468091730447
:106D800090917404820F931F909374048093730402
:106D90000BC081E08093990407C01092990404C04D
:106DA00010929E0410929D0480919D0490919E04E7
:106DB000C816D90624F4D0929E04C0929D0471E0B6
:106DC000671674E0770670E0870670E097065CF05F
:106DD0008091F9039091FA0320919D0430919E04D3
:106DE000820F931F13C080E068168CEF78068FEF38
:106DF00088068FEF9806BCF48091F9039091FA030E
:106E000020919D0430919E04821B930B9093FA0372
:106E10008093F90308C010927404109273041092C6
:106E200076041092750420E030E040E050E060917C
:106E300074087091750880917608909177080E9487
:106E4000CF45882341F41092740410927304109279
:106E500076041092750480916C0890916D08A09151
:106E60006E08B0916F088093950490939604A09358
:106E70009704B09398048091700890917108A09144
:106E80007208B09173088093910490939204A09338
:106E90009304B093940410921B0410921C0410925B
:106EA0001D0410921E0410921F04109220041092D0
:106EB00021041092220410922304109224041092B0
:106EC00025041092260410926C0810926D081092FE
:106ED0006E0810926F08109270081092710810924C
:106EE000720810927308109264081092650810924C
:106EF00066081092670810925C0810925D08109264
:106F00005E0810925F081092E2031092E1038090F5
:106F10006A0490906B04940197FE04C022273327E3
:106F200028193909253131053CF08091190884FD73
:106F300003C081E08093A704E09022085901CC248B
:106F4000B7FCC094DC2CB401882777FD8095982F7E
:106F50002E2D3327442755270E9487469B01AC01DD
:106F6000C601B5010E94874620E032E040E050E0D3
:106F70000E94FB4689019A01FF24E89CC001E99C1C
:106F8000900DF89C900D112464E070E00E94C646BC
:106F9000600F711F882777FD8095982F6093C2043A
:106FA0007093C3048093C4049093C50420913B0460
:106FB00030913C0440913D0450913E04261B370B18
:106FC000480B590B20933B0430933C0440933D0401
:106FD00050933E0480913B0490913C04A0913D0469
:106FE000B0913E048155934CA040B04064F080E5E0
:106FF00093ECA0E0B0E080933B0490933C04A0931A
:107000003D04B0933E0480913B0490913C04A091D8
:107010003D04B0913E04805B9C43AF4FBF4F64F48E
:1070200080EB9CE3AFEFBFEF80933B0490933C0475
:10703000A0933D04B0933E048091190883FF9BC048
:1070400080914D04815080934D048F3FD9F40E946C
:10705000840590934804809347042091490430911B
:107060004A04821B930B845E9D4F68E671E00E9488
:10707000C646845B904090934C0480934B0482E31B
:1070800080934D0460910B0470910C0480910D0469
:1070900090910E0420E032E040E050E00E94FB4678
:1070A000890137FF03C0109501951F4F60911304AC
:1070B00070911404809115049091160420E032E040
:1070C00040E050E00E94FB46B90137FF03C07095D5
:1070D00061957F4F601771070CF4B8016931710534
:1070E00074F48091A704882351F080914704909113
:1070F000480490934A04809349041092A704209175
:1071000097033327629FC001639F900D729F900D7C
:10711000112460E470E00E94C646A901461B570B8B
:107120001416150644F500913B0410913C0420917F
:107130003D0430913E0480914B0490914C04BC017D
:10714000469FC001479F900D569F900D112460E20D
:1071500070E00E94C646882777FD8095982F060F1D
:10716000171F281F391F00933B0410933C042093E2
:107170003D0430933E048091190885FF26C080911C
:107180004E04882369F48091610490916204909385
:1071900028058093270580916304909164040AC0B8
:1071A000813081F483E690E0909328058093270551
:1071B0008DE490E0909311058093100510921C05CA
:1071C00010921B050E949A3F09C043981092FB043D
:1071D0001092FA041092FD041092FC048091A8040D
:1071E00081508093A8048F3F09F022C188E18093E9
:1071F000A80460910B0470910C0480910D0490918F
:107200000E04E0902508FF2400271127A80197010C
:107210000E94FB4630933407209333076091130498
:10722000709114048091150490911604A80197019F
:107230000E94FB46309336072093350780917D08E6
:1072400090917E0890933807809337078091870844
:107250009091880890933A07809339078091270589
:107260009091280590933C0780933B0780911005EF
:107270009091110590933E0780933D078091D6042D
:107280009091D7049093400780933F078091DA0450
:107290009091DB04909342078093410780914704CB
:1072A000909148049093440780934307809108038A
:1072B0009091090390934607809345078091650458
:1072C00099279093480780934707809190079927C3
:1072D00090934A07809349072091CD078091CE076C
:1072E000280F312D311D8091D0074091CF07840F99
:1072F000912D911D280F391F30934C0720934B0778
:1073000080918B0790918C0790934E0780934D0747
:1073100080917307909174079093500780934F0763
:107320008091770790917807909352078093510747
:107330008091590490915A04909354078093530775
:1073400080917B0790917C07909356078093550717
:1073500080910705909108059093580780935707EF
:1073600080910B0590910C0590935A0780935907D3
:107370008091DE049091DF0490935C0780935B071B
:107380008091E2049091E30490935E0780935D07FF
:107390008091E6049091E7049093600780935F07E3
:1073A0008091EE049091EF049093620780936107BF
:1073B0008091EA049091EB049093640780936307B3
:1073C0008091F2049091F30490936607809365078F
:1073D000809187079091880790936807809367074B
:1073E00080916A0490916B0490936A078093690777
:1073F0008091FA049091FB0490936C0780936B0743
:107400008091FC049091FD0490936E0780936D072A
:1074100080916604909167049093700780936F0742
:10742000809168049091690490937207809371072A
:10743000809177048823A9F06091610870916208B7
:10744000882777FD8095982F0E94C5452091820856
:107450003091830840918408509185080E943F46EE
:1074600032C060910B0470910C0480910D049091D6
:107470000E04E0906108F09062080E94C5452091DA
:1074800074083091750840917608509177080E94F1
:107490003F465B016C010027F7FC0095102FC801E7
:1074A000B7010E94C5452091820830918308409120
:1074B0008408509185080E943F469B01AC01C6019B
:1074C000B5010E9420450E94A84570936208609310
:1074D0006108809178048823A9F06091590870911F
:1074E0005A08882777FD8095982F0E94C5452091DE
:1074F00082083091830840918408509185080E9449
:107500003F4632C0609113047091140480911504B9
:1075100090911604E0905908F0905A080E94C545D1
:107520002091740830917508409176085091770841
:107530000E943F465B016C010027F7FC0095102F6D
:10754000C801B7010E94C545209182083091830887
:1075500040918408509185080E943F469B01AC01F0
:10756000C601B5010E9420450E94A84570935A08A3
:10757000609359086091800870918108A090270459
:10758000B0902804C0902904D0902A0480917408F7
:1075900090917508A0917608B09177088E879F87A3
:1075A000A88BB98B882777FD8095982F0E94C545B9
:1075B0007B018C016091820870918308809184081E
:1075C000909185089B01AC010E9420459B01AC0174
:1075D000C801B7010E943F467B018C01C601B5017D
:1075E0000E94C5452E853F85488959890E943F469E
:1075F00020E030E040E05FE30E943F469B01AC01A9
:10760000C801B7010E9420450E94A84570938108D7
:107610006093800880916108909162088150984041
:1076200034F080E098E09093620880936108809144
:107630006108909162088050984F34F480E098EF90
:1076400090936208809361088091590890915A083C
:107650008150984034F080E098E090935A088093ED
:1076600059088091590890915A088050984F34F4E5
:1076700080E098EF90935A08809359088091800891
:10768000909181088150984034F080E098E0909388
:1076900081088093800880918008909181088050B3
:1076A000984F34F480E098EF90938108809380089D
:1076B00080911908282F332720FFD6C080914E04CF
:1076C000882309F0D1C08091940321FF0EC082333A
:1076D00010F580916F0490917004889790937204D4
:1076E0008093710410924F0419C020919F03309130
:1076F000A003280F311D80911E089927AC01249FFB
:10770000C001259F900D349F900D11248897909370
:1077100072048093710481E080934F0420916F0480
:1077200030917004409171045091720442175307D4
:107730000CF09AC080914F04882309F495C0241B53
:10774000350B809195039927BC01269FC001279F87
:10775000900D369F900D112460E170E00E94C646A6
:107760000D811E81061B170B2091DF033091E00372
:10777000809193039927DC012A9FC0012B9F900DD4
:107780003A9F900D112468E070E00E94C646061BE7
:10779000170B6091430470914404809145049091CB
:1077A000460420E032E040E050E00E94FB46CA017F
:1077B000B901209196033327442755270E94874615
:1077C00020E230E040E050E00E94FB46BFEF2E3C5C
:1077D0003B0714F42EEC3FEF8091A9049091AA048A
:1077E000AC0164E0440F551F6A95E1F7481B590B43
:1077F0002333310514F022E330E0021B130BCA01DE
:10780000800F911F60E170E00E94C6467093AA0449
:107810006093A90480911A089927681779078CF456
:10782000ED81FE81E817F9072CF09093AA0480936C
:10783000A90407C02D813E813093AA042093A90496
:107840000DC08091A9049091AA044D815E814817D2
:10785000590724F45093AA044093A9046091A90401
:107860007091AA047E836D8380917F08482E5524F1
:107870001CEE612E1FEF712E640C751C8D819E8194
:10788000861597050CF43C01E0918008F091810881
:107890000091C2041091C3042091C4043091C50426
:1078A00094E1691671041CF418861F8225C0C30177
:1078B00062E070E00E94C6469F01201B310BCB01A5
:1078C000261737070CF4C901709561957F4F68172B
:1078D00079070CF4BC01C20186199709681779076A
:1078E0000CF4CB01D301A419B509B887AF83A8174D
:1078F000B90714F498878F8320916108309162084A
:1079000080906604909067048091FA049091FB0443
:10791000881A990A2819390930936B0820936A0844
:1079200020E030E040E050E06E857F8588899989CD
:107930000E94CF458823F1F1E0900B04F0900C04F5
:1079400000910D0410910E046091CA047091CB0453
:107950008091CC049091CD040E94C5455B016C01DF
:10796000C801B7010E94C5452E853F8548895989C0
:107970000E943F467B018C01B401882777FD8095EA
:10798000982F0E94C5459B01AC01C801B7010E9418
:107990001F459B01AC01C601B5010E9420450E9414
:1079A000A8456093CA047093CB048093CC04909351
:1079B000CD041CC020916A0830916B08442737FD24
:1079C0004095542F8091CA049091CB04A091CC048F
:1079D000B091CD04820F931FA41FB51F8093CA04DA
:1079E0009093CB04A093CC04B093CD048091CA04AF
:1079F0009091CB04A091CC04B091CD048138EEE3FA
:107A00009E07E0E0AE07E0E0BE072CF080E89EE3D2
:107A1000A0E0B0E009C08058914CAF4FBF4F64F474
:107A200080E891ECAFEFBFEF8093CA049093CB0452
:107A3000A093CC04B093CD0460916A0870916B0858
:107A400020918F03309190034091910350919203C4
:107A500029873A874B875C87882777FD8095982F01
:107A60000E94C5457B018C016091CA047091CB04D2
:107A70008091CC049091CD040E94C5459B01AC013E
:107A800069857A858B859C850E943F469B01AC0168
:107A9000C801B7010E9420450E94A8455B016C0106
:107AA0004B0180919E03E82EFF24002711278F8130
:107AB000988597FF03C0909581959F4F62E070E095
:107AC0000E94C6469B01260D371D442737FD409571
:107AD000542FC801B7010E94874620E430E040E0FF
:107AE00050E00E94FB463A832983821693060CF4E9
:107AF000950129803A803094219431083394A10172
:107B0000221633060CF4A9018F819885860D971DE6
:107B1000840F951F97FF03C020E030E005C092015D
:107B2000841595050CF49C0180916308882E992496
:107B3000C401821693060CF4C90180935B08C3014B
:107B4000841B950B6F817885860F971F97FF03C065
:107B500020E030E005C09201841595050CF49C01ED
:107B6000C401821693060CF4C90180936008209129
:107B7000590830915A0880916804909169049F8F48
:107B80008E8F8091FC049091FD04AE8DBF8DA81B5B
:107B9000B90BBF8FAE8F2A1B3B0B30935808209335
:107BA000570820E030E040E050E06E857F8588890E
:107BB00099890E94CF45882309F440C0E0901304BE
:107BC000F090140400911504109116046091C604FD
:107BD0007091C7048091C8049091C9040E94C54562
:107BE0005B016C01C801B7010E94C5452E853F8528
:107BF000488959890E943F467B018C01EE8DFF8D9B
:107C0000BF01882777FD8095982F0E94C5459B016D
:107C1000AC01C801B7010E941F459B01AC01C60120
:107C2000B5010E9420450E94A8456093C604709348
:107C3000C7048093C8049093C9041CC020915708BE
:107C400030915808442737FD4095542F8091C60441
:107C50009091C704A091C804B091C904820F931FEA
:107C6000A41FB51F8093C6049093C704A093C804B3
:107C7000B093C9048091C6049091C704A091C80430
:107C8000B091C9048138FEE39F07F0E0AF07F0E050
:107C9000BF072CF080E89EE3A0E0B0E009C0805868
:107CA000914CAF4FBF4F64F480E891ECAFEFBFEF62
:107CB0008093C6049093C704A093C804B093C904EA
:107CC0006091570870915808882777FD8095982F04
:107CD0000E94C5457B018C016091C6047091C70468
:107CE0008091C8049091C9040E94C5459B01AC01D4
:107CF00069857A858B859C850E943F469B01AC01F6
:107D0000C801B7010E9420450E94A84529813A81F7
:107D1000621773070CF49B01C101221633060CF4A1
:107D2000C901A301480F591F6F817885461B570B66
:107D300057FF03C060E070E005C0B201441555056F
:107D40000CF4BA01A401861697060CF4AB0140931B
:107D50007A089301281B390B8F819885281B390BD2
:107D600037FF03C040E050E005C0A20124153505EF
:107D70000CF4A901C401841695060CF0D5C0CA0103
:107D8000D3C02091870430918804C901B3E0880FE3
:107D9000991FBA95E1F7821B930B68E070E00E948F
:107DA000C6467F8F6E8F709388046093870440E08F
:107DB00050E00C946C2F60910B0470910C04809136
:107DC0000D0490910E04A0902508BB24CC24DD2442
:107DD000E0907D08F0907E08A60195010E94FB4688
:107DE00039014A010027F7FC0095102F6E187F0813
:107DF000800A910A60911304709114048091150413
:107E000090911604E0908708F0908808A6019501EB
:107E10000E94FB4659016A010027F7FC0095102FCC
:107E2000AE18BF08C00AD10AC401B30120E130E096
:107E300040E050E00E94FB4619012A0139014A0145
:107E4000C601B50120E130E040E050E00E94FB4671
:107E500059016A0179018A0180918D0490918E0403
:107E6000409714F00C946A320C94643210921B0404
:107E700010921C0410921D0410921E0410921F04F4
:107E800010922004109221041092220410926C0887
:107E900010926D0810926E0810926F081092700880
:107EA0001092710810927208109273081092640870
:107EB00010926508109266081092670810925C088C
:107EC00010925D0810925E0810925F0880912B045A
:107ED00090912C04A0912D04B0912E0480932F0436
:107EE00090933004A0933104B09332048091330412
:107EF00090913404A0913504B091360480933704F6
:107F000090933804A0933904B0933A041092E2039A
:107F10001092E1031092760410927504109274048A
:107F2000109273040C94053380937808E2E1C15EEB
:107F30000C943247A6E0B0E0E0EAFFE30C94164769
:107F4000709190077330C0F48091590490915A0455
:107F5000873491050CF45DC01092FB041092FA0472
:107F60001092FD041092FC04439882E390E09093F9
:107F7000C7038093C6034DC0733009F04AC06091B7
:107F80006E04613009F04BC080910605882309F02A
:107F900044C08091530490915404805D9740E8F56B
:107FA0008091730790917407A0917507B09176073F
:107FB0008093070590930805A0930905B0930A05DF
:107FC00020917707309178074091790750917A078F
:107FD00020930B0530930C0540930D0550930E052F
:107FE0008093D6049093D704A093D804B093D90477
:107FF0002093DA043093DB044093DC045093DD04D7
:1080000082E390E09093C7038093C60360930605D4
:1080100004C060916E04613011F4449A19C0662363
:10802000B9F44498109207051092080510920905BA
:1080300010920A0510920B0510920C0510920D0576
:1080400010920E05109206051092540410925304DB
:108050008091590490915A049E838D8387349105B1
:108060004CF58091730790917407A0917507B091BA
:1080700076078093D6049093D704A093D804B09346
:10808000D9048091770790917807A0917907B091F2
:108090007A078093DA049093DB04A093DC04B09316
:1080A000DD041092FB041092FA041092FD04109269
:1080B000FC044398733009F0C7C3AD81BE81A73477
:1080C000B1050CF4C1C3A639B1050CF048C08091CC
:1080D0006604909167040C96499750F48091680467
:1080E000909169048D3091051CF4845F9F4FBCF51D
:1080F0001092FB041092FA041092FD041092FC04FA
:108100008091730790917407A0917507B0917607DD
:108110008093D6049093D704A093D804B093D90445
:108120008091770790917807A0917907B0917A07AD
:108130008093DA049093DB04A093DC04B093DD0415
:1081400080910F05883C30F088B198E0892788B984
:1081500010920F0580910F058F5F80930F05E090BF
:10816000D604F090D7040091D8041091D904E114FA
:10817000F1040105110509F467C32091DA04309177
:10818000DB044091DC045091DD04211531054105EB
:10819000510509F459C380916604909167048D30AC
:1081A00091050CF051C3845F9F4F0CF44DC3809137
:1081B0006804909169048D3091050CF045C3845F8B
:1081C0009F4F0CF441C38D819E81863991057CF5CA
:1081D00080914E04882309F033C3809173079091F6
:1081E0007407A0917507B0917607E81AF90A0A0B8F
:1081F0001B0BE092DE04F092DF040093E004109386
:10820000E1048091770790917807A0917907B09168
:108210007A07281B390B4A0B5B0B2093E20430933F
:10822000E3044093E4045093E504439AB2C0A09061
:108230000705B0900805C0900905D0900A05A11463
:10824000B104C104D10409F448C0E0900B05F090DA
:108250000C0500910D0510910E05E114F1040105C6
:108260001105D9F18091730790917407A09175075A
:10827000B0917607A6019501281B390B4A0B5B0BC1
:108280002093DE043093DF044093E0045093E10434
:1082900020917707309178074091790750917A07BC
:1082A000E21AF30A040B150BE092E204F092E304E5
:1082B0000093E4041093E5048093D6049093D704CC
:1082C000A093D804B093D9042093DA043093DB044C
:1082D0004093DC045093DD04439AAD81BE81A639FE
:1082E000B1052CF480914E04813009F052C0A114E4
:1082F000B104C104D10409F04CC080910B059091E8
:108300000C05A0910D05B0910E050097A105B105D2
:1083100009F03FC08091D6049091D704A091D80471
:10832000B091D9042091730730917407409175077B
:1083300050917607821B930BA40BB50B8093DE0440
:108340009093DF04A093E004B093E1048091DA04F9
:108350009091DB04A091DC04B091DD0420917707BB
:10836000309178074091790750917A07821B930BDF
:10837000A40BB50B8093E2049093E304A093E40470
:10838000B093E504439A82E390E09093C70380930F
:10839000C6036091270570912805A090DE04B09077
:1083A000DF04C090E004D090E104882777FD809539
:1083B000982FA60195010E94874620E038E040E012
:1083C00050E00E94FB4629833A834B835C832093D1
:1083D000E6043093E7044093E8045093E904609185
:1083E000100570911105882777FD8095982F2091B1
:1083F0007F073091800740918107509182070E944A
:10840000874620E031E040E050E00E94FB46390121
:108410004A012093EA043093EB044093EC04509318
:10842000ED046091270570912805E090E204F0903A
:10843000E3040091E4041091E504882777FD80951A
:10844000982FA80197010E94874620E038E040E07D
:1084500050E00E94FB4619012A012093EE0430935C
:10846000EF044093F0045093F10460911005709173
:108470001105882777FD8095982F209183073091EB
:10848000840740918507509186070E94874620E027
:1084900031E040E050E00E94FB462093F20430932C
:1084A000F3044093F4045093F504ED81FE81E63922
:1084B000F1050CF482C08091070590910805A09108
:1084C0000905B0910A050097A105B10509F475C029
:1084D00080910B0590910C05A0910D05B0910E05B2
:1084E0000097A105B10509F468C0C501B7FE03C036
:1084F000909581959F4F855F914054F4C701F7FE99
:1085000003C0909581959F4F855F91400CF455C0B5
:1085100083E3681671048104910464F082E390E0BF
:10852000A0E0B0E08093EA049093EB04A093EC0405
:10853000B093ED04233331054105510564F082E326
:1085400090E0A0E0B0E08093F2049093F304A09355
:10855000F404B093F5048091EA049091EB04A091A7
:10856000EC04B091ED048E5C9F4FAF4FBF4F64F4AD
:108570008EEC9FEFAFEFBFEF8093EA049093EB0494
:10858000A093EC04B093ED048091F2049091F30475
:10859000A091F404B091F5048E5C9F4FAF4FBF4F94
:1085A00064F48EEC9FEFAFEFBFEF8093F2049093F3
:1085B000F304A093F404B093F5048091EA0490913D
:1085C000EB0429813A81821B930B9093F7048093EB
:1085D000F6048091F2049091F304281A390A30923B
:1085E000F9042092F80480914704909148040E9475
:1085F000C744909581959F4FAA2797FDA095BA2FC4
:108600002091F8043091F904442737FD4095542F08
:10861000BC01CD010E9487467B018C0180914704FB
:10862000909148040E940A45AA2797FDA095BA2F69
:108630002091F6043091F704442737FD4095542FDC
:10864000BC01CD010E948746E60EF71E081F191FC8
:10865000C801B70120E030E140E050E00E94FB4655
:108660003093FF042093FE048091470490914804C6
:108670000E940A45AA2797FDA095BA2F2091F804D9
:108680003091F904442737FD4095542FBC01CD01AA
:108690000E9487467B018C01809147049091480499
:1086A0000E94C744AA2797FDA095BA2F2091F604EF
:1086B0003091F704442737FD4095542FBC01CD017C
:1086C0000E948746E60EF71E081F191FC801B70152
:1086D00020E030E140E050E00E94FB466901309329
:1086E00001052093000560911B0570911C052091E8
:1086F0007D0830917E08882777FD8095982F442744
:1087000037FD4095542F0E94874620E034E040E03A
:1087100050E00E94FB4679018A01309303052093C3
:10872000020560911B0570911C052091870830910E
:108730008808882777FD8095982F442737FD409536
:10874000542F0E94874620E034E040E050E00E9431
:10875000FB46B90130930505209304053AE1E31681
:10876000F10434F089E190E09093030580930205D1
:108770006A31710534F089E190E0909305058093AA
:1087800004058091020590910305875E9F4F34F4A4
:1087900087EE9FEF90930305809302058091040577
:1087A00090910505875E9F4F34F487EE9FEF90937D
:1087B0000505809304052091FE043091FF0480910B
:1087C000020590910305280F391F3093FB04209375
:1087D000FA0440910405509105054C0D5D1D509320
:1087E000FD044093FC042432310534F083E290E030
:1087F0009093FB048093FA044432510534F083E2F1
:1088000090E09093FD048093FC048091FA04909191
:10881000FB048D5D9F4F34F48DED9FEF9093FB042F
:108820008093FA048091FC049091FD048D5D9F4F2C
:108830005CF48DED9FEF9093FD048093FC0404C0E5
:10884000813009F4F4CCA5CDE2E1CA5F0C94324743
:108850001F93CF93DF93EC01892B31F461157105E0
:1088600019F480E090E08FC077FD02C011E001C0F4
:108870001FEF209729F48AE51802C001112483C054
:10888000882777FD8095982F26E0660F771F881F31
:10889000991F2A95D1F79E01442737FD4095542F03
:1088A0000E94FB46F90137FF03C0F095E195FF4FA9
:1088B00041E0EA35F40734F4E358FA4F8491282F65
:1088C000332747C05CE1E73AF5071CF02AE530E0C2
:1088D00040C089E0ED38F8071CF029E530E039C0E8
:1088E00045E0EA3BF4071CF028E530E032C054E0F4
:1088F000E731F5071CF027E530E02BC083E0EE32CE
:10890000F8071CF026E530E024C042E0E939F4071E
:108910001CF025E530E01DC052E0E233F5071CF005
:1089200024E530E016C081E0E73EF8071CF023E5BF
:1089300030E00FC041E0ED3AF4071CF022E530E0F2
:1089400008C0EF57F1401CF021E530E002C020E5FF
:1089500030E01C161D066CF4812F992787FD909539
:10896000AC01249FC001259F900D349F900D1124D0
:108970000AC011162CF484EB90E0821B930B03C009
:10898000C901845B9040DF91CF911F910895FC0154
:1089900097FD03C041E050E005C0F095E195FF4F21
:1089A0004FEF5FEFEB35F1055CF0CF018B55904059
:1089B0008A35910540F484EB90E08E1B9F0BFC01FF
:1089C00021E030E010C0CF01855B90408A359105F1
:1089D00018F4E45BF04005C088E691E08E1B9F0B25
:1089E000FC012FEF3FEFEE0FFF1FE952F94F85918A
:1089F0009491BC01629FC001639F900D729F900D86
:108A000011249C01429FC001439F900D529F900DE5
:108A1000112408952AE530E0281B390BC9010E9472
:108A2000C7440895FC014150504030F001900616B3
:108A3000D1F73197CF010895882799270895505885
:108A4000192EEFD001D0D2C0BA176207730784077E
:108A50009507B1F188F40EF410940B2EBA2FA02DC7
:108A6000062E622F202D072E732F302D082E842FD7
:108A7000402D092E952F502DFF275523B9F0591B56
:108A800049F0573E98F0469537952795A795F040C1
:108A90005395C9F776F0BA0F621F731F841F30F425
:108AA000879577956795B795F040939517FA0F2EB0
:108AB0000895BF1BBB27BA0B620B730B840BF6CF59
:108AC000DEF6DBC0AED001D091C0552359F099231A
:108AD00069F09F575F57951B33F442F4903811F4B7
:108AE000915805C09BC091589F3F09F4C6C0BB2751
:108AF000112462177307840730F4660F771F881FED
:108B0000BB1F915098F311D00F920FD00F920DD040
:108B1000A0E82617370748071B0609F0A048BA2F18
:108B2000602D7F918F9100240895A0E800246217A2
:108B300073078407B10528F0621B730B840BB1091E
:108B40000A2A660F771F881FBB1FA69581F7089515
:108B500097FB73D09F3738F0FEE9F91B982F872FCA
:108B6000762F6B2F05C086C096958795779567956C
:108B7000F150D0F73EF490958095709561957F4FB8
:108B80008F4F9F4F0895E89403C097FB0EF4F3DFD7
:108B9000B62F672F782F892F9EE9002427C00ED08B
:108BA0005EF004C00BD026F001C008D019F020F40C
:108BB0008FEF089580E0089581E0089597FB092ED6
:108BC000052600F8689430D0E89407FC07C06217C7
:108BD00073078407950721F008F40094079498948C
:108BE00008959A95BB0F661F771F881F112499233C
:108BF000A1F08823B2F79F3F59F0BB0F48F421F44E
:108C0000002011F460FF04C06F5F7F4F8F4F9F4FB4
:108C1000881F9795879597F908952CC09FEF80EC52
:108C20000895052E092607FA440F551F5F3F79F076
:108C3000AA27A51708F051E04795880F991F9F3F75
:108C400031F0BB27B91708F091E0879508959F91FF
:108C50009F911124E3CF97FB880F991F9F3F31F01D
:108C6000BB27B91708F091E0879508959F919F91D0
:108C70001124D4CF66277727882799270895D1DF35
:108C800001D0B4CF992339F0552329F09F575F576E
:108C9000950F13F49AF1F1CF91589F3FE1F3629F42
:108CA000A12D0F92BB27639FA00DB11DEE27729FD0
:108CB000A00DB11DEE1FAF93AA27649FB00DE11D5B
:108CC000739FB00DE11DAA1F6627829FB00DE11DA5
:108CD000A61F5527749FE00DA11D551F839FE00D12
:108CE000A11D561F849FA00D511D852F7A2F6E2F19
:108CF0001F900F9088231AF4939539F48FCF000CAE
:108D0000111CBB1F661F771F881F01280895629FD3
:108D1000D001739FF001829FE00DF11D649FE00D73
:108D2000F11D929FF00D839FF00D749FF00D659FD4
:108D3000F00D9927729FB00DE11DF91F639FB00DD3
:108D4000E11DF91FBD01CF0111240895991B79E0A0
:108D500004C0991F961708F0961B881F7A95C9F7CB
:108D600080950895AA1BBB1B51E107C0AA1FBB1F1A
:108D7000A617B70710F0A61BB70B881F991F5A95A7
:108D8000A9F780959095BC01CD01089597FB092E18
:108D900007260AD077FD04D0E5DF06D000201AF4BC
:108DA000709561957F4F0895F6F7909581959F4F47
:108DB0000895A1E21A2EAA1BBB1BFD010DC0AA1F1C
:108DC000BB1FEE1FFF1FA217B307E407F50720F034
:108DD000A21BB30BE40BF50B661F771F881F991FAF
:108DE0001A9469F760957095809590959B01AC01F8
:108DF000BD01CF01089597FB092E05260ED057FD22
:108E000004D0D7DF0AD0001C38F450954095309537
:108E100021953F4F4F4F5F4F0895F6F790958095FE
:108E2000709561957F4F8F4F9F4F08952F923F927E
:108E30004F925F926F927F928F929F92AF92BF926A
:108E4000CF92DF92EF92FF920F931F93CF93DF9316
:108E5000CDB7DEB7CA1BDB0B0FB6F894DEBF0FBE73
:108E6000CDBF09942A88398848885F846E847D84C0
:108E70008C849B84AA84B984C884DF80EE80FD80C2
:108E80000C811B81AA81B981CE0FD11D0FB6F89438
:108E9000DEBF0FBECDBFED010895EE0FFF1F0590A1
:108EA000F491E02D0994F999FECFB2BDA1BDF89AD5
:108EB000119600B40895F7DF01921A94E1F708952E
:108EC000F999FECFB2BDA1BD00BC11960FB6F894C2
:108ED000FA9AF99A0FBE08950190F2DF1A94E1F719
:048EE0000895FFCF23
:108EE4000A01FF64496E74656772616C4E69636B55
:108EF4005F5F5F5F496E74656772616C526F6C6C23
:108F04005F5F5F5F4163634E69636B5F5F5F5F5F7A
:108F14005F5F5F5F416363526F6C6C5F5F5F5F5F56
:108F24005F5F5F5F505F4750535F46616B746F7262
:108F34005F5F5F5F445F4750535F46616B746F725E
:108F44005F5F5F5F536F6C6C5F506F735F4E6F72E8
:108F540074685F5F536F6C6C5F506F735F456173D0
:108F6400745F5F5F4B6F6D7061737356616C756591
:108F74005F5F5F5F5370616E6E756E675F5F5F5FAB
:108F84005F5F5F5F456D7066616E675F5F5F5F5FC8
:108F94005F5F5F5F4750534669785F5F5F5F5F5F06
:108FA4005F5F5F5F476573616D747374726F6D5F4C
:108FB4005F5F5F5F476573636877696E6469676B5A
:108FC4006569745F506F732E6E6F7274685F5F5F54
:108FD4005F5F5F5F506F732E656173745F5F5F5F88
:108FE4005F5F5F5F506F7469335F5F5F5F5F5F5F99
:108FF4005F5F5F5F48F668655F4750535F5F5F5F21
:109004005F5F5F5F486F6D655F4E6F7274685F5F2F
:109014005F5F5F5F486F6D655F456173745F5F5F3E
:109024005F5F5F5F506F736162775F4E6F727468EA
:109034005F5F5F5F506F736162775F456173745FF9
:109044005F5F5F5F505F45696E666C7573735F4EFB
:109054006F727468505F45696E666C7573735F45B3
:109064006173745F445F45696E666C7573735F4EBC
:109074006F727468445F45696E666C7573735F459F
:109084006173745F566572746963616C5F73706554
:1090940065645F5F537469636B476965725F5F5FA3
:1090A4005F5F5F5F4750535F4E69636B5F5F5F5FF6
:1090B4005F5F5F5F4750535F526F6C6C5F5F5F5FD2
:1090C4005F5F5F5F537469636B4E69636B5F5F5F80
:1090D4005F5F5F5F537469636B526F6C6C5F5F5F5C
:1090E4005F5F5F5FFFFF0A016400007D0000FF0314
:1090F4000102030405060708090A48616C6C6F2025
:1091040057656C74000000000000000000000000BF
:10911400000000000000000000000000000000004B
:10912400000000000000000000000000000000003B
:10913400000000000000000000000000000000002B
:10914400000000000000000000000D014265676996
:109154006E6E657200004E6F726D616C000053702C
:109164006F72740000640090D0030090D003001765
:10917400B7D13830FB103A409696020A644664EC44
:04918400FF90080050
:00000001FF
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/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/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/GPS.c
0,0 → 1,236
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Copyright (c) 10.2007 by Jochen Kromayer
// + es handelt sich um eine Beta-Software, die zu nichtkommerziellen Zwecken frei veröffentlich und weitergegeben werden darf. Für evtl.
// + Personen- und/der Sachschäden ist jegliche Haftung ausgeschlossen
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#include "main.h"
 
 
long Soll_Position_North = 0;
long Soll_Position_East = 0;
 
long GPS_Positionsabweichung_North = 0;
long GPS_Positionsabweichung_East = 0;
 
long P_Einfluss_North = 0;
long D_Einfluss_North = 0;
 
long P_Einfluss_East = 0;
long D_Einfluss_East = 0;
 
 
signed int GPS_North = 0;
signed int GPS_East = 0;
signed int GPS_Nick = 0;
signed int GPS_Roll = 0;
signed int GPS_Nick_tmp = 0; //(250308Kr)
signed int GPS_Roll_tmp = 0; //(250308Kr)
signed int GPS_Nick_ACC = 0; //(250308Kr)
signed int GPS_Roll_ACC = 0; //(250308Kr)
 
char gethome = 0; //Flag ob GPS_Home_Position gelernt ist //(280807Kr)
long GPS_Home_North = 0;
long GPS_Home_East = 0;
 
unsigned char blinkcount_LED2 = 0; //Hilfszähler für die blinkende LED (010907Kr)
 
#define GPS_Limit 35 //(031207Kr)
#define Limit_D_Anteil 50 //(031207Kr)
#define GPS_StickSense 12 //(241207Kr)
#define Limit_ACC_Anteil 25 //(250308Kr)
 
void gps_main(void)
{
 
//wenn kein 3D-Fix vorhanden, über das Poti jedoch irgendeine GPS Funktion aktiv ist, werden die GPS-Steuerbefehle
//auf Null gesetzt, um unkontrolliertes Wegfliegen durch das GPS zu verhindern. Dadurch wird abgesichert
//(auch im laufenden Flug), dass bei einem Verlust der GPS-Verbindung GPS deaktivert wird
if (actualPos.GPSFix < 3 && Poti3 > 70)
{
GPS_Nick = 0;
GPS_Roll = 0;
LED2_OFF;
beeptime = 50;
}
 
 
 
// speichert die GPS_Home_Position beim 3D-Fix, MotorEINschalten und wenn noch nicht zu weit weggeflogen wurde
// (modell_fliegt_gps < 2000) einmalig ab. Die Flugzeitabfrage sichert ab, dass bei einem Losfliegen ohne 3D-Fix
// die Home_Positinen irgendwann später dort gelernt werden, wo dann zu ersten mal ein 3D-Fix vorhanden ist
if (actualPos.GPSFix == 3 && MotorenEin == 1 && gethome == 0 && modell_fliegt_gps < 2000)
{
GPS_Home_North = actualPos.northing;
GPS_Home_East = actualPos.easting;
// Muss hier auch eingelernt werden, damit falls das Poti3 beim Motorenstarten in
// Mittelstellung sein sollte, trotzdem schon eine Sollposition vorliegt. Andernfalls würde
// GPS_Nick und _Roll maximal werden bis zum ersten Mal Stick_Nick und _Roll gesteuert würde
Soll_Position_North = actualPos.northing;
Soll_Position_East = actualPos.easting;
beeptime = 50;
gethome = 1;
}
 
 
//schaltet bei Verwendung des GPS/MM3-Boards von Walter, GPS an RX von UART0 //(050208Kr)
if (MotorenEin == 1)
{
SWITCH_GPS_2_RX;
}
 
 
//löscht die GPS_Home_Position beim MotorAUSschalten wieder und resetet das Flag gethome //(280807Kr)
//zusätzlich wird bei Verwendung des GPS/MM3-Boards von Walter BT wieder an RX von UART0 geschaltet //(050208Kr)
if (MotorenEin == 0)
{
SWITCH_BT_2_RX;
GPS_Home_North = 0;
GPS_Home_East = 0;
gethome = 0;
modell_fliegt_gps = 0;
}
 
 
 
 
// wenn Schalter ausgeschaltet, dann wird die LED2 ausgeschaltet und das GPS Steuerkommando gelöscht
if(Poti3 <= 70)
{
// Sollpositionen müssen auch hier beschrieben werden, damit ausgeschlossen ist, dass falls gelandet
// wird und die GPS-Funktion über Poti3 deaktivert und anschließend wieder aktiviert wird keine Soll-Positionen vorliegen.
Soll_Position_North = actualPos.northing;
Soll_Position_East = actualPos.easting;
GPS_Nick = 0;
GPS_Roll = 0;
LED2_OFF;
}
// wenn 3D-Fix, Schalter im mittleren Bereich und vom Pilot gesteuert wird, wird ständig neue GPS-Sollposition eingelernt
if(actualPos.GPSFix == 3 && Poti3 > 70 && Poti3 < 150 && (StickNick > GPS_StickSense || StickNick < -GPS_StickSense || StickRoll > GPS_StickSense || StickRoll < -GPS_StickSense))
{
GPS_Nick = 0; //wird genullt, damit das letzte GPS Kommando nicht ständig gegen den Piloten ansteuert
GPS_Roll = 0; //wird genullt, damit das letzte GPS Kommando nicht ständig gegen den Piloten ansteuert
Soll_Position_North = actualPos.northing; // Soll-Position wird geschrieben
Soll_Position_East = actualPos.easting; // Soll-Position wird geschrieben
//++++++++++++++++++++++++++++++++++++
//Sorgt lediglich dafür, dass die LED2 langsam blinkt. Dauer ist durch die "> x" Abfrage festgelegt
//++++++++++++++++++++++++++++++++++++
if(blinkcount_LED2 >= 200) // maximal erlaubt 255 wegen unsigned char
{
LED2_FLASH;
blinkcount_LED2 = 0;
}
blinkcount_LED2++;
//++++++++++++++++++++++++++++++++++++
}
 
// wenn 3D-Fix, Schalter im mittleren Bereich (oder höher), neuer Mittelwert vorhanden, wenigstens einmal Sollposition
// gelernt und der Pilot nicht selbst steuert wird eine GPS-Funktion aktiviert
if (actualPos.GPSFix == 3 && Poti3 > 70 && Soll_Position_North != 0 && Soll_Position_East != 0 && StickNick <= GPS_StickSense && StickNick >= -GPS_StickSense && StickRoll <= GPS_StickSense && StickRoll >= -GPS_StickSense)
{
//Berechnung der GPS-Positionsabweichung je nach aktivierter GPS-Funktion (GPS_HOLD oder HOMING)
//DYNAMISCHES GPS-HOLD, wenn Schalter in Mittelstellung ist UND KEINE Notlandung, wird die zuletzt gelernte Soll_Position angeflogen
if(Poti3 < 150 && Notlandung == 0) //(050208Kr)
{
GPS_Positionsabweichung_North = (Soll_Position_North - actualPos.northing);
GPS_Positionsabweichung_East = (Soll_Position_East - actualPos.easting);
LED2_ON;
}
//andernfalls, wenn Schalter in max. Stellung ODER Notlandung und zusätzlich die GPS_Home_Positionen beim Motorenstarten gelernt
//werden konnten, wird zur GPS_Home_Position geflogen
if ((Poti3 >= 150 || Notlandung == 1) && GPS_Home_North != 0 && GPS_Home_East != 0) //(050208Kr)
{
GPS_Positionsabweichung_North = (GPS_Home_North - actualPos.northing);
GPS_Positionsabweichung_East = (GPS_Home_East - actualPos.easting);
// durch das ständige Neulernen der Soll_Positionen während HOMING wird erreicht, dass der MK nach dem Umschalten
// von HOMING zurück zu GPS-HOLD nicht wieder an die alte Soll_Position zurück fliegt
Soll_Position_North = actualPos.northing;
Soll_Position_East = actualPos.easting;
LED2_ON;
}
//verhindert, dass beim Umschalten von "GPS-HOLD" auf "HOMING" oder bei einer Notlandung OHNE gelernte Homeposition
//die GPS Funktion unkontrolliert steuert. Daher wird GPS_HOLD aktiv gehalten, die Sollpositon wird bei Stickbefehlen
//jedoch nicht wie beim dynamischen GPS_HOLD überschrieben. Zusätzlich wird der Summer eingeschaltet.
if ((Poti3 >= 150 || Notlandung == 1) && GPS_Home_North == 0 && GPS_Home_East == 0) //(050208Kr)
{
GPS_Positionsabweichung_North = (Soll_Position_North - actualPos.northing);
GPS_Positionsabweichung_East = (Soll_Position_East - actualPos.easting);
LED2_ON;
beeptime = 50;
}
//Berechnung der Einzelkomponenten des PD-Reglers
P_Einfluss_North = (P_GPS_Verstaerkung * GPS_Positionsabweichung_North) / 2048;
D_Einfluss_North = (D_GPS_Verstaerkung * actualPos.velNorth) / 256;
P_Einfluss_East = (P_GPS_Verstaerkung * GPS_Positionsabweichung_East) / 2048;
D_Einfluss_East = (D_GPS_Verstaerkung * actualPos.velEast) / 256;
// Begrenzung des maximalen D-Anteils für pos. und neg. Werte. Grenze muss so geählt werden,
// dass das Limit im normalen Position-Hold nicht erreicht wird und somit keinen Einfluss hat.
// Grund: Beim Zufliegen auf weiter entfernte Ziele bremst der D-Anteil kurz vor dem Ziel den Mikrokopter sehr stark ab.
// Dieses Limit wirkt nur, wenn sich der MK im HOMING Modus befindet und sich noch weit (>5m) von der Home-Position weg befindet.
if (Poti3 >= 150 && GPS_Home_North != 0 && GPS_Home_East != 0 && (abs(GPS_Positionsabweichung_North) > 500 || abs(GPS_Positionsabweichung_East) > 500))
{
if (D_Einfluss_North > Limit_D_Anteil) D_Einfluss_North = Limit_D_Anteil;
if (D_Einfluss_East > Limit_D_Anteil) D_Einfluss_East = Limit_D_Anteil;
if (D_Einfluss_North < -Limit_D_Anteil) D_Einfluss_North = -Limit_D_Anteil;
if (D_Einfluss_East < -Limit_D_Anteil) D_Einfluss_East = -Limit_D_Anteil;
}
//PD-Regler
GPS_North = (-P_Einfluss_North + D_Einfluss_North);
GPS_East = (P_Einfluss_East - D_Einfluss_East);
 
 
//Diese Variante funktioniert genausogut und ist noch optimierter von der Ausührungszeit und Genauigkeit
GPS_Nick_tmp = (((long)-sin_i(KompassValue)*(long)GPS_East) + ((long)cos_i(KompassValue)*(long)GPS_North))/4096;
GPS_Roll_tmp = (((long)cos_i(KompassValue)*(long)GPS_East) + ((long)sin_i(KompassValue)*(long)GPS_North))/4096;
//***************************************
//Einflüsse der ACC Sensoren (körperfest)
GPS_Nick_ACC = ((long)ACC_GPS_Verstaerkung * (long)Mittelwert_AccNick) / 1024; //mindestens durch 23,34 dividiert, um Überläufe zu verhindern
GPS_Roll_ACC = ((long)ACC_GPS_Verstaerkung * (long)Mittelwert_AccRoll) / 1024; //mindestens durch 23,34 dividiert, um Überläufe zu verhindern
if (GPS_Nick_ACC > Limit_ACC_Anteil) GPS_Nick_ACC = Limit_ACC_Anteil;
if (GPS_Roll_ACC > Limit_ACC_Anteil) GPS_Roll_ACC = Limit_ACC_Anteil;
if (GPS_Nick_ACC < -Limit_ACC_Anteil) GPS_Nick_ACC = -Limit_ACC_Anteil;
if (GPS_Roll_ACC < -Limit_ACC_Anteil) GPS_Roll_ACC = -Limit_ACC_Anteil;
 
GPS_Nick = GPS_Nick_tmp + GPS_Nick_ACC;
GPS_Roll = GPS_Roll_tmp + GPS_Roll_ACC;
//***************************************
 
// Begrenzung des maximalen GPS Einflusses für positive und negative Werte
if (GPS_Nick > GPS_Limit) GPS_Nick = GPS_Limit;
if (GPS_Roll > GPS_Limit) GPS_Roll = GPS_Limit;
if (GPS_Nick < -GPS_Limit) GPS_Nick = -GPS_Limit;
if (GPS_Roll < -GPS_Limit) GPS_Roll = -GPS_Limit;
//newData_navPosUtm = 0;
}
}
 
//***************************
// TO-DO:
// 1.) Vorzeichen von GPS_NICK_ACC und GPS_ROLL_ACC experimentell ermitteln
// 2.) Teilerfaktor (momentan 512) für sinnvollen Wertebereich ermitteln
// 3.) Testen ob Mittelwert_ACCXXX die richtige Signalgröße ist oder evntl. doch z.B. AdWertAccXXXX, ...
 
// 4.) Zeitverzögerung für P_Einfluss_XXXX nach neutralen Knüppeln integrieren
// 5.) Modularisieren / Unterfunktionen
// 6.) I-Anteil in die GPS-Regelung integrieren
// 7.) Updaterate für die zeitaufwändige Kompassberechnung auf 5Hz reduzieren
//***************************
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/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/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/README_es_wird_abweichend_Userparam3_und_statt_J5_immer_J9_verwendet.pdf
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/Settings.h
--- my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/_Parameter.txt (nonexistent)
+++ my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/_Parameter.txt (revision 796)
@@ -0,0 +1,46 @@
+**********************************
+GPS-Parameter
+**********************************
+
+P-Faktor (Userparam_5): ~100
+
+info: muss zum Einstellen auf ein Poti gelegt werden!
+verhindert ein langsames, stetiges Wegdriften des MK. Der P-Faktor sollte zu Beginn gleich Null sein und ERST NACHDEM DER D-Faktor EINGESTELLT IST (siehe unten) langsam erhöht werden. Idealerweise in kleinen Schritten, bis der MK wieder langsam gegen den Wind zur Sollposition zurückfliegt.
+
+
+---------------------
+D-Faktor (Userparam_6): ~80
+
+info: muss zum Einstellen auf ein Poti gelegt werden!
+Auch beim D-Faktor zuerst so vorgehen, dass er zu Beginn gleich Null ist. Dann die GPS Funktion von Sender aus einschalten und die Steuerknüppel loslassen. Anschließend wird der MK unmittelbar wegdriften. Dies kann nur durch ein Erhöhen des D-Faktors verhindert werden. Der D-Faktor gleich hauptsächlich stärkere Windböen aus und verlangsamt das plötzliche Wegfliegen erstmal, führt alleine jedoch nicht zu einem stabilen Positionshalten. Diesen Parameter solange behutsam erhöhen, bis der MK anfängt mehr oder weniger stark auf der Stelle zu zucken, dann natürlich wieder leicht reduzieren!
+Den Rest macht denn der P-Faktor (siehe oben).
+
+
+
+
+
+**********************************
+MM3-Parameter
+**********************************
+
+MM3 Kompass Kalibrationsparameter(Userparam_3): 178
+
+
+
+
+
+**********************************
+LED-Parameter
+**********************************
+
+LED1_TOTALTIME (UserParam_7): ~60 //darf nicht größer als 255 gewählt werden
+
+info:
+wenn = 0, bleit LED1 dauerhaft AUS
+wenn >= 200, ist die LED1 dauerhaft AN
+dazwischen blinkt die LED1 unterschiedlich lange
+
+
+---------------------
+LED1_ONTIME (UserParam_8): ~20 //darf nicht größer als 255 gewählt werden
+
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/_Settings.h
0,0 → 1,50
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Testmodi
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#define MOTOR_OFF 0
#define MOTOR_TEST 0
 
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// 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 500 // in diesem Intervall werden Degugdaten ohne Aufforderung gesendet
 
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Sender
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#define K_NICK 0
#define K_ROLL 1
#define K_GAS 2
#define K_GIER 3
#define K_POTI1 4
#define K_POTI2 5
#define K_POTI3 6
#define K_POTI4 7
// +++++++++++++++++++++++++++++++
// + Getestete Settings:
// +++++++++++++++++++++++++++++++
// Setting: Kamera
// Stick_P:3
// Stick_D:0
// Gyro_P: 175
// Gyro_I: 175
// Ki_Anteil: 10
// +++++++++++++++++++++++++++++++
// + Getestete Settings:
// +++++++++++++++++++++++++++++++
// Setting: Normal
// Stick_P:2
// Stick_D:8
// Gyro_P: 80
// Gyro_I: 150
// Ki_Anteil: 5
 
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/analog.c
0,0 → 1,147
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + 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;
volatile int HoeheD = 0;
volatile char messanzahl_Druck;
volatile int tmpLuftdruck;
volatile unsigned int ZaehlMessungen = 0;
 
//#######################################################################################
//
void ADC_Init(void)
//#######################################################################################
{
ADMUX = 0;//Referenz ist extern
ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE);
//Free Running Mode, Division Factor 128, Interrupt on
}
 
void SucheLuftruckOffset(void)
{
unsigned int off;
off = eeprom_read_byte(&EEPromArray[EEPROM_ADR_LAST_OFFSET]);
if(off > 20) off -= 10;
OCR0A = off;
Delay_ms_Mess(100);
if(MessLuftdruck < 850) off = 0;
for(; off < 250;off++)
{
OCR0A = off;
Delay_ms_Mess(50);
printf(".");
if(MessLuftdruck < 900) break;
}
eeprom_write_byte(&EEPromArray[EEPROM_ADR_LAST_OFFSET], off);
DruckOffsetSetting = off;
Delay_ms_Mess(300);
}
 
 
//#######################################################################################
//
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 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 < 800) NeutralAccZ+= 0.02;
}
else if(AdWertAccHoch < -1)
{
if(NeutralAccZ > 600) NeutralAccZ-= 0.02;
}
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 = (int)(StartLuftdruck - tmpLuftdruck - HoehenWert); // D-Anteil = neuerWert - AlterWert
Luftdruck = (tmpLuftdruck + 3 * Luftdruck) / 4;
HoehenWert = StartLuftdruck - Luftdruck;
tmpLuftdruck = 0;
}
kanal = 0;
state = 0;
break;
default:
kanal = 0;
state = 0;
break;
}
ADMUX = kanal;
if(state != 0) ANALOG_ON;
}
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/analog.h
0,0 → 1,24
/*#######################################################################################
 
#######################################################################################*/
 
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 volatile int HoeheD;
extern volatile unsigned int MessLuftdruck;
extern volatile int StartLuftdruck;
extern volatile char MessanzahlNick;
 
unsigned int ReadADC(unsigned char adc_input);
void ADC_Init(void);
void SucheLuftruckOffset(void);
 
 
#define ANALOG_OFF ADCSRA=0
#define ANALOG_ON ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE)
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/compass.c
0,0 → 1,241
/*
 
Copyright 2007, Niklas Nold
 
This program (files compass.c and compass.h) is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation;
either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
 
Please note: All the other files for the project "Mikrokopter" by H. Buss are under the license (license_buss.txt) published by www.mikrokopter.de
*/
 
#include "main.h"
 
struct MM3_calib_struct ee_calib EEMEM; // Reservierung im EEPROM
 
struct MM3_working_struct MM3;
struct MM3_calib_struct MM3_calib;
 
 
//############################################################################
// Initialisierung
void init_MM3(void)
//############################################################################
{
// SPI-Schnittstelle initialisieren
SPCR = (1<<SPIE)|(1<<SPE)|(1<<MSTR)|(1<<SPR1)|(1<<SPR0); // Interrupt an, Master, 156 kHz Oszillator
 
DDRB |= (1<<PB7)|(1<<PB5)|(1<<PB2); // SCK, MOSI, J8 jeweils als Ausgang
//Dieser Pin ist weder bei der FC 1.0 noch bei der FC 1.1 verwendet.
//Bei der originalen FC 1.1 ist sogar ein extra Lödpad vorhanden, bei
//einer originalen FC 1.0 oder auch einer zur 1.1 Umgebauten liegt dieser
//Pin auf "Stecker 4" der Universalschnittstelle
DDRC |= (1<<PC6); // PC6 (J9) als Ausgang. Ist für den SSNOT Pin beim MM3
PORTC &= ~(1<<PC6); // PC6 (J9) permanent auf Low. Ist für den SSNOT Pin beim MM3
// Init Statemachine
MM3.AXIS = MM3_X;
MM3.STATE = MM3_RESET;
// Kalibrierung aus dem EEprom lesen
eeprom_read_block((uint8_t *) &MM3_calib.X_off, &EEPromArray[EEPROM_ADR_MM3_CALIB], sizeof(MM3_calib)); //Bugfix für sporadisch falsche Zuweisung des Nick-Kanals durch Nick666 EEPROM Verwendung (110308)
}
 
 
//############################################################################
// Wird in der SIGNAL (SIG_OVERFLOW0) aufgerufen
void timer0_MM3(void)
//############################################################################
{
switch (MM3.STATE)
{
case MM3_RESET:
PORTB |= (1<<PB2); // J8 auf High, MM3 Reset
MM3.STATE = MM3_START_TRANSFER;
return;
case MM3_START_TRANSFER:
PORTB &= ~(1<<PB2); // J8 auf Low (war ~125 µs auf High)
if (MM3.AXIS == MM3_X) SPDR = 0x31; // Schreiben ins SPDR löst automatisch SPI-Übertragung (MOSI und MISO) aus
else if (MM3.AXIS == MM3_Y) SPDR = 0x32; // Micromag Period Select ist auf 256 (0x30)
else SPDR = 0x33; //if (MM3.AXIS == MM3_Z) // 1: x-Achse, 2: Y-Achse, 3: Z-Achse
MM3.DRDY = SetDelay(8); // Laut Datenblatt max. Zeit bis Messung fertig (bei PS 256 eigentlich 4 ms)
MM3.STATE = MM3_WAIT_DRDY;
return;
case MM3_WAIT_DRDY:
if (CheckDelay(MM3.DRDY)) {SPDR = 0x00;MM3.STATE = MM3_DRDY;} // Irgendwas ins SPDR, damit Übertragung ausgelöst wird, wenn Wartezeit vorbei
return; // Jetzt gehts weiter in SIGNAL (SIG_SPI)
}
}
 
 
//############################################################################
// SPI byte ready
SIGNAL (SIG_SPI)
//############################################################################
{
static char tmp;
int wert;
 
switch (MM3.STATE)
{
case MM3_DRDY: // 1. Byte ist da, zwischenspeichern
tmp = SPDR;
SPDR = 0x00; // Übertragung von 2. Byte auslösen
MM3.STATE = MM3_BYTE2;
return;
case MM3_BYTE2: // 2. Byte der entsprechenden Achse ist da
wert = tmp;
wert <<= 8; // 1. Byte an MSB-Stelle rücken
wert |= SPDR; // 2. Byte dranpappen
if(abs(wert) < Max_Axis_Value) // Spikes filtern. Zuweisung nur, wenn Max-Wert nicht überschritten
switch (MM3.AXIS)
{
case MM3_X:
MM3.x_axis = wert;
MM3.AXIS = MM3_Y;
break;
case MM3_Y:
MM3.y_axis = wert;
MM3.AXIS = MM3_Z;
break;
default: //case MM3_Z:
MM3.z_axis = wert;
MM3.AXIS = MM3_X;
}
MM3.STATE = MM3_RESET;
}
}
 
//############################################################################
// Kompass kalibrieren
void calib_MM3(void)
//############################################################################
{
signed int x_min=0,x_max=0,y_min=0,y_max=0,z_min=0,z_max=0;
uint8_t measurement=50,beeper=0;
unsigned int timer;
GRN_ON;
ROT_OFF;
while (measurement)
{
//H_earth = MM3.x_axis*MM3.x_axis + MM3.y_axis*MM3.y_axis + MM3.z_axis*MM3.z_axis;
if (MM3.x_axis > x_max) x_max = MM3.x_axis;
else if (MM3.x_axis < x_min) x_min = MM3.x_axis;
if (MM3.y_axis > y_max) y_max = MM3.y_axis;
else if (MM3.y_axis < y_min) y_min = MM3.y_axis;
if (MM3.z_axis > z_max) z_max = MM3.z_axis;
else if (MM3.z_axis < z_min) z_min = MM3.z_axis;
if (!beeper)
{
ROT_FLASH;
GRN_FLASH;
beeptime = 50;
beeper = 50;
}
beeper--;
// Schleife mit 100 Hz
timer = SetDelay(10);
while(!CheckDelay(timer));
// Wenn Gas zurück genommen wird, Kalibrierung mit 1/2 Sekunde Verzögerung beenden
if (PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] < 100) measurement--;
}
// Wertebereich der Achsen
MM3_calib.X_range = (x_max - x_min);
MM3_calib.Y_range = (y_max - y_min);
MM3_calib.Z_range = (z_max - z_min);
// Offset der Achsen
MM3_calib.X_off = (x_max + x_min) / 2;
MM3_calib.Y_off = (y_max + y_min) / 2;
MM3_calib.Z_off = (z_max + z_min) / 2;
 
// und im EEProm abspeichern
eeprom_write_block((uint8_t *) &MM3_calib.X_off, &EEPromArray[EEPROM_ADR_MM3_CALIB], sizeof(MM3_calib)); //Bugfix für sporadisch falsche Zuweisung des Nick-Kanals durch Nick666 EEPROM Verwendung (110308)
}
 
 
//############################################################################
// Neigungskompensierung und Berechnung der Ausrichtung
int heading_MM3(void)
//############################################################################
{
signed int sin_nick, cos_nick, sin_roll, cos_roll;
long x_axis, y_axis, z_axis;
long x_corr, y_corr;
signed int heading;
int8_t nicktilt,rolltilt;
unsigned int div_faktor;
div_faktor = (uint16_t)EE_Parameter.UserParam3 * 8;
// Berechung von sinus und cosinus
nicktilt = (IntegralNick/div_faktor);
sin_nick = sin_i(nicktilt);
cos_nick = cos_i(nicktilt);
rolltilt = (IntegralRoll/div_faktor);
sin_roll = sin_i(rolltilt);
cos_roll = cos_i(rolltilt);
 
// Offset
x_axis = (MM3.x_axis - MM3_calib.X_off);
y_axis = (MM3.y_axis - MM3_calib.Y_off);
z_axis = (MM3.z_axis - MM3_calib.Z_off);
/*
// Normierung Wertebereich
if ((MM3_calib.X_range > MM3_calib.Y_range) && (MM3_calib.X_range > MM3_calib.Z_range))
{
y_axis = (y_axis * MM3_calib.X_range) / MM3_calib.Y_range;
z_axis = (z_axis * MM3_calib.X_range) / MM3_calib.Z_range;
}
else if ((MM3_calib.Y_range > MM3_calib.X_range) && (MM3_calib.Y_range > MM3_calib.Z_range))
{
x_axis = (x_axis * MM3_calib.Y_range) / MM3_calib.X_range;
z_axis = (z_axis * MM3_calib.Y_range) / MM3_calib.Z_range;
}
else //if ((MM3_calib.Z_range > MM3_calib.X_range) && (MM3_calib.Z_range > MM3_calib.Y_range))
{
x_axis = (x_axis * MM3_calib.Z_range) / MM3_calib.X_range;
y_axis = (y_axis * MM3_calib.Z_range) / MM3_calib.Y_range;
}
*/
// Neigungskompensierung
x_corr = x_axis * cos_nick;
x_corr += (((y_axis * sin_roll) / 4096) * sin_nick);
x_corr -= (((z_axis * cos_roll) / 4096) * sin_nick);
x_corr /= 4096;
y_corr = y_axis * cos_roll;
y_corr += z_axis * sin_roll;
y_corr /= 4096;
// Winkelberechnung
heading = atan2_i(x_corr, y_corr);
// Skalieren von +-180° auf 0-360°
if (heading < 0) heading = -heading;
else heading = 360 - heading;
 
return (heading);
}
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/compass.h
0,0 → 1,44
 
 
struct MM3_working_struct
{
uint8_t STATE;
unsigned int DRDY;
uint8_t AXIS;
volatile signed int x_axis;
volatile signed int y_axis;
volatile signed int z_axis;
};
 
 
struct MM3_calib_struct
{
int8_t X_off;
int8_t Y_off;
int8_t Z_off;
uint16_t X_range;
uint16_t Y_range;
uint16_t Z_range;
};
 
extern struct MM3_working_struct MM3;
extern struct MM3_calib_struct MM3_calib;
 
void init_MM3(void);
void timer0_MM3(void);
void calib_MM3(void);
int heading_MM3(void);
 
#define Max_Axis_Value 500
 
// Die Werte der Statemachine
#define MM3_RESET 0
#define MM3_START_TRANSFER 1
#define MM3_WAIT_DRDY 2
#define MM3_DRDY 3
#define MM3_BYTE2 4
#define MM3_X 5
#define MM3_Y 6
#define MM3_Z 7
#define MM3_TILT 8
#define MM3_IDLE 9
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/eeprom.c
0,0 → 1,182
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Konstanten
// + 0-250 -> normale Werte
// + 251 -> Poti1
// + 252 -> Poti2
// + 253 -> Poti3
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
void DefaultKonstanten1(void)
{
EE_Parameter.Kanalbelegung[K_NICK] = 1;
EE_Parameter.Kanalbelegung[K_ROLL] = 2;
EE_Parameter.Kanalbelegung[K_GAS] = 3;
EE_Parameter.Kanalbelegung[K_GIER] = 4;
EE_Parameter.Kanalbelegung[K_POTI1] = 5;
EE_Parameter.Kanalbelegung[K_POTI2] = 6;
EE_Parameter.Kanalbelegung[K_POTI3] = 7;
EE_Parameter.Kanalbelegung[K_POTI4] = 8;
EE_Parameter.GlobalConfig = CFG_ACHSENKOPPLUNG_AKTIV;//CFG_HOEHENREGELUNG | /*CFG_HOEHEN_SCHALTER |*/ CFG_KOMPASS_AKTIV | CFG_KOMPASS_FIX;//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 = 4; // Wert : 0-50
EE_Parameter.Stick_P = 4; //2 // Wert : 1-6
EE_Parameter.Stick_D = 8; //8 // Wert : 0-64
EE_Parameter.Gier_P = 12; // Wert : 1-20
EE_Parameter.Gas_Min = 15; // Wert : 0-32
EE_Parameter.Gas_Max = 250; // 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 = 20; // 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 = 32 * 4; //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.LoopConfig = 0; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt
EE_Parameter.AchsKopplung1 = 90;
EE_Parameter.AchsGegenKopplung1 = 5;
EE_Parameter.WinkelUmschlagNick = 100;
EE_Parameter.WinkelUmschlagRoll = 100;
EE_Parameter.GyroAccAbgleich = 16; // 1/k
EE_Parameter.Driftkomp = 4;
EE_Parameter.DynamicStability = 100;
memcpy(EE_Parameter.Name, "Sport\0", 12);
}
void DefaultKonstanten2(void)
{
EE_Parameter.Kanalbelegung[K_NICK] = 1;
EE_Parameter.Kanalbelegung[K_ROLL] = 2;
EE_Parameter.Kanalbelegung[K_GAS] = 3;
EE_Parameter.Kanalbelegung[K_GIER] = 4;
EE_Parameter.Kanalbelegung[K_POTI1] = 5;
EE_Parameter.Kanalbelegung[K_POTI2] = 6;
EE_Parameter.Kanalbelegung[K_POTI3] = 7;
EE_Parameter.Kanalbelegung[K_POTI4] = 8;
EE_Parameter.GlobalConfig = CFG_ACHSENKOPPLUNG_AKTIV;//CFG_HOEHENREGELUNG | /*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 = 3; //2 // Wert : 1-6
EE_Parameter.Stick_D = 4; //8 // Wert : 0-64
EE_Parameter.Gier_P = 6; // Wert : 1-20
EE_Parameter.Gas_Min = 15; // Wert : 0-32
EE_Parameter.Gas_Max = 250; // 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 = 20; // 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 = 20 * 4; // 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.LoopConfig = 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 = 100;
EE_Parameter.WinkelUmschlagRoll = 100;
EE_Parameter.GyroAccAbgleich = 32; // 1/k
EE_Parameter.Driftkomp = 4;
EE_Parameter.DynamicStability = 75;
memcpy(EE_Parameter.Name, "Normal\0", 12);
}
 
void DefaultKonstanten3(void)
{
EE_Parameter.Kanalbelegung[K_NICK] = 1;
EE_Parameter.Kanalbelegung[K_ROLL] = 2;
EE_Parameter.Kanalbelegung[K_GAS] = 3;
EE_Parameter.Kanalbelegung[K_GIER] = 4;
EE_Parameter.Kanalbelegung[K_POTI1] = 5;
EE_Parameter.Kanalbelegung[K_POTI2] = 6;
EE_Parameter.Kanalbelegung[K_POTI3] = 7;
EE_Parameter.Kanalbelegung[K_POTI4] = 8;
EE_Parameter.GlobalConfig = CFG_DREHRATEN_BEGRENZER | CFG_ACHSENKOPPLUNG_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 = 2; // Wert : 0-50
EE_Parameter.Stick_P = 2; //2 // Wert : 1-6
EE_Parameter.Stick_D = 4; //8 // Wert : 0-64
EE_Parameter.Gier_P = 6; // Wert : 1-20
EE_Parameter.Gas_Min = 15; // Wert : 0-32
EE_Parameter.Gas_Max = 250; // 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 = 140; // 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 = 20 * 4; // 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.LoopConfig = 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 = 100;
EE_Parameter.WinkelUmschlagRoll = 100;
EE_Parameter.GyroAccAbgleich = 32; // 1/k
EE_Parameter.Driftkomp = 4;
EE_Parameter.DynamicStability = 50;
memcpy(EE_Parameter.Name, "Beginner\0", 12);
}
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/fc.c
0,0 → 1,1286
/*#######################################################################################
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;
volatile int AdNeutralNick = 0,AdNeutralRoll = 0,AdNeutralGier = 0,StartNeutralRoll = 0,StartNeutralNick = 0;
volatile int Mittelwert_AccNick, Mittelwert_AccRoll,Mittelwert_AccHoch, NeutralAccX=0, NeutralAccY=0;
volatile float NeutralAccZ = 0;
unsigned char CosinusNickWinkel = 0, CosinusRollWinkel = 0;
volatile long IntegralNick = 0,IntegralNick2 = 0;
volatile long IntegralRoll = 0,IntegralRoll2 = 0;
volatile long IntegralAccNick = 0,IntegralAccRoll = 0,IntegralAccZ = 0;
volatile long Integral_Gier = 0;
volatile long Mess_IntegralNick = 0,Mess_IntegralNick2 = 0;
volatile long Mess_IntegralRoll = 0,Mess_IntegralRoll2 = 0;
volatile long Mess_Integral_Gier = 0,Mess_Integral_Gier2 = 0;
volatile long MittelIntegralNick,MittelIntegralRoll,MittelIntegralNick2,MittelIntegralRoll2;
volatile long Mess_Integral_Hoch = 0;
 
int KompassValue = 0;
int KompassStartwert = 0;
int KompassRichtung = 0;
uint8_t updKompass = 0;
 
unsigned char MAX_GAS,MIN_GAS;
unsigned char Notlandung = 0;
unsigned char HoehenReglerAktiv = 0;
long Umschlag180Nick = 250000L, Umschlag180Roll = 250000L;
 
unsigned char blinkcount_LED1 = 0;//Hilfszähler für die blinkende LED (310807Kr)
unsigned char LED1_TOTALTIME = 0;//Parameter für Blinkverhalten von LED1 (091207Kr)
unsigned char LED1_ONTIME = 0;//Parameter für Blinkverhalten von LED1 (091207Kr)
unsigned int modell_fliegt_gps = 0;//(030907Kr)
 
 
float GyroFaktor;
float IntegralFaktor;
volatile int DiffNick,DiffRoll;
int Poti1 = 0, Poti2 = 0, Poti3 = 0, Poti4 = 0, Poti5 = 0, Poti6 = 0, Poti7 = 0, Poti8 = 0; //PPM24-Erweiterung (121007Kr)
volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count;
unsigned char MotorWert[5];
volatile unsigned char SenderOkay = 0;
int StickNick = 0,StickRoll = 0,StickGier = 0,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;
struct mk_param_struct EE_Parameter;
signed int ExternStickNick = 0,ExternStickRoll = 0,ExternStickGier = 0, ExternHoehenValue = -20;
int MaxStickNick = 0,MaxStickRoll = 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;
Parameter_AchsKopplung1 = 0;
Parameter_AchsGegenKopplung1 = 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;
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;
StartLuftdruck = Luftdruck;
HoeheD = 0;
Mess_Integral_Hoch = 0;
KompassStartwert = KompassValue;
beeptime = 50;
Umschlag180Nick = (long) EE_Parameter.WinkelUmschlagNick * 2500L;
Umschlag180Roll = (long) EE_Parameter.WinkelUmschlagRoll * 2500L;
ExternHoehenValue = 0;
}
 
//############################################################################
// Bearbeitet die Messwerte
void Mittelwert(void)
//############################################################################
{
static signed long tmpl,tmpl2;
MesswertGier = (signed int) AdNeutralGier - AdWertGier;
MesswertRoll = (signed int) AdWertRoll - AdNeutralRoll;
MesswertNick = (signed int) AdWertNick - AdNeutralNick;
 
// 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;
IntegralAccZ += Aktuell_az - NeutralAccZ;
// Gier ++++++++++++++++++++++++++++++++++++++++++++++++
Mess_Integral_Gier += MesswertGier;
Mess_Integral_Gier2 += MesswertGier;
// Kopplungsanteil +++++++++++++++++++++++++++++++++++++
if(!Looping_Nick && !Looping_Roll && (EE_Parameter.GlobalConfig & CFG_ACHSENKOPPLUNG_AKTIV))
{
tmpl = Mess_IntegralNick / 4096L;
tmpl *= MesswertGier;
tmpl *= Parameter_AchsKopplung1; //125
tmpl /= 2048L;
tmpl2 = Mess_IntegralRoll / 4096L;
tmpl2 *= MesswertGier;
tmpl2 *= Parameter_AchsKopplung1;
tmpl2 /= 2048L;
}
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 - 10000L);
Mess_IntegralRoll2 = Mess_IntegralRoll;
}
if(Mess_IntegralRoll <-Umschlag180Roll)
{
Mess_IntegralRoll = (Umschlag180Roll - 10000L);
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 - 10000L);
Mess_IntegralNick2 = Mess_IntegralNick;
}
if(Mess_IntegralNick <-Umschlag180Nick)
{
Mess_IntegralNick = (Umschlag180Nick - 10000L);
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 && !(EE_Parameter.GlobalConfig & CFG_HEADING_HOLD)) //um Heading_Hold erweitert //(071107Kr)
{
if(MesswertNick > 200) MesswertNick += 4 * (MesswertNick - 200);
else if(MesswertNick < -200) MesswertNick += 4 * (MesswertNick + 200);
if(MesswertRoll > 200) MesswertRoll += 4 * (MesswertRoll - 200);
else if(MesswertRoll < -200) MesswertRoll += 4 * (MesswertRoll + 200);
}
//------------------------------------------------------------------------------
if(Poti1 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110) Poti1++; else if(Poti1 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI1]] + 110 && Poti1) Poti1--;
if(Poti2 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110) Poti2++; else if(Poti2 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] + 110 && Poti2) Poti2--;
if(Poti3 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110) Poti3++; else if(Poti3 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] + 110 && Poti3) Poti3--;
if(Poti4 < PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110) Poti4++; else if(Poti4 > PPM_in[EE_Parameter.Kanalbelegung[K_POTI4]] + 110 && Poti4) Poti4--;
//PPM24-Erweiterung (121007Kr)
if(Poti5 < PPM_in[9] + 110) Poti5++; else if(Poti5 > PPM_in[9] + 110 && Poti5) Poti5--;
if(Poti6 < PPM_in[10] + 110) Poti6++; else if(Poti6 > PPM_in[10] + 110 && Poti6) Poti6--;
if(Poti7 < PPM_in[11] + 110) Poti7++; else if(Poti7 > PPM_in[11] + 110 && Poti7) Poti7--;
if(Poti8 < PPM_in[12] + 110) Poti8++; else if(Poti8 > PPM_in[12] + 110 && Poti8) Poti8--;
if(Poti1 < 0) Poti1 = 0; else if(Poti1 > 255) Poti1 = 255;
if(Poti2 < 0) Poti2 = 0; else if(Poti2 > 255) Poti2 = 255;
if(Poti3 < 0) Poti3 = 0; else if(Poti3 > 255) Poti3 = 255;
if(Poti4 < 0) Poti4 = 0; else if(Poti4 > 255) Poti4 = 255;
//PPM24-Erweiterung (121007Kr)
if(Poti5 < 0) Poti5 = 0; else if(Poti5 > 255) Poti5 = 255;
if(Poti6 < 0) Poti6 = 0; else if(Poti6 > 255) Poti6 = 255;
if(Poti7 < 0) Poti7 = 0; else if(Poti7 > 255) Poti7 = 255;
if(Poti8 < 0) Poti8 = 0; else if(Poti8 > 255) Poti8 = 255;
}
 
//############################################################################
// Messwerte beim Ermitteln der Nullage
void CalibrierMittelwert(void)
//############################################################################
{
// ADC auschalten, damit die Werte sich nicht während der Berechnung ändern
ANALOG_OFF;
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--;
//PPM24-Erweiterung (121007Kr)
if(Poti5 < PPM_in[9] + 110) Poti5++; else if(Poti5 > PPM_in[9] + 110 && Poti5) Poti5--;
if(Poti6 < PPM_in[10] + 110) Poti6++; else if(Poti6 > PPM_in[10] + 110 && Poti6) Poti6--;
if(Poti7 < PPM_in[11] + 110) Poti7++; else if(Poti7 > PPM_in[11] + 110 && Poti7) Poti7--;
if(Poti8 < PPM_in[12] + 110) Poti8++; else if(Poti8 > PPM_in[12] + 110 && Poti8) Poti8--;
if(Poti1 < 0) Poti1 = 0; else if(Poti1 > 255) Poti1 = 255;
if(Poti2 < 0) Poti2 = 0; else if(Poti2 > 255) Poti2 = 255;
if(Poti3 < 0) Poti3 = 0; else if(Poti3 > 255) Poti3 = 255;
if(Poti4 < 0) Poti4 = 0; else if(Poti4 > 255) Poti4 = 255;
//PPM24-Erweiterung (121007Kr)
if(Poti5 < 0) Poti5 = 0; else if(Poti5 > 255) Poti5 = 255;
if(Poti6 < 0) Poti6 = 0; else if(Poti6 > 255) Poti6 = 255;
if(Poti7 < 0) Poti7 = 0; else if(Poti7 > 255) Poti7 = 255;
if(Poti8 < 0) Poti8 = 0; else if(Poti8 > 255) Poti8 = 255;
 
Umschlag180Nick = (long) EE_Parameter.WinkelUmschlagNick * 2500L;
Umschlag180Roll = (long) EE_Parameter.WinkelUmschlagRoll * 2500L; //(110208Kr)
}
 
//############################################################################
// Senden der Motorwerte per I2C-Bus
void SendMotorData(void)
//############################################################################
{
if(MOTOR_OFF || !MotorenEin)
{
Motor_Hinten = 0;
Motor_Vorne = 0;
Motor_Rechts = 0;
Motor_Links = 0;
if(MotorTest[0]) Motor_Vorne = MotorTest[0];
if(MotorTest[1]) Motor_Hinten = MotorTest[1];
if(MotorTest[2]) Motor_Links = MotorTest[2];
if(MotorTest[3]) Motor_Rechts = MotorTest[3];
}
 
// DebugOut.Analog[12] = Motor_Vorne;
// DebugOut.Analog[13] = Motor_Hinten;
// DebugOut.Analog[14] = Motor_Links;
// DebugOut.Analog[15] = Motor_Rechts;
 
//Start I2C Interrupt Mode
twi_state = 0;
motor = 0;
i2c_start();
}
 
 
 
//############################################################################
// Trägt ggf. das Poti als Parameter ein
void ParameterZuordnung(void)
//############################################################################
{
 
#define CHK_POTI(b,a,min,max) { if(a > 250) { if(a == 251) b = Poti1; else if(a == 252) b = Poti2; else if(a == 253) b = Poti3; else if(a == 254) b = Poti4;} else b = a; if(b <= min) b = min; else if(b >= max) b = max;}
CHK_POTI(Parameter_MaxHoehe,EE_Parameter.MaxHoehe,0,255);
CHK_POTI(Parameter_Luftdruck_D,EE_Parameter.Luftdruck_D,0,100);
CHK_POTI(Parameter_Hoehe_P,EE_Parameter.Hoehe_P,0,100);
CHK_POTI(Parameter_Hoehe_ACC_Wirkung,EE_Parameter.Hoehe_ACC_Wirkung,0,255);
CHK_POTI(Parameter_KompassWirkung,EE_Parameter.KompassWirkung,0,255);
CHK_POTI(Parameter_Gyro_P,EE_Parameter.Gyro_P,10,255);
CHK_POTI(Parameter_Gyro_I,EE_Parameter.Gyro_I,0,255);
CHK_POTI(Parameter_I_Faktor,EE_Parameter.I_Faktor,0,255);
CHK_POTI(Parameter_UserParam1,EE_Parameter.UserParam1,0,255);
CHK_POTI(Parameter_UserParam2,EE_Parameter.UserParam2,0,255);
CHK_POTI(Parameter_UserParam3,EE_Parameter.UserParam3,0,255);
CHK_POTI(Parameter_UserParam4,EE_Parameter.UserParam4,0,255);
CHK_POTI(Parameter_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);
 
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 unsigned int modell_fliegt = 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 < 0) GasMischanteil = 0;
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Emfang schlecht
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if(SenderOkay < 100)
{
if(!PcZugriff)
{
if(BeepMuster == 0xffff)
{
beeptime = 15000;
BeepMuster = 0x0c00;
}
}
if(RcLostTimer) RcLostTimer--;
else
{
MotorenEin = 0;
Notlandung = 0;
}
ROT_ON;
if(modell_fliegt > 2000) // wahrscheinlich in der Luft --> langsam absenken
{
GasMischanteil = EE_Parameter.NotGas;
Notlandung = 1;
PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] = 0;
PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] = 0;
PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] = 0;
}
else MotorenEin = 0;
}
else
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Emfang gut
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if(SenderOkay > 140)
{
Notlandung = 0;
RcLostTimer = EE_Parameter.NotGasZeit * 50;
if(GasMischanteil > 40)
{
if(modell_fliegt < 0xffff) modell_fliegt++;
modell_fliegt_gps = modell_fliegt;// (030907Kr)
}
if((modell_fliegt < 200) || (GasMischanteil < 40))
{
SummeNick = 0;
SummeRoll = 0;
Mess_Integral_Gier = 0;
Mess_Integral_Gier2 = 0;
}
if((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;
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], setting); // aktiven Datensatz merken
}
if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert?
{
if((MessLuftdruck > 950) || (MessLuftdruck < 750)) SucheLuftruckOffset();
}
ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE);
SetNeutral();
Piep(GetActiveParamSetNumber());
}
}
else
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;
}
}
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();
StickNick = (StickNick * 3 + PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_P) / 4;
StickNick += PPM_diff[EE_Parameter.Kanalbelegung[K_NICK]] * EE_Parameter.Stick_D;
StickRoll = (StickRoll * 3 + PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_P) / 4;
StickRoll += PPM_diff[EE_Parameter.Kanalbelegung[K_ROLL]] * EE_Parameter.Stick_D;
 
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--;
if(Notlandung) {MaxStickNick = 0; MaxStickRoll = 0;}
GyroFaktor = ((float)Parameter_Gyro_P + 10.0) / 256.0;
IntegralFaktor = ((float) Parameter_Gyro_I) / 44000;
 
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Digitale Steuerung per DubWise
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#define KEY_VALUE (Parameter_UserParam1 * 4) //(Poti3 * 8)
if(DubWiseKeys[1]) beeptime = 10;
if(DubWiseKeys[1] & DUB_KEY_UP) tmp_int = KEY_VALUE; else
if(DubWiseKeys[1] & DUB_KEY_DOWN) tmp_int = -KEY_VALUE; else tmp_int = 0;
ExternStickNick = (ExternStickNick * 7 + tmp_int) / 8;
if(DubWiseKeys[1] & DUB_KEY_LEFT) tmp_int = KEY_VALUE; else
if(DubWiseKeys[1] & DUB_KEY_RIGHT) tmp_int = -KEY_VALUE; else tmp_int = 0;
ExternStickRoll = (ExternStickRoll * 7 + tmp_int) / 8;
 
if(DubWiseKeys[0] & 8) ExternStickGier = 50;else
if(DubWiseKeys[0] & 4) ExternStickGier =-50;else ExternStickGier = 0;
if(DubWiseKeys[0] & 2) ExternHoehenValue++;
if(DubWiseKeys[0] & 16) ExternHoehenValue--;
 
StickNick += ExternStickNick / 8;
StickRoll += ExternStickRoll / 8;
StickGier += ExternStickGier;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Analoge Steuerung per Seriell
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if(ExternControl.Config & 0x01 && Parameter_UserParam1 > 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(EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) IntegralFaktor = 0;
if(GyroFaktor < 0) GyroFaktor = 0;
if(IntegralFaktor < 0) IntegralFaktor = 0;
 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// LED Stuff
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
LED1_TOTALTIME = Parameter_UserParam7;
LED1_ONTIME = Parameter_UserParam8;
LED1_OFF;
if(LED1_TOTALTIME >= 200)
{
LED1_ON;
blinkcount_LED1 = 0;
}
else if(blinkcount_LED1 >= LED1_TOTALTIME && LED1_TOTALTIME > 0 && MotorenEin == 1)
{
LED1_ON;
if(blinkcount_LED1 >= LED1_ONTIME + LED1_TOTALTIME)
{
LED1_OFF;
blinkcount_LED1 = 0;
}
}
blinkcount_LED1++;
 
//if(PPM_in[EE_Parameter.Kanalbelegung[K_POTI2]] > 75) LED1_ON; else LED1_OFF; //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr)
//if(PPM_in[EE_Parameter.Kanalbelegung[K_POTI3]] > 75) LED2_ON; else LED2_OFF; //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr)
 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Looping?
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if((PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > EE_Parameter.LoopThreshold) && EE_Parameter.LoopConfig & CFG_LOOP_LINKS) 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.LoopConfig & 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.LoopConfig & 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.LoopConfig & 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) beeptime = 100; //(110208Kr)
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 = 0.5; //entspricht Parameter_Gyro_P=118. Originalwert von Holger 0.1; //(040208Kr)
IntegralFaktor = 0.003; //entspricht Parameter_Gyro_I=132. Originalwert von Holger 0.005; //(040208Kr)
Looping_Roll = 0;
Looping_Nick = 0;
Poti3 = 77; //damit die GPS-Funktion auch bei schlechtem Empfang noch aktiv bleibt muss Poti3 > 70 sein //(050208Kr)
}
 
 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// 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;
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 > 15) || (MaxStickRoll > 15))
{
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)
{
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 > 15) || (MaxStickRoll > 15) || (abs(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]) > 25))
{
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;
 
 
//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;
//DebugOut.Analog[22] = MittelIntegralRoll / 26;
//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)
{
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;
if(cnt > EE_Parameter.Driftkomp) cnt = EE_Parameter.Driftkomp;
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)
{
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;
}
 
if(cnt > EE_Parameter.Driftkomp) cnt = EE_Parameter.Driftkomp;
if(IntegralFehlerRoll > FEHLER_LIMIT) AdNeutralRoll += cnt;
if(IntegralFehlerRoll < -FEHLER_LIMIT) AdNeutralRoll -= cnt;
//DebugOut.Analog[27] = ausgleichRoll;
//DebugOut.Analog[23] = AdNeutralNick;//10*(AdNeutralNick - StartNeutralNick);
//DebugOut.Analog[24] = 10*(AdNeutralRoll - StartNeutralRoll);
}
else
{
LageKorrekturRoll = 0;
LageKorrekturNick = 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(abs(StickGier) > 20) // war 35
{
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
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#ifdef MM3IS
if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV)
{
int w,v;
 
if (!updKompass--) // Aufruf mit ~10 Hz
{
KompassValue = heading_MM3();
KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180;
//die rechenaufwendig Neigungskompensierung "heading_MM3()" wird in der fc.c mit 10 Hz aufgerufen,
//die nicht rechenaufwendig Achsen werden mit ~125 Hz aktualisiert, also ~41 Hz pro Achse.
// durch updKompass wird festgelegt wie häufig der heading-Teil des Kompass berechnet wird (z.B. 50~ 10Hz; 100 ~ 5Hz)
updKompass = 50;
}
w = abs(IntegralNick /512); // mit zunehmender Neigung den Einfluss drosseln
v = abs(IntegralRoll /512);
if(v > w) w = v; // grösste Neigung ermitteln
if(w < 25 && NeueKompassRichtungMerken)
{
KompassStartwert = KompassValue;
NeueKompassRichtungMerken = 0;
}
w = (w * Parameter_KompassWirkung) / 64; // auf die Wirkung normieren
w = Parameter_KompassWirkung - w; // Wirkung ggf drosseln
if(w > 0)
{
Mess_Integral_Gier += (KompassRichtung * w) / 32; // nach Kompass ausrichten
}
}
#endif
 
#ifndef MM3IS
if(KompassValue && (EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV))
{
int w,v;
static int SignalSchlecht = 0;
w = abs(IntegralNick /512); // mit zunehmender Neigung den Einfluss drosseln
v = abs(IntegralRoll /512);
if(v > w) w = v; // grösste Neigung ermitteln
if(w < 25 && NeueKompassRichtungMerken && !SignalSchlecht)
{
KompassStartwert = KompassValue;
NeueKompassRichtungMerken = 0;
}
w = (w * Parameter_KompassWirkung) / 64; // auf die Wirkung normieren
w = Parameter_KompassWirkung - w; // Wirkung ggf drosseln
if(w > 0)
{
if(!SignalSchlecht) Mess_Integral_Gier += (KompassRichtung * w) / 32; // nach Kompass ausrichten
if(SignalSchlecht) SignalSchlecht--;
}
else SignalSchlecht = 500; // so lange das Signal taub stellen --> ca. 1 sek
}
 
#endif
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// GPS
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if(EE_Parameter.GlobalConfig & CFG_GPS_AKTIV)
{
if(Notlandung == 0)
{
P_GPS_Verstaerkung = Poti7;
D_GPS_Verstaerkung = Poti8;
ACC_GPS_Verstaerkung = 0; //Parameter_UserParam4;
//P_GPS_Verstaerkung = Parameter_UserParam5;
//D_GPS_Verstaerkung = Parameter_UserParam6;
}
if(Notlandung == 1)
{
//legt die GPS-Faktoren im Falle der Notlandung fest, damit toggelnde Potiwerte nicht stören können //(050208Kr)
P_GPS_Verstaerkung = 99;
D_GPS_Verstaerkung = 77;
ACC_GPS_Verstaerkung = 0;
}
//if(newData_navPosUtm == 1)
//{
gps_main();
//}
}
else
{
LED2_OFF;
GPS_Nick = 0;
GPS_Roll = 0;
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// 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] = P_GPS_Verstaerkung;
DebugOut.Analog[5] = D_GPS_Verstaerkung;
DebugOut.Analog[6] = Soll_Position_North;
DebugOut.Analog[7] = Soll_Position_East;
DebugOut.Analog[8] = KompassValue;
DebugOut.Analog[9] = UBat;
DebugOut.Analog[10] = SenderOkay;
DebugOut.Analog[11] = actualPos.GPSFix;
DebugOut.Analog[12] = (motor_rx[0]+motor_rx[1]+motor_rx[2]+motor_rx[3]); //Gesamtstrom
DebugOut.Analog[13] = actualPos.GSpeed; //Geschwindigkeit über Grund
DebugOut.Analog[14] = actualPos.northing;
DebugOut.Analog[15] = actualPos.easting;
DebugOut.Analog[16] = Poti3;
DebugOut.Analog[17] = actualPos.altitude;
DebugOut.Analog[18] = GPS_Home_North;
DebugOut.Analog[19] = GPS_Home_East;
DebugOut.Analog[20] = GPS_Positionsabweichung_North;
DebugOut.Analog[21] = GPS_Positionsabweichung_East;
DebugOut.Analog[22] = P_Einfluss_North;
DebugOut.Analog[23] = P_Einfluss_East;
DebugOut.Analog[24] = D_Einfluss_North;
DebugOut.Analog[25] = D_Einfluss_East;
DebugOut.Analog[26] = actualPos.velDown;
DebugOut.Analog[27] = StickGier;
DebugOut.Analog[28] = GPS_Nick;
DebugOut.Analog[29] = GPS_Roll;
DebugOut.Analog[30] = StickNick;
DebugOut.Analog[31] = StickRoll;
//DebugOut.Analog[xx] = motor_rx[0]; //Motorstrom vorne
//DebugOut.Analog[xx] = motor_rx[1]; //Motorstrom hinten
//DebugOut.Analog[xx] = motor_rx[2]; //Motorstrom links
//DebugOut.Analog[xx] = motor_rx[3]; //Motorstrom rechts
//DebugOut.Analog[xx] = actualPos.velNorth;
//DebugOut.Analog[xx] = actualPos.velEast;
//DebugOut.Analog[xx] = Parameter_UserParam3;
//DebugOut.Analog[xx] = Parameter_UserParam4;
//DebugOut.Analog[xx] = StickGier;
//DebugOut.Analog[xx] = GPS_North;
//DebugOut.Analog[xx] = GPS_East;
 
}
 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Drehgeschwindigkeit und -winkel zu einem Istwert zusammenfassen
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//DebugOut.Analog[26] = MesswertNick;
//DebugOut.Analog[28] = MesswertRoll;
 
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[25] = IntegralRoll * IntegralFaktor;
//DebugOut.Analog[31] = StickRoll;// / (26*IntegralFaktor);
//DebugOut.Analog[28] = MesswertRoll;
 
// Maximalwerte abfangen
#define MAX_SENSOR 2048
if(MesswertNick > MAX_SENSOR) MesswertNick = MAX_SENSOR;
if(MesswertNick < -MAX_SENSOR) MesswertNick = -MAX_SENSOR;
if(MesswertRoll > MAX_SENSOR) MesswertRoll = MAX_SENSOR;
if(MesswertRoll < -MAX_SENSOR) MesswertRoll = -MAX_SENSOR;
if(MesswertGier > MAX_SENSOR) MesswertGier = MAX_SENSOR;
if(MesswertGier < -MAX_SENSOR) MesswertGier = -MAX_SENSOR;
 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Höhenregelung
// Die Höhenregelung schwächt lediglich das Gas ab, erhöht es allerdings nicht
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//OCR0B = 180 - (Poti1 + 120) / 4;
//DruckOffsetSetting = OCR0B;
 
//der Höhenregler wird nun nur durchlaufen, wenn KEINE Notlandung vorliegt //(050208Kr)
if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) && Notlandung == 0) // Höhenregelung
{
int tmp_int;
if(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER) // Regler wird über Schalter gesteuert
{
if(Parameter_MaxHoehe < 50)
{
SollHoehe = HoehenWert - 40; // Parameter_MaxHoehe ist der PPM-Wert des Schalters
HoehenReglerAktiv = 0;
}
else
HoehenReglerAktiv = 1;
}
else
{
SollHoehe = ((int) ExternHoehenValue + (int) Parameter_MaxHoehe) * (int)EE_Parameter.Hoehe_Verstaerkung - 40;
HoehenReglerAktiv = 1;
}
 
if(Notlandung) SollHoehe = 0;
h = HoehenWert;
if((h > SollHoehe) && HoehenReglerAktiv) // zu hoch --> drosseln
{ h = ((h - SollHoehe) * (int) Parameter_Hoehe_P) / 16; // Differenz bestimmen --> P-Anteil
h = GasMischanteil - h; // vom Gas abziehen
h -= (HoeheD * Parameter_Luftdruck_D)/8; // D-Anteil
tmp_int = ((Mess_Integral_Hoch / 512) * (signed long) Parameter_Hoehe_ACC_Wirkung) / 32;
if(tmp_int > 50) tmp_int = 50;
else if(tmp_int < -50) tmp_int = -50;
h -= tmp_int;
hoehenregler = (hoehenregler*15 + h) / 16;
if(hoehenregler < EE_Parameter.Hoehe_MinGas) // nicht unter MIN
{
if(GasMischanteil >= EE_Parameter.Hoehe_MinGas) hoehenregler = EE_Parameter.Hoehe_MinGas;
if(GasMischanteil < EE_Parameter.Hoehe_MinGas) hoehenregler = GasMischanteil;
}
if(hoehenregler > GasMischanteil) hoehenregler = GasMischanteil; // nicht mehr als Gas
GasMischanteil = hoehenregler;
}
}
if(GasMischanteil > MAX_GAS - 20) GasMischanteil = MAX_GAS - 20;
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Mischer und PI-Regler
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// DebugOut.Analog[7] = GasMischanteil;
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Gier-Anteil
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#define MUL_G 1.0
GierMischanteil = MesswertGier - sollGier; // Regler für Gier
// GierMischanteil = 0;
 
if(GierMischanteil > (GasMischanteil / 2)) GierMischanteil = GasMischanteil / 2;
if(GierMischanteil < -(GasMischanteil / 2)) GierMischanteil = -(GasMischanteil / 2);
if(GierMischanteil > ((MAX_GAS - GasMischanteil))) GierMischanteil = ((MAX_GAS - GasMischanteil));
if(GierMischanteil < -((MAX_GAS - GasMischanteil))) GierMischanteil = -((MAX_GAS - GasMischanteil));
 
if(GasMischanteil < 20) GierMischanteil = 0;
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Nick-Achse
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
DiffNick = MesswertNick - (StickNick - GPS_Nick); // Differenz bestimmen
if(IntegralFaktor) SummeNick += IntegralNick * IntegralFaktor - (StickNick - GPS_Nick); // I-Anteil bei Winkelregelung
else SummeNick += DiffNick; // I-Anteil bei HH
if(SummeNick > 16000) SummeNick = 16000;
if(SummeNick < -16000) SummeNick = -16000;
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
if ((motorwert < 0)) motorwert = 0;
else if(motorwert > MAX_GAS) motorwert = MAX_GAS;
if (motorwert < MIN_GAS) motorwert = MIN_GAS;
Motor_Vorne = motorwert;
// Motor Heck
motorwert = GasMischanteil - pd_ergebnis + GierMischanteil;
if ((motorwert < 0)) motorwert = 0;
else if(motorwert > MAX_GAS) motorwert = MAX_GAS;
if (motorwert < MIN_GAS) motorwert = MIN_GAS;
Motor_Hinten = motorwert;
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Roll-Achse
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
DiffRoll = MesswertRoll - (StickRoll - GPS_Roll); // Differenz bestimmen
if(IntegralFaktor) SummeRoll += IntegralRoll * IntegralFaktor - (StickRoll - GPS_Roll);// I-Anteil bei Winkelregelung
else SummeRoll += DiffRoll; // I-Anteil bei HH
if(SummeRoll > 16000) SummeRoll = 16000;
if(SummeRoll < -16000) SummeRoll = -16000;
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;
#define GRENZE Poti1
 
if ((motorwert < 0)) motorwert = 0;
else if(motorwert > MAX_GAS) motorwert = MAX_GAS;
if (motorwert < MIN_GAS) motorwert = MIN_GAS;
Motor_Links = motorwert;
// Motor Rechts
motorwert = GasMischanteil - pd_ergebnis - GierMischanteil;
 
if ((motorwert < 0)) motorwert = 0;
else if(motorwert > MAX_GAS) motorwert = MAX_GAS;
if (motorwert < MIN_GAS) motorwert = MIN_GAS;
Motor_Rechts = motorwert;
// +++++++++++++++++++++++++++++++++++++++++++++++
}
 
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/fc.h
0,0 → 1,148
/*#######################################################################################
Flight Control
#######################################################################################*/
 
#ifndef _FC_H
#define _FC_H
 
extern volatile unsigned int I2CTimeout;
extern unsigned char Sekunde,Minute;
extern volatile long IntegralNick,IntegralNick2;
extern volatile long IntegralRoll,IntegralRoll2;
extern volatile long Mess_IntegralNick,Mess_IntegralNick2;
extern volatile long Mess_IntegralRoll,Mess_IntegralRoll2;
extern volatile long IntegralAccNick,IntegralAccRoll;
extern volatile long Mess_Integral_Hoch;
extern volatile long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2;
extern int KompassValue;
extern int KompassStartwert;
extern int KompassRichtung;
extern int HoehenWert;
extern int SollHoehe;
extern volatile int MesswertNick,MesswertRoll,MesswertGier;
extern volatile int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll;
extern volatile int NeutralAccX, NeutralAccY,Mittelwert_AccHoch;
extern volatile float NeutralAccZ;
extern 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 unsigned int modell_fliegt_gps;//(030907Kr)
extern unsigned char Notlandung;//(040208Kr)
 
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 long IntegralNick,IntegralNick2;
extern volatile long IntegralRoll,IntegralRoll2;
extern volatile long Integral_Gier;
extern volatile long Mess_IntegralNick,Mess_IntegralNick2;
extern volatile long Mess_IntegralRoll,Mess_IntegralRoll2;
extern volatile long Mess_Integral_Gier;
extern volatile int DiffNick,DiffRoll;
extern int Poti1, Poti2, Poti3, Poti4, Poti5, Poti6, Poti7, Poti8; //PPM24-Erweiterung (121007Kr)
extern volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count;
extern unsigned char MotorWert[5];
extern volatile unsigned char SenderOkay;
extern int StickNick,StickRoll,StickGier;
extern char MotorenEin;
extern void DefaultKonstanten1(void);
extern void DefaultKonstanten2(void);
extern void DefaultKonstanten3(void);
 
#define STRUCT_PARAM_LAENGE 71
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
 
//------------------------------------------------
unsigned char LoopConfig; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt
unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen
unsigned char Reserved[4];
char Name[12];
};
 
 
/*
unsigned char ServoNickMax; // Wert : 0-250
unsigned char ServoNickRefresh; //
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag
//------------------------------------------------
unsigned char LoopConfig; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt
unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen
unsigned char Reserved[4];
char Name[12];
*/
extern struct mk_param_struct EE_Parameter;
 
extern unsigned char Parameter_Luftdruck_D;
extern unsigned char Parameter_MaxHoehe;
extern unsigned char Parameter_Hoehe_P;
extern unsigned char Parameter_Hoehe_ACC_Wirkung;
extern unsigned char Parameter_KompassWirkung;
extern unsigned char Parameter_Gyro_P;
extern unsigned char Parameter_Gyro_I;
extern unsigned char Parameter_Gier_P;
extern unsigned char Parameter_ServoNickControl;
extern unsigned char Parameter_AchsKopplung1;
extern unsigned char Parameter_AchsGegenKopplung1;
 
 
#endif //_FC_H
 
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/flight.pnproj
0,0 → 1,0
<Project name="Flight-Ctrl"><File path="uart.h"></File><File path="main.c"></File><File path="main.h"></File><File path="makefile"></File><File path="uart.c"></File><File path="printf_P.h"></File><File path="printf_P.c"></File><File path="timer0.c"></File><File path="timer0.h"></File><File path="old_macros.h"></File><File path="twimaster.c"></File><File path="version.txt"></File><File path="twimaster.h"></File><File path="rc.c"></File><File path="rc.h"></File><File path="fc.h"></File><File path="fc.c"></File><File path="menu.h"></File><File path="menu.c"></File><File path="_Settings.h"></File><File path="analog.c"></File><File path="analog.h"></File><File path="GPS.c"></File><File path="gps.h"></File><File path="License.txt"></File><File path="eeprom.c"></File><File path="spi.h"></File><File path="spi.c"></File><File path="math.h"></File><File path="math.c"></File><File path="compass.h"></File><File path="compass.c"></File></Project>
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/flight.pnps
0,0 → 1,0
<pd><ViewState><e p="Flight-Ctrl" x="true"></e></ViewState></pd>
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/gps.h
0,0 → 1,29
extern long P_Einfluss_North;
extern long D_Einfluss_North;
 
extern long P_Einfluss_East;
extern long D_Einfluss_East;
 
extern long GPS_Positionsabweichung_North;
extern long GPS_Positionsabweichung_East;
 
extern long GPS_Home_North;
extern long GPS_Home_East;
 
extern long Soll_Position_North;
extern long Soll_Position_East;
 
extern long EAST_MITTEL;
extern long NORTH_MITTEL;
 
extern signed int GPS_North;
extern signed int GPS_East;
 
extern signed int GPS_Nick;
extern signed int GPS_Roll;
 
extern signed int GPS_Nick_ACC;
extern signed int GPS_Roll_ACC;
 
extern void gps_main(void);
 
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/main.c
0,0 → 1,278
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + 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"
#ifdef MM3IS
#include "compass.c"
#endif
// Reservierung im EEPROM
unsigned char EEPromArray[E2END+1] EEMEM; //Bugfix für sporadisch falsche Zuweisung des Nick-Kanals durch Nick666 EEPROM Verwendung (110308)
 
unsigned char PlatinenVersion = 10;
 
// -- Parametersatz aus EEPROM lesen ---
// number [0..5]
void ReadParameterSet(unsigned char number, unsigned char *buffer, unsigned char length)
{
if (number > 5) number = 5;
eeprom_read_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * number], length); //Bugfix für sporadisch falsche Zuweisung des Nick-Kanals durch Nick666 EEPROM Verwendung (110308)
}
 
 
// -- Parametersatz ins EEPROM schreiben ---
// number [0..5]
void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length)
{
if (number > 5) number = 5;
eeprom_write_block(buffer, &EEPromArray[EEPROM_ADR_PARAM_BEGIN + length * number], length); //Bugfix für sporadisch falsche Zuweisung des Nick-Kanals durch Nick666 EEPROM Verwendung (110308)
 
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], number); // diesen Parametersatz als aktuell merken
}
 
unsigned char GetActiveParamSetNumber(void)
{
unsigned char set;
set = eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET]);
if(set > 5)
{
set = 2;
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], set); // diesen Parametersatz als aktuell merken
}
return(set);
}
 
//############################################################################
//Hauptprogramm
int main (void)
//############################################################################
{
unsigned int timer;
 
//unsigned int timer2 = 0;
DDRB = 0x00;
PORTB = 0x00;
for(timer = 0; timer < 1000; timer++); // verzögern
if(PINB & 0x01) PlatinenVersion = 11; else PlatinenVersion = 10;
DDRC = 0x81; // SCL
#ifdef MM3IS
DDRC |= (1<<PC4); // PC4 als Ausgang, wird verwendet zur Umschaltung zwischen Bluetooth und GPS in Verbindung mit dem GPS/MM3-Board von Walter //(060208Kr)
#endif
PORTC = 0xff; // Pullup SDA
DDRB = 0x1B; // LEDs und Druckoffset
PORTB = 0x01; // LED_Rot
DDRD = 0x3E; // Speaker & TXD & J3 J4 J5
DDRD |=0x80; // J7
PORTD = 0xF7; // LED
MCUSR &=~(1<<WDRF);
WDTCSR |= (1<<WDCE)|(1<<WDE);
WDTCSR = 0;
 
beeptime = 2000;
 
StickGier = 0; PPM_in[K_GAS] = 0;StickRoll = 0; StickNick = 0;
 
ROT_OFF;
Timer_Init();
UART_Init();
#if defined (__AVR_ATmega644P__)
UART1_Init();
#endif
rc_sum_init();
ADC_Init();
i2c_init();
#ifdef MM3IS
init_MM3();
#endif
 
SPI_MasterInit();
sei();
 
VersionInfo.Hauptversion = VERSION_HAUPTVERSION;
VersionInfo.Nebenversion = VERSION_NEBENVERSION;
VersionInfo.PCKompatibel = VERSION_KOMPATIBEL;
printf("\n\rFlightControl\n\rHardware:%d.%d\n\rSoftware:V%d.%d%c ",PlatinenVersion/10,PlatinenVersion%10, VERSION_HAUPTVERSION, VERSION_NEBENVERSION,VERSION_INDEX + 'a');
printf("\n\r==============================");
GRN_ON;
 
#define EE_DATENREVISION 69 // wird angepasst, wenn sich die EEPROM-Daten geändert haben
if(eeprom_read_byte(&EEPromArray[EEPROM_ADR_VALID]) != EE_DATENREVISION)
{
printf("\n\rInit. EEPROM: Generiere Default-Parameter...");
DefaultKonstanten1();
for (unsigned char i=0;i<6;i++)
{
if(i==2) DefaultKonstanten2(); // Kamera
if(i==3) DefaultKonstanten3(); // Beginner
if(i>3) DefaultKonstanten2(); // Kamera
WriteParameterSet(i, (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE);
}
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], 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());
 
 
#ifdef MM3IS
//kurze Wartezeit (sonst reagiert die "Kompass kalibrieren?"-Abfrage nicht
timer = SetDelay(500);
while(!CheckDelay(timer));
//Kompass kalibrieren?
if(PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] > 100 && PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 100)
{
printf("\n\rKalibriere Kompass");
calib_MM3();
}
#endif
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;
while (1)
{
if (UpdateMotor) // ReglerIntervall
{
SPI_TransmitByte(); //#
UpdateMotor=0;
//PORTD |= 0x08;
MotorRegler();
 
//PORTD &= ~0x08;
SendMotorData();
ROT_OFF;
if(PcZugriff) PcZugriff--;
else
{
DubWiseKeys[0] = 0;
DubWiseKeys[1] = 0;
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)
{
DatenUebertragung();
BearbeiteRxDaten();
}
else BearbeiteRxDaten();
if(CheckDelay(timer))
{
if(UBat < EE_Parameter.UnterspannungsWarnung)
{
if(BeepMuster == 0xffff)
{
beeptime = 6000;
BeepMuster = 0x0300;
}
}
SPI_StartTransmitPacket();//#
timer = SetDelay(100);
}
//if(UpdateMotor) DebugOut.Analog[26]++;
}
}
return (1);
}
 
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/main.h
0,0 → 1,133
#ifndef _MAIN_H
#define _MAIN_H
 
//hier kann durch Auskommentierung zwischen CMPS03- und MM3-Kompass gewählt werden
#define MM3IS 1
 
//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
 
#if defined (__AVR_ATmega644P__)
#define SYSCLK 20000000L //Quarz Frequenz in Hz
//#define SYSCLK 16000000L //Quarz Frequenz in Hz
#endif
 
// neue Hardware
#define ROT_OFF {if(PlatinenVersion == 10) PORTB &=~0x01; else PORTB |= 0x01;}
#define ROT_ON {if(PlatinenVersion == 10) PORTB |= 0x01; else PORTB &=~0x01;}
#define ROT_FLASH PORTB ^= 0x01
#define GRN_OFF PORTB &=~0x02
#define GRN_ON PORTB |= 0x02
#define GRN_FLASH PORTB ^= 0x02
#define LED1_OFF PORTC &=~0x04 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch kann der Transistorausgang J16 geschaltet werden. // (160607Kr)
#define LED1_ON PORTC |= 0x04 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch kann der Transistorausgang J16 geschaltet werden. // (160607Kr)
#define LED1_FLASH PORTC ^= 0x04 //Erweiterung by 4ndreas aus mikrosvn branches // (280807Kr)
#define LED2_OFF PORTC &=~0x08 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch kann der Transistorausgang J17 geschaltet werden. // (160607Kr)
#define LED2_ON PORTC |= 0x08 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch kann der Transistorausgang J17 geschaltet werden. // (160607Kr)
#define LED2_FLASH PORTC ^= 0x08 //Erweiterung by 4ndreas aus mikrosvn branches // (280807Kr)
 
#ifdef MM3IS
#define SWITCH_BT_2_RX PORTC &=~0x10 //(PC4)dient zur Umschaltung zwischen Bluetooth und GPS in Verbindung mit dem GPS/MM3-Board von Walter //(050208Kr)
#define SWITCH_GPS_2_RX PORTC |= 0x10 //(PC4)dient zur Umschaltung zwischen Bluetooth und GPS in Verbindung mit dem GPS/MM3-Board von Walter //(050208Kr)
#endif
 
#define F_CPU SYSCLK
//#ifndef F_CPU
//#error ################## F_CPU nicht definiert oder ungültig #############
//#endif
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
#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_MM3_CALIB 10
 
#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 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;
 
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);
extern unsigned char EEPromArray[];
 
volatile int P_GPS_Verstaerkung; //P-Anteil (80-120)
volatile int D_GPS_Verstaerkung; //D-Anteil (90)
volatile int ACC_GPS_Verstaerkung; //ACC-Faktor
 
#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 "math.h"
 
#ifdef MM3IS
#include "compass.h"
#endif
 
 
#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/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/makefile
0,0 → 1,425
#--------------------------------------------------------------------
# MCU name
# hier kann durch Umkommentierung zwischen 644 OHNE und 644p MIT 2.Uart gewählt werden
MCU = atmega644
#MCU = atmega644p
F_CPU = 20000000
#-------------------------------------------------------------------
HAUPT_VERSION = 0
NEBEN_VERSION = 68
VERSION_INDEX = 3
 
VERSION_KOMPATIBEL = 7 # PC-Kompatibilität
#-------------------------------------------------------------------
 
ifeq ($(MCU), atmega32)
# FUSE_SETTINGS= -u -U lfuse:w:0xff:m -U hfuse:w:0xcf:m
 
HEX_NAME = MEGA32
endif
 
ifeq ($(MCU), atmega644)
FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m
#FUSE_SETTINGS = -U lfuse:w:0xff:m -U hfuse:w:0xdf:m
# -u bei neuen Controllern wieder einspielen
HEX_NAME = MEGA644
endif
 
ifeq ($(MCU), atmega644p)
FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m
HEX_NAME = MEGA644P
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_INDEX), 0)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION)a
endif
ifeq ($(VERSION_INDEX), 1)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION)b
endif
ifeq ($(VERSION_INDEX), 2)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION)c
endif
ifeq ($(VERSION_INDEX), 3)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION)d
endif
ifeq ($(VERSION_INDEX), 4)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION)e
endif
ifeq ($(VERSION_INDEX), 5)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION)f
endif
ifeq ($(VERSION_INDEX), 6)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION)g
endif
ifeq ($(VERSION_INDEX), 7)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION)h
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
SRC += math.c
##########################################################################################################
 
 
# List Assembler source files here.
# Make them always end in a capital .S. Files ending in a lowercase .s
# will not be considered source files but generated files (assembler
# output from the compiler), and will be deleted upon "make clean"!
# Even though the DOS/Win* filesystem matches both .s and .S the same,
# it will preserve the spelling of the filenames, and gcc itself does
# care about how the name is spelled on its command-line.
ASRC =
 
 
 
# List any extra directories to look for include files here.
# Each directory must be seperated by a space.
EXTRAINCDIRS =
 
 
# Optional compiler flags.
# -g: generate debugging information (for GDB, or for COFF conversion)
# -O*: optimization level
# -f...: tuning, see gcc manual and avr-libc documentation
# -Wall...: warning level
# -Wa,...: tell GCC to pass this to the assembler.
# -ahlms: create assembler listing
CFLAGS = -O$(OPT) \
-funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums \
-mtiny-stack -mcall-prologues \
-Wall -Wstrict-prototypes \
-Wa,-adhlns=$(<:.c=.lst) \
$(patsubst %,-I%,$(EXTRAINCDIRS))
 
 
# Set a "language standard" compiler flag.
# Unremark just one line below to set the language standard to use.
# gnu99 = C99 + GNU extensions. See GCC manual for more information.
#CFLAGS += -std=c89
#CFLAGS += -std=gnu89
#CFLAGS += -std=c99
CFLAGS += -std=gnu99
 
CFLAGS += -DVERSION_HAUPTVERSION=$(HAUPT_VERSION) -DVERSION_NEBENVERSION=$(NEBEN_VERSION) -DVERSION_KOMPATIBEL=$(VERSION_KOMPATIBEL) -DVERSION_INDEX=$(VERSION_INDEX)
 
 
# 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/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/math.c
0,0 → 1,111
/*
 
Copyright 2007, Niklas Nold
 
This program (files math.c and math.h) is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation;
either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
 
Please note: All the other files for the project "Mikrokopter" by H. Buss are under the license (license_buss.txt) published by www.mikrokopter.de
*/
 
#include "main.h"
 
 
const uint8_t pgm_atan[346] PROGMEM = {0,1,2,3,4,4,5,6,7,8,9,10,11,11,12,13,14,15,16,17,17,18,19,20,21,21,22,23,24,24,25,26,27,27,28,29,29,30,31,31,32,33,33,34,35,35,36,36,37,37,38,39,39,40,40,41,41,42,42,43,43,44,44,45,45,45,46,46,47,47,48,48,48,49,49,50,50,50,51,51,51,52,52,52,53,53,53,54,54,54,55,55,55,55,56,56,56,57,57,57,57,58,58,58,58,59,59,59,59,60,60,60,60,60,61,61,61,61,62,62,62,62,62,63,63,63,63,63,63,64,64,64,64,64,64,65,65,65,65,65,65,66,66,66,66,66,66,66,67,67,67,67,67,67,67,68,68,68,68,68,68,68,68,69,69,69,69,69,69,69,69,69,70,70,70,70,70,70,70,70,70,71,71,71,71,71,71,71,71,71,71,71,72,72,72,72,72,72,72,72,72,72,72,73,73,73,73,73,73,73,73,73,73,73,73,73,73,74,74,74,74,74,74,74,74,74,74,74,74,74,74,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79};
 
//############################################################################
// Arkustangens2 im Gradmaß
signed int atan2_i(signed int x, signed int y)
//############################################################################
{
int i,angle;
int8_t m;
if (!x && !y) return 0; //atan2 = 0 für x und y = 0
if (y < 0) m=-1;
else m=1;
if (!x) return (90*m); // atan2 = 90° für x = 0
i = abs(((long)y*64) / x); // Berechne i für die Lookup table (Schrittweite atan(x) ist 0,015625 -> y *64)
 
if (i<346) angle = pgm_read_byte(&pgm_atan[i]); // Lookup für 1° bis 79°
else if (i>7334) angle = 90; // Grenzwert ist 90°
else if (i>2444) angle = 89; // 89° bis 80° über Wertebereiche
else if (i>1465) angle = 88;
else if (i>1046) angle = 87;
else if (i>813) angle = 86;
else if (i>664) angle = 85;
else if (i>561) angle = 84;
else if (i>486) angle = 83;
else if (i>428) angle = 82;
else if (i>382) angle = 81;
else angle = 80; // (i>345)
if (x > 0) return (angle*m); // Quadrant I und IV
else if ((x < 0) && (m > 0)) return (-angle + 180); // Quadrant II
else return (angle - 180); // x < 0 && y < 0 Quadrant III
}
 
/*
const uint16_t pgm_sinus_i[91] PROGMEM = {
0, 18, 36, 54, 71, 89, 107, 125, 143, 160, 178, 195, 213, 230, 248,
265, 282, 299, 316, 333, 350, 367, 384, 400, 416, 433, 449, 465, 481, 496,
512, 527, 543, 558, 573, 587, 602, 616, 630, 644, 658, 672, 685, 698, 711,
724, 737, 749, 761, 773, 784, 796, 807, 818, 828, 839, 849, 859, 868, 878,
887, 896, 904, 912, 920, 928, 935, 943, 949, 956, 962, 968, 974, 979, 984,
989, 994, 998,1002,1005,1008,1011,1014,1016,1018,1020,1022,1023,1023,1024,
1024
}; //für div 1024 = div 2^10 = (>>10)
*/
const uint16_t pgm_sinus_i[91] PROGMEM = {
0,71,143,214,286,357,428,499,570,641,711,782,852,921,991,
1060,1129,1198,1266,1334,1401,1468,1534,1600,1666,1731,1796,1860,1923,1986,
2048,2110,2171,2231,2290,2349,2408,2465,2522,2578,2633,2687,2741,2793,2845,
2896,2946,2996,3044,3091,3138,3183,3228,3271,3314,3355,3396,3435,3474,3511,
3547,3582,3617,3650,3681,3712,3742,3770,3798,3824,3849,3873,3896,3917,3937,
3956,3974,3991,4006,4021,4034,4046,4056,4065,4074,4080,4086,4090,4094,4095,
4096
}; //für div 4096 = div 2^12 = (>>12)
//############################################################################
// Kosinusfunktion im Gradmaß
signed int cos_i(signed int winkel)
//############################################################################
{
return (sin_i(90-winkel));
}
 
//############################################################################
// Sinusfunktion im Gradmaß
signed int sin_i(signed int winkel)
//############################################################################
{
short int m,n;
signed int sinus;
if (winkel < 0)
{
m = -1;
winkel = abs(winkel);
}
else m = +1;
// Quadranten auswerten
if (winkel <= 90) n=1;
else if ((winkel > 90) && (winkel <= 180)) {winkel = 180 - winkel; n = 1;}
else if ((winkel > 180) && (winkel <= 270)) {winkel = winkel - 180; n = -1;}
else {winkel = 360 - winkel; n = -1;} //if ((winkel > 270) && (winkel <= 360))
 
sinus = pgm_read_word(&pgm_sinus_i[winkel]);
 
return (sinus*m*n);
}
 
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/math.h
0,0 → 1,8
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
#include "main.h"
 
extern signed int atan2_i(signed int x, signed int y);
extern signed int cos_i(signed int winkel);
extern signed int sin_i(signed int winkel);
 
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/menu.c
0,0 → 1,154
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Copyright (c) 04.2007 Holger Buss
// + only for non-profit use
// + www.MikroKopter.com
// + see the File "License.txt" for further Informations
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#include "main.h"
 
unsigned int TestInt = 0;
#define ARRAYGROESSE 10
unsigned char Array[ARRAYGROESSE] = {1,2,3,4,5,6,7,8,9,10};
char DisplayBuff[80] = "Hallo Welt";
unsigned char DispPtr = 0;
unsigned char RemoteTasten = 0;
 
#define KEY1 0x01
#define KEY2 0x02
#define KEY3 0x04
#define KEY4 0x08
#define KEY5 0x10
 
void LcdClear(void)
{
unsigned char i;
for(i=0;i<80;i++) DisplayBuff[i] = ' ';
}
 
void Menu(void)
{
 
#ifdef MM3IS
static unsigned char MaxMenue = 13, MenuePunkt=0;
#endif
#ifndef MM3IS
static unsigned char MaxMenue = 11, MenuePunkt=0;
#endif
if(RemoteTasten & KEY1) { if(MenuePunkt) MenuePunkt--; else MenuePunkt = MaxMenue; LcdClear(); RemotePollDisplayLine = -1; }
if(RemoteTasten & KEY2) { MenuePunkt++; LcdClear(); RemotePollDisplayLine = -1;}
if((RemoteTasten & KEY1) && (RemoteTasten & KEY2)) MenuePunkt = 0;
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_HAUPTVERSION, VERSION_NEBENVERSION,VERSION_INDEX+'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)",MesswertGier, AdNeutralGier);
}
else
{
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)",MesswertGier, AdNeutralGier/2);
}
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,"Po1: %3i Po5: %3i" ,Poti1,Poti5); //PPM24-Erweiterung (121007Kr)
LCD_printfxy(0,1,"Po2: %3i Po6: %3i" ,Poti2,Poti6); //PPM24-Erweiterung (121007Kr)
LCD_printfxy(0,2,"Po3: %3i Po7: %3i" ,Poti3,Poti7); //PPM24-Erweiterung (121007Kr)
LCD_printfxy(0,3,"Po4: %3i Po8: %3i" ,Poti4,Poti8); //PPM24-Erweiterung (121007Kr)
break;
case 10:
LCD_printfxy(0,0,"Servo " );
LCD_printfxy(0,1,"Setpoint %3i",Parameter_ServoNickControl);
LCD_printfxy(0,2,"Stellung: %3i",ServoValue);
LCD_printfxy(0,3,"Range:%3i-%3i",EE_Parameter.ServoNickMin,EE_Parameter.ServoNickMax);
break;
case 11:
LCD_printfxy(0,0,"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;
#ifdef MM3IS
case 12:
LCD_printfxy(0,0,"MM3 Offset");
LCD_printfxy(0,1,"X_Offset: %3i",MM3_calib.X_off);
LCD_printfxy(0,2,"Y_Offset: %3i",MM3_calib.Y_off);
LCD_printfxy(0,3,"Z_Offset: %3i",MM3_calib.Z_off);
break;
case 13:
LCD_printfxy(0,0,"MM3 Range");
LCD_printfxy(0,1,"X_Range: %4i",MM3_calib.X_range);
LCD_printfxy(0,2,"Y_Range: %4i",MM3_calib.Y_range);
LCD_printfxy(0,3,"Z_Range: %4i",MM3_calib.Z_range);
break;
#endif
default: MaxMenue = MenuePunkt - 1;
MenuePunkt = 0;
break;
}
RemoteTasten = 0;
}
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/menu.h
0,0 → 1,6
extern void Menu(void);
extern void LcdClear(void);
extern char DisplayBuff[80];
extern unsigned char DispPtr;
extern unsigned char RemoteTasten;
 
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/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/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/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/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/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/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/rc.c
0,0 → 1,87
/*#######################################################################################
Decodieren eines RC Summen Signals
#######################################################################################*/
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Copyright (c) 04.2007 Holger Buss
// + only for non-profit use
// + www.MikroKopter.com
// + see the File "License.txt" for further Informations
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
#include "rc.h"
#include "main.h"
 
volatile int PPM_in[15]; //PPM24-Erweiterung (121007Kr)
volatile int PPM_diff[15]; // das diffenzierte Stick-Signal //PPM24-Erweiterung (121007Kr)
volatile unsigned char NewPpmData = 1;
 
//############################################################################
//zum decodieren des PPM-Signals wird Timer1 mit seiner Input
//Capture Funktion benutzt:
void rc_sum_init (void)
//############################################################################
{
TCCR1B=(1<<CS11)|(1<<CS10)|(1<<ICES1)|(1<<ICNC1);//|(1 << WGM12); //timer1 prescale 64
 
// PWM
//TCCR1A = (1 << COM1B1) | (1 << WGM11) | (1 << WGM10);
//TCCR1B |= (1 << WGM12);
//OCR1B = 55;
TIMSK1 |= _BV(ICIE1);
AdNeutralGier = 0;
AdNeutralRoll = 0;
AdNeutralNick = 0;
return;
}
 
//############################################################################
//Diese Routine startet und inizialisiert den Timer für RC
SIGNAL(SIG_INPUT_CAPTURE1)
//############################################################################
 
{
static unsigned int AltICR=0;
signed int signal = 0,tmp;
static int index;
signal = (unsigned int) ICR1 - AltICR;
AltICR = ICR1;
//Syncronisationspause?
// if((signal > (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 < 14) //PPM24-Erweiterung (121007Kr)
{
if((signal > 250) && (signal < 687))
{
signal -= 466;
// Stabiles Signal
if(abs(signal - PPM_in[index]) < 6) { if(SenderOkay < 200) SenderOkay += 10;}
// tmp = (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
//J5 wird bei der FC_1.1 für die zweite UART verwendet, daher darf der Servokanal nicht an diesem Pin liegen
//if(index == 7) PORTD |= 0x08; else PORTD &= ~0x08; // Servosignal an J5 anlegen
}
}
}
 
 
 
 
 
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/rc.h
0,0 → 1,36
/*#######################################################################################
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
 
#if defined (__AVR_ATmega644P__)
//#define TIMER_TEILER CK64
#define TIMER_RELOAD_VALUE 250
//#define TIMER_TEILER CK256 // bei 20MHz
//#define TIMER_RELOAD_VALUE -78 // bei 20MHz
#endif
 
#define GAS PPM_in[2]
 
 
extern void rc_sum_init (void);
 
extern volatile int PPM_in[15]; //PPM24-Erweiterung (121007Kr)
extern volatile int PPM_diff[15]; // das diffenzierte Stick-Signal //PPM24-Erweiterung (121007Kr)
extern volatile unsigned char NewPpmData;
 
#endif //_RC_H
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/spi.c
0,0 → 1,113
// ######################## SPI - FlightCtrl ###################
#include "main.h"
 
 
struct str_ToNaviCtrl ToNaviCtrl;
struct str_FromNaviCtrl FromNaviCtrl;
unsigned char SPI_BufferIndex;
volatile unsigned char SPI_Buffer[sizeof(FromNaviCtrl)];
unsigned char *Ptr_buffer = (unsigned char *) &ToNaviCtrl;
 
unsigned char SPITransferCompleted, SPI_ChkSum;
#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<<SPIE); // Enable SPI, Master, set clock rate fck/64
SLAVE_SELECT_PORT |= (1 << SPI_SLAVE_SELECT);
SPITransferCompleted = 1;
ToNaviCtrl.Sync1 = 0x81;
ToNaviCtrl.Sync2 = 0x55;
ToNaviCtrl.Comp = 12;
ToNaviCtrl.IntegralNick = 12345;
ToNaviCtrl.IntegralRoll = 56789;
ToNaviCtrl.StickNick = 100;
ToNaviCtrl.StickRoll = 150;//(char) StickRoll;
ToNaviCtrl.StickGier = 200;//(char) StickGier;
}
 
//------------------------------------------------------
void SPI_StartTransmitPacket(void)
{
//if ((SLAVE_SELECT_PORT & (1 << SPI_SLAVE_SELECT)) == 0) return; // transfer of prev. packet not completed
if (!SPITransferCompleted) return;
SLAVE_SELECT_PORT &= ~(1 << SPI_SLAVE_SELECT); // SelectSlave
SPITransferCompleted = 0;
UpdateSPI_Buffer(); // update buffer
SPI_BufferIndex = 1;
DebugOut.Analog[16]++;
// -- Debug-Output ---
/* DebugOut.Analog[20] = FromNaviCtrl.Comp;
DebugOut.Analog[21] = FromNaviCtrl.GPS_Nick;
DebugOut.Analog[22] = FromNaviCtrl.GPS_Roll;
DebugOut.Analog[23] = FromNaviCtrl.CompassValue;
*/
//----
SPDR = ToNaviCtrl.Sync1; // Start transmission
ToNaviCtrl.ChkSum = ToNaviCtrl.Sync1;
}
 
//------------------------------------------------------
//SIGNAL(SIG_SPI)
void SPI_TransmitByte(void)
{
if (!(SPSR & (1 << SPIF))) return;
SLAVE_SELECT_PORT |= (1 << SPI_SLAVE_SELECT); // DeselectSlave
if (SPI_BufferIndex < sizeof(FromNaviCtrl))
{
SPI_Buffer[SPI_BufferIndex]= SPDR; // get data
// if (SPI_BufferIndex < 32 ) DebugOut.Analog[26+SPI_BufferIndex] = SPI_Buffer[SPI_BufferIndex];
//if(SPDR!= 0x00) DebugOut.Analog[19]++; ;
}
if (SPI_BufferIndex < sizeof(ToNaviCtrl))
{
asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop");
asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop");
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");
SPDR = Ptr_buffer[SPI_BufferIndex];
ToNaviCtrl.ChkSum += Ptr_buffer[SPI_BufferIndex];
}
else
{
unsigned char *ptr = (unsigned char *)&FromNaviCtrl;
SPITransferCompleted = 1;
memcpy(ptr, (unsigned char *) SPI_Buffer, sizeof(SPI_Buffer));
}
SPI_BufferIndex++;
}
 
//------------------------------------------------------
void UpdateSPI_Buffer(void)
{
/*static unsigned char i =0;
cli();
ToNaviCtrl.Comp = SPI_PROTOCOL_COMP;
ToNaviCtrl.IntegralNick = (int) (IntegralNick >> 4);
ToNaviCtrl.IntegralRoll = (int) (IntegralRoll >> 4);
ToNaviCtrl.StickNick = 4;
ToNaviCtrl.StickRoll = 5;//(char) StickRoll;
ToNaviCtrl.StickGier = 6;//(char) StickGier;
sei();
*/
}
 
#endif
 
 
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/spi.h
0,0 → 1,89
// ######################## SPI - FlightCtrl ###################
#ifndef _SPI_H
#define _SPI_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
 
struct str_ToNaviCtrl
{
unsigned char Sync1, Sync2;
unsigned char Comp;
int IntegralNick;
int IntegralRoll;
char StickNick,StickRoll,StickGier;
unsigned char ChkSum;
};
 
struct str_FromNaviCtrl
{
unsigned int Dummy;
unsigned char Comp;
int GPS_Nick;
int GPS_Roll;
int CompassValue;
};
 
#ifdef USE_SPI_COMMUNICATION
extern struct str_ToNaviCtrl ToNaviCtrl;
extern struct str_FromNaviCtrl FromNaviCtrl;
 
 
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/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/timer0.c
0,0 → 1,178
#include "main.h"
 
volatile unsigned int CountMilliseconds = 0;
volatile unsigned char UpdateMotor = 0;
volatile unsigned int beeptime = 0;
volatile unsigned int cntKompass = 0;
unsigned int BeepMuster = 0xffff;
int ServoValue = 0;
 
enum {
STOP = 0,
CK = 1,
CK8 = 2,
CK64 = 3,
CK256 = 4,
CK1024 = 5,
T0_FALLING_EDGE = 6,
T0_RISING_EDGE = 7
};
 
 
SIGNAL (SIG_OVERFLOW0) // 20MHz/8/256 = 9,765KHz
{
static unsigned char cnt_1ms = 1,cnt = 0;
unsigned char pieper_ein = 0;
// TCNT0 -= 250;//TIMER_RELOAD_VALUE;
 
if(!cnt--)
{
//***Info aus Email von Walter
//durch cnt kann die Updatefrequenz der Motoren beeinflusst werden. Bei cnt=9 sind es etwa 500hz.
//mit "cnt = 9;" sind es 488,28 Hz (alle 2,048 ms); (20000000 / 8 / 256 / 10 / 2)
//mit "cnt = 10;" nur noch 443,89 Hz (alle 2,253 ms); (20000000 / 8 / 256 / 11 / 2)
//***Info aus Email von Walter
 
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);
}
/* MM3 Magentometer 131207WM */
#ifdef MM3IS
//Abfrage um GPS_AKTIV erweitert, damit auch bei nur eingeschaltetem GPS OHNE Kompass der benötigte Kompassvalue berechnet wird (200907Kr)
if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV || EE_Parameter.GlobalConfig & CFG_GPS_AKTIV) timer0_MM3();
#endif
 
#ifndef MM3IS
//Abfrage um GPS_AKTIV erweitert, damit auch bei nur eingeschaltetem GPS OHNE Kompass der benötigte Kompassvalue berechnet wird (200907Kr)
if(EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV || EE_Parameter.GlobalConfig & CFG_GPS_AKTIV)
{
if(PINC & 0x10)
{
cntKompass++;
}
else
{
if((cntKompass) && (cntKompass < 4000))
{
KompassValue = cntKompass;
}
// if(cntKompass < 10) cntKompass = 10;
// KompassValue = (unsigned long)((unsigned long)(cntKompass-10)*720L + 1L) / 703L;
KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180;
cntKompass = 0;
}
}
#endif
 
}
 
 
void Timer_Init(void)
{
TCCR0B = CK8;
TCCR0A = (1<<COM0A1)|(1<<COM0B1)|3;//fast PWM
OCR0A = 0;
OCR0B = 120;
TCNT0 = (unsigned char)-TIMER_RELOAD_VALUE; // reload
//OCR1 = 0x00;
 
TCCR2A=(1<<COM2A1)|(1<<COM2A0)|3;
TCCR2B=(0<<CS20)|(1<<CS21)|(1<<CS22);
// TIMSK2 |= _BV(TOIE2);
TIMSK2 |= _BV(OCIE2A);
 
TIMSK0 |= _BV(TOIE0);
OCR2A = 10;
TCNT2 = 0;
}
 
// -----------------------------------------------------------------------
 
unsigned int SetDelay (unsigned int t)
{
// TIMSK0 &= ~_BV(TOIE0);
return(CountMilliseconds + t + 1);
// TIMSK0 |= _BV(TOIE0);
}
 
// -----------------------------------------------------------------------
char CheckDelay(unsigned int t)
{
// TIMSK0 &= ~_BV(TOIE0);
return(((t - CountMilliseconds) & 0x8000) >> 9);
// TIMSK0 |= _BV(TOIE0);
}
 
// -----------------------------------------------------------------------
void Delay_ms(unsigned int w)
{
unsigned int akt;
akt = SetDelay(w);
while (!CheckDelay(akt));
}
 
void Delay_ms_Mess(unsigned int w)
{
unsigned int akt;
akt = SetDelay(w);
while (!CheckDelay(akt)) ANALOG_ON;
}
 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Servo ansteuern
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SIGNAL(SIG_OUTPUT_COMPARE2A)
{
static unsigned char timer = 10;
if(!timer--)
{
TCCR2A=(1<<COM2A1)|(0<<COM2A0)|3;
ServoValue = Parameter_ServoNickControl;
if(EE_Parameter.ServoNickCompInvert & 0x01) ServoValue += ((long) EE_Parameter.ServoNickComp * (IntegralNick / 128)) / 512;
else ServoValue -= ((long) EE_Parameter.ServoNickComp * (IntegralNick / 128)) / 512;
if(ServoValue < EE_Parameter.ServoNickMin) ServoValue = EE_Parameter.ServoNickMin;
else if(ServoValue > EE_Parameter.ServoNickMax) ServoValue = EE_Parameter.ServoNickMax;
 
OCR2A = ServoValue;// + 75;
timer = EE_Parameter.ServoNickRefresh;
}
else
{
TCCR2A =3;
PORTD&=~0x80;
}
}
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/timer0.h
0,0 → 1,16
 
#define TIMER_TEILER CK8
#define TIMER_RELOAD_VALUE 250
 
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 int ServoValue;
extern unsigned int BeepMuster;
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/twimaster.c
0,0 → 1,152
/*############################################################################
############################################################################*/
 
#include "main.h"
 
unsigned char twi_state = 0;
unsigned char motor = 0;
unsigned char motorread = 0;
unsigned char motor_rx[8];
 
//############################################################################
//Initzialisieren der I2C (TWI) Schnittstelle
void i2c_init(void)
//############################################################################
{
TWSR = 0;
TWBR = ((SYSCLK/SCL_CLOCK)-16)/2;
}
 
//############################################################################
//Start I2C
char i2c_start(void)
//############################################################################
{
TWCR = (1<<TWSTA) | (1<<TWEN) | (1<<TWINT) | (1<<TWIE);
return(0);
}
 
//############################################################################
//Start I2C
void i2c_stop(void)
//############################################################################
{
TWCR = (1<<TWEN) | (1<<TWSTO) | (1<<TWINT);
}
 
void i2c_reset(void)
//############################################################################
{
i2c_stop();
twi_state = 0;
motor = TWDR;
motor = 0;
TWCR = 0x80;
TWAMR = 0;
TWAR = 0;
TWDR = 0;
TWSR = 0;
TWBR = 0;
i2c_init();
i2c_start();
i2c_write_byte(0);
}
 
//############################################################################
//Start I2C
char i2c_write_byte(char byte)
//############################################################################
{
TWSR = 0x00;
TWDR = byte;
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWIE);
return(0);
}
 
//############################################################################
//Start I2C
SIGNAL (TWI_vect)
//############################################################################
{
switch (twi_state++)
{
case 0:
i2c_write_byte(0x52+(motor*2));
break;
case 1:
switch(motor++)
{
case 0:
i2c_write_byte(Motor_Vorne);
break;
case 1:
i2c_write_byte(Motor_Hinten);
break;
case 2:
i2c_write_byte(Motor_Rechts);
break;
case 3:
i2c_write_byte(Motor_Links);
break;
}
break;
case 2:
i2c_stop();
if (motor<4) twi_state = 0;
else motor = 0;
i2c_start();
break;
//Liest Daten von Motor
case 3:
i2c_write_byte(0x53+(motorread*2));
break;
case 4:
switch(motorread)
{
case 0:
i2c_write_byte(Motor_Vorne);
break;
case 1:
i2c_write_byte(Motor_Hinten);
break;
case 2:
i2c_write_byte(Motor_Rechts);
break;
case 3:
i2c_write_byte(Motor_Links);
break;
}
break;
case 5: //1 Byte vom Motor lesen
motor_rx[motorread] = TWDR;
 
case 6:
switch(motorread)
{
case 0:
i2c_write_byte(Motor_Vorne);
break;
case 1:
i2c_write_byte(Motor_Hinten);
break;
case 2:
i2c_write_byte(Motor_Rechts);
break;
case 3:
i2c_write_byte(Motor_Links);
break;
}
break;
case 7: //2 Byte vom Motor lesen
motor_rx[motorread+4] = TWDR;
motorread++;
if (motorread>3) motorread=0;
i2c_stop();
I2CTimeout = 10;
twi_state = 0;
}
TWCR |= 0x80;
}
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/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 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/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/uart.c
0,0 → 1,719
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Copyright (c) 04.2007 Holger Buss
// + only for non-profit use
// + www.MikroKopter.com
// + see the File "License.txt" for further Informations
// +
// + GPS read out:
// + modified Version of the Pitschu Brushless Ufo - (c) Peter Schulten, Mülheim, Germany
// + only for non-profit use
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
#include "main.h"
#include "uart.h"
 
unsigned char DebugGetAnforderung = 0,DebugDisplayAnforderung = 0,DebugDataAnforderung = 0,GetVersionAnforderung = 0;
unsigned volatile char SioTmp = 0;
unsigned volatile char SendeBuffer[MAX_SENDE_BUFF];
unsigned volatile char RxdBuffer[MAX_EMPFANGS_BUFF];
unsigned volatile char NMEABuffer[MAX_EMPFANGS_BUFF];
unsigned volatile char NeuerDatensatzEmpfangen = 0;
unsigned volatile char NeueKoordinateEmpfangen = 0;
unsigned volatile char UebertragungAbgeschlossen = 1;
unsigned volatile char CntCrcError = 0;
unsigned volatile char AnzahlEmpfangsBytes = 0;
unsigned volatile char PC_DebugTimeout = 0;
unsigned char RemotePollDisplayLine = 0;
unsigned char NurKanalAnforderung = 0;
unsigned char DebugTextAnforderung = 255;
unsigned char PcZugriff = 100;
unsigned char MotorTest[4] = {0,0,0,0};
unsigned char DubWiseKeys[4] = {0,0,0,0};
unsigned char MeineSlaveAdresse;
unsigned char ConfirmFrame;
struct str_DebugOut DebugOut;
struct str_ExternControl ExternControl;
struct str_VersionInfo VersionInfo;
int Debug_Timer;
 
const unsigned char ANALOG_TEXT[32][16] =
{
//1234567890123456
"IntegralNick____", //00 //long
"IntegralRoll____", //01 //long
"AccNick_________", //02 //int
"AccRoll_________", //03 //int
"P_GPS_Faktor____", //04 //int
"D_GPS_Faktor____", //05 //int
"Soll_Pos_North__", //06 //long
"Soll_Pos_East___", //07 //long
"KompassValue____", //08 //int
"Spannung________", //09 //int
"Empfang_________", //10 //int
"GPSFix__________", //11 //int
"Gesamtstrom_____", //12 //char+char+char+char
"Geschwindigkeit_", //13 //long
"Pos.north_______", //14 //long
"Pos.east________", //15 //long
"Poti3___________", //16 //int
"Höhe_GPS________", //17 //long
"Home_North______", //18 //long
"Home_East_______", //19 //long
"Posabw_North____", //20 //long
"Posabw_East_____", //21 //long
"P_Einfluss_North", //22 //long
"P_Einfluss_East_", //23 //long
"D_Einfluss_North", //24 //long
"D_Einfluss_East_", //25 //long
"Vertical_speed__", //26 //long
"StickGier_______", //27 //int
"GPS_Nick________", //28 //int
"GPS_Roll________", //29 //int
"StickNick_______", //30 //int
"StickRoll_______" //31 //int
};
 
//***************************************************************************************
// GPS DEFINITION ANFANG
//***************************************************************************************
char newData_navPosUtm = 0; // Flag, wenn neue PosUtm-Daten vorliegen (211007Kr)
 
static uint8_t gpsState;
#define GPS_EMPTY 0
#define GPS_SYNC1 1
#define GPS_SYNC2 2
#define GPS_CLASS 3
#define GPS_LEN1 4
#define GPS_LEN2 5
#define GPS_FILLING 6
#define GPS_CKA 7
#define GPS_CKB 8
 
gpsInfo_t actualPos; // measured position (last gps record)
 
#define SYNC_CHAR1 0xb5
#define SYNC_CHAR2 0x62
 
#define CLASS_NAV 0x01
#define MSGID_STATUS 0x03
//#define MSGID_POSLLH 0x02 //(231107Kr)
#define MSGID_POSUTM 0x08
#define MSGID_VELNED 0x12
 
 
 
typedef struct {
unsigned long ITOW; // time of week
uint8_t GPSfix; // GPSfix Type, range 0..6
uint8_t Flags; // Navigation Status Flags
uint8_t DiffS; // Differential Status
uint8_t res; // reserved
unsigned long TTFF; // Time to first fix (millisecond time tag)
unsigned long MSSS; // Milliseconds since Startup / Reset
uint8_t packetStatus;
} NAV_STATUS_t;
 
/*
typedef struct { //(231107Kr)
unsigned long ITOW; // time of week
long LON; // longitude in 1e-07 deg
long LAT; // lattitude
long HEIGHT; // height in mm
long HMSL; // height above mean sea level im mm
unsigned long Hacc; // horizontal accuracy in mm
unsigned long Vacc; // vertical accuracy in mm
uint8_t packetStatus;
} NAV_POSLLH_t;
*/
 
typedef struct {
unsigned long ITOW; // time of week
long EAST; // cm UTM Easting
long NORTH; // cm UTM Nording
long ALT; // cm altitude
uint8_t ZONE; // UTM zone number
uint8_t HEM; // Hemisphere Indicator (0=North, 1=South)
uint8_t packetStatus;
} NAV_POSUTM_t;
 
 
typedef struct {
unsigned long ITOW; // ms GPS Millisecond Time of Week
long VEL_N; // cm/s NED north velocity
long VEL_E; // cm/s NED east velocity
long VEL_D; // cm/s NED down velocity
unsigned long Speed; // cm/s Speed (3-D)
unsigned long GSpeed; // cm/s Ground Speed (2-D)
long Heading; // deg (1e-05) Heading 2-D
unsigned long SAcc; // cm/s Speed Accuracy Estimate
unsigned long CAcc; // deg Course / Heading Accuracy Estimate
uint8_t packetStatus;
} NAV_VELNED_t;
 
 
 
NAV_STATUS_t navStatus;
//NAV_POSLLH_t navPosLlh; //(231107Kr)
NAV_POSUTM_t navPosUtm;
NAV_VELNED_t navVelNed;
 
volatile char *ubxP, *ubxEp, *ubxSp; // pointers to packet currently transfered
volatile uint8_t CK_A, CK_B; // UBX checksum bytes
volatile unsigned short msgLen;
volatile uint8_t msgID;
volatile uint8_t ignorePacket; // true when previous packet was not processed
 
//***************************************************************************************
// GPS DEFINITION ENDE
//***************************************************************************************
 
#if defined (__AVR_ATmega644P__)
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++ Sende-Part der Datenübertragung an zweiten UART
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SIGNAL(SIG_USART1_TRANS)
{
 
 
 
}
#endif
 
#if defined (__AVR_ATmega644P__)
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++ Empfangs-Part der Datenübertragung von zweitem UART
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SIGNAL(SIG_USART1_RECV)
{
 
 
 
}
#endif
 
 
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++ Sende-Part der Datenübertragung
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SIGNAL(INT_VEC_TX)
{
static unsigned int ptr = 0;
unsigned char tmp_tx;
if(!UebertragungAbgeschlossen)
{
ptr++; // die [0] wurde schon gesendet
tmp_tx = SendeBuffer[ptr];
if((tmp_tx == '\r') || (ptr == MAX_SENDE_BUFF))
{
ptr = 0;
UebertragungAbgeschlossen = 1;
}
UDR = tmp_tx;
}
else ptr = 0;
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++ GPS, schreibt die letzten Messwerte auf die globalen Variablen ANFANG
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
void GPSscanData (void)
{
 
 
 
if (navStatus.packetStatus == 1) // valid packet
{
actualPos.GPSFix = navStatus.GPSfix;
actualPos.newData = navStatus.packetStatus;
navStatus.packetStatus = 0;
}
/*
if (navPosLlh.packetStatus == 1) // valid packet
{
actualPos.longi = navPosLlh.LON; //(231107Kr)
actualPos.lati = navPosLlh.LAT; //(231107Kr)
actualPos.height = navPosLlh.HEIGHT; //(231107Kr)
navPosLlh.packetStatus = 0;
}
*/
 
if (navPosUtm.packetStatus == 1) // valid packet
{
actualPos.northing = navPosUtm.NORTH;
actualPos.easting = navPosUtm.EAST;
actualPos.altitude = navPosUtm.ALT;
navPosUtm.packetStatus = 0;
newData_navPosUtm = 1; // (211007Kr)
ROT_ON; // Rot blinkt in der Frequenz mit der neue UTM-Daten des GPS Empfänger ankommen und brauchbar sind //(211107Kr)
}
 
 
if (navVelNed.packetStatus == 1) // valid packet
{
actualPos.velNorth = navVelNed.VEL_N;
actualPos.velEast = navVelNed.VEL_E;
actualPos.velDown = navVelNed.VEL_D;
actualPos.GSpeed = navVelNed.GSpeed; //Geschwindigkeit [cm/s] über Grund (151007Kr)
navVelNed.packetStatus = 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;
 
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++ GPS AN UART_0 AUSWERTUNG ANFANG
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
uint8_t c;
uint8_t re;
 
re = (UCSR0A & (_B1(FE0) | _B1(DOR0))); // any error occured ?
c = SioTmp;
 
 
if (re == 0)
{
switch (gpsState)
{
case GPS_EMPTY:
if (c == SYNC_CHAR1)
gpsState = GPS_SYNC1;
break;
case GPS_SYNC1:
if (c == SYNC_CHAR2)
gpsState = GPS_SYNC2;
else if (c != SYNC_CHAR1)
gpsState = GPS_EMPTY;
break;
case GPS_SYNC2:
if (c == CLASS_NAV)
gpsState = GPS_CLASS;
else
gpsState = GPS_EMPTY;
break;
case GPS_CLASS: // msg ID seen: init packed receive
msgID = c;
CK_A = CLASS_NAV + c;
CK_B = CLASS_NAV + CK_A;
gpsState = GPS_LEN1;
 
switch (msgID)
{
case MSGID_STATUS:
ubxP = (char*)&navStatus;
ubxEp = (char*)(&navStatus + sizeof(NAV_STATUS_t));
ubxSp = (char*)&navStatus.packetStatus;
ignorePacket = navStatus.packetStatus;
break;
/*
case MSGID_POSLLH: //(231107Kr)
ubxP = (char*)&navPosLlh;
ubxEp = (char*)(&navPosLlh + sizeof(NAV_POSLLH_t));
ubxSp = (char*)&navPosLlh.packetStatus;
ignorePacket = navPosLlh.packetStatus;
break;
*/
case MSGID_POSUTM:
ubxP = (char*)&navPosUtm;
ubxEp = (char*)(&navPosUtm + sizeof(NAV_POSUTM_t));
ubxSp = (char*)&navPosUtm.packetStatus;
ignorePacket = navPosUtm.packetStatus;
break;
case MSGID_VELNED:
ubxP = (char*)&navVelNed;
ubxEp = (char*)(&navVelNed + sizeof(NAV_VELNED_t));
ubxSp = (char*)&navVelNed.packetStatus;
ignorePacket = navVelNed.packetStatus;
break;
default:
ignorePacket = 1;
ubxSp = (char*)0;
}
break;
case GPS_LEN1: // first len byte
msgLen = c;
CK_A += c;
CK_B += CK_A;
gpsState = GPS_LEN2;
break;
case GPS_LEN2: // second len byte
msgLen = msgLen + (c * 256);
CK_A += c;
CK_B += CK_A;
gpsState = GPS_FILLING; // next data will be stored in packet struct
break;
case GPS_FILLING:
CK_A += c;
CK_B += CK_A;
 
if ( !ignorePacket && ubxP < ubxEp)
*ubxP++ = c;
 
if (--msgLen == 0)
gpsState = GPS_CKA;
break;
case GPS_CKA:
if (c == CK_A)
gpsState = GPS_CKB;
else
gpsState = GPS_EMPTY;
break;
case GPS_CKB:
if (c == CK_B && ubxSp) // No error -> packet received successfully
*ubxSp = 1; // set packetStatus in struct
gpsState = GPS_EMPTY; // ready for next packet
break;
default:
gpsState = GPS_EMPTY; // ready for next packet
}
}
else // discard any data if error occured
{
gpsState = GPS_EMPTY;
}
GPSscanData ();
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++ GPS AN UART_0 AUSWERTUNG ENDE
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
if(buf_ptr >= MAX_EMPFANGS_BUFF) UartState = 0;
if(SioTmp == '\r' && UartState == 2)
{
UartState = 0;
crc -= RxdBuffer[buf_ptr-2];
crc -= RxdBuffer[buf_ptr-1];
crc %= 4096;
crc1 = '=' + crc / 64;
crc2 = '=' + crc % 64;
CrcOkay = 0;
if((crc1 == RxdBuffer[buf_ptr-2]) && (crc2 == RxdBuffer[buf_ptr-1])) CrcOkay = 1; else { CrcOkay = 0; CntCrcError++;};
if(!NeuerDatensatzEmpfangen && CrcOkay) // Datensatz schon verarbeitet
{
NeuerDatensatzEmpfangen = 1;
AnzahlEmpfangsBytes = buf_ptr;
RxdBuffer[buf_ptr] = '\r';
if(RxdBuffer[2] == 'R') wdt_enable(WDTO_250MS); // Reset-Commando
}
}
else
switch(UartState)
{
case 0:
if(SioTmp == '#' && !NeuerDatensatzEmpfangen) UartState = 1; // Startzeichen und Daten schon verarbeitet
buf_ptr = 0;
RxdBuffer[buf_ptr++] = SioTmp;
crc = SioTmp;
break;
case 1: // Adresse auswerten
UartState++;
RxdBuffer[buf_ptr++] = SioTmp;
crc += SioTmp;
break;
case 2: // Eingangsdaten sammeln
RxdBuffer[buf_ptr] = SioTmp;
if(buf_ptr < MAX_EMPFANGS_BUFF) buf_ptr++;
else UartState = 0;
crc += SioTmp;
break;
default:
UartState = 0;
break;
}
}
 
 
// --------------------------------------------------------------------------
void AddCRC(unsigned int wieviele)
{
unsigned int tmpCRC = 0,i;
for(i = 0; i < wieviele;i++)
{
tmpCRC += SendeBuffer[i];
}
tmpCRC %= 4096;
SendeBuffer[i++] = '=' + tmpCRC / 64;
SendeBuffer[i++] = '=' + tmpCRC % 64;
SendeBuffer[i++] = '\r';
UebertragungAbgeschlossen = 0;
UDR = SendeBuffer[0];
}
 
 
 
// --------------------------------------------------------------------------
void SendOutData(unsigned char cmd,unsigned char modul, unsigned char *snd, unsigned char len)
{
unsigned int pt = 0;
unsigned char a,b,c;
unsigned char ptr = 0;
 
SendeBuffer[pt++] = '#'; // Startzeichen
SendeBuffer[pt++] = modul; // Adresse (a=0; b=1,...)
SendeBuffer[pt++] = cmd; // Commando
 
while(len)
{
if(len) { a = snd[ptr++]; len--;} else a = 0;
if(len) { b = snd[ptr++]; len--;} else b = 0;
if(len) { c = snd[ptr++]; len--;} else c = 0;
SendeBuffer[pt++] = '=' + (a >> 2);
SendeBuffer[pt++] = '=' + (((a & 0x03) << 4) | ((b & 0xf0) >> 4));
SendeBuffer[pt++] = '=' + (((b & 0x0f) << 2) | ((c & 0xc0) >> 6));
SendeBuffer[pt++] = '=' + ( c & 0x3f);
}
AddCRC(pt);
}
 
 
// --------------------------------------------------------------------------
void Decode64(unsigned char *ptrOut, unsigned char len, unsigned char ptrIn,unsigned char max) // Wohin mit den Daten; Wie lang; Wo im RxdBuffer
{
unsigned char a,b,c,d;
unsigned char ptr = 0;
unsigned char x,y,z;
while(len)
{
a = RxdBuffer[ptrIn++] - '=';
b = RxdBuffer[ptrIn++] - '=';
c = RxdBuffer[ptrIn++] - '=';
d = RxdBuffer[ptrIn++] - '=';
if(ptrIn > max - 2) break; // nicht mehr Daten verarbeiten, als empfangen wurden
 
x = (a << 2) | (b >> 4);
y = ((b & 0x0f) << 4) | (c >> 2);
z = ((c & 0x03) << 6) | d;
 
if(len--) ptrOut[ptr++] = x; else break;
if(len--) ptrOut[ptr++] = y; else break;
if(len--) ptrOut[ptr++] = z; else break;
}
 
}
 
// --------------------------------------------------------------------------
void BearbeiteRxDaten(void)
{
if(!NeuerDatensatzEmpfangen) return;
 
// unsigned int tmp_int_arr1[1];
// unsigned int tmp_int_arr2[2];
// unsigned int tmp_int_arr3[3];
unsigned char tmp_char_arr2[2];
// unsigned char tmp_char_arr3[3];
// unsigned char tmp_char_arr4[4];
//if(!MotorenEin)
PcZugriff = 255;
switch(RxdBuffer[2])
{
case 'a':// Texte der Analogwerte
Decode64((unsigned char *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes);
DebugTextAnforderung = tmp_char_arr2[0];
break;
case 'b':
Decode64((unsigned char *) &ExternControl,sizeof(ExternControl),3,AnzahlEmpfangsBytes);
RemoteTasten |= ExternControl.RemoteTasten;
ConfirmFrame = ExternControl.Frame;
break;
case 'c':
Decode64((unsigned char *) &ExternControl,sizeof(ExternControl),3,AnzahlEmpfangsBytes);
RemoteTasten |= ExternControl.RemoteTasten;
ConfirmFrame = ExternControl.Frame;
DebugDataAnforderung = 1;
break;
case 'h':// x-1 Displayzeilen
Decode64((unsigned char *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes);
RemoteTasten |= tmp_char_arr2[0];
if(tmp_char_arr2[1] == 255) NurKanalAnforderung = 1; else NurKanalAnforderung = 0; // keine Displaydaten
DebugDisplayAnforderung = 1;
break;
case 't':// Motortest
Decode64((unsigned char *) &MotorTest[0],sizeof(MotorTest),3,AnzahlEmpfangsBytes);
break;
case 'k':// Keys von DubWise
Decode64((unsigned char *) &DubWiseKeys[0],sizeof(DubWiseKeys),3,AnzahlEmpfangsBytes);
ConfirmFrame = DubWiseKeys[3];
break;
case 'v': // Version-Anforderung und Ausbaustufe
GetVersionAnforderung = 1;
break;
case 'g':// "Get"-Anforderung für Debug-Daten
// Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen
DebugGetAnforderung = 1;
break;
case 'q':// "Get"-Anforderung für Settings
// Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen
Decode64((unsigned char *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes);
if(tmp_char_arr2[0] != 0xff)
{
if(tmp_char_arr2[0] > 5) tmp_char_arr2[0] = 5;
ReadParameterSet(tmp_char_arr2[0], (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE);
SendOutData('L' + tmp_char_arr2[0] -1,MeineSlaveAdresse,(unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE);
}
else
SendOutData('L' + GetActiveParamSetNumber()-1,MeineSlaveAdresse,(unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE);
break;
case 'l':
case 'm':
case 'n':
case 'o':
case 'p': // Parametersatz speichern
Decode64((unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE,3,AnzahlEmpfangsBytes);
WriteParameterSet(RxdBuffer[2] - 'l' + 1, (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE);
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], RxdBuffer[2] - 'l' + 1); // aktiven Datensatz merken
Umschlag180Nick = (long) EE_Parameter.WinkelUmschlagNick * 2500L;
Umschlag180Roll = (long) EE_Parameter.WinkelUmschlagRoll * 2500L;
Piep(GetActiveParamSetNumber());
break;
}
// DebugOut.AnzahlZyklen = Debug_Timer_Intervall;
NeuerDatensatzEmpfangen = 0;
}
 
//############################################################################
//Routine für die Serielle Ausgabe
int uart_putchar (char c)
//############################################################################
{
if (c == '\n')
uart_putchar('\r');
//Warten solange bis Zeichen gesendet wurde
loop_until_bit_is_set(USR, UDRE);
//Ausgabe des Zeichens
UDR = c;
return (0);
}
 
// --------------------------------------------------------------------------
void WriteProgramData(unsigned int pos, unsigned char wert)
{
//if (ProgramLocation == IN_RAM) Buffer[pos] = wert;
// else eeprom_write_byte(&EE_Buffer[pos], wert);
// Buffer[pos] = wert;
}
 
//############################################################################
//INstallation der Seriellen Schnittstelle
void UART_Init (void)
//############################################################################
{
//Enable TXEN im Register UCR TX-Data Enable & RX Enable
 
UCR=(1 << TXEN) | (1 << RXEN);
// UART Double Speed (U2X)
USR |= (1<<U2X);
// RX-Interrupt Freigabe
UCSRB |= (1<<RXCIE);
// TX-Interrupt Freigabe
UCSRB |= (1<<TXCIE);
 
//Teiler wird gesetzt
UBRR=(SYSCLK / (BAUD_RATE * 8L) - 1);
//UBRR = 33;
//öffnet einen Kanal für printf (STDOUT)
//fdevopen (uart_putchar, 0);
//sbi(PORTD,4);
Debug_Timer = SetDelay(200);
gpsState = GPS_EMPTY;
}
 
#if defined (__AVR_ATmega644P__)
//############################################################################
//INstallation der 2ten Seriellen Schnittstelle
void UART1_Init (void)
//############################################################################
{
//Enable TXEN im Register UCR TX-Data Enable & RX Enable
 
UCSR1B=(1 << TXEN1) | (1 << RXEN1);
// UART Double Speed (U2X)
UCSR1A |= (1<<U2X1);
// RX-Interrupt Freigabe
UCSR1B |= (1<<RXCIE1);
// TX-Interrupt Freigabe
UCSR1B |= (1<<TXCIE1);
 
//Teiler wird gesetzt
UBRR1L=(SYSCLK / (BAUD_RATE1 * 8L) - 1);
//UBRR1L = 33;
//öffnet einen Kanal für printf (STDOUT)
//fdevopen (uart_putchar, 0);
//sbi(PORTD,4);
Debug_Timer = SetDelay(200);
}
#endif
 
//---------------------------------------------------------------------------------------------
void DatenUebertragung(void)
{
if(!UebertragungAbgeschlossen) return;
 
if(DebugGetAnforderung && UebertragungAbgeschlossen) // Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen
{
SendOutData('G',MeineSlaveAdresse,(unsigned char *) &ExternControl,sizeof(ExternControl));
DebugGetAnforderung = 0;
}
 
if((CheckDelay(Debug_Timer) || DebugDataAnforderung) && UebertragungAbgeschlossen)
{
SendOutData('D',MeineSlaveAdresse,(unsigned char *) &DebugOut,sizeof(DebugOut));
DebugDataAnforderung = 0;
Debug_Timer = SetDelay(MIN_DEBUG_INTERVALL);
}
if(DebugTextAnforderung != 255) // Texte für die Analogdaten
{
SendOutData('A',DebugTextAnforderung + '0',(unsigned char *) ANALOG_TEXT[DebugTextAnforderung],16);
DebugTextAnforderung = 255;
}
if(ConfirmFrame && UebertragungAbgeschlossen) // Datensatz ohne CRC bestätigen
{
SendeBuffer[0] = '#';
SendeBuffer[1] = ConfirmFrame;
SendeBuffer[2] = '\r';
UebertragungAbgeschlossen = 0;
ConfirmFrame = 0;
UDR = SendeBuffer[0];
}
if(DebugDisplayAnforderung && UebertragungAbgeschlossen)
{
Menu();
DebugDisplayAnforderung = 0;
if(++RemotePollDisplayLine == 4 || NurKanalAnforderung)
{
SendOutData('4',0,(unsigned char *)&PPM_in,sizeof(PPM_in)); // DisplayZeile übertragen
RemotePollDisplayLine = -1;
}
else SendOutData('0' + RemotePollDisplayLine,0,(unsigned char *)&DisplayBuff[20 * RemotePollDisplayLine],20); // DisplayZeile übertragen
}
if(GetVersionAnforderung && UebertragungAbgeschlossen)
{
SendOutData('V',MeineSlaveAdresse,(unsigned char *) &VersionInfo,sizeof(VersionInfo));
GetVersionAnforderung = 0;
}
 
}
 
/branches/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/uart.h
0,0 → 1,161
#ifndef _UART_H
#define _UART_H
 
#define MAX_SENDE_BUFF 150
#define MAX_EMPFANGS_BUFF 150
#define DUB_KEY_UP 4
#define DUB_KEY_DOWN 8
#define DUB_KEY_RIGHT 32
#define DUB_KEY_LEFT 16
#define DUB_KEY_FIRE 64
 
 
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;
extern void UART_Init (void);
#if defined (__AVR_ATmega644P__)
extern void UART1_Init (void);
#endif
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];
extern unsigned char DubWiseKeys[4];
struct str_DebugOut
{
unsigned char Digital[2];
unsigned int Analog[32]; // Debugwerte
};
 
extern struct str_DebugOut DebugOut;
 
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++ GPS DEFINITION ANFANG
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
extern char newData_navPosUtm; // (211007Kr)
 
#define _B1(bit) (1 << (bit))
#define _B0(bit) (0 << (bit))
 
typedef struct
{
long northing; // in cm (+ = north)
long easting; // in cm (+ = east)
long altitude; // in cm
long velNorth;
long velEast;
long velDown;
long GSpeed; //(151007Kr)
uint8_t newData; // status of data: 0 = invlid; 1 = valid
uint8_t GPSFix;
uint8_t noSV; // number of sats
} gpsInfo_t;
 
 
extern gpsInfo_t actualPos; // measured position (last gps record)
 
extern void GPSscanData (void);
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++ GPS DEFINITION ENDE
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
 
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 Hauptversion;
unsigned char Nebenversion;
unsigned char PCKompatibel;
unsigned char Rserved[7];
};
extern struct str_VersionInfo VersionInfo;
 
//Die Baud_Rate der Seriellen Schnittstelle ist 9600 Baud
//#define BAUD_RATE 9600 //Baud Rate für die Serielle Schnittstelle
//#define BAUD_RATE 14400 //Baud Rate für die Serielle Schnittstelle
//#define BAUD_RATE 28800 //Baud Rate für die Serielle Schnittstelle
//#define BAUD_RATE 38400 //Baud Rate für die Serielle Schnittstelle
#define BAUD_RATE 57600 //Baud Rate für die Serielle Schnittstelle
#define BAUD_RATE1 57600 //Baud Rate für UART2 (nur auf 644P)
 
//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
 
#if defined (__AVR_ATmega644P__)
# 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/Flight-Ctrl_V0_xx_GPS_Joko/my_Flight-Ctrl_V0_68d_4_GPS_CMPS_MM3FP_FREEUART/version.txt
0,0 → 1,139
 
-------
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
 
 
MODDS:
- LED1 und LED2 Ansteuerung, blinkende LED_1 für Positionsleuchten (einstellbar über Userparam 7 und 8)
- GPS wird deaktiviert und Summer eingeschaltet, wenn kein 3D-Fix (mehr) vorhanden
- GPS-Statusanzeige auf eine LED reduziert (aus, blinkend, an)
- Homing-Fkt. eingebaut
- dyn. Position Hold -> normaler Rundflug möglich
- Die Berechnung von Kompassvalue wird jetzt auch über den GPS Haken im Koptertool aktiviert
- 12 Kanal Erweiterung (rc.c; rc.h; fc.c; fc.h; menu.c)
- MM3 KOMPASS VON NICK666 IST IMPLEMENTIERT
- Homing bei Notlandung einbaut
- Das Problem mit der Beschreibung des EEPROMs ist gelöst. Die Kanalzuweisung für Nick wird nun nicht mehr sporadisch vertauscht
- Umschaltung zwischen Bluetooth und GPS bei Verwendung des Walterboards wenn die Motoren ein- bzw. ausgeschaltet werden
- Eine testweise Verwendung des Beschleunigungssensors in der GPS Routine. Ist in der fc.c jedoch mittels "ACC_GPS_Verstaerkung = 0" totgedreht.
 
Compiler Optionen:
makefile - hier kann zwischen 644 und 644p gewählt werden. Bei p wird die Uart1 mit compiliert, ist jedoch momentan noch mit in Verwendung
main.h - hier kann mittels #define MM3IS 1 zwischen den beiden Kompassversionen gewählt werden
spi.h - hier kann über "#define USE_SPI_COMMUNICATION" die originale Holger spi-Routine aktiviert werden