This commit is contained in:
Fergus Leahy 2018-09-26 16:30:06 +00:00 committed by GitHub
commit 0cb12efa21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
463 changed files with 13324 additions and 5150 deletions

1
Firmware/DFUHID/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
hid_bootloader_cli

40
Firmware/DFUHID/Makefile Normal file
View File

@ -0,0 +1,40 @@
OS ?= LINUX
#OS ?= WINDOWS
#OS ?= MACOSX
#OS ?= BSD
ifeq ($(OS), LINUX) # also works on FreeBSD
CC ?= gcc
CFLAGS ?= -O2 -Wall
hid_bootloader_cli: hid_bootloader_cli.c
$(CC) $(CFLAGS) -s -DUSE_LIBUSB -o hid_bootloader_cli hid_bootloader_cli.c -lusb
else ifeq ($(OS), WINDOWS)
CC = i586-mingw32msvc-gcc
CFLAGS ?= -O2 -Wall
LDLIB = -lsetupapi -lhid
hid_bootloader_cli.exe: hid_bootloader_cli.c
$(CC) $(CFLAGS) -s -DUSE_WIN32 -o hid_bootloader_cli.exe hid_bootloader_cli.c $(LDLIB)
else ifeq ($(OS), MACOSX)
CC ?= gcc
SDK ?= /Developer/SDKs/MacOSX10.5.sdk
CFLAGS ?= -O2 -Wall
hid_bootloader_cli: hid_bootloader_cli.c
$(CC) $(CFLAGS) -DUSE_APPLE_IOKIT -isysroot $(SDK) -o hid_bootloader_cli hid_bootloader_cli.c -Wl,-syslibroot,$(SDK) -framework IOKit -framework CoreFoundation
else ifeq ($(OS), BSD) # works on NetBSD and OpenBSD
CC ?= gcct
CFLAGS ?= -O2 -Wall
hid_bootloader_cli: hid_bootloader_cli.c
$(CC) $(CFLAGS) -s -DUSE_UHID -o hid_bootloader_cli hid_bootloader_cli.c
endif
clean:
rm -f hid_bootloader_cli hid_bootloader_cli.exe

View File

@ -0,0 +1,21 @@
OS ?= FreeBSD
#OS ?= NetBSD
#OS ?= OpenBSD
CFLAGS ?= -O2 -Wall
CC ?= gcc
.if $(OS) == "FreeBSD"
CFLAGS += -DUSE_LIBUSB
LIBS = -lusb
.elif $(OS) == "NetBSD" || $(OS) == "OpenBSD"
CFLAGS += -DUSE_UHID
LIBS =
.endif
hid_bootloader_cli: hid_bootloader_cli.c
$(CC) $(CFLAGS) -s -o hid_bootloader_cli hid_bootloader_cli.c $(LIBS)
clean:
rm -f hid_bootloader_cli

674
Firmware/DFUHID/gpl3.txt Normal file
View File

@ -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>.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,120 @@
"""
LUFA Library
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
"""
"""
Front-end programmer for the LUFA HID class bootloader.
Usage:
python hid_bootloader_loader.py <Device> <Input>.hex
Example:
python hid_bootloader_loader.py at90usb1287 Mouse.hex
Requires the pywinusb (https://pypi.python.org/pypi/pywinusb/) and
IntelHex (https://pypi.python.org/pypi/IntelHex/) libraries.
"""
import sys
from pywinusb import hid
from intelhex import IntelHex
# Device information table
device_info_map = dict()
device_info_map['at90usb1287'] = {'page_size': 256, 'flash_kb': 128}
device_info_map['at90usb1286'] = {'page_size': 256, 'flash_kb': 128}
device_info_map['at90usb647'] = {'page_size': 256, 'flash_kb': 64}
device_info_map['at90usb646'] = {'page_size': 256, 'flash_kb': 64}
device_info_map['atmega32u4'] = {'page_size': 128, 'flash_kb': 32}
device_info_map['atmega32u2'] = {'page_size': 128, 'flash_kb': 32}
device_info_map['atmega16u4'] = {'page_size': 128, 'flash_kb': 16}
device_info_map['atmega16u2'] = {'page_size': 128, 'flash_kb': 16}
device_info_map['at90usb162'] = {'page_size': 128, 'flash_kb': 16}
device_info_map['atmega8u2'] = {'page_size': 128, 'flash_kb': 8}
device_info_map['at90usb82'] = {'page_size': 128, 'flash_kb': 8}
def get_hid_device_handle():
hid_device_filter = hid.HidDeviceFilter(vendor_id=0x03EB,
product_id=0x2067)
valid_hid_devices = hid_device_filter.get_devices()
if len(valid_hid_devices) is 0:
return None
else:
return valid_hid_devices[0]
def send_page_data(hid_device, address, data):
# Bootloader page data should be the HID Report ID (always zero) followed
# by the starting address to program, then one device's flash page worth
# of data
output_report_data = [0]
output_report_data.extend([address & 0xFF, address >> 8])
output_report_data.extend(data)
hid_device.send_output_report(output_report_data)
def program_device(hex_data, device_info):
hid_device = get_hid_device_handle()
if hid_device is None:
print("No valid HID device found.")
sys.exit(1)
try:
hid_device.open()
print("Connected to bootloader.")
# Program in all data from the loaded HEX file, in a number of device
# page sized chunks
for addr in range(0, hex_data.maxaddr(), device_info['page_size']):
# Compute the address range of the current page in the device
current_page_range = range(addr, addr+device_info['page_size'])
# Extract the data from the hex file at the specified start page
# address and convert it to a regular list of bytes
page_data = [hex_data[i] for i in current_page_range]
print("Writing address 0x%04X-0x%04X" % (current_page_range[0], current_page_range[-1]))
# Devices with more than 64KB of flash should shift down the page
# address so that it is 16-bit (page size is guaranteed to be
# >= 256 bytes so no non-zero address bits are discarded)
if device_info['flash_kb'] < 64:
send_page_data(hid_device, addr, page_data)
else:
send_page_data(hid_device, addr >> 8, page_data)
# Once programming is complete, start the application via a dummy page
# program to the page address 0xFFFF
print("Programming complete, starting application.")
send_page_data(hid_device, 0xFFFF, [0] * device_info['page_size'])
finally:
hid_device.close()
if __name__ == '__main__':
# Load the specified HEX file
try:
hex_data = IntelHex(sys.argv[2])
except:
print("Could not open the specified HEX file.")
sys.exit(1)
# Retrieve the device information entry for the specified device
try:
device_info = device_info_map[sys.argv[1]]
except:
print("Unknown device name specified.")
sys.exit(1)
program_device(hex_data, device_info)

View File

@ -195,7 +195,7 @@ const USB_Descriptor_String_t PROGMEM TataconString = USB_STRING_DESCRIPTOR(L"Ta
* USB host.
*/
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint8_t wIndex,
const uint16_t wIndex,
const void** const DescriptorAddress)
{
const uint8_t DescriptorType = (wValue >> 8);

View File

@ -98,7 +98,7 @@
/* Function Prototypes: */
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint8_t wIndex,
const uint16_t wIndex,
const void** const DescriptorAddress)
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);

View File

@ -79,4 +79,8 @@ flashboot:
flash: all
sleep 1
py -2 DFU/hid_bootloader_loader.py atmega16u2 Keyboard.hex
py -2 ../DFUHID/hid_bootloader_loader.py atmega16u2 Keyboard.hex
flashC: all
sleep 1
../DFUHID/hid_bootloader_cli -mmcu=atmega16u2 -r Keyboard.hex

9
Firmware/LUFA/Build/DMBS/.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
*.lss
*.bin
*.elf
*.hex
*.eep
*.map
*.o
*.d
*.sym

View File

@ -0,0 +1,39 @@
/*
DMBS Build System
Released into the public domain.
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
/** \file
*
* Special application to extract an EEPROM image stored in FLASH memory, and
* copy it to the device EEPROM. This application is designed to be used with
* the HID build system module of DMBS to program the EEPROM of a target device
* that uses the HID bootloader protocol, which does not have native EEPROM
* programming support.
*/
#include <avr/io.h>
#include <avr/eeprom.h>
#include <avr/pgmspace.h>
/* References to the binary EEPROM data linked in the AVR's FLASH memory space */
extern const char _binary_InputEEData_bin_start[];
extern const char _binary_InputEEData_bin_end[];
extern const char _binary_InputEEData_bin_size[];
/* Friendly names for the embedded binary data stored in FLASH memory space */
#define InputEEData _binary_InputEEData_bin_start
#define InputEEData_size ((int)_binary_InputEEData_bin_size)
int main(void)
{
/* Copy out the embedded EEPROM data from FLASH to EEPROM memory space */
for (uint16_t i = 0; i < InputEEData_size; i++)
eeprom_update_byte((uint8_t*)i, pgm_read_byte(&InputEEData[i]));
/* Infinite loop once complete */
for (;;);
}

View File

@ -0,0 +1,35 @@
#
# DMBS Build System
# Released into the public domain.
#
# dean [at] fourwalledcubicle [dot] com
# www.fourwalledcubicle.com
#
# Run "make help" for target help.
MCU = atmega128
ARCH = AVR8
F_CPU = 1000000
OPTIMIZATION = s
TARGET = HID_EEPROM_Loader
SRC = $(TARGET).c
CC_FLAGS =
LD_FLAGS =
OBJECT_FILES = InputEEData.o
# Default target
all:
# Determine the AVR sub-architecture of the build main application object file
FIND_AVR_SUBARCH = avr$(shell avr-objdump -f $(TARGET).o | grep architecture | cut -d':' -f3 | cut -d',' -f1)
# Create a linkable object file with the input binary EEPROM data stored in the FLASH section
InputEEData.o: InputEEData.bin $(TARGET).o $(MAKEFILE_LIST)
@echo $(MSG_OBJCPY_CMD) Converting \"$<\" to a object file \"$@\"
avr-objcopy -I binary -O elf32-avr -B $(call FIND_AVR_SUBARCH) --rename-section .data=.progmem.data,contents,alloc,readonly,data $< $@
# Include LUFA build script makefiles
include ../core.mk
include ../gcc.mk
include ../hid.mk

View File

@ -0,0 +1,32 @@
DMBS Build System
Released into the public domain.
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org/>

View File

@ -0,0 +1,38 @@
DMBS - Dean's Makefile Build System
===================================
Modules Overview
----------------
The following modules are currently included:
- [ATPROGRAM](atprogram.md) - Device Programming
- [AVRDUDE](avrdude.md) - Device Programming
- [CORE](core.md) - DMBS Core Functionality
- [CPPCHECK](cppcheck.md) - Static Code Analysis
- [DFU](dfu.md) - Device Programming
- [DOXYGEN](doxygen.md) - Automated Source Code Documentation
- [GCC](gcc.md) - Compiling/Assembling/Linking with GCC
- [HID](hid.md) - Device Programming
## Importing modules into your project makefile
To use a module, it is recommended to add the following boilerplate to your
makefile:
# Include DMBS build script makefiles
DMBS_PATH ?= ../DMBS
Which can then used to indicate the location of your DMBS installation, relative
to the current directory, when importing modules. For example:
DMBS_PATH ?= ../DMBS
include $(DMBS_PATH)/core.mk
include $(DMBS_PATH)/gcc.mk
Imports the `CORE` and `GCC` modules from DMBS using a single path relative to
your project's makefile.
If you wish to write your own DMBS module(s),
[see the documentation here for more details.](WritingYourOwnModules.md)

View File

