diff --git a/Firmware/DFUHID/.gitignore b/Firmware/DFUHID/.gitignore new file mode 100644 index 0000000..4e73d1e --- /dev/null +++ b/Firmware/DFUHID/.gitignore @@ -0,0 +1 @@ +hid_bootloader_cli diff --git a/Firmware/DFUHID/Makefile b/Firmware/DFUHID/Makefile new file mode 100644 index 0000000..d7d6458 --- /dev/null +++ b/Firmware/DFUHID/Makefile @@ -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 diff --git a/Firmware/DFUHID/Makefile.bsd b/Firmware/DFUHID/Makefile.bsd new file mode 100644 index 0000000..a15a664 --- /dev/null +++ b/Firmware/DFUHID/Makefile.bsd @@ -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 diff --git a/Firmware/DFUHID/gpl3.txt b/Firmware/DFUHID/gpl3.txt new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/Firmware/DFUHID/gpl3.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + 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. + + + Copyright (C) + + 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 . + +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: + + Copyright (C) + 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 +. + + 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 +. diff --git a/Firmware/DFUHID/hid_bootloader_cli.c b/Firmware/DFUHID/hid_bootloader_cli.c new file mode 100644 index 0000000..b54f943 --- /dev/null +++ b/Firmware/DFUHID/hid_bootloader_cli.c @@ -0,0 +1,1013 @@ +/* Modified for the LUFA HID Bootloader by Dean Camera + * http://www.lufa-lib.org + * + * THIS MODIFIED VERSION IS UNSUPPORTED BY PJRC. + */ + +/* Teensy Loader, Command Line Interface + * Program and Reboot Teensy Board with HalfKay Bootloader + * http://www.pjrc.com/teensy/loader_cli.html + * Copyright 2008-2010, PJRC.COM, LLC + * + * + * You may redistribute this program and/or modify it under the terms + * of the GNU General Public License as published by the Free Software + * Foundation, version 3 of the License. + * + * 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/ + */ + +/* Want to incorporate this code into a proprietary application?? + * Just email paul@pjrc.com to ask. Usually it's not a problem, + * but you do need to ask to use this code in any way other than + * those permitted by the GNU General Public License, version 3 */ + +/* For non-root permissions on ubuntu or similar udev-based linux + * http://www.pjrc.com/teensy/49-teensy.rules + */ + +#include +#include +#include +#include +#include +#include + +void usage(void) +{ + fprintf(stderr, "Usage: hid_bootloader_cli -mmcu= [-w] [-h] [-n] [-v] \n"); + fprintf(stderr, "\t-w : Wait for device to appear\n"); + fprintf(stderr, "\t-r : Use hard reboot if device not online\n"); + fprintf(stderr, "\t-n : No reboot after programming\n"); + fprintf(stderr, "\t-v : Verbose output\n"); + fprintf(stderr, "\n = atmegaXXuY or at90usbXXXY"); + + fprintf(stderr, "\nFor support and more information, please visit:\n"); + fprintf(stderr, "http://www.lufa-lib.org\n"); + + fprintf(stderr, "\nBased on the TeensyHID command line programmer software:\n"); + fprintf(stderr, "http://www.pjrc.com/teensy/loader_cli.html\n"); + exit(1); +} + +// USB Access Functions +int teensy_open(void); +int teensy_write(void *buf, int len, double timeout); +void teensy_close(void); +int hard_reboot(void); + +// Intel Hex File Functions +int read_intel_hex(const char *filename); +int ihex_bytes_within_range(int begin, int end); +void ihex_get_data(int addr, int len, unsigned char *bytes); + +// Misc stuff +int printf_verbose(const char *format, ...); +void delay(double seconds); +void die(const char *str, ...); +void parse_options(int argc, char **argv); + +// options (from user via command line args) +int wait_for_device_to_appear = 0; +int hard_reboot_device = 0; +int reboot_after_programming = 1; +int verbose = 0; +int code_size = 0, block_size = 0; +const char *filename=NULL; + + +/****************************************************************/ +/* */ +/* Main Program */ +/* */ +/****************************************************************/ + +int main(int argc, char **argv) +{ + unsigned char buf[260]; + int num, addr, r, first_block=1, waited=0; + + // parse command line arguments + parse_options(argc, argv); + if (!filename) { + fprintf(stderr, "Filename must be specified\n\n"); + usage(); + } + if (!code_size) { + fprintf(stderr, "MCU type must be specified\n\n"); + usage(); + } + printf_verbose("Teensy Loader, Command Line, Version 2.0\n"); + + // read the intel hex file + // this is done first so any error is reported before using USB + num = read_intel_hex(filename); + if (num < 0) die("error reading intel hex file \"%s\"", filename); + printf_verbose("Read \"%s\": %d bytes, %.1f%% usage\n", + filename, num, (double)num / (double)code_size * 100.0); + + // open the USB device + while (1) { + if (teensy_open()) break; + if (hard_reboot_device) { + if (!hard_reboot()) die("Unable to find rebootor\n"); + printf_verbose("Hard Reboot performed\n"); + hard_reboot_device = 0; // only hard reboot once + wait_for_device_to_appear = 1; + } + if (!wait_for_device_to_appear) die("Unable to open device\n"); + if (!waited) { + printf_verbose("Waiting for Teensy device...\n"); + printf_verbose(" (hint: press the reset button)\n"); + waited = 1; + } + delay(0.25); + } + printf_verbose("Found HalfKay Bootloader\n"); + + // if we waited for the device, read the hex file again + // perhaps it changed while we were waiting? + if (waited) { + num = read_intel_hex(filename); + if (num < 0) die("error reading intel hex file \"%s\"", filename); + printf_verbose("Read \"%s\": %d bytes, %.1f%% usage\n", + filename, num, (double)num / (double)code_size * 100.0); + } + + // program the data + printf_verbose("Programming"); + fflush(stdout); + for (addr = 0; addr < code_size; addr += block_size) { + if (addr > 0 && !ihex_bytes_within_range(addr, addr + block_size - 1)) { + // don't waste time on blocks that are unused, + // but always do the first one to erase the chip + continue; + } + printf_verbose("."); + if (code_size < 0x10000) { + buf[0] = addr & 255; + buf[1] = (addr >> 8) & 255; + } else { + buf[0] = (addr >> 8) & 255; + buf[1] = (addr >> 16) & 255; + } + ihex_get_data(addr, block_size, buf + 2); + r = teensy_write(buf, block_size + 2, first_block ? 3.0 : 0.25); + if (!r) die("error writing to Teensy\n"); + first_block = 0; + } + printf_verbose("\n"); + + // reboot to the user's new code + if (reboot_after_programming) { + printf_verbose("Booting\n"); + buf[0] = 0xFF; + buf[1] = 0xFF; + memset(buf + 2, 0, sizeof(buf) - 2); + teensy_write(buf, block_size + 2, 0.25); + } + teensy_close(); + return 0; +} + + + + +/****************************************************************/ +/* */ +/* USB Access - libusb (Linux & FreeBSD) */ +/* */ +/****************************************************************/ + +#if defined(USE_LIBUSB) + +// http://libusb.sourceforge.net/doc/index.html +#include + +usb_dev_handle * open_usb_device(int vid, int pid) +{ + struct usb_bus *bus; + struct usb_device *dev; + usb_dev_handle *h; + #ifdef LIBUSB_HAS_GET_DRIVER_NP + char buf[128]; + #endif + int r; + + usb_init(); + usb_find_busses(); + usb_find_devices(); + //printf_verbose("\nSearching for USB device:\n"); + for (bus = usb_get_busses(); bus; bus = bus->next) { + for (dev = bus->devices; dev; dev = dev->next) { + //printf_verbose("bus \"%s\", device \"%s\" vid=%04X, pid=%04X\n", + // bus->dirname, dev->filename, + // dev->descriptor.idVendor, + // dev->descriptor.idProduct + //); + if (dev->descriptor.idVendor != vid) continue; + if (dev->descriptor.idProduct != pid) continue; + h = usb_open(dev); + if (!h) { + printf_verbose("Found device but unable to open"); + continue; + } + #ifdef LIBUSB_HAS_GET_DRIVER_NP + r = usb_get_driver_np(h, 0, buf, sizeof(buf)); + if (r >= 0) { + r = usb_detach_kernel_driver_np(h, 0); + if (r < 0) { + usb_close(h); + printf_verbose("Device is in use by \"%s\" driver", buf); + continue; + } + } + #endif + // Mac OS-X - removing this call to usb_claim_interface() might allow + // this to work, even though it is a clear misuse of the libusb API. + // normally Apple's IOKit should be used on Mac OS-X + r = usb_claim_interface(h, 0); + if (r < 0) { + usb_close(h); + printf_verbose("Unable to claim interface, check USB permissions"); + continue; + } + return h; + } + } + return NULL; +} + +static usb_dev_handle *libusb_teensy_handle = NULL; + +int teensy_open(void) +{ + teensy_close(); + libusb_teensy_handle = open_usb_device(0x16C0, 0x0478); + + if (!libusb_teensy_handle) + libusb_teensy_handle = open_usb_device(0x03eb, 0x2067); + + if (!libusb_teensy_handle) return 0; + return 1; +} + +int teensy_write(void *buf, int len, double timeout) +{ + int r; + + if (!libusb_teensy_handle) return 0; + r = usb_control_msg(libusb_teensy_handle, 0x21, 9, 0x0200, 0, (char *)buf, + len, (int)(timeout * 1000.0)); + if (r < 0) return 0; + return 1; +} + +void teensy_close(void) +{ + if (!libusb_teensy_handle) return; + usb_release_interface(libusb_teensy_handle, 0); + usb_close(libusb_teensy_handle); + libusb_teensy_handle = NULL; +} + +int hard_reboot(void) +{ + usb_dev_handle *rebootor; + int r; + + rebootor = open_usb_device(0x16C0, 0x0477); + + if (!rebootor) + rebootor = open_usb_device(0x03eb, 0x2067); + + if (!rebootor) return 0; + r = usb_control_msg(rebootor, 0x21, 9, 0x0200, 0, "reboot", 6, 100); + usb_release_interface(rebootor, 0); + usb_close(rebootor); + if (r < 0) return 0; + return 1; +} + +#endif + + +/****************************************************************/ +/* */ +/* USB Access - Microsoft WIN32 */ +/* */ +/****************************************************************/ + +#if defined(USE_WIN32) + +// http://msdn.microsoft.com/en-us/library/ms790932.aspx +#include +#include +#include +#include + +HANDLE open_usb_device(int vid, int pid) +{ + GUID guid; + HDEVINFO info; + DWORD index, required_size; + SP_DEVICE_INTERFACE_DATA iface; + SP_DEVICE_INTERFACE_DETAIL_DATA *details; + HIDD_ATTRIBUTES attrib; + HANDLE h; + BOOL ret; + + HidD_GetHidGuid(&guid); + info = SetupDiGetClassDevs(&guid, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE); + if (info == INVALID_HANDLE_VALUE) return NULL; + for (index=0; 1 ;index++) { + iface.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); + ret = SetupDiEnumDeviceInterfaces(info, NULL, &guid, index, &iface); + if (!ret) { + SetupDiDestroyDeviceInfoList(info); + break; + } + SetupDiGetInterfaceDeviceDetail(info, &iface, NULL, 0, &required_size, NULL); + details = (SP_DEVICE_INTERFACE_DETAIL_DATA *)malloc(required_size); + if (details == NULL) continue; + memset(details, 0, required_size); + details->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA); + ret = SetupDiGetDeviceInterfaceDetail(info, &iface, details, + required_size, NULL, NULL); + if (!ret) { + free(details); + continue; + } + h = CreateFile(details->DevicePath, GENERIC_READ|GENERIC_WRITE, + FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, + FILE_FLAG_OVERLAPPED, NULL); + free(details); + if (h == INVALID_HANDLE_VALUE) continue; + attrib.Size = sizeof(HIDD_ATTRIBUTES); + ret = HidD_GetAttributes(h, &attrib); + if (!ret) { + CloseHandle(h); + continue; + } + if (attrib.VendorID != vid || attrib.ProductID != pid) { + CloseHandle(h); + continue; + } + SetupDiDestroyDeviceInfoList(info); + return h; + } + return NULL; +} + +int write_usb_device(HANDLE h, void *buf, int len, int timeout) +{ + static HANDLE event = NULL; + unsigned char tmpbuf[1040]; + OVERLAPPED ov; + DWORD n, r; + + if (len > sizeof(tmpbuf) - 1) return 0; + if (event == NULL) { + event = CreateEvent(NULL, TRUE, TRUE, NULL); + if (!event) return 0; + } + ResetEvent(&event); + memset(&ov, 0, sizeof(ov)); + ov.hEvent = event; + tmpbuf[0] = 0; + memcpy(tmpbuf + 1, buf, len); + if (!WriteFile(h, tmpbuf, len + 1, NULL, &ov)) { + if (GetLastError() != ERROR_IO_PENDING) return 0; + r = WaitForSingleObject(event, timeout); + if (r == WAIT_TIMEOUT) { + CancelIo(h); + return 0; + } + if (r != WAIT_OBJECT_0) return 0; + } + if (!GetOverlappedResult(h, &ov, &n, FALSE)) return 0; + return 1; +} + +static HANDLE win32_teensy_handle = NULL; + +int teensy_open(void) +{ + teensy_close(); + win32_teensy_handle = open_usb_device(0x16C0, 0x0478); + + if (!win32_teensy_handle) + win32_teensy_handle = open_usb_device(0x03eb, 0x2067); + + if (!win32_teensy_handle) return 0; + return 1; +} + +int teensy_write(void *buf, int len, double timeout) +{ + int r; + if (!win32_teensy_handle) return 0; + r = write_usb_device(win32_teensy_handle, buf, len, (int)(timeout * 1000.0)); + return r; +} + +void teensy_close(void) +{ + if (!win32_teensy_handle) return; + CloseHandle(win32_teensy_handle); + win32_teensy_handle = NULL; +} + +int hard_reboot(void) +{ + HANDLE rebootor; + int r; + + rebootor = open_usb_device(0x16C0, 0x0477); + + if (!rebootor) + rebootor = open_usb_device(0x03eb, 0x2067); + + if (!rebootor) return 0; + r = write_usb_device(rebootor, "reboot", 6, 100); + CloseHandle(rebootor); + return r; +} + +#endif + + + +/****************************************************************/ +/* */ +/* USB Access - Apple's IOKit, Mac OS-X */ +/* */ +/****************************************************************/ + +#if defined(USE_APPLE_IOKIT) + +// http://developer.apple.com/technotes/tn2007/tn2187.html +#include +#include +#include + +struct usb_list_struct { + IOHIDDeviceRef ref; + int pid; + int vid; + struct usb_list_struct *next; +}; + +static struct usb_list_struct *usb_list=NULL; +static IOHIDManagerRef hid_manager=NULL; + +void attach_callback(void *context, IOReturn r, void *hid_mgr, IOHIDDeviceRef dev) +{ + CFTypeRef type; + struct usb_list_struct *n, *p; + int32_t pid, vid; + + if (!dev) return; + type = IOHIDDeviceGetProperty(dev, CFSTR(kIOHIDVendorIDKey)); + if (!type || CFGetTypeID(type) != CFNumberGetTypeID()) return; + if (!CFNumberGetValue((CFNumberRef)type, kCFNumberSInt32Type, &vid)) return; + type = IOHIDDeviceGetProperty(dev, CFSTR(kIOHIDProductIDKey)); + if (!type || CFGetTypeID(type) != CFNumberGetTypeID()) return; + if (!CFNumberGetValue((CFNumberRef)type, kCFNumberSInt32Type, &pid)) return; + n = (struct usb_list_struct *)malloc(sizeof(struct usb_list_struct)); + if (!n) return; + //printf("attach callback: vid=%04X, pid=%04X\n", vid, pid); + n->ref = dev; + n->vid = vid; + n->pid = pid; + n->next = NULL; + if (usb_list == NULL) { + usb_list = n; + } else { + for (p = usb_list; p->next; p = p->next) ; + p->next = n; + } +} + +void detach_callback(void *context, IOReturn r, void *hid_mgr, IOHIDDeviceRef dev) +{ + struct usb_list_struct *p, *tmp, *prev=NULL; + + p = usb_list; + while (p) { + if (p->ref == dev) { + if (prev) { + prev->next = p->next; + } else { + usb_list = p->next; + } + tmp = p; + p = p->next; + free(tmp); + } else { + prev = p; + p = p->next; + } + } +} + +void init_hid_manager(void) +{ + CFMutableDictionaryRef dict; + IOReturn ret; + + if (hid_manager) return; + hid_manager = IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDOptionsTypeNone); + if (hid_manager == NULL || CFGetTypeID(hid_manager) != IOHIDManagerGetTypeID()) { + if (hid_manager) CFRelease(hid_manager); + printf_verbose("no HID Manager - maybe this is a pre-Leopard (10.5) system?\n"); + return; + } + dict = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, + &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); + if (!dict) return; + IOHIDManagerSetDeviceMatching(hid_manager, dict); + CFRelease(dict); + IOHIDManagerScheduleWithRunLoop(hid_manager, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); + IOHIDManagerRegisterDeviceMatchingCallback(hid_manager, attach_callback, NULL); + IOHIDManagerRegisterDeviceRemovalCallback(hid_manager, detach_callback, NULL); + ret = IOHIDManagerOpen(hid_manager, kIOHIDOptionsTypeNone); + if (ret != kIOReturnSuccess) { + IOHIDManagerUnscheduleFromRunLoop(hid_manager, + CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); + CFRelease(hid_manager); + printf_verbose("Error opening HID Manager"); + } +} + +static void do_run_loop(void) +{ + while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, true) == kCFRunLoopRunHandledSource) ; +} + +IOHIDDeviceRef open_usb_device(int vid, int pid) +{ + struct usb_list_struct *p; + IOReturn ret; + + init_hid_manager(); + do_run_loop(); + for (p = usb_list; p; p = p->next) { + if (p->vid == vid && p->pid == pid) { + ret = IOHIDDeviceOpen(p->ref, kIOHIDOptionsTypeNone); + if (ret == kIOReturnSuccess) return p->ref; + } + } + return NULL; +} + +void close_usb_device(IOHIDDeviceRef dev) +{ + struct usb_list_struct *p; + + do_run_loop(); + for (p = usb_list; p; p = p->next) { + if (p->ref == dev) { + IOHIDDeviceClose(dev, kIOHIDOptionsTypeNone); + return; + } + } +} + +static IOHIDDeviceRef iokit_teensy_reference = NULL; + +int teensy_open(void) +{ + teensy_close(); + iokit_teensy_reference = open_usb_device(0x16C0, 0x0478); + + if (!iokit_teensy_reference) + iokit_teensy_reference = open_usb_device(0x03eb, 0x2067); + + if (!iokit_teensy_reference) return 0; + return 1; +} + +int teensy_write(void *buf, int len, double timeout) +{ + IOReturn ret; + + // timeouts do not work on OS-X + // IOHIDDeviceSetReportWithCallback is not implemented + // even though Apple documents it with a code example! + // submitted to Apple on 22-sep-2009, problem ID 7245050 + if (!iokit_teensy_reference) return 0; + ret = IOHIDDeviceSetReport(iokit_teensy_reference, + kIOHIDReportTypeOutput, 0, buf, len); + if (ret == kIOReturnSuccess) return 1; + return 0; +} + +void teensy_close(void) +{ + if (!iokit_teensy_reference) return; + close_usb_device(iokit_teensy_reference); + iokit_teensy_reference = NULL; +} + +int hard_reboot(void) +{ + IOHIDDeviceRef rebootor; + IOReturn ret; + + rebootor = open_usb_device(0x16C0, 0x0477); + + if (!rebootor) + rebootor = open_usb_device(0x03eb, 0x2067); + + if (!rebootor) return 0; + ret = IOHIDDeviceSetReport(rebootor, + kIOHIDReportTypeOutput, 0, (uint8_t *)("reboot"), 6); + close_usb_device(rebootor); + if (ret == kIOReturnSuccess) return 1; + return 0; +} + +#endif + + + +/****************************************************************/ +/* */ +/* USB Access - BSD's UHID driver */ +/* */ +/****************************************************************/ + +#if defined(USE_UHID) + +// Thanks to Todd T Fries for help getting this working on OpenBSD +// and to Chris Kuethe for the initial patch to use UHID. + +#include +#include +#include +#include +#ifndef USB_GET_DEVICEINFO +#include +#endif + +#ifndef USB_GET_DEVICEINFO +# define USB_GET_DEVICEINFO 0 +# error The USB_GET_DEVICEINFO ioctl() value is not defined for your system. +#endif + +int open_usb_device(int vid, int pid) +{ + int r, fd; + DIR *dir; + struct dirent *d; + struct usb_device_info info; + char buf[256]; + + dir = opendir("/dev"); + if (!dir) return -1; + while ((d = readdir(dir)) != NULL) { + if (strncmp(d->d_name, "uhid", 4) != 0) continue; + snprintf(buf, sizeof(buf), "/dev/%s", d->d_name); + fd = open(buf, O_RDWR); + if (fd < 0) continue; + r = ioctl(fd, USB_GET_DEVICEINFO, &info); + if (r < 0) { + // NetBSD: added in 2004 + // OpenBSD: added November 23, 2009 + // FreeBSD: missing (FreeBSD 8.0) - USE_LIBUSB works! + die("Error: your uhid driver does not support" + " USB_GET_DEVICEINFO, please upgrade!\n"); + close(fd); + closedir(dir); + exit(1); + } + //printf("%s: v=%d, p=%d\n", buf, info.udi_vendorNo, info.udi_productNo); + if (info.udi_vendorNo == vid && info.udi_productNo == pid) { + closedir(dir); + return fd; + } + close(fd); + } + closedir(dir); + return -1; +} + +static int uhid_teensy_fd = -1; + +int teensy_open(void) +{ + teensy_close(); + uhid_teensy_fd = open_usb_device(0x16C0, 0x0478); + + if (uhid_teensy_fd < 0) + uhid_teensy_fd = open_usb_device(0x03eb, 0x2067); + + if (uhid_teensy_fd < 0) return 0; + return 1; +} + +int teensy_write(void *buf, int len, double timeout) +{ + int r; + + // TODO: implement timeout... how?? + r = write(uhid_teensy_fd, buf, len); + if (r == len) return 1; + return 0; +} + +void teensy_close(void) +{ + if (uhid_teensy_fd >= 0) { + close(uhid_teensy_fd); + uhid_teensy_fd = -1; + } +} + +int hard_reboot(void) +{ + int r, rebootor_fd; + + rebootor_fd = open_usb_device(0x16C0, 0x0477); + + if (rebootor_fd < 0) + rebootor_fd = open_usb_device(0x03eb, 0x2067); + + if (rebootor_fd < 0) return 0; + r = write(rebootor_fd, "reboot", 6); + delay(0.1); + close(rebootor_fd); + if (r == 6) return 1; + return 0; +} + +#endif + + + +/****************************************************************/ +/* */ +/* Read Intel Hex File */ +/* */ +/****************************************************************/ + +// the maximum flash image size we can support +// chips with larger memory may be used, but only this +// much intel-hex data can be loaded into memory! +#define MAX_MEMORY_SIZE 0x10000 + +static unsigned char firmware_image[MAX_MEMORY_SIZE]; +static unsigned char firmware_mask[MAX_MEMORY_SIZE]; +static int end_record_seen=0; +static int byte_count; +static unsigned int extended_addr = 0; +static int parse_hex_line(char *line); + +int read_intel_hex(const char *filename) +{ + FILE *fp; + int i, lineno=0; + char buf[1024]; + + byte_count = 0; + end_record_seen = 0; + for (i=0; i= MAX_MEMORY_SIZE) return 0; + ptr += 2; + sum = (len & 255) + ((addr >> 8) & 255) + (addr & 255) + (code & 255); + if (code != 0) { + if (code == 1) { + end_record_seen = 1; + return 1; + } + if (code == 2 && len == 2) { + if (!sscanf(ptr, "%04x", &i)) return 1; + ptr += 4; + sum += ((i >> 8) & 255) + (i & 255); + if (!sscanf(ptr, "%02x", &cksum)) return 1; + if (((sum & 255) + (cksum & 255)) & 255) return 1; + extended_addr = i << 4; + //printf("ext addr = %05X\n", extended_addr); + } + if (code == 4 && len == 2) { + if (!sscanf(ptr, "%04x", &i)) return 1; + ptr += 4; + sum += ((i >> 8) & 255) + (i & 255); + if (!sscanf(ptr, "%02x", &cksum)) return 1; + if (((sum & 255) + (cksum & 255)) & 255) return 1; + extended_addr = i << 16; + //printf("ext addr = %08X\n", extended_addr); + } + return 1; // non-data line + } + byte_count += len; + while (num != len) { + if (sscanf(ptr, "%02x", &i) != 1) return 0; + i &= 255; + firmware_image[addr + extended_addr + num] = i; + firmware_mask[addr + extended_addr + num] = 1; + ptr += 2; + sum += i; + (num)++; + if (num >= 256) return 0; + } + if (!sscanf(ptr, "%02x", &cksum)) return 0; + if (((sum & 255) + (cksum & 255)) & 255) return 0; /* checksum error */ + return 1; +} + +int ihex_bytes_within_range(int begin, int end) +{ + int i; + + if (begin < 0 || begin >= MAX_MEMORY_SIZE || + end < 0 || end >= MAX_MEMORY_SIZE) { + return 0; + } + for (i=begin; i<=end; i++) { + if (firmware_mask[i]) return 1; + } + return 0; +} + +void ihex_get_data(int addr, int len, unsigned char *bytes) +{ + int i; + + if (addr < 0 || len < 0 || addr + len >= MAX_MEMORY_SIZE) { + for (i=0; i .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) diff --git a/Firmware/Keyboard/Descriptors.c b/Firmware/Keyboard/Descriptors.c index 1d9bd50..b1530f9 100644 --- a/Firmware/Keyboard/Descriptors.c +++ b/Firmware/Keyboard/Descriptors.c @@ -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); diff --git a/Firmware/Keyboard/Descriptors.h b/Firmware/Keyboard/Descriptors.h index 6d865d0..f3a844b 100644 --- a/Firmware/Keyboard/Descriptors.h +++ b/Firmware/Keyboard/Descriptors.h @@ -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); diff --git a/Firmware/Keyboard/makefile b/Firmware/Keyboard/makefile index 682297f..583e665 100644 --- a/Firmware/Keyboard/makefile +++ b/Firmware/Keyboard/makefile @@ -72,4 +72,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 \ No newline at end of file diff --git a/Firmware/LUFA/Build/DMBS/.gitignore b/Firmware/LUFA/Build/DMBS/.gitignore new file mode 100644 index 0000000..9387689 --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/.gitignore @@ -0,0 +1,9 @@ +*.lss +*.bin +*.elf +*.hex +*.eep +*.map +*.o +*.d +*.sym diff --git a/Firmware/LUFA/Build/DMBS/DMBS/HID_EEPROM_Loader/HID_EEPROM_Loader.c b/Firmware/LUFA/Build/DMBS/DMBS/HID_EEPROM_Loader/HID_EEPROM_Loader.c new file mode 100644 index 0000000..35ea2d7 --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/DMBS/HID_EEPROM_Loader/HID_EEPROM_Loader.c @@ -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 +#include +#include + +/* 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 (;;); +} diff --git a/Firmware/LUFA/Build/DMBS/DMBS/HID_EEPROM_Loader/makefile b/Firmware/LUFA/Build/DMBS/DMBS/HID_EEPROM_Loader/makefile new file mode 100644 index 0000000..879eda8 --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/DMBS/HID_EEPROM_Loader/makefile @@ -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 diff --git a/Firmware/LUFA/Build/DMBS/DMBS/License.txt b/Firmware/LUFA/Build/DMBS/DMBS/License.txt new file mode 100644 index 0000000..322c762 --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/DMBS/License.txt @@ -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 diff --git a/Firmware/LUFA/Build/DMBS/DMBS/ModulesOverview.md b/Firmware/LUFA/Build/DMBS/DMBS/ModulesOverview.md new file mode 100644 index 0000000..1fd9cc1 --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/DMBS/ModulesOverview.md @@ -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) diff --git a/Firmware/LUFA/Build/DMBS/DMBS/WritingYourOwnModules.md b/Firmware/LUFA/Build/DMBS/DMBS/WritingYourOwnModules.md new file mode 100644 index 0000000..3ecbb33 --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/DMBS/WritingYourOwnModules.md @@ -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 diff --git a/Firmware/LUFA/Build/DMBS/DMBS/atprogram.md b/Firmware/LUFA/Build/DMBS/DMBS/atprogram.md new file mode 100644 index 0000000..ea1b0d9 --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/DMBS/atprogram.md @@ -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: + + + + + + + + + + + + +
atprogramProgram the device FLASH memory with the application's executable data.
atprogram-eeProgram the device EEPROM memory with the application's EEPROM data.
+ +## 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: + + + + + + + + + + + + +
MCUName of the Atmel processor model (e.g. `at90usb1287`).
TARGETName of the application output file prefix (e.g. `TestApplication`).
+ +## 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. + + + + + + + + + + + + + + + + +
ATPROGRAM_PROGRAMMERName of the Atmel programmer or debugger tool to communicate with (e.g. `jtagice3`). Default is `atmelice`.
ATPROGRAM_INTERFACEName of the programming interface to use when programming the target (e.g. `spi`). Default is `jtag`.
ATPROGRAM_PORTName of the communication port to use when when programming with a serially connected tool (e.g. `COM2`). Default is `usb`.
+ +## Provided Variables: + +The following variables may be referenced in a user makefile (via `$(NAME)` +syntax) if desired, as they are provided by this module. + + + + + + + + +
N/AThis module provides no variables.
+ +## 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. + + + + + + + + +
N/AThis module provides no macros.
+ +## 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. diff --git a/Firmware/LUFA/Build/DMBS/DMBS/atprogram.mk b/Firmware/LUFA/Build/DMBS/DMBS/atprogram.mk new file mode 100644 index 0000000..a505275 --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/DMBS/atprogram.mk @@ -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) diff --git a/Firmware/LUFA/Build/DMBS/DMBS/avrdude.md b/Firmware/LUFA/Build/DMBS/DMBS/avrdude.md new file mode 100644 index 0000000..d6c71ce --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/DMBS/avrdude.md @@ -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: + + + + + + + + + + + + +
avrdudeProgram the device FLASH memory with the application's executable data.
avrdude-eeProgram the device EEPROM memory with the application's EEPROM data.
+ +## 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: + + + + + + + + + + + + +
MCUName of the Atmel processor model (e.g. `at90usb1287`).
TARGETName of the application output file prefix (e.g. `TestApplication`).
+ +## 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. + + + + + + + + + + + + + + + + + + + + +
AVRDUDE_PROGRAMMERName of the programmer/debugger tool or bootloader to communicate with (e.g. `jtagicemkii`). Default is `jtagicemkii`.
AVRDUDE_PORTName of the communication port to use when when programming with a serially connected tool (e.g. `COM2`). Default is `usb`.
AVRDUDE_FLAGSAdditional flags to pass to `avrdude` when invoking the tool. Default is empty (no additional flags).
AVRDUDE_MEMORYMemory space to program when executing the `avrdude` target (e.g. 'application` for an XMEGA device). Default is `flash`.
+ +## Provided Variables: + +The following variables may be referenced in a user makefile (via `$(NAME)` +syntax) if desired, as they are provided by this module. + + + + + + + + +
N/AThis module provides no variables.
+ +## 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. + + + + + + + + +
N/AThis module provides no macros.
+ +## 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. diff --git a/Firmware/LUFA/Build/DMBS/DMBS/avrdude.mk b/Firmware/LUFA/Build/DMBS/DMBS/avrdude.mk new file mode 100644 index 0000000..c4bac8f --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/DMBS/avrdude.mk @@ -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) diff --git a/Firmware/LUFA/Build/DMBS/DMBS/core.md b/Firmware/LUFA/Build/DMBS/DMBS/core.md new file mode 100644 index 0000000..c7c9767 --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/DMBS/core.md @@ -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: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
helpShow help for the current project, including a list of all available targets, variables and macros from the imported modules.
list_targetsShow a list of all build targets from the imported modules.
list_modulesShow a list of all imported modules.
list_mandatoryShow a list of all mandatory variables from the imported modules.
list_optionalShow a list of all optional variables from the imported modules.
list_providedShow a list of all variables provided by the imported modules.
list_macrosShow a list of all macros provided by the imported modules.
+ +## 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: + + + + + + + + +
N/AThis module has no mandatory variables.
+ +## 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. + + + + + + + + +
N/AThis module has no optional variables.
+ +## Provided Variables: + +The following variables may be referenced in a user makefile (via `$(NAME)` +syntax) if desired, as they are provided by this module. + + + + + + + + +
DMBS_VERSIONCurrent version of this DMBS release, as a ISO 8601 integer (such as `160403` for `2016-04-03`).
+ +## 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. + + + + + + + + + + + + + + + + + + + + +
DMBS_CHECK_VERSIONMacro to check the current DMBS version against the first argument and abort if the required version is newer than the current version.
ERROR_IF_UNSETMacro to check the given makefile variable name passed as the first argument, and abort if it has not been set by any makefile module.
ERROR_IF_EMPTYMacro to check the given makefile variable name passed as the first argument, and abort if it has an empty value.
ERROR_IF_NONBOOLMacro to check the given makefile variable name passed as the first argument, and abort if it has a value other than `Y` or `N`.
+ +## 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. diff --git a/Firmware/LUFA/Build/DMBS/DMBS/core.mk b/Firmware/LUFA/Build/DMBS/DMBS/core.mk new file mode 100644 index 0000000..1c55569 --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/DMBS/core.mk @@ -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) diff --git a/Firmware/LUFA/Build/DMBS/DMBS/cppcheck.md b/Firmware/LUFA/Build/DMBS/DMBS/cppcheck.md new file mode 100644 index 0000000..ec0e38d --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/DMBS/cppcheck.md @@ -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: + + + + + + + + + + + + +
cppcheckScan the project with CPPCHECK, and show all discovered issues.
cppcheck-configCheck the project with CPPCHECK, to find missing header paths.
+ +## 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: + + + + + + + + +
SRCList of all project source files to scan.
+ +## 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. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CPPCHECK_INCLUDESExtra include paths to search, for any missing header files. Default is empty (no additional paths).
CPPCHECK_EXCLUDESList of source files, file paths or path fragments to exclude from the scan. Default is empty (no exclusions).
CPPCHECK_MSG_TEMPLATETemplate for error and warning message output. Default is `{file}:{line}: {severity} ({id}): {message}`.
CPPCHECK_ENABLEList of CPPCHECK checks to enable. Default is `all`.
CPPCHECK_SUPPRESSList of CPPCHECK checks to ignore. Default is `variableScope missingInclude`.
CPPCHECK_FAIL_ON_WARNINGBoolean, if `Y` the build will fail if CPPCHECK discovers any errors or warnings. If `N`, fail only on errors. Default is `Y`.
CPPCHECK_QUIETBoolean, if `Y` CPPCHECK will suppress all output except for discovered errors or warnings. If `N`, scan progress will be emitted. Default is `Y`.
CPPCHECK_FLAGS_Additional flags to pass to CPPCHECK when scans are started. Default is empty (no additional flags).
+ +## Provided Variables: + +The following variables may be referenced in a user makefile (via `$(NAME)` +syntax) if desired, as they are provided by this module. + + + + + + + + +
N/AThis module provides no variables.
+ +## 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. + + + + + + + + +
N/AThis module provides no macros.
+ +## 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. diff --git a/Firmware/LUFA/Build/DMBS/DMBS/cppcheck.mk b/Firmware/LUFA/Build/DMBS/DMBS/cppcheck.mk new file mode 100644 index 0000000..9b82fc3 --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/DMBS/cppcheck.mk @@ -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) diff --git a/Firmware/LUFA/Build/DMBS/DMBS/dfu.md b/Firmware/LUFA/Build/DMBS/DMBS/dfu.md new file mode 100644 index 0000000..456bbf6 --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/DMBS/dfu.md @@ -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: + + + + + + + + + + + + + + + + + + + + +
flipProgram the application into the device's flash memory, using Atmel FLIP.
flip-eeProgram the application's EEPROM data into the device's EEPROM memory, using Atmel FLIP.
dfuProgram the application into the device's flash memory, using `dfu-programmer`.
dfu-eeProgram the application's EEPROM data into the device's EEPROM memory, using `dfu-programmer`.
+ +## 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: + + + + + + + + + + + + +
MCUName of the Atmel processor model (e.g. `at90usb1287`).
TARGETName of the application output file prefix (e.g. `TestApplication`).
+ +## 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. + + + + + + + + +
N/AThis module has no optional variables.
+ +## Provided Variables: + +The following variables may be referenced in a user makefile (via `$(NAME)` +syntax) if desired, as they are provided by this module. + + + + + + + + +
N/AThis module provides no variables.
+ +## 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. + + + + + + + + +
N/AThis module provides no macros.
+ +## 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. diff --git a/Firmware/LUFA/Build/DMBS/DMBS/dfu.mk b/Firmware/LUFA/Build/DMBS/DMBS/dfu.mk new file mode 100644 index 0000000..1eb22b8 --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/DMBS/dfu.mk @@ -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) diff --git a/Firmware/LUFA/Build/DMBS/DMBS/doxygen.md b/Firmware/LUFA/Build/DMBS/DMBS/doxygen.md new file mode 100644 index 0000000..837704a --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/DMBS/doxygen.md @@ -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: + + + + + + + + + + + + + + + + +
doxygenGenerate project documentation, via Doxygen.
doxygen-createCreate a new project Doxygen template, which can then be customized.
doxygen-upgradeUpgrade an existing project Doxygen template to the latest Doxygen version.
+ +## 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: + + + + + + + + +
N/AThis module has no mandatory variables.
+ +## 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. + + + + + + + + + + + + + + + + +
DOXYGEN_CONFName of the Doxygen project configuration file that should be used when generating documentation, or creating/upgrading the configuration file.
DOXYGEN_FAIL_ON_WARNINGBoolean, if `Y` the build will fail if Doxygen encounters any errors or warnings. If `N`, fail only on errors. Default is `Y`.
DOXYGEN_OVERRIDE_PARAMSList of `NAME=VALUE` parameters which should override the values specified in the project configuration file, when building documentation.
+ +## Provided Variables: + +The following variables may be referenced in a user makefile (via `$(NAME)` +syntax) if desired, as they are provided by this module. + + + + + + + + +
N/AThis module provides no variables.
+ +## 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. + + + + + + + + +
N/AThis module provides no macros.
+ +## 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. diff --git a/Firmware/LUFA/Build/DMBS/DMBS/doxygen.mk b/Firmware/LUFA/Build/DMBS/DMBS/doxygen.mk new file mode 100644 index 0000000..45639ad --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/DMBS/doxygen.mk @@ -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 + + diff --git a/Firmware/LUFA/Build/DMBS/DMBS/gcc.md b/Firmware/LUFA/Build/DMBS/DMBS/gcc.md new file mode 100644 index 0000000..f516da5 --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/DMBS/gcc.md @@ -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: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
sizeShow the compiled binary size for the various memory segments.
symbol-sizesShow the size of each symbol in the compiled binary (useful to find large functions to optimize further).
allBuild application and generate all binary (BIN, ELF, HEX) and auxiliary (LSS, MAP, SYM, etc.) output files.
libGenerate a static `.a` library from the application code, containing the flash region's data.
elfGenerate an ELF debug file from the application code, containing all region's data.
binGenerate a flat BIN binary file from the application code, containing the flash region's data.
hexGenerate a pair of Intel HEX files from the application code, containing the flash region's data (HEX) and EEPROM data (EEP).
lssGenerate a LSS listing file showing the disassembly of the compiled application.
cleanRemove all generated project intermediary and binary output files.
mostlycleanRemove all generated project intermediary output files, but preserve the binary output files.
+ +## 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: + + + + + + + + + + + + + + + + + + + + +
MCUName of the Atmel processor model (e.g. `at90usb1287`).
TARGETName of the application output file prefix (e.g. `TestApplication`).
ARCHTarget device architecture (e.g. `AVR8`).
SRCList of all project source files (C, C++, ASM).
+ +## 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. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OPTIMIZATIONOptimization level to use when compiling C and C++ source files. Default is `s` (optimize for smallest size).
C_STANDARDC language standard used when compiling C language source files. Default is `gnu99` (C99 standard with GNU extensions)./td> +
CPP_STANDARDC++ language standard used when compiling C++ language source files. Default is `gnu++98` (C++98 standard with GNU extensions)./td> +
F_CPUProcessor 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).
C_FLAGSCommon GCC flags passed to the compiler for C language (C) input files. Default is blank (no additional flags).
CPP_FLAGSCommon GCC flags passed to the compiler for C++ language (CPP) input files. Default is blank (no additional flags).
ASM_FLAGSCommon GCC flags passed to the assembler for assembly language (S) input files. Default is blank (no additional flags).
CC_FLAGSCommon GCC flags passed to the compiler for all source file types. Default is blank (no additional flags).
LD_FLAGSExtra flags to pass to the GNU linker when linking the compiled object files into the resulting binary. Default is blank (no additional flags).
LINKER_RELAXATIONSBoolean, if `Y` linker relaxations will be enabled to slightly reduce the resulting binary's size. Default is `Y`.
OBJDIRDirectory to store the intermediate object files, as they are generated from the source files. Default is `obj`.
OBJECT_FILESList of additional `.o` object files to link into the final binary. Default is blank (no additional objects).
DEBUG_FORMATDebug ELF file format to generate. Default is `dwarf-2`.
DEBUG_LEVELLevel of the debugging information to generate in the compiled object files. Debug is 2 (medium level debugging information).
COMPILER_PATHPath 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).
+ +## Provided Variables: + +The following variables may be referenced in a user makefile (via `$(NAME)` +syntax) if desired, as they are provided by this module. + + + + + + + + +
N/AThis module provides no variables.
+ +## 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. + + + + + + + + +
N/AThis module provides no macros.
+ +## 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. diff --git a/Firmware/LUFA/Build/DMBS/DMBS/gcc.mk b/Firmware/LUFA/Build/DMBS/DMBS/gcc.mk new file mode 100644 index 0000000..3affa63 --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/DMBS/gcc.mk @@ -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) diff --git a/Firmware/LUFA/Build/DMBS/DMBS/hid.md b/Firmware/LUFA/Build/DMBS/DMBS/hid.md new file mode 100644 index 0000000..b2dfbf7 --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/DMBS/hid.md @@ -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: + + + + + + + + + + + + + + + + + + + + +
hidProgram a LUFA HID class bootloader device, using the `hid_bootloader_cli.py` Python script.
hid-eeProgram 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.
teensyProgram a LUFA HID class bootloader device or Teensy board, using the `teensy_loader_cli` tool.
teensy-eeProgram 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.
+ +## 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: + + + + + + + + + + + + +
MCUName of the Atmel processor model (e.g. `at90usb1287`).
TARGETName of the application output file prefix (e.g. `TestApplication`).
+ +## 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. + + + + + + + + +
N/AThis module has no optional variables.
+ +## Provided Variables: + +The following variables may be referenced in a user makefile (via `$(NAME)` +syntax) if desired, as they are provided by this module. + + + + + + + + +
N/AThis module provides no variables.
+ +## 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. + + + + + + + + +
N/AThis module provides no macros.
+ +## 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. diff --git a/Firmware/LUFA/Build/DMBS/DMBS/hid.mk b/Firmware/LUFA/Build/DMBS/DMBS/hid.mk new file mode 100644 index 0000000..7a0ad9d --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/DMBS/hid.mk @@ -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) diff --git a/Firmware/LUFA/Build/DMBS/Readme.md b/Firmware/LUFA/Build/DMBS/Readme.md new file mode 100644 index 0000000..f4f7a5f --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/Readme.md @@ -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 diff --git a/Firmware/LUFA/Build/DMBS/Template/Template.c b/Firmware/LUFA/Build/DMBS/Template/Template.c new file mode 100644 index 0000000..95d36f7 --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/Template/Template.c @@ -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. +} diff --git a/Firmware/LUFA/Build/DMBS/Template/makefile b/Firmware/LUFA/Build/DMBS/Template/makefile new file mode 100644 index 0000000..d882923 --- /dev/null +++ b/Firmware/LUFA/Build/DMBS/Template/makefile @@ -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 diff --git a/Firmware/LUFA/Build/LUFA/lufa-gcc.mk b/Firmware/LUFA/Build/LUFA/lufa-gcc.mk new file mode 100644 index 0000000..f824362 --- /dev/null +++ b/Firmware/LUFA/Build/LUFA/lufa-gcc.mk @@ -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) diff --git a/Firmware/LUFA/Build/LUFA/lufa-sources.mk b/Firmware/LUFA/Build/LUFA/lufa-sources.mk new file mode 100644 index 0000000..7ca9a28 --- /dev/null +++ b/Firmware/LUFA/Build/LUFA/lufa-sources.mk @@ -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) diff --git a/Firmware/LUFA/Build/lufa_atprogram.mk b/Firmware/LUFA/Build/lufa_atprogram.mk index 9433834..86988d1 100644 --- a/Firmware/LUFA/Build/lufa_atprogram.mk +++ b/Firmware/LUFA/Build/lufa_atprogram.mk @@ -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 diff --git a/Firmware/LUFA/Build/lufa_avrdude.mk b/Firmware/LUFA/Build/lufa_avrdude.mk index 4eff418..649215f 100644 --- a/Firmware/LUFA/Build/lufa_avrdude.mk +++ b/Firmware/LUFA/Build/lufa_avrdude.mk @@ -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 diff --git a/Firmware/LUFA/Build/lufa_build.mk b/Firmware/LUFA/Build/lufa_build.mk index b9b144a..f7c496e 100644 --- a/Firmware/LUFA/Build/lufa_build.mk +++ b/Firmware/LUFA/Build/lufa_build.mk @@ -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 -# .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 diff --git a/Firmware/LUFA/Build/lufa_core.mk b/Firmware/LUFA/Build/lufa_core.mk index 7d97466..62cef90 100644 --- a/Firmware/LUFA/Build/lufa_core.mk +++ b/Firmware/LUFA/Build/lufa_core.mk @@ -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 diff --git a/Firmware/LUFA/Build/lufa_cppcheck.mk b/Firmware/LUFA/Build/lufa_cppcheck.mk index 0b9b611..801a4c1 100644 --- a/Firmware/LUFA/Build/lufa_cppcheck.mk +++ b/Firmware/LUFA/Build/lufa_cppcheck.mk @@ -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 diff --git a/Firmware/LUFA/Build/lufa_dfu.mk b/Firmware/LUFA/Build/lufa_dfu.mk index 956adc8..2100ae8 100644 --- a/Firmware/LUFA/Build/lufa_dfu.mk +++ b/Firmware/LUFA/Build/lufa_dfu.mk @@ -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 diff --git a/Firmware/LUFA/Build/lufa_doxygen.mk b/Firmware/LUFA/Build/lufa_doxygen.mk index babf287..64afd4a 100644 --- a/Firmware/LUFA/Build/lufa_doxygen.mk +++ b/Firmware/LUFA/Build/lufa_doxygen.mk @@ -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 diff --git a/Firmware/LUFA/Build/lufa_hid.mk b/Firmware/LUFA/Build/lufa_hid.mk index e79b7bf..86ca145 100644 --- a/Firmware/LUFA/Build/lufa_hid.mk +++ b/Firmware/LUFA/Build/lufa_hid.mk @@ -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 diff --git a/Firmware/LUFA/Build/lufa_sources.mk b/Firmware/LUFA/Build/lufa_sources.mk index cc3492e..48291c7 100644 --- a/Firmware/LUFA/Build/lufa_sources.mk +++ b/Firmware/LUFA/Build/lufa_sources.mk @@ -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 diff --git a/Firmware/LUFA/CodeTemplates/DeviceTemplate/Descriptors.c b/Firmware/LUFA/CodeTemplates/DeviceTemplate/Descriptors.c index 71cebe8..0b44c0d 100644 --- a/Firmware/LUFA/CodeTemplates/DeviceTemplate/Descriptors.c +++ b/Firmware/LUFA/CodeTemplates/DeviceTemplate/Descriptors.c @@ -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 diff --git a/Firmware/LUFA/CodeTemplates/DeviceTemplate/Descriptors.h b/Firmware/LUFA/CodeTemplates/DeviceTemplate/Descriptors.h index 6d8145d..2bf6a6a 100644 --- a/Firmware/LUFA/CodeTemplates/DeviceTemplate/Descriptors.h +++ b/Firmware/LUFA/CodeTemplates/DeviceTemplate/Descriptors.h @@ -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 diff --git a/Firmware/LUFA/CodeTemplates/DeviceTemplate/DeviceApplication.c b/Firmware/LUFA/CodeTemplates/DeviceTemplate/DeviceApplication.c index ddaa9d0..2bc44b4 100644 --- a/Firmware/LUFA/CodeTemplates/DeviceTemplate/DeviceApplication.c +++ b/Firmware/LUFA/CodeTemplates/DeviceTemplate/DeviceApplication.c @@ -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 diff --git a/Firmware/LUFA/CodeTemplates/DeviceTemplate/DeviceApplication.h b/Firmware/LUFA/CodeTemplates/DeviceTemplate/DeviceApplication.h index 325176c..b342909 100644 --- a/Firmware/LUFA/CodeTemplates/DeviceTemplate/DeviceApplication.h +++ b/Firmware/LUFA/CodeTemplates/DeviceTemplate/DeviceApplication.h @@ -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 diff --git a/Firmware/LUFA/CodeTemplates/DeviceTemplate/asf.xml b/Firmware/LUFA/CodeTemplates/DeviceTemplate/asf.xml index e952714..fd65db2 100644 --- a/Firmware/LUFA/CodeTemplates/DeviceTemplate/asf.xml +++ b/Firmware/LUFA/CodeTemplates/DeviceTemplate/asf.xml @@ -1,55 +1,55 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - Template for a LUFA USB device mode application. - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + Template for a LUFA USB device mode application. + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Firmware/LUFA/CodeTemplates/DriverStubs/Board.h b/Firmware/LUFA/CodeTemplates/DriverStubs/Board.h index 5a1e583..9dce2f5 100644 --- a/Firmware/LUFA/CodeTemplates/DriverStubs/Board.h +++ b/Firmware/LUFA/CodeTemplates/DriverStubs/Board.h @@ -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 diff --git a/Firmware/LUFA/CodeTemplates/DriverStubs/Buttons.h b/Firmware/LUFA/CodeTemplates/DriverStubs/Buttons.h index b3c2f2b..fd74652 100644 --- a/Firmware/LUFA/CodeTemplates/DriverStubs/Buttons.h +++ b/Firmware/LUFA/CodeTemplates/DriverStubs/Buttons.h @@ -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 diff --git a/Firmware/LUFA/CodeTemplates/DriverStubs/Dataflash.h b/Firmware/LUFA/CodeTemplates/DriverStubs/Dataflash.h index 83acb2f..f405a80 100644 --- a/Firmware/LUFA/CodeTemplates/DriverStubs/Dataflash.h +++ b/Firmware/LUFA/CodeTemplates/DriverStubs/Dataflash.h @@ -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 diff --git a/Firmware/LUFA/CodeTemplates/DriverStubs/Joystick.h b/Firmware/LUFA/CodeTemplates/DriverStubs/Joystick.h index 07542ab..bf17c43 100644 --- a/Firmware/LUFA/CodeTemplates/DriverStubs/Joystick.h +++ b/Firmware/LUFA/CodeTemplates/DriverStubs/Joystick.h @@ -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 diff --git a/Firmware/LUFA/CodeTemplates/DriverStubs/LEDs.h b/Firmware/LUFA/CodeTemplates/DriverStubs/LEDs.h index 4373972..d7d2f50 100644 --- a/Firmware/LUFA/CodeTemplates/DriverStubs/LEDs.h +++ b/Firmware/LUFA/CodeTemplates/DriverStubs/LEDs.h @@ -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 diff --git a/Firmware/LUFA/CodeTemplates/HostTemplate/HostApplication.c b/Firmware/LUFA/CodeTemplates/HostTemplate/HostApplication.c index 1ac0378..e0774b3 100644 --- a/Firmware/LUFA/CodeTemplates/HostTemplate/HostApplication.c +++ b/Firmware/LUFA/CodeTemplates/HostTemplate/HostApplication.c @@ -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 diff --git a/Firmware/LUFA/CodeTemplates/HostTemplate/HostApplication.h b/Firmware/LUFA/CodeTemplates/HostTemplate/HostApplication.h index 16dbb53..31eea28 100644 --- a/Firmware/LUFA/CodeTemplates/HostTemplate/HostApplication.h +++ b/Firmware/LUFA/CodeTemplates/HostTemplate/HostApplication.h @@ -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 diff --git a/Firmware/LUFA/CodeTemplates/HostTemplate/asf.xml b/Firmware/LUFA/CodeTemplates/HostTemplate/asf.xml index c3860c0..c1996ec 100644 --- a/Firmware/LUFA/CodeTemplates/HostTemplate/asf.xml +++ b/Firmware/LUFA/CodeTemplates/HostTemplate/asf.xml @@ -1,41 +1,41 @@ - - - - - - - - - - - - - - - - Template for a LUFA USB host mode application. - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + Template for a LUFA USB host mode application. + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Firmware/LUFA/CodeTemplates/LUFAConfig.h b/Firmware/LUFA/CodeTemplates/LUFAConfig.h index ab7fc75..bf6ee37 100644 --- a/Firmware/LUFA/CodeTemplates/LUFAConfig.h +++ b/Firmware/LUFA/CodeTemplates/LUFAConfig.h @@ -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 diff --git a/Firmware/LUFA/CodeTemplates/makefile_template b/Firmware/LUFA/CodeTemplates/makefile_template index efb6aa7..945d6fd 100644 --- a/Firmware/LUFA/CodeTemplates/makefile_template +++ b/Firmware/LUFA/CodeTemplates/makefile_template @@ -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 diff --git a/Firmware/LUFA/Common/ArchitectureSpecific.h b/Firmware/LUFA/Common/ArchitectureSpecific.h index 292e27b..28f2900 100644 --- a/Firmware/LUFA/Common/ArchitectureSpecific.h +++ b/Firmware/LUFA/Common/ArchitectureSpecific.h @@ -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 diff --git a/Firmware/LUFA/Common/Architectures.h b/Firmware/LUFA/Common/Architectures.h index 265b412..5873674 100644 --- a/Firmware/LUFA/Common/Architectures.h +++ b/Firmware/LUFA/Common/Architectures.h @@ -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 diff --git a/Firmware/LUFA/Common/Attributes.h b/Firmware/LUFA/Common/Attributes.h index dc5c6be..c8e4104 100644 --- a/Firmware/LUFA/Common/Attributes.h +++ b/Firmware/LUFA/Common/Attributes.h @@ -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 diff --git a/Firmware/LUFA/Common/BoardTypes.h b/Firmware/LUFA/Common/BoardTypes.h index 06ff4dd..a8bb191 100644 --- a/Firmware/LUFA/Common/BoardTypes.h +++ b/Firmware/LUFA/Common/BoardTypes.h @@ -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 diff --git a/Firmware/LUFA/Common/Common.h b/Firmware/LUFA/Common/Common.h index 3e12e4f..6864eb6 100644 --- a/Firmware/LUFA/Common/Common.h +++ b/Firmware/LUFA/Common/Common.h @@ -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 diff --git a/Firmware/LUFA/Common/CompilerSpecific.h b/Firmware/LUFA/Common/CompilerSpecific.h index 9979fff..41e5305 100644 --- a/Firmware/LUFA/Common/CompilerSpecific.h +++ b/Firmware/LUFA/Common/CompilerSpecific.h @@ -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 diff --git a/Firmware/LUFA/Common/Endianness.h b/Firmware/LUFA/Common/Endianness.h index 2eb3ad0..8be9e0d 100644 --- a/Firmware/LUFA/Common/Endianness.h +++ b/Firmware/LUFA/Common/Endianness.h @@ -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)) diff --git a/Firmware/LUFA/DoxygenPages/BuildSystem.txt b/Firmware/LUFA/DoxygenPages/BuildSystem.txt index 0ae1dd6..ef57fcf 100644 --- a/Firmware/LUFA/DoxygenPages/BuildSystem.txt +++ b/Firmware/LUFA/DoxygenPages/BuildSystem.txt @@ -1,975 +1,281 @@ -/** \file - * - * This file contains special DoxyGen information for the generation of the main page and other special - * documentation pages. It is not a project source file. - */ - -/** \page Page_BuildSystem The LUFA Build System - * - * \section Sec_BuildSystem_Overview Overview of the LUFA Build System - * The LUFA build system is an attempt at making a set of re-usable, modular build make files which - * can be referenced in a LUFA powered project, to minimize the amount of code required in an - * application makefile. The system is written in GNU Make, and each module is independent of - * one-another. - * - * For details on the prerequisites needed for Linux and Windows machines to be able to use the LUFA - * build system, see \ref Sec_CompilingApps_Prerequisites. - * - * To use a LUFA build system module, simply add an include to your project makefile. All user projects - * should at a minimum include \ref Page_BuildModule_CORE for base functionality: - * \code - * include $(LUFA_PATH)/Build/lufa_core.mk - * \endcode - * - * Once included in your project makefile, the associated build module targets will be added to your - * project's build makefile targets automatically. To call a build target, run make {TARGET_NAME} - * from the command line, substituting in the appropriate target name. - * - * \see \ref Sec_ConfiguringApps_AppMakefileParams for a copy of the sample LUFA project makefile. - * - * Each build module may have one or more mandatory parameters (GNU Make variables) which must - * be supplied in the project makefile for the module to work, and one or more optional parameters which - * may be defined and which will assume a sensible default if not. - * - * \section SSec_BuildSystem_Modules Available Modules - * - * The following modules are included in this LUFA release: - * - * \li \subpage Page_BuildModule_ATPROGRAM - Device Programming - * \li \subpage Page_BuildModule_AVRDUDE - Device Programming - * \li \subpage Page_BuildModule_BUILD - Compiling/Assembling/Linking - * \li \subpage Page_BuildModule_CORE - Core Build System Functions - * \li \subpage Page_BuildModule_CPPCHECK - Static Code Analysis - * \li \subpage Page_BuildModule_DFU - Device Programming - * \li \subpage Page_BuildModule_DOXYGEN - Automated Source Code Documentation - * \li \subpage Page_BuildModule_HID - Device Programming - * \li \subpage Page_BuildModule_SOURCES - LUFA Module Source Code Variables - * - * If you have problems building using the LUFA build system, see \subpage Page_BuildTroubleshooting for resolution steps. - */ - - /** \page Page_BuildModule_BUILD The BUILD build module - * - * The BUILD LUFA build system module, providing targets for the compilation, - * assembling and linking of an application from source code into binary files - * suitable for programming into a target device, using the GCC compiler. - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_build.mk - * \endcode - * - * \section SSec_BuildModule_BUILD_Requirements Requirements - * This module requires the the architecture appropriate binaries of the GCC compiler are available in your - * system's PATH variable. The GCC compiler and associated toolchain is distributed in Atmel AVR Studio - * 5.x and Atmel Studio 6.x installation directories, as well as in many third party distribution packages. - * - * \section SSec_BuildModule_BUILD_Targets Targets - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
sizeDisplay size of the compiled application FLASH and SRAM segments.
symbol-sizesDisplay a size-sorted list of symbols from the compiled application, in decimal bytes.
libBuild and archive all source files into a library A binary file.
allBuild and link the application into ELF debug and HEX binary files.
elfBuild and link the application into an ELF debug file.
binBuild and link the application and produce a BIN binary file.
hexBuild and link the application and produce HEX and EEP binary files.
lssBuild and link the application and produce a LSS source code/assembly code mixed listing file.
cleanRemove all intermediary files and binary output files.
mostlycleanRemove all intermediary files but preserve any binary output files.
<filename>.sCreate an assembly listing of a given input C/C++ source file.
- * - * \section SSec_BuildModule_BUILD_MandatoryParams Mandatory Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
TARGETName of the application output file prefix (e.g. TestApplication).
ARCHArchitecture of the target processor (see \ref Page_DeviceSupport).
MCUName of the Atmel processor model (e.g. at90usb1287).
SRCList of relative or absolute paths to the application C (.c), C++ (.cpp) and Assembly (.S) source files.
F_USBSpeed in Hz of the input clock frequency to the target's USB controller.
LUFA_PATHPath to the LUFA library core, either relative or absolute (e.g. ../LUFA-000000/LUFA/).
- * - * \section SSec_BuildModule_BUILD_OptionalParams Optional Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
BOARDLUFA board hardware drivers to use (see \ref Page_DeviceSupport).
OPTIMIZATIONOptimization level to use when compiling source files (see GCC manual).
C_STANDARDVersion of the C standard to apply when compiling C++ source files (see GCC manual).
CPP_STANDARDVersion of the C++ standard to apply when compiling C++ source files (see GCC manual).
DEBUG_FORMATFormat of the debug information to embed in the generated object files (see GCC manual).
DEBUG_LEVELLevel of the debugging information to embed in the generated object files (see GCC manual).
F_CPUSpeed of the processor CPU clock, in Hz.
C_FLAGSFlags to pass to the C compiler only, after the automatically generated flags.
CPP_FLAGSFlags to pass to the C++ compiler only, after the automatically generated flags.
ASM_FLAGSFlags to pass to the assembler only, after the automatically generated flags.
CC_FLAGSCommon flags to pass to the C/C++ compiler and assembler, after the automatically generated flags.
COMPILER_PATHDirectory where the C/C++ toolchain is located, if not available in the system PATH.
LD_FLAGSFlags to pass to the linker, after the automatically generated flags.
LINKER_RELAXATIONSEnables or disables linker relaxations when linking the application binary. This can reduce the total size - * of the application by replacing full \c CALL instructions with smaller \c RCALL instructions where possible. - * \note On some unpatched versions of binutils, this can cause link failures in some circumstances. If you - * receive a link error relocation truncated to fit: R_AVR_13_PCREL, disable this setting.
OBJDIRDirectory to place the generated object and dependency files. If set to "." the same folder as the source file will be used. - * \note When this option is enabled, all source filenames must be unique.
OBJECT_FILESList of additional object files that should be linked into the resulting binary.
- * - * \section SSec_BuildModule_BUILD_ProvidedVariables Module Provided Variables - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_BUILD_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - -/** \page Page_BuildModule_CORE The CORE build module - * - * The core LUFA build system module, providing common build system help and information targets. - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_core.mk - * \endcode - * - * \section SSec_BuildModule_CORE_Requirements Requirements - * This module has no requirements outside a standard *nix shell like environment; the sh - * shell, GNU make and *nix CoreUtils (echo, printf, etc.). - * - * \section SSec_BuildModule_CORE_Targets Targets - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
helpDisplay build system help and configuration information.
list_targetsList all available build targets from the build system.
list_modulesList all available build modules from the build system.
list_mandatoryList all mandatory parameters required by the included modules.
list_optionalList all optional parameters required by the included modules.
list_providedList all variables provided by the included modules.
list_macrosList all macros provided by the included modules.
- * - * \section SSec_BuildModule_CORE_MandatoryParams Mandatory Parameters - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_CORE_OptionalParams Optional Parameters - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_CORE_ProvidedVariables Module Provided Variables - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_CORE_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - -/** \page Page_BuildModule_ATPROGRAM The ATPROGRAM build module - * - * The ATPROGRAM programming utility LUFA build system module, providing targets to reprogram an - * Atmel processor FLASH and EEPROM memories with a project's compiled binary output files. - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_atprogram.mk - * \endcode - * - * \section SSec_BuildModule_ATPROGRAM_Requirements Requirements - * This module requires the atprogram.exe utility to be available in your system's PATH - * variable. The atprogram.exe utility is distributed in Atmel AVR Studio 5.x and Atmel Studio 6.x - * inside the application install folder's "\atbackend" subdirectory. - * - * \section SSec_BuildModule_ATPROGRAM_Targets Targets - * - * - * - * - * - * - * - * - * - * - *
atprogramProgram the device FLASH memory with the application's executable data.
atprogram-eeProgram the device EEPROM memory with the application's EEPROM data.
- * - * \section SSec_BuildModule_ATPROGRAM_MandatoryParams Mandatory Parameters - * - * - * - * - * - * - * - * - * - * - *
MCUName of the Atmel processor model (e.g. at90usb1287).
TARGETName of the application output file prefix (e.g. TestApplication).
- * - * \section SSec_BuildModule_ATPROGRAM_OptionalParams Optional Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
ATPROGRAM_PROGRAMMERName of the Atmel programmer or debugger tool to communicate with (e.g. jtagice3).
ATPROGRAM_INTERFACEName of the programming interface to use when programming the target (e.g. spi).
ATPROGRAM_PORTName of the communication port to use when when programming with a serially connected tool (e.g. COM2).
- * - * \section SSec_BuildModule_ATPROGRAM_ProvidedVariables Module Provided Variables - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_ATPROGRAM_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - -/** \page Page_BuildModule_AVRDUDE The AVRDUDE build module - * - * The AVRDUDE programming utility LUFA build system module, providing targets to reprogram an - * Atmel processor FLASH and EEPROM memories with a project's compiled binary output files. - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_avrdude.mk - * \endcode - * - * \section SSec_BuildModule_AVRDUDE_Requirements Requirements - * This module requires the avrdude utility to be available in your system's PATH - * variable. The avrdude utility is distributed in the old WinAVR project releases for - * Windows (http://winavr.sourceforge.net) or can be installed on *nix systems via the project's - * source code (https://savannah.nongnu.org/projects/avrdude) or through the package manager. - * - * \section SSec_BuildModule_AVRDUDE_Targets Targets - * - * - * - * - * - * - * - * - * - * - *
avrdudeProgram the device FLASH memory with the application's executable data.
avrdude-eeProgram the device EEPROM memory with the application's EEPROM data.
- * - * \section SSec_BuildModule_AVRDUDE_MandatoryParams Mandatory Parameters - * - * - * - * - * - * - * - * - * - * - *
MCUName of the Atmel processor model (e.g. at90usb1287).
TARGETName of the application output file prefix (e.g. TestApplication).
- * - * \section SSec_BuildModule_AVRDUDE_OptionalParams Optional Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
AVRDUDE_PROGRAMMERName of the programmer or debugger tool to communicate with (e.g. jtagicemkii).
AVRDUDE_PORTName of the communication port to use when when programming with the connected tool (e.g. COM2, /dev/ttyUSB0 or usb).
AVRDUDE_FLAGSAdditional flags to pass to avrdude when programming, applied after the automatically generated flags.
- * - * \section SSec_BuildModule_AVRDUDE_ProvidedVariables Module Provided Variables - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_AVRDUDE_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - - /** \page Page_BuildModule_CPPCHECK The CPPCHECK build module - * - * The CPPCHECK programming utility LUFA build system module, providing targets to statically - * analyze C and C++ source code for errors and performance/style issues. - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_cppcheck.mk - * \endcode - * - * \section SSec_BuildModule_CPPCHECK_Requirements Requirements - * This module requires the cppcheck utility to be available in your system's PATH - * variable. The cppcheck utility is distributed through the project's home page - * (http://cppcheck.sourceforge.net) for Windows, and can be installed on *nix systems via - * the project's source code or through the package manager. - * - * \section SSec_BuildModule_CPPCHECK_Targets Targets - * - * - * - * - * - * - * - * - * - * - *
cppcheckStatically analyze the project source code for issues.
cppcheck-configCheck the cppcheck configuration - scan source code and warn about missing header files and other issues.
- * - * \section SSec_BuildModule_CPPCHECK_MandatoryParams Mandatory Parameters - * - * - * - * - * - * - *
SRCList of source files to statically analyze.
- * - * \section SSec_BuildModule_CPPCHECK_OptionalParams Optional Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
CPPCHECK_INCLUDESPath of extra directories to check when attemting to resolve C/C++ header file includes.
CPPCHECK_EXCLUDESPaths or path fragments to exclude when analyzing.
CPPCHECK_MSG_TEMPLATEOutput message template to use when printing errors, warnings and information (see cppcheck documentation).
CPPCHECK_ENABLEAnalysis rule categories to enable (see cppcheck documentation).
CPPCHECK_SUPPRESSSpecific analysis rules to suppress (see cppcheck documentation).
CPPCHECK_FAIL_ON_WARNINGSet to Y to fail the analysis job with an error exit code if warnings are found, N to continue without failing.
CPPCHECK_QUIETSet to Y to suppress all output except warnings and errors, N to show verbose output information.
CPPCHECK_FLAGSExtra flags to pass to cppcheck, after the automatically generated flags.
- * - * \section SSec_BuildModule_CPPCHECK_ProvidedVariables Module Provided Variables - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_CPPCHECK_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - - /** \page Page_BuildModule_DFU The DFU build module - * - * The DFU programming utility LUFA build system module, providing targets to reprogram an - * Atmel processor FLASH and EEPROM memories with a project's compiled binary output files. - * This module requires a DFU class bootloader to be running in the target, compatible with - * the DFU bootloader protocol as published by Atmel. - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_dfu.mk - * \endcode - * - * \section SSec_BuildModule_DFU_Requirements Requirements - * This module requires either the batchisp utility from Atmel's FLIP utility, or the open - * source dfu-programmer utility (http://dfu-programmer.sourceforge.net/) to be - * available in your system's PATH variable. On *nix systems the dfu-programmer utility - * can be installed via the project's source code or through the package manager. - * - * \section SSec_BuildModule_DFU_Targets Targets - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
dfuProgram the device FLASH memory with the application's executable data using dfu-programmer.
dfu-eeProgram the device EEPROM memory with the application's EEPROM data using dfu-programmer.
flipProgram the device FLASH memory with the application's executable data using batchisp.
flip-eeProgram the device EEPROM memory with the application's EEPROM data using batchisp.
- * - * \section SSec_BuildModule_DFU_MandatoryParams Mandatory Parameters - * - * - * - * - * - * - * - * - * - * - *
MCUName of the Atmel processor model (e.g. at90usb1287).
TARGETName of the application output file prefix (e.g. TestApplication).
- * - * \section SSec_BuildModule_DFU_OptionalParams Optional Parameters - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_DFU_ProvidedVariables Module Provided Variables - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_DFU_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - - /** \page Page_BuildModule_DOXYGEN The DOXYGEN build module - * - * The DOXYGEN code documentation utility LUFA build system module, providing targets to generate - * project HTML and other format documentation from a set of source files that include special - * Doxygen comments. - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_doxygen.mk - * \endcode - * - * \section SSec_BuildModule_DOXYGEN_Requirements Requirements - * This module requires the doxygen utility from the Doxygen website - * (http://www.doxygen.org/) to be available in your system's PATH variable. On *nix - * systems the doxygen utility can be installed via the project's source code or through - * the package manager. - * - * \section SSec_BuildModule_DOXYGEN_Targets Targets - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
doxygenGenerate project documentation.
doxygen_createCreate a new Doxygen configuration file using the latest template.
doxygen_upgradeUpgrade an existing Doxygen configuration file to the latest template
- * - * \section SSec_BuildModule_DOXYGEN_MandatoryParams Mandatory Parameters - * - * - * - * - * - * - *
LUFA_PATHPath to the LUFA library core, either relative or absolute (e.g. ../LUFA-000000/LUFA/).
- * - * \section SSec_BuildModule_DOXYGEN_OptionalParams Optional Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
DOXYGEN_CONFName and path of the base Doxygen configuration file for the project.
DOXYGEN_FAIL_ON_WARNINGSet to Y to fail the generation with an error exit code if warnings are found other than unsupported configuration parameters, N to continue without failing.
DOXYGEN_OVERRIDE_PARAMSExtra Doxygen configuration parameters to apply, overriding the corresponding config entry in the project's configuration file (e.g. QUIET=YES).
- * - * \section SSec_BuildModule_DOXYGEN_ProvidedVariables Module Provided Variables - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_DOXYGEN_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - - /** \page Page_BuildModule_HID The HID build module - * - * The HID programming utility LUFA build system module, providing targets to reprogram an - * Atmel processor's FLASH memory with a project's compiled binary output file. This module - * requires a HID class bootloader to be running in the target, using a protocol compatible - * with the PJRC "HalfKay" protocol (http://www.pjrc.com/teensy/halfkay_protocol.html). - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_hid.mk - * \endcode - * - * \section SSec_BuildModule_HID_Requirements Requirements - * This module requires either the hid_bootloader_cli utility from the included LUFA HID - * class bootloader API subdirectory, or the teensy_loader_cli utility from PJRC - * (http://www.pjrc.com/teensy/loader_cli.html) to be available in your system's PATH - * variable. - * - * \section SSec_BuildModule_HID_Targets Targets - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
hidProgram the device FLASH memory with the application's executable data using hid_bootloader_cli.
hid-eeProgram the device EEPROM memory with the application's EEPROM data using hid_bootloader_cli and - * a temporary AVR application programmed into the target's FLASH. - * \note This will erase the currently loaded application in the target.
teensyProgram the device FLASH memory with the application's executable data using teensy_loader_cli.
teensy-eeProgram the device EEPROM memory with the application's EEPROM data using teensy_loader_cli and - * a temporary AVR application programmed into the target's FLASH. - * \note This will erase the currently loaded application in the target.
- * - * \section SSec_BuildModule_HID_MandatoryParams Mandatory Parameters - * - * - * - * - * - * - * - * - * - * - *
MCUName of the Atmel processor model (e.g. at90usb1287).
TARGETName of the application output file prefix (e.g. TestApplication).
- * - * \section SSec_BuildModule_HID_OptionalParams Optional Parameters - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_HID_ProvidedVariables Module Provided Variables - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_HID_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - - /** \page Page_BuildModule_SOURCES The SOURCES build module - * - * The SOURCES LUFA build system module, providing variables listing the various LUFA source files - * required to be build by a project for a given LUFA module. This module gives a way to reference - * LUFA source files symbolically, so that changes to the library structure do not break the library - * makefile. - * - * To use this module in your application makefile, add the following code: - * \code - * include $(LUFA_PATH)/Build/lufa_sources.mk - * \endcode - * - * \section SSec_BuildModule_SOURCES_Requirements Requirements - * None. - * - * \section SSec_BuildModule_SOURCES_Targets Targets - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_SOURCES_MandatoryParams Mandatory Parameters - * - * - * - * - * - * - * - * - * - * - *
LUFA_PATHPath to the LUFA library core, either relative or absolute (e.g. ../LUFA-000000/LUFA/).
ARCHArchitecture of the target processor (see \ref Page_DeviceSupport).
- * - * \section SSec_BuildModule_SOURCES_OptionalParams Optional Parameters - * - * - * - * - * - *
None
- * - * \section SSec_BuildModule_SOURCES_ProvidedVariables Module Provided Variables - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
LUFA_SRC_USBList of LUFA USB driver source files.
LUFA_SRC_USBCLASSList of LUFA USB Class driver source files.
LUFA_SRC_TEMPERATUREList of LUFA temperature sensor driver source files.
LUFA_SRC_SERIALList of LUFA Serial U(S)ART driver source files.
LUFA_SRC_TWIList of LUFA TWI driver source files.
LUFA_SRC_PLATFORMList of LUFA architecture specific platform management source files.
- * - * \section SSec_BuildModule_SOURCES_ProvidedMacros Module Provided Macros - * - * - * - * - * - *
None
- */ - -/** \page Page_BuildTroubleshooting Troubleshooting Information - * - * LUFA uses a lot of advanced features of the AVR-GCC compiler, linker, and surrounding binaries. This can sometimes lead to problems compiling applications if one of these - * features is buggy in the version of the tools used in a build environment. Missing utilities and incorrectly set makefile configuration options can also result in different - * errors being produced when compilation or other operations are attempted. The table below lists a set of commonly encountered errors and their resolutions. - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
ProblemResolution
Error "relocation truncated to fit: R_AVR_13_PCREL against symbol {X}" shown when compiling.Try compiling with the setting LINKER_RELAXATIONS=N in your LUFA Build System 2.0 makefile, or remove the line -Wl,--relax - * from other makefiles. Alternatively, make sure you have the latest version of the Atmel Toolchain installed for your system.
Error "error: ld terminated with signal 11 [Segmentation fault]" shown when compiling.Try compiling with the setting DEBUG_LEVEL=2 in your LUFA Build System 2.0 makefile, or make sure you are using binutils version 2.22 or later.
Error "EMERGENCY ABORT: INFINITE RECURSION DETECTED" shown when compiling.Make sure you are using an up to date version of GNU Make when compiling. This error is a safety system added to the mid-level makefiles, to prevent an issue with - * GNU make or other variants of Make causing an infinitely recursive build.
Error "Unsupported architecture "{X}"" shown when compiling.Ensure your makefile's ARCH setting is set to one of the architecture names (case-sensitive) supported by the version of LUFA you are compiling against.
Error "Makefile {X} value not set" shown when compiling.The specified Makefile value was not configured in your project's makefile or on the command line, and the nominated setting is required by one or more LUFA - * build system modules. Define the value in your project makefile and try again.
Error "Makefile {X} option cannot be blank" shown when compiling.The specified Makefile value was configured in your project's makefile or on the command line, but was set to an empty value. For the nominated configuration - * option, an empty value is not allowed. Define the nominated setting to a correct non-blank value and try again.
Error "Makefile {X} option must be Y or N" shown when compiling.The specified Makefile value was configured in your project's makefile or on the command line, but was set to a value other than a Y (for "Yes") or "N" (for "No"). - * This configuration option is required to be one of the aforementioned boolean values, and other values are invalid. Set this option to either Y or N and try again.
Error "Unknown input source file formats: {X}" shown when compiling.The nominated source files, specified in your project's makefile in the SRC configuration option, has an extension that the LUFA build system does not - * recognise. The file extensions are case sensitive, and must be one of the supported formats (*.c, *.cpp or *.S).
Error "Cannot build with OBJDIR parameter set - one or more object file name is not unique" shown when compiling.When a project is built with a non-empty OBJDIR object directory name set, all input source files must have unique names, excluding extension and path. - * This means that input files that are named identically and differ only by their path or extension are invalid when this mode is used.
Error "Source file does not exist: {X}" shown when compiling.The nominated input source file, specified in the user project's SRC parameter, could not be found. Ensure the source file exists and the absolute or - * relative path given in the user project makefile is correct and try again.
Error "Doxygen configuration file {X} does not exist" shown when upgrading a Doxygen configuration file.The nominated Doxygen configuration file, specified in the user project's DOXYGEN_CONF parameter, could not be found. Ensure the configuration file exists - * and the absolute or relative path given in the user project makefile is correct and try again, or run the appropriate makefile target to generate a new configuration - * file.
Error "avr-gcc: error: unrecognized option '{X}'" shown when compiling.An unrecognised option was supplied to the compiler, usually in the C_FLAGS, CPP_FLAGS, ASM_FLAGS or CC_FLAGS configuration - * options. The nominated compiler switch may be invalid, or unsupported by the version of AVR-GCC on the host system. Remove the unrecognised flag if invalid, or - * upgrade to the latest AVR-GCC. If the option is a valid linker option, use the prefix "-Wl," to ensure it is passed to the linker correctly.
Error "makefile:{X}: {Y}.mk: No such file or directory" shown when make is invoked.The path to the nominated makefile module was incorrect. This usually indicates that the makefile LUFA_PATH option is not set to a valid relative or - * absolute path to the LUFA library core.
Error "fatal error: LUFAConfig.h: No such file or directory" shown when compiling.The USE_LUFA_CONFIG_HEADER compile time option was set in the user project makefile, but the user supplied LUFAConfig.h header could not be - * found. Ensure that the directory that contains this configuration file is correctly passed to the compiler via the -I switch in the makefile CC_FLAGS - * parameter.
Error "ld.exe: section .apitable_trampolines loaded at {X} overlaps section .text" shown when compiling a bootloader.The bootloader is compiling too large for the given FLASH_SIZE_KB and BOOT_SECTION_SIZE_KB parameters set in the bootloader makefile. This - * usually indicates that these values are incorrect for the specified device the bootloader is targeting. If these values are correct, a newer version of the - * compiler may need to be used to ensure that the bootloader is built within the section size constraints of the target device.
Error "unknown MCU '{X}' specified" shown when compiling.The specified microcontroller device model name set in the user application's makefile as the MCU parameter is incorrect, or unsupported by the - * version of the compiler being used. Make sure the model name is correct, or upgrade to the latest Atmel Toolchain to obtain newer device support.
Error "undefined reference to `{X}'" shown when compiling.This is usually caused by a missing source file in the user application's SRC configuration parameter. If the indicated symbol is one from the LUFA - * library, you may be missing a LUFA source makefile module (see \ref Page_BuildModule_SOURCES).
- * - * For troubleshooting other errors you encounter, please see \ref Sec_ProjectHelp. - */ +/** \file + * + * This file contains special DoxyGen information for the generation of the main page and other special + * documentation pages. It is not a project source file. + */ + +/** \page Page_BuildSystem The LUFA Build System + * + * \section Sec_BuildSystem_Overview Overview of the LUFA Build System + * The LUFA build system was originally an attempt at making a set of + * re-usable, modular build make files which could be referenced in a LUFA + * powered project, to minimize the amount of code required in an + * application makefile. + * + * As it turned out to be fairly generic in nature, it was split out into its + * own separate project, called DMBS (Dean's Makefile Build System) + * which is released into the public domain. LUFA-specific portions of the + * LUFA build system extend DMBS, and provide a universal build system for all + * LUFA projects. + * + * The latest DMBS project information and documentation can be found at: + * https://github.com/abcminiuser/dmbs + * + * DMBS is written in GNU Make, and each module is independent of one-another. + * + * LUFA now uses DMBS for its build system, with some LUFA specific extension + * modules. + * + * If you have problems building using LUFA, see \subpage Page_BuildTroubleshooting for resolution steps. + * + * \li \subpage Page_BuildModule_LUFA_SOURCES - The LUFA SOURCES extension module for DMBS + * \li \subpage Page_BuildModule_LUFA_GCC - The LUFA GCC extension module for DMBS + */ + +/** \page Page_BuildModule_LUFA_SOURCES LUFA SOURCES extension module for DMBS + * + * The LUFA SOURCES extension more for DMBS provides LUFA specific variables + * listing the various LUFA source files required to be build by a project for + * a given LUFA module. This module gives a way to reference LUFA source files + * symbolically, so that changes to the library structure do not break the + * library makefile. + * + * To use this module in your application makefile, add the following code: + * \code + * include $(LUFA_PATH)/Build/LUFA/lufa-sources.mk + * \endcode + * + * \section SSec_BuildModule_LUFA_SOURCES_Requirements Requirements + * None. + * + * \section SSec_BuildModule_LUFA_SOURCES_Targets Targets + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_LUFA_SOURCES_MandatoryParams Mandatory Parameters + * + * + * + * + * + * + * + * + * + * + *
LUFA_PATHPath to the LUFA library core, either relative or absolute (e.g. ../LUFA-000000/LUFA/).
ARCHArchitecture of the target processor (see \ref Page_DeviceSupport).
+ * + * \section SSec_BuildModule_LUFA_SOURCES_OptionalParams Optional Parameters + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_LUFA_SOURCES_ProvidedVariables Module Provided Variables + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
LUFA_SRC_USBList of LUFA USB driver source files.
LUFA_SRC_USBCLASSList of LUFA USB Class driver source files.
LUFA_SRC_TEMPERATUREList of LUFA temperature sensor driver source files.
LUFA_SRC_SERIALList of LUFA Serial U(S)ART driver source files.
LUFA_SRC_TWIList of LUFA TWI driver source files.
LUFA_SRC_PLATFORMList of LUFA architecture specific platform management source files.
+ * + * \section SSec_BuildModule_LUFA_SOURCES_ProvidedMacros Module Provided Macros + * + * + * + * + * + *
None
+ */ + +/** \page Page_BuildModule_LUFA_GCC LUFA GCC extension module for DMBS + * + * The LUFA GCC extension module for the standard DMBS GCC module extends the + * latter to support the compilation of LUFA powered projects. It should be + * imported into your LUFA powered project makefiles to ensure that the correct + * build settings are used for the project's configuration. + * + * To use this module in your application makefile, add the following code: + * \code + * include $(LUFA_PATH)/Build/LUFA/lufa-gcc.mk + * \endcode + * + * \section SSec_BuildModule_LUFA_GCC_Requirements Requirements + * This module should be included in your makefile *after* the DMBS GCC module. + * + * \section SSec_BuildModule_LUFA_GCC_Targets Targets + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_LUFA_GCC_MandatoryParams Mandatory Parameters + * + * + * + * + * + * + *
LUFA_PATHPath to the LUFA library core, either relative or absolute (e.g. ../LUFA-000000/LUFA/).
+ * + * \section SSec_BuildModule_LUFA_GCC_OptionalParams Optional Parameters + * + * + * + * + * + * + *
BOARDLUFA board hardware drivers to use (see \ref Page_DeviceSupport).
+ * + * \section SSec_BuildModule_LUFA_GCC_ProvidedVariables Module Provided Variables + * + * + * + * + * + *
None
+ * + * \section SSec_BuildModule_LUFA_GCC_ProvidedMacros Module Provided Macros + * + * + * + * + * + *
None
+ */ + +/** \page Page_BuildTroubleshooting Troubleshooting Information + * + * LUFA uses a lot of advanced features of the AVR-GCC compiler, linker, and + * surrounding binaries. This can sometimes lead to problems compiling + * applications if one of these features is buggy in the version of the tools + * used in a build environment. Missing utilities and incorrectly set makefile + * configuration options can also result in different errors being produced + * when compilation or other operations are attempted. The table below lists a + * set of commonly encountered errors and their resolutions. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
ProblemResolution
Error "relocation truncated to fit: R_AVR_13_PCREL against symbol {X}" shown when compiling.Try compiling with the setting LINKER_RELAXATIONS=N in your LUFA Build System 2.0 makefile, or remove the line -Wl,--relax + * from other makefiles. Alternatively, make sure you have the latest version of the Atmel Toolchain installed for your system.
Error "error: ld terminated with signal 11 [Segmentation fault]" shown when compiling.Try compiling with the setting DEBUG_LEVEL=2 in your LUFA Build System 2.0 makefile, or make sure you are using binutils version 2.22 or later.
Error "EMERGENCY ABORT: INFINITE RECURSION DETECTED" shown when compiling.Make sure you are using an up to date version of GNU Make when compiling. This error is a safety system added to the mid-level makefiles, to prevent an issue with + * GNU make or other variants of Make causing an infinitely recursive build.
Error "Unsupported architecture "{X}"" shown when compiling.Ensure your makefile's ARCH setting is set to one of the architecture names (case-sensitive) supported by the version of LUFA you are compiling against.
Error "Makefile {X} value not set" shown when compiling.The specified Makefile value was not configured in your project's makefile or on the command line, and the nominated setting is required by one or more LUFA + * build system modules. Define the value in your project makefile and try again.
Error "Makefile {X} option cannot be blank" shown when compiling.The specified Makefile value was configured in your project's makefile or on the command line, but was set to an empty value. For the nominated configuration + * option, an empty value is not allowed. Define the nominated setting to a correct non-blank value and try again.
Error "Makefile {X} option must be Y or N" shown when compiling.The specified Makefile value was configured in your project's makefile or on the command line, but was set to a value other than a Y (for "Yes") or "N" (for "No"). + * This configuration option is required to be one of the aforementioned boolean values, and other values are invalid. Set this option to either Y or N and try again.
Error "Unknown input source file formats: {X}" shown when compiling.The nominated source files, specified in your project's makefile in the SRC configuration option, has an extension that the LUFA build system does not + * recognise. The file extensions are case sensitive, and must be one of the supported formats (*.c, *.cpp or *.S).
Error "Cannot build with OBJDIR parameter set - one or more object file name is not unique" shown when compiling.When a project is built with a non-empty OBJDIR object directory name set, all input source files must have unique names, excluding extension and path. + * This means that input files that are named identically and differ only by their path or extension are invalid when this mode is used.
Error "Source file does not exist: {X}" shown when compiling.The nominated input source file, specified in the user project's SRC parameter, could not be found. Ensure the source file exists and the absolute or + * relative path given in the user project makefile is correct and try again.
Error "Doxygen configuration file {X} does not exist" shown when upgrading a Doxygen configuration file.The nominated Doxygen configuration file, specified in the user project's DOXYGEN_CONF parameter, could not be found. Ensure the configuration file exists + * and the absolute or relative path given in the user project makefile is correct and try again, or run the appropriate makefile target to generate a new configuration + * file.
Error "avr-gcc: error: unrecognized option '{X}'" shown when compiling.An unrecognised option was supplied to the compiler, usually in the C_FLAGS, CPP_FLAGS, ASM_FLAGS or CC_FLAGS configuration + * options. The nominated compiler switch may be invalid, or unsupported by the version of AVR-GCC on the host system. Remove the unrecognised flag if invalid, or + * upgrade to the latest AVR-GCC. If the option is a valid linker option, use the prefix "-Wl," to ensure it is passed to the linker correctly.
Error "makefile:{X}: {Y}.mk: No such file or directory" shown when make is invoked.The path to the nominated makefile module was incorrect. This usually indicates that the makefile LUFA_PATH option is not set to a valid relative or + * absolute path to the LUFA library core.
Error "fatal error: LUFAConfig.h: No such file or directory" shown when compiling.The USE_LUFA_CONFIG_HEADER compile time option was set in the user project makefile, but the user supplied LUFAConfig.h header could not be + * found. Ensure that the directory that contains this configuration file is correctly passed to the compiler via the -I switch in the makefile CC_FLAGS + * parameter.
Error "ld.exe: section .apitable_trampolines loaded at {X} overlaps section .text" shown when compiling a bootloader.The bootloader is compiling too large for the given FLASH_SIZE_KB and BOOT_SECTION_SIZE_KB parameters set in the bootloader makefile. This + * usually indicates that these values are incorrect for the specified device the bootloader is targeting. If these values are correct, a newer version of the + * compiler may need to be used to ensure that the bootloader is built within the section size constraints of the target device.
Error "unknown MCU '{X}' specified" shown when compiling.The specified microcontroller device model name set in the user application's makefile as the MCU parameter is incorrect, or unsupported by the + * version of the compiler being used. Make sure the model name is correct, or upgrade to the latest Atmel Toolchain to obtain newer device support.
Error "undefined reference to `{X}'" shown when compiling.This is usually caused by a missing source file in the user application's SRC configuration parameter. If the indicated symbol is one from the LUFA + * library, you may be missing a LUFA source makefile module (see \ref Page_BuildModule_LUFA_SOURCES).
+ * + * For troubleshooting other errors you encounter, please see \ref Sec_ProjectHelp. + */ diff --git a/Firmware/LUFA/DoxygenPages/ChangeLog.txt b/Firmware/LUFA/DoxygenPages/ChangeLog.txt index 482c886..aedfd3c 100644 --- a/Firmware/LUFA/DoxygenPages/ChangeLog.txt +++ b/Firmware/LUFA/DoxygenPages/ChangeLog.txt @@ -5,6 +5,62 @@ */ /** \page Page_ChangeLog Project Changelog + * + * \section Sec_ChangeLog170418 Version 170418 + * New: + * - 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) + * + * Fixed: + * - 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) + * + * Changed: + * - 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 + * New: + * - 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) + * + * Changed: + * - 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 + * + * Fixed: + * - 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 * New: diff --git a/Firmware/LUFA/DoxygenPages/CompileTimeTokens.txt b/Firmware/LUFA/DoxygenPages/CompileTimeTokens.txt index ab075cf..92adf0d 100644 --- a/Firmware/LUFA/DoxygenPages/CompileTimeTokens.txt +++ b/Firmware/LUFA/DoxygenPages/CompileTimeTokens.txt @@ -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 NO_SOF_EVENTS - (\ref Group_Events) - All Architectures \n diff --git a/Firmware/LUFA/DoxygenPages/DevelopingWithLUFA.txt b/Firmware/LUFA/DoxygenPages/DevelopingWithLUFA.txt index 9a02f95..31b58fa 100644 --- a/Firmware/LUFA/DoxygenPages/DevelopingWithLUFA.txt +++ b/Firmware/LUFA/DoxygenPages/DevelopingWithLUFA.txt @@ -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 */ diff --git a/Firmware/LUFA/DoxygenPages/DeviceSupport.txt b/Firmware/LUFA/DoxygenPages/DeviceSupport.txt index 2a4b9c3..cff2cda 100644 --- a/Firmware/LUFA/DoxygenPages/DeviceSupport.txt +++ b/Firmware/LUFA/DoxygenPages/DeviceSupport.txt @@ -92,6 +92,7 @@ * - STK525 * - STK526 * - XPLAIN (Original green board, not 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 diff --git a/Firmware/LUFA/DoxygenPages/Donating.txt b/Firmware/LUFA/DoxygenPages/Donating.txt index 4a4b6aa..68228ac 100644 --- a/Firmware/LUFA/DoxygenPages/Donating.txt +++ b/Firmware/LUFA/DoxygenPages/Donating.txt @@ -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 greatly 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 greatly 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 (Note: Please do NOT pay this in advance through the donation link below - diff --git a/Firmware/LUFA/DoxygenPages/KnownIssues.txt b/Firmware/LUFA/DoxygenPages/KnownIssues.txt index 7018fec..183036c 100644 --- a/Firmware/LUFA/DoxygenPages/KnownIssues.txt +++ b/Firmware/LUFA/DoxygenPages/KnownIssues.txt @@ -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 experimental (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 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 experimental (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 (Project->Project {name} Properties... 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 experimental (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 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 experimental (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 (Project->Project {name} Properties... 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. diff --git a/Firmware/LUFA/DoxygenPages/LUFAPoweredProjects.txt b/Firmware/LUFA/DoxygenPages/LUFAPoweredProjects.txt index b1816d0..fa94add 100644 --- a/Firmware/LUFA/DoxygenPages/LUFAPoweredProjects.txt +++ b/Firmware/LUFA/DoxygenPages/LUFAPoweredProjects.txt @@ -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/ diff --git a/Firmware/LUFA/DoxygenPages/MigrationInformation.txt b/Firmware/LUFA/DoxygenPages/MigrationInformation.txt index bc47d14..7efb312 100644 --- a/Firmware/LUFA/DoxygenPages/MigrationInformation.txt +++ b/Firmware/LUFA/DoxygenPages/MigrationInformation.txt @@ -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 + * Device Mode + * - 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 + * Non-USB Library Components + * - 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 * Device Mode * - The device mode RNDIS class driver now requires a user-supplied buffer and buffer length to operate, rather diff --git a/Firmware/LUFA/DoxygenPages/ProgrammingApps.txt b/Firmware/LUFA/DoxygenPages/ProgrammingApps.txt index 4759ac8..653b4ad 100644 --- a/Firmware/LUFA/DoxygenPages/ProgrammingApps.txt +++ b/Firmware/LUFA/DoxygenPages/ProgrammingApps.txt @@ -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. */ diff --git a/Firmware/LUFA/DoxygenPages/SoftwareBootloaderJump.txt b/Firmware/LUFA/DoxygenPages/SoftwareBootloaderJump.txt index 0b69612..f8c2523 100644 --- a/Firmware/LUFA/DoxygenPages/SoftwareBootloaderJump.txt +++ b/Firmware/LUFA/DoxygenPages/SoftwareBootloaderJump.txt @@ -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); diff --git a/Firmware/LUFA/Drivers/Board/AVR8/ADAFRUITU4/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/ADAFRUITU4/Board.h index 48016e0..a640ddc 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/ADAFRUITU4/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/ADAFRUITU4/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/ADAFRUITU4/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/ADAFRUITU4/LEDs.h index 9f31220..be7180c 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/ADAFRUITU4/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/ADAFRUITU4/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Board.h index 07000ec..11e6e0e 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Buttons.h b/Firmware/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Buttons.h index 8b815db..7d5a48b 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/LEDs.h index 76e89fd..cd7bff7 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/BENITO/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/BENITO/Board.h index 5584e1e..9f5b291 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/BENITO/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/BENITO/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/BENITO/Buttons.h b/Firmware/LUFA/Drivers/Board/AVR8/BENITO/Buttons.h index 96d14a3..5e9128e 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/BENITO/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/BENITO/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/BENITO/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/BENITO/LEDs.h index 49df441..f968d7c 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/BENITO/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/BENITO/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/BIGMULTIO/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/BIGMULTIO/Board.h index 9d4e301..02ebe09 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/BIGMULTIO/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/BIGMULTIO/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/BIGMULTIO/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/BIGMULTIO/LEDs.h index 93d5bec..93048f5 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/BIGMULTIO/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/BIGMULTIO/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/BLACKCAT/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/BLACKCAT/Board.h index 6eec7bf..a9aef6e 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/BLACKCAT/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/BLACKCAT/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/BLACKCAT/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/BLACKCAT/LEDs.h index 4a72039..5a7c4f2 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/BLACKCAT/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/BLACKCAT/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/BUI/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/BUI/Board.h index 067e870..87102b6 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/BUI/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/BUI/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/BUI/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/BUI/LEDs.h index e06edb5..d982bcd 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/BUI/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/BUI/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/BUMBLEB/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/BUMBLEB/Board.h index 906f0b5..5af60ab 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/BUMBLEB/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/BUMBLEB/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/BUMBLEB/Buttons.h b/Firmware/LUFA/Drivers/Board/AVR8/BUMBLEB/Buttons.h index 0495425..812cf79 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/BUMBLEB/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/BUMBLEB/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/BUMBLEB/Joystick.h b/Firmware/LUFA/Drivers/Board/AVR8/BUMBLEB/Joystick.h index 82d085e..259c674 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/BUMBLEB/Joystick.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/BUMBLEB/Joystick.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/BUMBLEB/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/BUMBLEB/LEDs.h index 5cd7b48..bb070db 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/BUMBLEB/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/BUMBLEB/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/CULV3/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/CULV3/Board.h index 777902d..88679d1 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/CULV3/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/CULV3/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/CULV3/Buttons.h b/Firmware/LUFA/Drivers/Board/AVR8/CULV3/Buttons.h index 6a26a99..21b6e1c 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/CULV3/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/CULV3/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/CULV3/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/CULV3/LEDs.h index 3d2b8fd..da3ebf8 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/CULV3/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/CULV3/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/DUCE/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/DUCE/Board.h index 44cf691..8521ec9 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/DUCE/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/DUCE/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/DUCE/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/DUCE/LEDs.h index 83caded..ad866b9 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/DUCE/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/DUCE/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/EVK527/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/EVK527/Board.h index c77c18b..01b6b93 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/EVK527/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/EVK527/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/EVK527/Buttons.h b/Firmware/LUFA/Drivers/Board/AVR8/EVK527/Buttons.h index 239880c..3094fbe 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/EVK527/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/EVK527/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/EVK527/Dataflash.h b/Firmware/LUFA/Drivers/Board/AVR8/EVK527/Dataflash.h index 38b2b58..2ec973e 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/EVK527/Dataflash.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/EVK527/Dataflash.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/EVK527/Joystick.h b/Firmware/LUFA/Drivers/Board/AVR8/EVK527/Joystick.h index 492c706..909fa02 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/EVK527/Joystick.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/EVK527/Joystick.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/EVK527/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/EVK527/LEDs.h index 84e689a..a10b822 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/EVK527/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/EVK527/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/JMDBU2/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/JMDBU2/Board.h index 0f1aca0..0e46a57 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/JMDBU2/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/JMDBU2/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/JMDBU2/Buttons.h b/Firmware/LUFA/Drivers/Board/AVR8/JMDBU2/Buttons.h index 8050099..8da45e4 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/JMDBU2/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/JMDBU2/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/JMDBU2/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/JMDBU2/LEDs.h index 562103e..bd2c191 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/JMDBU2/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/JMDBU2/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/LEONARDO/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/LEONARDO/Board.h index 95ef437..400bb11 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/LEONARDO/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/LEONARDO/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/LEONARDO/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/LEONARDO/LEDs.h index ea7d41c..6f26cc1 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/LEONARDO/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/LEONARDO/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/MAXIMUS/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/MAXIMUS/Board.h index 929e60a..7de7501 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/MAXIMUS/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/MAXIMUS/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/MAXIMUS/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/MAXIMUS/LEDs.h index 695949a..aba85ab 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/MAXIMUS/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/MAXIMUS/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/MICRO/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/MICRO/Board.h index 622bfc8..279dc3a 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/MICRO/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/MICRO/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/MICRO/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/MICRO/LEDs.h index c3e471d..445e1a3 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/MICRO/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/MICRO/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/MICROPENDOUS/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/MICROPENDOUS/Board.h index b84bf79..1ae3d6f 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/MICROPENDOUS/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/MICROPENDOUS/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/MICROPENDOUS/Buttons.h b/Firmware/LUFA/Drivers/Board/AVR8/MICROPENDOUS/Buttons.h index 8adff2d..c40ac1f 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/MICROPENDOUS/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/MICROPENDOUS/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/MICROPENDOUS/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/MICROPENDOUS/LEDs.h index 253ad31..2ab89eb 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/MICROPENDOUS/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/MICROPENDOUS/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/MICROSIN162/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/MICROSIN162/Board.h index 3ffb028..1e503c3 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/MICROSIN162/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/MICROSIN162/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/MICROSIN162/Buttons.h b/Firmware/LUFA/Drivers/Board/AVR8/MICROSIN162/Buttons.h index 68344fe..1c90fab 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/MICROSIN162/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/MICROSIN162/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/MICROSIN162/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/MICROSIN162/LEDs.h index 51d1b3e..690ce7d 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/MICROSIN162/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/MICROSIN162/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/MINIMUS/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/MINIMUS/Board.h index 80b8b3c..53bc2da 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/MINIMUS/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/MINIMUS/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/MINIMUS/Buttons.h b/Firmware/LUFA/Drivers/Board/AVR8/MINIMUS/Buttons.h index ec94445..f83924c 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/MINIMUS/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/MINIMUS/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h index adc3468..5569323 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/MULTIO/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/MULTIO/Board.h index 84f3d87..d701dc3 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/MULTIO/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/MULTIO/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/MULTIO/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/MULTIO/LEDs.h index ca6d440..9d3bf6a 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/MULTIO/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/MULTIO/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/OLIMEX162/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/OLIMEX162/Board.h index b9bcf77..64c6577 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/OLIMEX162/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/OLIMEX162/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/OLIMEX162/Buttons.h b/Firmware/LUFA/Drivers/Board/AVR8/OLIMEX162/Buttons.h index 3714c5e..f8ed871 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/OLIMEX162/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/OLIMEX162/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/OLIMEX162/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/OLIMEX162/LEDs.h index 5ecc1f5..52d82ef 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/OLIMEX162/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/OLIMEX162/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/OLIMEX32U4/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/OLIMEX32U4/Board.h index 657b15c..f063b9f 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/OLIMEX32U4/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/OLIMEX32U4/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/OLIMEX32U4/Buttons.h b/Firmware/LUFA/Drivers/Board/AVR8/OLIMEX32U4/Buttons.h index 8e33fd9..fecc637 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/OLIMEX32U4/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/OLIMEX32U4/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/OLIMEX32U4/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/OLIMEX32U4/LEDs.h index 259859c..51eeace 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/OLIMEX32U4/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/OLIMEX32U4/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/Board.h index d318a82..52129fb 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/Buttons.h b/Firmware/LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/Buttons.h index aff10b1..3240dda 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/LEDs.h index 033fca0..6bf924d 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/Board.h index 690fee1..9b0b28c 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/Buttons.h b/Firmware/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/Buttons.h index 634eda9..5db1c59 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/LEDs.h index 2bbaf68..96cf3ed 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/POLOLUMICRO/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/POLOLUMICRO/Board.h new file mode 100644 index 0000000..bf68e39 --- /dev/null +++ b/Firmware/LUFA/Drivers/Board/AVR8/POLOLUMICRO/Board.h @@ -0,0 +1,79 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2017. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + 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 + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaims all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief Board specific information header for the "Pololu A-Star Micro" board. + * \copydetails Group_BoardInfo_POLOLUMICRO + * + * \note This file should not be included directly. It is automatically included as needed by the Board driver + * dispatch header located in LUFA/Drivers/Board/Board.h. + */ + +/** \ingroup Group_BoardInfo + * \defgroup Group_BoardInfo_POLOLUMICRO POLOLUMICRO + * \brief Board specific information header for the "Pololu A-Star Micro" board. + * + * Board specific information header: + * https://www.pololu.com/docs/0J61 -> https://www.pololu.com/docs/0J61/3.1 + * + * @{ + */ + +#ifndef __BOARD_POLOLUMICRO_H__ +#define __BOARD_POLOLUMICRO_H__ + + /* Includes: */ + #include "../../../../Common/Common.h" + #include "../../LEDs.h" + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_BOARD_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** Indicates the board has hardware LEDs mounted. */ + #define BOARD_HAS_LEDS + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + +/** @} */ + diff --git a/Firmware/LUFA/Drivers/Board/AVR8/POLOLUMICRO/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/POLOLUMICRO/LEDs.h new file mode 100644 index 0000000..454a9e2 --- /dev/null +++ b/Firmware/LUFA/Drivers/Board/AVR8/POLOLUMICRO/LEDs.h @@ -0,0 +1,154 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2017. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + 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 + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaims all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief Board specific LED driver header for the Pololu A-Star Micro board. + * \copydetails Group_LEDs_MICRO + * + * \note This file should not be included directly. It is automatically included as needed by the LEDs driver + * dispatch header located in LUFA/Drivers/Board/LEDs.h. + */ + +/** \ingroup Group_LEDs + * \defgroup Group_LEDs_MICRO MICRO + * \brief Board specific LED driver header for the Pololu A-Star Micro board. + * + * Board specific LED driver header for the Pololu A-Star Micro board https://www.pololu.com/docs/0J61/3.1 + * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1YellowGeneral IndicatorHighPORTC.7
LEDS_LED2GreenBootloader, USB-activityLowPORTD.5
+ * + * @{ + */ + +#ifndef __LEDS_MICRO_H__ +#define __LEDS_MICRO_H__ + + /* Includes: */ + #include "../../../../Common/Common.h" + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_LEDS_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. + #endif + + /* Private Interface - For use in library only: */ + #if !defined(__DOXYGEN__) + /* Macros: */ + #define LEDS_PORTC_LEDS (LEDS_LED1) + #define LEDS_PORTD_LEDS (LEDS_LED2) + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** LED mask for the first LED on the board. */ + #define LEDS_LED1 (1 << 7) + + /** LED mask for the second LED on the board. */ + #define LEDS_LED2 (1 << 5) + + /** LED mask for all the LEDs on the board. */ + #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2) + + /** LED mask for none of the board LEDs. */ + #define LEDS_NO_LEDS 0 + + /* Inline Functions: */ + #if !defined(__DOXYGEN__) + static inline void LEDs_Init(void) + { + DDRD |= LEDS_PORTD_LEDS; + PORTD &= ~LEDS_PORTD_LEDS; + DDRC |= LEDS_PORTC_LEDS; + PORTC &= ~LEDS_PORTC_LEDS; + } + + static inline void LEDs_Disable(void) + { + DDRD &= ~LEDS_PORTD_LEDS; + PORTD &= ~LEDS_PORTD_LEDS; + DDRC &= ~LEDS_PORTC_LEDS; + PORTC &= ~LEDS_PORTC_LEDS; + } + + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) + { + PORTD |= (LEDMask & LEDS_PORTD_LEDS); + PORTC |= (LEDMask & LEDS_PORTC_LEDS); + } + + static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask) + { + PORTD &= ~(LEDMask & LEDS_PORTD_LEDS); + PORTC &= ~(LEDMask & LEDS_PORTC_LEDS); + } + + static inline void LEDs_SetAllLEDs(const uint8_t LEDMask) + { + PORTD = ((PORTD & ~LEDS_PORTD_LEDS) | (LEDMask & LEDS_PORTD_LEDS)); + PORTC = ((PORTC & ~LEDS_PORTC_LEDS) | (LEDMask & LEDS_PORTC_LEDS)); + } + + static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, + const uint8_t ActiveMask) + { + PORTD = ((PORTD & ~(LEDMask & LEDS_PORTD_LEDS)) | (ActiveMask & LEDS_PORTD_LEDS)); + PORTC = ((PORTC & ~(LEDMask & LEDS_PORTC_LEDS)) | (ActiveMask & LEDS_PORTC_LEDS)); + } + + static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) + { + PORTD ^= (LEDMask & LEDS_PORTD_LEDS); + PORTC ^= (LEDMask & LEDS_PORTC_LEDS); + } + + static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; + static inline uint8_t LEDs_GetLEDs(void) + { + return ((PORTD & LEDS_PORTD_LEDS) | (PORTC & LEDS_PORTC_LEDS)); + } + #endif + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + +/** @} */ diff --git a/Firmware/LUFA/Drivers/Board/AVR8/RZUSBSTICK/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/RZUSBSTICK/Board.h index 6fc3666..83219b9 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/RZUSBSTICK/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/RZUSBSTICK/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/RZUSBSTICK/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/RZUSBSTICK/LEDs.h index 6ebcdfc..25bdae1 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/RZUSBSTICK/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/RZUSBSTICK/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/Board.h index 49cc2e5..7803ecd 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/LEDs.h index b8eb4ab..70ca608 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/STANGE_ISP/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/STANGE_ISP/Board.h index 36594fc..45472f1 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/STANGE_ISP/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/STANGE_ISP/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/STANGE_ISP/Buttons.h b/Firmware/LUFA/Drivers/Board/AVR8/STANGE_ISP/Buttons.h index d4576b6..2607622 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/STANGE_ISP/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/STANGE_ISP/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/STANGE_ISP/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/STANGE_ISP/LEDs.h index 9f10683..97a7e37 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/STANGE_ISP/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/STANGE_ISP/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/STK525/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/STK525/Board.h index bda925b..a6831a7 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/STK525/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/STK525/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/STK525/Buttons.h b/Firmware/LUFA/Drivers/Board/AVR8/STK525/Buttons.h index 532a46f..5770d07 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/STK525/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/STK525/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/STK525/Dataflash.h b/Firmware/LUFA/Drivers/Board/AVR8/STK525/Dataflash.h index 825a7a5..b0b2855 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/STK525/Dataflash.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/STK525/Dataflash.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/STK525/Joystick.h b/Firmware/LUFA/Drivers/Board/AVR8/STK525/Joystick.h index 6b9b4f4..0224a72 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/STK525/Joystick.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/STK525/Joystick.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/STK525/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/STK525/LEDs.h index 53948b4..e413816 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/STK525/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/STK525/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/STK526/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/STK526/Board.h index 6be146f..1c4ee85 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/STK526/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/STK526/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/STK526/Buttons.h b/Firmware/LUFA/Drivers/Board/AVR8/STK526/Buttons.h index bc598d3..168adaa 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/STK526/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/STK526/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/STK526/Dataflash.h b/Firmware/LUFA/Drivers/Board/AVR8/STK526/Dataflash.h index d2a59b1..82b311b 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/STK526/Dataflash.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/STK526/Dataflash.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/STK526/Joystick.h b/Firmware/LUFA/Drivers/Board/AVR8/STK526/Joystick.h index 7decabc..c7d816c 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/STK526/Joystick.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/STK526/Joystick.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/STK526/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/STK526/LEDs.h index 71525e9..fc561e7 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/STK526/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/STK526/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/TEENSY/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/TEENSY/Board.h index 52e4d61..15237b6 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/TEENSY/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/TEENSY/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h index 9f87224..ed7fbf0 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/TUL/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/TUL/Board.h index 7759c37..066e6c3 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/TUL/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/TUL/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/TUL/Buttons.h b/Firmware/LUFA/Drivers/Board/AVR8/TUL/Buttons.h index bbcca26..af6b2ae 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/TUL/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/TUL/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/TUL/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/TUL/LEDs.h index 8a14b8a..9417b67 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/TUL/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/TUL/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/U2S/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/U2S/Board.h index 128580a..6ea2380 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/U2S/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/U2S/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/U2S/Buttons.h b/Firmware/LUFA/Drivers/Board/AVR8/U2S/Buttons.h index 30f0a9f..ea5c1af 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/U2S/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/U2S/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/U2S/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/U2S/LEDs.h index d7cf7cf..942fdc0 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/U2S/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/U2S/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/UDIP/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/UDIP/Board.h index 3a40005..c8b6e77 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/UDIP/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/UDIP/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/UDIP/Buttons.h b/Firmware/LUFA/Drivers/Board/AVR8/UDIP/Buttons.h index dab29a6..f579b29 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/UDIP/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/UDIP/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/UDIP/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/UDIP/LEDs.h index fbcc8ff..1bf8398 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/UDIP/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/UDIP/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/UNO/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/UNO/Board.h index b23f8d0..9277a38 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/UNO/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/UNO/Board.h @@ -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 @@ -67,6 +67,12 @@ /** Indicates the board has hardware LEDs mounted. */ #define BOARD_HAS_LEDS + /** Pin that can reset the main MCU. */ + #define AVR_RESET_LINE_PORT PORTD + #define AVR_RESET_LINE_DDR DDRD + #define AVR_RESET_LINE_PIN PIND + #define AVR_RESET_LINE_MASK (1 << PD7) + /* Disable C linkage for C++ Compilers: */ #if defined(__cplusplus) } diff --git a/Firmware/LUFA/Drivers/Board/AVR8/UNO/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/UNO/LEDs.h index 006c3a5..17526f3 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/UNO/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/UNO/LEDs.h @@ -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 @@ -44,8 +44,8 @@ * * * - * - * + * + * *
NameColorInfoActive LevelPort Pin
LEDS_LED1YellowRXLowPORTD.4
LEDS_LED2YellowTXLowPORTD.5
LEDS_LED1YellowRXLowPORTD.5
LEDS_LED2YellowTXLowPORTD.4
* * @{ @@ -70,10 +70,10 @@ /* Public Interface - May be used in end-application: */ /* Macros: */ /** LED mask for the first LED on the board. */ - #define LEDS_LED1 (1 << 4) + #define LEDS_LED1 (1 << 5) /** LED mask for the second LED on the board. */ - #define LEDS_LED2 (1 << 5) + #define LEDS_LED2 (1 << 4) /** LED mask for all the LEDs on the board. */ #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2) @@ -81,6 +81,12 @@ /** LED mask for none of the board LEDs. */ #define LEDS_NO_LEDS 0 + /** LED mask for the library LED driver, to indicate TX activity. */ + #define LEDMASK_TX LEDS_LED1 + + /** LED mask for the library LED driver, to indicate RX activity. */ + #define LEDMASK_RX LEDS_LED2 + /* Inline Functions: */ #if !defined(__DOXYGEN__) static inline void LEDs_Init(void) @@ -92,7 +98,7 @@ static inline void LEDs_Disable(void) { DDRD &= ~LEDS_ALL_LEDS; - PORTD &= ~LEDS_ALL_LEDS; + PORTD |= LEDS_ALL_LEDS; } static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) diff --git a/Firmware/LUFA/Drivers/Board/AVR8/USB2AX/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/USB2AX/Board.h index 05a4dea..c6fcd43 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/USB2AX/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/USB2AX/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/USB2AX/Buttons.h b/Firmware/LUFA/Drivers/Board/AVR8/USB2AX/Buttons.h index 170a9af..df6ef64 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/USB2AX/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/USB2AX/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h index 03550fc..b4ed1ca 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/USBFOO/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/USBFOO/Board.h index 15c41ab..fa01b5b 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/USBFOO/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/USBFOO/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/USBFOO/Buttons.h b/Firmware/LUFA/Drivers/Board/AVR8/USBFOO/Buttons.h index e901437..9c2476c 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/USBFOO/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/USBFOO/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/USBFOO/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/USBFOO/LEDs.h index e396630..9c5b8bc 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/USBFOO/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/USBFOO/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/USBKEY/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/USBKEY/Board.h index 3663056..920681d 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/USBKEY/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/USBKEY/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/USBKEY/Buttons.h b/Firmware/LUFA/Drivers/Board/AVR8/USBKEY/Buttons.h index 3ec7b3a..068fd0b 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/USBKEY/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/USBKEY/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/USBKEY/Dataflash.h b/Firmware/LUFA/Drivers/Board/AVR8/USBKEY/Dataflash.h index 85a8dda..77be220 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/USBKEY/Dataflash.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/USBKEY/Dataflash.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/USBKEY/Joystick.h b/Firmware/LUFA/Drivers/Board/AVR8/USBKEY/Joystick.h index 45d5a66..7410364 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/USBKEY/Joystick.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/USBKEY/Joystick.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/USBKEY/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/USBKEY/LEDs.h index dc02da5..18ff756 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/USBKEY/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/USBKEY/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/USBTINYMKII/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/USBTINYMKII/Board.h index 492aced..5501bf6 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/USBTINYMKII/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/USBTINYMKII/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/USBTINYMKII/Buttons.h b/Firmware/LUFA/Drivers/Board/AVR8/USBTINYMKII/Buttons.h index 682239c..e87f611 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/USBTINYMKII/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/USBTINYMKII/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/USBTINYMKII/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/USBTINYMKII/LEDs.h index a2decbc..288f550 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/USBTINYMKII/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/USBTINYMKII/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/XPLAIN/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/XPLAIN/Board.h index 57ad4c9..713e065 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/XPLAIN/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/XPLAIN/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/XPLAIN/Dataflash.h b/Firmware/LUFA/Drivers/Board/AVR8/XPLAIN/Dataflash.h index a8078f6..ed6a48c 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/XPLAIN/Dataflash.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/XPLAIN/Dataflash.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/XPLAIN/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/XPLAIN/LEDs.h index 338b1b4..9da3fad 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/XPLAIN/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/XPLAIN/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/XPLAINED_MINI/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/XPLAINED_MINI/Board.h new file mode 100644 index 0000000..2253e33 --- /dev/null +++ b/Firmware/LUFA/Drivers/Board/AVR8/XPLAINED_MINI/Board.h @@ -0,0 +1,78 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2017. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + 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 + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaims all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief Board specific information header for the Atmel Xplained-MINI series kits. + * \copydetails Group_BoardInfo_XPLAINED_MINI + * + * \note This file should not be included directly. It is automatically included as needed by the Board driver + * dispatch header located in LUFA/Drivers/Board/Board.h. + */ + +/** \ingroup Group_BoardInfo + * \defgroup Group_BoardInfo_XPLAINED_MINI XPLAINED_MINI + * \brief Board specific information header for the Atmel Xplained-MINI series kits. + * + * Board specific information header for the Atmel Xplained-MINI series kits. + * + * @{ + */ + +#ifndef __BOARD_XPLAINED_MINI_H__ +#define __BOARD_XPLAINED_MINI_H__ + + /* Includes: */ + #include "../../../../Common/Common.h" + #include "../../LEDs.h" + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_BOARD_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** Indicates the board has hardware LEDs mounted. */ + #define BOARD_HAS_LEDS + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + +/** @} */ + diff --git a/Firmware/LUFA/Drivers/Board/AVR8/XPLAINED_MINI/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/XPLAINED_MINI/LEDs.h new file mode 100644 index 0000000..5c8f196 --- /dev/null +++ b/Firmware/LUFA/Drivers/Board/AVR8/XPLAINED_MINI/LEDs.h @@ -0,0 +1,135 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2017. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + 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 + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaims all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief Board specific LED driver header for the Atmel Xplained-MINI series kits.. + * \copydetails Group_LEDs_XPLAINED_MINI + * + * \note This file should not be included directly. It is automatically included as needed by the LEDs driver + * dispatch header located in LUFA/Drivers/Board/LEDs.h. + */ + +/** \ingroup Group_LEDs + * \defgroup Group_LEDs_XPLAINED_MINI XPLAINED_MINI + * \brief Board specific LED driver header for the Atmel Xplained-MINI series kits. + * + * Board specific LED driver header for the Atmel Xplained-MINI series kits. + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenGeneral IndicatorLowPORTC.6
+ * + * @{ + */ + +#ifndef __LEDS_XPLAINED_MINI_H__ +#define __LEDS_XPLAINED_MINI_H__ + + /* Includes: */ + #include "../../../../Common/Common.h" + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_LEDS_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** LED mask for the first LED on the board. */ + #define LEDS_LED1 (1 << 6) + + /** LED mask for all the LEDs on the board. */ + #define LEDS_ALL_LEDS LEDS_LED1 + + /** LED mask for none of the board LEDs. */ + #define LEDS_NO_LEDS 0 + + /* Inline Functions: */ + #if !defined(__DOXYGEN__) + static inline void LEDs_Init(void) + { + DDRC |= LEDS_ALL_LEDS; + PORTC |= LEDS_ALL_LEDS; + } + + static inline void LEDs_Disable(void) + { + DDRC &= ~LEDS_ALL_LEDS; + PORTC &= ~LEDS_ALL_LEDS; + } + + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) + { + PORTC &= ~LEDMask; + } + + static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask) + { + PORTC |= LEDMask; + } + + static inline void LEDs_SetAllLEDs(const uint8_t LEDMask) + { + PORTC = ((PORTC | LEDS_ALL_LEDS) & ~LEDMask); + } + + static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, + const uint8_t ActiveMask) + { + PORTC = ((PORTC | LEDMask) & ~ActiveMask); + } + + static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) + { + PINC = LEDMask; + } + + static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; + static inline uint8_t LEDs_GetLEDs(void) + { + return (~PORTC & LEDS_ALL_LEDS); + } + #endif + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + +/** @} */ + diff --git a/Firmware/LUFA/Drivers/Board/AVR8/YUN/Board.h b/Firmware/LUFA/Drivers/Board/AVR8/YUN/Board.h index 1d99302..035f66a 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/YUN/Board.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/YUN/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/AVR8/YUN/LEDs.h b/Firmware/LUFA/Drivers/Board/AVR8/YUN/LEDs.h index bcdd47f..d06acd7 100644 --- a/Firmware/LUFA/Drivers/Board/AVR8/YUN/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/AVR8/YUN/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/Board.h b/Firmware/LUFA/Drivers/Board/Board.h index 27f4953..55ed29a 100644 --- a/Firmware/LUFA/Drivers/Board/Board.h +++ b/Firmware/LUFA/Drivers/Board/Board.h @@ -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 @@ -157,6 +157,10 @@ #include "AVR8/YUN/Board.h" #elif (BOARD == BOARD_MICRO) #include "AVR8/MICRO/Board.h" + #elif (BOARD == BOARD_POLOLUMICRO) + #include "AVR8/POLOLUMICRO/Board.h" + #elif (BOARD == BOARD_XPLAINED_MINI) + #include "AVR8/XPLAINED_MINI/Board.h" #else #include "Board/Board.h" #endif diff --git a/Firmware/LUFA/Drivers/Board/Buttons.h b/Firmware/LUFA/Drivers/Board/Buttons.h index dc22cc1..00ebe8c 100644 --- a/Firmware/LUFA/Drivers/Board/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/Buttons.h @@ -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 @@ -93,8 +93,9 @@ #if (BOARD == BOARD_NONE) #define BUTTONS_BUTTON1 0 - static inline void Buttons_Init(void) {}; - static inline uint_reg_t Buttons_GetStatus(void) { return 0; }; + static inline void Buttons_Init(void) {} + static inline void Buttons_Disable(void) {} + static inline uint_reg_t Buttons_GetStatus(void) { return 0; } #elif (BOARD == BOARD_USBKEY) #include "AVR8/USBKEY/Buttons.h" #elif (BOARD == BOARD_STK525) diff --git a/Firmware/LUFA/Drivers/Board/Dataflash.h b/Firmware/LUFA/Drivers/Board/Dataflash.h index 9b4bf56..b634dcc 100644 --- a/Firmware/LUFA/Drivers/Board/Dataflash.h +++ b/Firmware/LUFA/Drivers/Board/Dataflash.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/Joystick.h b/Firmware/LUFA/Drivers/Board/Joystick.h index 4ecf61f..0d0fe89 100644 --- a/Firmware/LUFA/Drivers/Board/Joystick.h +++ b/Firmware/LUFA/Drivers/Board/Joystick.h @@ -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 @@ -105,8 +105,9 @@ #define JOY_LEFT 0 #define JOY_RIGHT 0 #define JOY_PRESS 0 - static inline void Joystick_Init(void) {}; - static inline uint_reg_t Joystick_GetStatus(void) { return 0; }; + static inline void Joystick_Init(void) {} + static inline void Joystick_Disable(void) {} + static inline uint_reg_t Joystick_GetStatus(void) { return 0; } #elif (BOARD == BOARD_USBKEY) #include "AVR8/USBKEY/Joystick.h" #elif (BOARD == BOARD_STK525) diff --git a/Firmware/LUFA/Drivers/Board/LEDs.h b/Firmware/LUFA/Drivers/Board/LEDs.h index 392714a..ba0b1bb 100644 --- a/Firmware/LUFA/Drivers/Board/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/LEDs.h @@ -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 @@ -108,13 +108,13 @@ #include "../../Common/Common.h" #if (BOARD == BOARD_NONE) - static inline void LEDs_Init(void) {}; - static inline void LEDs_Disable(void) {}; - static inline void LEDs_TurnOnLEDs(const uint_reg_t LEDMask) {}; - static inline void LEDs_TurnOffLEDs(const uint_reg_t LEDMask) {}; - static inline void LEDs_SetAllLEDs(const uint_reg_t LEDMask) {}; - static inline void LEDs_ChangeLEDs(const uint_reg_t LEDMask, const uint_reg_t ActiveMask) {}; - static inline void LEDs_ToggleLEDs(const uint_reg_t LEDMask) {}; + static inline void LEDs_Init(void) {} + static inline void LEDs_Disable(void) {} + static inline void LEDs_TurnOnLEDs(const uint_reg_t LEDMask) {} + static inline void LEDs_TurnOffLEDs(const uint_reg_t LEDMask) {} + static inline void LEDs_SetAllLEDs(const uint_reg_t LEDMask) {} + static inline void LEDs_ChangeLEDs(const uint_reg_t LEDMask, const uint_reg_t ActiveMask) {} + static inline void LEDs_ToggleLEDs(const uint_reg_t LEDMask) {} static inline uint_reg_t LEDs_GetLEDs(void) { return 0; } #elif (BOARD == BOARD_USBKEY) #include "AVR8/USBKEY/LEDs.h" @@ -207,6 +207,10 @@ #include "AVR8/YUN/LEDs.h" #elif (BOARD == BOARD_MICRO) #include "AVR8/MICRO/LEDs.h" + #elif (BOARD == BOARD_POLOLUMICRO) + #include "AVR8/POLOLUMICRO/LEDs.h" + #elif (BOARD == BOARD_XPLAINED_MINI) + #include "AVR8/XPLAINED_MINI/LEDs.h" #else #include "Board/LEDs.h" #endif diff --git a/Firmware/LUFA/Drivers/Board/Temperature.c b/Firmware/LUFA/Drivers/Board/Temperature.c index 8b09f10..2fb1976 100644 --- a/Firmware/LUFA/Drivers/Board/Temperature.c +++ b/Firmware/LUFA/Drivers/Board/Temperature.c @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/Temperature.h b/Firmware/LUFA/Drivers/Board/Temperature.h index d20c6f7..f381cc9 100644 --- a/Firmware/LUFA/Drivers/Board/Temperature.h +++ b/Firmware/LUFA/Drivers/Board/Temperature.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/UC3/EVK1100/Board.h b/Firmware/LUFA/Drivers/Board/UC3/EVK1100/Board.h index 0c34a3f..bd68cf5 100644 --- a/Firmware/LUFA/Drivers/Board/UC3/EVK1100/Board.h +++ b/Firmware/LUFA/Drivers/Board/UC3/EVK1100/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/UC3/EVK1100/Buttons.h b/Firmware/LUFA/Drivers/Board/UC3/EVK1100/Buttons.h index fa45200..a2bd15d 100644 --- a/Firmware/LUFA/Drivers/Board/UC3/EVK1100/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/UC3/EVK1100/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/UC3/EVK1100/Joystick.h b/Firmware/LUFA/Drivers/Board/UC3/EVK1100/Joystick.h index 72dd769..7117bc5 100644 --- a/Firmware/LUFA/Drivers/Board/UC3/EVK1100/Joystick.h +++ b/Firmware/LUFA/Drivers/Board/UC3/EVK1100/Joystick.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/UC3/EVK1100/LEDs.h b/Firmware/LUFA/Drivers/Board/UC3/EVK1100/LEDs.h index f66eddb..ca6a37f 100644 --- a/Firmware/LUFA/Drivers/Board/UC3/EVK1100/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/UC3/EVK1100/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/UC3/EVK1101/Board.h b/Firmware/LUFA/Drivers/Board/UC3/EVK1101/Board.h index 5d5f95a..46d79f0 100644 --- a/Firmware/LUFA/Drivers/Board/UC3/EVK1101/Board.h +++ b/Firmware/LUFA/Drivers/Board/UC3/EVK1101/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/UC3/EVK1101/Buttons.h b/Firmware/LUFA/Drivers/Board/UC3/EVK1101/Buttons.h index 3de4b33..41bf42c 100644 --- a/Firmware/LUFA/Drivers/Board/UC3/EVK1101/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/UC3/EVK1101/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/UC3/EVK1101/Joystick.h b/Firmware/LUFA/Drivers/Board/UC3/EVK1101/Joystick.h index f7a9a75..1351213 100644 --- a/Firmware/LUFA/Drivers/Board/UC3/EVK1101/Joystick.h +++ b/Firmware/LUFA/Drivers/Board/UC3/EVK1101/Joystick.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/UC3/EVK1101/LEDs.h b/Firmware/LUFA/Drivers/Board/UC3/EVK1101/LEDs.h index dad7771..71d45d2 100644 --- a/Firmware/LUFA/Drivers/Board/UC3/EVK1101/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/UC3/EVK1101/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/UC3/EVK1104/Board.h b/Firmware/LUFA/Drivers/Board/UC3/EVK1104/Board.h index aa7adbf..0c8b762 100644 --- a/Firmware/LUFA/Drivers/Board/UC3/EVK1104/Board.h +++ b/Firmware/LUFA/Drivers/Board/UC3/EVK1104/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/UC3/EVK1104/Buttons.h b/Firmware/LUFA/Drivers/Board/UC3/EVK1104/Buttons.h index dfcfb66..d12fda5 100644 --- a/Firmware/LUFA/Drivers/Board/UC3/EVK1104/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/UC3/EVK1104/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/UC3/EVK1104/LEDs.h b/Firmware/LUFA/Drivers/Board/UC3/EVK1104/LEDs.h index 2258a26..793ea86 100644 --- a/Firmware/LUFA/Drivers/Board/UC3/EVK1104/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/UC3/EVK1104/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/Board.h b/Firmware/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/Board.h index ec4d9c7..94abc3e 100644 --- a/Firmware/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/Board.h +++ b/Firmware/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/Buttons.h b/Firmware/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/Buttons.h index 8accb6f..879373e 100644 --- a/Firmware/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/LEDs.h b/Firmware/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/LEDs.h index 66b7834..cbd2bde 100644 --- a/Firmware/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Board.h b/Firmware/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Board.h index 824c3db..2bc2377 100644 --- a/Firmware/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Board.h +++ b/Firmware/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h b/Firmware/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h index d5119eb..901869d 100644 --- a/Firmware/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Dataflash.h b/Firmware/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Dataflash.h index 2d09839..b484738 100644 --- a/Firmware/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Dataflash.h +++ b/Firmware/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Dataflash.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/LEDs.h b/Firmware/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/LEDs.h index 16abfbc..a0c5b3a 100644 --- a/Firmware/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Board.h b/Firmware/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Board.h index d807d18..b133b9a 100644 --- a/Firmware/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Board.h +++ b/Firmware/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Buttons.h b/Firmware/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Buttons.h index 9c458b4..01c7c08 100644 --- a/Firmware/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Dataflash.h b/Firmware/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Dataflash.h index f02ca4a..7140266 100644 --- a/Firmware/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Dataflash.h +++ b/Firmware/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Dataflash.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/LEDs.h b/Firmware/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/LEDs.h index 7bd31ad..078532a 100644 --- a/Firmware/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/XMEGA/C3_XPLAINED/Board.h b/Firmware/LUFA/Drivers/Board/XMEGA/C3_XPLAINED/Board.h index d90cc3a..e48bd58 100644 --- a/Firmware/LUFA/Drivers/Board/XMEGA/C3_XPLAINED/Board.h +++ b/Firmware/LUFA/Drivers/Board/XMEGA/C3_XPLAINED/Board.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/XMEGA/C3_XPLAINED/Buttons.h b/Firmware/LUFA/Drivers/Board/XMEGA/C3_XPLAINED/Buttons.h index db62b1d..1a8c1fc 100644 --- a/Firmware/LUFA/Drivers/Board/XMEGA/C3_XPLAINED/Buttons.h +++ b/Firmware/LUFA/Drivers/Board/XMEGA/C3_XPLAINED/Buttons.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Board/XMEGA/C3_XPLAINED/LEDs.h b/Firmware/LUFA/Drivers/Board/XMEGA/C3_XPLAINED/LEDs.h index 737624b..f701c88 100644 --- a/Firmware/LUFA/Drivers/Board/XMEGA/C3_XPLAINED/LEDs.h +++ b/Firmware/LUFA/Drivers/Board/XMEGA/C3_XPLAINED/LEDs.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Misc/AT45DB321C.h b/Firmware/LUFA/Drivers/Misc/AT45DB321C.h index 2506928..e354ca4 100644 --- a/Firmware/LUFA/Drivers/Misc/AT45DB321C.h +++ b/Firmware/LUFA/Drivers/Misc/AT45DB321C.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Misc/AT45DB642D.h b/Firmware/LUFA/Drivers/Misc/AT45DB642D.h index ebbad71..76a7a5c 100644 --- a/Firmware/LUFA/Drivers/Misc/AT45DB642D.h +++ b/Firmware/LUFA/Drivers/Misc/AT45DB642D.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Misc/RingBuffer.h b/Firmware/LUFA/Drivers/Misc/RingBuffer.h index 68fdb8e..0e76a07 100644 --- a/Firmware/LUFA/Drivers/Misc/RingBuffer.h +++ b/Firmware/LUFA/Drivers/Misc/RingBuffer.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Misc/TerminalCodes.h b/Firmware/LUFA/Drivers/Misc/TerminalCodes.h index d43fe01..b12a247 100644 --- a/Firmware/LUFA/Drivers/Misc/TerminalCodes.h +++ b/Firmware/LUFA/Drivers/Misc/TerminalCodes.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Peripheral/ADC.h b/Firmware/LUFA/Drivers/Peripheral/ADC.h index 295c6e1..a0182b3 100644 --- a/Firmware/LUFA/Drivers/Peripheral/ADC.h +++ b/Firmware/LUFA/Drivers/Peripheral/ADC.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Peripheral/AVR8/ADC_AVR8.h b/Firmware/LUFA/Drivers/Peripheral/AVR8/ADC_AVR8.h index 03b6ed0..a2b7ede 100644 --- a/Firmware/LUFA/Drivers/Peripheral/AVR8/ADC_AVR8.h +++ b/Firmware/LUFA/Drivers/Peripheral/AVR8/ADC_AVR8.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Peripheral/AVR8/SPI_AVR8.h b/Firmware/LUFA/Drivers/Peripheral/AVR8/SPI_AVR8.h index 1b8f53e..7244f4a 100644 --- a/Firmware/LUFA/Drivers/Peripheral/AVR8/SPI_AVR8.h +++ b/Firmware/LUFA/Drivers/Peripheral/AVR8/SPI_AVR8.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Peripheral/AVR8/SerialSPI_AVR8.h b/Firmware/LUFA/Drivers/Peripheral/AVR8/SerialSPI_AVR8.h index 8d58369..052780e 100644 --- a/Firmware/LUFA/Drivers/Peripheral/AVR8/SerialSPI_AVR8.h +++ b/Firmware/LUFA/Drivers/Peripheral/AVR8/SerialSPI_AVR8.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.c b/Firmware/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.c index 8785a4b..779a80c 100644 --- a/Firmware/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.c +++ b/Firmware/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.c @@ -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 @@ -88,8 +88,10 @@ void Serial_SendString(const char* StringPtr) void Serial_SendData(const void* Buffer, uint16_t Length) { + uint8_t* CurrByte = (uint8_t*)Buffer; + while (Length--) - Serial_SendByte(*((uint8_t*)Buffer++)); + Serial_SendByte(*(CurrByte++)); } void Serial_CreateStream(FILE* Stream) diff --git a/Firmware/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h b/Firmware/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h index e8860a5..b3e7ee3 100644 --- a/Firmware/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h +++ b/Firmware/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h @@ -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 @@ -168,7 +168,8 @@ /** Initializes the USART, ready for serial data transmission and reception. This initializes the interface to * standard 8-bit, no parity, 1 stop bit settings suitable for most applications. * - * \param[in] BaudRate Serial baud rate, in bits per second. + * \param[in] BaudRate Serial baud rate, in bits per second. This should be the target baud rate regardless of the + * \c DoubleSpeed parameter's value. * \param[in] DoubleSpeed Enables double speed mode when set, halving the sample time to double the baud rate. */ static inline void Serial_Init(const uint32_t BaudRate, diff --git a/Firmware/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c b/Firmware/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c index 2a6c160..eb08687 100644 --- a/Firmware/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c +++ b/Firmware/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c @@ -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 @@ -135,7 +135,7 @@ uint8_t TWI_ReadPacket(const uint8_t SlaveAddress, const uint8_t* InternalAddress, uint8_t InternalAddressLen, uint8_t* Buffer, - uint8_t Length) + uint16_t Length) { uint8_t ErrorCode; @@ -175,7 +175,7 @@ uint8_t TWI_WritePacket(const uint8_t SlaveAddress, const uint8_t* InternalAddress, uint8_t InternalAddressLen, const uint8_t* Buffer, - uint8_t Length) + uint16_t Length) { uint8_t ErrorCode; diff --git a/Firmware/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.h b/Firmware/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.h index 584b584..a8b845a 100644 --- a/Firmware/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.h +++ b/Firmware/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.h @@ -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 @@ -273,7 +273,7 @@ const uint8_t* InternalAddress, uint8_t InternalAddressLen, uint8_t* Buffer, - uint8_t Length) ATTR_NON_NULL_PTR_ARG(3); + uint16_t Length) ATTR_NON_NULL_PTR_ARG(3); /** High level function to perform a complete packet transfer over the TWI bus from the specified * device. @@ -292,7 +292,7 @@ const uint8_t* InternalAddress, uint8_t InternalAddressLen, const uint8_t* Buffer, - uint8_t Length) ATTR_NON_NULL_PTR_ARG(3); + uint16_t Length) ATTR_NON_NULL_PTR_ARG(3); /* Disable C linkage for C++ Compilers: */ #if defined(__cplusplus) diff --git a/Firmware/LUFA/Drivers/Peripheral/SPI.h b/Firmware/LUFA/Drivers/Peripheral/SPI.h index 54c4642..f0cd177 100644 --- a/Firmware/LUFA/Drivers/Peripheral/SPI.h +++ b/Firmware/LUFA/Drivers/Peripheral/SPI.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Peripheral/Serial.h b/Firmware/LUFA/Drivers/Peripheral/Serial.h index 46ee61b..0c537bc 100644 --- a/Firmware/LUFA/Drivers/Peripheral/Serial.h +++ b/Firmware/LUFA/Drivers/Peripheral/Serial.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Peripheral/SerialSPI.h b/Firmware/LUFA/Drivers/Peripheral/SerialSPI.h index 9a42ba5..dbab9db 100644 --- a/Firmware/LUFA/Drivers/Peripheral/SerialSPI.h +++ b/Firmware/LUFA/Drivers/Peripheral/SerialSPI.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Peripheral/TWI.h b/Firmware/LUFA/Drivers/Peripheral/TWI.h index 5290e66..24483d8 100644 --- a/Firmware/LUFA/Drivers/Peripheral/TWI.h +++ b/Firmware/LUFA/Drivers/Peripheral/TWI.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Peripheral/XMEGA/SPI_XMEGA.h b/Firmware/LUFA/Drivers/Peripheral/XMEGA/SPI_XMEGA.h index c623048..7797df1 100644 --- a/Firmware/LUFA/Drivers/Peripheral/XMEGA/SPI_XMEGA.h +++ b/Firmware/LUFA/Drivers/Peripheral/XMEGA/SPI_XMEGA.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Peripheral/XMEGA/SerialSPI_XMEGA.h b/Firmware/LUFA/Drivers/Peripheral/XMEGA/SerialSPI_XMEGA.h index a981ce6..ca32350 100644 --- a/Firmware/LUFA/Drivers/Peripheral/XMEGA/SerialSPI_XMEGA.h +++ b/Firmware/LUFA/Drivers/Peripheral/XMEGA/SerialSPI_XMEGA.h @@ -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 diff --git a/Firmware/LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.c b/Firmware/LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.c index 4e29357..9ecda47 100644 --- a/Firmware/LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.c +++ b/Firmware/LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.c @@ -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 @@ -91,23 +91,26 @@ void Serial_SendData(USART_t* const USART, const void* Buffer, uint16_t Length) { + uint8_t* CurrByte = (uint8_t*)Buffer; + while (Length--) - Serial_SendByte(USART, *((uint8_t*)Buffer++)); + Serial_SendByte(USART, *(CurrByte++)); } -void Serial_CreateStream(FILE* Stream) +void Serial_CreateStream(USART_t* USART, FILE* Stream) { if (!(Stream)) { Stream = &USARTSerialStream; stdin = Stream; stdout = Stream; - } + } - *Stream = (FILE)FDEV_SETUP_STREAM(Serial_putchar, Serial_getchar, _FDEV_SETUP_RW); + *Stream = (FILE)FDEV_SETUP_STREAM(Serial_putchar, Serial_getchar, _FDEV_SETUP_RW); + fdev_set_udata(Stream, USART); } -void Serial_CreateBlockingStream(FILE* Stream) +void Serial_CreateBlockingStream(USART_t* USART, FILE* Stream) { if (!(Stream)) { @@ -116,7 +119,8 @@ void Serial_CreateBlockingStream(FILE* Stream) stdout = Stream; } - *Stream = (FILE)FDEV_SETUP_STREAM(Serial_putchar, Serial_getchar_Blocking, _FDEV_SETUP_RW); + *Stream = (FILE)FDEV_SETUP_STREAM(Serial_putchar, Serial_getchar_Blocking, _FDEV_SETUP_RW); + fdev_set_udata(Stream, USART); } #endif diff --git a/Firmware/LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.h b/Firmware/LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.h index ad34c85..36f507d 100644 --- a/Firmware/LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.h +++ b/Firmware/LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.h @@ -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 @@ -151,29 +151,32 @@ * be used when the read data is processed byte-per-bye (via \c getc()) or when the user application will implement its own * line buffering. * + * \param[in,out] USART Pointer to the base of the USART peripheral within the device. * \param[in,out] Stream Pointer to a FILE structure where the created stream should be placed, if \c NULL, \c stdout * and \c stdin will be configured to use the USART. * * \pre The USART must first be configured via a call to \ref Serial_Init() before the stream is used. */ - void Serial_CreateStream(FILE* Stream); + void Serial_CreateStream(USART_t* USART, FILE* Stream); - /** Identical to \ref Serial_CreateStream(), except that reads are blocking until the calling stream function terminates + /** Identical to \ref Serial_CreateStream(), except that reads are blocking until the calling stream function terminates * the transfer. * + * \param[in,out] USART Pointer to the base of the USART peripheral within the device. * \param[in,out] Stream Pointer to a FILE structure where the created stream should be placed, if \c NULL, \c stdout * and \c stdin will be configured to use the USART. * * \pre The USART must first be configured via a call to \ref Serial_Init() before the stream is used. */ - void Serial_CreateBlockingStream(FILE* Stream); + void Serial_CreateBlockingStream(USART_t* USART, FILE* Stream); /* Inline Functions: */ /** Initializes the USART, ready for serial data transmission and reception. This initializes the interface to * standard 8-bit, no parity, 1 stop bit settings suitable for most applications. * * \param[in,out] USART Pointer to the base of the USART peripheral within the device. - * \param[in] BaudRate Serial baud rate, in bits per second. + * \param[in] BaudRate Serial baud rate, in bits per second. This should be the target baud rate regardless of + * the \c DoubleSpeed parameter's value. * \param[in] DoubleSpeed Enables double speed mode when set, halving the sample time to double the baud rate. */ static inline void Serial_Init(USART_t* const USART, diff --git a/Firmware/LUFA/Drivers/Peripheral/XMEGA/TWI_XMEGA.c b/Firmware/LUFA/Drivers/Peripheral/XMEGA/TWI_XMEGA.c index 6f8ab1d..92cc643 100644 --- a/Firmware/LUFA/Drivers/Peripheral/XMEGA/TWI_XMEGA.c +++ b/Firmware/LUFA/Drivers/Peripheral/XMEGA/TWI_XMEGA.c @@ -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 @@ -110,7 +110,7 @@ uint8_t TWI_ReadPacket(TWI_t* const TWI, const uint8_t* InternalAddress, uint8_t InternalAddressLen, uint8_t* Buffer, - uint8_t Length) + uint16_t Length) { uint8_t ErrorCode; @@ -151,7 +151,7 @@ uint8_t TWI_WritePacket(TWI_t* const TWI, const uint8_t* InternalAddress, uint8_t InternalAddressLen, const uint8_t* Buffer, - uint8_t Length) + uint16_t Length) { uint8_t ErrorCode; diff --git a/Firmware/LUFA/Drivers/Peripheral/XMEGA/TWI_XMEGA.h b/Firmware/LUFA/Drivers/Peripheral/XMEGA/TWI_XMEGA.h index 72437e5..94ada73 100644 --- a/Firmware/LUFA/Drivers/Peripheral/XMEGA/TWI_XMEGA.h +++ b/Firmware/LUFA/Drivers/Peripheral/XMEGA/TWI_XMEGA.h @@ -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 @@ -268,7 +268,7 @@ const uint8_t* InternalAddress, uint8_t InternalAddressLen, uint8_t* Buffer, - uint8_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(4); + uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(4); /** High level function to perform a complete packet transfer over the TWI bus from the specified * device. @@ -289,7 +289,7 @@ const uint8_t* InternalAddress, uint8_t InternalAddressLen, const uint8_t* Buffer, - uint8_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(4); + uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(4); /* Disable C linkage for C++ Compilers: */ #if defined(__cplusplus) diff --git a/Firmware/LUFA/Drivers/USB/Class/AndroidAccessoryClass.h b/Firmware/LUFA/Drivers/USB/Class/AndroidAccessoryClass.h index 24978ca..f1c0109 100644 --- a/Firmware/LUFA/Drivers/USB/Class/AndroidAccessoryClass.h +++ b/Firmware/LUFA/Drivers/USB/Class/AndroidAccessoryClass.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/AudioClass.h b/Firmware/LUFA/Drivers/USB/Class/AudioClass.h index 0e3ca8d..d6ced05 100644 --- a/Firmware/LUFA/Drivers/USB/Class/AudioClass.h +++ b/Firmware/LUFA/Drivers/USB/Class/AudioClass.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/CDCClass.h b/Firmware/LUFA/Drivers/USB/Class/CDCClass.h index 3bad74b..30b3ee2 100644 --- a/Firmware/LUFA/Drivers/USB/Class/CDCClass.h +++ b/Firmware/LUFA/Drivers/USB/Class/CDCClass.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Common/AndroidAccessoryClassCommon.h b/Firmware/LUFA/Drivers/USB/Class/Common/AndroidAccessoryClassCommon.h index c3153da..fdf8671 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Common/AndroidAccessoryClassCommon.h +++ b/Firmware/LUFA/Drivers/USB/Class/Common/AndroidAccessoryClassCommon.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Common/AudioClassCommon.h b/Firmware/LUFA/Drivers/USB/Class/Common/AudioClassCommon.h index 2db5eee..46ecd08 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Common/AudioClassCommon.h +++ b/Firmware/LUFA/Drivers/USB/Class/Common/AudioClassCommon.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Common/CDCClassCommon.h b/Firmware/LUFA/Drivers/USB/Class/Common/CDCClassCommon.h index 94e6c68..1ad49ec 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Common/CDCClassCommon.h +++ b/Firmware/LUFA/Drivers/USB/Class/Common/CDCClassCommon.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Common/HIDClassCommon.h b/Firmware/LUFA/Drivers/USB/Class/Common/HIDClassCommon.h index 9d701fb..6e700a9 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Common/HIDClassCommon.h +++ b/Firmware/LUFA/Drivers/USB/Class/Common/HIDClassCommon.h @@ -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 @@ -445,7 +445,7 @@ HID_RI_REPORT_SIZE(8, 0x03), \ HID_RI_OUTPUT(8, HID_IOF_CONSTANT), \ HID_RI_LOGICAL_MINIMUM(8, 0x00), \ - HID_RI_LOGICAL_MAXIMUM(8, 0xFF), \ + HID_RI_LOGICAL_MAXIMUM(16, 0xFF), \ HID_RI_USAGE_PAGE(8, 0x07), \ HID_RI_USAGE_MINIMUM(8, 0x00), \ HID_RI_USAGE_MAXIMUM(8, 0xFF), \ @@ -679,4 +679,3 @@ #endif /** @} */ - diff --git a/Firmware/LUFA/Drivers/USB/Class/Common/HIDParser.c b/Firmware/LUFA/Drivers/USB/Class/Common/HIDParser.c index d93508f..62f10c4 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Common/HIDParser.c +++ b/Firmware/LUFA/Drivers/USB/Class/Common/HIDParser.c @@ -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 @@ -364,8 +364,8 @@ void USB_SetHIDReportItemInfo(uint8_t* ReportData, while (DataBitsRem--) { - if (ReportItem->Value & (1 << (CurrentBit % 8))) - ReportData[CurrentBit / 8] |= BitMask; + if (ReportItem->Value & BitMask) + ReportData[CurrentBit / 8] |= (1 << (CurrentBit % 8)); CurrentBit++; BitMask <<= 1; diff --git a/Firmware/LUFA/Drivers/USB/Class/Common/HIDParser.h b/Firmware/LUFA/Drivers/USB/Class/Common/HIDParser.h index 1f84ef4..023316d 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Common/HIDParser.h +++ b/Firmware/LUFA/Drivers/USB/Class/Common/HIDParser.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Common/HIDReportData.h b/Firmware/LUFA/Drivers/USB/Class/Common/HIDReportData.h index df4302c..fe1c4df 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Common/HIDReportData.h +++ b/Firmware/LUFA/Drivers/USB/Class/Common/HIDReportData.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Common/MIDIClassCommon.h b/Firmware/LUFA/Drivers/USB/Class/Common/MIDIClassCommon.h index b6f6034..b6414bc 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Common/MIDIClassCommon.h +++ b/Firmware/LUFA/Drivers/USB/Class/Common/MIDIClassCommon.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Common/MassStorageClassCommon.h b/Firmware/LUFA/Drivers/USB/Class/Common/MassStorageClassCommon.h index 8a12f31..d2ea37a 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Common/MassStorageClassCommon.h +++ b/Firmware/LUFA/Drivers/USB/Class/Common/MassStorageClassCommon.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Common/PrinterClassCommon.h b/Firmware/LUFA/Drivers/USB/Class/Common/PrinterClassCommon.h index 1edd1dd..2db830e 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Common/PrinterClassCommon.h +++ b/Firmware/LUFA/Drivers/USB/Class/Common/PrinterClassCommon.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Common/RNDISClassCommon.h b/Firmware/LUFA/Drivers/USB/Class/Common/RNDISClassCommon.h index 640745e..ade1af0 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Common/RNDISClassCommon.h +++ b/Firmware/LUFA/Drivers/USB/Class/Common/RNDISClassCommon.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Common/StillImageClassCommon.h b/Firmware/LUFA/Drivers/USB/Class/Common/StillImageClassCommon.h index 09a9eab..7608b18 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Common/StillImageClassCommon.h +++ b/Firmware/LUFA/Drivers/USB/Class/Common/StillImageClassCommon.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c b/Firmware/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c index f862ba7..08cbeb7 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c +++ b/Firmware/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h b/Firmware/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h index 6cdf4db..ca63511 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h +++ b/Firmware/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c b/Firmware/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c index f4e74cf..867548c 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c +++ b/Firmware/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c @@ -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 @@ -155,6 +155,16 @@ uint8_t CDC_Device_SendString(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo return Endpoint_Write_Stream_LE(String, strlen(String), NULL); } +uint8_t CDC_Device_SendString_P(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, + const char* const String) +{ + if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS)) + return ENDPOINT_RWSTREAM_DeviceDisconnected; + + Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpoint.Address); + return Endpoint_Write_PStream_LE(String, strlen_P(String), NULL); +} + uint8_t CDC_Device_SendData(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, const void* const Buffer, const uint16_t Length) @@ -166,6 +176,17 @@ uint8_t CDC_Device_SendData(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, return Endpoint_Write_Stream_LE(Buffer, Length, NULL); } +uint8_t CDC_Device_SendData_P(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, + const void* const Buffer, + const uint16_t Length) +{ + if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS)) + return ENDPOINT_RWSTREAM_DeviceDisconnected; + + Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpoint.Address); + return Endpoint_Write_PStream_LE(Buffer, Length, NULL); +} + uint8_t CDC_Device_SendByte(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, const uint8_t Data) { diff --git a/Firmware/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h b/Firmware/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h index 05c0fdd..9d5c4e5 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h +++ b/Firmware/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h @@ -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 @@ -200,6 +200,24 @@ const void* const Buffer, const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); + /** Sends a given data buffer from PROGMEM space to the attached USB host, if connected. If a host is not connected when the + * function is called, the string is discarded. Bytes will be queued for transmission to the host until either the endpoint + * bank becomes full, or the \ref CDC_Device_Flush() function is called to flush the pending data to the host. This allows + * for multiple bytes to be packed into a single endpoint packet, increasing data throughput. + * + * \pre This function must only be called when the Device state machine is in the \ref DEVICE_STATE_Configured state or + * the call will fail. + * + * \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state. + * \param[in] Buffer Pointer to a buffer containing the data to send to the device. + * \param[in] Length Length of the data to send to the host. + * + * \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum. + */ + uint8_t CDC_Device_SendData_P(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, + const void* const Buffer, + const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); + /** Sends a given null terminated string to the attached USB host, if connected. If a host is not connected when * the function is called, the string is discarded. Bytes will be queued for transmission to the host until either * the endpoint bank becomes full, or the \ref CDC_Device_Flush() function is called to flush the pending data to @@ -216,6 +234,22 @@ uint8_t CDC_Device_SendString(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, const char* const String) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); + /** Sends a given null terminated string from PROGMEM space to the attached USB host, if connected. If a host is not connected + * when the function is called, the string is discarded. Bytes will be queued for transmission to the host until either + * the endpoint bank becomes full, or the \ref CDC_Device_Flush() function is called to flush the pending data to + * the host. This allows for multiple bytes to be packed into a single endpoint packet, increasing data throughput. + * + * \pre This function must only be called when the Device state machine is in the \ref DEVICE_STATE_Configured state or + * the call will fail. + * + * \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state. + * \param[in] String Pointer to the null terminated string to send to the host. + * + * \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum. + */ + uint8_t CDC_Device_SendString_P(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, + const char* const String) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); + /** Sends a given byte to the attached USB host, if connected. If a host is not connected when the function is called, the * byte is discarded. Bytes will be queued for transmission to the host until either the endpoint bank becomes full, or the * \ref CDC_Device_Flush() function is called to flush the pending data to the host. This allows for multiple bytes to be diff --git a/Firmware/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c b/Firmware/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c index 03a745c..a8a6e8b 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c +++ b/Firmware/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Device/HIDClassDevice.h b/Firmware/LUFA/Drivers/USB/Class/Device/HIDClassDevice.h index f373cf0..ae628c8 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Device/HIDClassDevice.h +++ b/Firmware/LUFA/Drivers/USB/Class/Device/HIDClassDevice.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.c b/Firmware/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.c index b002525..a35c408 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.c +++ b/Firmware/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.h b/Firmware/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.h index 70eb442..ee2efd7 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.h +++ b/Firmware/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c b/Firmware/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c index d090796..1ea30f7 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c +++ b/Firmware/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.h b/Firmware/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.h index 5132213..12b54f8 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.h +++ b/Firmware/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.c b/Firmware/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.c index fd3454b..7209c45 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.c +++ b/Firmware/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.h b/Firmware/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.h index d9d9644..802c591 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.h +++ b/Firmware/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.c b/Firmware/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.c index 6ee73c5..45293b1 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.c +++ b/Firmware/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.h b/Firmware/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.h index 2821d7d..761bc27 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.h +++ b/Firmware/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/HIDClass.h b/Firmware/LUFA/Drivers/USB/Class/HIDClass.h index d2eea75..158eb25 100644 --- a/Firmware/LUFA/Drivers/USB/Class/HIDClass.h +++ b/Firmware/LUFA/Drivers/USB/Class/HIDClass.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c b/Firmware/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c index ac8d5dc..ea89033 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c +++ b/Firmware/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.h b/Firmware/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.h index 0476f2e..f4f04e4 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.h +++ b/Firmware/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Host/AudioClassHost.c b/Firmware/LUFA/Drivers/USB/Class/Host/AudioClassHost.c index 3b5bceb..9f1a6dc 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Host/AudioClassHost.c +++ b/Firmware/LUFA/Drivers/USB/Class/Host/AudioClassHost.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Host/AudioClassHost.h b/Firmware/LUFA/Drivers/USB/Class/Host/AudioClassHost.h index b00bb5f..f1f4207 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Host/AudioClassHost.h +++ b/Firmware/LUFA/Drivers/USB/Class/Host/AudioClassHost.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Host/CDCClassHost.c b/Firmware/LUFA/Drivers/USB/Class/Host/CDCClassHost.c index b32a237..af9ed96 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Host/CDCClassHost.c +++ b/Firmware/LUFA/Drivers/USB/Class/Host/CDCClassHost.c @@ -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 @@ -294,6 +294,24 @@ uint8_t CDC_Host_SendData(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, return ErrorCode; } +uint8_t CDC_Host_SendData_P(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, + const void* const Buffer, + const uint16_t Length) +{ + if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive)) + return PIPE_READYWAIT_DeviceDisconnected; + + uint8_t ErrorCode; + + Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipe.Address); + + Pipe_Unfreeze(); + ErrorCode = Pipe_Write_PStream_LE(Buffer, Length, NULL); + Pipe_Freeze(); + + return ErrorCode; +} + uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, const char* const String) { @@ -311,6 +329,23 @@ uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, return ErrorCode; } +uint8_t CDC_Host_SendString_P(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, + const char* const String) +{ + if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive)) + return PIPE_READYWAIT_DeviceDisconnected; + + uint8_t ErrorCode; + + Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipe.Address); + + Pipe_Unfreeze(); + ErrorCode = Pipe_Write_PStream_LE(String, strlen_P(String), NULL); + Pipe_Freeze(); + + return ErrorCode; +} + uint8_t CDC_Host_SendByte(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, const uint8_t Data) { diff --git a/Firmware/LUFA/Drivers/USB/Class/Host/CDCClassHost.h b/Firmware/LUFA/Drivers/USB/Class/Host/CDCClassHost.h index aeee23e..86ce6de 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Host/CDCClassHost.h +++ b/Firmware/LUFA/Drivers/USB/Class/Host/CDCClassHost.h @@ -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 @@ -201,6 +201,24 @@ const void* const Buffer, const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1); + /** Sends a given data buffer from PROGMEM space to the attached USB device, if connected. If a device is not connected when the + * function is called, the string is discarded. Bytes will be queued for transmission to the host until either the pipe + * bank becomes full, or the \ref CDC_Host_Flush() function is called to flush the pending data to the device. This allows + * for multiple bytes to be packed into a single pipe packet, increasing data throughput. + * + * \pre This function must only be called when the Host state machine is in the \ref HOST_STATE_Configured state or + * the call will fail. + * + * \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state. + * \param[in] Buffer Pointer to a buffer containing the data to send to the device. + * \param[in] Length Length of the data to send to the host. + * + * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. + */ + uint8_t CDC_Host_SendData_P(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, + const void* const Buffer, + const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1); + /** Sends a given null-terminated string to the attached USB device, if connected. If a device is not connected when the * function is called, the string is discarded. Bytes will be queued for transmission to the device until either the pipe * bank becomes full, or the \ref CDC_Host_Flush() function is called to flush the pending data to the device. This allows @@ -217,6 +235,22 @@ uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, const char* const String) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); + /** Sends a given null terminated string from PROGMEM space to the attached USB device, if connected. If a device is not connected + * when the function is called, the string is discarded. Bytes will be queued for transmission to the device until either + * the pipe bank becomes full, or the \ref CDC_Host_Flush() function is called to flush the pending data to + * the device. This allows for multiple bytes to be packed into a single pipe packet, increasing data throughput. + * + * \pre This function must only be called when the Host state machine is in the \ref HOST_STATE_Configured state or + * the call will fail. + * + * \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state. + * \param[in] String Pointer to the null terminated string to send to the host. + * + * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. + */ + uint8_t CDC_Host_SendString_P(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, + const char* const String) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); + /** Sends a given byte to the attached USB device, if connected. If a device is not connected when the function is called, the * byte is discarded. Bytes will be queued for transmission to the device until either the pipe bank becomes full, or the * \ref CDC_Host_Flush() function is called to flush the pending data to the host. This allows for multiple bytes to be diff --git a/Firmware/LUFA/Drivers/USB/Class/Host/HIDClassHost.c b/Firmware/LUFA/Drivers/USB/Class/Host/HIDClassHost.c index b43435d..32591ff 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Host/HIDClassHost.c +++ b/Firmware/LUFA/Drivers/USB/Class/Host/HIDClassHost.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Host/HIDClassHost.h b/Firmware/LUFA/Drivers/USB/Class/Host/HIDClassHost.h index 703b698..73b5abb 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Host/HIDClassHost.h +++ b/Firmware/LUFA/Drivers/USB/Class/Host/HIDClassHost.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c b/Firmware/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c index 8b898cb..635148f 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c +++ b/Firmware/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Host/MIDIClassHost.h b/Firmware/LUFA/Drivers/USB/Class/Host/MIDIClassHost.h index 7624f8e..9cae21a 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Host/MIDIClassHost.h +++ b/Firmware/LUFA/Drivers/USB/Class/Host/MIDIClassHost.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.c b/Firmware/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.c index ac448a5..f7c5a6a 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.c +++ b/Firmware/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.h b/Firmware/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.h index 6e55807..348050f 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.h +++ b/Firmware/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Host/PrinterClassHost.c b/Firmware/LUFA/Drivers/USB/Class/Host/PrinterClassHost.c index fd32e1c..8a04d0a 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Host/PrinterClassHost.c +++ b/Firmware/LUFA/Drivers/USB/Class/Host/PrinterClassHost.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Host/PrinterClassHost.h b/Firmware/LUFA/Drivers/USB/Class/Host/PrinterClassHost.h index 8089aa5..511dab4 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Host/PrinterClassHost.h +++ b/Firmware/LUFA/Drivers/USB/Class/Host/PrinterClassHost.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c b/Firmware/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c index 3ed51c8..6fb09fd 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c +++ b/Firmware/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Host/RNDISClassHost.h b/Firmware/LUFA/Drivers/USB/Class/Host/RNDISClassHost.h index 79334b4..bddbc24 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Host/RNDISClassHost.h +++ b/Firmware/LUFA/Drivers/USB/Class/Host/RNDISClassHost.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Host/StillImageClassHost.c b/Firmware/LUFA/Drivers/USB/Class/Host/StillImageClassHost.c index 24a6308..ef33d9b 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Host/StillImageClassHost.c +++ b/Firmware/LUFA/Drivers/USB/Class/Host/StillImageClassHost.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/Host/StillImageClassHost.h b/Firmware/LUFA/Drivers/USB/Class/Host/StillImageClassHost.h index f9f41ad..ababdb0 100644 --- a/Firmware/LUFA/Drivers/USB/Class/Host/StillImageClassHost.h +++ b/Firmware/LUFA/Drivers/USB/Class/Host/StillImageClassHost.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/MIDIClass.h b/Firmware/LUFA/Drivers/USB/Class/MIDIClass.h index 7e6ba1c..a35ae13 100644 --- a/Firmware/LUFA/Drivers/USB/Class/MIDIClass.h +++ b/Firmware/LUFA/Drivers/USB/Class/MIDIClass.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/MassStorageClass.h b/Firmware/LUFA/Drivers/USB/Class/MassStorageClass.h index 79a0521..fa41fbf 100644 --- a/Firmware/LUFA/Drivers/USB/Class/MassStorageClass.h +++ b/Firmware/LUFA/Drivers/USB/Class/MassStorageClass.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/PrinterClass.h b/Firmware/LUFA/Drivers/USB/Class/PrinterClass.h index 91121b5..78ad520 100644 --- a/Firmware/LUFA/Drivers/USB/Class/PrinterClass.h +++ b/Firmware/LUFA/Drivers/USB/Class/PrinterClass.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/RNDISClass.h b/Firmware/LUFA/Drivers/USB/Class/RNDISClass.h index 1555f0d..07b4f56 100644 --- a/Firmware/LUFA/Drivers/USB/Class/RNDISClass.h +++ b/Firmware/LUFA/Drivers/USB/Class/RNDISClass.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Class/StillImageClass.h b/Firmware/LUFA/Drivers/USB/Class/StillImageClass.h index f2ec37b..7cb8b4f 100644 --- a/Firmware/LUFA/Drivers/USB/Class/StillImageClass.h +++ b/Firmware/LUFA/Drivers/USB/Class/StillImageClass.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.c b/Firmware/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.c index d23e7b8..f972b0b 100644 --- a/Firmware/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.c +++ b/Firmware/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h b/Firmware/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h index 5efffe7..69f9be5 100644 --- a/Firmware/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h +++ b/Firmware/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.c b/Firmware/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.c index 5782824..8ffae15 100644 --- a/Firmware/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.c +++ b/Firmware/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.h b/Firmware/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.h index 2032789..80e78df 100644 --- a/Firmware/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.h +++ b/Firmware/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.c b/Firmware/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.c index f5d2034..92cf836 100644 --- a/Firmware/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.c +++ b/Firmware/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.h b/Firmware/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.h index 1632d93..6d83752 100644 --- a/Firmware/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.h +++ b/Firmware/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c b/Firmware/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c index 4e38c75..cbb7735 100644 --- a/Firmware/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c +++ b/Firmware/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.h b/Firmware/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.h index f0ffa5a..7a48e31 100644 --- a/Firmware/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.h +++ b/Firmware/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/AVR8/OTG_AVR8.h b/Firmware/LUFA/Drivers/USB/Core/AVR8/OTG_AVR8.h index c2e8496..74c70cc 100644 --- a/Firmware/LUFA/Drivers/USB/Core/AVR8/OTG_AVR8.h +++ b/Firmware/LUFA/Drivers/USB/Core/AVR8/OTG_AVR8.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.c b/Firmware/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.c index 47169b3..7b17d45 100644 --- a/Firmware/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.c +++ b/Firmware/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.h b/Firmware/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.h index 264dab5..ca63bdf 100644 --- a/Firmware/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.h +++ b/Firmware/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c b/Firmware/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c index fc99ae4..20239d0 100644 --- a/Firmware/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c +++ b/Firmware/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.h b/Firmware/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.h index bac324f..3521efb 100644 --- a/Firmware/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.h +++ b/Firmware/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_Control_R.c b/Firmware/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_Control_R.c index 59c620a..f6c4beb 100644 --- a/Firmware/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_Control_R.c +++ b/Firmware/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_Control_R.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_Control_W.c b/Firmware/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_Control_W.c index 9888700..922b58e 100644 --- a/Firmware/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_Control_W.c +++ b/Firmware/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_Control_W.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_RW.c b/Firmware/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_RW.c index d51afdf..e55e592 100644 --- a/Firmware/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_RW.c +++ b/Firmware/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_RW.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/AVR8/Template/Template_Pipe_RW.c b/Firmware/LUFA/Drivers/USB/Core/AVR8/Template/Template_Pipe_RW.c index 2685c9b..bb2a57f 100644 --- a/Firmware/LUFA/Drivers/USB/Core/AVR8/Template/Template_Pipe_RW.c +++ b/Firmware/LUFA/Drivers/USB/Core/AVR8/Template/Template_Pipe_RW.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c b/Firmware/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c index 71c5f91..92532ab 100644 --- a/Firmware/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c +++ b/Firmware/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.h b/Firmware/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.h index de34f42..1b6e2ef 100644 --- a/Firmware/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.h +++ b/Firmware/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.c b/Firmware/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.c index 7efaea6..fac4fb4 100644 --- a/Firmware/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.c +++ b/Firmware/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.h b/Firmware/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.h index e6f5ff9..1eeb019 100644 --- a/Firmware/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.h +++ b/Firmware/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/ConfigDescriptors.c b/Firmware/LUFA/Drivers/USB/Core/ConfigDescriptors.c index da6812a..d540bcf 100644 --- a/Firmware/LUFA/Drivers/USB/Core/ConfigDescriptors.c +++ b/Firmware/LUFA/Drivers/USB/Core/ConfigDescriptors.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/ConfigDescriptors.h b/Firmware/LUFA/Drivers/USB/Core/ConfigDescriptors.h index b4a9788..5355ecf 100644 --- a/Firmware/LUFA/Drivers/USB/Core/ConfigDescriptors.h +++ b/Firmware/LUFA/Drivers/USB/Core/ConfigDescriptors.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/Device.h b/Firmware/LUFA/Drivers/USB/Core/Device.h index 10d739f..81b0e17 100644 --- a/Firmware/LUFA/Drivers/USB/Core/Device.h +++ b/Firmware/LUFA/Drivers/USB/Core/Device.h @@ -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 @@ -131,7 +131,7 @@ * \return Size in bytes of the descriptor if it exists, zero or \ref NO_DESCRIPTOR otherwise. */ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, - const uint8_t wIndex, + const uint16_t wIndex, const void** const DescriptorAddress #if (defined(ARCH_HAS_MULTI_ADDRESS_SPACE) || defined(__DOXYGEN__)) && \ !(defined(USE_FLASH_DESCRIPTORS) || defined(USE_EEPROM_DESCRIPTORS) || defined(USE_RAM_DESCRIPTORS)) diff --git a/Firmware/LUFA/Drivers/USB/Core/DeviceStandardReq.c b/Firmware/LUFA/Drivers/USB/Core/DeviceStandardReq.c index adf615a..feb092d 100644 --- a/Firmware/LUFA/Drivers/USB/Core/DeviceStandardReq.c +++ b/Firmware/LUFA/Drivers/USB/Core/DeviceStandardReq.c @@ -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 @@ -152,8 +152,8 @@ static void USB_Device_SetConfiguration(void) #define MemoryAddressSpace MEMSPACE_FLASH #elif defined(USE_EEPROM_DESCRIPTORS) #define MemoryAddressSpace MEMSPACE_EEPROM - #elif defined(USE_SRAM_DESCRIPTORS) - #define MemoryAddressSpace MEMSPACE_SRAM + #elif defined(USE_RAM_DESCRIPTORS) + #define MemoryAddressSpace MEMSPACE_RAM #else uint8_t MemoryAddressSpace; #endif @@ -292,6 +292,7 @@ static void USB_Device_GetStatus(void) switch (USB_ControlRequest.bmRequestType) { case (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE): + { #if !defined(NO_DEVICE_SELF_POWER) if (USB_Device_CurrentlySelfPowered) CurrentStatus |= FEATURE_SELFPOWERED_ENABLED; @@ -302,9 +303,16 @@ static void USB_Device_GetStatus(void) CurrentStatus |= FEATURE_REMOTE_WAKEUP_ENABLED; #endif break; + } case (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_ENDPOINT): + { #if !defined(CONTROL_ONLY_DEVICE) - Endpoint_SelectEndpoint((uint8_t)USB_ControlRequest.wIndex & ENDPOINT_EPNUM_MASK); + uint8_t EndpointIndex = ((uint8_t)USB_ControlRequest.wIndex & ENDPOINT_EPNUM_MASK); + + if (EndpointIndex >= ENDPOINT_TOTAL_ENDPOINTS) + return; + + Endpoint_SelectEndpoint(EndpointIndex); CurrentStatus = Endpoint_IsStalled(); @@ -312,6 +320,7 @@ static void USB_Device_GetStatus(void) #endif break; + } default: return; } @@ -330,20 +339,23 @@ static void USB_Device_ClearSetFeature(void) { #if !defined(NO_DEVICE_REMOTE_WAKEUP) case REQREC_DEVICE: + { if ((uint8_t)USB_ControlRequest.wValue == FEATURE_SEL_DeviceRemoteWakeup) USB_Device_RemoteWakeupEnabled = (USB_ControlRequest.bRequest == REQ_SetFeature); else return; break; + } #endif #if !defined(CONTROL_ONLY_DEVICE) case REQREC_ENDPOINT: + { if ((uint8_t)USB_ControlRequest.wValue == FEATURE_SEL_EndpointHalt) { uint8_t EndpointIndex = ((uint8_t)USB_ControlRequest.wIndex & ENDPOINT_EPNUM_MASK); - if (EndpointIndex == ENDPOINT_CONTROLEP) + if (EndpointIndex == ENDPOINT_CONTROLEP || EndpointIndex >= ENDPOINT_TOTAL_ENDPOINTS) return; Endpoint_SelectEndpoint(EndpointIndex); @@ -364,6 +376,7 @@ static void USB_Device_ClearSetFeature(void) } break; + } #endif default: return; diff --git a/Firmware/LUFA/Drivers/USB/Core/DeviceStandardReq.h b/Firmware/LUFA/Drivers/USB/Core/DeviceStandardReq.h index 396e205..14badcd 100644 --- a/Firmware/LUFA/Drivers/USB/Core/DeviceStandardReq.h +++ b/Firmware/LUFA/Drivers/USB/Core/DeviceStandardReq.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/Endpoint.h b/Firmware/LUFA/Drivers/USB/Core/Endpoint.h index bf41376..b577f63 100644 --- a/Firmware/LUFA/Drivers/USB/Core/Endpoint.h +++ b/Firmware/LUFA/Drivers/USB/Core/Endpoint.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/EndpointStream.h b/Firmware/LUFA/Drivers/USB/Core/EndpointStream.h index 5675c32..156d155 100644 --- a/Firmware/LUFA/Drivers/USB/Core/EndpointStream.h +++ b/Firmware/LUFA/Drivers/USB/Core/EndpointStream.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/Events.c b/Firmware/LUFA/Drivers/USB/Core/Events.c index a63b002..1865579 100644 --- a/Firmware/LUFA/Drivers/USB/Core/Events.c +++ b/Firmware/LUFA/Drivers/USB/Core/Events.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/Events.h b/Firmware/LUFA/Drivers/USB/Core/Events.h index 9c85112..57fd0d9 100644 --- a/Firmware/LUFA/Drivers/USB/Core/Events.h +++ b/Firmware/LUFA/Drivers/USB/Core/Events.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/Host.h b/Firmware/LUFA/Drivers/USB/Core/Host.h index 6146cc5..50410b2 100644 --- a/Firmware/LUFA/Drivers/USB/Core/Host.h +++ b/Firmware/LUFA/Drivers/USB/Core/Host.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/HostStandardReq.c b/Firmware/LUFA/Drivers/USB/Core/HostStandardReq.c index 4a21ce7..42a934d 100644 --- a/Firmware/LUFA/Drivers/USB/Core/HostStandardReq.c +++ b/Firmware/LUFA/Drivers/USB/Core/HostStandardReq.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/HostStandardReq.h b/Firmware/LUFA/Drivers/USB/Core/HostStandardReq.h index bd67bcb..6654269 100644 --- a/Firmware/LUFA/Drivers/USB/Core/HostStandardReq.h +++ b/Firmware/LUFA/Drivers/USB/Core/HostStandardReq.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/OTG.h b/Firmware/LUFA/Drivers/USB/Core/OTG.h index 58d47ba..6293e4c 100644 --- a/Firmware/LUFA/Drivers/USB/Core/OTG.h +++ b/Firmware/LUFA/Drivers/USB/Core/OTG.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/Pipe.h b/Firmware/LUFA/Drivers/USB/Core/Pipe.h index ca3fdbe..0697078 100644 --- a/Firmware/LUFA/Drivers/USB/Core/Pipe.h +++ b/Firmware/LUFA/Drivers/USB/Core/Pipe.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/PipeStream.h b/Firmware/LUFA/Drivers/USB/Core/PipeStream.h index 2399696..8785302 100644 --- a/Firmware/LUFA/Drivers/USB/Core/PipeStream.h +++ b/Firmware/LUFA/Drivers/USB/Core/PipeStream.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/StdDescriptors.h b/Firmware/LUFA/Drivers/USB/Core/StdDescriptors.h index e0a1a37..381c02c 100644 --- a/Firmware/LUFA/Drivers/USB/Core/StdDescriptors.h +++ b/Firmware/LUFA/Drivers/USB/Core/StdDescriptors.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/StdRequestType.h b/Firmware/LUFA/Drivers/USB/Core/StdRequestType.h index b2506cd..7297806 100644 --- a/Firmware/LUFA/Drivers/USB/Core/StdRequestType.h +++ b/Firmware/LUFA/Drivers/USB/Core/StdRequestType.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/UC3/Device_UC3.c b/Firmware/LUFA/Drivers/USB/Core/UC3/Device_UC3.c index 6f6de3f..3aa1433 100644 --- a/Firmware/LUFA/Drivers/USB/Core/UC3/Device_UC3.c +++ b/Firmware/LUFA/Drivers/USB/Core/UC3/Device_UC3.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/UC3/Device_UC3.h b/Firmware/LUFA/Drivers/USB/Core/UC3/Device_UC3.h index 5579ea0..fd6dbde 100644 --- a/Firmware/LUFA/Drivers/USB/Core/UC3/Device_UC3.h +++ b/Firmware/LUFA/Drivers/USB/Core/UC3/Device_UC3.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/UC3/EndpointStream_UC3.c b/Firmware/LUFA/Drivers/USB/Core/UC3/EndpointStream_UC3.c index 6e98629..04f6e97 100644 --- a/Firmware/LUFA/Drivers/USB/Core/UC3/EndpointStream_UC3.c +++ b/Firmware/LUFA/Drivers/USB/Core/UC3/EndpointStream_UC3.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/UC3/EndpointStream_UC3.h b/Firmware/LUFA/Drivers/USB/Core/UC3/EndpointStream_UC3.h index 831c714..8b1c10e 100644 --- a/Firmware/LUFA/Drivers/USB/Core/UC3/EndpointStream_UC3.h +++ b/Firmware/LUFA/Drivers/USB/Core/UC3/EndpointStream_UC3.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.c b/Firmware/LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.c index 5dce488..7e24672 100644 --- a/Firmware/LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.c +++ b/Firmware/LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.h b/Firmware/LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.h index cf35d2b..32d6a9b 100644 --- a/Firmware/LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.h +++ b/Firmware/LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/UC3/Host_UC3.c b/Firmware/LUFA/Drivers/USB/Core/UC3/Host_UC3.c index 7780752..2c182ab 100644 --- a/Firmware/LUFA/Drivers/USB/Core/UC3/Host_UC3.c +++ b/Firmware/LUFA/Drivers/USB/Core/UC3/Host_UC3.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/UC3/Host_UC3.h b/Firmware/LUFA/Drivers/USB/Core/UC3/Host_UC3.h index eb803b0..5338f72 100644 --- a/Firmware/LUFA/Drivers/USB/Core/UC3/Host_UC3.h +++ b/Firmware/LUFA/Drivers/USB/Core/UC3/Host_UC3.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/UC3/PipeStream_UC3.c b/Firmware/LUFA/Drivers/USB/Core/UC3/PipeStream_UC3.c index 7dfe448..27426ad 100644 --- a/Firmware/LUFA/Drivers/USB/Core/UC3/PipeStream_UC3.c +++ b/Firmware/LUFA/Drivers/USB/Core/UC3/PipeStream_UC3.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/UC3/PipeStream_UC3.h b/Firmware/LUFA/Drivers/USB/Core/UC3/PipeStream_UC3.h index 4dd79c9..cc34442 100644 --- a/Firmware/LUFA/Drivers/USB/Core/UC3/PipeStream_UC3.h +++ b/Firmware/LUFA/Drivers/USB/Core/UC3/PipeStream_UC3.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.c b/Firmware/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.c index a24c7b1..73cf360 100644 --- a/Firmware/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.c +++ b/Firmware/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.h b/Firmware/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.h index 1a0ada8..12e0dcd 100644 --- a/Firmware/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.h +++ b/Firmware/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_Control_R.c b/Firmware/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_Control_R.c index 59c620a..f6c4beb 100644 --- a/Firmware/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_Control_R.c +++ b/Firmware/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_Control_R.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_Control_W.c b/Firmware/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_Control_W.c index 9888700..922b58e 100644 --- a/Firmware/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_Control_W.c +++ b/Firmware/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_Control_W.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_RW.c b/Firmware/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_RW.c index d51afdf..e55e592 100644 --- a/Firmware/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_RW.c +++ b/Firmware/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_RW.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/UC3/Template/Template_Pipe_RW.c b/Firmware/LUFA/Drivers/USB/Core/UC3/Template/Template_Pipe_RW.c index 2685c9b..bb2a57f 100644 --- a/Firmware/LUFA/Drivers/USB/Core/UC3/Template/Template_Pipe_RW.c +++ b/Firmware/LUFA/Drivers/USB/Core/UC3/Template/Template_Pipe_RW.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/UC3/USBController_UC3.c b/Firmware/LUFA/Drivers/USB/Core/UC3/USBController_UC3.c index fda0ddc..2b1e9ac 100644 --- a/Firmware/LUFA/Drivers/USB/Core/UC3/USBController_UC3.c +++ b/Firmware/LUFA/Drivers/USB/Core/UC3/USBController_UC3.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/UC3/USBController_UC3.h b/Firmware/LUFA/Drivers/USB/Core/UC3/USBController_UC3.h index 2e82458..32c2f6e 100644 --- a/Firmware/LUFA/Drivers/USB/Core/UC3/USBController_UC3.h +++ b/Firmware/LUFA/Drivers/USB/Core/UC3/USBController_UC3.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c b/Firmware/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c index 83ada8c..3b3958a 100644 --- a/Firmware/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c +++ b/Firmware/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.h b/Firmware/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.h index ddd5389..e2f67bf 100644 --- a/Firmware/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.h +++ b/Firmware/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/USBController.h b/Firmware/LUFA/Drivers/USB/Core/USBController.h index c1d74c3..5980a37 100644 --- a/Firmware/LUFA/Drivers/USB/Core/USBController.h +++ b/Firmware/LUFA/Drivers/USB/Core/USBController.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/USBInterrupt.h b/Firmware/LUFA/Drivers/USB/Core/USBInterrupt.h index 3dcfd5f..b00ef7b 100644 --- a/Firmware/LUFA/Drivers/USB/Core/USBInterrupt.h +++ b/Firmware/LUFA/Drivers/USB/Core/USBInterrupt.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/USBMode.h b/Firmware/LUFA/Drivers/USB/Core/USBMode.h index 09cf307..2044f89 100644 --- a/Firmware/LUFA/Drivers/USB/Core/USBMode.h +++ b/Firmware/LUFA/Drivers/USB/Core/USBMode.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/USBTask.c b/Firmware/LUFA/Drivers/USB/Core/USBTask.c index 30a3cd6..329ff4a 100644 --- a/Firmware/LUFA/Drivers/USB/Core/USBTask.c +++ b/Firmware/LUFA/Drivers/USB/Core/USBTask.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/USBTask.h b/Firmware/LUFA/Drivers/USB/Core/USBTask.h index 7205ea1..77cee65 100644 --- a/Firmware/LUFA/Drivers/USB/Core/USBTask.h +++ b/Firmware/LUFA/Drivers/USB/Core/USBTask.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.c b/Firmware/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.c index 10c3279..470e128 100644 --- a/Firmware/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.c +++ b/Firmware/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h b/Firmware/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h index b203e10..759ff35 100644 --- a/Firmware/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h +++ b/Firmware/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/XMEGA/EndpointStream_XMEGA.c b/Firmware/LUFA/Drivers/USB/Core/XMEGA/EndpointStream_XMEGA.c index 421d717..6413281 100644 --- a/Firmware/LUFA/Drivers/USB/Core/XMEGA/EndpointStream_XMEGA.c +++ b/Firmware/LUFA/Drivers/USB/Core/XMEGA/EndpointStream_XMEGA.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/XMEGA/EndpointStream_XMEGA.h b/Firmware/LUFA/Drivers/USB/Core/XMEGA/EndpointStream_XMEGA.h index cba6537..3c094da 100644 --- a/Firmware/LUFA/Drivers/USB/Core/XMEGA/EndpointStream_XMEGA.h +++ b/Firmware/LUFA/Drivers/USB/Core/XMEGA/EndpointStream_XMEGA.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.c b/Firmware/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.c index 8155ecf..470f57e 100644 --- a/Firmware/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.c +++ b/Firmware/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h b/Firmware/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h index 42c476b..db7d840 100644 --- a/Firmware/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h +++ b/Firmware/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/XMEGA/Host_XMEGA.c b/Firmware/LUFA/Drivers/USB/Core/XMEGA/Host_XMEGA.c index c467733..b8b8c46 100644 --- a/Firmware/LUFA/Drivers/USB/Core/XMEGA/Host_XMEGA.c +++ b/Firmware/LUFA/Drivers/USB/Core/XMEGA/Host_XMEGA.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/XMEGA/PipeStream_XMEGA.c b/Firmware/LUFA/Drivers/USB/Core/XMEGA/PipeStream_XMEGA.c index c467733..b8b8c46 100644 --- a/Firmware/LUFA/Drivers/USB/Core/XMEGA/PipeStream_XMEGA.c +++ b/Firmware/LUFA/Drivers/USB/Core/XMEGA/PipeStream_XMEGA.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/XMEGA/Pipe_XMEGA.c b/Firmware/LUFA/Drivers/USB/Core/XMEGA/Pipe_XMEGA.c index 69f369e..bb92b1d 100644 --- a/Firmware/LUFA/Drivers/USB/Core/XMEGA/Pipe_XMEGA.c +++ b/Firmware/LUFA/Drivers/USB/Core/XMEGA/Pipe_XMEGA.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_Control_R.c b/Firmware/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_Control_R.c index 0bd3843..c923f31 100644 --- a/Firmware/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_Control_R.c +++ b/Firmware/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_Control_R.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_Control_W.c b/Firmware/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_Control_W.c index 703f253..b32de81 100644 --- a/Firmware/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_Control_W.c +++ b/Firmware/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_Control_W.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_RW.c b/Firmware/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_RW.c index d51afdf..e55e592 100644 --- a/Firmware/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_RW.c +++ b/Firmware/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_RW.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.c b/Firmware/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.c index 9958980..4eea57a 100644 --- a/Firmware/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.c +++ b/Firmware/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.h b/Firmware/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.h index 15d4eec..6bab03a 100644 --- a/Firmware/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.h +++ b/Firmware/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.c b/Firmware/LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.c index f03f3f2..a82dde0 100644 --- a/Firmware/LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.c +++ b/Firmware/LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.c @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.h b/Firmware/LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.h index e224e22..54ee7f1 100644 --- a/Firmware/LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.h +++ b/Firmware/LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.h @@ -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 diff --git a/Firmware/LUFA/Drivers/USB/USB.h b/Firmware/LUFA/Drivers/USB/USB.h index a8df26f..87c098c 100644 --- a/Firmware/LUFA/Drivers/USB/USB.h +++ b/Firmware/LUFA/Drivers/USB/USB.h @@ -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 diff --git a/Firmware/LUFA/License.txt b/Firmware/LUFA/License.txt index 8d4ad75..f89d606 100644 --- a/Firmware/LUFA/License.txt +++ b/Firmware/LUFA/License.txt @@ -1,5 +1,5 @@ LUFA Library - Copyright (C) Dean Camera, 2014. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org diff --git a/Firmware/LUFA/Platform/Platform.h b/Firmware/LUFA/Platform/Platform.h index a9eedeb..9997d79 100644 --- a/Firmware/LUFA/Platform/Platform.h +++ b/Firmware/LUFA/Platform/Platform.h @@ -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 diff --git a/Firmware/LUFA/Platform/UC3/ClockManagement.h b/Firmware/LUFA/Platform/UC3/ClockManagement.h index fb06262..5f286d5 100644 --- a/Firmware/LUFA/Platform/UC3/ClockManagement.h +++ b/Firmware/LUFA/Platform/UC3/ClockManagement.h @@ -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 diff --git a/Firmware/LUFA/Platform/UC3/Exception.S b/Firmware/LUFA/Platform/UC3/Exception.S index 3a5f240..59f16f1 100644 --- a/Firmware/LUFA/Platform/UC3/Exception.S +++ b/Firmware/LUFA/Platform/UC3/Exception.S @@ -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 diff --git a/Firmware/LUFA/Platform/UC3/InterruptManagement.c b/Firmware/LUFA/Platform/UC3/InterruptManagement.c index 80d193f..b99be24 100644 --- a/Firmware/LUFA/Platform/UC3/InterruptManagement.c +++ b/Firmware/LUFA/Platform/UC3/InterruptManagement.c @@ -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 diff --git a/Firmware/LUFA/Platform/UC3/InterruptManagement.h b/Firmware/LUFA/Platform/UC3/InterruptManagement.h index 90198cd..b051930 100644 --- a/Firmware/LUFA/Platform/UC3/InterruptManagement.h +++ b/Firmware/LUFA/Platform/UC3/InterruptManagement.h @@ -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 diff --git a/Firmware/LUFA/Platform/XMEGA/ClockManagement.h b/Firmware/LUFA/Platform/XMEGA/ClockManagement.h index 9edaa72..eb941d9 100644 --- a/Firmware/LUFA/Platform/XMEGA/ClockManagement.h +++ b/Firmware/LUFA/Platform/XMEGA/ClockManagement.h @@ -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 diff --git a/Firmware/LUFA/StudioIntegration/Docbook/mshelp/README.txt b/Firmware/LUFA/StudioIntegration/Docbook/mshelp/README.txt new file mode 100644 index 0000000..4f251cc --- /dev/null +++ b/Firmware/LUFA/StudioIntegration/Docbook/mshelp/README.txt @@ -0,0 +1,13 @@ +This is a modified/updated version of the Microsoft HV1 Docbook transform, written by Morten Engelhardt Olsen, + +Originally posted at http://sourceforge.net/p/docbook/feature-requests/461/, this has been further updated by Morten to make it compatible with more recent DocBook versions. + + --------------------------- +/ This documentation system \ +\ is udderly ridiculous! / + --------------------------- + \ ^__^ + \ (oo)\_______ + (__)\ )\/\ + ||----w | + || || diff --git a/Firmware/LUFA/StudioIntegration/Docbook/mshelp/docbook.xsl b/Firmware/LUFA/StudioIntegration/Docbook/mshelp/docbook.xsl new file mode 100644 index 0000000..03b81fe --- /dev/null +++ b/Firmware/LUFA/StudioIntegration/Docbook/mshelp/docbook.xsl @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Firmware/LUFA/StudioIntegration/Docbook/mshelp/hv1-common.xsl b/Firmware/LUFA/StudioIntegration/Docbook/mshelp/hv1-common.xsl new file mode 100644 index 0000000..b6f2610 --- /dev/null +++ b/Firmware/LUFA/StudioIntegration/Docbook/mshelp/hv1-common.xsl @@ -0,0 +1,664 @@ + + + + + + + + + + + + + + + + + + + + + + en-US + + + + + + + + + + + + + + + + + en-US + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ + + + + +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bk + + + + + + + + + + + + ar + + + + + + + + + + + + pr + + + + + + + + + + + + ch + + + + + + + + + + + + ap + + + + + + + + + + + + + + + + pt + + + + + + + + + + + + + + + + rn + + + + + + + + + + + + + + + re + + + + + + + + + + + + + + + + co + + + + + + + + s + + + + + + + + + + + + + + + + bi + + + + + + + + + + + + + + + + go + + + + + + + + + + + + + + + + ix + + + + + si + + + + + chunk-filename-error- + + + + + + + + + + + + + + + + + + + + + + + + + $product.name needs to be set to generate ms.help style links + + + + + $product.version needs to be set to generate ms.help style links + + + + + $product.locale needs to be set to generate ms.help style links + + + + ms.help?method=page&id= + + &product= + + &productVersion= + + &locale= + + + + # + + + + + + ms-xhelp:///?Id= + + + + + + + + + + + + + + preserve + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + : + + , + + + + + + + , + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/Firmware/LUFA/StudioIntegration/Docbook/placeholder.txt b/Firmware/LUFA/StudioIntegration/Docbook/placeholder.txt index dd69b7e..c017acf 100644 --- a/Firmware/LUFA/StudioIntegration/Docbook/placeholder.txt +++ b/Firmware/LUFA/StudioIntegration/Docbook/placeholder.txt @@ -1 +1 @@ -Copy the Docbook XSLT docbook-xsl-1.78.1 release contents into this directory (i.e. with the root Docbook files in the current folder). The Docbook releases can be found at http://sourceforge.net/projects/docbook/files/docbook-xsl/ . +Copy the Docbook XSLT docbook-xsl-1.78.1 release contents into this directory (i.e. with the root Docbook files in the current folder). The Docbook releases can be found at http://sourceforge.net/projects/docbook/files/docbook-xsl/ . diff --git a/Firmware/LUFA/StudioIntegration/HV1/helpcontentsetup.msha b/Firmware/LUFA/StudioIntegration/HV1/helpcontentsetup.msha index cb1c4b9..bd1d7ee 100644 --- a/Firmware/LUFA/StudioIntegration/HV1/helpcontentsetup.msha +++ b/Firmware/LUFA/StudioIntegration/HV1/helpcontentsetup.msha @@ -1,6 +1,6 @@ - + + @@ -25,19 +25,23 @@ - + + + + + + + + + - lufa_help_ - - .mshc + - lufa_help_ - - .mshc + diff --git a/Firmware/LUFA/StudioIntegration/HV1/lufa_hv1_transform.xslt b/Firmware/LUFA/StudioIntegration/HV1/lufa_hv1_transform.xslt index 8aa4a94..e7e2301 100644 --- a/Firmware/LUFA/StudioIntegration/HV1/lufa_hv1_transform.xslt +++ b/Firmware/LUFA/StudioIntegration/HV1/lufa_hv1_transform.xslt @@ -1,45 +1,45 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Firmware/LUFA/StudioIntegration/HV1/lufa_studio_help_styling.css b/Firmware/LUFA/StudioIntegration/HV1/lufa_studio_help_styling.css index 0b6ccbd..a4a025c 100644 --- a/Firmware/LUFA/StudioIntegration/HV1/lufa_studio_help_styling.css +++ b/Firmware/LUFA/StudioIntegration/HV1/lufa_studio_help_styling.css @@ -1,53 +1,53 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2013. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -.programlisting { - display: block; - margin-left: 15px; - padding: 10px; - background-color: #f4f4f4; - border: 1px solid #aaaaaa; - font-family: "Consolas", "Courier New", sans-serif; - } - - code { - background-color: #f4f4f4; - font-family: "Consolas", "Courier New", sans-serif; - } - -.note, .warning, .tip { - display: block; - margin-left: 15px; - padding-left: 10px; - padding-bottom: 5px; - background-color: #f4f4f4; - border: 1px solid #aaaaaa; -} - -table { - border: 1px solid #aaaaaa; - border-collapse: collapse; - margin-left: 15px; - font-size: 10pt; -} - -table thead { - background-color: #f4f4f4; -} - -table thead th { - padding: 5px; -} - -table tbody td { - padding: 5px; -} - -ul { - padding-left: 20px; -} +/* + LUFA Library + Copyright (C) Dean Camera, 2017. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +.programlisting { + display: block; + margin-left: 15px; + padding: 10px; + background-color: #f4f4f4; + border: 1px solid #aaaaaa; + font-family: "Consolas", "Courier New", sans-serif; + } + + code { + background-color: #f4f4f4; + font-family: "Consolas", "Courier New", sans-serif; + } + +.note, .warning, .tip { + display: block; + margin-left: 15px; + padding-left: 10px; + padding-bottom: 5px; + background-color: #f4f4f4; + border: 1px solid #aaaaaa; +} + +table { + border: 1px solid #aaaaaa; + border-collapse: collapse; + margin-left: 15px; + font-size: 10pt; +} + +table thead { + background-color: #f4f4f4; +} + +table thead th { + padding: 5px; +} + +table tbody td { + padding: 5px; +} + +ul { + padding-left: 20px; +} diff --git a/Firmware/LUFA/StudioIntegration/VSIX/LUFA.dll b/Firmware/LUFA/StudioIntegration/VSIX/LUFA.dll new file mode 100644 index 0000000..369c781 Binary files /dev/null and b/Firmware/LUFA/StudioIntegration/VSIX/LUFA.dll differ diff --git a/Firmware/LUFA/StudioIntegration/VSIX/[Content_Types].xml b/Firmware/LUFA/StudioIntegration/VSIX/[Content_Types].xml index 112d169..05ef8b6 100644 --- a/Firmware/LUFA/StudioIntegration/VSIX/[Content_Types].xml +++ b/Firmware/LUFA/StudioIntegration/VSIX/[Content_Types].xml @@ -1,13 +1,13 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/Firmware/LUFA/StudioIntegration/VSIX/asf-manifest.xml b/Firmware/LUFA/StudioIntegration/VSIX/asf-manifest.xml index bd96951..794fd68 100644 --- a/Firmware/LUFA/StudioIntegration/VSIX/asf-manifest.xml +++ b/Firmware/LUFA/StudioIntegration/VSIX/asf-manifest.xml @@ -1,18 +1,18 @@ - - - FourWalledCubicle - LUFA - Dean Camera - - True - - - - 0 - - - content.xml.cache - - - - + + + FourWalledCubicle + LUFA + Dean Camera + + True + + + + 0 + + + content.xml.cache + + + + diff --git a/Firmware/LUFA/StudioIntegration/VSIX/extension.vsixmanifest b/Firmware/LUFA/StudioIntegration/VSIX/extension.vsixmanifest index 8475017..f155618 100644 --- a/Firmware/LUFA/StudioIntegration/VSIX/extension.vsixmanifest +++ b/Firmware/LUFA/StudioIntegration/VSIX/extension.vsixmanifest @@ -1,33 +1,32 @@ - - - - - LUFA Library - Dean Camera - 0 - http://www.lufa-lib.org - LUFA, the Lightweight USB Framework for AVRs. - - License.txt - LUFA_thumb.png - LUFA.png - - - AtmelStudio - AtmelStudio - - - - 1033 - - false - - - - - - LUFA.pkgdef - helpcontentsetup.msha - asf-manifest.xml - - + + + + + LUFA Library + Dean Camera + 0 + http://www.lufa-lib.org + LUFA, the Lightweight USB Framework for AVRs. + + License.txt + LUFA_thumb.png + LUFA.png + + + AtmelStudio + + + + 1033 + + false + + + + + + LUFA.pkgdef + helpcontentsetup.msha + asf-manifest.xml + + diff --git a/Firmware/LUFA/StudioIntegration/VSIX/generate_caches.py b/Firmware/LUFA/StudioIntegration/VSIX/generate_caches.py index eb4b71e..ab787e8 100644 --- a/Firmware/LUFA/StudioIntegration/VSIX/generate_caches.py +++ b/Firmware/LUFA/StudioIntegration/VSIX/generate_caches.py @@ -1,38 +1,38 @@ -""" - LUFA Library - Copyright (C) Dean Camera, 2013. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -""" - -import sys -sys.path.append("ProjectGenerator") - - -def show_message(message): - print("[Project Generator] %s" % message) - sys.stdout.flush() - - -def main(lufa_root_path): - try: - from asf_avrstudio5_interface import PythonFacade - except ImportError: - print("Fatal Error: The ASF project generator is missing.") - return 1 - - p = PythonFacade(lufa_root_path) - - show_message("Checking database sanity...") - p.check_extension_database_sanity(lufa_root_path) - - show_message("Building cache files...") - p.generate_extension_cache_files(lufa_root_path) - - show_message("Cache files created.") - return 0 - - -if __name__ == "__main__": - sys.exit(main(sys.argv[1])) +""" + LUFA Library + Copyright (C) Dean Camera, 2017. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +""" + +import sys +sys.path.append("ProjectGenerator") + + +def show_message(message): + print("[Project Generator] %s" % message) + sys.stdout.flush() + + +def main(lufa_root_path): + try: + from asf_avrstudio5_interface import PythonFacade + except ImportError: + print("Fatal Error: The ASF project generator is missing.") + return 1 + + p = PythonFacade(lufa_root_path) + + show_message("Checking database sanity...") + p.check_extension_database_sanity(lufa_root_path) + + show_message("Building cache files...") + p.generate_extension_cache_files(lufa_root_path) + + show_message("Cache files created.") + return 0 + + +if __name__ == "__main__": + sys.exit(main(sys.argv[1])) diff --git a/Firmware/LUFA/StudioIntegration/VSIX/lufa_asfmanifest_transform.xslt b/Firmware/LUFA/StudioIntegration/VSIX/lufa_asfmanifest_transform.xslt index 8fc9841..00f552c 100644 --- a/Firmware/LUFA/StudioIntegration/VSIX/lufa_asfmanifest_transform.xslt +++ b/Firmware/LUFA/StudioIntegration/VSIX/lufa_asfmanifest_transform.xslt @@ -1,6 +1,6 @@ - - - - - - - - Lightweight USB Framework for AVRs (LUFA), a USB software stack/framework. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + Lightweight USB Framework for AVRs (LUFA), a USB software stack/framework. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Firmware/LUFA/StudioIntegration/lufa_common.xml b/Firmware/LUFA/StudioIntegration/lufa_common.xml index c2ef7af..b72f84c 100644 --- a/Firmware/LUFA/StudioIntegration/lufa_common.xml +++ b/Firmware/LUFA/StudioIntegration/lufa_common.xml @@ -1,34 +1,34 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Firmware/LUFA/StudioIntegration/lufa_drivers_board.xml b/Firmware/LUFA/StudioIntegration/lufa_drivers_board.xml index e150aa6..bd0359f 100644 --- a/Firmware/LUFA/StudioIntegration/lufa_drivers_board.xml +++ b/Firmware/LUFA/StudioIntegration/lufa_drivers_board.xml @@ -1,114 +1,114 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Firmware/LUFA/StudioIntegration/lufa_drivers_board_names.xml b/Firmware/LUFA/StudioIntegration/lufa_drivers_board_names.xml index ab7e03e..69a38c5 100644 --- a/Firmware/LUFA/StudioIntegration/lufa_drivers_board_names.xml +++ b/Firmware/LUFA/StudioIntegration/lufa_drivers_board_names.xml @@ -1,853 +1,853 @@ - - - - - - - - - Board hardware (LEDs, Buttons, etc.) drivers for the preconfigured LUFA boards. Note that only the boards - compatible with the currently selected device will be shown. - - To disable all hardware drivers silently, use NONE. To supply customer drivers, use USER (see manual). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + Board hardware (LEDs, Buttons, etc.) drivers for the preconfigured LUFA boards. Note that only the boards + compatible with the currently selected device will be shown. + + To disable all hardware drivers silently, use NONE. To supply customer drivers, use USER (see manual). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Firmware/LUFA/StudioIntegration/lufa_drivers_misc.xml b/Firmware/LUFA/StudioIntegration/lufa_drivers_misc.xml index 4311ae8..ee72f33 100644 --- a/Firmware/LUFA/StudioIntegration/lufa_drivers_misc.xml +++ b/Firmware/LUFA/StudioIntegration/lufa_drivers_misc.xml @@ -1,57 +1,57 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Firmware/LUFA/StudioIntegration/lufa_drivers_peripheral.xml b/Firmware/LUFA/StudioIntegration/lufa_drivers_peripheral.xml index 76ea516..b4eb874 100644 --- a/Firmware/LUFA/StudioIntegration/lufa_drivers_peripheral.xml +++ b/Firmware/LUFA/StudioIntegration/lufa_drivers_peripheral.xml @@ -1,198 +1,198 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Firmware/LUFA/StudioIntegration/lufa_drivers_usb.xml b/Firmware/LUFA/StudioIntegration/lufa_drivers_usb.xml index 263c411..f07aad6 100644 --- a/Firmware/LUFA/StudioIntegration/lufa_drivers_usb.xml +++ b/Firmware/LUFA/StudioIntegration/lufa_drivers_usb.xml @@ -1,32 +1,32 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Firmware/LUFA/StudioIntegration/lufa_drivers_usb_class.xml b/Firmware/LUFA/StudioIntegration/lufa_drivers_usb_class.xml index 67ab760..123d606 100644 --- a/Firmware/LUFA/StudioIntegration/lufa_drivers_usb_class.xml +++ b/Firmware/LUFA/StudioIntegration/lufa_drivers_usb_class.xml @@ -1,32 +1,32 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Firmware/LUFA/StudioIntegration/lufa_drivers_usb_class_android.xml b/Firmware/LUFA/StudioIntegration/lufa_drivers_usb_class_android.xml index 3451712..3ec06ed 100644 --- a/Firmware/LUFA/StudioIntegration/lufa_drivers_usb_class_android.xml +++ b/Firmware/LUFA/StudioIntegration/lufa_drivers_usb_class_android.xml @@ -1,6 +1,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Firmware/LUFA/StudioIntegration/lufa_drivers_usb_core_avr8.xml b/Firmware/LUFA/StudioIntegration/lufa_drivers_usb_core_avr8.xml index 4688f05..b2792cb 100644 --- a/Firmware/LUFA/StudioIntegration/lufa_drivers_usb_core_avr8.xml +++ b/Firmware/LUFA/StudioIntegration/lufa_drivers_usb_core_avr8.xml @@ -1,43 +1,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Firmware/LUFA/StudioIntegration/lufa_drivers_usb_core_uc3.xml b/Firmware/LUFA/StudioIntegration/lufa_drivers_usb_core_uc3.xml index 2e7185f..d815fca 100644 --- a/Firmware/LUFA/StudioIntegration/lufa_drivers_usb_core_uc3.xml +++ b/Firmware/LUFA/StudioIntegration/lufa_drivers_usb_core_uc3.xml @@ -1,42 +1,42 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Firmware/LUFA/StudioIntegration/lufa_drivers_usb_core_xmega.xml b/Firmware/LUFA/StudioIntegration/lufa_drivers_usb_core_xmega.xml index c79a0f5..364a0f3 100644 --- a/Firmware/LUFA/StudioIntegration/lufa_drivers_usb_core_xmega.xml +++ b/Firmware/LUFA/StudioIntegration/lufa_drivers_usb_core_xmega.xml @@ -1,36 +1,36 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Firmware/LUFA/StudioIntegration/lufa_platform.xml b/Firmware/LUFA/StudioIntegration/lufa_platform.xml index 4ee51f6..e20b718 100644 --- a/Firmware/LUFA/StudioIntegration/lufa_platform.xml +++ b/Firmware/LUFA/StudioIntegration/lufa_platform.xml @@ -1,60 +1,60 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Firmware/LUFA/StudioIntegration/lufa_platform_uc3.xml b/Firmware/LUFA/StudioIntegration/lufa_platform_uc3.xml index 98017b0..8c26d23 100644 --- a/Firmware/LUFA/StudioIntegration/lufa_platform_uc3.xml +++ b/Firmware/LUFA/StudioIntegration/lufa_platform_uc3.xml @@ -1,26 +1,26 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/Firmware/LUFA/StudioIntegration/lufa_platform_xmega.xml b/Firmware/LUFA/StudioIntegration/lufa_platform_xmega.xml index e613fe5..299c859 100644 --- a/Firmware/LUFA/StudioIntegration/lufa_platform_xmega.xml +++ b/Firmware/LUFA/StudioIntegration/lufa_platform_xmega.xml @@ -1,23 +1,23 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/Firmware/LUFA/StudioIntegration/lufa_toolchain.xml b/Firmware/LUFA/StudioIntegration/lufa_toolchain.xml index a76b6d0..66b416e 100644 --- a/Firmware/LUFA/StudioIntegration/lufa_toolchain.xml +++ b/Firmware/LUFA/StudioIntegration/lufa_toolchain.xml @@ -1,43 +1,45 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Firmware/LUFA/StudioIntegration/makefile b/Firmware/LUFA/StudioIntegration/makefile index 2649598..53fb470 100644 --- a/Firmware/LUFA/StudioIntegration/makefile +++ b/Firmware/LUFA/StudioIntegration/makefile @@ -1,6 +1,6 @@ # # LUFA Library -# Copyright (C) Dean Camera, 2013. +# Copyright (C) Dean Camera, 2017. # # dean [at] fourwalledcubicle [dot] com # www.lufa-lib.org @@ -10,16 +10,17 @@ # --------------------------------------- LUFA_ROOT := .. -LUFA_VERSION_NUM := $(shell grep LUFA_VERSION_STRING $(LUFA_ROOT)/Version.h | cut -d'"' -f2) +LUFA_VERSION_NUM := $(shell grep -e "\#define *LUFA_VERSION_STRING " $(LUFA_ROOT)/Version.h | cut -d'"' -f2) +LUFA_VERSION_TYPE := $(shell grep -e "\#define *LUFA_VERSION_RELEASE_TYPE " $(LUFA_ROOT)/Version.h) -ifneq ($(LUFA_VERSION_NUM),000000) +ifneq ($(findstring LUFA_VERSION_RELEASE_TYPE_DEVELOPMENT, $(LUFA_VERSION_TYPE)),LUFA_VERSION_RELEASE_TYPE_DEVELOPMENT) EXT_VERSION_NUM := $(shell date +"%y.%m.%d").$(LUFA_VERSION_NUM) EXT_VSIX_NAME := LUFA-RELEASE-$(LUFA_VERSION_NUM).vsix else EXT_VERSION_NUM := 0.$(shell date +"%y%m%d.%H%M%S") EXT_VSIX_NAME := LUFA-TESTING-$(shell date +"%y.%m.%d-%H.%M.%S").vsix - $(warning No LUFA version set - assuming a test version should be created.) + $(warning Development mode set - assuming a test version should be created.) endif DOXYGEN_TAG_FILE_XML := $(LUFA_ROOT)/Documentation/lufa_doc_tags.xml @@ -27,7 +28,7 @@ DOXYGEN_COMBINED_XML := $(LUFA_ROOT)/Documentation/xml/lufa_doc.xml TEMP_MANIFEST_XML := manifest.xml EXTENSION_OUTPUT_XML := $(LUFA_ROOT)/../extension.xml MODULE_OUTPUT_XML := $(LUFA_ROOT)/asf.xml -MSHELP_OUTPUT_XML := $(LUFA_ROOT)/../lufa_help_$(EXT_VERSION_NUM).mshc +MSHELP_OUTPUT_XML := $(LUFA_ROOT)/../lufa_help_$(subst .,_,$(EXT_VERSION_NUM)).mshc XML_FILES := $(filter-out $(TEMP_MANIFEST_FILE), $(shell ls *.xml)) VSIX_ASSETS := $(LUFA_ROOT)/DoxygenPages/Images/LUFA_thumb.png \ $(LUFA_ROOT)/DoxygenPages/Images/LUFA.png \ @@ -36,7 +37,8 @@ VSIX_ASSETS := $(LUFA_ROOT)/DoxygenPages/Images/LUFA_thumb.png \ VSIX/LUFA.dll \ VSIX/LUFA.pkgdef VSIX_GEN_PARAMS := --stringparam extension-version "$(EXT_VERSION_NUM)" \ - --stringparam lufa-version "$(LUFA_VERSION_NUM)" + --stringparam lufa-version "$(LUFA_VERSION_NUM)" \ + --stringparam help-package-filename "$(notdir $(MSHELP_OUTPUT_XML))" MSHELP_GEN_PARAMS := --stringparam generate.toc "book toc" \ --stringparam chunk.quietly "1" \ --stringparam chunk.section.depth "3" \ diff --git a/Firmware/LUFA/Version.h b/Firmware/LUFA/Version.h index 264c941..03cb084 100644 --- a/Firmware/LUFA/Version.h +++ b/Firmware/LUFA/Version.h @@ -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 @@ -42,11 +42,26 @@ /* Public Interface - May be used in end-application: */ /* Macros: */ - /** Indicates the version number of the library, as an integer. */ - #define LUFA_VERSION_INTEGER 0x140928 + /** \name LUFA Release Type Constants */ + //@{ + /** Constant for \ref LUFA_VERSION_RELEASE_TYPE indicating a development release. */ + #define LUFA_VERSION_RELEASE_TYPE_DEVELOPMENT 0 - /** Indicates the version number of the library, as a string. */ - #define LUFA_VERSION_STRING "140928" + /** Constant for \ref LUFA_VERSION_RELEASE_TYPE indicating a beta release. */ + #define LUFA_VERSION_RELEASE_TYPE_BETA 1 + + /** Constant for \ref LUFA_VERSION_RELEASE_TYPE indicating a full official release. */ + #define LUFA_VERSION_RELEASE_TYPE_FULL 2 + //@} + + /** Indicates the version number of the library, as an integer. \note This value is only updates in non-development releases. */ + #define LUFA_VERSION_INTEGER 0x170418 + + /** Indicates the version number of the library, as a string. \note This value is only updates in non-development releases. */ + #define LUFA_VERSION_STRING "170418" + + /** Indicates the release type of the library. */ + #define LUFA_VERSION_RELEASE_TYPE LUFA_VERSION_RELEASE_TYPE_FULL #endif diff --git a/Firmware/LUFA/doxyfile b/Firmware/LUFA/doxyfile index 77e8def..90b8ca2 100644 --- a/Firmware/LUFA/doxyfile +++ b/Firmware/LUFA/doxyfile @@ -1,4 +1,4 @@ -# Doxyfile 1.8.8 +# Doxyfile 1.8.9 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -46,10 +46,10 @@ PROJECT_NUMBER = 000000 PROJECT_BRIEF = -# With the PROJECT_LOGO tag one can specify an logo or icon that is included in -# the documentation. The maximum height of the logo should not exceed 55 pixels -# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo -# to the output directory. +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. PROJECT_LOGO = ./DoxygenPages/Images/LUFA_thumb.png @@ -60,7 +60,7 @@ PROJECT_LOGO = ./DoxygenPages/Images/LUFA_thumb.png OUTPUT_DIRECTORY = ./Documentation/ -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and # will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where @@ -93,14 +93,14 @@ ALLOW_UNICODE_NAMES = NO OUTPUT_LANGUAGE = English -# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES -# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the @@ -145,7 +145,7 @@ ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO -# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. @@ -215,9 +215,9 @@ MULTILINE_CPP_IS_BRIEF = NO INHERIT_DOCS = YES -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a -# new page for each member. If set to NO, the documentation of a member will be -# part of the file/class/namespace that contains it. +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = NO @@ -286,7 +286,7 @@ OPTIMIZE_OUTPUT_VHDL = NO # instance to make doxygen treat .inc files as Fortran files (default is PHP), # and .f files as C (default is Fortran), use: inc=Fortran f=C. # -# Note For files without extension you can use no_extension as a placeholder. +# Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. @@ -305,8 +305,8 @@ MARKDOWN_SUPPORT = NO # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by by putting a % sign in front of the word -# or globally by setting AUTOLINK_SUPPORT to NO. +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = YES @@ -346,7 +346,7 @@ SIP_SUPPORT = NO IDL_PROPERTY_SUPPORT = NO # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first +# tag is set to YES then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. @@ -411,7 +411,7 @@ LOOKUP_CACHE_SIZE = 0 # Build related configuration options #--------------------------------------------------------------------------- -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. @@ -421,35 +421,35 @@ LOOKUP_CACHE_SIZE = 0 EXTRACT_ALL = YES -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = YES -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = NO -# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be # included in the documentation. # The default value is: NO. EXTRACT_STATIC = YES -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = YES -# This flag is only useful for Objective-C code. When set to YES local methods, +# This flag is only useful for Objective-C code. If set to YES, local methods, # which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO only methods in the interface are +# included in the documentation. If set to NO, only methods in the interface are # included. # The default value is: NO. @@ -474,21 +474,21 @@ HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set -# to NO these classes will be included in the various overviews. This option has -# no effect if EXTRACT_ALL is enabled. +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO these declarations will be +# (class|struct|union) declarations. If set to NO, these declarations will be # included in the documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO these +# documentation blocks found inside the body of a function. If set to NO, these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. @@ -502,7 +502,7 @@ HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES upper-case letters are also +# names in lower-case letters. If set to YES, upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. @@ -511,12 +511,19 @@ INTERNAL_DOCS = NO CASE_SENSE_NAMES = NO # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES the +# their full class and namespace scopes in the documentation. If set to YES, the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. @@ -544,14 +551,14 @@ INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. +# name. If set to NO, the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. Note that +# name. If set to NO, the members will appear in declaration order. Note that # this will also influence the order of the classes in the class list. # The default value is: NO. @@ -596,27 +603,25 @@ SORT_BY_SCOPE_NAME = NO STRICT_PROTO_MATCHING = YES -# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the -# todo list. This list is created by putting \todo commands in the -# documentation. +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. # The default value is: YES. GENERATE_TODOLIST = NO -# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the -# test list. This list is created by putting \test commands in the -# documentation. +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. # The default value is: YES. GENERATE_TESTLIST = NO -# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = NO -# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. @@ -641,8 +646,8 @@ ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 1 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES the list -# will mention the files that were used to generate the documentation. +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = YES @@ -706,7 +711,7 @@ CITE_BIB_FILES = QUIET = YES # The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. @@ -714,7 +719,7 @@ QUIET = YES WARNINGS = YES -# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. @@ -731,8 +736,8 @@ WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return -# value. If set to NO doxygen will only warn about wrong or incomplete parameter -# documentation, but not about the absence of documentation. +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. # The default value is: NO. WARN_NO_PARAMDOC = YES @@ -801,6 +806,7 @@ RECURSIVE = YES EXCLUDE = Documentation/ \ StudioIntegration/ \ + Build/ \ License.txt # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or @@ -885,7 +891,7 @@ INPUT_FILTER = FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER ) will also be used to filter the input files that are used for +# INPUT_FILTER) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. @@ -945,7 +951,7 @@ REFERENCED_BY_RELATION = NO REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# to YES then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. @@ -992,7 +998,7 @@ USE_HTAGS = NO VERBATIM_HEADERS = NO -# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the +# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the # clang parser (see: http://clang.llvm.org/) for more accurate parsing at the # cost of reduced performance. This can be particularly helpful with template # rich C++ code for which doxygen's built-in parser lacks the necessary type @@ -1041,7 +1047,7 @@ IGNORE_PREFIX = # Configuration options related to the HTML output #--------------------------------------------------------------------------- -# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = YES @@ -1107,10 +1113,10 @@ HTML_STYLESHEET = # cascading style sheets that are included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefor more robust against future updates. +# standard style sheet and is therefore more robust against future updates. # Doxygen will copy the style sheet files to the output directory. -# Note: The order of the extra stylesheet files is of importance (e.g. the last -# stylesheet in the list overrules the setting of the previous ones in the +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1127,7 +1133,7 @@ HTML_EXTRA_STYLESHEET = ./DoxygenPages/Style/Style.css HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the stylesheet and background images according to +# will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see # http://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 @@ -1255,28 +1261,28 @@ GENERATE_HTMLHELP = NO CHM_FILE = ../LUFA.chm # The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# including file name) of the HTML help compiler (hhc.exe). If non-empty, # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = -# The GENERATE_CHI flag controls if a separate .chi index file is generated ( -# YES) or that it should be included in the master .chm file ( NO). +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = -# The BINARY_TOC flag controls whether a binary table of contents is generated ( -# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it # enables the Previous and Next buttons. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. @@ -1390,7 +1396,7 @@ DISABLE_INDEX = YES # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can # further fine-tune the look of the index. As an example, the default style # sheet generated by doxygen has an example that shows how to put an image at # the root of the tree instead of the PROJECT_NAME. Since the tree basically has @@ -1418,7 +1424,7 @@ ENUM_VALUES_PER_LINE = 1 TREEVIEW_WIDTH = 300 -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1447,7 +1453,7 @@ FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # http://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. @@ -1533,7 +1539,7 @@ SERVER_BASED_SEARCH = NO # external search engine pointed to by the SEARCHENGINE_URL option to obtain the # search results. # -# Doxygen ships with an example indexer ( doxyindexer) and search engine +# Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library # Xapian (see: http://xapian.org/). # @@ -1546,7 +1552,7 @@ EXTERNAL_SEARCH = NO # The SEARCHENGINE_URL should point to a search engine hosted by a web server # which will return the search results when EXTERNAL_SEARCH is enabled. # -# Doxygen ships with an example indexer ( doxyindexer) and search engine +# Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library # Xapian (see: http://xapian.org/). See the section "External Indexing and # Searching" for details. @@ -1584,7 +1590,7 @@ EXTRA_SEARCH_MAPPINGS = # Configuration options related to the LaTeX output #--------------------------------------------------------------------------- -# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output. +# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. # The default value is: YES. GENERATE_LATEX = NO @@ -1615,7 +1621,7 @@ LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex -# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX +# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX # documents. This may be useful for small projects and may help to save some # trees in general. # The default value is: NO. @@ -1650,9 +1656,9 @@ EXTRA_PACKAGES = # Note: Only use a user-defined header if you know what you are doing! The # following commands have a special meaning inside the header: $title, # $datetime, $date, $doxygenversion, $projectname, $projectnumber, -# $projectbrief, $projectlogo. Doxygen will replace $title with the empy string, -# for the replacement values of the other commands the user is refered to -# HTML_HEADER. +# $projectbrief, $projectlogo. Doxygen will replace $title with the empty +# string, for the replacement values of the other commands the user is referred +# to HTML_HEADER. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_HEADER = @@ -1668,6 +1674,17 @@ LATEX_HEADER = LATEX_FOOTER = +# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# LaTeX style sheets that are included after the standard style sheets created +# by doxygen. Using this option one can overrule certain style aspects. Doxygen +# will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EXTRA_STYLESHEET = + # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output # directory. Note that the files will be copied as-is; there are no commands or @@ -1686,7 +1703,7 @@ LATEX_EXTRA_FILES = PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate -# the PDF file directly from the LaTeX files. Set this option to YES to get a +# the PDF file directly from the LaTeX files. Set this option to YES, to get a # higher quality PDF documentation. # The default value is: YES. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1731,7 +1748,7 @@ LATEX_BIB_STYLE = plain # Configuration options related to the RTF output #--------------------------------------------------------------------------- -# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The +# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The # RTF output is optimized for Word 97 and may not look too pretty with other RTF # readers/editors. # The default value is: NO. @@ -1746,7 +1763,7 @@ GENERATE_RTF = NO RTF_OUTPUT = rtf -# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF +# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF # documents. This may be useful for small projects and may help to save some # trees in general. # The default value is: NO. @@ -1783,11 +1800,21 @@ RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = +# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code +# with syntax highlighting in the RTF output. +# +# Note that which sources are shown also depends on other settings such as +# SOURCE_BROWSER. +# The default value is: NO. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_SOURCE_CODE = NO + #--------------------------------------------------------------------------- # Configuration options related to the man page output #--------------------------------------------------------------------------- -# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for +# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for # classes and files. # The default value is: NO. @@ -1831,7 +1858,7 @@ MAN_LINKS = NO # Configuration options related to the XML output #--------------------------------------------------------------------------- -# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that +# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that # captures the structure of the code including all documentation. # The default value is: NO. @@ -1845,7 +1872,7 @@ GENERATE_XML = NO XML_OUTPUT = xml -# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program +# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program # listings (including syntax highlighting and cross-referencing information) to # the XML output. Note that enabling this will significantly increase the size # of the XML output. @@ -1858,7 +1885,7 @@ XML_PROGRAMLISTING = YES # Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- -# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files +# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files # that can be used to generate PDF. # The default value is: NO. @@ -1872,7 +1899,7 @@ GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook -# If the DOCBOOK_PROGRAMLISTING tag is set to YES doxygen will include the +# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the # program listings (including syntax highlighting and cross-referencing # information) to the DOCBOOK output. Note that enabling this will significantly # increase the size of the DOCBOOK output. @@ -1885,10 +1912,10 @@ DOCBOOK_PROGRAMLISTING = NO # Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- -# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen -# Definitions (see http://autogen.sf.net) file that captures the structure of -# the code including all documentation. Note that this feature is still -# experimental and incomplete at the moment. +# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an +# AutoGen Definitions (see http://autogen.sf.net) file that captures the +# structure of the code including all documentation. Note that this feature is +# still experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO @@ -1897,7 +1924,7 @@ GENERATE_AUTOGEN_DEF = NO # Configuration options related to the Perl module output #--------------------------------------------------------------------------- -# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module +# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module # file that captures the structure of the code including all documentation. # # Note that this feature is still experimental and incomplete at the moment. @@ -1905,7 +1932,7 @@ GENERATE_AUTOGEN_DEF = NO GENERATE_PERLMOD = NO -# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary +# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary # Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI # output from the Perl module output. # The default value is: NO. @@ -1913,9 +1940,9 @@ GENERATE_PERLMOD = NO PERLMOD_LATEX = NO -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely +# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely # formatted so it can be parsed by a human reader. This is useful if you want to -# understand what is going on. On the other hand, if this tag is set to NO the +# understand what is going on. On the other hand, if this tag is set to NO, the # size of the Perl module output will be much smaller and Perl will parse it # just the same. # The default value is: YES. @@ -1935,14 +1962,14 @@ PERLMOD_MAKEVAR_PREFIX = # Configuration options related to the preprocessor #--------------------------------------------------------------------------- -# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all +# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all # C-preprocessor directives found in the sources and include files. # The default value is: YES. ENABLE_PREPROCESSING = YES -# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names -# in the source code. If set to NO only conditional compilation will be +# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names +# in the source code. If set to NO, only conditional compilation will be # performed. Macro expansion can be done in a controlled way by setting # EXPAND_ONLY_PREDEF to YES. # The default value is: NO. @@ -1958,7 +1985,7 @@ MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = YES -# If the SEARCH_INCLUDES tag is set to YES the includes files in the +# If the SEARCH_INCLUDES tag is set to YES, the include files in the # INCLUDE_PATH will be searched if a #include is found. # The default value is: YES. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. @@ -2037,20 +2064,21 @@ TAGFILES = GENERATE_TAGFILE = -# If the ALLEXTERNALS tag is set to YES all external class will be listed in the -# class index. If set to NO only the inherited external classes will be listed. +# If the ALLEXTERNALS tag is set to YES, all external class will be listed in +# the class index. If set to NO, only the inherited external classes will be +# listed. # The default value is: NO. ALLEXTERNALS = NO -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in -# the modules index. If set to NO, only the current project's groups will be +# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will be # listed. # The default value is: YES. EXTERNAL_GROUPS = YES -# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in +# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in # the related pages index. If set to NO, only the current project's pages will # be listed. # The default value is: YES. @@ -2067,7 +2095,7 @@ PERL_PATH = /usr/bin/perl # Configuration options related to the dot tool #--------------------------------------------------------------------------- -# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram +# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram # (in HTML and LaTeX) for classes with base or super classes. Setting the tag to # NO turns the diagrams off. Note that this option also works with HAVE_DOT # disabled, but it is recommended to install and use dot, since it yields more @@ -2092,7 +2120,7 @@ MSCGEN_PATH = DIA_PATH = -# If set to YES, the inheritance and collaboration graphs will hide inheritance +# If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. # The default value is: YES. @@ -2165,7 +2193,7 @@ COLLABORATION_GRAPH = NO GROUP_GRAPHS = YES -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. # The default value is: NO. @@ -2303,10 +2331,14 @@ DIAFILE_DIRS = # PlantUML is not used or called during a preprocessing step. Doxygen will # generate a warning when it encounters a \startuml command in this case and # will not generate output for the diagram. -# This tag requires that the tag HAVE_DOT is set to YES. PLANTUML_JAR_PATH = +# When using plantuml, the specified paths are searched for files specified by +# the !include statement in a plantuml block. + +PLANTUML_INCLUDE_PATH = + # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes # larger than this value, doxygen will truncate the graph, which is visualized @@ -2343,7 +2375,7 @@ MAX_DOT_GRAPH_DEPTH = 2 DOT_TRANSPARENT = YES -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) support # this, this feature is disabled by default. @@ -2360,7 +2392,7 @@ DOT_MULTI_TARGETS = NO GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot +# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot # files that are used to generate the various graphs. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. diff --git a/Firmware/LUFA/makefile b/Firmware/LUFA/makefile index 88449a9..7e7a9c3 100644 --- a/Firmware/LUFA/makefile +++ b/Firmware/LUFA/makefile @@ -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 @@ -9,45 +9,32 @@ # Makefile for the LUFA library itself. # --------------------------------------- -LUFA_VERSION_NUM = $(shell grep LUFA_VERSION_STRING $(LUFA_PATH)/Version.h | cut -d'"' -f2) -EXCLUDE_FROM_EXPORT := Documentation DoxygenPages CodeTemplates Build StudioIntegration doxyfile *.tar *.o *.d *.lss *.lst *.hex *.elf *.hex *.eep *.map *.bin +LUFA_VERSION_NUM := $(shell grep LUFA_VERSION_STRING $(LUFA_PATH)/Version.h | cut -d'"' -f2) # Default target - no default action when attempting to build the core directly all: -# Export the library core as a TAR archive for importing into an IDE -export_tar: - @echo Exporting LUFA library to a TAR archive... - @tar -cf LUFA_$(LUFA_VERSION_NUM).tar --directory=. $(EXCLUDE_FROM_EXPORT:%=--exclude=%) * - @tar -cf LUFA_$(LUFA_VERSION_NUM)_Code_Templates.tar CodeTemplates - @echo Export LUFA_$(LUFA_VERSION_NUM).tar complete. - # Display the LUFA version of this library copy version: @echo "LUFA $(LUFA_VERSION_NUM)" -# Check if this is being included from a legacy or non LUFA build system makefile -ifneq ($(LUFA_PATH),) - LUFA_ROOT_PATH = $(patsubst %/,%,$(LUFA_PATH))/LUFA/ - - include $(patsubst %/,%,$(LUFA_PATH))/LUFA/Build/lufa_sources.mk -else - LUFA_BUILD_MODULES += MASTER - LUFA_BUILD_TARGETS += export_tar version +LUFA_PATH := . +ARCH := {AVR8,UC3,XMEGA} +DOXYGEN_OVERRIDE_PARAMS := QUIET=YES PROJECT_NUMBER=$(LUFA_VERSION_NUM) - LUFA_PATH = . - ARCH = {AVR8,UC3,XMEGA} - DOXYGEN_OVERRIDE_PARAMS = QUIET=YES PROJECT_NUMBER=$(LUFA_VERSION_NUM) - - # Remove all object and associated files from the LUFA library core - clean: +# Remove all object and associated files from the LUFA library core +clean: rm -f $(LUFA_SRC_ALL_FILES:%.c=%.o) rm -f $(LUFA_SRC_ALL_FILES:%.c=%.d) rm -f $(LUFA_SRC_ALL_FILES:%.c=%.lst) - include Build/lufa_core.mk - include Build/lufa_sources.mk - include Build/lufa_doxygen.mk -endif +# Include LUFA-specific DMBS extension modules +DMBS_LUFA_PATH ?= $(LUFA_PATH)/Build/LUFA +include $(DMBS_LUFA_PATH)/lufa-sources.mk + +# Include common DMBS build system modules +DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS +include $(DMBS_PATH)/core.mk +include $(DMBS_PATH)/doxygen.mk -.PHONY: all export_tar version clean +.PHONY: all version diff --git a/Firmware/SwitchDual/Config.c b/Firmware/SwitchDual/Config.c new file mode 100644 index 0000000..7a3f072 --- /dev/null +++ b/Firmware/SwitchDual/Config.c @@ -0,0 +1,42 @@ +#include +#include "Joystick.h" + +#include +#include + +#define MAGIC_NUMBER 43 + +static const tatacon_config_t defaults PROGMEM = { + .switches = { + // SWITCH ORDER: CenterLeft, RimLeft, CenterRight, RimRight + // ---- osu default + SWITCH_LCLICK, + SWITCH_ZL, + SWITCH_RCLICK, + SWITCH_ZR }, + .ledsOn = true, + .debounce = 30 +}; + +uint8_t firstRun EEMEM; // init to 255 +tatacon_config_t eeConfig EEMEM; + +tatacon_config_t tataConfig; + +void InitConfig(void) { + if (eeprom_read_byte(&firstRun) != MAGIC_NUMBER) { // store defaults + memcpy_P(&tataConfig, &defaults, sizeof(tatacon_config_t)); + eeprom_write_block(&tataConfig, &eeConfig, sizeof(tatacon_config_t)); + eeprom_write_byte(&firstRun, MAGIC_NUMBER); // defaults set + } + eeprom_read_block(&tataConfig, &eeConfig, sizeof(tatacon_config_t)); + tataConfig.version = FIRMWARE_VERSION; +} + +void SetConfig(uint8_t* config) { + memcpy(&tataConfig, config, sizeof(tatacon_config_t)); + // Version is set in firmware, not software + tataConfig.version = FIRMWARE_VERSION; + + eeprom_write_block(&tataConfig, &eeConfig, sizeof(tatacon_config_t)); +} \ No newline at end of file diff --git a/Firmware/SwitchDual/Config.h b/Firmware/SwitchDual/Config.h new file mode 100644 index 0000000..da3db28 --- /dev/null +++ b/Firmware/SwitchDual/Config.h @@ -0,0 +1,27 @@ +#ifndef _CONFIG_H +#define _CONFIG_H + +#include +#include +#include + +// For ease of code sharing with the OsuPad +#define KB_SWITCHES 4 +#define TATACON_CONFIG_BYTES 12 +#define MAGIC_RESET_NUMBER 42 +#define FIRMWARE_VERSION 20 + +typedef struct { + // SWITCH ORDER: CenterLeft, RimLeft, CenterRight, RimRight + uint16_t switches[KB_SWITCHES]; + bool ledsOn; + uint8_t debounce; + uint8_t version; +} tatacon_config_t; + +extern tatacon_config_t tataConfig; + +extern void InitConfig(void); +extern void SetConfig(uint8_t* config); + +#endif \ No newline at end of file diff --git a/Firmware/SwitchDual/Config/LUFAConfig.h b/Firmware/SwitchDual/Config/LUFAConfig.h new file mode 100644 index 0000000..5fae1fa --- /dev/null +++ b/Firmware/SwitchDual/Config/LUFAConfig.h @@ -0,0 +1,84 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2014. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2014 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 + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaims all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief LUFA Library Configuration Header File + * + * This header file is used to configure LUFA's compile time options, + * as an alternative to the compile time constants supplied through + * a makefile. + * + * For information on what each token does, refer to the LUFA + * manual section "Summary of Compile Tokens". + */ + +#ifndef _LUFA_CONFIG_H_ +#define _LUFA_CONFIG_H_ + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ +// #define ORDERED_EP_CONFIG + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL) + #define USB_DEVICE_ONLY +// #define USB_HOST_ONLY +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE +// #define INTERRUPT_CONTROL_ENDPOINT +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + + /* USB Host Mode Driver Related Tokens: */ +// #define HOST_STATE_AS_GPIOR {Insert Value Here} +// #define USB_HOST_TIMEOUT_MS {Insert Value Here} +// #define HOST_DEVICE_SETTLE_DELAY_MS {Insert Value Here} +// #define NO_AUTO_VBUS_MANAGEMENT +// #define INVERTED_VBUS_ENABLE_LINE +#endif diff --git a/Firmware/SwitchDual/Descriptors.c b/Firmware/SwitchDual/Descriptors.c new file mode 100644 index 0000000..e6c4446 --- /dev/null +++ b/Firmware/SwitchDual/Descriptors.c @@ -0,0 +1,344 @@ +#include "Descriptors.h" +#include "Config.h" +// HID Descriptors. +const USB_Descriptor_HIDReport_Datatype_t PROGMEM JoystickReport[] = { + HID_RI_USAGE_PAGE(8,1), /* Generic Desktop */ + HID_RI_USAGE(8,5), /* Joystick */ + HID_RI_COLLECTION(8,1), /* Application */ + // Buttons (2 bytes) + HID_RI_LOGICAL_MINIMUM(8,0), + HID_RI_LOGICAL_MAXIMUM(8,1), + HID_RI_PHYSICAL_MINIMUM(8,0), + HID_RI_PHYSICAL_MAXIMUM(8,1), + // The Switch will allow us to expand the original HORI descriptors to a full 16 buttons. + // The Switch will make use of 14 of those buttons. + HID_RI_REPORT_SIZE(8,1), + HID_RI_REPORT_COUNT(8,16), + HID_RI_USAGE_PAGE(8,9), + HID_RI_USAGE_MINIMUM(8,1), + HID_RI_USAGE_MAXIMUM(8,16), + HID_RI_INPUT(8,2), + // HAT Switch (1 nibble) + HID_RI_USAGE_PAGE(8,1), + HID_RI_LOGICAL_MAXIMUM(8,7), + HID_RI_PHYSICAL_MAXIMUM(16,315), + HID_RI_REPORT_SIZE(8,4), + HID_RI_REPORT_COUNT(8,1), + HID_RI_UNIT(8,20), + HID_RI_USAGE(8,57), + HID_RI_INPUT(8,66), + // There's an additional nibble here that's utilized as part of the Switch Pro Controller. + // I believe this -might- be separate U/D/L/R bits on the Switch Pro Controller, as they're utilized as four button descriptors on the Switch Pro Controller. + HID_RI_UNIT(8,0), + HID_RI_REPORT_COUNT(8,1), + HID_RI_INPUT(8,1), + // Joystick (4 bytes) + HID_RI_LOGICAL_MAXIMUM(16,255), + HID_RI_PHYSICAL_MAXIMUM(16,255), + HID_RI_USAGE(8,48), + HID_RI_USAGE(8,49), + HID_RI_USAGE(8,50), + HID_RI_USAGE(8,53), + HID_RI_REPORT_SIZE(8,8), + HID_RI_REPORT_COUNT(8,4), + HID_RI_INPUT(8,2), + // ??? Vendor Specific (1 byte) + // This byte requires additional investigation. + HID_RI_USAGE_PAGE(16,65280), + HID_RI_USAGE(8,32), + HID_RI_REPORT_COUNT(8,1), + HID_RI_INPUT(8,2), + // Output (8 bytes) + // Original observation of this suggests it to be a mirror of the inputs that we sent. + // The Switch requires us to have these descriptors available. + HID_RI_USAGE(16,9761), + HID_RI_REPORT_COUNT(8,8), + HID_RI_OUTPUT(8,2), + HID_RI_END_COLLECTION(0), +}; + + +/** HID class report descriptor. This is a special descriptor constructed with values from the + * USBIF HID class specification to describe the reports and capabilities of the HID device. This + * descriptor is parsed by the host and its contents used to determine what data (and in what encoding) + * the device will send, and what it may be sent back from the host. Refer to the HID specification for + * more details on HID report descriptors. + */ +const USB_Descriptor_HIDReport_Datatype_t PROGMEM GenericReport[] = +{ + HID_RI_USAGE_PAGE(16, 0xFFDC), /* Vendor Page 0xDC */ + HID_RI_USAGE(8, 0xFB), /* Vendor Usage 0xFB */ + HID_RI_COLLECTION(8, 0x01), /* Vendor Usage 1 */ + HID_RI_USAGE(8, 0x02), /* Vendor Usage 2 */ + HID_RI_LOGICAL_MINIMUM(8, 0x00), + HID_RI_LOGICAL_MAXIMUM(8, 0xFF), + HID_RI_REPORT_SIZE(8, 8), + HID_RI_REPORT_COUNT(8, TATACON_CONFIG_BYTES), + HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE), + + HID_RI_USAGE(8, 0x02), /* Vendor Usage 2 */ + HID_RI_LOGICAL_MINIMUM(8, 0x00), + HID_RI_LOGICAL_MAXIMUM(8, 0xFF), + HID_RI_REPORT_SIZE(8, 8), + HID_RI_REPORT_COUNT(8, TATACON_CONFIG_BYTES), + HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE), + HID_RI_END_COLLECTION(0), +}; +// Device Descriptor Structure +const USB_Descriptor_Device_t PROGMEM DeviceDescriptor = { + .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, + + .USBSpecification = VERSION_BCD(2,0,0), + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, + + .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, + + .VendorID = 0x0F0D, + .ProductID = 0x0092, + .ReleaseNumber = VERSION_BCD(1,0,0), + + .ManufacturerStrIndex = STRING_ID_Manufacturer, + .ProductStrIndex = STRING_ID_Product, + .SerialNumStrIndex = NO_DESCRIPTOR, + + .NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS +}; + +// Configuration Descriptor Structure +const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { + .Config = + { + .Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration}, + + .TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t), + .TotalInterfaces = 2, + + .ConfigurationNumber = 1, + .ConfigurationStrIndex = NO_DESCRIPTOR, + + .ConfigAttributes = 0x80, + + .MaxPowerConsumption = USB_CONFIG_POWER_MA(500) + }, + + .HID_Interface = + { + .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, + + .InterfaceNumber = INTERFACE_ID_Joystick, + .AlternateSetting = 0x00, + + .TotalEndpoints = 2, + + .Class = HID_CSCP_HIDClass, + .SubClass = HID_CSCP_NonBootSubclass, + .Protocol = HID_CSCP_NonBootProtocol, + + .InterfaceStrIndex = NO_DESCRIPTOR + }, + + .HID_JoystickHID = + { + .Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID}, + + .HIDSpec = VERSION_BCD(1,1,1), + .CountryCode = 0x00, + .TotalReportDescriptors = 1, + .HIDReportType = HID_DTYPE_Report, + .HIDReportLength = sizeof(JoystickReport) + }, + + .HID_ReportINEndpoint = + { + .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, + + .EndpointAddress = JOYSTICK_IN_EPADDR, + .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), + .EndpointSize = JOYSTICK_EPSIZE, + .PollingIntervalMS = 0x05 + }, + + .HID_ReportOUTEndpoint = + { + .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, + + .EndpointAddress = JOYSTICK_OUT_EPADDR, + .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), + .EndpointSize = JOYSTICK_EPSIZE, + .PollingIntervalMS = 0x05 + }, + .HID3_Interface = + { + .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, + + .InterfaceNumber = INTERFACE_ID_Joystick2, + .AlternateSetting = 0x00, + + .TotalEndpoints = 2, + + .Class = HID_CSCP_HIDClass, + .SubClass = HID_CSCP_NonBootSubclass, + .Protocol = HID_CSCP_NonBootProtocol, + + .InterfaceStrIndex = NO_DESCRIPTOR + }, + + .HID3_JoystickHID = + { + .Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID}, + + .HIDSpec = VERSION_BCD(1,1,1), + .CountryCode = 0x00, + .TotalReportDescriptors = 1, + .HIDReportType = HID_DTYPE_Report, + .HIDReportLength = sizeof(JoystickReport) + }, + + .HID3_ReportINEndpoint = + { + .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, + + .EndpointAddress = JOYSTICK2_IN_EPADDR, + .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), + .EndpointSize = JOYSTICK_EPSIZE, + .PollingIntervalMS = 0x05 + }, + + .HID3_ReportOUTEndpoint = + { + .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, + + .EndpointAddress = JOYSTICK2_OUT_EPADDR, + .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), + .EndpointSize = JOYSTICK_EPSIZE, + .PollingIntervalMS = 0x05 + }, + // .HID2_Interface = + // { + // .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, + + // .InterfaceNumber = INTERFACE_ID_Generic, + // .AlternateSetting = 0x00, + + // .TotalEndpoints = 1, + + // .Class = HID_CSCP_HIDClass, + // .SubClass = HID_CSCP_NonBootSubclass, + // .Protocol = HID_CSCP_NonBootProtocol, + + // .InterfaceStrIndex = STRING_ID_Config + // }, + + // .HID2_VendorHID = + // { + // .Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID}, + + // .HIDSpec = VERSION_BCD(1,1,1), + // .CountryCode = 0x00, + // .TotalReportDescriptors = 1, + // .HIDReportType = HID_DTYPE_Report, + // .HIDReportLength = sizeof(GenericReport) + // }, + + // .HID2_ReportINEndpoint = + // { + // .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, + + // .EndpointAddress = GENERIC_EPADDR, + // .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), + // .EndpointSize = GENERIC_EPSIZE, + // .PollingIntervalMS = 255 + // }, +}; + +// Language Descriptor Structure +const USB_Descriptor_String_t PROGMEM LanguageString = USB_STRING_DESCRIPTOR_ARRAY(LANGUAGE_ID_ENG); + +// Manufacturer and Product Descriptor Strings +const USB_Descriptor_String_t PROGMEM ManufacturerString = USB_STRING_DESCRIPTOR(L"HORI CO.,LTD."); +const USB_Descriptor_String_t PROGMEM ProductString = USB_STRING_DESCRIPTOR(L"POKKEN CONTROLLER"); +const USB_Descriptor_String_t PROGMEM ConfigString = USB_STRING_DESCRIPTOR(L"Tatacon Config"); +const USB_Descriptor_String_t PROGMEM TataconString = USB_STRING_DESCRIPTOR(L"Tatacon"); +// USB Device Callback - Get Descriptor +uint16_t CALLBACK_USB_GetDescriptor( + const uint16_t wValue, + const uint16_t wIndex, + const void** const DescriptorAddress +) { + const uint8_t DescriptorType = (wValue >> 8); + const uint8_t DescriptorNumber = (wValue & 0xFF); + + const void* Address = NULL; + uint16_t Size = NO_DESCRIPTOR; + + switch (DescriptorType) + { + case DTYPE_Device: + Address = &DeviceDescriptor; + Size = sizeof(USB_Descriptor_Device_t); + break; + case DTYPE_Configuration: + Address = &ConfigurationDescriptor; + Size = sizeof(USB_Descriptor_Configuration_t); + break; + case DTYPE_String: + switch (DescriptorNumber) { + case STRING_ID_Language: + Address = &LanguageString; + Size = pgm_read_byte(&LanguageString.Header.Size); + break; + case STRING_ID_Manufacturer: + Address = &ManufacturerString; + Size = pgm_read_byte(&ManufacturerString.Header.Size); + break; + case STRING_ID_Product: + Address = &ProductString; + Size = pgm_read_byte(&ProductString.Header.Size); + break; + case STRING_ID_Config: + Address = &ConfigString; + Size = pgm_read_byte(&ConfigString.Header.Size); + break; + case STRING_ID_Tatacon: + Address = &TataconString; + Size = pgm_read_byte(&TataconString.Header.Size); + break; + } + break; + case DTYPE_HID: + switch (wIndex) { + case INTERFACE_ID_Joystick: + Address = &ConfigurationDescriptor.HID_JoystickHID; + Size = sizeof(USB_HID_Descriptor_HID_t); + break; + // case INTERFACE_ID_Generic: + // Address = &ConfigurationDescriptor.HID2_VendorHID; + // break; + case INTERFACE_ID_Joystick2: + Address = &ConfigurationDescriptor.HID3_JoystickHID; + Size = sizeof(USB_HID_Descriptor_HID_t); + break; + } + case DTYPE_Report: + switch (wIndex) { + case INTERFACE_ID_Joystick: + Address = &JoystickReport; + Size = sizeof(JoystickReport); + break; + // case INTERFACE_ID_Generic: + // Address = &GenericReport; + // Size = sizeof(GenericReport); + // break; + case INTERFACE_ID_Joystick2: + Address = &JoystickReport; + Size = sizeof(JoystickReport); + break; + } + break; + } + + *DescriptorAddress = Address; + return Size; +} diff --git a/Firmware/SwitchDual/Descriptors.h b/Firmware/SwitchDual/Descriptors.h new file mode 100644 index 0000000..e9d984d --- /dev/null +++ b/Firmware/SwitchDual/Descriptors.h @@ -0,0 +1,80 @@ +#ifndef _DESCRIPTORS_H_ +#define _DESCRIPTORS_H_ + +// Includes +#include + +#include + +// Type Defines +// Device Configuration Descriptor Structure +typedef struct +{ + USB_Descriptor_Configuration_Header_t Config; + + // Joystick HID Interface + USB_Descriptor_Interface_t HID_Interface; + USB_HID_Descriptor_HID_t HID_JoystickHID; + USB_Descriptor_Endpoint_t HID_ReportOUTEndpoint; + USB_Descriptor_Endpoint_t HID_ReportINEndpoint; + + + // Joystick HID Interface + USB_Descriptor_Interface_t HID3_Interface; + USB_HID_Descriptor_HID_t HID3_JoystickHID; + USB_Descriptor_Endpoint_t HID3_ReportOUTEndpoint; + USB_Descriptor_Endpoint_t HID3_ReportINEndpoint; + + // Generic HID Interface + // USB_Descriptor_Interface_t HID2_Interface; + // USB_HID_Descriptor_HID_t HID2_VendorHID; + // USB_Descriptor_Endpoint_t HID2_ReportINEndpoint; + +} USB_Descriptor_Configuration_t; + +// Device Interface Descriptor IDs +enum InterfaceDescriptors_t +{ + INTERFACE_ID_Joystick = 0, /**< Joystick interface descriptor ID */ + INTERFACE_ID_Joystick2 = 1, + // INTERFACE_ID_Generic = 2, /**< Generic interface descriptor ID */ +}; + +// Device String Descriptor IDs +enum StringDescriptors_t +{ + STRING_ID_Language = 0, // Supported Languages string descriptor ID (must be zero) + STRING_ID_Manufacturer = 1, // Manufacturer string ID + STRING_ID_Product = 2, // Product string ID + STRING_ID_Config = 3, /**< Config string ID */ + STRING_ID_Tatacon = 4, /**< Config string ID */ +}; + +// Macros +// Endpoint Addresses +#define JOYSTICK_IN_EPADDR (ENDPOINT_DIR_IN | 1) +#define JOYSTICK_OUT_EPADDR (ENDPOINT_DIR_OUT | 3) +#define JOYSTICK2_IN_EPADDR (ENDPOINT_DIR_IN | 2) +#define JOYSTICK2_OUT_EPADDR (ENDPOINT_DIR_OUT | 4) +// HID Endpoint Size +// The Switch -needs- this to be 64. +// The Wii U is flexible, allowing us to use the default of 8 (which did not match the original Hori descriptors). +#define JOYSTICK_EPSIZE 64 +// Descriptor Header Type - HID Class HID Descriptor +#define DTYPE_HID 0x21 +// Descriptor Header Type - HID Class HID Report Descriptor +#define DTYPE_Report 0x22 + +#define GENERIC_EPADDR (ENDPOINT_DIR_IN | 5) + +/** Size in bytes of the Keyboard HID reporting IN endpoint. */ +#define GENERIC_EPSIZE TATACON_CONFIG_BYTES + +// Function Prototypes +uint16_t CALLBACK_USB_GetDescriptor( + const uint16_t wValue, + const uint16_t wIndex, + const void** const DescriptorAddress +) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); + +#endif \ No newline at end of file diff --git a/Firmware/SwitchDual/Joystick.c b/Firmware/SwitchDual/Joystick.c new file mode 100644 index 0000000..d7eb010 --- /dev/null +++ b/Firmware/SwitchDual/Joystick.c @@ -0,0 +1,453 @@ +#include "Joystick.h" +#include "i2cmaster.h" +#include "Config.h" + +#ifdef DEBUG +#include "usbio.h" +#include +#endif + +static uint8_t PrevGenericHIDReportBuffer[TATACON_CONFIG_BYTES]; + +// USB_ClassInfo_HID_Device_t Generic_HID_Interface = +// { +// .Config = +// { +// .InterfaceNumber = INTERFACE_ID_Generic, +// .ReportINEndpoint = +// { +// .Address = GENERIC_EPADDR, +// .Size = GENERIC_EPSIZE, +// .Banks = 1, +// }, +// .PrevReportINBuffer = PrevGenericHIDReportBuffer, +// .PrevReportINBufferSize = sizeof(PrevGenericHIDReportBuffer), +// }, +// }; +// V1 hardware has no LEDs +#ifdef V1_BUILD + #define SET(port, pin) + #define CLEAR(port, pin) + #define TOGGLE(port, pin) +#else + #define SET(port, pin) port |= _BV(pin) + #define CLEAR(port, pin) port &= ~_BV(pin) + #define TOGGLE(port, pin) port ^= _BV(pin) +#endif + +uint32_t Boot_Key ATTR_NO_INIT; +#define MAGIC_BOOT_KEY 0xDEADBE7A +// offset * word size +#define BOOTLOADER_START_ADDRESS (0x1c00 * 2) + +void Bootloader_Jump_Check(void) ATTR_INIT_SECTION(3); +void Bootloader_Jump_Check(void) { + // If the reset source was the bootloader and the key is correct, clear it and jump to the bootloader + if ((MCUSR & (1 << WDRF)) && (Boot_Key == MAGIC_BOOT_KEY)) { + Boot_Key = 0; + ((void (*)(void))BOOTLOADER_START_ADDRESS)(); + } +} + +typedef struct { + // optimise data sending + uint8_t state; + uint8_t lastReport; + uint8_t debounce; +} switch_t; + + +static switch_t switches[TATACON_SWITCHES]; +static uint8_t switchesChanged = 1; +static uint8_t nunchuckReady = 0; +ControllerState state = {.state = SYNC_CONTROLLER, .report_count = 0, .echoes = 0}; +ControllerState state2 = {.state = SYNC_CONTROLLER, .report_count = 0, .echoes = 0}; +#define ECHOES 2 +int echoes = 0; + +USB_JoystickReport_Input_t last_report; + +// Main entry point. +int main(void) { + InitConfig(); + + // We'll start by performing hardware and peripheral setup. + SetupHardware(); + // We'll then enable global interrupts for our use. + GlobalInterruptEnable(); + // Once that's done, we'll enter an infinite loop. + for (;;) { + // We need to run our task to process and deliver data for our IN and OUT endpoints. + // HID_Device_USBTask(&Generic_HID_Interface); + HID_Task(); + + // We also need to run the main USB management task. + USB_USBTask(); + } +} + +// Process and deliver data from IN and OUT endpoints. +void HID_Task(void) { + // If the device isn't connected and properly configured, we can't do anything here. + if (USB_DeviceState != DEVICE_STATE_Configured) { + SET(LED_PORT, DON_LED_PIN); + SET(LED_PORT, KAT_LED_PIN); + return; + } + + // We'll start with the OUT endpoint. + Endpoint_SelectEndpoint(JOYSTICK_OUT_EPADDR); + // We'll check to see if we received something on the OUT endpoint. + if (Endpoint_IsOUTReceived()) { + // If we did, and the packet has data, we'll react to it. + if (Endpoint_IsReadWriteAllowed()) { + // We'll create a place to store our data received from the host. + USB_JoystickReport_Output_t JoystickOutputData; + // We'll then take in that data, setting it up in our storage. + while(Endpoint_Read_Stream_LE(&JoystickOutputData, sizeof(JoystickOutputData), NULL) != ENDPOINT_RWSTREAM_NoError); + // At this point, we can react to this data. + // However, since we're not doing anything with this data, we abandon it. + } + // Regardless of whether we reacted to the data, we acknowledge an OUT packet on this endpoint. + Endpoint_ClearOUT(); + } + + // We'll then move on to the IN endpoint. + Endpoint_SelectEndpoint(JOYSTICK_IN_EPADDR); + // We first check to see if the host is ready to accept data. + if (Endpoint_IsINReady()) { + // We'll create an empty report. + USB_JoystickReport_Input_t JoystickInputData; + // We'll then populate this report with what we want to send to the host. + GetNextReport(&JoystickInputData, &state2); + // Once populated, we can output this data to the host. We do this by first writing the data to the control stream. + while(Endpoint_Write_Stream_LE(&JoystickInputData, sizeof(JoystickInputData), NULL) != ENDPOINT_RWSTREAM_NoError); + // We then send an IN packet on this endpoint. + Endpoint_ClearIN(); + } + // We'll start with the OUT endpoint. + Endpoint_SelectEndpoint(JOYSTICK2_OUT_EPADDR); + // We'll check to see if we received something on the OUT endpoint. + if (Endpoint_IsOUTReceived()) { + // If we did, and the packet has data, we'll react to it. + if (Endpoint_IsReadWriteAllowed()) { + // We'll create a place to store our data received from the host. + USB_JoystickReport_Output_t JoystickOutputData; + // We'll then take in that data, setting it up in our storage. + while(Endpoint_Read_Stream_LE(&JoystickOutputData, sizeof(JoystickOutputData), NULL) != ENDPOINT_RWSTREAM_NoError); + // At this point, we can react to this data. + // However, since we're not doing anything with this data, we abandon it. + } + // Regardless of whether we reacted to the data, we acknowledge an OUT packet on this endpoint. + Endpoint_ClearOUT(); + } + + // We'll then move on to the IN endpoint. + Endpoint_SelectEndpoint(JOYSTICK2_IN_EPADDR); + // We first check to see if the host is ready to accept data. + if (Endpoint_IsINReady()) { + // We'll create an empty report. + USB_JoystickReport_Input_t JoystickInputData; + // We'll then populate this report with what we want to send to the host. + GetNextReport(&JoystickInputData, &state); + // Once populated, we can output this data to the host. We do this by first writing the data to the control stream. + while(Endpoint_Write_Stream_LE(&JoystickInputData, sizeof(JoystickInputData), NULL) != ENDPOINT_RWSTREAM_NoError); + // We then send an IN packet on this endpoint. + Endpoint_ClearIN(); + } +} + + + + + +void nunchuck_online(void) { + if(!nunchuckReady) { + nunchuckReady = 1; + // Turn LEDs off, it returned + CLEAR(LED_PORT, DON_LED_PIN); + CLEAR(LED_PORT, KAT_LED_PIN); + } +} + +void nunchuck_offline(void) { + i2c_stop(); + if(nunchuckReady) { + nunchuckReady = 0; + // Turn LEDs on until it returns + // SET(LED_PORT, DON_LED_PIN); + // SET(LED_PORT, KAT_LED_PIN); + // Clear structs + for(int i = 0; i < KB_SWITCHES; i++) { + switches[i].state = 0; + if(switches[i].state != switches[i].lastReport) { + switchesChanged = 1; + } + } + } +} + +void nunchuck_init(void) { + // try to say hello + if(!i2c_start(NUNCHUCK_ADDR | I2C_WRITE)) { + i2c_write(0xF0); + i2c_write(0x55); + i2c_stop(); + _delay_ms(25); + + i2c_start(NUNCHUCK_ADDR | I2C_WRITE); + i2c_write(0xFB); + i2c_write(0x00); + i2c_stop(); + _delay_ms(25); + nunchuck_online(); + } else { + nunchuck_offline(); + } +} + +uint8_t nunchuck_readByte(uint8_t address) { + uint8_t data = 0xFF; + + if(!nunchuckReady) { + nunchuck_init(); + } + + if(!i2c_start(NUNCHUCK_ADDR | I2C_WRITE)) { + i2c_write(address); + i2c_stop(); + + i2c_start(NUNCHUCK_ADDR | I2C_READ); + data = i2c_readNak(); + i2c_stop(); + nunchuck_online(); + } else { + nunchuck_offline(); + } + return data; +} + +// Starting at address, read n bytes and return the last +void nunchuck_readMany(uint8_t address, uint8_t *data, uint8_t count) { + + if(!nunchuckReady) { + nunchuck_init(); + } + + if(!i2c_start(NUNCHUCK_ADDR | I2C_WRITE)) { + i2c_write(address); + i2c_stop(); + + i2c_start(NUNCHUCK_ADDR | I2C_READ); + for(uint8_t i = 0; i < count-1; i++) { + data[i] = i2c_readAck(); + } + data[count-1] = i2c_readNak(); + i2c_stop(); + nunchuck_online(); + } else { + nunchuck_offline(); + } +} + + + + + +void GetNextReport(USB_JoystickReport_Input_t* const reportData, ControllerState *cstate) { + uint8_t data, i; + // Prepare an empty report + memset(reportData, 0, sizeof(USB_JoystickReport_Input_t)); + reportData->LX = STICK_CENTER; + reportData->LY = STICK_CENTER; + reportData->RX = STICK_CENTER; + reportData->RY = STICK_CENTER; + reportData->HAT = HAT_CENTER; + + // Repeat ECHOES times the last report + if (cstate->echoes > 0) { + memcpy(reportData, &last_report, sizeof(USB_JoystickReport_Input_t)); + cstate->echoes--; + return; + } + + // States and moves management + switch (cstate->state) { + case SYNC_CONTROLLER: + if (cstate->report_count > 100) { + cstate->report_count = 0; + cstate->state = TATACON_PASSTHROUGH; + } + else if (cstate->report_count == 25 || cstate->report_count == 50) { + reportData->Button |= SWITCH_L | SWITCH_R; + } + else if (cstate->report_count == 75 || cstate->report_count == 100) { + reportData->Button |= SWITCH_A; + } + cstate->report_count++; + break; + case TATACON_PASSTHROUGH: + // Get tatacon button data + data = nunchuck_readByte(BUTTONS_DATA); + CLEAR(LED_PORT, KAT_LED_PIN); + + // Tatacon has 4 inputs to check + for(i = 0; i < TATACON_SWITCHES; i++) { + // The I2C data starts at the 6th bit and goes down + uint8_t newState = !(data & _BV(TATACON_BUTTONS_START - i)); + if(!switches[i].debounce && switches[i].state != newState) { + SET(LED_PORT, KAT_LED_PIN); + reportData->Button |= tataConfig.switches[i]; + switches[i].state = newState; + switches[i].debounce = tataConfig.debounce; + switchesChanged = 1; + } + } + break; + } + memcpy(&last_report, reportData, sizeof(USB_JoystickReport_Input_t)); + cstate->echoes = ECHOES; +} + + + + +void SetupHardware() { + /* Disable watchdog if enabled by bootloader/fuses */ + MCUSR &= ~(1 << WDRF); + wdt_disable(); + +#ifdef V1_BUILD + CLKPR = (1 << CLKPCE); // enable a change to CLKPR + CLKPR = 0; // set the CLKDIV to 0 - was 0011b = div by 8 taking 8MHz to 1MHz +#endif + clock_prescale_set(clock_div_1); + /* Hardware Initialization */ + SET(LED_DIR, DON_LED_PIN); + SET(LED_DIR, KAT_LED_PIN); + +#ifdef DEBUG + init_usb_stdio(); + SET(LED_PORT, DON_LED_PIN); + for(int i = 0; i < 32; i++) { + TOGGLE(LED_PORT, DON_LED_PIN); + TOGGLE(LED_PORT, KAT_LED_PIN); + _delay_ms(125); + } +#endif + // if(tataConfig.ledsOn) { + // Turn them on until we init with the nunchuck + // SET(LED_PORT, DON_LED_PIN); + // SET(LED_PORT, KAT_LED_PIN); + // } + i2c_init(); + nunchuck_init(); + USB_Init(); +} + +// LUFA USB Events + +// Fired to indicate that the device is enumerating. +void EVENT_USB_Device_Connect(void) { + // We can indicate that we're enumerating here (via status LEDs, sound, etc.). + SET(LED_PORT, DON_LED_PIN); + SET(LED_PORT, KAT_LED_PIN); +} + +// Fired to indicate that the device is no longer connected to a host. +void EVENT_USB_Device_Disconnect(void) { + // We can indicate that our device is not ready (via status LEDs, sound, etc.). + CLEAR(LED_PORT, DON_LED_PIN); + CLEAR(LED_PORT, KAT_LED_PIN); +} + +// Fired when the host set the current configuration of the USB device after enumeration. +void EVENT_USB_Device_ConfigurationChanged(void) { + bool ConfigSuccess = true; + + // We setup the HID report endpoints. + ConfigSuccess &= Endpoint_ConfigureEndpoint(JOYSTICK_OUT_EPADDR, EP_TYPE_INTERRUPT, JOYSTICK_EPSIZE, 1); + ConfigSuccess &= Endpoint_ConfigureEndpoint(JOYSTICK_IN_EPADDR, EP_TYPE_INTERRUPT, JOYSTICK_EPSIZE, 1); + ConfigSuccess &= Endpoint_ConfigureEndpoint(JOYSTICK2_OUT_EPADDR, EP_TYPE_INTERRUPT, JOYSTICK_EPSIZE, 1); + ConfigSuccess &= Endpoint_ConfigureEndpoint(JOYSTICK2_IN_EPADDR, EP_TYPE_INTERRUPT, JOYSTICK_EPSIZE, 1); + // HID_Device_ConfigureEndpoints(&Generic_HID_Interface); + + // We can read ConfigSuccess to indicate a success or failure at this point. + if (ConfigSuccess) { + CLEAR(LED_PORT, DON_LED_PIN); + CLEAR(LED_PORT, KAT_LED_PIN); + } + USB_Device_EnableSOFEvents(); + +} + +// Process control requests sent to the device from the USB host. +void EVENT_USB_Device_ControlRequest(void) { + // We can handle two control requests: a GetReport and a SetReport. + // HID_Device_ProcessControlRequest(&Generic_HID_Interface); + + // Not used here, it looks like we don't receive control request from the Switch. +} + +// Event handler for the USB device Start Of Frame event. +void EVENT_USB_Device_StartOfFrame(void) { + // HID_Device_MillisecondElapsed(&Generic_HID_Interface); + + for(int i = 0; i < TATACON_SWITCHES; i++) { + if(switches[i].debounce) { + switches[i].debounce--; + } + } +} + +// bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, +// uint8_t* const ReportID, +// const uint8_t ReportType, +// void* ReportData, +// uint16_t* const ReportSize) +// { +// if(ReportType != HID_REPORT_ITEM_In) { +// *ReportSize = 0; +// return false; +// } +// if(HIDInterfaceInfo == &Generic_HID_Interface) { +// uint8_t* ConfigReport = (uint8_t*)ReportData; +// memcpy(ConfigReport, &tataConfig, sizeof(tatacon_config_t)); +// *ReportSize = TATACON_CONFIG_BYTES; +// //TOGGLE(LED_PORT, DON_LED_PIN); +// return true; +// } +// *ReportSize = 0; +// return false; +// } + +// // * HID class driver callback function for the processing of HID reports from the host. +// // * +// // * \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced +// // * \param[in] ReportID Report ID of the received report from the host +// // * \param[in] ReportType The type of report that the host has sent, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature +// // * \param[in] ReportData Pointer to a buffer where the received report has been stored +// // * \param[in] ReportSize Size in bytes of the received HID report + +// void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, +// const uint8_t ReportID, +// const uint8_t ReportType, +// const void* ReportData, +// const uint16_t ReportSize) +// { +// if(HIDInterfaceInfo == &Generic_HID_Interface && ReportType == HID_REPORT_ITEM_Out) { +// uint8_t* ConfigReport = (uint8_t*)ReportData; +// // So we can upgrade firmware without having to hit the button +// if(ConfigReport[TATACON_CONFIG_BYTES-1] == MAGIC_RESET_NUMBER) { +// // With this uncommented, reboot fails. Odd. +// //USB_Disable(); +// cli(); + +// // Back to the bootloader +// Boot_Key = MAGIC_BOOT_KEY; +// wdt_enable(WDTO_250MS); +// while(1); +// } +// SetConfig(ConfigReport); +// } +// } \ No newline at end of file diff --git a/Firmware/SwitchDual/Joystick.h b/Firmware/SwitchDual/Joystick.h new file mode 100644 index 0000000..ded9742 --- /dev/null +++ b/Firmware/SwitchDual/Joystick.h @@ -0,0 +1,157 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2014. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2014 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 + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaims all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * + * Header file for Joystick.c. + */ + +#ifndef _JOYSTICK_H_ +#define _JOYSTICK_H_ + +/* Includes: */ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "Descriptors.h" + +// Tatacon USB Pin Config +#define LED_DIR DDRD +#define LED_PORT PORTD +#define DON_LED_PIN 6 +#define KAT_LED_PIN 5 + +// Nunchuck I2C address +#define NUNCHUCK_ADDR (0x52 << 1) +#define BUTTONS_DATA 0x05 +#define TATACON_BUTTONS_START 6 +#define TATACON_SWITCHES 4 + +// Type Defines +// Enumeration for joystick buttons. +typedef enum { + SWITCH_Y = 0x01, + SWITCH_B = 0x02, + SWITCH_A = 0x04, + SWITCH_X = 0x08, + SWITCH_L = 0x10, + SWITCH_R = 0x20, + SWITCH_ZL = 0x40, + SWITCH_ZR = 0x80, + SWITCH_MINUS = 0x100, + SWITCH_PLUS = 0x200, + SWITCH_LCLICK = 0x400, + SWITCH_RCLICK = 0x800, + SWITCH_HOME = 0x1000, + SWITCH_CAPTURE = 0x2000, +} JoystickButtons_t; + +#define HAT_TOP 0x00 +#define HAT_TOP_RIGHT 0x01 +#define HAT_RIGHT 0x02 +#define HAT_BOTTOM_RIGHT 0x03 +#define HAT_BOTTOM 0x04 +#define HAT_BOTTOM_LEFT 0x05 +#define HAT_LEFT 0x06 +#define HAT_TOP_LEFT 0x07 +#define HAT_CENTER 0x08 + +#define STICK_MIN 0 +#define STICK_CENTER 128 +#define STICK_MAX 255 + +// Joystick HID report structure. We have an input and an output. +typedef struct { + uint16_t Button; // 16 buttons; see JoystickButtons_t for bit mapping + uint8_t HAT; // HAT switch; one nibble w/ unused nibble + uint8_t LX; // Left Stick X + uint8_t LY; // Left Stick Y + uint8_t RX; // Right Stick X + uint8_t RY; // Right Stick Y + uint8_t VendorSpec; +} USB_JoystickReport_Input_t; + +// The output is structured as a mirror of the input. +// This is based on initial observations of the Pokken Controller. +typedef struct { + uint16_t Button; // 16 buttons; see JoystickButtons_t for bit mapping + uint8_t HAT; // HAT switch; one nibble w/ unused nibble + uint8_t LX; // Left Stick X + uint8_t LY; // Left Stick Y + uint8_t RX; // Right Stick X + uint8_t RY; // Right Stick Y +} USB_JoystickReport_Output_t; + +typedef enum { + SYNC_CONTROLLER, + TATACON_PASSTHROUGH +} State_t; + +typedef struct controllerState { + State_t state; + int report_count; + int echoes; +} ControllerState; +// Function Prototypes +// Setup all necessary hardware, including USB initialization. +void SetupHardware(void); +// Process and deliver data from IN and OUT endpoints. +void HID_Task(void); +// USB device event handlers. +void EVENT_USB_Device_Connect(void); +void EVENT_USB_Device_Disconnect(void); +void EVENT_USB_Device_ConfigurationChanged(void); +void EVENT_USB_Device_ControlRequest(void); +//void EVENT_USB_Device_StartOfFrame(void); + +// Prepare the next report for the host. +void GetNextReport(USB_JoystickReport_Input_t* const ReportData, ControllerState *cstate); +bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, + uint8_t* const ReportID, + const uint8_t ReportType, + void* ReportData, + uint16_t* const ReportSize); +void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, + const uint8_t ReportID, + const uint8_t ReportType, + const void* ReportData, + const uint16_t ReportSize); +#endif diff --git a/Firmware/SwitchDual/asciihid.h b/Firmware/SwitchDual/asciihid.h new file mode 100644 index 0000000..9f66468 --- /dev/null +++ b/Firmware/SwitchDual/asciihid.h @@ -0,0 +1,145 @@ +// https://github.com/SFE-Chris/UNO-HIDKeyboard-Library/blob/master/HIDKeyboard.h + +#include + +// HID Values of Function Keys +#define F1 0x3a +#define F2 0x3b +#define F3 0x3c +#define F4 0x3d +#define F5 0x3e +#define F6 0x3f +#define F7 0x40 +#define F8 0x41 +#define F9 0x42 +#define F10 0x43 +#define F11 0x44 +#define F12 0x45 + +// HID Values of Special Keys +#define ENTER 0x28 +#define ESCAPE 0x29 +#define BACKSPACE 0x2a +#define TAB 0x2b +#define SPACEBAR 0x2c +#define CAPSLOCK 0x39 +#define PRINTSCREEN 0x46 +#define SCROLLLOCK 0x47 +#define PAUSE 0x48 +#define INSERT 0x49 +#define HOME 0x4a +#define PAGEUP 0x4b +#define DELETE 0x4c +#define END 0x4d +#define PAGEDOWN 0x4e +#define RIGHTARROW 0x4f +#define LEFTARROW 0x50 +#define DOWNARROW 0x51 +#define UPARROW 0x52 + +// HID Values of Keypad Keys +#define NUMLOCK 0x53 +#define KEYPADSLASH 0x54 +#define KEYPADSTAR 0x55 +#define KEYPADMINUS 0x56 +#define KEYPADPLUS 0x57 +#define KEYPADENTER 0x58 +#define KEYPAD1 0x59 +#define KEYPAD2 0x5a +#define KEYPAD3 0x5b +#define KEYPAD4 0x5c +#define KEYPAD5 0x5d +#define KEYPAD6 0x5e +#define KEYPAD7 0x5f +#define KEYPAD8 0x60 +#define KEYPAD9 0x61 +#define KEYPAD0 0x62 +#define KEYPADPERIOD 0x63 + +// HID Values of System Keys +#define KEYBOARDAPPLICATION 0x65 +#define KEYBOARDPOWER 0x66 +#define VOLUMEMUTE 0x7f +#define VOLUMEUP 0x80 +#define VOLUMEDOWN 0x81 + +// Common-use modifiers +#define CTRL 0x01 +#define SHIFT 0x02 +#define ALT 0x04 +#define GUI 0x08 + + +/**************************************************************************** + * + * ASCII->HID LOOKUP TABLE + * + * Taken from the HID Table definition at + * http://www.usb.org/developers/devclass_docs/Hut1_11.pdf + * + * This array maps the ASCII value of a type-able character to its + * corresponding HID value. + * + * Example: + * 'a' = ASCII value 97 = HID value 0x04 + * HIDTable['a'] = HIDTable[97] = 0x04 + * + * NOTE: + * "Shift Modified" HID values are the same as the non Shift-Modified values + * for any given character, e.g. the HID value for '2' is equal to the + * HID value for '@'. The Shift-Modified value is sent by setting the + * modifier value (buf[0]) to the corresponding modifier value in the + * modifier table. + * + ****************************************************************************/ +const PROGMEM uint8_t HIDTable[] = { + 0x00, // 0 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x28, // 10 + 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 20 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, // 30 + 0x00, 0x2c, 0x1e, 0x34, 0x20, 0x21, 0x22, 0x24, 0x34, 0x26, // 40 + 0x27, 0x25, 0x2e, 0x36, 0x2d, 0x37, 0x38, 0x27, 0x1e, 0x1f, // 50 + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x33, 0x33, 0x36, // 60 + 0x2e, 0x37, 0x38, 0x1f, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, // 70 + 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, // 80 + 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, // 90 + 0x2f, 0x31, 0x30, 0x23, 0x2d, 0x35, 0x04, 0x05, 0x06, 0x07, // 100 + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, // 110 + 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, // 120 + 0x1c, 0x1d, 0x2f, 0x31, 0x30, 0x35, 127 // 127 +}; + + +/**************************************************************************** + * + * ASCII->MODIFIER LOOKUP TABLE + * + * Looks up whether or not the HID report should use the SHIFT modifier. + * + * Example: + * The character '2' and the character '@' have different ASCII values but + * the same HID value. This table uses the ASCII value to determine if + * we should hold shift while sending the key. e.g.: + * + * HIDTable['2'] = 0x1f and modifierTable['2'] = 0 + * HIDTable['@'] = 0x1f and modifierTable['@'] = SHIFT + * + * There's probaly a better way to do this, but it's functional. + * + ****************************************************************************/ +const PROGMEM uint8_t modifierTable[] = { + 0x00, // 0 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 10 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 20 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 30 + 0x00, 0x00, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, // 40 + SHIFT, 0x00, SHIFT, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 50 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, SHIFT, 0x00, SHIFT, // 60 + 0x00, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, // 70 + SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, // 80 + SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, // 90 + 0x00, 0x00, 0x00, SHIFT, SHIFT, 0x00, 0x00, 0x00, 0x00, 0x00, // 100 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 110 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 120 + 0x00, 0x00, SHIFT, SHIFT, SHIFT, SHIFT, 0x00 // 127 +}; \ No newline at end of file diff --git a/Firmware/SwitchDual/i2cmaster.S b/Firmware/SwitchDual/i2cmaster.S new file mode 100644 index 0000000..0670117 --- /dev/null +++ b/Firmware/SwitchDual/i2cmaster.S @@ -0,0 +1,366 @@ +;************************************************************************* +; Title : I2C (Single) Master Implementation +; Author: Peter Fleury http://jump.to/fleury +; based on Atmel Appl. Note AVR300 +; File: $Id: i2cmaster.S,v 1.12 2008/03/02 08:51:27 peter Exp $ +; Software: AVR-GCC 3.3 or higher +; Target: any AVR device +; +; DESCRIPTION +; Basic routines for communicating with I2C slave devices. This +; "single" master implementation is limited to one bus master on the +; I2C bus. +; +; Based on the Atmel Application Note AVR300, corrected and adapted +; to GNU assembler and AVR-GCC C call interface +; Replaced the incorrect quarter period delays found in AVR300 with +; half period delays. + +; Tweaked by monty for true 400KHz operation at 8MHz system clock on an +; atmega16u2. Duty cycle adjusted for correct 400KHz spec adherence. +; +; 7 cycles = 0.875us high +; 13 cycles = 1.625us low +; +; USAGE +; These routines can be called from C, refere to file i2cmaster.h. +; See example test_i2cmaster.c +; Adapt the SCL and SDA port and pin definitions and eventually +; the delay routine to your target ! +; Use 4.7k pull-up resistor on the SDA and SCL pin. +; +; NOTES +; The I2C routines can be called either from non-interrupt or +; interrupt routines, not both. +; +;************************************************************************* + +#if (__GNUC__ * 100 + __GNUC_MINOR__) < 303 +#error "This library requires AVR-GCC 3.3 or later, update to newer AVR-GCC compiler !" +#endif + + +#include + + + +;***** Adapt these SCA and SCL port and pin definition to your target !! +; +; V1 had different I2C pinouts +#ifdef V1_BUILD + #define SDA 1 ; SDA Port D, Pin 4 + #define SCL 0 ; SCL Port D, Pin 5 + #define SDA_PORT PORTD + #define SCL_PORT PORTD +#else + #define SDA 4 ; SDA Port D, Pin 4 + #define SCL 3 ; SCL Port D, Pin 3 + #define SDA_PORT PORTD + #define SCL_PORT PORTD +#endif + +;****** + +;-- map the IO register back into the IO address space +#define SDA_DDR (_SFR_IO_ADDR(SDA_PORT) - 1) +#define SCL_DDR (_SFR_IO_ADDR(SCL_PORT) - 1) +#define SDA_OUT _SFR_IO_ADDR(SDA_PORT) +#define SCL_OUT _SFR_IO_ADDR(SCL_PORT) +#define SDA_IN (_SFR_IO_ADDR(SDA_PORT) - 2) +#define SCL_IN (_SFR_IO_ADDR(SCL_PORT) - 2) + + +#ifndef __tmp_reg__ +#define __tmp_reg__ 0 +#endif + + + .section .text + +;************************************************************************* +; delay half period +; For I2C in normal mode (100kHz), use T/2 > 5us +; For I2C in fast mode (400kHz), use T/2 > 1.3us +;************************************************************************* + .stabs "",100,0,0,i2c_delay_T2 + .stabs "i2cmaster.S",100,0,0,i2c_delay_T2 + .func i2c_delay_T2 ; delay 1.25 microsec with 8 Mhz crystal +i2c_delay_T2: ; 4 cycles + ret ; 5 " + .endfunc ; total 9 cyles = 1.25 microsec with 8 Mhz crystal, IO op happens on the 10th + +;************************************************************************* +; delay 40 microseconds, to give the slave time to do stuff +;************************************************************************* + .func i2c_delay_40us +i2c_delay_40us: ; 4 cycles + push r16 ; 2 + ldi r16, 102 ; 1 +delay: + dec r16 ; 1 + brne delay ; 2 + ; 1 + pop r16 ; 2 + ret ; 5 + .endfunc ; total 321 cyles almost 40 microsec with 8 Mhz crystal + + +;************************************************************************* +; Initialization of the I2C bus interface. Need to be called only once +; +; extern void i2c_init(void) +;************************************************************************* + .global i2c_init + .func i2c_init +i2c_init: + cbi SDA_DDR,SDA ;release SDA + cbi SCL_DDR,SCL ;release SCL + cbi SDA_OUT,SDA + cbi SCL_OUT,SCL + ret + .endfunc + + +;************************************************************************* +; Issues a start condition and sends address and transfer direction. +; return 0 = device accessible, 1= failed to access device +; +; extern unsigned char i2c_start(unsigned char addr); +; addr = r24, return = r25(=0):r24 +;************************************************************************* + + .global i2c_start + .func i2c_start +i2c_start: + sbi SDA_DDR,SDA ;force SDA low + rcall i2c_delay_T2 ;delay T/2 + + rcall i2c_write ;write address + ret + .endfunc + + +;************************************************************************* +; Issues a repeated start condition and sends address and transfer direction. +; return 0 = device accessible, 1= failed to access device +; +; extern unsigned char i2c_rep_start(unsigned char addr); +; addr = r24, return = r25(=0):r24 +;************************************************************************* + + .global i2c_rep_start + .func i2c_rep_start +i2c_rep_start: + sbi SCL_DDR,SCL ;force SCL low + rcall i2c_delay_T2 ;delay T/2 + cbi SDA_DDR,SDA ;release SDA + rcall i2c_delay_T2 ;delay T/2 + cbi SCL_DDR,SCL ;release SCL + rcall i2c_delay_T2 ;delay T/2 + sbi SDA_DDR,SDA ;force SDA low + rcall i2c_delay_T2 ;delay T/2 + + rcall i2c_write ;write address + ret + .endfunc + + +;************************************************************************* +; Issues a start condition and sends address and transfer direction. +; If device is busy, use ack polling to wait until device is ready +; +; extern void i2c_start_wait(unsigned char addr); +; addr = r24 +;************************************************************************* + + .global i2c_start_wait + .func i2c_start_wait +i2c_start_wait: + mov __tmp_reg__,r24 +i2c_start_wait1: + sbi SDA_DDR,SDA ;force SDA low + rcall i2c_delay_T2 ;delay T/2 + mov r24,__tmp_reg__ + rcall i2c_write ;write address + tst r24 ;if device not busy -> done + breq i2c_start_wait_done + rcall i2c_stop ;terminate write operation + rjmp i2c_start_wait1 ;device busy, poll ack again +i2c_start_wait_done: + ret + .endfunc + + +;************************************************************************* +; Terminates the data transfer and releases the I2C bus +; +; extern void i2c_stop(void) +;************************************************************************* + + .global i2c_stop + .func i2c_stop +i2c_stop: + sbi SCL_DDR,SCL ;force SCL low + sbi SDA_DDR,SDA ;force SDA low + rcall i2c_delay_T2 ;delay T/2 + cbi SCL_DDR,SCL ;release SCL + rcall i2c_delay_T2 ;delay T/2 +i2c_stop_wait: + ;wait SCL high (in case wait states are inserted) + sbis SCL_IN,SCL ; 2 + rjmp i2c_stop_wait + cbi SDA_DDR,SDA ;release SDA + rcall i2c_delay_T2 ;delay T/2 + rcall i2c_delay_40us ; delay 40us to let slave catch its breath + ret + .endfunc + + +;************************************************************************* +; Send one byte to I2C device +; return 0 = write successful, 1 = write failed +; +; extern unsigned char i2c_write( unsigned char data ); +; data = r24, return = r25(=0):r24 +;************************************************************************* + .global i2c_write + .func i2c_write +i2c_write: + sec ;set carry flag ; + rol r24 ;shift in carry and out bit one ; + rjmp i2c_write_first ; +i2c_write_bit: + lsl r24 ;if transmit register empty ; 1 + breq i2c_get_ack ; 1 + nop ; 1 +i2c_write_first: + ; 7 since the last cbi + sbi SCL_DDR,SCL ;force SCL low ; 2 + brcc i2c_write_low ; 1 + nop ; 1 + cbi SDA_DDR,SDA ;release SDA ; 2 + rjmp i2c_write_high ; 2 +i2c_write_low: ; 1 + sbi SDA_DDR,SDA ;force SDA low ; 2 + rjmp i2c_write_high ; 2 +i2c_write_high: + nop + nop + nop + nop + nop + ; 13 since the last + cbi SCL_DDR,SCL ;release SCL ; 2 +i2c_write_wait: + ;wait SCL high (in case wait states are inserted) + sbis SCL_IN,SCL ; 2 + rjmp i2c_write_wait + + rjmp i2c_write_bit ; 2 + +i2c_get_ack: ; 1 + sbi SCL_DDR,SCL ;force SCL low + cbi SDA_DDR,SDA ;release SDA + nop + nop + nop + nop + nop + nop + nop + nop + nop + cbi SCL_DDR,SCL ;release SCL +i2c_ack_wait: + sbis SCL_IN,SCL ;wait SCL high (in case wait states are inserted) + rjmp i2c_ack_wait + + clr r24 ;return 0 + sbic SDA_IN,SDA ;if SDA high -> return 1 + ldi r24,1 + sbi SCL_DDR,SCL ;force SCL low + rcall i2c_delay_T2 ;delay T/2 + clr r25 + ret + .endfunc + + + +;************************************************************************* +; read one byte from the I2C device, send ack or nak to device +; (ack=1, send ack, request more data from device +; ack=0, send nak, read is followed by a stop condition) +; +; extern unsigned char i2c_read(unsigned char ack); +; ack = r24, return = r25(=0):r24 +; extern unsigned char i2c_readAck(void); +; extern unsigned char i2c_readNak(void); +; return = r25(=0):r24 +;************************************************************************* + .global i2c_readAck + .global i2c_readNak + .global i2c_read + .func i2c_read +i2c_readNak: + clr r24 + rjmp i2c_read +i2c_readAck: + ldi r24,0x01 +i2c_read: + ldi r23,0x01 ;data = 0x01 +i2c_read_bit: + sbi SCL_DDR,SCL ;force SCL low ; 2 + nop ; 1 + nop ; 1 + nop ; 1 + nop ; 1 + nop ; 1 + nop ; 1 + nop ; 1 + nop ; 1 + nop ; 1 + nop ; 1 + nop ; 1 + + cbi SCL_DDR,SCL ;release SCL ; 2 + +i2c_read_stretch: + ;loop until SCL is high (allow slave to stretch SCL) + sbis SCL_IN, SCL ; 2 + rjmp i2c_read_stretch + ; + clc ;clear carry flag ; 1 + sbic SDA_IN,SDA ;if SDA is high ; 2 + sec ; set carry flag + ; + rol r23 ;store bit ; 1 + ;while receive register not full + brcc i2c_read_bit ; 2 + +i2c_put_ack: + sbi SCL_DDR,SCL ;force SCL low + cpi r24,1 + breq i2c_put_ack_low ;if (ack=0) + cbi SDA_DDR,SDA ; release SDA + rjmp i2c_put_ack_high +i2c_put_ack_low: ;else + sbi SDA_DDR,SDA ; force SDA low + nop +i2c_put_ack_high: + nop + nop + nop + nop + nop + cbi SCL_DDR,SCL ;release SCL +i2c_put_ack_wait: + sbis SCL_IN,SCL ;wait SCL high + rjmp i2c_put_ack_wait + nop + mov r24,r23 + clr r25 + sbi SCL_DDR,SCL ;force SCL low + cbi SDA_DDR,SDA ;release SDA + ret + .endfunc + diff --git a/Firmware/SwitchDual/i2cmaster.h b/Firmware/SwitchDual/i2cmaster.h new file mode 100644 index 0000000..3917b9e --- /dev/null +++ b/Firmware/SwitchDual/i2cmaster.h @@ -0,0 +1,178 @@ +#ifndef _I2CMASTER_H +#define _I2CMASTER_H 1 +/************************************************************************* +* Title: C include file for the I2C master interface +* (i2cmaster.S or twimaster.c) +* Author: Peter Fleury http://jump.to/fleury +* File: $Id: i2cmaster.h,v 1.10 2005/03/06 22:39:57 Peter Exp $ +* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3 +* Target: any AVR device +* Usage: see Doxygen manual +**************************************************************************/ + +#ifdef DOXYGEN +/** + @defgroup pfleury_ic2master I2C Master library + @code #include @endcode + + @brief I2C (TWI) Master Software Library + + Basic routines for communicating with I2C slave devices. This single master + implementation is limited to one bus master on the I2C bus. + + This I2c library is implemented as a compact assembler software implementation of the I2C protocol + which runs on any AVR (i2cmaster.S) and as a TWI hardware interface for all AVR with built-in TWI hardware (twimaster.c). + Since the API for these two implementations is exactly the same, an application can be linked either against the + software I2C implementation or the hardware I2C implementation. + + Use 4.7k pull-up resistor on the SDA and SCL pin. + + Adapt the SCL and SDA port and pin definitions and eventually the delay routine in the module + i2cmaster.S to your target when using the software I2C implementation ! + + Adjust the CPU clock frequence F_CPU in twimaster.c or in the Makfile when using the TWI hardware implementaion. + + @note + The module i2cmaster.S is based on the Atmel Application Note AVR300, corrected and adapted + to GNU assembler and AVR-GCC C call interface. + Replaced the incorrect quarter period delays found in AVR300 with + half period delays. + + @author Peter Fleury pfleury@gmx.ch http://jump.to/fleury + + @par API Usage Example + The following code shows typical usage of this library, see example test_i2cmaster.c + + @code + + #include + + + #define Dev24C02 0xA2 // device address of EEPROM 24C02, see datasheet + + int main(void) + { + unsigned char ret; + + i2c_init(); // initialize I2C library + + // write 0x75 to EEPROM address 5 (Byte Write) + i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode + i2c_write(0x05); // write address = 5 + i2c_write(0x75); // write value 0x75 to EEPROM + i2c_stop(); // set stop conditon = release bus + + + // read previously written value back from EEPROM address 5 + i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode + + i2c_write(0x05); // write address = 5 + i2c_rep_start(Dev24C02+I2C_READ); // set device address and read mode + + ret = i2c_readNak(); // read one byte from EEPROM + i2c_stop(); + + for(;;); + } + @endcode + +*/ +#endif /* DOXYGEN */ + +/**@{*/ + +#if (__GNUC__ * 100 + __GNUC_MINOR__) < 304 +#error "This library requires AVR-GCC 3.4 or later, update to newer AVR-GCC compiler !" +#endif + +#include + +/** defines the data direction (reading from I2C device) in i2c_start(),i2c_rep_start() */ +#define I2C_READ 1 + +/** defines the data direction (writing to I2C device) in i2c_start(),i2c_rep_start() */ +#define I2C_WRITE 0 + + +/** + @brief initialize the I2C master interace. Need to be called only once + @param void + @return none + */ +extern void i2c_init(void); + + +/** + @brief Terminates the data transfer and releases the I2C bus + @param void + @return none + */ +extern void i2c_stop(void); + + +/** + @brief Issues a start condition and sends address and transfer direction + + @param addr address and transfer direction of I2C device + @retval 0 device accessible + @retval 1 failed to access device + */ +extern unsigned char i2c_start(unsigned char addr); + + +/** + @brief Issues a repeated start condition and sends address and transfer direction + + @param addr address and transfer direction of I2C device + @retval 0 device accessible + @retval 1 failed to access device + */ +extern unsigned char i2c_rep_start(unsigned char addr); + + +/** + @brief Issues a start condition and sends address and transfer direction + + If device is busy, use ack polling to wait until device ready + @param addr address and transfer direction of I2C device + @return none + */ +extern void i2c_start_wait(unsigned char addr); + + +/** + @brief Send one byte to I2C device + @param data byte to be transfered + @retval 0 write successful + @retval 1 write failed + */ +extern unsigned char i2c_write(unsigned char data); + + +/** + @brief read one byte from the I2C device, request more data from device + @return byte read from I2C device + */ +extern unsigned char i2c_readAck(void); + +/** + @brief read one byte from the I2C device, read is followed by a stop condition + @return byte read from I2C device + */ +extern unsigned char i2c_readNak(void); + +/** + @brief read one byte from the I2C device + + Implemented as a macro, which calls either i2c_readAck or i2c_readNak + + @param ack 1 send ack, request more data from device
+ 0 send nak, read is followed by a stop condition + @return byte read from I2C device + */ +extern unsigned char i2c_read(unsigned char ack); +#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); + + +/**@}*/ +#endif diff --git a/Firmware/SwitchDual/makefile b/Firmware/SwitchDual/makefile new file mode 100644 index 0000000..b3b8f4e --- /dev/null +++ b/Firmware/SwitchDual/makefile @@ -0,0 +1,85 @@ +# +# LUFA Library +# Copyright (C) Dean Camera, 2014. +# +# dean [at] fourwalledcubicle [dot] com +# www.lufa-lib.org +# +# -------------------------------------- +# LUFA Project Makefile. +# -------------------------------------- + +# Run "make help" for target help. + +MCU = atmega16u2 +ARCH = AVR8 +#BOARD = USER +F_CPU = 8000000 +F_USB = $(F_CPU) +OPTIMIZATION = s +TARGET = Joystick +SRC = $(TARGET).c Descriptors.c i2cmaster.S Config.c usbio.c $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS) +LUFA_PATH = ../LUFA +CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ +LD_FLAGS = + +AVRDUDE = avrdude -B 8 -c usbasp -p $(MCU) + + +# Default target +all: + +# 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 LUFA build script makefiles +DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS +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 + +v1: CC_FLAGS += -DV1_BUILD +v1: clean all + +debug: CC_FLAGS += -DDEBUG +debug: clean flash + +v1debug: CC_FLAGS += -DV1_BUILD -DDEBUG +v1debug: clean all + +init: erase wfuse flashboot flash + +initboot: erase wfuse flashboot + +erase: + $(AVRDUDE) -e + +rfuse: + $(AVRDUDE) -U hfuse:r:-:h -U lfuse:r:-:h -U efuse:r:-:h + +wfuse: + $(AVRDUDE) -U lfuse:w:0xde:m -U hfuse:w:0xdb:m -U efuse:w:0xf6:m + +# To make this hex, compile HID Bootloader in LUFA +# FLASH_SIZE_KB := 16 +# BOOT_SECTION_SIZE_KB := 2 +# MCU = atmega16u2 +# ARCH = AVR8 +flashboot: + $(AVRDUDE) -U flash:w:DFU/BootloaderHID.hex:i + +flash: all + sleep 1 + python2 ../DFUHID/hid_bootloader_loader.py atmega16u2 Joystick.hex + +flashC: all + sleep 1 + ../DFUHID/hid_bootloader_cli -mmcu=atmega16u2 -r Joystick.hex \ No newline at end of file diff --git a/Firmware/SwitchDual/usbio.c b/Firmware/SwitchDual/usbio.c new file mode 100644 index 0000000..37f250f --- /dev/null +++ b/Firmware/SwitchDual/usbio.c @@ -0,0 +1,114 @@ +/* + * FILE: usbio.c + * + * Original UART code by Peter Sutton. + * Adapted for USB by William Toohey. + * + * Module to allow standard output routines to be used via + * USB keyboard typing. The init_serial_stdio() method must be called before + * any standard IO methods (e.g. printf). We use a circular buffer to + * store output messages. + */ + +#include +#include +#include + +#include + +/* Global variables */ +/* Circular buffer to hold outgoing characters. The insert_pos variable + * keeps track of the position (0 to OUTPUT_BUFFER_SIZE-1) that the next + * outgoing character should be written to. bytes_in_buffer keeps + * count of the number of characters currently stored in the buffer + * (ranging from 0 to OUTPUT_BUFFER_SIZE). This number of bytes immediately + * prior to the current insert_pos are the bytes waiting to be output. + * If the insert_pos reaches the end of the buffer it will wrap around + * to the beginning (assuming those bytes have been output). + * NOTE - OUTPUT_BUFFER_SIZE can not be larger than 255 without changing + * the type of the variables below. + */ +#define OUTPUT_BUFFER_SIZE 255 +char out_buffer[OUTPUT_BUFFER_SIZE]; +uint8_t out_insert_pos; +uint8_t bytes_in_out_buffer; +// Whether we should be depressing or releasing a key +uint8_t liftoff = 0; + +static int usb_put_char(char, FILE*); + +/* Setup a stream that uses the uart get and put functions. We will + * make standard input and output use this stream below. + */ +static FILE myStream = FDEV_SETUP_STREAM(usb_put_char, NULL, + _FDEV_SETUP_WRITE); + +void init_usb_stdio(void) { + /* + * Initialise our buffers + */ + out_insert_pos = 0; + bytes_in_out_buffer = 0; + + /* Set up our stream so the put function below is used + * to write characters via the USB port when we use + * stdio functions + */ + stdout = &myStream; +} + +static int usb_put_char(char c, FILE* stream) { + /* Add the character to the buffer for transmission if there + * is space to do so. We advance the insert_pos to the next + * character position. If this is beyond the end of the buffer + * we wrap around back to the beginning of the buffer + */ + // Drop overrun + if(bytes_in_out_buffer >= OUTPUT_BUFFER_SIZE) { + return 0; + } + out_buffer[out_insert_pos++] = c; + bytes_in_out_buffer++; + if(out_insert_pos == OUTPUT_BUFFER_SIZE) { + /* Wrap around buffer pointer if necessary */ + out_insert_pos = 0; + } + return 0; +} + +int make_report(USB_KeyboardReport_Data_t *KeyboardReport) { + if(liftoff) { + liftoff = 0; + return 1; + } else { + /* Check if we have data in our buffer */ + if(bytes_in_out_buffer > 0) { + /* Yes we do - remove the pending byte and output it + * via the USB. The pending byte (character) is the + * one which is "bytes_in_buffer" characters before the + * insert_pos (taking into account that we may + * need to wrap around to the end of the buffer). + */ + char c; + if(out_insert_pos - bytes_in_out_buffer < 0) { + /* Need to wrap around */ + c = out_buffer[out_insert_pos - bytes_in_out_buffer + + OUTPUT_BUFFER_SIZE]; + } else { + c = out_buffer[out_insert_pos - bytes_in_out_buffer]; + } + /* Decrement our count of the number of bytes in the + * buffer + */ + bytes_in_out_buffer--; + + /* Output the character via USB, converting to scancode */ + KeyboardReport->KeyCode[0] = pgm_read_byte(&HIDTable[(uint8_t)c]); + KeyboardReport->Modifier = pgm_read_byte(&modifierTable[(uint8_t)c]); + liftoff = 1; + return 1; + } else { + return 0; + } + } +} diff --git a/Firmware/SwitchDual/usbio.h b/Firmware/SwitchDual/usbio.h new file mode 100644 index 0000000..e3e379d --- /dev/null +++ b/Firmware/SwitchDual/usbio.h @@ -0,0 +1,20 @@ +/* + * serialio.h + * + * Author: Peter Sutton + * + * Modified by William Toohey + */ + +#ifndef SERIALIO_H_ +#define SERIALIO_H_ + +#include +#include + +/* Initialise IO using USB. + */ +void init_usb_stdio(void); +int make_report(USB_KeyboardReport_Data_t*); + +#endif /* SERIALIO_H_ */ \ No newline at end of file diff --git a/Firmware/SwitchPro/Config.c b/Firmware/SwitchPro/Config.c new file mode 100644 index 0000000..7a3f072 --- /dev/null +++ b/Firmware/SwitchPro/Config.c @@ -0,0 +1,42 @@ +#include +#include "Joystick.h" + +#include +#include + +#define MAGIC_NUMBER 43 + +static const tatacon_config_t defaults PROGMEM = { + .switches = { + // SWITCH ORDER: CenterLeft, RimLeft, CenterRight, RimRight + // ---- osu default + SWITCH_LCLICK, + SWITCH_ZL, + SWITCH_RCLICK, + SWITCH_ZR }, + .ledsOn = true, + .debounce = 30 +}; + +uint8_t firstRun EEMEM; // init to 255 +tatacon_config_t eeConfig EEMEM; + +tatacon_config_t tataConfig; + +void InitConfig(void) { + if (eeprom_read_byte(&firstRun) != MAGIC_NUMBER) { // store defaults + memcpy_P(&tataConfig, &defaults, sizeof(tatacon_config_t)); + eeprom_write_block(&tataConfig, &eeConfig, sizeof(tatacon_config_t)); + eeprom_write_byte(&firstRun, MAGIC_NUMBER); // defaults set + } + eeprom_read_block(&tataConfig, &eeConfig, sizeof(tatacon_config_t)); + tataConfig.version = FIRMWARE_VERSION; +} + +void SetConfig(uint8_t* config) { + memcpy(&tataConfig, config, sizeof(tatacon_config_t)); + // Version is set in firmware, not software + tataConfig.version = FIRMWARE_VERSION; + + eeprom_write_block(&tataConfig, &eeConfig, sizeof(tatacon_config_t)); +} \ No newline at end of file diff --git a/Firmware/SwitchPro/Config.h b/Firmware/SwitchPro/Config.h new file mode 100644 index 0000000..da3db28 --- /dev/null +++ b/Firmware/SwitchPro/Config.h @@ -0,0 +1,27 @@ +#ifndef _CONFIG_H +#define _CONFIG_H + +#include +#include +#include + +// For ease of code sharing with the OsuPad +#define KB_SWITCHES 4 +#define TATACON_CONFIG_BYTES 12 +#define MAGIC_RESET_NUMBER 42 +#define FIRMWARE_VERSION 20 + +typedef struct { + // SWITCH ORDER: CenterLeft, RimLeft, CenterRight, RimRight + uint16_t switches[KB_SWITCHES]; + bool ledsOn; + uint8_t debounce; + uint8_t version; +} tatacon_config_t; + +extern tatacon_config_t tataConfig; + +extern void InitConfig(void); +extern void SetConfig(uint8_t* config); + +#endif \ No newline at end of file diff --git a/Firmware/SwitchPro/Config/LUFAConfig.h b/Firmware/SwitchPro/Config/LUFAConfig.h new file mode 100644 index 0000000..5fae1fa --- /dev/null +++ b/Firmware/SwitchPro/Config/LUFAConfig.h @@ -0,0 +1,84 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2014. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2014 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 + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaims all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief LUFA Library Configuration Header File + * + * This header file is used to configure LUFA's compile time options, + * as an alternative to the compile time constants supplied through + * a makefile. + * + * For information on what each token does, refer to the LUFA + * manual section "Summary of Compile Tokens". + */ + +#ifndef _LUFA_CONFIG_H_ +#define _LUFA_CONFIG_H_ + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ +// #define ORDERED_EP_CONFIG + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL) + #define USB_DEVICE_ONLY +// #define USB_HOST_ONLY +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE +// #define INTERRUPT_CONTROL_ENDPOINT +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + + /* USB Host Mode Driver Related Tokens: */ +// #define HOST_STATE_AS_GPIOR {Insert Value Here} +// #define USB_HOST_TIMEOUT_MS {Insert Value Here} +// #define HOST_DEVICE_SETTLE_DELAY_MS {Insert Value Here} +// #define NO_AUTO_VBUS_MANAGEMENT +// #define INVERTED_VBUS_ENABLE_LINE +#endif diff --git a/Firmware/SwitchPro/Descriptors.c b/Firmware/SwitchPro/Descriptors.c new file mode 100644 index 0000000..39824fd --- /dev/null +++ b/Firmware/SwitchPro/Descriptors.c @@ -0,0 +1,289 @@ +#include "Descriptors.h" +#include "Config.h" +// HID Descriptors. +const USB_Descriptor_HIDReport_Datatype_t PROGMEM JoystickReport[] = { + HID_RI_USAGE_PAGE(8,1), /* Generic Desktop */ + HID_RI_USAGE(8,5), /* Joystick */ + HID_RI_COLLECTION(8,1), /* Application */ + // Buttons (2 bytes) + HID_RI_LOGICAL_MINIMUM(8,0), + HID_RI_LOGICAL_MAXIMUM(8,1), + HID_RI_PHYSICAL_MINIMUM(8,0), + HID_RI_PHYSICAL_MAXIMUM(8,1), + // The Switch will allow us to expand the original HORI descriptors to a full 16 buttons. + // The Switch will make use of 14 of those buttons. + HID_RI_REPORT_SIZE(8,1), + HID_RI_REPORT_COUNT(8,16), + HID_RI_USAGE_PAGE(8,9), + HID_RI_USAGE_MINIMUM(8,1), + HID_RI_USAGE_MAXIMUM(8,16), + HID_RI_INPUT(8,2), + // HAT Switch (1 nibble) + HID_RI_USAGE_PAGE(8,1), + HID_RI_LOGICAL_MAXIMUM(8,7), + HID_RI_PHYSICAL_MAXIMUM(16,315), + HID_RI_REPORT_SIZE(8,4), + HID_RI_REPORT_COUNT(8,1), + HID_RI_UNIT(8,20), + HID_RI_USAGE(8,57), + HID_RI_INPUT(8,66), + // There's an additional nibble here that's utilized as part of the Switch Pro Controller. + // I believe this -might- be separate U/D/L/R bits on the Switch Pro Controller, as they're utilized as four button descriptors on the Switch Pro Controller. + HID_RI_UNIT(8,0), + HID_RI_REPORT_COUNT(8,1), + HID_RI_INPUT(8,1), + // Joystick (4 bytes) + HID_RI_LOGICAL_MAXIMUM(16,255), + HID_RI_PHYSICAL_MAXIMUM(16,255), + HID_RI_USAGE(8,48), + HID_RI_USAGE(8,49), + HID_RI_USAGE(8,50), + HID_RI_USAGE(8,53), + HID_RI_REPORT_SIZE(8,8), + HID_RI_REPORT_COUNT(8,4), + HID_RI_INPUT(8,2), + // ??? Vendor Specific (1 byte) + // This byte requires additional investigation. + HID_RI_USAGE_PAGE(16,65280), + HID_RI_USAGE(8,32), + HID_RI_REPORT_COUNT(8,1), + HID_RI_INPUT(8,2), + // Output (8 bytes) + // Original observation of this suggests it to be a mirror of the inputs that we sent. + // The Switch requires us to have these descriptors available. + HID_RI_USAGE(16,9761), + HID_RI_REPORT_COUNT(8,8), + HID_RI_OUTPUT(8,2), + HID_RI_END_COLLECTION(0), +}; + +/** HID class report descriptor. This is a special descriptor constructed with values from the + * USBIF HID class specification to describe the reports and capabilities of the HID device. This + * descriptor is parsed by the host and its contents used to determine what data (and in what encoding) + * the device will send, and what it may be sent back from the host. Refer to the HID specification for + * more details on HID report descriptors. + */ +const USB_Descriptor_HIDReport_Datatype_t PROGMEM GenericReport[] = +{ + HID_RI_USAGE_PAGE(16, 0xFFDC), /* Vendor Page 0xDC */ + HID_RI_USAGE(8, 0xFB), /* Vendor Usage 0xFB */ + HID_RI_COLLECTION(8, 0x01), /* Vendor Usage 1 */ + HID_RI_USAGE(8, 0x02), /* Vendor Usage 2 */ + HID_RI_LOGICAL_MINIMUM(8, 0x00), + HID_RI_LOGICAL_MAXIMUM(8, 0xFF), + HID_RI_REPORT_SIZE(8, 8), + HID_RI_REPORT_COUNT(8, TATACON_CONFIG_BYTES), + HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE), + + HID_RI_USAGE(8, 0x02), /* Vendor Usage 2 */ + HID_RI_LOGICAL_MINIMUM(8, 0x00), + HID_RI_LOGICAL_MAXIMUM(8, 0xFF), + HID_RI_REPORT_SIZE(8, 8), + HID_RI_REPORT_COUNT(8, TATACON_CONFIG_BYTES), + HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE), + HID_RI_END_COLLECTION(0), +}; +// Device Descriptor Structure +const USB_Descriptor_Device_t PROGMEM DeviceDescriptor = { + .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, + + .USBSpecification = VERSION_BCD(2,0,0), + .Class = USB_CSCP_NoDeviceClass, + .SubClass = USB_CSCP_NoDeviceSubclass, + .Protocol = USB_CSCP_NoDeviceProtocol, + + .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, + + .VendorID = 0x0F0D, + .ProductID = 0x0092, + .ReleaseNumber = VERSION_BCD(1,0,0), + + .ManufacturerStrIndex = STRING_ID_Manufacturer, + .ProductStrIndex = STRING_ID_Product, + .SerialNumStrIndex = NO_DESCRIPTOR, + + .NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS +}; + +// Configuration Descriptor Structure +const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { + .Config = + { + .Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration}, + + .TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t), + .TotalInterfaces = 2, + + .ConfigurationNumber = 1, + .ConfigurationStrIndex = NO_DESCRIPTOR, + + .ConfigAttributes = 0x80, + + .MaxPowerConsumption = USB_CONFIG_POWER_MA(500) + }, + + .HID_Interface = + { + .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, + + .InterfaceNumber = INTERFACE_ID_Joystick, + .AlternateSetting = 0x00, + + .TotalEndpoints = 2, + + .Class = HID_CSCP_HIDClass, + .SubClass = HID_CSCP_NonBootSubclass, + .Protocol = HID_CSCP_NonBootProtocol, + + .InterfaceStrIndex = NO_DESCRIPTOR + }, + + .HID_JoystickHID = + { + .Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID}, + + .HIDSpec = VERSION_BCD(1,1,1), + .CountryCode = 0x00, + .TotalReportDescriptors = 1, + .HIDReportType = HID_DTYPE_Report, + .HIDReportLength = sizeof(JoystickReport) + }, + + .HID_ReportINEndpoint = + { + .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, + + .EndpointAddress = JOYSTICK_IN_EPADDR, + .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), + .EndpointSize = JOYSTICK_EPSIZE, + .PollingIntervalMS = 0x05 + }, + + .HID_ReportOUTEndpoint = + { + .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, + + .EndpointAddress = JOYSTICK_OUT_EPADDR, + .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), + .EndpointSize = JOYSTICK_EPSIZE, + .PollingIntervalMS = 0x05 + }, + .HID2_Interface = + { + .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, + + .InterfaceNumber = INTERFACE_ID_Generic, + .AlternateSetting = 0x00, + + .TotalEndpoints = 1, + + .Class = HID_CSCP_HIDClass, + .SubClass = HID_CSCP_NonBootSubclass, + .Protocol = HID_CSCP_NonBootProtocol, + + .InterfaceStrIndex = STRING_ID_Config + }, + + .HID2_VendorHID = + { + .Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID}, + + .HIDSpec = VERSION_BCD(1,1,1), + .CountryCode = 0x00, + .TotalReportDescriptors = 1, + .HIDReportType = HID_DTYPE_Report, + .HIDReportLength = sizeof(GenericReport) + }, + + .HID2_ReportINEndpoint = + { + .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, + + .EndpointAddress = GENERIC_EPADDR, + .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), + .EndpointSize = GENERIC_EPSIZE, + .PollingIntervalMS = 255 + }, +}; + +// Language Descriptor Structure +const USB_Descriptor_String_t PROGMEM LanguageString = USB_STRING_DESCRIPTOR_ARRAY(LANGUAGE_ID_ENG); + +// Manufacturer and Product Descriptor Strings +const USB_Descriptor_String_t PROGMEM ManufacturerString = USB_STRING_DESCRIPTOR(L"HORI CO.,LTD."); +const USB_Descriptor_String_t PROGMEM ProductString = USB_STRING_DESCRIPTOR(L"POKKEN CONTROLLER"); +const USB_Descriptor_String_t PROGMEM ConfigString = USB_STRING_DESCRIPTOR(L"Tatacon Config"); +const USB_Descriptor_String_t PROGMEM TataconString = USB_STRING_DESCRIPTOR(L"Tatacon"); +// USB Device Callback - Get Descriptor +uint16_t CALLBACK_USB_GetDescriptor( + const uint16_t wValue, + const uint16_t wIndex, + const void** const DescriptorAddress +) { + const uint8_t DescriptorType = (wValue >> 8); + const uint8_t DescriptorNumber = (wValue & 0xFF); + + const void* Address = NULL; + uint16_t Size = NO_DESCRIPTOR; + + switch (DescriptorType) + { + case DTYPE_Device: + Address = &DeviceDescriptor; + Size = sizeof(USB_Descriptor_Device_t); + break; + case DTYPE_Configuration: + Address = &ConfigurationDescriptor; + Size = sizeof(USB_Descriptor_Configuration_t); + break; + case DTYPE_String: + switch (DescriptorNumber) { + case STRING_ID_Language: + Address = &LanguageString; + Size = pgm_read_byte(&LanguageString.Header.Size); + break; + case STRING_ID_Manufacturer: + Address = &ManufacturerString; + Size = pgm_read_byte(&ManufacturerString.Header.Size); + break; + case STRING_ID_Product: + Address = &ProductString; + Size = pgm_read_byte(&ProductString.Header.Size); + break; + case STRING_ID_Config: + Address = &ConfigString; + Size = pgm_read_byte(&ConfigString.Header.Size); + break; + case STRING_ID_Tatacon: + Address = &TataconString; + Size = pgm_read_byte(&TataconString.Header.Size); + break; + } + break; + case DTYPE_HID: + switch (wIndex) { + case INTERFACE_ID_Joystick: + Address = &ConfigurationDescriptor.HID_JoystickHID; + Size = sizeof(USB_HID_Descriptor_HID_t); + break; + case INTERFACE_ID_Generic: + Address = &ConfigurationDescriptor.HID2_VendorHID; + break; + } + case DTYPE_Report: + switch (wIndex) { + case INTERFACE_ID_Joystick: + Address = &JoystickReport; + Size = sizeof(JoystickReport); + break; + case INTERFACE_ID_Generic: + Address = &GenericReport; + Size = sizeof(GenericReport); + break; + } + break; + } + + *DescriptorAddress = Address; + return Size; +} diff --git a/Firmware/SwitchPro/Descriptors.h b/Firmware/SwitchPro/Descriptors.h new file mode 100644 index 0000000..a1cb8c2 --- /dev/null +++ b/Firmware/SwitchPro/Descriptors.h @@ -0,0 +1,70 @@ +#ifndef _DESCRIPTORS_H_ +#define _DESCRIPTORS_H_ + +// Includes +#include + +#include + +// Type Defines +// Device Configuration Descriptor Structure +typedef struct +{ + USB_Descriptor_Configuration_Header_t Config; + + // Joystick HID Interface + USB_Descriptor_Interface_t HID_Interface; + USB_HID_Descriptor_HID_t HID_JoystickHID; + USB_Descriptor_Endpoint_t HID_ReportOUTEndpoint; + USB_Descriptor_Endpoint_t HID_ReportINEndpoint; + + // Generic HID Interface + USB_Descriptor_Interface_t HID2_Interface; + USB_HID_Descriptor_HID_t HID2_VendorHID; + USB_Descriptor_Endpoint_t HID2_ReportINEndpoint; +} USB_Descriptor_Configuration_t; + +// Device Interface Descriptor IDs +enum InterfaceDescriptors_t +{ + INTERFACE_ID_Joystick = 0, /**< Joystick interface descriptor ID */ + INTERFACE_ID_Generic = 1, /**< Generic interface descriptor ID */ + +}; + +// Device String Descriptor IDs +enum StringDescriptors_t +{ + STRING_ID_Language = 0, // Supported Languages string descriptor ID (must be zero) + STRING_ID_Manufacturer = 1, // Manufacturer string ID + STRING_ID_Product = 2, // Product string ID + STRING_ID_Config = 3, /**< Config string ID */ + STRING_ID_Tatacon = 4, /**< Config string ID */ +}; + +// Macros +// Endpoint Addresses +#define JOYSTICK_IN_EPADDR (ENDPOINT_DIR_IN | 1) +#define JOYSTICK_OUT_EPADDR (ENDPOINT_DIR_OUT | 2) +// HID Endpoint Size +// The Switch -needs- this to be 64. +// The Wii U is flexible, allowing us to use the default of 8 (which did not match the original Hori descriptors). +#define JOYSTICK_EPSIZE 64 +// Descriptor Header Type - HID Class HID Descriptor +#define DTYPE_HID 0x21 +// Descriptor Header Type - HID Class HID Report Descriptor +#define DTYPE_Report 0x22 + +#define GENERIC_EPADDR (ENDPOINT_DIR_IN | 3) + +/** Size in bytes of the Keyboard HID reporting IN endpoint. */ +#define GENERIC_EPSIZE TATACON_CONFIG_BYTES + +// Function Prototypes +uint16_t CALLBACK_USB_GetDescriptor( + const uint16_t wValue, + const uint16_t wIndex, + const void** const DescriptorAddress +) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); + +#endif \ No newline at end of file diff --git a/Firmware/SwitchPro/Joystick.c b/Firmware/SwitchPro/Joystick.c new file mode 100644 index 0000000..ad421ef --- /dev/null +++ b/Firmware/SwitchPro/Joystick.c @@ -0,0 +1,420 @@ +#include "Joystick.h" +#include "i2cmaster.h" +#include "Config.h" + +#ifdef DEBUG +#include "usbio.h" +#include +#endif + +static uint8_t PrevGenericHIDReportBuffer[TATACON_CONFIG_BYTES]; + +USB_ClassInfo_HID_Device_t Generic_HID_Interface = +{ + .Config = + { + .InterfaceNumber = INTERFACE_ID_Generic, + .ReportINEndpoint = + { + .Address = GENERIC_EPADDR, + .Size = GENERIC_EPSIZE, + .Banks = 1, + }, + .PrevReportINBuffer = PrevGenericHIDReportBuffer, + .PrevReportINBufferSize = sizeof(PrevGenericHIDReportBuffer), + }, +}; +// V1 hardware has no LEDs +#ifdef V1_BUILD + #define SET(port, pin) + #define CLEAR(port, pin) + #define TOGGLE(port, pin) +#else + #define SET(port, pin) port |= _BV(pin) + #define CLEAR(port, pin) port &= ~_BV(pin) + #define TOGGLE(port, pin) port ^= _BV(pin) +#endif + +uint32_t Boot_Key ATTR_NO_INIT; +#define MAGIC_BOOT_KEY 0xDEADBE7A +// offset * word size +#define BOOTLOADER_START_ADDRESS (0x1c00 * 2) + +void Bootloader_Jump_Check(void) ATTR_INIT_SECTION(3); +void Bootloader_Jump_Check(void) { + // If the reset source was the bootloader and the key is correct, clear it and jump to the bootloader + if ((MCUSR & (1 << WDRF)) && (Boot_Key == MAGIC_BOOT_KEY)) { + Boot_Key = 0; + ((void (*)(void))BOOTLOADER_START_ADDRESS)(); + } +} + +typedef struct { + // optimise data sending + uint8_t state; + uint8_t lastReport; + uint8_t debounce; +} switch_t; + +static switch_t switches[TATACON_SWITCHES]; +static uint8_t switchesChanged = 1; +static uint8_t nunchuckReady = 0; +// Main entry point. +int main(void) { + InitConfig(); + + // We'll start by performing hardware and peripheral setup. + SetupHardware(); + // We'll then enable global interrupts for our use. + GlobalInterruptEnable(); + // Once that's done, we'll enter an infinite loop. + for (;;) { + // We need to run our task to process and deliver data for our IN and OUT endpoints. + HID_Device_USBTask(&Generic_HID_Interface); + HID_Task(); + + // We also need to run the main USB management task. + USB_USBTask(); + } +} + +// Process and deliver data from IN and OUT endpoints. +void HID_Task(void) { + // If the device isn't connected and properly configured, we can't do anything here. + if (USB_DeviceState != DEVICE_STATE_Configured) { + SET(LED_PORT, DON_LED_PIN); + SET(LED_PORT, KAT_LED_PIN); + return; + } + + // We'll start with the OUT endpoint. + Endpoint_SelectEndpoint(JOYSTICK_OUT_EPADDR); + // We'll check to see if we received something on the OUT endpoint. + if (Endpoint_IsOUTReceived()) { + // If we did, and the packet has data, we'll react to it. + if (Endpoint_IsReadWriteAllowed()) { + // We'll create a place to store our data received from the host. + USB_JoystickReport_Output_t JoystickOutputData; + // We'll then take in that data, setting it up in our storage. + while(Endpoint_Read_Stream_LE(&JoystickOutputData, sizeof(JoystickOutputData), NULL) != ENDPOINT_RWSTREAM_NoError); + // At this point, we can react to this data. + // However, since we're not doing anything with this data, we abandon it. + } + // Regardless of whether we reacted to the data, we acknowledge an OUT packet on this endpoint. + Endpoint_ClearOUT(); + } + + // We'll then move on to the IN endpoint. + Endpoint_SelectEndpoint(JOYSTICK_IN_EPADDR); + // We first check to see if the host is ready to accept data. + if (Endpoint_IsINReady()) { + // We'll create an empty report. + USB_JoystickReport_Input_t JoystickInputData; + // We'll then populate this report with what we want to send to the host. + GetNextReport(&JoystickInputData); + // Once populated, we can output this data to the host. We do this by first writing the data to the control stream. + while(Endpoint_Write_Stream_LE(&JoystickInputData, sizeof(JoystickInputData), NULL) != ENDPOINT_RWSTREAM_NoError); + // We then send an IN packet on this endpoint. + Endpoint_ClearIN(); + } +} + + + + + +void nunchuck_online(void) { + if(!nunchuckReady) { + nunchuckReady = 1; + // Turn LEDs off, it returned + CLEAR(LED_PORT, DON_LED_PIN); + CLEAR(LED_PORT, KAT_LED_PIN); + } +} + +void nunchuck_offline(void) { + i2c_stop(); + if(nunchuckReady) { + nunchuckReady = 0; + // Turn LEDs on until it returns + // SET(LED_PORT, DON_LED_PIN); + // SET(LED_PORT, KAT_LED_PIN); + // Clear structs + for(int i = 0; i < KB_SWITCHES; i++) { + switches[i].state = 0; + if(switches[i].state != switches[i].lastReport) { + switchesChanged = 1; + } + } + } +} + +void nunchuck_init(void) { + // try to say hello + if(!i2c_start(NUNCHUCK_ADDR | I2C_WRITE)) { + i2c_write(0xF0); + i2c_write(0x55); + i2c_stop(); + _delay_ms(25); + + i2c_start(NUNCHUCK_ADDR | I2C_WRITE); + i2c_write(0xFB); + i2c_write(0x00); + i2c_stop(); + _delay_ms(25); + nunchuck_online(); + } else { + nunchuck_offline(); + } +} + +uint8_t nunchuck_readByte(uint8_t address) { + uint8_t data = 0xFF; + + if(!nunchuckReady) { + nunchuck_init(); + } + + if(!i2c_start(NUNCHUCK_ADDR | I2C_WRITE)) { + i2c_write(address); + i2c_stop(); + + i2c_start(NUNCHUCK_ADDR | I2C_READ); + data = i2c_readNak(); + i2c_stop(); + nunchuck_online(); + } else { + nunchuck_offline(); + } + return data; +} + +// Starting at address, read n bytes and return the last +void nunchuck_readMany(uint8_t address, uint8_t *data, uint8_t count) { + + if(!nunchuckReady) { + nunchuck_init(); + } + + if(!i2c_start(NUNCHUCK_ADDR | I2C_WRITE)) { + i2c_write(address); + i2c_stop(); + + i2c_start(NUNCHUCK_ADDR | I2C_READ); + for(uint8_t i = 0; i < count-1; i++) { + data[i] = i2c_readAck(); + } + data[count-1] = i2c_readNak(); + i2c_stop(); + nunchuck_online(); + } else { + nunchuck_offline(); + } +} + +typedef enum { + SYNC_CONTROLLER, + TATACON_PASSTHROUGH +} State_t; + +State_t state = SYNC_CONTROLLER; +#define ECHOES 2 +int echoes = 0; +int report_count = 0; +USB_JoystickReport_Input_t last_report; + +void GetNextReport(USB_JoystickReport_Input_t* const reportData) { + uint8_t data, i; + // Prepare an empty report + memset(reportData, 0, sizeof(USB_JoystickReport_Input_t)); + reportData->LX = STICK_CENTER; + reportData->LY = STICK_CENTER; + reportData->RX = STICK_CENTER; + reportData->RY = STICK_CENTER; + reportData->HAT = HAT_CENTER; + + // Repeat ECHOES times the last report + if (echoes > 0) { + memcpy(reportData, &last_report, sizeof(USB_JoystickReport_Input_t)); + echoes--; + return; + } + + // States and moves management + switch (state) { + case SYNC_CONTROLLER: + if (report_count > 100) { + report_count = 0; + state = TATACON_PASSTHROUGH; + } + else if (report_count == 25 || report_count == 50) { + reportData->Button |= SWITCH_L | SWITCH_R; + } + else if (report_count == 75 || report_count == 100) { + reportData->Button |= SWITCH_A; + } + report_count++; + break; + case TATACON_PASSTHROUGH: + // Get tatacon button data + data = nunchuck_readByte(BUTTONS_DATA); + CLEAR(LED_PORT, KAT_LED_PIN); + + // Tatacon has 4 inputs to check + for(i = 0; i < TATACON_SWITCHES; i++) { + // The I2C data starts at the 6th bit and goes down + uint8_t newState = !(data & _BV(TATACON_BUTTONS_START - i)); + if(!switches[i].debounce && switches[i].state != newState) { + SET(LED_PORT, KAT_LED_PIN); + reportData->Button |= tataConfig.switches[i]; + switches[i].state = newState; + switches[i].debounce = tataConfig.debounce; + switchesChanged = 1; + } + } + break; + } + memcpy(&last_report, reportData, sizeof(USB_JoystickReport_Input_t)); + echoes = ECHOES; +} + + + + +void SetupHardware() { + /* Disable watchdog if enabled by bootloader/fuses */ + MCUSR &= ~(1 << WDRF); + wdt_disable(); + +#ifdef V1_BUILD + CLKPR = (1 << CLKPCE); // enable a change to CLKPR + CLKPR = 0; // set the CLKDIV to 0 - was 0011b = div by 8 taking 8MHz to 1MHz +#endif + clock_prescale_set(clock_div_1); + /* Hardware Initialization */ + SET(LED_DIR, DON_LED_PIN); + SET(LED_DIR, KAT_LED_PIN); + +#ifdef DEBUG + init_usb_stdio(); + SET(LED_PORT, DON_LED_PIN); + for(int i = 0; i < 32; i++) { + TOGGLE(LED_PORT, DON_LED_PIN); + TOGGLE(LED_PORT, KAT_LED_PIN); + _delay_ms(125); + } +#endif + // if(tataConfig.ledsOn) { + // Turn them on until we init with the nunchuck + // SET(LED_PORT, DON_LED_PIN); + // SET(LED_PORT, KAT_LED_PIN); + // } + i2c_init(); + nunchuck_init(); + USB_Init(); +} + +// LUFA USB Events + +// Fired to indicate that the device is enumerating. +void EVENT_USB_Device_Connect(void) { + // We can indicate that we're enumerating here (via status LEDs, sound, etc.). + SET(LED_PORT, DON_LED_PIN); + SET(LED_PORT, KAT_LED_PIN); +} + +// Fired to indicate that the device is no longer connected to a host. +void EVENT_USB_Device_Disconnect(void) { + // We can indicate that our device is not ready (via status LEDs, sound, etc.). + CLEAR(LED_PORT, DON_LED_PIN); + CLEAR(LED_PORT, KAT_LED_PIN); +} + +// Fired when the host set the current configuration of the USB device after enumeration. +void EVENT_USB_Device_ConfigurationChanged(void) { + bool ConfigSuccess = true; + + // We setup the HID report endpoints. + ConfigSuccess &= Endpoint_ConfigureEndpoint(JOYSTICK_OUT_EPADDR, EP_TYPE_INTERRUPT, JOYSTICK_EPSIZE, 1); + ConfigSuccess &= Endpoint_ConfigureEndpoint(JOYSTICK_IN_EPADDR, EP_TYPE_INTERRUPT, JOYSTICK_EPSIZE, 1); + HID_Device_ConfigureEndpoints(&Generic_HID_Interface); + + // We can read ConfigSuccess to indicate a success or failure at this point. + if (ConfigSuccess) { + CLEAR(LED_PORT, DON_LED_PIN); + CLEAR(LED_PORT, KAT_LED_PIN); + } + USB_Device_EnableSOFEvents(); + +} + +// Process control requests sent to the device from the USB host. +void EVENT_USB_Device_ControlRequest(void) { + // We can handle two control requests: a GetReport and a SetReport. + HID_Device_ProcessControlRequest(&Generic_HID_Interface); + + // Not used here, it looks like we don't receive control request from the Switch. +} + +// Event handler for the USB device Start Of Frame event. +void EVENT_USB_Device_StartOfFrame(void) { + HID_Device_MillisecondElapsed(&Generic_HID_Interface); + + for(int i = 0; i < TATACON_SWITCHES; i++) { + if(switches[i].debounce) { + switches[i].debounce--; + } + } +} + +bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, + uint8_t* const ReportID, + const uint8_t ReportType, + void* ReportData, + uint16_t* const ReportSize) +{ + if(ReportType != HID_REPORT_ITEM_In) { + *ReportSize = 0; + return false; + } + if(HIDInterfaceInfo == &Generic_HID_Interface) { + uint8_t* ConfigReport = (uint8_t*)ReportData; + memcpy(ConfigReport, &tataConfig, sizeof(tatacon_config_t)); + *ReportSize = TATACON_CONFIG_BYTES; + //TOGGLE(LED_PORT, DON_LED_PIN); + return true; + } + *ReportSize = 0; + return false; +} + +/** HID class driver callback function for the processing of HID reports from the host. + * + * \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced + * \param[in] ReportID Report ID of the received report from the host + * \param[in] ReportType The type of report that the host has sent, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature + * \param[in] ReportData Pointer to a buffer where the received report has been stored + * \param[in] ReportSize Size in bytes of the received HID report + */ +void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, + const uint8_t ReportID, + const uint8_t ReportType, + const void* ReportData, + const uint16_t ReportSize) +{ + if(HIDInterfaceInfo == &Generic_HID_Interface && ReportType == HID_REPORT_ITEM_Out) { + uint8_t* ConfigReport = (uint8_t*)ReportData; + // So we can upgrade firmware without having to hit the button + if(ConfigReport[TATACON_CONFIG_BYTES-1] == MAGIC_RESET_NUMBER) { + // With this uncommented, reboot fails. Odd. + //USB_Disable(); + cli(); + + // Back to the bootloader + Boot_Key = MAGIC_BOOT_KEY; + wdt_enable(WDTO_250MS); + while(1); + } + SetConfig(ConfigReport); + } +} \ No newline at end of file diff --git a/Firmware/SwitchPro/Joystick.h b/Firmware/SwitchPro/Joystick.h new file mode 100644 index 0000000..2cc6c7f --- /dev/null +++ b/Firmware/SwitchPro/Joystick.h @@ -0,0 +1,147 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2014. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2014 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 + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaims all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * + * Header file for Joystick.c. + */ + +#ifndef _JOYSTICK_H_ +#define _JOYSTICK_H_ + +/* Includes: */ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "Descriptors.h" + +// Tatacon USB Pin Config +#define LED_DIR DDRD +#define LED_PORT PORTD +#define DON_LED_PIN 6 +#define KAT_LED_PIN 5 + +// Nunchuck I2C address +#define NUNCHUCK_ADDR (0x52 << 1) +#define BUTTONS_DATA 0x05 +#define TATACON_BUTTONS_START 6 +#define TATACON_SWITCHES 4 + +// Type Defines +// Enumeration for joystick buttons. +typedef enum { + SWITCH_Y = 0x01, + SWITCH_B = 0x02, + SWITCH_A = 0x04, + SWITCH_X = 0x08, + SWITCH_L = 0x10, + SWITCH_R = 0x20, + SWITCH_ZL = 0x40, + SWITCH_ZR = 0x80, + SWITCH_MINUS = 0x100, + SWITCH_PLUS = 0x200, + SWITCH_LCLICK = 0x400, + SWITCH_RCLICK = 0x800, + SWITCH_HOME = 0x1000, + SWITCH_CAPTURE = 0x2000, +} JoystickButtons_t; + +#define HAT_TOP 0x00 +#define HAT_TOP_RIGHT 0x01 +#define HAT_RIGHT 0x02 +#define HAT_BOTTOM_RIGHT 0x03 +#define HAT_BOTTOM 0x04 +#define HAT_BOTTOM_LEFT 0x05 +#define HAT_LEFT 0x06 +#define HAT_TOP_LEFT 0x07 +#define HAT_CENTER 0x08 + +#define STICK_MIN 0 +#define STICK_CENTER 128 +#define STICK_MAX 255 + +// Joystick HID report structure. We have an input and an output. +typedef struct { + uint16_t Button; // 16 buttons; see JoystickButtons_t for bit mapping + uint8_t HAT; // HAT switch; one nibble w/ unused nibble + uint8_t LX; // Left Stick X + uint8_t LY; // Left Stick Y + uint8_t RX; // Right Stick X + uint8_t RY; // Right Stick Y + uint8_t VendorSpec; +} USB_JoystickReport_Input_t; + +// The output is structured as a mirror of the input. +// This is based on initial observations of the Pokken Controller. +typedef struct { + uint16_t Button; // 16 buttons; see JoystickButtons_t for bit mapping + uint8_t HAT; // HAT switch; one nibble w/ unused nibble + uint8_t LX; // Left Stick X + uint8_t LY; // Left Stick Y + uint8_t RX; // Right Stick X + uint8_t RY; // Right Stick Y +} USB_JoystickReport_Output_t; + +// Function Prototypes +// Setup all necessary hardware, including USB initialization. +void SetupHardware(void); +// Process and deliver data from IN and OUT endpoints. +void HID_Task(void); +// USB device event handlers. +void EVENT_USB_Device_Connect(void); +void EVENT_USB_Device_Disconnect(void); +void EVENT_USB_Device_ConfigurationChanged(void); +void EVENT_USB_Device_ControlRequest(void); +//void EVENT_USB_Device_StartOfFrame(void); + +// Prepare the next report for the host. +void GetNextReport(USB_JoystickReport_Input_t* const ReportData); +bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, + uint8_t* const ReportID, + const uint8_t ReportType, + void* ReportData, + uint16_t* const ReportSize); +void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, + const uint8_t ReportID, + const uint8_t ReportType, + const void* ReportData, + const uint16_t ReportSize); +#endif diff --git a/Firmware/SwitchPro/asciihid.h b/Firmware/SwitchPro/asciihid.h new file mode 100644 index 0000000..9f66468 --- /dev/null +++ b/Firmware/SwitchPro/asciihid.h @@ -0,0 +1,145 @@ +// https://github.com/SFE-Chris/UNO-HIDKeyboard-Library/blob/master/HIDKeyboard.h + +#include + +// HID Values of Function Keys +#define F1 0x3a +#define F2 0x3b +#define F3 0x3c +#define F4 0x3d +#define F5 0x3e +#define F6 0x3f +#define F7 0x40 +#define F8 0x41 +#define F9 0x42 +#define F10 0x43 +#define F11 0x44 +#define F12 0x45 + +// HID Values of Special Keys +#define ENTER 0x28 +#define ESCAPE 0x29 +#define BACKSPACE 0x2a +#define TAB 0x2b +#define SPACEBAR 0x2c +#define CAPSLOCK 0x39 +#define PRINTSCREEN 0x46 +#define SCROLLLOCK 0x47 +#define PAUSE 0x48 +#define INSERT 0x49 +#define HOME 0x4a +#define PAGEUP 0x4b +#define DELETE 0x4c +#define END 0x4d +#define PAGEDOWN 0x4e +#define RIGHTARROW 0x4f +#define LEFTARROW 0x50 +#define DOWNARROW 0x51 +#define UPARROW 0x52 + +// HID Values of Keypad Keys +#define NUMLOCK 0x53 +#define KEYPADSLASH 0x54 +#define KEYPADSTAR 0x55 +#define KEYPADMINUS 0x56 +#define KEYPADPLUS 0x57 +#define KEYPADENTER 0x58 +#define KEYPAD1 0x59 +#define KEYPAD2 0x5a +#define KEYPAD3 0x5b +#define KEYPAD4 0x5c +#define KEYPAD5 0x5d +#define KEYPAD6 0x5e +#define KEYPAD7 0x5f +#define KEYPAD8 0x60 +#define KEYPAD9 0x61 +#define KEYPAD0 0x62 +#define KEYPADPERIOD 0x63 + +// HID Values of System Keys +#define KEYBOARDAPPLICATION 0x65 +#define KEYBOARDPOWER 0x66 +#define VOLUMEMUTE 0x7f +#define VOLUMEUP 0x80 +#define VOLUMEDOWN 0x81 + +// Common-use modifiers +#define CTRL 0x01 +#define SHIFT 0x02 +#define ALT 0x04 +#define GUI 0x08 + + +/**************************************************************************** + * + * ASCII->HID LOOKUP TABLE + * + * Taken from the HID Table definition at + * http://www.usb.org/developers/devclass_docs/Hut1_11.pdf + * + * This array maps the ASCII value of a type-able character to its + * corresponding HID value. + * + * Example: + * 'a' = ASCII value 97 = HID value 0x04 + * HIDTable['a'] = HIDTable[97] = 0x04 + * + * NOTE: + * "Shift Modified" HID values are the same as the non Shift-Modified values + * for any given character, e.g. the HID value for '2' is equal to the + * HID value for '@'. The Shift-Modified value is sent by setting the + * modifier value (buf[0]) to the corresponding modifier value in the + * modifier table. + * + ****************************************************************************/ +const PROGMEM uint8_t HIDTable[] = { + 0x00, // 0 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x28, // 10 + 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 20 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, // 30 + 0x00, 0x2c, 0x1e, 0x34, 0x20, 0x21, 0x22, 0x24, 0x34, 0x26, // 40 + 0x27, 0x25, 0x2e, 0x36, 0x2d, 0x37, 0x38, 0x27, 0x1e, 0x1f, // 50 + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x33, 0x33, 0x36, // 60 + 0x2e, 0x37, 0x38, 0x1f, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, // 70 + 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, // 80 + 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, // 90 + 0x2f, 0x31, 0x30, 0x23, 0x2d, 0x35, 0x04, 0x05, 0x06, 0x07, // 100 + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, // 110 + 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, // 120 + 0x1c, 0x1d, 0x2f, 0x31, 0x30, 0x35, 127 // 127 +}; + + +/**************************************************************************** + * + * ASCII->MODIFIER LOOKUP TABLE + * + * Looks up whether or not the HID report should use the SHIFT modifier. + * + * Example: + * The character '2' and the character '@' have different ASCII values but + * the same HID value. This table uses the ASCII value to determine if + * we should hold shift while sending the key. e.g.: + * + * HIDTable['2'] = 0x1f and modifierTable['2'] = 0 + * HIDTable['@'] = 0x1f and modifierTable['@'] = SHIFT + * + * There's probaly a better way to do this, but it's functional. + * + ****************************************************************************/ +const PROGMEM uint8_t modifierTable[] = { + 0x00, // 0 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 10 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 20 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 30 + 0x00, 0x00, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, // 40 + SHIFT, 0x00, SHIFT, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 50 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, SHIFT, 0x00, SHIFT, // 60 + 0x00, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, // 70 + SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, // 80 + SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, SHIFT, // 90 + 0x00, 0x00, 0x00, SHIFT, SHIFT, 0x00, 0x00, 0x00, 0x00, 0x00, // 100 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 110 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 120 + 0x00, 0x00, SHIFT, SHIFT, SHIFT, SHIFT, 0x00 // 127 +}; \ No newline at end of file diff --git a/Firmware/SwitchPro/i2cmaster.S b/Firmware/SwitchPro/i2cmaster.S new file mode 100644 index 0000000..0670117 --- /dev/null +++ b/Firmware/SwitchPro/i2cmaster.S @@ -0,0 +1,366 @@ +;************************************************************************* +; Title : I2C (Single) Master Implementation +; Author: Peter Fleury http://jump.to/fleury +; based on Atmel Appl. Note AVR300 +; File: $Id: i2cmaster.S,v 1.12 2008/03/02 08:51:27 peter Exp $ +; Software: AVR-GCC 3.3 or higher +; Target: any AVR device +; +; DESCRIPTION +; Basic routines for communicating with I2C slave devices. This +; "single" master implementation is limited to one bus master on the +; I2C bus. +; +; Based on the Atmel Application Note AVR300, corrected and adapted +; to GNU assembler and AVR-GCC C call interface +; Replaced the incorrect quarter period delays found in AVR300 with +; half period delays. + +; Tweaked by monty for true 400KHz operation at 8MHz system clock on an +; atmega16u2. Duty cycle adjusted for correct 400KHz spec adherence. +; +; 7 cycles = 0.875us high +; 13 cycles = 1.625us low +; +; USAGE +; These routines can be called from C, refere to file i2cmaster.h. +; See example test_i2cmaster.c +; Adapt the SCL and SDA port and pin definitions and eventually +; the delay routine to your target ! +; Use 4.7k pull-up resistor on the SDA and SCL pin. +; +; NOTES +; The I2C routines can be called either from non-interrupt or +; interrupt routines, not both. +; +;************************************************************************* + +#if (__GNUC__ * 100 + __GNUC_MINOR__) < 303 +#error "This library requires AVR-GCC 3.3 or later, update to newer AVR-GCC compiler !" +#endif + + +#include + + + +;***** Adapt these SCA and SCL port and pin definition to your target !! +; +; V1 had different I2C pinouts +#ifdef V1_BUILD + #define SDA 1 ; SDA Port D, Pin 4 + #define SCL 0 ; SCL Port D, Pin 5 + #define SDA_PORT PORTD + #define SCL_PORT PORTD +#else + #define SDA 4 ; SDA Port D, Pin 4 + #define SCL 3 ; SCL Port D, Pin 3 + #define SDA_PORT PORTD + #define SCL_PORT PORTD +#endif + +;****** + +;-- map the IO register back into the IO address space +#define SDA_DDR (_SFR_IO_ADDR(SDA_PORT) - 1) +#define SCL_DDR (_SFR_IO_ADDR(SCL_PORT) - 1) +#define SDA_OUT _SFR_IO_ADDR(SDA_PORT) +#define SCL_OUT _SFR_IO_ADDR(SCL_PORT) +#define SDA_IN (_SFR_IO_ADDR(SDA_PORT) - 2) +#define SCL_IN (_SFR_IO_ADDR(SCL_PORT) - 2) + + +#ifndef __tmp_reg__ +#define __tmp_reg__ 0 +#endif + + + .section .text + +;************************************************************************* +; delay half period +; For I2C in normal mode (100kHz), use T/2 > 5us +; For I2C in fast mode (400kHz), use T/2 > 1.3us +;************************************************************************* + .stabs "",100,0,0,i2c_delay_T2 + .stabs "i2cmaster.S",100,0,0,i2c_delay_T2 + .func i2c_delay_T2 ; delay 1.25 microsec with 8 Mhz crystal +i2c_delay_T2: ; 4 cycles + ret ; 5 " + .endfunc ; total 9 cyles = 1.25 microsec with 8 Mhz crystal, IO op happens on the 10th + +;************************************************************************* +; delay 40 microseconds, to give the slave time to do stuff +;************************************************************************* + .func i2c_delay_40us +i2c_delay_40us: ; 4 cycles + push r16 ; 2 + ldi r16, 102 ; 1 +delay: + dec r16 ; 1 + brne delay ; 2 + ; 1 + pop r16 ; 2 + ret ; 5 + .endfunc ; total 321 cyles almost 40 microsec with 8 Mhz crystal + + +;************************************************************************* +; Initialization of the I2C bus interface. Need to be called only once +; +; extern void i2c_init(void) +;************************************************************************* + .global i2c_init + .func i2c_init +i2c_init: + cbi SDA_DDR,SDA ;release SDA + cbi SCL_DDR,SCL ;release SCL + cbi SDA_OUT,SDA + cbi SCL_OUT,SCL + ret + .endfunc + + +;************************************************************************* +; Issues a start condition and sends address and transfer direction. +; return 0 = device accessible, 1= failed to access device +; +; extern unsigned char i2c_start(unsigned char addr); +; addr = r24, return = r25(=0):r24 +;************************************************************************* + + .global i2c_start + .func i2c_start +i2c_start: + sbi SDA_DDR,SDA ;force SDA low + rcall i2c_delay_T2 ;delay T/2 + + rcall i2c_write ;write address + ret + .endfunc + + +;************************************************************************* +; Issues a repeated start condition and sends address and transfer direction. +; return 0 = device accessible, 1= failed to access device +; +; extern unsigned char i2c_rep_start(unsigned char addr); +; addr = r24, return = r25(=0):r24 +;************************************************************************* + + .global i2c_rep_start + .func i2c_rep_start +i2c_rep_start: + sbi SCL_DDR,SCL ;force SCL low + rcall i2c_delay_T2 ;delay T/2 + cbi SDA_DDR,SDA ;release SDA + rcall i2c_delay_T2 ;delay T/2 + cbi SCL_DDR,SCL ;release SCL + rcall i2c_delay_T2 ;delay T/2 + sbi SDA_DDR,SDA ;force SDA low + rcall i2c_delay_T2 ;delay T/2 + + rcall i2c_write ;write address + ret + .endfunc + + +;************************************************************************* +; Issues a start condition and sends address and transfer direction. +; If device is busy, use ack polling to wait until device is ready +; +; extern void i2c_start_wait(unsigned char addr); +; addr = r24 +;************************************************************************* + + .global i2c_start_wait + .func i2c_start_wait +i2c_start_wait: + mov __tmp_reg__,r24 +i2c_start_wait1: + sbi SDA_DDR,SDA ;force SDA low + rcall i2c_delay_T2 ;delay T/2 + mov r24,__tmp_reg__ + rcall i2c_write ;write address + tst r24 ;if device not busy -> done + breq i2c_start_wait_done + rcall i2c_stop ;terminate write operation + rjmp i2c_start_wait1 ;device busy, poll ack again +i2c_start_wait_done: + ret + .endfunc + + +;************************************************************************* +; Terminates the data transfer and releases the I2C bus +; +; extern void i2c_stop(void) +;************************************************************************* + + .global i2c_stop + .func i2c_stop +i2c_stop: + sbi SCL_DDR,SCL ;force SCL low + sbi SDA_DDR,SDA ;force SDA low + rcall i2c_delay_T2 ;delay T/2 + cbi SCL_DDR,SCL ;release SCL + rcall i2c_delay_T2 ;delay T/2 +i2c_stop_wait: + ;wait SCL high (in case wait states are inserted) + sbis SCL_IN,SCL ; 2 + rjmp i2c_stop_wait + cbi SDA_DDR,SDA ;release SDA + rcall i2c_delay_T2 ;delay T/2 + rcall i2c_delay_40us ; delay 40us to let slave catch its breath + ret + .endfunc + + +;************************************************************************* +; Send one byte to I2C device +; return 0 = write successful, 1 = write failed +; +; extern unsigned char i2c_write( unsigned char data ); +; data = r24, return = r25(=0):r24 +;************************************************************************* + .global i2c_write + .func i2c_write +i2c_write: + sec ;set carry flag ; + rol r24 ;shift in carry and out bit one ; + rjmp i2c_write_first ; +i2c_write_bit: + lsl r24 ;if transmit register empty ; 1 + breq i2c_get_ack ; 1 + nop ; 1 +i2c_write_first: + ; 7 since the last cbi + sbi SCL_DDR,SCL ;force SCL low ; 2 + brcc i2c_write_low ; 1 + nop ; 1 + cbi SDA_DDR,SDA ;release SDA ; 2 + rjmp i2c_write_high ; 2 +i2c_write_low: ; 1 + sbi SDA_DDR,SDA ;force SDA low ; 2 + rjmp i2c_write_high ; 2 +i2c_write_high: + nop + nop + nop + nop + nop + ; 13 since the last + cbi SCL_DDR,SCL ;release SCL ; 2 +i2c_write_wait: + ;wait SCL high (in case wait states are inserted) + sbis SCL_IN,SCL ; 2 + rjmp i2c_write_wait + + rjmp i2c_write_bit ; 2 + +i2c_get_ack: ; 1 + sbi SCL_DDR,SCL ;force SCL low + cbi SDA_DDR,SDA ;release SDA + nop + nop + nop + nop + nop + nop + nop + nop + nop + cbi SCL_DDR,SCL ;release SCL +i2c_ack_wait: + sbis SCL_IN,SCL ;wait SCL high (in case wait states are inserted) + rjmp i2c_ack_wait + + clr r24 ;return 0 + sbic SDA_IN,SDA ;if SDA high -> return 1 + ldi r24,1 + sbi SCL_DDR,SCL ;force SCL low + rcall i2c_delay_T2 ;delay T/2 + clr r25 + ret + .endfunc + + + +;************************************************************************* +; read one byte from the I2C device, send ack or nak to device +; (ack=1, send ack, request more data from device +; ack=0, send nak, read is followed by a stop condition) +; +; extern unsigned char i2c_read(unsigned char ack); +; ack = r24, return = r25(=0):r24 +; extern unsigned char i2c_readAck(void); +; extern unsigned char i2c_readNak(void); +; return = r25(=0):r24 +;************************************************************************* + .global i2c_readAck + .global i2c_readNak + .global i2c_read + .func i2c_read +i2c_readNak: + clr r24 + rjmp i2c_read +i2c_readAck: + ldi r24,0x01 +i2c_read: + ldi r23,0x01 ;data = 0x01 +i2c_read_bit: + sbi SCL_DDR,SCL ;force SCL low ; 2 + nop ; 1 + nop ; 1 + nop ; 1 + nop ; 1 + nop ; 1 + nop ; 1 + nop ; 1 + nop ; 1 + nop ; 1 + nop ; 1 + nop ; 1 + + cbi SCL_DDR,SCL ;release SCL ; 2 + +i2c_read_stretch: + ;loop until SCL is high (allow slave to stretch SCL) + sbis SCL_IN, SCL ; 2 + rjmp i2c_read_stretch + ; + clc ;clear carry flag ; 1 + sbic SDA_IN,SDA ;if SDA is high ; 2 + sec ; set carry flag + ; + rol r23 ;store bit ; 1 + ;while receive register not full + brcc i2c_read_bit ; 2 + +i2c_put_ack: + sbi SCL_DDR,SCL ;force SCL low + cpi r24,1 + breq i2c_put_ack_low ;if (ack=0) + cbi SDA_DDR,SDA ; release SDA + rjmp i2c_put_ack_high +i2c_put_ack_low: ;else + sbi SDA_DDR,SDA ; force SDA low + nop +i2c_put_ack_high: + nop + nop + nop + nop + nop + cbi SCL_DDR,SCL ;release SCL +i2c_put_ack_wait: + sbis SCL_IN,SCL ;wait SCL high + rjmp i2c_put_ack_wait + nop + mov r24,r23 + clr r25 + sbi SCL_DDR,SCL ;force SCL low + cbi SDA_DDR,SDA ;release SDA + ret + .endfunc + diff --git a/Firmware/SwitchPro/i2cmaster.h b/Firmware/SwitchPro/i2cmaster.h new file mode 100644 index 0000000..3917b9e --- /dev/null +++ b/Firmware/SwitchPro/i2cmaster.h @@ -0,0 +1,178 @@ +#ifndef _I2CMASTER_H +#define _I2CMASTER_H 1 +/************************************************************************* +* Title: C include file for the I2C master interface +* (i2cmaster.S or twimaster.c) +* Author: Peter Fleury http://jump.to/fleury +* File: $Id: i2cmaster.h,v 1.10 2005/03/06 22:39:57 Peter Exp $ +* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3 +* Target: any AVR device +* Usage: see Doxygen manual +**************************************************************************/ + +#ifdef DOXYGEN +/** + @defgroup pfleury_ic2master I2C Master library + @code #include @endcode + + @brief I2C (TWI) Master Software Library + + Basic routines for communicating with I2C slave devices. This single master + implementation is limited to one bus master on the I2C bus. + + This I2c library is implemented as a compact assembler software implementation of the I2C protocol + which runs on any AVR (i2cmaster.S) and as a TWI hardware interface for all AVR with built-in TWI hardware (twimaster.c). + Since the API for these two implementations is exactly the same, an application can be linked either against the + software I2C implementation or the hardware I2C implementation. + + Use 4.7k pull-up resistor on the SDA and SCL pin. + + Adapt the SCL and SDA port and pin definitions and eventually the delay routine in the module + i2cmaster.S to your target when using the software I2C implementation ! + + Adjust the CPU clock frequence F_CPU in twimaster.c or in the Makfile when using the TWI hardware implementaion. + + @note + The module i2cmaster.S is based on the Atmel Application Note AVR300, corrected and adapted + to GNU assembler and AVR-GCC C call interface. + Replaced the incorrect quarter period delays found in AVR300 with + half period delays. + + @author Peter Fleury pfleury@gmx.ch http://jump.to/fleury + + @par API Usage Example + The following code shows typical usage of this library, see example test_i2cmaster.c + + @code + + #include + + + #define Dev24C02 0xA2 // device address of EEPROM 24C02, see datasheet + + int main(void) + { + unsigned char ret; + + i2c_init(); // initialize I2C library + + // write 0x75 to EEPROM address 5 (Byte Write) + i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode + i2c_write(0x05); // write address = 5 + i2c_write(0x75); // write value 0x75 to EEPROM + i2c_stop(); // set stop conditon = release bus + + + // read previously written value back from EEPROM address 5 + i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode + + i2c_write(0x05); // write address = 5 + i2c_rep_start(Dev24C02+I2C_READ); // set device address and read mode + + ret = i2c_readNak(); // read one byte from EEPROM + i2c_stop(); + + for(;;); + } + @endcode + +*/ +#endif /* DOXYGEN */ + +/**@{*/ + +#if (__GNUC__ * 100 + __GNUC_MINOR__) < 304 +#error "This library requires AVR-GCC 3.4 or later, update to newer AVR-GCC compiler !" +#endif + +#include + +/** defines the data direction (reading from I2C device) in i2c_start(),i2c_rep_start() */ +#define I2C_READ 1 + +/** defines the data direction (writing to I2C device) in i2c_start(),i2c_rep_start() */ +#define I2C_WRITE 0 + + +/** + @brief initialize the I2C master interace. Need to be called only once + @param void + @return none + */ +extern void i2c_init(void); + + +/** + @brief Terminates the data transfer and releases the I2C bus + @param void + @return none + */ +extern void i2c_stop(void); + + +/** + @brief Issues a start condition and sends address and transfer direction + + @param addr address and transfer direction of I2C device + @retval 0 device accessible + @retval 1 failed to access device + */ +extern unsigned char i2c_start(unsigned char addr); + + +/** + @brief Issues a repeated start condition and sends address and transfer direction + + @param addr address and transfer direction of I2C device + @retval 0 device accessible + @retval 1 failed to access device + */ +extern unsigned char i2c_rep_start(unsigned char addr); + + +/** + @brief Issues a start condition and sends address and transfer direction + + If device is busy, use ack polling to wait until device ready + @param addr address and transfer direction of I2C device + @return none + */ +extern void i2c_start_wait(unsigned char addr); + + +/** + @brief Send one byte to I2C device + @param data byte to be transfered + @retval 0 write successful + @retval 1 write failed + */ +extern unsigned char i2c_write(unsigned char data); + + +/** + @brief read one byte from the I2C device, request more data from device + @return byte read from I2C device + */ +extern unsigned char i2c_readAck(void); + +/** + @brief read one byte from the I2C device, read is followed by a stop condition + @return byte read from I2C device + */ +extern unsigned char i2c_readNak(void); + +/** + @brief read one byte from the I2C device + + Implemented as a macro, which calls either i2c_readAck or i2c_readNak + + @param ack 1 send ack, request more data from device
+ 0 send nak, read is followed by a stop condition + @return byte read from I2C device + */ +extern unsigned char i2c_read(unsigned char ack); +#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); + + +/**@}*/ +#endif diff --git a/Firmware/SwitchPro/makefile b/Firmware/SwitchPro/makefile new file mode 100644 index 0000000..b3b8f4e --- /dev/null +++ b/Firmware/SwitchPro/makefile @@ -0,0 +1,85 @@ +# +# LUFA Library +# Copyright (C) Dean Camera, 2014. +# +# dean [at] fourwalledcubicle [dot] com +# www.lufa-lib.org +# +# -------------------------------------- +# LUFA Project Makefile. +# -------------------------------------- + +# Run "make help" for target help. + +MCU = atmega16u2 +ARCH = AVR8 +#BOARD = USER +F_CPU = 8000000 +F_USB = $(F_CPU) +OPTIMIZATION = s +TARGET = Joystick +SRC = $(TARGET).c Descriptors.c i2cmaster.S Config.c usbio.c $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS) +LUFA_PATH = ../LUFA +CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ +LD_FLAGS = + +AVRDUDE = avrdude -B 8 -c usbasp -p $(MCU) + + +# Default target +all: + +# 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 LUFA build script makefiles +DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS +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 + +v1: CC_FLAGS += -DV1_BUILD +v1: clean all + +debug: CC_FLAGS += -DDEBUG +debug: clean flash + +v1debug: CC_FLAGS += -DV1_BUILD -DDEBUG +v1debug: clean all + +init: erase wfuse flashboot flash + +initboot: erase wfuse flashboot + +erase: + $(AVRDUDE) -e + +rfuse: + $(AVRDUDE) -U hfuse:r:-:h -U lfuse:r:-:h -U efuse:r:-:h + +wfuse: + $(AVRDUDE) -U lfuse:w:0xde:m -U hfuse:w:0xdb:m -U efuse:w:0xf6:m + +# To make this hex, compile HID Bootloader in LUFA +# FLASH_SIZE_KB := 16 +# BOOT_SECTION_SIZE_KB := 2 +# MCU = atmega16u2 +# ARCH = AVR8 +flashboot: + $(AVRDUDE) -U flash:w:DFU/BootloaderHID.hex:i + +flash: all + sleep 1 + python2 ../DFUHID/hid_bootloader_loader.py atmega16u2 Joystick.hex + +flashC: all + sleep 1 + ../DFUHID/hid_bootloader_cli -mmcu=atmega16u2 -r Joystick.hex \ No newline at end of file diff --git a/Firmware/SwitchPro/usbio.c b/Firmware/SwitchPro/usbio.c new file mode 100644 index 0000000..37f250f --- /dev/null +++ b/Firmware/SwitchPro/usbio.c @@ -0,0 +1,114 @@ +/* + * FILE: usbio.c + * + * Original UART code by Peter Sutton. + * Adapted for USB by William Toohey. + * + * Module to allow standard output routines to be used via + * USB keyboard typing. The init_serial_stdio() method must be called before + * any standard IO methods (e.g. printf). We use a circular buffer to + * store output messages. + */ + +#include +#include +#include + +#include + +/* Global variables */ +/* Circular buffer to hold outgoing characters. The insert_pos variable + * keeps track of the position (0 to OUTPUT_BUFFER_SIZE-1) that the next + * outgoing character should be written to. bytes_in_buffer keeps + * count of the number of characters currently stored in the buffer + * (ranging from 0 to OUTPUT_BUFFER_SIZE). This number of bytes immediately + * prior to the current insert_pos are the bytes waiting to be output. + * If the insert_pos reaches the end of the buffer it will wrap around + * to the beginning (assuming those bytes have been output). + * NOTE - OUTPUT_BUFFER_SIZE can not be larger than 255 without changing + * the type of the variables below. + */ +#define OUTPUT_BUFFER_SIZE 255 +char out_buffer[OUTPUT_BUFFER_SIZE]; +uint8_t out_insert_pos; +uint8_t bytes_in_out_buffer; +// Whether we should be depressing or releasing a key +uint8_t liftoff = 0; + +static int usb_put_char(char, FILE*); + +/* Setup a stream that uses the uart get and put functions. We will + * make standard input and output use this stream below. + */ +static FILE myStream = FDEV_SETUP_STREAM(usb_put_char, NULL, + _FDEV_SETUP_WRITE); + +void init_usb_stdio(void) { + /* + * Initialise our buffers + */ + out_insert_pos = 0; + bytes_in_out_buffer = 0; + + /* Set up our stream so the put function below is used + * to write characters via the USB port when we use + * stdio functions + */ + stdout = &myStream; +} + +static int usb_put_char(char c, FILE* stream) { + /* Add the character to the buffer for transmission if there + * is space to do so. We advance the insert_pos to the next + * character position. If this is beyond the end of the buffer + * we wrap around back to the beginning of the buffer + */ + // Drop overrun + if(bytes_in_out_buffer >= OUTPUT_BUFFER_SIZE) { + return 0; + } + out_buffer[out_insert_pos++] = c; + bytes_in_out_buffer++; + if(out_insert_pos == OUTPUT_BUFFER_SIZE) { + /* Wrap around buffer pointer if necessary */ + out_insert_pos = 0; + } + return 0; +} + +int make_report(USB_KeyboardReport_Data_t *KeyboardReport) { + if(liftoff) { + liftoff = 0; + return 1; + } else { + /* Check if we have data in our buffer */ + if(bytes_in_out_buffer > 0) { + /* Yes we do - remove the pending byte and output it + * via the USB. The pending byte (character) is the + * one which is "bytes_in_buffer" characters before the + * insert_pos (taking into account that we may + * need to wrap around to the end of the buffer). + */ + char c; + if(out_insert_pos - bytes_in_out_buffer < 0) { + /* Need to wrap around */ + c = out_buffer[out_insert_pos - bytes_in_out_buffer + + OUTPUT_BUFFER_SIZE]; + } else { + c = out_buffer[out_insert_pos - bytes_in_out_buffer]; + } + /* Decrement our count of the number of bytes in the + * buffer + */ + bytes_in_out_buffer--; + + /* Output the character via USB, converting to scancode */ + KeyboardReport->KeyCode[0] = pgm_read_byte(&HIDTable[(uint8_t)c]); + KeyboardReport->Modifier = pgm_read_byte(&modifierTable[(uint8_t)c]); + liftoff = 1; + return 1; + } else { + return 0; + } + } +} diff --git a/Firmware/SwitchPro/usbio.h b/Firmware/SwitchPro/usbio.h new file mode 100644 index 0000000..e3e379d --- /dev/null +++ b/Firmware/SwitchPro/usbio.h @@ -0,0 +1,20 @@ +/* + * serialio.h + * + * Author: Peter Sutton + * + * Modified by William Toohey + */ + +#ifndef SERIALIO_H_ +#define SERIALIO_H_ + +#include +#include + +/* Initialise IO using USB. + */ +void init_usb_stdio(void); +int make_report(USB_KeyboardReport_Data_t*); + +#endif /* SERIALIO_H_ */ \ No newline at end of file diff --git a/README.md b/README.md index af9b967..6947979 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # TataconUSB -A small dongle to connect your Wii taiko controller to your computer as a USB +A small dongle to connect your Wii taiko controller to your Nintendo Switch or computer as a USB device, instead of using Bluetooth. [Purchase here](https://mon.im/tatacon/) @@ -13,12 +13,22 @@ device, instead of using Bluetooth. - Sweet LEDs (can be turned off) - Responds so fast you can bounce your sticks and get multi hits. Can be turned off with Debounce feature. - Tested working on official, Hori and knockoff controllers -- Windows, Linux, Mac compatible + [cross platform Chrome app for configuration](https://chrome.google.com/webstore/detail/tataconfig/ndeibflmpllogilncdmoajadcopjkchg) +- Nintendo Switch, Windows, Linux, Mac compatible + [cross platform Chrome app for configuration](https://chrome.google.com/webstore/detail/tataconfig/ndeibflmpllogilncdmoajadcopjkchg) - Config app allows future firmware updates to add more features - No drivers required! ## Building firmware: -At console, run `make`. You will need AVR GCC installed. +Open a console. +To build the PC firmware navigate to `firmware/Keyboard`. +To build the Nintendo Switch firmware navigate to `firmware/SwitchPro`. +Run `make`. You will need AVR GCC installed. + +To install hit the reset button, then `make flash` to use the Python loader(Windows) or `make flashC` to use the C loader(unix). + +Python loader requires pywinusb (https://pypi.python.org/pypi/pywinusb/) and +IntelHex (https://pypi.python.org/pypi/IntelHex/) libraries. + +C loader requires compiling with libusb-dev (Ubuntu) installed. ## Building software: It's a Chrome web app. Install it like a normal dev app. @@ -36,3 +46,29 @@ Program the HID bootloader and clock fuses via `make init` and an SPI programmer The makefile is by default setup to use the USBAsp. I recommend pogo pins in a breadboard + USB connection for power. From there, program by hitting the hardware reset button, then `make flash`. + +## Nintendo Switch firmware +The Nintendo Switch firmware is based off of work by @progmem, who created the the proof-of-concept Hori Pokken Pad LUFA [firmware](https://github.com/progmem/Switch-Fightstick) and @shinyquagsire23, who extended it to create a [Splatoon 2 image printer](https://github.com/shinyquagsire23/Switch-Fightstick). + +The firmware imitates the Hori Pokken Pad, which when connected to a Switch, running V3.0.0 or above, is picked up as a Pro controller. + +By default, when plugged in the firmware performs the sync command L + R, A, in order to pass through the new controller screen. + +Drum hits can be changed to any Switch Pro Controller buttons using the chrome configuration app. + +## Linux use +In order to use with the chrome configuration app, linux users must edit their udev rules. + +### UDEV rules +Write in /etc/udev/rules.d/50-tatacon.rules: +``` +#Original firmware for PC/OSU +ATTRS{manufacturer}=="mon.im", MODE:="0664", GROUP:="plugdev" + +#Switch/WiiU Hori Pokken Pad +SUBSYSTEM=="usb", ATTR{idVendor}=="0f0d", ATTR{idProduct}=="0092", MODE="0664", GROUP="plugdev" +KERNEL=="hidraw*", ATTRS{idVendor}=="0f0d", ATTRS{idProduct}=="0092", MODE="0664", GROUP="plugdev" +``` + + + diff --git a/Software/Tataconfig/manifest.json b/Software/Tataconfig/manifest.json index 3d982d3..c4b0d2b 100644 --- a/Software/Tataconfig/manifest.json +++ b/Software/Tataconfig/manifest.json @@ -15,6 +15,7 @@ "usbDevices": [ { "vendorId": 5840, "productId": 2669, "__comment" : "Configuration" }, + { "vendorId": 3853, "productId": 146, "__comment" : "Configuration Switch Controller" }, { "vendorId": 1003, "productId": 8295, "__comment" : "Firmware update" } ] } diff --git a/Software/Tataconfig/tataconfig.js b/Software/Tataconfig/tataconfig.js index 91aa8c8..46b0884 100644 --- a/Software/Tataconfig/tataconfig.js +++ b/Software/Tataconfig/tataconfig.js @@ -1,7 +1,8 @@ (function() { var devices = []; var debounceOptions = [["Off", 0], ["Low", 15], ["Medium", 30], ["High", 50]]; - var configBytes = { + var configBytes; + var configBytesV1 = { donL : 0, katL : 1, donR : 2, @@ -11,20 +12,47 @@ version : 6, reset : 7 }; - + var configBytesV2 = { + donL : 0, + katL : 2, + donR : 4, + katR : 6, + leds : 8, + debounce : 9, + version : 10, + reset : 11, + }; + var configKeyV2 = { + donL : 0, + katL : 1, + donR : 2, + katR : 3, + }; + var VERSION_OSU = 0; + var VERSION_SWITCH = 2; + var majorVersion; + var version; var magicResetNumber = 42; - + // USB device filter to get config device (Hori gamepad also appears otherwise) + var tataconConfigFilter = 65500; + // Valid vendor IDs including mon.im's OSU vendor and Hori Vendor IDs + var vendorIds = [0x16D0, 0x0F0D]; var newDevice = function(device) { - if(device.vendorId == 0x16D0) { // Config mode + // Grab device matching our vendor IDs and the config profile + // Perform filter here, as filter doesn't work on listener + if(vendorIds.includes(device.vendorId) && device.collections[0].usagePage == tataconConfigFilter) { console.log("Added new device with ID " + device.deviceId); chrome.hid.connect(device.deviceId, function(connection) { + var dev = {devId: device.deviceId, connId : connection.connectionId}; + console.log(device); devices.push(dev); chrome.hid.receive(connection.connectionId, function(id, data) { var view = new Uint8ClampedArray(data); dev.config = view; console.log("Got config: " + view); dev.newConfig = view.slice(0); + dev.data = data; createConfigUI(dev); }) }); @@ -42,7 +70,18 @@ var title = document.createElement("div"); title.className = "title"; - title.textContent = "Tatacon to USB v" + device.config[configBytes.version]/10; + version = device.config[device.config.length - 2]/10; + // Get truncated version number (OSU/Switch) + majorVersion = (version|0); + // Set config bytes layout based on version (8bit vs 16bit uints) + if (majorVersion == VERSION_OSU) { + title.textContent = "Tatacon to USB (v"; + configBytes = configBytesV1; + } else if (majorVersion == VERSION_SWITCH) { + title.textContent = "Tatacon to Switch (v"; + configBytes = configBytesV2; + } + title.textContent += device.config[device.config.length - 2]/10 + ")"; ui.appendChild(title); var tatacon = document.createElement("div"); @@ -53,16 +92,34 @@ select.className = swtch; device[swtch] = select; tatacon.appendChild(select); - - scancodes.forEach(function(code) { + if (majorVersion == VERSION_OSU) { + scancodes.forEach(function(code) { var option = document.createElement("option"); option.value = code.value; option.textContent = code.name; select.appendChild(option); }); + } else if (majorVersion == VERSION_SWITCH) { + switchcodes.forEach(function(code) { + var option = document.createElement("option"); + option.value = code.value; + option.textContent = code.name; + select.appendChild(option); + }); + } select.onchange = function() { + console.log(device.newConfig); + console.log("Version:" + majorVersion); + if (majorVersion == VERSION_SWITCH) { + // Write new button to buffer as little endian uint16 + var dv = new DataView(device.newConfig.buffer); + dv.setUint16(configBytes[swtch], select.value, true); + console.log(device.newConfig); + } + else if(majorVersion == VERSION_OSU) { device.newConfig[configBytes[swtch]] = select.value; - updateUI(device); + } + updateUI(device); } }); @@ -137,10 +194,19 @@ resetDefaults.textContent = "Defaults"; resetDefaults.onclick = function() { // SWITCH ORDER: CenterLeft, RimLeft, CenterRight, RimRight + if (majorVersion == VERSION_OSU) { device.newConfig[configBytes.donL] = 0x1B; // X device.newConfig[configBytes.katL] = 0x1D; // Z device.newConfig[configBytes.donR] = 0x06; // C device.newConfig[configBytes.katR] = 0x19; // V + } else if (majorVersion == VERSION_SWITCH) { + // Set defaults (little endian uint16) + var dv = new DataView(device.newConfig.buffer); + dv.setUint16(configBytes.donL, 0x10, true); // L + dv.setUint16(configBytes.katL, 0x400, true); // LSTICK + dv.setUint16(configBytes.donR, 0x20, true); // R + dv.setUint16(configBytes.katR, 0x800, true); // RSTICK + } device.newConfig[configBytes.leds] = 1; // LEDs on device.newConfig[configBytes.debounce] = debounceOptions[2][1]; // medium debounce updateUI(device); @@ -177,7 +243,15 @@ var updateUI = function(device) { ["donL", "katL", "donR", "katR"].forEach(function(swtch) { + if (majorVersion == VERSION_OSU) { device[swtch].value = device.newConfig[configBytes[swtch]]; + + } else if (majorVersion == VERSION_SWITCH) { + // Read button info as little endian uint16 + var dv = new DataView(device.newConfig.buffer); + device[swtch].value = dv.getUint16(configBytes[swtch], true); + console.log(device[swtch].value); + } }); device.leds.checked = device.newConfig[configBytes.leds]; @@ -237,12 +311,30 @@ chrome.runtime.lastError.message); return; } + console.log(devices); devices.forEach(newDevice); }) chrome.hid.onDeviceAdded.addListener(newDevice); chrome.hid.onDeviceRemoved.addListener(deviceRemoved); }); +var switchcodes = [ +{name: "Y", value: 0x01}, +{name: "B", value: 0x02}, +{name: "A", value: 0x04}, +{name: "X", value: 0x08}, +{name: "L", value: 0x10}, +{name: "R", value: 0x20}, +{name: "ZL", value: 0x40}, +{name: "ZR", value: 0x80}, +{name: "MINUS", value: 0x100}, +{name: "PLUS", value: 0x200}, +{name: "LCLICK", value: 0x400}, +{name: "RCLICK", value: 0x800}, +{name: "HOME", value: 0x1000}, +{name: "CAPTURE", value: 0x2000} +] + var scancodes = [ {name: "A", value: 0x04}, {name: "B", value: 0x05},