@ -0,0 +1,94 @@
DMBS - Dean's Makefile Build System
===================================
Writing Your Own Modules
------------------------
A DMBS module consists of the several boilerplate sections, explained below.
## The DMBS module hooks
Your module needs to advertise to DMBS its name, its makefile targets, the
required and optional variables, and the variables and macros the module
provides for use elsewhere. This is achieved with the following section:
DMBS_BUILD_MODULES += EXAMPLE
DMBS_BUILD_TARGETS += example-target another-target
DMBS_BUILD_MANDATORY_VARS += MANDATORY_NAME ALSO_MANDATORY
DMBS_BUILD_OPTIONAL_VARS += OPTIONAL_NAME ALSO_OPTIONAL
DMBS_BUILD_PROVIDED_VARS += MEANING_OF_LIFE
DMBS_BUILD_PROVIDED_MACROS += STRIP_WHITESPACE
The example above declares that this module is called `EXAMPLE`, and exposes the
listed targets, variable requirements and provides variables and macros.
Your module name and provided variable/macro names must be unique, however you
can (and should) re-use variable names where appropriate if they apply to
several modules (such as `ARCH` to specify the project's microcontroller
architecture). Re-using targets is not recommended, but can be used to extend
the dependencies of another module's targets.
## Importing the CORE module
Next, your module should always import the DMBS `CORE` module, via the
following:
# Conditionally import the CORE module of DMBS if it is not already imported
DMBS_MODULE_PATH := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
ifeq ($(findstring CORE, $(DMBS_BUILD_MODULES)),)
include $(DMBS_MODULE_PATH)/core.mk
endif
This ensures that the `make help` target is always available. In addition, the
`CORE` module exposes some [commonly used macros and variables](core.md) to
your module.
## Setting optional variable's defaults
If a variable is optional, you should provide a default value. Do this via the
`?=` operator of `make`, which sets a variable's value if it has not yet been
set:
MY_OPTIONAL_VARIABLE ?= some_default_value
## Sanity checking user input
Sanity checks are what make DMBS useful. Where possible, validate user input and
convert generated errors to human-friendly messages. This can be achieved by
enforcing that all the declared module mandatory variables have been set by the
user:
# Sanity-check values of mandatory user-supplied variables
$(foreach MANDATORY_VAR, $(DMBS_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
As well as complaining if they are set, but currently empty:
$(call ERROR_IF_EMPTY, SOME_MANDATORY_VARIABLE)
$(call ERROR_IF_EMPTY, SOME_OPTIONAL_BUT_NON_EMPTY_VARIABLE)
Or even if they are boolean (`Y` or `N`) variables that have an invalid value:
$(call ERROR_IF_NONBOOL, SOME_BOOL_VARIABLE)
## Adding targets
The meat of a DMBS module is the targets, which are run when the user types
`make {target name}` from the command line. These can be as complex or simple
as you like. See the GNU make manual for information on writing make targets.
example-target:
echo "Your DMBS module works!"
## And finally, list the PHONYs
Important in GNU Make is the concept of phony targets; this special directive
tells make that a given target should never be considered a valid file. Listing
phonies ensures that, for example, if your module had a target called `build`,
it would always run when the user types `make build` from the command line, even
if a file called `build` existed in the user project folder.
You can list module-internal targets here, as well as mark all public targets
via the module header's `DMBS_BUILD_TARGETS` variable.
# Phony build targets for this module
.PHONY: $(DMBS_BUILD_TARGETS) some-module-internal-target another-internal-target

View File

@ -0,0 +1,119 @@
DMBS - Dean's Makefile Build System
===================================
Module: ATPROGRAM
-----------------
The ATPROGRAM module provides build targets for use with the official
`ATPROGRAM` back-end utility distributed with the free
[Atmel Studio](http://www.atmel.com) software released by Atmel.
## Importing This Module into a Makefile:
To use this module in your application makefile, add the following code to your
makefile:
include $(DMBS_PATH)/atprogram.mk
## Prerequisites:
This module requires the `atprogram.exe` utility to be available in your
system's `PATH` variable. The `atprogram.exe` utility is distributed in Atmel
Studio (usually) inside the application install folder's `atbackend`
subdirectory.
## Build Targets:
The following targets are supported by this module:
<table>
<tbody>
<tr>
<td>atprogram</td>
<td>Program the device FLASH memory with the application's executable data.</td>
</tr>
<tr>
<td>atprogram-ee</td>
<td>Program the device EEPROM memory with the application's EEPROM data.</td>
</tr>
</tbody>
</table>
## Mandatory Variables:
The following variables must be defined (with a `NAME = VALUE` syntax, one
variable per line) in the user makefile to be able to use this module:
<table>
<tbody>
<tr>
<td>MCU</td>
<td>Name of the Atmel processor model (e.g. `at90usb1287`).</td>
</tr>
<tr>
<td>TARGET</td>
<td>Name of the application output file prefix (e.g. `TestApplication`).</td>
</tr>
</tbody>
</table>
## Optional Variables:
The following variables may be defined (with a `NAME = VALUE` syntax, one
variable per line) in the user makefile. If not specified, a default value will
be assumed.
<table>
<tbody>
<tr>
<td>ATPROGRAM_PROGRAMMER</td>
<td>Name of the Atmel programmer or debugger tool to communicate with (e.g. `jtagice3`). Default is `atmelice`.</td>
</tr>
<tr>
<td>ATPROGRAM_INTERFACE</td>
<td>Name of the programming interface to use when programming the target (e.g. `spi`). Default is `jtag`.</td>
</tr>
<tr>
<td>ATPROGRAM_PORT</td>
<td>Name of the communication port to use when when programming with a serially connected tool (e.g. `COM2`). Default is `usb`.</td>
</tr>
</tbody>
</table>
## Provided Variables:
The following variables may be referenced in a user makefile (via `$(NAME)`
syntax) if desired, as they are provided by this module.
<table>
<tbody>
<tr>
<td>N/A</td>
<td>This module provides no variables.</td>
</tr>
</tbody>
</table>
## Provided Macros:
The following macros may be referenced in a user makefile (via
`$(call NAME, ARG1, ARG2, ...)` syntax) if desired, as they are provided by
this module.
<table>
<tbody>
<tr>
<td>N/A</td>
<td>This module provides no macros.</td>
</tr>
</tbody>
</table>
## Module Changelog:
The changes to this module since its initial release are listed below, as of the
DMBS version where the change was made.
### 20160403
Initial release.

View File

@ -0,0 +1,68 @@
#
# DMBS Build System
# Released into the public domain.
#
# dean [at] fourwalledcubicle [dot] com
# www.fourwalledcubicle.com
#
DMBS_BUILD_MODULES += ATPROGRAM
DMBS_BUILD_TARGETS += atprogram atprogram-ee
DMBS_BUILD_MANDATORY_VARS += MCU TARGET
DMBS_BUILD_OPTIONAL_VARS += ATPROGRAM_PROGRAMMER ATPROGRAM_INTERFACE ATPROGRAM_PORT
DMBS_BUILD_PROVIDED_VARS +=
DMBS_BUILD_PROVIDED_MACROS +=
# Conditionally import the CORE module of DMBS if it is not already imported
DMBS_MODULE_PATH := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
ifeq ($(findstring CORE, $(DMBS_BUILD_MODULES)),)
include $(DMBS_MODULE_PATH)/core.mk
endif
# Default values of optionally user-supplied variables
ATPROGRAM_PROGRAMMER ?= atmelice
ATPROGRAM_INTERFACE ?= jtag
ATPROGRAM_PORT ?=
# Sanity check user supplied values
$(foreach MANDATORY_VAR, $(DMBS_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
$(call ERROR_IF_EMPTY, MCU)
$(call ERROR_IF_EMPTY, TARGET)
$(call ERROR_IF_EMPTY, ATPROGRAM_PROGRAMMER)
$(call ERROR_IF_EMPTY, ATPROGRAM_INTERFACE)
# Output Messages
MSG_ATPROGRAM_CMD := ' [ATPRGRM] :'
# Construct base atprogram command flags
BASE_ATPROGRAM_FLAGS := --tool $(ATPROGRAM_PROGRAMMER) --interface $(ATPROGRAM_INTERFACE) --device $(MCU)
ifneq ($(ATPROGRAM_PORT),)
BASE_ATPROGRAM_FLAGS += --port $(ATPROGRAM_PORT)
endif
# Construct the flags to use for the various memory spaces
ifeq ($(ARCH), AVR8)
ATPROGRAM_FLASH_FLAGS := --chiperase --flash
ATPROGRAM_EEPROM_FLAGS := --eeprom
else ifeq ($(ARCH), XMEGA)
ATPROGRAM_FLASH_FLAGS := --erase --flash
ATPROGRAM_EEPROM_FLAGS := --eeprom
else ifeq ($(ARCH), UC3)
ATPROGRAM_FLASH_FLAGS := --erase
ATPROGRAM_EEPROM_FLAGS := --eeprom
else
$(error Unsupported architecture "$(ARCH)")
endif
# Programs in the target FLASH memory using ATPROGRAM
atprogram: $(TARGET).elf $(MAKEFILE_LIST)
@echo $(MSG_ATPROGRAM_CMD) Programming device \"$(MCU)\" FLASH using \"$(ATPROGRAM_PROGRAMMER)\"
atprogram $(BASE_ATPROGRAM_FLAGS) program $(ATPROGRAM_FLASH_FLAGS) --file $<
# Programs in the target EEPROM memory using ATPROGRAM
atprogram-ee: $(TARGET).elf $(MAKEFILE_LIST)
@echo $(MSG_ATPROGRAM_CMD) Programming device \"$(MCU)\" EEPROM using \"$(ATPROGRAM_PROGRAMMER)\"
atprogram $(BASE_ATPROGRAM_FLAGS) program $(ATPROGRAM_EEPROM_FLAGS) --file $<
# Phony build targets for this module
.PHONY: $(DMBS_BUILD_TARGETS)

View File

@ -0,0 +1,124 @@
DMBS - Dean's Makefile Build System
===================================
Module: AVRDUDE
-----------------
The AVRDUDE module provides build targets for use with the official
open source `AVRDUDE` programmer utility, for the reprogramming of Atmel devices
using a wide variety of official and non-official programming devices and
bootloaders.
## Importing This Module into a Makefile:
To use this module in your application makefile, add the following code to your
makefile:
include $(DMBS_PATH)/avrdude.mk
## Prerequisites:
This module requires the `avrdude` utility to be available in your
system's `PATH` variable. The `avrdude` utility is distributed on the project's
[official site](https://savannah.nongnu.org/projects/avrdude) but is also
made available in many *nix operating system's package managers.
## Build Targets:
The following targets are supported by this module:
<table>
<tbody>
<tr>
<td>avrdude</td>
<td>Program the device FLASH memory with the application's executable data.</td>
</tr>
<tr>
<td>avrdude-ee</td>
<td>Program the device EEPROM memory with the application's EEPROM data.</td>
</tr>
</tbody>
</table>
## Mandatory Variables:
The following variables must be defined (with a `NAME = VALUE` syntax, one
variable per line) in the user makefile to be able to use this module:
<table>
<tbody>
<tr>
<td>MCU</td>
<td>Name of the Atmel processor model (e.g. `at90usb1287`).</td>
</tr>
<tr>
<td>TARGET</td>
<td>Name of the application output file prefix (e.g. `TestApplication`).</td>
</tr>
</tbody>
</table>
## Optional Variables:
The following variables may be defined (with a `NAME = VALUE` syntax, one
variable per line) in the user makefile. If not specified, a default value will
be assumed.
<table>
<tbody>
<tr>
<td>AVRDUDE_PROGRAMMER</td>
<td>Name of the programmer/debugger tool or bootloader to communicate with (e.g. `jtagicemkii`). Default is `jtagicemkii`.</td>
</tr>
<tr>
<td>AVRDUDE_PORT</td>
<td>Name of the communication port to use when when programming with a serially connected tool (e.g. `COM2`). Default is `usb`.</td>
</tr>
<tr>
<td>AVRDUDE_FLAGS</td>
<td>Additional flags to pass to `avrdude` when invoking the tool. Default is empty (no additional flags).</td>
</tr>
<tr>
<td>AVRDUDE_MEMORY</td>
<td>Memory space to program when executing the `avrdude` target (e.g. 'application` for an XMEGA device). Default is `flash`.</td>
</tr>
</tbody>
</table>
## Provided Variables:
The following variables may be referenced in a user makefile (via `$(NAME)`
syntax) if desired, as they are provided by this module.
<table>
<tbody>
<tr>
<td>N/A</td>
<td>This module provides no variables.</td>
</tr>
</tbody>
</table>
## Provided Macros:
The following macros may be referenced in a user makefile (via
`$(call NAME, ARG1, ARG2, ...)` syntax) if desired, as they are provided by
this module.
<table>
<tbody>
<tr>
<td>N/A</td>
<td>This module provides no macros.</td>
</tr>
</tbody>
</table>
## Module Changelog:
The changes to this module since its initial release are listed below, as of the
DMBS version where the change was made.
### 20160403
Initial release.

View File

@ -0,0 +1,52 @@
#
# DMBS Build System
# Released into the public domain.
#
# dean [at] fourwalledcubicle [dot] com
# www.fourwalledcubicle.com
#
DMBS_BUILD_MODULES += AVRDUDE
DMBS_BUILD_TARGETS += avrdude avrdude-ee
DMBS_BUILD_MANDATORY_VARS += MCU TARGET
DMBS_BUILD_OPTIONAL_VARS += AVRDUDE_PROGRAMMER AVRDUDE_PORT AVRDUDE_FLAGS AVRDUDE_MEMORY
DMBS_BUILD_PROVIDED_VARS +=
DMBS_BUILD_PROVIDED_MACROS +=
# Conditionally import the CORE module of DMBS if it is not already imported
DMBS_MODULE_PATH := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
ifeq ($(findstring CORE, $(DMBS_BUILD_MODULES)),)
include $(DMBS_MODULE_PATH)/core.mk
endif
# Default values of optionally user-supplied variables
AVRDUDE_PROGRAMMER ?= jtagicemkii
AVRDUDE_PORT ?= usb
AVRDUDE_FLAGS ?=
AVRDUDE_MEMORY ?= flash
# Sanity check user supplied values
$(foreach MANDATORY_VAR, $(DMBS_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
$(call ERROR_IF_EMPTY, MCU)
$(call ERROR_IF_EMPTY, TARGET)
$(call ERROR_IF_EMPTY, AVRDUDE_PROGRAMMER)
$(call ERROR_IF_EMPTY, AVRDUDE_PORT)
# Output Messages
MSG_AVRDUDE_CMD := ' [AVRDUDE] :'
# Construct base avrdude command flags
BASE_AVRDUDE_FLAGS := -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
# Programs in the target FLASH memory using AVRDUDE
avrdude: $(TARGET).hex $(MAKEFILE_LIST)
@echo $(MSG_AVRDUDE_CMD) Programming device \"$(MCU)\" FLASH using \"$(AVRDUDE_PROGRAMMER)\" on port \"$(AVRDUDE_PORT)\"
avrdude $(BASE_AVRDUDE_FLAGS) -U $(AVRDUDE_MEMORY):w:$< $(AVRDUDE_FLAGS)
# Programs in the target EEPROM memory using AVRDUDE
avrdude-ee: $(TARGET).eep $(MAKEFILE_LIST)
@echo $(MSG_AVRDUDE_CMD) Programming device \"$(MCU)\" EEPROM using \"$(AVRDUDE_PROGRAMMER)\" on port \"$(AVRDUDE_PORT)\"
avrdude $(BASE_AVRDUDE_FLAGS) -U eeprom:w:$< $(AVRDUDE_FLAGS)
# Phony build targets for this module
.PHONY: $(DMBS_BUILD_TARGETS)

View File

@ -0,0 +1,136 @@
DMBS - Dean's Makefile Build System
===================================
Module: CORE
------------
The CORE module provides the core DMBS infrastructure used by other DMBS
modules, and must always be imported. Additionally, this module provides the
help system for DMBS.
## Importing This Module into a Makefile:
To use this module in your application makefile, add the following code to your
makefile:
include $(DMBS_PATH)/core.mk
## Prerequisites:
None.
## Build Targets:
The following targets are supported by this module:
<table>
<tbody>
<tr>
<td>help</td>
<td>Show help for the current project, including a list of all available targets, variables and macros from the imported modules.</td>
</tr>
<tr>
<td>list_targets</td>
<td>Show a list of all build targets from the imported modules.</td>
</tr>
<tr>
<td>list_modules</td>
<td>Show a list of all imported modules.</td>
</tr>
<tr>
<td>list_mandatory</td>
<td>Show a list of all mandatory variables from the imported modules.</td>
</tr>
<tr>
<td>list_optional</td>
<td>Show a list of all optional variables from the imported modules.</td>
</tr>
<tr>
<td>list_provided</td>
<td>Show a list of all variables provided by the imported modules.</td>
</tr>
<tr>
<td>list_macros</td>
<td>Show a list of all macros provided by the imported modules.</td>
</tr>
</tbody>
</table>
## Mandatory Variables:
The following variables must be defined (with a `NAME = VALUE` syntax, one
variable per line) in the user makefile to be able to use this module:
<table>
<tbody>
<tr>
<td>N/A</td>
<td>This module has no mandatory variables.</td>
</tr>
</tbody>
</table>
## Optional Variables:
The following variables may be defined (with a `NAME = VALUE` syntax, one
variable per line) in the user makefile. If not specified, a default value will
be assumed.
<table>
<tbody>
<tr>
<td>N/A</td>
<td>This module has no optional variables.</td>
</tr>
</tbody>
</table>
## Provided Variables:
The following variables may be referenced in a user makefile (via `$(NAME)`
syntax) if desired, as they are provided by this module.
<table>
<tbody>
<tr>
<td>DMBS_VERSION</td>
<td>Current version of this DMBS release, as a ISO 8601 integer (such as `160403` for `2016-04-03`).</td>
</tr>
</tbody>
</table>
## Provided Macros:
The following macros may be referenced in a user makefile (via
`$(call NAME, ARG1, ARG2, ...)` syntax) if desired, as they are provided by
this module.
<table>
<tbody>
<tr>
<td>DMBS_CHECK_VERSION</td>
<td>Macro to check the current DMBS version against the first argument and abort if the required version is newer than the current version.</td>
</tr>
<tr>
<td>ERROR_IF_UNSET</td>
<td>Macro to check the given makefile variable name passed as the first argument, and abort if it has not been set by any makefile module.</td>
</tr>
<tr>
<td>ERROR_IF_EMPTY</td>
<td>Macro to check the given makefile variable name passed as the first argument, and abort if it has an empty value.</td>
</tr>
<tr>
<td>ERROR_IF_NONBOOL</td>
<td>Macro to check the given makefile variable name passed as the first argument, and abort if it has a value other than `Y` or `N`.</td>
</tr>
</tbody>
</table>
## Module Changelog:
The changes to this module since its initial release are listed below, as of the
DMBS version where the change was made.
### 20160403
Initial release.

View File

@ -0,0 +1,147 @@
#
# DMBS Build System
# Released into the public domain.
#
# dean [at] fourwalledcubicle [dot] com
# www.fourwalledcubicle.com
#
DMBS_BUILD_MODULES += CORE
DMBS_BUILD_TARGETS += help list_targets list_modules list_mandatory list_optional list_provided list_macros
DMBS_BUILD_MANDATORY_VARS +=
DMBS_BUILD_OPTIONAL_VARS +=
DMBS_BUILD_PROVIDED_VARS += DMBS_VERSION
DMBS_BUILD_PROVIDED_MACROS += DMBS_CHECK_VERSION ERROR_IF_UNSET ERROR_IF_EMPTY ERROR_IF_NONBOOL
SHELL = /bin/sh
# Current DMBS release version
DMBS_VERSION := 20160717
# Macro to check the DMBS version, aborts if the given DMBS version is below the current version
DMBS_CHECK_VERSION ?= $(if $(filter-out 0, $(shell test $(DMBS_VERSION) -lt $(1); echo $$?)), , $(error DMBS version $(1) or newer required, current version is $(DMBS_VERSION)))
# Macros to use in other modules to check various conditions
ERROR_IF_UNSET ?= $(if $(filter undefined, $(origin $(strip $(1)))), $(error Makefile $(strip $(1)) value not set))
ERROR_IF_EMPTY ?= $(if $(strip $($(strip $(1)))), , $(error Makefile $(strip $(1)) option cannot be blank))
ERROR_IF_NONBOOL ?= $(if $(filter Y N, $($(strip $(1)))), , $(error Makefile $(strip $(1)) option must be Y or N))
# Converts a given input to a printable output using "(None)" if no items are in the list
CONVERT_TO_PRINTABLE = $(if $(strip $(1)), $(1), (None))
# Build sorted and filtered lists of the included build module data
SORTED_DMBS_BUILD_MODULES = $(sort $(DMBS_BUILD_MODULES))
SORTED_DMBS_BUILD_TARGETS = $(sort $(DMBS_BUILD_TARGETS))
SORTED_DMBS_MANDATORY_VARS = $(sort $(DMBS_BUILD_MANDATORY_VARS))
SORTED_DMBS_OPTIONAL_VARS = $(filter-out $(SORTED_DMBS_MANDATORY_VARS), $(sort $(DMBS_BUILD_OPTIONAL_VARS)))
SORTED_DMBS_PROVIDED_VARS = $(sort $(DMBS_BUILD_PROVIDED_VARS))
SORTED_DMBS_PROVIDED_MACROS = $(sort $(DMBS_BUILD_PROVIDED_MACROS))
# Create printable versions of the sorted build module data (use "(None)" when no data is available)
PRINTABLE_DMBS_BUILD_MODULES = $(call CONVERT_TO_PRINTABLE, $(SORTED_DMBS_BUILD_MODULES))
PRINTABLE_DMBS_BUILD_TARGETS = $(call CONVERT_TO_PRINTABLE, $(SORTED_DMBS_BUILD_TARGETS))
PRINTABLE_DMBS_MANDATORY_VARS = $(call CONVERT_TO_PRINTABLE, $(SORTED_DMBS_MANDATORY_VARS))
PRINTABLE_DMBS_OPTIONAL_VARS = $(call CONVERT_TO_PRINTABLE, $(SORTED_DMBS_OPTIONAL_VARS))
PRINTABLE_DMBS_PROVIDED_VARS = $(call CONVERT_TO_PRINTABLE, $(SORTED_DMBS_PROVIDED_VARS))
PRINTABLE_DMBS_PROVIDED_MACROS = $(call CONVERT_TO_PRINTABLE, $(SORTED_DMBS_PROVIDED_MACROS))
help:
@echo "==================================================================="
@echo " The DMBS Build System "
@echo " By Dean Camera { dean @ fourwalledcubicle . com } "
@echo "==================================================================="
@echo "DESCRIPTION: "
@echo " This build system is a set of makefile modules for (GNU) Make, to "
@echo " provide a simple system for building DMBS powered applications. "
@echo " Each makefile module can be included from within a user makefile, "
@echo " to expose the build rules documented in the comments at the top of"
@echo " each build module. "
@echo " "
@echo "USAGE: "
@echo " To execute a rule, define all variables indicated in the desired "
@echo " module as a required parameter before including the build module "
@echo " in your project makefile. Parameters marked as optional will "
@echo " assume a default value in the modules if not user-assigned. "
@echo " "
@echo " By default the target output shows both a friendly summary, as "
@echo " well as the actual invoked command. To suppress the output of the "
@echo " invoked commands and show only the friendly command output, run "
@echo " make with the \"-s\" switch added before the target(s). "
@echo "==================================================================="
@echo " "
@echo " Currently used build system modules in this application: "
@echo " "
@printf " %b" "$(PRINTABLE_DMBS_BUILD_MODULES:%= - %\n)"
@echo " "
@echo " "
@echo " Currently available build targets in this application: "
@echo " "
@printf " %b" "$(PRINTABLE_DMBS_BUILD_TARGETS:%= - %\n)"
@echo " "
@echo " "
@echo " Mandatory variables required by the selected build Modules: "
@echo " "
@printf " %b" "$(PRINTABLE_DMBS_MANDATORY_VARS:%= - %\n)"
@echo " "
@echo " "
@echo " Optional variables required by the selected build Modules: "
@echo " "
@printf " %b" "$(PRINTABLE_DMBS_OPTIONAL_VARS:%= - %\n)"
@echo " "
@echo " "
@echo " Variables provided by the selected build Modules: "
@echo " "
@printf " %b" "$(PRINTABLE_DMBS_PROVIDED_VARS:%= - %\n)"
@echo " "
@echo " "
@echo " Macros provided by the selected build Modules: "
@echo " "
@printf " %b" "$(PRINTABLE_DMBS_PROVIDED_MACROS:%= - %\n)"
@echo " "
@echo "==================================================================="
@echo " The DMBS Build System $(DMBS_VERSION) - Making MAKE easier."
@echo "==================================================================="
# Lists build modules included by the project makefile, in alphabetical order
list_modules:
@echo Currently Used Build System Modules:
@printf " %b" "$(PRINTABLE_DMBS_BUILD_MODULES:%= - %\n)"
# Lists build targets included by the project makefile, in alphabetical order
list_targets:
@echo Currently Available Build Targets:
@printf " %b" "$(PRINTABLE_DMBS_BUILD_TARGETS:%= - %\n)"
# Lists mandatory variables that must be set by the project makefile, in alphabetical order
list_mandatory:
@echo Mandatory Variables for Included Modules:
@printf " %b" "$(PRINTABLE_DMBS_MANDATORY_VARS:%= - %\n)"
# Lists optional variables that must be set by the project makefile, in alphabetical order
list_optional:
@echo Optional Variables for Included Modules:
@printf " %b" "$(PRINTABLE_DMBS_OPTIONAL_VARS:%= - %\n)"
# Lists variables provided by the included build modules, in alphabetical order
list_provided:
@echo Variables Provided by the Included Modules:
@printf " %b" "$(PRINTABLE_DMBS_PROVIDED_VARS:%= - %\n)"
# Lists macros provided by the included build modules, in alphabetical order
list_macros:
@echo Macros Provided by the Included Modules:
@printf " %b" "$(PRINTABLE_DMBS_PROVIDED_MACROS:%= - %\n)"
# Debugging; "make print-VARNAME" will output the variable VARNAME's value
print-%:
@printf "%s = %s" $(@:print-%=%) $($(@:print-%=%))
# Disable default in-built make rules (those that are needed are explicitly
# defined, and doing so has performance benefits when recursively building)
ifeq ($(filter -r,$(MAKEFLAGS)),)
MAKEFLAGS += -r
endif
.SUFFIXES:
# Phony build targets for this module
.PHONY: $(DMBS_BUILD_TARGETS)

View File

@ -0,0 +1,134 @@
DMBS - Dean's Makefile Build System
===================================
Module: CPPCHECK
-----------------
The CPPCHECK module provides build targets to perform static analysis of the
user application, using the open source `cppcheck` tool.
## Importing This Module into a Makefile:
To use this module in your application makefile, add the following code to your
makefile:
include $(DMBS_PATH)/cppcheck.mk
## Prerequisites:
This module requires the `cppcheck` utility to be available in your system's
`PATH` variable. The `cppcheck` utility is distributed on the project's
[official site](http://cppcheck.sourceforge.net/) but is also
made available in many *nix operating system's package managers.
## Build Targets:
The following targets are supported by this module:
<table>
<tbody>
<tr>
<td>cppcheck</td>
<td>Scan the project with CPPCHECK, and show all discovered issues.</td>
</tr>
<tr>
<td>cppcheck-config</td>
<td>Check the project with CPPCHECK, to find missing header paths.</td>
</tr>
</tbody>
</table>
## Mandatory Variables:
The following variables must be defined (with a `NAME = VALUE` syntax, one
variable per line) in the user makefile to be able to use this module:
<table>
<tbody>
<tr>
<td>SRC</td>
<td>List of all project source files to scan.</td>
</tr>
</tbody>
</table>
## Optional Variables:
The following variables may be defined (with a `NAME = VALUE` syntax, one
variable per line) in the user makefile. If not specified, a default value will
be assumed.
<table>
<tbody>
<tr>
<td>CPPCHECK_INCLUDES</td>
<td>Extra include paths to search, for any missing header files. Default is empty (no additional paths).</td>
</tr>
<tr>
<td>CPPCHECK_EXCLUDES</td>
<td>List of source files, file paths or path fragments to exclude from the scan. Default is empty (no exclusions).</td>
</tr>
<tr>
<td>CPPCHECK_MSG_TEMPLATE</td>
<td>Template for error and warning message output. Default is `{file}:{line}: {severity} ({id}): {message}`.</td>
</tr>
<tr>
<td>CPPCHECK_ENABLE</td>
<td>List of CPPCHECK checks to enable. Default is `all`.</td>
</tr>
<tr>
<td>CPPCHECK_SUPPRESS</td>
<td>List of CPPCHECK checks to ignore. Default is `variableScope missingInclude`.</td>
</tr>
<tr>
<td>CPPCHECK_FAIL_ON_WARNING</td>
<td>Boolean, if `Y` the build will fail if CPPCHECK discovers any errors or warnings. If `N`, fail only on errors. Default is `Y`.</td>
</tr>
<tr>
<td>CPPCHECK_QUIET</td>
<td>Boolean, if `Y` CPPCHECK will suppress all output except for discovered errors or warnings. If `N`, scan progress will be emitted. Default is `Y`.</td>
</tr>
<tr>
<td>CPPCHECK_FLAGS_</td>
<td>Additional flags to pass to CPPCHECK when scans are started. Default is empty (no additional flags).</td>
</tr>
</tbody>
</table>
## Provided Variables:
The following variables may be referenced in a user makefile (via `$(NAME)`
syntax) if desired, as they are provided by this module.
<table>
<tbody>
<tr>
<td>N/A</td>
<td>This module provides no variables.</td>
</tr>
</tbody>
</table>
## Provided Macros:
The following macros may be referenced in a user makefile (via
`$(call NAME, ARG1, ARG2, ...)` syntax) if desired, as they are provided by
this module.
<table>
<tbody>
<tr>
<td>N/A</td>
<td>This module provides no macros.</td>
</tr>
</tbody>
</table>
## Module Changelog:
The changes to this module since its initial release are listed below, as of the
DMBS version where the change was made.
### 20160403
Initial release.

View File

@ -0,0 +1,66 @@
#
# DMBS Build System
# Released into the public domain.
#
# dean [at] fourwalledcubicle [dot] com
# www.fourwalledcubicle.com
#
DMBS_BUILD_MODULES += CPPCHECK
DMBS_BUILD_TARGETS += cppcheck cppcheck-config
DMBS_BUILD_MANDATORY_VARS += SRC
DMBS_BUILD_OPTIONAL_VARS += CPPCHECK_INCLUDES CPPCHECK_EXCLUDES CPPCHECK_MSG_TEMPLATE CPPCHECK_ENABLE \
CPPCHECK_SUPPRESS CPPCHECK_FAIL_ON_WARNING CPPCHECK_QUIET CPPCHECK_FLAGS
DMBS_BUILD_PROVIDED_VARS +=
DMBS_BUILD_PROVIDED_MACROS +=
# Conditionally import the CORE module of DMBS if it is not already imported
DMBS_MODULE_PATH := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
ifeq ($(findstring CORE, $(DMBS_BUILD_MODULES)),)
include $(DMBS_MODULE_PATH)/core.mk
endif
# Default values of optionally user-supplied variables
CPPCHECK_INCLUDES ?=
CPPCHECK_EXCLUDES ?=
CPPCHECK_MSG_TEMPLATE ?= {file}:{line}: {severity} ({id}): {message}
CPPCHECK_ENABLE ?= all
CPPCHECK_SUPPRESS ?= variableScope missingInclude
CPPCHECK_FAIL_ON_WARNING ?= Y
CPPCHECK_QUIET ?= Y
CPPCHECK_FLAGS ?=
# Sanity check user supplied values
$(foreach MANDATORY_VAR, $(DMBS_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
$(call ERROR_IF_EMPTY, SRC)
$(call ERROR_IF_EMPTY, CPPCHECK_MSG_TEMPLATE)
$(call ERROR_IF_EMPTY, CPPCHECK_ENABLE)
$(call ERROR_IF_NONBOOL, CPPCHECK_FAIL_ON_WARNING)
$(call ERROR_IF_NONBOOL, CPPCHECK_QUIET)
# Build a default argument list for cppcheck
BASE_CPPCHECK_FLAGS := --template="$(CPPCHECK_MSG_TEMPLATE)" $(CPPCHECK_INCLUDES:%=-I%) $(CPPCHECK_EXCLUDES:%=-i%) --inline-suppr --force --std=c99
# Sanity check parameters and construct additional command line arguments to cppcheck
ifeq ($(CPPCHECK_FAIL_ON_WARNING), Y)
BASE_CPPCHECK_FLAGS += --error-exitcode=1
endif
ifeq ($(CPPCHECK_QUIET), Y)
BASE_CPPCHECK_FLAGS += --quiet
endif
# Output Messages
MSG_CPPCHECK_CMD := ' [CPPCHECK]:'
# Checks the CPPCheck configuration as used in the user project, to determine if any paths are missing or invalid
cppcheck-config: $(MAKEFILE_LIST)
@echo $(MSG_CPPCHECK_CMD) Checking cppcheck configuration check on source files
cppcheck $(BASE_CPPCHECK_FLAGS) --check-config $(CPPCHECK_FLAGS) $(SRC)
# Runs a static analysis using CPPCheck to determine if there are any issues
cppcheck: $(MAKEFILE_LIST)
@echo $(MSG_CPPCHECK_CMD) Performing static analysis on source files
cppcheck $(BASE_CPPCHECK_FLAGS) --enable=$(CPPCHECK_ENABLE) $(CPPCHECK_SUPPRESS:%=--suppress=%) $(CPPCHECK_FLAGS) $(SRC)
# Phony build targets for this module
.PHONY: $(DMBS_BUILD_TARGETS)

View File

@ -0,0 +1,122 @@
DMBS - Dean's Makefile Build System
===================================
Module: DFU
-----------------
The DFU module provides build targets to program a USB connected target running
a DFU class bootloader, via the official Atmel FLIP utility running via the
command line, or the open source `DFU-Programmer` tool.
## Importing This Module into a Makefile:
To use this module in your application makefile, add the following code to your
makefile:
include $(DMBS_PATH)/dfu.mk
## Prerequisites:
This module requires the `batchisp` utility to be available in your system's
`PATH` variable. The `batchisp` utility is distributed as part of Atmel's FLIP
software which can be downloaded from the [official site](http://www.atmel.com).
This module requires the `dfu-programmer` utility to be available in your
system's `PATH` variable. The `dfu-programmer` utility is distributed from the
[official project site](https://dfu-programmer.github.io/).
## Build Targets:
The following targets are supported by this module:
<table>
<tbody>
<tr>
<td>flip</td>
<td>Program the application into the device's flash memory, using Atmel FLIP.</td>
</tr>
<tr>
<td>flip-ee</td>
<td>Program the application's EEPROM data into the device's EEPROM memory, using Atmel FLIP.</td>
</tr>
<tr>
<td>dfu</td>
<td>Program the application into the device's flash memory, using `dfu-programmer`.</td>
</tr>
<tr>
<td>dfu-ee</td>
<td>Program the application's EEPROM data into the device's EEPROM memory, using `dfu-programmer`.</td>
</tr>
</tbody>
</table>
## Mandatory Variables:
The following variables must be defined (with a `NAME = VALUE` syntax, one
variable per line) in the user makefile to be able to use this module:
<table>
<tbody>
<tr>
<td>MCU</td>
<td>Name of the Atmel processor model (e.g. `at90usb1287`).</td>
</tr>
<tr>
<td>TARGET</td>
<td>Name of the application output file prefix (e.g. `TestApplication`).</td>
</tr>
</tbody>
</table>
## Optional Variables:
The following variables may be defined (with a `NAME = VALUE` syntax, one
variable per line) in the user makefile. If not specified, a default value will
be assumed.
<table>
<tbody>
<tr>
<td>N/A</td>
<td>This module has no optional variables.</td>
</tr>
</tbody>
</table>
## Provided Variables:
The following variables may be referenced in a user makefile (via `$(NAME)`
syntax) if desired, as they are provided by this module.
<table>
<tbody>
<tr>
<td>N/A</td>
<td>This module provides no variables.</td>
</tr>
</tbody>
</table>
## Provided Macros:
The following macros may be referenced in a user makefile (via
`$(call NAME, ARG1, ARG2, ...)` syntax) if desired, as they are provided by
this module.
<table>
<tbody>
<tr>
<td>N/A</td>
<td>This module provides no macros.</td>
</tr>
</tbody>
</table>
## Module Changelog:
The changes to this module since its initial release are listed below, as of the
DMBS version where the change was made.
### 20160403
Initial release.

View File

@ -0,0 +1,62 @@
#
# DMBS Build System
# Released into the public domain.
#
# dean [at] fourwalledcubicle [dot] com
# www.fourwalledcubicle.com
#
DMBS_BUILD_MODULES += DFU
DMBS_BUILD_TARGETS += flip flip-ee dfu dfu-ee
DMBS_BUILD_MANDATORY_VARS += MCU TARGET
DMBS_BUILD_OPTIONAL_VARS +=
DMBS_BUILD_PROVIDED_VARS +=
DMBS_BUILD_PROVIDED_MACROS +=
# Conditionally import the CORE module of DMBS if it is not already imported
DMBS_MODULE_PATH := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
ifeq ($(findstring CORE, $(DMBS_BUILD_MODULES)),)
include $(DMBS_MODULE_PATH)/core.mk
endif
# Sanity-check values of mandatory user-supplied variables
$(foreach MANDATORY_VAR, $(DMBS_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
$(call ERROR_IF_EMPTY, MCU)
$(call ERROR_IF_EMPTY, TARGET)
# Output Messages
MSG_COPY_CMD := ' [CP] :'
MSG_REMOVE_CMD := ' [RM] :'
MSG_DFU_CMD := ' [DFU] :'
# Programs in the target FLASH memory using BATCHISP, the command line tool used by FLIP
flip: $(TARGET).hex $(MAKEFILE_LIST)
@echo $(MSG_DFU_CMD) Programming FLASH with batchisp using \"$<\"
batchisp -hardware usb -device $(MCU) -operation erase f loadbuffer $< program
batchisp -hardware usb -device $(MCU) -operation start reset 0
# Programs in the target EEPROM memory using BATCHISP, the command line tool used by FLIP
flip-ee: $(TARGET).eep $(MAKEFILE_LIST)
@echo $(MSG_COPY_CMD) Copying EEP file to temporary file \"$<.hex\"
cp $< $<.hex
@echo $(MSG_DFU_CMD) Programming EEPROM with batchisp using \"$<.hex\"
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $<.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
@echo $(MSG_REMOVE_CMD) Removing temporary file \"$<.hex\"
rm $<.hex
# Programs in the target FLASH memory using DFU-PROGRAMMER
dfu: $(TARGET).hex $(MAKEFILE_LIST)
@echo $(MSG_DFU_CMD) Programming FLASH with dfu-programmer using \"$<\"
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash $<
dfu-programmer $(MCU) reset
# Programs in the target EEPROM memory using DFU-PROGRAMMER
dfu-ee: $(TARGET).eep $(MAKEFILE_LIST)
@echo $(MSG_DFU_CMD) Programming EEPROM with dfu-programmer using \"$<\"
dfu-programmer $(MCU) flash --eeprom $<
dfu-programmer $(MCU) reset
# Phony build targets for this module
.PHONY: $(DMBS_BUILD_TARGETS)

View File

@ -0,0 +1,118 @@
DMBS - Dean's Makefile Build System
===================================
Module: DOXYGEN
-----------------
The DOXYGEN module provides build targets to automatically generate API
documentation for a project, using the open-source Doxygen tool.
## Importing This Module into a Makefile:
To use this module in your application makefile, add the following code to your
makefile:
include $(DMBS_PATH)/doxygen.mk
## Prerequisites:
This module requires the `doxygen` utility to be available in your system's
`PATH` variable. The `doxygen` utility is distributed on the project's
[official site](http://doxygen.org/) but is also
made available in many *nix operating system's package managers.
## Build Targets:
The following targets are supported by this module:
<table>
<tbody>
<tr>
<td>doxygen</td>
<td>Generate project documentation, via Doxygen.</td>
</tr>
<tr>
<td>doxygen-create</td>
<td>Create a new project Doxygen template, which can then be customized.</td>
</tr>
<tr>
<td>doxygen-upgrade</td>
<td>Upgrade an existing project Doxygen template to the latest Doxygen version.</td>
</tr>
</tbody>
</table>
## Mandatory Variables:
The following variables must be defined (with a `NAME = VALUE` syntax, one
variable per line) in the user makefile to be able to use this module:
<table>
<tbody>
<tr>
<td>N/A</td>
<td>This module has no mandatory variables.</td>
</tr>
</tbody>
</table>
## Optional Variables:
The following variables may be defined (with a `NAME = VALUE` syntax, one
variable per line) in the user makefile. If not specified, a default value will
be assumed.
<table>
<tbody>
<tr>
<td>DOXYGEN_CONF</td>
<td>Name of the Doxygen project configuration file that should be used when generating documentation, or creating/upgrading the configuration file.</td>
</tr>
<tr>
<td>DOXYGEN_FAIL_ON_WARNING</td>
<td>Boolean, if `Y` the build will fail if Doxygen encounters any errors or warnings. If `N`, fail only on errors. Default is `Y`.</td>
</tr>
<tr>
<td>DOXYGEN_OVERRIDE_PARAMS</td>
<td>List of `NAME=VALUE` parameters which should override the values specified in the project configuration file, when building documentation.</td>
</tr>
</tbody>
</table>
## Provided Variables:
The following variables may be referenced in a user makefile (via `$(NAME)`
syntax) if desired, as they are provided by this module.
<table>
<tbody>
<tr>
<td>N/A</td>
<td>This module provides no variables.</td>
</tr>
</tbody>
</table>
## Provided Macros:
The following macros may be referenced in a user makefile (via
`$(call NAME, ARG1, ARG2, ...)` syntax) if desired, as they are provided by
this module.
<table>
<tbody>
<tr>
<td>N/A</td>
<td>This module provides no macros.</td>
</tr>
</tbody>
</table>
## Module Changelog:
The changes to this module since its initial release are listed below, as of the
DMBS version where the change was made.
### 20160403
Initial release.

View File

@ -0,0 +1,62 @@
#
# DMBS Build System
# Released into the public domain.
#
# dean [at] fourwalledcubicle [dot] com
# www.fourwalledcubicle.com
#
DMBS_BUILD_MODULES += DOXYGEN
DMBS_BUILD_TARGETS += doxygen doxygen-upgrade doxygen-create
DMBS_BUILD_MANDATORY_VARS +=
DMBS_BUILD_OPTIONAL_VARS += DOXYGEN_CONF DOXYGEN_FAIL_ON_WARNING DOXYGEN_OVERRIDE_PARAMS
DMBS_BUILD_PROVIDED_VARS +=
DMBS_BUILD_PROVIDED_MACROS +=
# Conditionally import the CORE module of DMBS if it is not already imported
DMBS_MODULE_PATH := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
ifeq ($(findstring CORE, $(DMBS_BUILD_MODULES)),)
include $(DMBS_MODULE_PATH)/core.mk
endif
# Default values of optionally user-supplied variables
DOXYGEN_CONF ?= doxyfile
DOXYGEN_FAIL_ON_WARNING ?= Y
DOXYGEN_OVERRIDE_PARAMS ?= QUIET=YES
# Sanity check user supplied values
$(foreach MANDATORY_VAR, $(DMBS_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
$(call ERROR_IF_EMPTY, DOXYGEN_CONF)
$(call ERROR_IF_NONBOOL, DOXYGEN_FAIL_ON_WARNING)
# Output Messages
MSG_DOXYGEN_CMD := ' [DOXYGEN] :'
# Determine Doxygen invocation command
BASE_DOXYGEN_CMD := ( cat $(DOXYGEN_CONF) $(DOXYGEN_OVERRIDE_PARAMS:%=; echo "%") ) | doxygen -
ifeq ($(DOXYGEN_FAIL_ON_WARNING), Y)
DOXYGEN_CMD := if ( $(BASE_DOXYGEN_CMD) 2>&1 | grep -v "warning: ignoring unsupported tag" ;); then exit 1; fi;
else
DOXYGEN_CMD := $(BASE_DOXYGEN_CMD)
endif
# Error if the specified Doxygen configuration file does not exist
$(DOXYGEN_CONF):
$(error Doxygen configuration file $@ does not exist)
# Builds the project documentation using the specified configuration file and the DOXYGEN tool
doxygen: $(DOXYGEN_CONF) $(MAKEFILE_LIST)
@echo $(MSG_DOXYGEN_CMD) Configuration file \"$(DOXYGEN_CONF)\" with parameters \"$(DOXYGEN_OVERRIDE_PARAMS)\"
$(DOXYGEN_CMD)
# Upgrades an existing Doxygen configuration file to the latest Doxygen template, preserving settings
doxygen-upgrade: $(DOXYGEN_CONF) $(MAKEFILE_LIST)
@echo $(MSG_DOXYGEN_CMD) Upgrading configuration file \"$(DOXYGEN_CONF)\" with latest template
doxygen -u $(DOXYGEN_CONF) > /dev/null
# Creates a new Doxygen configuration file with the set file name
doxygen-create: $(MAKEFILE_LIST)
@echo $(MSG_DOXYGEN_CMD) Creating new configuration file \"$(DOXYGEN_CONF)\" with latest template
doxygen -g $(DOXYGEN_CONF) > /dev/null

View File

@ -0,0 +1,204 @@
DMBS - Dean's Makefile Build System
===================================
Module: GCC
-----------------
The GCC module provides build targets to compile a user application, using a
variant of GCC for a specific target architecture (such as `avr-gcc`).
## Importing This Module into a Makefile:
To use this module in your application makefile, add the following code to your
makefile:
include $(DMBS_PATH)/gcc.mk
## Prerequisites:
This module requires the GCC compiler to be installed and available in the
system's `PATH` variable for the desired target architecture.
## Build Targets:
The following targets are supported by this module:
<table>
<tbody>
<tr>
<td>size</td>
<td>Show the compiled binary size for the various memory segments.</td>
</tr>
<tr>
<td>symbol-sizes</td>
<td>Show the size of each symbol in the compiled binary (useful to find large functions to optimize further).</td>
</tr>
<tr>
<td>all</td>
<td>Build application and generate all binary (BIN, ELF, HEX) and auxiliary (LSS, MAP, SYM, etc.) output files.</td>
</tr>
<tr>
<td>lib</td>
<td>Generate a static `.a` library from the application code, containing the flash region's data.</td>
</tr>
<tr>
<td>elf</td>
<td>Generate an ELF debug file from the application code, containing all region's data.</td>
</tr>
<tr>
<td>bin</td>
<td>Generate a flat BIN binary file from the application code, containing the flash region's data.</td>
</tr>
<tr>
<td>hex</td>
<td>Generate a pair of Intel HEX files from the application code, containing the flash region's data (HEX) and EEPROM data (EEP).</td>
</tr>
<tr>
<td>lss</td>
<td>Generate a LSS listing file showing the disassembly of the compiled application.</td>
</tr>
<tr>
<td>clean</td>
<td>Remove all generated project intermediary and binary output files.</td>
</tr>
<tr>
<td>mostlyclean</td>
<td>Remove all generated project intermediary output files, but preserve the binary output files.</td>
</tr>
</tbody>
</table>
## Mandatory Variables:
The following variables must be defined (with a `NAME = VALUE` syntax, one
variable per line) in the user makefile to be able to use this module:
<table>
<tbody>
<tr>
<td>MCU</td>
<td>Name of the Atmel processor model (e.g. `at90usb1287`).</td>
</tr>
<tr>
<td>TARGET</td>
<td>Name of the application output file prefix (e.g. `TestApplication`).</td>
</tr>
<tr>
<td>ARCH</td>
<td>Target device architecture (e.g. `AVR8`).</td>
</tr>
<tr>
<td>SRC</td>
<td>List of all project source files (C, C++, ASM).</td>
</tr>
</tbody>
</table>
## Optional Variables:
The following variables may be defined (with a `NAME = VALUE` syntax, one
variable per line) in the user makefile. If not specified, a default value will
be assumed.
<table>
<tbody>
<tr>
<td>OPTIMIZATION</td>
<td>Optimization level to use when compiling C and C++ source files. Default is `s` (optimize for smallest size).</td>
</tr>
<tr>
<td>C_STANDARD</td>
<td>C language standard used when compiling C language source files. Default is `gnu99` (C99 standard with GNU extensions)./td>
</tr>
<tr>
<td>CPP_STANDARD</td>
<td>C++ language standard used when compiling C++ language source files. Default is `gnu++98` (C++98 standard with GNU extensions)./td>
</tr>
<tr>
<td>F_CPU</td>
<td>Processor core clock frequency, in Hz. This is used by some architectures for functions such as software spin-loop delays. Default is blank (no value defined).</td>
</tr>
<tr>
<td>C_FLAGS</td>
<td>Common GCC flags passed to the compiler for C language (C) input files. Default is blank (no additional flags).</td>
</tr>
<tr>
<td>CPP_FLAGS</td>
<td>Common GCC flags passed to the compiler for C++ language (CPP) input files. Default is blank (no additional flags).</td>
</tr>
<tr>
<td>ASM_FLAGS</td>
<td>Common GCC flags passed to the assembler for assembly language (S) input files. Default is blank (no additional flags).</td>
</tr>
<tr>
<td>CC_FLAGS</td>
<td>Common GCC flags passed to the compiler for all source file types. Default is blank (no additional flags).</td>
</tr>
<tr>
<td>LD_FLAGS</td>
<td>Extra flags to pass to the GNU linker when linking the compiled object files into the resulting binary. Default is blank (no additional flags).</td>
</tr>
<tr>
<td>LINKER_RELAXATIONS</td>
<td>Boolean, if `Y` linker relaxations will be enabled to slightly reduce the resulting binary's size. Default is `Y`.</td>
</tr>
<tr>
<td>OBJDIR</td>
<td>Directory to store the intermediate object files, as they are generated from the source files. Default is `obj`.</td>
</tr>
<tr>
<td>OBJECT_FILES</td>
<td>List of additional `.o` object files to link into the final binary. Default is blank (no additional objects).</td>
</tr>
<tr>
<td>DEBUG_FORMAT</td>
<td>Debug ELF file format to generate. Default is `dwarf-2`.</td>
</tr>
<tr>
<td>DEBUG_LEVEL</td>
<td>Level of the debugging information to generate in the compiled object files. Debug is 2 (medium level debugging information).</td>
</tr>
<tr>
<td>COMPILER_PATH</td>
<td>Path to the compiler to use, in case a specific compiler should be substituted for the one in the system's `PATH` variable. Default is blank (use `PATH` provided compiler).</td>
</tr>
</tbody>
</table>
## Provided Variables:
The following variables may be referenced in a user makefile (via `$(NAME)`
syntax) if desired, as they are provided by this module.
<table>
<tbody>
<tr>
<td>N/A</td>
<td>This module provides no variables.</td>
</tr>
</tbody>
</table>
## Provided Macros:
The following macros may be referenced in a user makefile (via
`$(call NAME, ARG1, ARG2, ...)` syntax) if desired, as they are provided by
this module.
<table>
<tbody>
<tr>
<td>N/A</td>
<td>This module provides no macros.</td>
</tr>
</tbody>
</table>
## Module Changelog:
The changes to this module since its initial release are listed below, as of the
DMBS version where the change was made.
### 20160403
Initial release.

View File

@ -0,0 +1,270 @@
#
# DMBS Build System
# Released into the public domain.
#
# dean [at] fourwalledcubicle [dot] com
# www.fourwalledcubicle.com
#
DMBS_BUILD_MODULES += GCC
DMBS_BUILD_TARGETS += size symbol-sizes all lib elf bin hex lss clean mostlyclean
DMBS_BUILD_MANDATORY_VARS += TARGET ARCH MCU SRC
DMBS_BUILD_OPTIONAL_VARS += BOARD OPTIMIZATION C_STANDARD CPP_STANDARD F_CPU C_FLAGS CPP_FLAGS ASM_FLAGS CC_FLAGS LD_FLAGS OBJDIR OBJECT_FILES DEBUG_TYPE DEBUG_LEVEL LINKER_RELAXATIONS COMPILER_PATH
DMBS_BUILD_PROVIDED_VARS +=
DMBS_BUILD_PROVIDED_MACROS +=
# Conditionally import the CORE module of DMBS if it is not already imported
DMBS_MODULE_PATH := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
ifeq ($(findstring CORE, $(DMBS_BUILD_MODULES)),)
include $(DMBS_MODULE_PATH)/core.mk
endif
# Default values of optionally user-supplied variables
COMPILER_PATH ?=
OPTIMIZATION ?= s
F_CPU ?=
C_STANDARD ?= gnu99
CPP_STANDARD ?= gnu++98
C_FLAGS ?=
CPP_FLAGS ?=
ASM_FLAGS ?=
CC_FLAGS ?=
OBJDIR ?= obj
OBJECT_FILES ?=
DEBUG_FORMAT ?= dwarf-2
DEBUG_LEVEL ?= 2
LINKER_RELAXATIONS ?= Y
# Sanity check user supplied values
$(foreach MANDATORY_VAR, $(DMBS_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
$(call ERROR_IF_EMPTY, MCU)
$(call ERROR_IF_EMPTY, TARGET)
$(call ERROR_IF_EMPTY, ARCH)
$(call ERROR_IF_EMPTY, OPTIMIZATION)
$(call ERROR_IF_EMPTY, C_STANDARD)
$(call ERROR_IF_EMPTY, CPP_STANDARD)
$(call ERROR_IF_EMPTY, OBJDIR)
$(call ERROR_IF_EMPTY, DEBUG_FORMAT)
$(call ERROR_IF_EMPTY, DEBUG_LEVEL)
$(call ERROR_IF_NONBOOL, LINKER_RELAXATIONS)
# Determine the utility prefix to use for the selected architecture
ifeq ($(ARCH), AVR8)
CROSS := $(COMPILER_PATH)avr
else ifeq ($(ARCH), XMEGA)
CROSS := $(COMPILER_PATH)avr
else ifeq ($(ARCH), UC3)
CROSS := $(COMPILER_PATH)avr32
else
$(error Unsupported architecture "$(ARCH)")
endif
# Output Messages
MSG_INFO_MESSAGE := ' [INFO] :'
MSG_COMPILE_CMD := ' [GCC] :'
MSG_ASSEMBLE_CMD := ' [GAS] :'
MSG_NM_CMD := ' [NM] :'
MSG_REMOVE_CMD := ' [RM] :'
MSG_LINK_CMD := ' [LNK] :'
MSG_ARCHIVE_CMD := ' [AR] :'
MSG_SIZE_CMD := ' [SIZE] :'
MSG_OBJCPY_CMD := ' [OBJCPY] :'
MSG_OBJDMP_CMD := ' [OBJDMP] :'
# Convert input source file list to differentiate them by type
C_SOURCE := $(filter %.c, $(SRC))
CPP_SOURCE := $(filter %.cpp, $(SRC))
ASM_SOURCE := $(filter %.S, $(SRC))
# Create a list of unknown source file types, if any are found throw an error
UNKNOWN_SOURCE := $(filter-out $(C_SOURCE) $(CPP_SOURCE) $(ASM_SOURCE), $(SRC))
ifneq ($(UNKNOWN_SOURCE),)
$(error Unknown input source file formats: $(UNKNOWN_SOURCE))
endif
# Convert input source filenames into a list of required output object files
OBJECT_FILES += $(addsuffix .o, $(basename $(SRC)))
# Check if an output object file directory was specified instead of the input file location
ifneq ($(OBJDIR),.)
# Prefix all the object filenames with the output object file directory path
OBJECT_FILES := $(addprefix $(patsubst %/,%,$(OBJDIR))/, $(notdir $(OBJECT_FILES)))
# Check if any object file (without path) appears more than once in the object file list
ifneq ($(words $(sort $(OBJECT_FILES))), $(words $(OBJECT_FILES)))
$(error Cannot build with OBJDIR parameter set - one or more object file name is not unique)
endif
# Create the output object file directory if it does not exist and add it to the virtual path list
$(shell mkdir -p $(OBJDIR) 2> /dev/null)
VPATH += $(dir $(SRC))
endif
# Create a list of dependency files from the list of object files
DEPENDENCY_FILES := $(OBJECT_FILES:%.o=%.d)
# Create a list of common flags to pass to the compiler/linker/assembler
BASE_CC_FLAGS := -pipe -g$(DEBUG_FORMAT) -g$(DEBUG_LEVEL)
ifneq ($(findstring $(ARCH), AVR8 XMEGA),)
BASE_CC_FLAGS += -mmcu=$(MCU) -fshort-enums -fno-inline-small-functions -fpack-struct
else ifneq ($(findstring $(ARCH), UC3),)
BASE_CC_FLAGS += -mpart=$(MCU:at32%=%) -masm-addr-pseudos
endif
BASE_CC_FLAGS += -Wall -fno-strict-aliasing -funsigned-char -funsigned-bitfields -ffunction-sections
BASE_CC_FLAGS += -I.
BASE_CC_FLAGS += -DARCH=ARCH_$(ARCH)
ifneq ($(F_CPU),)
BASE_CC_FLAGS += -DF_CPU=$(F_CPU)UL
endif
ifeq ($(LINKER_RELAXATIONS), Y)
BASE_CC_FLAGS += -mrelax
endif
# Additional language specific compiler flags
BASE_C_FLAGS := -x c -O$(OPTIMIZATION) -std=$(C_STANDARD) -Wstrict-prototypes
BASE_CPP_FLAGS := -x c++ -O$(OPTIMIZATION) -std=$(CPP_STANDARD)
BASE_ASM_FLAGS := -x assembler-with-cpp
# This flag is required for bootloaders as GCC will emit invalid jump table
# assembly code for devices with large amounts of flash; the jump table target
# is extracted from FLASH without using the correct ELPM instruction, resulting
# in a pseudo-random jump target.
BASE_CC_FLAGS += -fno-jump-tables
# Create a list of flags to pass to the linker
BASE_LD_FLAGS := -lm -Wl,-Map=$(TARGET).map,--cref -Wl,--gc-sections
ifeq ($(LINKER_RELAXATIONS), Y)
BASE_LD_FLAGS += -Wl,--relax
endif
ifneq ($(findstring $(ARCH), AVR8 XMEGA),)
BASE_LD_FLAGS += -mmcu=$(MCU)
else ifneq ($(findstring $(ARCH), UC3),)
BASE_LD_FLAGS += -mpart=$(MCU:at32%=%) --rodata-writable --direct-data
endif
# Determine flags to pass to the size utility based on its reported features (only invoke if size target required)
# and on an architecture where this non-standard patch is available
ifneq ($(ARCH), UC3)
size: SIZE_MCU_FLAG := $(shell $(CROSS)-size --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
size: SIZE_FORMAT_FLAG := $(shell $(CROSS)-size --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
endif
# Pre-build informational target, to give compiler and project name information when building
build_begin:
@echo $(MSG_INFO_MESSAGE) Begin compilation of project \"$(TARGET)\"...
@echo ""
@$(CROSS)-gcc --version
# Post-build informational target, to project name information when building has completed
build_end:
@echo $(MSG_INFO_MESSAGE) Finished building project \"$(TARGET)\".
# Prints size information of a compiled application (FLASH, RAM and EEPROM usages)
size: $(TARGET).elf
@echo $(MSG_SIZE_CMD) Determining size of \"$<\"
@echo ""
$(CROSS)-size $(SIZE_MCU_FLAG) $(SIZE_FORMAT_FLAG) $<
# Prints size information on the symbols within a compiled application in decimal bytes
symbol-sizes: $(TARGET).elf
@echo $(MSG_NM_CMD) Extracting \"$<\" symbols with decimal byte sizes
$(CROSS)-nm --size-sort --demangle --radix=d $<
# Cleans intermediary build files, leaving only the compiled application files
mostlyclean:
@echo $(MSG_REMOVE_CMD) Removing object files of \"$(TARGET)\"
rm -f $(OBJECT_FILES)
@echo $(MSG_REMOVE_CMD) Removing dependency files of \"$(TARGET)\"
rm -f $(DEPENDENCY_FILES)
# Cleans all build files, leaving only the original source code
clean: mostlyclean
@echo $(MSG_REMOVE_CMD) Removing output files of \"$(TARGET)\"
rm -f $(TARGET).elf $(TARGET).hex $(TARGET).bin $(TARGET).eep $(TARGET).map $(TARGET).lss $(TARGET).sym lib$(TARGET).a
# Performs a complete build of the user application and prints size information afterwards
all: build_begin elf hex bin lss sym size build_end
# Helper targets, to build a specific type of output file without having to know the project target name
lib: lib$(TARGET).a
elf: $(TARGET).elf
hex: $(TARGET).hex $(TARGET).eep
bin: $(TARGET).bin
lss: $(TARGET).lss
sym: $(TARGET).sym
# Default target to *create* the user application's specified source files; if this rule is executed by
# make, the input source file doesn't exist and an error needs to be presented to the user
$(SRC):
$(error Source file does not exist: $@)
# Compiles an input C source file and generates an assembly listing for it
%.s: %.c $(MAKEFILE_LIST)
@echo $(MSG_COMPILE_CMD) Generating assembly from C file \"$(notdir $<)\"
$(CROSS)-gcc -S $(BASE_CC_FLAGS) $(BASE_C_FLAGS) $(CC_FLAGS) $(C_FLAGS) $< -o $@
# Compiles an input C++ source file and generates an assembly listing for it
%.s: %.cpp $(MAKEFILE_LIST)
@echo $(MSG_COMPILE_CMD) Generating assembly from C++ file \"$(notdir $<)\"
$(CROSS)-gcc -S $(BASE_CC_FLAGS) $(BASE_CPP_FLAGS) $(CC_FLAGS) $(CPP_FLAGS) $< -o $@
# Compiles an input C source file and generates a linkable object file for it
$(OBJDIR)/%.o: %.c $(MAKEFILE_LIST)
@echo $(MSG_COMPILE_CMD) Compiling C file \"$(notdir $<)\"
$(CROSS)-gcc -c $(BASE_CC_FLAGS) $(BASE_C_FLAGS) $(CC_FLAGS) $(C_FLAGS) -MMD -MP -MF $(@:%.o=%.d) $< -o $@
# Compiles an input C++ source file and generates a linkable object file for it
$(OBJDIR)/%.o: %.cpp $(MAKEFILE_LIST)
@echo $(MSG_COMPILE_CMD) Compiling C++ file \"$(notdir $<)\"
$(CROSS)-gcc -c $(BASE_CC_FLAGS) $(BASE_CPP_FLAGS) $(CC_FLAGS) $(CPP_FLAGS) -MMD -MP -MF $(@:%.o=%.d) $< -o $@
# Assembles an input ASM source file and generates a linkable object file for it
$(OBJDIR)/%.o: %.S $(MAKEFILE_LIST)
@echo $(MSG_ASSEMBLE_CMD) Assembling \"$(notdir $<)\"
$(CROSS)-gcc -c $(BASE_CC_FLAGS) $(BASE_ASM_FLAGS) $(CC_FLAGS) $(ASM_FLAGS) -MMD -MP -MF $(@:%.o=%.d) $< -o $@
# Generates a library archive file from the user application, which can be linked into other applications
.PRECIOUS : $(OBJECT_FILES)
.SECONDARY : %.a
%.a: $(OBJECT_FILES)
@echo $(MSG_ARCHIVE_CMD) Archiving object files into \"$@\"
$(CROSS)-ar rcs $@ $(OBJECT_FILES)
# Generates an ELF debug file from the user application, which can be further processed for FLASH and EEPROM data
# files, or used for programming and debugging directly
.PRECIOUS : $(OBJECT_FILES)
.SECONDARY : %.elf
%.elf: $(OBJECT_FILES)
@echo $(MSG_LINK_CMD) Linking object files into \"$@\"
$(CROSS)-gcc $^ -o $@ $(BASE_LD_FLAGS) $(LD_FLAGS)
# Extracts out the loadable FLASH memory data from the project ELF file, and creates an Intel HEX format file of it
%.hex: %.elf
@echo $(MSG_OBJCPY_CMD) Extracting HEX file data from \"$<\"
$(CROSS)-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature $< $@
# Extracts out the loadable FLASH memory data from the project ELF file, and creates an Binary format file of it
%.bin: %.elf
@echo $(MSG_OBJCPY_CMD) Extracting BIN file data from \"$<\"
$(CROSS)-objcopy -O binary -R .eeprom -R .fuse -R .lock -R .signature $< $@
# Extracts out the loadable EEPROM memory data from the project ELF file, and creates an Intel HEX format file of it
%.eep: %.elf
@echo $(MSG_OBJCPY_CMD) Extracting EEP file data from \"$<\"
$(CROSS)-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings $< $@ || exit 0
# Creates an assembly listing file from an input project ELF file, containing interleaved assembly and source data
%.lss: %.elf
@echo $(MSG_OBJDMP_CMD) Extracting LSS file data from \"$<\"
$(CROSS)-objdump -h -d -S -z $< > $@
# Creates a symbol file listing the loadable and discarded symbols from an input project ELF file
%.sym: %.elf
@echo $(MSG_NM_CMD) Extracting SYM file data from \"$<\"
$(CROSS)-nm -n $< > $@
# Include build dependency files
-include $(DEPENDENCY_FILES)
# Phony build targets for this module
.PHONY: build_begin build_end $(DMBS_BUILD_TARGETS)

View File

@ -0,0 +1,129 @@
DMBS - Dean's Makefile Build System
===================================
Module: HID
-----------------
The HID module provides build targets to program a target running a PJRC Teensy
or LUFA compatible HID class bootloader.
## Importing This Module into a Makefile:
To use this module in your application makefile, add the following code to your
makefile:
include $(DMBS_PATH)/hid.mk
## Prerequisites:
This module requires the `teensy_loader_cli` utility to be available in your
system's `PATH` variable. The `teensy_loader_cli` utility is distributed in
a modified form (from PJRC) in the LUFA project's
[official site](http://www.lufa-lib.org/), but is also
made available in its original form directly from the
[PJRC website](https://www.pjrc.com/teensy/loader_cli.html). Note that the
original tool works with Teensy boards only, and not LUFA HID bootloader
devices.
This module requires the `hid_bootloader_cli` utility to be available in your
system's `PATH` variable. The `hid_bootloader_cli` Python script utility is
distributed in LUFA project's [official site](http://www.lufa-lib.org/).
This module requires the AVR-GCC compiler to be installed and available in the
system's `PATH` variable.
## Build Targets:
The following targets are supported by this module:
<table>
<tbody>
<tr>
<td>hid</td>
<td>Program a LUFA HID class bootloader device, using the `hid_bootloader_cli.py` Python script.</td>
</tr>
<tr>
<td>hid-ee</td>
<td>Program a LUFA HID class bootloader device's EEPROM, using the `hid_bootloader_cli.py` Python script and a shim application which is programmed into the target's flash.</td>
</tr>
<tr>
<td>teensy</td>
<td>Program a LUFA HID class bootloader device or Teensy board, using the `teensy_loader_cli` tool.</td>
</tr>
<tr>
<td>teensy-ee</td>
<td>Program a LUFA HID class bootloader device's EEPROM, using the `teensy_loader_cli` tool and a shim application which is programmed into the target's flash.</td>
</tr>
</tbody>
</table>
## Mandatory Variables:
The following variables must be defined (with a `NAME = VALUE` syntax, one
variable per line) in the user makefile to be able to use this module:
<table>
<tbody>
<tr>
<td>MCU</td>
<td>Name of the Atmel processor model (e.g. `at90usb1287`).</td>
</tr>
<tr>
<td>TARGET</td>
<td>Name of the application output file prefix (e.g. `TestApplication`).</td>
</tr>
</tbody>
</table>
## Optional Variables:
The following variables may be defined (with a `NAME = VALUE` syntax, one
variable per line) in the user makefile. If not specified, a default value will
be assumed.
<table>
<tbody>
<tr>
<td>N/A</td>
<td>This module has no optional variables.</td>
</tr>
</tbody>
</table>
## Provided Variables:
The following variables may be referenced in a user makefile (via `$(NAME)`
syntax) if desired, as they are provided by this module.
<table>
<tbody>
<tr>
<td>N/A</td>
<td>This module provides no variables.</td>
</tr>
</tbody>
</table>
## Provided Macros:
The following macros may be referenced in a user makefile (via
`$(call NAME, ARG1, ARG2, ...)` syntax) if desired, as they are provided by
this module.
<table>
<tbody>
<tr>
<td>N/A</td>
<td>This module provides no macros.</td>
</tr>
</tbody>
</table>
## Module Changelog:
The changes to this module since its initial release are listed below, as of the
DMBS version where the change was made.
### 20160403
Initial release.

View File

@ -0,0 +1,57 @@
#
# DMBS Build System
# Released into the public domain.
#
# dean [at] fourwalledcubicle [dot] com
# www.fourwalledcubicle.com
#
DMBS_BUILD_MODULES += HID
DMBS_BUILD_TARGETS += hid hid-ee teensy teensy-ee
DMBS_BUILD_MANDATORY_VARS += MCU TARGET
DMBS_BUILD_OPTIONAL_VARS +=
DMBS_BUILD_PROVIDED_VARS +=
DMBS_BUILD_PROVIDED_MACROS +=
# Conditionally import the CORE module of DMBS if it is not already imported
DMBS_MODULE_PATH := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
ifeq ($(findstring CORE, $(DMBS_BUILD_MODULES)),)
include $(DMBS_MODULE_PATH)/core.mk
endif
# Sanity-check values of mandatory user-supplied variables
$(foreach MANDATORY_VAR, $(DMBS_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
$(call ERROR_IF_EMPTY, MCU)
$(call ERROR_IF_EMPTY, TARGET)
# Output Messages
MSG_HID_BOOTLOADER_CMD := ' [HID] :'
MSG_OBJCPY_CMD := ' [OBJCPY] :'
MSG_MAKE_CMD := ' [MAKE] :'
# Programs in the target FLASH memory using the HID_BOOTLOADER_CLI tool
hid: $(TARGET).hex $(MAKEFILE_LIST)
@echo $(MSG_HID_BOOTLOADER_CMD) Programming FLASH with hid_bootloader_cli using \"$<\"
hid_bootloader_cli -mmcu=$(MCU) -v $<
# Programs in the target EEPROM memory using the HID_BOOTLOADER_CLI tool (note: clears target FLASH memory)
hid-ee: $(TARGET).eep $(MAKEFILE_LIST)
@echo $(MSG_OBJCPY_CMD) Converting \"$<\" to a binary file \"InputEEData.bin\"
avr-objcopy -I ihex -O binary $< $(DMBS_MODULE_PATH)/HID_EEPROM_Loader/InputEEData.bin
@echo $(MSG_MAKE_CMD) Making EEPROM loader application for \"$<\"
$(MAKE) -C $(DMBS_MODULE_PATH)/HID_EEPROM_Loader/ MCU=$(MCU) clean hid
# Programs in the target FLASH memory using the TEENSY_BOOTLOADER_CLI tool
teensy: $(TARGET).hex $(MAKEFILE_LIST)
@echo $(MSG_HID_BOOTLOADER_CMD) Programming FLASH with teensy_loader_cli using \"$<\"
teensy_loader_cli -mmcu=$(MCU) -v $<
# Programs in the target EEPROM memory using the TEENSY_BOOTLOADER_CLI tool (note: clears target FLASH memory)
teensy-ee: $(TARGET).hex $(MAKEFILE_LIST)
@echo $(MSG_OBJCPY_CMD) Converting \"$<\" to a binary file \"InputEEData.bin\"
avr-objcopy -I ihex -O binary $< $(DMBS_MODULE_PATH)/HID_EEPROM_Loader/InputEEData.bin
@echo $(MSG_MAKE_CMD) Making EEPROM loader application for \"$<\"
$(MAKE) -s -C $(DMBS_MODULE_PATH)/HID_EEPROM_Loader/ MCU=$(MCU) clean teensy
# Phony build targets for this module
.PHONY: $(DMBS_BUILD_TARGETS)

View File

@ -0,0 +1,123 @@
DMBS - Dean's Makefile Build System
===================================
Project Overview
----------------
GNU Make is scary, and it's tough to get the rules right sometimes. Many
projects get by via simple copy-pasting of old makefiles, resulting in many
redundant copies of the same old rules. DMBS aims to solve this by providing a
simple modular set of makefiles which can be included by your project to quickly
add various build functionality.
This aims to replace the old WinAVR "mfile" makefile template, giving better
functionality and much simpler user makefiles.
Benefits:
----------------
Apart from much simpler, cleaner makefiles DMBS carries the aim of making the
process of troubleshooting build issues a little easier. Lots can go wrong, so
DMBS tries to sanity check its inputs wherever possible, and produce
human-readable error messages. Forgotten to set a variable? Get a
`Makefile {X} value not set.` message, rather than a possibly unrelated message.
Have the wrong filename? See `Source file does not exist: {X}` rather than the
infamous `No rule to make target {X}` message.
Use:
----------------
A template user makefile is provided in the `Template` directory. DMBS modules
are included via a GNU Make `include` directive. While the DMBS `core` module is
always required, you can pick and choose what other modules you wish to add to
your user project.
[See here for the documentation on the individual modules provided by DMBS.](DMBS/ModulesOverview.md)
If you're interested in writing your own DMBS module(s), [see here.](DMBS/WritingYourOwnModules.md)
Here's an example user makefile:
MCU = atmega128
ARCH = AVR8
F_CPU = 8000000
OPTIMIZATION = s
TARGET = Template
SRC = $(TARGET).c
CC_FLAGS =
LD_FLAGS =
# Default target
all:
# Include DMBS build script makefiles
DMBS_PATH ?= ../DMBS
include $(DMBS_PATH)/core.mk
include $(DMBS_PATH)/gcc.mk
include $(DMBS_PATH)/cppcheck.mk
include $(DMBS_PATH)/doxygen.mk
include $(DMBS_PATH)/dfu.mk
include $(DMBS_PATH)/hid.mk
include $(DMBS_PATH)/avrdude.mk
include $(DMBS_PATH)/atprogram.mk
Each DMBS module can optionally supply one or more Make variables and macros,
which you can reference in your user makefile. Additionally, modules can require
one or more variables to be set by the user makefile, with (in some cases) sane
defaults used if left out.
As modules are added, you can get a list of available targets by simply typing
`make help` from the command line. This will produce a formatted list of targets
as well as mandatory and optional variables and exposed variables and macros.
Distribution
----------------
You can embed DMBS in your project any way you like - some options are:
1. A git submodule
2. A source tarball
3. A manually copied extracted archive
The intention of DMBS is that users can just import it from whatever source
they like. If your project needs to extend the existing modules in an unusual
manner, or if you want to provide your own modules, you can include them in
your project repository (or submit a patch to DMBS if your module is generic
enough to warrant wide use).
License
----------------
DMBS is released into the public domain, making is suitable for use everywhere,
by everyone. Contributions are greatly appreciated however, in order to make
DMBS better for everyone.
The actual license text is as follows:
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org/>

View File

@ -0,0 +1,12 @@
/*
DMBS Build System
Released into the public domain.
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
int main(void)
{
// Application code here.
}

View File

@ -0,0 +1,32 @@
#
# DMBS Build System
# Released into the public domain.
#
# dean [at] fourwalledcubicle [dot] com
# www.fourwalledcubicle.com
#
# Run "make help" for target help.
MCU = atmega128
ARCH = AVR8
F_CPU = 8000000
OPTIMIZATION = s
TARGET = Template
SRC = $(TARGET).c
CC_FLAGS =
LD_FLAGS =
# Default target
all:
# Include DMBS build script makefiles
DMBS_PATH ?= ../DMBS
include $(DMBS_PATH)/core.mk
include $(DMBS_PATH)/gcc.mk
include $(DMBS_PATH)/cppcheck.mk
include $(DMBS_PATH)/doxygen.mk
include $(DMBS_PATH)/dfu.mk
include $(DMBS_PATH)/hid.mk
include $(DMBS_PATH)/avrdude.mk
include $(DMBS_PATH)/atprogram.mk

View File

@ -0,0 +1,43 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2015.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
#
DMBS_BUILD_MODULES += LUFA_GCC
DMBS_BUILD_TARGETS +=
DMBS_BUILD_MANDATORY_VARS += LUFA_PATH ARCH F_USB
DMBS_BUILD_OPTIONAL_VARS += BOARD
DMBS_BUILD_PROVIDED_VARS +=
DMBS_BUILD_PROVIDED_MACROS +=
SHELL = /bin/sh
ERROR_IF_UNSET ?= $(if $(filter undefined, $(origin $(strip $(1)))), $(error Makefile $(strip $(1)) value not set))
ERROR_IF_EMPTY ?= $(if $(strip $($(strip $(1)))), , $(error Makefile $(strip $(1)) option cannot be blank))
ERROR_IF_NONBOOL ?= $(if $(filter Y N, $($(strip $(1)))), , $(error Makefile $(strip $(1)) option must be Y or N))
# Sanity check user supplied values
$(call ERROR_IF_EMPTY, LUFA_PATH)
$(call ERROR_IF_EMPTY, ARCH)
$(call ERROR_IF_EMPTY, F_USB)
# Default values of optionally user-supplied variables
BOARD ?= NONE
# Determine the utility prefix to use for the selected architecture
ifeq ($(ARCH), XMEGA)
$(warning The XMEGA device support is currently EXPERIMENTAL (incomplete and/or non-functional), and is included for preview purposes only.)
else ifeq ($(ARCH), UC3)
$(warning The UC3 device support is currently EXPERIMENTAL (incomplete and/or non-functional), and is included for preview purposes only.)
endif
# Common LUFA C/C++ includes/definitions
LUFA_CXX_INCLUDES = -I. -I$(patsubst %/,%,$(LUFA_PATH))/..
LUFA_CXX_DEFINES = -DARCH=ARCH_$(ARCH) -DBOARD=BOARD_$(BOARD) -DF_USB=$(F_USB)UL
# LUFA specific standard build options
C_FLAGS += $(LUFA_CXX_INCLUDES) $(LUFA_CXX_DEFINES) $(LUFA_CXX_FLAGS)
CPP_FLAGS += $(LUFA_CXX_INCLUDES) $(LUFA_CXX_DEFINES) $(LUFA_CXX_FLAGS)

View File

@ -0,0 +1,95 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2015.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
#
DMBS_BUILD_MODULES += LUFA_SOURCES
DMBS_BUILD_TARGETS +=
DMBS_BUILD_MANDATORY_VARS += LUFA_PATH ARCH
DMBS_BUILD_OPTIONAL_VARS +=
DMBS_BUILD_PROVIDED_VARS += LUFA_SRC_USB_DEVICE LUFA_SRC_USB_HOST \
LUFA_SRC_USB LUFA_SRC_USBCLASS_DEVICE \
LUFA_SRC_USBCLASS_HOST LUFA_SRC_USBCLASS \
LUFA_SRC_TEMPERATURE LUFA_SRC_SERIAL \
LUFA_SRC_TWI LUFA_SRC_PLATFORM
DMBS_BUILD_PROVIDED_MACROS +=
SHELL = /bin/sh
ERROR_IF_UNSET ?= $(if $(filter undefined, $(origin $(strip $(1)))), $(error Makefile $(strip $(1)) value not set))
ERROR_IF_EMPTY ?= $(if $(strip $($(strip $(1)))), , $(error Makefile $(strip $(1)) option cannot be blank))
ERROR_IF_NONBOOL ?= $(if $(filter Y N, $($(strip $(1)))), , $(error Makefile $(strip $(1)) option must be Y or N))
# Sanity check user supplied values
$(foreach MANDATORY_VAR, $(LUFA_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
$(call ERROR_IF_EMPTY, LUFA_PATH)
$(call ERROR_IF_EMPTY, ARCH)
# Allow LUFA_ROOT_PATH to be overridden elsewhere to support legacy LUFA makefiles
LUFA_ROOT_PATH ?= $(patsubst %/,%,$(LUFA_PATH))
# Construct LUFA module source variables
LUFA_SRC_USB_COMMON := $(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/USBController_$(ARCH).c \
$(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/USBInterrupt_$(ARCH).c \
$(LUFA_ROOT_PATH)/Drivers/USB/Core/ConfigDescriptors.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Core/Events.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Core/USBTask.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Common/HIDParser.c \
LUFA_SRC_USB_HOST := $(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/Host_$(ARCH).c \
$(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/Pipe_$(ARCH).c \
$(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/PipeStream_$(ARCH).c \
$(LUFA_ROOT_PATH)/Drivers/USB/Core/HostStandardReq.c \
$(LUFA_SRC_USB_COMMON)
LUFA_SRC_USB_DEVICE := $(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/Device_$(ARCH).c \
$(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/Endpoint_$(ARCH).c \
$(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/EndpointStream_$(ARCH).c \
$(LUFA_ROOT_PATH)/Drivers/USB/Core/DeviceStandardReq.c \
$(LUFA_SRC_USB_COMMON)
LUFA_SRC_USBCLASS_DEVICE := $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/AudioClassDevice.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/CDCClassDevice.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/HIDClassDevice.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/MassStorageClassDevice.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/MIDIClassDevice.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/PrinterClassDevice.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/RNDISClassDevice.c \
LUFA_SRC_USBCLASS_HOST := $(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/AudioClassHost.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/CDCClassHost.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/HIDClassHost.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/MassStorageClassHost.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/MIDIClassHost.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/PrinterClassHost.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/RNDISClassHost.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/StillImageClassHost.c
LUFA_SRC_USB := $(sort $(LUFA_SRC_USB_COMMON) $(LUFA_SRC_USB_HOST) $(LUFA_SRC_USB_DEVICE))
LUFA_SRC_USBCLASS := $(LUFA_SRC_USBCLASS_DEVICE) $(LUFA_SRC_USBCLASS_HOST)
LUFA_SRC_TEMPERATURE := $(LUFA_ROOT_PATH)/Drivers/Board/Temperature.c
LUFA_SRC_SERIAL := $(LUFA_ROOT_PATH)/Drivers/Peripheral/$(ARCH)/Serial_$(ARCH).c
LUFA_SRC_TWI := $(LUFA_ROOT_PATH)/Drivers/Peripheral/$(ARCH)/TWI_$(ARCH).c
ifeq ($(ARCH), UC3)
LUFA_SRC_PLATFORM := $(LUFA_ROOT_PATH)/Platform/UC3/Exception.S \
$(LUFA_ROOT_PATH)/Platform/UC3/InterruptManagement.c
else
LUFA_SRC_PLATFORM :=
endif
# Build a list of all available module sources
LUFA_SRC_ALL_FILES := $(LUFA_SRC_USB) \
$(LUFA_SRC_USBCLASS) \
$(LUFA_SRC_TEMPERATURE) \
$(LUFA_SRC_SERIAL) \
$(LUFA_SRC_TWI) \
$(LUFA_SRC_PLATFORM)

View File

@ -1,103 +1,10 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2014.
# Copyright (C) Dean Camera, 2015.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
#
LUFA_BUILD_MODULES += ATPROGRAM
LUFA_BUILD_TARGETS += atprogram atprogram-ee
LUFA_BUILD_MANDATORY_VARS += MCU TARGET
LUFA_BUILD_OPTIONAL_VARS += ATPROGRAM_PROGRAMMER ATPROGRAM_INTERFACE ATPROGRAM_PORT
LUFA_BUILD_PROVIDED_VARS +=
LUFA_BUILD_PROVIDED_MACROS +=
# -----------------------------------------------------------------------------
# LUFA ATPROGRAM Programmer Buildsystem Makefile Module.
# -----------------------------------------------------------------------------
# DESCRIPTION:
# Provides a set of targets to re-program a device using the Atmel atprogram
# utility in AVR Studio 5.x and Atmel Studio 6.0 onwards.
# -----------------------------------------------------------------------------
# TARGETS:
#
# atprogram - Program target FLASH with application using
# atprogram
# atprogram-ee - Program target EEPROM with application data
# using atprogram
#
# MANDATORY PARAMETERS:
#
# MCU - Microcontroller device model name
# TARGET - Application name
#
# OPTIONAL PARAMETERS:
#
# ATPROGRAM_PROGRAMMER - Name of programming hardware to use
# ATPROGRAM_INTERFACE - Name of programming interface to use
# ATPROGRAM_PORT - Name of communication port to use
#
# PROVIDED VARIABLES:
#
# (None)
#
# PROVIDED MACROS:
#
# (None)
#
# -----------------------------------------------------------------------------
SHELL = /bin/sh
ERROR_IF_UNSET ?= $(if $(filter undefined, $(origin $(strip $(1)))), $(error Makefile $(strip $(1)) value not set))
ERROR_IF_EMPTY ?= $(if $(strip $($(strip $(1)))), , $(error Makefile $(strip $(1)) option cannot be blank))
ERROR_IF_NONBOOL ?= $(if $(filter Y N, $($(strip $(1)))), , $(error Makefile $(strip $(1)) option must be Y or N))
# Default values of optionally user-supplied variables
ATPROGRAM_PROGRAMMER ?= jtagice3
ATPROGRAM_INTERFACE ?= jtag
ATPROGRAM_PORT ?=
# Sanity check user supplied values
$(foreach MANDATORY_VAR, $(LUFA_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
$(call ERROR_IF_EMPTY, MCU)
$(call ERROR_IF_EMPTY, TARGET)
$(call ERROR_IF_EMPTY, ATPROGRAM_PROGRAMMER)
$(call ERROR_IF_EMPTY, ATPROGRAM_INTERFACE)
# Output Messages
MSG_ATPROGRAM_CMD := ' [ATPRGRM] :'
# Construct base atprogram command flags
BASE_ATPROGRAM_FLAGS := --tool $(ATPROGRAM_PROGRAMMER) --interface $(ATPROGRAM_INTERFACE) --device $(MCU)
ifneq ($(ATPROGRAM_PORT),)
BASE_ATPROGRAM_FLAGS += --port $(ATPROGRAM_PORT)
endif
# Construct the flags to use for the various memory spaces
ifeq ($(ARCH), AVR8)
ATPROGRAM_FLASH_FLAGS := --chiperase --flash
ATPROGRAM_EEPROM_FLAGS := --eeprom
else ifeq ($(ARCH), XMEGA)
ATPROGRAM_FLASH_FLAGS := --erase --flash
ATPROGRAM_EEPROM_FLAGS := --eeprom
else ifeq ($(ARCH), UC3)
ATPROGRAM_FLASH_FLAGS := --erase
ATPROGRAM_EEPROM_FLAGS := --eeprom
else
$(error Unsupported architecture "$(ARCH)")
endif
# Programs in the target FLASH memory using ATPROGRAM
atprogram: $(TARGET).elf $(MAKEFILE_LIST)
@echo $(MSG_ATPROGRAM_CMD) Programming device \"$(MCU)\" FLASH using \"$(ATPROGRAM_PROGRAMMER)\"
atprogram $(BASE_ATPROGRAM_FLAGS) program $(ATPROGRAM_FLASH_FLAGS) --file $<
# Programs in the target EEPROM memory using ATPROGRAM
atprogram-ee: $(TARGET).elf $(MAKEFILE_LIST)
@echo $(MSG_ATPROGRAM_CMD) Programming device \"$(MCU)\" EEPROM using \"$(ATPROGRAM_PROGRAMMER)\"
atprogram $(BASE_ATPROGRAM_FLAGS) program $(ATPROGRAM_EEPROM_FLAGS) --file $<
# Phony build targets for this module
.PHONY: atprogram atprogram-ee
DMBS_PATH := $(LUFA_PATH)/Build/DMBS/DMBS
include $(DMBS_PATH)/atprogram.mk

View File

@ -1,86 +1,10 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2014.
# Copyright (C) Dean Camera, 2015.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
#
LUFA_BUILD_MODULES += AVRDUDE
LUFA_BUILD_TARGETS += avrdude avrdude-ee
LUFA_BUILD_MANDATORY_VARS += MCU TARGET
LUFA_BUILD_OPTIONAL_VARS += AVRDUDE_PROGRAMMER AVRDUDE_PORT AVRDUDE_FLAGS
LUFA_BUILD_PROVIDED_VARS +=
LUFA_BUILD_PROVIDED_MACROS +=
# -----------------------------------------------------------------------------
# LUFA AVRDUDE Programmer Buildsystem Makefile Module.
# -----------------------------------------------------------------------------
# DESCRIPTION:
# Provides a set of targets to re-program a device using the open source
# avr-dude utility.
# -----------------------------------------------------------------------------
# TARGETS:
#
# avrdude - Program target FLASH with application using
# avrdude
# avrdude-ee - Program target EEPROM with application data
# using avrdude
#
# MANDATORY PARAMETERS:
#
# MCU - Microcontroller device model name
# TARGET - Application name
#
# OPTIONAL PARAMETERS:
#
# AVRDUDE_PROGRAMMER - Name of programming hardware to use
# AVRDUDE_PORT - Name of communication port to use
# AVRDUDE_FLAGS - Flags to pass to avr-dude
#
# PROVIDED VARIABLES:
#
# (None)
#
# PROVIDED MACROS:
#
# (None)
#
# -----------------------------------------------------------------------------
SHELL = /bin/sh
ERROR_IF_UNSET ?= $(if $(filter undefined, $(origin $(strip $(1)))), $(error Makefile $(strip $(1)) value not set))
ERROR_IF_EMPTY ?= $(if $(strip $($(strip $(1)))), , $(error Makefile $(strip $(1)) option cannot be blank))
ERROR_IF_NONBOOL ?= $(if $(filter Y N, $($(strip $(1)))), , $(error Makefile $(strip $(1)) option must be Y or N))
# Default values of optionally user-supplied variables
AVRDUDE_PROGRAMMER ?= jtagicemkii
AVRDUDE_PORT ?= usb
AVRDUDE_FLAGS ?=
# Sanity check user supplied values
$(foreach MANDATORY_VAR, $(LUFA_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
$(call ERROR_IF_EMPTY, MCU)
$(call ERROR_IF_EMPTY, TARGET)
$(call ERROR_IF_EMPTY, AVRDUDE_PROGRAMMER)
$(call ERROR_IF_EMPTY, AVRDUDE_PORT)
# Output Messages
MSG_AVRDUDE_CMD := ' [AVRDUDE] :'
# Construct base avrdude command flags
BASE_AVRDUDE_FLAGS := -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
# Programs in the target FLASH memory using AVRDUDE
avrdude: $(TARGET).hex $(MAKEFILE_LIST)
@echo $(MSG_AVRDUDE_CMD) Programming device \"$(MCU)\" FLASH using \"$(AVRDUDE_PROGRAMMER)\" on port \"$(AVRDUDE_PORT)\"
avrdude $(BASE_AVRDUDE_FLAGS) -U flash:w:$< $(AVRDUDE_FLAGS)
# Programs in the target EEPROM memory using AVRDUDE
avrdude-ee: $(TARGET).eep $(MAKEFILE_LIST)
@echo $(MSG_AVRDUDE_CMD) Programming device \"$(MCU)\" EEPROM using \"$(AVRDUDE_PROGRAMMER)\" on port \"$(AVRDUDE_PORT)\"
avrdude $(BASE_AVRDUDE_FLAGS) -U eeprom:w:$< $(AVRDUDE_FLAGS)
# Phony build targets for this module
.PHONY: avrdude avrdude-ee
DMBS_PATH := $(LUFA_PATH)/Build/DMBS/DMBS
include $(DMBS_PATH)/avrdude.mk

View File

@ -1,351 +1,12 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2014.
# Copyright (C) Dean Camera, 2015.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
#
LUFA_BUILD_MODULES += BUILD
LUFA_BUILD_TARGETS += size symbol-sizes all lib elf bin hex lss clean mostlyclean
LUFA_BUILD_MANDATORY_VARS += TARGET ARCH MCU SRC F_USB LUFA_PATH
LUFA_BUILD_OPTIONAL_VARS += BOARD OPTIMIZATION C_STANDARD CPP_STANDARD F_CPU C_FLAGS CPP_FLAGS ASM_FLAGS CC_FLAGS LD_FLAGS OBJDIR OBJECT_FILES DEBUG_TYPE DEBUG_LEVEL LINKER_RELAXATIONS COMPILER_PATH
LUFA_BUILD_PROVIDED_VARS +=
LUFA_BUILD_PROVIDED_MACROS +=
# -----------------------------------------------------------------------------
# LUFA GCC Compiler Buildsystem Makefile Module.
# -----------------------------------------------------------------------------
# DESCRIPTION:
# Provides a set of targets to build a C, C++ and/or Assembly application
# via the AVR-GCC compiler.
# -----------------------------------------------------------------------------
# TARGETS:
#
# size - List built application size
# symbol-sizes - Print application symbols from the binary ELF
# file as a list sorted by size in bytes
# all - Build application and list size
# lib - Build and archive source files into a library
# elf - Build application ELF debug object file
# bin - Build application BIN binary object file
# hex - Build application HEX object file
# lss - Build application LSS assembly listing file
# clean - Remove all project intermediary and binary
# output files
# mostlyclean - Remove intermediary output files, but
# preserve binaries
# <filename>.s - Compile C/C++ source file into an assembly file
# for manual code inspection
#
# MANDATORY PARAMETERS:
#
# TARGET - Application name
# ARCH - Device architecture name
# MCU - Microcontroller device model name
# SRC - List of input source files (*.c, *.cpp, *.S)
# F_USB - Speed of the input clock of the USB controller
# in Hz
# LUFA_PATH - Path to the LUFA library core
#
# OPTIONAL PARAMETERS:
#
# BOARD - LUFA board hardware
# OPTIMIZATION - Optimization level
# C_STANDARD - C Language Standard to use
# CPP_STANDARD - C++ Language Standard to use
# F_CPU - Speed of the CPU, in Hz
# C_FLAGS - Flags to pass to the C compiler only
# CPP_FLAGS - Flags to pass to the C++ compiler only
# ASM_FLAGS - Flags to pass to the assembler only
# CC_FLAGS - Common flags to pass to the C/C++ compiler and
# assembler
# LD_FLAGS - Flags to pass to the linker
# LINKER_RELAXATIONS - Enable or disable linker relaxations to
# decrease binary size (note: can cause link
# failures on systems with an unpatched binutils)
# OBJDIR - Directory for the output object and dependency
# files; if equal to ".", the output files will
# be generated in the same folder as the sources
# OBJECT_FILES - Extra object files to link in to the binaries
# DEBUG_FORMAT - Format of the debugging information to
# generate in the compiled object files
# DEBUG_LEVEL - Level the debugging information to generate in
# the compiled object files
# COMPILER_PATH - Location of the GCC toolchain to use
#
# PROVIDED VARIABLES:
#
# (None)
#
# PROVIDED MACROS:
#
# (None)
#
# -----------------------------------------------------------------------------
SHELL = /bin/sh
ERROR_IF_UNSET ?= $(if $(filter undefined, $(origin $(strip $(1)))), $(error Makefile $(strip $(1)) value not set))
ERROR_IF_EMPTY ?= $(if $(strip $($(strip $(1)))), , $(error Makefile $(strip $(1)) option cannot be blank))
ERROR_IF_NONBOOL ?= $(if $(filter Y N, $($(strip $(1)))), , $(error Makefile $(strip $(1)) option must be Y or N))
# Default values of optionally user-supplied variables
COMPILER_PATH ?=
BOARD ?= NONE
OPTIMIZATION ?= s
F_CPU ?=
C_STANDARD ?= gnu99
CPP_STANDARD ?= gnu++98
C_FLAGS ?=
CPP_FLAGS ?=
ASM_FLAGS ?=
CC_FLAGS ?=
OBJDIR ?= .
OBJECT_FILES ?=
DEBUG_FORMAT ?= dwarf-2
DEBUG_LEVEL ?= 2
LINKER_RELAXATIONS ?= Y
# Sanity check user supplied values
$(foreach MANDATORY_VAR, $(LUFA_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
$(call ERROR_IF_EMPTY, MCU)
$(call ERROR_IF_EMPTY, TARGET)
$(call ERROR_IF_EMPTY, ARCH)
$(call ERROR_IF_EMPTY, F_USB)
$(call ERROR_IF_EMPTY, LUFA_PATH)
$(call ERROR_IF_EMPTY, BOARD)
$(call ERROR_IF_EMPTY, OPTIMIZATION)
$(call ERROR_IF_EMPTY, C_STANDARD)
$(call ERROR_IF_EMPTY, CPP_STANDARD)
$(call ERROR_IF_EMPTY, OBJDIR)
$(call ERROR_IF_EMPTY, DEBUG_FORMAT)
$(call ERROR_IF_EMPTY, DEBUG_LEVEL)
$(call ERROR_IF_NONBOOL, LINKER_RELAXATIONS)
# Determine the utility prefix to use for the selected architecture
ifeq ($(ARCH), AVR8)
CROSS := $(COMPILER_PATH)avr
else ifeq ($(ARCH), XMEGA)
CROSS := $(COMPILER_PATH)avr
$(warning The XMEGA device support is currently EXPERIMENTAL (incomplete and/or non-functional), and is included for preview purposes only.)
else ifeq ($(ARCH), UC3)
CROSS := $(COMPILER_PATH)avr32
$(warning The UC3 device support is currently EXPERIMENTAL (incomplete and/or non-functional), and is included for preview purposes only.)
else
$(error Unsupported architecture "$(ARCH)")
endif
# Output Messages
MSG_INFO_MESSAGE := ' [INFO] :'
MSG_COMPILE_CMD := ' [GCC] :'
MSG_ASSEMBLE_CMD := ' [GAS] :'
MSG_NM_CMD := ' [NM] :'
MSG_REMOVE_CMD := ' [RM] :'
MSG_LINK_CMD := ' [LNK] :'
MSG_ARCHIVE_CMD := ' [AR] :'
MSG_SIZE_CMD := ' [SIZE] :'
MSG_OBJCPY_CMD := ' [OBJCPY] :'
MSG_OBJDMP_CMD := ' [OBJDMP] :'
# Convert input source file list to differentiate them by type
C_SOURCE := $(filter %.c, $(SRC))
CPP_SOURCE := $(filter %.cpp, $(SRC))
ASM_SOURCE := $(filter %.S, $(SRC))
# Create a list of unknown source file types, if any are found throw an error
UNKNOWN_SOURCE := $(filter-out $(C_SOURCE) $(CPP_SOURCE) $(ASM_SOURCE), $(SRC))
ifneq ($(UNKNOWN_SOURCE),)
$(error Unknown input source file formats: $(UNKNOWN_SOURCE))
endif
# Convert input source filenames into a list of required output object files
OBJECT_FILES += $(addsuffix .o, $(basename $(SRC)))
# Check if an output object file directory was specified instead of the input file location
ifneq ($(OBJDIR),.)
# Prefix all the object filenames with the output object file directory path
OBJECT_FILES := $(addprefix $(patsubst %/,%,$(OBJDIR))/, $(notdir $(OBJECT_FILES)))
# Check if any object file (without path) appears more than once in the object file list
ifneq ($(words $(sort $(OBJECT_FILES))), $(words $(OBJECT_FILES)))
$(error Cannot build with OBJDIR parameter set - one or more object file name is not unique)
endif
# Create the output object file directory if it does not exist and add it to the virtual path list
$(shell mkdir $(OBJDIR) 2> /dev/null)
VPATH += $(dir $(SRC))
endif
# Create a list of dependency files from the list of object files
DEPENDENCY_FILES := $(OBJECT_FILES:%.o=%.d)
# Create a list of common flags to pass to the compiler/linker/assembler
BASE_CC_FLAGS := -pipe -g$(DEBUG_FORMAT) -g$(DEBUG_LEVEL)
ifeq ($(ARCH), AVR8)
BASE_CC_FLAGS += -mmcu=$(MCU) -fshort-enums -fno-inline-small-functions -fpack-struct
else ifeq ($(ARCH), XMEGA)
BASE_CC_FLAGS += -mmcu=$(MCU) -fshort-enums -fno-inline-small-functions -fpack-struct
else ifeq ($(ARCH), UC3)
BASE_CC_FLAGS += -mpart=$(MCU:at32%=%) -masm-addr-pseudos
endif
BASE_CC_FLAGS += -Wall -fno-strict-aliasing -funsigned-char -funsigned-bitfields -ffunction-sections
BASE_CC_FLAGS += -I. -I$(patsubst %/,%,$(LUFA_PATH))/..
BASE_CC_FLAGS += -DARCH=ARCH_$(ARCH) -DBOARD=BOARD_$(BOARD) -DF_USB=$(F_USB)UL
ifneq ($(F_CPU),)
BASE_CC_FLAGS += -DF_CPU=$(F_CPU)UL
endif
ifeq ($(LINKER_RELAXATIONS), Y)
BASE_CC_FLAGS += -mrelax
endif
# This flag is required for bootloaders as GCC will emit invalid jump table
# assembly code for devices with large amounts of flash; the jump table target
# is extracted from FLASH without using the correct ELPM instruction, resulting
# in a pseudo-random jump target.
BASE_CC_FLAGS += -fno-jump-tables
# Additional language specific compiler flags
BASE_C_FLAGS := -x c -O$(OPTIMIZATION) -std=$(C_STANDARD) -Wstrict-prototypes
BASE_CPP_FLAGS := -x c++ -O$(OPTIMIZATION) -std=$(CPP_STANDARD)
BASE_ASM_FLAGS := -x assembler-with-cpp
# Create a list of flags to pass to the linker
BASE_LD_FLAGS := -lm -Wl,-Map=$(TARGET).map,--cref -Wl,--gc-sections
ifeq ($(LINKER_RELAXATIONS), Y)
BASE_LD_FLAGS += -Wl,--relax
endif
ifeq ($(ARCH), AVR8)
BASE_LD_FLAGS += -mmcu=$(MCU)
else ifeq ($(ARCH), XMEGA)
BASE_LD_FLAGS += -mmcu=$(MCU)
else ifeq ($(ARCH), UC3)
BASE_LD_FLAGS += -mpart=$(MCU:at32%=%) --rodata-writable --direct-data
endif
# Determine flags to pass to the size utility based on its reported features (only invoke if size target required)
# and on an architecture where this non-standard patch is available
ifneq ($(ARCH), UC3)
size: SIZE_MCU_FLAG := $(shell $(CROSS)-size --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
size: SIZE_FORMAT_FLAG := $(shell $(CROSS)-size --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
endif
# Pre-build informational target, to give compiler and project name information when building
build_begin:
@echo $(MSG_INFO_MESSAGE) Begin compilation of project \"$(TARGET)\"...
@echo ""
@$(CROSS)-gcc --version
# Post-build informational target, to project name information when building has completed
build_end:
@echo $(MSG_INFO_MESSAGE) Finished building project \"$(TARGET)\".
# Prints size information of a compiled application (FLASH, RAM and EEPROM usages)
size: $(TARGET).elf
@echo $(MSG_SIZE_CMD) Determining size of \"$<\"
@echo ""
$(CROSS)-size $(SIZE_MCU_FLAG) $(SIZE_FORMAT_FLAG) $<
# Prints size information on the symbols within a compiled application in decimal bytes
symbol-sizes: $(TARGET).elf
@echo $(MSG_NM_CMD) Extracting \"$<\" symbols with decimal byte sizes
$(CROSS)-nm --size-sort --demangle --radix=d $<
# Cleans intermediary build files, leaving only the compiled application files
mostlyclean:
@echo $(MSG_REMOVE_CMD) Removing object files of \"$(TARGET)\"
rm -f $(OBJECT_FILES)
@echo $(MSG_REMOVE_CMD) Removing dependency files of \"$(TARGET)\"
rm -f $(DEPENDENCY_FILES)
# Cleans all build files, leaving only the original source code
clean: mostlyclean
@echo $(MSG_REMOVE_CMD) Removing output files of \"$(TARGET)\"
rm -f $(TARGET).elf $(TARGET).hex $(TARGET).bin $(TARGET).eep $(TARGET).map $(TARGET).lss $(TARGET).sym lib$(TARGET).a
# Performs a complete build of the user application and prints size information afterwards
all: build_begin elf hex bin lss sym size build_end
# Helper targets, to build a specific type of output file without having to know the project target name
lib: lib$(TARGET).a
elf: $(TARGET).elf
hex: $(TARGET).hex $(TARGET).eep
bin: $(TARGET).bin
lss: $(TARGET).lss
sym: $(TARGET).sym
# Default target to *create* the user application's specified source files; if this rule is executed by
# make, the input source file doesn't exist and an error needs to be presented to the user
$(SRC):
$(error Source file does not exist: $@)
# Compiles an input C source file and generates an assembly listing for it
%.s: %.c $(MAKEFILE_LIST)
@echo $(MSG_COMPILE_CMD) Generating assembly from C file \"$(notdir $<)\"
$(CROSS)-gcc -S $(BASE_CC_FLAGS) $(BASE_C_FLAGS) $(CC_FLAGS) $(C_FLAGS) $< -o $@
# Compiles an input C++ source file and generates an assembly listing for it
%.s: %.cpp $(MAKEFILE_LIST)
@echo $(MSG_COMPILE_CMD) Generating assembly from C++ file \"$(notdir $<)\"
$(CROSS)-gcc -S $(BASE_CC_FLAGS) $(BASE_CPP_FLAGS) $(CC_FLAGS) $(CPP_FLAGS) $< -o $@
# Compiles an input C source file and generates a linkable object file for it
$(OBJDIR)/%.o: %.c $(MAKEFILE_LIST)
@echo $(MSG_COMPILE_CMD) Compiling C file \"$(notdir $<)\"
$(CROSS)-gcc -c $(BASE_CC_FLAGS) $(BASE_C_FLAGS) $(CC_FLAGS) $(C_FLAGS) -MMD -MP -MF $(@:%.o=%.d) $< -o $@
# Compiles an input C++ source file and generates a linkable object file for it
$(OBJDIR)/%.o: %.cpp $(MAKEFILE_LIST)
@echo $(MSG_COMPILE_CMD) Compiling C++ file \"$(notdir $<)\"
$(CROSS)-gcc -c $(BASE_CC_FLAGS) $(BASE_CPP_FLAGS) $(CC_FLAGS) $(CPP_FLAGS) -MMD -MP -MF $(@:%.o=%.d) $< -o $@
# Assembles an input ASM source file and generates a linkable object file for it
$(OBJDIR)/%.o: %.S $(MAKEFILE_LIST)
@echo $(MSG_ASSEMBLE_CMD) Assembling \"$(notdir $<)\"
$(CROSS)-gcc -c $(BASE_CC_FLAGS) $(BASE_ASM_FLAGS) $(CC_FLAGS) $(ASM_FLAGS) -MMD -MP -MF $(@:%.o=%.d) $< -o $@
# Generates a library archive file from the user application, which can be linked into other applications
.PRECIOUS : $(OBJECT_FILES)
.SECONDARY : %.a
%.a: $(OBJECT_FILES)
@echo $(MSG_ARCHIVE_CMD) Archiving object files into \"$@\"
$(CROSS)-ar rcs $@ $(OBJECT_FILES)
# Generates an ELF debug file from the user application, which can be further processed for FLASH and EEPROM data
# files, or used for programming and debugging directly
.PRECIOUS : $(OBJECT_FILES)
.SECONDARY : %.elf
%.elf: $(OBJECT_FILES)
@echo $(MSG_LINK_CMD) Linking object files into \"$@\"
$(CROSS)-gcc $^ -o $@ $(BASE_LD_FLAGS) $(LD_FLAGS)
# Extracts out the loadable FLASH memory data from the project ELF file, and creates an Intel HEX format file of it
%.hex: %.elf
@echo $(MSG_OBJCPY_CMD) Extracting HEX file data from \"$<\"
$(CROSS)-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature $< $@
# Extracts out the loadable FLASH memory data from the project ELF file, and creates an Binary format file of it
%.bin: %.elf
@echo $(MSG_OBJCPY_CMD) Extracting BIN file data from \"$<\"
$(CROSS)-objcopy -O binary -R .eeprom -R .fuse -R .lock -R .signature $< $@
# Extracts out the loadable EEPROM memory data from the project ELF file, and creates an Intel HEX format file of it
%.eep: %.elf
@echo $(MSG_OBJCPY_CMD) Extracting EEP file data from \"$<\"
$(CROSS)-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings $< $@ || exit 0
# Creates an assembly listing file from an input project ELF file, containing interleaved assembly and source data
%.lss: %.elf
@echo $(MSG_OBJDMP_CMD) Extracting LSS file data from \"$<\"
$(CROSS)-objdump -h -d -S -z $< > $@
# Creates a symbol file listing the loadable and discarded symbols from an input project ELF file
%.sym: %.elf
@echo $(MSG_NM_CMD) Extracting SYM file data from \"$<\"
$(CROSS)-nm -n $< > $@
# Include build dependency files
-include $(DEPENDENCY_FILES)
# Phony build targets for this module
.PHONY: build_begin build_end size symbol-sizes lib elf hex lss clean mostlyclean
DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS
DMBS_LUFA_PATH ?= $(LUFA_PATH)/Build/LUFA
include $(DMBS_PATH)/gcc.mk
include $(DMBS_LUFA_PATH)/lufa-gcc.mk

View File

@ -1,175 +1,10 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2014.
# Copyright (C) Dean Camera, 2015.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
#
LUFA_BUILD_MODULES += CORE
LUFA_BUILD_TARGETS += help list_targets list_modules list_mandatory list_optional list_provided list_macros
LUFA_BUILD_MANDATORY_VARS +=
LUFA_BUILD_OPTIONAL_VARS +=
LUFA_BUILD_PROVIDED_VARS +=
LUFA_BUILD_PROVIDED_MACROS +=
# -----------------------------------------------------------------------------
# LUFA Core Build System Makefile Module.
# -----------------------------------------------------------------------------
# DESCRIPTION:
# Provides a set of core build targets for the LUFA build system
# -----------------------------------------------------------------------------
# TARGETS:
#
# help - Build system help
# list_targets - List all build targets
# list_modules - List all build modules
# list_mandatory - List all mandatory make variables required by
# the included build modules of the application
# list_optional - List all optional make variables required by
# the included build modules of the application
# list_provided - List all provided make variables from the
# included build modules of the application
# list_macros - List all provided make macros from the
# included build modules of the application
#
# MANDATORY PARAMETERS:
#
# (None)
#
# OPTIONAL PARAMETERS:
#
# (None)
#
# PROVIDED VARIABLES:
#
# (None)
#
# PROVIDED MACROS:
#
# (None)
#
# -----------------------------------------------------------------------------
SHELL = /bin/sh
# Converts a given input to a printable output using "(None)" if no items are in the list
CONVERT_TO_PRINTABLE = $(if $(strip $(1)), $(1), (None))
# Build sorted and filtered lists of the included build module data
SORTED_LUFA_BUILD_MODULES = $(sort $(LUFA_BUILD_MODULES))
SORTED_LUFA_BUILD_TARGETS = $(sort $(LUFA_BUILD_TARGETS))
SORTED_LUFA_MANDATORY_VARS = $(sort $(LUFA_BUILD_MANDATORY_VARS))
SORTED_LUFA_OPTIONAL_VARS = $(filter-out $(SORTED_LUFA_MANDATORY_VARS), $(sort $(LUFA_BUILD_OPTIONAL_VARS)))
SORTED_LUFA_PROVIDED_VARS = $(sort $(LUFA_BUILD_PROVIDED_VARS))
SORTED_LUFA_PROVIDED_MACROS = $(sort $(LUFA_BUILD_PROVIDED_MACROS))
# Create printable versions of the sorted build module data (use "(None)" when no data is available)
PRINTABLE_LUFA_BUILD_MODULES = $(call CONVERT_TO_PRINTABLE, $(SORTED_LUFA_BUILD_MODULES))
PRINTABLE_LUFA_BUILD_TARGETS = $(call CONVERT_TO_PRINTABLE, $(SORTED_LUFA_BUILD_TARGETS))
PRINTABLE_LUFA_MANDATORY_VARS = $(call CONVERT_TO_PRINTABLE, $(SORTED_LUFA_MANDATORY_VARS))
PRINTABLE_LUFA_OPTIONAL_VARS = $(call CONVERT_TO_PRINTABLE, $(SORTED_LUFA_OPTIONAL_VARS))
PRINTABLE_LUFA_PROVIDED_VARS = $(call CONVERT_TO_PRINTABLE, $(SORTED_LUFA_PROVIDED_VARS))
PRINTABLE_LUFA_PROVIDED_MACROS = $(call CONVERT_TO_PRINTABLE, $(SORTED_LUFA_PROVIDED_MACROS))
help:
@echo "==================================================================="
@echo " LUFA Build System 2.0 "
@echo " (C) Dean Camera, 2014 { dean @ fourwalledcubicle . com } "
@echo "==================================================================="
@echo "DESCRIPTION: "
@echo " This build system is a set of makefile modules for (GNU) Make, to "
@echo " provide a simple system for building LUFA powered applications. "
@echo " Each makefile module can be included from within a user makefile, "
@echo " to expose the build rules documented in the comments at the top of"
@echo " each build module. "
@echo " "
@echo "USAGE: "
@echo " To execute a rule, define all variables indicated in the desired "
@echo " module as a required parameter before including the build module "
@echo " in your project makefile. Parameters marked as optional will "
@echo " assume a default value in the modules if not user-assigned. "
@echo " "
@echo " By default the target output shows both a friendly summary, as "
@echo " well as the actual invoked command. To suppress the output of the "
@echo " invoked commands and show only the friendly command output, run "
@echo " make with the \"-s\" switch added before the target(s). "
@echo " "
@echo "SEE ALSO: "
@echo " For more information, see the 'Build System' chapter of the LUFA "
@echo " project documentation. "
@echo "==================================================================="
@echo " "
@echo " Currently used build system modules in this application: "
@echo " "
@printf " %b" "$(PRINTABLE_LUFA_BUILD_MODULES:%= - %\n)"
@echo " "
@echo " "
@echo " Currently available build targets in this application: "
@echo " "
@printf " %b" "$(PRINTABLE_LUFA_BUILD_TARGETS:%= - %\n)"
@echo " "
@echo " "
@echo " Mandatory variables required by the selected build Modules: "
@echo " "
@printf " %b" "$(PRINTABLE_LUFA_MANDATORY_VARS:%= - %\n)"
@echo " "
@echo " "
@echo " Optional variables required by the selected build Modules: "
@echo " "
@printf " %b" "$(PRINTABLE_LUFA_OPTIONAL_VARS:%= - %\n)"
@echo " "
@echo " "
@echo " Variables provided by the selected build Modules: "
@echo " "
@printf " %b" "$(PRINTABLE_LUFA_PROVIDED_VARS:%= - %\n)"
@echo " "
@echo " "
@echo " Macros provided by the selected build Modules: "
@echo " "
@printf " %b" "$(PRINTABLE_LUFA_PROVIDED_MACROS:%= - %\n)"
@echo " "
@echo "==================================================================="
@echo " The LUFA BuildSystem 2.0 - Powered By Positive Thinking (tm) "
@echo "==================================================================="
# Lists build modules included by the project makefile, in alphabetical order
list_modules:
@echo Currently Used Build System Modules:
@printf " %b" "$(PRINTABLE_LUFA_BUILD_MODULES:%= - %\n)"
# Lists build targets included by the project makefile, in alphabetical order
list_targets:
@echo Currently Available Build Targets:
@printf " %b" "$(PRINTABLE_LUFA_BUILD_TARGETS:%= - %\n)"
# Lists mandatory variables that must be set by the project makefile, in alphabetical order
list_mandatory:
@echo Mandatory Variables for Included Modules:
@printf " %b" "$(PRINTABLE_LUFA_MANDATORY_VARS:%= - %\n)"
# Lists optional variables that must be set by the project makefile, in alphabetical order
list_optional:
@echo Optional Variables for Included Modules:
@printf " %b" "$(PRINTABLE_LUFA_OPTIONAL_VARS:%= - %\n)"
# Lists variables provided by the included build modules, in alphabetical order
list_provided:
@echo Variables Provided by the Included Modules:
@printf " %b" "$(PRINTABLE_LUFA_PROVIDED_VARS:%= - %\n)"
# Lists macros provided by the included build modules, in alphabetical order
list_macros:
@echo Macros Provided by the Included Modules:
@printf " %b" "$(PRINTABLE_LUFA_PROVIDED_MACROS:%= - %\n)"
# Disable default in-built make rules (those that are needed are explicitly
# defined, and doing so has performance benefits when recursively building)
ifeq ($(filter -r,$(MAKEFLAGS)),)
MAKEFLAGS += -r
endif
.SUFFIXES:
# Phony build targets for this module
.PHONY: help list_modules list_targets list_mandatory list_optional list_provided list_macros
DMBS_PATH := $(LUFA_PATH)/Build/DMBS/DMBS
include $(DMBS_PATH)/core.mk

View File

@ -1,107 +1,10 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2014.
# Copyright (C) Dean Camera, 2015.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
#
LUFA_BUILD_MODULES += CPPCHECK
LUFA_BUILD_TARGETS += cppcheck cppcheck-config
LUFA_BUILD_MANDATORY_VARS += SRC
LUFA_BUILD_OPTIONAL_VARS += CPPCHECK_INCLUDES CPPCHECK_EXCLUDES CPPCHECK_MSG_TEMPLATE CPPCHECK_ENABLE \
CPPCHECK_SUPPRESS CPPCHECK_FAIL_ON_WARNING CPPCHECK_QUIET CPPCHECK_FLAGS
LUFA_BUILD_PROVIDED_VARS +=
LUFA_BUILD_PROVIDED_MACROS +=
# -----------------------------------------------------------------------------
# LUFA CPPCheck Buildsystem Makefile Module.
# -----------------------------------------------------------------------------
# DESCRIPTION:
# Provides a set of targets to scan a project with the free "cppcheck" static
# analysis tool, to check for code errors at runtime
# (see http://cppcheck.sourceforge.net).
# -----------------------------------------------------------------------------
# TARGETS:
#
# cppcheck - Scan the project with CPPCheck
# cppcheck-config - Use CPPCheck to look for missing include files
#
# MANDATORY PARAMETERS:
#
# SRC - List of source files to statically analyze
#
# OPTIONAL PARAMETERS:
#
# CPPCHECK_INCLUDES - Extra include paths to search for missing
# header files
# CPPCHECK_EXCLUDES - Source file paths to exclude checking (can be
# a path fragment if desired)
# CPPCHECK_MSG_TEMPLATE - Template for cppcheck error and warning output
# CPPCHECK_ENABLE - General cppcheck category checks to enable
# CPPCHECK_SUPPRESS - Specific cppcheck warnings to disable by ID
# CPPCHECK_FAIL_ON_WARNING - Set to Y to fail the build on cppcheck
# warnings, N to continue even if warnings occur
# CPPCHECK_QUIET - Enable cppcheck verbose or quiet output mode
# CPPCHECK_FLAGS - Additional flags to pass to cppcheck
#
# PROVIDED VARIABLES:
#
# (None)
#
# PROVIDED MACROS:
#
# (None)
#
# -----------------------------------------------------------------------------
SHELL = /bin/sh
ERROR_IF_UNSET ?= $(if $(filter undefined, $(origin $(strip $(1)))), $(error Makefile $(strip $(1)) value not set))
ERROR_IF_EMPTY ?= $(if $(strip $($(strip $(1)))), , $(error Makefile $(strip $(1)) option cannot be blank))
ERROR_IF_NONBOOL ?= $(if $(filter Y N, $($(strip $(1)))), , $(error Makefile $(strip $(1)) option must be Y or N))
# Default values of optionally user-supplied variables
CPPCHECK_INCLUDES ?=
CPPCHECK_EXCLUDES ?=
CPPCHECK_MSG_TEMPLATE ?= {file}:{line}: {severity} ({id}): {message}
CPPCHECK_ENABLE ?= all
CPPCHECK_SUPPRESS ?= variableScope missingInclude
CPPCHECK_FAIL_ON_WARNING ?= Y
CPPCHECK_QUIET ?= Y
CPPCHECK_FLAGS ?=
# Sanity check user supplied values
$(foreach MANDATORY_VAR, $(LUFA_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
$(call ERROR_IF_EMPTY, SRC)
$(call ERROR_IF_EMPTY, CPPCHECK_MSG_TEMPLATE)
$(call ERROR_IF_EMPTY, CPPCHECK_ENABLE)
$(call ERROR_IF_NONBOOL, CPPCHECK_FAIL_ON_WARNING)
$(call ERROR_IF_NONBOOL, CPPCHECK_QUIET)
# Build a default argument list for cppcheck
BASE_CPPCHECK_FLAGS := --template="$(CPPCHECK_MSG_TEMPLATE)" $(CPPCHECK_INCLUDES:%=-I%) $(CPPCHECK_EXCLUDES:%=-i%) --inline-suppr --force --std=c99
# Sanity check parameters and construct additional command line arguments to cppcheck
ifeq ($(CPPCHECK_FAIL_ON_WARNING), Y)
BASE_CPPCHECK_FLAGS += --error-exitcode=1
endif
ifeq ($(CPPCHECK_QUIET), Y)
BASE_CPPCHECK_FLAGS += --quiet
endif
# Output Messages
MSG_CPPCHECK_CMD := ' [CPPCHECK]:'
# Checks the CPPCheck configuration as used in the user project, to determine if any paths are missing or invalid
cppcheck-config: $(MAKEFILE_LIST)
@echo $(MSG_CPPCHECK_CMD) Checking cppcheck configuration check on source files
cppcheck $(BASE_CPPCHECK_FLAGS) --check-config $(CPPCHECK_FLAGS) $(SRC)
# Runs a static analysis using CPPCheck to determine if there are any issues
cppcheck: $(MAKEFILE_LIST)
@echo $(MSG_CPPCHECK_CMD) Performing static analysis on source files
cppcheck $(BASE_CPPCHECK_FLAGS) --enable=$(CPPCHECK_ENABLE) $(CPPCHECK_SUPPRESS:%=--suppress=%) $(CPPCHECK_FLAGS) $(SRC)
# Phony build targets for this module
.PHONY: cppcheck-config cppcheck
DMBS_PATH := $(LUFA_PATH)/Build/DMBS/DMBS
include $(DMBS_PATH)/cppcheck.mk

View File

@ -1,95 +1,10 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2014.
# Copyright (C) Dean Camera, 2015.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
#
LUFA_BUILD_MODULES += DFU
LUFA_BUILD_TARGETS += flip flip-ee dfu dfu-ee
LUFA_BUILD_MANDATORY_VARS += MCU TARGET
LUFA_BUILD_OPTIONAL_VARS +=
LUFA_BUILD_PROVIDED_VARS +=
LUFA_BUILD_PROVIDED_MACROS +=
# -----------------------------------------------------------------------------
# LUFA DFU Bootloader Buildsystem Makefile Module.
# -----------------------------------------------------------------------------
# DESCRIPTION:
# Provides a set of targets to re-program a device currently running a DFU
# class bootloader with a project's FLASH and EEPROM files.
# -----------------------------------------------------------------------------
# TARGETS:
#
# flip - Program FLASH into target via Atmel FLIP
# flip-ee - Program EEPROM into target via Atmel FLIP
# dfu - Program FLASH into target via dfu-programmer
# dfu-ee - Program EEPROM into target via dfu-programmer
#
# MANDATORY PARAMETERS:
#
# MCU - Microcontroller device model name
# TARGET - Application name
#
# OPTIONAL PARAMETERS:
#
# (None)
#
# PROVIDED VARIABLES:
#
# (None)
#
# PROVIDED MACROS:
#
# (None)
#
# -----------------------------------------------------------------------------
SHELL = /bin/sh
ERROR_IF_UNSET ?= $(if $(filter undefined, $(origin $(strip $(1)))), $(error Makefile $(strip $(1)) value not set))
ERROR_IF_EMPTY ?= $(if $(strip $($(strip $(1)))), , $(error Makefile $(strip $(1)) option cannot be blank))
ERROR_IF_NONBOOL ?= $(if $(filter Y N, $($(strip $(1)))), , $(error Makefile $(strip $(1)) option must be Y or N))
# Sanity-check values of mandatory user-supplied variables
$(foreach MANDATORY_VAR, $(LUFA_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
$(call ERROR_IF_EMPTY, MCU)
$(call ERROR_IF_EMPTY, TARGET)
# Output Messages
MSG_COPY_CMD := ' [CP] :'
MSG_REMOVE_CMD := ' [RM] :'
MSG_DFU_CMD := ' [DFU] :'
# Programs in the target FLASH memory using BATCHISP, the command line tool used by FLIP
flip: $(TARGET).hex $(MAKEFILE_LIST)
@echo $(MSG_DFU_CMD) Programming FLASH with batchisp using \"$<\"
batchisp -hardware usb -device $(MCU) -operation erase f loadbuffer $< program
batchisp -hardware usb -device $(MCU) -operation start reset 0
# Programs in the target EEPROM memory using BATCHISP, the command line tool used by FLIP
flip-ee: $(TARGET).eep $(MAKEFILE_LIST)
@echo $(MSG_COPY_CMD) Copying EEP file to temporary file \"$<.hex\"
cp $< $<.hex
@echo $(MSG_DFU_CMD) Programming EEPROM with batchisp using \"$<.hex\"
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $<.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
@echo $(MSG_REMOVE_CMD) Removing temporary file \"$<.hex\"
rm $<.hex
# Programs in the target FLASH memory using DFU-PROGRAMMER
dfu: $(TARGET).hex $(MAKEFILE_LIST)
@echo $(MSG_DFU_CMD) Programming FLASH with dfu-programmer using \"$<\"
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash $<
dfu-programmer $(MCU) reset
# Programs in the target EEPROM memory using DFU-PROGRAMMER
dfu-ee: $(TARGET).eep $(MAKEFILE_LIST)
@echo $(MSG_DFU_CMD) Programming EEPROM with dfu-programmer using \"$<\"
dfu-programmer $(MCU) eeprom-flash $<
dfu-programmer $(MCU) reset
# Phony build targets for this module
.PHONY: flip flip-ee dfu dfu-ee
DMBS_PATH := $(LUFA_PATH)/Build/DMBS/DMBS
include $(DMBS_PATH)/dfu.mk

View File

@ -1,100 +1,10 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2014.
# Copyright (C) Dean Camera, 2015.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
#
LUFA_BUILD_MODULES += DOXYGEN
LUFA_BUILD_TARGETS += doxygen doxygen_upgrade doxygen_create
LUFA_BUILD_MANDATORY_VARS += LUFA_PATH
LUFA_BUILD_OPTIONAL_VARS += DOXYGEN_CONF DOXYGEN_FAIL_ON_WARNING DOXYGEN_OVERRIDE_PARAMS
LUFA_BUILD_PROVIDED_VARS +=
LUFA_BUILD_PROVIDED_MACROS +=
# -----------------------------------------------------------------------------
# LUFA Doxygen Buildsystem Makefile Module.
# -----------------------------------------------------------------------------
# DESCRIPTION:
# Provides a set of targets to automatically build Doxygen documentation for
# a project (see www.doxygen.org).
# -----------------------------------------------------------------------------
# TARGETS:
#
# doxygen - Build Doxygen Documentation
# doxygen_create - Create a new Doxygen configuration file using
# the latest template
# doxygen_upgrade - Upgrade an existing Doxygen configuration file
# to the latest template
#
# MANDATORY PARAMETERS:
#
# LUFA_PATH - Path to the LUFA library core
#
# OPTIONAL PARAMETERS:
#
# DOXYGEN_CONF - Doxygen configuration filename
# DOXYGEN_FAIL_ON_WARNING - Set to Y to fail the build on Doxygen warnings,
# N to continue even if warnings occur
# DOXYGEN_OVERRIDE_PARAMS - Parameters to override in the doxygen
# configuration file
# PROVIDED VARIABLES:
#
# (None)
#
# PROVIDED MACROS:
#
# (None)
#
# -----------------------------------------------------------------------------
SHELL = /bin/sh
ERROR_IF_UNSET ?= $(if $(filter undefined, $(origin $(strip $(1)))), $(error Makefile $(strip $(1)) value not set))
ERROR_IF_EMPTY ?= $(if $(strip $($(strip $(1)))), , $(error Makefile $(strip $(1)) option cannot be blank))
ERROR_IF_NONBOOL ?= $(if $(filter Y N, $($(strip $(1)))), , $(error Makefile $(strip $(1)) option must be Y or N))
# Default values of optionally user-supplied variables
DOXYGEN_CONF ?= doxyfile
DOXYGEN_FAIL_ON_WARNING ?= Y
DOXYGEN_OVERRIDE_PARAMS ?= QUIET=YES HTML_EXTRA_STYLESHEET=$(patsubst %/,%,$(LUFA_PATH))/DoxygenPages/Style/Style.css
# Sanity check user supplied values
$(foreach MANDATORY_VAR, $(LUFA_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
$(call ERROR_IF_EMPTY, DOXYGEN_CONF)
$(call ERROR_IF_EMPTY, LUFA_PATH)
$(call ERROR_IF_NONBOOL, DOXYGEN_FAIL_ON_WARNING)
# Output Messages
MSG_DOXYGEN_CMD := ' [DOXYGEN] :'
# Determine Doxygen invocation command
BASE_DOXYGEN_CMD := ( cat $(DOXYGEN_CONF) $(DOXYGEN_OVERRIDE_PARAMS:%=; echo "%") ) | doxygen -
ifeq ($(DOXYGEN_FAIL_ON_WARNING), Y)
DOXYGEN_CMD := if ( $(BASE_DOXYGEN_CMD) 2>&1 | grep -v "warning: ignoring unsupported tag" ;); then exit 1; fi;
else
DOXYGEN_CMD := $(BASE_DOXYGEN_CMD)
endif
# Error if the specified Doxygen configuration file does not exist
$(DOXYGEN_CONF):
$(error Doxygen configuration file $@ does not exist)
# Builds the project documentation using the specified configuration file and the DOXYGEN tool
doxygen: $(DOXYGEN_CONF) $(MAKEFILE_LIST)
@echo $(MSG_DOXYGEN_CMD) Configuration file \"$(DOXYGEN_CONF)\" with parameters \"$(DOXYGEN_OVERRIDE_PARAMS)\"
$(DOXYGEN_CMD)
# Upgrades an existing Doxygen configuration file to the latest Doxygen template, preserving settings
doxygen_upgrade: $(DOXYGEN_CONF) $(MAKEFILE_LIST)
@echo $(MSG_DOXYGEN_CMD) Upgrading configuration file \"$(DOXYGEN_CONF)\" with latest template
doxygen -u $(DOXYGEN_CONF) > /dev/null
# Creates a new Doxygen configuration file with the set file name
doxygen_create: $(MAKEFILE_LIST)
@echo $(MSG_DOXYGEN_CMD) Creating new configuration file \"$(DOXYGEN_CONF)\" with latest template
doxygen -g $(DOXYGEN_CONF) > /dev/null
# Phony build targets for this module
.PHONY: doxygen doxygen_upgrade doxygen_create
DMBS_PATH := $(LUFA_PATH)/Build/DMBS/DMBS
include $(DMBS_PATH)/doxygen.mk

View File

@ -1,96 +1,10 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2014.
# Copyright (C) Dean Camera, 2015.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
#
LUFA_BUILD_MODULES += HID
LUFA_BUILD_TARGETS += hid hid-ee teensy teensy-ee
LUFA_BUILD_MANDATORY_VARS += MCU TARGET
LUFA_BUILD_OPTIONAL_VARS +=
LUFA_BUILD_PROVIDED_VARS +=
LUFA_BUILD_PROVIDED_MACROS +=
# -----------------------------------------------------------------------------
# LUFA HID Bootloader Buildsystem Makefile Module.
# -----------------------------------------------------------------------------
# DESCRIPTION:
# Provides a set of targets to re-program a device currently running a HID
# class bootloader with a project's FLASH files.
# -----------------------------------------------------------------------------
# TARGETS:
#
# hid - Program FLASH into target via
# hid_bootloader_cli
# hid-ee - Program EEPROM into target via a temporary
# AVR application and hid_bootloader_cli
# teensy - Program FLASH into target via
# teensy_loader_cli
# teensy-ee - Program EEPROM into target via a temporary
# AVR application and teensy_loader_cli
#
# MANDATORY PARAMETERS:
#
# MCU - Microcontroller device model name
# TARGET - Application name
#
# OPTIONAL PARAMETERS:
#
# (None)
#
# PROVIDED VARIABLES:
#
# (None)
#
# PROVIDED MACROS:
#
# (None)
#
# -----------------------------------------------------------------------------
SHELL = /bin/sh
LUFA_MODULE_PATH := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
ERROR_IF_UNSET ?= $(if $(filter undefined, $(origin $(strip $(1)))), $(error Makefile $(strip $(1)) value not set))
ERROR_IF_EMPTY ?= $(if $(strip $($(strip $(1)))), , $(error Makefile $(strip $(1)) option cannot be blank))
ERROR_IF_NONBOOL ?= $(if $(filter Y N, $($(strip $(1)))), , $(error Makefile $(strip $(1)) option must be Y or N))
# Sanity-check values of mandatory user-supplied variables
$(foreach MANDATORY_VAR, $(LUFA_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
$(call ERROR_IF_EMPTY, MCU)
$(call ERROR_IF_EMPTY, TARGET)
# Output Messages
MSG_HID_BOOTLOADER_CMD := ' [HID] :'
MSG_OBJCPY_CMD := ' [OBJCPY] :'
MSG_MAKE_CMD := ' [MAKE] :'
# Programs in the target FLASH memory using the HID_BOOTLOADER_CLI tool
hid: $(TARGET).hex $(MAKEFILE_LIST)
@echo $(MSG_HID_BOOTLOADER_CMD) Programming FLASH with hid_bootloader_cli using \"$<\"
hid_bootloader_cli -mmcu=$(MCU) -v $<
# Programs in the target EEPROM memory using the HID_BOOTLOADER_CLI tool (note: clears target FLASH memory)
hid-ee: $(TARGET).eep $(MAKEFILE_LIST)
@echo $(MSG_OBJCPY_CMD) Converting \"$<\" to a binary file \"InputEEData.bin\"
avr-objcopy -I ihex -O binary $< $(LUFA_MODULE_PATH)/HID_EEPROM_Loader/InputEEData.bin
@echo $(MSG_MAKE_CMD) Making EEPROM loader application for \"$<\"
$(MAKE) -C $(LUFA_MODULE_PATH)/HID_EEPROM_Loader/ MCU=$(MCU) clean hid
# Programs in the target FLASH memory using the TEENSY_BOOTLOADER_CLI tool
teensy: $(TARGET).hex $(MAKEFILE_LIST)
@echo $(MSG_HID_BOOTLOADER_CMD) Programming FLASH with teensy_loader_cli using \"$<\"
teensy_loader_cli -mmcu=$(MCU) -v $<
# Programs in the target EEPROM memory using the TEENSY_BOOTLOADER_CLI tool (note: clears target FLASH memory)
teensy-ee: $(TARGET).hex $(MAKEFILE_LIST)
@echo $(MSG_OBJCPY_CMD) Converting \"$<\" to a binary file \"InputEEData.bin\"
avr-objcopy -I ihex -O binary $< $(LUFA_MODULE_PATH)/HID_EEPROM_Loader/InputEEData.bin
@echo $(MSG_MAKE_CMD) Making EEPROM loader application for \"$<\"
$(MAKE) -s -C $(LUFA_MODULE_PATH)/HID_EEPROM_Loader/ MCU=$(MCU) clean teensy
# Phony build targets for this module
.PHONY: hid hid-ee teensy teensy-ee
DMBS_PATH := $(LUFA_PATH)/Build/DMBS/DMBS
include $(DMBS_PATH)/hid.mk

View File

@ -1,144 +1,10 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2014.
# Copyright (C) Dean Camera, 2015.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
#
LUFA_BUILD_MODULES += SOURCES
LUFA_BUILD_TARGETS +=
LUFA_BUILD_MANDATORY_VARS += LUFA_PATH ARCH
LUFA_BUILD_OPTIONAL_VARS +=
LUFA_BUILD_PROVIDED_VARS += LUFA_SRC_USB_DEVICE LUFA_SRC_USB_HOST \
LUFA_SRC_USB LUFA_SRC_USBCLASS_DEVICE \
LUFA_SRC_USBCLASS_HOST LUFA_SRC_USBCLASS \
LUFA_SRC_TEMPERATURE LUFA_SRC_SERIAL \
LUFA_SRC_TWI LUFA_SRC_PLATFORM
LUFA_BUILD_PROVIDED_MACROS +=
# -----------------------------------------------------------------------------
# LUFA Sources Buildsystem Makefile Module.
# -----------------------------------------------------------------------------
# DESCRIPTION:
# Provides a set of makefile variables for the various LUFA module sources.
# Once included, the sources required to use a given LUFA module will become
# available using the makefile variable names listed in the LUFA project
# documentation.
# -----------------------------------------------------------------------------
# TARGETS:
#
# (None)
#
# MANDATORY PARAMETERS:
#
# LUFA_PATH - Path to the LUFA library core
# ARCH - Device architecture name
#
# OPTIONAL PARAMETERS:
#
# (None)
#
# PROVIDED VARIABLES:
#
# LUFA_SRC_USB_DEVICE - List of LUFA USB driver source files required
# for USB Device mode only
# LUFA_SRC_USB_HOST - List of LUFA USB driver source files required
# for USB Host mode only
# LUFA_SRC_USB - List of LUFA USB driver source files for all
# USB modes
# LUFA_SRC_USBCLASS_DEVICE - List of LUFA USB Class driver source files for
# USB Device mode only
# LUFA_SRC_USBCLASS_HOST - List of LUFA USB Class driver source files for
# USB Host mode only
# LUFA_SRC_USBCLASS - List of LUFA USB Class driver source files for
# all USB modes
# LUFA_SRC_TEMPERATURE - List of LUFA temperature sensor driver source
# files
# LUFA_SRC_SERIAL - List of LUFA Serial U(S)ART driver source files
# LUFA_SRC_TWI - List of LUFA TWI driver source files
# LUFA_SRC_PLATFORM - List of LUFA architecture specific platform
# management source files
#
# PROVIDED MACROS:
#
# (None)
#
# -----------------------------------------------------------------------------
SHELL = /bin/sh
ERROR_IF_UNSET ?= $(if $(filter undefined, $(origin $(strip $(1)))), $(error Makefile $(strip $(1)) value not set))
ERROR_IF_EMPTY ?= $(if $(strip $($(strip $(1)))), , $(error Makefile $(strip $(1)) option cannot be blank))
ERROR_IF_NONBOOL ?= $(if $(filter Y N, $($(strip $(1)))), , $(error Makefile $(strip $(1)) option must be Y or N))
# Sanity check user supplied values
$(foreach MANDATORY_VAR, $(LUFA_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
$(call ERROR_IF_EMPTY, LUFA_PATH)
$(call ERROR_IF_EMPTY, ARCH)
# Allow LUFA_ROOT_PATH to be overridden elsewhere to support legacy LUFA makefiles
LUFA_ROOT_PATH ?= $(patsubst %/,%,$(LUFA_PATH))
# Construct LUFA module source variables
LUFA_SRC_USB_COMMON := $(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/USBController_$(ARCH).c \
$(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/USBInterrupt_$(ARCH).c \
$(LUFA_ROOT_PATH)/Drivers/USB/Core/ConfigDescriptors.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Core/Events.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Core/USBTask.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Common/HIDParser.c \
LUFA_SRC_USB_HOST := $(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/Host_$(ARCH).c \
$(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/Pipe_$(ARCH).c \
$(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/PipeStream_$(ARCH).c \
$(LUFA_ROOT_PATH)/Drivers/USB/Core/HostStandardReq.c \
$(LUFA_SRC_USB_COMMON)
LUFA_SRC_USB_DEVICE := $(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/Device_$(ARCH).c \
$(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/Endpoint_$(ARCH).c \
$(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/EndpointStream_$(ARCH).c \
$(LUFA_ROOT_PATH)/Drivers/USB/Core/DeviceStandardReq.c \
$(LUFA_SRC_USB_COMMON)
LUFA_SRC_USBCLASS_DEVICE := $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/AudioClassDevice.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/CDCClassDevice.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/HIDClassDevice.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/MassStorageClassDevice.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/MIDIClassDevice.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/PrinterClassDevice.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/RNDISClassDevice.c \
LUFA_SRC_USBCLASS_HOST := $(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/AudioClassHost.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/CDCClassHost.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/HIDClassHost.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/MassStorageClassHost.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/MIDIClassHost.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/PrinterClassHost.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/RNDISClassHost.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/StillImageClassHost.c
LUFA_SRC_USB := $(sort $(LUFA_SRC_USB_COMMON) $(LUFA_SRC_USB_HOST) $(LUFA_SRC_USB_DEVICE))
LUFA_SRC_USBCLASS := $(LUFA_SRC_USBCLASS_DEVICE) $(LUFA_SRC_USBCLASS_HOST)
LUFA_SRC_TEMPERATURE := $(LUFA_ROOT_PATH)/Drivers/Board/Temperature.c
LUFA_SRC_SERIAL := $(LUFA_ROOT_PATH)/Drivers/Peripheral/$(ARCH)/Serial_$(ARCH).c
LUFA_SRC_TWI := $(LUFA_ROOT_PATH)/Drivers/Peripheral/$(ARCH)/TWI_$(ARCH).c
ifeq ($(ARCH), UC3)
LUFA_SRC_PLATFORM := $(LUFA_ROOT_PATH)/Platform/UC3/Exception.S \
$(LUFA_ROOT_PATH)/Platform/UC3/InterruptManagement.c
else
LUFA_SRC_PLATFORM :=
endif
# Build a list of all available module sources
LUFA_SRC_ALL_FILES := $(LUFA_SRC_USB) \
$(LUFA_SRC_USBCLASS) \
$(LUFA_SRC_TEMPERATURE) \
$(LUFA_SRC_SERIAL) \
$(LUFA_SRC_TWI) \
$(LUFA_SRC_PLATFORM)
DMBS_LUFA_PATH ?= $(LUFA_PATH)/Build/LUFA
include $(DMBS_LUFA_PATH)/lufa-sources.mk

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@ -127,7 +127,7 @@ const USB_Descriptor_String_t ProductString =
* USB host.
*/
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint8_t wIndex,
const uint16_t wIndex,
const void** const DescriptorAddress
#if defined(HAS_MULTIPLE_DESCRIPTOR_ADDRESS_SPACES)
, uint8_t* const DescriptorMemorySpace

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,55 +1,55 @@
<asf xmlversion="1.0">
<project caption="USB Device Template" id="lufa.templates.device.project.avr8">
<require idref="lufa.templates.device"/>
<require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8_template"/>
<device-support value="at90usb1287"/>
<config name="lufa.drivers.board.name" value="usbkey"/>
<build type="define" name="F_CPU" value="8000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/>
</project>
<project caption="USB Device Template" id="lufa.templates.device.project.xmega">
<require idref="lufa.templates.device"/>
<require idref="lufa.boards.dummy.xmega"/>
<generator value="as5_8_template"/>
<device-support value="atxmega256a3bu"/>
<config name="lufa.drivers.board.name" value="a3bu_xplained"/>
<build type="define" name="F_CPU" value="32000000UL"/>
<build type="define" name="F_USB" value="48000000UL"/>
</project>
<module type="application" id="lufa.templates.device" caption="USB Device Template">
<info type="description" value="summary">
Template for a LUFA USB device mode application.
</info>
<info type="gui-flag" value="move-to-root"/>
<info type="keyword" value="Technology">
<keyword value="USB Device"/>
<keyword value="Template Projects"/>
</info>
<device-support-alias value="lufa_avr8"/>
<device-support-alias value="lufa_xmega"/>
<device-support-alias value="lufa_uc3"/>
<build type="c-source" value="DeviceApplication.c"/>
<build type="c-source" value="Descriptors.c"/>
<build type="header-file" value="DeviceApplication.h"/>
<build type="header-file" value="Descriptors.h"/>
<build type="module-config" subtype="path" value=".."/>
<build type="header-file" value="../LUFAConfig.h"/>
<require idref="lufa.common"/>
<require idref="lufa.platform"/>
<require idref="lufa.drivers.usb"/>
<require idref="lufa.drivers.board"/>
</module>
</asf>
<asf xmlversion="1.0">
<project caption="USB Device Template" id="lufa.templates.device.project.avr8">
<require idref="lufa.templates.device"/>
<require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8_template"/>
<device-support value="at90usb1287"/>
<config name="lufa.drivers.board.name" value="usbkey"/>
<build type="define" name="F_CPU" value="8000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/>
</project>
<project caption="USB Device Template" id="lufa.templates.device.project.xmega">
<require idref="lufa.templates.device"/>
<require idref="lufa.boards.dummy.xmega"/>
<generator value="as5_8_template"/>
<device-support value="atxmega256a3bu"/>
<config name="lufa.drivers.board.name" value="a3bu_xplained"/>
<build type="define" name="F_CPU" value="32000000UL"/>
<build type="define" name="F_USB" value="48000000UL"/>
</project>
<module type="application" id="lufa.templates.device" caption="USB Device Template">
<info type="description" value="summary">
Template for a LUFA USB device mode application.
</info>
<info type="gui-flag" value="move-to-root"/>
<info type="keyword" value="Technology">
<keyword value="USB Device"/>
<keyword value="Template Projects"/>
</info>
<device-support-alias value="lufa_avr8"/>
<device-support-alias value="lufa_xmega"/>
<device-support-alias value="lufa_uc3"/>
<build type="c-source" value="DeviceApplication.c"/>
<build type="c-source" value="Descriptors.c"/>
<build type="header-file" value="DeviceApplication.h"/>
<build type="header-file" value="Descriptors.h"/>
<build type="module-config" subtype="path" value=".."/>
<build type="header-file" value="../LUFAConfig.h"/>
<require idref="lufa.common"/>
<require idref="lufa.platform"/>
<require idref="lufa.drivers.usb"/>
<require idref="lufa.drivers.board"/>
</module>
</asf>

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@ -122,7 +122,7 @@ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode,
* option is set, this is still required even in an application that uses host mode only.
*/
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint8_t wIndex,
const uint16_t wIndex,
const void** const DescriptorAddress
#if defined(HAS_MULTIPLE_DESCRIPTOR_ADDRESS_SPACES)
, uint8_t* const DescriptorMemorySpace

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,41 +1,41 @@
<asf xmlversion="1.0">
<project caption="USB Host Template" id="lufa.templates.host.project">
<require idref="lufa.templates.host"/>
<require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8_template"/>
<device-support value="at90usb1287"/>
<config name="lufa.drivers.board.name" value="usbkey"/>
<build type="define" name="F_CPU" value="8000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/>
</project>
<module type="application" id="lufa.templates.host" caption="USB Host Template">
<info type="description" value="summary">
Template for a LUFA USB host mode application.
</info>
<info type="gui-flag" value="move-to-root"/>
<info type="keyword" value="Technology">
<keyword value="USB Host"/>
<keyword value="Template Projects"/>
</info>
<device-support-alias value="lufa_avr8"/>
<device-support-alias value="lufa_xmega"/>
<device-support-alias value="lufa_uc3"/>
<build type="c-source" value="HostApplication.c"/>
<build type="header-file" value="HostApplication.h"/>
<build type="module-config" subtype="path" value=".."/>
<build type="header-file" value="../LUFAConfig.h"/>
<require idref="lufa.common"/>
<require idref="lufa.platform"/>
<require idref="lufa.drivers.usb"/>
<require idref="lufa.drivers.board"/>
</module>
</asf>
<asf xmlversion="1.0">
<project caption="USB Host Template" id="lufa.templates.host.project">
<require idref="lufa.templates.host"/>
<require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8_template"/>
<device-support value="at90usb1287"/>
<config name="lufa.drivers.board.name" value="usbkey"/>
<build type="define" name="F_CPU" value="8000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/>
</project>
<module type="application" id="lufa.templates.host" caption="USB Host Template">
<info type="description" value="summary">
Template for a LUFA USB host mode application.
</info>
<info type="gui-flag" value="move-to-root"/>
<info type="keyword" value="Technology">
<keyword value="USB Host"/>
<keyword value="Template Projects"/>
</info>
<device-support-alias value="lufa_avr8"/>
<device-support-alias value="lufa_xmega"/>
<device-support-alias value="lufa_uc3"/>
<build type="c-source" value="HostApplication.c"/>
<build type="header-file" value="HostApplication.h"/>
<build type="module-config" subtype="path" value=".."/>
<build type="header-file" value="../LUFAConfig.h"/>
<require idref="lufa.common"/>
<require idref="lufa.platform"/>
<require idref="lufa.drivers.usb"/>
<require idref="lufa.drivers.board"/>
</module>
</asf>

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,6 +1,6 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2014.
# Copyright (C) Dean Camera, 2017.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
@ -26,13 +26,18 @@ LD_FLAGS =
# Default target
all:
# Include LUFA build script makefiles
include $(LUFA_PATH)/Build/lufa_core.mk
include $(LUFA_PATH)/Build/lufa_sources.mk
include $(LUFA_PATH)/Build/lufa_build.mk
include $(LUFA_PATH)/Build/lufa_cppcheck.mk
include $(LUFA_PATH)/Build/lufa_doxygen.mk
include $(LUFA_PATH)/Build/lufa_dfu.mk
include $(LUFA_PATH)/Build/lufa_hid.mk
include $(LUFA_PATH)/Build/lufa_avrdude.mk
include $(LUFA_PATH)/Build/lufa_atprogram.mk
# Include LUFA-specific DMBS extension modules
DMBS_LUFA_PATH ?= $(LUFA_PATH)/Build/LUFA
include $(DMBS_LUFA_PATH)/lufa-sources.mk
include $(DMBS_LUFA_PATH)/lufa-gcc.mk
# Include common DMBS build system modules
DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS
include $(DMBS_PATH)/core.mk
include $(DMBS_PATH)/cppcheck.mk
include $(DMBS_PATH)/doxygen.mk
include $(DMBS_PATH)/dfu.mk
include $(DMBS_PATH)/gcc.mk
include $(DMBS_PATH)/hid.mk
include $(DMBS_PATH)/avrdude.mk
include $(DMBS_PATH)/atprogram.mk

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@ -240,6 +240,12 @@
/** Selects the Arduino Micro specific board drivers, including the driver for the board LEDs. */
#define BOARD_MICRO 58
/** Selects the Pololu A-Star Micro specific board drivers, including the driver for the board LEDs. */
#define BOARD_POLOLUMICRO 59
/** Selects the Atmel Xplained-MINI specific board drivers, including the driver for the board LEDs. */
#define BOARD_XPLAINED_MINI 60
#if !defined(__DOXYGEN__)
#define BOARD_ BOARD_NONE

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@ -397,7 +397,7 @@
*
* \return Input data with the individual bytes reversed.
*/
static inline uint16_t SwapEndian_16(const uint16_t Word) ATTR_WARN_UNUSED_RESULT ATTR_CONST;
static inline uint16_t SwapEndian_16(const uint16_t Word) ATTR_WARN_UNUSED_RESULT ATTR_CONST ATTR_ALWAYS_INLINE;
static inline uint16_t SwapEndian_16(const uint16_t Word)
{
if (GCC_IS_COMPILE_CONST(Word))
@ -428,7 +428,7 @@
*
* \return Input data with the individual bytes reversed.
*/
static inline uint32_t SwapEndian_32(const uint32_t DWord) ATTR_WARN_UNUSED_RESULT ATTR_CONST;
static inline uint32_t SwapEndian_32(const uint32_t DWord) ATTR_WARN_UNUSED_RESULT ATTR_CONST ATTR_ALWAYS_INLINE;
static inline uint32_t SwapEndian_32(const uint32_t DWord)
{
if (GCC_IS_COMPILE_CONST(DWord))

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,62 @@
*/
/** \page Page_ChangeLog Project Changelog
*
* \section Sec_ChangeLog170418 Version 170418
* <b>New:</b>
* - Core:
* - Added support for the Pololu A-Star Micro board (thanks to Joh Schneider)
* - Added new \c LUFA_VERSION_RELEASE_TYPE macro to the library version header, to determine release type (thanks to NicoHood)
*
* <b>Fixed:</b>
* - Core:
* - The CALLBACK_USB_GetDescriptor() callback function into the user application erroneously had a uint8_t type for the wIndex
* parameter, instead of uint16_t (thanks to Matlo)
* - Fixed broken USE_RAM_DESCRIPTORS compile time option when the FIXED_NUM_CONFIGURATIONS compile time option is not enabled
* in a user application (thanks to Matlo)
* - Fixed missing \c va_end() calls in the HID bootloader CLI app which could cause portability issues
* - Fixed void pointer arithmetic in the \c Serial_SendData() functions for AVR8 and XMEGA architectures
* - Fixed void pointer arithmetic in the low level and class driver RNDIS demo protocol decoders
* - Fixed low level RNDIS demo incorrectly setting the RNDIS state when a null packet filter was requested
* - Fixed missing entries in several project's Atmel Studio integration files, such as driver INF files
* - Fixed invalid endpoint indexes causing memory corruption in device Clear/Set Feature standard requests (thanks to Peter Popovec)
* - Fixed incorrect serialization in USB_SetHIDReportItemInfo() function (thanks to e-chip)
*
* <b>Changed:</b>
* - Added signed alternative libUSB driver for the AVRISP-MKII clone project, to support Atmel Studio 7 (thanks to Atmel)
* - Removed no longer required LIBUSB_DRIVER_COMPAT and RESET_TOGGLES_LIBUSB_COMPAT configuration options from the AVRISP-MKII
* clone project, as the new libUSB driver works for AVRDUDE and Atmel Studio 7 under Windows
* - Replaced the LUFA build system with its (compatible) successor, DMBS (Dean's Makefile Build System)
* - Removed obsolete library TAR export and associated documentation
* - Fixed incorrect HID_DESCRIPTOR_KEYBOARD() macro definition (thanks to Eric Tang)
*
* \section Sec_ChangeLog151115 Version 151115
* <b>New:</b>
* - Added support for the Atmel Xplained-MINI series of development kits
* - Added new PROGMEM variant send functions to the CDC class device driver (thanks to Stefan Hellermann)
* - Added new PROGMEM variant send functions to the CDC class host driver
* - Added additional Arduino Uno board definitions for the main processor reset (thanks to NicoHood)
* - Added modified DocBook transforms to generate Atmel Studio 6/7 internal help documentation (thanks to Morten Engelhardt Olsen)
*
* <b>Changed:</b>
* - Core:
* - The TWI peripheral driver's TWI_WritePacket() and TWI_ReadPacket() functions now takes a 16-bit Length rather than an 8-bit
* length, for longer transfers
* - Library Applications:
* - The CDC, DFU, Mass Storage and Printer class bootloaders will no longer run the user application if the application reset
* vector is blank (thanks to Alex Kazik)
* - The CDC, DFU and Printer class bootloaders are now compatible with the original Atmel XPLAIN and Arduino Leonardo boards
* - The CDC, DFU, Mass Storage and Printer class bootloaders are not compatible with devices with the BOOTRST fuse set and will
* exit automatically unless an external reset was the last reset cause (thanks to Alex Kazik)
* - Added missing force-inline attribute to the endianness utility functions (thanks to Stefan Hellermann)
* - Updated the DFU build system module to use updated EEPROM programming command arguments for dfu-programmer 0.6.2 or newer
*
* <b>Fixed:</b>
* - Fixed broken XMEGA serial stream driver due to missing USART base pointer parameter (thanks to William Patterson)
* - Fixed incorrect signature reported in the CDC/DFU bootloaders for the AT90USB82 (thanks to NicoHood)
* - Fixed broken RNDIS demos on Linux machines whose DHCP hosts require a Lease Time option (thanks to Stefan Hellermann)
* - Fixed broken LEDs_Disable() implementation for the Arduino Uno board (thanks to NicoHood)
* - Fixed missing bounds checks and off-by-one in the DFU bootloader signature bytes (thanks to Reuti)
*
* \section Sec_ChangeLog140928 Version 140928
* <b>New:</b>

View File

@ -113,8 +113,8 @@
* On the smaller USB AVRs, the USB controller lacks VBUS events to determine the physical connection state of the USB bus to a host. In lieu of
* VBUS events, the library attempts to determine the connection state via the bus suspension and wake up events instead. This however may be
* slightly inaccurate due to the possibility of the host suspending the bus while the device is still connected. If accurate connection status is
* required, the VBUS line of the USB connector should be routed to an AVR pin to detect its level, so that the USB_DeviceState global
* can be accurately set and the \ref EVENT_USB_Device_Connect() and \ref EVENT_USB_Device_Disconnect() events manually raised by the RAISE_EVENT macro.
* required, the VBUS line of the USB connector should be routed to an AVR pin to detect its level, so that the \ref USB_DeviceState global
* can be accurately set and the \ref EVENT_USB_Device_Connect() and \ref EVENT_USB_Device_Disconnect() events manually raised by the user application.
* When defined, this token disables the library's auto-detection of the connection state by the aforementioned suspension and wake up events.
*
* \li <b>NO_SOF_EVENTS</b> - (\ref Group_Events) - <i>All Architectures</i> \n

View File

@ -17,7 +17,6 @@
* \li \subpage Page_VIDPID - Allocated USB VID and PID Values
* \li \subpage Page_OSDrivers - Operating System Driver Information
* \li \subpage Page_BuildLibrary - Building as a Linkable Library
* \li \subpage Page_ExportingLibrary - Exporting LUFA for IDE Use
* \li \subpage Page_WritingBoardDrivers - How to Write Custom Board Drivers
* \li \subpage Page_SoftwareBootloaderStart - How to jump to the bootloader in software
*/

View File

@ -92,6 +92,7 @@
* - STK525
* - STK526
* - XPLAIN (Original green board, <i>not</i> the newer blue XPLAINED family boards)
* - Xplained-MINI
*
* \section Sec_AVR8Support_ThirdParty Supported Third Party Boards
* Currently supported third-party boards (see \ref Group_BoardTypes for makefile \c BOARD constant names):
@ -117,6 +118,7 @@
* - Olimex AVR-ISP-MK2
* - Paranoid Studio's US2AX (V1, V2 and V3 hardware revisions)
* - PJRC Teensy (1.x and 2.x versions)
* - Pololu A-Star Micro
* - Rikus' U2S
* - Sparkfun U2 Breakout Board
* - Stange ISP Programmer Board

View File

@ -9,10 +9,9 @@
*
* \image html Images/Author.jpg "Dean Camera, LUFA Developer"
*
* I am a 24 year old Atmel Applications Engineer, living in Trondheim, Norway and working on LUFA in my spare time.
* The development and support of this library requires much effort from myself, as I am the sole developer, maintainer
* and supporter. Please consider donating a small amount to support this and my future Open Source projects - All
* donations are <i>greatly</i> appreciated.
* I am a software developer working on LUFA in my spare time. The development and support of this library requires
* much effort from myself, as I am the sole developer, maintainer and supporter. Please consider donating a small
* amount to support this and my future Open Source projects - All donations are <i>greatly</i> appreciated.
*
* Note that commercial entities can remove the attribution portion of the LUFA license by a one-time fee - see
* \ref Page_LicenseInfo for more details (<b>Note: Please do NOT pay this in advance through the donation link below -

View File

@ -9,6 +9,70 @@
* issues in the library. Most of these issues should be corrected in the future release - see
* \ref Page_FutureChanges for a list of planned changes in future releases.
*
* \section Sec_KnownIssues170418 Version 170418
* - AVR8 Architecture
* - No known issues.
* - UC3 Architecture
* \warning The UC3 device support is currently <b>experimental</b> (incomplete and/or non-functional), and is included for preview purposes only. \n
*
* - No demos, bootloaders or projects have been ported for the UC3 devices in the current release,
* although the architecture is supported in the LUFA core library.
* - DMA transfers to and from the USB controller are not yet implemented for this release.
* - The UC3C, UC3D and UC3L sub-families of UC3 are not currently supported by the library due to their
* altered USB controller design.
* - The various \c *_CreateStream() functions for creating standard \c <stdio.h> compatible virtual file
* streams are not available on the UC3 architecture, due to a lack of suitable library support.
* - XMEGA Architecture
* \warning The XMEGA device support is currently <b>experimental</b> (incomplete and/or non-functional), and is included for preview purposes only.
*
* - Endpoints of more than 64 bytes are not currently supported in this release.
* - Isochronous endpoints are not currently supported in this release. As a result, the audio class
* cannot be used on XMEGA devices.
* - Multiple-bank endpoints are not currently supported in this release.
* - Early silicon revisions of the ATXMEGA128A1U are incompatible with LUFA, due to their various errata
* relating to the USB controller.
* - Architecture Independent
* - The LUFA library is not watchdog aware, and thus timeouts are possible if short periods are used
* and a lengthy USB operation is initiated.
* - No LUFA provided driver INF files for Windows are signed, and thus may fail to install on systems where driver signing is enforced (e.g. Windows 8/10).
* - Build System
* - No known issues.
* - Atmel Studio Integration
* - Not all devices are listed in the "Supported Parts" screen when selecting a device. To select an alternative device, change the "Show Device" drop-down to "All Parts".
* - When switching boards after changing the device selection, a second conflicting \c BOARD symbol definition can be created that prevents successful compilation. To fix, open the project properties window (<i>Project->Project {name} Properties...</i> menu item), click the "Toolchain" tab, click "Symbols" under the "AVR/GNU C Compiler" section and remove the incorrect definition.
*
* \section Sec_KnownIssues151115 Version 151115
* - AVR8 Architecture
* - No known issues.
* - UC3 Architecture
* \warning The UC3 device support is currently <b>experimental</b> (incomplete and/or non-functional), and is included for preview purposes only. \n
*
* - No demos, bootloaders or projects have been ported for the UC3 devices in the current release,
* although the architecture is supported in the LUFA core library.
* - DMA transfers to and from the USB controller are not yet implemented for this release.
* - The UC3C, UC3D and UC3L sub-families of UC3 are not currently supported by the library due to their
* altered USB controller design.
* - The various \c *_CreateStream() functions for creating standard \c <stdio.h> compatible virtual file
* streams are not available on the UC3 architecture, due to a lack of suitable library support.
* - XMEGA Architecture
* \warning The XMEGA device support is currently <b>experimental</b> (incomplete and/or non-functional), and is included for preview purposes only.
*
* - Endpoints of more than 64 bytes are not currently supported in this release.
* - Isochronous endpoints are not currently supported in this release. As a result, the audio class
* cannot be used on XMEGA devices.
* - Multiple-bank endpoints are not currently supported in this release.
* - Early silicon revisions of the ATXMEGA128A1U are incompatible with LUFA, due to their various errata
* relating to the USB controller.
* - Architecture Independent
* - The LUFA library is not watchdog aware, and thus timeouts are possible if short periods are used
* and a lengthy USB operation is initiated.
* - No LUFA provided driver INF files for Windows are signed, and thus may fail to install on systems where driver signing is enforced (e.g. Windows 8).
* - Build System
* - No known issues.
* - Atmel Studio Integration
* - Not all devices are listed in the "Supported Parts" screen when selecting a device. To select an alternative device, change the "Show Device" drop-down to "All Parts".
* - When switching boards after changing the device selection, a second conflicting \c BOARD symbol definition can be created that prevents successful compilation. To fix, open the project properties window (<i>Project->Project {name} Properties...</i> menu item), click the "Toolchain" tab, click "Symbols" under the "AVR/GNU C Compiler" section and remove the incorrect definition.
*
* \section Sec_KnownIssues140928 Version 140928
* - AVR8 Architecture
* - No known issues.

View File

@ -76,6 +76,7 @@
* \li Gumbi, a Python library and USB GPIO controller: https://code.google.com/p/gumbi/
* \li Hardware Volume Control: https://github.com/davidk/hw-volume-control
* \li Hiduino, a USB-MIDI replacement firmware for the Arduino Uno: http://code.google.com/p/hiduino/
* \li HoodLoader2, an Arduino Uno enhanced USB AVR coprocessor firmware: https://github.com/NicoHood/HoodLoader2
* \li IBM capacitive keybord replacement controller: http://downloads.cornall.co/ibm-capsense-usb-web/ibm-capsense-usb.html
* \li Ikea RGB LED USB modification: http://slashhome.se/p/projects/id/ikea_dioder_usb/#project
* \li IR electricity meter monitor: http://sourceforge.net/projects/irmetermon/
@ -168,6 +169,7 @@
* \li BitFury, a Bitcoin ASIC miner: https://github.com/aauer1/LUFA-BitFury/tree/master/Projects/BitfuryBTC
* \li Ceberus, a MadCatz Xbox 360 arcade stick modifier: http://www.phreakmods.com/products/cerberus
* \li CFFA3000, a CompactFlash interface for the Apple II: http://www.dreher.net/CFforAppleII
* \li ChameleonMini, a RFID monitoring tool: https://github.com/emsec/ChameleonMini/wiki
* \li Digital Survey Instruments Magnetometer and Pointer: http://www.digitalsurveyinstruments.com/
* \li FinchRobot, a robot designed for educational use: http://www.finchrobot.com/
* \li Flysight, a GPS logger for wingsuit pilots: http://flysight.ca/

View File

@ -10,6 +10,15 @@
* to the next version released. It does not indicate all new additions to the library in each version change, only
* areas relevant to making older projects compatible with the API changes of each new release.
*
* \section Sec_Migration170418 Version 170418
* <b>Device Mode</b>
* - The \c CALLBACK_USB_GetDescriptor() callback function into the user application's \c wIndex parameter is now \c uint16_t, not \c uint8_t.
*
* \section Sec_Migration151115 Migrating from 140928 to 151115
* <b>Non-USB Library Components</b>
* - The ATPROGRAM LUFA build system module now defaults to the Atmel ICE debugger tool, instead of the Atmel JTAG ICE3.
* - The \c Serial_CreateStream() and \c Serial_CreateBlockingStream() functions now require a USART base pointer for XMEGA devices as the first parameter.
*
* \section Sec_Migration140928 Migrating from 140302 to 140928
* <b>Device Mode</b>
* - The device mode RNDIS class driver now requires a user-supplied buffer and buffer length to operate, rather

View File

@ -24,7 +24,4 @@
* If you wish to use the DFU bootloader to program in your application, refer to your DFU programmer's documentation.
* Atmel provides a free utility called FLIP which is USB AVR compatible, and an open source (Linux compatible)
* alternative exists called "dfu-programmer".
*
* \see \ref Page_BuildModule_DFU for information on the LUFA build system DFU module, for automatic DFU bootloader
* programming makefile targets.
*/

View File

@ -31,7 +31,7 @@
*
* uint32_t Boot_Key ATTR_NO_INIT;
*
* #define MAGIC_BOOT_KEY 0xDC42ACCA
* #define MAGIC_BOOT_KEY 0xBADCAFE5
* #define BOOTLOADER_START_ADDRESS ((FLASH_SIZE_BYTES - BOOTLOADER_SEC_SIZE_BYTES) >> 1)
*
* void Bootloader_Jump_Check(void) ATTR_INIT_SECTION(3);

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

View File

@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted

Some files were not shown because too many files have changed in this diff Show More